(()=>{var e,t,i,n={192(e,t,i){"use strict";i.d(t,{ZG:()=>n,ZS:()=>r,Kt:()=>B});class n{constructor(e,t){this.password=e,this.date=t}}class r{}var s=i(3204),o=i(69194),a=i(22327),l=i(21590),c=i(9764),d=i(16845);class u{constructor(e,t,i){this.credential=e,this.category=t,this.generationDate="number"==typeof i?new Date(i):i}static fromJSON(e){return new u(e.credential,e.category,e.generationDate)}toJSON(){return{credential:this.credential,category:this.category,generationDate:this.generationDate.valueOf()}}}var h=i(31857),A=i(4132);class p{constructor(e,t){this.disclosed=e,this.excluded=t}static allSecret(){const e=Object.freeze([]),t=Object.freeze([]);return new p(e,t)}disclose(e){const t=[...this.disclosed,e];return new p(Object.freeze(t),this.excluded)}exclude(e){const t=[...this.excluded,e];return new p(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 r of this.disclosed)i[r]=e[r];const n=Object.assign(i,t);for(const r of this.excluded)delete n[r];return n}}var g=i(89097),v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const f=g.l.array(h.qd,"localGeneratorHistory",p.allSecret(),{deserializer:u.fromJSON,clearOn:["logout"]}),m=new A.A(h.qd,"localGeneratorHistoryBuffer",{deserializer(e){const t=e;return null==t?void 0:t.map(e=>new n(e.password,e.date))},isValid(e){return v(this,void 0,void 0,function*(){return!!e.length})},map(e,t){return v(this,void 0,void 0,function*(){return(yield t.decrypt(e)).map(e=>new u(e.password,"password",e.date))})},clearOn:["logout"]});var y=i(72245),C=i(39306),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(e,t,i){this.userId=e,this.keyService=t,this.encryptService=i}decrypt(e){return w(this,void 0,void 0,function*(){const t=yield(0,y._)(this.keyService.userKey$(this.userId));if(null==t)throw new Error("No user key found for decryption");const i=(null!=e?e:[]).map(e=>w(this,void 0,void 0,function*(){const i=new C.k(e.password),r=yield this.encryptService.decryptString(i,t);return new n(r,e.date)}));return yield Promise.all(i)})}}var b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class B extends r{constructor(e,t,i,n={maxTotal:200}){super(),this.encryptService=e,this.keyService=t,this.stateProvider=i,this.options=n,this._credentialStates=new Map,this.track=(e,t,i,n)=>b(this,void 0,void 0,function*(){const r=this.getCredentialState(e);let s=null;return yield r.update(e=>{e=null!=e?e:[],s=new u(t,i,null!=n?n:Date.now()),e.unshift(s);const r=Math.max(0,this.options.maxTotal);return e.splice(r,1/0),e},{shouldUpdate:e=>{var i;return!(null!==(i=null==e?void 0:e.some(e=>e.credential===t))&&void 0!==i&&i)}}),s}),this.take=(e,t)=>b(this,void 0,void 0,function*(){const i=this.getCredentialState(e);let n,r=null;return yield i.update(e=>(e=null!=e?e:[],[r]=e.splice(n,1),e),{shouldUpdate:e=>{var i;return n=null!==(i=null==e?void 0:e.findIndex(e=>e.credential===t))&&void 0!==i?i:-1,n>=0}}),r}),this.clear=e=>b(this,void 0,void 0,function*(){var t;const i=this.getCredentialState(e);return null!==(t=yield i.update(()=>null))&&void 0!==t?t:[]}),this.credentials$=e=>this.getCredentialState(e).state$.pipe((0,s.T)(e=>null!=e?e:[]))}getCredentialState(e){let t=this._credentialStates.get(e);return t||(t=this.createSecretState(e),this._credentialStates.set(e,t)),t}createSecretState(e){const t=new c.n(2048),i=this.keyService.userKey$(e).pipe((0,s.T)(i=>i?new a.f(e,this.encryptService,i,t):null),(0,o.p)(e=>!!e)),n=d.m.from(e,f,this.stateProvider,i),r=new I(e,this.keyService,this.encryptService),u=this.keyService.userKey$(e).pipe((0,s.T)(e=>e&&r));return new l.d(this.stateProvider,m,n,u)}}},274(e,t,i){"use strict";i.d(t,{X:()=>n});const n=i(82392).JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 80 73.33">
  <path class="tw-fill-illustration-bg-primary" d="M11.667 31.666c0-5.523 3.805-10 8.5-10h39.666c4.695 0 8.5 4.477 8.5 10v31.667c0 5.523-3.805 10-8.5 10H20.167c-4.695 0-8.5-4.477-8.5-10V31.666Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.833 23.333H20.167c-3.912 0-7.084 3.73-7.084 8.333v31.667c0 4.602 3.172 8.333 7.084 8.333h39.666c3.912 0 7.084-3.73 7.084-8.333V31.666c0-4.602-3.172-8.333-7.084-8.333Zm-39.666-1.667c-4.695 0-8.5 4.477-8.5 10v31.667c0 5.523 3.805 10 8.5 10h39.666c4.695 0 8.5-4.477 8.5-10V31.666c0-5.523-3.805-10-8.5-10H20.167Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M55.833 22.5v-5.834C55.833 7.922 48.745.833 40 .833c-8.744 0-15.833 7.089-15.833 15.833V22.5h5v-5.834c0-5.983 4.85-10.833 10.833-10.833 5.983 0 10.833 4.85 10.833 10.833V22.5h5Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M23.333 16.667C23.333 7.462 30.795 0 40 0c9.205 0 16.667 7.462 16.667 16.667v6.666H50v-6.666c0-5.523-4.477-10-10-10s-10 4.477-10 10v6.666h-6.667v-6.666ZM40 1.667c-8.284 0-15 6.715-15 15v5h3.333v-5C28.333 10.223 33.557 5 40 5s11.667 5.223 11.667 11.667v5H55v-5c0-8.285-6.716-15-15-15Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M13.333 55.833h53.334V62.5H13.333v-6.667Z"/>
  <path class="tw-fill-illustration-bg-primary" d="M25 18.333h3.333v3.333H25v-3.333Zm26.667 0H55v3.333h-3.333v-3.333Z"/>
  <path class="tw-fill-illustration-tertiary" d="M0 47.5c0-5.523 4.477-10 10-10h60c5.523 0 10 4.477 10 10s-4.477 10-10 10H10c-5.523 0-10-4.477-10-10Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 39.167H10a8.333 8.333 0 1 0 0 16.666h60a8.333 8.333 0 1 0 0-16.666ZM10 37.5c-5.523 0-10 4.477-10 10s4.477 10 10 10h60c5.523 0 10-4.477 10-10s-4.477-10-10-10H10Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.667 42.5c.46 0 .833.389.833.868v3.48l3.117-1.658c.424-.225.942-.078 1.158.328.216.407.048.919-.375 1.144l-3.365 1.789 2.69 2.885c.327.35.32.89-.017 1.203-.337.314-.875.284-1.202-.067l-2.84-3.045-2.839 3.045c-.327.351-.865.38-1.201.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.423-.224-.591-.736-.375-1.143.216-.406.734-.553 1.157-.328l3.118 1.658v-3.48c0-.48.373-.868.833-.868ZM30 42.5c.46 0 .834.389.834.868v3.48l3.116-1.658c.424-.225.942-.078 1.158.328.216.407.048.919-.375 1.144l-3.365 1.789 2.69 2.885c.328.35.32.89-.017 1.203-.336.314-.874.284-1.201-.067L30 49.427l-2.84 3.045c-.326.351-.864.38-1.2.067-.338-.314-.345-.853-.018-1.203l2.69-2.885-3.365-1.79c-.423-.224-.591-.736-.375-1.143.216-.406.734-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.833-.868Zm14.167.868c0-.48-.373-.868-.834-.868-.46 0-.833.389-.833.868v3.48l-3.117-1.658c-.423-.225-.942-.078-1.158.328-.216.407-.048.919.376 1.144l3.364 1.789-2.69 2.885c-.327.35-.32.89.017 1.203.337.314.875.284 1.202-.067l2.84-3.045 2.839 3.045c.327.351.865.38 1.202.067.336-.314.344-.853.017-1.203l-2.69-2.885 3.364-1.79c.424-.224.592-.736.376-1.143-.216-.406-.735-.553-1.158-.328l-3.117 1.657v-3.479Zm6.666 8.299c0-.46.374-.834.834-.834h6.666a.833.833 0 0 1 0 1.667h-6.666a.833.833 0 0 1-.834-.833Zm10.834-.834a.833.833 0 0 0 0 1.667h6.666a.833.833 0 0 0 0-1.667h-6.666Z" clip-rule="evenodd"/>
</svg>
`},286(e,t,i){"use strict";i.d(t,{y:()=>be});var n=i(77468),r=i(33812),s=i(51757),o=i(66046),a=i(72737),l=i(16878),c=i(69194),d=i(80909),u=i(3204),h=i(72245),A=i(33338),p=i(36359),g=i(14803),v=i(34040),f=i(75811),m=i(8131),y=i(94735),C=i(56962),w=i(20136),I=i(92697),b=i(14318),B=i(27520),E=i(36288),S=i(25024),Q=i(88832),k=i(58950),T=i(75583),F=i(26411),P=i(8433),R=i(73638),D=i(192),M=i(8245),x=i(23979),O=i(44500),G=i(406),U=i(3633),V=i(80351),j=i(36801),N=i(74208),z=i(35500),Y=i(44432),L=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function K(e,t){if(1&e){const e=r.RV6();r.j41(0,"div",0)(1,"bit-callout",1),r.nI1(2,"i18n"),r.bIt("dismiss",function(){N.eBV(e);const t=r.XpG();return N.Njj(t.dismissGeneratorSpotlight(t.NudgeType.GeneratorNudgeStatus))}),r.j41(3,"p",2)(4,"span",3),r.EFF(5),r.nI1(6,"i18n"),r.k0s(),r.j41(7,"span",4),r.EFF(8),r.nI1(9,"i18n"),r.nrm(10,"i",5),r.EFF(11),r.nI1(12,"i18n"),r.k0s()()()()}2&e&&(r.R7$(),r.Y8G("title",r.bMT(2,5,"generatorNudgeTitle"))("icon",null),r.R7$(4),r.SpI(" ",r.bMT(6,7,"generatorNudgeBodyAria")," "),r.R7$(3),r.SpI(" ",r.bMT(9,9,"generatorNudgeBodyOne")," "),r.R7$(3),r.SpI(" ",r.bMT(12,11,"generatorNudgeBodyTwo")," "))}class X{constructor(e,t){this.nudgesService=e,this.accountService=t,this.NudgeType=G.mo,this.activeUserId$=this.accountService.activeAccount$.pipe(U.F6),this.showGeneratorSpotlight$=this.activeUserId$.pipe((0,O.n)(e=>this.nudgesService.showNudgeSpotlight$(G.mo.GeneratorNudgeStatus,e)))}dismissGeneratorSpotlight(e){return L(this,void 0,void 0,function*(){const t=yield(0,h._)(this.activeUserId$);yield this.nudgesService.dismissNudge(e,t)})}}X.ɵfac=function(e){return new(e||X)(r.rXU(G.u6),r.rXU(z.D))},X.ɵcmp=r.VBU({type:X,selectors:[["nudge-generator-spotlight"]],decls:2,vars:3,consts:[[1,"tw-mb-4"],[3,"dismiss","title","icon"],[1,"tw-text-main","tw-mb-0"],[1,"tw-sr-only"],["aria-hidden","true"],[1,"bwi","bwi-generate"]],template:function(e,t){1&e&&(r.nVh(0,K,13,13,"div",0),r.nI1(1,"async")),2&e&&r.vxM(r.bMT(1,1,t.showGeneratorSpotlight$)?0:-1)},dependencies:[V.j,Y.G,n.MD,T.E,j.$Z,n.Jj],encapsulation:2});var q=i(94615),H=i(63968),W=i(91261),$=i(58503),J=i(18030),Z=i(69855),_=i(50700),ee=i(60989),te=i(12694),ie=i(16496),ne=i(58806),re=i(86226),se=i(93199),oe=i(43759),ae=i(33886),le=i(25740),ce=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function de(e,t){if(1&e&&(r.j41(0,"bit-toggle",1),r.EFF(1),r.k0s()),2&e){const e=t.$implicit;r.Y8G("value",e.value),r.R7$(),r.SpI(" ",e.label," ")}}function ue(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-password-settings",9),r.bIt("onUpdated",function(){N.eBV(e);const t=r.XpG();return N.Njj(t.generate("password settings"))}),r.k0s()}if(2&e){r.XpG();const e=r.r8f(24);r.Y8G("account",e)}}function he(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-passphrase-settings",9),r.bIt("onUpdated",function(){N.eBV(e);const t=r.XpG();return N.Njj(t.generate("passphrase settings"))}),r.k0s()}if(2&e){r.XpG();const e=r.r8f(24);r.Y8G("account",e)}}function Ae(e,t){if(1&e&&(r.j41(0,"bit-hint"),r.EFF(1),r.nI1(2,"async"),r.k0s()),2&e){const e=r.XpG(2);r.R7$(),r.JRh(r.bMT(2,1,e.credentialTypeHint$))}}function pe(e,t){if(1&e&&(r.j41(0,"form",12)(1,"bit-form-field")(2,"bit-label"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.nrm(5,"bit-select",16),r.nI1(6,"async"),r.k0s()()),2&e){const e=r.XpG(2);r.Y8G("formGroup",e.forwarder),r.R7$(3),r.JRh(r.bMT(4,3,"service")),r.R7$(2),r.Y8G("items",r.bMT(6,5,e.forwarderOptions$))}}function ge(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-catchall-settings",17),r.bIt("onUpdated",function(){N.eBV(e);const t=r.XpG(2);return N.Njj(t.generate("catchall settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function ve(e,t){if(1&e&&r.nrm(0,"tools-forwarder-settings",15),2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)("forwarder",t)}}function fe(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-subaddress-settings",17),r.bIt("onUpdated",function(){N.eBV(e);const t=r.XpG(2);return N.Njj(t.generate("subaddress settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function me(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-username-settings",17),r.bIt("onUpdated",function(){N.eBV(e);const t=r.XpG(2);return N.Njj(t.generate("username settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function ye(e,t){if(1&e&&(r.j41(0,"bit-section")(1,"bit-section-header")(2,"h2",10),r.EFF(3),r.nI1(4,"i18n"),r.k0s()(),r.j41(5,"div",11)(6,"bit-card")(7,"form",12)(8,"bit-form-field")(9,"bit-label"),r.EFF(10),r.nI1(11,"i18n"),r.k0s(),r.nrm(12,"bit-select",13),r.nI1(13,"async"),r.nVh(14,Ae,3,3,"bit-hint"),r.nI1(15,"async"),r.k0s()(),r.nVh(16,pe,7,7,"form",12),r.nI1(17,"async"),r.nVh(18,ge,1,1,"tools-catchall-settings",14),r.nVh(19,ve,1,2,"tools-forwarder-settings",15),r.nI1(20,"async"),r.nVh(21,fe,1,1,"tools-subaddress-settings",14),r.nVh(22,me,1,1,"tools-username-settings",14),r.k0s()()()),2&e){let e;const t=r.XpG(),i=r.r8f(22);r.R7$(3),r.JRh(r.bMT(4,10,"options")),r.R7$(4),r.Y8G("formGroup",t.username),r.R7$(3),r.JRh(r.bMT(11,12,"type")),r.R7$(2),r.Y8G("items",r.bMT(13,14,t.usernameOptions$)),r.R7$(2),r.vxM(r.bMT(15,16,t.credentialTypeHint$)?14:-1),r.R7$(2),r.vxM(r.bMT(17,18,t.showForwarder$)?16:-1),r.R7$(2),r.vxM((null==i?null:i.id)===t.Algorithm.catchall?18:-1),r.R7$(),r.vxM((e=r.bMT(20,20,t.forwarderId$))?19:-1,e),r.R7$(2),r.vxM((null==i?null:i.id)===t.Algorithm.plusAddress?21:-1),r.R7$(),r.vxM((null==i?null:i.id)===t.Algorithm.username?22:-1)}}const Ce="identifier",we="forwarder",Ie="none";class be{constructor(e,t,i,n,s,h,A,p,g){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.logService=n,this.i18nService=s,this.accountService=h,this.zone=A,this.formBuilder=p,this.ariaLive=g,this.destroyed=new o.B,this.Algorithm=R.oG,this.account=null,this.debug=!1,this.log=(0,w.S2)({}),this.account$=new a.m(1),this.website=null,this.onGenerated=new r.bkB,this.root$=new l.t({nav:null}),this.username=this.formBuilder.group({nav:[null]}),this.forwarder=this.formBuilder.group({nav:[null]}),this.rootOptions$=new l.t([]),this.usernameOptions$=new l.t([]),this.forwarderOptions$=new l.t([]),this.forwarderId$=new l.t(null),this.showForwarder$=new l.t(!1),this.maybeAlgorithm$=new a.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,c.p)(e=>!!e)),this.showAlgorithm$=this.maybeAlgorithm$.pipe((0,d.v)(this.showForwarder$),(0,u.T)(([e,t])=>t?null:e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{copyCredential:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{generateCredential:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{credentialType:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeHint$=new a.m(1),this.category$=new a.m(1),this.generatedCredential$=new l.t(void 0),this.value$=this.generatedCredential$.pipe((0,u.T)(e=>{var t;return null!==(t=null==e?void 0:e.credential)&&void 0!==t?t:"-"})),this.USER_REQUEST="user request",this.generate$=new o.B}ngOnChanges(e){return ce(this,void 0,void 0,function*(){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))})}onRootChanged(e){this.root$.value.nav!==e.nav&&this.zone.run(()=>{this.root$.next(e)})}ngOnInit(){return ce(this,void 0,void 0,function*(){if(this.log=(0,w.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),!this.account){const e=yield(0,h._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}(0,A.z)([this.generatorService.algorithms$("email",{account$:this.account$}),this.generatorService.algorithms$("username",{account$:this.account$})]).pipe((0,u.T)(e=>e.flat()),(0,u.T)(e=>{const t=e.filter(e=>!(0,R.$S)(e.id));t.sort((e,t)=>e.weight-t.weight);const i=this.toOptions(t);i.splice(-1,0,{value:we,label:this.i18nService.t("forwardedEmail")});const n=e.filter(e=>(0,R.$S)(e.id));n.sort((e,t)=>e.weight-t.weight);const r=this.toOptions(n);return r.unshift({value:Ie,label:this.i18nService.t("select")}),[i,r]}),(0,p.M)(e=>this.log.debug({algorithms:e},"algorithms loaded")),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{this.zone.run(()=>{this.usernameOptions$.next(e),this.forwarderOptions$.next(t)})}),this.generatorService.algorithms$("password",{account$:this.account$}).pipe((0,u.T)(e=>{const t=this.toOptions(e);return t.push({value:Ce,label:this.i18nService.t("username")}),t}),(0,g.Q)(this.destroyed)).subscribe(this.rootOptions$),this.maybeAlgorithm$.pipe((0,u.T)(e=>{var t;return(null===(t=null==e?void 0:e.i18nKeys)||void 0===t?void 0:t.description)?(0,J.Tl)(e.i18nKeys.description,this.i18nService):""}),(0,g.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.credentialTypeHint$.next(e)})}),this.maybeAlgorithm$.pipe((0,u.T)(e=>null==e?void 0:e.type),(0,v.F)(),(0,g.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.category$.next(e)})}),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,f.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,m.E)(this.account$,this.maybeAlgorithm$),(0,g.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n,r;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null,algorithm:null!==(r=null==i?void 0:i.id)&&void 0!==r?r:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{i&&e.source===this.USER_REQUEST&&this.announce((0,J.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.generatedCredential$.next(e),this.onGenerated.next(e)})});const e=new o.B,t=new o.B,i=new o.B;this.root$.pipe((0,u.T)(e=>e.nav===Ce?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:Ce}),(0,g.Q)(this.destroyed)).subscribe(e),this.username.valueChanges.pipe((0,u.T)(e=>{if(e.nav===we)return{nav:e.nav};if(e.nav)return{nav:e.nav,algorithm:JSON.parse(e.nav)};{const[e]=R.I4[R.ZU.username];return{nav:JSON.stringify(e),algorithm:e}}}),(0,g.Q)(this.destroyed)).subscribe(t),this.forwarder.valueChanges.pipe((0,u.T)(e=>e.nav===Ie?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:Ie}),(0,g.Q)(this.destroyed)).subscribe(i),(0,A.z)([e,t,i]).pipe((0,u.T)(([e,t,i])=>{const n=!e.algorithm&&!t.algorithm;return[n,n&&i.algorithm&&(0,R.$S)(i.algorithm)?i.algorithm.forwarder:null]}),(0,v.F)((e,t)=>e[0]===t[0]&&e[1]===t[1]),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{this.log.debug({forwarderId:t,showForwarder:e},"forwarder visibility updated"),this.zone.run(()=>{this.showForwarder$.next(e),this.forwarderId$.next(t)})}),(0,A.z)([e,t,i]).pipe((0,u.T)(([e,t,i])=>{var n,r;const s=null!==(r=null!==(n=e.algorithm)&&void 0!==n?n:t.algorithm)&&void 0!==r?r:i.algorithm;return s?this.generatorService.algorithm(s):null}),(0,v.F)((e,t)=>null!==e&&null!==t&&(0,R.W0)(e.id,t.id)),(0,g.Q)(this.destroyed)).subscribe(e=>{var t;this.log.debug({algorithm:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},"algorithm selected"),this.zone.run(()=>{this.maybeAlgorithm$.next(e)})});const n=yield this.generatorService.preferences({account$:this.account$});this.algorithm$.pipe((0,m.E)(n),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{function i(i){const n=t[i];n.algorithm=e.id,n.updated=new Date}if((0,R.MP)(e.id))i("email");else if((0,R.yJ)(e.id))i("username");else{if(!(0,R.xu)(e.id))return;i("password")}this.log.info({algorithm:e.id,type:e.type},"algorithm preferences updated"),n.next(t)}),n.pipe((0,u.T)(({email:e,username:t,password:i})=>{const n=e.updated>t.updated?e:t,r=(0,R.$S)(n.algorithm)?n:null,s=r?JSON.stringify(r.algorithm):Ie,o=r?we:JSON.stringify(n.algorithm),a=n.updated>i.updated?Ce:JSON.stringify(i.algorithm);return{root:{selection:{nav:a},active:{nav:a,algorithm:a===Ce?void 0:i.algorithm}},username:{selection:{nav:o},active:{nav:o,algorithm:r?void 0:n.algorithm}},forwarder:{selection:{nav:s},active:{nav:s,algorithm:null==r?void 0:r.algorithm}}}}),(0,g.Q)(this.destroyed)).subscribe(({root:n,username:r,forwarder:s})=>{this.log.debug({root:n.selection,username:r.selection,forwarder:s.selection},"navigation updated"),this.onRootChanged(n.selection),this.username.setValue(r.selection,{emitEvent:!1}),this.forwarder.setValue(s.selection,{emitEvent:!1}),e.next(n.active),t.next(r.active),i.next(s.active)}),this.maybeAlgorithm$.pipe((0,g.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.generatedCredential$.next(void 0))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}generate(e){return ce(this,void 0,void 0,function*(){const t=yield(0,h._)(this.algorithm$),i={source:e,algorithm:t.id};this.website&&(i.website=this.website),this.log.debug(i,"generation requested"),this.generate$.next(i)})}toOptions(e){return e.map(e=>({value:JSON.stringify(e.id),label:(0,J.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.generate$.complete(),this.generatedCredential$.complete(),this.onGenerated.complete(),this.log.debug("component destroyed")}}be.ɵfac=function(e){return new(e||be)(r.rXU(R.iE),r.rXU(D.ZS),r.rXU(Z.f),r.rXU(C.K),r.rXU(_.W),r.rXU(z.D),r.rXU(r.SKi),r.rXU(s.ok),r.rXU(ee.Ai))},be.ɵcmp=r.VBU({type:be,selectors:[["tools-credential-generator"]],inputs:{account:"account",debug:"debug",website:"website"},outputs:{onGenerated:"onGenerated"},features:[r.OA$],decls:30,vars:42,consts:[["fullWidth","",1,"tw-mb-4",3,"selectedChange","selected"],[3,"value"],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center","tw-min-w-0"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","primaryGhost",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","primaryGhost","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[1,"tw-mt-6",3,"account"],[1,"tw-mt-6",3,"onUpdated","account"],["bitTypography","h6"],[1,"tw-mb-4"],[1,"tw-container",3,"formGroup"],["formControlName","nav","data-testid","username-type",3,"items"],[3,"account"],[3,"account","forwarder"],["formControlName","nav","data-testid","email-forwarding-service",3,"items"],[3,"onUpdated","account"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"bit-toggle-group",0),r.nI1(1,"async"),r.nI1(2,"i18n"),r.bIt("selectedChange",function(i){return N.eBV(e),N.Njj(t.onRootChanged({nav:i}))}),r.Z7z(3,de,2,2,"bit-toggle",1,r.fX1),r.nI1(5,"async"),r.k0s(),r.nrm(6,"nudge-generator-spotlight"),r.j41(7,"bit-card",2)(8,"div",3),r.nrm(9,"bit-color-password",4),r.nI1(10,"async"),r.k0s(),r.j41(11,"div",5)(12,"button",6),r.nI1(13,"async"),r.nI1(14,"async"),r.bIt("click",function(){return N.eBV(e),N.Njj(t.generate(t.USER_REQUEST))}),r.EFF(15),r.nI1(16,"async"),r.k0s(),r.nrm(17,"button",7),r.nI1(18,"async"),r.nI1(19,"async"),r.nI1(20,"async"),r.nI1(21,"async"),r.k0s()(),r.SS7(22),r.nI1(23,"async"),r.SS7(24),r.nI1(25,"async"),r.nVh(26,ue,1,1,"tools-password-settings",8)(27,he,1,1,"tools-passphrase-settings",8),r.nVh(28,ye,23,22,"bit-section"),r.nI1(29,"async")}if(2&e){let e;r.Y8G("selected",r.bMT(1,12,t.root$).nav),r.BMQ("aria-label",r.bMT(2,14,"type")),r.R7$(3),r.Dyx(r.bMT(5,16,t.rootOptions$)),r.R7$(6),r.Y8G("password",r.bMT(10,18,t.value$)),r.R7$(3),r.Y8G("label",r.bMT(13,20,t.credentialTypeGenerateLabel$))("disabled",!r.bMT(14,22,t.algorithm$)),r.R7$(3),r.SpI(" ",r.bMT(16,24,t.credentialTypeGenerateLabel$)," "),r.R7$(2),r.Y8G("label",r.bMT(18,26,t.credentialTypeCopyLabel$))("appCopyClick",r.bMT(19,28,t.value$))("valueLabel",r.bMT(20,30,t.credentialTypeLabel$))("disabled",!r.bMT(21,32,t.algorithm$)),r.R7$(5);const i=r.bH3(r.bMT(23,34,t.showAlgorithm$));r.R7$(2),r.bH3(r.bMT(25,37,t.account$)),r.R7$(2),r.vxM((e=null==i?null:i.id)===t.Algorithm.password?26:e===t.Algorithm.passphrase?27:-1),r.R7$(2),r.vxM("password"!==r.bMT(29,40,t.category$)?28:-1)}},dependencies:[I.E,te.H,ie.a,X,b.i,B.S,E.s,S.D,H.q,q.H,Q.n,k.U,T.E,ne.r,s.X1,s.qT,s.BC,s.cb,s.j4,s.JD,F.L,re.j,se.I,oe.h,P.p,ae.w,M.b,x.h,W.z,$.b,y.p,n.Jj,le.$],encapsulation:2})},304(e,t,i){"use strict";i.d(t,{l:()=>n});class n{}},347(e,t,i){"use strict";i.d(t,{h5:()=>x,Fx:()=>f,kg:()=>Y,AW:()=>v});var n=i(77468),r=i(94573),s=i(72245),o=i(274),a=i(48003),l=i(12058),c=i(81441),d=i(56962),u=i(83516),h=i(49272),A=i(44432),p=i(55807),g=i(36801);class v extends Error{constructor(){super("The current password is invalid.")}}class f{}var m=i(33812),y=i(74208),C=i(35500),w=i(50700),I=i(83541),b=i(1221),B=i(69855),E=i(66316),S=i(52717),Q=i(18499),k=i(23649),T=i(58384),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const P=()=>({key:"changeMasterPassword"});function R(e,t){1&e&&(m.nrm(0,"bit-icon",0),m.nI1(1,"i18n")),2&e&&m.Y8G("ariaLabel",m.bMT(1,1,"loading"))}function D(e,t){1&e&&(m.j41(0,"bit-callout",3),m.EFF(1),m.nI1(2,"i18n"),m.k0s()),2&e&&(m.R7$(),m.JRh(m.bMT(2,1,"changePasswordWarning")))}function M(e,t){if(1&e){const e=m.RV6();m.DNE(0,D,3,3,"bit-callout",1),m.j41(1,"auth-input-password",2),m.bIt("onPasswordFormSubmit",function(t){y.eBV(e);const i=m.XpG();return y.Njj(i.handlePasswordFormSubmit(t))})("onSecondaryButtonClick",function(){y.eBV(e);const t=m.XpG();return y.Njj(t.logOut())}),m.k0s()}if(2&e){const e=m.XpG();m.Y8G("ngIf",e.forceSetPasswordReason!==e.ForceSetPasswordReason.AdminForcePasswordReset),m.R7$(),m.Y8G("flow",e.inputPasswordFlow)("email",e.email)("userId",e.userId)("loading",e.submitting)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("inlineButtons",!0)("primaryButtonText",m.lJ4(9,P))("secondaryButtonText",e.secondaryButtonText())}}class x{constructor(e,t,i,n,s,o,l,d,u,h,A,p,g,v){this.accountService=e,this.changePasswordService=t,this.i18nService=i,this.masterPasswordService=n,this.anonLayoutWrapperDataService=s,this.organizationInviteService=o,this.messagingService=l,this.policyService=d,this.toastService=u,this.syncService=h,this.dialogService=A,this.logService=p,this.logoutService=g,this.router=v,this.inputPasswordFlow=a.m5.ChangePassword,this.passwordChanged=(0,r.CGW)(),this.activeAccount=null,this.initializing=!0,this.submitting=!1,this.forceSetPasswordReason=c.n.None,this.ForceSetPasswordReason=c.n}ngOnInit(){return F(this,void 0,void 0,function*(){if(this.activeAccount=yield(0,s._)(this.accountService.activeAccount$),!this.activeAccount)throw new Error("No active active account found while trying to change passwords.");if(this.userId=this.activeAccount.id,this.email=this.activeAccount.email,!this.userId)throw new Error("userId not found");this.masterPasswordPolicyOptions=yield(0,s._)(this.policyService.masterPasswordPolicyOptions$(this.userId)),this.forceSetPasswordReason=yield(0,s._)(this.masterPasswordService.forceSetPasswordReason$(this.userId)),this.forceSetPasswordReason===c.n.AdminForcePasswordReset?this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:o.X,pageTitle:{key:"updateMasterPassword"},pageSubtitle:{key:"accountRecoveryUpdateMasterPasswordSubtitle"}}):this.forceSetPasswordReason===c.n.WeakMasterPassword&&this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:o.X,pageTitle:{key:"updateMasterPassword"},pageSubtitle:{key:"updateMasterPasswordSubtitle"},maxWidth:"lg"}),this.initializing=!1})}logOut(){return F(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&(yield this.organizationInviteService.clearOrganizationInvitation(),this.changePasswordService.clearDeeplinkState&&(yield this.changePasswordService.clearDeeplinkState()),this.messagingService.send("logout"))})}handlePasswordFormSubmit(e){return F(this,void 0,void 0,function*(){var t,i;this.submitting=!0;try{if(e.rotateUserKey){if(null==this.activeAccount)throw new Error("activeAccount not found");if(e.newApisWithInputPasswordFlagEnabled)return yield this.changePasswordService.changePasswordAndRotateUserKey(e,this.activeAccount),void this.passwordChanged.emit();if(null==e.currentPassword||null==e.newPasswordHint)throw new Error("currentPassword or newPasswordHint not found");yield this.syncService.fullSync(!0),yield this.changePasswordService.rotateUserKeyMasterPasswordAndEncryptedData(e.currentPassword,e.newPassword,this.activeAccount,e.newPasswordHint),this.passwordChanged.emit()}else{if(!this.userId)throw new Error("userId not found");if(this.forceSetPasswordReason===c.n.AdminForcePasswordReset?yield this.changePasswordService.changePasswordForAccountRecovery(e,this.userId):yield this.changePasswordService.changePassword(e,this.userId),this.toastService.showToast({variant:"success",message:this.i18nService.t("masterPasswordChanged")}),this.passwordChanged.emit(),e.newApisWithInputPasswordFlagEnabled){yield this.logoutService.logout(this.userId);this.changePasswordService.shouldNavigateToRoot()&&(yield this.router.navigate(["/"]))}else this.messagingService.send("logout");null===(i=(t=this.changePasswordService).closeBrowserExtensionPopout)||void 0===i||i.call(t)}}catch(n){this.logService.error(n),n instanceof v?this.toastService.showToast({variant:"error",message:this.i18nService.t("invalidMasterPassword")}):this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}finally{this.submitting=!1}})}secondaryButtonText(){return this.forceSetPasswordReason===c.n.AdminForcePasswordReset||this.forceSetPasswordReason===c.n.WeakMasterPassword?{key:"logOut"}:void 0}}x.ɵfac=function(e){return new(e||x)(m.rXU(C.D),m.rXU(f),m.rXU(w.W),m.rXU(I.O),m.rXU(b.f),m.rXU(S.i),m.rXU(u.U),m.rXU(Q.m),m.rXU(B.f),m.rXU(h.H),m.rXU(E.o3),m.rXU(d.K),m.rXU(l.k4),m.rXU(k.Ix))},x.ɵcmp=m.VBU({type:x,selectors:[["auth-change-password"]],inputs:{inputPasswordFlow:"inputPasswordFlow"},outputs:{passwordChanged:"passwordChanged"},decls:2,vars:1,consts:[["name","bwi-spinner",1,"bwi-spin","bwi-2x","tw-text-muted",3,"ariaLabel"],["type","warning",4,"ngIf"],[3,"onPasswordFormSubmit","onSecondaryButtonClick","flow","email","userId","loading","masterPasswordPolicyOptions","inlineButtons","primaryButtonText","secondaryButtonText"],["type","warning"]],template:function(e,t){1&e&&m.nVh(0,R,2,3,"bit-icon",0)(1,M,2,10),2&e&&m.vxM(t.initializing?0:1)},dependencies:[A.G,n.MD,n.bT,p.o,T.R,a.tu,g.$Z],encapsulation:2});var O=i(22397),G=i(23965);class U extends G.W7{static newConstructorWithHint(e,t,i){const n=new U;return n.newMasterPasswordHash=e.masterPasswordAuthenticationHash,n.key=t.masterKeyWrappedUserKey,n.masterPasswordHint=i,n}}var V=i(33331),j=i(60512),N=i(85184),z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Y{constructor(e,t,i,n){this.keyService=e,this.masterPasswordApiService=t,this.masterPasswordService=i,this.masterPasswordUnlockService=n}changePasswordAndRotateUserKey(e,t){return z(this,void 0,void 0,function*(){throw new Error("changePasswordAndRotateUserKey() is only implemented in Web")})}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return z(this,void 0,void 0,function*(){throw new Error("rotateUserKeyMasterPasswordAndEncryptedData() is only implemented in Web")})}preparePasswordChange(e,t,i){return z(this,void 0,void 0,function*(){if(!t)throw new Error("userId not found");if(!(e.currentMasterKey&&e.currentServerMasterKeyHash&&e.newMasterKey&&e.newServerMasterKeyHash&&null!=e.newPasswordHint))throw new Error("invalid PasswordInputResult credentials, could not change password");const n=yield this.masterPasswordService.decryptUserKeyWithMasterKey(e.currentMasterKey,t);if(null==n)throw new Error("Could not decrypt user key");const r=yield this.keyService.encryptUserKeyWithMasterKey(e.newMasterKey,n);return i instanceof O.T?(i.masterPasswordHash=e.currentServerMasterKeyHash,i.newMasterPasswordHash=e.newServerMasterKeyHash,i.masterPasswordHint=e.newPasswordHint):i instanceof U&&(i.newMasterPasswordHash=e.newServerMasterKeyHash,i.masterPasswordHint=e.newPasswordHint),r})}changePassword(e,t){return z(this,void 0,void 0,function*(){if(e.newApisWithInputPasswordFlagEnabled){const i="Could not change password.";(0,V.B)(e.currentPassword,"currentPassword",i),(0,V.B)(e.newPassword,"newPassword",i),(0,j.x)(e.kdfConfig,"kdfConfig",i),(0,V.B)(e.salt,"salt",i),(0,j.x)(e.newPasswordHint,"newPasswordHint",i);if(!(yield this.masterPasswordUnlockService.proofOfDecryption(e.currentPassword,t)))throw new v;const n=yield(0,N.p)(this.keyService.userKey$(t),"userKey"),r=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e.currentPassword,e.kdfConfig,e.salt),{newAuthenticationData:s,newUnlockData:o}=yield this.makeNewAuthAndUnlockData(e.newPassword,e.kdfConfig,e.salt,n),a=O.T.newConstructor(r.masterPasswordAuthenticationHash,s,o,e.newPasswordHint);return void(yield this.masterPasswordApiService.postPassword(a))}const i=new O.T,n=yield this.preparePasswordChange(e,t,i);i.key=n[1].encryptedString;try{yield this.masterPasswordApiService.postPassword(i)}catch(r){throw new Error("Could not change password")}})}changePasswordForAccountRecovery(e,t){return z(this,void 0,void 0,function*(){if(e.newApisWithInputPasswordFlagEnabled){const i="Could not change password for account recovery.";(0,V.B)(e.currentPassword,"currentPassword",i),(0,V.B)(e.newPassword,"newPassword",i),(0,j.x)(e.kdfConfig,"kdfConfig",i),(0,V.B)(e.salt,"salt",i),(0,j.x)(e.newPasswordHint,"newPasswordHint",i);if(!(yield this.masterPasswordUnlockService.proofOfDecryption(e.currentPassword,t)))throw new v;const n=yield(0,N.p)(this.keyService.userKey$(t),"userKey"),{newAuthenticationData:r,newUnlockData:s}=yield this.makeNewAuthAndUnlockData(e.newPassword,e.kdfConfig,e.salt,n),o=U.newConstructorWithHint(r,s,e.newPasswordHint);return void(yield this.masterPasswordApiService.putUpdateTempPassword(o))}const i=new U,n=yield this.preparePasswordChange(e,t,i);i.key=n[1].encryptedString;try{yield this.masterPasswordApiService.putUpdateTempPassword(i)}catch(r){throw new Error("Could not change password")}})}makeNewAuthAndUnlockData(e,t,i,n){return z(this,void 0,void 0,function*(){return{newAuthenticationData:yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e,t,i),newUnlockData:yield this.masterPasswordService.makeMasterPasswordUnlockData(e,t,i,n)}})}shouldNavigateToRoot(){return!1}}},406(e,t,i){"use strict";i.d(t,{mo:()=>L,u6:()=>X,aX:()=>Z});var n=i(74208),r=i(3204),s=i(27442),o=i(33338),a=i(31857),l=i(84079),c=i(93695),d=i(75811),u=i(44500),h=i(11451),A=i(67553),p=i(18499),g=i(43978),v=i(84101),f=i(56962),m=i(8916),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e){this.stateProvider=e}getNudgeStatus$(e,t){return this.stateProvider.getUser(t,K).state$.pipe((0,r.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:{hasBadgeDismissed:!1,hasSpotlightDismissed:!1}}))}nudgeStatus$(e,t){return this.getNudgeStatus$(e,t)}setNudgeStatus(e,t,i){return y(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,K).update(i=>(null!=i||(i={}),i[e]=t,i))})}}C.ɵfac=function(e){return new(e||C)(n.KVO(a.v2))},C.ɵprov=n.jDH({token:C,factory:C.ɵfac,providedIn:"root"});var w=i(33812),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b extends C{constructor(){super(...arguments),this.vaultProfileService=(0,n.WQX)(h.r),this.logService=(0,n.WQX)(f.K),this.pinService=(0,n.WQX)(v.t),this.biometricStateService=(0,n.WQX)(m.vB),this.policyService=(0,n.WQX)(p.m),this.organizationService=(0,n.WQX)(A.PV)}nudgeStatus$(e,t){const i=(0,l.H)(this.vaultProfileService.getProfileCreationDate(t)).pipe((0,d.W)(()=>(this.logService.error("Failed to load profile date:"),(0,c.of)(new Date))));return(0,o.z)([i,this.getNudgeStatus$(e,t),(0,c.of)(Date.now()-2592e6),(0,l.H)(this.pinService.isPinSet(t)),this.biometricStateService.biometricUnlockEnabled$(t),this.organizationService.organizations$(t),this.policyService.policiesByType$(g.tt.RemoveUnlockWithPin,t)]).pipe((0,u.n)(i=>I(this,[i],void 0,function*([i,n,r,s,o,a,l]){const c=i.getTime()<r,d=a.some(e=>l.some(t=>t.type===g.tt.RemoveUnlockWithPin&&t.organizationId===e.id)),u=c||s||o||d,h={hasBadgeDismissed:n.hasBadgeDismissed||u,hasSpotlightDismissed:n.hasSpotlightDismissed||u};return(s||o||d)&&!n.hasSpotlightDismissed&&(yield this.setNudgeStatus(e,h,t)),h})))}}b.ɵfac=(()=>{let e;return function(t){return(e||(e=w.xGo(b)))(t||b)}})(),b.ɵprov=n.jDH({token:b,factory:b.ɵfac,providedIn:"root"});var B=i(52892);class E extends C{constructor(e,t){super(e),this.autoConfirmService=t}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.autoConfirmService.configuration$(t),this.autoConfirmService.canManageAutoConfirm$(t)]).pipe((0,r.T)(([e,t,i])=>{if(!i)return{hasBadgeDismissed:!0,hasSpotlightDismissed:!0};if(e.hasBadgeDismissed||e.hasSpotlightDismissed)return e;const n=!1===t.showBrowserNotification;return{hasBadgeDismissed:n,hasSpotlightDismissed:n}}))}}E.ɵfac=function(e){return new(e||E)(n.KVO(a.v2),n.KVO(B.zh))},E.ɵprov=n.jDH({token:E,factory:E.ɵfac});var S=i(35500),Q=i(5556),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T extends C{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(Q.p),this.accountService=(0,n.WQX)(S.D),this.logService=(0,n.WQX)(f.K)}nudgeStatus$(e,t){const i=this.accountService.activeAccount$.pipe((0,r.T)(e=>{var t;return null!==(t=null==e?void 0:e.creationDate)&&void 0!==t?t:new Date}),(0,d.W)(()=>(this.logService.error("Error getting profile creation date"),(0,c.of)(new Date))));return(0,o.z)([this.cipherService.cipherViews$(t),this.getNudgeStatus$(e,t),i,(0,c.of)(Date.now()-2592e6)]).pipe((0,u.n)(i=>k(this,[i],void 0,function*([i,n,r,s]){const o=r.getTime()<s,a=null==i?void 0:i.filter(e=>null==e.deletedDate);if(o&&a.length>0&&!n.hasSpotlightDismissed){const i={hasSpotlightDismissed:!0,hasBadgeDismissed:!0};return yield this.setNudgeStatus(e,i,t),yield this.setNudgeStatus(L.EmptyVaultNudge,i,t),i}return n.hasSpotlightDismissed?n:{hasBadgeDismissed:null==a||0===a.length,hasSpotlightDismissed:null==a||0===a.length}})))}}T.ɵfac=(()=>{let e;return function(t){return(e||(e=w.xGo(T)))(t||T)}})(),T.ɵprov=n.jDH({token:T,factory:T.ɵfac,providedIn:"root"});var F=i(23965);class P extends C{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(Q.p),this.organizationService=(0,n.WQX)(A.PV),this.collectionService=(0,n.WQX)(F.YD)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherListViews$(t),this.organizationService.organizations$(t),this.collectionService.decryptedCollections$(t)]).pipe((0,u.n)(([e,t,i,n])=>{const r=!(null==t||0===t.length);if(null==i||0===i.length)return e.hasBadgeDismissed||e.hasSpotlightDismissed?(0,c.of)(e):(0,c.of)({hasSpotlightDismissed:r,hasBadgeDismissed:r});const s=new Set(i.map(e=>e.id)),o=i.some(e=>e.canCreateNewCollections),a=n.some(e=>e.manage&&s.has(e.organizationId));return e.hasBadgeDismissed||e.hasSpotlightDismissed?(0,c.of)(e):a||o?(0,c.of)({hasSpotlightDismissed:r,hasBadgeDismissed:r}):(0,c.of)({hasSpotlightDismissed:!0,hasBadgeDismissed:!0})}))}}P.ɵfac=(()=>{let e;return function(t){return(e||(e=w.xGo(P)))(t||P)}})(),P.ɵprov=n.jDH({token:P,factory:P.ɵfac,providedIn:"root"});class R extends C{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(Q.p),this.organizationService=(0,n.WQX)(A.PV),this.collectionService=(0,n.WQX)(F.YD)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherViews$(t),this.organizationService.organizations$(t),this.collectionService.decryptedCollections$(t)]).pipe((0,u.n)(([e,t,i,n])=>{var r,s;const o=(null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0)>1,{hasBadgeDismissed:a,hasSpotlightDismissed:l}=e;if(0===(null!==(s=null==i?void 0:i.length)&&void 0!==s?s:0))return a||l?(0,c.of)(e):(0,c.of)({hasSpotlightDismissed:o,hasBadgeDismissed:o});const d=new Set(i.map(e=>e.id)),u=i.some(e=>e.canCreateNewCollections),h=n.some(e=>e.manage&&d.has(e.organizationId));return a||l?(0,c.of)(e):h||u?(0,c.of)({hasSpotlightDismissed:o,hasBadgeDismissed:o}):(0,c.of)({hasSpotlightDismissed:!0,hasBadgeDismissed:!0})}))}}R.ɵfac=(()=>{let e;return function(t){return(e||(e=w.xGo(R)))(t||R)}})(),R.ɵprov=n.jDH({token:R,factory:R.ɵfac,providedIn:"root"});var D=i(69194),M=i(31442),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class O extends C{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(Q.p)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherViews$(t).pipe((0,D.p)(e=>null!=e))]).pipe((0,u.n)(i=>x(this,[i],void 0,function*([i,n]){if(i.hasSpotlightDismissed)return i;let r;switch(e){case L.NewLoginItemStatus:r=M.gC.Login;break;case L.NewCardItemStatus:r=M.gC.Card;break;case L.NewIdentityItemStatus:r=M.gC.Identity;break;case L.NewNoteItemStatus:r=M.gC.SecureNote;break;case L.NewSshItemStatus:r=M.gC.SshKey}if(n.some(e=>e.type===r)&&!i.hasSpotlightDismissed){const i={hasSpotlightDismissed:!0,hasBadgeDismissed:!0};return yield this.setNudgeStatus(e,i,t),i}return i})))}}O.ɵfac=(()=>{let e;return function(t){return(e||(e=w.xGo(O)))(t||O)}})(),O.ɵprov=n.jDH({token:O,factory:O.ɵfac,providedIn:"root"});var G=i(21879);class U extends C{constructor(e,t,i){super(e),this.vaultProfileService=t,this.logService=i}nudgeStatus$(e,t){const i=(0,l.H)(this.vaultProfileService.getProfileCreationDate(t)).pipe((0,d.W)(()=>(this.logService.error("Error getting profile creation date"),(0,c.of)(new Date))));return(0,o.z)([i,this.getNudgeStatus$(e,t),(0,c.of)(Date.now()-2592e6)]).pipe((0,r.T)(([e,t,i])=>{const n=e.getTime()<i;return{hasBadgeDismissed:t.hasBadgeDismissed||n,hasSpotlightDismissed:t.hasSpotlightDismissed||n}}))}}U.ɵfac=function(e){return new(e||U)(n.KVO(G.v2),n.KVO(h.r),n.KVO(f.K))},U.ɵprov=n.jDH({token:U,factory:U.ɵfac,providedIn:"root"});var V=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class j{nudgeStatus$(e,t){return(0,c.of)({hasBadgeDismissed:!0,hasSpotlightDismissed:!0})}setNudgeStatus(e,t,i){return V(this,void 0,void 0,function*(){})}}j.ɵfac=function(e){return new(e||j)},j.ɵprov=n.jDH({token:j,factory:j.ɵfac,providedIn:"root"});const N=new n.nKC("AutofillNudgeService"),z=new n.nKC("AutoConfirmNudgeService");var Y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const L={EmptyVaultNudge:"empty-vault-nudge",VaultSettingsImportNudge:"vault-settings-import-nudge",HasVaultItems:"has-vault-items",AutofillNudge:"autofill-nudge",AccountSecurity:"account-security",DownloadBitwarden:"download-bitwarden",NewLoginItemStatus:"new-login-item-status",NewCardItemStatus:"new-card-item-status",NewIdentityItemStatus:"new-identity-item-status",NewNoteItemStatus:"new-note-item-status",NewSshItemStatus:"new-ssh-item-status",GeneratorNudgeStatus:"generator-nudge-status",AutoConfirmNudge:"auto-confirm-nudge",PremiumUpgrade:"premium-upgrade"},K=new a.Ok(a.bI,"vaultNudgeDismissed",{deserializer:e=>e,clearOn:[]});class X{constructor(){var e,t;this.newItemNudgeService=(0,n.WQX)(O),this.newAcctNudgeService=(0,n.WQX)(U),this.noOpNudgeService=(0,n.WQX)(j),this.autofillNudgeService=(0,n.WQX)(N,{optional:!0}),this.autoConfirmNudgeService=(0,n.WQX)(z,{optional:!0}),this.customNudgeServices={[L.HasVaultItems]:(0,n.WQX)(T),[L.EmptyVaultNudge]:(0,n.WQX)(P),[L.VaultSettingsImportNudge]:(0,n.WQX)(R),[L.AccountSecurity]:(0,n.WQX)(b),[L.AutofillNudge]:null!==(e=this.autofillNudgeService)&&void 0!==e?e:this.noOpNudgeService,[L.DownloadBitwarden]:this.newAcctNudgeService,[L.GeneratorNudgeStatus]:this.newAcctNudgeService,[L.NewLoginItemStatus]:this.newItemNudgeService,[L.NewCardItemStatus]:this.newItemNudgeService,[L.NewIdentityItemStatus]:this.newItemNudgeService,[L.NewNoteItemStatus]:this.newItemNudgeService,[L.NewSshItemStatus]:this.newItemNudgeService,[L.AutoConfirmNudge]:null!==(t=this.autoConfirmNudgeService)&&void 0!==t?t:this.noOpNudgeService},this.defaultNudgeService=(0,n.WQX)(C)}getNudgeService(e){var t;return null!==(t=this.customNudgeServices[e])&&void 0!==t?t:this.defaultNudgeService}showNudgeSpotlight$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t).pipe((0,r.T)(e=>!e.hasSpotlightDismissed))}showNudgeBadge$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t).pipe((0,r.T)(e=>!e.hasBadgeDismissed))}showNudgeStatus$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t)}dismissNudge(e,t){return Y(this,arguments,void 0,function*(e,t,i=!1){const n=i?{hasBadgeDismissed:!0,hasSpotlightDismissed:!1}:{hasBadgeDismissed:!0,hasSpotlightDismissed:!0};yield this.getNudgeService(e).setNudgeStatus(e,n,t)})}hasActiveBadges$(e){const t=[L.EmptyVaultNudge,L.DownloadBitwarden,L.AutofillNudge,L.AutoConfirmNudge].map(t=>this.getNudgeService(t).nudgeStatus$(t,e).pipe((0,r.T)(e=>!(null==e?void 0:e.hasBadgeDismissed)),(0,s.t)({refCount:!1,bufferSize:1})));return(0,o.z)(t).pipe((0,r.T)(e=>e.some(e=>!0===e)))}}X.ɵfac=function(e){return new(e||X)},X.ɵprov=n.jDH({token:X,factory:X.ɵfac,providedIn:"root"});var q=i(83731),H=i(3633),W=i(58329),$=i(82468),J=i(1601);class Z{constructor(){this.accountService=(0,n.WQX)(S.D),this.configService=(0,n.WQX)(J.w),this.billingAccountService=(0,n.WQX)(W.Q),this.cipherService=(0,n.WQX)(Q.p),this.activeUserId$=this.accountService.activeAccount$.pipe(H.F6),this.activeUserId=(0,q.ot)(this.activeUserId$,{requireSync:!0}),this.hasPremium$=this.activeUserId$.pipe((0,u.n)(e=>this.billingAccountService.hasPremiumFromAnySource$(e))),this.ciphers$=this.cipherService.ciphers$(this.activeUserId()),this.ciphers=(0,q.ot)(this.ciphers$,{initialValue:{}}),this.hasPremium=(0,q.ot)(this.hasPremium$,{initialValue:!0}),this.accountAgeFeatureFlag=(0,q.ot)(this.configService.getFeatureFlag$($.TO.PM32180PremiumUpsellAccountAge),{initialValue:7}),this.accountAgeInDays$=this.accountService.activeAccount$.pipe((0,r.T)(e=>{if(!e||!e.creationDate)return 0;const t=e.creationDate,i=Date.now()-t.getTime();return Math.floor(i/864e5)})),this.accountAgeInDays=(0,q.ot)(this.accountAgeInDays$,{initialValue:-1})}showUpsell(){const e=Object.keys(this.ciphers()).length;return this.accountAgeInDays()>=this.accountAgeFeatureFlag()&&e>=5&&!this.hasPremium()}}Z.ɵfac=function(e){return new(e||Z)},Z.ɵprov=n.jDH({token:Z,factory:Z.ɵfac,providedIn:"root"})},440(e,t,i){"use strict";i.d(t,{z:()=>A});var n=i(33812),r=(i(84488),i(90097)),s=i(25065),o=i(27760),a=i(74208),l=i(91326),c=i(57178),d=i(77468),u=i(25740);function h(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-banner",0),n.EFF(1),n.j41(2,"a",1),n.bIt("click",function(){a.eBV(e);const t=n.XpG();return a.Njj(t.clicked.emit())}),n.EFF(3),n.nI1(4,"i18n"),n.k0s()()}if(2&e){n.XpG();const e=n.r8f(0);n.Y8G("showClose",!1),n.R7$(),n.SpI(" ",e.message," "),n.R7$(2),n.SpI(" ",n.bMT(4,3,"clickHereToAddPaymentMethod")," ")}}class A{constructor(e){this.organizationWarningsService=e,this.includeOrganizationNameInMessaging=!1,this.clicked=new n.bkB}ngOnInit(){this.warning$=this.organizationWarningsService.getFreeTrialWarning$(this.organization,this.includeOrganizationNameInMessaging)}}A.ɵfac=function(e){return new(e||A)(n.rXU(o.S))},A.ɵcmp=n.VBU({type:A,selectors:[["app-organization-free-trial-warning"]],inputs:{organization:"organization",includeOrganizationNameInMessaging:"includeOrganizationNameInMessaging"},outputs:{clicked:"clicked"},decls:3,vars:4,consts:[["id","free-trial-banner","icon","bwi-billing","bannerType","premium",3,"showClose"],["bitLink","","linkType","secondary","rel","noreferrer noopener",1,"tw-cursor-pointer",3,"click"]],template:function(e,t){if(1&e&&(n.SS7(0),n.nI1(1,"async"),n.nVh(2,h,5,5,"bit-banner",0)),2&e){const e=n.bH3(n.bMT(1,1,t.warning$));n.R7$(2),n.vxM(e?2:-1)}},dependencies:[r.H,l.K,s.G,c.g,d.Jj,u.$],encapsulation:2})},639(e,t,i){"use strict";i.d(t,{E:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},685(e,t,i){"use strict";i.d(t,{XS:()=>m,Zc:()=>f});var n=i(3204),r=i(33338),s=i(93695),o=i(72245),a=i(44500),l=i(3633),c=i(43978),d=i(46217),u=i(38449),h=i(17989);class A extends h.A{constructor(){super(...arguments),this.autoEnrollEnabled=!1}}var p=i(31857);const g=p.Ok.record(p.jb,"policies",{deserializer:e=>e,clearOn:["logout"]});var v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const f=(0,n.T)(e=>{var t;return null!==(t=e.at(0))&&void 0!==t?t:void 0});class m{constructor(e,t,i){this.stateProvider=e,this.organizationService=t,this.accountService=i}policyState(e){return this.stateProvider.getUser(e,g)}policyData$(e){return this.policyState(e).state$.pipe((0,n.T)(e=>null!=e?e:{}))}policies$(e){return this.policyData$(e).pipe((0,n.T)(e=>{return t=e,Object.values(t||{}).map(e=>new u.P(e));var t}))}policiesByType$(e,t){if(!t)throw new Error("No userId provided");const i=this.policies$(t),s=this.organizationService.organizations$(t);return(0,r.z)([i,s]).pipe((0,n.T)(([e,t])=>this.enforcedPolicyFilter(e,t)),(0,n.T)(t=>t.filter(t=>t.type===e)))}policyAppliesToUser$(e,t){return this.policiesByType$(e,t).pipe(f,(0,n.T)(e=>!!e))}enforcedPolicyFilter(e,t){const i=Object.fromEntries(t.map(e=>[e.id,e]));return e.filter(t=>{const n=i[t.organizationId];return!n||t.enabled&&n.status>=c.Zx.Accepted&&n.usePolicies&&!this.isExemptFromPolicy(t.type,n,e)})}masterPasswordPolicyOptions$(e,t){return(t?(0,s.of)(t):this.policiesByType$(c.tt.MasterPassword,e)).pipe((0,n.T)(e=>{var t;let i;const n=null!==(t=e.filter(e=>e.type===c.tt.MasterPassword))&&void 0!==t?t:[];if(0!==n.length)return n.forEach(e=>{e.enabled&&e.data&&(i||(i=new d.U),null!=e.data.minComplexity&&e.data.minComplexity>i.minComplexity&&(i.minComplexity=e.data.minComplexity),null!=e.data.minLength&&e.data.minLength>i.minLength&&(i.minLength=e.data.minLength),e.data.requireUpper&&(i.requireUpper=!0),e.data.requireLower&&(i.requireLower=!0),e.data.requireNumbers&&(i.requireNumbers=!0),e.data.requireSpecial&&(i.requireSpecial=!0),e.data.enforceOnLogin&&(i.enforceOnLogin=!0))}),i}))}combinePoliciesIntoMasterPasswordPolicyOptions(e){var t;let i;const n=null!==(t=e.filter(e=>e.type===c.tt.MasterPassword))&&void 0!==t?t:[];if(0!==n.length)return n.forEach(e=>{e.enabled&&e.data&&(i||(i=new d.U),this.mergeMasterPasswordPolicyOptions(i,e.data))}),i}combineMasterPasswordPolicyOptions(...e){let t;return e.forEach(e=>{t||(t=new d.U),this.mergeMasterPasswordPolicyOptions(t,e)}),t}evaluateMasterPassword(e,t,i){return!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,r;const s=new A;if(!e||!t)return[s,!1];const o=e.find(e=>e.organizationId===t&&e.type===c.tt.ResetPassword&&e.enabled);return s.autoEnrollEnabled=null!==(n=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.autoEnrollEnabled)&&void 0!==n&&n,[s,null!==(r=null==o?void 0:o.enabled)&&void 0!==r&&r]}upsert(e,t){return v(this,void 0,void 0,function*(){yield this.policyState(t).update(t=>(null!=t||(t={}),t[e.id]=e,t))})}replace(e,t){return v(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(g,e,t)})}isExemptFromPolicy(e,t,i){switch(e){case c.tt.MaximumVaultTimeout:return t.isOwner;case c.tt.PasswordGenerator:case c.tt.FreeFamiliesSponsorshipPolicy:case c.tt.RestrictedItemTypes:case c.tt.RemoveUnlockWithPin:case c.tt.AutoConfirm:return!1;case c.tt.OrganizationDataOwnership:return t.isAdmin;case c.tt.SingleOrg:return!i.find(e=>e.organizationId===t.id&&e.type===c.tt.AutoConfirm&&e.enabled)&&t.canManagePolicies;default:return t.canManagePolicies}}mergeMasterPasswordPolicyOptions(e,t){var i,n;e||(e=new d.U),t&&(e.minComplexity=Math.max(e.minComplexity,null!==(i=t.minComplexity)&&void 0!==i?i:e.minComplexity),e.minLength=Math.max(e.minLength,null!==(n=t.minLength)&&void 0!==n?n:e.minLength),e.requireUpper=Boolean(e.requireUpper||t.requireUpper),e.requireLower=Boolean(e.requireLower||t.requireLower),e.requireNumbers=Boolean(e.requireNumbers||t.requireNumbers),e.requireSpecial=Boolean(e.requireSpecial||t.requireSpecial),e.enforceOnLogin=Boolean(e.enforceOnLogin||t.enforceOnLogin))}syncPolicy(e){return v(this,void 0,void 0,function*(){yield(0,o._)(this.accountService.activeAccount$.pipe(l.F6,(0,a.n)(t=>this.upsert(e,t))))})}}},1002(e,t,i){"use strict";i.d(t,{C:()=>s});var n=i(39306),r=i(20702);class s extends r.r{constructor(e){super(e);const t=this.getResponseProperty("EncryptedPrivateKey");t&&(this.encryptedPrivateKey=new n.k(t));const i=this.getResponseProperty("EncryptedUserKey");i&&(this.encryptedUserKey=new n.k(i)),this.credentialId=this.getResponseProperty("CredentialId"),this.transports=this.getResponseProperty("Transports")||[]}}},1036(e,t,i){"use strict";var n;i.d(t,{t:()=>n}),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.OrganizationDataOwnership=5]="OrganizationDataOwnership",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",e[e.AutomaticAppLogIn=12]="AutomaticAppLogIn",e[e.FreeFamiliesSponsorshipPolicy=13]="FreeFamiliesSponsorshipPolicy",e[e.RemoveUnlockWithPin=14]="RemoveUnlockWithPin",e[e.RestrictedItemTypes=15]="RestrictedItemTypes",e[e.UriMatchDefaults=16]="UriMatchDefaults",e[e.AutotypeDefaultSetting=17]="AutotypeDefaultSetting",e[e.AutoConfirm=18]="AutoConfirm",e[e.BlockClaimedDomainAccountCreation=19]="BlockClaimedDomainAccountCreation",e[e.SendControls=21]="SendControls"}(n||(n={}))},1086(e,t,i){"use strict";i.d(t,{B:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.publicKey=this.getResponseProperty("PublicKey"),this.requestDeviceType=this.getResponseProperty("RequestDeviceType"),this.requestDeviceTypeValue=this.getResponseProperty("RequestDeviceTypeValue"),this.requestDeviceIdentifier=this.getResponseProperty("RequestDeviceIdentifier"),this.requestIpAddress=this.getResponseProperty("RequestIpAddress"),this.requestCountryName=this.getResponseProperty("RequestCountryName"),this.key=this.getResponseProperty("Key"),this.creationDate=this.getResponseProperty("CreationDate"),this.requestApproved=this.getResponseProperty("RequestApproved"),this.responseDate=this.getResponseProperty("ResponseDate"),this.deviceId=this.getResponseProperty("RequestDeviceId");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()),r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds());this.isExpired=r-i>=9e5,this.isAnswered=null!=this.requestApproved&&null!=this.responseDate}}},1094(e,t,i){"use strict";i.d(t,{z:()=>n.z,h:()=>u});var n=i(440),r=(i(84488),i(90097)),s=i(25065),o=i(27760),a=i(33812),l=i(91326),c=i(77468);function d(e,t){if(1&e&&(a.j41(0,"bit-banner",0),a.EFF(1),a.k0s()),2&e){a.XpG();const e=a.r8f(0);a.Y8G("showClose",!1),a.R7$(),a.SpI(" ",e.message," ")}}class u{constructor(e){this.organizationWarningsService=e}ngOnInit(){this.warning$=this.organizationWarningsService.getResellerRenewalWarning$(this.organization)}}u.ɵfac=function(e){return new(e||u)(a.rXU(o.S))},u.ɵcmp=a.VBU({type:u,selectors:[["app-organization-reseller-renewal-warning"]],inputs:{organization:"organization"},decls:3,vars:4,consts:[["id","reseller-warning-banner","icon","bwi-billing","bannerType","info",3,"showClose"]],template:function(e,t){if(1&e&&(a.SS7(0),a.nI1(1,"async"),a.nVh(2,d,2,2,"bit-banner",0)),2&e){const e=a.bH3(a.bMT(1,1,t.warning$));a.R7$(2),a.vxM(e?2:-1)}},dependencies:[r.H,l.K,s.G,c.Jj],encapsulation:2})},1221(e,t,i){"use strict";i.d(t,{f:()=>n});class n{}},1576(e,t,i){"use strict";i.d(t,{m:()=>R});var n=i(77468),r=i(94573),s=i(33277),o=i(6056),a=i(36801),l=i(22191),c=i(26477),d=i(90647),u=i(88547),h=i(74208),A=i(33812),p=i(57178),g=i(36288),v=i(13496),f=i(53997),m=i(78952);function y(e,t){if(1&e&&(A.j41(0,"a",1),A.eu8(1,4),A.k0s()),2&e){const e=A.XpG().$implicit;A.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function C(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",5),A.bIt("click",function(t){h.eBV(e);const i=A.XpG().$implicit;return h.Njj(i.onClick(t))}),A.eu8(1,4),A.k0s()}if(2&e){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function w(e,t){1&e&&A.nrm(0,"i",3)}function I(e,t){if(1&e&&(A.nVh(0,y,2,4,"a",1)(1,C,2,1,"button",2),A.nVh(2,w,1,0,"i",3)),2&e){let e;const i=t.$implicit,n=t.$index,r=t.$count;A.vxM((e=i.route())?0:1,e),A.R7$(2),A.vxM(n!==r-1?2:-1)}}function b(e,t){1&e&&A.nrm(0,"i",3)}function B(e,t){if(1&e&&(A.j41(0,"a",7),A.eu8(1,4),A.k0s()),2&e){const e=A.XpG().$implicit;A.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function E(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",9),A.bIt("click",function(t){h.eBV(e);const i=A.XpG().$implicit;return h.Njj(i.onClick(t))}),A.eu8(1,4),A.k0s()}if(2&e){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function S(e,t){if(1&e&&A.nVh(0,B,2,4,"a",7)(1,E,2,1,"button",8),2&e){let e;const i=t.$implicit;A.vxM((e=i.route())?0:1,e)}}function Q(e,t){if(1&e&&(A.j41(0,"a",1),A.eu8(1,4),A.k0s()),2&e){const e=A.XpG().$implicit;A.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function k(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",5),A.bIt("click",function(t){h.eBV(e);const i=A.XpG().$implicit;return h.Njj(i.onClick(t))}),A.eu8(1,4),A.k0s()}if(2&e){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngTemplateOutlet",e.content())}}function T(e,t){1&e&&A.nrm(0,"i",3)}function F(e,t){if(1&e&&(A.nVh(0,Q,2,4,"a",1)(1,k,2,1,"button",2),A.nVh(2,T,1,0,"i",3)),2&e){let e;const i=t.$implicit,n=t.$index,r=t.$count;A.vxM((e=i.route())?0:1,e),A.R7$(2),A.vxM(n!==r-1?2:-1)}}function P(e,t){if(1&e&&(A.nVh(0,b,1,0,"i",3),A.nrm(1,"button",6),A.nI1(2,"i18n"),A.j41(3,"bit-menu",null,0),A.Z7z(5,S,2,1,null,null,A.fX1),A.k0s(),A.nrm(7,"i",3),A.Z7z(8,F,3,2,null,null,A.fX1)),2&e){const e=A.sdS(4),t=A.XpG();A.vxM(t.beforeOverflow().length>0?0:-1),A.R7$(),A.Y8G("bitMenuTriggerFor",e)("label",A.bMT(2,3,"moreBreadcrumbs")),A.R7$(4),A.Dyx(t.overflow()),A.R7$(3),A.Dyx(t.afterOverflow())}}class R{constructor(){this.show=(0,r.hFB)(3),this.breadcrumbs=(0,r.tEk)(u.D),this.hasOverflow=(0,s.EW)(()=>this.breadcrumbs().length>this.show()),this.beforeOverflow=(0,s.EW)(()=>{const e=this.breadcrumbs(),t=this.show();return e.length>t?e.slice(0,t-1):e}),this.overflow=(0,s.EW)(()=>this.breadcrumbs().slice(this.show()-1,-1)),this.afterOverflow=(0,s.EW)(()=>this.breadcrumbs().slice(-1))}}R.ɵfac=function(e){return new(e||R)},R.ɵcmp=A.VBU({type:R,selectors:[["bit-breadcrumbs"]],contentQueries:function(e,t,i){1&e&&A.C6U(i,t.breadcrumbs,u.D,4),2&e&&A.NyB()},inputs:{show:[1,"show"]},decls:3,vars:1,consts:[["overflowMenu",""],["bitLink","",1,"tw-my-2","tw-inline-block",3,"routerLink","queryParams","queryParamsHandling"],["type","button","bitLink","",1,"tw-my-2","tw-inline-block"],[1,"bwi","bwi-angle-right","tw-mx-1.5","tw-text-main"],[3,"ngTemplateOutlet"],["type","button","bitLink","",1,"tw-my-2","tw-inline-block",3,"click"],["type","button","bitIconButton","bwi-ellipsis-h","size","small",3,"bitMenuTriggerFor","label"],["bitMenuItem","",3,"routerLink","queryParams","queryParamsHandling"],["type","button","bitMenuItem",""],["type","button","bitMenuItem","",3,"click"]],template:function(e,t){1&e&&(A.Z7z(0,I,3,2,null,null,A.fX1),A.nVh(2,P,10,5)),2&e&&(A.Dyx(t.beforeOverflow()),A.R7$(2),A.vxM(t.hasOverflow()?2:-1))},dependencies:[n.MD,n.T3,c.V,p.g,o.iI,o.Wk,l.Q,g.s,d.M,v.Z,f.O,m.S,a.$Z],encapsulation:2,changeDetection:0})},1601(e,t,i){"use strict";i.d(t,{w:()=>n});class n{}},2003(e,t,i){"use strict";i.d(t,{vo:()=>u,Vj:()=>h,J_:()=>K,Xc:()=>z,db:()=>Y,xI:()=>U,ZS:()=>V,gc:()=>L});var n=i(94573),r=i(29029),s=i(14318),o=i(75583),a=i(36801),l=i(33812),c=i(56898),d=i(58806);const u={DownloadLicense:"download-license",CancelSubscription:"cancel-subscription"};class h{constructor(){this.downloadLicenseDisabled=(0,n.hFB)(!1),this.cancelSubscriptionDisabled=(0,n.hFB)(!1),this.callToActionClicked=(0,n.CGW)(),this.actions=u}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=l.VBU({type:h,selectors:[["billing-additional-options-card"]],inputs:{downloadLicenseDisabled:[1,"downloadLicenseDisabled"],cancelSubscriptionDisabled:[1,"cancelSubscriptionDisabled"]},outputs:{callToActionClicked:"callToActionClicked"},decls:14,vars:14,consts:[[1,"tw-size-full","tw-flex","tw-flex-col"],["bitTypography","h3",1,"tw-m-0","tw-mb-4"],["bitTypography","body1",1,"tw-m-0","tw-mb-4","tw-text-main"],[1,"tw-flex","tw-gap-4"],["bitButton","","buttonType","secondary","type","button",3,"click","disabled"],["bitButton","","buttonType","danger","type","button",3,"click","disabled"]],template:function(e,t){1&e&&(l.j41(0,"bit-card",0)(1,"h3",1),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"p",2),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.j41(7,"div",3)(8,"button",4),l.bIt("click",function(){return t.callToActionClicked.emit(t.actions.DownloadLicense)}),l.EFF(9),l.nI1(10,"i18n"),l.k0s(),l.j41(11,"button",5),l.bIt("click",function(){return t.callToActionClicked.emit(t.actions.CancelSubscription)}),l.EFF(12),l.nI1(13,"i18n"),l.k0s()()()),2&e&&(l.R7$(2),l.JRh(l.bMT(3,6,"additionalOptions")),l.R7$(3),l.SpI(" ",l.bMT(6,8,"additionalOptionsDesc")," "),l.R7$(3),l.Y8G("disabled",t.downloadLicenseDisabled()),l.R7$(),l.SpI(" ",l.bMT(10,10,"downloadLicense")," "),l.R7$(2),l.Y8G("disabled",t.cancelSubscriptionDisabled()),l.R7$(),l.SpI(" ",l.bMT(13,12,"cancelSubscription")," "))},dependencies:[r.t,c.Q,s.i,o.E,d.r,a.$Z],encapsulation:2,changeDetection:0});var A=i(77468),p=i(74208),g=i(33277),v=i(50700),f=i(639),m=i(80351),y=i(65731),C=i(47696),w=i(44432);const I=(e,t)=>t.action;function b(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",12),l.bIt("click",function(){const t=p.eBV(e).$implicit,i=l.XpG(3);return p.Njj(i.callToActionClicked.emit(t.action))}),l.EFF(1),l.k0s()}if(2&e){const e=t.$implicit;l.Y8G("buttonType",e.buttonType),l.R7$(),l.SpI(" ",e.text," ")}}function B(e,t){if(1&e&&(l.j41(0,"div",10),l.Z7z(1,b,2,2,"button",11,I),l.k0s()),2&e){const e=l.XpG();l.R7$(),l.Dyx(e.callsToAction)}}function E(e,t){if(1&e&&(l.j41(0,"bit-callout",7)(1,"div",8)(2,"p",9),l.EFF(3),l.k0s(),l.nVh(4,B,3,0,"div",10),l.k0s()()),2&e){const e=t;l.Y8G("type",e.type)("icon",e.icon)("title",e.title),l.R7$(3),l.JRh(e.description),l.R7$(),l.vxM(e.callsToAction?4:-1)}}function S(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(2);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWillBeSuspendedOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,e.suspension(),e.dateFormat))}}function Q(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(2);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWasSuspendedOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,e.suspension(),e.dateFormat))}}function k(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(3);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWillBeCanceledOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,t,e.dateFormat))}}function T(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"currency"),l.k0s(),l.EFF(5),l.nI1(6,"i18n"),l.j41(7,"span",14),l.EFF(8),l.nI1(9,"date"),l.k0s()),2&e){const e=l.XpG(2).total,t=l.XpG();l.SpI(" ",l.bMT(1,4,"yourNextChargeIsFor")," "),l.R7$(3),l.SpI("",l.brH(4,6,e,"USD","symbol")," USD"),l.R7$(2),l.SpI(" ",l.bMT(6,10,"dueOn")," "),l.R7$(3),l.JRh(l.i5U(9,12,t.nextCharge(),t.dateFormat))}}function F(e,t){if(1&e&&l.nVh(0,k,5,7)(1,T,10,15),2&e){let e;const t=l.XpG(2);l.vxM((e=t.cancelAt())?0:1,e)}}function P(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(3);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWillBeCanceledOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,t,e.dateFormat))}}function R(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"currency"),l.k0s(),l.EFF(5),l.nI1(6,"i18n"),l.j41(7,"span",14),l.EFF(8),l.nI1(9,"date"),l.k0s()),2&e){const e=l.XpG(2).total,t=l.XpG();l.SpI(" ",l.bMT(1,4,"yourNextChargeIsFor")," "),l.R7$(3),l.SpI("",l.brH(4,6,e,"USD","symbol")," USD"),l.R7$(2),l.SpI(" ",l.bMT(6,10,"dueOn")," "),l.R7$(3),l.JRh(l.i5U(9,12,t.nextCharge(),t.dateFormat))}}function D(e,t){if(1&e&&l.nVh(0,P,5,7)(1,R,10,15),2&e){let e;const t=l.XpG(2);l.vxM((e=t.cancelAt())?0:1,e)}}function M(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(2);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWillBeSuspendedOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,e.suspension(),e.dateFormat))}}function x(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(2);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWasCanceledOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,e.canceled(),e.dateFormat))}}function O(e,t){if(1&e&&(l.EFF(0),l.nI1(1,"i18n"),l.j41(2,"span",14),l.EFF(3),l.nI1(4,"date"),l.k0s()),2&e){const e=l.XpG(2);l.SpI(" ",l.bMT(1,2,"yourSubscriptionWasSuspendedOn")," "),l.R7$(3),l.JRh(l.i5U(4,4,e.suspension(),e.dateFormat))}}function G(e,t){if(1&e&&(l.j41(0,"h2",13),l.nVh(1,S,5,7)(2,Q,5,7)(3,F,2,1)(4,D,2,1)(5,M,5,7)(6,x,5,7)(7,O,5,7),l.k0s()),2&e){let e;const t=l.XpG().subscription().status;l.R7$(),l.vxM("incomplete"===(e=t)?1:"incomplete_expired"===e?2:"trialing"===e?3:"active"===e?4:"past_due"===e?5:"canceled"===e?6:"unpaid"===e?7:-1)}}const U={ContactSupport:"contact-support",ManageInvoices:"manage-invoices",ReinstateSubscription:"reinstate-subscription",Resubscribe:"resubscribe",UpdatePayment:"update-payment",UpgradePlan:"upgrade-plan"};class V{constructor(){this.datePipe=(0,p.WQX)(A.vh),this.i18nService=(0,p.WQX)(v.W),this.dateFormat="MMM. d, y",this.title=n.hFB.required(),this.subscription=n.hFB.required(),this.showUpgradeButton=(0,n.hFB)(!1),this.callToActionClicked=(0,n.CGW)(),this.badge=(0,g.EW)(()=>{const e=this.subscription(),t={text:this.i18nService.t("pendingCancellation"),variant:"warning"};switch(e.status){case L.Incomplete:return{text:this.i18nService.t("updatePayment"),variant:"warning"};case L.IncompleteExpired:return{text:this.i18nService.t("expired"),variant:"danger"};case L.Trialing:return e.cancelAt?t:{text:this.i18nService.t("trial"),variant:"success"};case L.Active:return e.cancelAt?t:{text:this.i18nService.t("active"),variant:"success"};case L.PastDue:return{text:this.i18nService.t("pastDue"),variant:"warning"};case L.Canceled:return{text:this.i18nService.t("canceled"),variant:"danger"};case L.Unpaid:return{text:this.i18nService.t("unpaid"),variant:"danger"}}}),this.callout=(0,g.EW)(()=>{const e=this.subscription();switch(e.status){case L.Incomplete:return{title:this.i18nService.t("updatePayment"),type:"warning",description:this.i18nService.t("weCouldNotProcessYourPayment"),callsToAction:[{text:this.i18nService.t("updatePayment"),buttonType:"unstyled",action:U.UpdatePayment},{text:this.i18nService.t("contactSupportShort"),buttonType:"unstyled",action:U.ContactSupport}]};case L.IncompleteExpired:return{title:this.i18nService.t("expired"),type:"danger",description:this.i18nService.t("yourSubscriptionIsExpired"),callsToAction:[{text:this.i18nService.t("resubscribe"),buttonType:"unstyled",action:U.Resubscribe}]};case L.Trialing:case L.Active:if(e.cancelAt){const t=this.datePipe.transform(e.cancelAt,this.dateFormat);return{title:this.i18nService.t("pendingCancellation"),type:"warning",description:this.i18nService.t("yourSubscriptionIsScheduledToCancel",t),callsToAction:[{text:this.i18nService.t("reinstateSubscription"),buttonType:"unstyled",action:U.ReinstateSubscription}]}}return this.showUpgradeButton()?{title:this.i18nService.t("upgradeYourPlan"),type:"info",icon:"bwi-diamond",description:this.i18nService.t("premiumShareEvenMore"),callsToAction:[{text:this.i18nService.t("upgradeNow"),buttonType:"unstyled",action:U.UpgradePlan}]}:null;case L.PastDue:{const t=this.datePipe.transform(e.suspension,this.dateFormat);return{title:this.i18nService.t("pastDue"),type:"warning",description:this.i18nService.t("youHaveAGracePeriod",e.gracePeriod,t),callsToAction:[{text:this.i18nService.t("manageInvoices"),buttonType:"unstyled",action:U.ManageInvoices}]}}case L.Canceled:return{title:this.i18nService.t("canceled"),type:"danger",description:this.i18nService.t("yourSubscriptionIsCanceled"),callsToAction:[{text:this.i18nService.t("resubscribe"),buttonType:"unstyled",action:U.Resubscribe}]};case L.Unpaid:return{title:this.i18nService.t("unpaid"),type:"danger",description:this.i18nService.t("toReactivateYourSubscription"),callsToAction:[{text:this.i18nService.t("manageInvoices"),buttonType:"unstyled",action:U.ManageInvoices}]}}}),this.cancelAt=(0,g.EW)(()=>{const e=this.subscription();if(e.status===L.Trialing||e.status===L.Active)return e.cancelAt}),this.canceled=(0,g.EW)(()=>{const e=this.subscription();if(e.status===L.Canceled)return e.canceled}),this.nextCharge=(0,g.EW)(()=>{const e=this.subscription();if(e.status===L.Trialing||e.status===L.Active)return e.nextCharge}),this.suspension=(0,g.EW)(()=>{const e=this.subscription();if(e.status===L.Incomplete||e.status===L.IncompleteExpired||e.status===L.PastDue||e.status===L.Unpaid)return e.suspension})}}V.ɵfac=function(e){return new(e||V)},V.ɵcmp=l.VBU({type:V,selectors:[["billing-subscription-card"]],inputs:{title:[1,"title"],subscription:[1,"subscription"],showUpgradeButton:[1,"showUpgradeButton"]},outputs:{callToActionClicked:"callToActionClicked"},decls:11,vars:6,consts:[["cartSummaryHeader",""],[1,"tw-size-full","tw-flex","tw-flex-col"],[1,"tw-flex","tw-items-center","tw-justify-between","tw-mb-4"],["bitTypography","h3",1,"tw-m-0"],["bitBadge","",1,"tw-ml-3",3,"variant"],[1,"tw-mb-4"],[3,"cart","header"],[3,"type","icon","title"],[1,"tw-flex","tw-flex-col","tw-gap-2"],[1,"tw-m-0"],[1,"tw-flex","tw-flex-row","tw-gap-2"],["bitButton","","type","button",3,"buttonType"],["bitButton","","type","button",3,"click","buttonType"],["bitTypography","h4","id","cart-summary-header-custom","data-test-id","cart-summary-header-custom",1,"!tw-m-0"],[1,"tw-font-bold"]],template:function(e,t){if(1&e&&(l.j41(0,"bit-card",1)(1,"div",2)(2,"h2",3),l.EFF(3),l.k0s(),l.j41(4,"span",4),l.EFF(5),l.k0s()(),l.j41(6,"div",5),l.nrm(7,"billing-cart-summary",6),l.k0s(),l.nVh(8,E,5,5,"bit-callout",7),l.k0s(),l.DNE(9,G,8,1,"ng-template",null,0,l.C5r)),2&e){let e;const i=l.sdS(10);l.R7$(3),l.JRh(t.title()),l.R7$(),l.Y8G("variant",t.badge().variant),l.R7$(),l.SpI(" ",t.badge().text," "),l.R7$(2),l.Y8G("cart",t.subscription().cart)("header",i),l.R7$(),l.vxM((e=t.callout())?8:-1,e)}},dependencies:[A.MD,f.E,C.n,r.t,c.Q,m.j,w.G,s.i,y.Oo,o.E,d.r,A.oe,A.vh,a.$Z],encapsulation:2,changeDetection:0});var j=i(83691),N=i(38140);const z={AddStorage:"add-storage",RemoveStorage:"remove-storage"};class Y{constructor(){this.i18nService=(0,p.WQX)(v.W),this.storage=n.hFB.required(),this.addStorageDisabled=(0,n.hFB)(!1),this.removeStorageDisabled=(0,n.hFB)(!1),this.callToActionClicked=(0,n.CGW)(),this.isEmpty=(0,g.EW)(()=>0===this.storage().used),this.isFull=(0,g.EW)(()=>{const e=this.storage();return e.used>=e.available}),this.percentageUsed=(0,g.EW)(()=>{const e=this.storage();return 0===e.available?0:Math.min(e.used/e.available*100,100)}),this.title=(0,g.EW)(()=>this.isFull()?this.i18nService.t("storageFull"):this.i18nService.t("storage")),this.description=(0,g.EW)(()=>{const e=this.storage(),t=e.available,i=e.readableUsed;return this.isFull()?this.i18nService.t("storageFullDescription",t.toString()):this.i18nService.t("storageUsedDescription",i,t.toString())}),this.progressBarColor=(0,g.EW)(()=>this.isFull()?"danger":"primary"),this.actions=z}}Y.ɵfac=function(e){return new(e||Y)},Y.ɵcmp=l.VBU({type:Y,selectors:[["billing-storage-card"]],inputs:{storage:[1,"storage"],addStorageDisabled:[1,"addStorageDisabled"],removeStorageDisabled:[1,"removeStorageDisabled"]},outputs:{callToActionClicked:"callToActionClicked"},decls:15,vars:13,consts:[[1,"tw-size-full","tw-flex","tw-flex-col"],[1,"tw-flex","tw-flex-col","tw-gap-3","tw-mb-4"],["bitTypography","h3",1,"tw-m-0"],["bitTypography","body1",1,"tw-m-0","tw-text-main"],[1,"tw-mb-4"],["size","small",3,"barWidth","bgColor","showText"],[1,"tw-flex","tw-gap-4"],["bitButton","","buttonType","secondary","type","button",3,"click","disabled"]],template:function(e,t){1&e&&(l.j41(0,"bit-card",0)(1,"div",1)(2,"h3",2),l.EFF(3),l.k0s(),l.j41(4,"p",3),l.EFF(5),l.k0s()(),l.j41(6,"div",4),l.nrm(7,"bit-progress",5),l.k0s(),l.j41(8,"div",6)(9,"button",7),l.bIt("click",function(){return t.callToActionClicked.emit(t.actions.AddStorage)}),l.EFF(10),l.nI1(11,"i18n"),l.k0s(),l.j41(12,"button",7),l.bIt("click",function(){return t.callToActionClicked.emit(t.actions.RemoveStorage)}),l.EFF(13),l.nI1(14,"i18n"),l.k0s()()()),2&e&&(l.R7$(3),l.JRh(t.title()),l.R7$(2),l.JRh(t.description()),l.R7$(2),l.Y8G("barWidth",t.percentageUsed())("bgColor",t.progressBarColor())("showText",!1),l.R7$(2),l.Y8G("disabled",t.addStorageDisabled()),l.R7$(),l.SpI(" ",l.bMT(11,9,"addStorage")," "),l.R7$(2),l.Y8G("disabled",t.removeStorageDisabled()),l.R7$(),l.SpI(" ",l.bMT(14,11,"removeStorage")," "))},dependencies:[A.MD,r.t,c.Q,s.i,j.E,N.X,o.E,d.r,a.$Z],encapsulation:2,changeDetection:0});const L={Incomplete:"incomplete",IncompleteExpired:"incomplete_expired",Trialing:"trialing",Active:"active",PastDue:"past_due",Canceled:"canceled",Unpaid:"unpaid"},K=100},2073(e,t,i){"use strict";i.d(t,{A5:()=>c,G$:()=>d,Hq:()=>y,Kk:()=>I,Pn:()=>g,U1:()=>A,Ug:()=>C,Vc:()=>h,Xk:()=>p,aZ:()=>n.aZ,dZ:()=>u,de:()=>f,e$:()=>l,eL:()=>v,jf:()=>r,ml:()=>a,mq:()=>m,oq:()=>w,qQ:()=>s,ye:()=>o});var n=i(36801);const r=new n.aZ("WINDOW"),s=new n.aZ("DOCUMENT"),o=new n.aZ("OBSERVABLE_MEMORY_STORAGE"),a=new n.aZ("OBSERVABLE_DISK_STORAGE"),l=new n.aZ("OBSERVABLE_DISK_LOCAL_STORAGE"),c=new n.aZ("MEMORY_STORAGE"),d=new n.aZ("SECURE_STORAGE"),u=new n.aZ("LOGOUT_CALLBACK"),h=new n.aZ("SUPPORTS_SECURE_STORAGE"),A=new n.aZ("LOCALES_DIRECTORY"),p=new n.aZ("SYSTEM_LANGUAGE"),g=new n.aZ("LOG_MAC_FAILURES"),v=new n.aZ("SYSTEM_THEME_OBSERVABLE"),f=new n.aZ("DEFAULT_VAULT_TIMEOUT"),m=new n.aZ("INTRAPROCESS_MESSAGING_SUBJECT"),y=new n.aZ("CLIENT_TYPE"),C=new n.aZ("REFRESH_ACCESS_TOKEN_ERROR_CALLBACK"),w=new n.aZ("ENV_ADDITIONAL_REGIONS"),I=new n.aZ("HTTP_OPERATIONS")},2096(e,t,i){"use strict";i.d(t,{n:()=>r});var n=i(33812);class r{transform(e,t,i){return`${e} ${1===e?t:i}`}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"pluralize",type:r,pure:!0})},2195(e,t,i){"use strict";i.d(t,{RZ:()=>k,GW:()=>Se,_K:()=>S,jN:()=>Te});var n=i(51757),r=i(66046),s=i(72245),o=i(3204),a=i(14803),l=i(36359),c=i(69194),d=i(44500),u=i(27442),h=i(93695),A=i(33338),p=i(14928),g=i(23965),v=i(67553),f=i(52237),m=i(3633),y=i(15639),C=i(78781);var w=i(81525),I=i(8433),b=i(16452),B=i(25065),E=i(81667);var S,Q,k,T=i(43184),F=i(45980),P=i(97434),R=i(33812),D=i(74208),M=i(94573),x=i(66316),O=i(69855),G=i(50700),U=i(35500),V=i(1601),j=i(77468),N=i(49519),z=i(3892),Y=i(26657),L=i(38620),K=i(56898),X=i(44432),q=i(68016),H=i(67311),W=i(86226),$=i(93199),J=i(97553),Z=i(43759),_=i(36288),ee=i(33886),te=i(68923),ie=i(88516),ne=i(49608),re=i(25740),se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function oe(e,t){if(1&e&&(R.j41(0,"span",12),R.EFF(1),R.k0s()),2&e){const e=R.XpG(2);R.R7$(),R.JRh(e.collection.name)}}function ae(e,t){if(1&e&&(R.qex(0),R.EFF(1),R.nI1(2,"i18n"),R.DNE(3,oe,2,1,"span",11),R.bVm()),2&e){const e=R.XpG();R.R7$(),R.SpI(" ",R.bMT(2,2,e.dialogReadonly?"viewCollection":"editCollection")," "),R.R7$(2),R.Y8G("ngIf",!e.loading)}}function le(e,t){1&e&&(R.qex(0),R.EFF(1),R.nI1(2,"i18n"),R.bVm()),2&e&&(R.R7$(),R.SpI(" ",R.bMT(2,1,"newCollection")," "))}function ce(e,t){1&e&&(R.qex(0,null,0),R.nrm(2,"i",13),R.bVm())}function de(e,t){if(1&e&&R.nrm(0,"bit-option",27),2&e){const e=t.$implicit;R.Y8G("value",e.id)("label",e.name)}}function ue(e,t){if(1&e&&(R.j41(0,"bit-form-field")(1,"bit-label"),R.EFF(2),R.nI1(3,"i18n"),R.k0s(),R.j41(4,"bit-select",25),R.DNE(5,de,1,2,"bit-option",26),R.nI1(6,"async"),R.k0s()()),2&e){const e=R.XpG(2);R.R7$(2),R.JRh(R.bMT(3,2,"organization")),R.R7$(3),R.Y8G("ngForOf",R.bMT(6,4,e.organizations$))}}function he(e,t){1&e&&(R.j41(0,"bit-form-field")(1,"bit-label"),R.EFF(2),R.nI1(3,"i18n"),R.k0s(),R.nrm(4,"input",28),R.j41(5,"bit-hint"),R.EFF(6),R.nI1(7,"i18n"),R.k0s()()),2&e&&(R.R7$(2),R.JRh(R.bMT(3,2,"externalId")),R.R7$(4),R.JRh(R.bMT(7,4,"externalIdDesc")))}function Ae(e,t){if(1&e&&(R.nrm(0,"bit-option",29),R.nI1(1,"i18n")),2&e){const e=R.XpG(2);R.Y8G("label",R.ai1("",e.deletedParentName," (",R.bMT(1,4,"deleted"),")"))("value",e.deletedParentName)}}function pe(e,t){if(1&e&&R.nrm(0,"bit-option",30),2&e){const e=t.$implicit;R.Y8G("value",e.name)("label",e.name)}}function ge(e,t){1&e&&(R.qex(0),R.j41(1,"span"),R.EFF(2),R.nI1(3,"i18n"),R.k0s(),R.bVm()),2&e&&(R.R7$(2),R.JRh(R.bMT(3,1,"readOnlyCollectionAccess")))}function ve(e,t){1&e&&(R.j41(0,"bit-callout",32),R.nI1(1,"i18n"),R.EFF(2),R.nI1(3,"i18n"),R.k0s()),2&e&&(R.Y8G("title",R.mNQ(R.bMT(1,3,"grantManageCollectionWarningTitle"))),R.R7$(2),R.SpI(" ",R.bMT(3,5,"grantManageCollectionWarning")," "))}function fe(e,t){1&e&&(R.j41(0,"span"),R.EFF(1),R.nI1(2,"i18n"),R.k0s()),2&e&&(R.R7$(),R.JRh(R.bMT(2,1,"grantCollectionAccess")))}function me(e,t){1&e&&(R.j41(0,"span"),R.EFF(1),R.nI1(2,"i18n"),R.k0s()),2&e&&(R.R7$(),R.JRh(R.bMT(2,1,"grantCollectionAccessMembersOnly")))}function ye(e,t){1&e&&(R.j41(0,"span"),R.EFF(1),R.nI1(2,"i18n"),R.k0s()),2&e&&(R.R7$(),R.SpI(" "," "+R.bMT(2,1,"adminCollectionAccess")," "))}function Ce(e,t){if(1&e&&(R.qex(0),R.DNE(1,ve,4,7,"bit-callout",31)(2,fe,3,3,"span",4)(3,me,3,3,"span",4)(4,ye,3,3,"span",4),R.bVm()),2&e){const e=R.XpG(2);R.R7$(),R.Y8G("ngIf",e.showAddAccessWarning),R.R7$(),R.Y8G("ngIf",e.organization.useGroups),R.R7$(),R.Y8G("ngIf",!e.organization.useGroups),R.R7$(),R.Y8G("ngIf",e.organization.allowAdminAccessToAllCollectionItems)}}function we(e,t){1&e&&(R.j41(0,"div",33),R.nrm(1,"i",34),R.EFF(2),R.nI1(3,"i18n"),R.k0s()),2&e&&(R.R7$(2),R.SpI(" ",R.bMT(3,1,"managePermissionRequired")," "))}function Ie(e,t){if(1&e&&(R.nrm(0,"bit-access-selector",35),R.nI1(1,"i18n"),R.nI1(2,"i18n"),R.nI1(3,"i18n"),R.nI1(4,"i18n")),2&e){const e=R.XpG(2);R.Y8G("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",R.bMT(1,7,"groupSlashMemberColumnHeader"))("selectorLabelText",R.bMT(2,9,"selectGroupsAndMembers"))("selectorHelpText",R.bMT(3,11,"userPermissionOverrideHelperDesc"))("emptySelectionText",R.bMT(4,13,"noMembersOrGroupsAdded"))("initialPermission",e.initialPermission)}}function be(e,t){if(1&e&&(R.nrm(0,"bit-access-selector",36),R.nI1(1,"i18n"),R.nI1(2,"i18n"),R.nI1(3,"i18n")),2&e){const e=R.XpG(2);R.Y8G("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",R.bMT(1,5,"memberColumnHeader"))("selectorLabelText",R.bMT(2,7,"selectMembers"))("emptySelectionText",R.bMT(3,9,"noMembersAdded"))}}function Be(e,t){if(1&e){const e=R.RV6();R.j41(0,"bit-tab-group",14),R.mxI("selectedIndexChange",function(t){D.eBV(e);const i=R.XpG();return R.DH7(i.tabIndex,t)||(i.tabIndex=t),D.Njj(t)}),R.j41(1,"bit-tab",15),R.nI1(2,"i18n"),R.j41(3,"bit-form-field")(4,"bit-label"),R.EFF(5),R.nI1(6,"i18n"),R.k0s(),R.nrm(7,"input",16),R.k0s(),R.DNE(8,ue,7,6,"bit-form-field",4)(9,he,8,6,"bit-form-field",4),R.j41(10,"bit-form-field")(11,"bit-label"),R.EFF(12),R.nI1(13,"i18n"),R.k0s(),R.j41(14,"bit-select",17),R.nrm(15,"bit-option",18),R.nI1(16,"i18n"),R.DNE(17,Ae,2,6,"bit-option",19)(18,pe,1,2,"bit-option",20),R.k0s()()(),R.j41(19,"bit-tab",15)(20,"div",21),R.DNE(21,ge,4,3,"ng-container",4)(22,Ce,5,4,"ng-container",4),R.k0s(),R.DNE(23,we,4,3,"div",22)(24,Ie,5,15,"bit-access-selector",23)(25,be,4,11,"bit-access-selector",24),R.k0s()()}if(2&e){const e=R.XpG();R.R50("selectedIndex",e.tabIndex),R.R7$(),R.Y8G("label",R.mNQ(R.bMT(2,17,"collectionInfo"))),R.R7$(4),R.JRh(R.bMT(6,19,"name")),R.R7$(3),R.Y8G("ngIf",e.showOrgSelector),R.R7$(),R.Y8G("ngIf",e.isExternalIdVisible),R.R7$(3),R.JRh(R.bMT(13,21,"nestCollectionUnder")),R.R7$(3),R.Y8G("value",void 0)("label",R.bMT(16,23,"noCollection")),R.R7$(2),R.Y8G("ngIf",e.deletedParentName),R.R7$(),R.Y8G("ngForOf",e.nestOptions),R.R7$(),R.Y8G("label",e.accessTabLabel),R.R7$(2),R.Y8G("ngIf",e.dialogReadonly),R.R7$(),R.Y8G("ngIf",!e.dialogReadonly),R.R7$(),R.Y8G("ngIf",e.formGroup.controls.access.hasError("managePermissionRequired")&&!e.showAddAccessWarning),R.R7$(),R.Y8G("ngIf",e.organization.useGroups),R.R7$(),R.Y8G("ngIf",!e.organization.useGroups)}}function Ee(e,t){if(1&e&&(R.nrm(0,"button",37),R.nI1(1,"i18n")),2&e){const e=R.XpG();R.Y8G("label",R.bMT(1,3,"delete"))("bitAction",e.delete)("disabled",e.loading)}}!function(e){e[e.Info=0]="Info",e[e.Access=1]="Access"}(S||(S={})),function(e){e.Upgrade="upgrade",e.Save="save"}(Q||(Q={})),function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted",e.Upgrade="upgrade"}(k||(k={}));class Se{constructor(e,t,i,o,a,l,c,d,u,h,A,p,g,v){var y,C,w;this.params=e,this.formBuilder=t,this.dialogRef=i,this.organizationService=o,this.groupService=a,this.collectionAdminService=l,this.i18nService=c,this.organizationUserApiService=d,this.dialogService=u,this.changeDetectorRef=h,this.accountService=A,this.toastService=p,this.collectionService=g,this.configService=v,this.destroy$=new r.B,this.loading=!0,this.nestOptions=[],this.accessItems=[],this.showOrgSelector=!1,this.formGroup=this.formBuilder.group({name:["",[n.k0.required,(w=["/"],e=>{if(!(e instanceof n.MJ))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(w.includes(i))return{forbiddenCharacters:{value:e.value,characters:w}};return null})]],externalId:{value:"",disabled:!0},parent:void 0,access:[[]],selectedOrg:""}),this.PermissionMode=T.Z,this.showDeleteButton=!1,this.showAddAccessWarning=!1,this.buttonDisplayName=Q.Save,this.submit=()=>se(this,void 0,void 0,function*(){var e,t;if(this.dialogReadonly)return;if(this.formGroup.markAllAsTouched(),this.buttonDisplayName==Q.Upgrade)return this.close(k.Upgrade),void this.changePlan(this.orgExceedingCollectionLimit);if(this.formGroup.invalid){const e=this.formGroup.controls.access.hasError("managePermissionRequired");return void(this.tabIndex!==S.Access||e?this.tabIndex===S.Info&&e&&this.toastService.showToast({variant:"error",message:this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("access"))}):this.toastService.showToast({variant:"error",message:this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("collectionInfo"))}))}if(this.editMode&&!(null===(e=this.collection)||void 0===e?void 0:e.canEditName(this.organization))&&this.formGroup.controls.name.dirty)throw new Error("Cannot change readonly field: Name");const i=null===(t=this.formGroup.controls.parent)||void 0===t?void 0:t.value,n=Object.assign(new f.nb({id:"",organizationId:"",name:""}),this.collection);n.name=i?`${i}/${this.formGroup.controls.name.value}`:this.formGroup.controls.name.value,n.id=this.params.collectionId,n.organizationId=this.formGroup.controls.selectedOrg.value,n.externalId=this.formGroup.controls.externalId.value,n.groups=this.formGroup.controls.access.value.filter(e=>e.type===F.Uv.Group).map(F.yo),n.users=this.formGroup.controls.access.value.filter(e=>e.type===F.Uv.Member).map(F.yo);const r=yield(0,s._)(this.accountService.activeAccount$.pipe(m.F6)),o=this.editMode?yield this.collectionAdminService.update(n,r):yield this.collectionAdminService.create(n,r);this.toastService.showToast({variant:"success",message:this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",n.name)}),this.close(k.Saved,o)}),this.delete=()=>se(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.toastService.showToast({variant:"success",message:this.i18nService.t("deletedCollectionId",null===(t=this.collection)||void 0===t?void 0:t.name)}),this.close(k.Deleted,this.collection)}),this.tabIndex=null!==(y=e.initialTab)&&void 0!==y?y:S.Info,this.initialPermission=null!==(C=e.initialPermission)&&void 0!==C?C:F.aF.View}ngOnInit(){return se(this,void 0,void 0,function*(){const e=yield(0,s._)(this.accountService.activeAccount$.pipe((0,o.T)(e=>null==e?void 0:e.id)));var t,i,r;this.params.showOrgSelector?(this.showOrgSelector=!0,this.formGroup.controls.selectedOrg.valueChanges.pipe((0,a.Q)(this.destroy$)).subscribe(e=>this.loadOrg(e)),this.organizations$=this.organizationService.organizations$(e).pipe((0,p.$)(),(0,o.T)(e=>e.filter(e=>e.canCreateNewCollections&&!e.isProviderUser).sort(C.A.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.organizationSelected.setAsyncValidators((t=this.organizations$,i=this.collectionService.encryptedCollections$(e).pipe((0,o.T)(e=>null!=e?e:[])),r=this.i18nService,e=>{if(!(e instanceof n.MJ))return(0,h.of)(null);const s=e.value;return s?(0,A.z)([t.pipe((0,y.Hc)(s)),i]).pipe((0,o.T)(([e,t])=>{if(!e)return null;const i=t.filter(t=>t.organizationId===e.id);return e.maxCollections===i.length?{cannotCreateCollections:{message:r.t("cannotCreateCollection")}}:null})):(0,h.of)(null)})),this.formGroup.updateValueAndValidity(),this.organizationSelected.valueChanges.pipe((0,l.M)(e=>{var t;(null===(t=this.organizationSelected.errors)||void 0===t?void 0:t.cannotCreateCollections)?this.buttonDisplayName=Q.Upgrade:this.buttonDisplayName=Q.Save}),(0,c.p)(()=>{var e;return null===(e=this.organizationSelected.errors)||void 0===e?void 0:e.cannotCreateCollections}),(0,d.n)(e=>this.organizations$.pipe((0,y.Hc)(e))),(0,a.Q)(this.destroy$)).subscribe(e=>{this.orgExceedingCollectionLimit=e,this.organizationSelected.markAsTouched(),this.formGroup.updateValueAndValidity()})})}loadOrg(e){return se(this,void 0,void 0,function*(){const t=yield(0,s._)((0,m.F6)(this.accountService.activeAccount$)),i=this.organizationService.organizations$(t).pipe((0,v.Sw)(e)).pipe((0,u.t)({refCount:!0,bufferSize:1})),n=i.pipe((0,d.n)(t=>t.useGroups?this.groupService.getAll(e):(0,h.of)([]))),r=this.accountService.activeAccount$.pipe(m.F6,(0,d.n)(t=>this.collectionAdminService.collectionAdminViews$(e,t)));(0,A.z)({organization:i,collections:r,groups:n,users:this.organizationUserApiService.getAllMiniUserDetails(e)}).pipe((0,a.Q)(this.formGroup.controls.selectedOrg.valueChanges),(0,a.Q)(this.destroy$)).subscribe(({organization:e,collections:t,groups:i,users:n})=>{var r,s;if(this.organization=e,this.params.collectionId&&(this.collection=t.find(e=>e.id===this.collectionId),!this.collection))throw new Error("Could not find collection to edit.");if(this.accessItems=[].concat(i.map(e=>function(e,t){return{id:e.id,type:F.Uv.Group,listName:e.name,labelName:e.name,readonly:!1,readonlyPermission:null!=t?(0,F.Jh)(t.groups.find(t=>t.id===e.id)):void 0}}(e,this.collection)),n.data.map(e=>ke(e,this.collection))),this.changeDetectorRef.detectChanges(),this.nestOptions=this.params.limitNestedCollections?t.filter(e=>e.manage):t,this.collection){this.nestOptions=this.nestOptions.filter(e=>e.id!==this.collectionId);const{name:i,parent:n}=function(e){var t;const i=null===(t=e.name)||void 0===t?void 0:t.split("/"),n=i[i.length-1],r=i.length>1?i.slice(0,-1).join("/"):void 0;return{name:n,parent:r}}(this.collection);void 0!==n&&(this.organization.canViewAllCollections&&!t.find(e=>e.name===n)?this.deletedParentName=n:this.nestOptions.find(e=>e.name===n)||this.nestOptions.unshift({name:n}));const r=function(e){if(null==e)return[];return[].concat(e.groups.map(e=>({id:e.id,type:F.Uv.Group,permission:(0,F.Jh)(e)})),e.users.map(e=>({id:e.id,type:F.Uv.Member,permission:(0,F.Jh)(e)})))}(this.collection);this.formGroup.patchValue({name:i,externalId:this.collection.externalId,parent:n,access:r}),this.showDeleteButton=!this.dialogReadonly&&this.collection.canDelete(e)}else{const e=this.nestOptions.find(e=>e.id===this.params.parentCollectionId),t=null===(r=n.data.find(e=>{var t;return e.userId===(null===(t=this.organization)||void 0===t?void 0:t.userId)}))||void 0===r?void 0:r.id,i=void 0!==t?[{id:t,type:F.Uv.Member,permission:F.aF.Manage}]:[];this.formGroup.patchValue({parent:null!==(s=null==e?void 0:e.name)&&void 0!==s?s:void 0,access:i})}e.allowAdminAccessToAllCollectionItems?this.formGroup.controls.access.removeValidators(Qe):this.formGroup.controls.access.addValidators(Qe),this.formGroup.controls.access.updateValueAndValidity(),this.handleFormGroupReadonly(this.dialogReadonly),this.loading=!1,this.showAddAccessWarning=this.handleAddAccessWarning()})})}get organizationSelected(){return this.formGroup.controls.selectedOrg}get isExternalIdVisible(){var e;return this.params.isAdminConsoleActive&&!!(null===(e=this.formGroup.get("externalId"))||void 0===e?void 0:e.value)}get collectionId(){return this.params.collectionId}get editMode(){return null!=this.params.collectionId}get dialogReadonly(){return!0===this.params.readonly}get accessTabLabel(){return this.dialogReadonly?this.i18nService.t("viewAccess"):this.i18nService.t("editAccess")}cancel(){return se(this,void 0,void 0,function*(){this.close(k.Canceled)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}changePlan(e){(0,b.IO)(this.dialogService,{data:{organizationId:e.id,subscription:null,productTierType:e.productTierType}})}handleAddAccessWarning(){var e;return!((null===(e=this.organization)||void 0===e?void 0:e.allowAdminAccessToAllCollectionItems)||!this.params.isAddAccessCollection)}handleFormGroupReadonly(e){if(e)return this.formGroup.controls.access.disable(),this.formGroup.controls.name.disable(),void this.formGroup.controls.parent.disable();if(this.formGroup.controls.access.enable(),!this.editMode)return this.formGroup.controls.name.enable(),void this.formGroup.controls.parent.enable();const t=this.collection.canEditName(this.organization);this.formGroup.controls.name[t?"enable":"disable"](),this.formGroup.controls.parent[t?"enable":"disable"]()}close(e,t){this.dialogRef.close({action:e,collection:t})}}function Qe(e){return e.value.some(e=>e.permission===F.aF.Manage)?null:{managePermissionRequired:!0}}function ke(e,t){var i,n;return{id:e.id,type:F.Uv.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,readonly:!1,readonlyPermission:null!=t?(0,F.Jh)(new f.sK(t.users.find(t=>t.id===e.id))):void 0}}function Te(e,t){return e.open(Se,t)}Se.ɵfac=function(e){return new(e||Se)(R.rXU(w.Qs),R.rXU(n.ok),R.rXU(x.ce),R.rXU(v.PV),R.rXU(E.nK),R.rXU(g.vE),R.rXU(G.W),R.rXU(g.uB),R.rXU(x.o3),R.rXU(M.gRc),R.rXU(U.D),R.rXU(O.f),R.rXU(g.YD),R.rXU(V.w))},Se.ɵcmp=R.VBU({type:Se,selectors:[["ng-component"]],decls:16,vars:16,consts:[["spinner",""],[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,"click","disabled"],["type","button","bitIconButton","bwi-trash","buttonType","dangerGhost","class","tw-ml-auto","bitFormButton","",3,"label","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"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin"],[3,"selectedIndexChange","selectedIndex"],[3,"label"],["bitInput","","appAutofocus","","formControlName","name"],["bitInput","","formControlName","parent"],[3,"value","label"],["disabled","","icon","bwi-collection-shared",3,"value","label",4,"ngIf"],["icon","bwi-collection-shared",3,"value","label",4,"ngFor","ngForOf"],[1,"tw-mb-3"],["class","tw-mb-3 tw-text-danger",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","initialPermission",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText",4,"ngIf"],["bitInput","","formControlName","selectedOrg"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-business",3,"value","label"],["bitInput","","formControlName","externalId"],["disabled","","icon","bwi-collection-shared",3,"value","label"],["icon","bwi-collection-shared",3,"value","label"],["type","warning",3,"title",4,"ngIf"],["type","warning",3,"title"],[1,"tw-mb-3","tw-text-danger"],[1,"bwi","bwi-error"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","initialPermission"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText"],["type","button","bitIconButton","bwi-trash","buttonType","dangerGhost","bitFormButton","",1,"tw-ml-auto",3,"label","bitAction","disabled"]],template:function(e,t){1&e&&(R.j41(0,"form",1)(1,"bit-dialog",2)(2,"span",3),R.DNE(3,ae,4,4,"ng-container",4)(4,le,3,3,"ng-container",4),R.k0s(),R.j41(5,"div",5),R.DNE(6,ce,3,0,"ng-container",4)(7,Be,26,25,"bit-tab-group",6),R.k0s(),R.qex(8,7),R.j41(9,"button",8),R.EFF(10),R.nI1(11,"i18n"),R.k0s(),R.j41(12,"button",9),R.bIt("click",function(){return t.cancel()}),R.EFF(13),R.nI1(14,"i18n"),R.k0s(),R.DNE(15,Ee,2,5,"button",10),R.bVm(),R.k0s()()),2&e&&(R.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),R.R7$(),R.Y8G("disablePadding",!t.loading),R.R7$(2),R.Y8G("ngIf",t.editMode),R.R7$(),R.Y8G("ngIf",!t.editMode),R.R7$(2),R.Y8G("ngIf",t.loading),R.R7$(),R.Y8G("ngIf",!t.loading),R.R7$(2),R.Y8G("disabled",t.loading||t.dialogReadonly),R.R7$(),R.SpI(" ",R.bMT(11,12,t.buttonDisplayName)," "),R.R7$(2),R.Y8G("disabled",t.loading),R.R7$(),R.SpI(" ",R.bMT(14,14,"cancel")," "),R.R7$(2),R.Y8G("ngIf",t.showDeleteButton))},dependencies:[B.G,j.Sq,j.bT,n.qT,n.me,n.BC,n.cb,n.j4,n.JD,N.B,z.p,Y.$,L.L,K.Q,X.G,q.m,H.hJ,W.j,$.I,J.J,Z.h,_.s,ee.w,te.P,ie.W,ne.j,P.m,T.t,I.p,j.Jj,re.$],encapsulation:2})},2334(e,t,i){"use strict";i.d(t,{vQ:()=>M,fc:()=>P});var n=i(66046),r=i(72737),s=i(34040),o=i(44500),a=i(3204),l=i(33338),c=i(93695),d=i(36359),u=i(81714),h=i(65023),A=i(3097),p=i(8029),g=i(72245),v=i(62329),f=i(84110),m=i(82468),y=i(97948);class C{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,this.push=null==e.push?{pushTechnology:y.v.SignalR}:{pushTechnology:e.push.pushTechnology,vapidPublicKey:e.push.vapidPublicKey},this.settings=e.settings,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 C(e)}}var w=i(29377),I=i(47523),b=i(39364);class B{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 S(e.server):null,this.utcDate=(new Date).toISOString(),this.environment=(null==e?void 0:e.environment)?new Q(e.environment):null,this.featureStates=null==e?void 0:e.featureStates,this.settings=new b.f(e.settings),this.push=(null==e?void 0:e.push)?new E(e.push):null}static fromJSON(e){return Object.assign(new B({}),e,{server:(null==e?void 0:e.server)?S.fromJSON(e.server):null,environment:(null==e?void 0:e.environment)?Q.fromJSON(e.environment):null})}}class E{constructor(e){this.pushTechnology=e.pushTechnology,this.vapidPublicKey=e.vapidPublicKey}static fromJSON(e){return Object.assign(new E({}),e)}}class S{constructor(e){this.name=e.name,this.url=e.url}static fromJSON(e){return Object.assign(new S({}),e)}}class Q{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 Q({}),e)}}var k=i(31857),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const F=(0,I.fE)("configRetrievalIntervalMs")?(0,I.dB)("configRetrievalIntervalMs"):36e5,P=new k.Ok(k.Z6,"serverConfig",{deserializer:e=>null==e?null:C.fromJSON(e),clearOn:["logout"]}),R=k.Zs.record(k.Z6,"byServer",{deserializer:e=>null==e?null:C.fromJSON(e)}),D=(e,t)=>e.getApiUrl()===t.getApiUrl();class M{constructor(e,t,i,g,v){this.configApiService=e,this.environmentService=t,this.logService=i,this.stateProvider=g,this.authService=v,this.failedFetchFallbackSubject=new n.B,this.serverCommunicationConfigSubject=new r.m(1),this.serverCommunicationConfig$=this.serverCommunicationConfigSubject.asObservable();const m=this.environmentService.globalEnvironment$.pipe((0,s.F)(D),(0,o.n)(e=>this.globalConfigFor$(e.getApiUrl()).pipe((0,a.T)(t=>[t,null,e,t]))));this.serverConfig$=this.stateProvider.activeUserId$.pipe((0,s.F)(),(0,o.n)(e=>null==e?m:this.authService.authStatusFor$(e).pipe((0,a.T)(e=>e===f.J.Unlocked),(0,s.F)(),(0,o.n)(t=>t?(0,l.z)([this.environmentService.getEnvironment$(e).pipe((0,s.F)(D)),this.userConfigFor$(e)]).pipe((0,o.n)(([t,i])=>null==i?this.globalConfigFor$(t.getApiUrl()).pipe((0,a.T)(i=>[null,e,t,i])):(0,c.of)([i,e,t,i]))):m))),(0,d.M)(e=>T(this,void 0,void 0,function*(){const[t,i,n,r]=e;t&&!this.olderThanRetrievalInterval(t.utcDate)||(yield this.renewConfig(t,i,n,r))})),(0,o.n)(([e])=>!e||this.olderThanRetrievalInterval(e.utcDate)?u.t:(0,c.of)(e)),(0,h.X)(this.failedFetchFallbackSubject),(0,A.u)({connector:()=>new r.m(1),resetOnRefCountZero:()=>(0,p.O)(1e3)})),this.cloudRegion$=this.serverConfig$.pipe((0,a.T)(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:w.T.US})),this.serverSettings$=this.serverConfig$.pipe((0,a.T)(e=>{var t;return null!==(t=null==e?void 0:e.settings)&&void 0!==t?t:new b.f}))}getFeatureFlag$(e){return this.serverConfig$.pipe((0,a.T)(t=>(0,m.Y6)(t,e)))}userCachedFeatureFlag$(e,t){return this.stateProvider.getUser(t,P).state$.pipe((0,a.T)(t=>(0,m.Y6)(t,e)))}getFeatureFlag(e){return T(this,void 0,void 0,function*(){return yield(0,g._)(this.getFeatureFlag$(e))})}checkServerMeetsVersionRequirement$(e){return this.serverConfig$.pipe((0,a.T)(t=>{if(null==t)return!1;return new v.SemVer(t.version).compare(e)>=0}))}ensureConfigFetched(){return T(this,void 0,void 0,function*(){yield(0,g._)(this.serverConfig$)})}olderThanRetrievalInterval(e){return(new Date).getTime()-e.getTime()>F}renewConfig(e,t,i,n){return T(this,void 0,void 0,function*(){var r,s,o;try{const a=setTimeout(()=>{this.logService.info("Environment did not respond in time, emitting previous config."),this.failedFetchFallbackSubject.next(n)},800),l=yield this.configApiService.get(t);clearTimeout(a);const c=new C(new B(l));this.parseBoostrapConfig(l),null!=(null===(r=null==c?void 0:c.environment)||void 0===r?void 0:r.cloudRegion)&&(null===(s=null==e?void 0:e.environment)||void 0===s?void 0:s.cloudRegion)!=c.environment.cloudRegion&&(yield this.environmentService.setCloudRegion(t,null===(o=null==c?void 0:c.environment)||void 0===o?void 0:o.cloudRegion)),null==t?yield this.stateProvider.getGlobal(R).update(e=>Object.assign(Object.assign({},e),{[i.getApiUrl()]:c})):yield this.stateProvider.setUserState(P,c,t)}catch(a){this.logService.error(`Unable to fetch ServerConfig from ${i.getApiUrl()}`,a),this.failedFetchFallbackSubject.next(n)}})}globalConfigFor$(e){return this.stateProvider.getGlobal(R).state$.pipe((0,a.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:null}))}userConfigFor$(e){return this.stateProvider.getUser(e,P).state$}parseBoostrapConfig(e){var t,i,n;const r=null!==(i=null===(t=e.communication)||void 0===t?void 0:t.bootstrap)&&void 0!==i?i:null,s=null===(n=e.environment)||void 0===n?void 0:n.vault,o="ssoCookieVendor"===(null==r?void 0:r.type)&&null!=s?{bootstrap:{type:"ssoCookieVendor",idpLoginUrl:r.idpLoginUrl,cookieName:r.cookieName,cookieDomain:r.cookieDomain,vaultUrl:s,cookieValue:void 0}}:{bootstrap:{type:"direct"}};this.serverCommunicationConfigSubject.next(o)}}},2471(e,t,i){"use strict";i.d(t,{B:()=>n});class n{}},2738(e,t,i){"use strict";var n;i.d(t,{s:()=>n}),function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Cli="cli"}(n||(n={}))},2922(e,t,i){"use strict";i.d(t,{k:()=>n});class n{}},3160(e,t,i){"use strict";i.d(t,{z:()=>n});class n{}},3633(e,t,i){"use strict";i.d(t,{F6:()=>w,bB:()=>I,xU:()=>f,xy:()=>b});var n=i(16878),r=i(33338),s=i(93695),o=i(80909),a=i(34040),l=i(69194),c=i(3204),d=i(27442),u=i(44500),h=i(22485),A=i(78781),p=i(31857),g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const v=p.Zs.record(p.ie,"accounts",{deserializer:e=>Object.assign(Object.assign({},e),{creationDate:e.creationDate?new Date(e.creationDate):void 0})}),f=new p.Zs(p.ie,"activeAccountId",{deserializer:e=>e}),m=p.Zs.record(p.ie,"activity",{deserializer:e=>new Date(e)}),y=new p.Ok(p.ie,"verifyNewDeviceLogin",{deserializer:e=>e,clearOn:["logout"]}),C={email:"",emailVerified:!1,name:void 0,creationDate:void 0},w=(0,c.T)(e=>{if(null==e)throw new Error("Null or undefined account");return e.id}),I=(0,c.T)(e=>{var t;return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null});class b{constructor(e,t,i,s){this.messagingService=e,this.logService=t,this.globalStateProvider=i,this.singleUserStateProvider=s,this._showHeader$=new n.t(!0),this.showHeader$=this._showHeader$.asObservable(),this.accountsState=this.globalStateProvider.get(v),this.activeAccountIdState=this.globalStateProvider.get(f),this.accounts$=this.accountsState.state$.pipe((0,c.T)(e=>null==e?{}:e)),this.activeAccount$=this.activeAccountIdState.state$.pipe((0,o.v)(this.accounts$),(0,c.T)(([e,t])=>e?Object.assign({id:e},t[e]):null),(0,a.F)((e,t)=>(null==e?void 0:e.id)===(null==t?void 0:t.id)&&this.accountInfoEqual(e,t)),(0,d.t)({bufferSize:1,refCount:!1})),this.accountActivity$=this.globalStateProvider.get(m).state$.pipe((0,c.T)(e=>null!=e?e:{})),this.sortedUserIds$=this.accountActivity$.pipe((0,c.T)(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,r.z)([this.accounts$,this.activeAccount$,this.sortedUserIds$]).pipe((0,c.T)(([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})),this.accountVerifyNewDeviceLogin$=this.activeAccountIdState.state$.pipe((0,u.n)(e=>this.singleUserStateProvider.get(e,y).state$))}addAccount(e,t){return g(this,void 0,void 0,function*(){if(!A.A.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 g(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{name:t})})}setAccountEmail(e,t){return g(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{email:t})})}setAccountEmailVerified(e,t){return g(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{emailVerified:t})})}setAccountCreationDate(e,t){return g(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{creationDate:t})})}clean(e){return g(this,void 0,void 0,function*(){yield this.setAccountInfo(e,C),yield this.removeAccountActivity(e)})}switchAccount(e){return g(this,void 0,void 0,function*(){let t=!1;yield this.activeAccountIdState.update((i,n)=>(t=!0,e),{combineLatestWith:this.accountsState.state$.pipe((0,l.p)(t=>null==e||null!=(null==t?void 0:t[e])),(0,h.w)({first:1e3,with:()=>(0,s.of)({})})),shouldUpdate:(t,i)=>{if(null!=e&&null==(null==i?void 0:i[e]))throw new Error("Account does not exist");return t!==e}}),t&&(yield this.setAccountActivity(e,new Date))})}setAccountActivity(e,t){return g(this,void 0,void 0,function*(){A.A.isGuid(e)&&(yield this.globalStateProvider.get(m).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())}}))})}setAccountVerifyNewDeviceLogin(e,t){return g(this,void 0,void 0,function*(){A.A.isGuid(e)&&(yield this.singleUserStateProvider.get(e,y).update(()=>t,{shouldUpdate:e=>e!==t}))})}removeAccountActivity(e){return g(this,void 0,void 0,function*(){yield this.globalStateProvider.get(m).update(t=>(null==t||delete t[e],t),{shouldUpdate:t=>null!=(null==t?void 0:t[e])})})}delete(){return g(this,void 0,void 0,function*(){var e;try{null===(e=this.messagingService)||void 0===e||e.send("logout")}catch(t){throw this.logService.error(t),t}})}setShowHeader(e){return g(this,void 0,void 0,function*(){this._showHeader$.next(e)})}accountInfoEqual(e,t){var i,n;return null==e&&null==t||null!=e&&null!=t&&(e.email===t.email&&e.emailVerified===t.emailVerified&&e.name===t.name&&(null===(i=e.creationDate)||void 0===i?void 0:i.getTime())===(null===(n=t.creationDate)||void 0===n?void 0:n.getTime()))}setAccountInfo(e,t){return g(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!this.accountInfoEqual(t[e],i(t[e]))}})})}}},3892(e,t,i){"use strict";i.d(t,{p:()=>g});var n=i(94573),r=i(74208),s=i(83731),o=i(16878),a=i(96070),l=i(36359),c=i(56962),d=i(26038),u=i(33812),h=i(53100),A=i(2471),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class g{get loading(){return this._loading$.value}set loading(e){this._loading$.next(e),this.buttonComponent.loading.set(e)}constructor(e,t,i){this.buttonComponent=e,this.validationService=t,this.logService=i,this._loading$=new o.t(!1),this.loading$=this._loading$.asObservable(),this.disabled=!1,this.handler=n.geq.required({alias:"bitAction"}),this.destroyRef=(0,r.WQX)(r.abz)}onClick(){return p(this,void 0,void 0,function*(){!this.handler()||this.loading||this.disabled||this.buttonComponent.disabled()||(this.loading=!0,(0,d.Z)(this.handler()).pipe((0,l.M)({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,a.j)(()=>this.loading=!1),(0,s.pQ)(this.destroyRef)).subscribe())})}}g.ɵfac=function(e){return new(e||g)(u.rXU(h.E),u.rXU(A.B,8),u.rXU(c.K,8))},g.ɵdir=u.FsC({type:g,selectors:[["","bitAction",""]],hostBindings:function(e,t){1&e&&u.bIt("click",function(){return t.onClick()})},inputs:{handler:[1,"bitAction","handler"]},outputs:{handler:"bitActionChange"}})},4017(e,t,i){"use strict";i.d(t,{D:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-item-action"]],hostAttrs:[1,"[&>button]:tw-relative","[&>button:not([bit-item-content])]:after:tw-content-['']","[&>button]:after:tw-absolute","[&>button]:after:tw-block","bit-compact:[&>button]:after:tw-top-[-0.7rem]","bit-compact:[&>button]:after:tw-bottom-[-0.7rem]","[&>button]:after:tw-top-[-0.8rem]","[&>button]:after:tw-bottom-[-0.80rem]","[&>button]:after:tw-right-0","[&>button]:after:tw-left-0"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},4132(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(31857);class r{constructor(e,t,i){this.stateDefinition=e,this.key=t,this.options=i}toKeyDefinition(){return new n.Ok(this.stateDefinition,this.key,this.options)}shouldOverwrite(e){var t;const i=null===(t=this.options)||void 0===t?void 0:t.shouldOverwrite;return i?i(e):!!e}map(e,t){var i;const n=null===(i=this.options)||void 0===i?void 0:i.map;return n?n(e,t):Promise.resolve(e)}isValid(e,t){var i;if(null===e)return Promise.resolve(!1);const n=null===(i=this.options)||void 0===i?void 0:i.isValid;return n?n(e,t):Promise.resolve(!!e)}}},4162(e,t,i){"use strict";i.d(t,{M:()=>z});var n=i(93161),r=i(77468),s=i(33812),o=i(66046),a=i(16878),l=i(72737),c=i(72245),d=i(75811),u=i(34040),h=i(69194),A=i(3204),p=i(14803),g=i(8131),v=i(94735),f=i(56962),m=i(20136),y=i(25024),C=i(92697),w=i(14318),I=i(27520),b=i(36288),B=i(73638),E=i(192),S=i(94615),Q=i(63968),k=i(18030),T=i(74208),F=i(69855),P=i(50700),R=i(35500),D=i(60989),M=i(12694),x=i(16496),O=i(25740),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function U(e,t){if(1&e&&(s.j41(0,"bit-toggle",9),s.EFF(1),s.k0s()),2&e){const e=t.$implicit;s.Y8G("value",e.value),s.R7$(),s.SpI(" ",e.label," ")}}function V(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-toggle-group",8),s.nI1(1,"async"),s.nI1(2,"i18n"),s.bIt("selectedChange",function(t){T.eBV(e);const i=s.XpG();return T.Njj(i.onCredentialTypeChanged(t))}),s.Z7z(3,U,2,2,"bit-toggle",9,s.fX1),s.nI1(5,"async"),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("selected",s.bMT(1,2,e.credentialType$)),s.BMQ("aria-label",s.bMT(2,4,"type")),s.R7$(3),s.Dyx(s.bMT(5,6,e.passwordOptions$))}}function j(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-password-settings",10),s.nI1(1,"async"),s.bIt("onUpdated",function(){T.eBV(e);const t=s.XpG();return T.Njj(t.generate("password settings"))}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("account",s.bMT(1,2,e.account$))("disableMargin",e.disableMargin)}}function N(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-passphrase-settings",10),s.nI1(1,"async"),s.bIt("onUpdated",function(){T.eBV(e);const t=s.XpG();return T.Njj(t.generate("passphrase settings"))}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("account",s.bMT(1,2,e.account$))("disableMargin",e.disableMargin)}}class z{constructor(e,t,i,n,r,c,d,u){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.i18nService=n,this.logService=r,this.accountService=c,this.zone=d,this.ariaLive=u,this.Algorithm=B.oG,this.account=null,this.account$=new l.m(1),this.debug=!1,this.log=(0,m.S2)({}),this.profile=B.WV.account,this.disableMargin=!1,this.credentialType$=new a.t(null),this.value$=new a.t(""),this.generate$=new o.B,this.USER_REQUEST="user request",this.onGenerated=new s.bkB,this.onAlgorithm=new s.bkB,this.passwordOptions$=new a.t([]),this.showCredentialTypes$=this.passwordOptions$.pipe((0,A.T)(e=>e.length>1)),this.maybeAlgorithm$=new l.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,h.p)(e=>!!e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,A.T)(({i18nKeys:{copyCredential:e}})=>(0,k.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,A.T)(({i18nKeys:{generateCredential:e}})=>(0,k.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,A.T)(({i18nKeys:{credentialType:e}})=>(0,k.Tl)(e,this.i18nService))),this.destroyed=new o.B}ngOnChanges(e){return G(this,void 0,void 0,function*(){var t,i;const n=null==e?void 0:e.account;n&&n.currentValue.id&&n.previousValue.id!==n.currentValue.id&&(this.log.debug({previousUserId:null===(t=null==n?void 0:n.previousValue)||void 0===t?void 0:t.id,currentUserId:null===(i=null==n?void 0:n.currentValue)||void 0===i?void 0:i.id},"account input change detected"),this.account$.next(n.currentValue.id))})}generate(e){return G(this,void 0,void 0,function*(){const t=yield(0,c._)(this.algorithm$),i={source:e,algorithm:t.id,profile:this.profile};this.log.debug(i,"generation requested"),this.generate$.next(i)})}onCredentialTypeChanged(e){this.credentialType$.value!==e&&this.zone.run(()=>{this.credentialType$.next(e)})}ngOnInit(){return G(this,void 0,void 0,function*(){if(this.log=(0,m.mJ)(this.debug,this.logService,{type:"PasswordGeneratorComponent"}),!this.account){const e=yield(0,c._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}this.generatorService.algorithms$("password",{account$:this.account$}).pipe((0,A.T)(e=>this.toOptions(e)),(0,p.Q)(this.destroyed)).subscribe(this.passwordOptions$),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,d.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,g.E)(this.account$,this.algorithm$),(0,p.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{e.source===this.USER_REQUEST&&this.announce((0,k.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.onGenerated.next(e),this.value$.next(e.credential)})});const e=yield this.generatorService.preferences({account$:this.account$});this.credentialType$.pipe((0,h.p)(e=>!!e),(0,g.E)(e),(0,p.Q)(this.destroyed)).subscribe(([t,i])=>{(0,B.xu)(t)&&(this.log.info({algorithm:t,type:B.ZU.password},"algorithm preferences updated"),i.password.algorithm=t,i.password.updated=new Date,e.next(i))}),e.pipe((0,A.T)(({password:e})=>this.generatorService.algorithm(e.algorithm)),(0,u.F)((e,t)=>null!==e&&null!==t&&(0,B.W0)(e.id,t.id)),(0,p.Q)(this.destroyed)).subscribe(e=>{this.log.debug({algorithm:e.id},"algorithm selected"),this.onCredentialTypeChanged(e.id),this.zone.run(()=>{this.maybeAlgorithm$.next(e),this.onAlgorithm.next((0,k.VI)(e,this.i18nService))})}),this.maybeAlgorithm$.pipe((0,p.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.value$.next("-"))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}toOptions(e){return e.map(e=>({value:e.id,label:(0,k.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.complete(),this.generate$.complete(),this.value$.complete(),this.onGenerated.complete()}}z.ɵfac=function(e){return new(e||z)(s.rXU(B.iE),s.rXU(E.ZS),s.rXU(F.f),s.rXU(P.W),s.rXU(f.K),s.rXU(R.D),s.rXU(s.SKi),s.rXU(D.Ai))},z.ɵcmp=s.VBU({type:z,selectors:[["tools-password-generator"]],inputs:{account:"account",debug:"debug",profile:"profile",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onGenerated:"onGenerated",onAlgorithm:"onAlgorithm"},features:[s.OA$],decls:21,vars:33,consts:[["fullWidth","",1,"tw-mb-4",3,"selected"],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center","tw-min-w-0"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","primaryGhost",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","primaryGhost","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[1,"tw-mt-6",3,"account","disableMargin"],["fullWidth","",1,"tw-mb-4",3,"selectedChange","selected"],[3,"value"],[1,"tw-mt-6",3,"onUpdated","account","disableMargin"]],template:function(e,t){if(1&e&&(s.nVh(0,V,6,8,"bit-toggle-group",0),s.nI1(1,"async"),s.j41(2,"bit-card",1)(3,"div",2),s.nrm(4,"bit-color-password",3),s.nI1(5,"async"),s.k0s(),s.j41(6,"div",4)(7,"button",5),s.nI1(8,"async"),s.nI1(9,"async"),s.bIt("click",function(){return t.generate(t.USER_REQUEST)}),s.EFF(10),s.nI1(11,"async"),s.k0s(),s.nrm(12,"button",6),s.nI1(13,"async"),s.nI1(14,"async"),s.nI1(15,"async"),s.nI1(16,"async"),s.k0s()(),s.nVh(17,j,2,4,"tools-password-settings",7),s.nI1(18,"async"),s.nVh(19,N,2,4,"tools-passphrase-settings",7),s.nI1(20,"async")),2&e){let e,i;s.vxM(s.bMT(1,11,t.showCredentialTypes$)?0:-1),s.R7$(4),s.Y8G("password",s.bMT(5,13,t.value$)),s.R7$(3),s.Y8G("label",s.bMT(8,15,t.credentialTypeGenerateLabel$))("disabled",!s.bMT(9,17,t.algorithm$)),s.R7$(3),s.SpI(" ",s.bMT(11,19,t.credentialTypeGenerateLabel$)," "),s.R7$(2),s.Y8G("label",s.bMT(13,21,t.credentialTypeCopyLabel$))("appCopyClick",s.bMT(14,23,t.value$))("valueLabel",s.bMT(15,25,t.credentialTypeLabel$))("disabled",!s.bMT(16,27,t.algorithm$)),s.R7$(5),s.vxM((null==(e=s.bMT(18,29,t.algorithm$))?null:e.id)===t.Algorithm.password?17:-1),s.R7$(2),s.vxM((null==(i=s.bMT(20,31,t.algorithm$))?null:i.id)===t.Algorithm.passphrase?19:-1)}},dependencies:[C.E,M.H,x.a,w.i,I.S,b.s,y.D,Q.q,S.H,v.p,r.Jj,O.$],encapsulation:2})},4532(e,t,i){"use strict";i.d(t,{d:()=>n});class n{}},4581(e,t,i){"use strict";i.d(t,{y:()=>U});var n=i(94573),r=i(24137),s=i(87916),o=i(33812),a=i(42503),l=i(3204),c=i(78867),d=i(77468),u=i(6056),h=i(74269),A=i(65067),p=i(74208),g=i(23649),v=i(72245),f=i(88565),m=i(12012),y=i(35500),C=i(37115),w=i(39488),I=i(66316),b=i(36801),B=i(27485),E=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class S{constructor(){this.dialogService=(0,p.WQX)(I.o3),this.accountService=(0,p.WQX)(y.D),this.syncService=(0,p.WQX)(w.H),this.apiService=(0,p.WQX)(m.G),this.router=(0,p.WQX)(g.Ix),this.platformUtilsService=(0,p.WQX)(C.y),this.upgrade=()=>E(this,void 0,void 0,function*(){this.platformUtilsService.isSelfHost()?yield this.navigateToSelfHostSubscriptionPage():yield this.openUpgradeDialog()})}navigateToSelfHostSubscriptionPage(){return E(this,void 0,void 0,function*(){yield this.router.navigate(["/settings/subscription/premium"])})}openUpgradeDialog(){return E(this,void 0,void 0,function*(){const e=yield(0,v._)(this.accountService.activeAccount$);if(!e)return;const t=B.gY.open(this.dialogService,{data:{account:e,planSelectionStepTitleOverride:"upgradeYourPlan",hideContinueWithoutUpgradingButton:!0}}),i=yield(0,f.s)(t.closed);if((null==i?void 0:i.status)===B.PD.UpgradedToPremium)yield this.syncService.fullSync(!0);else if((null==i?void 0:i.status)===B.PD.UpgradedToFamilies){const e=`/organizations/${i.organizationId}/vault`;yield this.router.navigate([e])}})}}S.ɵfac=function(e){return new(e||S)},S.ɵcmp=o.VBU({type:S,selectors:[["app-upgrade-nav-button"]],decls:6,vars:3,consts:[[1,"tw-px-2","tw-mt-3","tw-mb-2","tw-h-10"],[1,"tw-rounded-full","tw-bg-primary-100","tw-size-full"],["type","button",1,"tw-py-1.5","tw-px-4","tw-flex","tw-gap-2","tw-items-center","tw-size-full","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-0","focus:tw-outline-none","focus-visible:tw-outline-none","focus-visible:tw-ring-text-alt2","focus-visible:tw-z-10","tw-font-medium","tw-rounded-full","tw-transition","tw-border","tw-border-solid","tw-text-left","tw-bg-primary-100","tw-text-primary-600","tw-border-primary-600","hover:tw-bg-hover-default","hover:tw-text-primary-700","hover:tw-border-primary-700",3,"click"],["aria-hidden","true",1,"bwi","bwi-premium"]],template:function(e,t){1&e&&(o.rj2(0,"div",0)(1,"div",1)(2,"button",2),o.VwU("click",function(){return t.upgrade()}),o.Hgh(3,"i",3),o.EFF(4),o.nI1(5,"i18n"),o.eux()()()),2&e&&(o.R7$(4),o.SpI(" ",o.bMT(5,1,"upgradeYourPlan")," "))},dependencies:[b.$Z],encapsulation:2});var Q=i(25740);function k(e,t){if(1&e&&o.nrm(0,"bit-nav-item",2),2&e){const e=t.$implicit;o.Y8G("icon",e.icon)("text",e.name)("route",e.appRoute)("forceActiveStyles",e.isActive),o.BMQ("icon",e.icon)}}function T(e,t){if(1&e&&(o.nrm(0,"bit-nav-divider"),o.DNE(1,k,1,5,"bit-nav-item",1)),2&e){o.XpG();const e=o.r8f(0);o.R7$(),o.Y8G("ngForOf",e)}}function F(e,t){1&e&&o.nrm(0,"app-upgrade-nav-button")}function P(e,t){if(1&e&&(o.j41(0,"div",10),o.EFF(1),o.k0s()),2&e){const e=o.XpG(2).$implicit;o.R7$(),o.SpI(" ",e.otherProductOverrides.supportingText," ")}}function R(e,t){var i;if(1&e&&(o.j41(0,"a",8),o.nrm(1,"i"),o.j41(2,"div"),o.EFF(3),o.DNE(4,P,2,1,"div",9),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("href",e.marketingRoute.route,o.B4B),o.R7$(),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-mt-1 tw-mx-1")),o.R7$(2),o.SpI(" ",null!==(i=null==e.otherProductOverrides?null:e.otherProductOverrides.name)&&void 0!==i?i:e.name," "),o.R7$(),o.Y8G("ngIf",null==e.otherProductOverrides?null:e.otherProductOverrides.supportingText)}}function D(e,t){if(1&e&&(o.j41(0,"div",10),o.EFF(1),o.k0s()),2&e){const e=o.XpG(2).$implicit;o.R7$(),o.SpI(" ",e.otherProductOverrides.supportingText," ")}}function M(e,t){var i;if(1&e&&(o.j41(0,"a",11),o.nrm(1,"i"),o.j41(2,"div"),o.EFF(3),o.DNE(4,D,2,1,"div",9),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("routerLink",e.marketingRoute.route),o.R7$(),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-mt-1 tw-mx-1")),o.R7$(2),o.SpI(" ",null!==(i=null==e.otherProductOverrides?null:e.otherProductOverrides.name)&&void 0!==i?i:e.name," "),o.R7$(),o.Y8G("ngIf",null==e.otherProductOverrides?null:e.otherProductOverrides.supportingText)}}function x(e,t){if(1&e&&(o.qex(0),o.j41(1,"div",5),o.DNE(2,R,5,6,"a",6)(3,M,5,6,"a",7),o.k0s(),o.bVm()),2&e){const e=t.$implicit;o.R7$(2),o.Y8G("ngIf",e.marketingRoute.external),o.R7$(),o.Y8G("ngIf",!e.marketingRoute.external)}}function O(e,t){if(1&e&&(o.j41(0,"section",0)(1,"span",3),o.EFF(2),o.nI1(3,"i18n"),o.k0s(),o.DNE(4,x,4,2,"ng-container",4),o.k0s()),2&e){o.XpG();const e=o.r8f(5);o.R7$(2),o.JRh(o.bMT(3,2,"moreFromBitwarden")),o.R7$(2),o.Y8G("ngForOf",e)}}class G{constructor(e){this.productSwitcherService=e,this.shouldShowPremiumUpgradeButton$=this.productSwitcherService.shouldShowPremiumUpgradeButton$,this.accessibleProducts$=this.productSwitcherService.products$.pipe((0,l.T)(e=>{var t;return null!==(t=e.bento)&&void 0!==t?t:[]})),this.moreProducts$=this.productSwitcherService.products$.pipe((0,l.T)(e=>{var t;return null!==(t=e.other)&&void 0!==t?t:[]}),(0,l.T)(e=>e.sort(e=>"Organizations"===e.name?-1:1)))}}G.ɵfac=function(e){return new(e||G)(o.rXU(c.Y))},G.ɵcmp=o.VBU({type:G,selectors:[["navigation-product-switcher"]],standalone:!1,decls:8,vars:11,consts:[[1,"tw-mt-2","tw-flex","tw-w-full","tw-flex-col","tw-gap-2","tw-border-0"],["focusAfterNavTarget","body",3,"icon","text","route","forceActiveStyles",4,"ngFor","ngForOf"],["focusAfterNavTarget","body",3,"icon","text","route","forceActiveStyles"],[1,"tw-text-xs","!tw-text-alt2","tw-p-2","tw-pb-0"],[4,"ngFor","ngForOf"],[1,"tw-ps-2","tw-pe-2"],["target","_blank","rel","noreferrer","class","tw-flex tw-px-3 tw-py-2 tw-rounded-md tw-font-medium !tw-text-alt2 !tw-no-underline hover:tw-bg-hover-contrast [&>:not(.bwi)]:hover:tw-underline",3,"href",4,"ngIf"],["rel","noreferrer","class","tw-flex tw-px-3 tw-py-2 tw-rounded-md tw-font-medium !tw-text-alt2 !tw-no-underline hover:tw-bg-hover-contrast [&>:not(.bwi)]:hover:tw-underline",3,"routerLink",4,"ngIf"],["target","_blank","rel","noreferrer",1,"tw-flex","tw-px-3","tw-py-2","tw-rounded-md","tw-font-medium","!tw-text-alt2","!tw-no-underline","hover:tw-bg-hover-contrast","[&>:not(.bwi)]:hover:tw-underline",3,"href"],["class","tw-text-xs tw-font-normal",4,"ngIf"],[1,"tw-text-xs","tw-font-normal"],["rel","noreferrer",1,"tw-flex","tw-px-3","tw-py-2","tw-rounded-md","tw-font-medium","!tw-text-alt2","!tw-no-underline","hover:tw-bg-hover-contrast","[&>:not(.bwi)]:hover:tw-underline",3,"routerLink"]],template:function(e,t){if(1&e&&(o.SS7(0),o.nI1(1,"async"),o.nVh(2,T,2,1),o.nVh(3,F,1,0,"app-upgrade-nav-button"),o.nI1(4,"async"),o.SS7(5),o.nI1(6,"async"),o.nVh(7,O,5,4,"section",0)),2&e){const e=o.bH3(o.bMT(1,3,t.accessibleProducts$));o.R7$(2),o.vxM(e&&e.length>1?2:-1),o.R7$(),o.vxM(o.bMT(4,6,t.shouldShowPremiumUpgradeButton$)?3:-1),o.R7$(2);const i=o.bH3(o.bMT(6,8,t.moreProducts$));o.R7$(2),o.vxM(i&&i.length>0?7:-1)}},dependencies:[d.Sq,d.bT,u.Wk,h.K,A.u,S,d.Jj,Q.$],encapsulation:2});class U{constructor(){this.variant=(0,n.hFB)("primary")}}U.ɵfac=function(e){return new(e||U)},U.ɵcmp=o.VBU({type:U,selectors:[["app-side-nav"]],inputs:{variant:[1,"variant"]},ngContentSelectors:["*"],decls:4,vars:1,consts:[[3,"variant"],["slot","product-switcher"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"bit-side-nav",0),o.SdG(1),o.qex(2,1),o.nrm(3,"navigation-product-switcher"),o.bVm(),o.k0s()),2&e&&o.Y8G("variant",t.variant())},dependencies:[r.f,a.K,s.V,G],encapsulation:2,changeDetection:0})},4717(e,t,i){"use strict";i.d(t,{o:()=>n});class n{}},5076(e,t,i){"use strict";i.d(t,{e:()=>s,v:()=>r});var n=i(53323);const r="00000000-0000-0000-0000-000000000000";function s(e){return"string"==typeof e&&(0,n.W_)(e)}},5513(e,t,i){"use strict";i.d(t,{d:()=>g});var n=i(43380),r=i(37831),s=i(94573),o=i(74208),a=i(33812),l=i(33277);const c=[{id:"right-center",offsetX:10,originX:"end",originY:"center",overlayX:"start",overlayY:"center",panelClass:["bit-tooltip-right-center"]},{id:"left-center",offsetX:-10,originX:"start",originY:"center",overlayX:"end",overlayY:"center",panelClass:["bit-tooltip-left-center"]},{id:"below-center",offsetY:10,originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",panelClass:["bit-tooltip-below-center"]},{id:"above-center",offsetY:-10,originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",panelClass:["bit-tooltip-above-center"]}];var d=i(77468);function u(e,t){if(1&e&&a.EFF(0),2&e){const e=a.XpG(2);a.JRh(e.tooltipData.content())}}function h(e,t){if(1&e&&(a.rj2(0,"div",0)(1,"div",1),a.SdG(2,0,null,u,1,1),a.eux()()),2&e){const e=a.XpG();a.BMQ("data-position",e.tooltipData.tooltipPosition())("data-visible",e.tooltipData.isVisible()),a.R7$(),a.Avn("id",e.tooltipData.id())}}const A=new o.nKC("TOOLTIP_DATA");class p{constructor(){this.templateRef=s.ebz.required(a.C4Q),this.elementRef=(0,o.WQX)(a.aKT),this.tooltipData=(0,o.WQX)(A)}}p.ɵfac=function(e){return new(e||p)},p.ɵcmp=a.VBU({type:p,selectors:[["bit-tooltip"]],viewQuery:function(e,t){1&e&&a.wEZ(t.templateRef,a.C4Q,5),2&e&&a.NyB()},ngContentSelectors:["*"],decls:1,vars:1,consts:[[1,"bit-tooltip-container"],["role","tooltip",1,"bit-tooltip",3,"id"]],template:function(e,t){1&e&&(a.NAR(),a.nVh(0,h,4,3,"div",0)),2&e&&a.vxM(t.tooltipData.content()?0:-1)},dependencies:[d.MD],encapsulation:2});class g{constructor(){this.tooltipContent=(0,s.geq)("",{alias:"bitTooltip"}),this.tooltipPosition=(0,s.hFB)("above-center"),this.addTooltipToDescribedby=(0,s.hFB)(!1),this.isVisible=(0,o.vPA)(!1),this.elementRef=(0,o.WQX)(a.aKT),this.overlay=(0,o.WQX)(n.hJ),this.viewContainerRef=(0,o.WQX)(a.c1b),this.positionStrategy=this.overlay.position().flexibleConnectedTo(this.elementRef).withFlexibleDimensions(!1).withPush(!0),this.tooltipId="bit-tooltip-"+g.nextId++,this.currentDescribedByIds=this.elementRef.nativeElement.getAttribute("aria-describedby")||null,this.tooltipPortal=new r.A8(p,this.viewContainerRef,o.zZn.create({providers:[{provide:A,useValue:{content:this.tooltipContent,isVisible:this.isVisible,tooltipPosition:this.tooltipPosition,id:(0,o.vPA)(this.tooltipId)}}]})),this.destroyTooltip=()=>{var e;this.clearTimeout(),null===(e=this.overlayRef)||void 0===e||e.dispose(),this.overlayRef=void 0,this.isVisible.set(!1)},this.showTooltip=()=>{this.clearTimeout(),this.overlayRef||(this.overlayRef=this.overlay.create(Object.assign(Object.assign({},this.defaultPopoverConfig),{positionStrategy:this.positionStrategy})),this.overlayRef.attach(this.tooltipPortal)),this.showTimeoutId=setTimeout(()=>{this.isVisible.set(!0),this.showTimeoutId=void 0},800)},this.hideTooltip=()=>{this.destroyTooltip()},this.resolvedDescribedByIds=(0,l.EW)(()=>this.addTooltipToDescribedby()?this.currentDescribedByIds?`${this.currentDescribedByIds||""} ${this.tooltipId}`:this.tooltipId:this.currentDescribedByIds)}clearTimeout(){void 0!==this.showTimeoutId&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=void 0)}onFocusIn(e){e.target.matches(":focus-visible")&&this.showTooltip()}onFocusOut(){this.hideTooltip()}computePositions(e){const t=c.find(t=>t.id===e);return t?[t,...c]:c}get defaultPopoverConfig(){return{hasBackdrop:!1,scrollStrategy:this.overlay.scrollStrategies.reposition()}}ngOnInit(){this.positionStrategy.withPositions(this.computePositions(this.tooltipPosition()))}ngOnDestroy(){this.destroyTooltip()}}g.nextId=0,g.ɵfac=function(e){return new(e||g)},g.ɵdir=a.FsC({type:g,selectors:[["","bitTooltip",""]],hostVars:1,hostBindings:function(e,t){1&e&&a.bIt("mouseenter",function(){return t.showTooltip()})("mouseleave",function(){return t.hideTooltip()})("focusin",function(e){return t.onFocusIn(e)})("focusout",function(){return t.onFocusOut()}),2&e&&a.BMQ("aria-describedby",t.resolvedDescribedByIds())},inputs:{tooltipContent:[1,"bitTooltip","tooltipContent"],tooltipPosition:[1,"tooltipPosition"],addTooltipToDescribedby:[1,"addTooltipToDescribedby"]},outputs:{tooltipContent:"bitTooltipChange"}})},5520(e,t,i){"use strict";i.d(t,{S:()=>f});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(51757);i(37798);var l=i(36801),c=i(89479),d=i(70171),u=i(33812),h=i(97553);const A=["input"],p=(e,t)=>({"tw-opacity-0":e,"tw-bg-text-muted":t});function g(e,t){if(1&e){const e=u.RV6();u.j41(0,"button",7),u.nI1(1,"i18n"),u.bIt("click",function(){s.eBV(e);const t=u.XpG();return s.Njj(t.clearSearch())})("focus",function(){s.eBV(e);const t=u.XpG();return s.Njj(t.isResetButtonFocused.set(!0))})("blur",function(){s.eBV(e);const t=u.XpG();return s.Njj(t.isResetButtonFocused.set(!1))}),u.k0s()}if(2&e){const e=u.XpG();u.Y8G("ngClass",u.l_i(4,p,!e.showResetButton(),e.showResetButton())),u.BMQ("aria-label",u.bMT(1,2,"resetSearch"))}}let v=0;class f{constructor(){this.input=(0,r.ebz)("input"),this.id="search-id-"+v++,this.inputType=-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf(" Chrome/")&&-1===navigator.userAgent.indexOf(" Chromium/")?"text":"search",this.isInputFocused=(0,s.vPA)(!1),this.isFormHovered=(0,s.vPA)(!1),this.isResetButtonFocused=(0,s.vPA)(!1),this.showResetButton=(0,o.EW)(()=>this.isInputFocused()||this.isFormHovered()||this.isResetButtonFocused()),this.disabled=(0,r.geq)(),this.placeholder=(0,r.hFB)(),this.autocomplete=(0,r.hFB)()}getFocusTarget(){var e;return null===(e=this.input())||void 0===e?void 0:e.nativeElement}onChange(e){this.searchText=e,null!=this.notifyOnChange&&this.notifyOnChange(e)}clearSearch(){var e;this.searchText="",this.notifyOnChange&&this.notifyOnChange(""),null===(e=this.input())||void 0===e||e.nativeElement.focus()}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.set(e)}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=u.VBU({type:f,selectors:[["bit-search"]],viewQuery:function(e,t){1&e&&u.wEZ(t.input,A,5),2&e&&u.NyB()},inputs:{disabled:[1,"disabled"],placeholder:[1,"placeholder"],autocomplete:[1,"autocomplete"]},outputs:{disabled:"disabledChange"},features:[u.Jv_([{provide:a.kq,multi:!0,useExisting:f},{provide:d.H,useExisting:f}])],decls:10,vars:14,consts:[["input",""],["role","search",1,"tw-relative","tw-flex","tw-items-center","tw-w-full","tw-h-10",3,"mouseenter","mouseleave"],[1,"tw-sr-only",3,"for"],["aria-hidden","true",1,"tw-absolute","tw-start-2","tw-z-20","!tw-mb-0","tw-cursor-text",3,"for"],[1,"bwi","bwi-search","bwi-fw","tw-text-muted"],["bitInput","","name","searchText",1,"tw-ps-9","tw-h-full",3,"ngModelChange","focus","blur","type","id","placeholder","ngModel","disabled"],["class","bw-reset-btn tw-size-6 tw-absolute hover:tw-bg-text-main tw-end-2 tw-z-20 !tw-mb-0 tw-cursor-pointer","type","reset",3,"ngClass","click","focus","blur",4,"ngIf"],["type","reset",1,"bw-reset-btn","tw-size-6","tw-absolute","hover:tw-bg-text-main","tw-end-2","tw-z-20","!tw-mb-0","tw-cursor-pointer",3,"click","focus","blur","ngClass"]],template:function(e,t){var i;if(1&e){const e=u.RV6();u.j41(0,"form",1),u.bIt("mouseenter",function(){return s.eBV(e),s.Njj(t.isFormHovered.set(!0))})("mouseleave",function(){return s.eBV(e),s.Njj(t.isFormHovered.set(!1))}),u.j41(1,"label",2),u.EFF(2),u.nI1(3,"i18n"),u.k0s(),u.j41(4,"label",3),u.nrm(5,"i",4),u.k0s(),u.j41(6,"input",5,0),u.nI1(8,"i18n"),u.bIt("ngModelChange",function(i){return s.eBV(e),s.Njj(t.onChange(i))})("focus",function(){return s.eBV(e),s.Njj(t.isInputFocused.set(!0))})("blur",function(){return s.eBV(e),t.isInputFocused.set(!1),s.Njj(t.onTouch())}),u.k0s(),u.DNE(9,g,2,7,"button",6),u.k0s()}2&e&&(u.R7$(),u.Y8G("for",t.id),u.R7$(),u.JRh(u.bMT(3,10,"search")),u.R7$(2),u.Y8G("for",t.id),u.R7$(2),u.Y8G("type",t.inputType)("id",t.id)("placeholder",null!==(i=t.placeholder())&&void 0!==i?i:u.bMT(8,12,"search"))("ngModel",t.searchText)("disabled",t.disabled()),u.BMQ("autocomplete",t.autocomplete()),u.R7$(3),u.Y8G("ngIf",t.searchText))},dependencies:[c.x,h.J,a.X1,a.qT,a.me,a.BC,a.cb,a.YN,a.vS,a.cV,n.bT,n.YU,l.$Z],encapsulation:2})},5556(e,t,i){"use strict";i.d(t,{p:()=>n});class n{}},5571(e,t,i){"use strict";i.d(t,{o:()=>c});var n=i(78781),r=i(17989),s=i(24072),o=i(59281),a=i(34461),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c extends r.A{constructor(e){super(),null!=e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName,this.fileName=(0,s.e)(e.fileName),this.key=(0,s.e)(e.key))}decrypt(e){return l(this,arguments,void 0,function*(e,t="No Cipher Context"){const i=yield this.decryptObj(this,new a.$(this),["fileName"],e,"DomainType: Attachment; "+t);return null!=this.key&&(i.key=yield this.decryptAttachmentKey(e),i.encryptedKey=this.key,i.key||(i.hasDecryptionError=!0)),i})}decryptAttachmentKey(e){return l(this,void 0,void 0,function*(){try{if(null==this.key)return;const t=n.A.getContainerService().getEncryptService();return yield t.unwrapSymmetricKey(this.key,e)}catch(t){return void console.error("[Attachment] Error decrypting attachment",t)}})}toAttachmentData(){const e=new o.e;return null!=this.size&&(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;const t=new c;return t.id=e.id,t.url=e.url,t.size=e.size,t.sizeName=e.sizeName,t.key=(0,s.u)(e.key),t.fileName=(0,s.u)(e.fileName),t}toSdkAttachment(){var e,t;return{id:this.id,url:this.url,size:this.size,sizeName:this.sizeName,fileName:null===(e=this.fileName)||void 0===e?void 0:e.toSdk(),key:null===(t=this.key)||void 0===t?void 0:t.toSdk()}}static fromSdkAttachment(e){if(!e)return;const t=new c;return t.id=e.id,t.url=e.url,t.size=e.size,t.sizeName=e.sizeName,t.fileName=(0,s.u)(e.fileName),t.key=(0,s.u)(e.key),t}}},5771(e,t,i){"use strict";i.d(t,{k:()=>o});var n=i(56962),r=i(33812),s=i(2471);class o{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,null===(t=this.logService)||void 0===t||t.error("Received API exception:",e),this.validationService.showError(e)}))}}o.ɵfac=function(e){return new(e||o)(r.rXU(r.aKT),r.rXU(s.B),r.rXU(n.K))},o.ɵdir=r.FsC({type:o,selectors:[["","appApiAction",""]],inputs:{appApiAction:"appApiAction"},standalone:!1,features:[r.OA$]})},5819(e,t,i){"use strict";i.d(t,{Lg:()=>l,qk:()=>s,D$:()=>a,fg:()=>c});var n=i(69194),r=i(99969);class s{constructor(e){this.messageStream=e,this.allMessages$=this.messageStream}messages$(e){return this.allMessages$.pipe((0,n.p)(t=>(null==t?void 0:t.command)===e.command))}}s.EMPTY=new s(r.w);class o{constructor(e){this.innerMessageSenders=e}send(e,t={}){for(const i of this.innerMessageSenders)i.send(e,t)}}class a{static combine(...e){return new o(e)}}a.EMPTY=new o([]);class l{constructor(e){this.command=e}}Symbol("externalSource");class c{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}))}}},5884(e,t,i){"use strict";i.d(t,{W:()=>P});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(51757),l=i(90586),c=i(36801),d=i(29029),u=i(58384),h=i(22191),A=i(90647),p=i(13496),g=i(53997),v=i(78952),f=i(75583),m=i(67519),y=i(90143),C=i(26193),w=i(33812);const I=["chipSelectButton"],b=e=>({width:e}),B=(e,t)=>t.value;function E(e,t){if(1&e){const e=w.RV6();w.j41(0,"button",8),w.nI1(1,"i18n"),w.bIt("click",function(){s.eBV(e);const t=w.XpG();return s.Njj(t.clear())}),w.k0s()}if(2&e){const e=w.XpG();w.Y8G("disabled",e.disabled()),w.BMQ("aria-label",w.i5U(1,2,"removeItem",e.label))}}function S(e,t){var i,n;if(1&e){const e=w.RV6();w.j41(0,"button",10),w.nI1(1,"i18n"),w.bIt("click",function(t){const i=s.eBV(e),n=w.XpG(2);return s.Njj(n.viewOption(i,t))}),w.nrm(2,"bit-icon",11),w.EFF(3),w.nI1(4,"i18n"),w.k0s(),w.j41(5,"button",10),w.nI1(6,"i18n"),w.bIt("click",function(t){s.eBV(e);const i=w.XpG(2);return s.Njj(i.selectOption(i.renderedOptions,t))}),w.nrm(7,"bit-icon",12),w.EFF(8),w.nI1(9,"i18n"),w.k0s()}if(2&e){const e=t,r=w.XpG(2);w.Y8G("title",w.i5U(1,4,"backTo",null!==(i=e.label)&&void 0!==i?i:r.placeholderText())),w.R7$(3),w.SpI(" ",w.i5U(4,7,"backTo",null!==(n=e.label)&&void 0!==n?n:r.placeholderText())," "),w.R7$(2),w.Y8G("title",w.i5U(6,10,"viewItemsIn",r.renderedOptions.label)),w.R7$(3),w.SpI(" ",w.i5U(9,13,"viewItemsIn",r.renderedOptions.label)," ")}}function Q(e,t){if(1&e&&w.nrm(0,"bit-icon",16),2&e){const e=w.XpG().$implicit;w.HbH(e.iconClass),w.Y8G("name",e.icon)}}function k(e,t){1&e&&w.nrm(0,"bit-icon",15)}function T(e,t){if(1&e){const e=w.RV6();w.j41(0,"button",13),w.bIt("click",function(t){const i=s.eBV(e).$implicit,n=w.XpG(2);return s.Njj(null!=i.children&&i.children.length?n.viewOption(i,t):n.selectOption(i,t))}),w.nVh(1,Q,1,3,"bit-icon",14),w.EFF(2),w.nVh(3,k,1,0,"bit-icon",15),w.k0s()}if(2&e){const e=t.$implicit;w.Y8G("disabled",e.disabled)("title",e.label),w.BMQ("aria-haspopup",null!=e.children&&e.children.length?"menu":null),w.R7$(),w.vxM(e.icon?1:-1),w.R7$(),w.SpI(" ",e.label," "),w.R7$(),w.vxM(null!=e.children&&e.children.length?3:-1)}}function F(e,t){if(1&e&&(w.j41(0,"div",7),w.nVh(1,S,10,16),w.Z7z(2,T,4,6,"button",9,B),w.k0s()),2&e){let e;const t=w.XpG();w.Y8G("ngStyle",t.menuWidth&&w.eq3(2,b,t.menuWidth+"px")),w.R7$(),w.vxM((e=t.getParent(t.renderedOptions))?1:-1,e),w.R7$(),w.Dyx(t.renderedOptions.children)}}class P{constructor(){this.cdr=(0,s.WQX)(r.gRc),this.baseChip=(0,s.WQX)(m.rg,{host:!0}),this.menu=(0,r.ebz)(p.Z),this.menuItems=(0,r.dtW)(v.S),this.chipSelectButton=(0,r.ebz)("chipSelectButton"),this.menuTrigger=(0,r.ebz)(g.O),this.placeholderText=r.hFB.required(),this.placeholderIcon=(0,r.hFB)(),this.options=r.hFB.required(),this.disabledInput=(0,r.hFB)(!1,{alias:"disabled",transform:r.L39}),this.disabledState=(0,s.vPA)(!1),this.disabled=(0,o.EW)(()=>this.disabledInput()||this.disabledState()),this.classList=(0,o.EW)(()=>`!tw-ps-0 !tw-pb-0 ${this.baseChip.fullWidth()?"tw-block tw-w-full":"tw-inline-block"}`),this.menuWidth=null,this.childParentMap=new Map,this.baseChip.variant.set("subtle"),this.baseChip.hasTrailingIcon.set(!0),(0,o.QZ)(()=>{this.baseChip.disabledState.set(this.disabled())}),(0,o.QZ)(()=>{const e=this.selectedOption;this.childParentMap.clear(),this.initializeRootTree(this.options()),null!=(null==e?void 0:e.value)&&(this.selectedOption=this.findOption(this.rootTree,e.value)),void 0!==this.pendingValue&&(this.selectedOption=this.findOption(this.rootTree,this.pendingValue),this.setOrResetRenderedOptions(),this.pendingValue=void 0,this.cdr.markForCheck()),this.baseChip.selectedState.set(!!this.selectedOption)}),(0,o.QZ)(()=>{var e;const t=this.menuItems(),i=this.menu(),n=this.menuTrigger();t.length>0&&(null==n?void 0:n.isOpen)&&(null===(e=null==i?void 0:i.keyManager)||void 0===e||e.setFirstItemActive())})}get label(){var e;return(null===(e=this.selectedOption)||void 0===e?void 0:e.label)||this.placeholderText()}get icon(){var e;return(null===(e=this.selectedOption)||void 0===e?void 0:e.icon)||this.placeholderIcon()}setOrResetRenderedOptions(){var e,t;this.renderedOptions=this.selectedOption?(null!==(t=null===(e=this.selectedOption.children)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0?this.selectedOption:this.getParent(this.selectedOption):this.rootTree}handleMenuClosed(){this.setOrResetRenderedOptions(),this.menuWidth=null}selectOption(e,t){this.selectedOption=e,this.baseChip.selectedState.set(!0),this.onChange(e)}viewOption(e,t){this.renderedOptions=e,t.preventDefault(),t.stopImmediatePropagation()}clear(){this.renderedOptions=this.rootTree,this.selectedOption=null,this.baseChip.selectedState.set(!1),this.onChange(null)}findOption(e,t){if(!e)return null;let i=null;return null!==e.value&&(0,l.c)(e.value,t)?e:(Array.isArray(e.children)&&e.children.length>0&&e.children.some(e=>(i=this.findOption(e,t),i)),i)}markParents(e){var t;null===(t=e.children)||void 0===t||t.forEach(t=>{this.childParentMap.set(t,e),this.markParents(t)})}getParent(e){return this.childParentMap.get(e)}initializeRootTree(e){const t={children:e,value:null};this.markParents(t),this.rootTree=t,this.renderedOptions=this.rootTree}setMenuWidth(){var e,t,i,n,r,s,o,a,l,c;const d=null!==(n=null===(i=null===(t=null===(e=this.chipSelectButton())||void 0===e?void 0:e.nativeElement)||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.width)&&void 0!==n?n:0,u=null!==(c=null===(l=null===(a=null===(o=null===(s=null===(r=this.menu())||void 0===r?void 0:r.menuItems().at(0))||void 0===s?void 0:s.elementRef)||void 0===o?void 0:o.nativeElement)||void 0===a?void 0:a.getBoundingClientRect())||void 0===l?void 0:l.width)&&void 0!==c?c:0;this.menuWidth=Math.max(d,u)}writeValue(e){this.rootTree?(this.selectedOption=this.findOption(this.rootTree,e),this.baseChip.selectedState.set(!!this.selectedOption),this.setOrResetRenderedOptions(),this.cdr.markForCheck()):this.pendingValue=e}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabledState.set(e)}onChange(e){var t;this.notifyOnChange&&this.notifyOnChange(null!==(t=null==e?void 0:e.value)&&void 0!==t?t:null)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}}P.ɵfac=function(e){return new(e||P)},P.ɵcmp=w.VBU({type:P,selectors:[["bit-chip-filter"]],viewQuery:function(e,t){1&e&&(w.wEZ(t.menu,p.Z,5),w.wEZ(t.menuItems,v.S,5),w.wEZ(t.chipSelectButton,I,5),w.wEZ(t.menuTrigger,g.O,5)),2&e&&w.NyB(4)},hostVars:2,hostBindings:function(e,t){2&e&&w.HbH(t.classList())},inputs:{placeholderText:[1,"placeholderText"],placeholderIcon:[1,"placeholderIcon"],options:[1,"options"],disabledInput:[1,"disabled","disabledInput"]},features:[w.Jv_([{provide:a.kq,useExisting:P,multi:!0}]),w.nM4([{directive:m.rg,inputs:["maxWidthClass","maxWidthClass","fullWidth","fullWidth"]}])],decls:10,vars:12,consts:[["menuTrigger","menuTrigger","chipSelectButton",""],["menu",""],["size","large"],["bit-chip-content","","type","button",1,"tw-truncate","tw-bg-transparent","hover:tw-bg-transparent","tw-border-none","tw-outline-none","tw-w-full","tw-text-[color:inherit]","tw-text-[length:inherit]","tw-ps-2",3,"click","startIcon","endIcon","bitMenuTriggerFor","disabled","title"],[1,"tw-block","tw-truncate","tw-min-w-0"],["bit-chip-dismiss-button","","slot","end","type","button",1,"tw-relative","tw-bottom-[1px]",3,"disabled"],[3,"closed"],[1,"tw-max-h-80","tw-min-w-32","tw-max-w-80","tw-text-sm",3,"ngStyle"],["bit-chip-dismiss-button","","slot","end","type","button",1,"tw-relative","tw-bottom-[1px]",3,"click","disabled"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"disabled","title"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"click","title"],["slot","start","name","bwi-angle-left","aria-hidden","true"],["slot","start","name","bwi-list","aria-hidden","true"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"click","disabled","title"],["slot","start","aria-hidden","true",3,"name","class"],["slot","end","name","bwi-angle-right","aria-hidden","true"],["slot","start","aria-hidden","true",3,"name"]],template:function(e,t){if(1&e){const e=w.RV6();w.j41(0,"bit-chip-content",2)(1,"button",3,0),w.bIt("click",function(){return s.eBV(e),s.Njj(t.setMenuWidth())}),w.j41(4,"span",4),w.EFF(5),w.k0s()(),w.nVh(6,E,2,5,"button",5),w.k0s(),w.j41(7,"bit-menu",6,1),w.bIt("closed",function(){return s.eBV(e),s.Njj(t.handleMenuClosed())}),w.nVh(9,F,4,4,"div",7),w.k0s()}if(2&e){const e=w.sdS(2),i=w.sdS(8);w.R7$(),w.HbH("tw-pb-[calc(theme(spacing.1)_-_1px)]"),w.AVh("tw-cursor-not-allowed",t.disabled()),w.Y8G("startIcon",t.icon)("endIcon",t.selectedOption?void 0:e.isOpen?"bwi-angle-up":"bwi-angle-down")("bitMenuTriggerFor",i)("disabled",t.disabled())("title",t.label),w.R7$(4),w.JRh(t.label),w.R7$(),w.vxM(t.selectedOption?6:-1),w.R7$(3),w.vxM(t.renderedOptions?9:-1)}},dependencies:[n.MD,n.B3,d.t,h.Q,A.M,p.Z,g.O,v.S,f.E,y.l,C.i,u.R,c.$Z],encapsulation:2,changeDetection:0})},6307(e,t,i){"use strict";i.d(t,{m:()=>r});var n=i(83731);function r(e,t){(0,n.br)(t).pipe((0,n.pQ)()).subscribe(t=>{t?(e.removeAttribute("disabled"),e.setAttribute("aria-disabled","true")):e.removeAttribute("aria-disabled")})}},6528(e,t,i){"use strict";i.d(t,{G:()=>c});var n=i(39907),r=i(31442),s=i(69473),o=i(8583),a=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class c extends o.n{get maskedCode(){return null!=this.code?"•".repeat(this.code.length):void 0}get maskedNumber(){return null!=this.number?"•".repeat(this.number.length):void 0}get brand(){return this._brand}set brand(e){this._brand=e,this._subTitle=void 0}get number(){return this._number}set number(e){this._number=e,this._subTitle=void 0}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(){const e=this.expYear?(0,n.jd)(this.expYear):void 0;if(!this.expMonth&&!e)return;let t=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return t+=" / "+(e||"____"),t}static fromJSON(e){return Object.assign(new c,e)}static getCardBrandByPatterns(e){if(null==e||"string"!=typeof e||""===e.trim())return;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":void 0))))))}static fromSdkCardView(e){const t=new c;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}toSdkCardView(){return this}}a([(0,s.V)(r.xP.CardholderName,{sortPosition:0}),l("design:type",String)],c.prototype,"cardholderName",void 0),a([(0,s.V)(r.xP.ExpMonth,{sortPosition:3,i18nKey:"expirationMonth"}),l("design:type",String)],c.prototype,"expMonth",void 0),a([(0,s.V)(r.xP.ExpYear,{sortPosition:4,i18nKey:"expirationYear"}),l("design:type",String)],c.prototype,"expYear",void 0),a([(0,s.V)(r.xP.Code,{sortPosition:5,i18nKey:"securityCode"}),l("design:type",String)],c.prototype,"code",void 0),a([(0,s.V)(r.xP.Brand,{sortPosition:2}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"brand",null),a([(0,s.V)(r.xP.Number,{sortPosition:1}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"number",null)},6804(e,t,i){"use strict";i.d(t,{S:()=>B});var n=i(51757),r=i(48003),s=i(71804),o=i(37380),a=i(7861),l=i(37579),c=i(81573),d=i(29029),u=i(81525),h=i(36801),A=i(33812),p=i(66316),g=i(50700),v=i(62166),f=i(26657),m=i(38620),y=i(56898),C=i(7730),w=i(68016),I=i(67311),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class B{constructor(e,t,i,r,s){this.data=e,this.dialogRef=t,this.twoFactorService=i,this.i18nService=r,this.userVerificationService=s,this.formGroup=new n.gE({secret:new n.MJ(null)}),this.invalidSecret=!1,this.submit=()=>b(this,void 0,void 0,function*(){try{if(!this.formGroup.value.secret)throw new Error("Secret is required");const e=this.formGroup.value.secret;this.formPromise=this.userVerificationService.buildRequest(e).then(e=>this.apiCall(e));const t=yield this.formPromise;this.dialogRef.close({response:t,secret:e.secret,verificationType:e.type})}catch(e){throw e instanceof a._&&400===e.statusCode&&(this.invalidSecret=!0),e}}),this.type=e.type,this.organizationId=e.organizationId}get dialogTitle(){switch(this.type){case-1:return this.i18nService.t("recoveryCodeTitle");case s.R.Duo:case s.R.OrganizationDuo:return"Duo";case s.R.Email:return this.i18nService.t("emailTitle");case s.R.WebAuthn:return this.i18nService.t("webAuthnTitle");case s.R.Authenticator:return this.i18nService.t("authenticatorAppTitle");case s.R.Yubikey:return"Yubikey";default:throw new Error(`Unknown two-factor type: ${this.type}`)}}apiCall(e){switch(this.type){case-1:return this.twoFactorService.getTwoFactorRecover(e);case s.R.Duo:case s.R.OrganizationDuo:return null!=this.organizationId?this.twoFactorService.getTwoFactorOrganizationDuo(this.organizationId,e):this.twoFactorService.getTwoFactorDuo(e);case s.R.Email:return this.twoFactorService.getTwoFactorEmail(e);case s.R.WebAuthn:return this.twoFactorService.getTwoFactorWebAuthn(e);case s.R.Authenticator:return this.twoFactorService.getTwoFactorAuthenticator(e);case s.R.Yubikey:return this.twoFactorService.getTwoFactorYubiKey(e);default:throw new Error(`Unknown two-factor type: ${this.type}`)}}static open(e,t){return e.open(B,t)}}B.ɵfac=function(e){return new(e||B)(A.rXU(u.Qs),A.rXU(p.ce),A.rXU(o.fz),A.rXU(g.W),A.rXU(v.i))},B.ɵcmp=A.VBU({type:B,selectors:[["app-two-factor-verify"]],decls:12,vars:13,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title","subtitle"],["bitDialogContent",""],["formControlName","secret","name","secret",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(A.j41(0,"form",0)(1,"bit-dialog",1),A.nI1(2,"i18n"),A.qex(3,2),A.j41(4,"app-user-verification-form-input",3),A.mxI("invalidSecretChange",function(e){return A.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),A.k0s(),A.bVm(),A.qex(5,4),A.j41(6,"button",5),A.EFF(7),A.nI1(8,"i18n"),A.k0s(),A.j41(9,"button",6),A.EFF(10),A.nI1(11,"i18n"),A.k0s(),A.bVm(),A.k0s()()),2&e&&(A.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),A.R7$(),A.Y8G("title",A.bMT(2,7,"twoStepLogin"))("subtitle",t.dialogTitle),A.R7$(3),A.R50("invalidSecret",t.invalidSecret),A.R7$(3),A.SpI(" ",A.bMT(8,9,"continue")," "),A.R7$(3),A.SpI(" ",A.bMT(11,11,"close")," "))},dependencies:[l.C,f.$,m.L,d.t,y.Q,c.P,C.I,w.m,I.hJ,n.X1,n.qT,n.BC,n.cb,n.j4,n.JD,r.wV,h.$Z],encapsulation:2})},6912(e,t,i){"use strict";i.d(t,{D:()=>n});class n{constructor(e,t){this.twoFactor=e,this.device=null!=t?t:null}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}}},7243(e,t,i){"use strict";i.d(t,{T:()=>g});var n=i(74208),r=i(33277),s=i(72245),o=i(3204),a=i(67553),l=i(21879),c=i(28209),d=i(35500),u=i(50700),h=i(23649),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const p=new l.Ok(l.b4,"coachmarkTourCompleted",{deserializer:e=>null!=e&&e,clearOn:[]});class g{constructor(e,t,i,s,o){this.accountService=e,this.organizationService=t,this.stateProvider=i,this.i18nService=s,this.router=o,this.activeStepId=(0,n.vPA)(null),this.currentStepNumber=(0,r.EW)(()=>{const e=this.activeStepId();if(!e)return 0;const t=this.applicableSteps().findIndex(t=>t.id===e);return t>=0?t+1:0}),this.totalSteps=(0,r.EW)(()=>this.applicableSteps().length),this.isRunning=(0,r.EW)(()=>null!==this.activeStepId()),this.applicableSteps=(0,n.vPA)([])}getStepConfig(e){return c.Q.find(t=>t.id===e)}getStepTitle(e){const t=this.getStepConfig(e);return t?this.i18nService.t(t.titleKey):""}getStepDescription(e){const t=this.getStepConfig(e);return t?this.i18nService.t(t.descriptionKey):""}getStepLearnMoreUrl(e){const t=this.getStepConfig(e);return null==t?void 0:t.learnMoreUrl}getStepPosition(e){const t=this.getStepConfig(e);return null==t?void 0:t.position}startTour(){return A(this,void 0,void 0,function*(){if(this.isRunning())return;const e=yield(0,s._)(this.accountService.activeAccount$);if(!e)return;if(yield(0,s._)(this.stateProvider.getUserState$(p,e.id).pipe((0,o.T)(e=>null!=e&&e))))return;const t=yield(0,s._)(this.organizationService.hasOrganizations(e.id)),i=c.Q.filter(e=>!e.requiresOrganization||t);0!==i.length&&(this.applicableSteps.set(i),yield this.navigateToStep(i[0]))})}navigateToStep(e){return A(this,void 0,void 0,function*(){e.route&&(yield this.router.navigate([e.route]),yield new Promise(e=>setTimeout(e,100))),this.activeStepId.set(e.id)})}nextStep(){return A(this,void 0,void 0,function*(){if(!this.isRunning())return;const e=this.applicableSteps(),t=e.findIndex(e=>e.id===this.activeStepId());t>=e.length-1?yield this.completeTour():yield this.navigateToStep(e[t+1])})}previousStep(){return A(this,void 0,void 0,function*(){if(!this.isRunning())return;const e=this.applicableSteps(),t=e.findIndex(e=>e.id===this.activeStepId());t>0&&(yield this.navigateToStep(e[t-1]))})}completeTour(){return A(this,void 0,void 0,function*(){this.activeStepId.set(null),this.applicableSteps.set([]);const e=yield(0,s._)(this.accountService.activeAccount$);e&&(yield this.stateProvider.setUserState(p,!0,e.id))})}}g.ɵfac=function(e){return new(e||g)(n.KVO(d.D),n.KVO(a.PV),n.KVO(l.v2),n.KVO(u.W),n.KVO(h.Ix))},g.ɵprov=n.jDH({token:g,factory:g.ɵfac,providedIn:"root"})},7248(e,t,i){"use strict";i.d(t,{V:()=>n});class n{authenticateWith(e){return this.masterPasswordHash=e.masterPasswordAuthenticationHash,this}}},7421(e,t,i){"use strict";i.d(t,{T:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,hostAttrs:[1,"tw-box-border","tw-block","tw-bg-background","tw-text-main","tw-border","tw-border-solid","tw-border-secondary-100","tw-shadow","tw-rounded-xl"]})},7730(e,t,i){"use strict";i.d(t,{I:()=>o});var n=i(94573),r=i(33812),s=i(81525);class o{constructor(e){this.dialogRef=e,this.dialogResult=(0,n.hFB)(void 0,{alias:"bitDialogClose"})}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)(r.rXU(s.ce,8))},o.ɵdir=r.FsC({type:o,selectors:[["","bitDialogClose",""]],hostVars:1,hostBindings:function(e,t){1&e&&r.bIt("click",function(){return t.close()}),2&e&&r.BMQ("disabled",t.disableClose)},inputs:{dialogResult:[1,"bitDialogClose","dialogResult"]}})},7855(e,t,i){"use strict";i.d(t,{q:()=>R});var n=i(28846),r=i(51757),s=i(33812),o=i(66046),a=i(14803),l=i(68333),c=i(78781),d=i(8916),u=i(62166),h=i(50700),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{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.keyService=e,this.userVerificationService=t,this.i18nService=i,this._invalidSecret=!1,this.invalidSecretChange=new s.bkB,this.hasMasterPassword=!0,this.disableRequestOTP=!1,this.sentCode=!1,this.secret=new r.MJ("",[r.k0.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.hasMasterPassword?this.i18nService.t("incorrectPassword"):this.i18nService.t("incorrectCode")}}}]),this.destroy$=new o.B,this.requestOTP=()=>A(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 A(this,void 0,void 0,function*(){this.hasMasterPassword=yield this.userVerificationService.hasMasterPasswordAndMasterKeyHash(),this.processChanges(this.secret.value),this.secret.valueChanges.pipe((0,a.Q)(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.k.MasterPassword:l.k.OTP,secret:c.A.isNullOrWhitespace(e)?null:e})}}p.ɵfac=function(e){return new(e||p)(s.rXU(d.Lu),s.rXU(u.i),s.rXU(h.W))},p.ɵdir=s.FsC({type:p,selectors:[["app-user-verification"]],inputs:{invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange"},standalone:!1});var g=i(77468),v=i(49519),f=i(57083),m=i(3892),y=i(56898),C=i(86226),w=i(93199),I=i(97553),b=i(43759),B=i(76356),E=i(69896),S=i(36288),Q=i(58384),k=i(25740);function T(e,t){if(1&e&&(s.qex(0),s.j41(1,"bit-form-field",1)(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"input",2)(6,"button",3),s.j41(7,"bit-hint"),s.EFF(8),s.nI1(9,"i18n"),s.k0s()(),s.bVm()),2&e){const e=s.XpG();s.R7$(3),s.JRh(s.bMT(4,3,"masterPass")),s.R7$(2),s.Y8G("formControl",e.secret),s.R7$(3),s.JRh(s.bMT(9,5,"confirmIdentity"))}}function F(e,t){1&e&&(s.j41(0,"span",9),s.nrm(1,"bit-icon",10),s.EFF(2),s.nI1(3,"i18n"),s.k0s()),2&e&&(s.Y8G("@sent",void 0),s.R7$(2),s.SpI(" ",s.bMT(3,2,"codeSent")," "))}function P(e,t){if(1&e&&(s.qex(0),s.j41(1,"div",4)(2,"label",5),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.j41(5,"button",6),s.EFF(6),s.nI1(7,"i18n"),s.k0s(),s.DNE(8,F,4,4,"span",7),s.k0s(),s.j41(9,"bit-form-field",1)(10,"bit-label"),s.EFF(11),s.nI1(12,"i18n"),s.k0s(),s.nrm(13,"input",8),s.j41(14,"bit-hint"),s.EFF(15),s.nI1(16,"i18n"),s.k0s()(),s.bVm()),2&e){const e=s.XpG();s.R7$(3),s.JRh(s.bMT(4,7,"sendVerificationCode")),s.R7$(2),s.Y8G("bitAction",e.requestOTP),s.R7$(),s.SpI(" ",s.bMT(7,9,"sendCode")," "),s.R7$(2),s.Y8G("ngIf",e.sentCode),s.R7$(3),s.JRh(s.bMT(12,11,"verificationCode")),s.R7$(2),s.Y8G("formControl",e.secret),s.R7$(2),s.JRh(s.bMT(16,13,"confirmIdentity"))}}class R extends p{}R.ɵfac=(()=>{let e;return function(t){return(e||(e=s.xGo(R)))(t||R)}})(),R.ɵcmp=s.VBU({type:R,selectors:[["app-user-verification"]],standalone:!1,features:[s.Jv_([{provide:r.kq,multi:!0,useExisting:R}]),s.Vt3],decls:2,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"],["name","bwi-check-circle"]],template:function(e,t){1&e&&s.DNE(0,T,10,7,"ng-container",0)(1,P,17,15,"ng-container",0),2&e&&(s.Y8G("ngIf",t.hasMasterPassword),s.R7$(),s.Y8G("ngIf",!t.hasMasterPassword))},dependencies:[g.bT,r.me,r.BC,r.l_,v.B,f.q,m.p,y.Q,C.j,w.I,I.J,b.h,B.e,E.a,S.s,Q.R,k.$],encapsulation:2,data:{animation:[(0,n.hZ)("sent",[(0,n.kY)(":enter",[(0,n.iF)({opacity:0}),(0,n.i0)("100ms",(0,n.iF)({opacity:1}))])])]}})},7861(e,t,i){"use strict";i.d(t,{_:()=>r});var n=i(20702);class r extends n.r{constructor(e,t,i){super(e);let n=null;if(null!=e){const t=this.getResponseProperty("ErrorModel");n=t&&i?t:e}429===t?this.message="Rate limit exceeded. Try again later.":n&&(this.message=this.getResponseProperty("Message",n),this.validationErrors=this.getResponseProperty("ValidationErrors",n)),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}}},7919(e,t,i){"use strict";i.d(t,{KN:()=>o,g7:()=>s,gC:()=>n});const n=Object.freeze({Login:1,SecureNote:2,Card:3,Identity:4,SshKey:5}),r=Object.freeze(Object.fromEntries(Object.entries(n).map(([e,t])=>[t,e])));function s(e){return r[e]}const o=e=>Object.values(n).includes(e)},8168(e,t,i){"use strict";i.d(t,{k:()=>c});var n=i(94573),r=i(74208),s=i(33277),o=i(23197),a=i(82392),l=i(33812);class c{constructor(){this.domSanitizer=(0,r.WQX)(o.up),this.content=(0,n.hFB)(),this.ariaLabel=(0,n.hFB)(),this.innerHtml=(0,s.EW)(()=>{const e=this.content();if(!(0,a.Ye)(e))return null;const t=e.svg;return this.domSanitizer.bypassSecurityTrustHtml(t)})}}c.ɵfac=function(e){return new(e||c)},c.ɵcmp=l.VBU({type:c,selectors:[["bit-svg"]],hostAttrs:[1,"tw-max-h-full","tw-flex","tw-justify-center"],hostVars:3,hostBindings:function(e,t){2&e&&(l.Avn("innerHTML",t.innerHtml(),l.npT),l.BMQ("aria-hidden",!t.ariaLabel())("aria-label",t.ariaLabel()))},inputs:{content:[1,"content"],ariaLabel:[1,"ariaLabel"]},decls:0,vars:0,template:function(e,t){},encapsulation:2,changeDetection:0})},8245(e,t,i){"use strict";i.d(t,{b:()=>y});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(94735),h=i(26411),A=i(73638),p=i(86226),g=i(97553),v=i(43759),f=i(25740),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class y{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({catchallDomain:[""]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return m(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return m(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(A.qG.catchall,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.account$.complete(),this.destroyed$.next(),this.destroyed$.complete()}}y.ɵfac=function(e){return new(e||y)(n.rXU(r.ok),n.rXU(A.iE))},y.ɵcmp=n.VBU({type:y,selectors:[["tools-catchall-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:6,vars:4,consts:[[1,"tw-container",3,"formGroup"],["bitInput","","formControlName","catchallDomain","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"input",1),n.bIt("change",function(){return t.save("catchallDomain")}),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(3),n.JRh(n.bMT(4,2,"domainName")))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,h.L,p.j,g.J,v.h,u.p,f.$],encapsulation:2})},8297(e,t,i){"use strict";i.d(t,{K:()=>a});var n=i(89033),r=i(24374),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({imports:[n.c,r.d,n.c]})},8433(e,t,i){"use strict";i.d(t,{p:()=>o});var n=i(33886),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.w]})},8583(e,t,i){"use strict";i.d(t,{n:()=>n});class n{}},8916(e,t,i){"use strict";i.d(t,{hU:()=>J,vB:()=>f,Zm:()=>C,cR:()=>p,fX:()=>_,QH:()=>m,aT:()=>ne,gX:()=>q,PA:()=>de,xP:()=>ae,zZ:()=>ee,ao:()=>W,Lu:()=>w,n1:()=>$,ox:()=>le,wM:()=>re,E$:()=>Z});var n=i(3204),r=i(33338),s=i(72245),o=i(39306),a=i(31857);const l=new a.Ok(a.rB,"biometricUnlockEnabled",{deserializer:e=>e,clearOn:[]}),c=new a.Ok(a.rB,"clientKeyHalf",{deserializer:e=>e,clearOn:["logout"]}),d=a.Zs.record(a.rB,"promptCancelled",{deserializer:e=>e}),u=new a.Ok(a.rB,"promptAutomatically",{deserializer:e=>e,clearOn:[]}),h=new a.Zs(a.rB,"fingerprintValidated",{deserializer:e=>e}),A=new a.Zs(a.rB,"lastProcessReload",{deserializer:e=>new Date(e)});var p,g,v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class f{}class m{constructor(e){this.stateProvider=e,this.biometricUnlockEnabledState=this.stateProvider.getActive(l),this.encryptedClientKeyHalfState=this.stateProvider.getActive(c),this.encryptedClientKeyHalf$=this.encryptedClientKeyHalfState.state$.pipe((0,n.T)(y)),this.promptCancelledState=this.stateProvider.getGlobal(d),this.promptCancelled$=(0,r.z)([this.stateProvider.activeUserId$,this.promptCancelledState.state$]).pipe((0,n.T)(([e,t])=>{var i;return null!=e&&(null!==(i=null==t?void 0:t[e])&&void 0!==i&&i)})),this.promptAutomaticallyState=this.stateProvider.getActive(u),this.promptAutomatically$=this.promptAutomaticallyState.state$.pipe((0,n.T)(Boolean)),this.fingerprintValidatedState=this.stateProvider.getGlobal(h),this.fingerprintValidated$=this.fingerprintValidatedState.state$.pipe((0,n.T)(Boolean)),this.lastProcessReloadState=this.stateProvider.getGlobal(A),this.lastProcessReload$=this.lastProcessReloadState.state$}setBiometricUnlockEnabled(e){return v(this,void 0,void 0,function*(){yield this.biometricUnlockEnabledState.update(()=>e)})}biometricUnlockEnabled$(e){return null!=e?this.stateProvider.getUser(e,l).state$.pipe((0,n.T)(Boolean)):this.biometricUnlockEnabledState.state$.pipe((0,n.T)(Boolean))}getBiometricUnlockEnabled(e){return v(this,void 0,void 0,function*(){return yield(0,s._)(this.stateProvider.getUser(e,l).state$.pipe((0,n.T)(Boolean)))})}setEncryptedClientKeyHalf(e,t){return v(this,void 0,void 0,function*(){var i;const n=null!==(i=null==e?void 0:e.encryptedString)&&void 0!==i?i:null;t?yield this.stateProvider.getUser(t,c).update(()=>n):yield this.encryptedClientKeyHalfState.update(()=>n)})}getEncryptedClientKeyHalf(e){return v(this,void 0,void 0,function*(){return yield(0,s._)(this.stateProvider.getUser(e,c).state$.pipe((0,n.T)(y)))})}logout(e){return v(this,void 0,void 0,function*(){yield this.stateProvider.getUser(e,c).update(()=>null),yield this.resetUserPromptCancelled(e)})}resetUserPromptCancelled(e){return v(this,void 0,void 0,function*(){yield this.stateProvider.getGlobal(d).update((t,i)=>(null!=t&&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 v(this,void 0,void 0,function*(){yield this.promptCancelledState.update((e,t)=>(null!=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 v(this,void 0,void 0,function*(){yield this.promptCancelledState.update(()=>null)})}setPromptAutomatically(e){return v(this,void 0,void 0,function*(){yield this.promptAutomaticallyState.update(()=>e)})}setFingerprintValidated(e){return v(this,void 0,void 0,function*(){yield this.fingerprintValidatedState.update(()=>e)})}updateLastProcessReload(){return v(this,void 0,void 0,function*(){yield this.lastProcessReloadState.update(()=>new Date)})}getLastProcessReload(){return v(this,void 0,void 0,function*(){return yield(0,s._)(this.lastProcessReload$)})}}function y(e){return null==e?null:new o.k(e)}!function(e){e[e.Available=0]="Available",e[e.UnlockNeeded=1]="UnlockNeeded",e[e.HardwareUnavailable=2]="HardwareUnavailable",e[e.AutoSetupNeeded=3]="AutoSetupNeeded",e[e.ManualSetupNeeded=4]="ManualSetupNeeded",e[e.PlatformUnsupported=5]="PlatformUnsupported",e[e.DesktopDisconnected=6]="DesktopDisconnected",e[e.NotEnabledLocally=7]="NotEnabledLocally",e[e.NotEnabledInConnectedDesktopApp=8]="NotEnabledInConnectedDesktopApp",e[e.NativeMessagingPermissionMissing=9]="NativeMessagingPermissionMissing"}(p||(p={})),function(e){e.AuthenticateWithBiometrics="authenticateWithBiometrics",e.GetBiometricsStatus="getBiometricsStatus",e.UnlockWithBiometricsForUser="unlockWithBiometricsForUser",e.GetBiometricsStatusForUser="getBiometricsStatusForUser",e.CanEnableBiometricUnlock="canEnableBiometricUnlock"}(g||(g={}));class C{supportsBiometric(){throw new Error("Method not implemented.")}}Error;class w{}var I=i(69636),b=i(44500),B=i(81714),E=i(69194),S=i(34040),Q=i(27442),k=i(93695),T=i(75811),F=i(96718),P=i(2738),R=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class D{static fromData(e){switch(e.type){case"organization":return new M(e.key);case"provider":return new x(e.key,e.providerId);default:return null}}static isProviderEncrypted(e){return"provider"===e.toData().type}}class M{constructor(e){this.key=e}decrypt(e,t){return R(this,void 0,void 0,function*(){return yield e.decapsulateKeyUnsigned(this.encryptedOrganizationKey,t)})}get encryptedOrganizationKey(){return new o.k(this.key)}toData(){return{type:"organization",key:this.key}}}class x{constructor(e,t){this.key=e,this.providerId=t}decrypt(e,t){return R(this,void 0,void 0,function*(){const i=yield e.unwrapSymmetricKey(new o.k(this.key),t[this.providerId]);if(null==i)throw new Error("Failed to decrypt organization key");return i})}get encryptedOrganizationKey(){return new o.k(this.key)}toData(){return{type:"provider",key:this.key,providerId:this.providerId}}}var O=i(16184),G=i(78070),U=i(68467);var V=i(78781),j=i(30126),N=i(43890);const z=a.Ok.record(a.Gg,"organizationKeys",{deserializer:e=>e,clearOn:["logout"]}),Y=a.Ok.record(a.Gg,"providerKeys",{deserializer:e=>e,clearOn:["logout"]});var L=i(71464),K=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const X="";class q{constructor(e,t,i,n,r,s,o,a,l,c,d){this.masterPasswordService=e,this.keyGenerationService=t,this.cryptoFunctionService=i,this.encryptService=n,this.platformUtilService=r,this.logService=s,this.stateService=o,this.accountService=a,this.stateProvider=l,this.kdfConfigService=c,this.accountCryptographyStateService=d,this.activeUserOrgKeys$=this.stateProvider.activeUserId$.pipe((0,b.n)(e=>null!=e?this.orgKeys$(e):B.t),(0,E.p)(e=>null!=e),(0,S.F)(),(0,Q.t)({bufferSize:1,refCount:!1}))}setUserKey(e,t){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("No key provided. Lock the user to clear the key");if(null==t)throw new Error("No userId provided.");yield this.stateProvider.setUserState(L.y,this.userKeyToStateObject(e),t),yield this.stateProvider.setUserState(L.T,!0,t),yield this.storeAdditionalKeys(e,t);if(null==(yield(0,s._)(this.userKey$(t).pipe((0,E.p)(e=>null!=e)))))throw new Error("Failed to set user key")})}refreshAdditionalKeys(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required.");const t=yield(0,s._)(this.userKey$(e));if(null==t)throw new Error("No user key found for: "+e);yield this.setUserKey(t,e)})}everHadUserKey$(e){return this.stateProvider.getUser(e,L.T).state$.pipe((0,n.T)(e=>null!=e&&e))}getInMemoryUserKeyFor$(e){return this.stateProvider.getUserState$(L.y,e).pipe((0,n.T)(e=>this.stateObjectToUserKey(e)))}getUserKey(e){return K(this,void 0,void 0,function*(){const t=yield(0,s._)(this.stateProvider.getUserState$(L.y,e));return this.stateObjectToUserKey(t)})}getUserKeyFromStorage(e,t){return K(this,void 0,void 0,function*(){if(null==t)throw new Error("UserId is required");const i=yield this.getKeyFromStorage(e,t);return null==i?null:((yield this.validateUserKey(i,t))||(this.logService.warning("Invalid key, throwing away stored keys"),yield this.clearAllStoredUserKeys(t)),i)})}hasUserKey(e){return K(this,void 0,void 0,function*(){return null!=e&&null!=(yield(0,s._)(this.stateProvider.getUserState$(L.y,e)))})}makeUserKey(e){return K(this,void 0,void 0,function*(){if(!e)throw new Error("MasterKey is required");const t=yield this.keyGenerationService.createKey(512);return this.buildProtectedSymmetricKey(e,t)})}clearUserKey(e){return K(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(L.y,null,e),yield this.clearAllStoredUserKeys(e))})}clearStoredUserKey(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");yield this.stateService.setUserKeyAutoUnlock(null,{userId:e})})}getOrDeriveMasterKey(e,t){return K(this,void 0,void 0,function*(){if(null==t)throw new Error("User ID is required.");const i=yield(0,s._)(this.masterPasswordService.masterKey$(t));if(null!=i)return i;const r=yield(0,s._)(this.accountService.accounts$.pipe((0,n.T)(e=>{var i;return null===(i=e[t])||void 0===i?void 0:i.email})));if(null==r)throw new Error("No email found for user "+t);const o=yield(0,s._)(this.kdfConfigService.getKdfConfig$(t));if(null==o)throw new Error("No kdf found for user "+t);return yield this.makeMasterKey(e,r,o)})}makeMasterKey(e,t,i){return K(this,void 0,void 0,function*(){const n=(new Date).getTime();t=t.trim().toLowerCase();const r=yield this.keyGenerationService.deriveKeyFromPassword(e,t,i),s=(new Date).getTime();return this.logService.info(`[KeyService] Deriving master key took ${s-n}ms`),r})}encryptUserKeyWithMasterKey(e,t){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("masterKey is required.");if(null==t)throw new Error("userKey is required.");return yield this.buildProtectedSymmetricKey(e,t)})}hashMasterKey(e,t,i){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("password is required.");if(null==t)throw new Error("key is required.");const n=i===U.VK.LocalAuthorization?2:1,r=yield this.cryptoFunctionService.pbkdf2(t.inner().encryptionKey,e,"sha256",n);return V.A.fromBufferToB64(r)})}setOrgKeys(e,t,i){return K(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,z).update(()=>{const i={};for(const t of e)i[t.id]={type:"organization",key:t.key};for(const e of t)i[e.id]={type:"provider",providerId:e.providerId,key:e.key};return i})})}getOrgKey(e){return K(this,void 0,void 0,function*(){return yield(0,s._)(this.activeUserOrgKeys$.pipe((0,n.T)(t=>{var i;return null!==(i=t[e])&&void 0!==i?i:null})))})}makeDataEncKey(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("No key provided");const t=yield this.keyGenerationService.createKey(512);return[t,yield this.encryptService.wrapSymmetricKey(t,e)]})}clearOrgKeys(e){return K(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(z,null,e))})}setProviderKeys(e,t){return K(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,Y).update(()=>{const t={};return e.forEach(e=>{t[e.id]=e.key}),t})})}providerKeys$(e){return this.userPrivateKey$(e).pipe((0,b.n)(t=>null==t?(0,k.of)(null):this.providerKeysHelper$(e,t)))}clearProviderKeys(e){return K(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(Y,null,e))})}makeOrgKey(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");const t=yield(0,s._)(this.userPublicKey$(e));if(null==t)throw new Error("No public key found for user "+e);const i=yield this.keyGenerationService.createKey(512);return[yield this.encryptService.encapsulateKeyUnsigned(i,t),i]})}getFingerprint(e,t){return K(this,void 0,void 0,function*(){if(null==t)throw new Error("Public key is required to generate a fingerprint.");const i=yield this.cryptoFunctionService.hash(t,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(i,e,32,"sha256");return this.hashPhrase(n)})}makeKeyPair(e){return K(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[V.A.fromBufferToB64(t[0]),yield this.encryptService.wrapDecapsulationKey(t[1],e)]})}makeSendKey(e){return K(this,void 0,void 0,function*(){return yield this.keyGenerationService.deriveKeyFromMaterial(e,"bitwarden-send","send")})}makeCipherKey(){return K(this,void 0,void 0,function*(){return yield this.keyGenerationService.createKey(512)})}clearKeys(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");yield this.masterPasswordService.clearMasterKeyHash(e),yield this.clearUserKey(e),yield this.clearOrgKeys(e),yield this.clearProviderKeys(e),yield this.stateProvider.setUserState(L.T,null,e),yield this.accountCryptographyStateService.clearAccountCryptographicState(e)})}validateUserKey(e,t){return K(this,void 0,void 0,function*(){if(null==e)return!1;try{const i=yield(0,s._)(this.userEncryptedPrivateKey$(t));if(null==i)return!1;const n=yield this.decryptPrivateKey(i,e);if(null==n)return!1;if(null==(yield this.derivePublicKey(n)))return!1}catch(i){return!1}return!0})}initAccount(e){return K(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required.");if(null!=(yield(0,s._)(this.userKey$(e))))throw this.logService.error("Tried to initialize account with existing user key."),new Error("Cannot initialize account, keys already exist.");const t=yield this.keyGenerationService.createKey(512),[i,n]=yield this.makeKeyPair(t);if(null==n.encryptedString)throw new Error("Failed to create valid private key.");return yield this.setUserKey(t,e),yield this.accountCryptographyStateService.setAccountCryptographicState({V1:{private_key:n.encryptedString}},e),{userKey:t,publicKey:i,privateKey:n}})}storeAdditionalKeys(e,t){return K(this,void 0,void 0,function*(){(yield this.shouldStoreKey(U.hq.Auto,t))?yield this.stateService.setUserKeyAutoUnlock(e.keyB64,{userId:t}):yield this.stateService.setUserKeyAutoUnlock(null,{userId:t})})}shouldStoreKey(e,t){return K(this,void 0,void 0,function*(){if(e===U.hq.Auto){if(this.platformUtilService.getClientType()==P.s.Cli)return!0;const e=yield(0,s._)(this.stateProvider.getUserState$(G.z,t).pipe((0,E.p)(e=>null!=e)));return this.logService.debug(`[KeyService] Should store auto key for vault timeout ${e}`),e==O.Lw.Never}return!1})}getKeyFromStorage(e,t){return K(this,void 0,void 0,function*(){if(e===U.hq.Auto){const e=yield this.stateService.getUserKeyAutoUnlock({userId:t});if(e)return new N.e(V.A.fromB64ToArray(e))}return null})}clearAllStoredUserKeys(e){return K(this,void 0,void 0,function*(){yield this.stateService.setUserKeyAutoUnlock(null,{userId:e})})}hashPhrase(e){return K(this,arguments,void 0,function*(e,t=64){const i=Math.log(j.o.length)/Math.log(2);let n=Math.ceil(t/i);const r=Array.from(new Uint8Array(e));if(n*i>4*r.length)throw new Error("Output entropy of hash function is too small");const s=[];let o=I.fromArray(r,256);for(;n--;){const e=o.mod(j.o.length);o=o.divide(j.o.length),s.push(j.o[e])}return s})}buildProtectedSymmetricKey(e,t){return K(this,void 0,void 0,function*(){let i;if(e.inner().type===U.Qd.AesCbc256_B64){const n=yield this.keyGenerationService.stretchKey(e);i=yield this.encryptService.wrapSymmetricKey(t,n)}else{if(e.inner().type!==U.Qd.AesCbc256_HmacSha256_B64)throw new Error("Invalid key size.");i=yield this.encryptService.wrapSymmetricKey(t,e)}return[t,i]})}userKey$(e){return this.stateProvider.getUser(e,L.y).state$.pipe((0,n.T)(e=>null!=e?e[""]:null))}userPublicKey$(e){return this.userPrivateKey$(e).pipe((0,b.n)(e=>K(this,void 0,void 0,function*(){return yield this.derivePublicKey(e)})))}derivePublicKey(e){return K(this,void 0,void 0,function*(){return null==e?null:yield this.cryptoFunctionService.rsaExtractPublicKey(e)})}userPrivateKey$(e){return this.userPrivateKeyHelper$(e).pipe((0,n.T)(e=>{var t;return null!==(t=null==e?void 0:e.userPrivateKey)&&void 0!==t?t:null}))}userEncryptionKeyPair$(e){return this.userPrivateKey$(e).pipe((0,b.n)(e=>K(this,void 0,void 0,function*(){if(null==e)return null;const t=yield this.derivePublicKey(e);return{privateKey:e,publicKey:t}})))}userEncryptedPrivateKey$(e){return this.accountCryptographyStateService.accountCryptographicState$(e).pipe((0,n.T)(e=>null==e?null:"V2"in e?e.V2.private_key:"V1"in e?e.V1.private_key:null))}userPrivateKeyHelper$(e){return this.userKey$(e).pipe((0,b.n)(t=>null==t?(0,k.of)(null):this.userEncryptedPrivateKey$(e).pipe((0,b.n)(e=>K(this,void 0,void 0,function*(){return yield this.decryptPrivateKey(e,t)})),(0,n.T)(e=>({userKey:t,userPrivateKey:e})),(0,T.W)(i=>(this.logService.error(`Failed to decrypt private key for user ${e}`),(0,k.of)({userKey:t,userPrivateKey:null}))))))}decryptPrivateKey(e,t){return K(this,void 0,void 0,function*(){return null==e?null:yield this.encryptService.unwrapDecapsulationKey(new o.k(e),t)})}providerKeysHelper$(e,t){return this.stateProvider.getUser(e,Y).state$.pipe((i=(e,i)=>K(this,void 0,void 0,function*(){return yield this.encryptService.decapsulateKeyUnsigned(new o.k(i),t)}),(0,n.T)(e=>{if(null==e)return null;const t={};for(const[n,r]of Object.entries(e))t[n]=i(n,r);return t})),(0,b.n)(e=>null==e?(0,k.of)(null):0===Object.keys(e).length?(0,k.of)({}):(0,F.p)(e)));var i}userSigningKey$(e){return this.accountCryptographyStateService.accountCryptographicState$(e).pipe((0,n.T)(e=>null==e?null:"V2"in e?e.V2.signing_key:null))}orgKeys$(e){return this.cipherDecryptionKeys$(e).pipe((0,n.T)(e=>{var t;return null!==(t=null==e?void 0:e.orgKeys)&&void 0!==t?t:null}))}encryptedOrgKeys$(e){var t;return null===(t=this.userPrivateKey$(e))||void 0===t?void 0:t.pipe((0,b.n)(t=>null==t?(0,k.of)({}):(0,r.z)([this.stateProvider.getUser(e,z).state$,this.providerKeysHelper$(e,t)]).pipe((0,b.n)(e=>K(this,[e],void 0,function*([e,i]){const n=yield this.derivePublicKey(t),r={};e=null!=e?e:{};for(const t of Object.keys(e)){if(null!=r[t])continue;const s=D.fromData(e[t]);if(null==s)continue;let o;if(D.isProviderEncrypted(s)){if(null==i)continue;o=yield this.encryptService.encapsulateKeyUnsigned(yield s.decrypt(this.encryptService,i),n)}else o=s.encryptedOrganizationKey;r[t]=o}return r})),(0,T.W)(t=>(this.logService.error(`Failed to get encrypted organization keys for user ${e}`,t),(0,k.of)({}))))))}cipherDecryptionKeys$(e){var t;return null===(t=this.userPrivateKeyHelper$(e))||void 0===t?void 0:t.pipe((0,b.n)(t=>{if(null==t)return(0,k.of)(null);const i=t.userPrivateKey;return null==i?(0,k.of)({userKey:t.userKey,orgKeys:null}):(0,r.z)([this.stateProvider.getUser(e,z).state$,this.providerKeysHelper$(e,i)]).pipe((0,b.n)(e=>K(this,[e],void 0,function*([e,t]){const n={};e=null!=e?e:{};for(const r of Object.keys(e)){if(null!=n[r])continue;const s=D.fromData(e[r]);if(null==s)continue;let o;if(D.isProviderEncrypted(s)){if(null==t)continue;o=yield s.decrypt(this.encryptService,t)}else o=yield s.decrypt(this.encryptService,i);n[r]=o}return n})),(0,n.T)(e=>({userKey:t.userKey,orgKeys:e})))}))}userSignedPublicKey$(e){return this.accountCryptographyStateService.accountCryptographicState$(e).pipe((0,n.T)(e=>null==e?null:"V2"in e?e.V2.signed_public_key:null))}userKeyToStateObject(e){return null==e?null:{[X]:e}}stateObjectToUserKey(e){var t;return null==e?null:null!==(t=e[""])&&void 0!==t?t:null}}class H{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}}var W;!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(W||(W={}));class ${constructor(e){this.kdfType=W.PBKDF2_SHA256,this.iterations=null!=e?e:$.ITERATIONS.defaultValue}validateKdfConfigForSetting(){if(!$.ITERATIONS.inRange(this.iterations))throw new Error(`PBKDF2 iterations must be between ${$.ITERATIONS.min} and ${$.ITERATIONS.max}`)}validateKdfConfigForPrelogin(){if($.PRELOGIN_ITERATIONS_MIN>this.iterations)throw new Error(`PBKDF2 iterations must be at least ${$.PRELOGIN_ITERATIONS_MIN}, but was ${this.iterations}; possible pre-login downgrade attack detected.`)}static fromJSON(e){return new $(e.iterations)}toSdkConfig(){return{pBKDF2:{iterations:this.iterations}}}}$.ITERATIONS=new H(6e5,2e6,6e5),$.PRELOGIN_ITERATIONS_MIN=5e3;class J{constructor(e,t,i){this.kdfType=W.Argon2id,this.iterations=null!=e?e:J.ITERATIONS.defaultValue,this.memory=null!=t?t:J.MEMORY.defaultValue,this.parallelism=null!=i?i:J.PARALLELISM.defaultValue}validateKdfConfigForSetting(){if(!J.ITERATIONS.inRange(this.iterations))throw new Error(`Argon2 iterations must be between ${J.ITERATIONS.min} and ${J.ITERATIONS.max}`);if(!J.MEMORY.inRange(this.memory))throw new Error(`Argon2 memory must be between ${J.MEMORY.min} MiB and ${J.MEMORY.max} MiB`);if(!J.PARALLELISM.inRange(this.parallelism))throw new Error(`Argon2 parallelism must be between ${J.PARALLELISM.min} and ${J.PARALLELISM.max}.`)}validateKdfConfigForPrelogin(){if(J.PRELOGIN_ITERATIONS_MIN>this.iterations)throw new Error(`Argon2 iterations must be at least ${J.PRELOGIN_ITERATIONS_MIN}, but was ${this.iterations}; possible pre-login downgrade attack detected.`);if(J.PRELOGIN_MEMORY_MIN>this.memory)throw new Error(`Argon2 memory must be at least ${J.PRELOGIN_MEMORY_MIN} MiB, but was ${this.memory} MiB; possible pre-login downgrade attack detected.`);if(J.PRELOGIN_PARALLELISM_MIN>this.parallelism)throw new Error(`Argon2 parallelism must be at least ${J.PRELOGIN_PARALLELISM_MIN}, but was ${this.parallelism}; possible pre-login downgrade attack detected.`)}static fromJSON(e){return new J(e.iterations,e.memory,e.parallelism)}toSdkConfig(){return{argon2id:{iterations:this.iterations,memory:this.memory,parallelism:this.parallelism}}}}function Z(e){if("pBKDF2"in e)return new $(e.pBKDF2.iterations);if("argon2id"in e)return new J(e.argon2id.iterations,e.argon2id.memory,e.argon2id.parallelism);throw new Error("Unsupported KDF type")}J.MEMORY=new H(16,1024,64),J.PARALLELISM=new H(1,16,4),J.ITERATIONS=new H(2,10,3),J.PRELOGIN_MEMORY_MIN=16,J.PRELOGIN_PARALLELISM_MIN=1,J.PRELOGIN_ITERATIONS_MIN=2;const _=new $($.ITERATIONS.defaultValue);class ee{}var te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ie=new a.Ok(a.P7,"kdfConfig",{deserializer:e=>null==e?null:e.kdfType===W.PBKDF2_SHA256?$.fromJSON(e):J.fromJSON(e),clearOn:["logout"]});class ne{constructor(e){this.stateProvider=e}setKdfConfig(e,t){return te(this,void 0,void 0,function*(){if(null==e)throw new Error("userId cannot be null");if(null==t)throw new Error("kdfConfig cannot be null");yield this.stateProvider.setUserState(ie,t,e)})}getKdfConfig(e){return te(this,void 0,void 0,function*(){if(null==e)throw new Error("userId cannot be null");const t=yield(0,s._)(this.stateProvider.getUser(e,ie).state$);if(null==t)throw new Error("KdfConfig for user "+e+" is null");return t})}getKdfConfig$(e){if(null==e)throw new Error("userId cannot be null");return this.stateProvider.getUser(e,ie).state$}}class re{}var se=i(82468),oe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ae{constructor(e,t,i,n,r,s,o,a){this.keyService=e,this.cipherService=t,this.userAsymmetricKeysRegenerationApiService=i,this.logService=n,this.sdkService=r,this.apiService=s,this.configService=o,this.accountCryptographyStateService=a}regenerateIfNeeded(e){return oe(this,void 0,void 0,function*(){try{if(yield this.configService.getFeatureFlag(se.TO.PrivateKeyRegeneration)){(yield this.shouldRegenerate(e))&&(yield this.regenerateUserPublicKeyEncryptionKeyPair(e))}}catch(t){this.logService.error("[UserAsymmetricKeyRegeneration] An error occurred. Skipping regeneration for the user.",t)}})}shouldRegenerate(e){return oe(this,void 0,void 0,function*(){const t=yield(0,s._)(this.keyService.userKey$(e));if(!t)return this.logService.info("[UserAsymmetricKeyRegeneration] User symmetric key unavailable, skipping regeneration for the user."),!1;if(t.inner().type===U.Qd.CoseEncrypt0)return this.logService.error("[UserAsymmetricKeyRegeneration] Cannot regenerate asymmetric keys for accounts on V2 encryption."),!1;const i=yield(0,s._)(this.keyService.userEncryptedPrivateKey$(e));let r=null;try{r=yield this.apiService.getUserPublicKey(e)}catch(a){if(404!==(null==a?void 0:a.statusCode))throw a}if(!i&&!r)return this.logService.info("[UserAsymmetricKeyRegeneration] User has no asymmetric keys, attempting to create a new keypair."),!0;if(!i||!r)return this.logService.warning("[UserAsymmetricKeyRegeneration] User's asymmetric key initialization data is unavailable, skipping regeneration."),!1;const o=yield(0,s._)(this.sdkService.client$.pipe((0,n.T)(e=>{if(void 0===e)throw new Error("SDK is undefined");return e.crypto().verify_asymmetric_keys({userKey:t.keyB64,userPublicKey:r.publicKey,userKeyEncryptedPrivateKey:i})})));if(o.privateKeyDecryptable)return!o.validPrivateKey&&(this.logService.info("[UserAsymmetricKeyRegeneration] User's private key is decryptable but not a valid key, attempting regeneration."),!0);return(yield this.userKeyCanDecrypt(t,e))?(this.logService.info("[UserAsymmetricKeyRegeneration] User Asymmetric Key decryption failure detected, attempting regeneration."),!0):(this.logService.warning("[UserAsymmetricKeyRegeneration] User Asymmetric Key decryption failure detected, but unable to determine User Symmetric Key validity, skipping regeneration."),!1)})}regenerateUserPublicKeyEncryptionKeyPair(e){return oe(this,void 0,void 0,function*(){const t=yield(0,s._)(this.keyService.userKey$(e));if(null==t)throw new Error("User key not found");if(t.inner().type!==U.Qd.AesCbc256_HmacSha256_B64)throw new Error("User key is not V1 encryption type");const i=yield(0,s._)(this.sdkService.client$.pipe((0,n.T)(e=>{if(void 0===e)throw new Error("SDK is undefined");return e.crypto().make_key_pair(t.keyB64)})));try{yield this.userAsymmetricKeysRegenerationApiService.regenerateUserAsymmetricKeys(i.userPublicKey,new o.k(i.userKeyEncryptedPrivateKey))}catch(r){return"Key regeneration not supported for this user."===(null==r?void 0:r.message)?(this.logService.info("[UserAsymmetricKeyRegeneration] Regeneration not supported for this user at this time."),!1):(this.logService.error("[UserAsymmetricKeyRegeneration] Regeneration error when submitting the request to the server.",r),!1)}return yield this.accountCryptographyStateService.setAccountCryptographicState({V1:{private_key:i.userKeyEncryptedPrivateKey}},e),this.logService.info("[UserAsymmetricKeyRegeneration] User's asymmetric keys successfully regenerated."),!0})}userKeyCanDecrypt(e,t){return oe(this,void 0,void 0,function*(){const i=(yield this.cipherService.getAll(t)).find(e=>null==e.organizationId);if(!i)return!1;try{return!(yield i.decrypt(e)).decryptionFailure||(this.logService.error("[UserAsymmetricKeyRegeneration] User Symmetric Key validation error: Cipher decryption failed"),!1)}catch(n){return this.logService.error("[UserAsymmetricKeyRegeneration] User Symmetric Key validation error.",n),!1}})}}class le{}var ce=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class de{constructor(e){this.apiService=e}regenerateUserAsymmetricKeys(e,t){return ce(this,void 0,void 0,function*(){const i={userPublicKey:e,userKeyEncryptedUserPrivateKey:t};yield this.apiService.send("POST","/accounts/key-management/regenerate-keys",i,!0,!0)})}}},8936(e,t,i){"use strict";i.d(t,{B:()=>w,G:()=>C});var n=i(78991),r=i(23549),s=i(25304),o=i(19638);const a={id:o.N.addyio,name:"Addy.io"},l=[{site:s.YY.forwarder,product:{vendor:a},host:{authorization:"bearer",selfHost:"maybe",baseUrl:"https://app.addy.io"},requestedFields:[r.D0.token,r.D0.baseUrl,r.D0.domain]}],c=Object.freeze({id:o.N.bitwarden,name:"Bitwarden"}),d={id:o.N.duckduckgo,name:"DuckDuckGo"},u=[{site:s.YY.forwarder,product:{vendor:d},host:{authorization:"bearer",selfHost:"never",baseUrl:"https://quack.duckduckgo.com/api"},requestedFields:[r.D0.token]}],h={id:o.N.fastmail,name:"Fastmail"},A=[{site:s.YY.forwarder,product:{vendor:h},host:{authorization:"bearer",selfHost:"maybe",baseUrl:"https://api.fastmail.com"},requestedFields:[r.D0.token]}],p={id:o.N.forwardemail,name:"Forward Email"},g=[{site:s.YY.forwarder,product:{vendor:p},host:{authorization:"basic-username",selfHost:"never",baseUrl:"https://api.forwardemail.net"},requestedFields:[r.D0.domain,r.D0.token]}],v={id:o.N.mozilla,name:"Mozilla"},f=[{site:s.YY.forwarder,product:{vendor:v,name:"Firefox Relay"},host:{authorization:"token",selfHost:"never",baseUrl:"https://relay.firefox.com/api"},requestedFields:[r.D0.token]}],m={id:o.N.simplelogin,name:"SimpleLogin"},y=[{site:s.YY.forwarder,product:{vendor:m},host:{authentication:!0,selfHost:"maybe",baseUrl:"https://app.simplelogin.io"},requestedFields:[r.D0.baseUrl,r.D0.token,r.D0.domain]}],C=(0,n.ol)([a,c,d,h,p,v,m]),w=(0,n.ol)([l,u,A,g,f,y].flat())},8943(e,t,i){"use strict";i.d(t,{AJ:()=>p,mI:()=>A,Gn:()=>d,$9:()=>n});class n{}var r=i(82781),s=i(62870),o=i(68467),a=i(78781),l=i(43890),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d{constructor(e){this.cryptoFunctionService=e}createKey(e){return c(this,void 0,void 0,function*(){const t=yield this.cryptoFunctionService.aesGenerateKey(e);return new l.e(t)})}createKeyWithPurpose(e,t,i){return c(this,void 0,void 0,function*(){if(null==i){const e=yield this.cryptoFunctionService.randomBytes(32);i=a.A.fromBufferToUtf8(e.buffer)}const n=yield this.cryptoFunctionService.aesGenerateKey(e),r=yield this.cryptoFunctionService.hkdf(n,i,t,64,"sha256");return{salt:i,material:n,derivedKey:new l.e(r)}})}deriveKeyFromMaterial(e,t,i){return c(this,void 0,void 0,function*(){const n=yield this.cryptoFunctionService.hkdf(e,t,i,64,"sha256");return new l.e(n)})}deriveKeyFromPassword(e,t,i){return c(this,void 0,void 0,function*(){return"string"==typeof e&&(e=(new TextEncoder).encode(e)),"string"==typeof t&&(t=(new TextEncoder).encode(t)),yield s.B.Ready,new l.e(r.PureCrypto.derive_kdf_material(e,t,i.toSdkConfig()))})}stretchKey(e){return c(this,void 0,void 0,function*(){if(e.inner().type!=o.Qd.AesCbc256_B64)throw new Error("Key passed into stretchKey is not a 256-bit key.");const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e.inner().encryptionKey,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e.inner().encryptionKey,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new l.e(t)})}deriveVaultExportKey(e,t,i){return c(this,void 0,void 0,function*(){return yield this.stretchKey(yield this.deriveKeyFromPassword(e,t,i))})}}var u=i(55367),h=i.n(u);function A(e,t){const i=h().cipher.createDecipher("AES-ECB",a.A.fromArrayToByteString(t));if(i.start(),i.update(h().util.createBuffer(a.A.fromArrayToByteString(e))),!i.finish())throw new Error("AES-ECB decryption failed.");return a.A.fromByteStringToArray(i.output.getBytes())}function p(e,t,i){const n=h().cipher.createDecipher("AES-CBC",a.A.fromArrayToByteString(t));if(n.start({iv:a.A.fromArrayToByteString(i)}),n.update(h().util.createBuffer(a.A.fromArrayToByteString(e))),!n.finish())throw new Error("AES-CBC decryption failed.");return a.A.fromByteStringToArray(n.output.getBytes())}},9045(e,t,i){"use strict";i.d(t,{E:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 8.33 80 66.67">
    <path class="tw-fill-illustration-bg-primary" d="M8.333 66.667H20L18.333 75H10l-1.667-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.333 66.667 10 75h8.333L20 66.667H8.333Zm2.033 1.667 1 5h5.601l1-5h-7.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M60 66.667h11.667L70 75h-8.333L60 66.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 66.667 61.667 75H70l1.667-8.333H60Zm2.033 1.667 1 5h5.6l1-5h-7.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="m10.417 68.334.416 2.5H17.5l.417-2.5h-7.5ZM62.084 68.334l.416 2.5h6.667l.416-2.5h-7.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 15a6.667 6.667 0 0 1 6.667-6.666h66.666A6.667 6.667 0 0 1 80 15.001v46.666a6.667 6.667 0 0 1-6.666 6.667H6.666A6.667 6.667 0 0 1 0 61.667V15.001Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M73.334 10H6.666a5 5 0 0 0-5 5v46.667a5 5 0 0 0 5 5h66.666a5 5 0 0 0 5-5V15.001a5 5 0 0 0-5-5ZM6.666 8.335A6.667 6.667 0 0 0 0 15.001v46.666a6.667 6.667 0 0 0 6.667 6.667h66.666A6.667 6.667 0 0 0 80 61.667V15.001a6.667 6.667 0 0 0-6.666-6.667H6.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M6.667 18.333A3.333 3.333 0 0 1 10 15h60a3.333 3.333 0 0 1 3.333 3.333v40A3.333 3.333 0 0 1 70 61.667H10a3.333 3.333 0 0 1-3.333-3.334v-40Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 16.667H10c-.92 0-1.667.746-1.667 1.666v40C8.333 59.253 9.08 60 10 60h60c.92 0 1.667-.746 1.667-1.667v-40c0-.92-.746-1.666-1.667-1.666ZM10 15a3.333 3.333 0 0 0-3.333 3.333v40A3.333 3.333 0 0 0 10 61.667h60a3.333 3.333 0 0 0 3.333-3.334v-40A3.333 3.333 0 0 0 70 15H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M45 38.333c0 8.745-7.089 15.834-15.833 15.834-8.745 0-15.834-7.09-15.834-15.834S20.423 22.5 29.167 22.5 45 29.589 45 38.333Z"/>
    <path class="tw-fill-illustration-tertiary" d="M36.667 38.334a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M30 25a.833.833 0 0 0-1.666 0v4.204A9.125 9.125 0 0 0 23.3 31.29l-2.973-2.973a.834.834 0 0 0-1.179 1.179l2.973 2.973a9.125 9.125 0 0 0-2.084 5.032h-4.204a.833.833 0 1 0 0 1.667h4.204a9.125 9.125 0 0 0 2.084 5.032l-2.973 2.974a.833.833 0 1 0 1.179 1.178l2.973-2.973a9.127 9.127 0 0 0 5.033 2.085v4.204a.833.833 0 0 0 1.666 0v-4.204a9.127 9.127 0 0 0 5.033-2.085l2.973 2.973a.833.833 0 0 0 1.178-1.178l-2.973-2.974a9.125 9.125 0 0 0 2.085-5.032H42.5a.833.833 0 1 0 0-1.667h-4.204a9.125 9.125 0 0 0-2.085-5.032l2.973-2.973a.833.833 0 1 0-1.178-1.179l-2.973 2.973A9.125 9.125 0 0 0 30 29.204V25Zm4.468 18.64a7.5 7.5 0 1 1 0-10.61h.002l.003.003a7.476 7.476 0 0 1 2.194 5.297v.004c0 2.07-.839 3.944-2.195 5.301l-.002.002-.002.002ZM32.5 38.333a3.333 3.333 0 1 1-6.667 0 3.333 3.333 0 0 1 6.667 0Zm1.667 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M69.167 21.667c0-.92.746-1.667 1.666-1.667h3.334c.92 0 1.666.746 1.666 1.667V30c0 .92-.746 1.667-1.666 1.667h-3.334c-.92 0-1.666-.747-1.666-1.667v-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.167 21.667h-3.334V30h3.334v-8.333ZM70.833 20c-.92 0-1.666.746-1.666 1.667V30c0 .92.746 1.667 1.666 1.667h3.334c.92 0 1.666-.747 1.666-1.667v-8.333c0-.92-.746-1.667-1.666-1.667h-3.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M69.167 46.667c0-.92.746-1.667 1.666-1.667h3.334c.92 0 1.666.746 1.666 1.667V55c0 .92-.746 1.667-1.666 1.667h-3.334c-.92 0-1.666-.747-1.666-1.667v-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.167 46.667h-3.334V55h3.334v-8.333ZM70.833 45c-.92 0-1.666.746-1.666 1.667V55c0 .92.746 1.667 1.666 1.667h3.334c.92 0 1.666-.747 1.666-1.667v-8.333c0-.92-.746-1.667-1.666-1.667h-3.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M70.834 51.667V55h3.333v-3.333h-3.334ZM70.834 26.667V30h3.333v-3.333h-3.334Z" clip-rule="evenodd"/>
  </svg>
`},9083(e,t,i){"use strict";i.d(t,{Q0:()=>E,vA:()=>B});var n=i(72245),r=i(23965),s=i(3633),o=i(66316),a=i(81525),l=i(33812),c=i(69855),d=i(5556),u=i(50700),h=i(12012),A=i(35500),p=i(77468),g=i(3892),v=i(56898),f=i(67311),m=i(25740),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function C(e,t){if(1&e&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e){const e=l.XpG(2);l.R7$(),l.SpI(" ",l.i5U(2,1,"deleteSelectedItemsDesc",e.cipherIds.length+e.unassignedCiphers.length)," ")}}function w(e,t){if(1&e&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e){const e=l.XpG(2);l.R7$(),l.SpI(" ",l.i5U(2,1,"deleteSelectedCollectionsDesc",e.collections.length)," ")}}function I(e,t){if(1&e&&(l.qex(0),l.DNE(1,C,3,4,"span",2)(2,w,3,4,"span",2),l.EFF(3),l.nI1(4,"i18n"),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.Y8G("ngIf",(null==e.cipherIds?null:e.cipherIds.length)||(null==e.unassignedCiphers?null:e.unassignedCiphers.length)),l.R7$(),l.Y8G("ngIf",null==e.collections?null:e.collections.length),l.R7$(),l.SpI(" ",l.bMT(4,3,"deleteSelectedConfirmation")," ")}}function b(e,t){if(1&e&&(l.qex(0),l.EFF(1),l.nI1(2,"i18n"),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.SpI(" ",l.i5U(2,1,"permanentlyDeleteSelectedItemsDesc",e.cipherIds.length+e.unassignedCiphers.length)," ")}}const B={Deleted:"deleted",Canceled:"canceled"},E=(e,t)=>e.open(S,Object.assign({positionStrategy:new o.u3},t));class S{constructor(e,t,i,r,o,a,l,c){var d;this.dialogRef=t,this.cipherService=i,this.i18nService=r,this.apiService=o,this.collectionService=a,this.toastService=l,this.accountService=c,this.permanent=!1,this.submit=()=>y(this,void 0,void 0,function*(){const e=[];if(this.unassignedCiphers.length&&this.organization.canEditUnassignedCiphers&&e.push(this.deleteCiphersAdmin(this.unassignedCiphers)),this.cipherIds.length&&(this.organization&&this.organization.canEditAllCiphers?e.push(this.deleteCiphersAdmin(this.cipherIds)):e.push(this.deleteCiphers())),this.collections.length&&e.push(this.deleteCollections()),yield Promise.all(e),(this.cipherIds.length||this.unassignedCiphers.length)&&this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(this.permanent?"permanentlyDeletedItems":"deletedItems")}),this.collections.length){const e=yield(0,n._)(this.accountService.activeAccount$.pipe(s.F6));yield this.collectionService.delete(this.collections.map(e=>e.id),e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedCollections")})}this.close(B.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,this.unassignedCiphers=e.unassignedCiphers||[]}cancel(){return y(this,void 0,void 0,function*(){this.close(B.Canceled)})}deleteCiphers(){return y(this,void 0,void 0,function*(){var e;const t=null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers,i=yield(0,n._)(this.accountService.activeAccount$.pipe(s.F6));this.permanent?yield this.cipherService.deleteManyWithServer(this.cipherIds,i,t):yield this.cipherService.softDeleteManyWithServer(this.cipherIds,i,t)})}deleteCiphersAdmin(e){return y(this,void 0,void 0,function*(){const t=yield(0,n._)(this.accountService.activeAccount$.pipe(s.F6));this.permanent?yield this.cipherService.deleteManyWithServer(e,t,!0,this.organization.id):yield this.cipherService.softDeleteManyWithServer(e,t,!0,this.organization.id)})}deleteCollections(){return y(this,void 0,void 0,function*(){if(this.organization)return this.collections.some(e=>!e.canDelete(this.organization))?void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message: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.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message: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.rXU(a.Qs),l.rXU(o.ce),l.rXU(d.p),l.rXU(u.W),l.rXU(h.G),l.rXU(r.YD),l.rXU(c.f),l.rXU(A.D))},S.ɵcmp=l.VBU({type:S,selectors:[["ng-component"]],standalone:!1,decls:14,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.j41(0,"bit-simple-dialog")(1,"span",0),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"span",1),l.DNE(5,I,5,5,"ng-container",2)(6,b,3,4,"ng-container",2),l.k0s(),l.qex(7,3),l.j41(8,"button",4),l.EFF(9),l.nI1(10,"i18n"),l.k0s(),l.j41(11,"button",5),l.bIt("click",function(){return t.cancel()}),l.EFF(12),l.nI1(13,"i18n"),l.k0s(),l.bVm(),l.k0s()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,6,t.permanent?"permanentlyDeleteSelected":"deleteSelected")," "),l.R7$(3),l.Y8G("ngIf",!t.permanent),l.R7$(),l.Y8G("ngIf",t.permanent),l.R7$(2),l.Y8G("bitAction",t.submit),l.R7$(),l.SpI(" ",l.bMT(10,8,t.permanent?"permanentlyDelete":"delete")," "),l.R7$(3),l.JRh(l.bMT(13,10,"cancel")))},dependencies:[p.bT,g.p,v.Q,f.hJ,f.o_,m.$],encapsulation:2})},9171(e,t,i){"use strict";i.d(t,{R:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 1.49 96 94.02">
    <path class="tw-fill-illustration-bg-primary" d="M79 48.5c0 17.12-13.88 31-31 31-17.12 0-31-13.88-31-31 0-17.12 13.88-31 31-31 17.12 0 31 13.88 31 31Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48 18.5c-16.569 0-30 13.431-30 30 0 16.569 13.431 30 30 30 16.569 0 30-13.431 30-30 0-16.569-13.431-30-30-30Zm-32 30c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M0 48.5c0-6.627 5.373-12 12-12h72c6.627 0 12 5.373 12 12s-5.373 12-12 12H12c-6.627 0-12-5.373-12-12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84 38.5H12c-5.523 0-10 4.477-10 10s4.477 10 10 10h72c5.523 0 10-4.477 10-10s-4.477-10-10-10Zm-72-2c-6.627 0-12 5.373-12 12s5.373 12 12 12h72c6.627 0 12-5.373 12-12s-5.373-12-12-12H12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20 42.5c.552 0 1 .467 1 1.042v4.175l3.74-1.989c.508-.27 1.13-.094 1.39.394.259.488.057 1.102-.45 1.372l-4.038 2.147 3.228 3.462c.392.42.383 1.067-.02 1.444-.405.376-1.05.34-1.443-.08L20 50.813l-3.408 3.654c-.392.42-1.038.456-1.441.08-.404-.377-.414-1.023-.021-1.444l3.228-3.462-4.038-2.147c-.508-.27-.71-.884-.45-1.372.26-.488.881-.664 1.39-.394l3.74 1.99v-4.176c0-.575.448-1.042 1-1.042Zm16 0c.552 0 1 .467 1 1.042v4.175l3.74-1.989c.508-.27 1.13-.094 1.39.394.259.488.057 1.102-.45 1.372l-4.038 2.147 3.228 3.462c.392.42.383 1.067-.02 1.444-.405.376-1.05.34-1.443-.08L36 50.813l-3.408 3.654c-.392.42-1.038.456-1.441.08-.404-.377-.414-1.023-.021-1.444l3.228-3.462-4.038-2.147c-.508-.27-.71-.884-.45-1.372.26-.488.881-.664 1.39-.394l3.74 1.99v-4.176c0-.575.447-1.042 1-1.042Zm17 1.042c0-.575-.448-1.042-1-1.042-.553 0-1 .467-1 1.042v4.175l-3.74-1.989c-.509-.27-1.13-.094-1.39.394s-.058 1.102.45 1.372l4.038 2.147-3.228 3.462c-.393.42-.383 1.067.02 1.444.404.376 1.05.34 1.442-.08L52 50.813l3.407 3.654c.393.42 1.038.456 1.442.08.404-.377.413-1.023.02-1.444l-3.227-3.462 4.037-2.147c.508-.27.71-.884.45-1.372-.259-.488-.88-.664-1.389-.394L53 47.717v-4.175Zm8 9.958a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2h-8a1 1 0 0 1-1-1Zm13-1a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M58.327 92.299c11.605-2.736 21.09-9.736 27.192-18.952a1 1 0 1 1 1.667 1.104c-6.37 9.624-16.28 16.937-28.4 19.795-19.671 4.637-39.367-3.824-49.937-19.72a1 1 0 1 1 1.666-1.107c10.121 15.221 28.98 23.32 47.812 18.88Zm28.545-68.44a1 1 0 0 1-1.386-.278C75.364 8.359 56.505.26 37.674 4.7 25.348 7.607 15.413 15.322 9.385 25.394a1 1 0 1 1-1.716-1.027C13.963 13.85 24.342 5.79 37.215 2.754c19.67-4.638 39.367 3.824 49.936 19.72a1 1 0 0 1-.279 1.386Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M24 73.5a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v14a1 1 0 1 0 2 0v-13h13a1 1 0 0 0 1-1ZM72 23.5a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-14a1 1 0 1 0-2 0v13H73a1 1 0 0 0-1 1ZM22.618 64.5a29.913 29.913 0 0 1-2.122-4h55.008a29.913 29.913 0 0 1-2.122 4H22.618Z" clip-rule="evenodd"/>
  </svg>
  `},9184(e,t,i){"use strict";i.d(t,{b:()=>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)}}},9327(e,t,i){"use strict";i.d(t,{cH:()=>w.c,cK:()=>g,dA:()=>C,Hd:()=>v.H});var n=i(20702),r=i(47438);class s extends n.r{constructor(e){super(e);const t=this.getResponseProperty("FreeTrial");t&&(this.freeTrial=new o(t));const i=this.getResponseProperty("InactiveSubscription");i&&(this.inactiveSubscription=new a(i));const n=this.getResponseProperty("ResellerRenewal");n&&(this.resellerRenewal=new l(n));const s=this.getResponseProperty("TaxId");s&&(this.taxId=new r.c(s))}}class o extends n.r{constructor(e){super(e),this.remainingTrialDays=this.getResponseProperty("RemainingTrialDays")}}class a extends n.r{constructor(e){super(e),this.resolution=this.getResponseProperty("Resolution")}}class l extends n.r{constructor(e){switch(super(e),this.type=this.getResponseProperty("Type"),this.type){case"upcoming":this.upcoming=new c(this.getResponseProperty("Upcoming"));break;case"issued":this.issued=new d(this.getResponseProperty("Issued"));break;case"past_due":this.pastDue=new u(this.getResponseProperty("PastDue"))}}}class c extends n.r{constructor(e){super(e),this.renewalDate=new Date(this.getResponseProperty("RenewalDate"))}}class d extends n.r{constructor(e){super(e),this.issuedDate=new Date(this.getResponseProperty("IssuedDate")),this.dueDate=new Date(this.getResponseProperty("DueDate"))}}class u extends n.r{constructor(e){super(e),this.suspensionDate=new Date(this.getResponseProperty("SuspensionDate"))}}var h=i(74208),A=i(12012),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class g{constructor(e){this.apiService=e,this.getWarnings=e=>p(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/billing/vnext/warnings`,null,!0,!0);return new s(t)})}}g.ɵfac=function(e){return new(e||g)(h.KVO(A.G))},g.ɵprov=h.jDH({token:g,factory:g.ɵfac,providedIn:"root"});var v=i(60577),f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m extends n.r{constructor(e){super(e),this.tax=this.getResponseProperty("Tax"),this.total=this.getResponseProperty("Total")}}class y extends n.r{constructor(e){super(e),this.tax=this.getResponseProperty("Tax"),this.total=this.getResponseProperty("Total"),this.credit=this.getResponseProperty("Credit"),this.newPlanProratedMonths=this.getResponseProperty("NewPlanProratedMonths"),this.newPlanProratedAmount=this.getResponseProperty("NewPlanProratedAmount")}}class C{constructor(e){this.apiService=e,this.previewTaxForOrganizationSubscriptionPurchase=(e,t,i)=>f(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST","/billing/preview-invoice/organizations/subscriptions/purchase",{purchase:Object.assign(Object.assign({},e),(null==i?void 0:i.length)?{coupons:i}:{}),billingAddress:t},!0,!0);return new m(n)}),this.previewTaxForOrganizationSubscriptionPlanChange=(e,t,i)=>f(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST",`/billing/preview-invoice/organizations/${e}/subscription/plan-change`,{plan:t,billingAddress:i},!0,!0);return new m(n)}),this.previewTaxForOrganizationSubscriptionUpdate=(e,t)=>f(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/billing/preview-invoice/organizations/${e}/subscription/update`,{update:t},!0,!0);return new m(i)}),this.previewTaxForPremiumSubscriptionPurchase=(e,t,i)=>f(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST","/billing/preview-invoice/premium/subscriptions/purchase",Object.assign({additionalStorage:e,billingAddress:t},(null==i?void 0:i.length)?{coupons:i}:{}),!0,!0);return new m(n)}),this.previewProrationForPremiumUpgrade=(e,t)=>f(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/billing/preview-invoice/premium/subscriptions/upgrade",{targetProductTierType:e,billingAddress:t},!0,!0);return new y(i)})}}C.ɵfac=function(e){return new(e||C)(h.KVO(A.G))},C.ɵprov=h.jDH({token:C,factory:C.ɵfac,providedIn:"root"});var w=i(11728)},9396(e,t,i){"use strict";i.d(t,{T:()=>n});const n=()=>"undefined"!=typeof document&&parseFloat(getComputedStyle(document.documentElement).fontSize)||16},9413(e,t,i){"use strict";i.d(t,{S:()=>a});var n=i(59333),r=i(80755),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({providers:[n.J,r.p]})},9753(e,t,i){"use strict";i.d(t,{tD:()=>U,I$:()=>z,M0:()=>le,H8:()=>je,Ww:()=>ke,ve:()=>Z,vU:()=>X.vU,Pu:()=>M.P,kx:()=>X.kx,c3:()=>X.c3});var n=i(81525),r=i(33812),s=i(51757),o=i(3204),a=i(9327),l=i(25065),c=i(74208),d=i(1601),u=i(66316),h=i(69855),A=i(50700),p=i(37115),g=i(26657),v=i(38620),f=i(56898),m=i(7730),y=i(68016),C=i(67311),w=i(86226),I=i(97553),b=i(43759),B=i(36288);class E{constructor(e){this.iconButtonComponent=e,this.classList=["tw-text-muted"]}ngOnInit(){this.iconButtonComponent&&this.iconButtonComponent.size.set("small")}}E.ɵfac=function(e){return new(e||E)(r.rXU(B.s,8))},E.ɵdir=r.FsC({type:E,selectors:[["","bitPrefix",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)}});var S=i(24374),Q=i(17721),k=i(58806),T=i(77468),F=i(25740),P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const R=["payPalForm"];class D{constructor(e,t,i,n,r,a,l){var c;this.billingClient=e,this.configService=t,this.dialogParams=i,this.dialogRef=n,this.i18nService=r,this.platformUtilsService=a,this.toastService=l,this.payPalConfig={},this.redirectUrl=window.location.href,this.formGroup=new s.gE({paymentMethod:new s.MJ("payPal"),amount:new s.MJ("0.00",[s.k0.required,(c=this.i18nService.t("mustBePositiveNumber"),e=>{if(!e.value)return null;const t=parseFloat(e.value);return isNaN(t)||t<=0?{notPositiveNumber:{message:c}}:null})])}),this.payPalCustom$=this.configService.cloudRegion$.pipe((0,o.T)(e=>{switch(this.dialogParams.subscriber.type){case"account":return`user_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`;case"organization":return`organization_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`;case"provider":return`provider_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`}})),this.submit=()=>P(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.valid){if("bitPay"===this.formGroup.value.paymentMethod){const e=yield this.billingClient.addCreditWithBitPay(this.dialogParams.subscriber,{amount:this.amount,redirectUrl:this.redirectUrl});switch(e.type){case"success":this.platformUtilsService.launchUri(e.value),this.dialogRef.close("launched");break;case"error":this.toastService.showToast({variant:"error",title:"",message:e.message}),this.dialogRef.close("error")}}this.payPalForm.nativeElement.submit(),this.dialogRef.close("launched")}}),this.formatAmount=()=>{if(this.formGroup.value.amount){const e=parseFloat(this.formGroup.value.amount);isNaN(e)?this.formGroup.controls.amount.setValue(null):this.formGroup.controls.amount.setValue(e.toFixed(2).toString())}}}get amount(){if(this.formGroup.value.amount){const e=parseFloat(this.formGroup.value.amount);return isNaN(e)?null:e}return null}get payPalSubject(){switch(this.dialogParams.subscriber.type){case"account":return this.dialogParams.subscriber.data.email;case"organization":case"provider":return this.dialogParams.subscriber.data.name}}}D.open=(e,t)=>e.open(D,t),D.ɵfac=function(e){return new(e||D)(r.rXU(a.Hd),r.rXU(d.w),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(A.W),r.rXU(p.y),r.rXU(h.f))},D.ɵcmp=r.VBU({type:D,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&r.GBs(R,7,r.aKT),2&e){let e;r.mGM(e=r.lsd())&&(t.payPalForm=e.first)}},decls:52,vars:38,consts:[["payPalForm",""],[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],["bitTypography","body1"],[1,"tw-grid","tw-grid-cols-2"],[3,"formControl"],["id","credit-method-paypal",3,"value"],[1,"bwi","bwi-paypal"],["id","credit-method-bitcoin",3,"value"],[1,"bwi","bwi-bitcoin"],["bitInput","","type","text","required","",3,"blur","formControl"],["bitPrefix",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"bitDialogClose"],["method","post","target","_top",3,"action"],["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"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"form",1)(1,"bit-dialog")(2,"span",2),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",3)(6,"p",4),r.EFF(7),r.nI1(8,"i18n"),r.k0s(),r.j41(9,"div",5)(10,"bit-radio-group",6)(11,"bit-radio-button",7)(12,"bit-label"),r.nrm(13,"i",8),r.EFF(14,"PayPal"),r.k0s()(),r.j41(15,"bit-radio-button",9)(16,"bit-label"),r.nrm(17,"i",10),r.EFF(18,"Bitcoin"),r.k0s()()()(),r.j41(19,"div",5)(20,"bit-form-field")(21,"bit-label"),r.EFF(22),r.nI1(23,"i18n"),r.k0s(),r.j41(24,"input",11),r.bIt("blur",function(){return c.eBV(e),c.Njj(t.formatAmount())}),r.k0s(),r.j41(25,"span",12),r.EFF(26,"$USD"),r.k0s()()()(),r.qex(27,13),r.j41(28,"button",14),r.EFF(29),r.nI1(30,"i18n"),r.k0s(),r.j41(31,"button",15),r.EFF(32),r.nI1(33,"i18n"),r.k0s(),r.bVm(),r.k0s()(),r.j41(34,"form",16,0),r.nrm(36,"input",17)(37,"input",18)(38,"input",19)(39,"input",20)(40,"input",21)(41,"input",22)(42,"input",23)(43,"input",24)(44,"input",25)(45,"input",26)(46,"input",27)(47,"input",28)(48,"input",29),r.nI1(49,"async"),r.nrm(50,"input",30)(51,"input",31),r.k0s()}2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,26,"addCredit")," "),r.R7$(4),r.JRh(r.bMT(8,28,"creditDelayed")),r.R7$(3),r.Y8G("formControl",t.formGroup.controls.paymentMethod),r.R7$(),r.Y8G("value","payPal"),r.R7$(4),r.Y8G("value","bitPay"),r.R7$(7),r.JRh(r.bMT(23,30,"amount")),r.R7$(2),r.Y8G("formControl",t.formGroup.controls.amount),r.R7$(5),r.SpI(" ",r.bMT(30,32,"submit")," "),r.R7$(2),r.Y8G("bitDialogClose","cancelled"),r.R7$(),r.SpI(" ",r.bMT(33,34,"cancel")," "),r.R7$(2),r.Y8G("action",r.mNQ(t.payPalConfig.buttonAction),r.B4B),r.R7$(3),r.Y8G("value",r.mNQ(t.payPalConfig.businessId)),r.R7$(5),r.Y8G("value",r.mNQ(t.redirectUrl)),r.R7$(),r.Y8G("value",r.mNQ(t.redirectUrl)),r.R7$(4),r.Y8G("value",r.mNQ(t.amount)),r.R7$(),r.Y8G("value",r.mNQ(r.bMT(49,36,t.payPalCustom$))),r.R7$(3),r.Y8G("value",r.mNQ(t.payPalSubject)))},dependencies:[l.G,s.qT,s.me,s.BC,s.cb,s.YS,s.cV,s.l_,s.j4,g.$,v.L,f.Q,m.I,y.m,C.hJ,w.j,I.J,b.h,E,S.d,Q.Y,k.r,T.Jj,F.$],encapsulation:2});var M=i(21587),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class O{constructor(e,t,i,n){this.billingClient=e,this.dialogRef=t,this.i18nService=i,this.toastService=n,this.formGroup=M.P.getFormGroup(),this.submit=()=>x(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.valid)return;const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t="payPal"!==this.formGroup.value.type?this.formGroup.controls.billingAddress.getRawValue():null,i=yield this.billingClient.updatePaymentMethod(this.subscriber,e,t);switch(i.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("paymentMethodUpdated")}),this.dialogRef.close({type:"success",paymentMethod:i.value});break;case"error":this.toastService.showToast({variant:"error",title:"",message:i.message}),this.dialogRef.close({type:"error"})}})}}O.ɵfac=function(e){return new(e||O)(r.rXU(a.Hd),r.rXU(u.ce),r.rXU(A.W),r.rXU(h.f))},O.ɵcmp=r.VBU({type:O,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&r.GBs(M.P,5),2&e){let e;r.mGM(e=r.lsd())&&(t.enterPaymentMethodComponent=e.first)}},decls:0,vars:0,template:function(e,t){},encapsulation:2});const G=()=>({type:"cancelled"});class U extends O{constructor(e,t,i,n,r){super(e,i,n,r),this.dialogParams=t,this.subscriber=this.dialogParams.subscriber}}U.open=(e,t)=>e.open(U,t),U.ɵfac=function(e){return new(e||U)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(A.W),r.rXU(h.f))},U.ɵcmp=r.VBU({type:U,selectors:[["ng-component"]],features:[r.Vt3],decls:14,vars:16,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"group","showBankAccount","includeBillingAddress"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2),r.nrm(6,"app-enter-payment-method",3),r.k0s(),r.qex(7,4),r.j41(8,"button",5),r.EFF(9),r.nI1(10,"i18n"),r.k0s(),r.j41(11,"button",6),r.EFF(12),r.nI1(13,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"changePaymentMethod")," "),r.R7$(3),r.Y8G("group",t.formGroup)("showBankAccount","account"!==t.dialogParams.subscriber.type)("includeBillingAddress",!0),r.R7$(3),r.SpI(" ",r.bMT(10,11,"save")," "),r.R7$(2),r.Y8G("bitDialogClose",r.lJ4(15,G)),r.R7$(),r.SpI(" ",r.bMT(13,13,"cancel")," "))},dependencies:[M.P,l.G,s.qT,s.cb,s.j4,g.$,v.L,f.Q,m.I,y.m,C.hJ,F.$],encapsulation:2});var V=i(3892),j=i(88832),N=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class z{constructor(e,t,i,n){this.billingClient=e,this.dialogService=t,this.i18nService=i,this.toastService=n,this.addAccountCredit=()=>N(this,void 0,void 0,function*(){if("account"!==this.subscriber.type){(yield this.billingClient.getBillingAddress(this.subscriber))||this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("billingAddressRequiredToAddCredit")})}D.open(this.dialogService,{data:{subscriber:this.subscriber}})})}}z.ɵfac=function(e){return new(e||z)(r.rXU(a.Hd),r.rXU(u.o3),r.rXU(A.W),r.rXU(h.f))},z.ɵcmp=r.VBU({type:z,selectors:[["app-display-account-credit"]],inputs:{subscriber:"subscriber",credit:"credit"},decls:11,vars:14,consts:[["bitTypography","h2"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"]],template:function(e,t){var i;1&e&&(r.j41(0,"bit-section")(1,"h2",0),r.EFF(2),r.nI1(3,"i18n"),r.nI1(4,"currency"),r.k0s(),r.j41(5,"p"),r.EFF(6),r.nI1(7,"i18n"),r.k0s(),r.j41(8,"button",1),r.EFF(9),r.nI1(10,"i18n"),r.k0s()()),2&e&&(r.R7$(2),r.Lme("",r.bMT(3,5,"accountCredit"),": ",r.i5U(4,7,null!==(i=t.credit)&&void 0!==i?i:0,"$")),r.R7$(4),r.JRh(r.bMT(7,10,"availableCreditAppliedToInvoice")),r.R7$(2),r.Y8G("bitAction",t.addAccountCredit),r.R7$(),r.SpI(" ",r.bMT(10,12,"addCredit")," "))},dependencies:[l.G,V.p,f.Q,j.n,k.r,T.oe,F.$],encapsulation:2});var Y=i(88565),L=i(64447),K=i(47438),X=i(34923),q=i(44432),H=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const W=(e,t,i)=>({type:"update",existing:e,supportsTaxId:t,taxIdWarning:i}),$=()=>({type:"cancelled"});function J(e,t){if(1&e&&(r.j41(0,"bit-callout",3),r.EFF(1),r.k0s()),2&e){r.XpG();const e=r.r8f(6);r.Y8G("type",e.type)("title",e.title),r.R7$(),r.SpI(" ",e.message," ")}}class Z{constructor(e,t,i,n,r){var s;this.billingClient=e,this.dialogParams=t,this.dialogRef=i,this.i18nService=n,this.toastService=r,this.formGroup=X.vU.getFormGroup(),this.submit=()=>H(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=(0,X.c3)(this.formGroup),t=yield this.billingClient.updateBillingAddress(this.dialogParams.subscriber,e);switch(t.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("billingAddressUpdated")}),this.dialogRef.close({type:"success",billingAddress:t.value});break;case"error":this.toastService.showToast({variant:"error",title:"",message:t.message}),this.dialogRef.close({type:"error"})}}),t.billingAddress&&this.formGroup.patchValue(Object.assign(Object.assign({},t.billingAddress),{taxId:null===(s=t.billingAddress.taxId)||void 0===s?void 0:s.value}))}get supportsTaxId(){switch(this.dialogParams.subscriber.type){case"account":return!1;case"organization":return[L.K_.TeamsStarter,L.K_.Teams,L.K_.Enterprise].includes(this.dialogParams.subscriber.data.productTierType);case"provider":return!0}}get taxIdWarningCallout(){if(!this.supportsTaxId||!this.dialogParams.taxIdWarning||this.dialogParams.taxIdWarning===K.e.PendingVerification)return null;switch(this.dialogParams.taxIdWarning){case K.e.Missing:return{type:"warning",title:this.i18nService.t("missingTaxIdCalloutTitle"),message:this.i18nService.t("missingTaxIdCalloutDescription")};case K.e.FailedVerification:return{type:"warning",title:this.i18nService.t("unverifiedTaxIdCalloutTitle"),message:this.i18nService.t("unverifiedTaxIdCalloutDescription")}}}}Z.open=(e,t)=>e.open(Z,t),Z.ɵfac=function(e){return new(e||Z)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(A.W),r.rXU(h.f))},Z.ɵcmp=r.VBU({type:Z,selectors:[["ng-component"]],decls:16,vars:21,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"type","title"],[3,"scenario","group"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){if(1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2),r.SS7(6),r.nVh(7,J,2,3,"bit-callout",3),r.nrm(8,"app-enter-billing-address",4),r.k0s(),r.qex(9,5),r.j41(10,"button",6),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.j41(13,"button",7),r.EFF(14),r.nI1(15,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e){r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"editBillingAddress")," "),r.R7$(3);const e=r.bH3(t.taxIdWarningCallout);r.R7$(),r.vxM(e?7:-1),r.R7$(),r.Y8G("scenario",r.sMw(16,W,t.dialogParams.billingAddress,t.supportsTaxId,t.dialogParams.taxIdWarning))("group",t.formGroup),r.R7$(3),r.SpI(" ",r.bMT(12,12,"save")," "),r.R7$(2),r.Y8G("bitDialogClose",r.lJ4(20,$)),r.R7$(),r.SpI(" ",r.bMT(15,14,"cancel")," ")}},dependencies:[X.vU,l.G,s.qT,s.cb,s.j4,g.$,v.L,f.Q,q.G,m.I,y.m,C.hJ,F.$],encapsulation:2});class _{transform(e){const t=[];return e.line1&&t.push(e.line1),e.line2&&t.push(e.line2),e.city&&t.push(e.city),e.state&&t.push(e.state),t.push(e.postalCode,e.country),t.join(", ")}}_.ɵfac=function(e){return new(e||_)},_.ɵpipe=r.EJ8({name:"address",type:_,pure:!0});var ee=i(47696),te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ie(e,t){1&e&&(r.j41(0,"span",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"missingTaxId")))}function ne(e,t){1&e&&(r.j41(0,"span",4),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"pendingVerification")))}function re(e,t){1&e&&(r.j41(0,"span",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"unverified")))}function se(e,t){if(1&e&&(r.j41(0,"p",3),r.EFF(1),r.nI1(2,"i18n"),r.nVh(3,ne,3,3,"span",4),r.nVh(4,re,3,3,"span",1),r.k0s()),2&e){const e=r.XpG(2);r.R7$(),r.SpI(" ",r.i5U(2,3,"taxId",e.billingAddress.taxId.value)," "),r.R7$(2),r.vxM(e.showTaxIdPendingVerificationBadge?3:-1),r.R7$(),r.vxM(e.showUnverifiedTaxIdBadge?4:-1)}}function oe(e,t){if(1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"address"),r.k0s(),r.nVh(3,se,5,6,"p",3)),2&e){const e=r.XpG();r.R7$(),r.JRh(r.bMT(2,2,e.billingAddress)),r.R7$(2),r.vxM(e.billingAddress.taxId?3:-1)}}function ae(e,t){1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"noBillingAddress")))}class le{constructor(e){this.dialogService=e,this.updated=new r.bkB,this.editBillingAddress=()=>te(this,void 0,void 0,function*(){const e=Z.open(this.dialogService,{data:{subscriber:this.subscriber,billingAddress:this.billingAddress,taxIdWarning:this.taxIdWarning}}),t=yield(0,Y.s)(e.closed);"success"===(null==t?void 0:t.type)&&this.updated.emit(t.billingAddress)})}get showMissingTaxIdBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.Missing}get showTaxIdPendingVerificationBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.PendingVerification}get showUnverifiedTaxIdBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.FailedVerification}}le.ɵfac=function(e){return new(e||le)(r.rXU(u.o3))},le.ɵcmp=r.VBU({type:le,selectors:[["app-display-billing-address"]],inputs:{subscriber:"subscriber",billingAddress:"billingAddress",taxIdWarning:"taxIdWarning"},outputs:{updated:"updated"},decls:10,vars:9,consts:[["bitTypography","h2"],["bitBadge","","variant","warning"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],[1,"tw-flex","tw-items-center","tw-gap-2"],["bitBadge","","variant","secondary"]],template:function(e,t){if(1&e&&(r.j41(0,"bit-section")(1,"h2",0),r.EFF(2),r.nI1(3,"i18n"),r.nVh(4,ie,3,3,"span",1),r.k0s(),r.nVh(5,oe,4,4)(6,ae,3,3,"p"),r.j41(7,"button",2),r.EFF(8),r.nI1(9,"i18n"),r.k0s()()),2&e){r.R7$(2),r.SpI(" ",r.bMT(3,5,"billingAddress")," "),r.R7$(2),r.vxM(t.showMissingTaxIdBadge?4:-1),r.R7$(),r.vxM(t.billingAddress?5:6);const e=t.billingAddress?"editBillingAddress":"addBillingAddress";r.R7$(2),r.Y8G("bitAction",t.editBillingAddress),r.R7$(),r.SpI(" ",r.bMT(9,7,e)," ")}},dependencies:[l.G,V.p,ee.n,f.Q,j.n,k.r,_,F.$],encapsulation:2});var ce=i(94573),de=i(33277),ue=i(90107),he=i(14055),Ae=i(58384),pe=i(57178),ge=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ve(e,t){if(1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"i18n"),r.j41(3,"a",7),r.EFF(4),r.nI1(5,"i18n"),r.k0s()()),2&e){const e=r.XpG(2);r.R7$(),r.SpI(" ",r.bMT(2,3,"verifyBankAccountWithStripe")," "),r.R7$(2),r.BMQ("href",e.hostedVerificationUrl,r.B4B),r.R7$(),r.JRh(r.bMT(5,5,"verifyNow"))}}function fe(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI("- ",r.bMT(2,1,"unverified")))}function me(e,t){if(1&e&&(r.nVh(0,ve,6,7,"p"),r.j41(1,"p"),r.nrm(2,"bit-icon",6),r.EFF(3),r.nVh(4,fe,3,3,"span"),r.k0s()),2&e){const e=r.XpG();r.vxM(e.hostedVerificationUrl?0:-1),r.R7$(3),r.Lme(" ",e.bankName,", *",e.last4," "),r.R7$(),r.vxM(e.hostedVerificationUrl?4:-1)}}function ye(e,t){1&e&&r.nrm(0,"i"),2&e&&r.HbH(r.VkB("bwi bwi-fw credit-card-icon ",t))}function Ce(e,t){1&e&&r.nrm(0,"bit-icon",9)}function we(e,t){if(1&e&&(r.j41(0,"p",5),r.nVh(1,ye,1,3,"i",8)(2,Ce,1,0,"bit-icon",9),r.EFF(3),r.nI1(4,"titlecase"),r.k0s()),2&e){let e;const t=r.XpG(),i=r.XpG(2);r.R7$(),r.vxM((e=i.cardBrandIcon())?1:2,e),r.R7$(2),r.E5c(" ",r.bMT(4,4,t.brand),", *",t.last4,", ",t.expiration," ")}}function Ie(e,t){if(1&e&&(r.j41(0,"p"),r.nrm(1,"bit-icon",10),r.EFF(2),r.k0s()),2&e){const e=r.XpG();r.R7$(2),r.SpI(" ",e.email," ")}}function be(e,t){if(1&e&&r.nVh(0,me,5,4)(1,we,5,6,"p",5)(2,Ie,3,1,"p"),2&e){let e;r.vxM("bankAccount"===(e=t.type)?0:"card"===e?1:"payPal"===e?2:-1)}}function Be(e,t){1&e&&(r.j41(0,"p",3),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"noPaymentMethod")))}function Ee(e,t){if(1&e){const e=r.RV6();r.j41(0,"h5",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s(),r.j41(3,"div",2),r.nVh(4,be,3,1)(5,Be,3,3,"p",3),r.j41(6,"a",4),r.bIt("click",function(){c.eBV(e);const t=r.XpG();return c.Njj(t.changePaymentMethod())}),r.EFF(7),r.nI1(8,"i18n"),r.k0s()()}if(2&e){let e;const t=r.XpG();r.R7$(),r.JRh(r.bMT(2,3,"paymentMethod")),r.R7$(3),r.vxM((e=t.paymentMethod())?4:5,e);const i=t.paymentMethod()?"changePaymentMethod":"addPaymentMethod";r.R7$(3),r.SpI(" ",r.bMT(8,5,i))}}function Se(e,t){if(1&e){const e=r.RV6();r.j41(0,"div",12)(1,"button",13),r.bIt("click",function(){c.eBV(e);const t=r.XpG(2);return c.Njj(t.submit())}),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.j41(4,"button",14),r.bIt("click",function(){c.eBV(e);const t=r.XpG(2);return c.Njj(t.cancel())}),r.EFF(5),r.nI1(6,"i18n"),r.k0s()()}if(2&e){const e=r.XpG(2);r.R7$(),r.Y8G("disabled",e.formGroup.invalid),r.R7$(),r.SpI(" ",r.bMT(3,3,"save")," "),r.R7$(3),r.SpI(" ",r.bMT(6,5,"cancel")," ")}}function Qe(e,t){if(1&e&&(r.nrm(0,"app-enter-payment-method",11,0),r.nVh(2,Se,7,7,"div",12)),2&e){const e=r.XpG();r.Y8G("includeBillingAddress",!1)("group",e.formGroup)("showBankAccount",!0)("showAccountCredit",!1),r.R7$(2),r.vxM(e.showFormButtons()?2:-1)}}class ke{constructor(){var e;this.subscriber=ce.hFB.required(),this.paymentMethod=ce.hFB.required(),this.externalFormGroup=(0,ce.hFB)(null),this.updated=(0,ce.CGW)(),this.enterPaymentMethodComponent=(0,ce.ebz)(M.P),this.isChangingPayment=(0,c.vPA)(!1),this.cardBrandIcon=(0,de.EW)(()=>(0,he.nS)(this.paymentMethod())),this.showFormButtons=(0,de.EW)(()=>null===this.externalFormGroup()),this.billingClient=(0,c.WQX)(a.Hd),this.i18nService=(0,c.WQX)(A.W),this.toastService=(0,c.WQX)(h.f),this.logService=(0,c.WQX)(ue.Kc),this.changePaymentMethod=()=>ge(this,void 0,void 0,function*(){this.isChangingPayment.set(!0)}),this.submit=()=>ge(this,void 0,void 0,function*(){try{const e=yield this.getTokenizedPaymentMethod(),t=this.formGroup.value.type!==he.vj.payPal?this.formGroup.controls.billingAddress.getRawValue():null;yield this.handlePaymentMethodUpdate(e,t)}catch(e){throw this.logService.error("Error submitting payment method update:",e),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("paymentMethodUpdateError")}),e}}),this.cancel=()=>{this.resetForm()},this.formGroup=null!==(e=this.externalFormGroup())&&void 0!==e?e:M.P.getFormGroup()}getTokenizedPaymentMethod(){return ge(this,void 0,void 0,function*(){if(!this.formGroup.valid)throw this.formGroup.markAllAsTouched(),new Error("Form is invalid");const e=this.enterPaymentMethodComponent();if(!e)throw new Error("Payment method component not found");const t=yield e.tokenize();if(!t)throw new Error("Failed to tokenize payment method");return t})}isFormValid(){return!!this.enterPaymentMethodComponent()&&this.enterPaymentMethodComponent().validate()}resetForm(){this.formGroup.reset(),this.isChangingPayment.set(!1)}handlePaymentMethodUpdate(e,t){return ge(this,void 0,void 0,function*(){const i=yield this.billingClient.updatePaymentMethod(this.subscriber(),e,t);switch(i.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("paymentMethodUpdated")}),this.updated.emit(i.value),this.resetForm();break;case"error":this.logService.error("Error submitting payment method update:",i),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("paymentMethodUpdateError")})}})}}ke.ɵfac=function(e){return new(e||ke)},ke.ɵcmp=r.VBU({type:ke,selectors:[["app-display-payment-method-inline"]],viewQuery:function(e,t){1&e&&r.wEZ(t.enterPaymentMethodComponent,M.P,5),2&e&&r.NyB()},inputs:{subscriber:[1,"subscriber"],paymentMethod:[1,"paymentMethod"],externalFormGroup:[1,"externalFormGroup"]},outputs:{updated:"updated"},decls:3,vars:1,consts:[["enterPaymentMethodComponent",""],["bitTypography","h5"],[1,"tw-flex","tw-items-center","tw-gap-2"],["bitTypography","body1"],["bitLink","","linkType","primary",1,"tw-cursor-pointer","tw-mb-4",3,"click"],[1,"tw-flex","tw-gap-2"],["name","bwi-billing"],["bitLink","","rel","noreferrer","target","_blank"],[3,"class"],["name","bwi-credit-card"],["name","bwi-paypal",1,"tw-text-primary-600"],[3,"includeBillingAddress","group","showBankAccount","showAccountCredit"],[1,"tw-mt-4","tw-flex","tw-gap-2"],["bitLink","","linkType","default","type","button",3,"click","disabled"],["bitLink","","linkType","subtle","type","button",3,"click"]],template:function(e,t){1&e&&(r.j41(0,"bit-section"),r.nVh(1,Ee,9,7)(2,Qe,3,5),r.k0s()),2&e&&(r.R7$(),r.vxM(t.isChangingPayment()?2:1))},dependencies:[l.G,Ae.R,pe.g,j.n,k.r,M.P,T.PV,F.$],encapsulation:2,changeDetection:0});var Te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Fe(e,t){1&e&&(r.j41(0,"h2",0),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"paymentMethod")))}function Pe(e,t){if(1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"i18n"),r.j41(3,"a",5),r.EFF(4),r.nI1(5,"i18n"),r.k0s()()),2&e){const e=r.XpG(3);r.R7$(),r.SpI(" ",r.bMT(2,3,"verifyBankAccountWithStripe")," "),r.R7$(2),r.BMQ("href",e.paymentMethod.hostedVerificationUrl,r.B4B),r.R7$(),r.JRh(r.bMT(5,5,"verifyNow"))}}function Re(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI("- ",r.bMT(2,1,"unverified")))}function De(e,t){if(1&e&&(r.nVh(0,Pe,6,7,"p"),r.j41(1,"p"),r.nrm(2,"i",4),r.EFF(3),r.nVh(4,Re,3,3,"span"),r.k0s()),2&e){const e=r.XpG(2);r.vxM(e.paymentMethod.hostedVerificationUrl?0:-1),r.R7$(3),r.Lme(" ",e.paymentMethod.bankName,", *",e.paymentMethod.last4," "),r.R7$(),r.vxM(e.paymentMethod.hostedVerificationUrl?4:-1)}}function Me(e,t){if(1&e&&r.nrm(0,"i"),2&e){r.XpG();const e=r.r8f(1);r.HbH(r.VkB("bwi bwi-fw credit-card-icon ",e))}}function xe(e,t){1&e&&r.nrm(0,"i",7)}function Oe(e,t){if(1&e&&(r.j41(0,"p",3),r.SS7(1),r.nVh(2,Me,1,3,"i",6)(3,xe,1,0,"i",7),r.EFF(4),r.nI1(5,"titlecase"),r.k0s()),2&e){const e=r.XpG(2);r.R7$();const t=r.bH3(e.getCardBrandIcon());r.R7$(),r.vxM(null!==t?2:3),r.R7$(2),r.E5c(" ",r.bMT(5,5,e.paymentMethod.brand),", *",e.paymentMethod.last4,", ",e.paymentMethod.expiration," ")}}function Ge(e,t){if(1&e&&(r.j41(0,"p"),r.nrm(1,"i",8),r.EFF(2),r.k0s()),2&e){const e=r.XpG(2);r.R7$(2),r.SpI(" ",e.paymentMethod.email," ")}}function Ue(e,t){if(1&e&&r.nVh(0,De,5,4)(1,Oe,6,7,"p",3)(2,Ge,3,1,"p"),2&e){let e;const t=r.XpG();r.vxM("bankAccount"===(e=t.paymentMethod.type)?0:"card"===e?1:"payPal"===e?2:-1)}}function Ve(e,t){1&e&&(r.j41(0,"p",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"noPaymentMethod")))}class je{constructor(e){this.dialogService=e,this.updated=new r.bkB,this.hideHeader=(0,ce.hFB)(!1),this.changePaymentMethod=()=>Te(this,void 0,void 0,function*(){const e=U.open(this.dialogService,{data:{subscriber:this.subscriber}}),t=yield(0,Y.s)(e.closed);"success"===(null==t?void 0:t.type)&&this.updated.emit(t.paymentMethod)}),this.getCardBrandIcon=()=>(0,he.nS)(this.paymentMethod)}}je.ɵfac=function(e){return new(e||je)(r.rXU(u.o3))},je.ɵcmp=r.VBU({type:je,selectors:[["app-display-payment-method"]],inputs:{subscriber:"subscriber",paymentMethod:"paymentMethod",hideHeader:[1,"hideHeader"]},outputs:{updated:"updated"},decls:7,vars:6,consts:[["bitTypography","h2"],["bitTypography","body1"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],[1,"tw-flex","tw-items-center","tw-gap-2"],[1,"bwi","bwi-fw","bwi-billing"],["bitLink","","rel","noreferrer","target","_blank"],[3,"class"],[1,"bwi","bwi-fw","bwi-credit-card"],[1,"bwi","bwi-fw","bwi-paypal","tw-text-primary-600"]],template:function(e,t){if(1&e&&(r.j41(0,"bit-section"),r.nVh(1,Fe,3,3,"h2",0),r.nVh(2,Ue,3,1)(3,Ve,3,3,"p",1),r.j41(4,"button",2),r.EFF(5),r.nI1(6,"i18n"),r.k0s()()),2&e){r.R7$(),r.vxM(t.hideHeader()?-1:1),r.R7$(),r.vxM(t.paymentMethod?2:3);const e=t.paymentMethod?"changePaymentMethod":"addPaymentMethod";r.R7$(2),r.Y8G("bitAction",t.changePaymentMethod),r.R7$(),r.SpI(" ",r.bMT(6,4,e)," ")}},dependencies:[l.G,V.p,f.Q,pe.g,j.n,k.r,T.PV,F.$],encapsulation:2});i(32287);class Ne extends O{constructor(e,t,i,n,r){super(e,i,n,r),this.dialogParams=t,this.subscriber=this.dialogParams.subscriber}}Ne.open=(e,t)=>e.open(Ne,Object.assign(Object.assign({},t),{disableClose:!0})),Ne.ɵfac=function(e){return new(e||Ne)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(A.W),r.rXU(h.f))},Ne.ɵcmp=r.VBU({type:Ne,selectors:[["ng-component"]],features:[r.Vt3],decls:13,vars:13,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"type","title"],[3,"group","includeBillingAddress"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"]],template:function(e,t){1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2)(6,"bit-callout",3),r.EFF(7),r.k0s(),r.nrm(8,"app-enter-payment-method",4),r.k0s(),r.qex(9,5),r.j41(10,"button",6),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"addPaymentMethod")," "),r.R7$(3),r.Y8G("type",t.dialogParams.callout.type)("title",t.dialogParams.callout.title),r.R7$(),r.SpI(" ",t.dialogParams.callout.message," "),r.R7$(),r.Y8G("group",t.formGroup)("includeBillingAddress",!0),r.R7$(3),r.SpI(" ",r.bMT(12,11,"save")," "))},dependencies:[M.P,l.G,s.qT,s.cb,s.j4,g.$,v.L,f.Q,q.G,y.m,C.hJ,F.$],encapsulation:2});var ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ye{constructor(e,t,i){this.billingClient=e,this.i18nService=t,this.toastService=i,this.verified=new r.bkB,this.formGroup=new s.gE({descriptorCode:new s.MJ("",[s.k0.required,s.k0.minLength(6),s.k0.maxLength(6)])}),this.submit=()=>ze(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.valid)return;const e=yield this.billingClient.verifyBankAccount(this.subscriber,this.formGroup.value.descriptorCode);switch(e.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("bankAccountVerified")}),this.verified.emit(e.value);break;case"error":this.toastService.showToast({variant:"error",title:"",message:e.message})}})}}Ye.ɵfac=function(e){return new(e||Ye)(r.rXU(a.Hd),r.rXU(A.W),r.rXU(h.f))},Ye.ɵcmp=r.VBU({type:Ye,selectors:[["app-verify-bank-account"]],inputs:{subscriber:"subscriber"},outputs:{verified:"verified"},decls:14,vars:16,consts:[["type","warning",3,"title"],[3,"formGroup","bitSubmit"],[1,"tw-mr-2","tw-w-48"],["bitInput","","type","text","placeholder","SMAB12",3,"formControl"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"]],template:function(e,t){1&e&&(r.j41(0,"bit-callout",0),r.nI1(1,"i18n"),r.j41(2,"p"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"form",1)(6,"bit-form-field",2)(7,"bit-label"),r.EFF(8),r.nI1(9,"i18n"),r.k0s(),r.nrm(10,"input",3),r.k0s(),r.j41(11,"button",4),r.EFF(12),r.nI1(13,"i18n"),r.k0s()()()),2&e&&(r.Y8G("title",r.mNQ(r.bMT(1,8,"verifyBankAccount"))),r.R7$(3),r.JRh(r.bMT(4,10,"verifyBankAccountWithStatementDescriptorInstructions")),r.R7$(2),r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.JRh(r.bMT(9,12,"descriptorCode")),r.R7$(2),r.Y8G("formControl",t.formGroup.controls.descriptorCode),r.R7$(2),r.SpI(" ",r.bMT(13,14,"submit")," "))},dependencies:[l.G,s.qT,s.me,s.BC,s.cb,s.l_,s.j4,g.$,v.L,f.Q,q.G,w.j,I.J,b.h,F.$],encapsulation:2})},9764(e,t,i){"use strict";i.d(t,{n:()=>o});var n=i(78781);class r{}const s=Object.freeze({padding:"0",divider:"|",hasInvalidPadding:/[^0]/});class o extends r{constructor(e){super(),this.frameSize=e}pack(e){const t=JSON.stringify(e),i=n.A.fromUtf8ToB64(t),r=JSON.stringify(this.frameSize),o=2*s.divider.length,a=i.length+r.length+o,l=this.frameSize-a%this.frameSize;return`${r}|${i}|${s.padding.repeat(l)}`}unpack(e){const t=e.indexOf(s.divider);if(t<1)throw new Error("missing frame size");const i=parseInt(e.slice(0,t),10),r=t+1;if(e.length%i>0)throw new Error("invalid length");const o=e.lastIndexOf(s.divider);if(o==t)throw new Error("missing json object");const a=o+1;if(e.slice(a).match(s.hasInvalidPadding))throw new Error("invalid padding");const l=e.slice(r,o),c=n.A.fromB64ToUtf8(l);return JSON.parse(c)}}},9997(e,t,i){"use strict";i.d(t,{C:()=>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)}}},10070(e,t,i){"use strict";i.d(t,{c:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"))}}},10459(e,t,i){"use strict";i.d(t,{P:()=>s,k:()=>r});var n=i(8916);class r{constructor(e,t,i){this.salt=e,this.kdf=t,this.masterKeyWrappedUserKey=i}static fromSdk(e){return new r(e.salt,(0,n.E$)(e.kdf),e.masterKeyWrappedUserKey)}toSdk(){return{salt:this.salt,kdf:this.kdf.toSdkConfig(),masterKeyWrappedUserKey:this.masterKeyWrappedUserKey}}toJSON(){return{salt:this.salt,kdf:this.kdf,masterKeyWrappedUserKey:this.masterKeyWrappedUserKey}}static fromJSON(e){return null==e?null:new r(e.salt,e.kdf.kdfType===n.ao.PBKDF2_SHA256?n.n1.fromJSON(e.kdf):n.hU.fromJSON(e.kdf),e.masterKeyWrappedUserKey)}}function s(e){return{salt:e.salt,kdf:(0,n.E$)(e.kdf),masterPasswordAuthenticationHash:e.masterPasswordAuthenticationHash}}},10672(e,t,i){"use strict";i.d(t,{H:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-container"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-max-w-4xl"]],template:function(e,t){1&e&&(n.NAR(),n.rj2(0,"div",0),n.SdG(1),n.eux())},encapsulation:2})},10840(e,t,i){"use strict";i.d(t,{Y:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},10931(e,t,i){"use strict";i.d(t,{n:()=>y});var n=i(77468),r=i(94573),s=i(74208),o=i(75583),a=i(29029),l=i(26477),c=i(79783),d=i(85800),u=i(36801),h=i(7243),A=i(33812),p=i(56898),g=i(57178),v=i(58806);function f(e,t){1&e&&(A.j41(0,"a",2),A.EFF(1),A.nI1(2,"i18n"),A.nrm(3,"i",8),A.k0s()),2&e&&(A.Y8G("href",t,A.B4B),A.R7$(),A.SpI(" ",A.bMT(2,2,"learnMore")," "))}function m(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",9),A.bIt("click",function(){s.eBV(e);const t=A.XpG();return s.Njj(t.service.previousStep())}),A.EFF(1),A.nI1(2,"i18n"),A.k0s()}2&e&&(A.R7$(),A.SpI(" ",A.bMT(2,1,"back")," "))}class y{constructor(){this.stepId=r.hFB.required(),this.popover=r.ebz.required(d.r),this.service=(0,s.WQX)(h.T)}}y.ɵfac=function(e){return new(e||y)},y.ɵcmp=A.VBU({type:y,selectors:[["app-coachmark"]],viewQuery:function(e,t){1&e&&A.wEZ(t.popover,d.r,5),2&e&&A.NyB()},inputs:{stepId:[1,"stepId"]},exportAs:["coachmark"],decls:14,vars:14,consts:[[3,"closed","title"],["bitTypography","body2",1,"tw-mb-3"],["bitLink","","linkType","primary","target","_blank","rel","noopener noreferrer",1,"tw-mb-3","tw-flex","tw-items-center","tw-gap-1",3,"href"],[1,"tw-flex","tw-items-center","tw-justify-between","tw-pt-2"],["bitTypography","body2",1,"tw-text-muted"],[1,"tw-flex","tw-gap-2"],["bitButton","","buttonType","secondary","type","button"],["bitButton","","buttonType","primary","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-text-sm"],["bitButton","","buttonType","secondary","type","button",3,"click"]],template:function(e,t){if(1&e&&(A.j41(0,"bit-popover",0),A.bIt("closed",function(){return t.service.completeTour()}),A.j41(1,"p",1),A.EFF(2),A.k0s(),A.nVh(3,f,4,4,"a",2),A.j41(4,"div",3)(5,"span",4),A.EFF(6),A.nI1(7,"i18n"),A.k0s(),A.j41(8,"div",5),A.nVh(9,m,3,3,"button",6),A.j41(10,"button",7),A.bIt("click",function(){return t.service.nextStep()}),A.EFF(11),A.nI1(12,"i18n"),A.nI1(13,"i18n"),A.k0s()()()()),2&e){let e;A.Y8G("title",t.service.getStepTitle(t.stepId())),A.R7$(2),A.SpI(" ",t.service.getStepDescription(t.stepId())," "),A.R7$(),A.vxM((e=t.service.getStepLearnMoreUrl(t.stepId()))?3:-1,e),A.R7$(3),A.SpI(" ",A.brH(7,6,"coachmarkStepIndicator",t.service.currentStepNumber(),t.service.totalSteps())," "),A.R7$(3),A.vxM(t.service.currentStepNumber()>1?9:-1),A.R7$(2),A.SpI(" ",t.service.currentStepNumber()===t.service.totalSteps()?A.bMT(12,10,"close"):A.bMT(13,12,"next")," ")}},dependencies:[n.MD,a.t,p.Q,l.V,g.g,c.k,d.r,o.E,v.r,u.$Z],encapsulation:2,changeDetection:0})},11009(e,t,i){"use strict";i.d(t,{H:()=>n});class n{}},11224(e,t,i){"use strict";i.d(t,{X:()=>n});class n{}},11314(e,t,i){"use strict";i.d(t,{k:()=>n});class n{constructor(e){null!=e&&(this.password=e.password,this.lastUsedDate=e.lastUsedDate)}}},11451(e,t,i){"use strict";i.d(t,{r:()=>o});var n=i(74208),r=i(12012),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class o{constructor(){this.apiService=(0,n.WQX)(r.G),this.userId=null,this.profileCreatedDate=null}getProfileCreationDate(e){return s(this,void 0,void 0,function*(){if(this.profileCreatedDate&&e===this.userId)return Promise.resolve(new Date(this.profileCreatedDate));const t=yield this.fetchAndCacheProfile();return new Date(t.creationDate)})}fetchAndCacheProfile(){return s(this,void 0,void 0,function*(){const e=yield this.apiService.getProfile();return this.userId=e.id,this.profileCreatedDate=e.creationDate,e})}}o.ɵfac=function(e){return new(e||o)},o.ɵprov=n.jDH({token:o,factory:o.ɵfac,providedIn:"root"})},11486(e,t,i){"use strict";i.d(t,{l:()=>H});var n=i(72245),r=i(44500),s=i(23965),o=i(90171),a=i(67553),l=i(54931),c=i(56962),d=i(55542),u=i(81525),h=i(25065),A=i(30038),p=i(33812),g=i(12012),v=i(50700),f=i(51757),m=i(2471),y=i(69855),C=i(23649),w=i(35500),I=i(77468),b=i(54471),B=i(3892),E=i(26657),S=i(38620),Q=i(56898),k=i(7730),T=i(68016),F=i(67311),P=i(86226),R=i(97553),D=i(43759),M=i(38410),x=i(22466),O=i(36572),G=i(25740),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function V(e,t){if(1&e&&(p.j41(0,"small",16),p.EFF(1),p.k0s()),2&e){const e=p.XpG();p.R7$(),p.JRh(e.name)}}function j(e,t){1&e&&(p.j41(0,"div"),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e&&(p.R7$(),p.SpI(" ",p.bMT(2,1,"noEventsInList")," "))}function N(e,t){1&e&&(p.j41(0,"th",19),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e&&(p.R7$(),p.JRh(p.bMT(2,1,"member")))}function z(e,t){if(1&e&&(p.j41(0,"td",19)(1,"span",27),p.EFF(2),p.k0s()()),2&e){const e=p.XpG().$implicit;p.R7$(),p.Y8G("appA11yTitle",p.mNQ(e.userEmail)),p.R7$(),p.JRh(e.userName)}}function Y(e,t){if(1&e&&(p.j41(0,"tr",24)(1,"td",19),p.EFF(2),p.nI1(3,"date"),p.k0s(),p.j41(4,"td",19),p.nrm(5,"i",25),p.j41(6,"span",20),p.EFF(7),p.k0s()(),p.DNE(8,z,3,3,"td",21),p.nrm(9,"td",26),p.k0s()),2&e){const e=t.$implicit,i=p.XpG(3);p.R7$(2),p.JRh(p.i5U(3,11,e.date,"medium")),p.R7$(3),p.HbH(p.VkB("tw-text-muted bwi bwi-lg ",e.appIcon)),p.Y8G("title",p.ai1("",e.appName,", ",e.ip)),p.R7$(2),p.Lme("",e.appName,", ",e.ip),p.R7$(),p.Y8G("ngIf",i.showUser),p.R7$(),p.Y8G("innerHTML",e.message,p.npT)}}function L(e,t){if(1&e&&(p.DNE(0,Y,10,14,"tr",23),p.nI1(1,"async")),2&e){const e=t.$implicit;p.Y8G("ngForOf",p.bMT(1,1,e))}}function K(e,t){if(1&e&&(p.j41(0,"bit-table",17),p.qex(1,18),p.j41(2,"tr")(3,"th",19),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.j41(6,"th",19)(7,"span",20),p.EFF(8),p.nI1(9,"i18n"),p.k0s()(),p.DNE(10,N,3,3,"th",21),p.j41(11,"th",19),p.EFF(12),p.nI1(13,"i18n"),p.k0s()(),p.bVm(),p.DNE(14,L,2,3,"ng-template",22),p.k0s()),2&e){const e=p.XpG();p.Y8G("dataSource",e.dataSource),p.R7$(4),p.JRh(p.bMT(5,5,"timestamp")),p.R7$(4),p.JRh(p.bMT(9,7,"client")),p.R7$(2),p.Y8G("ngIf",e.showUser),p.R7$(2),p.JRh(p.bMT(13,9,"event"))}}function X(e,t){if(1&e&&(p.j41(0,"button",28),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e){const e=p.XpG();p.Y8G("bitAction",e.loadMoreEvents),p.R7$(),p.SpI(" ",p.bMT(2,2,"loadMore")," ")}}class q{get name(){return this.params.name}get showUser(){var e;return null!==(e=this.params.showUser)&&void 0!==e&&e}constructor(e,t,i,n,r,s,o,a,l,c,u,h,A,p){this.params=e,this.apiService=t,this.i18nService=i,this.eventService=n,this.userNamePipe=r,this.logService=s,this.organizationUserApiService=o,this.formBuilder=a,this.validationService=l,this.toastService=c,this.router=u,this.activeRoute=h,this.accountService=A,this.organizationService=p,this.loading=!0,this.dataSource=new d.s,this.filterFormGroup=this.formBuilder.group({start:[""],end:[""]}),this.orgUsersUserIdMap=new Map,this.orgUsersIdMap=new Map,this.loadMoreEvents=()=>U(this,void 0,void 0,function*(){yield this.loadEvents(!1)}),this.refreshEvents=()=>U(this,void 0,void 0,function*(){yield this.loadEvents(!0)})}ngOnInit(){return U(this,void 0,void 0,function*(){const e=this.eventService.getDefaultDateFilters();this.filterFormGroup.setValue({start:e[0],end:e[1]}),yield this.load()})}ngOnDestroy(){return U(this,void 0,void 0,function*(){yield(0,n._)(this.activeRoute.queryParams.pipe((0,r.n)(e=>U(this,void 0,void 0,function*(){yield this.router.navigate([],{queryParams:Object.assign(Object.assign({},e),{viewEvents:null})})}))))})}load(){return U(this,void 0,void 0,function*(){try{if(this.showUser){(yield this.organizationUserApiService.getAllMiniUserDetails(this.params.organizationId)).data.forEach(e=>{const t=this.userNamePipe.transform(e);this.orgUsersIdMap.set(e.id,{name:t,email:e.email}),this.orgUsersUserIdMap.set(e.userId,{name:t,email:e.email})})}yield this.loadEvents(!0)}catch(e){this.logService.error(e),this.validationService.showError(e)}this.loading=!1})}loadEvents(e){return U(this,void 0,void 0,function*(){let t,i=null;try{i=this.eventService.formatDateFilters(this.filterFormGroup.value.start,this.filterFormGroup.value.end)}catch(r){return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidDateRange")})}t="user"===this.params.entity&&this.params.providerId?yield this.apiService.getEventsProviderUser(this.params.providerId,this.params.entityId,i[0],i[1],e?null:this.continuationToken):"user"===this.params.entity?yield this.apiService.getEventsOrganizationUser(this.params.organizationId,this.params.entityId,i[0],i[1],e?null:this.continuationToken):"secret"===this.params.entity?yield this.apiService.getEventsSecret(this.params.organizationId,this.params.entityId,i[0],i[1],e?null:this.continuationToken):"service-account"===this.params.entity?yield this.apiService.getEventsServiceAccount(this.params.organizationId,this.params.entityId,i[0],i[1],e?null:this.continuationToken):"project"===this.params.entity?yield this.apiService.getEventsProject(this.params.organizationId,this.params.entityId,i[0],i[1],e?null:this.continuationToken):yield this.apiService.getEventsCipher(this.params.entityId,i[0],i[1],e?null:this.continuationToken),this.continuationToken=t.continuationToken;const n=yield Promise.all(t.data.map(e=>U(this,void 0,void 0,function*(){const t=null==e.actingUserId?e.userId:e.actingUserId,i=yield this.eventService.getEventInfo(e),n=this.showUser&&null!=t&&this.orgUsersUserIdMap.has(t)?this.orgUsersUserIdMap.get(t):null;return new l.g8({message:i.message,humanReadableMessage:i.humanReadableMessage,appIcon:i.appIcon,appName:i.appName,userId:t,userName:null!=n?n.name:this.showUser?this.i18nService.t("unknown"):null,userEmail:null!=n?n.email:this.showUser?"":null,date:e.date,ip:e.ipAddress,type:e.type,installationId:e.installationId,systemUser:e.systemUser,serviceAccountId:e.serviceAccountId})})));!e&&null!=this.dataSource.data&&this.dataSource.data.length>0?this.dataSource.data=this.dataSource.data.concat(n):this.dataSource.data=n})}}q.ɵfac=function(e){return new(e||q)(p.rXU(u.Qs),p.rXU(g.G),p.rXU(v.W),p.rXU(A.US),p.rXU(o.b),p.rXU(c.K),p.rXU(s.uB),p.rXU(f.ok),p.rXU(m.B),p.rXU(y.f),p.rXU(C.Ix),p.rXU(C.nX),p.rXU(w.D),p.rXU(a.PV))},q.ɵcmp=p.VBU({type:q,selectors:[["ng-component"]],decls:34,vars:30,consts:[["dialogSize","large",3,"loading"],["bitDialogTitle",""],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],[3,"formGroup","bitSubmit"],[1,"tw-flex","tw-items-center","tw-space-x-2"],["bitInput","","type","datetime-local","id","start","formControlName","start",3,"placeholder"],[1,"tw-mx-2"],["bitInput","","type","datetime-local","id","end","formControlName","end",3,"placeholder"],["type","submit","bitButton","","buttonType","primary","bitFormButton",""],["aria-hidden","true",1,"bwi","bwi-refresh","bwi-fw"],[4,"ngIf"],[3,"dataSource",4,"ngIf"],["bitButton","","buttonType","secondary","block","","type","button",3,"bitAction",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","secondary","type","button","bitDialogClose",""],[1,"tw-text-muted"],[3,"dataSource"],["header",""],["bitCell",""],[1,"tw-sr-only"],["bitCell","",4,"ngIf"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["aria-hidden","true",3,"title"],["bitCell","",3,"innerHTML"],[3,"appA11yTitle"],["bitButton","","buttonType","secondary","block","","type","button",3,"bitAction"]],template:function(e,t){1&e&&(p.j41(0,"bit-dialog",0)(1,"span",1),p.EFF(2),p.nI1(3,"i18n"),p.DNE(4,V,2,1,"small",2),p.k0s(),p.j41(5,"div",3)(6,"form",4)(7,"div",5)(8,"bit-form-field")(9,"bit-label"),p.EFF(10),p.nI1(11,"i18n"),p.k0s(),p.nrm(12,"input",6),p.nI1(13,"i18n"),p.k0s(),p.j41(14,"span",7),p.EFF(15,"-"),p.k0s(),p.j41(16,"bit-form-field")(17,"bit-label"),p.EFF(18),p.nI1(19,"i18n"),p.k0s(),p.nrm(20,"input",8),p.nI1(21,"i18n"),p.k0s(),p.j41(22,"button",9),p.nrm(23,"i",10),p.EFF(24),p.nI1(25,"i18n"),p.k0s()()(),p.nrm(26,"hr"),p.DNE(27,j,3,3,"div",11)(28,K,15,11,"bit-table",12)(29,X,3,4,"button",13),p.k0s(),p.qex(30,14),p.j41(31,"button",15),p.EFF(32),p.nI1(33,"i18n"),p.k0s(),p.bVm(),p.k0s()),2&e&&(p.Y8G("loading",t.loading),p.R7$(2),p.SpI(" ",p.bMT(3,16,"eventLogs")," "),p.R7$(2),p.Y8G("ngIf",t.name),p.R7$(2),p.Y8G("formGroup",t.filterFormGroup)("bitSubmit",t.refreshEvents),p.R7$(4),p.JRh(p.bMT(11,18,"from")),p.R7$(2),p.Y8G("placeholder",p.mNQ(p.bMT(13,20,"startDate"))),p.R7$(6),p.JRh(p.bMT(19,22,"to")),p.R7$(2),p.Y8G("placeholder",p.mNQ(p.bMT(21,24,"endDate"))),p.R7$(4),p.SpI(" ",p.bMT(25,26,"refresh")," "),p.R7$(3),p.Y8G("ngIf",!t.dataSource.data||!t.dataSource.data.length),p.R7$(),p.Y8G("ngIf",null==t.dataSource||null==t.dataSource.data?null:t.dataSource.data.length),p.R7$(),p.Y8G("ngIf",t.continuationToken),p.R7$(3),p.SpI(" ",p.bMT(33,28,"close")," "))},dependencies:[h.G,I.Sq,I.bT,f.qT,f.me,f.BC,f.cb,f.j4,f.JD,b.C,B.p,E.$,S.L,Q.Q,k.I,T.m,F.hJ,P.j,R.J,D.h,M.Q,x.Y,O._,O.O,I.Jj,I.vh,G.$],encapsulation:2});const H=(e,t)=>e.open(q,t)},11728(e,t,i){"use strict";i.d(t,{c:()=>y});var n=i(58412),r=i(20702),s=i(65731);class o extends r.r{constructor(e){super(e);const t=this.getResponseProperty("Type");if(t!==s.Tu.AmountOff&&t!==s.Tu.PercentOff)throw new Error(`Failed to parse invalid discount type: ${t}`);this.type=t,this.value=this.getResponseProperty("Value")}}class a extends r.r{constructor(e){super(e),this.translationKey=this.getResponseProperty("TranslationKey"),this.quantity=this.getResponseProperty("Quantity"),this.cost=this.getResponseProperty("Cost");const t=this.getResponseProperty("Discount");t&&(this.discount=t)}}class l extends r.r{constructor(e){super(e),this.seats=new a(this.getResponseProperty("Seats"));const t=this.getResponseProperty("AdditionalStorage");t&&(this.additionalStorage=new a(t))}}class c extends r.r{constructor(e){super(e),this.seats=new a(this.getResponseProperty("Seats"));const t=this.getResponseProperty("AdditionalServiceAccounts");t&&(this.additionalServiceAccounts=new a(t))}}class d extends r.r{constructor(e){super(e),this.passwordManager=new l(this.getResponseProperty("PasswordManager"));const t=this.getResponseProperty("SecretsManager");t&&(this.secretsManager=new c(t));const i=this.getResponseProperty("Cadence");if(i!==n.fQ.Annually&&i!==n.fQ.Monthly)throw new Error(`Failed to parse invalid cadence: ${i}`);this.cadence=i;const r=this.getResponseProperty("Discount");r&&(this.discounts=[new o(r)]),this.estimatedTax=this.getResponseProperty("EstimatedTax")}}class u extends r.r{constructor(e){super(e),this.available=this.getResponseProperty("Available"),this.used=this.getResponseProperty("Used"),this.readableUsed=this.getResponseProperty("ReadableUsed")}}var h=i(2003);class A extends r.r{constructor(e){super(e),this.toDomain=()=>{switch(this.status){case h.gc.Incomplete:case h.gc.IncompleteExpired:case h.gc.PastDue:case h.gc.Unpaid:return{cart:this.cart,storage:this.storage,status:this.status,suspension:this.suspension,gracePeriod:this.gracePeriod};case h.gc.Trialing:case h.gc.Active:return{cart:this.cart,storage:this.storage,status:this.status,nextCharge:this.nextCharge,cancelAt:this.cancelAt};case h.gc.Canceled:return{cart:this.cart,storage:this.storage,status:this.status,canceled:this.canceled}}};const t=this.getResponseProperty("Status");if(t!==h.gc.Incomplete&&t!==h.gc.IncompleteExpired&&t!==h.gc.Trialing&&t!==h.gc.Active&&t!==h.gc.PastDue&&t!==h.gc.Canceled&&t!==h.gc.Unpaid)throw new Error(`Failed to parse invalid subscription status: ${t}`);this.status=t,this.cart=new d(this.getResponseProperty("Cart")),this.storage=new u(this.getResponseProperty("Storage"));const i=this.getResponseProperty("Suspension");i&&(this.suspension=new Date(i));const n=this.getResponseProperty("GracePeriod");n&&(this.gracePeriod=n);const r=this.getResponseProperty("NextCharge");r&&(this.nextCharge=new Date(r));const s=this.getResponseProperty("CancelAt");s&&(this.cancelAt=new Date(s));const o=this.getResponseProperty("Canceled");o&&(this.canceled=new Date(o))}}class p extends r.r{constructor(e){var t,i,n,r,s;super(e),this.stripeCouponId=this.getResponseProperty("StripeCouponId"),this.percentOff=null!==(t=this.getResponseProperty("PercentOff"))&&void 0!==t?t:void 0,this.amountOff=null!==(i=this.getResponseProperty("AmountOff"))&&void 0!==i?i:void 0,this.currency=null!==(n=this.getResponseProperty("Currency"))&&void 0!==n?n:void 0,this.duration=this.getResponseProperty("Duration"),this.durationInMonths=null!==(r=this.getResponseProperty("DurationInMonths"))&&void 0!==r?r:void 0,this.name=null!==(s=this.getResponseProperty("Name"))&&void 0!==s?s:void 0,this.startDate=this.getResponseProperty("StartDate"),this.endDate=this.getResponseProperty("EndDate"),this.tierEligibility=this.getResponseProperty("TierEligibility")}}var g=i(7861),v=i(74208),f=i(12012),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class y{constructor(e){this.apiService=e,this.endpoint="/account/billing/vnext",this.getLicense=()=>m(this,void 0,void 0,function*(){const e=`${this.endpoint}/license`;return this.apiService.send("GET",e,null,!0,!0)}),this.getSubscription=()=>m(this,void 0,void 0,function*(){const e=`${this.endpoint}/subscription`;try{const t=yield this.apiService.send("GET",e,null,!0,!0);return new A(t).toDomain()}catch(t){if(t instanceof g._&&404===t.statusCode)return null;throw t}}),this.purchaseSubscription=(e,t,i)=>m(this,void 0,void 0,function*(){const n=`${this.endpoint}/subscription`,r="token"in e?{tokenizedPaymentMethod:e,billingAddress:t}:{nonTokenizedPaymentMethod:e,billingAddress:t},s=Object.assign(Object.assign({},r),(null==i?void 0:i.length)?{coupons:i}:{});yield this.apiService.send("POST",n,s,!0,!0)}),this.reinstateSubscription=()=>m(this,void 0,void 0,function*(){const e=`${this.endpoint}/subscription/reinstate`;yield this.apiService.send("POST",e,null,!0,!1)}),this.updateSubscriptionStorage=e=>m(this,void 0,void 0,function*(){const t=`${this.endpoint}/subscription/storage`;yield this.apiService.send("PUT",t,{additionalStorageGb:e},!0,!1)}),this.getApplicableDiscounts=()=>m(this,void 0,void 0,function*(){const e=`${this.endpoint}/discounts`,t=yield this.apiService.send("GET",e,null,!0,!0);return Array.isArray(t)?t.map(e=>new p(e)):[]}),this.upgradePremiumToOrganization=e=>m(this,void 0,void 0,function*(){const t=`${this.endpoint}/upgrade`;return yield this.apiService.send("POST",t,{organizationName:e.organizationName,key:e.organizationKey,collectionName:e.collectionName,publicKey:e.publicKey,encryptedPrivateKey:e.encryptedPrivateKey,targetProductTierType:e.planTier,cadence:e.cadence,billingAddress:e.billingAddress},!0,!0)})}}y.ɵfac=function(e){return new(e||y)(v.KVO(f.G))},y.ɵprov=v.jDH({token:y,factory:y.ɵfac,providedIn:"root"})},11766(e,t,i){"use strict";i.d(t,{g:()=>s});var n=i(82781),r=i(31442);class s{constructor(e){this.type=r.PU.Text,this.newField=!1,this.showValue=!1,this.showCount=!1,e&&(this.type=e.type,this.linkedId=e.linkedId)}get maskedValue(){return null!=this.value?"••••••••":void 0}static fromJSON(e){return Object.assign(new s,e)}static fromSdkFieldView(e){if(!e)return;const t=new s;return t.name=e.name,t.value=e.value,t.type=e.type,t.linkedId=e.linkedId,t}toSdkFieldView(){var e,t,i,r;return{name:null!==(e=this.name)&&void 0!==e?e:void 0,value:null!==(t=this.value)&&void 0!==t?t:void 0,type:null!==(i=this.type)&&void 0!==i?i:n.FieldType.Text,linkedId:null!==(r=this.linkedId)&&void 0!==r?r:void 0}}}},11979(e,t,i){"use strict";i.d(t,{H:()=>h,y:()=>u});var n=i(33338),r=i(93695),s=i(3204),o=i(27442),a=i(44500),l=i(15639),c=i(3633),d=i(66523);class u{}class h{constructor(e,t,i){this.collectionService=e,this.organizationService=t,this.accountService=i,this.organization$=e=>this.accountService.activeAccount$.pipe(c.F6,(0,a.n)(e=>this.organizationService.organizations$(e)),(0,s.T)(t=>t.find(t=>t.id===e.organizationId)))}canDeleteCipher$(e,t){return this.organization$(e).pipe((0,s.T)(i=>{var n;if(t){if(!e.collectionIds||0===e.collectionIds.length)return!0===(null==i?void 0:i.canEditUnassignedCiphers);if(null==i?void 0:i.canEditAllCiphers)return!0}return!!(null===(n=e.permissions)||void 0===n?void 0:n.delete)}))}canRestoreCipher$(e,t){return this.organization$(e).pipe((0,s.T)(i=>{var n;if(t){if(!e.collectionIds||0===e.collectionIds.length)return!0===(null==i?void 0:i.canEditUnassignedCiphers);if(null==i?void 0:i.canEditAllCiphers)return!0}return!!(null===(n=e.permissions)||void 0===n?void 0:n.restore)}))}canEditCipher$(e,t=!1){return this.organization$(e).pipe((0,s.T)(i=>{if(t){if(!e.collectionIds||0===e.collectionIds.length)return!0===(null==i?void 0:i.canEditUnassignedCiphers);if(null==i?void 0:i.canEditAllCiphers)return!0}return!!e.edit}))}canCloneCipher$(e,t){return null==e.organizationId?(0,r.of)(!0):(0,n.z)([this.organization$(e),this.accountService.activeAccount$.pipe(c.F6)]).pipe((0,a.n)(([i,n])=>{var o;return t&&i&&(i.isAdmin||(null===(o=i.permissions)||void 0===o?void 0:o.editAnyCollection))?(0,r.of)(!0):this.collectionService.decryptedCollections$(n).pipe((0,l.S)(e.collectionIds.map(d.zw)),(0,s.T)(e=>e.some(e=>e.manage)))}),(0,o.t)({bufferSize:1,refCount:!1}))}}},12012(e,t,i){"use strict";i.d(t,{G:()=>n});class n{}},12022(e,t,i){"use strict";i.d(t,{j:()=>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})}static fromSdkPasswordHistoryView(e){if(!e)return;const t=new n;return t.password=e.password,t.lastUsedDate=null==e.lastUsedDate?null:new Date(e.lastUsedDate),t}toSdkPasswordHistoryView(){var e;return{password:null!==(e=this.password)&&void 0!==e?e:"",lastUsedDate:this.lastUsedDate.toISOString()}}}},12058(e,t,i){"use strict";i.d(t,{d8:()=>n.d,xM:()=>f,H8:()=>je,XF:()=>c,_l:()=>Ye,uU:()=>He,L7:()=>$e,$c:()=>Ze,bj:()=>l,FQ:()=>qe,pi:()=>F,DS:()=>r,CL:()=>ke,sg:()=>o.s,aJ:()=>d,k4:()=>u,F2:()=>g,pS:()=>v,Xc:()=>I,GX:()=>Pe,Ym:()=>a,Gz:()=>m,_p:()=>C,iD:()=>_e});var n=i(77312);class r{}var s,o=i(65802);class a{}class l extends a{}class c{}class d{}class u{}!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"}(s||(s={}));var h=i(68881),A=i(97883),p=i(43890);class g{constructor(e,t,i,n,r){this.email=e,this.masterPassword=t,this.twoFactor=i,this.masterPasswordPoliciesFromOrgInvite=n,this.preFetchedPreloginData=r,this.type=s.Password}}class v{constructor(e,t,i,n,r,o){this.code=e,this.codeVerifier=t,this.redirectUrl=i,this.orgId=n,this.email=r,this.twoFactor=o,this.type=s.Sso}}class f{constructor(e,t,i,n,r){this.email=e,this.accessCode=t,this.authRequestId=i,this.decryptedUserKey=n,this.twoFactor=r,this.type=s.AuthRequest}static fromJSON(e){return Object.assign(new f(e.email,e.accessCode,e.authRequestId,null,e.twoFactor?new h.i(e.twoFactor.provider,e.twoFactor.token,e.twoFactor.remember):e.twoFactor),{decryptedUserKey:p.e.fromJSON(e.decryptedUserKey)})}}class m{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i,this.type=s.WebAuthn}static fromJSON(e){return new m(e.token,Object.assign(Object.create(A.c.prototype),e.deviceResponse),p.e.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 C{static fromResponse(e){if(null==e)return;if(!e.encryptedPrivateKey||!e.encryptedUserKey)return;const t=new C;return t.encryptedPrivateKey=e.encryptedPrivateKey.encryptedString,t.encryptedUserKey=e.encryptedUserKey.encryptedString,t.credentialId=e.credentialId,t.transports=e.transports||[],t}static fromJSON(e){if(null!=e)return Object.assign(new C,e)}}class w{static fromResponse(e){var t,i,n,r;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.isTdeOffboarding=null!==(r=null==e?void 0:e.isTdeOffboarding)&&void 0!==r&&r,s}static fromJSON(e){if(null!=e)return Object.assign(new w,e)}}class I{static fromIdentityTokenResponse(e){if(null==e)throw new Error("User Decryption Options are required for client initialization. Response is nullish.");const t=new I;if(!e.userDecryptionOptions)throw new Error("User Decryption Options are required for client initialization. userDecryptionOptions is missing in response.");{const i=e.userDecryptionOptions;if(t.hasMasterPassword=i.hasMasterPassword,t.trustedDeviceOption=w.fromResponse(i.trustedDeviceOption),t.keyConnectorOption=y.fromResponse(i.keyConnectorOption),i.webAuthnPrfOption){const e=C.fromResponse(i.webAuthnPrfOption);e&&(t.webAuthnPrfOptions=[e])}}return t}static fromJSON(e){const t=Object.assign(new I,e);return t.trustedDeviceOption=w.fromJSON(null==e?void 0:e.trustedDeviceOption),t.keyConnectorOption=y.fromJSON(null==e?void 0:e.keyConnectorOption),(null==e?void 0:e.webAuthnPrfOptions)&&Array.isArray(e.webAuthnPrfOptions)&&(t.webAuthnPrfOptions=e.webAuthnPrfOptions.map(e=>C.fromJSON(e)).filter(e=>void 0!==e)),t}}var b=i(44500),B=i(72245),E=i(84110),S=i(31857),Q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const k=new S.Zs(S.jB,"loginEmail",{deserializer:e=>e}),T=new S.Zs(S.d1,"storedEmail",{deserializer:e=>e});class F{constructor(e,t,i){this.accountService=e,this.authService=t,this.stateProvider=i,this.loginEmailState=this.stateProvider.getGlobal(k),this.storedEmailState=this.stateProvider.getGlobal(T),this.addingAccount$=this.authService.authStatuses$.pipe((0,b.n)(e=>Q(this,void 0,void 0,function*(){const t=yield(0,B._)(this.accountService.activeAccount$);return t&&delete e[t.id],Object.values(e).some(e=>e!==E.J.LoggedOut)}))),this.loginEmail$=this.loginEmailState.state$,this.rememberedEmail$=this.storedEmailState.state$.pipe((0,b.n)(e=>Q(this,void 0,void 0,function*(){return(yield(0,B._)(this.addingAccount$))?null:e})))}setLoginEmail(e){return Q(this,void 0,void 0,function*(){yield this.loginEmailState.update(t=>e)})}clearLoginEmail(){return Q(this,void 0,void 0,function*(){yield this.loginEmailState.update(e=>null)})}setRememberedEmailChoice(e,t){return Q(this,void 0,void 0,function*(){t?yield this.storedEmailState.update(t=>e):yield this.storedEmailState.update(e=>null)})}clearRememberedEmail(){return Q(this,void 0,void 0,function*(){yield this.storedEmailState.update(e=>null)})}}var P=i(16878),R=i(34040),D=i(80909),M=i(27442),x=i(3204),O=i(7861),G=i(37798),U=i(9997),V=i(6912);class j extends V.D{constructor(e,t,i,n,r){super(i,n),this.email=e,this.masterPasswordHash=t,this.twoFactor=i,this.newDeviceOtp=r}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="password",t.username=this.email,t.password=this.masterPasswordHash,this.newDeviceOtp&&(t.newDeviceOtp=this.newDeviceOtp),t}static fromJSON(e){return Object.assign(Object.create(j.prototype),e,{device:e.device?U.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var N=i(69194),z=i(22485),Y=i(71804),L=i(78781);class K{constructor(){this.twoFactorProviders=null}get requiresTwoFactor(){return null!=this.twoFactorProviders}get requiresSso(){return!L.A.isNullOrWhitespace(this.ssoOrganizationIdentifier)}}var X=i(81441),q=i(78107),H=i(27790),W=i(62780),$=i(82489),J=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Z{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m){this.accountService=e,this.masterPasswordService=t,this.keyService=i,this.encryptService=n,this.apiService=r,this.tokenService=s,this.appIdService=o,this.platformUtilsService=a,this.messagingService=l,this.logService=c,this.stateService=d,this.twoFactorService=u,this.userDecryptionOptionsService=h,this.billingAccountProfileStateService=A,this.vaultTimeoutSettingsService=p,this.KdfConfigService=g,this.environmentService=v,this.configService=f,this.accountCryptographicStateService=m,this.sessionTimeoutSubject=new P.t(!1),this.sessionTimeout$=this.sessionTimeoutSubject.asObservable()}logInTwoFactor(e){return J(this,void 0,void 0,function*(){var t;const i=this.cache.value;if(!i.tokenRequest)throw new Error("Token request is undefined");i.tokenRequest.setTwoFactor(e),this.cache.next(i);const[n]=yield this.startLogIn();return n.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,n})}startLogIn(){return J(this,void 0,void 0,function*(){yield this.twoFactorService.clearSelectedProvider();const e=this.cache.value.tokenRequest;if(!e)throw new Error("Token request is undefined");const t=yield this.apiService.postIdentityToken(e);if(t instanceof $.x)return[yield this.processTwoFactorResponse(t),t];if(t instanceof W.L)return[yield this.processTokenResponse(t),t];if(t instanceof q.H)return[yield this.processDeviceVerificationResponse(t),t];if(t instanceof H.u)return[yield this.processSsoRequiredResponse(t),t];throw new Error("Invalid response object.")})}buildDeviceRequest(){return J(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();return new U.C(e,this.platformUtilsService)})}buildTwoFactor(e,t){return J(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 h.i(Y.R.Remember,e,!1)}return new h.i})}saveAccountInformation(e){return J(this,void 0,void 0,function*(){var t,i,n,r;const s=yield this.tokenService.decodeAccessToken(e.accessToken),o=s.sub;if(yield this.accountService.addAccount(o,{name:s.name,email:null!==(t=s.email)&&void 0!==t?t:"",emailVerified:null!==(i=s.email_verified)&&void 0!==i&&i,creationDate:void 0}),yield this.environmentService.seedUserEnvironment(o),yield this.accountService.switchAccount(o),yield this.verifyAccountAdded(o),yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(o,I.fromIdentityTokenResponse(e)),null!=(null===(n=e.userDecryptionOptions)||void 0===n?void 0:n.masterPasswordUnlock)){const t=e.userDecryptionOptions.masterPasswordUnlock.toMasterPasswordUnlockData();yield this.masterPasswordService.setMasterPasswordUnlockData(t,o)}const a=yield(0,B._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(o)),l=yield(0,B._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(o));return yield this.tokenService.setTokens(e.accessToken,a,l,e.refreshToken),yield this.KdfConfigService.setKdfConfig(o,e.kdfConfig),yield this.billingAccountProfileStateService.setHasPremium(null!==(r=s.premium)&&void 0!==r&&r,!1,o),o})}processTokenResponse(e){return J(this,void 0,void 0,function*(){var t;const i=new K;if(this.encryptionKeyMigrationRequired(e))return i.requiresEncryptionKeyMigration=!0,i;const n=yield this.saveAccountInformation(e);if(i.userId=n,null!=e.twoFactorToken){const t=yield this.tokenService.getEmail();yield this.tokenService.setTwoFactorToken(t,e.twoFactorToken)}return yield this.setMasterKey(e,n),yield this.setAccountCryptographicState(e,n),yield this.setUserKey(e,n),yield this.processForceSetPasswordReason(e.forcePasswordReset,n),this.messagingService.send("loggedIn"),i.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,i})}encryptionKeyMigrationRequired(e){return!1}processForceSetPasswordReason(e,t){return J(this,void 0,void 0,function*(){return!!e&&(yield this.masterPasswordService.setForceSetPasswordReason(X.n.AdminForcePasswordReset,t),!0)})}processTwoFactorResponse(e){return J(this,void 0,void 0,function*(){var t;yield this.clearTwoFactorToken();const i=new K;return i.twoFactorProviders=e.twoFactorProviders2,yield this.twoFactorService.setProviders(e),i.ssoEmail2FaSessionToken=e.ssoEmail2faSessionToken,i.email=null!==(t=e.email)&&void 0!==t?t:"",i})}clearTwoFactorToken(){return J(this,void 0,void 0,function*(){const e=this.cache.value.userEnteredEmail;e&&(yield this.tokenService.clearTwoFactorToken(e))})}verifyAccountAdded(e){return J(this,void 0,void 0,function*(){yield(0,B._)(this.accountService.activeAccount$.pipe((0,N.p)(t=>(null==t?void 0:t.id)===e),(0,z.w)({first:1e3,with:()=>{throw new Error("Expected user never made active user after initialization.")}})))})}processDeviceVerificationResponse(e){return J(this,void 0,void 0,function*(){const e=new K;return e.requiresDeviceVerification=!0,e})}processSsoRequiredResponse(e){return J(this,void 0,void 0,function*(){const t=new K;return t.ssoOrganizationIdentifier=e.ssoOrganizationIdentifier,t})}}var _=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ee{static fromJSON(e){return Object.assign(new ee,e,{tokenRequest:j.fromJSON(e.tokenRequest),authRequestCredentials:f.fromJSON(e.authRequestCredentials)})}}class te extends Z{constructor(e,t,...i){super(...i),this.deviceTrustService=t,this.cache=new P.t(e),this.email$=this.cache.pipe((0,x.T)(e=>e.tokenRequest.email)),this.accessCode$=this.cache.pipe((0,x.T)(e=>e.authRequestCredentials.accessCode)),this.authRequestId$=this.cache.pipe((0,x.T)(e=>e.authRequestCredentials.authRequestId))}logIn(e){return _(this,void 0,void 0,function*(){const t=new ee;t.tokenRequest=new j(e.email,e.accessCode,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){const t=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return _(this,void 0,void 0,function*(){const i=this.cache.value;return this.cache.next(i),t.logInTwoFactor.call(this,e)})}setMasterKey(e,t){return _(this,void 0,void 0,function*(){})}setUserKey(e,t){return _(this,void 0,void 0,function*(){const i=this.cache.value.authRequestCredentials;e.key&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t)),i.decryptedUserKey?yield this.keyService.setUserKey(i.decryptedUserKey,t):(yield this.trySetUserKeyWithMasterKey(t),yield this.deviceTrustService.trustDeviceIfRequired(t))})}trySetUserKeyWithMasterKey(e){return _(this,void 0,void 0,function*(){const t=yield(0,B._)(this.masterPasswordService.masterKey$(e));if(t){const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(t,e);yield this.keyService.setUserKey(i,e)}})}setAccountCryptographicState(e,t){return _(this,void 0,void 0,function*(){yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeysResponseModel.toWrappedAccountCryptographicState(),t)})}exportCache(){return{authRequest:this.cache.value}}}var ie=i(46217),ne=i(82468),re=i(68467),se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class oe{constructor(){this.unlockServiceForPasswordLogin=!1,this.forcePasswordResetReason=X.n.None}static fromJSON(e){return Object.assign(new oe,e,{tokenRequest:j.fromJSON(e.tokenRequest),masterKey:p.e.fromJSON(e.masterKey)})}}class ae extends Z{constructor(e,t,i,n,r,...s){super(...s),this.passwordStrengthService=t,this.policyService=i,this.passwordPreloginService=n,this.unlockService=r,this.cache=new P.t(e),this.email$=this.cache.pipe((0,x.T)(e=>e.tokenRequest.email)),this.serverMasterKeyHash$=this.cache.pipe((0,x.T)(e=>e.tokenRequest.masterPasswordHash)),this.localMasterKeyHash$=this.cache.pipe((0,x.T)(e=>e.localMasterKeyHash))}logIn(e){return se(this,void 0,void 0,function*(){const t=yield this.configService.getFeatureFlag(ne.TO.UseUnlockServiceForPasswordLogin),{email:i,masterPassword:n,twoFactor:r,preFetchedPreloginData:s}=e,o=new oe;o.masterKey=yield this.makePasswordPreloginMasterKey(n,i,s),this.passwordPreloginService.clearCache(),o.masterPassword=n,o.unlockServiceForPasswordLogin=t,o.userEnteredEmail=i,o.localMasterKeyHash=yield this.keyService.hashMasterKey(n,o.masterKey,re.VK.LocalAuthorization);const a=yield this.keyService.hashMasterKey(n,o.masterKey);o.tokenRequest=new j(i,a,yield this.buildTwoFactor(r,i),yield this.buildDeviceRequest()),this.cache.next(o);const[l,c]=yield this.startLogIn();return yield this.evaluateMasterPasswordIfRequired(c,e,l),l})}logInTwoFactor(e){const t=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return se(this,void 0,void 0,function*(){return yield t.logInTwoFactor.call(this,e)})}setMasterKey(e,t){return se(this,void 0,void 0,function*(){if(!this.cache.value.unlockServiceForPasswordLogin){const{masterKey:e,localMasterKeyHash:i}=this.cache.value;yield this.masterPasswordService.setMasterKey(e,t),yield this.masterPasswordService.setMasterKeyHash(i,t)}})}setUserKey(e,t){return se(this,void 0,void 0,function*(){if(this.cache.value.unlockServiceForPasswordLogin)yield this.unlockService.unlockWithMasterPassword(t,this.cache.value.masterPassword);else{if(this.encryptionKeyMigrationRequired(e))return;yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t);const i=yield(0,B._)(this.masterPasswordService.masterKey$(t));if(i){const e=yield this.masterPasswordService.decryptUserKeyWithMasterKey(i,t);yield this.keyService.setUserKey(e,t)}}})}setAccountCryptographicState(e,t){return se(this,void 0,void 0,function*(){yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeysResponseModel.toWrappedAccountCryptographicState(),t)})}encryptionKeyMigrationRequired(e){return!e.key}makePasswordPreloginMasterKey(e,t,i){return se(this,void 0,void 0,function*(){if(i)return this.keyService.makeMasterKey(e,t,i.kdfConfig);const n=yield(0,B._)(this.passwordPreloginService.getPreloginData$(t));if(!n)throw new Error("KDF config is required");return this.keyService.makeMasterKey(e,t,n.kdfConfig)})}evaluateMasterPasswordIfRequired(e,t,i){return se(this,void 0,void 0,function*(){if(e instanceof q.H||e instanceof H.u)return;const n=this.policyService.combineMasterPasswordPolicyOptions(t.masterPasswordPoliciesFromOrgInvite,this.getMasterPasswordPolicyOptionsFromResponse(e));if(!t.masterPasswordPoliciesFromOrgInvite&&!(null==n?void 0:n.enforceOnLogin))return;this.evaluateMasterPassword(t,n)||(e instanceof $.x?this.cache.next(Object.assign(Object.assign({},this.cache.value),{forcePasswordResetReason:X.n.WeakMasterPassword})):yield this.masterPasswordService.setForceSetPasswordReason(X.n.WeakMasterPassword,i.userId))})}getMasterPasswordPolicyOptionsFromResponse(e){return null==e?null:ie.U.fromResponse(e.masterPasswordPolicy)}evaluateMasterPassword({masterPassword:e,email:t},i){var n;const r=null===(n=this.passwordStrengthService.getPasswordStrength(e,t))||void 0===n?void 0:n.score;return this.policyService.evaluateMasterPassword(r,e,i)}exportCache(){return{password:this.cache.value}}logInNewDeviceVerification(e){return se(this,void 0,void 0,function*(){var t;const i=this.cache.value;i.tokenRequest.newDeviceOtp=e,this.cache.next(i);const[n]=yield this.startLogIn();return n.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,n})}processForceSetPasswordReason(e,t){const i=Object.create(null,{processForceSetPasswordReason:{get:()=>super.processForceSetPasswordReason}});return se(this,void 0,void 0,function*(){if(yield i.processForceSetPasswordReason.call(this,e,t))return!1;const n=this.cache.value.forcePasswordResetReason;return n!==X.n.None&&(yield this.masterPasswordService.setForceSetPasswordReason(n,t),!0)})}}class le extends V.D{constructor(e,t,i,n,r){super(n,r),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(le.prototype),e,{device:e.device?U.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var ce=i(51151),de=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ue{static fromJSON(e){return Object.assign(new ue,e,{tokenRequest:le.fromJSON(e.tokenRequest)})}}class he extends Z{constructor(e,t,i,n,r,...s){super(...s),this.keyConnectorService=t,this.deviceTrustService=i,this.authRequestService=n,this.i18nService=r,this.cache=new P.t(e),this.email$=this.cache.pipe((0,x.T)(e=>e.email)),this.orgId$=this.cache.pipe((0,x.T)(e=>e.orgId)),this.ssoEmail2FaSessionToken$=this.cache.pipe((0,x.T)(e=>e.ssoEmail2FaSessionToken))}logIn(e){return de(this,void 0,void 0,function*(){const t=new ue;t.orgId=e.orgId,t.userEnteredEmail=e.email;const i=yield this.buildDeviceRequest();this.logService.info("Logging in with appId %s.",i.identifier),t.tokenRequest=new le(e.code,e.codeVerifier,e.redirectUrl,yield this.buildTwoFactor(e.twoFactor,e.email),i),this.cache.next(t);const[n]=yield this.startLogIn(),r=n.email,s=n.ssoEmail2FaSessionToken;return this.cache.next(Object.assign(Object.assign({},this.cache.value),{email:r,ssoEmail2FaSessionToken:s})),n})}setMasterKey(e,t){return de(this,void 0,void 0,function*(){if(this.shouldSetMasterKeyFromKeyConnector(e)){if(null==e.key)yield this.keyConnectorService.setNewSsoUserKeyConnectorConversionData({kdfConfig:e.kdfConfig,keyConnectorUrl:this.getKeyConnectorUrl(e),organizationId: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}}getKeyConnectorUrl(e){var t;const i=null==e?void 0:e.userDecryptionOptions;return null===(t=null==i?void 0:i.keyConnectorOption)||void 0===t?void 0:t.keyConnectorUrl}setUserKey(e,t){return de(this,void 0,void 0,function*(){const i=e.key;i&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(i,t));const n=null==e?void 0:e.userDecryptionOptions;if(null==n?void 0:n.trustedDeviceOption){this.logService.info("Attempting to set user key with approved admin auth request."),yield this.trySetUserKeyWithApprovedAdminRequestIfExists(t);(yield this.keyService.hasUserKey(t))||(this.logService.info("Attempting to set user key with device key."),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 O._&&n.statusCode===ce.kG.NotFound&&(yield this.authRequestService.clearAdminAuthRequest(e)))}(null==i?void 0:i.requestApproved)&&(yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(i,t.privateKey,e),(yield this.keyService.hasUserKey(e))&&(yield this.deviceTrustService.trustDeviceIfRequired(e),yield this.authRequestService.clearAdminAuthRequest(e),this.authRequestService.emitAdminLoginApproved()))})}trySetUserKeyWithDeviceKey(e,t){return de(this,void 0,void 0,function*(){var i;const n=null===(i=e.userDecryptionOptions)||void 0===i?void 0:i.trustedDeviceOption;if(!n)return void this.logService.error("Unable to set user key due to missing trustedDeviceOption.");const r=yield this.deviceTrustService.getDeviceKey(t),s=null==n?void 0:n.encryptedPrivateKey,o=null==n?void 0:n.encryptedUserKey;if(!r||!s||!o)return r?s&&o||(yield this.deviceTrustService.recordDeviceTrustLoss()):this.logService.warning("Unable to set user key due to missing device key."),s||this.logService.warning("Unable to set user key due to missing encrypted device private key."),void(o||this.logService.warning("Unable to set user key due to missing encrypted user key."));const a=yield this.deviceTrustService.decryptUserKeyWithDeviceKey(t,s,o,r);a&&(yield this.keyService.setUserKey(a,t))})}trySetUserKeyWithMasterKey(e){return de(this,void 0,void 0,function*(){const t=yield(0,B._)(this.masterPasswordService.masterKey$(e));if(!t)return;const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(t,e);yield this.keyService.setUserKey(i,e)})}setAccountCryptographicState(e,t){return de(this,void 0,void 0,function*(){e.accountKeysResponseModel&&(yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeysResponseModel.toWrappedAccountCryptographicState(),t))})}exportCache(){return{sso:this.cache.value}}processForceSetPasswordReason(e,t){const i=Object.create(null,{processForceSetPasswordReason:{get:()=>super.processForceSetPasswordReason}});return de(this,void 0,void 0,function*(){var n,r,s,o;if(yield i.processForceSetPasswordReason.call(this,e,t))return!1;const a=yield(0,B._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(t));if(!a)return!1;if(null===(n=a.trustedDeviceOption)||void 0===n?void 0:n.isTdeOffboarding)return yield this.masterPasswordService.setForceSetPasswordReason(X.n.TdeOffboarding,t),!0;const l=yield(0,B._)(this.keyService.userEncryptedPrivateKey$(t)),c=yield this.keyService.hasUserKey(t);return a.trustedDeviceOption||a.hasMasterPassword||(null===(r=a.keyConnectorOption)||void 0===r?void 0:r.keyConnectorUrl)||!l||c?!a.hasMasterPassword&&(null===(s=a.trustedDeviceOption)||void 0===s?void 0:s.hasManageResetPasswordPermission)?(yield this.masterPasswordService.setForceSetPasswordReason(X.n.TdeUserWithoutPasswordHasPasswordResetPermission,t),!0):!(a.hasMasterPassword||(null===(o=a.keyConnectorOption)||void 0===o?void 0:o.keyConnectorUrl)||a.trustedDeviceOption)&&(yield this.masterPasswordService.setForceSetPasswordReason(X.n.SsoNewJitProvisionedUser,t),!0):(yield this.masterPasswordService.setForceSetPasswordReason(X.n.TdeOffboardingUntrustedDevice,t),!0)})}}var Ae=i(65485),pe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ge{static fromJSON(e){return Object.assign(new ge,e,{tokenRequest:Ae.i.fromJSON(e.tokenRequest)})}}class ve extends Z{constructor(e,t,...i){super(...i),this.keyConnectorService=t,this.cache=new P.t(e)}logIn(e){return pe(this,void 0,void 0,function*(){const t=new ge;t.tokenRequest=new Ae.i(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 pe(this,void 0,void 0,function*(){if(e.apiUseKeyConnector){const e=(yield(0,B._)(this.environmentService.environment$)).getKeyConnectorUrl();yield this.keyConnectorService.setMasterKeyFromUrl(e,t)}})}setUserKey(e,t){return pe(this,void 0,void 0,function*(){if(e.key&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t)),e.apiUseKeyConnector){const e=yield(0,B._)(this.masterPasswordService.masterKey$(t));if(e){const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(e,t);yield this.keyService.setUserKey(i,t)}}})}setAccountCryptographicState(e,t){return pe(this,void 0,void 0,function*(){yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeysResponseModel.toWrappedAccountCryptographicState(),t)})}saveAccountInformation(e){const t=Object.create(null,{saveAccountInformation:{get:()=>super.saveAccountInformation}});return pe(this,void 0,void 0,function*(){const i=yield t.saveAccountInformation.call(this,e),n=yield(0,B._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(i)),r=yield(0,B._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(i)),s=this.cache.value.tokenRequest;return yield this.tokenService.setClientId(s.clientId,n,r),yield this.tokenService.setClientSecret(s.clientSecret,n,r),i})}exportCache(){return{userApiKey:this.cache.value}}}class fe extends V.D{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(fe.prototype),e,{deviceResponse:A.c.fromJSON(e.deviceResponse),device:e.device?U.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var me=i(39306),ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ce{static fromJSON(e){return Object.assign(new Ce,e,{tokenRequest:fe.fromJSON(e.tokenRequest),credentials:m.fromJSON(e.credentials)})}}class we extends Z{constructor(e,...t){super(...t),this.cache=new P.t(e)}logIn(e){return ye(this,void 0,void 0,function*(){const t=new Ce;t.credentials=e,t.tokenRequest=new fe(e.token,e.deviceResponse,yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn();return i})}logInTwoFactor(){return ye(this,void 0,void 0,function*(){throw new Error("2FA not supported yet for WebAuthn Login.")})}setMasterKey(e,t){return ye(this,void 0,void 0,function*(){})}setUserKey(e,t){return ye(this,void 0,void 0,function*(){const i=e.key;i&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(i,t));const n=null==e?void 0:e.userDecryptionOptions;if(null==n?void 0:n.webAuthnPrfOption){const e=this.cache.value.credentials;if(!e.prfKey)return;const i=n.webAuthnPrfOption,r=yield this.encryptService.unwrapDecapsulationKey(i.encryptedPrivateKey,e.prfKey),s=yield this.encryptService.decapsulateKeyUnsigned(new me.k(i.encryptedUserKey.encryptedString),r);s&&(yield this.keyService.setUserKey(s,t))}})}setAccountCryptographicState(e,t){return ye(this,void 0,void 0,function*(){yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeysResponseModel.toWrappedAccountCryptographicState(),t)})}exportCache(){return{webAuthn:this.cache.value}}}const Ie=new S.Zs(S.Gm,"currentLoginStrategy",{deserializer:e=>e}),be=new S.Zs(S.Gm,"loginStrategyCacheExpiration",{deserializer:e=>e?null:new Date(e)}),Be=new S.Zs(S.Gm,"authRequestPushNotification",{deserializer:e=>e}),Ee=new S.Zs(S.Gm,"loginStrategyCache",{deserializer:e=>null==e?null:{password:e.password?oe.fromJSON(e.password):void 0,sso:e.sso?ue.fromJSON(e.sso):void 0,userApiKey:e.userApiKey?ge.fromJSON(e.userApiKey):void 0,authRequest:e.authRequest?ee.fromJSON(e.authRequest):void 0,webAuthn:e.webAuthn?Ce.fromJSON(e.webAuthn):void 0}});var Se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qe=3e5;class ke{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S,Q,k){this.accountService=e,this.masterPasswordService=t,this.unlockService=i,this.keyService=n,this.apiService=r,this.tokenService=s,this.appIdService=o,this.platformUtilsService=a,this.messagingService=l,this.logService=c,this.keyConnectorService=d,this.environmentService=u,this.stateService=h,this.twoFactorService=A,this.i18nService=p,this.encryptService=g,this.passwordStrengthService=v,this.policyService=f,this.deviceTrustService=m,this.authRequestService=y,this.userDecryptionOptionsService=C,this.stateProvider=w,this.billingAccountProfileStateService=I,this.vaultTimeoutSettingsService=b,this.kdfConfigService=B,this.taskSchedulerService=E,this.configService=S,this.accountCryptographicStateService=Q,this.passwordPreloginService=k,this.authenticationTimeoutSubject=new P.t(!1),this.authenticationSessionTimeout$=this.authenticationTimeoutSubject.asObservable(),this.currentAuthnTypeState=this.stateProvider.get(Ie),this.loginStrategyCacheState=this.stateProvider.get(Ee),this.loginStrategyCacheExpirationState=this.stateProvider.get(be),this.authRequestPushNotificationState=this.stateProvider.get(Be),this.taskSchedulerService.registerTaskHandler(G.fq.loginStrategySessionTimeout,()=>Se(this,void 0,void 0,function*(){this.authenticationTimeoutSubject.next(!0);try{yield this.clearCache()}catch(e){this.logService.error("Failed to clear cache during session timeout",e)}})),this.currentAuthType$=this.currentAuthnTypeState.state$,this.loginStrategy$=this.currentAuthnTypeState.state$.pipe((0,R.F)(),(0,D.v)(this.loginStrategyCacheState.state$),this.initializeLoginStrategy.bind(this),(0,M.t)({refCount:!0,bufferSize:1}))}getEmail(){return Se(this,void 0,void 0,function*(){const e=yield(0,B._)(this.loginStrategy$);return e&&"email$"in e?yield(0,B._)(e.email$):null})}getMasterPasswordHash(){return Se(this,void 0,void 0,function*(){const e=yield(0,B._)(this.loginStrategy$);return e&&"serverMasterKeyHash$"in e?yield(0,B._)(e.serverMasterKeyHash$):null})}getSsoEmail2FaSessionToken(){return Se(this,void 0,void 0,function*(){const e=yield(0,B._)(this.loginStrategy$);return e&&"ssoEmail2FaSessionToken$"in e?yield(0,B._)(e.ssoEmail2FaSessionToken$):null})}getAccessCode(){return Se(this,void 0,void 0,function*(){const e=yield(0,B._)(this.loginStrategy$);return e&&"accessCode$"in e?yield(0,B._)(e.accessCode$):null})}getAuthRequestId(){return Se(this,void 0,void 0,function*(){const e=yield(0,B._)(this.loginStrategy$);return e&&"authRequestId$"in e?yield(0,B._)(e.authRequestId$):null})}logIn(e){return Se(this,void 0,void 0,function*(){yield this.clearCache(),this.authenticationTimeoutSubject.next(!1),yield this.currentAuthnTypeState.update(t=>e.type);const t=yield(0,B._)(this.loginStrategy$),i=Object.assign({},e),n=yield null==t?void 0:t.logIn(i);if(null==n||n.requiresTwoFactor||n.requiresDeviceVerification?(yield this.loginStrategyCacheState.update(e=>{var i;return null!==(i=null==t?void 0:t.exportCache())&&void 0!==i?i:null}),yield this.startSessionTimeout()):yield this.clearCache(),!n)throw new Error("No auth result returned");return n})}logInTwoFactor(e){return Se(this,void 0,void 0,function*(){if(!(yield this.isSessionValid()))throw new Error(this.i18nService.t("sessionTimeout"));const t=yield(0,B._)(this.loginStrategy$);if(null==t)throw new Error("No login strategy found.");try{const i=yield t.logInTwoFactor(e);return null==i||i.requiresTwoFactor||(yield this.clearCache()),i}catch(i){throw i instanceof O._||(yield this.clearCache()),i}})}logInNewDeviceVerification(e){return Se(this,void 0,void 0,function*(){if(!(yield this.isSessionValid()))throw new Error(this.i18nService.t("sessionTimeout"));const t=yield(0,B._)(this.loginStrategy$);if(null==t)throw new Error("No login strategy found.");if(!("logInNewDeviceVerification"in t))throw new Error("Current login strategy does not support device verification.");try{const i=yield t.logInNewDeviceVerification(e);return null===i||i.requiresDeviceVerification||(yield this.clearCache()),i}catch(i){throw i instanceof O._||(yield this.clearCache()),i}})}clearCache(){return Se(this,void 0,void 0,function*(){yield this.currentAuthnTypeState.update(e=>null),yield this.loginStrategyCacheState.update(e=>null),this.authenticationTimeoutSubject.next(!1),yield this.clearSessionTimeout()})}startSessionTimeout(){return Se(this,void 0,void 0,function*(){yield this.clearSessionTimeout(),yield this.loginStrategyCacheExpirationState.update(e=>new Date(Date.now()+Qe)),this.sessionTimeoutSubscription=this.taskSchedulerService.setTimeout(G.fq.loginStrategySessionTimeout,Qe)})}clearSessionTimeout(){return Se(this,void 0,void 0,function*(){var e;yield this.loginStrategyCacheExpirationState.update(e=>null),null===(e=this.sessionTimeoutSubscription)||void 0===e||e.unsubscribe()})}isSessionValid(){return Se(this,void 0,void 0,function*(){if(null==(yield(0,B._)(this.loginStrategyCacheState.state$)))return!1;const e=yield(0,B._)(this.loginStrategyCacheExpirationState.state$);return!(null!=e&&e<new Date)||(yield this.clearCache(),!1)})}initializeLoginStrategy(e){const t=[this.accountService,this.masterPasswordService,this.keyService,this.encryptService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.billingAccountProfileStateService,this.vaultTimeoutSettingsService,this.kdfConfigService,this.environmentService,this.configService,this.accountCryptographicStateService];return e.pipe((0,x.T)(([e,i])=>{var n,r,o,a,l;if(null==e)return null;switch(e){case s.Password:return new ae(null!==(n=null==i?void 0:i.password)&&void 0!==n?n:new oe,this.passwordStrengthService,this.policyService,this.passwordPreloginService,this.unlockService,...t);case s.Sso:return new he(null!==(r=null==i?void 0:i.sso)&&void 0!==r?r:new ue,this.keyConnectorService,this.deviceTrustService,this.authRequestService,this.i18nService,...t);case s.UserApiKey:return new ve(null!==(o=null==i?void 0:i.userApiKey)&&void 0!==o?o:new ge,this.keyConnectorService,...t);case s.AuthRequest:return new te(null!==(a=null==i?void 0:i.authRequest)&&void 0!==a?a:new ee,this.deviceTrustService,...t);case s.WebAuthn:return new we(null!==(l=null==i?void 0:i.webAuthn)&&void 0!==l?l:new Ce,...t)}}))}}var Te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fe=new S.Ok(S.xu,"decryptionOptions",{deserializer:e=>I.fromJSON(e),clearOn:["logout"]});class Pe{constructor(e){this.singleUserStateProvider=e}userDecryptionOptionsById$(e){return this.singleUserStateProvider.get(e,Fe).state$.pipe((0,N.p)(e=>null!=e))}hasMasterPasswordById$(e){return this.userDecryptionOptionsById$(e).pipe((0,x.T)(e=>{var t;return null!==(t=e.hasMasterPassword)&&void 0!==t&&t}))}setUserDecryptionOptionsById(e,t){return Te(this,void 0,void 0,function*(){yield this.singleUserStateProvider.get(e,Fe).update(e=>t)})}}var Re=i(66046),De=i(43008),Me=i(99352);class xe{constructor(e,t,i,n){this.key=e,this.masterPasswordHash=t,this.deviceIdentifier=i,this.requestApproved=n}}var Oe=i(1086),Ge=i(3633),Ue=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ve=new S.Ok(S.dn,"adminAuthRequest",{deserializer:e=>e,clearOn:[]});class je{constructor(e,t,i,n,r,s,o,a){this.appIdService=e,this.masterPasswordService=t,this.keyService=i,this.encryptService=n,this.apiService=r,this.stateProvider=s,this.authRequestApiService=o,this.accountService=a,this.authRequestPushNotificationSubject=new Re.B,this.adminLoginApprovedSubject=new Re.B,this.authRequestPushNotification$=this.authRequestPushNotificationSubject.asObservable(),this.adminLoginApproved$=this.adminLoginApprovedSubject.asObservable()}getAdminAuthRequest(e){return Ue(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required");const t=yield(0,B._)(this.stateProvider.getUser(e,Ve).state$);return Me.x.fromJSON(t)})}setAdminAuthRequest(e,t){return Ue(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(Ve,e.toJSON(),t)})}clearAdminAuthRequest(e){return Ue(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required");yield this.stateProvider.setUserState(Ve,null,e)})}getPendingAuthRequests$(){return(0,De.v)(()=>this.authRequestApiService.getPendingAuthRequests()).pipe((0,x.T)(e=>e.data.map(e=>new Oe.B(e))))}getLatestPendingAuthRequest$(){return this.getPendingAuthRequests$().pipe((0,x.T)(e=>0===e.length?null:e.sort((e,t)=>{const i=new Date(e.creationDate).getTime();return new Date(t.creationDate).getTime()-i})[0]))}approveOrDenyAuthRequest(e,t){return Ue(this,void 0,void 0,function*(){const i=yield(0,B._)(this.accountService.activeAccount$.pipe(Ge.F6));if(!t.id)throw new Error("Auth request has no id");if(!t.publicKey)throw new Error("Auth request has no public key");if(null==i)throw new Error("User ID is required");const n=L.A.fromB64ToArray(t.publicKey),r=yield(0,B._)(this.keyService.userKey$(i)),s=yield this.encryptService.encapsulateKeyUnsigned(r,n),o=new xe(s.encryptedString,void 0,yield this.appIdService.getAppId(),e);return yield this.apiService.putAuthRequest(t.id,o)})}setUserKeyAfterDecryptingSharedUserKey(e,t,i){return Ue(this,void 0,void 0,function*(){const n=yield this.decryptPubKeyEncryptedUserKey(e.key,t);yield this.keyService.setUserKey(n,i)})}decryptPubKeyEncryptedUserKey(e,t){return Ue(this,void 0,void 0,function*(){return yield this.encryptService.decapsulateKeyUnsigned(new me.k(e),t)})}sendAuthRequestPushNotification(e){null!=e.id&&this.authRequestPushNotificationSubject.next(e.id)}getFingerprintPhrase(e,t){return Ue(this,void 0,void 0,function*(){return(yield this.keyService.getFingerprint(e.toLowerCase(),t)).join("-")})}emitAdminLoginApproved(){this.adminLoginApprovedSubject.next()}}var Ne=i(12277),ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ye{constructor(e,t){this.apiService=e,this.logService=t}getPendingAuthRequests(){return ze(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/auth-requests/pending",null,!0,!0);return new Ne.s(e,Oe.B)})}getAuthRequest(e){return ze(this,void 0,void 0,function*(){try{const t=`/auth-requests/${e}`,i=yield this.apiService.send("GET",t,null,!0,!0);return new Oe.B(i)}catch(t){throw this.logService.error(t),t}})}getAuthResponse(e,t){return ze(this,void 0,void 0,function*(){try{const i=`/auth-requests/${e}/response?code=${t}`,n=yield this.apiService.send("GET",i,null,!1,!0);return new Oe.B(n)}catch(i){throw this.logService.error(i),i}})}postAdminAuthRequest(e){return ze(this,void 0,void 0,function*(){try{const t=yield this.apiService.send("POST","/auth-requests/admin-request",e,!0,!0);return new Oe.B(t)}catch(t){throw this.logService.error(t),t}})}postAuthRequest(e){return ze(this,void 0,void 0,function*(){try{const t=yield this.apiService.send("POST","/auth-requests/",e,!1,!0,null,t=>{t.set("Device-Identifier",e.deviceIdentifier)});return new Oe.B(t)}catch(t){throw this.logService.error(t),t}})}}var Le=i(33338),Ke=i(60512),Xe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qe{}class He{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p){this.accountService=e,this.biometricService=t,this.vaultTimeoutSettingsService=i,this.logoutService=n,this.messagingService=r,this.searchService=s,this.folderService=o,this.masterPasswordService=a,this.stateEventRunnerService=l,this.cipherService=c,this.authService=d,this.systemService=u,this.processReloadService=h,this.logService=A,this.keyService=p}lockAll(){return Xe(this,void 0,void 0,function*(){const e=yield(0,B._)((0,Le.z)([this.accountService.activeAccount$,this.accountService.accounts$]).pipe((0,x.T)(([e,t])=>{const i=Object.keys(t);return null==e?{activeAccount:null,otherAccounts:i}:{activeAccount:e.id,otherAccounts:i.filter(t=>t!==e.id)}})));for(const t of e.otherAccounts)yield this.lock(t);null!=e.activeAccount&&(yield this.lock(e.activeAccount))})}lock(e){return Xe(this,void 0,void 0,function*(){if((0,Ke.x)(e,"userId","LockService"),this.logService.info(`[LockService] Locking user ${e}`),(yield(0,B._)(this.authService.authStatusFor$(e)))!==E.J.LoggedOut){if(!(yield this.vaultTimeoutSettingsService.canLock(e)))return yield this.logoutService.logout(e,"vaultTimeout"),void this.logService.info(`[LockService] User ${e} cannot lock, logging out instead.`);yield this.wipeDecryptedState(e),yield this.waitForLockedStatus(e),yield this.systemService.clearPendingClipboard(),yield this.runPlatformOnLockActions(),this.logService.info(`[LockService] Locked user ${e}`),yield this.biometricService.setShouldAutopromptNow(!1),this.messagingService.send("locked",{userId:e}),yield this.processReloadService.startProcessReload()}})}wipeDecryptedState(e){return Xe(this,void 0,void 0,function*(){yield this.searchService.clearIndex(e),yield this.folderService.clearDecryptedFolderState(e),yield this.masterPasswordService.clearMasterKey(e),yield this.cipherService.clearCache(e),yield this.keyService.clearStoredUserKey(e),yield this.stateEventRunnerService.handleEvent("lock",e)})}waitForLockedStatus(e){return Xe(this,void 0,void 0,function*(){yield(0,B._)(this.authService.authStatusFor$(e).pipe((0,N.p)(e=>e===E.J.Locked),(0,z.w)({first:5e3,with:()=>{throw new Error("The lock process did not complete in a reasonable amount of time.")}})))})}runPlatformOnLockActions(){return Xe(this,void 0,void 0,function*(){})}}var We=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class $e{constructor(e,t,i,n,r,s,o){this.configService=e,this.loginEmailService=t,this.ssoLoginService=i,this.syncService=n,this.userAsymmetricKeysRegenerationService=r,this.encryptedMigrator=s,this.logService=o}run(e,t){return We(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0,{skipTokenRefresh:!0}),yield this.userAsymmetricKeysRegenerationService.regenerateIfNeeded(e),yield this.loginEmailService.clearLoginEmail();try{yield this.encryptedMigrator.runMigrations(e,t)}catch(n){}const i=yield this.ssoLoginService.getSsoEmail();i?(yield this.ssoLoginService.updateSsoRequiredCache(i,e),yield this.ssoLoginService.clearSsoEmail()):this.logService.debug("SSO login email not found.")})}}var Je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ze{constructor(e){this.messagingService=e}logout(e,t){return Je(this,void 0,void 0,function*(){this.messagingService.send("logout",{userId:e,logoutReason:t})})}}function _e(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=L.A.fromUrlB64ToUtf8(i)}catch(r){throw new Error("Cannot decode the token")}try{return JSON.parse(n)}catch(s){throw new Error("Cannot parse the token's payload into JSON")}}},12117(e,t,i){"use strict";i.d(t,{E:()=>n});class n{constructor(e,t){this.options=e,this.token=t}}},12277(e,t,i){"use strict";i.d(t,{s:()=>r});var n=i(20702);class r extends n.r{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")}}},12694(e,t,i){"use strict";i.d(t,{H:()=>a});var n=i(94573),r=i(33277),s=i(33812);let o=0;class a{constructor(){this.id=o++,this.name=`bit-toggle-group-${this.id}`,this.fullWidth=(0,n.hFB)(void 0,{transform:n.L39}),this.selected=(0,n.geq)(),this.classlist=(0,r.EW)(()=>["tw-flex"].concat(this.fullWidth()?["tw-w-full","[&>*]:tw-flex-1"]:[]))}onInputInteraction(e){this.selected.set(e)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-toggle-group"]],hostAttrs:["role","radiogroup"],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classlist())},inputs:{fullWidth:[1,"fullWidth"],selected:[1,"selected"]},outputs:{selected:"selectedChange"},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(s.NAR(),s.SdG(0))},encapsulation:2,changeDetection:0})},13417(e,t,i){"use strict";i.d(t,{$:()=>n});class n{}},13496(e,t,i){"use strict";i.d(t,{Z:()=>u});var n=i(60989),r=i(58716),s=i(94573),o=i(33812),a=i(33277),l=i(78952),c=i(74208);function d(e,t){if(1&e){const e=o.RV6();o.j41(0,"div",0),o.bIt("click",function(){c.eBV(e);const t=o.XpG();return c.Njj(t.closed.emit())}),o.SdG(1),o.k0s()}if(2&e){const e=o.XpG();o.Y8G("cdkTrapFocusAutoCapture","dialog"===e.ariaRole()),o.BMQ("role",e.ariaRole())("aria-label",e.ariaLabel())}}class u{constructor(){this.templateRef=s.ebz.required(o.C4Q),this.closed=new o.bkB,this.menuItems=(0,s.tEk)(l.S,{descendants:!0}),this.ariaRole=(0,s.hFB)("menu"),this.ariaLabel=(0,s.hFB)(),(0,a.QZ)(()=>{"menu"===this.ariaRole()&&(this.keyManager=new r.B(this.menuItems()).withWrap().skipPredicate(e=>!!e.disabled))})}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.VBU({type:u,selectors:[["bit-menu"]],contentQueries:function(e,t,i){1&e&&o.C6U(i,t.menuItems,l.S,5),2&e&&o.NyB()},viewQuery:function(e,t){1&e&&o.wEZ(t.templateRef,o.C4Q,5),2&e&&o.NyB()},inputs:{ariaRole:[1,"ariaRole"],ariaLabel:[1,"ariaLabel"]},outputs:{closed:"closed"},exportAs:["menuComponent"],ngContentSelectors:["*"],decls:1,vars:0,consts:[["cdkTrapFocus","",1,"tw-flex","tw-shrink-0","tw-flex-col","tw-rounded-lg","tw-border","tw-border-solid","tw-border-secondary-100","tw-bg-background","tw-shadow-md","tw-bg-clip-padding","tw-py-1","tw-overflow-y-auto",3,"click","cdkTrapFocusAutoCapture"]],template:function(e,t){1&e&&(o.NAR(),o.DNE(0,d,2,3,"ng-template"))},dependencies:[n.kB],encapsulation:2})},14055(e,t,i){"use strict";i.d(t,{TU:()=>s,cD:()=>l,mv:()=>f,vj:()=>v,nS:()=>a,i5:()=>A,w$:()=>m,Lx:()=>h,qk:()=>p,x$:()=>y});var n=i(20702);class r extends n.r{constructor(e){super(e),this.code=this.getResponseProperty("Code"),this.value=this.getResponseProperty("Value")}}class s extends n.r{constructor(e){super(e),this.country=this.getResponseProperty("Country"),this.postalCode=this.getResponseProperty("PostalCode"),this.line1=this.getResponseProperty("Line1"),this.line2=this.getResponseProperty("Line2"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State");const t=this.getResponseProperty("TaxId");this.taxId=t?new r(t):null}}const o={amex:"card-amex",diners:"card-diners-club",discover:"card-discover",jcb:"card-jcb",mastercard:"card-mastercard",unionpay:"card-unionpay",visa:"card-visa"},a=e=>"card"!==(null==e?void 0:e.type)?null:e.brand in o?o[e.brand]:null;class l extends n.r{constructor(e){super(e);const t=this.getResponseProperty("Type");switch(t){case"card":this.value=new d(e);break;case"bankAccount":this.value=new c(e);break;case"payPal":this.value=new u(e);break;default:throw new Error(`Cannot deserialize unsupported payment method type: ${t}`)}}}class c extends n.r{constructor(e){super(e),this.type="bankAccount",this.bankName=this.getResponseProperty("BankName"),this.last4=this.getResponseProperty("Last4"),this.hostedVerificationUrl=this.getResponseProperty("HostedVerificationUrl")}}class d extends n.r{constructor(e){super(e),this.type="card",this.brand=this.getResponseProperty("Brand"),this.last4=this.getResponseProperty("Last4"),this.expiration=this.getResponseProperty("Expiration")}}class u extends n.r{constructor(e){super(e),this.type="payPal",this.email=this.getResponseProperty("Email")}}const h=[{name:"-- Select --",value:"",disabled:!1},{name:"United States",value:"US",disabled:!1},{name:"China",value:"CN",disabled:!1},{name:"France",value:"FR",disabled:!1},{name:"Germany",value:"DE",disabled:!1},{name:"Canada",value:"CA",disabled:!1},{name:"United Kingdom",value:"GB",disabled:!1},{name:"Australia",value:"AU",disabled:!1},{name:"India",value:"IN",disabled:!1},{name:"",value:"-",disabled:!0},{name:"Afghanistan",value:"AF",disabled:!1},{name:"Åland Islands",value:"AX",disabled:!1},{name:"Albania",value:"AL",disabled:!1},{name:"Algeria",value:"DZ",disabled:!1},{name:"American Samoa",value:"AS",disabled:!1},{name:"Andorra",value:"AD",disabled:!1},{name:"Angola",value:"AO",disabled:!1},{name:"Anguilla",value:"AI",disabled:!1},{name:"Antarctica",value:"AQ",disabled:!1},{name:"Antigua and Barbuda",value:"AG",disabled:!1},{name:"Argentina",value:"AR",disabled:!1},{name:"Armenia",value:"AM",disabled:!1},{name:"Aruba",value:"AW",disabled:!1},{name:"Austria",value:"AT",disabled:!1},{name:"Azerbaijan",value:"AZ",disabled:!1},{name:"Bahamas",value:"BS",disabled:!1},{name:"Bahrain",value:"BH",disabled:!1},{name:"Bangladesh",value:"BD",disabled:!1},{name:"Barbados",value:"BB",disabled:!1},{name:"Belarus",value:"BY",disabled:!1},{name:"Belgium",value:"BE",disabled:!1},{name:"Belize",value:"BZ",disabled:!1},{name:"Benin",value:"BJ",disabled:!1},{name:"Bermuda",value:"BM",disabled:!1},{name:"Bhutan",value:"BT",disabled:!1},{name:"Bolivia, Plurinational State of",value:"BO",disabled:!1},{name:"Bonaire, Sint Eustatius and Saba",value:"BQ",disabled:!1},{name:"Bosnia and Herzegovina",value:"BA",disabled:!1},{name:"Botswana",value:"BW",disabled:!1},{name:"Bouvet Island",value:"BV",disabled:!1},{name:"Brazil",value:"BR",disabled:!1},{name:"British Indian Ocean Territory",value:"IO",disabled:!1},{name:"Brunei Darussalam",value:"BN",disabled:!1},{name:"Bulgaria",value:"BG",disabled:!1},{name:"Burkina Faso",value:"BF",disabled:!1},{name:"Burundi",value:"BI",disabled:!1},{name:"Cambodia",value:"KH",disabled:!1},{name:"Cameroon",value:"CM",disabled:!1},{name:"Cape Verde",value:"CV",disabled:!1},{name:"Cayman Islands",value:"KY",disabled:!1},{name:"Central African Republic",value:"CF",disabled:!1},{name:"Chad",value:"TD",disabled:!1},{name:"Chile",value:"CL",disabled:!1},{name:"Christmas Island",value:"CX",disabled:!1},{name:"Cocos (Keeling) Islands",value:"CC",disabled:!1},{name:"Colombia",value:"CO",disabled:!1},{name:"Comoros",value:"KM",disabled:!1},{name:"Congo",value:"CG",disabled:!1},{name:"Congo, the Democratic Republic of the",value:"CD",disabled:!1},{name:"Cook Islands",value:"CK",disabled:!1},{name:"Costa Rica",value:"CR",disabled:!1},{name:"Côte d'Ivoire",value:"CI",disabled:!1},{name:"Croatia",value:"HR",disabled:!1},{name:"Cuba",value:"CU",disabled:!1},{name:"Curaçao",value:"CW",disabled:!1},{name:"Cyprus",value:"CY",disabled:!1},{name:"Czech Republic",value:"CZ",disabled:!1},{name:"Denmark",value:"DK",disabled:!1},{name:"Djibouti",value:"DJ",disabled:!1},{name:"Dominica",value:"DM",disabled:!1},{name:"Dominican Republic",value:"DO",disabled:!1},{name:"Ecuador",value:"EC",disabled:!1},{name:"Egypt",value:"EG",disabled:!1},{name:"El Salvador",value:"SV",disabled:!1},{name:"Equatorial Guinea",value:"GQ",disabled:!1},{name:"Eritrea",value:"ER",disabled:!1},{name:"Estonia",value:"EE",disabled:!1},{name:"Ethiopia",value:"ET",disabled:!1},{name:"Falkland Islands (Malvinas)",value:"FK",disabled:!1},{name:"Faroe Islands",value:"FO",disabled:!1},{name:"Fiji",value:"FJ",disabled:!1},{name:"Finland",value:"FI",disabled:!1},{name:"French Guiana",value:"GF",disabled:!1},{name:"French Polynesia",value:"PF",disabled:!1},{name:"French Southern Territories",value:"TF",disabled:!1},{name:"Gabon",value:"GA",disabled:!1},{name:"Gambia",value:"GM",disabled:!1},{name:"Georgia",value:"GE",disabled:!1},{name:"Ghana",value:"GH",disabled:!1},{name:"Gibraltar",value:"GI",disabled:!1},{name:"Greece",value:"GR",disabled:!1},{name:"Greenland",value:"GL",disabled:!1},{name:"Grenada",value:"GD",disabled:!1},{name:"Guadeloupe",value:"GP",disabled:!1},{name:"Guam",value:"GU",disabled:!1},{name:"Guatemala",value:"GT",disabled:!1},{name:"Guernsey",value:"GG",disabled:!1},{name:"Guinea",value:"GN",disabled:!1},{name:"Guinea-Bissau",value:"GW",disabled:!1},{name:"Guyana",value:"GY",disabled:!1},{name:"Haiti",value:"HT",disabled:!1},{name:"Heard Island and McDonald Islands",value:"HM",disabled:!1},{name:"Holy See (Vatican City State)",value:"VA",disabled:!1},{name:"Honduras",value:"HN",disabled:!1},{name:"Hong Kong",value:"HK",disabled:!1},{name:"Hungary",value:"HU",disabled:!1},{name:"Iceland",value:"IS",disabled:!1},{name:"Indonesia",value:"ID",disabled:!1},{name:"Iran, Islamic Republic of",value:"IR",disabled:!1},{name:"Iraq",value:"IQ",disabled:!1},{name:"Ireland",value:"IE",disabled:!1},{name:"Isle of Man",value:"IM",disabled:!1},{name:"Israel",value:"IL",disabled:!1},{name:"Italy",value:"IT",disabled:!1},{name:"Jamaica",value:"JM",disabled:!1},{name:"Japan",value:"JP",disabled:!1},{name:"Jersey",value:"JE",disabled:!1},{name:"Jordan",value:"JO",disabled:!1},{name:"Kazakhstan",value:"KZ",disabled:!1},{name:"Kenya",value:"KE",disabled:!1},{name:"Kiribati",value:"KI",disabled:!1},{name:"Korea, Democratic People's Republic of",value:"KP",disabled:!1},{name:"Korea, Republic of",value:"KR",disabled:!1},{name:"Kuwait",value:"KW",disabled:!1},{name:"Kyrgyzstan",value:"KG",disabled:!1},{name:"Lao People's Democratic Republic",value:"LA",disabled:!1},{name:"Latvia",value:"LV",disabled:!1},{name:"Lebanon",value:"LB",disabled:!1},{name:"Lesotho",value:"LS",disabled:!1},{name:"Liberia",value:"LR",disabled:!1},{name:"Libya",value:"LY",disabled:!1},{name:"Liechtenstein",value:"LI",disabled:!1},{name:"Lithuania",value:"LT",disabled:!1},{name:"Luxembourg",value:"LU",disabled:!1},{name:"Macao",value:"MO",disabled:!1},{name:"Macedonia, the former Yugoslav Republic of",value:"MK",disabled:!1},{name:"Madagascar",value:"MG",disabled:!1},{name:"Malawi",value:"MW",disabled:!1},{name:"Malaysia",value:"MY",disabled:!1},{name:"Maldives",value:"MV",disabled:!1},{name:"Mali",value:"ML",disabled:!1},{name:"Malta",value:"MT",disabled:!1},{name:"Marshall Islands",value:"MH",disabled:!1},{name:"Martinique",value:"MQ",disabled:!1},{name:"Mauritania",value:"MR",disabled:!1},{name:"Mauritius",value:"MU",disabled:!1},{name:"Mayotte",value:"YT",disabled:!1},{name:"Mexico",value:"MX",disabled:!1},{name:"Micronesia, Federated States of",value:"FM",disabled:!1},{name:"Moldova, Republic of",value:"MD",disabled:!1},{name:"Monaco",value:"MC",disabled:!1},{name:"Mongolia",value:"MN",disabled:!1},{name:"Montenegro",value:"ME",disabled:!1},{name:"Montserrat",value:"MS",disabled:!1},{name:"Morocco",value:"MA",disabled:!1},{name:"Mozambique",value:"MZ",disabled:!1},{name:"Myanmar",value:"MM",disabled:!1},{name:"Namibia",value:"NA",disabled:!1},{name:"Nauru",value:"NR",disabled:!1},{name:"Nepal",value:"NP",disabled:!1},{name:"Netherlands",value:"NL",disabled:!1},{name:"New Caledonia",value:"NC",disabled:!1},{name:"New Zealand",value:"NZ",disabled:!1},{name:"Nicaragua",value:"NI",disabled:!1},{name:"Niger",value:"NE",disabled:!1},{name:"Nigeria",value:"NG",disabled:!1},{name:"Niue",value:"NU",disabled:!1},{name:"Norfolk Island",value:"NF",disabled:!1},{name:"Northern Mariana Islands",value:"MP",disabled:!1},{name:"Norway",value:"NO",disabled:!1},{name:"Oman",value:"OM",disabled:!1},{name:"Pakistan",value:"PK",disabled:!1},{name:"Palau",value:"PW",disabled:!1},{name:"Palestinian Territory, Occupied",value:"PS",disabled:!1},{name:"Panama",value:"PA",disabled:!1},{name:"Papua New Guinea",value:"PG",disabled:!1},{name:"Paraguay",value:"PY",disabled:!1},{name:"Peru",value:"PE",disabled:!1},{name:"Philippines",value:"PH",disabled:!1},{name:"Pitcairn",value:"PN",disabled:!1},{name:"Poland",value:"PL",disabled:!1},{name:"Portugal",value:"PT",disabled:!1},{name:"Puerto Rico",value:"PR",disabled:!1},{name:"Qatar",value:"QA",disabled:!1},{name:"Réunion",value:"RE",disabled:!1},{name:"Romania",value:"RO",disabled:!1},{name:"Russian Federation",value:"RU",disabled:!1},{name:"Rwanda",value:"RW",disabled:!1},{name:"Saint Barthélemy",value:"BL",disabled:!1},{name:"Saint Helena, Ascension and Tristan da Cunha",value:"SH",disabled:!1},{name:"Saint Kitts and Nevis",value:"KN",disabled:!1},{name:"Saint Lucia",value:"LC",disabled:!1},{name:"Saint Martin (French part)",value:"MF",disabled:!1},{name:"Saint Pierre and Miquelon",value:"PM",disabled:!1},{name:"Saint Vincent and the Grenadines",value:"VC",disabled:!1},{name:"Samoa",value:"WS",disabled:!1},{name:"San Marino",value:"SM",disabled:!1},{name:"Sao Tome and Principe",value:"ST",disabled:!1},{name:"Saudi Arabia",value:"SA",disabled:!1},{name:"Senegal",value:"SN",disabled:!1},{name:"Serbia",value:"RS",disabled:!1},{name:"Seychelles",value:"SC",disabled:!1},{name:"Sierra Leone",value:"SL",disabled:!1},{name:"Singapore",value:"SG",disabled:!1},{name:"Sint Maarten (Dutch part)",value:"SX",disabled:!1},{name:"Slovakia",value:"SK",disabled:!1},{name:"Slovenia",value:"SI",disabled:!1},{name:"Solomon Islands",value:"SB",disabled:!1},{name:"Somalia",value:"SO",disabled:!1},{name:"South Africa",value:"ZA",disabled:!1},{name:"South Georgia and the South Sandwich Islands",value:"GS",disabled:!1},{name:"South Sudan",value:"SS",disabled:!1},{name:"Spain",value:"ES",disabled:!1},{name:"Sri Lanka",value:"LK",disabled:!1},{name:"Sudan",value:"SD",disabled:!1},{name:"Suriname",value:"SR",disabled:!1},{name:"Svalbard and Jan Mayen",value:"SJ",disabled:!1},{name:"Swaziland",value:"SZ",disabled:!1},{name:"Sweden",value:"SE",disabled:!1},{name:"Switzerland",value:"CH",disabled:!1},{name:"Syrian Arab Republic",value:"SY",disabled:!1},{name:"Taiwan",value:"TW",disabled:!1},{name:"Tajikistan",value:"TJ",disabled:!1},{name:"Tanzania, United Republic of",value:"TZ",disabled:!1},{name:"Thailand",value:"TH",disabled:!1},{name:"Timor-Leste",value:"TL",disabled:!1},{name:"Togo",value:"TG",disabled:!1},{name:"Tokelau",value:"TK",disabled:!1},{name:"Tonga",value:"TO",disabled:!1},{name:"Trinidad and Tobago",value:"TT",disabled:!1},{name:"Tunisia",value:"TN",disabled:!1},{name:"Turkey",value:"TR",disabled:!1},{name:"Turkmenistan",value:"TM",disabled:!1},{name:"Turks and Caicos Islands",value:"TC",disabled:!1},{name:"Tuvalu",value:"TV",disabled:!1},{name:"Uganda",value:"UG",disabled:!1},{name:"Ukraine",value:"UA",disabled:!1},{name:"United Arab Emirates",value:"AE",disabled:!1},{name:"United States Minor Outlying Islands",value:"UM",disabled:!1},{name:"Uruguay",value:"UY",disabled:!1},{name:"Uzbekistan",value:"UZ",disabled:!1},{name:"Vanuatu",value:"VU",disabled:!1},{name:"Venezuela, Bolivarian Republic of",value:"VE",disabled:!1},{name:"Viet Nam",value:"VN",disabled:!1},{name:"Virgin Islands, British",value:"VG",disabled:!1},{name:"Virgin Islands, U.S.",value:"VI",disabled:!1},{name:"Wallis and Futuna",value:"WF",disabled:!1},{name:"Western Sahara",value:"EH",disabled:!1},{name:"Yemen",value:"YE",disabled:!1},{name:"Zambia",value:"ZM",disabled:!1},{name:"Zimbabwe",value:"ZW",disabled:!1}],A=e=>{const t=p.filter(t=>t.iso===e);if(0===t.length)return null;if(1===t.length)return t[0];{const e=t.find(e=>e.impactsTaxCalculation);return e||t[0]}},p=[{country:"Albania",iso:"AL",code:"al_tin",description:"Albania Tax Identification Number",example:"J12345678N",impactsTaxCalculation:!0},{country:"Andorra",iso:"AD",code:"ad_nrt",description:"Andorran NRT number",example:"A-123456-Z",impactsTaxCalculation:!1},{country:"Angola",iso:"AO",code:"ao_tin",description:"Angola Tax Identification Number",example:"5123456789",impactsTaxCalculation:!1},{country:"Argentina",iso:"AR",code:"ar_cuit",description:"Argentinian tax ID number",example:"12-3456789-01",impactsTaxCalculation:!1},{country:"Armenia",iso:"AM",code:"am_tin",description:"Armenia Tax Identification Number",example:"2538904",impactsTaxCalculation:!0},{country:"Aruba",iso:"AW",code:"aw_tin",description:"Aruba Tax Identification Number",example:"12345678",impactsTaxCalculation:!0},{country:"Australia",iso:"AU",code:"au_abn",description:"Australian Business Number (AU ABN)",example:"12345678912",impactsTaxCalculation:!0},{country:"Australia",iso:"AU",code:"au_arn",description:"Australian Taxation Office Reference Number",example:"123456789123",impactsTaxCalculation:!1},{country:"Austria",iso:"AT",code:"eu_vat",description:"European VAT number",example:"ATU12345678",impactsTaxCalculation:!0},{country:"Azerbaijan",iso:"AZ",code:"az_tin",description:"Azerbaijan Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Bahamas",iso:"BS",code:"bs_tin",description:"Bahamas Tax Identification Number",example:"123.456.789",impactsTaxCalculation:!1},{country:"Bahrain",iso:"BH",code:"bh_vat",description:"Bahraini VAT Number",example:"123456789012345",impactsTaxCalculation:!0},{country:"Bangladesh",iso:"BD",code:"bd_bin",description:"Bangladesh Business Identification Number",example:"123456789-0123",impactsTaxCalculation:!0},{country:"Barbados",iso:"BB",code:"bb_tin",description:"Barbados Tax Identification Number",example:"1123456789012",impactsTaxCalculation:!1},{country:"Belarus",iso:"BY",code:"by_tin",description:"Belarus TIN Number",example:"123456789",impactsTaxCalculation:!0},{country:"Belgium",iso:"BE",code:"eu_vat",description:"European VAT number",example:"BE0123456789",impactsTaxCalculation:!0},{country:"Benin",iso:"BJ",code:"bj_ifu",description:"Benin Tax Identification Number (Identifiant Fiscal Unique)",example:"1234567890123",impactsTaxCalculation:!0},{country:"Bolivia",iso:"BO",code:"bo_tin",description:"Bolivian tax ID",example:"123456789",impactsTaxCalculation:!1},{country:"Bosnia & Herzegovina",iso:"BA",code:"ba_tin",description:"Bosnia and Herzegovina Tax Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Brazil",iso:"BR",code:"br_cnpj",description:"Brazilian CNPJ number",example:"01.234.456/5432-10",impactsTaxCalculation:!1},{country:"Brazil",iso:"BR",code:"br_cpf",description:"Brazilian CPF number",example:"123.456.789-87",impactsTaxCalculation:!1},{country:"Bulgaria",iso:"BG",code:"bg_uic",description:"Bulgaria Unified Identification Code",example:"123456789",impactsTaxCalculation:!1},{country:"Bulgaria",iso:"BG",code:"eu_vat",description:"European VAT number",example:"BG0123456789",impactsTaxCalculation:!0},{country:"Burkina Faso",iso:"BF",code:"bf_ifu",description:"Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique)",example:"12345678A",impactsTaxCalculation:!0},{country:"Cambodia",iso:"KH",code:"kh_tin",description:"Cambodia Tax Identification Number",example:"1001-123456789",impactsTaxCalculation:!0},{country:"Cameroon",iso:"CM",code:"cm_niu",description:"Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique)",example:"M123456789000L",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_bn",description:"Canadian BN",example:"123456789",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_gst_hst",description:"Canadian GST/HST number",example:"123456789RT0002",impactsTaxCalculation:!0},{country:"Canada",iso:"CA",code:"ca_pst_bc",description:"Canadian PST number (British Columbia)",example:"PST-1234-5678",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_pst_mb",description:"Canadian PST number (Manitoba)",example:"123456-7",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_pst_sk",description:"Canadian PST number (Saskatchewan)",example:"1234567",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_qst",description:"Canadian QST number (Québec)",example:"1234567890TQ1234",impactsTaxCalculation:!0},{country:"Cape Verde",iso:"CV",code:"cv_nif",description:"Cape Verde Tax Identification Number (Número de Identificação Fiscal)",example:"213456789",impactsTaxCalculation:!1},{country:"Chile",iso:"CL",code:"cl_tin",description:"Chilean TIN",example:"12.345.678-K",impactsTaxCalculation:!0},{country:"China",iso:"CN",code:"cn_tin",description:"Chinese tax ID",example:"123456789012345678",impactsTaxCalculation:!1},{country:"Colombia",iso:"CO",code:"co_nit",description:"Colombian NIT number",example:"123.456.789-0",impactsTaxCalculation:!1},{country:"Congo - Kinshasa",iso:"CD",code:"cd_nif",description:"Congo (DR) Tax Identification Number (Número de Identificação Fiscal)",example:"A0123456M",impactsTaxCalculation:!1},{country:"Costa Rica",iso:"CR",code:"cr_tin",description:"Costa Rican tax ID",example:"1-234-567890",impactsTaxCalculation:!1},{country:"Croatia",iso:"HR",code:"eu_vat",description:"European VAT number",example:"HR12345678912",impactsTaxCalculation:!0},{country:"Croatia",iso:"HR",code:"hr_oib",description:"Croatian Personal Identification Number",example:"12345678901",impactsTaxCalculation:!1},{country:"Cyprus",iso:"CY",code:"eu_vat",description:"European VAT number",example:"CY12345678Z",impactsTaxCalculation:!0},{country:"Czech Republic",iso:"CZ",code:"eu_vat",description:"European VAT number",example:"CZ1234567890",impactsTaxCalculation:!0},{country:"Denmark",iso:"DK",code:"eu_vat",description:"European VAT number",example:"DK12345678",impactsTaxCalculation:!0},{country:"Dominican Republic",iso:"DO",code:"do_rcn",description:"Dominican RCN number",example:"123-4567890-1",impactsTaxCalculation:!1},{country:"Ecuador",iso:"EC",code:"ec_ruc",description:"Ecuadorian RUC number",example:"1234567890001",impactsTaxCalculation:!1},{country:"Egypt",iso:"EG",code:"eg_tin",description:"Egyptian Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"El Salvador",iso:"SV",code:"sv_nit",description:"El Salvadorian NIT number",example:"1234-567890-123-4",impactsTaxCalculation:!1},{country:"Estonia",iso:"EE",code:"eu_vat",description:"European VAT number",example:"EE123456789",impactsTaxCalculation:!0},{country:"Ethiopia",iso:"ET",code:"et_tin",description:"Ethiopia Tax Identification Number",example:"1234567890",impactsTaxCalculation:!0},{country:"EU",iso:"EU",code:"eu_oss_vat",description:"European One Stop Shop VAT number for non-Union scheme",example:"EU123456789",impactsTaxCalculation:!1},{country:"Finland",iso:"FI",code:"eu_vat",description:"European VAT number",example:"FI12345678",impactsTaxCalculation:!0},{country:"France",iso:"FR",code:"eu_vat",description:"European VAT number",example:"FRAB123456789",impactsTaxCalculation:!0},{country:"Georgia",iso:"GE",code:"ge_vat",description:"Georgian VAT",example:"123456789",impactsTaxCalculation:!0},{country:"Germany",iso:"DE",code:"de_stn",description:"German Tax Number (Steuernummer)",example:"1234567890",impactsTaxCalculation:!1},{country:"Germany",iso:"DE",code:"eu_vat",description:"European VAT number",example:"DE123456789",impactsTaxCalculation:!0},{country:"Greece",iso:"GR",code:"eu_vat",description:"European VAT number",example:"EL123456789",impactsTaxCalculation:!0},{country:"Guinea",iso:"GN",code:"gn_nif",description:"Guinea Tax Identification Number (Número de Identificação Fiscal)",example:"123456789",impactsTaxCalculation:!0},{country:"Hong Kong",iso:"HK",code:"hk_br",description:"Hong Kong BR number",example:"12345678",impactsTaxCalculation:!1},{country:"Hungary",iso:"HU",code:"eu_vat",description:"European VAT number",example:"HU12345678",impactsTaxCalculation:!0},{country:"Hungary",iso:"HU",code:"hu_tin",description:"Hungary tax number (adószám)",example:"12345678-1-23",impactsTaxCalculation:!1},{country:"Iceland",iso:"IS",code:"is_vat",description:"Icelandic VAT",example:"123456",impactsTaxCalculation:!0},{country:"India",iso:"IN",code:"in_gst",description:"Indian GST number",example:"12ABCDE3456FGZH",impactsTaxCalculation:!0},{country:"Indonesia",iso:"ID",code:"id_npwp",description:"Indonesian NPWP number",example:"012.345.678.9-012.345",impactsTaxCalculation:!1},{country:"Ireland",iso:"IE",code:"eu_vat",description:"European VAT number",example:"IE1234567AB",impactsTaxCalculation:!0},{country:"Israel",iso:"IL",code:"il_vat",description:"Israel VAT",example:"12345",impactsTaxCalculation:!1},{country:"Italy",iso:"IT",code:"eu_vat",description:"European VAT number",example:"IT12345678912",impactsTaxCalculation:!0},{country:"Japan",iso:"JP",code:"jp_cn",description:"Japanese Corporate Number (*Hōjin Bangō*)",example:"1234567891234",impactsTaxCalculation:!1},{country:"Japan",iso:"JP",code:"jp_rn",description:"Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*)",example:"12345",impactsTaxCalculation:!1},{country:"Japan",iso:"JP",code:"jp_trn",description:"Japanese Tax Registration Number (*Tōroku Bangō*)",example:"T1234567891234",impactsTaxCalculation:!0},{country:"Kazakhstan",iso:"KZ",code:"kz_bin",description:"Kazakhstani Business Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Kenya",iso:"KE",code:"ke_pin",description:"Kenya Revenue Authority Personal Identification Number",example:"P000111111A",impactsTaxCalculation:!1},{country:"Kyrgyzstan",iso:"KG",code:"kg_tin",description:"Kyrgyzstan Tax Identification Number",example:"12345678901234",impactsTaxCalculation:!1},{country:"Laos",iso:"LA",code:"la_tin",description:"Laos Tax Identification Number",example:"123456789-000",impactsTaxCalculation:!1},{country:"Latvia",iso:"LV",code:"eu_vat",description:"European VAT number",example:"LV12345678912",impactsTaxCalculation:!0},{country:"Liechtenstein",iso:"LI",code:"li_uid",description:"Liechtensteinian UID number",example:"CHE123456789",impactsTaxCalculation:!1},{country:"Liechtenstein",iso:"LI",code:"li_vat",description:"Liechtensteinian VAT number",example:"12345",impactsTaxCalculation:!0},{country:"Lithuania",iso:"LT",code:"eu_vat",description:"European VAT number",example:"LT123456789123",impactsTaxCalculation:!0},{country:"Luxembourg",iso:"LU",code:"eu_vat",description:"European VAT number",example:"LU12345678",impactsTaxCalculation:!0},{country:"Malaysia",iso:"MY",code:"my_frp",description:"Malaysian FRP number",example:"12345678",impactsTaxCalculation:!1},{country:"Malaysia",iso:"MY",code:"my_itn",description:"Malaysian ITN",example:"C 1234567890",impactsTaxCalculation:!1},{country:"Malaysia",iso:"MY",code:"my_sst",description:"Malaysian SST number",example:"A12-3456-78912345",impactsTaxCalculation:!1},{country:"Malta",iso:"MT",code:"eu_vat",description:"European VAT number",example:"MT12345678",impactsTaxCalculation:!0},{country:"Mauritania",iso:"MR",code:"mr_nif",description:"Mauritania Tax Identification Number (Número de Identificação Fiscal)",example:"12345678",impactsTaxCalculation:!1},{country:"Mexico",iso:"MX",code:"mx_rfc",description:"Mexican RFC number",example:"ABC010203AB9",impactsTaxCalculation:!1},{country:"Moldova",iso:"MD",code:"md_vat",description:"Moldova VAT Number",example:"1234567",impactsTaxCalculation:!0},{country:"Montenegro",iso:"ME",code:"me_pib",description:"Montenegro PIB Number",example:"12345678",impactsTaxCalculation:!1},{country:"Morocco",iso:"MA",code:"ma_vat",description:"Morocco VAT Number",example:"12345678",impactsTaxCalculation:!0},{country:"Nepal",iso:"NP",code:"np_pan",description:"Nepal PAN Number",example:"123456789",impactsTaxCalculation:!0},{country:"Netherlands",iso:"NL",code:"eu_vat",description:"European VAT number",example:"NL123456789B12",impactsTaxCalculation:!0},{country:"New Zealand",iso:"NZ",code:"nz_gst",description:"New Zealand GST number",example:"123456789",impactsTaxCalculation:!0},{country:"Nigeria",iso:"NG",code:"ng_tin",description:"Nigerian Tax Identification Number",example:"12345678-0001",impactsTaxCalculation:!1},{country:"North Macedonia",iso:"MK",code:"mk_vat",description:"North Macedonia VAT Number",example:"MK1234567890123",impactsTaxCalculation:!0},{country:"Norway",iso:"NO",code:"no_vat",description:"Norwegian VAT number",example:"123456789MVA",impactsTaxCalculation:!0},{country:"Norway",iso:"NO",code:"no_voec",description:"Norwegian VAT on e-commerce number",example:"1234567",impactsTaxCalculation:!1},{country:"Oman",iso:"OM",code:"om_vat",description:"Omani VAT Number",example:"OM1234567890",impactsTaxCalculation:!0},{country:"Peru",iso:"PE",code:"pe_ruc",description:"Peruvian RUC number",example:"12345678901",impactsTaxCalculation:!0},{country:"Philippines",iso:"PH",code:"ph_tin",description:"Philippines Tax Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Poland",iso:"PL",code:"eu_vat",description:"European VAT number",example:"PL1234567890",impactsTaxCalculation:!0},{country:"Portugal",iso:"PT",code:"eu_vat",description:"European VAT number",example:"PT123456789",impactsTaxCalculation:!0},{country:"Romania",iso:"RO",code:"eu_vat",description:"European VAT number",example:"RO1234567891",impactsTaxCalculation:!0},{country:"Romania",iso:"RO",code:"ro_tin",description:"Romanian tax ID number",example:"1234567890123",impactsTaxCalculation:!1},{country:"Russia",iso:"RU",code:"ru_inn",description:"Russian INN",example:"1234567891",impactsTaxCalculation:!0},{country:"Russia",iso:"RU",code:"ru_kpp",description:"Russian KPP",example:"123456789",impactsTaxCalculation:!0},{country:"Saudi Arabia",iso:"SA",code:"sa_vat",description:"Saudi Arabia VAT",example:"123456789012345",impactsTaxCalculation:!0},{country:"Senegal",iso:"SN",code:"sn_ninea",description:"Senegal NINEA Number",example:"12345672A2",impactsTaxCalculation:!1},{country:"Serbia",iso:"RS",code:"rs_pib",description:"Serbian PIB number",example:"123456789",impactsTaxCalculation:!1},{country:"Singapore",iso:"SG",code:"sg_gst",description:"Singaporean GST",example:"M12345678X",impactsTaxCalculation:!0},{country:"Singapore",iso:"SG",code:"sg_uen",description:"Singaporean UEN",example:"123456789F",impactsTaxCalculation:!1},{country:"Slovakia",iso:"SK",code:"eu_vat",description:"European VAT number",example:"SK1234567891",impactsTaxCalculation:!0},{country:"Slovenia",iso:"SI",code:"eu_vat",description:"European VAT number",example:"SI12345678",impactsTaxCalculation:!0},{country:"Slovenia",iso:"SI",code:"si_tin",description:"Slovenia tax number (davčna številka)",example:"12345678",impactsTaxCalculation:!1},{country:"South Africa",iso:"ZA",code:"za_vat",description:"South African VAT number",example:"4123456789",impactsTaxCalculation:!0},{country:"South Korea",iso:"KR",code:"kr_brn",description:"Korean BRN",example:"123-45-67890",impactsTaxCalculation:!0},{country:"Spain",iso:"ES",code:"es_cif",description:"Spanish NIF number (previously Spanish CIF number)",example:"A12345678",impactsTaxCalculation:!1},{country:"Spain",iso:"ES",code:"eu_vat",description:"European VAT number",example:"ESA1234567Z",impactsTaxCalculation:!0},{country:"Suriname",iso:"SR",code:"sr_fin",description:"Suriname FIN Number",example:"1234567890",impactsTaxCalculation:!0},{country:"Sweden",iso:"SE",code:"eu_vat",description:"European VAT number",example:"SE123456789123",impactsTaxCalculation:!0},{country:"Switzerland",iso:"CH",code:"ch_uid",description:"Switzerland UID number",example:"CHE-123.456.789 HR",impactsTaxCalculation:!1},{country:"Switzerland",iso:"CH",code:"ch_vat",description:"Switzerland VAT number",example:"CHE-123.456.789 MWST",impactsTaxCalculation:!0},{country:"Taiwan",iso:"TW",code:"tw_vat",description:"Taiwanese VAT",example:"12345678",impactsTaxCalculation:!0},{country:"Tajikistan",iso:"TJ",code:"tj_tin",description:"Tajikistan Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Tanzania",iso:"TZ",code:"tz_vat",description:"Tanzania VAT Number",example:"12345678A",impactsTaxCalculation:!0},{country:"Thailand",iso:"TH",code:"th_vat",description:"Thai VAT",example:"1234567891234",impactsTaxCalculation:!0},{country:"Turkey",iso:"TR",code:"tr_tin",description:"Turkish Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Uganda",iso:"UG",code:"ug_tin",description:"Uganda Tax Identification Number",example:"1014751879",impactsTaxCalculation:!0},{country:"Ukraine",iso:"UA",code:"ua_vat",description:"Ukrainian VAT",example:"123456789",impactsTaxCalculation:!0},{country:"United Arab Emirates",iso:"AE",code:"ae_trn",description:"United Arab Emirates TRN",example:"123456789012345",impactsTaxCalculation:!0},{country:"United Kingdom",iso:"GB",code:"eu_vat",description:"Northern Ireland VAT number",example:"XI123456789",impactsTaxCalculation:!0},{country:"United Kingdom",iso:"GB",code:"gb_vat",description:"United Kingdom VAT number",example:"GB123456789",impactsTaxCalculation:!0},{country:"United States",iso:"US",code:"us_ein",description:"United States EIN",example:"12-3456789",impactsTaxCalculation:!1},{country:"Uruguay",iso:"UY",code:"uy_ruc",description:"Uruguayan RUC number",example:"123456789012",impactsTaxCalculation:!0},{country:"Uzbekistan",iso:"UZ",code:"uz_tin",description:"Uzbekistan TIN Number",example:"123456789",impactsTaxCalculation:!1},{country:"Uzbekistan",iso:"UZ",code:"uz_vat",description:"Uzbekistan VAT Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Venezuela",iso:"VE",code:"ve_rif",description:"Venezuelan RIF number",example:"A-12345678-9",impactsTaxCalculation:!1},{country:"Vietnam",iso:"VN",code:"vn_tin",description:"Vietnamese tax ID number",example:"1234567890",impactsTaxCalculation:!1},{country:"Zambia",iso:"ZM",code:"zm_tin",description:"Zambia Tax Identification Number",example:"1004751879",impactsTaxCalculation:!1},{country:"Zimbabwe",iso:"ZW",code:"zw_tin",description:"Zimbabwe Tax Identification Number",example:"1234567890",impactsTaxCalculation:!1}];var g=i(64447);const v={bankAccount:"bankAccount",card:"card",payPal:"payPal"},f={accountCredit:"accountCredit"},m=e=>Object.values(v).includes(e),y=e=>{switch(e){case"bankAccount":return g.eq.BankAccount;case"card":return g.eq.Card;case"payPal":return g.eq.PayPal}}},14092(e,t,i){"use strict";i.d(t,{t:()=>a});var n=i(90118),r=i(62963),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({imports:[r.G,n.Pq]})},14093(e,t,i){"use strict";i.d(t,{r:()=>u});var n=i(78781),r=i(31442),s=i(69473),o=i(65918),a=i(8583),l=i(16671),c=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},d=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class u extends a.n{constructor(e){super(),this.uris=[],this.fido2Credentials=[],e&&(this.passwordRevisionDate=e.passwordRevisionDate,this.autofillOnPageLoad=e.autofillOnPageLoad)}get uri(){return this.hasUris?this.uris[0].uri:void 0}get maskedPassword(){return null!=this.password?"••••••••":void 0}get subTitle(){var e;return n.A.isNullOrEmpty(this.username)&&(null===(e=this.fido2Credentials)||void 0===e?void 0:e.length)>0?this.fido2Credentials[0].userName:this.username}get canLaunch(){return this.hasUris&&this.uris.some(e=>e.canLaunch)}get hasTotp(){return!n.A.isNullOrWhitespace(this.totp)}get launchUri(){if(this.hasUris){const e=this.uris.find(e=>e.canLaunch);if(null!=e)return e.launchUri}}get hasUris(){return null!=this.uris&&this.uris.length>0}get hasFido2Credentials(){return null!=this.fido2Credentials&&this.fido2Credentials.length>0}matchesUri(e,t,i,n){return null!=this.uris&&this.uris.some(r=>r.matchesUri(e,t,i,n))}static fromJSON(e){var t,i,n,r;if(null==e)return new u;const s=Object.assign(new u,e);return s.passwordRevisionDate=null==e.passwordRevisionDate?void 0:new Date(e.passwordRevisionDate),s.uris=null!==(i=null===(t=e.uris)||void 0===t?void 0:t.map(e=>l.z.fromJSON(e)))&&void 0!==i?i:[],s.fido2Credentials=null!==(r=null===(n=e.fido2Credentials)||void 0===n?void 0:n.map(e=>o.X.fromJSON(e)))&&void 0!==r?r:[],s}static fromSdkLoginView(e){var t;const i=new u;return i.username=e.username,i.password=e.password,i.passwordRevisionDate=null==e.passwordRevisionDate?void 0:new Date(e.passwordRevisionDate),i.totp=e.totp,i.autofillOnPageLoad=e.autofillOnPageLoad,i.uris=(null===(t=e.uris)||void 0===t?void 0:t.filter(e=>null!=e.uri&&""!==e.uri).map(e=>l.z.fromSdkLoginUriView(e)))||[],i.fido2Credentials=[],i}toSdkLoginView(){var e,t,i;return{username:this.username,password:this.password,passwordRevisionDate:null===(e=this.passwordRevisionDate)||void 0===e?void 0:e.toISOString(),totp:this.hasTotp?this.totp:void 0,autofillOnPageLoad:null!==(t=this.autofillOnPageLoad)&&void 0!==t?t:void 0,uris:null===(i=this.uris)||void 0===i?void 0:i.map(e=>e.toSdkLoginUriView()),fido2Credentials:void 0}}}c([(0,s.V)(r.EU.Username,{sortPosition:0}),d("design:type",String)],u.prototype,"username",void 0),c([(0,s.V)(r.EU.Password,{sortPosition:1}),d("design:type",String)],u.prototype,"password",void 0)},14318(e,t,i){"use strict";i.d(t,{i:()=>s});var n=i(33812),r=i(7421);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.VBU({type:s,selectors:[["bit-card"]],hostAttrs:[1,"tw-p-4","[@media(min-width:650px)]:tw-p-6"],features:[n.nM4([r.T])],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2,changeDetection:0})},15033(e,t,i){"use strict";i.d(t,{J:()=>n});class n{}},15639(e,t,i){"use strict";i.d(t,{Hc:()=>s,S:()=>o,pn:()=>a});var n=i(48479),r=i(3204);const s=e=>(0,r.T)(t=>t.find(t=>t.id===e)),o=e=>{const t=new Set(e);return(0,r.T)(e=>e.filter(e=>e.id&&t.has(e.id)))};function a(e){return t=>{const i=new Map,r=()=>{for(const[,e]of i.entries())e.unsubscribe();i.clear()};return new n.c(n=>{const s=t.subscribe({next:t=>{var r;for(const e of i.keys())t.has(e)?t.delete(e):(null===(r=i.get(e))||void 0===r||r.unsubscribe(),i.delete(e));for(const s of t.keys())i.set(s,e(s).subscribe({next:e=>{n.next(e)},error:e=>{n.error(e)},complete:()=>{i.delete(s)}}))},error:e=>{n.error(e)},complete:()=>{r(),n.complete()}});return()=>{r(),s.unsubscribe()}})}}},15661(e,t,i){"use strict";i.d(t,{Tu:()=>n.T,nk:()=>r.n});var n=i(7243),r=i(10931);i(28209)},15740(e,t,i){"use strict";var n;i.d(t,{c:()=>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={}))},16184(e,t,i){"use strict";i.d(t,{a6:()=>T,rq:()=>B,W4:()=>m,BF:()=>C,nv:()=>E,ep:()=>n,Lw:()=>y,ft:()=>w});class n{}var r=i(93695),s=i(44500),o=i(33338),a=i(3204),l=i(72245),c=i(84079),d=i(73276),u=i(75811),h=i(99969),A=i(34040),p=i(27442),g=i(43978),v=i(685),f=i(3633);const m={Lock:"lock",LogOut:"logOut"},y={Never:"never",OnRestart:"onRestart",OnLocked:"onLocked",OnSleep:"onSleep",OnIdle:"onIdle",Custom:"custom"},C={Immediately:0,OnMinute:1,EightHours:480};function w(e){return"number"==typeof e}var I=i(78070),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class B{constructor(e,t,i,n,r,s,o,a,l,c,d){this.accountService=e,this.pinStateService=t,this.userDecryptionOptionsService=i,this.keyService=n,this.tokenService=r,this.policyService=s,this.biometricStateService=o,this.stateProvider=a,this.logService=l,this.defaultVaultTimeout=c,this.sessionTimeoutTypeService=d}setVaultTimeoutOptions(e,t,i){return b(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout settings.");if(null==t)throw new Error("Vault Timeout cannot be null.");if(null==i)throw new Error("Vault Timeout Action cannot be null.");yield this.setVaultTimeout(e,t),yield this.setVaultTimeoutAction(e,i),yield this.migrateTokenStorage(e,i,t),yield this.keyService.refreshAdditionalKeys(e)})}availableVaultTimeoutActions$(e){return(null!=e?(0,r.of)(e):(0,f.F6)(this.accountService.activeAccount$)).pipe((0,s.n)(e=>(0,o.z)([this.userDecryptionOptionsService.hasMasterPasswordById$(e),this.biometricStateService.biometricUnlockEnabled$(e),this.pinStateService.pinSet$(e)])),(0,a.T)(([e,t,i])=>e||t||i?[m.LogOut,m.Lock]:[m.LogOut]))}canLock(e){return b(this,void 0,void 0,function*(){const t=yield(0,l._)(this.availableVaultTimeoutActions$(e));return(null==t?void 0:t.includes(m.Lock))||!1})}isBiometricLockSet(e){return b(this,void 0,void 0,function*(){return yield(0,l._)(this.biometricStateService.biometricUnlockEnabled$(e))})}setVaultTimeout(e,t){return b(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout.");if(null==t)throw new Error("Vault Timeout cannot be null.");yield this.stateProvider.setUserState(I.z,t,e)})}getVaultTimeoutByUserId$(e){if(!e)throw new Error("User id required. Cannot get vault timeout.");return(0,o.z)([this.stateProvider.getUserState$(I.z,e),this.getMaxSessionTimeoutPolicyDataByUserId$(e)]).pipe((0,s.n)(([t,i])=>(this.logService.debug("[VaultTimeoutSettingsService] Current vault timeout is %o for user id %s, max session policy %o",t,e,i),(0,c.H)(this.determineVaultTimeout(t,i)).pipe((0,d.H)(i=>b(this,void 0,void 0,function*(){return this.logService.debug("[VaultTimeoutSettingsService] Determined vault timeout is %o for user id %s",i,e),i!==t&&(yield this.stateProvider.setUserState(I.z,i,e)),i})),(0,u.W)(e=>(this.logService.error(`Error getting vault timeout: ${e}`),h.w))))),(0,A.F)(),(0,p.t)({refCount:!0,bufferSize:1}))}determineVaultTimeout(e,t){return b(this,void 0,void 0,function*(){const i=yield this.determineVaultTimeoutInternal(e,t);return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(i)})}determineVaultTimeoutInternal(e,t){return b(this,void 0,void 0,function*(){if(e=null!=e?e:this.defaultVaultTimeout,null==t)return e;switch(t.type){case"immediately":return C.Immediately;case"custom":case null:case void 0:return e===C.Immediately?e:w(e)?Math.min(e,t.minutes):t.minutes;case"onSystemLock":if(e===y.Never||e===y.OnRestart||e===y.OnLocked||e===y.OnIdle||e===y.OnSleep)return y.OnLocked;break;case"onAppRestart":if(e===y.Never||e===y.OnLocked||e===y.OnIdle||e===y.OnSleep)return y.OnRestart}return e})}migrateTokenStorage(e,t,i){return b(this,void 0,void 0,function*(){const n=yield this.tokenService.getAccessToken(e),r=yield this.tokenService.getRefreshToken(e),s=yield this.tokenService.getClientId(e),o=yield this.tokenService.getClientSecret(e);i!=y.Never&&t===m.LogOut&&(yield this.tokenService.clearTokens(e)),n&&(yield this.tokenService.setTokens(n,t,i,r,[s,o]))})}setVaultTimeoutAction(e,t){return b(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout action.");if(!t)throw new Error("Vault Timeout Action cannot be null");yield this.stateProvider.setUserState(I.G,t,e)})}getVaultTimeoutActionByUserId$(e){if(!e)throw new Error("User id required. Cannot get vault timeout action.");return(0,o.z)([this.stateProvider.getUserState$(I.G,e),this.getMaxSessionTimeoutPolicyDataByUserId$(e),this.availableVaultTimeoutActions$(e),this.getVaultTimeoutByUserId$(e)]).pipe((0,d.H)(t=>b(this,[t],void 0,function*([t,i,n,r]){const s=this.determineVaultTimeoutAction(n,t,i);if(1===n.length){const i=n[0];null!==t&&(yield this.stateProvider.setUserState(I.G,null,e),t!==i&&(yield this.migrateTokenStorage(e,i,r)))}else s!==t&&(yield this.stateProvider.setUserState(I.G,s,e),null===t&&s===m.Lock&&(yield this.migrateTokenStorage(e,s,r)));return s})),(0,u.W)(e=>(this.logService.error(`Error getting vault timeout: ${e}`),h.w)),(0,A.F)(),(0,p.t)({refCount:!0,bufferSize:1}))}determineVaultTimeoutAction(e,t,i){return 1===e.length?e[0]:(null==i?void 0:i.action)&&e.includes(i.action)?i.action:null==t&&e.includes(m.Lock)?m.Lock:t}getMaxSessionTimeoutPolicyDataByUserId$(e){if(!e)throw new Error("User id required. Cannot get max session timeout policy.");return this.policyService.policiesByType$(g.tt.MaximumVaultTimeout,e).pipe(v.Zc,(0,a.T)(e=>{var t;return null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}))}}class E{}var S=i(84110),Q=i(37798),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T{constructor(e,t,i,n,r,s,o,a){this.accountService=e,this.platformUtilsService=t,this.authService=i,this.vaultTimeoutSettingsService=n,this.taskSchedulerService=r,this.logService=s,this.lockService=o,this.logoutService=a,this.inited=!1,this.taskSchedulerService.registerTaskHandler(Q.fq.vaultTimeoutCheckInterval,()=>this.checkVaultTimeout())}init(e){return k(this,void 0,void 0,function*(){this.inited||(this.inited=!0,e&&this.startCheck())})}startCheck(){this.checkVaultTimeout().catch(e=>this.logService.error(e)),this.taskSchedulerService.setInterval(Q.fq.vaultTimeoutCheckInterval,1e4)}checkVaultTimeout(){return k(this,void 0,void 0,function*(){const e=yield this.platformUtilsService.isAnyViewFocused();yield(0,l._)((0,o.z)([this.accountService.activeAccount$,this.accountService.accountActivity$]).pipe((0,d.H)(t=>k(this,[t],void 0,function*([t,i]){const n=null==t?void 0:t.id;for(const r in i){const t=r;null!=t&&(yield this.shouldLock(t,i[t],n,e))&&(yield this.executeTimeoutAction(t))}}))))})}shouldLock(e,t,i,n){return k(this,void 0,void 0,function*(){if(n&&e===i)return!1;const r=yield this.authService.getAuthStatus(e);if(r===S.J.Locked||r===S.J.LoggedOut)return!1;const s=yield(0,l._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(e));if("string"==typeof s)return!1;if(null==t)return!1;const o=60*s;return((new Date).getTime()-t.getTime())/1e3>=o})}executeTimeoutAction(e){return k(this,void 0,void 0,function*(){(yield(0,l._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(e)))===m.LogOut?yield this.logoutService.logout(e,"vaultTimeout"):yield this.lockService.lock(e)})}}},16452(e,t,i){"use strict";i.d(t,{IO:()=>ai,d1:()=>si});var n=i(33812),r=i(51757),s=i(66046),o=i(72245),a=i(33338),l=i(3204),c=i(44500),d=i(14803),u=i(36006),h=i(67553),A=i(43978),p=i(56953),g=i(79667),v=i(3633),f=i(64447),m=i(82468),y=i(83516),C=i(39488),w=i(14318),I=i(81525),b=i(8916),B=i(9327),E=i(27760),S=i(9753),Q=i(14055),k=i(41226),T=i(37806),F=i(74208),P=i(69855),R=i(66316),D=i(12012),M=i(50700),x=i(23649),O=i(18499),G=i(11224),U=i(35500),V=i(1601),j=i(77468),N=i(26657),z=i(38620),Y=i(47696),L=i(56898),K=i(44432),X=i(7730),q=i(68016),H=i(67311),W=i(93199),$=i(36288),J=i(12694),Z=i(16496),_=i(58806),ee=i(25740),te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ie=(e,t)=>({"tw-py-1":e,"tw-py-0":t}),ne=(e,t)=>({"tw-bg-primary-700 !tw-text-contrast":e,"tw-bg-secondary-100":t}),re=e=>({type:"checkout",supportsTaxId:e});function se(e,t){if(1&e&&(n.j41(0,"bit-toggle",18),n.EFF(1),n.k0s()),2&e){const e=t.$implicit;n.Y8G("value",e.value),n.R7$(),n.SpI(" ",e.name," ")}}function oe(e,t){if(1&e){const e=n.RV6();n.j41(0,"div",15)(1,"bit-toggle-group",16),n.bIt("selectedChange",function(t){F.eBV(e);const i=n.XpG();return F.Njj(i.updateInterval(t))}),n.DNE(2,se,2,2,"bit-toggle",17),n.k0s()()}if(2&e){const e=n.XpG();n.R7$(),n.Y8G("selected",e.selectedInterval),n.R7$(),n.Y8G("ngForOf",e.getPlanIntervals())("ngForTrackBy",e.optimizedNgForRender)}}function ae(e,t){if(1&e&&(n.j41(0,"div",31),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.Y8G("ngClass",n.l_i(4,ne,e===t.selectedPlan,!(e===t.selectedPlan))),n.R7$(),n.SpI(" ",n.bMT(2,2,"recommended")," ")}}function le(e,t){1&e&&(n.j41(0,"span",32),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"current")))}function ce(e,t){if(1&e&&(n.qex(0),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.bVm()),2&e){const e=n.XpG(3).$implicit,t=n.XpG(2);n.R7$(),n.E5c(" ",n.bMT(2,3,"additionalUsers").toLowerCase()," ",n.i5U(3,5,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$")," /",n.bMT(4,8,t.selectedPlanInterval)," ")}}function de(e,t){if(1&e&&(n.qex(0),n.j41(1,"b",33),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.j41(4,"span",34),n.EFF(5),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"b",35),n.DNE(8,ce,5,10,"ng-container",11),n.k0s(),n.bVm()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.R7$(2),n.SpI(" ",n.i5U(3,3,e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice,"$")," "),n.R7$(3),n.SpI(" /",e.productTier===t.productTypes.Families?"month":n.bMT(6,6,"monthPerMember")),n.R7$(3),n.Y8G("ngIf",e.PasswordManager.hasAdditionalSeatsOption)}}function ue(e,t){if(1&e&&(n.j41(0,"span"),n.DNE(1,de,9,8,"ng-container",11),n.k0s()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.PasswordManager.basePrice&&!t.acceptingSponsorship)}}function he(e,t){if(1&e&&(n.j41(0,"span")(1,"b",33),n.EFF(2),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"span",34),n.EFF(6),n.nI1(7,"i18n"),n.k0s()()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(2),n.SpI("",n.i5U(4,5,"costPerMember",n.i5U(3,2,((t.sub.useSecretsManager?e.SecretsManager.seatPrice:0)+e.PasswordManager.seatPrice)/(e.isAnnual?12:1),"$"))," "),n.R7$(4),n.SpI(" /",n.bMT(7,8,"monthPerMember"))}}function Ae(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"freeForever")," "))}function pe(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenPasswordManager")," "))}function ge(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenSecretsManager")," "))}function ve(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s(),n.j41(13,"li"),n.nrm(14,"i",39),n.EFF(15),n.nI1(16,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,4,"unlimitedSecretsStorage")," "),n.R7$(4),n.SpI(" ",n.bMT(8,6,"unlimitedUsers")," "),n.R7$(4),n.SpI(" ",n.bMT(12,8,"unlimitedProjects")," "),n.R7$(4),n.SpI(" ",n.bMT(16,10,"UpTo50MachineAccounts")," "))}function fe(e,t){if(1&e&&(n.qex(0),n.DNE(1,pe,3,3,"p",36),n.j41(2,"p",37),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"ul",38)(6,"li"),n.nrm(7,"i",39),n.EFF(8),n.nI1(9,"i18n"),n.k0s(),n.j41(10,"li"),n.nrm(11,"i",39),n.EFF(12),n.nI1(13,"i18n"),n.k0s(),n.j41(14,"li"),n.nrm(15,"i",39),n.EFF(16),n.nI1(17,"i18n"),n.k0s(),n.j41(18,"li"),n.nrm(19,"i",39),n.EFF(20),n.nI1(21,"i18n"),n.k0s()(),n.DNE(22,ge,3,3,"p",36)(23,ve,17,12,"ul",40),n.bVm()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(2),n.JRh(n.bMT(4,8,"enterprisePlanUpgradeMessage")),n.R7$(5),n.SpI(" ",n.bMT(9,10,"includeEnterprisePolicies")," "),n.R7$(4),n.SpI(" ",n.bMT(13,12,"passwordLessSso")," "),n.R7$(4),n.SpI(" ",n.bMT(17,14,"accountRecovery")," "),n.R7$(4),n.SpI(" ",n.bMT(21,16,"customRoles")," "),n.R7$(2),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager)}}function me(e,t){1&e&&(n.qex(0),n.j41(1,"ul",42)(2,"li"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"li"),n.EFF(9),n.nI1(10,"i18n"),n.k0s()(),n.bVm()),2&e&&(n.R7$(3),n.JRh(n.bMT(4,3,"includeAllTeamsStarterFeatures")),n.R7$(3),n.JRh(n.bMT(7,5,"chooseMonthlyOrAnnualBilling")),n.R7$(3),n.JRh(n.i5U(10,7,"abilityToAddMoreThanNMembers",10)))}function ye(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenPasswordManager")," "))}function Ce(e,t){1&e&&(n.j41(0,"p",37),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"teamsPlanUpgradeMessage")," "))}function we(e,t){1&e&&(n.j41(0,"p",37),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"familyPlanUpgradeMessage")," "))}function Ie(e,t){1&e&&(n.j41(0,"ul",45)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"premiumAccounts")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"unlimitedSharing")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"unlimitedCollections")," "))}function be(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"secureDataSharing")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"eventLogMonitoring")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"directoryIntegration")," "))}function Be(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenSecretsManager")," "))}function Ee(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"unlimitedSecretsStorage")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"unlimitedProjects")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"UpTo20MachineAccounts")," "))}function Se(e,t){if(1&e&&n.DNE(0,ye,3,3,"p",36)(1,Ce,3,3,"p",43)(2,we,3,3,"p",43)(3,Ie,13,9,"ul",44)(4,be,13,9,"ul",40)(5,Be,3,3,"p",36)(6,Ee,13,9,"ul",40),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.Y8G("ngIf",t.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.productTier===t.productTypes.Teams),n.R7$(),n.Y8G("ngIf",e.productTier===t.productTypes.Families),n.R7$(),n.Y8G("ngIf",e.productTier==t.productTypes.Families),n.R7$(),n.Y8G("ngIf",e.productTier==t.productTypes.Teams),n.R7$(),n.Y8G("ngIf",t.organization.useSecretsManager&&e.productTier!==t.productTypes.Families),n.R7$(),n.Y8G("ngIf",t.organization.useSecretsManager&&e.productTier==t.productTypes.Teams)}}function Qe(e,t){if(1&e&&n.DNE(0,me,11,10,"ng-container",30)(1,Se,7,7,"ng-template",null,1,n.C5r),2&e){const e=n.sdS(2),t=n.XpG().$implicit,i=n.XpG(2);n.Y8G("ngIf",t.productTier===i.productTypes.Teams&&i.teamsStarterPlanIsAvailable)("ngIfElse",e)}}function ke(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-card",23),n.bIt("click",function(){const t=F.eBV(e).$implicit,i=n.XpG(2);return F.Njj(i.selectPlan(t))})("keyup",function(t){const i=F.eBV(e).index,r=n.XpG(2);return F.Njj(r.onKeydown(t,i))})("focus",function(){const t=F.eBV(e).index,i=n.XpG(2);return F.Njj(i.onFocus(t))}),n.j41(1,"div",24),n.DNE(2,ae,3,7,"div",25),n.j41(3,"div",26)(4,"h3",27)(5,"span",28),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,le,3,3,"span",29),n.k0s(),n.DNE(9,ue,2,1,"span",11)(10,he,8,10,"span",11)(11,Ae,3,3,"span",11),n.k0s()(),n.DNE(12,fe,24,18,"ng-container",30)(13,Qe,3,2,"ng-template",null,0,n.C5r),n.k0s()}if(2&e){const e=t.$implicit,i=t.index,r=n.sdS(14),s=n.XpG(2);n.Y8G("ngClass",s.getPlanCardContainerClasses(e,i))("id",i+"a_plan_card"),n.BMQ("tabindex",s.focusedIndex!==i||s.isCardDisabled(i)?"-1":"0")("aria-disabled",s.isCardDisabled(i)),n.R7$(2),n.Y8G("ngIf",e.productTier===s.productTypes.Enterprise&&!s.isSubscriptionCanceled),n.R7$(),n.Y8G("ngClass",n.l_i(15,ie,!(e===s.selectedPlan),e===s.selectedPlan)),n.R7$(3),n.JRh(n.bMT(7,13,e.nameLocalizationKey)),n.R7$(2),n.Y8G("ngIf",e===s.currentPlan),n.R7$(),n.Y8G("ngIf",e.productTier!=s.productTypes.Free),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.productTier==s.productTypes.Free),n.R7$(),n.Y8G("ngIf",e.productTier===s.productTypes.Enterprise)("ngIfElse",r)}}function Te(e,t){1&e&&(n.j41(0,"bit-callout",46),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManagerSubscriptionInfo")," "))}function Fe(e,t){1&e&&(n.j41(0,"bit-callout",47),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManagerComplimentaryPasswordManager")," "))}function Pe(e,t){if(1&e&&(n.qex(0),n.j41(1,"div",19),n.DNE(2,ke,15,18,"bit-card",20),n.k0s(),n.nrm(3,"br"),n.DNE(4,Te,3,3,"bit-callout",21)(5,Fe,3,3,"bit-callout",22),n.nrm(6,"br"),n.bVm()),2&e){const e=n.XpG();n.R7$(),n.HbH("tw-grid-cols-"+e.selectableProducts.length),n.R7$(),n.Y8G("ngForOf",e.selectableProducts)("ngForTrackBy",e.manageSelectableProduct),n.R7$(2),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&e.isSecretsManagerTrial())}}function Re(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("- ",n.bMT(2,1,"unverified")))}function De(e,t){if(1&e){const e=n.RV6();n.nrm(0,"i",56),n.EFF(1),n.nVh(2,Re,3,3,"span"),n.j41(3,"span",57),n.bIt("click",function(){F.eBV(e);const t=n.XpG(3);return F.Njj(t.toggleShowPayment())}),n.EFF(4),n.nI1(5,"i18n"),n.k0s()}if(2&e){const e=n.XpG(3);n.R7$(),n.Lme(" ",e.paymentMethod.bankName,", *",e.paymentMethod.last4," "),n.R7$(),n.vxM(e.paymentMethod.hostedVerificationUrl?2:-1),n.R7$(2),n.SpI(" ",n.bMT(5,4,"changePaymentMethod")," ")}}function Me(e,t){if(1&e&&n.nrm(0,"i"),2&e){n.XpG();const e=n.r8f(1);n.HbH(n.VkB("bwi bwi-fw credit-card-icon ",e))}}function xe(e,t){1&e&&n.nrm(0,"i",59)}function Oe(e,t){if(1&e){const e=n.RV6();n.j41(0,"p",9),n.SS7(1),n.nVh(2,Me,1,3,"i",58)(3,xe,1,0,"i",59),n.EFF(4),n.nI1(5,"titlecase"),n.j41(6,"span",57),n.bIt("click",function(){F.eBV(e);const t=n.XpG(3);return F.Njj(t.toggleShowPayment())}),n.EFF(7),n.nI1(8,"i18n"),n.k0s()()}if(2&e){const e=n.XpG(3);n.R7$();const t=n.bH3(e.getCardBrandIcon());n.R7$(),n.vxM(null!==t?2:3),n.R7$(2),n.E5c(" ",n.bMT(5,6,e.paymentMethod.brand),", *",e.paymentMethod.last4,", ",e.paymentMethod.expiration," "),n.R7$(3),n.SpI(" ",n.bMT(8,8,"changePaymentMethod")," ")}}function Ge(e,t){if(1&e){const e=n.RV6();n.nrm(0,"i",60),n.EFF(1),n.j41(2,"span",57),n.bIt("click",function(){F.eBV(e);const t=n.XpG(3);return F.Njj(t.toggleShowPayment())}),n.EFF(3),n.nI1(4,"i18n"),n.k0s()}if(2&e){const e=n.XpG(3);n.R7$(),n.SpI(" ",e.paymentMethod.email," "),n.R7$(2),n.SpI(" ",n.bMT(4,2,"changePaymentMethod")," ")}}function Ue(e,t){if(1&e&&(n.j41(0,"p"),n.nVh(1,De,6,6)(2,Oe,9,10,"p",9)(3,Ge,5,4),n.nrm(4,"a"),n.k0s()),2&e){let e;const t=n.XpG(2);n.R7$(),n.vxM("bankAccount"===(e=t.paymentMethod.type)?1:"card"===e?2:"payPal"===e?3:-1)}}function Ve(e,t){if(1&e&&(n.qex(0),n.nrm(1,"app-enter-payment-method",61)(2,"app-enter-billing-address",62),n.bVm()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("group",e.billingFormGroup.controls.paymentMethod),n.R7$(),n.Y8G("group",e.billingFormGroup.controls.billingAddress)("scenario",n.eq3(3,re,e.supportsTaxId))}}function je(e,t){1&e&&(n.j41(0,"p",70),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function Ne(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",72),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.EFF(4),n.nI1(5,"i18n"),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.JRh(n.i5U(3,2,e.selectedPlan.PasswordManager.basePrice,"$")),n.R7$(2),n.SpI(" ",n.bMT(5,5,"freeWithSponsorship")," ")}}function ze(e,t){if(1&e&&(n.EFF(0),n.nI1(1,"currency")),2&e){const e=n.XpG(5);n.SpI(" ",n.i5U(1,1,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function Ye(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.DNE(7,Ne,6,7,"ng-container",30)(8,ze,2,4,"ng-template",null,2,n.C5r),n.k0s()()),2&e){const e=n.sdS(9),t=n.XpG(4);n.R7$(2),n.LHq(" ",t.passwordManagerSeats," ",n.bMT(3,6,"members")," × ",n.i5U(4,8,t.selectedPlan.isAnnual?t.selectedPlan.PasswordManager.basePrice/12:t.selectedPlan.PasswordManager.basePrice,"$")," /",n.bMT(5,11,t.selectedPlanInterval)," "),n.R7$(5),n.Y8G("ngIf",t.acceptingSponsorship)("ngIfElse",e)}}function Le(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Ke(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Xe(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Le,3,3,"span",11),n.EFF(3),n.DNE(4,Ke,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",e.passwordManagerSeats||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function qe(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.storageGb," ",n.bMT(3,5,"additionalStorageGbMessage")," × ",n.i5U(4,7,e.additionalStoragePriceMonthly(e.selectedPlan),"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalStorageTotal(e.selectedPlan),"$"))}}function He(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.SpI(" ",n.bMT(4,5,n.i5U(3,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(7,7,e.calculateTotalAppliedDiscount(e.passwordManagerSeatTotal(e.selectedPlan)+e.additionalStorageTotal(e.selectedPlan)),"$"))}}function We(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,He,8,10,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually&&e.discountPercentageFromSub>0)}}function $e(e,t){1&e&&(n.j41(0,"p",76),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function Je(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",null==e.sub?null:e.sub.smSeats," ",n.bMT(3,4,"members")," × ",n.i5U(4,6,e.selectedPlan.isAnnual?e.selectedPlan.SecretsManager.basePrice/12:e.selectedPlan.SecretsManager.basePrice,"$")," /",n.bMT(5,9,e.selectedPlanInterval)," ")}}function Ze(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function _e(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function et(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Ze,3,3,"span",11),n.EFF(3),n.DNE(4,_e,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.smSeats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats),"$")," ")}}function tt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"span"),n.EFF(8),n.nI1(9,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(4,7,n.bMT(3,5,"serviceAccounts"))," × ",n.i5U(5,9,null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(6,12,e.selectedPlanInterval)," "),n.R7$(6),n.JRh(n.i5U(9,14,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function it(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.SpI(" ",n.bMT(4,5,n.i5U(3,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(7,7,e.calculateTotalAppliedDiscount(e.additionalServiceAccountTotal(e.selectedPlan)+e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats)),"$"))}}function nt(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,it,8,10,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually&&e.discountPercentageFromSub>0)}}function rt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,je,3,3,"p",66)(2,Ye,10,13,"p",67)(3,Xe,11,14,"p",68)(4,qe,9,15,"p",68)(5,We,2,1,"p",68)(6,$e,3,3,"p",69)(7,Je,6,11,"p",67)(8,et,11,14,"p",68)(9,tt,10,17,"p",68)(10,nt,2,1,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.storageGb>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.basePrice)&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.hasAdditionalSeatsOption)&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption)&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial())}}function st(e,t){1&e&&(n.j41(0,"p",70),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function ot(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.PasswordManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function at(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function lt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function ct(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,at,3,3,"span",11),n.EFF(3),n.DNE(4,lt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",e.passwordManagerSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function dt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.storageGb," ",n.bMT(3,5,"additionalStorageGbMessage")," × ",n.i5U(4,7,e.additionalStoragePriceMonthly(e.selectedPlan),"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.storageGb*e.selectedPlan.PasswordManager.additionalStoragePricePerGb,"$"))}}function ut(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.SpI(" ",n.bMT(4,9,n.i5U(3,6,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(3),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.JRh(n.i5U(7,11,e.calculateTotalAppliedDiscount(e.total),"$"))}}function ht(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,ut,8,14,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function At(e,t){1&e&&(n.j41(0,"p",76),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function pt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.SecretsManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.SecretsManager.basePrice,"$")," ")}}function gt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function vt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function ft(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,gt,3,3,"span",11),n.EFF(3),n.DNE(4,vt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.smSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$")," ")}}function mt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"span"),n.EFF(8),n.nI1(9,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(4,7,n.bMT(3,5,"serviceAccounts"))," × ",n.i5U(5,9,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(6,12,e.selectedPlanInterval)," "),n.R7$(6),n.JRh(n.i5U(9,14,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function yt(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.SpI(" ",n.bMT(4,9,n.i5U(3,6,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(3),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.JRh(n.i5U(7,11,e.additionalServiceAccountTotal(e.selectedPlan)+e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$"))}}function Ct(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,yt,8,14,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function wt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,st,3,3,"p",66)(2,ot,9,14,"p",68)(3,ct,11,14,"p",68)(4,dt,9,15,"p",68)(5,ht,2,1,"p",68)(6,At,3,3,"p",69)(7,pt,9,14,"p",68)(8,ft,11,14,"p",68)(9,mt,10,17,"p",68)(10,Ct,2,1,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.storageGb>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial())}}function It(e,t){if(1&e&&(n.j41(0,"div",63),n.DNE(1,rt,11,10,"bit-hint",64)(2,wt,11,10,"bit-hint",64),n.k0s()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually),n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function bt(e,t){1&e&&(n.j41(0,"p",79),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function Bt(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",null==e.sub?null:e.sub.smSeats," ",n.bMT(3,4,"members")," × ",n.i5U(4,6,e.selectedPlan.isAnnual?e.selectedPlan.SecretsManager.basePrice/12:e.selectedPlan.SecretsManager.basePrice,"$")," /",n.bMT(5,9,e.selectedPlanInterval)," ")}}function Et(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function St(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Qt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Et,3,3,"span",11),n.EFF(3),n.DNE(4,St,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.smSeats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats),"$")," ")}}function kt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(3,5,"serviceAccounts")," × ",n.i5U(4,7,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function Tt(e,t){1&e&&(n.j41(0,"p",80),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function Ft(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",72),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.EFF(4),n.nI1(5,"i18n"),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.JRh(n.i5U(3,2,e.selectedPlan.PasswordManager.basePrice,"$")),n.R7$(2),n.SpI(" ",n.bMT(5,5,"freeWithSponsorship")," ")}}function Pt(e,t){if(1&e&&(n.EFF(0),n.nI1(1,"currency")),2&e){const e=n.XpG(5);n.SpI(" ",n.i5U(1,1,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function Rt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.DNE(7,Ft,6,7,"ng-container",30)(8,Pt,2,4,"ng-template",null,2,n.C5r),n.k0s()()),2&e){const e=n.sdS(9),t=n.XpG(4);n.R7$(2),n.LHq(" ",null==t.sub?null:t.sub.seats," ",n.bMT(3,6,"members")," × ",n.i5U(4,8,t.selectedPlan.isAnnual?t.selectedPlan.PasswordManager.basePrice/12:t.selectedPlan.PasswordManager.basePrice,"$")," /",n.bMT(5,11,t.selectedPlanInterval)," "),n.R7$(5),n.Y8G("ngIf",t.acceptingSponsorship)("ngIfElse",e)}}function Dt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Mt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function xt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"freeForOneYear")," "))}function Ot(e,t){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const e=n.XpG(5);n.R7$(),n.SpI(" ",n.i5U(2,1,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function Gt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Dt,3,3,"span",11),n.EFF(3),n.DNE(4,Mt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,xt,3,3,"span",11)(9,Ot,3,4,"span",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.seats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,7,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,10,e.selectedPlanInterval)," "),n.R7$(3),n.Y8G("ngIf",e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",!e.isSecretsManagerTrial())}}function Ut(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,bt,3,3,"p",77)(2,Bt,6,11,"p",67)(3,Qt,11,14,"p",68)(4,kt,9,15,"p",68)(5,Tt,3,3,"p",78)(6,Rt,10,13,"p",68)(7,Gt,10,12,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption)}}function Vt(e,t){1&e&&(n.j41(0,"p",79),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function jt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.SecretsManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.SecretsManager.basePrice,"$")," ")}}function Nt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function zt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Yt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Nt,3,3,"span",11),n.EFF(3),n.DNE(4,zt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.smSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$")," ")}}function Lt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(3,5,"serviceAccounts")," × ",n.i5U(4,7,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function Kt(e,t){1&e&&(n.j41(0,"p",80),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function Xt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.PasswordManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function qt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Ht(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Wt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"freeForOneYear")," "))}function $t(e,t){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const e=n.XpG(5);n.R7$(),n.SpI(" ",n.i5U(2,1,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function Jt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,qt,3,3,"span",11),n.EFF(3),n.DNE(4,Ht,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,Wt,3,3,"span",11)(9,$t,3,4,"span",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.seats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,7,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,10,e.selectedPlanInterval)," "),n.R7$(3),n.Y8G("ngIf",e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",!e.isSecretsManagerTrial())}}function Zt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,Vt,3,3,"p",77)(2,jt,9,14,"p",68)(3,Yt,11,14,"p",68)(4,Lt,9,15,"p",68)(5,Kt,3,3,"p",78)(6,Xt,9,14,"p",68)(7,Jt,10,12,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption)}}function _t(e,t){if(1&e&&(n.j41(0,"div",63),n.DNE(1,Ut,8,7,"bit-hint",64)(2,Zt,8,7,"bit-hint",64),n.k0s()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually),n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function ei(e,t){if(1&e&&(n.j41(0,"p",73),n.qex(1),n.j41(2,"span",74),n.EFF(3),n.nI1(4,"i18n"),n.nI1(5,"lowercase"),n.k0s(),n.j41(6,"span",75),n.EFF(7),n.nI1(8,"currency"),n.k0s(),n.bVm(),n.k0s()),2&e){const e=n.XpG(3);n.R7$(3),n.SpI(" ",n.bMT(5,5,n.i5U(4,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(8,7,e.calculateTotalAppliedDiscount(e.total),"$"))}}function ti(e,t){if(1&e&&(n.j41(0,"div",63)(1,"bit-hint",65),n.DNE(2,ei,9,10,"p",68),n.k0s()()),2&e){const e=n.XpG(2);n.R7$(2),n.Y8G("ngIf",e.discountPercentageFromSub>0)}}function ii(e,t){if(1&e&&(n.j41(0,"div",81)(1,"bit-hint",65)(2,"p",82)(3,"span",51),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()()()),2&e){const e=n.XpG(2);n.R7$(4),n.SpI(" ",n.bMT(5,2,"estimatedTax")," "),n.R7$(3),n.SpI(" ",n.brH(8,4,e.estimatedTax,"USD","$")," ")}}function ni(e,t){if(1&e&&(n.j41(0,"div",81)(1,"bit-hint",65)(2,"p",82)(3,"span",51),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.j41(9,"span",83),n.EFF(10),n.nI1(11,"i18n"),n.k0s()()()()()),2&e){const e=n.XpG(2);n.R7$(4),n.SpI(" ",n.bMT(5,3,"total")," "),n.R7$(3),n.SpI(" ",n.brH(8,5,e.total-e.calculateTotalAppliedDiscount(e.total),"USD","$")," "),n.R7$(3),n.SpI(" / ",n.bMT(11,9,e.selectedPlanInterval))}}function ri(e,t){if(1&e){const e=n.RV6();n.qex(0),n.j41(1,"h2",48),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.DNE(4,Ue,5,1,"p",11)(5,Ve,3,5,"ng-container",11),n.j41(6,"div",49)(7,"p",50)(8,"span",51),n.EFF(9),n.nI1(10,"i18n"),n.nI1(11,"currency"),n.k0s(),n.j41(12,"span",52),n.EFF(13),n.nI1(14,"i18n"),n.k0s(),n.j41(15,"button",53),n.nI1(16,"i18n"),n.nI1(17,"i18n"),n.bIt("click",function(){F.eBV(e);const t=n.XpG();return F.Njj(t.toggleTotalOpened())}),n.k0s()()(),n.DNE(18,It,3,2,"div",54)(19,_t,3,2,"div",54)(20,ti,3,1,"div",54)(21,ii,9,8,"div",55)(22,ni,12,11,"div",55),n.bVm()}if(2&e){const e=n.XpG();n.R7$(2),n.JRh(n.bMT(3,13,"paymentMethod")),n.R7$(2),n.Y8G("ngIf",!e.showPayment&&!!e.paymentMethod&&!e.isSubscriptionCanceled),n.R7$(),n.Y8G("ngIf",e.canUpdatePaymentInformation()),n.R7$(4),n.Lme("",n.bMT(10,15,"total"),": ",n.brH(11,17,e.total-e.calculateTotalAppliedDiscount(e.total),"USD","$")," USD"),n.R7$(4),n.SpI(" / ",n.bMT(14,21,e.selectedPlanInterval)),n.R7$(2),n.Y8G("bitIconButton",e.totalOpened?"bwi-angle-down":"bwi-angle-up")("label",e.totalOpened?n.bMT(16,23,"hidePricingSummary"):n.bMT(17,25,"showPricingSummary")),n.R7$(3),n.Y8G("ngIf",e.totalOpened&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.totalOpened&&e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.totalOpened&&!e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.totalOpened),n.R7$(),n.Y8G("ngIf",e.totalOpened)}}var si,oi;!function(e){e.Closed="closed",e.Submitted="submitted"}(si||(si={})),function(e){e.Selected="selected",e.NotSelected="not_selected",e.Disabled="disabled"}(oi||(oi={}));const ai=(e,t)=>e.open(li,t);class li{get productTier(){return this._productTier}set productTier(e){var t,i,n;this._productTier=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.productTier)||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,o,a,l,c,d,u,h,A,p,g,v,m,y,C,w,I){this.dialogParams=e,this.dialogRef=t,this.toastService=i,this.apiService=o,this.i18nService=a,this.keyService=l,this.router=c,this.syncService=d,this.policyService=u,this.organizationService=h,this.messagingService=A,this.formBuilder=p,this.organizationApiService=g,this.accountService=v,this.billingNotificationService=m,this.subscriberBillingClient=y,this.previewInvoiceClient=C,this.organizationWarningsService=w,this.configService=I,this.acceptingSponsorship=!1,this.showFree=!1,this.showCancel=!1,this.estimatedTax=0,this._productTier=f.K_.Free,this._plan=f.OL.Free,this.onSuccess=new n.bkB,this.onCanceled=new n.bkB,this.onTrialBillingSuccess=new n.bkB,this.loading=!0,this.ResultType=si,this.selfHosted=!1,this.productTypes=f.K_,this.singleOrgPolicyAppliesToActiveUser=!1,this.isInTrialFlow=!1,this.discount=0,this.formGroup=this.formBuilder.group({name:[""],billingEmail:["",[r.k0.email]],businessOwned:[!1],premiumAccessAddon:[!1],additionalSeats:[0,[r.k0.min(0),r.k0.max(1e5)]],clientOwnerEmail:["",[r.k0.email]],plan:[this.plan],productTier:[this.productTier]}),this.billingFormGroup=this.formBuilder.group({paymentMethod:S.Pu.getFormGroup(),billingAddress:S.vU.getFormGroup()}),this.selectedInterval=1,this.planIntervals=f.$y,this.showPayment=!1,this.totalOpened=!1,this.isCardStateDisabled=!1,this.focusedIndex=null,this.isSubscriptionCanceled=!1,this.destroy$=new s.B,this.submit=()=>te(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.billingFormGroup.markAllAsTouched(),this.formGroup.invalid||this.billingFormGroup.invalid&&!this.paymentMethod)return;this.formPromise=(()=>te(this,void 0,void 0,function*(){var e;let t;const i=null===(e=this.sub)||void 0===e?void 0:e.subscription,n="canceled"===(null==i?void 0:i.status),r=(null==i?void 0:i.cancelled)&&this.organization.productTierType===f.K_.Free;return n||r?(yield this.restartSubscription(),t=this.organizationId):t=yield this.updateOrganization(),this.toastService.showToast({variant:"success",title:null,message:this.isSubscriptionCanceled?this.i18nService.t("restartOrganizationSubscription"):this.i18nService.t("organizationUpgraded")}),yield this.syncService.fullSync(!0),this.acceptingSponsorship||this.isInTrialFlow||(yield this.router.navigate(["/organizations/"+t+"/billing/subscription"])),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:t,subLabelText:this.billingSubLabelText()}),t}))();const e=yield this.formPromise;this.onSuccess.emit({organizationId:e}),this.messagingService.send("organizationCreated",{organizationId:e}),this.dialogRef.close()}),this.getCardBrandIcon=()=>(0,Q.nS)(this.paymentMethod)}ngOnInit(){return te(this,void 0,void 0,function*(){var e,t,i,n,r,s,p,g;if(this.dialogParams.organizationId){this.currentPlanName=this.resolvePlanName(this.dialogParams.productTierType),this.sub=null!==(e=this.dialogParams.subscription)&&void 0!==e?e:yield this.organizationApiService.getSubscription(this.dialogParams.organizationId),this.dialogHeaderName=this.resolveHeaderName(this.sub),this.organizationId=this.dialogParams.organizationId,this.currentPlan=null===(t=this.sub)||void 0===t?void 0:t.plan,this.selectedPlan=null===(i=this.sub)||void 0===i?void 0:i.plan;const s=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id)));if(this.organization=yield(0,o._)(this.organizationService.organizations$(s).pipe((0,h.Sw)(this.organizationId))),"canceled"!==(null===(r=null===(n=this.sub)||void 0===n?void 0:n.subscription)||void 0===r?void 0:r.status))try{const e={type:"organization",data:this.organization},[t,i]=yield Promise.all([this.subscriberBillingClient.getPaymentMethod(e),this.subscriberBillingClient.getBillingAddress(e)]);this.paymentMethod=t,this.billingAddress=i}catch(C){this.billingNotificationService.handleError(C)}}this.selfHosted||(this.plans=yield this.apiService.getPlans(),this.passwordManagerPlans=this.plans.data.filter(e=>!!e.PasswordManager),this.secretsManagerPlans=this.plans.data.filter(e=>!!e.SecretsManager),this.productTier!==f.K_.Enterprise&&this.productTier!==f.K_.Teams||this.formGroup.controls.businessOwned.setValue(!0));const y=yield this.configService.getFeatureFlag(m.TO.PM26462_Milestone_3);if(this._familyPlan=y?f.OL.FamiliesAnnually:f.OL.FamiliesAnnually2025,this.currentPlan&&this.currentPlan.productTier!==f.K_.Enterprise){const e=this.passwordManagerPlans.find(e=>this.currentPlan.productTier===f.K_.Free?e.type===this._familyPlan:e.upgradeSortOrder==this.currentPlan.upgradeSortOrder+1);this.plan=e.type,this.productTier=e.productTier}this.upgradeFlowPrefillForm(),this.accountService.activeAccount$.pipe(v.F6,(0,c.n)(e=>this.policyService.policyAppliesToUser$(A.tt.SingleOrg,e)),(0,d.Q)(this.destroy$)).subscribe(e=>{this.singleOrgPolicyAppliesToActiveUser=e}),this.selfHosted||this.changedProduct(),this.planCards=[{name:this.i18nService.t("planNameTeams"),selected:!0},{name:this.i18nService.t("planNameEnterprise"),selected:!1}],this.discountPercentageFromSub=this.isSecretsManagerTrial()?0:null!==(g=null===(p=null===(s=this.sub)||void 0===s?void 0:s.customerDiscount)||void 0===p?void 0:p.percentOff)&&void 0!==g?g:0,yield this.setInitialPlanSelection(),this.isSubscriptionCanceled||(yield this.refreshSalesTax()),(0,a.z)([this.billingFormGroup.controls.billingAddress.controls.country.valueChanges,this.billingFormGroup.controls.billingAddress.controls.postalCode.valueChanges,this.billingFormGroup.controls.billingAddress.controls.taxId.valueChanges]).pipe((0,u.B)(1e3),(0,c.n)(()=>te(this,void 0,void 0,function*(){return yield this.refreshSalesTax()})),(0,d.Q)(this.destroy$)).subscribe(),this.loading=!1})}resolveHeaderName(e){var t;return null!=e.subscription&&(this.isSubscriptionCanceled=e.subscription.cancelled&&(null===(t=this.sub)||void 0===t?void 0:t.plan.productTier)!==f.K_.Free,this.isSubscriptionCanceled)?this.i18nService.t("restartSubscription"):this.i18nService.t("upgradeFreeOrganization",this.resolvePlanName(this.dialogParams.productTierType))}setInitialPlanSelection(){return te(this,void 0,void 0,function*(){this.focusedIndex=this.selectableProducts.length-1,this.isSubscriptionCanceled?yield this.selectPlan(this.reSubscribablePlan):yield this.selectPlan(this.getPlanByType(f.K_.Enterprise))})}getPlanByType(e){return this.selectableProducts.find(t=>t.productTier===e)}isSecretsManagerTrial(){var e,t,i,n;return null!==(n=null===(i=null===(t=null===(e=this.sub)||void 0===e?void 0:e.subscription)||void 0===t?void 0:t.items)||void 0===i?void 0:i.some(e=>{var t,i,n;return null===(n=null===(i=null===(t=this.sub)||void 0===t?void 0:t.customerDiscount)||void 0===i?void 0:i.appliesTo)||void 0===n?void 0:n.includes(e.productId)}))&&void 0!==n&&n}planTypeChanged(){return te(this,void 0,void 0,function*(){yield this.selectPlan(this.getPlanByType(f.K_.Enterprise))})}updateInterval(e){return te(this,void 0,void 0,function*(){this.selectedInterval=e,yield this.planTypeChanged()})}getPlanIntervals(){return[{name:f.$y[f.$y.Annually],value:f.$y.Annually},{name:f.$y[f.$y.Monthly],value:f.$y.Monthly}]}optimizedNgForRender(e){return e}getPlanCardContainerClasses(e,t){let i;switch(e==this.currentPlan?(i=oi.Disabled,this.isCardStateDisabled=!0,this.focusedIndex=t):e==this.selectedPlan?(i=oi.Selected,this.isCardStateDisabled=!1,this.focusedIndex=t):this.selectedInterval===f.$y.Monthly&&e.productTier==f.K_.Families?(i=oi.Disabled,this.isCardStateDisabled=!0,this.focusedIndex=this.selectableProducts.length-1):(i=oi.NotSelected,this.isCardStateDisabled=!1),i){case oi.Selected:return["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-primary-600","hover:tw-border-primary-700","tw-border-2","!tw-border-primary-700","tw-rounded-lg"];case oi.NotSelected:return["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","hover:tw-border-text-main","focus:tw-border-2","focus:tw-border-primary-700"];case oi.Disabled:return this.isSubscriptionCanceled?["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded","tw-w-80"]:["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded"]}}selectPlan(e){return te(this,void 0,void 0,function*(){if((this.selectedInterval!==f.$y.Monthly||e.productTier!=f.K_.Families)&&(e!==this.currentPlan||this.isSubscriptionCanceled)){this.selectedPlan=e,this.formGroup.patchValue({productTier:e.productTier});try{yield this.refreshSalesTax()}catch(t){this.estimatedTax=0}}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get upgradeRequiresPaymentMethod(){var e;const t=(null===(e=this.organization)||void 0===e?void 0:e.productTierType)===f.K_.Free,i=!this.showFree,n=!this.paymentMethod;return t&&i&&n}get selectedPlanInterval(){return this.isSubscriptionCanceled?this.currentPlan.isAnnual?"year":"month":this.selectedPlan.isAnnual?"year":"month"}get reSubscribablePlan(){var e;if(!this.currentPlan)throw new Error("Current plan must be set to find the re-subscribable plan for a cancelled subscription.");return this.currentPlan.disabled&&null!==(e=this.passwordManagerPlans.find(e=>e.productTier===this.currentPlan.productTier&&e.isAnnual===this.currentPlan.isAnnual&&!e.disabled))&&void 0!==e?e:this.currentPlan}get selectableProducts(){if(this.isSubscriptionCanceled)return[this.reSubscribablePlan];if(this.acceptingSponsorship){const e=this.passwordManagerPlans.find(e=>e.type===this._familyPlan);return this.discount=e.PasswordManager.basePrice,[e]}const e=this.formGroup.controls.businessOwned.value,t=this.passwordManagerPlans.filter(t=>t.type!==f.OL.Custom&&(!e||t.canBeUsedByBusiness)&&(this.showFree||t.productTier!==f.K_.Free)&&(t.productTier===f.K_.Free||t.productTier===f.K_.TeamsStarter||this.selectedInterval===f.$y.Annually&&t.isAnnual||this.selectedInterval===f.$y.Monthly&&!t.isAnnual)&&(t.productTier!==f.K_.Families||t.type===this._familyPlan)&&(!this.currentPlan||this.currentPlan.upgradeSortOrder<t.upgradeSortOrder)&&this.planIsEnabled(t));if(this.currentPlan.productTier===f.K_.Free&&this.selectedInterval===f.$y.Monthly&&!this.organization.useSecretsManager){const e=this.passwordManagerPlans.find(e=>e.productTier==f.K_.Families);t.push(e)}if(this.organization.useSecretsManager&&this.currentPlan.productTier===f.K_.Free){const e=t.findIndex(e=>e.productTier===f.K_.Families);-1!==e&&t.splice(e,1)}return this.currentPlan.productTier!==f.K_.Free&&t.push(this.currentPlan),t.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),t}get selectablePlans(){var e;const t=this.formGroup.controls.productTier.value,i=(null===(e=this.passwordManagerPlans)||void 0===e?void 0:e.filter(e=>e.productTier===t&&this.planIsEnabled(e)))||[];return i.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),i}get storageGb(){var e,t;return Math.max(0,(null!==(t=null===(e=this.sub)||void 0===e?void 0:e.maxStorageGb)&&void 0!==t?t:0)-this.selectedPlan.PasswordManager.baseStorageGb)}passwordManagerSeatTotal(e){var t;return!e.PasswordManager.hasAdditionalSeatsOption||this.isSecretsManagerTrial()?0:e.PasswordManager.seatPrice*Math.abs((null===(t=this.sub)||void 0===t?void 0:t.seats)||0)}secretsManagerSeatTotal(e,t){return e.SecretsManager.hasAdditionalSeatsOption?e.SecretsManager.seatPrice*Math.abs(t||0):0}additionalStorageTotal(e){return e.PasswordManager.hasAdditionalStorageOption?e.PasswordManager.additionalStoragePricePerGb*this.storageGb:0}additionalStoragePriceMonthly(e){return e.PasswordManager.additionalStoragePricePerGb}additionalServiceAccountTotal(e){return e.SecretsManager.hasAdditionalServiceAccountOption&&0!=this.additionalServiceAccount?e.SecretsManager.additionalPricePerServiceAccount*this.additionalServiceAccount:0}get passwordManagerSubtotal(){if(!this.selectedPlan||!this.selectedPlan.PasswordManager)return 0;let e=this.selectedPlan.PasswordManager.basePrice;return this.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&(e+=this.passwordManagerSeatTotal(this.selectedPlan)),this.selectedPlan.PasswordManager.hasPremiumAccessOption&&(e+=this.selectedPlan.PasswordManager.premiumAccessOptionPrice),this.selectedPlan.PasswordManager.hasAdditionalStorageOption&&(e+=this.additionalStorageTotal(this.selectedPlan)),e-this.discount}secretsManagerSubtotal(){var e;const t=this.selectedPlan;return t&&t.SecretsManager?(this.secretsManagerTotal||(this.secretsManagerTotal=t.SecretsManager.basePrice+this.secretsManagerSeatTotal(t,null===(e=this.sub)||void 0===e?void 0:e.smSeats)+this.additionalServiceAccountTotal(t)),this.secretsManagerTotal):this.secretsManagerTotal||0}get passwordManagerSeats(){var e;return this.selectedPlan?this.selectedPlan.productTier===f.K_.Families?this.selectedPlan.PasswordManager.baseSeats:null===(e=this.sub)||void 0===e?void 0:e.seats:0}get total(){return this.organization&&this.selectedPlan?this.organization.useSecretsManager?this.passwordManagerSubtotal+this.secretsManagerSubtotal()+this.estimatedTax:this.passwordManagerSubtotal+this.estimatedTax:0}get teamsStarterPlanIsAvailable(){return this.selectablePlans.some(e=>e.type===f.OL.TeamsStarter)}get additionalServiceAccount(){var e,t;if(!this.currentPlan||!this.currentPlan.SecretsManager)return 0;const i=((null===(e=this.currentPlan.SecretsManager)||void 0===e?void 0:e.baseServiceAccount)||0)-((null===(t=this.sub)||void 0===t?void 0:t.smServiceAccounts)||0);return i<=0?Math.abs(i):0}changedProduct(){const e=this.selectablePlans[0];this.setPlanType(e.type),this.handlePremiumAddonAccess(e.PasswordManager.hasPremiumAccessOption),this.handleAdditionalSeats(e.PasswordManager.hasAdditionalSeatsOption)}setPlanType(e){this.formGroup.controls.plan.setValue(e)}handlePremiumAddonAccess(e){this.formGroup.controls.premiumAccessAddon.setValue(!e)}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)}restartSubscription(){return te(this,void 0,void 0,function*(){const e=yield this.enterPaymentMethodComponent.tokenize(),t=(0,S.c3)(this.billingFormGroup.controls.billingAddress);yield this.subscriberBillingClient.restartSubscription({type:"organization",data:this.organization},e,t),this.organizationWarningsService.refreshInactiveSubscriptionWarning()})}updateOrganization(){return te(this,void 0,void 0,function*(){var e,t,i;const n=new g.v;if(this.selectedPlan.productTier!==f.K_.Families&&(n.additionalSeats=null===(e=this.sub)||void 0===e?void 0:e.seats),(null===(t=this.sub)||void 0===t?void 0:t.maxStorageGb)>this.selectedPlan.PasswordManager.baseStorageGb&&(n.additionalStorageGb=(null===(i=this.sub)||void 0===i?void 0:i.maxStorageGb)-this.selectedPlan.PasswordManager.baseStorageGb),n.premiumAccessAddon=this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value,n.planType=this.selectedPlan.type,this.showPayment&&(n.billingAddressCountry=this.billingFormGroup.controls.billingAddress.value.country,n.billingAddressPostalCode=this.billingFormGroup.controls.billingAddress.value.postalCode),this.buildSecretsManagerRequest(n),this.upgradeRequiresPaymentMethod||this.showPayment||!this.paymentMethod){const e=yield this.enterPaymentMethodComponent.tokenize(),t=(0,S.c3)(this.billingFormGroup.controls.billingAddress),i={type:"organization",data:this.organization};yield this.subscriberBillingClient.updateBillingAddress(i,t),yield this.subscriberBillingClient.updatePaymentMethod(i,e,null)}if(!this.organization.hasPublicAndPrivateKeys){const e=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id))),t=yield(0,o._)(this.keyService.orgKeys$(e).pipe((0,l.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.organizationId])&&void 0!==t?t:null}))),i=yield this.keyService.makeKeyPair(t);n.keys=new p.B(i[0],i[1].encryptedString)}return yield this.organizationApiService.upgrade(this.organizationId,n),this.organizationId})}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){var t;e.useSecretsManager=this.organization.useSecretsManager,this.organization.useSecretsManager&&(this.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&this.currentPlan.productTier===f.K_.Free?e.additionalSmSeats=this.organization.seats:(e.additionalSmSeats=null===(t=this.sub)||void 0===t?void 0:t.smSeats,e.additionalServiceAccounts=this.additionalServiceAccount))}upgradeFlowPrefillForm(){if(this.acceptingSponsorship)return this.formGroup.controls.productTier.setValue(f.K_.Families),void this.changedProduct();if(this.currentPlan&&this.currentPlan.productTier!==f.K_.Enterprise){const e=this.passwordManagerPlans.find(e=>this.currentPlan.productTier===f.K_.Free?e.type===this._familyPlan:this.currentPlan.productTier!==f.K_.Families||this.teamsStarterPlanIsAvailable?e.upgradeSortOrder===this.currentPlan.upgradeSortOrder+1:e.type===f.OL.TeamsAnnually);this.plan=e.type,this.productTier=e.productTier,this.changedProduct()}}planIsEnabled(e){return!e.disabled&&!e.legacyYear}toggleShowPayment(){this.showPayment=!0}toggleTotalOpened(){this.totalOpened=!this.totalOpened}calculateTotalAppliedDiscount(e){return e*(this.discountPercentageFromSub/100)}resolvePlanName(e){switch(e){case f.K_.Enterprise:return this.i18nService.t("planNameEnterprise");case f.K_.Free:return this.i18nService.t("planNameFree");case f.K_.Families:return this.i18nService.t("planNameFamilies");case f.K_.Teams:return this.i18nService.t("planNameTeams");case f.K_.TeamsStarter:return this.i18nService.t("planNameTeamsStarter")}}onKeydown(e,t){const i=Array.from(document.querySelectorAll(".product-card"));let n=t;const r="ArrowRight"===e.key||"ArrowDown"===e.key?1:-1;if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp"].includes(e.key)){do{n=(n+r+i.length)%i.length}while(this.isCardDisabled(n)&&n!==t);e.preventDefault(),setTimeout(()=>{const e=i[n];e.classList.contains("tw-bg-secondary-100")&&e.classList.contains("tw-text-muted")||null==e||e.focus()},0)}}onFocus(e){return te(this,void 0,void 0,function*(){this.focusedIndex=e,yield this.selectPlan(this.selectableProducts[e])})}isCardDisabled(e){return this.selectableProducts[e]===(this.currentPlan||this.isCardStateDisabled)}manageSelectableProduct(e){return e}refreshSalesTax(){return te(this,void 0,void 0,function*(){if(this.billingFormGroup.controls.billingAddress.invalid&&!this.billingAddress)return;const e=this.billingFormGroup.controls.billingAddress.valid?(0,S.c3)(this.billingFormGroup.controls.billingAddress):this.billingAddress,t=yield this.previewInvoiceClient.previewTaxForOrganizationSubscriptionPlanChange(this.organizationId,(e=>{switch(e){case f.OL.FamiliesAnnually:case f.OL.FamiliesAnnually2025:return{tier:"families",cadence:"annually"};case f.OL.TeamsMonthly:return{tier:"teams",cadence:"monthly"};case f.OL.TeamsAnnually:return{tier:"teams",cadence:"annually"};case f.OL.EnterpriseMonthly:return{tier:"enterprise",cadence:"monthly"};case f.OL.EnterpriseAnnually:return{tier:"enterprise",cadence:"annually"}}})(this.selectedPlan.type),e);this.estimatedTax=t.tax})}canUpdatePaymentInformation(){return this.upgradeRequiresPaymentMethod||this.showPayment||!this.paymentMethod||this.isSubscriptionCanceled}get submitButtonLabel(){var e;return this.organization&&this.sub&&this.organization.productTierType!==f.K_.Free&&"canceled"===(null===(e=this.sub.subscription)||void 0===e?void 0:e.status)?this.i18nService.t("restart"):this.i18nService.t("upgrade")}get supportsTaxId(){return this.formGroup.value.productTier!==f.K_.Families}}li.ɵfac=function(e){return new(e||li)(n.rXU(I.Qs),n.rXU(R.ce),n.rXU(P.f),n.rXU(D.G),n.rXU(M.W),n.rXU(b.Lu),n.rXU(x.Ix),n.rXU(C.H),n.rXU(O.m),n.rXU(h.PV),n.rXU(y.U),n.rXU(r.ok),n.rXU(G.X),n.rXU(U.D),n.rXU(k.g),n.rXU(B.Hd),n.rXU(B.dA),n.rXU(E.S),n.rXU(V.w))},li.ɵcmp=n.VBU({type:li,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&n.GBs(S.Pu,5),2&e){let e;n.mGM(e=n.lsd())&&(t.enterPaymentMethodComponent=e.first)}},inputs:{acceptingSponsorship:"acceptingSponsorship",organizationId:"organizationId",showFree:"showFree",showCancel:"showCancel",productTier:"productTier",plan:"plan",providerId:"providerId"},outputs:{onSuccess:"onSuccess",onCanceled:"onCanceled",onTrialBillingSuccess:"onTrialBillingSuccess"},decls:22,vars:19,consts:[["nonEnterprisePlans",""],["fullFeatureList",""],["notAcceptingSponsorship",""],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[1,"tw-mb-3","tw-flex","tw-justify-between"],[1,"tw-text-lg","tw-pr-1","tw-font-medium",3,"hidden"],[1,"tw-flex","tw-items-center","tw-gap-2"],["class","tw-inline-block",4,"ngIf"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"],[1,"tw-inline-block"],[3,"selectedChange","selected"],[3,"value",4,"ngFor","ngForOf","ngForTrackBy"],[3,"value"],[1,"tw-grid","tw-grid-flow-col","tw-gap-4","tw-mb-4"],[3,"ngClass","id","click","keyup","focus",4,"ngFor","ngForOf","ngForTrackBy"],["type","info","title","SECRETS MANAGER SUBSCRIPTION",4,"ngIf"],["type","info","title","PASSWORD MANAGER SUBSCRIPTION",4,"ngIf"],[3,"click","keyup","focus","ngClass","id"],[1,"tw-relative"],["class","tw-bg-secondary-100 tw-text-center !tw-border-0 tw-text-sm tw-font-medium tw-py-1",3,"ngClass",4,"ngIf"],[1,"tw-px-2","tw-pb-[4px]",3,"ngClass"],[1,"tw-text-[1.25rem]","tw-mt-[6px]","tw-font-medium","tw-mb-0","tw-leading-[2rem]","tw-flex","tw-items-center"],[1,"tw-capitalize","tw-whitespace-nowrap"],["bitBadge","","variant","secondary","class","tw-ml-2 tw-align-middle",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"tw-bg-secondary-100","tw-text-center","!tw-border-0","tw-text-sm","tw-font-medium","tw-py-1",3,"ngClass"],["bitBadge","","variant","secondary",1,"tw-ml-2","tw-align-middle"],[1,"tw-text-lg","tw-font-medium"],[1,"tw-text-xs","tw-px-0"],[1,"tw-text-sm","tw-font-medium"],["class","tw-text-xs tw-px-2 tw-font-medium tw-mb-1",4,"ngIf"],[1,"tw-text-xs","tw-px-2","tw-mb-1"],[1,"bwi-ul","tw-text-xs"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-success","bwi-li"],["class","bwi-ul tw-text-xs",4,"ngIf"],[1,"tw-text-xs","tw-px-2","tw-font-medium","tw-mb-1"],[1,"tw-px-2","tw-pb-2","tw-list-inside","tw-mb-0","tw-text-xs"],["class","tw-text-xs tw-px-2 tw-mb-1",4,"ngIf"],["class","bwi-ul tw-text-xs tw-mb-1",4,"ngIf"],[1,"bwi-ul","tw-text-xs","tw-mb-1"],["type","info","title","SECRETS MANAGER SUBSCRIPTION"],["type","info","title","PASSWORD MANAGER SUBSCRIPTION"],["bitTypography","h4"],[1,"tw-mt-4"],[1,"tw-text-lg","tw-mb-1"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-font-light"],["type","button","size","small",3,"click","bitIconButton","label"],["class","tw-flex tw-flex-wrap tw-gap-4",4,"ngIf"],["class","tw-flex tw-flex-wrap tw-gap-4 tw-mt-4",4,"ngIf"],[1,"bwi","bwi-fw","bwi-billing"],[1,"tw-ml-2","tw-text-primary-600","tw-cursor-pointer",3,"click"],[3,"class"],[1,"bwi","bwi-fw","bwi-credit-card"],[1,"bwi","bwi-fw","bwi-paypal","tw-text-primary-600"],[3,"group"],[3,"group","scenario"],[1,"tw-flex","tw-flex-wrap","tw-gap-4"],["class","tw-w-1/2",4,"ngIf"],[1,"tw-w-1/2"],["class","tw-font-medium tw-mb-1",4,"ngIf"],["class","tw-mb-1 tw-flex tw-justify-between","bitTypography","body2",4,"ngIf"],["class","tw-mb-0 tw-flex tw-justify-between","bitTypography","body2",4,"ngIf"],["class","tw-font-medium tw-mt-3 tw-mb-1",4,"ngIf"],[1,"tw-font-medium","tw-mb-1"],["bitTypography","body2",1,"tw-mb-1","tw-flex","tw-justify-between"],[1,"tw-line-through"],["bitTypography","body2",1,"tw-mb-0","tw-flex","tw-justify-between"],[1,"tw-text-xs"],[1,"tw-line-through","tw-text-xs"],[1,"tw-font-medium","tw-mt-3","tw-mb-1"],["class","tw-font-medium tw-mt-2 tw-mb-0",4,"ngIf"],["class","tw-font-medium tw-mt-3 tw-mb-0",4,"ngIf"],[1,"tw-font-medium","tw-mt-2","tw-mb-0"],[1,"tw-font-medium","tw-mt-3","tw-mb-0"],[1,"tw-flex","tw-flex-wrap","tw-gap-4","tw-mt-4"],[1,"tw-flex","tw-justify-between","tw-border-0","tw-border-solid","tw-border-t","tw-border-secondary-300","tw-pt-2","tw-mb-0"],[1,"tw-text-xs","tw-font-medium"]],template:function(e,t){1&e&&(n.j41(0,"form",3)(1,"bit-dialog",4)(2,"span",5),n.EFF(3),n.k0s(),n.j41(4,"div",6)(5,"p"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"div",7)(9,"span",8),n.EFF(10),n.nI1(11,"i18n"),n.k0s(),n.j41(12,"div",9),n.DNE(13,oe,3,3,"div",10),n.k0s()(),n.DNE(14,Pe,7,6,"ng-container",11)(15,ri,23,27,"ng-container",11),n.k0s(),n.qex(16,12),n.j41(17,"button",13),n.EFF(18),n.k0s(),n.j41(19,"button",14),n.EFF(20),n.nI1(21,"i18n"),n.k0s(),n.bVm(),n.k0s()()),2&e&&(n.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),n.R7$(),n.Y8G("loading",t.loading),n.R7$(2),n.SpI(" ",t.dialogHeaderName," "),n.R7$(3),n.JRh(n.bMT(7,13,"upgradePlans")),n.R7$(3),n.Y8G("hidden",t.isSubscriptionCanceled),n.R7$(),n.JRh(n.bMT(11,15,"selectAPlan")),n.R7$(3),n.Y8G("ngIf",!t.isSubscriptionCanceled),n.R7$(),n.Y8G("ngIf",!t.loading&&!t.selfHosted&&t.passwordManagerPlans),n.R7$(),n.Y8G("ngIf",t.formGroup.value.productTier!==t.productTypes.Free||t.isSubscriptionCanceled),n.R7$(3),n.SpI(" ",t.submitButtonLabel," "),n.R7$(),n.Y8G("bitDialogClose",t.ResultType.Closed),n.R7$(),n.SpI(" ",n.bMT(21,17,"cancel")," "))},dependencies:[T.r,j.YU,j.Sq,j.bT,r.qT,r.cb,r.j4,N.$,z.L,Y.n,L.Q,K.G,X.I,q.m,H.hJ,W.I,$.s,J.H,Z.a,_.r,S.Pu,S.vU,w.i,j.GH,j.PV,j.oe,ee.$],encapsulation:2})},16496(e,t,i){"use strict";i.d(t,{a:()=>h});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(16568),l=i(12694);const c=["labelContent"],d=["*",[["bit-berry"]]];let u=0;class h{constructor(){this.id="bit-toggle-"+u++,this.groupComponent=(0,r.WQX)(l.H),this.value=n.hFB.required(),this.labelContent=(0,n.ebz)("labelContent"),this.berryComponent=(0,n.sbv)(a.c),this.hasBerry=(0,o.EW)(()=>!!this.berryComponent()),this.labelTitle=(0,r.vPA)(null),this.name=this.groupComponent.name,this.selected=(0,o.EW)(()=>this.groupComponent.selected()===this.value()),this.hostClasses=["tw-group/toggle","tw-flex","tw-min-w-16"],this.inputClasses=["tw-peer/toggle-input","tw-appearance-none","tw-outline-none"],this.labelClasses=["tw-h-full","tw-w-full","tw-flex","tw-items-center","tw-justify-center","tw-gap-1.5","!tw-font-medium","tw-leading-5","tw-transition","tw-text-center","tw-text-sm","tw-border-primary-600","!tw-text-primary-600","tw-border-solid","tw-border-y","tw-border-r","tw-border-l-0","tw-cursor-pointer","hover:tw-bg-hover-default","group-first-of-type/toggle:tw-border-l","group-first-of-type/toggle:tw-rounded-s-full","group-last-of-type/toggle:tw-rounded-e-full","peer-focus-visible/toggle-input:tw-outline-none","peer-focus-visible/toggle-input:tw-ring","peer-focus-visible/toggle-input:tw-ring-offset-2","peer-focus-visible/toggle-input:tw-ring-primary-600","peer-focus-visible/toggle-input:tw-z-10","peer-focus-visible/toggle-input:tw-bg-primary-600","peer-focus-visible/toggle-input:tw-border-primary-600","peer-focus-visible/toggle-input:!tw-text-contrast","peer-checked/toggle-input:tw-bg-primary-600","peer-checked/toggle-input:tw-border-primary-600","peer-checked/toggle-input:!tw-text-contrast","tw-py-1.5","tw-px-3","!tw-mb-0"],(0,s.mal)(()=>{var e;const t=null===(e=this.labelContent())||void 0===e?void 0:e.nativeElement.innerText;t&&this.labelTitle.set(t)}),(0,o.QZ)(()=>{var e;const t=this.selected()?"contrast":"primary";null===(e=this.berryComponent())||void 0===e||e.variant.set(t)})}handleInputChange(){this.groupComponent.onInputInteraction(this.value())}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=s.VBU({type:h,selectors:[["bit-toggle"]],contentQueries:function(e,t,i){1&e&&s.C6U(i,t.berryComponent,a.c,5),2&e&&s.NyB()},viewQuery:function(e,t){1&e&&s.wEZ(t.labelContent,c,5),2&e&&s.NyB()},hostAttrs:["tabindex","-1"],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.hostClasses)},inputs:{value:[1,"value"]},ngContentSelectors:["*","bit-berry"],decls:7,vars:10,consts:[["labelContent",""],["type","radio",3,"change","id","name","checked"],[3,"for","title"],[1,"tw-line-clamp-2","tw-break-words"],[1,"tw-shrink-0","[&_bit-berry]:tw-flex",3,"hidden"]],template:function(e,t){if(1&e){const e=s.RV6();s.NAR(d),s.rj2(0,"input",1),s.VwU("change",function(){return r.eBV(e),r.Njj(t.handleInputChange())}),s.eux(),s.rj2(1,"label",2)(2,"span",3,0),s.SdG(4),s.eux(),s.rj2(5,"span",4),s.SdG(6,1),s.eux()()}2&e&&(s.HbH(t.inputClasses),s.Avn("id",t.id)("name",t.name)("checked",t.selected()),s.R7$(),s.HbH(t.labelClasses),s.Avn("htmlFor",t.id)("title",t.labelTitle()),s.R7$(4),s.Avn("hidden",!t.hasBerry()))},encapsulation:2,changeDetection:0})},16568(e,t,i){"use strict";i.d(t,{c:()=>a});var n=i(94573),r=i(33277),s=i(33812);function o(e,t){if(1&e&&(s.rj2(0,"span"),s.EFF(1),s.eux()),2&e){const e=s.XpG();s.HbH(e.containerClasses()),s.R7$(),s.JRh(e.content())}}class a{constructor(){this.variant=(0,n.geq)("primary"),this.value=(0,n.hFB)(),this.type=(0,n.hFB)("count"),this.content=(0,r.EW)(()=>{const e=this.value();if("status"!==this.type()&&e&&!(e<0))return e>999?"999+":`${e}`}),this.textColor=(0,r.EW)(()=>"contrast"===this.variant()?"tw-text-fg-heading":"tw-text-fg-contrast"),this.padding=(0,r.EW)(()=>{var e,t;return(null!==(t=null===(e=this.value())||void 0===e?void 0:e.toString().length)&&void 0!==t?t:0)>2?"tw-px-1.5 tw-py-0.5":""}),this.containerClasses=(0,r.EW)(()=>["tw-inline-flex","tw-items-center","tw-justify-center","tw-align-middle","tw-text-xxs","tw-rounded-full",...{status:["tw-h-2","tw-w-2"],count:["tw-h-4","tw-min-w-4",this.padding()]}[this.type()],{primary:"tw-bg-bg-brand",subtle:"tw-bg-bg-contrast",success:"tw-bg-bg-success",warning:"tw-bg-bg-warning",danger:"tw-bg-bg-danger",accentPrimary:"tw-bg-fg-accent-primary-strong",contrast:"tw-bg-bg-primary"}[this.variant()],this.textColor()].join(" "))}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-berry"]],inputs:{variant:[1,"variant"],value:[1,"value"],type:[1,"type"]},outputs:{variant:"variantChange"},decls:1,vars:1,consts:[[3,"class"]],template:function(e,t){1&e&&s.nVh(0,o,2,3,"span",0),2&e&&s.vxM("status"===t.type()||t.content()?0:-1)},encapsulation:2,changeDetection:0})},16671(e,t,i){"use strict";i.d(t,{z:()=>a});var n=i(59777),r=i(78781);const s=Object.freeze({CipherUri:["https://","http://","ssh://","ftp://","sftp://","irc://","vnc://","rdp://","ms-rd:","chrome://","iosapp://","androidapp://"],WebUrl:["https://"]});class o{static canLaunch(e,t){if(r.A.isNullOrWhitespace(e))return!1;for(let i=0;i<t.length;i++)if(0===e.indexOf(t[i]))return!0;return!1}}class a{constructor(e){e&&(this.match=e.match)}get uri(){return this._uri}set uri(e){this._uri=e,this._domain=void 0,this._canLaunch=void 0}get domain(){return null==this._domain&&null!=this.uri&&(this._domain=r.A.getDomain(this.uri),""===this._domain&&(this._domain=void 0)),this._domain}get hostname(){if(this.match!==n.L.RegularExpression)return null==this._hostname&&null!=this.uri&&(this._hostname=r.A.getHostname(this.uri),""===this._hostname&&(this._hostname=void 0)),this._hostname}get host(){if(this.match!==n.L.RegularExpression)return null==this._host&&null!=this.uri&&(this._host=r.A.getHost(this.uri),""===this._host&&(this._host=void 0)),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&&!r.A.isNullOrWhitespace(r.A.getDomain(this.uri)))}get canLaunch(){return null!=this._canLaunch||(null!=this.uri&&this.match!==n.L.RegularExpression?this._canLaunch=o.canLaunch(this.launchUri,s.CipherUri):this._canLaunch=!1),this._canLaunch}get launchUri(){if(null!=this.uri)return this.uri.indexOf("://")<0&&!r.A.isNullOrWhitespace(r.A.getDomain(this.uri))?"http://"+this.uri:this.uri}static fromJSON(e){return Object.assign(new a,e)}static fromSdkLoginUriView(e){if(null==e)return;const t=new a;return t.uri=e.uri,t.match=e.match,t}toSdkLoginUriView(){var e,t;return{uri:null!==(e=this.uri)&&void 0!==e?e:void 0,match:null!==(t=this.match)&&void 0!==t?t:void 0,uriChecksum:void 0}}matchesUri(e,t,i,s){var o;if(!this.uri||!e)return!1;let a=null!==(o=this.match)&&void 0!==o?o:i;null!=a||(a=n.L.Domain),s&&a===n.L.Never&&(a=n.L.Domain);const l=r.A.getDomain(e),c=t.add(l);switch(a){case n.L.Domain:return this.matchesDomain(e,c);case n.L.Host:{const t=r.A.getHost(e);return null!=t&&t===r.A.getHost(this.uri)}case n.L.Exact:return e===this.uri;case n.L.StartsWith:return e.startsWith(this.uri);case n.L.RegularExpression:try{return new RegExp(this.uri,"i").test(e)}catch(d){return!1}case n.L.Never:return!1}return!1}matchesDomain(e,t){if(null==e||null==this.domain||!t.has(this.domain))return!1;if(r.A.DomainMatchBlacklist.has(this.domain)){const t=r.A.getHost(e);return!r.A.DomainMatchBlacklist.get(this.domain).has(t)}return!0}}},16845(e,t,i){"use strict";i.d(t,{m:()=>h});var n=i(72737),r=i(33338),s=i(93695),o=i(8029),a=i(73276),l=i(3204),c=i(3097),d=i(39306),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class h{constructor(e,t,i,s){this.key=e,this.$encryptor=t,this.encryptedState=s.getUser(i,e.toEncryptedStateKey()),this.combinedState$=(0,r.z)([this.encryptedState.combinedState$,this.$encryptor]).pipe((0,a.H)(e=>u(this,[e],void 0,function*([[e,t],i]){return[e,yield this.declassifyAll(i,t)]})),(0,c.u)({connector:()=>new n.m(1),resetOnRefCountZero:()=>{var t;return(0,o.O)(null!==(t=e.options.cleanupDelayMs)&&void 0!==t?t:6e4)}})),this.state$=this.combinedState$.pipe((0,l.T)(([,e])=>e))}get userId(){return this.encryptedState.userId}static from(e,t,i,n){return new h(t,n,e,i)}declassifyItem(e,t){return u(this,arguments,void 0,function*(e,{id:t,secret:i,disclosed:n}){const r=d.k.fromJSON(i),s=yield e.decrypt(r),o=this.key.classifier.declassify(n,s);return[t,this.key.options.deserializer(o)]})}declassifyAll(e,t){return u(this,void 0,void 0,function*(){if(null==t)return null;const i=t.map(t=>u(this,void 0,void 0,function*(){return this.declassifyItem(e,t)})),n=yield Promise.all(i);return this.key.reconstruct(n)})}classifyItem(e,t){return u(this,arguments,void 0,function*(e,[t,i]){const n=this.key.classifier.classify(i),r=yield e.encrypt(n.secret);return{id:t,secret:JSON.parse(JSON.stringify(r)),disclosed:n.disclosed}})}classifyAll(e,t){return u(this,void 0,void 0,function*(){if(null==t)return null;const i=this.key.deconstruct(t).map(t=>u(this,void 0,void 0,function*(){return this.classifyItem(e,t)}));return yield Promise.all(i)})}update(e){return u(this,arguments,void 0,function*(e,t=null){var i,n,o;const a=(0,r.z)([null!==(i=null==t?void 0:t.combineLatestWith)&&void 0!==i?i:(0,s.of)(null),this.$encryptor]);let l,c,d;yield this.encryptedState.update(e=>e,{shouldUpdate:(e,t)=>(l=e,[c,d]=t,!1),combineLatestWith:a});const u=yield this.declassifyAll(d,l);if(!(null===(o=null===(n=null==t?void 0:t.shouldUpdate)||void 0===n?void 0:n.call(t,u,c))||void 0===o||o))return u;const h=e(u,c),A=yield this.classifyAll(d,h);return yield this.encryptedState.update(()=>A),h})}}},16888(e,t,i){"use strict";i.d(t,{G:()=>r});var n=i(7248);class r extends n.V{}},16969(e,t,i){"use strict";i.d(t,{l:()=>d});var n=i(98267),r=i(72868);class s extends r.C{constructor(e){super(e),this.keyConnectorEnabled=!1}}var o=i(20702),a=i(95919);class l extends o.r{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 a.n(this.getResponseProperty("permissions")),this.userId=this.getResponseProperty("UserId"),this.useEvents=this.getResponseProperty("UseEvents"),this.providerStatus=this.getResponseProperty("ProviderStatus"),this.providerType=this.getResponseProperty("ProviderType")}}var c=i(39306);class d extends o.r{constructor(e){var t,i,o;super(e),this.accountKeys=null,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.premiumPersonally=this.getResponseProperty("Premium"),this.premiumFromOrganization=this.getResponseProperty("PremiumFromOrganization"),this.culture=this.getResponseProperty("Culture"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled");const a=this.getResponseProperty("Key");a&&(this.key=new c.k(a)),null!=this.getResponseProperty("AccountKeys")&&(this.accountKeys=new n.s(this.getResponseProperty("AccountKeys"))),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,this.verifyDevices=null===(o=this.getResponseProperty("VerifyDevices"))||void 0===o||o;const d=this.getResponseProperty("Organizations");null!=d&&(this.organizations=d.map(e=>new r.C(e)));const u=this.getResponseProperty("Providers");null!=u&&(this.providers=u.map(e=>new l(e)));const h=this.getResponseProperty("ProviderOrganizations");null!=h&&(this.providerOrganizations=h.map(e=>new s(e)))}}},17343(e,t,i){"use strict";i.d(t,{A:()=>Z});var n=i(67553),r=i(39488),s=i(31442),o=i(90118),a=i(24593),l=i(62819),c=i(77723),d=i(74208),u=i(33812),h=i(5556),A=i(66316),p=i(35500),g=i(50700),v=i(51757),f=i(26333),m=i(93103),y=i(47428),C=i(47696),w=i(44432),I=i(10672),b=i(57178),B=i(30930),E=i(38410),S=i(12694),Q=i(16496),k=i(75697),T=i(49112),F=i(5884),P=i(16568),R=i(77468),D=i(25740),M=i(55818),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function O(e,t){1&e&&(u.j41(0,"div"),u.nrm(1,"i",1),u.nI1(2,"i18n"),u.j41(3,"span",2),u.EFF(4),u.nI1(5,"i18n"),u.k0s()()),2&e&&(u.R7$(),u.Y8G("title",u.mNQ(u.bMT(2,3,"loading"))),u.R7$(3),u.JRh(u.bMT(5,5,"loading")))}function G(e,t){1&e&&(u.j41(0,"bit-callout",3),u.nI1(1,"i18n"),u.EFF(2),u.nI1(3,"i18n"),u.k0s()),2&e&&(u.Y8G("title",u.mNQ(u.bMT(1,3,"goodNews"))),u.R7$(2),u.SpI(" ",u.bMT(3,5,"noReusedPasswords")," "))}function U(e,t){if(1&e&&(u.j41(0,"bit-toggle",15),u.EFF(1),u.nrm(2,"bit-berry",15),u.k0s()),2&e){const e=t.$implicit,i=u.XpG(5);u.Y8G("value",e),u.R7$(),u.SpI(" ",i.getName(e)," "),u.R7$(),u.Y8G("value",i.getCount(e))}}function V(e,t){if(1&e){const e=u.RV6();u.j41(0,"bit-toggle-group",14),u.nI1(1,"async"),u.nI1(2,"i18n"),u.bIt("selectedChange",function(t){d.eBV(e);const i=u.XpG(4);return d.Njj(i.filterOrgToggle(t))}),u.Z7z(3,U,3,3,"bit-toggle",15,u.fX1),u.k0s()}if(2&e){const e=u.XpG(4);u.Y8G("selected",u.bMT(1,2,e.filterOrgStatus$)),u.BMQ("aria-label",u.bMT(2,4,"addAccessFilter")),u.R7$(3),u.Dyx(e.filterStatus)}}function j(e,t){if(1&e){const e=u.RV6();u.j41(0,"bit-chip-filter",16),u.bIt("ngModelChange",function(t){d.eBV(e);const i=u.XpG(4);return d.Njj(i.filterOrgToggleChipSelect(t))}),u.k0s()}if(2&e){const e=u.XpG(4);u.Y8G("placeholderText",e.chipSelectOptions[0].label)("options",e.chipSelectOptions)("ngModel",e.selectedFilterChip)}}function N(e,t){if(1&e&&u.nVh(0,V,5,6,"bit-toggle-group",12)(1,j,1,3,"bit-chip-filter",13),2&e){const e=u.XpG(3);u.vxM(e.canDisplayToggleGroup()?0:1)}}function z(e,t){1&e&&(u.j41(0,"th",9),u.EFF(1),u.nI1(2,"i18n"),u.k0s()),2&e&&(u.R7$(),u.JRh(u.bMT(2,1,"owner")))}function Y(e,t){if(1&e){const e=u.RV6();u.j41(0,"a",23),u.nI1(1,"i18n"),u.bIt("click",function(){d.eBV(e);const t=u.XpG().$implicit,i=u.XpG(3);return d.Njj(i.selectCipher(t))}),u.EFF(2),u.k0s()}if(2&e){const e=u.XpG().$implicit;u.Y8G("title",u.mNQ(u.i5U(1,3,"editItemWithName",e.name))),u.R7$(2),u.JRh(e.name)}}function L(e,t){if(1&e&&(u.j41(0,"span",20),u.EFF(1),u.k0s()),2&e){const e=u.XpG().$implicit;u.Y8G("title",u.mNQ(e.name)),u.R7$(),u.JRh(e.name)}}function K(e,t){1&e&&(u.nrm(0,"i",24),u.nI1(1,"i18n"),u.j41(2,"span",2),u.EFF(3),u.nI1(4,"i18n"),u.k0s()),2&e&&(u.Y8G("title",u.mNQ(u.bMT(1,3,"shared"))),u.R7$(3),u.JRh(u.bMT(4,5,"shared")))}function X(e,t){1&e&&(u.nrm(0,"i",25),u.nI1(1,"i18n"),u.j41(2,"span",2),u.EFF(3),u.nI1(4,"i18n"),u.k0s()),2&e&&(u.Y8G("title",u.mNQ(u.bMT(1,3,"attachments"))),u.R7$(3),u.JRh(u.bMT(4,5,"attachments")))}function q(e,t){if(1&e&&(u.nrm(0,"app-org-badge",26),u.nI1(1,"async"),u.nI1(2,"orgNameFromId")),2&e){const e=u.XpG(2).$implicit,t=u.XpG(3);u.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",u.i5U(2,5,e.organizationId,u.bMT(1,3,t.organizations$)))}}function H(e,t){if(1&e&&(u.j41(0,"td",8),u.nVh(1,q,3,8,"app-org-badge",26),u.k0s()),2&e){const e=u.XpG(4);u.R7$(),u.vxM(e.organization?-1:1)}}function W(e,t){if(1&e&&(u.j41(0,"td",8),u.nrm(1,"app-vault-icon",17),u.k0s(),u.j41(2,"td",18),u.nVh(3,Y,3,6,"a",19)(4,L,2,3,"span",20),u.nVh(5,K,5,7),u.nVh(6,X,5,7),u.nrm(7,"br"),u.j41(8,"small"),u.EFF(9),u.k0s()(),u.nVh(10,H,2,1,"td",8),u.j41(11,"td",21)(12,"span",22),u.EFF(13),u.nI1(14,"i18n"),u.k0s()()),2&e){const e=t.$implicit,i=u.XpG(3);u.R7$(),u.Y8G("cipher",e),u.R7$(2),u.vxM(!i.organization||i.canManageCipher(e)?3:4),u.R7$(2),u.vxM(!i.organization&&e.organizationId?5:-1),u.R7$(),u.vxM(e.hasAttachments?6:-1),u.R7$(3),u.JRh(e.subTitle),u.R7$(),u.vxM(i.isAdminConsoleActive?-1:10),u.R7$(3),u.SpI(" ",u.i5U(14,7,"reusedXTimes",i.passwordUseMap.get(e.login.password))," ")}}function $(e,t){if(1&e&&(u.j41(0,"bit-callout",4),u.nI1(1,"i18n"),u.EFF(2),u.nI1(3,"number"),u.nI1(4,"i18n"),u.k0s(),u.nVh(5,N,2,1),u.j41(6,"bit-table-scroll",5),u.qex(7,6),u.nrm(8,"th",7),u.j41(9,"th",8),u.EFF(10),u.nI1(11,"i18n"),u.k0s(),u.nVh(12,z,3,3,"th",9),u.j41(13,"th",10),u.EFF(14),u.nI1(15,"i18n"),u.k0s(),u.bVm(),u.DNE(16,W,15,10,"ng-template",11),u.k0s()),2&e){const e=u.XpG(2);u.Y8G("title",u.mNQ(u.bMT(1,9,"reusedPasswordsFound"))),u.R7$(2),u.SpI(" ",u.brH(4,13,"reusedPasswordsFoundReportDesc",u.bMT(3,11,e.ciphers.length),e.vaultMsg)," "),u.R7$(3),u.vxM(e.showFilterToggle&&!e.isAdminConsoleActive?5:-1),u.R7$(),u.Y8G("dataSource",e.dataSource)("rowSize",75),u.R7$(4),u.JRh(u.bMT(11,17,"name")),u.R7$(2),u.vxM(e.isAdminConsoleActive?-1:12),u.R7$(2),u.JRh(u.bMT(15,19,"timesReused"))}}function J(e,t){if(1&e&&(u.j41(0,"div",0),u.nVh(1,G,4,7,"bit-callout",3)(2,$,17,21),u.k0s()),2&e){const e=u.XpG();u.R7$(),u.vxM(e.ciphers.length?2:1)}}class Z extends c.n{constructor(e,t,i,n,r,s,o,a,l){super(e,i,r,t,n,s,o,a,l),this.cipherService=e,this.organizationService=t,this.ciphersToCheckForReusedPasswords=[],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*(){this.ciphersToCheckForReusedPasswords=yield this.getAllCiphers();const e=yield this.checkCiphersForReusedPasswords(this.ciphersToCheckForReusedPasswords);this.filterCiphersByOrg(e)})}checkCiphersForReusedPasswords(e){return x(this,void 0,void 0,function*(){const t=[];this.passwordUseMap=new Map,this.filterStatus=[0],e.forEach(e=>{const{type:i,login:n,isDeleted:r,edit:o,viewPassword:a}=e;i===s.gC.Login&&null!=n.password&&""!==n.password&&!r&&(this.organization||o)&&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))});return t.filter(e=>this.passwordUseMap.has(e.login.password)&&this.passwordUseMap.get(e.login.password)>1)})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return x(this,void 0,void 0,function*(){if(e===a.r.Deleted)return this.ciphersToCheckForReusedPasswords=this.ciphersToCheckForReusedPasswords.filter(e=>e.id!==t.id),null;const i=this.ciphersToCheckForReusedPasswords.findIndex(e=>e.id===t.id);-1!==i&&(this.ciphersToCheckForReusedPasswords[i]=t);const n=yield this.checkCiphersForReusedPasswords(this.ciphersToCheckForReusedPasswords);return this.filterCiphersByOrg(n),t})}}Z.ɵfac=function(e){return new(e||Z)(u.rXU(h.p),u.rXU(n.PV),u.rXU(A.o3),u.rXU(p.D),u.rXU(o.qX),u.rXU(g.W),u.rXU(r.H),u.rXU(o.hI),u.rXU(l.l))},Z.ɵcmp=u.VBU({type:Z,selectors:[["app-reused-passwords-report"]],standalone:!1,features:[u.Vt3],decls:7,vars:4,consts:[[1,"tw-mt-4"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","success",3,"title"],["type","danger",3,"title"],["layout","fixed",3,"dataSource","rowSize"],["header",""],["bitCell","",1,"tw-w-12"],["bitCell",""],["bitCell","",1,"tw-w-1/4"],["bitCell","",1,"tw-w-1/4","tw-text-right"],["bitRowDef",""],[3,"selected"],["fullWidth","true",3,"placeholderText","options","ngModel"],[3,"selectedChange","selected"],[3,"value"],["fullWidth","true",3,"ngModelChange","placeholderText","options","ngModel"],[3,"cipher"],["bitCell","",1,"tw-truncate","tw-max-w-0"],["bitLink","","href","#","appStopClick","",3,"title"],[3,"title"],["bitCell","",1,"tw-text-right"],["bitBadge","","variant","warning"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared","tw-ml-1",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-1",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(u.nrm(0,"app-header"),u.j41(1,"bit-container")(2,"p"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.nVh(5,O,6,7,"div")(6,J,3,1,"div",0),u.k0s()),2&e&&(u.R7$(3),u.JRh(u.bMT(4,2,"reusedPasswordsReportDesc")),u.R7$(2),u.vxM(!t.hasLoaded&&t.loading?5:6))},dependencies:[v.BC,v.vS,f.R,m.Y,y.x,C.n,w.G,I.H,b.g,B.a,E.Q,B.N,S.H,Q.a,k.P,T.f,F.W,P.c,R.Jj,R.QX,D.$,M.t],encapsulation:2})},17386(e,t,i){"use strict";i.d(t,{k:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","bitTabListContainer",""]],hostAttrs:[1,"tw-inline-flex","tw-flex-wrap","tw-leading-5"]})},17594(e,t,i){"use strict";i.d(t,{US:()=>y.US,bC:()=>Ie});var n=i(74208),r=i(51757),s=i(66046),o=i(69194),a=i(44500),l=i(33338),c=i(3204),d=i(14803),u=i(67553),h=i(54931),A=i(56962),p=i(98869),g=i(67253);class v{constructor(e){this.message=e.humanReadableMessage,this.appIcon=e.appIcon,this.appName=e.appName,this.userId=e.userId,this.userName=e.userName,this.userEmail=e.userEmail,this.date=e.date,this.ip=e.ip,this.type=h.Bx[e.type],this.installationId=e.installationId}}var f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{getEventExport(e){return f(this,void 0,void 0,function*(){return p.unparse(e.map(e=>new v(e)))})}getFileName(e=null,t="csv"){return g.Ly.getFileName(null!=e?e:"",t)}}m.ɵfac=function(e){return new(e||m)},m.ɵprov=n.jDH({token:m,factory:m.ɵfac,providedIn:"root"});var y=i(30038),C=i(33812),w=i(50700),I=i(37115),b=i(53127),B=i(69855),E=i(23649),S=i(35500),Q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k{get destroy$(){return this.destroySubject$.asObservable()}constructor(e,t,i,o,a,l,c,d,u,h){this.eventService=e,this.i18nService=t,this.exportService=i,this.platformUtilsService=o,this.logService=a,this.fileDownloadService=l,this.toastService=c,this.activeRoute=d,this.accountService=u,this.organizationService=h,this.loading=(0,n.vPA)(!0),this.loaded=(0,n.vPA)(!1),this.events=(0,n.vPA)([]),this.dirtyDates=!0,this.canUseSM=!1,this.eventsForm=new r.gE({start:new r.MJ(null),end:new r.MJ(null)}),this.destroySubject$=new s.B,this.loadMoreEvents=()=>Q(this,void 0,void 0,function*(){yield this.loadEvents(!1)}),this.refreshEvents=()=>Q(this,void 0,void 0,function*(){yield this.loadEvents(!0)}),this.exportEvents=()=>Q(this,void 0,void 0,function*(){if(this.dirtyDates)return;this.loading.set(!0);const e=this.parseDates();if(null==e)return;let t;try{t=this.export(e[0],e[1]),yield t}catch(i){this.logService.error(`Handled exception: ${i}`)}t=null,this.loading.set(!1)}),this.loadEvents=e=>Q(this,void 0,void 0,function*(){const t=this.parseDates();if(null==t)return;this.loading.set(!0);let i,n=[];i=this.loadAndParseEvents(t[0],t[1],e?null:this.continuationToken);const r=yield i;this.continuationToken=r.continuationToken,n=r.events,!e&&null!=this.events()&&this.events().length>0?this.events.update(e=>[...e,...n]):this.events.set(n),this.dirtyDates=!1,this.loading.set(!1),i=null});const A=this.eventService.getDefaultDateFilters();this.start=A[0],this.end=A[1]}initBase(){this.organizations$=this.accountService.activeAccount$.pipe((0,o.p)(e=>!!(null==e?void 0:e.id)),(0,a.n)(e=>this.organizationService.organizations$(e.id))),this.activeOrganization$=(0,l.z)([this.activeRoute.paramMap,this.organizations$]).pipe((0,c.T)(([e,t])=>t.find(t=>t.id===e.get("organizationId")))),this.canUseSM$=this.activeOrganization$.pipe((0,c.T)(e=>{var t;return null!==(t=null==e?void 0:e.canAccessSecretsManager)&&void 0!==t&&t})),this.canUseSM$.pipe((0,d.Q)(this.destroy$)).subscribe(e=>{this.canUseSM=e})}ngOnDestroy(){this.destroySubject$.next(),this.destroySubject$.complete()}get start(){return this.eventsForm.value.start}set start(e){this.eventsForm.get("start").setValue(e)}get end(){return this.eventsForm.value.end}set end(e){this.eventsForm.get("end").setValue(e)}loadAndParseEvents(e,t,i){return Q(this,void 0,void 0,function*(){const n=yield this.requestEvents(e,t,i),r=yield Promise.all(n.data.map(e=>Q(this,void 0,void 0,function*(){const t=null==e.actingUserId?e.userId:e.actingUserId,i=new y.ng;i.disableLink=!this.canUseSM;const n=yield this.eventService.getEventInfo(e,i),r=this.getUserName(e,t),s=null!=r?r.name:this.i18nService.t("unknown");return new h.g8({message:n.message,humanReadableMessage:n.humanReadableMessage,appIcon:n.appIcon,appName:n.appName,userId:t,userName:s,userEmail:null!=r?r.email:"",date:e.date,ip:e.ipAddress,type:e.type,installationId:e.installationId,systemUser:e.systemUser,serviceAccountId:e.serviceAccountId})})));return{continuationToken:n.continuationToken,events:r}})}parseDates(){let e=null;try{e=this.eventService.formatDateFilters(this.start,this.end)}catch(t){return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidDateRange")}),null}return e}export(e,t){return Q(this,void 0,void 0,function*(){let i=this.continuationToken,n=[].concat(this.events());for(;null!=i;){const r=yield this.loadAndParseEvents(e,t,i);i=r.continuationToken,n=n.concat(r.events)}const r=yield this.exportService.getEventExport(n),s=this.exportService.getFileName(this.exportFileName,"csv");this.fileDownloadService.download({fileName:s,blobData:r,blobOptions:{type:"text/plain"}})})}}k.ɵfac=function(e){return new(e||k)(C.rXU(y.US),C.rXU(w.W),C.rXU(m),C.rXU(I.y),C.rXU(A.K),C.rXU(b.y),C.rXU(B.f),C.rXU(E.nX),C.rXU(S.D),C.rXU(u.PV))},k.ɵdir=C.FsC({type:k});var T=i(72245),F=i(73276),P=i(93695),R=i(36359),D=i(88565),M=i(23965),x=i(90171),O=i(3633),G=i(64447),U=i(16452),V=i(72932),j=i(25065);function N(){const e=new Date,t=new Date(e.getTime()-864e5),i=t.getTime()+Math.random()*(e.getTime()-t.getTime());return new Date(i).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})}const z=new Array(6).fill({appName:"***",userName:"**********",userEmail:"**********",message:"**********"}),Y=[{date:N(),appName:"Extension - Firefox",userName:"Alice",userEmail:"alice@email.com",message:"Logged in"},{date:N(),appName:"Mobile - iOS",userName:"Bob",message:'Viewed item <span class="tw-text-code">000000</span>'},{date:N(),appName:"Desktop - Linux",userName:"Carlos",userEmail:"carlos@email.com",message:"Login attempt failed with incorrect password"},{date:N(),appName:"Web vault - Chrome",userName:"Ivan",userEmail:"ivan@email.com",message:'Confirmed user <span class="tw-text-code">000000</span>'},{date:N(),appName:"Mobile - Android",userName:"Franz",userEmail:"franz@email.com",message:'Sent item <span class="tw-text-code">000000</span> to trash'}].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()).concat(z);var L=i(12012),K=i(11224),X=i(13417),q=i(66316),H=i(1601),W=i(3892),$=i(26657),J=i(47696),Z=i(56898),_=i(44432),ee=i(86226),te=i(97553),ie=i(43759),ne=i(58384),re=i(38410),se=i(22466),oe=i(36572),ae=i(49112),le=i(77468),ce=i(25740),de=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ue(e,t){1&e&&(C.j41(0,"span",0),C.EFF(1),C.nI1(2,"i18n"),C.k0s()),2&e&&(C.R7$(),C.SpI(" ",C.bMT(2,1,"upgrade")," "))}function he(e,t){1&e&&(C.j41(0,"bit-callout",9),C.nI1(1,"i18n"),C.EFF(2),C.nI1(3,"i18n"),C.k0s()),2&e&&(C.Y8G("title",C.bMT(1,2,"upgradeEventLogTitleMessage")),C.R7$(2),C.SpI(" ",C.bMT(3,4,"upgradeEventLogMessage")," "))}function Ae(e,t){1&e&&(C.qex(0),C.nrm(1,"bit-icon",10),C.j41(2,"span",11),C.EFF(3),C.nI1(4,"i18n"),C.k0s(),C.bVm()),2&e&&(C.R7$(3),C.JRh(C.bMT(4,1,"loading")))}function pe(e,t){1&e&&(C.j41(0,"p"),C.EFF(1),C.nI1(2,"i18n"),C.k0s()),2&e&&(C.R7$(),C.JRh(C.bMT(2,1,"noEventsInList")))}function ge(e,t){if(1&e&&(C.j41(0,"tr",17)(1,"td",18),C.EFF(2),C.nI1(3,"date"),C.k0s(),C.j41(4,"td",15)(5,"span",19),C.EFF(6),C.k0s()(),C.j41(7,"td",15)(8,"span",19),C.EFF(9),C.k0s()(),C.nrm(10,"td",20),C.k0s()),2&e){const e=t.$implicit,i=t.$index;C.XpG(4);const n=C.r8f(0);C.R7$(2),C.SpI(" ",i>4&&n?"******":C.i5U(3,9,e.date,"medium")," "),C.R7$(3),C.Y8G("title",C.ai1("",e.appName,", ",e.ip)),C.R7$(),C.JRh(e.appName),C.R7$(2),C.Y8G("title",C.mNQ(e.userEmail)),C.R7$(),C.JRh(e.userName),C.R7$(),C.Y8G("innerHTML",e.message,C.npT)}}function ve(e,t){if(1&e&&C.Z7z(0,ge,11,12,"tr",17,C.Vm6),2&e){C.XpG(2);const e=C.r8f(1);C.Dyx(e)}}function fe(e,t){1&e&&(C.j41(0,"bit-table",12),C.qex(1,14),C.j41(2,"tr")(3,"th",15),C.EFF(4),C.nI1(5,"i18n"),C.k0s(),C.j41(6,"th",15),C.EFF(7),C.nI1(8,"i18n"),C.k0s(),C.j41(9,"th",15),C.EFF(10),C.nI1(11,"i18n"),C.k0s(),C.j41(12,"th",15),C.EFF(13),C.nI1(14,"i18n"),C.k0s()(),C.bVm(),C.DNE(15,ve,2,0,"ng-template",16),C.k0s()),2&e&&(C.R7$(4),C.JRh(C.bMT(5,4,"timestamp")),C.R7$(3),C.JRh(C.bMT(8,6,"client")),C.R7$(3),C.JRh(C.bMT(11,8,"member")),C.R7$(3),C.JRh(C.bMT(14,10,"event")))}function me(e,t){if(1&e&&(C.j41(0,"button",13),C.EFF(1),C.nI1(2,"i18n"),C.k0s()),2&e){const e=C.XpG(2);C.Y8G("bitAction",e.loadMoreEvents),C.R7$(),C.SpI(" ",C.bMT(2,2,"loadMore")," ")}}function ye(e,t){if(1&e&&(C.qex(0),C.SS7(1),C.nVh(2,pe,3,3,"p"),C.nVh(3,fe,16,12,"bit-table",12),C.nVh(4,me,3,4,"button",13),C.bVm()),2&e){const e=C.XpG();C.R7$();const t=C.bH3(null!=e.organization&&e.organization.useEvents?e.events():e.placeholderEvents);C.R7$(),C.vxM(t&&t.length?-1:2),C.R7$(),C.vxM(t&&t.length?3:-1),C.R7$(),C.vxM(e.continuationToken?4:-1)}}function Ce(e,t){if(1&e){const e=C.RV6();C.qex(0),C.j41(1,"div",21)(2,"div",22),C.nrm(3,"i",23),C.j41(4,"p",24),C.EFF(5),C.nI1(6,"i18n"),C.k0s(),C.j41(7,"p"),C.EFF(8),C.nI1(9,"i18n"),C.k0s(),C.j41(10,"button",25),C.bIt("click",function(){n.eBV(e);const t=C.XpG();return n.Njj(t.changePlan())}),C.EFF(11),C.nI1(12,"i18n"),C.k0s()()(),C.bVm()}2&e&&(C.R7$(5),C.SpI(" ",C.bMT(6,3,"upgradeEventLogTitleMessage")," "),C.R7$(3),C.SpI(" ",C.bMT(9,5,"upgradeForFullEventsMessage")," "),C.R7$(3),C.SpI(" ",C.bMT(12,7,"changeBillingPlan")," "))}const we={[h.p2.SCIM]:null,[h.p2.DomainVerification]:"domainVerification",[h.p2.PublicApi]:"publicApi",[h.p2.BitwardenPortal]:"system"};class Ie extends k{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f){super(i,n,r,s,o,h,A,f,p,l),this.apiService=e,this.route=t,this.userNamePipe=a,this.organizationService=l,this.organizationUserApiService=c,this.organizationApiService=d,this.providerService=u,this.accountService=p,this.dialogService=g,this.configService=v,this.activeRoute=f,this.exportFileName="org-events",this.placeholderEvents=Y,this.orgUsersUserIdMap=new Map,this.ProductTierType=G.K_}ngOnInit(){return de(this,void 0,void 0,function*(){this.initBase();const e=yield(0,T._)((0,O.F6)(this.accountService.activeAccount$));this.route.params.pipe((0,F.H)(t=>de(this,void 0,void 0,function*(){this.organizationId=t.organizationId,this.organization=yield(0,T._)(this.organizationService.organizations$(e).pipe((0,u.Sw)(this.organizationId))),this.organization.useEvents||(this.eventsForm.get("start").disable(),this.eventsForm.get("end").disable(),this.organizationSubscription=yield this.organizationApiService.getSubscription(this.organizationId)),yield this.load()})),(0,d.Q)(this.destroy$)).subscribe()})}load(){return de(this,void 0,void 0,function*(){if((yield this.organizationUserApiService.getAllMiniUserDetails(this.organizationId)).data.forEach(e=>{const t=this.userNamePipe.transform(e);this.orgUsersUserIdMap.set(e.userId,{name:t,email:e.email})}),null!=this.organization.providerId)try{yield(0,T._)(this.accountService.activeAccount$.pipe(O.F6,(0,a.n)(e=>this.providerService.get$(this.organization.providerId,e)),(0,c.T)(e=>null!=e&&e.canManageUsers),(0,a.n)(e=>e?this.apiService.getProviderUsers(this.organization.providerId):(0,P.of)(null)),(0,R.M)(e=>{e&&e.data.forEach(e=>{const t=this.userNamePipe.transform(e);this.orgUsersUserIdMap.set(e.userId,{name:`${t} (${this.organization.providerName})`,email:e.email})})})))}catch(e){this.logService.warning(e)}yield this.refreshEvents(),this.loaded.set(!0)})}requestEvents(e,t,i){return this.apiService.getEventsOrganization(this.organizationId,e,t,i)}getUserName(e,t){if(null!=e.installationId)return{name:`Installation: ${e.installationId}`};if(null!=t){if(this.orgUsersUserIdMap.has(t))return this.orgUsersUserIdMap.get(t);if(null!=e.providerId&&e.providerId===this.organization.providerId)return{name:this.organization.providerName}}if(null!=e.systemUser){const t=we[e.systemUser];return t?{name:this.i18nService.t(t)}:{name:h.p2[e.systemUser]}}return e.serviceAccountId?{name:this.i18nService.t("machineAccount")+" "+this.getShortId(e.serviceAccountId)}:null}getShortId(e){return null==e?void 0:e.substring(0,8)}changePlan(){return de(this,void 0,void 0,function*(){const e=(0,U.IO)(this.dialogService,{data:{organizationId:this.organizationId,subscription:this.organizationSubscription,productTierType:this.organization.productTierType}});(yield(0,D.s)(e.closed))!==U.d1.Closed&&(yield this.load())})}}Ie.ɵfac=function(e){return new(e||Ie)(C.rXU(L.G),C.rXU(E.nX),C.rXU(y.US),C.rXU(w.W),C.rXU(m),C.rXU(I.y),C.rXU(A.K),C.rXU(x.b),C.rXU(u.PV),C.rXU(M.uB),C.rXU(K.X),C.rXU(X.$),C.rXU(b.y),C.rXU(B.f),C.rXU(S.D),C.rXU(q.o3),C.rXU(H.w),C.rXU(E.nX))},Ie.ɵcmp=C.VBU({type:Ie,selectors:[["ng-component"]],features:[C.Vt3],decls:33,vars:31,consts:[["bitBadge","","variant","primary","slot","title-suffix",1,"tw-ml-2","tw-mt-1.5","tw-inline-flex","tw-items-center"],[1,"tw-mb-4",3,"formGroup"],[1,"tw-mt-4","tw-flex","tw-items-center"],["bitInput","","type","datetime-local","formControlName","start",3,"change","placeholder"],[1,"tw-mx-2"],["bitInput","","type","datetime-local","formControlName","end",3,"change","placeholder"],["type","button","bitButton","","bitFormButton","","buttonType","primary",1,"tw-mx-3","tw-mt-1",3,"bitAction","disabled"],["type","button","bitButton","","bitFormButton","",1,"tw-mt-1",3,"bitAction","disabled"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-in"],["type","info",3,"title"],["name","bwi-spinner","aria-hidden","true",1,"bwi-lg","bwi-spin","tw-text-muted"],[1,"tw-sr-only"],["data-testid","events-table"],["type","button","bitButton","","buttonType","primary",3,"bitAction"],["header",""],["bitCell",""],["body",""],["bitRow","","alignContent","top"],["bitCell","",1,"tw-whitespace-nowrap"],[3,"title"],["bitCell","",3,"innerHTML"],[1,"tw-relative","tw--top-72","tw-bg-background","tw-bg-opacity-90","tw-pb-5","tw-flex","tw-items-center","tw-justify-center","tw-h-[19rem]"],[1,"tw-bg-background","tw-max-w-xl","tw-flex-col","tw-justify-center","tw-text-center","tw-p-5","tw-px-10","tw-rounded","tw-border-0","tw-border-b","tw-border-secondary-300","tw-border-solid","tw-mt-5"],[1,"bwi","bwi-2x","bwi-business","tw-text-primary-600"],[1,"tw-font-medium","tw-mt-2"],["type","button","bitButton","","buttonType","primary",1,"tw-mt-1",3,"click"]],template:function(e,t){if(1&e){const e=C.RV6();C.SS7(0),C.j41(1,"app-header"),C.nVh(2,ue,3,3,"span",0),C.k0s(),C.j41(3,"div",1)(4,"div",2)(5,"bit-form-field")(6,"bit-label"),C.EFF(7),C.nI1(8,"i18n"),C.k0s(),C.j41(9,"input",3),C.nI1(10,"i18n"),C.bIt("change",function(){return n.eBV(e),n.Njj(t.dirtyDates=!0)}),C.k0s()(),C.j41(11,"span",4),C.EFF(12,"-"),C.k0s(),C.j41(13,"bit-form-field")(14,"bit-label"),C.EFF(15),C.nI1(16,"i18n"),C.k0s(),C.j41(17,"input",5),C.nI1(18,"i18n"),C.bIt("change",function(){return n.eBV(e),n.Njj(t.dirtyDates=!0)}),C.k0s()(),C.j41(19,"form")(20,"button",6),C.EFF(21),C.nI1(22,"i18n"),C.k0s()(),C.j41(23,"form")(24,"button",7)(25,"span"),C.EFF(26),C.nI1(27,"i18n"),C.k0s(),C.nrm(28,"i",8),C.k0s()()()(),C.nVh(29,he,4,6,"bit-callout",9),C.nVh(30,Ae,5,3,"ng-container"),C.nVh(31,ye,5,4,"ng-container"),C.nVh(32,Ce,13,9,"ng-container")}if(2&e){const e=C.bH3(!(null!=t.organization&&t.organization.useEvents));C.R7$(2),C.vxM(e?2:-1),C.R7$(),C.Y8G("formGroup",t.eventsForm),C.R7$(4),C.JRh(C.bMT(8,19,"from")),C.R7$(2),C.Y8G("placeholder",C.mNQ(C.bMT(10,21,"startDate"))),C.R7$(6),C.JRh(C.bMT(16,23,"to")),C.R7$(2),C.Y8G("placeholder",C.mNQ(C.bMT(18,25,"endDate"))),C.R7$(3),C.Y8G("bitAction",t.refreshEvents)("disabled",e),C.R7$(),C.SpI(" ",C.bMT(22,27,"update")," "),C.R7$(3),C.Y8G("bitAction",t.exportEvents)("disabled",t.dirtyDates||e),C.R7$(2),C.JRh(C.bMT(27,29,"export")),C.R7$(3),C.vxM(t.loaded()&&e?29:-1),C.R7$(),C.vxM(t.loaded()?-1:30),C.R7$(),C.vxM(t.loaded()?31:-1),C.R7$(),C.vxM(t.loaded()&&e?32:-1)}},dependencies:[j.G,r.qT,r.me,r.BC,r.cb,r.cV,r.j4,r.JD,W.p,$.$,J.n,Z.Q,_.G,ee.j,te.J,ie.h,ne.R,re.Q,se.Y,oe._,oe.O,V.G,ae.f,le.vh,ce.$],encapsulation:2,changeDetection:0});i(11486)},17721(e,t,i){"use strict";i.d(t,{Y:()=>f});var n=i(77468),r=i(94573),s=i(51757),o=i(36801),a=i(86226),l=i(33812);const c=[[["bit-label"]],"*",[["bit-hint"]]];function d(e,t){1&e&&(l.j41(0,"span",2),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" (",l.bMT(2,1,"required"),")"))}function u(e,t){1&e&&l.eu8(0)}function h(e,t){if(1&e&&(l.j41(0,"fieldset")(1,"legend",1),l.SdG(2),l.nVh(3,d,3,3,"span",2),l.k0s(),l.DNE(4,u,1,0,"ng-container",3),l.k0s()),2&e){const e=l.XpG(),t=l.sdS(3);l.R7$(3),l.vxM(e.required?3:-1),l.R7$(),l.Y8G("ngTemplateOutlet",t)}}function A(e,t){1&e&&l.eu8(0)}function p(e,t){if(1&e&&l.DNE(0,A,1,0,"ng-container",3),2&e){l.XpG();const e=l.sdS(3);l.Y8G("ngTemplateOutlet",e)}}function g(e,t){1&e&&(l.j41(0,"div"),l.SdG(1,1),l.k0s(),l.SdG(2,2,["ngProjectAs","bit-hint",5,["bit-hint"]]))}let v=0;class f{get name(){var e,t;return null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.name)||void 0===t?void 0:t.toString()}constructor(e){this.ngControl=e,this.disabled=!1,this.block=(0,r.hFB)(!1),this.role="radiogroup",this.id=(0,r.hFB)("bit-radio-group-"+v++),this.classList=["tw-block","tw-mb-4"],this.label=(0,r.sbv)(a.j),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(s.k0.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){var t;this.selected=e,null===(t=this.onChange)||void 0===t||t.call(this,this.selected)}onBlur(){var e;null===(e=this.onTouched)||void 0===e||e.call(this)}}f.ɵfac=function(e){return new(e||f)(l.rXU(s.vO,10))},f.ɵcmp=l.VBU({type:f,selectors:[["bit-radio-group"]],contentQueries:function(e,t,i){1&e&&l.C6U(i,t.label,a.j,5),2&e&&l.NyB()},hostVars:4,hostBindings:function(e,t){2&e&&(l.Avn("id",t.id()),l.BMQ("role",t.role),l.HbH(t.classList))},inputs:{block:[1,"block"],id:[1,"id"]},ngContentSelectors:["bit-label","*","bit-hint"],decls:4,vars:2,consts:[["content",""],[1,"tw-mb-1","tw-block","tw-text-sm","tw-font-medium","tw-text-main"],[1,"tw-text-xs","tw-font-normal"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(l.NAR(c),l.nVh(0,h,5,2,"fieldset"),l.nVh(1,p,1,1,"ng-container"),l.DNE(2,g,3,0,"ng-template",null,0,l.C5r)),2&e&&(l.vxM(t.label()?0:-1),l.R7$(),l.vxM(t.label()?-1:1))},dependencies:[n.T3,o.$Z],encapsulation:2})},17898(e,t,i){"use strict";i.d(t,{b:()=>n});class n{}},17989(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(39306),r=i(78781),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class o{buildDomainModel(e,t,i,r=[]){for(const s in i){if(!i.hasOwnProperty(s))continue;const o=t[i[s]||s];r.indexOf(s)>-1?e[s]=o||null:e[s]=o?new n.k(o):null}}buildDataModel(e,t,i,n=[]){for(const r in i){if(!i.hasOwnProperty(r))continue;const s=e[i[r]||r];n.indexOf(r)>-1?t[r]=null!=s?s:null:t[r]=null!=s?s.encryptedString:null}}decryptObj(e,t,i,o){return s(this,arguments,void 0,function*(e,t,i,s,o="No Domain Context"){const a=r.A.getContainerService().getEncryptService();for(const r of i)if(null!=e[r])try{t[r]=yield a.decryptString(e[r],s)}catch(l){const e="object"==typeof l&&null!==l&&"message"in l?l.message:String(l);console.error(`Failed to decrypt property '${String(r)}' of domain. Context: ${o}. Error: ${e}`),t[r]=n.h}else t[r]=null;return t})}}},18030(e,t,i){"use strict";i.d(t,{Tl:()=>s,VI:()=>r,jo:()=>o});var n=i(78991);function r(e,t){const i={id:e.id,type:e.type,name:s(e.i18nKeys.name,t),generate:s(e.i18nKeys.generateCredential,t),onGeneratedMessage:s(e.i18nKeys.credentialGenerated,t),credentialType:s(e.i18nKeys.credentialType,t),copy:s(e.i18nKeys.copyCredential,t),useGeneratedValue:s(e.i18nKeys.useCredential,t),onlyOnRequest:!e.capabilities.autogenerate,request:e.capabilities.fields};return e.i18nKeys.description&&(i.description=s(e.i18nKeys.description,t)),i}function s(e,t){return(0,n._g)(e)?t.t(e):e.literal}function o(e,t){return(null!=e?e:0)<(null!=t?t:Number.POSITIVE_INFINITY)}},18499(e,t,i){"use strict";i.d(t,{N:()=>r,m:()=>n});class n{}class r extends n{}},18990(e,t,i){"use strict";i.d(t,{m:()=>c});var n=i(60893),r=i(79783),s=i(25065),o=i(15661),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[s.G,n.t,r.k,o.nk,s.G,n.t]})},19488(e,t,i){"use strict";i.d(t,{Z:()=>l});var n=i(17989),r=i(24072),s=i(9184),o=i(6528),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class l extends n.A{constructor(e){super(),null!=e&&(this.cardholderName=(0,r.e)(e.cardholderName),this.brand=(0,r.e)(e.brand),this.number=(0,r.e)(e.number),this.expMonth=(0,r.e)(e.expMonth),this.expYear=(0,r.e)(e.expYear),this.code=(0,r.e)(e.code))}decrypt(e){return a(this,arguments,void 0,function*(e,t="No Cipher Context"){return this.decryptObj(this,new o.G,["cardholderName","brand","number","expMonth","expYear","code"],e,"DomainType: Card; "+t)})}toCardData(){const e=new s.b;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;const t=new l;return t.cardholderName=(0,r.u)(e.cardholderName),t.brand=(0,r.u)(e.brand),t.number=(0,r.u)(e.number),t.expMonth=(0,r.u)(e.expMonth),t.expYear=(0,r.u)(e.expYear),t.code=(0,r.u)(e.code),t}toSdkCard(){var e,t,i,n,r,s;return{cardholderName:null===(e=this.cardholderName)||void 0===e?void 0:e.toSdk(),brand:null===(t=this.brand)||void 0===t?void 0:t.toSdk(),number:null===(i=this.number)||void 0===i?void 0:i.toSdk(),expMonth:null===(n=this.expMonth)||void 0===n?void 0:n.toSdk(),expYear:null===(r=this.expYear)||void 0===r?void 0:r.toSdk(),code:null===(s=this.code)||void 0===s?void 0:s.toSdk()}}static fromSdkCard(e){if(!e)return;const t=new l;return t.cardholderName=(0,r.u)(e.cardholderName),t.brand=(0,r.u)(e.brand),t.number=(0,r.u)(e.number),t.expMonth=(0,r.u)(e.expMonth),t.expYear=(0,r.u)(e.expYear),t.code=(0,r.u)(e.code),t}}},19638(e,t,i){"use strict";i.d(t,{N:()=>n});const n=Object.freeze({addyio:"addyio",bitwarden:"bitwarden",duckduckgo:"duckduckgo",fastmail:"fastmail",forwardemail:"forwardemail",mozilla:"mozilla",simplelogin:"simplelogin"})},20136(e,t,i){"use strict";i.d(t,{S2:()=>l,oR:()=>c,mJ:()=>d});var n=i(68467);class r{constructor(e,t,i=()=>Date.now()){this.logger=e,this.now=i,this.context=t&&"object"==typeof t?t:{}}debug(e,t){this.log(e,n.xk.Debug,t)}info(e,t){this.log(e,n.xk.Info,t)}warn(e,t){this.log(e,n.xk.Warning,t)}error(e,t){this.log(e,n.xk.Error,t)}panic(e,t){this.log(e,n.xk.Error,t);throw new Error(null!=t?t:"string"==typeof e?e:"a fatal error occurred")}log(e,t,i){const n=Object.assign(Object.assign({},this.context),{message:i,content:null!=e?e:void 0,level:s(t),"@timestamp":this.now()});"string"!=typeof e||i||(n.message=e,delete n.content),this.logger.write(t,n)}}function s(e){switch(e){case n.xk.Debug:return"debug";case n.xk.Info:return"information";case n.xk.Warning:return"warning";case n.xk.Error:return"error";default:return`${e}`}}const o=(0,i(78991).ol)({debug(e,t){},info(e,t){},warn(e,t){},error(e,t){},panic(e,t){throw"string"!=typeof e||t?new Error(t):new Error(e)}});function a(e,t,i){e.warning({method:t,context:i,provider:"tools/log",message:"Semantic logging enabled. 🦟 Please report this bug if you see it 🦟"})}function l(e){return o}function c(e,t){return t.length&&a(e,"enableLogForTypes",{types:t}),function(i){const{type:n}=i;if("string"==typeof n&&t.includes(n)){const s=new r(e,i);return a(e,"enableLogForTypes",{targetType:n,available:t,loggerContext:i}),s}return o}}function d(e,t,i){if(e){const e=new r(t,i);return a(t,"ifEnabledSemanticLoggerProvider",i),e}return o}},20246(e,t,i){"use strict";i.d(t,{B:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;super(e),this.toDelete=!1,this.sponsoringOrganizationUserId=this.getResponseProperty("SponsoringOrganizationUserId"),this.friendlyName=this.getResponseProperty("FriendlyName"),this.offeredToEmail=this.getResponseProperty("OfferedToEmail"),this.planSponsorshipType=this.getResponseProperty("PlanSponsorshipType"),this.lastSyncDate=this.getResponseProperty("LastSyncDate"),this.validUntil=this.getResponseProperty("ValidUntil"),this.toDelete=null!==(t=this.getResponseProperty("ToDelete"))&&void 0!==t&&t,this.isAdminInitiated=this.getResponseProperty("IsAdminInitiated"),this.notes=this.getResponseProperty("Notes"),this.statusMessage=this.getResponseProperty("StatusMessage"),this.statusClass=this.getResponseProperty("StatusClass")}}},20266(e,t,i){"use strict";i.d(t,{m:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 66.67">
    <path class="tw-fill-illustration-bg-secondary" d="M13.333 15a5 5 0 0 1 5-5H75a5 5 0 0 1 5 5v40a5 5 0 0 1-5 5H18.333a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 11.667H18.333A3.333 3.333 0 0 0 15 15v40a3.333 3.333 0 0 0 3.333 3.333H75A3.333 3.333 0 0 0 78.333 55V15A3.333 3.333 0 0 0 75 11.667ZM18.333 10a5 5 0 0 0-5 5v40a5 5 0 0 0 5 5H75a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5H18.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M79.167 20h-65v-1.667h65V20Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M76.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0ZM71.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0ZM66.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Z"/>
    <path class="tw-fill-illustration-tertiary" d="M15 37.5a6.667 6.667 0 0 1 6.667-6.667H65a6.667 6.667 0 0 1 6.667 6.667v3.333A6.667 6.667 0 0 1 65 47.5H21.667A6.667 6.667 0 0 1 15 40.833V37.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 32.5H21.667a5 5 0 0 0-5 5v3.333a5 5 0 0 0 5 5H65a5 5 0 0 0 5-5V37.5a5 5 0 0 0-5-5Zm-43.333-1.667A6.667 6.667 0 0 0 15 37.5v3.333a6.667 6.667 0 0 0 6.667 6.667H65a6.667 6.667 0 0 0 6.667-6.667V37.5A6.667 6.667 0 0 0 65 30.833H21.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.167 40.834v-3.137l-2.333 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.334-.197 2.333-4.665a1.667 1.667 0 0 0-2.332 1.528v3.137Zm5-3.137a3.333 3.333 0 0 0-6.666 0v3.334a3.333 3.333 0 0 0 6.666 0V37.5Zm6.667.197v3.137a1.667 1.667 0 0 1-2.332 1.528l2.332-4.665Zm-1-1.725-2.333 4.665V37.5a1.667 1.667 0 0 1 2.332-1.528Zm-.667-1.805a3.333 3.333 0 0 1 3.334 3.333v3.334a3.333 3.333 0 1 1-6.667 0V37.5a3.333 3.333 0 0 1 3.333-3.333Zm10 6.667v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.333-.197 2.333-4.665A1.667 1.667 0 0 0 37.5 37.5v3.137Zm5-3.137a3.333 3.333 0 0 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Zm6.667.197v3.137a1.667 1.667 0 0 1-2.333 1.528l2.333-4.665Zm-1.001-1.725-2.333 4.665V37.5a1.667 1.667 0 0 1 2.333-1.528Zm-.666-1.805a3.333 3.333 0 0 1 3.333 3.333v3.334a3.333 3.333 0 0 1-6.666 0V37.5a3.333 3.333 0 0 1 3.333-3.333Zm10 6.667v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.333-1.528Zm-3.333-.197 2.332-4.665a1.667 1.667 0 0 0-2.333 1.528v3.137Zm5-3.137a3.333 3.333 0 1 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Zm6.666 3.334v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.333-.197 2.333-4.665A1.667 1.667 0 0 0 62.5 37.5v3.137Zm5-3.137a3.333 3.333 0 0 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 23.333a5 5 0 0 1 5-5h24.167a5 5 0 0 1 5 5v48.333a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V23.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 20H5a3.333 3.333 0 0 0-3.333 3.333v48.333A3.333 3.333 0 0 0 5 75h24.167a3.333 3.333 0 0 0 3.333-3.334V23.333A3.333 3.333 0 0 0 29.167 20ZM5 18.333a5 5 0 0 0-5 5v48.333a5 5 0 0 0 5 5h24.167a5 5 0 0 0 5-5V23.333a5 5 0 0 0-5-5H5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.667 33.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM12.083 35a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.667 33.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM12.083 35a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.667 42.917a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm2.083 1.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.667 42.917a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm2.083 1.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M13.333 23.333c0-.46.373-.833.834-.833H20a.833.833 0 1 1 0 1.667h-5.833a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M16.25 54.166a7.083 7.083 0 1 0 7.083 7.084 1.667 1.667 0 1 1 3.334 0c0 5.753-4.664 10.416-10.417 10.416S5.833 67.003 5.833 61.25s4.664-10.417 10.417-10.417a1.667 1.667 0 1 1 0 3.333Z" clip-rule="evenodd"/>
  </svg>
`},20377(e,t,i){"use strict";i.d(t,{E:()=>E,Gc:()=>S,LA:()=>B,Zm:()=>T,bt:()=>Q,eO:()=>I,pP:()=>b,y_:()=>k});var n=i(72737),r=i(45505),s=i(56986),o=i(61687),a=i(88507),l=i(21991),c=i(34040),d=i(11891),u=i(69194),h=i(14928),A=i(43219),p=i(3204),g=i(39444),v=i(21588),f=i(12610),m=i(14803),y=i(8131);function C(e){return e}function w(e,t){return{expectedValue:e,actualValue:t}}function I(e=C,t=w){return(0,r.F)((0,f.Z)(null),(0,g.J)(),(0,p.T)(([i,n],r)=>{if(0===r)return n;const s=e(i),o=e(n);if(s===o)return n;throw t(s,o)}))}function b(e,t){return(0,p.T)(i=>(null!=i?i:[]).reduce(e,structuredClone(t)))}function B(){return(0,c.F)((e,t)=>{let i=!0;for(const n in t)i&&(i=e[n]===t[n]);return i})}function E(e){if(Array.isArray(e)){const t=e.filter(e=>!!e).map(e=>e.pipe((0,A.w)(),(0,d.q)(!0)));return(0,o.O)(t)}return e.pipe((0,A.w)(),(0,d.q)(!0))}function S(e){const t=Array.isArray(e)?e:[e];return(0,r.F)((0,l.N)(e=>{const i=new n.m(1);return e.subscribe(i),(0,s.x)((0,a.y)(t).pipe((0,h.$)(),(0,A.w)()),i).pipe((0,m.Q)(E(i)))}))}function Q(...e){return(0,l.N)(t=>{const i=new n.m(1);t.subscribe(i);const r=e.map(e=>{const t=new n.m(1);return e.subscribe(t),t});return(0,s.x)((0,a.y)(r).pipe((0,h.$)(),(0,A.w)()),i).pipe((0,y.E)(...r),(0,m.Q)(E(i)))})}function k(e){return(0,r.F)((null==e?void 0:e.distinct)?(0,c.F)(e.distinct):e=>e,(0,p.T)((t,i)=>{var n,r;if(i>0)throw new Error(`${null!==(r=null===(n=null==e?void 0:e.name)||void 0===n?void 0:n.call(e))&&void 0!==r?r:"unknown"} observable should only emit one value.`);return t}))}function T(e,t){return(0,r.F)((0,v.S)(([i],n)=>{var r,s,o,a;const l=null!==(s=null===(r=null==t?void 0:t.key)||void 0===r?void 0:r.call(t,n))&&void 0!==s?s:n;let c=null==i?void 0:i.get(l);if(c)return[i,c];c=e(n),null==i||i.set(l,c);const d=i.size-(null!==(o=null==t?void 0:t.size)&&void 0!==o?o:1);return d>0&&Array.from(null!==(a=null==i?void 0:i.keys())&&void 0!==a?a:[]).slice(0,d).forEach(e=>null==i?void 0:i.delete(e)),[i,c]},[new Map,null]),(0,p.T)(([,e])=>e),(0,u.p)(e=>!!e))}},20702(e,t,i){"use strict";i.d(t,{r:()=>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]}}},20798(e,t,i){"use strict";i.d(t,{K:()=>n.K});var n=i(86561)},21001(e,t,i){"use strict";i.d(t,{HQ:()=>r,bg:()=>n});const n=Object.freeze({JIT_PROVISIONED_MP_ORG_USER:"jit_provisioned_mp_org_user",TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP:"tde_org_user_reset_password_permission_requires_mp",OFFBOARDED_TDE_ORG_USER:"offboarded_tde_org_user",OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE:"offboarded_tde_org_user_untrusted_device"});class r{}},21495(e,t,i){"use strict";i.d(t,{F:()=>n.F});var n=i(36801)},21551(e,t,i){"use strict";var n;i.d(t,{zq:()=>s,EO:()=>n,g2:()=>a,Cc:()=>d,Kg:()=>l,wH:()=>u}),function(e){e.Local="local",e.Memory="memory",e.Session="session"}(n||(n={}));var r=i(66046);class s{}var o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends s{constructor(){super(...arguments),this.store=new Map,this.updatesSubject=new r.B}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 o(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()}}var l,c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends s{constructor(){super(...arguments),this.store={},this.updatesSubject=new r.B}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 c(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()}}!function(e){e.Both="both",e.Disk="disk",e.Memory="memory"}(l||(l={}));class u{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}`)}}}},21587(e,t,i){"use strict";i.d(t,{P:()=>q});var n=i(94573),r=i(51757),s=i(66046),o=i(93695),a=i(3204),l=i(12610),c=i(14803),d=i(56962),u=i(78781),h=i(79783),A=i(25065),p=i(45482),g=i(14055),v=i(32287),f=i(33812),m=i(50700),y=i(69855),C=i(85800),w=i(63581),I=i(44432),b=i(86226),B=i(97553),E=i(43759),S=i(24374),Q=i(17721),k=i(33886),T=i(68923),F=i(58806),P=i(77468),R=i(25740),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const M=(e,t)=>t.value;function x(e,t){1&e&&(f.j41(0,"h5",2),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.JRh(f.bMT(2,1,"paymentMethod")))}function O(e,t){1&e&&(f.j41(0,"bit-radio-button",7)(1,"bit-label"),f.nrm(2,"i",11),f.EFF(3),f.nI1(4,"i18n"),f.k0s()()),2&e&&(f.Y8G("value","bankAccount"),f.R7$(3),f.SpI(" ",f.bMT(4,2,"bankAccount")," "))}function G(e,t){1&e&&(f.j41(0,"bit-radio-button",8)(1,"bit-label"),f.nrm(2,"i",12),f.EFF(3),f.nI1(4,"i18n"),f.k0s()()),2&e&&(f.Y8G("value","payPal"),f.R7$(3),f.SpI(" ",f.bMT(4,2,"payPal")," "))}function U(e,t){1&e&&(f.j41(0,"bit-radio-button",9)(1,"bit-label"),f.nrm(2,"i",13),f.EFF(3),f.nI1(4,"i18n"),f.k0s()()),2&e&&(f.Y8G("value","accountCredit"),f.R7$(3),f.SpI(" ",f.bMT(4,2,"accountCredit")," "))}function V(e,t){if(1&e&&(f.j41(0,"div",10)(1,"div",14)(2,"app-payment-label",15),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.nrm(5,"div",16),f.k0s(),f.j41(6,"div",17),f.nrm(7,"img",18),f.k0s(),f.j41(8,"div",14)(9,"app-payment-label",15),f.EFF(10),f.nI1(11,"i18n"),f.k0s(),f.nrm(12,"div",16),f.k0s(),f.j41(13,"div",14)(14,"app-payment-label",15),f.EFF(15),f.nI1(16,"i18n"),f.j41(17,"button",19),f.nrm(18,"i",20),f.k0s(),f.j41(19,"bit-popover",21,0),f.nI1(21,"i18n"),f.j41(22,"p",22),f.EFF(23),f.nI1(24,"i18n"),f.k0s()()(),f.nrm(25,"div",16),f.k0s()()),2&e){const e=f.sdS(20),t=f.XpG();f.R7$(2),f.Y8G("for","stripe-card-number-"+t.instanceId),f.R7$(),f.SpI(" ",f.bMT(4,13,"cardNumberLabel")," "),f.R7$(2),f.Y8G("id","stripe-card-number-"+t.instanceId),f.R7$(4),f.Y8G("for","stripe-card-expiry-"+t.instanceId),f.R7$(),f.SpI(" ",f.bMT(11,15,"expiration")," "),f.R7$(2),f.Y8G("id","stripe-card-expiry-"+t.instanceId),f.R7$(2),f.Y8G("for","stripe-card-cvc-"+t.instanceId),f.R7$(),f.SpI(" ",f.bMT(16,17,"securityCodeSlashCVV")," "),f.R7$(2),f.Y8G("bitPopoverTriggerFor",e)("position","above-end"),f.R7$(2),f.Y8G("title",f.bMT(21,19,"cardSecurityCode")),f.R7$(4),f.JRh(f.bMT(24,21,"cardSecurityCodeDescription")),f.R7$(2),f.Y8G("id","stripe-card-cvc-"+t.instanceId)}}function j(e,t){if(1&e&&(f.qex(0),f.j41(1,"bit-callout",23),f.nI1(2,"i18n"),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.j41(5,"div",24)(6,"bit-form-field",25)(7,"bit-label"),f.EFF(8),f.nI1(9,"i18n"),f.k0s(),f.nrm(10,"input",26),f.k0s(),f.j41(11,"bit-form-field",25)(12,"bit-label"),f.EFF(13),f.nI1(14,"i18n"),f.k0s(),f.nrm(15,"input",27),f.k0s(),f.j41(16,"bit-form-field",25)(17,"bit-label"),f.EFF(18),f.nI1(19,"i18n"),f.k0s(),f.nrm(20,"input",28),f.k0s(),f.j41(21,"bit-form-field",25)(22,"bit-label"),f.EFF(23),f.nI1(24,"i18n"),f.k0s(),f.j41(25,"bit-select",29),f.nrm(26,"bit-option",30),f.nI1(27,"i18n"),f.nrm(28,"bit-option",30),f.nI1(29,"i18n"),f.nrm(30,"bit-option",30),f.nI1(31,"i18n"),f.k0s()()(),f.bVm()),2&e){const e=f.XpG();f.R7$(),f.Y8G("title",f.mNQ(f.bMT(2,24,"verifyBankAccount"))),f.R7$(2),f.SpI(" ",f.bMT(4,26,"requiredToVerifyBankAccountWithStripe")," "),f.R7$(3),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(9,28,"routingNumber")),f.R7$(2),f.Y8G("formControl",e.group().controls.bankAccount.controls.routingNumber),f.R7$(),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(14,30,"accountNumber")),f.R7$(2),f.Y8G("formControl",e.group().controls.bankAccount.controls.accountNumber),f.R7$(),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(19,32,"accountHolderName")),f.R7$(2),f.Y8G("formControl",e.group().controls.bankAccount.controls.accountHolderName),f.R7$(),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(24,34,"bankAccountType")),f.R7$(2),f.Y8G("formControl",e.group().controls.bankAccount.controls.accountHolderType),f.R7$(),f.Y8G("label",f.VkB("-- ",f.bMT(27,36,"select")," --"))("value",""),f.R7$(2),f.Y8G("label",f.mNQ(f.bMT(29,38,"bankAccountTypeCompany")))("value","company"),f.R7$(2),f.Y8G("label",f.mNQ(f.bMT(31,40,"bankAccountTypeIndividual")))("value","individual")}}function N(e,t){1&e&&(f.qex(0),f.j41(1,"div",31),f.nrm(2,"div",32),f.j41(3,"small",33),f.EFF(4),f.nI1(5,"i18n"),f.k0s()(),f.bVm()),2&e&&(f.R7$(4),f.JRh(f.bMT(5,1,"paypalClickSubmit")))}function z(e,t){1&e&&(f.j41(0,"bit-callout",34),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.SpI(" ",f.bMT(2,1,"makeSureEnoughCredit")," "))}function Y(e,t){1&e&&(f.j41(0,"bit-callout",35),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.SpI(" ",f.bMT(2,1,"notEnoughAccountCredit")," "))}function L(e,t){if(1&e&&(f.qex(0),f.nVh(1,z,3,3,"bit-callout",34)(2,Y,3,3,"bit-callout",35),f.bVm()),2&e){const e=f.XpG();f.R7$(),f.vxM(e.hasEnoughAccountCredit()?1:2)}}function K(e,t){if(1&e&&f.nrm(0,"bit-option",40),2&e){const e=t.$implicit;f.Y8G("value",e.value)("disabled",e.disabled)("label",e.name)}}function X(e,t){if(1&e&&(f.j41(0,"h5",36),f.EFF(1),f.nI1(2,"i18n"),f.k0s(),f.j41(3,"div",37)(4,"div",38)(5,"bit-form-field",39)(6,"bit-label"),f.EFF(7),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"bit-select",4),f.Z7z(10,K,1,3,"bit-option",40,M),f.k0s()()(),f.j41(12,"div",38)(13,"bit-form-field",39)(14,"bit-label"),f.EFF(15),f.nI1(16,"i18n"),f.k0s(),f.nrm(17,"input",41),f.k0s()()()),2&e){const e=f.XpG();f.R7$(),f.JRh(f.bMT(2,7,"billingAddress")),f.R7$(4),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(8,9,"country")),f.R7$(2),f.Y8G("formControl",e.group().controls.billingAddress.controls.country),f.R7$(),f.Dyx(e.selectableCountries),f.R7$(3),f.Y8G("disableMargin",!0),f.R7$(2),f.JRh(f.bMT(16,11,"zipPostalCodeLabel")),f.R7$(2),f.Y8G("formControl",e.group().controls.billingAddress.controls.postalCode)}}class q{constructor(e,t,i,r,o){this.braintreeService=e,this.i18nService=t,this.logService=i,this.stripeService=r,this.toastService=o,this.instanceId=u.A.newGuid(),this.group=n.hFB.required(),this.showBankAccount=(0,n.hFB)(!0),this.showPayPal=(0,n.hFB)(!0),this.showAccountCredit=(0,n.hFB)(!1),this.hasEnoughAccountCredit=(0,n.hFB)(!0),this.includeBillingAddress=(0,n.hFB)(!1),this.selectableCountries=g.Lx,this.destroy$=new s.B,this.select=e=>this.group().controls.type.patchValue(e),this.tokenize=()=>D(this,void 0,void 0,function*(){const e=e=>D(this,void 0,void 0,function*(){switch(e){case"bankAccount":{if(this.group().controls.bankAccount.markAllAsTouched(),!this.group().controls.bankAccount.valid)throw new Error("Attempted to tokenize invalid bank account information.");const e=this.group().controls.bankAccount.getRawValue(),t=yield this.stripeService.createSetupIntent("bankAccount"),i=this.group().controls.billingAddress.enabled?this.group().controls.billingAddress.getRawValue():void 0;return yield this.stripeService.setupBankAccountPaymentMethod(t,e,i)}case"card":{const e=yield this.stripeService.createSetupIntent("card"),t=this.group().controls.billingAddress.enabled?this.group().controls.billingAddress.getRawValue():void 0;return this.stripeService.setupCardPaymentMethod(this.instanceId,e,t)}case"payPal":return this.braintreeService.requestPaymentMethod()}});if(!(0,g.w$)(this.selected))throw new Error(`Attempted to tokenize a non-tokenizable payment method: ${this.selected}`);try{const t=yield e(this.selected);return{type:this.selected,token:t}}catch(t){if(t){switch(this.logService.error(t),this.selected){case"card":return"object"==typeof t&&"message"in t&&"string"==typeof t.message&&this.toastService.showToast({variant:"error",title:"",message:t.message}),null;case"payPal":if("string"==typeof t&&"No payment method is available."===t)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("clickPayWithPayPal")}),null}throw t}return null}}),this.validate=()=>"bankAccount"!==this.selected||(this.group().controls.bankAccount.markAllAsTouched(),this.group().controls.bankAccount.valid)}ngOnInit(){this.stripeService.loadStripe(this.instanceId,{cardNumber:`#stripe-card-number-${this.instanceId}`,cardExpiry:`#stripe-card-expiry-${this.instanceId}`,cardCvc:`#stripe-card-cvc-${this.instanceId}`},!0),this.showPayPal()&&this.braintreeService.loadBraintree("#braintree-container",!1),this.includeBillingAddress()?(this.group().controls.billingAddress.patchValue({country:"US"}),this.showBankAccount$=this.group().controls.billingAddress.controls.country.valueChanges.pipe((0,l.Z)(this.group().controls.billingAddress.controls.country.value),(0,a.T)(e=>this.showBankAccount()&&"US"===e))):(this.showBankAccount$=(0,o.of)(this.showBankAccount()),this.group().controls.billingAddress.disable()),this.group().controls.type.valueChanges.pipe((0,l.Z)(this.group().controls.type.value),(0,c.Q)(this.destroy$)).subscribe(e=>{if("bankAccount"===e)this.group().controls.bankAccount.enable(),this.includeBillingAddress()&&this.group().controls.billingAddress.enable();else{switch(e){case"card":this.stripeService.mountElements(this.instanceId),this.includeBillingAddress()&&this.group().controls.billingAddress.enable();break;case"payPal":this.braintreeService.createDropin(),this.includeBillingAddress()&&this.group().controls.billingAddress.disable()}this.group().controls.bankAccount.disable()}}),this.showBankAccount$.pipe((0,c.Q)(this.destroy$)).subscribe(e=>{e||"bankAccount"!==this.selected||this.select("card")})}ngOnDestroy(){this.stripeService.unloadStripe(this.instanceId),this.destroy$.next(),this.destroy$.complete()}get selected(){return this.group().value.type}}q.getFormGroup=()=>new r.gE({type:new r.MJ("card",{nonNullable:!0}),bankAccount:new r.gE({routingNumber:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountNumber:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountHolderName:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountHolderType:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]})}),billingAddress:new r.gE({country:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),postalCode:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]})})}),q.ɵfac=function(e){return new(e||q)(f.rXU(p.qb),f.rXU(m.W),f.rXU(d.K),f.rXU(p.d$),f.rXU(y.f))},q.ɵcmp=f.VBU({type:q,selectors:[["app-enter-payment-method"]],inputs:{group:[1,"group"],showBankAccount:[1,"showBankAccount"],showPayPal:[1,"showPayPal"],showAccountCredit:[1,"showAccountCredit"],hasEnoughAccountCredit:[1,"hasEnoughAccountCredit"],includeBillingAddress:[1,"includeBillingAddress"]},decls:18,vars:14,consts:[["cardSecurityCodePopover",""],[3,"formGroup"],["bitTypography","h5"],[1,"tw-mb-4","tw-text-lg"],[3,"formControl"],["id","card-payment-method",3,"value"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-credit-card"],["id","bank-payment-method",3,"value"],["id","paypal-payment-method",3,"value"],["id","credit-payment-method",3,"value"],[1,"tw-grid","tw-grid-cols-2","tw-gap-4","tw-mb-4"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-billing"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paypal"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-dollar"],[1,"tw-col-span-1"],["required","",3,"for"],[1,"tw-stripe-form-control",3,"id"],[1,"tw-col-span-1","tw-flex","tw-items-end"],["src","../../../images/cards.png","alt","Visa, MasterCard, Discover, AmEx, JCB, Diners Club, UnionPay",1,"tw-max-w-full"],["type","button",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-pr-1",3,"bitPopoverTriggerFor","position"],["aria-hidden","true",1,"bwi","bwi-question-circle","tw-text-sm"],[3,"title"],[1,"tw-mb-0"],["type","warning",3,"title"],["formGroupName","bankAccount",1,"tw-grid","tw-grid-cols-2","tw-gap-4","tw-mb-4"],[1,"tw-col-span-1",3,"disableMargin"],["bitInput","","id","routingNumber","type","text","required","",3,"formControl"],["bitInput","","id","accountNumber","type","text","required","",3,"formControl"],["id","accountHolderName","bitInput","","type","text","required","",3,"formControl"],["id","accountHolderType","required","",3,"formControl"],[3,"value","label"],[1,"tw-mb-3"],["id","braintree-container",1,"tw-mb-1","tw-content-center"],[1,"tw-text-muted"],["type","info"],["type","warning"],["bitTypography","h5",1,"tw-pt-4"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],[3,"disableMargin"],[3,"value","disabled","label"],["bitInput","","type","text","autocomplete","postal-code",3,"formControl"]],template:function(e,t){if(1&e&&(f.j41(0,"form",1),f.nVh(1,x,3,3,"h5",2),f.j41(2,"div",3)(3,"bit-radio-group",4)(4,"bit-radio-button",5)(5,"bit-label"),f.nrm(6,"i",6),f.EFF(7),f.nI1(8,"i18n"),f.k0s()(),f.nVh(9,O,5,4,"bit-radio-button",7),f.nI1(10,"async"),f.nVh(11,G,5,4,"bit-radio-button",8),f.nVh(12,U,5,4,"bit-radio-button",9),f.k0s()(),f.nVh(13,V,26,23,"div",10)(14,j,32,42,"ng-container")(15,N,6,3,"ng-container")(16,L,3,1,"ng-container"),f.nVh(17,X,18,13),f.k0s()),2&e){let e;const i=t.includeBillingAddress()&&"payPal"!==t.selected;f.Y8G("formGroup",t.group()),f.R7$(),f.vxM(i?1:-1),f.R7$(2),f.Y8G("formControl",t.group().controls.type),f.R7$(),f.Y8G("value","card"),f.R7$(3),f.SpI(" ",f.bMT(8,10,"creditCard")," "),f.R7$(2),f.vxM(f.bMT(10,12,t.showBankAccount$)?9:-1),f.R7$(2),f.vxM(t.showPayPal()?11:-1),f.R7$(),f.vxM(t.showAccountCredit()?12:-1),f.R7$(),f.vxM("card"===(e=t.selected)?13:"bankAccount"===e?14:"payPal"===e?15:"accountCredit"===e?16:-1),f.R7$(4),f.vxM(i?17:-1)}},dependencies:[p.IJ,v.m,h.k,C.r,w.k,A.G,r.qT,r.me,r.BC,r.cb,r.YS,r.l_,r.j4,r.$R,I.G,b.j,B.J,E.h,S.d,Q.Y,k.w,T.P,F.r,P.Jj,R.$],encapsulation:2,changeDetection:0})},21590(e,t,i){"use strict";i.d(t,{d:()=>u});var n=i(33338),r=i(56986),s=i(83892),o=i(93695),a=i(73276),l=i(69194),c=i(3204),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e,t,i,u=null){this.key=t,this.output=i,this.bufferedState=e.getUser(i.userId,t.toKeyDefinition());const h=(0,r.x)((0,o.of)(null),this.bufferedState.state$).pipe((0,c.T)(e=>null!==(null!=e?e:null))),A=(null!=u?u:(0,o.of)(!0)).pipe((0,c.T)(e=>[t.shouldOverwrite(e),e])),p=(0,n.z)([h,A]).pipe((0,a.H)(e=>d(this,[e],void 0,function*([e,[t,i]]){return e&&t&&(yield this.overwriteOutput(i)),[!1,null]}))),g=this.output.state$.pipe((0,c.T)(e=>[!0,e]));this.state$=(0,s.h)(p,g).pipe((0,l.p)(([e])=>e),(0,c.T)(([,e])=>e)),this.combinedState$=this.state$.pipe((0,c.T)(e=>[this.output.userId,e])),this.bufferedState$=this.bufferedState.state$}overwriteOutput(e){return d(this,void 0,void 0,function*(){let t;yield this.bufferedState.update(e=>(t=null!=e?e:null,null));if(yield this.key.isValid(t,e)){const i=yield this.key.map(t,e);yield this.output.update(()=>i)}})}get userId(){return this.output.userId}buffer(e){return d(this,void 0,void 0,function*(){const t=null!=e?e:null;null!==t&&(yield this.bufferedState.update(()=>t))})}update(e,t=null){return this.output.update(e,t)}}},21823(e,t,i){"use strict";i.d(t,{G:()=>A});var n=i(74208),r=i(33277),s=i(83731),o=i(16878),a=i(36006),l=i(14928),c=i(3204),d=i(21879),u=i(9396);const h=new d.Zs(d.cj,"side-nav-width",{deserializer:e=>e});class A{constructor(){this.DEFAULT_OPEN_WIDTH=18,this.MIN_OPEN_WIDTH=15,this.MAX_OPEN_WIDTH=24,this.open=(0,n.vPA)(!1),this.isPushMode=(0,n.vPA)(!1),this.isOverlay=(0,r.EW)(()=>this.open()&&!this.isPushMode()),this.userCollapsePreference=(0,n.vPA)(null),this._width$=new o.t(this.DEFAULT_OPEN_WIDTH),this.width$=this._width$.asObservable(),this.widthRem=(0,s.ot)(this.width$,{initialValue:this.DEFAULT_OPEN_WIDTH}),this.widthState=(0,n.WQX)(d.Y2).get(h),this.widthState$=this.widthState.state$.pipe((0,c.T)(e=>null!=e?e:this.DEFAULT_OPEN_WIDTH)),this.rootFontSizePx=(0,u.T)(),this.widthState$.pipe((0,l.$)()).subscribe(e=>{this._width$.next(e)}),this.width$.pipe((0,a.B)(200),(0,s.pQ)()).subscribe(e=>{this.widthState.update(()=>e)})}toggle(){this.userCollapsePreference.set(this.open()?"closed":"open"),this.open.set(!this.open())}setWidthFromDrag(e,t){const i=(e-t)/this.rootFontSizePx;this._setWidthWithinMinMax(i)}setWidthFromKeys(e){const t=this._width$.getValue()+("ArrowLeft"===e?-1:1);this._setWidthWithinMinMax(t)}_setWidthWithinMinMax(e){const t=Math.min(Math.max(e,this.MIN_OPEN_WIDTH),this.MAX_OPEN_WIDTH);this._width$.next(t)}}A.ɵfac=function(e){return new(e||A)},A.ɵprov=n.jDH({token:A,factory:A.ɵfac,providedIn:"root"})},21879(e,t,i){"use strict";i.d(t,{ie:()=>E,dn:()=>S,dp:()=>H,Vl:()=>W,vZ:()=>I,wt:()=>Q,Md:()=>a,O2:()=>X,Iw:()=>be,Cg:()=>b,g:()=>B,rB:()=>Pe,cj:()=>$,fn:()=>Ce,HR:()=>we,Xk:()=>Ie,Z9:()=>J,PM:()=>he,xS:()=>Ae,Z6:()=>Z,Gg:()=>xe,Gd:()=>Oe,V_:()=>ao,BA:()=>w,eP:()=>k,XH:()=>q,w8:()=>n,K8:()=>Re,ww:()=>_,Wm:()=>ee,Qb:()=>ce,OB:()=>oe,Rv:()=>pe,jx:()=>ge,qd:()=>ae,kj:()=>le,Y2:()=>s,hs:()=>te,P7:()=>Ge,_Q:()=>Ue,Zs:()=>d,d1:()=>T,jB:()=>F,Gm:()=>P,Br:()=>R,Tf:()=>D,y7:()=>M,Nb:()=>Ao,i9:()=>Ee,bI:()=>Se,nr:()=>f,fK:()=>L,ll:()=>C,EF:()=>De,aL:()=>Me,jb:()=>m,L_:()=>y,Sc:()=>x,k2:()=>Be,Mc:()=>N,bj:()=>de,$g:()=>ue,q9:()=>Qe,iy:()=>O,aC:()=>G,W$:()=>ie,Ys:()=>o,zU:()=>v,iO:()=>Ve,lR:()=>g,v2:()=>r,dw:()=>go,dD:()=>ne,uv:()=>U,MC:()=>V,oR:()=>j,Ud:()=>re,bh:()=>z,xu:()=>Y,Ok:()=>p,gc:()=>Te,km:()=>ve,iK:()=>fe,s2:()=>ye,Jb:()=>me,dr:()=>K,b4:()=>ke,g4:()=>se,yh:()=>Fe,yT:()=>lo,YO:()=>co,GR:()=>uo});class n{}class r{}class s{}class o{}class a{}function l(e){return t=>null==t?null:t.map(t=>e(t))}function c(e){return t=>{if(null==t)return null;const i={};return Object.entries(t).forEach(([t,n])=>{i[t]=e(n)}),i}}class d{constructor(e,t,i){var n;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 or equal to 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `);const{enableUpdateLogging:r=!1,enableRetrievalLogging:s=!1}=null!==(n=i.debug)&&void 0!==n?n:{};this.debug={enableUpdateLogging:r,enableRetrievalLogging:s}}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 d(e,t,Object.assign(Object.assign({},i),{deserializer:l(e=>i.deserializer(e))}))}static record(e,t,i){return new d(e,t,Object.assign(Object.assign({},i),{deserializer:c(e=>i.deserializer(e))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}get errorKeyName(){return`${this.stateDefinition.name} > ${this.key}`}}var u,h=i(53323);const A=Symbol("UserKeyDefinition");class p{constructor(e,t,i){var n;if(this.stateDefinition=e,this.key=t,this.options=i,this[u]=!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 or equal to 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `);this.clearOn=Array.from(new Set(i.clearOn));const{enableUpdateLogging:r=!1,enableRetrievalLogging:s=!1}=null!==(n=i.debug)&&void 0!==n?n:{};this.debug={enableUpdateLogging:r,enableRetrievalLogging:s}}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 p(e,t,Object.assign(Object.assign({},i),{deserializer:l(e=>i.deserializer(e))}))}static record(e,t,i){return new p(e,t,Object.assign(Object.assign({},i),{deserializer:c(e=>i.deserializer(e))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}buildKey(e){if(!(0,h.W_)(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}`}}u=A;class g{}Symbol("active");class v{constructor(e,t,i){this.name=e,this.defaultStorageLocation=t,this.storageLocationOverrides=null!=i?i:{}}}const f=new v("organizations","disk"),m=new v("policies","disk"),y=new v("providers","disk"),C=new v("organizationManagementPreferences","disk",{web:"disk-local"}),w=new v("showDeleteManagedUserWarning","disk",{web:"disk-local"}),I=new v("autoConfirm","disk",{web:"disk-local"}),b=new v("billing","disk"),B=new v("billing","memory"),E=new v("account","disk"),S=(new v("account","memory"),new v("authRequestLocal","disk",{web:"disk-local"})),Q=new v("avatar","disk",{web:"disk-local"}),k=new v("deviceTrust","disk",{web:"disk-local",browser:"disk-backup-local-storage"}),T=new v("loginEmail","disk",{web:"disk-local"}),F=new v("loginEmail","memory"),P=new v("loginStrategy","memory"),R=new v("masterPassword","disk"),D=new v("masterPassword","memory"),M=new v("masterPasswordUnlock","disk"),x=new v("router","disk"),O=new v("ssoLogin","disk"),G=new v("ssoLoginLocal","disk",{web:"disk-local"}),U=new v("token","disk"),V=new v("tokenDiskLocal","disk",{web:"disk-local"}),j=new v("token","memory"),N=new v("sendAccess","disk"),z=new v("twoFactor","memory"),Y=new v("userDecryptionOptions","disk"),L=new v("organizationInvite","disk"),K=new v("vaultTimeoutSettings","disk",{web:"disk-local"}),X=new v("badgeSettings","disk"),q=(new v("userNotificationSettings","disk"),new v("domainSettings","disk")),H=new v("autofillSettings","disk"),W=new v("autofillSettingsLocal","disk",{web:"disk-local"}),$=(new v("autotypeSettings","disk"),new v("newWebLayoutBanner","disk",{web:"disk-local"}),new v("bitSideNav","disk")),J=(new v("phishingDetection","disk"),new v("applicationId","disk",{web:"disk-local"}),new v("clearEvent","disk")),Z=new v("config","disk",{web:"disk-local"}),_=(new v("desktopSettings","disk"),new v("environment","disk")),ee=new v("environment","memory"),te=new v("interProcessCommunication","memory"),ie=(new v("popupView","memory",{browser:"memory-large-object"}),new v("sync","disk",{web:"memory"})),ne=new v("theming","disk",{web:"disk-local"}),re=new v("translation","disk",{web:"disk-local"}),se=(new v("animation","disk"),new v("taskScheduler","disk"),new v("extensionInitialInstall","disk"),new v("webPushSubscription","disk",{web:"disk-local"})),oe=(new v("serverCommunicationConfig","disk"),new v("popupStyle","disk"),new v("smOnboarding","disk",{web:"disk-local"}),new v("extension","disk")),ae=new v("generator","disk"),le=new v("generator","memory"),ce=(new v("sendBrowser","memory"),new v("eventCollection","disk")),de=new v("encryptedSend","disk",{web:"memory"}),ue=new v("decryptedSend","memory",{browser:"memory-large-object"}),he=(new v("sendAccessAuth","memory"),new v("collection","disk",{web:"memory"})),Ae=new v("decryptedCollections","memory",{browser:"memory-large-object"}),pe=new v("folder","disk",{web:"memory"}),ge=new v("decryptedFolders","memory",{browser:"memory-large-object"}),ve=new v("vaultFilter","disk",{web:"disk-local"}),fe=new v("vaultOnboarding","disk",{web:"disk-local"}),me=new v("vaultSettings","disk",{web:"disk-local"}),ye=(new v("vaultBrowser","memory",{browser:"memory-large-object"}),new v("vaultSearch","memory",{browser:"memory-large-object"})),Ce=new v("ciphers","disk",{web:"memory"}),we=new v("ciphersLocal","disk",{web:"disk-local"}),Ie=new v("ciphersMemory","memory",{browser:"memory-large-object"}),be=new v("bannersDismissed","disk"),Be=(new v("vaultAppearance","disk"),new v("securityTasks","disk")),Ee=(new v("atRiskPasswordsPage","disk"),new v("notifications","disk")),Se=new v("nudges","disk",{web:"disk-local"}),Qe=new v("setupExtensionDismissed","disk",{web:"disk-local"}),ke=new v("vaultWelcomeDialog","disk",{web:"disk-local"}),Te=(new v("vaultBrowserIntroCarousel","disk"),new v("vaultAutofillSimplifiedIcon","disk"),new v("vaultAtRiskPasswords","memory")),Fe=new v("vaultWelcomeExtensionDialogDismissed","disk",{web:"disk-local"}),Pe=new v("biometricSettings","disk"),Re=new v("encryptedMigration","disk"),De=new v("pinUnlock","disk"),Me=new v("pinUnlock","memory"),xe=new v("crypto","disk"),Oe=new v("crypto","memory"),Ge=new v("kdfConfig","disk"),Ue=new v("keyConnector","disk");class Ve{}var je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ne{static create(){return new Ne([])}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(()=>je(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 Ne([...this.migrations,i])}runMigrator(e,t,i){return je(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 ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ye=new Error("Irreversible migration");class Le{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 ze(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i,yield e.set("stateVersion",i)})}}var Ke=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xe={key:"everHadUserKey",stateDefinition:{name:"crypto"}};class qe extends Le{migrate(e){return Ke(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ke(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.everHadUserKey;yield e.setToUser(t,Xe,null!=r&&r),null!=r&&delete i.profile.everHadUserKey,yield e.set(t,i)})}(t,i))])})}rollback(e){return Ke(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ke(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Xe);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{everHadUserKey:r}),yield e.set(t,i)),yield e.setToUser(t,Xe,null)})}(t,i))])})}}var He=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const We={key:"organizationKeys",stateDefinition:{name:"crypto"}};class $e extends Le{migrate(e){return He(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return He(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,We,s),delete i.keys.organizationKeys,yield e.set(t,i))})}(t,i))])})}rollback(e){return He(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return He(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,We);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{organizationKeys:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,We,null)})}(t,i))])})}}var Je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ze={name:"environment"},_e={key:"region",stateDefinition:Ze},et={key:"urls",stateDefinition:Ze};class tt extends Le{migrate(e){return Je(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.region)&&(yield e.setToGlobal(_e,t.region)),null!=(null==t?void 0:t.environmentUrls)&&(yield e.setToGlobal(et,t.environmentUrls));const i=yield e.getAccounts();yield Promise.all(i.map(t=>Je(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.region)&&(yield e.setToUser(t,_e,i.settings.region)),null!=(null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.environmentUrls)&&(yield e.setToUser(t,et,i.settings.environmentUrls)),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.region,null===(o=null==i?void 0:i.settings)||void 0===o||delete o.environmentUrls,yield e.set(t,i)}))),null==t||delete t.region,null==t||delete t.environmentUrls,yield e.set("global",t)})}rollback(e){return Je(this,void 0,void 0,function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(_e);n&&(t||(t={}),i=!0,t.region=n,yield e.setToGlobal(_e,null));const r=yield e.getFromGlobal(et);r&&(t||(t={}),i=!0,t.environmentUrls=r,yield e.setToGlobal(et,null)),i&&(yield e.set("global",t));const s=yield e.getAccounts();yield Promise.all(s.map(({userId:t,account:i})=>function(t,i){return Je(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,_e);r&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.region=r,yield e.setToUser(t,_e,null));const s=yield e.getFromUser(t,et);s&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.environmentUrls=s,yield e.setToUser(t,et,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var it=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nt={key:"providerKeys",stateDefinition:{name:"crypto"}};class rt extends Le{migrate(e){return it(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return it(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.providerKeys)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,nt,s),delete i.keys.providerKeys,yield e.set(t,i))})}(t,i))])})}rollback(e){return it(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return it(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,nt);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{providerKeys:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,nt,null)})}(t,i))])})}}var st=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ot={key:"clientKeyHalf",stateDefinition:{name:"biometricSettings"}};class at extends Le{migrate(e){return st(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>st(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.biometricEncryptionClientKeyHalf)&&(yield e.setToUser(t,ot,i.keys.biometricEncryptionClientKeyHalf),null===(r=null==i?void 0:i.keys)||void 0===r||delete r.biometricEncryptionClientKeyHalf,yield e.set(t,i))})))})}rollback(e){return st(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return st(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,ot);s&&(null!=i||(i={}),null!==(n=i.keys)&&void 0!==n||(i.keys={}),r=!0,i.keys.biometricEncryptionClientKeyHalf=s,yield e.setToUser(t,ot,null)),r&&(yield e.set(t,i))})}(t,i)))})}}var lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ct={key:"folders",stateDefinition:{name:"folder"}};class dt extends Le{migrate(e){return lt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return lt(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.folders)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,ct,s),delete i.data.folders,yield e.set(t,i))})}(t,i))])})}rollback(e){return lt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return lt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,ct);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{folders:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,ct,null)})}(t,i))])})}}var ut=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ht={key:"lastSync",stateDefinition:{name:"sync"}};class At extends Le{migrate(e){return ut(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ut(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,ht,null!=r?r:null),null!=r&&(delete i.profile.lastSync,yield e.set(t,i))})}(t,i))])})}rollback(e){return ut(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ut(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,ht);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:r}),yield e.set(t,i)),yield e.setToUser(t,ht,null)})}(t,i))])})}}var pt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const gt={key:"enablePasskeys",stateDefinition:{name:"vaultSettings"}};class vt extends Le{migrate(e){return pt(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enablePasskeys)&&(yield e.setToGlobal(gt,t.enablePasskeys),null==t||delete t.enablePasskeys,yield e.set("global",t))})}rollback(e){return pt(this,void 0,void 0,function*(){let t=yield e.get("global");const i=yield e.getFromGlobal(gt);null!=i&&(t=Object.assign(null!=t?t:{},{enablePasskeys:i}),yield e.set("global",t),yield e.setToGlobal(gt,void 0))})}}var ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const mt={stateDefinition:{name:"autofillSettings"}};class yt extends Le{migrate(e){return ft(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 ft(this,void 0,void 0,function*(){let n=!1;const r=null==i?void 0:i.settings;null!=(null==r?void 0:r.autoFillOnPageLoadDefault)&&(yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadDefault"}),r.autoFillOnPageLoadDefault),delete i.settings.autoFillOnPageLoadDefault,n=!0),null!=(null==r?void 0:r.enableAutoFillOnPageLoad)&&(yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoad"}),null==r?void 0:r.enableAutoFillOnPageLoad),delete i.settings.enableAutoFillOnPageLoad,n=!0),null!=(null==r?void 0:r.dismissedAutoFillOnPageLoadCallout)&&(yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadCalloutIsDismissed"}),null==r?void 0:r.dismissedAutoFillOnPageLoadCallout),delete i.settings.dismissedAutoFillOnPageLoadCallout,n=!0),null!=(null==r?void 0:r.disableAutoTotpCopy)&&(yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autoCopyTotp"}),!(null==r?void 0:r.disableAutoTotpCopy)),delete i.settings.disableAutoTotpCopy,n=!0),null!=(null==r?void 0:r.activateAutoFillOnPageLoadFromPolicy)&&(yield e.setToUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"},null==r?void 0:r.activateAutoFillOnPageLoadFromPolicy),delete i.settings.activateAutoFillOnPageLoadFromPolicy,n=!0),n&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return ft(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 ft(this,void 0,void 0,function*(){let n=!1,r=(null==i?void 0:i.settings)||{};const s=yield e.getFromUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadDefault"})),o=yield e.getFromUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoad"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadCalloutIsDismissed"})),l=yield e.getFromUser(t,Object.assign(Object.assign({},mt),{key:"autoCopyTotp"})),c=yield e.getFromUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"});null!=s&&(r=Object.assign(Object.assign({},r),{autoFillOnPageLoadDefault:s}),yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadDefault"}),null),n=!0),null!=o&&(r=Object.assign(Object.assign({},r),{enableAutoFillOnPageLoad:o}),yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoad"}),null),n=!0),null!=a&&(r=Object.assign(Object.assign({},r),{dismissedAutoFillOnPageLoadCallout:a}),yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autofillOnPageLoadCalloutIsDismissed"}),null),n=!0),null!=l&&(r=Object.assign(Object.assign({},r),{disableAutoTotpCopy:!l}),yield e.setToUser(t,Object.assign(Object.assign({},mt),{key:"autoCopyTotp"}),null),n=!0),null!=c&&(r=Object.assign(Object.assign({},r),{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:r})))})}(t,i))])})}}var Ct=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wt={key:"requirePasswordOnStart",stateDefinition:{name:"biometricSettings"}};class It extends Le{migrate(e){return Ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Ct(this,[t],void 0,function*({userId:t,account:i}){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.requirePasswordOnStart)&&(yield e.setToUser(t,wt,i.settings.requirePasswordOnStart),delete i.settings.requirePasswordOnStart,yield e.set(t,i))})))})}rollback(e){return Ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ct(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,wt);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.requirePasswordOnStart=r,yield e.setToUser(t,wt,null),yield e.set(t,i))})}(t,i)))})}}var bt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Bt={key:"privateKey",stateDefinition:{name:"crypto"}};class Et extends Le{migrate(e){return bt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return bt(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.privateKey)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Bt,s),delete i.keys.privateKey,yield e.set(t,i))})}(t,i))])})}rollback(e){return bt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return bt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Bt);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{privateKey:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Bt,null)})}(t,i))])})}}var St=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qt={key:"collections",stateDefinition:{name:"collection"}};class kt extends Le{migrate(e){return St(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return St(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.collections)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Qt,s),delete i.data.collections,yield e.set(t,i))})}(t,i))])})}rollback(e){return St(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return St(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Qt);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{collections:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Qt,null)})}(t,i))])})}}var Tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ft={key:"collapsedGroupings",stateDefinition:{name:"vaultFilter"}};class Pt extends Le{migrate(e){return Tt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Tt(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.collapsedGroupings;null!=r&&(yield e.setToUser(t,Ft,r),delete i.settings.collapsedGroupings,yield e.set(t,i))})}(t,i))])})}rollback(e){return Tt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Tt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Ft);i&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{collapsedGroupings:r}),yield e.set(t,i)),yield e.setToUser(t,Ft,null)})}(t,i))])})}}var Rt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Dt={key:"dismissedBiometricRequirePasswordOnStartCallout",stateDefinition:{name:"biometricSettings"}},Mt={key:"promptAutomatically",stateDefinition:{name:"biometricSettings"}};class xt extends Le{migrate(e){return Rt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Rt(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.dismissedBiometricRequirePasswordOnStartCallout)&&(yield e.setToUser(t,Dt,i.settings.dismissedBiometricRequirePasswordOnStartCallout)),null!=(null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.disableAutoBiometricsPrompt)&&(yield e.setToUser(t,Mt,!i.settings.disableAutoBiometricsPrompt)),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.dismissedBiometricRequirePasswordOnStartCallout,null===(o=null==i?void 0:i.settings)||void 0===o||delete o.disableAutoBiometricsPrompt,yield e.set(t,i))})))})}rollback(e){return Rt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Rt(this,void 0,void 0,function*(){var n,r;let s=!1;const o=yield e.getFromUser(t,Dt);o&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),s=!0,i.settings.dismissedBiometricRequirePasswordOnStartCallout=o,yield e.setToUser(t,Dt,null));const a=yield e.getFromUser(t,Mt);null!=a&&(null!=i||(i={}),null!==(r=i.settings)&&void 0!==r||(i.settings={}),s=!0,i.settings.disableAutoBiometricsPrompt=!a,yield e.setToUser(t,Mt,null)),s&&(yield e.set(t,i))})}(t,i)))})}}var Ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gt={key:"tasks",stateDefinition:{name:"smOnboarding"}};class Ut extends Le{migrate(e){return Ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Ot(this,[t],void 0,function*({userId:t,account:i}){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.smOnboardingTasks)&&(yield e.setToUser(t,Gt,i.settings.smOnboardingTasks),delete i.settings.smOnboardingTasks,yield e.set(t,i))})))})}rollback(e){return Ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ot(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Gt);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.smOnboardingTasks=r,yield e.setToUser(t,Gt,null),yield e.set(t,i))})}(t,i)))})}}var Vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const jt={stateDefinition:{name:"autofillSettingsLocal"}};class Nt extends Le{migrate(e){return Vt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Vt(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({},jt),{key:"clearClipboardDelay"}),n.clearClipboard),delete i.settings.clearClipboard,yield e.set(t,i))})}(t,i))])})}rollback(e){return Vt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Vt(this,void 0,void 0,function*(){let n=(null==i?void 0:i.settings)||{};const r=yield e.getFromUser(t,Object.assign(Object.assign({},jt),{key:"clearClipboardDelay"}));void 0!==r&&(n=Object.assign(Object.assign({},n),{clearClipboard:r}),yield e.setToUser(t,Object.assign(Object.assign({},jt),{key:"clearClipboardDelay"}),null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))})}(t,i))])})}}var zt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yt={key:"lastSync",stateDefinition:{name:"sync"}};class Lt extends Le{rollback(e){return zt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return zt(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,Yt,null!=r?r:null),null!=r&&(delete i.profile.lastSync,yield e.set(t,i))})}(t,i))])})}migrate(e){return zt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return zt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Yt);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:r}),yield e.set(t,i)),yield e.setToUser(t,Yt,null)})}(t,i))])})}}var Kt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xt={stateDefinition:{name:"badgeSettings"},key:"enableBadgeCounter"};class qt extends Le{migrate(e){return Kt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Kt(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,Xt,!n.disableBadgeCounter),delete i.settings.disableBadgeCounter,yield e.set(t,i))})}(t,i))])})}rollback(e){return Kt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Kt(this,void 0,void 0,function*(){let n=(null==i?void 0:i.settings)||{};const r=yield e.getFromUser(t,Xt);null!=r&&(n=Object.assign(Object.assign({},n),{disableBadgeCounter:!r}),yield e.setToUser(t,Xt,null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))})}(t,i))])})}}var Ht=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Wt={key:"biometricUnlockEnabled",stateDefinition:{name:"biometricSettings"}};class $t extends Le{migrate(e){return Ht(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Ht(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.biometricUnlock)&&(yield e.setToUser(t,Wt,i.settings.biometricUnlock)),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.biometricUnlock,yield e.set(t,i))})))})}rollback(e){return Ht(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ht(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Wt);null!=r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.biometricUnlock=r,yield e.setToUser(t,Wt,null),yield e.set(t,i))})}(t,i)))})}}var Jt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Zt extends Le{migrate(e){return Jt(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 Jt(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 _t,ei=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,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"}(_t||(_t={}));const ti={key:"policies",stateDefinition:{name:"policies"}};class ii extends Le{migrate(e){return ei(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ei(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.policies)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,ti,s),delete i.data.policies,yield e.set(t,i))})}(t,i)))})}rollback(e){return ei(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ei(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,ti);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{policies:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,ti,null)})}(t,i)))})}}var ni=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ri={stateDefinition:{name:"autofillSettings"},key:"enableContextMenu"};class si extends Le{migrate(e){return ni(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableContextMenuItem)&&(yield e.setToGlobal(ri,!t.disableContextMenuItem),delete t.disableContextMenuItem,yield e.set("global",t))})}rollback(e){return ni(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(ri);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableContextMenuItem:!i})),yield e.setToGlobal(ri,null))})}}var oi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ai={key:"locale",stateDefinition:{name:"translation"}};class li extends Le{migrate(e){return oi(this,void 0,void 0,function*(){const t=yield e.get("global");(null==t?void 0:t.locale)&&(yield e.setToGlobal(ai,t.locale),delete t.locale,yield e.set("global",t))})}rollback(e){return oi(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(ai);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(ai,null)})}}var ci=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const di="appId",ui="anonymousAppId",hi={key:di,stateDefinition:{name:"applicationId"}},Ai={key:ui,stateDefinition:{name:"applicationId"}};class pi extends Le{migrate(e){return ci(this,void 0,void 0,function*(){const t=yield e.get(di),i=yield e.get(ui);null!=t&&(yield e.setToGlobal(hi,t),yield e.set(di,null)),null!=i&&(yield e.setToGlobal(Ai,i),yield e.set(ui,null))})}rollback(e){return ci(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(hi),i=yield e.getFromGlobal(Ai);null!=t&&(yield e.set(di,t),yield e.setToGlobal(hi,null)),null!=i&&(yield e.set(ui,i),yield e.setToGlobal(Ai,null))})}}var gi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const vi={stateDefinition:{name:"domainSettings"},key:"defaultUriMatchStrategy"},fi={stateDefinition:{name:"domainSettings"},key:"equivalentDomains"},mi={stateDefinition:{name:"domainSettings"},key:"neverDomains"};class yi extends Le{migrate(e){return gi(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(mi,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){return gi(this,void 0,void 0,function*(){var r;const s=null==n?void 0:n.settings;null!=(null==s?void 0:s.defaultUriMatch)&&(yield e.setToUser(i,vi,s.defaultUriMatch),delete n.settings.defaultUriMatch,t=!0),null!=(null===(r=null==s?void 0:s.settings)||void 0===r?void 0:r.equivalentDomains)&&(yield e.setToUser(i,fi,s.settings.equivalentDomains),delete n.settings.settings.equivalentDomains,delete n.settings.settings,t=!0),t&&(yield e.set(i,n))})}(i,n))])})}rollback(e){return gi(this,void 0,void 0,function*(){let t=!1;const i=(yield e.get("global"))||{},n=yield e.getFromGlobal(mi);null!=n&&(yield e.set("global",Object.assign(Object.assign({},i),{neverDomains:n})),yield e.setToGlobal(mi,null));const r=yield e.getAccounts();yield Promise.all([...r.map(({userId:i,account:n})=>function(i,n){return gi(this,void 0,void 0,function*(){let r=(null==n?void 0:n.settings)||{};const s=yield e.getFromUser(i,vi),o=yield e.getFromUser(i,fi);null!=s&&(r=Object.assign(Object.assign({},r),{defaultUriMatch:s}),yield e.setToUser(i,vi,null),t=!0),null!=o&&(r=Object.assign(Object.assign({},r),{settings:{equivalentDomains:o}}),yield e.setToUser(i,fi,null),t=!0),t&&(yield e.set(i,Object.assign(Object.assign({},n),{settings:r})))})}(i,n))])})}}var Ci=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wi={key:"selection",stateDefinition:{name:"theming"}};class Ii extends Le{migrate(e){return Ci(this,void 0,void 0,function*(){const t=yield e.get("global"),i=null==t?void 0:t.theme;null!=i&&(yield e.setToGlobal(wi,i),delete t.theme,yield e.set("global",t))})}rollback(e){return Ci(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(wi);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(wi)}})}}var bi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Bi={stateDefinition:{name:"vaultSettings"}};class Ei extends Le{migrate(e){return bi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return bi(this,void 0,void 0,function*(){let n=!1;const r=null==i?void 0:i.settings;null!=(null==r?void 0:r.dontShowCardsCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Bi),{key:"showCardsCurrentTab"}),!r.dontShowCardsCurrentTab),delete i.settings.dontShowCardsCurrentTab,n=!0),null!=(null==r?void 0:r.dontShowIdentitiesCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Bi),{key:"showIdentitiesCurrentTab"}),!r.dontShowIdentitiesCurrentTab),delete i.settings.dontShowIdentitiesCurrentTab,n=!0),n&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return bi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return bi(this,void 0,void 0,function*(){var n;let r=!1,s=null!==(n=null==i?void 0:i.settings)&&void 0!==n?n:{};const o=yield e.getFromUser(t,Object.assign(Object.assign({},Bi),{key:"showCardsCurrentTab"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},Bi),{key:"showIdentitiesCurrentTab"}));null!=o&&(s=Object.assign(Object.assign({},s),{dontShowCardsCurrentTab:!o}),yield e.setToUser(t,Object.assign(Object.assign({},Bi),{key:"showCardsCurrentTab"}),null),r=!0),null!=a&&(s=Object.assign(Object.assign({},s),{dontShowIdentitiesCurrentTab:!a}),yield e.setToUser(t,Object.assign(Object.assign({},Bi),{key:"showIdentitiesCurrentTab"}),null),r=!0),r&&(yield e.set(t,Object.assign(Object.assign({},i),{settings:s})))})}(t,i))])})}}var Si=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qi={key:"avatarColor",stateDefinition:{name:"avatar"}};class ki extends Le{migrate(e){return Si(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Si(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.avatarColor)&&(yield e.setToUser(t,Qi,i.settings.avatarColor),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.avatarColor,yield e.set(t,i))})))})}rollback(e){return Si(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Si(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Qi);r&&(i||(i={}),n=!0,i.settings.avatarColor=r,yield e.setToUser(t,Qi,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var Ti=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fi={key:"emailTwoFactorTokenRecord",stateDefinition:{name:"tokenDiskLocal"}},Pi={name:"token"},Ri={key:"accessToken",stateDefinition:Pi},Di={key:"refreshToken",stateDefinition:Pi},Mi={key:"apiKeyClientId",stateDefinition:Pi},xi={key:"apiKeyClientSecret",stateDefinition:Pi};class Oi extends Le{migrate(e){return Ti(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:r})=>function(t,i,n,r){return Ti(this,void 0,void 0,function*(){var s,o,a,l,c;let d=!1;const u=null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.email;null!=n&&null!=i&&null!=u&&(r[u]=n);const h=null===(o=null==i?void 0:i.tokens)||void 0===o?void 0:o.accessToken;null!=h&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Ri,h)),delete i.tokens.accessToken,d=!0);const A=null===(a=null==i?void 0:i.tokens)||void 0===a?void 0:a.refreshToken;null!=A&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Di,A)),delete i.tokens.refreshToken,d=!0);const p=null===(l=null==i?void 0:i.profile)||void 0===l?void 0:l.apiKeyClientId;null!=p&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Mi,p)),delete i.profile.apiKeyClientId,d=!0);const g=null===(c=null==i?void 0:i.keys)||void 0===c?void 0:c.apiKeyClientSecret;null!=g&&("web-disk-local"!==e.type&&(yield e.setToUser(t,xi,g)),delete i.keys.apiKeyClientSecret,d=!0),d&&(yield e.set(t,i))})}(n,r,null==t?void 0:t.twoFactorToken,i))]),yield e.setToGlobal(Fi,i),null==t||delete t.twoFactorToken,yield e.set("global",t)})}rollback(e){return Ti(this,void 0,void 0,function*(){var t;const i=yield e.getAccounts();let n=null;for(const{account:r}of i){const i=null===(t=null==r?void 0:r.profile)||void 0===t?void 0:t.email;if(null==i)continue;if(n=(yield e.getFromGlobal(Fi))[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(Fi,null),yield Promise.all([...i.map(({userId:t,account:i})=>function(t,i){return Ti(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Ri);(null==i?void 0:i.tokens)&&null!=r&&(i.tokens.accessToken=r,n=!0),yield e.setToUser(t,Ri,null);const s=yield e.getFromUser(t,Di);(null==i?void 0:i.tokens)&&null!=s&&(i.tokens.refreshToken=s,n=!0),yield e.setToUser(t,Di,null);const o=yield e.getFromUser(t,Mi);(null==i?void 0:i.profile)&&null!=o&&(i.profile.apiKeyClientId=o,n=!0),yield e.setToUser(t,Mi,null);const a=yield e.getFromUser(t,xi);(null==i?void 0:i.keys)&&null!=a&&(i.keys.apiKeyClientSecret=a,n=!0),yield e.setToUser(t,xi,null),n&&(yield e.set(t,i))})}(t,i))])})}}var Gi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ui={key:"accountProfile",stateDefinition:{name:"billing"}};class Vi extends Le{migrate(e){return Gi(this,void 0,void 0,function*(){const t=yield e.getAccounts(),i=(t,i)=>Gi(this,void 0,void 0,function*(){var n,r,s,o;const a=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.hasPremiumPersonally,l=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.hasPremiumFromOrganization;null==a&&null==l||(yield e.setToUser(t,Ui,{hasPremiumPersonally:a,hasPremiumFromOrganization:l}),null===(s=null==i?void 0:i.profile)||void 0===s||delete s.hasPremiumPersonally,null===(o=null==i?void 0:i.profile)||void 0===o||delete o.hasPremiumFromOrganization,yield e.set(t,i))});yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return Gi(this,void 0,void 0,function*(){const t=yield e.getAccounts(),i=(t,i)=>Gi(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Ui);i&&r&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{hasPremiumPersonally:null==r?void 0:r.hasPremiumPersonally,hasPremiumFromOrganization:null==r?void 0:r.hasPremiumFromOrganization}),yield e.set(t,i)),yield e.setToUser(t,Ui,null)});yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}}var ji=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ni extends Le{migrate(e){return ji(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ji(this,void 0,void 0,function*(){var n;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 Ye}updateVersion(e,t){return ji(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 zi,Yi,Li,Ki,Xi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,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"}(zi||(zi={})),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"}(Yi||(Yi={})),function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller"}(Li||(Li={})),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"}(Ki||(Ki={}));const qi={key:"organizations",stateDefinition:{name:"organizations"}};class Hi extends Le{migrate(e){return Xi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Xi(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.organizations;null!=r&&(yield e.setToUser(t,qi,r),delete i.data.organizations,yield e.set(t,i))})}(t,i)))})}rollback(e){return Xi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Xi(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,qi);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{organizations:r}),yield e.set(t,i)),yield e.setToUser(t,qi,null)})}(t,i)))})}}var Wi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $i={stateDefinition:{name:"eventCollection"},key:"eventCollection"};class Ji extends Le{migrate(e){return Wi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Wi(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.eventCollection;null!=r&&(yield e.setToUser(t,$i,r),delete i.data.eventCollection,yield e.set(t,i))})}(t,i))])})}rollback(e){return Wi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Wi(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,$i);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{eventCollection:r}),yield e.set(t,i)),yield e.setToUser(t,$i,null)})}(t,i))])})}}var Zi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const _i={stateDefinition:{name:"domainSettings"},key:"showFavicons"};class en extends Le{migrate(e){return Zi(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableFavicon)&&(yield e.setToGlobal(_i,!t.disableFavicon),delete t.disableFavicon,yield e.set("global",t))})}rollback(e){return Zi(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(_i);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableFavicon:!i})),yield e.setToGlobal(_i,null))})}}var tn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nn={key:"autoConfirmFingerPrints",stateDefinition:{name:"organizationManagementPreferences"}};class rn extends Le{migrate(e){return tn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>tn(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.autoConfirmFingerPrints)&&(yield e.setToUser(t,nn,i.settings.autoConfirmFingerPrints),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.autoConfirmFingerPrints,yield e.set(t,i))})))})}rollback(e){return tn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return tn(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,nn);r&&(i||(i={}),n=!0,i.settings.autoConfirmFingerPrints=r,yield e.setToUser(t,nn,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var sn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const on={key:"decryptionOptions",stateDefinition:{name:"userDecryptionOptions"}};class an extends Le{migrate(e){return sn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return sn(this,void 0,void 0,function*(){const n=null==i?void 0:i.decryptionOptions;null!=n&&(yield e.setToUser(t,on,n),delete i.decryptionOptions,yield e.set(t,i))})}(t,i))])})}rollback(e){return sn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return sn(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,on);i&&(i.decryptionOptions=Object.assign(i.decryptionOptions,n),yield e.set(t,i)),yield e.setToUser(t,on,null)})}(t,i))])})}}var ln=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const cn={name:"environment"},dn={key:"region",stateDefinition:cn},un={key:"urls",stateDefinition:cn},hn={key:"environment",stateDefinition:cn};class An extends Le{migrate(e){return ln(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return ln(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,dn),n=yield e.getFromUser(t,un);null==i&&null==n||(yield e.setToUser(t,hn,{region:i,urls:n}),yield e.removeFromUser(t,dn),yield e.removeFromUser(t,un))})}(t))]);const i=yield e.getFromGlobal(dn),n=yield e.getFromGlobal(un);null==i&&null==n||(yield e.setToGlobal(hn,{region:i,urls:n}),yield e.removeFromGlobal(dn),yield e.removeFromGlobal(un))})}rollback(e){return ln(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return ln(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,hn);yield e.setToUser(t,dn,null==i?void 0:i.region),yield e.setToUser(t,un,null==i?void 0:i.urls),yield e.removeFromUser(t,hn)})}(t))]);const i=yield e.getFromGlobal(hn);yield e.setToGlobal(dn,null==i?void 0:i.region),yield e.setToGlobal(un,null==i?void 0:i.urls),yield e.removeFromGlobal(hn)})}}var pn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const gn={key:"promptCancelled",stateDefinition:{name:"biometricSettings"}};class vn extends Le{migrate(e){return pn(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>pn(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,gn)&&(yield e.removeFromUser(t,gn))})))})}rollback(e){return pn(this,void 0,void 0,function*(){throw Ye})}}var fn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const mn={name:"desktopSettings"},yn={key:"window",stateDefinition:mn},Cn={key:"closeToTray",stateDefinition:mn},wn={key:"minimizeToTray",stateDefinition:mn},In={key:"startToTray",stateDefinition:mn},bn={key:"trayEnabled",stateDefinition:mn},Bn={key:"openAtLogin",stateDefinition:mn},En={key:"alwaysShowDock",stateDefinition:mn},Sn={key:"alwaysOnTop",stateDefinition:mn};class Qn extends Le{migrate(e){return fn(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(yn,t.window),i=!0,delete t.window),null!=(null==t?void 0:t.enableCloseToTray)&&(yield e.setToGlobal(Cn,t.enableCloseToTray),i=!0,delete t.enableCloseToTray),null!=(null==t?void 0:t.enableMinimizeToTray)&&(yield e.setToGlobal(wn,t.enableMinimizeToTray),i=!0,delete t.enableMinimizeToTray),null!=(null==t?void 0:t.enableStartToTray)&&(yield e.setToGlobal(In,t.enableStartToTray),i=!0,delete t.enableStartToTray),null!=(null==t?void 0:t.enableTray)&&(yield e.setToGlobal(bn,t.enableTray),i=!0,delete t.enableTray),null!=(null==t?void 0:t.openAtLogin)&&(yield e.setToGlobal(Bn,t.openAtLogin),i=!0,delete t.openAtLogin),null!=(null==t?void 0:t.alwaysShowDock)&&(yield e.setToGlobal(En,t.alwaysShowDock),i=!0,delete t.alwaysShowDock),null!=(null==t?void 0:t.enableAlwaysOnTop)&&(yield e.setToGlobal(Sn,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){return fn(this,void 0,void 0,function*(){var n;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 Ye}}var kn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Tn={key:"enableDuckDuckGoBrowserIntegration",stateDefinition:{name:"autofillSettings"}};class Fn extends Le{migrate(e){return kn(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enableDuckDuckGoBrowserIntegration)&&(yield e.setToGlobal(Tn,t.enableDuckDuckGoBrowserIntegration),delete t.enableDuckDuckGoBrowserIntegration,yield e.set("global",t))})}rollback(e){return kn(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(Tn);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(Tn)})}}var Pn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Rn={stateDefinition:{name:"config"},key:"serverConfig"};class Dn extends Le{migrate(e){return Pn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Pn(this,void 0,void 0,function*(){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.serverConfig)&&(yield e.setToUser(t,Rn,i.settings.serverConfig),delete i.settings.serverConfig,yield e.set(t,i))})}(t,i))])})}rollback(e){return Pn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Pn(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Rn);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.serverConfig=r,yield e.setToUser(t,Rn,null),yield e.set(t,i))})}(t,i))])})}}var Mn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class xn extends Le{migrate(e){return Mn(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Mn(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;if(null==s)return;const o={};Object.entries(s).forEach(([e,t])=>{o[e]={type:"organization",key:t}}),i.keys.organizationKeys.encrypted=o,yield e.set(t,i)})}(t,i)))})}rollback(e){return Mn(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(t=>Mn(this,[t],void 0,function*({userId:t,account:i}){return function(t,i){return Mn(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;if(null==s)return;const o={};Object.entries(s).forEach(([e,t])=>{o[e]=t.key}),i.keys.organizationKeys.encrypted=o,yield e.set(t,i)})}(t,i)})))})}updateVersion(e,t){return Mn(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 On=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gn={key:"usesKeyConnector",stateDefinition:{name:"keyConnector"}},Un={key:"convertAccountToKeyConnector",stateDefinition:{name:"keyConnector"}};class Vn extends Le{migrate(e){return On(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return On(this,void 0,void 0,function*(){var n,r;const s=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.usesKeyConnector,o=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.convertAccountToKeyConnector;null==s&&null==o||(null!=s&&(yield e.setToUser(t,Gn,s),delete i.profile.usesKeyConnector),null!=o&&(yield e.setToUser(t,Un,o),delete i.profile.convertAccountToKeyConnector),yield e.set(t,i))})}(t,i))])})}rollback(e){return On(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return On(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,Gn),r=yield e.getFromUser(t,Un);null==n&&null==r||(null!=n&&(i.profile.usesKeyConnector=n,yield e.setToUser(t,Gn,null)),null!=r&&(i.profile.convertAccountToKeyConnector=r,yield e.setToUser(t,Un,null)),yield e.set(t,i))})}(t,i))])})}}var jn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nn={key:"storedEmail",stateDefinition:{name:"loginEmail"}};class zn extends Le{migrate(e){return jn(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.rememberedEmail)&&(yield e.setToGlobal(Nn,t.rememberedEmail)),null==t||delete t.rememberedEmail,yield e.set("global",t)})}rollback(e){return jn(this,void 0,void 0,function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(Nn);n&&(t||(t={}),i=!0,t.rememberedEmail=n,yield e.setToGlobal(Nn,null)),i&&(yield e.set("global",t))})}}var Yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ln extends Le{migrate(e){return Yn(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 Ye}}var Kn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xn={key:"deviceKey",stateDefinition:{name:"deviceTrust"}},qn={key:"shouldTrustDevice",stateDefinition:{name:"deviceTrust"}};class Hn extends Le{migrate(e){return Kn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Kn(this,void 0,void 0,function*(){var n,r;let s=!1;const o=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.deviceKey;null!=o&&(yield e.setToUser(t,Xn,o),delete i.keys.deviceKey,s=!0);const a=null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.trustDeviceChoiceForDecryption;null!=a&&(yield e.setToUser(t,qn,a),delete i.settings.trustDeviceChoiceForDecryption,s=!0),s&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return Kn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Kn(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,Xn);(null==i?void 0:i.keys)&&null!=n&&(i.keys.deviceKey=n,yield e.set(t,i)),yield e.setToUser(t,Xn,null);const r=yield e.getFromUser(t,qn);(null==i?void 0:i.settings)&&null!=r&&(i.settings.trustDeviceChoiceForDecryption=r,yield e.set(t,i)),yield e.setToUser(t,qn,null)})}(t,i))])})}}var Wn,$n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.Text=0]="Text",e[e.File=1]="File"}(Wn||(Wn={}));const Jn={stateDefinition:{name:"send"},key:"sends"};class Zn extends Le{migrate(e){return $n(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return $n(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.sends)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Jn,s),delete i.data.sends,yield e.set(t,i))})}(t,i))])})}rollback(e){return $n(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return $n(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Jn);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{sends:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Jn,null)})}(t,i))])})}}var _n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const er={key:"forceSetPasswordReason",stateDefinition:{name:"masterPassword"}},tr={key:"masterKeyHash",stateDefinition:{name:"masterPassword"}},ir={key:"masterKeyEncryptedUserKey",stateDefinition:{name:"masterPassword"}};class nr extends Le{migrate(e){return _n(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return _n(this,void 0,void 0,function*(){var n,r,s;const o=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.forceSetPasswordReason;null!=o&&(yield e.setToUser(t,er,o),delete i.profile.forceSetPasswordReason,yield e.set(t,i));const a=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.keyHash;null!=a&&(yield e.setToUser(t,tr,a),delete i.profile.keyHash,yield e.set(t,i));const l=null===(s=null==i?void 0:i.keys)||void 0===s?void 0:s.masterKeyEncryptedUserKey;null!=l&&(yield e.setToUser(t,ir,l),delete i.keys.masterKeyEncryptedUserKey,yield e.set(t,i))})}(t,i))])})}rollback(e){return _n(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return _n(this,void 0,void 0,function*(){var n,r,s;const o=yield e.getFromUser(t,er),a=yield e.getFromUser(t,tr),l=yield e.getFromUser(t,ir);null!=i&&(null!=o&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{forceSetPasswordReason:o})),null!=a&&(i.profile=Object.assign(null!==(r=i.profile)&&void 0!==r?r:{},{keyHash:a})),null!=l&&(i.keys=Object.assign(null!==(s=i.keys)&&void 0!==s?s:{},{masterKeyEncryptedUserKey:l})),yield e.set(t,i)),yield e.setToUser(t,er,null),yield e.setToUser(t,tr,null)})}(t,i))])})}}var rr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const sr={stateDefinition:{name:"authRequestLocal"},key:"adminAuthRequest"},or={stateDefinition:{name:"authRequestLocal"},key:"acceptAuthRequests"};class ar extends Le{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){return rr(this,void 0,void 0,function*(){var n;let r=!1;const s=null==i?void 0:i.adminAuthRequest;null!=s&&(yield e.setToUser(t,sr,s),delete i.adminAuthRequest,r=!0);const o=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.approveLoginRequests;null!=o&&(yield e.setToUser(t,or,o),delete i.settings.approveLoginRequests,r=!0),r&&(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){return rr(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,sr);null!=s&&(i.adminAuthRequest=s,r=!0),yield e.setToUser(t,sr,null);const o=yield e.getFromUser(t,or);null!=o&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{approveLoginRequests:o}),r=!0),yield e.setToUser(t,or,null),r&&(yield e.set(t,i))})}(t,i))])})}}var lr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const cr={key:"localData",stateDefinition:{name:"ciphersLocal"}},dr={key:"ciphers",stateDefinition:{name:"ciphers"}};class ur extends Le{migrate(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){return lr(this,void 0,void 0,function*(){var n,r,s;let o=!1;const a=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.localData;null!=a&&(yield e.setToUser(t,cr,a),delete i.data.localData,o=!0);const l=null===(s=null===(r=null==i?void 0:i.data)||void 0===r?void 0:r.ciphers)||void 0===s?void 0:s.encrypted;null!=l&&(yield e.setToUser(t,dr,l),delete i.data.ciphers,o=!0),o&&(yield e.set(t,i))})}(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){return lr(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,cr);i.data&&null!=r&&(i.data.localData=r,yield e.set(t,i)),yield e.setToUser(t,cr,null);const s=yield e.getFromUser(t,dr);i.data&&null!=s&&((n=i.data).ciphers||(n.ciphers={encrypted:null}),i.data.ciphers.encrypted=s,yield e.set(t,i)),yield e.setToUser(t,dr,null)})}(t,i))])})}}var hr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ar={key:"refreshTokenMigratedToSecureStorage",stateDefinition:{name:"token"}};class pr extends Le{migrate(e){return hr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return hr(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,Ar))&&(yield e.removeFromUser(t,Ar))})}(t))])})}rollback(e){return hr(this,void 0,void 0,function*(){throw Ye})}}var gr,vr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(gr||(gr={}));const fr={key:"kdfConfig",stateDefinition:{name:"kdfConfig"}};class mr extends Le{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*(){var n,r,s,o,a,l,c,d;const u={iterations:null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.kdfIterations,kdfType:null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.kdfType,memory:null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.kdfMemory,parallelism:null===(o=null==i?void 0:i.profile)||void 0===o?void 0:o.kdfParallelism};null!=u&&(yield e.setToUser(t,fr,u),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===(d=null==i?void 0:i.profile)||void 0===d||delete d.kdfParallelism),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*(){const n=yield e.getFromUser(t,fr);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,fr,null)),yield e.set(t,i)})}(t,i))])})}}var yr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Cr extends Le{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*(){var n;(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 yr(this,void 0,void 0,function*(){throw Ye})}updateVersion(e,t){return yr(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 wr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ir={stateDefinition:{name:"account"},key:"accounts"},br={stateDefinition:{name:"account"},key:"activeAccountId"},Br={stateDefinition:{name:"account"},key:"activity"};class Er extends Le{migrate(e){return wr(this,void 0,void 0,function*(){yield this.migrateAuthenticatedAccounts(e),yield this.migrateActiveAccountId(e),yield this.migrateAccountActivity(e)})}rollback(e){return wr(this,void 0,void 0,function*(){var t;const i=null!==(t=yield e.getKnownUserIds())&&void 0!==t?t:[];yield e.set("authenticatedAccounts",i),yield e.removeFromGlobal(Ir);const n=yield e.getFromGlobal(br);n&&(yield e.set("activeUserId",n)),yield e.removeFromGlobal(br);const r=yield e.getFromGlobal(Br);if(r){const t=Object.entries(r).reduce((e,[t,i])=>(e[t]=new Date(i).getTime(),e),{});yield e.set("accountActivity",t)}yield e.removeFromGlobal(Br)})}migrateAuthenticatedAccounts(e){return wr(this,void 0,void 0,function*(){var t;const i=null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[],n=(yield Promise.all(i.map(t=>wr(this,void 0,void 0,function*(){const i=yield e.get(t);return{userId:t,account:i}})))).reduce((e,{userId:t,account:i})=>{var n,r;return(null==i?void 0:i.profile)&&(e[t]={email:null!==(n=i.profile.email)&&void 0!==n?n:"",emailVerified:null!==(r=i.profile.emailVerified)&&void 0!==r&&r,name:i.profile.name}),e},{});yield e.setToGlobal(Ir,n),yield e.remove("authenticatedAccounts")})}migrateAccountActivity(e){return wr(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(Br,i),yield e.remove("accountActivity")})}migrateActiveAccountId(e){return wr(this,void 0,void 0,function*(){const t=yield e.get("activeUserId");yield e.setToGlobal(br,t),yield e.remove("activeUserId")})}}var Sr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qr={name:"pinUnlock"},kr={stateDefinition:Qr,key:"pinKeyEncryptedUserKeyPersistent"},Tr={stateDefinition:Qr,key:"userKeyEncryptedPin"},Fr={stateDefinition:Qr,key:"oldPinKeyEncryptedMasterKey"};class Pr extends Le{migrate(e){return Sr(this,void 0,void 0,function*(){const t=yield e.getAccounts();let i=!1;yield Promise.all([...t.map(({userId:t,account:n})=>function(t,n){return Sr(this,void 0,void 0,function*(){var r,s,o,a;null!=(null===(r=null==n?void 0:n.settings)||void 0===r?void 0:r.pinKeyEncryptedUserKey)&&(yield e.setToUser(t,kr,n.settings.pinKeyEncryptedUserKey),delete n.settings.pinKeyEncryptedUserKey,i=!0),null!=(null===(s=null==n?void 0:n.settings)||void 0===s?void 0:s.protectedPin)&&(yield e.setToUser(t,Tr,n.settings.protectedPin),delete n.settings.protectedPin,i=!0),null!=(null===(a=null===(o=null==n?void 0:n.settings)||void 0===o?void 0:o.pinProtected)||void 0===a?void 0:a.encrypted)&&(yield e.setToUser(t,Fr,n.settings.pinProtected.encrypted),delete n.settings.pinProtected,i=!0),i&&(yield e.set(t,n))})}(t,n))])})}rollback(e){return Sr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Sr(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,kr),o=yield e.getFromUser(t,Tr),a=yield e.getFromUser(t,Fr);i||(i={}),null!=s&&(i.settings.pinKeyEncryptedUserKey=s,yield e.setToUser(t,kr,null),r=!0),null!=o&&(i.settings.protectedPin=o,yield e.setToUser(t,Tr,null),r=!0),null!=a&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{pinProtected:{encrypted:a}}),yield e.setToUser(t,Fr,null),r=!0),r&&(yield e.set(t,i))})}(t,i)))})}}var Rr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Dr={name:"vaultTimeoutSettings"},Mr={key:"vaultTimeout",stateDefinition:Dr},xr={key:"vaultTimeoutAction",stateDefinition:Dr},Or={null:"never","-1":"onRestart","-2":"onLocked","-3":"onSleep","-4":"onIdle"},Gr={never:null,onRestart:-1,onLocked:-2,onSleep:-3,onIdle:-4};var Ur;!function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Cli="cli"}(Ur||(Ur={}));class Vr extends Le{migrate(e){return Rr(this,void 0,void 0,function*(){const t=yield e.get("global"),i=yield e.getAccounts();yield Promise.all([...i.map(({userId:t,account:i})=>function(t,i){return Rr(this,void 0,void 0,function*(){var n,r,s,o;let a=!1,l=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.vaultTimeout;if(e.clientType===Ur.Cli&&void 0===l&&(l=null),void 0!==l){if(null===l||l<0){const i=Or[l];yield e.setToUser(t,Mr,i)}else yield e.setToUser(t,Mr,l);null===(r=null==i?void 0:i.settings)||void 0===r||delete r.vaultTimeout,a=!0}const c=null===(s=null==i?void 0:i.settings)||void 0===s?void 0:s.vaultTimeoutAction;null!=c&&(yield e.setToUser(t,xr,c),null===(o=null==i?void 0:i.settings)||void 0===o||delete o.vaultTimeoutAction,a=!0),a&&(yield e.set(t,i))})}(t,i))]),null==t||delete t.vaultTimeout,null==t||delete t.vaultTimeoutAction,yield e.set("global",t),yield e.remove("global\\.vaultTimeout"),yield e.remove("global\\.vaultTimeoutAction")})}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){return Rr(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Mr);(null==i?void 0:i.settings)&&null!=r&&(i.settings.vaultTimeout="string"==typeof r?Gr[r]:r,n=!0),yield e.setToUser(t,Mr,null);const s=yield e.getFromUser(t,xr);(null==i?void 0:i.settings)&&null!=s&&(i.settings.vaultTimeoutAction=s,n=!0),yield e.setToUser(t,xr,null),n&&(yield e.set(t,i))})}(t,i))])})}}var jr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nr={stateDefinition:{name:"generator"},key:"generatorSettings"},zr={stateDefinition:{name:"generator"},key:"passwordGeneratorSettings"},Yr={stateDefinition:{name:"generator"},key:"passphraseGeneratorSettings"};class Lr extends Le{migrate(e){return jr(this,void 0,void 0,function*(){const t=yield e.getAccounts();function i(t,i){return jr(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.passwordGenerationOptions;if(r){const n=function(e){const t={length:e.length,ambiguous:e.ambiguous,uppercase:e.uppercase,minUppercase:e.minUppercase,lowercase:e.lowercase,minLowercase:e.minLowercase,number:e.number,minNumber:e.minNumber,special:e.special,minSpecial:e.minSpecial},i={type:e.type},n={numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber};return{generator:i,password:t,passphrase:n}}(r);yield function(e,t,i){return jr(this,void 0,void 0,function*(){var n;const r=null!==(n=yield e.getFromUser(t,Nr))&&void 0!==n?n:{},s=Object.assign(r,i.generator);yield Promise.all([e.setToUser(t,Nr,s),e.setToUser(t,Yr,i.passphrase),e.setToUser(t,zr,i.password)])})}(e,t,n),yield function(e,t,i){return jr(this,void 0,void 0,function*(){var n;null===(n=null==i?void 0:i.settings)||void 0===n||delete n.passwordGenerationOptions,yield e.set(t,i)})}(e,t,i)}})}yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return jr(this,void 0,void 0,function*(){})}}var Kr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xr={stateDefinition:{name:"generator"},key:"localGeneratorHistoryBuffer"};class qr extends Le{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){return Kr(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.passwordGenerationHistory;r&&r.encrypted&&(yield e.setToUser(t,Xr,r.encrypted),delete i.data.passwordGenerationHistory,yield e.set(t,i))})}(t,i))])})}rollback(e){return Kr(this,void 0,void 0,function*(){})}}var Hr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Wr={stateDefinition:{name:"generator"},key:"generatorSettings"},$r={stateDefinition:{name:"generator"},key:"catchallGeneratorSettings"},Jr={stateDefinition:{name:"generator"},key:"effUsernameGeneratorSettings"},Zr={stateDefinition:{name:"generator"},key:"subaddressGeneratorSettings"},_r={stateDefinition:{name:"generator"},key:"addyIoBuffer"},es={stateDefinition:{name:"generator"},key:"duckDuckGoBuffer"},ts={stateDefinition:{name:"generator"},key:"fastmailBuffer"},is={stateDefinition:{name:"generator"},key:"firefoxRelayBuffer"},ns={stateDefinition:{name:"generator"},key:"forwardEmailBuffer"},rs={stateDefinition:{name:"generator"},key:"simpleLoginBuffer"};class ss extends Le{migrate(e){return Hr(this,void 0,void 0,function*(){const t=yield e.getAccounts();function i(t,i){return Hr(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.usernameGenerationOptions;if(r){const n=function(e){const t={addyIo:{baseUrl:e.forwardedAnonAddyBaseUrl,token:e.forwardedAnonAddyApiToken,domain:e.forwardedAnonAddyDomain},duckDuckGo:{token:e.forwardedDuckDuckGoToken},fastmail:{token:e.forwardedFastmailApiToken},firefoxRelay:{token:e.forwardedFirefoxApiToken},forwardEmail:{token:e.forwardedForwardEmailApiToken,domain:e.forwardedForwardEmailDomain},simpleLogin:{token:e.forwardedSimpleLoginApiKey,baseUrl:e.forwardedSimpleLoginBaseUrl}},i={username:e.type,forwarder:e.forwardedService},n={effUsername:{wordCapitalize:e.wordCapitalize,wordIncludeNumber:e.wordIncludeNumber},subaddress:{subaddressType:e.subaddressType,subaddressEmail:e.subaddressEmail},catchall:{catchallType:e.catchallType,catchallDomain:e.catchallDomain}};return{generator:i,algorithms:n,forwarders:t}}(r);yield function(e,t,i){return Hr(this,void 0,void 0,function*(){yield Promise.all([e.setToUser(t,Wr,i.generator),e.setToUser(t,$r,i.algorithms.catchall),e.setToUser(t,Jr,i.algorithms.effUsername),e.setToUser(t,Zr,i.algorithms.subaddress),e.setToUser(t,_r,i.forwarders.addyIo),e.setToUser(t,es,i.forwarders.duckDuckGo),e.setToUser(t,ts,i.forwarders.fastmail),e.setToUser(t,is,i.forwarders.firefoxRelay),e.setToUser(t,ns,i.forwarders.forwardEmail),e.setToUser(t,rs,i.forwarders.simpleLogin)])})}(e,t,n),yield function(e,t,i){return Hr(this,void 0,void 0,function*(){var n;null===(n=null==i?void 0:i.settings)||void 0===n||delete n.usernameGenerationOptions,yield e.set(t,i)})}(e,t,i)}})}yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return Hr(this,void 0,void 0,function*(){})}}var os=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const as={name:"desktopSettings"},ls={key:"browserIntegrationEnabled",stateDefinition:as},cs={key:"browserIntegrationFingerprintEnabled",stateDefinition:as},ds={key:"minimizeOnCopy",stateDefinition:as};class us extends Le{migrate(e){return os(this,void 0,void 0,function*(){const t=yield e.get("global"),i=null==t?void 0:t.enableBrowserIntegration,n=null==t?void 0:t.enableBrowserIntegrationFingerprint;let r=!1;null!=i&&(yield e.setToGlobal(ls,i),delete t.enableBrowserIntegration,r=!0),null!=n&&(yield e.setToGlobal(cs,n),delete t.enableBrowserIntegrationFingerprint,r=!0),r&&(yield e.set("global",t));const s=yield e.getAccounts();yield Promise.all(s.map(({userId:t,account:i})=>function(t,i){return os(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.minimizeOnCopyToClipboard;null!=r&&(yield e.setToUser(t,ds,r),delete i.settings.minimizeOnCopyToClipboard,yield e.set(t,i))})}(t,i)))})}rollback(e){return os(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(ls),i=yield e.getFromGlobal(cs);if(null!=t){let i=yield e.get("global");null!=i||(i={}),i.enableBrowserIntegration=t,yield e.set("global",i),yield e.removeFromGlobal(ls)}if(null!=i){let t=yield e.get("global");null!=t||(t={}),t.enableBrowserIntegrationFingerprint=i,yield e.set("global",t),yield e.removeFromGlobal(cs)}const n=yield e.getAccounts();yield Promise.all(n.map(({userId:t,account:i})=>function(t,i){return os(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,ds);null!=n&&(null!=i||(i={settings:{}}),i.settings.minimizeOnCopyToClipboard=n,yield e.set(t,i),yield e.removeFromUser(t,ds))})}(t,i)))})}}var hs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const As={key:"showBanner",stateDefinition:{name:"unassignedItemsBanner"}};class ps extends Le{migrate(e){return hs(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>hs(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,As)&&(yield e.removeFromUser(t,As))})))})}rollback(e){return hs(this,void 0,void 0,function*(){throw Ye})}}var gs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const vs={key:"lastSync",stateDefinition:{name:"sync"}};class fs extends Le{migrate(e){return gs(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return gs(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;null!=r&&(yield e.setToUser(t,vs,r),delete i.profile.lastSync,yield e.set(t,i))})}(t,i)))})}rollback(e){return gs(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return gs(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,vs);null!=r&&(null!=i||(i={}),null!==(n=i.profile)&&void 0!==n||(i.profile={}),i.profile.lastSync=r,yield e.set(t,i),yield e.removeFromUser(t,vs))})}(t,i)))})}}var ms=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ys={key:"folder",stateDefinition:{name:"folder"}},Cs={key:"folders",stateDefinition:{name:"folder"}};class ws extends Le{migrate(e){return ms(this,void 0,void 0,function*(){const t=yield e.getKnownUserIds();yield Promise.all(t.map(t=>function(t){return ms(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,ys);null!=i&&(yield e.setToUser(t,Cs,i)),yield e.removeFromUser(t,ys)})}(t)))})}rollback(e){return ms(this,void 0,void 0,function*(){const t=yield e.getKnownUserIds();yield Promise.all(t.map(t=>function(t){return ms(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,Cs);null!=i&&(yield e.setToUser(t,ys,i)),yield e.removeFromUser(t,Cs)})}(t)))})}}var Is=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class bs extends Le{migrate(e){return Is(this,void 0,void 0,function*(){var t;const i=yield e.get("global"),n=null!==(t=null==i?void 0:i.noAutoPromptBiometrics)&&void 0!==t&&t,r=yield e.getAccounts();delete i.noAutoPromptBiometrics,yield Promise.all([...r.map(({userId:t,account:i})=>function(t,i){return Is(this,void 0,void 0,function*(){var r;null!=i&&n&&(i.settings=Object.assign(null!==(r=null==i?void 0:i.settings)&&void 0!==r?r:{},{disableAutoBiometricsPrompt:!0}),yield e.set(t,i))})}(t,i)),e.set("global",i)])})}rollback(e){return Is(this,void 0,void 0,function*(){throw Ye})}updateVersion(e,t){return Is(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 Bs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Es={key:"acBannersDismissed",stateDefinition:{name:"showProviderClientVaultPrivacyBanner"}};class Ss extends Le{migrate(e){return Bs(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Bs(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,Es)&&(yield e.removeFromUser(t,Es))})))})}rollback(e){return Bs(this,void 0,void 0,function*(){throw Ye})}}var Qs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ks={key:"newCustomizationOptionsCalloutDismissed",stateDefinition:{name:"bannersDismissed"}};class Ts extends Le{migrate(e){return Qs(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Qs(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,ks)&&(yield e.removeFromUser(t,ks))})))})}rollback(e){return Qs(this,void 0,void 0,function*(){throw Ye})}}var Fs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ps={key:"showAccountDeprovisioningBanner",stateDefinition:{name:"accountDeprovisioningBanner"}};class Rs extends Le{migrate(e){return Fs(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Fs(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,Ps)&&(yield e.removeFromUser(t,Ps))})))})}rollback(e){return Fs(this,void 0,void 0,function*(){throw Ye})}}var Ds=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ms={stateDefinition:{name:"account"},key:"accounts"},xs={key:"masterPasswordUnlockKey",stateDefinition:{name:"masterPasswordUnlock"}},Os={key:"masterKeyEncryptedUserKey",stateDefinition:{name:"masterPassword"}},Gs={key:"kdfConfig",stateDefinition:{name:"kdfConfig"}};class Us extends Le{migrate(e){return Ds(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(Ms),i=yield e.getAccounts();yield Promise.all(i.map(({userId:i})=>function(t,i){return Ds(this,void 0,void 0,function*(){const n=null==i?void 0:i.email,r=yield e.getFromUser(t,Gs),s=yield e.getFromUser(t,Os);null==(yield e.getFromUser(t,xs))&&null!=n&&null!=r&&null!=s&&(yield e.setToUser(t,xs,{salt:n.trim().toLowerCase(),kdf:r,masterKeyWrappedUserKey:s}))})}(i,t[i])))})}rollback(e){return Ds(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t})=>function(t){return Ds(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,xs))&&(yield e.removeFromUser(t,xs))})}(t)))})}}var Vs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const js={key:"pinKeyEncryptedUserKeyPersistent",stateDefinition:{name:"pinUnlock"}};class Ns extends Le{migrate(e){return Vs(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return Vs(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,js))&&(yield e.removeFromUser(t,js))})}(t))])})}rollback(e){return Vs(this,void 0,void 0,function*(){throw Ye})}}var zs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ys={key:"privateKey",stateDefinition:{name:"crypto"}},Ls={key:"userSigningKey",stateDefinition:{name:"crypto"}},Ks={key:"userSignedPublicKey",stateDefinition:{name:"crypto"}},Xs={key:"accountSecurityState",stateDefinition:{name:"crypto"}},qs={key:"accountCryptographicState",stateDefinition:{name:"crypto"}};class Hs extends Le{migrate(e){return zs(this,void 0,void 0,function*(){const t=yield e.getAccounts();for(const{userId:i}of t){const t=yield e.getFromUser(i,qs),n=yield e.getFromUser(i,Ys),r=yield e.getFromUser(i,Ls),s=yield e.getFromUser(i,Ks),o=yield e.getFromUser(i,Xs);if(!t){let t;null!=n&&null==r&&null==s&&null==o?(t={V1:{private_key:n}},yield e.setToUser(i,qs,t)):null!=n&&null!=r&&null!=s&&null!=o?(t={V2:{private_key:n,signing_key:r,signed_public_key:s,security_state:o}},yield e.setToUser(i,qs,t)):e.logService.warning(`Incomplete cryptographic state for user ${i}, skipping migration of account cryptographic state.`)}null!=n&&(yield e.removeFromUser(i,Ys)),null!=r&&(yield e.removeFromUser(i,Ls)),null!=s&&(yield e.removeFromUser(i,Ks)),null!=o&&(yield e.removeFromUser(i,Xs))}})}rollback(e){return zs(this,void 0,void 0,function*(){throw Ye})}}var Ws=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $s={wide:"default","extra-wide":"wide"},Js={key:"popup-width",stateDefinition:{name:"popupStyle"}};class Zs extends Le{migrate(e){return Ws(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(Js);null!=t&&t in $s&&(yield e.setToGlobal(Js,$s[t]))})}rollback(e){return Ws(this,void 0,void 0,function*(){throw Ye})}}var _s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class eo extends Le{migrate(e){return _s(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 _s(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 _s(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 to=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class io extends Le{tryAddSetting(e,t,i){if(e.some(({account:e})=>void 0!==t(e))){const n=!e.some(({account:e})=>{var i;return!1===(null!==(i=t(e))&&void 0!==i&&i)});i(n)}}migrate(e){return to(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 r=null!==(n=null===(i=t.settings)||void 0===i?void 0:i.neverDomains)&&void 0!==n?n:{};for(const[s,o]of Object.entries(r))null!=e||(e={}),e[s]=o;return e},void 0),r={};null!=n&&(r.neverDomains=n),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableAddLoginNotification},e=>r.disableAddLoginNotification=e),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableChangedPasswordNotification},e=>r.disableChangedPasswordNotification=e),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableContextMenuItem},e=>r.disableContextMenuItem=e),yield e.set("global",Object.assign(Object.assign({},t),r)),yield Promise.all(i.map(t=>to(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null===(n=i.settings)||void 0===n||delete n.disableAddLoginNotification,null===(r=i.settings)||void 0===r||delete r.disableChangedPasswordNotification,null===(s=i.settings)||void 0===s||delete s.disableContextMenuItem,null===(o=i.settings)||void 0===o||delete o.neverDomains,yield e.set(t,i)})))})}rollback(e){throw new Error("Method not implemented.")}}var no=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ro extends Le{constructor(){super(0,oo)}shouldMigrate(e){return Promise.resolve(e.currentVersion<oo)}migrate(e){return no(this,void 0,void 0,function*(){if(e.currentVersion<oo)throw new Error(`Your local data is too old to be migrated. Your current state version is ${e.currentVersion}, but minimum version is ${oo}.`)})}rollback(e){return no(this,void 0,void 0,function*(){throw Ye})}}var so=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const oo=3,ao=76;function lo(){return Ne.create().with(ro).with(Ni,3,4).with(xn,4,5).with(Cr,5,6).with(bs,6,7).with(eo,7,8).with(io,8,9).with(qe,9,10).with($e,10,11).with(tt,11,12).with(rt,12,13).with(at,13,14).with(dt,14,15).with(At,15,16).with(vt,16,17).with(yt,17,18).with(It,18,19).with(Et,19,20).with(kt,20,21).with(Pt,21,22).with(xt,22,23).with(Ut,23,24).with(Nt,24,25).with(Lt,25,26).with(qt,26,27).with($t,27,28).with(Zt,28,29).with(ii,29,30).with(si,30,31).with(li,31,32).with(pi,32,33).with(yi,33,34).with(Ii,34,35).with(Ei,35,36).with(ki,36,37).with(Oi,37,38).with(Vi,38,39).with(Hi,39,40).with(Ji,40,41).with(en,41,42).with(rn,42,43).with(an,43,44).with(An,44,45).with(vn,45,46).with(Qn,46,47).with(Fn,47,48).with(Dn,48,49).with(Vn,49,50).with(zn,50,51).with(Ln,51,52).with(Hn,52,53).with(Zn,53,54).with(nr,54,55).with(ar,55,56).with(ur,56,57).with(pr,57,58).with(mr,58,59).with(Er,59,60).with(Pr,60,61).with(Vr,61,62).with(Lr,62,63).with(qr,63,64).with(ss,64,65).with(us,65,66).with(ps,66,67).with(fs,67,68).with(ws,68,69).with(Ss,69,70).with(Ts,70,71).with(Rs,71,72).with(Us,72,73).with(Ns,73,74).with(Hs,74,75).with(Zs,75,ao)}function co(e,t){return so(this,void 0,void 0,function*(){var i;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)})}function uo(e,t){return so(this,void 0,void 0,function*(){const i=()=>so(this,void 0,void 0,function*(){return(yield co(e,t))>=ao}),n=e=>so(this,void 0,void 0,function*(){const r=2*e;if(!(r>8192))return new Promise(s=>{setTimeout(()=>so(this,void 0,void 0,function*(){(yield i())||(t.info(`Waiting for migrations to finish, waiting for ${r}ms`),yield n(r)),s()}),e)})});(yield i())||(yield n(2))})}var ho=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ao{constructor(e,t,i,n,r){this.currentVersion=e,this.storageService=t,this.logService=i,this.clientType=r,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 ho(this,void 0,void 0,function*(){const e=yield this.getKnownUserIds();return Promise.all(e.map(e=>ho(this,void 0,void 0,function*(){return{userId:e,account:yield this.get(e)}})))})}getKnownUserIds(){return ho(this,void 0,void 0,function*(){return this.currentVersion<60?function(e){return ho(this,void 0,void 0,function*(){var t;return null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[]})}(this.storageService):function(e){return ho(this,void 0,void 0,function*(){const t=yield e.get(po({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.")}():po(e)}}function po(e){return`global_${e.stateDefinition.name}_${e.key}`}class go{}},21925(e,t,i){"use strict";i.d(t,{a:()=>d});var n=i(17989),r=i(24072),s=i(22203),o=i(14093),a=i(84454),l=i(73386),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends n.A{constructor(e){super(),null!=e&&(this.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,this.autofillOnPageLoad=e.autofillOnPageLoad,this.username=(0,r.e)(e.username),this.password=(0,r.e)(e.password),this.totp=(0,r.e)(e.totp),e.uris&&(this.uris=e.uris.map(e=>new l.m(e))),e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map(e=>new a.U(e))))}decrypt(e,t){return c(this,arguments,void 0,function*(e,t,i="No Cipher Context"){const n=yield this.decryptObj(this,new o.r(this),["username","password","totp"],t,`DomainType: Login; ${i}`);if(null!=this.uris){n.uris=[];for(let r=0;r<this.uris.length;r++){if(null==this.uris[r].uri)continue;const s=yield this.uris[r].decrypt(t,i),o=s.uri;if(null==o)continue;(e||(yield this.uris[r].validateChecksum(o,t)))&&n.uris.push(s)}}return null!=this.fido2Credentials&&(n.fido2Credentials=yield Promise.all(this.fido2Credentials.map(e=>e.decrypt(t)))),n})}toLoginData(){const e=new s.k;return null!=this.passwordRevisionDate&&(e.passwordRevisionDate=this.passwordRevisionDate.toISOString()),null!=this.autofillOnPageLoad&&(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.map(e=>e.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;const s=new d;return s.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,s.autofillOnPageLoad=e.autofillOnPageLoad,s.username=(0,r.u)(e.username),s.password=(0,r.u)(e.password),s.totp=(0,r.u)(e.totp),s.uris=null===(t=e.uris)||void 0===t?void 0:t.map(e=>l.m.fromJSON(e)).filter(e=>null!=e),s.fido2Credentials=null!==(n=null===(i=e.fido2Credentials)||void 0===i?void 0:i.map(e=>a.U.fromJSON(e)).filter(e=>null!=e))&&void 0!==n?n:void 0,s}toSdkLogin(){var e,t,i,n,r,s,o;return{uris:null===(e=this.uris)||void 0===e?void 0:e.map(e=>e.toSdkLoginUri()),username:null===(t=this.username)||void 0===t?void 0:t.toSdk(),password:null===(i=this.password)||void 0===i?void 0:i.toSdk(),passwordRevisionDate:null===(n=this.passwordRevisionDate)||void 0===n?void 0:n.toISOString(),totp:null===(r=this.totp)||void 0===r?void 0:r.toSdk(),autofillOnPageLoad:null!==(s=this.autofillOnPageLoad)&&void 0!==s?s:void 0,fido2Credentials:null===(o=this.fido2Credentials)||void 0===o?void 0:o.map(e=>e.toSdkFido2Credential())}}static fromSdkLogin(e){var t,i,n,s;if(!e)return;const o=new d;return o.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,o.autofillOnPageLoad=e.autofillOnPageLoad,o.username=(0,r.u)(e.username),o.password=(0,r.u)(e.password),o.totp=(0,r.u)(e.totp),o.uris=null!==(i=null===(t=e.uris)||void 0===t?void 0:t.filter(e=>null!=e.uri).map(e=>l.m.fromSdkLoginUri(e)).filter(e=>null!=e))&&void 0!==i?i:void 0,o.fido2Credentials=null!==(s=null===(n=e.fido2Credentials)||void 0===n?void 0:n.map(e=>a.U.fromSdkFido2Credential(e)).filter(e=>null!=e))&&void 0!==s?s:void 0,o}}},22191(e,t,i){"use strict";i.d(t,{Q:()=>o});var n=i(36288),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.s]})},22203(e,t,i){"use strict";i.d(t,{k:()=>s});var n=i(69886),r=i(76506);class s{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 r.S(e))),e.fido2Credentials&&(this.fido2Credentials=null===(t=e.fido2Credentials)||void 0===t?void 0:t.map(e=>new n.w(e))))}}},22327(e,t,i){"use strict";i.d(t,{f:()=>s});class n{}var r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s extends n{constructor(e,t,i,n){super(),this.userId=e,this.encryptService=t,this.key=i,this.dataPacker=n,this.assertHasValue("userId",e),this.assertHasValue("key",i),this.assertHasValue("dataPacker",n),this.assertHasValue("encryptService",t)}encrypt(e){return r(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=this.dataPacker.pack(e);const i=yield this.encryptService.encryptString(t,this.key);return t=null,i})}decrypt(e){return r(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=yield this.encryptService.decryptString(e,this.key);const i=this.dataPacker.unpack(t);return t=null,i})}assertHasValue(e,t){if(null==t)throw new Error(`${e} cannot be null or undefined`)}}},22397(e,t,i){"use strict";i.d(t,{T:()=>r});var n=i(7248);class r extends n.V{static newConstructor(e,t,i,n){const s=new r;return s.masterPasswordHash=e,s.newMasterPasswordHash=t.masterPasswordAuthenticationHash,s.key=i.masterKeyWrappedUserKey,s.authenticationData=t,s.unlockData=i,s.masterPasswordHint=n,s}}},22466(e,t,i){"use strict";i.d(t,{Y:()=>s});var n=i(94573),r=i(33812);class s{constructor(){this.alignContent=(0,n.hFB)("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-hover-default","last:tw-border-0",this.alignmentClass]}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=r.FsC({type:s,selectors:[["tr","bitRow",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)},inputs:{alignContent:[1,"alignContent"]}})},22690(e,t,i){"use strict";i.d(t,{D:()=>l});var n=i(94573),r=i(78510),s=i(8168),o=i(33812);const a=[[["","slot","title"]],[["","slot","description"]],[["","slot","button"]]];class l{constructor(){this.icon=(0,n.hFB)(r.a)}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-no-items"]],inputs:{icon:[1,"icon"]},ngContentSelectors:["[slot=title]","[slot=description]","[slot=button]"],decls:10,vars:1,consts:[[1,"tw-mx-auto","tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-pt-6"],[1,"tw-max-w-sm","tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-24","tw-content-center"],["aria-hidden","true",3,"content"],[1,"tw-font-medium","tw-text-center","tw-mt-4"],[1,"tw-text-center"],[1,"tw-space-x-2"]],template:function(e,t){1&e&&(o.NAR(a),o.j41(0,"div",0)(1,"div",1)(2,"div",2),o.nrm(3,"bit-svg",3),o.k0s(),o.j41(4,"h3",4),o.SdG(5),o.k0s(),o.j41(6,"p",5),o.SdG(7,1),o.k0s()(),o.j41(8,"div",6),o.SdG(9,2),o.k0s()()),2&e&&(o.R7$(3),o.Y8G("content",t.icon()))},dependencies:[s.k],encapsulation:2,changeDetection:0})},22733(e,t,i){"use strict";i.d(t,{Tu:()=>n,fE:()=>r,p9:()=>s});const n={AmountOff:"amount-off",PercentOff:"percent-off"},r=(e,t)=>{switch(e.type){case n.PercentOff:{const i=e.value<1?e.value:e.value/100;return Math.round(t*i*100)/100}case n.AmountOff:return e.value;default:{const t=e.type;throw new Error(`Unhandled discount type: ${t}`)}}},s=(e,t)=>{switch(t.type){case n.AmountOff:return`${new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t.value)} ${e.t("discount")}`;case n.PercentOff:{const i=t.value<1?100*t.value:t.value;return`${Math.round(i)}% ${e.t("discount")}`}}}},22869(e,t,i){"use strict";i.d(t,{V:()=>n});class n{}},22949(e,t,i){"use strict";i.d(t,{p:()=>n});class n{}},23293(e,t,i){"use strict";i.d(t,{o:()=>E});var n=i(60512),r=i(39306),s=i(66523),o=i(78781),a=i(17989),l=i(34693),c=i(36501),d=i(7919),u=i(24072),h=i(42234),A=i(50451),p=i(38453),g=i(75751),v=i(5571),f=i(19488),m=i(77720),y=i(32072),C=i(21925),w=i(50751),I=i(47328),b=i(67756),B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E extends a.A{constructor(e,t){var i;if(super(),this.initializerKey=l.M.Cipher,this.id="",this.name=new r.k(""),this.type=d.gC.Login,this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,this.viewPassword=!0,this.collectionIds=[],this.reprompt=c.b.None,null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.name=new r.k(e.name),this.notes=(0,u.e)(e.notes),this.type=e.type,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.permissions=e.permissions,this.revisionDate=new Date(e.revisionDate),this.localData=t,this.collectionIds=null!==(i=e.collectionIds)&&void 0!==i?i:[],this.creationDate=new Date(e.creationDate),this.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):void 0,this.archivedDate=null!=e.archivedDate?new Date(e.archivedDate):void 0,this.reprompt=e.reprompt,this.key=(0,u.e)(e.key),this.type){case d.gC.Login:this.login=new C.a(e.login);break;case d.gC.SecureNote:this.secureNote=new I.S(e.secureNote);break;case d.gC.Card:this.card=new f.Z(e.card);break;case d.gC.Identity:this.identity=new y.l(e.identity);break;case d.gC.SshKey:this.sshKey=new b.M(e.sshKey)}null!=e.attachments&&(this.attachments=e.attachments.map(e=>new v.o(e))),null!=e.fields&&(this.fields=e.fields.map(e=>new m.D(e))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new w._(e)))}else this.creationDate=this.revisionDate=new Date}decrypt(e){return B(this,void 0,void 0,function*(){(0,n.x)(e,"userKeyOrOrgKey","Cipher decryption");const t=new g.f(this);let i=!0,r=e;if(null!=this.key){const n=o.A.getContainerService().getEncryptService();try{r=yield n.unwrapSymmetricKey(this.key,e),i=!1}catch(s){return t.name="[error: cannot decrypt]",t.decryptionFailure=!0,t}}switch(yield this.decryptObj(this,t,["name","notes"],r),this.type){case d.gC.Login:null!=this.login&&(t.login=yield this.login.decrypt(i,r,`Cipher Id: ${this.id}`));break;case d.gC.SecureNote:null!=this.secureNote&&(t.secureNote=yield this.secureNote.decrypt());break;case d.gC.Card:null!=this.card&&(t.card=yield this.card.decrypt(r,`Cipher Id: ${this.id}`));break;case d.gC.Identity:null!=this.identity&&(t.identity=yield this.identity.decrypt(r,`Cipher Id: ${this.id}`));break;case d.gC.SshKey:null!=this.sshKey&&(t.sshKey=yield this.sshKey.decrypt(r,`Cipher Id: ${this.id}`))}if(null!=this.attachments&&this.attachments.length>0){const e=[];for(const t of this.attachments){const i=yield t.decrypt(r,`Cipher Id: ${this.id}`);e.push(i)}t.attachments=e}if(null!=this.fields&&this.fields.length>0){const e=[];for(const t of this.fields){const i=yield t.decrypt(r);e.push(i)}t.fields=e}if(null!=this.passwordHistory&&this.passwordHistory.length>0){const e=[];for(const t of this.passwordHistory){const i=yield t.decrypt(r);e.push(i)}t.passwordHistory=e}return t})}toCipherData(){const e=new A.A;switch(e.id=this.id,null!=this.organizationId&&(e.organizationId=this.organizationId),null!=this.folderId&&(e.folderId=this.folderId),e.edit=this.edit,e.viewPassword=this.viewPassword,e.organizationUseTotp=this.organizationUseTotp,e.favorite=this.favorite,e.revisionDate=this.revisionDate.toISOString(),e.type=this.type,e.collectionIds=this.collectionIds,e.creationDate=this.creationDate.toISOString(),e.deletedDate=null!=this.deletedDate?this.deletedDate.toISOString():void 0,e.reprompt=this.reprompt,null!=this.key&&null!=this.key.encryptedString&&(e.key=this.key.encryptedString),null!=this.permissions&&(e.permissions=this.permissions),e.archivedDate=null!=this.archivedDate?this.archivedDate.toISOString():void 0,this.buildDataModel(this,e,{name:null,notes:null}),e.type){case d.gC.Login:null!=this.login&&(e.login=this.login.toLoginData());break;case d.gC.SecureNote:null!=this.secureNote&&(e.secureNote=this.secureNote.toSecureNoteData());break;case d.gC.Card:null!=this.card&&(e.card=this.card.toCardData());break;case d.gC.Identity:null!=this.identity&&(e.identity=this.identity.toIdentityData());break;case d.gC.SshKey:null!=this.sshKey&&(e.sshKey=this.sshKey.toSshKeyData())}return null!=this.fields&&(e.fields=this.fields.map(e=>e.toFieldData())),null!=this.attachments&&(e.attachments=this.attachments.map(e=>e.toAttachmentData())),null!=this.passwordHistory&&(e.passwordHistory=this.passwordHistory.map(e=>e.toPasswordHistoryData())),e}static fromJSON(e){var t,i,n;if(null==e)return;const s=new E;switch(s.id=e.id,s.organizationId=e.organizationId,s.folderId=e.folderId,s.type=e.type,s.favorite=e.favorite,s.organizationUseTotp=e.organizationUseTotp,s.edit=e.edit,s.viewPassword=e.viewPassword,null!=e.permissions&&(s.permissions=new h.a(e.permissions)),s.collectionIds=e.collectionIds,s.localData=e.localData,s.reprompt=e.reprompt,s.creationDate=new Date(e.creationDate),s.revisionDate=new Date(e.revisionDate),s.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):void 0,s.archivedDate=null!=e.archivedDate?new Date(e.archivedDate):void 0,s.name=r.k.fromJSON(e.name),s.notes=(0,u.u)(e.notes),s.key=(0,u.u)(e.key),s.attachments=null===(t=e.attachments)||void 0===t?void 0:t.map(e=>v.o.fromJSON(e)).filter(e=>null!=e),s.fields=null===(i=e.fields)||void 0===i?void 0:i.map(e=>m.D.fromJSON(e)).filter(e=>null!=e),s.passwordHistory=null===(n=e.passwordHistory)||void 0===n?void 0:n.map(e=>w._.fromJSON(e)).filter(e=>null!=e),e.type){case d.gC.Card:null!=e.card&&(s.card=f.Z.fromJSON(e.card));break;case d.gC.Identity:null!=e.identity&&(s.identity=y.l.fromJSON(e.identity));break;case d.gC.Login:null!=e.login&&(s.login=C.a.fromJSON(e.login));break;case d.gC.SecureNote:null!=e.secureNote&&(s.secureNote=I.S.fromJSON(e.secureNote));break;case d.gC.SshKey:null!=e.sshKey&&(s.sshKey=b.M.fromJSON(e.sshKey))}return s}toSdkCipher(){var e,t,i,n,r,o,a;const l={id:this.id?(0,s.WD)(this.id):void 0,organizationId:this.organizationId?(0,s.WD)(this.organizationId):void 0,folderId:this.folderId?(0,s.WD)(this.folderId):void 0,collectionIds:this.collectionIds?this.collectionIds.map(s.WD):[],key:null===(e=this.key)||void 0===e?void 0:e.toSdk(),name:this.name.toSdk(),notes:null===(t=this.notes)||void 0===t?void 0:t.toSdk(),type:this.type,favorite:this.favorite,organizationUseTotp:this.organizationUseTotp,edit:this.edit,permissions:this.permissions?{delete:this.permissions.delete,restore:this.permissions.restore}:void 0,viewPassword:this.viewPassword,localData:(0,p.H)(this.localData),attachments:null===(i=this.attachments)||void 0===i?void 0:i.map(e=>e.toSdkAttachment()),fields:null===(n=this.fields)||void 0===n?void 0:n.map(e=>e.toSdkField()),passwordHistory:null===(r=this.passwordHistory)||void 0===r?void 0:r.map(e=>e.toSdkPasswordHistory()),revisionDate:this.revisionDate.toISOString(),creationDate:this.creationDate.toISOString(),deletedDate:null===(o=this.deletedDate)||void 0===o?void 0:o.toISOString(),archivedDate:null===(a=this.archivedDate)||void 0===a?void 0:a.toISOString(),reprompt:(0,c.x)(this.reprompt),login:void 0,identity:void 0,card:void 0,secureNote:void 0,sshKey:void 0,data:void 0};switch(this.type){case d.gC.Login:null!=this.login&&(l.login=this.login.toSdkLogin());break;case d.gC.SecureNote:null!=this.secureNote&&(l.secureNote=this.secureNote.toSdkSecureNote());break;case d.gC.Card:null!=this.card&&(l.card=this.card.toSdkCard());break;case d.gC.Identity:null!=this.identity&&(l.identity=this.identity.toSdkIdentity());break;case d.gC.SshKey:null!=this.sshKey&&(l.sshKey=this.sshKey.toSdkSshKey())}return l}static fromSdkCipher(e){var t,i,n;if(null==e)return;const o=new E;return o.id=e.id?(0,s.zw)(e.id):"",o.organizationId=e.organizationId?(0,s.zw)(e.organizationId):void 0,o.folderId=e.folderId?(0,s.zw)(e.folderId):void 0,o.collectionIds=e.collectionIds?e.collectionIds.map(s.zw):[],o.key=(0,u.u)(e.key),o.name=r.k.fromJSON(e.name),o.notes=(0,u.u)(e.notes),o.type=e.type,o.favorite=e.favorite,o.organizationUseTotp=e.organizationUseTotp,o.edit=e.edit,o.permissions=h.a.fromSdkCipherPermissions(e.permissions),o.viewPassword=e.viewPassword,o.localData=(0,p.e)(e.localData),o.attachments=null===(t=e.attachments)||void 0===t?void 0:t.map(e=>v.o.fromSdkAttachment(e)).filter(e=>null!=e),o.fields=null===(i=e.fields)||void 0===i?void 0:i.map(e=>m.D.fromSdkField(e)).filter(e=>null!=e),o.passwordHistory=null===(n=e.passwordHistory)||void 0===n?void 0:n.map(e=>w._.fromSdkPasswordHistory(e)).filter(e=>null!=e),o.creationDate=new Date(e.creationDate),o.revisionDate=new Date(e.revisionDate),o.deletedDate=e.deletedDate?new Date(e.deletedDate):void 0,o.archivedDate=e.archivedDate?new Date(e.archivedDate):void 0,o.reprompt=e.reprompt,o.login=C.a.fromSdkLogin(e.login),o.secureNote=I.S.fromSdkSecureNote(e.secureNote),o.card=f.Z.fromSdkCard(e.card),o.identity=y.l.fromSdkIdentity(e.identity),o.sshKey=b.M.fromSdkSshKey(e.sshKey),o}}},23327(e,t,i){"use strict";i.d(t,{U:()=>p});var n=i(94573),r=i(20266),s=i(51111),o=i(36951),a=i(87895),l=i(46730),c=i(71804),d=i(45383),u=i(33812),h=i(8168);function A(e,t){if(1&e&&(u.j41(0,"div",0),u.nrm(1,"bit-svg",1),u.k0s()),2&e){const e=u.XpG();u.R7$(),u.Y8G("content",e.IconProviderMap[e.provider()])("ariaLabel",e.name())}}class p{constructor(){this.provider=n.hFB.required(),this.name=(0,n.hFB)(),this.IconProviderMap={[c.R.Authenticator]:r.m,[c.R.Duo]:s.x,[c.R.Email]:o.f,[c.R.OrganizationDuo]:s.x,[c.R.WebAuthn]:a.R,[c.R.Yubikey]:l.C}}}p.ɵfac=function(e){return new(e||p)},p.ɵcmp=u.VBU({type:p,selectors:[["auth-two-factor-icon"]],inputs:{provider:[1,"provider"],name:[1,"name"]},decls:1,vars:1,consts:[[1,"tw-size-[70px]","tw-content-center"],[3,"content","ariaLabel"]],template:function(e,t){1&e&&u.nVh(0,A,2,2,"div",0),2&e&&u.vxM(t.IconProviderMap[t.provider()]?0:-1)},dependencies:[d.Z,h.k],encapsulation:2,changeDetection:0})},23490(e,t,i){"use strict";i.d(t,{O:()=>u});var n=i(66046),r=i(25065),s=i(33812),o=i(86388),a=i(93103),l=i(57144),c=i(77468),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e){this.avatarService=e,this.size="base",this.destroy$=new n.B,this.color$=this.avatarService.avatarColor$,this.text&&(this.text=this.text.toUpperCase())}ngOnDestroy(){return d(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}}u.ɵfac=function(e){return new(e||u)(s.rXU(o.v))},u.ɵcmp=s.VBU({type:u,selectors:[["dynamic-avatar"]],inputs:{id:"id",text:"text",title:"title",size:"size"},decls:3,vars:8,consts:[[3,"title"],["appStopClick","",3,"text","size","color","id","title"]],template:function(e,t){1&e&&(s.j41(0,"span",0),s.nrm(1,"bit-avatar",1),s.nI1(2,"async"),s.k0s()),2&e&&(s.Y8G("title",t.title),s.R7$(),s.Y8G("text",t.text)("size",t.size)("color",s.bMT(2,6,t.color$))("id",t.id)("title",t.title))},dependencies:[r.G,a.Y,l.fw,c.Jj],encapsulation:2})},23542(e,t,i){"use strict";i.d(t,{v:()=>o});var n=i(74208),r=i(33812);class s{constructor(e,t){this.document=e,this.ngZone=t,this.ngZone.runOutsideAngular(()=>{this.listener=e=>{if(e.target.closest('[aria-disabled="true"][bit-aria-disable="true"]'))return e.stopPropagation(),e.preventDefault(),!1},this.document.addEventListener("click",this.listener,!0)})}ngOnDestroy(){this.document.removeEventListener("click",this.listener,!0)}}s.ɵfac=function(e){return new(e||s)(n.KVO(n.qQL),n.KVO(r.SKi))},s.ɵprov=n.jDH({token:s,factory:s.ɵfac,providedIn:"root"});class o{constructor(){this.ariaDisabledClickCaptureService=(0,n.WQX)(s)}}o.ɵfac=function(e){return new(e||o)},o.ɵdir=r.FsC({type:o,hostVars:1,hostBindings:function(e,t){2&e&&r.BMQ("bit-aria-disable",!0)}})},23549(e,t,i){"use strict";i.d(t,{D0:()=>r,_z:()=>n,aX:()=>s});const n=Object.freeze({forwarder:"forwarder"}),r=Object.freeze({token:"token",baseUrl:"baseUrl",domain:"domain",prefix:"prefix"}),s=Object.freeze({default:"default",none:"none",allow:"allow",deny:"deny"})},23567(e,t,i){"use strict";i.d(t,{F:()=>r});var n=i(84175);class r{static nestedTraverse(e,t,i,s,o,a){if(i.length<=t)return;const l=t===i.length-1,c=i[t];if(l)return void e.push(new n.n(s,o,c));const d=e.filter(e=>e.node.name===c);if(0===d.length){const n=c+a+i[t+1];r.nestedTraverse(e,0,[n,...i.slice(t+2)],s,o,a)}else r.nestedTraverse(d[0].children,t+1,i,s,d[0],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=r.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=r.getTreeNodeObjectFromList(e[i].children,t);if(null!==n)return n}}return null}}},23965(e,t,i){"use strict";i.d(t,{vE:()=>n,YD:()=>r,hQ:()=>c,Qd:()=>C,dw:()=>P,Lf:()=>q,tc:()=>J,i0:()=>Z,I:()=>_,uB:()=>R,Kc:()=>ee,IZ:()=>L,JS:()=>te,Wt:()=>re,W7:()=>ie,Fw:()=>se,Ki:()=>D,$3:()=>oe});class n{}class r{}class s{}class o{constructor(e){this.groups=[],this.users=[],this.externalId=e.externalId,e.groups&&(this.groups=e.groups),e.users&&(this.users=e.users)}}o.isUpdate=e=>e instanceof l;class a extends o{constructor(e){if(super(e),!e.name||!e.name.encryptedString)throw new Error("Name not provided for CollectionRequest.");this.name=e.name.encryptedString}}class l extends o{constructor(e){var t,i;super(e),this.name=null!==(i=null===(t=e.name)||void 0===t?void 0:t.encryptedString)&&void 0!==i?i:null}}class c extends o{constructor(e){if(null==e||null==e.name||null==e.name.encryptedString)throw new Error("CollectionWithIdRequest must contain name.");super({externalId:e.externalId}),this.name=e.name.encryptedString,this.id=e.id}}var d=i(33338),u=i(84079),h=i(44500),A=i(93695),p=i(72245),g=i(3204),v=i(67553),f=i(52237),m=i(50545),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e,t,i,n,r){this.apiService=e,this.keyService=t,this.encryptService=i,this.collectionService=n,this.organizationService=r}collectionAdminViews$(e,t){return(0,d.z)([this.keyService.orgKeys$(t),(0,u.H)(this.apiService.getManyCollectionsWithAccessDetails(e))]).pipe((0,h.n)(([t,i])=>{if(null==(null==i?void 0:i.data)||0===i.data.length)return(0,A.of)([]);if(null==t)throw new Error("No org keys found.");return this.decryptMany(e,i.data,t)}))}update(e,t){return y(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t,!0);if(!o.isUpdate(i))throw new Error("Cannot update collection with CreateCollectionRequest.");const n=yield this.apiService.putCollection(e.organizationId,e.id,i);return yield this.updateLocalCollections(n,e,t),n})}create(e,t){return y(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t,!1);if(o.isUpdate(i))throw new Error("Cannot create collection with UpdateCollectionRequest.");const n=yield this.apiService.postCollection(e.organizationId,i);return e.id=n.id,yield this.updateLocalCollections(n,e,t),n})}delete(e,t){return y(this,void 0,void 0,function*(){yield this.apiService.deleteCollection(e,t)})}updateLocalCollections(e,t,i){return y(this,void 0,void 0,function*(){e.assigned?yield this.collectionService.upsert(new f.Fw(e),i):yield this.collectionService.delete([t.id],i)})}bulkAssignAccess(e,t,i,n){return y(this,void 0,void 0,function*(){const r=new s;r.collectionIds=t,r.users=i.map(e=>new m.I(e.id,e.readOnly,e.hidePasswords,e.manage)),r.groups=n.map(e=>new m.I(e.id,e.readOnly,e.hidePasswords,e.manage)),yield this.apiService.send("POST",`/organizations/${e}/collections/bulk-access`,r,!0,!1)})}decryptMany(e,t,i){return y(this,void 0,void 0,function*(){const n=t.map(t=>y(this,void 0,void 0,function*(){return function(e){const t=e;return(null==t?void 0:t.groups)instanceof Array&&(null==t?void 0:t.users)instanceof Array}(t)?f.nb.fromCollectionAccessDetails(t,this.encryptService,i[e]):yield f.nb.fromCollectionResponse(t,this.encryptService,i[e])}));return yield Promise.all(n)})}encrypt(e,t,i){return y(this,void 0,void 0,function*(){if(!e.organizationId)throw new Error("Collection has no organization id.");const n=yield(0,p._)(this.keyService.orgKeys$(t).pipe((0,g.T)(t=>{if(!t)throw new Error("No keys for the provided userId.");const i=t[e.organizationId];if(null==i)throw new Error("No key for this collection's organization.");return i}))),r=e.groups.map(e=>new m.I(e.id,e.readOnly,e.hidePasswords,e.manage)),s=e.users.map(e=>new m.I(e.id,e.readOnly,e.hidePasswords,e.manage));if(i){const i=yield(0,p._)(this.organizationService.organizations$(t).pipe((0,v.Sw)(e.organizationId)));if(null==i)throw new Error("No Organization found.");return new l({name:e.canEditName(i)?yield this.encryptService.encryptString(e.name,n):null,externalId:e.externalId,users:s,groups:r})}return new a({name:yield this.encryptService.encryptString(e.name,n),externalId:e.externalId,users:s,groups:r})})}}var w=i(81714),I=i(27442),b=i(69194),B=i(84679),E=i(78781),S=i(23567),Q=i(31857);const k=Q.Ok.record(Q.PM,"collections",{deserializer:e=>f.Fw.fromJSON(e),clearOn:["logout"]}),T=new Q.Ok(Q.xS,"decryptedCollections",{deserializer:e=>{var t;return null!==(t=null==e?void 0:e.map(e=>f.iY.fromJSON(e)))&&void 0!==t?t:null},clearOn:["logout","lock"]});var F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class P{constructor(e,t,i,n){this.keyService=e,this.encryptService=t,this.i18nService=i,this.stateProvider=n,this.collectionViewCache=new Map}encryptedState(e){return this.stateProvider.getUser(e,k)}decryptedState(e){return this.stateProvider.getUser(e,T)}encryptedCollections$(e){return this.encryptedState(e).state$.pipe((0,g.T)(e=>null==e?null:Object.values(e).map(e=>f.pM.fromCollectionData(e))))}decryptedCollections$(e){const t=this.collectionViewCache.get(e);if(t)return t;const i=this.decryptedState(e).state$.pipe((0,h.n)(t=>null!==t?(0,A.of)(null!=t?t:[]):this.initializeDecryptedState(e).pipe((0,h.n)(()=>w.t))),(0,I.t)({bufferSize:1,refCount:!0}));return this.collectionViewCache.set(e,i),i}defaultUserCollection$(e,t){return this.decryptedCollections$(e).pipe((0,g.T)(e=>e.find(e=>e.isDefaultCollection&&e.organizationId===t)))}initializeDecryptedState(e){return(0,d.z)([this.encryptedCollections$(e),this.keyService.orgKeys$(e).pipe((0,b.p)(e=>!!e))]).pipe((0,h.n)(([t,i])=>this.decryptMany$(t,i).pipe((0,B.o)(t=>this.setDecryptedCollections(t,e)))))}upsert(e,t){return F(this,void 0,void 0,function*(){if(null==e)return;yield this.encryptedState(t).update(t=>(null==t&&(t={}),t[e.id]=e,t));const i=yield(0,p._)(this.keyService.orgKeys$(t).pipe((0,h.n)(t=>{if(!t)throw new Error("No key for this collection's organization.");return this.decryptMany$([f.pM.fromCollectionData(e)],t)})));yield this.decryptedState(t).update(t=>{if(null==t&&(t=[]),!(null==i?void 0:i.length))return t;const n=i[0],r=t.findIndex(t=>t.id==e.id);return r>=0?t[r]=n:t.push(n),t})})}replace(e,t){return F(this,void 0,void 0,function*(){yield this.encryptedState(t).update(()=>e),yield this.decryptedState(t).update(()=>null)})}delete(e,t){return F(this,void 0,void 0,function*(){yield this.encryptedState(t).update(t=>(null==t&&(t={}),e.forEach(e=>{delete t[e]}),t)),yield this.decryptedState(t).update(t=>(null==t&&(t=[]),e.forEach(e=>{var i;(null==t?void 0:t.length)&&(t=null!==(i=t.filter(t=>t.id!=e))&&void 0!==i?i:[])}),t))})}encrypt(e,t){return F(this,void 0,void 0,function*(){const i=yield(0,p._)(this.keyService.orgKeys$(t).pipe((0,b.p)(e=>!!e),(0,g.T)(t=>t[e.organizationId])));return yield e.encrypt(i,this.encryptService)})}decryptMany$(e,t){if(null===e||0==e.length||null===t)return(0,A.of)([]);const i=[];return e.forEach(e=>{i.push((0,u.H)(e.decrypt(t[e.organizationId],this.encryptService)))}),(0,d.z)(i).pipe((0,g.T)(e=>e.sort(E.A.getSortFunction(this.i18nService,"name"))))}getAllNested(e){const t=this.groupByOrganization(e),i=[];for(const n of t.values()){const e=[];for(const t of n){const i=Object.assign(new f.iY(Object.assign(Object.assign({},t),{name:t.name})),t),n=t.name?t.name.replace(/^\/+|\/+$/g,"").split("/"):[];S.F.nestedTraverse(e,0,n,i,void 0,"/")}i.push(...e)}return i}groupByOrganization(e){const t=new Map;return e.map(e=>{var i;const n=e.organizationId;(null!==(i=t.get(n))&&void 0!==i?i:t.set(n,[]).get(n)).push(e)}),t}getNested(e,t){const i=this.getAllNested(e);return S.F.getTreeNodeObjectFromList(i,t)}setDecryptedCollections(e,t){return F(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(T,e,t)})}}class R{}class D{}var M=i(12277);class x{constructor(e){this.ids=null==e?[]:e}}var O=i(95919),G=i(73409),U=i(20702);class V extends U.r{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 O.n(this.getResponseProperty("Permissions")),this.externalId=this.getResponseProperty("ExternalId"),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 G.U(e)));const i=this.getResponseProperty("Groups");null!=i&&(this.groups=i)}}class j extends V{constructor(e){var t,i;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,this.managedByOrganization=null!==(i=this.getResponseProperty("ManagedByOrganization"))&&void 0!==i&&i}}class N extends V{constructor(e){var t;super(e),this.managedByOrganization=null!==(t=this.getResponseProperty("ManagedByOrganization"))&&void 0!==t&&t,this.ssoExternalId=this.getResponseProperty("SsoExternalId")}}class z extends U.r{constructor(e){super(e),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),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 Y extends U.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class L extends U.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.key=this.getResponseProperty("Key")}}class K extends U.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.email=this.getResponseProperty("Email"),this.name=this.getResponseProperty("Name"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status")}}var X=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class q{constructor(e){this.apiService=e}getOrganizationUser(e,t,i){return X(this,void 0,void 0,function*(){const n=new URLSearchParams;(null==i?void 0:i.includeGroups)&&n.set("includeGroups","true");const r=yield this.apiService.send("GET",`/organizations/${e}/users/${t}?${n.toString()}`,null,!0,!0);return new N(r)})}getAllUsers(e,t){return X(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 M.s(n,j)})}getAllMiniUserDetails(e){return X(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/users/mini-details`,null,!0,!0);return new M.s(t,K)})}getOrganizationUserResetPasswordDetails(e,t){return X(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 z(i)})}getManyOrganizationUserAccountRecoveryDetails(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/account-recovery-details",new x(t),!0,!0);return new M.s(i,z)})}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 X(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/reinvite",new x(t),!0,!0);return new M.s(i,Y)})}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)}postOrganizationUserAutoConfirm(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/auto-confirm",i,!0,!1)}postOrganizationUsersPublicKey(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/public-keys",new x(t),!0,!0);return new M.s(i,L)})}postOrganizationUserBulkConfirm(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/confirm",t,!0,!0);return new M.s(i,Y)})}putOrganizationUserBulkEnableSecretsManager(e,t){return X(this,void 0,void 0,function*(){yield this.apiService.send("PUT","/organizations/"+e+"/users/enable-secrets-manager",new x(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)}removeOrganizationUser(e,t){return this.apiService.send("DELETE","/organizations/"+e+"/users/"+t,null,!0,!1)}removeManyOrganizationUsers(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("DELETE","/organizations/"+e+"/users",new x(t),!0,!0);return new M.s(i,Y)})}revokeOrganizationUser(e,t){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/revoke",null,!0,!1)}revokeManyOrganizationUsers(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/revoke",new x(t),!0,!0);return new M.s(i,Y)})}revokeSelf(e){return this.apiService.send("PUT","/organizations/"+e+"/users/revoke-self",null,!0,!1)}restoreOrganizationUser(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/restore/vnext",i,!0,!1)}restoreManyOrganizationUsers(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/restore",t,!0,!0);return new M.s(i,Y)})}deleteOrganizationUser(e,t){return this.apiService.send("DELETE","/organizations/"+e+"/users/"+t+"/delete-account",null,!0,!1)}deleteManyOrganizationUsers(e,t){return X(this,void 0,void 0,function*(){const i=yield this.apiService.send("DELETE","/organizations/"+e+"/users/delete-account",new x(t),!0,!0);return new M.s(i,Y)})}}var H=i(3633);class W{constructor(e,t){this.ids=e,this.defaultUserCollectionName=t}}class ${constructor(e){this.defaultUserCollectionName=e}}class J{constructor(e,t,i,n,r){this.keyService=e,this.encryptService=t,this.organizationUserApiService=i,this.accountService=n,this.i18nService=r}orgKey$(e){return this.accountService.activeAccount$.pipe(H.F6,(0,h.n)(e=>this.keyService.orgKeys$(e)),(0,b.p)(e=>!!e),(0,g.T)(t=>t[e.id]))}buildConfirmRequest(e,t){const i=this.getEncryptedDefaultCollectionName$(e),n=this.orgKey$(e).pipe((0,h.n)(e=>this.encryptService.encapsulateKeyUnsigned(e,t)));return(0,d.z)([n,i]).pipe((0,g.T)(([e,t])=>({key:e.encryptedString,defaultUserCollectionName:t.encryptedString})))}confirmUser(e,t,i){return this.buildConfirmRequest(e,i).pipe((0,h.n)(i=>this.organizationUserApiService.postOrganizationUserConfirm(e.id,t,i)))}bulkConfirmUsers(e,t){return this.getEncryptedDefaultCollectionName$(e).pipe((0,h.n)(i=>{const n=new ee(t,i.encryptedString);return this.organizationUserApiService.postOrganizationUserBulkConfirm(e.id,n)}))}buildRestoreUserRequest(e){return this.getEncryptedDefaultCollectionName$(e).pipe((0,g.T)(e=>new $(e.encryptedString)))}restoreUser(e,t){return this.buildRestoreUserRequest(e).pipe((0,h.n)(i=>this.organizationUserApiService.restoreOrganizationUser(e.id,t,i)))}bulkRestoreUsers(e,t){return this.getEncryptedDefaultCollectionName$(e).pipe((0,h.n)(i=>{const n=new W(t,i.encryptedString);return this.organizationUserApiService.restoreManyOrganizationUsers(e.id,n)}))}getEncryptedDefaultCollectionName$(e){return this.orgKey$(e).pipe((0,h.n)(e=>this.encryptService.encryptString(this.i18nService.t("myItems"),e)))}}class Z{}class _{}class ee{constructor(e,t){this.keys=e,this.defaultUserCollectionName=t}}class te{constructor(){this.emails=[],this.collections=[]}}class ie{static newConstructor(e,t){const i=new ie;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i}}var ne=i(7248);class re extends ne.V{}class se extends re{}class oe{constructor(){this.collections=[],this.groups=[]}}},23979(e,t,i){"use strict";i.d(t,{h:()=>T});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(96141),d=i(14803),u=i(8131),h=i(94735),A=i(26411),p=i(36288),g=i(73638),v=i(74208),f=i(86226),m=i(93199),y=i(97553),C=i(43759),w=i(76356),I=i(69896),b=i(25740),B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function E(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field")(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",2),n.bIt("change",function(){v.eBV(e);const t=n.XpG();return v.Njj(t.save("domain"))}),n.k0s(),n.j41(5,"bit-hint"),n.EFF(6),n.nI1(7,"i18n"),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,2,"forwarderDomainName")),n.R7$(4),n.JRh(n.bMT(7,4,"forwarderDomainNameHint")))}function S(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field")(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",3),n.bIt("change",function(){v.eBV(e);const t=n.XpG();return v.Njj(t.save("password"))}),n.k0s(),n.j41(5,"button",4),n.bIt("change",function(){v.eBV(e);const t=n.XpG();return v.Njj(t.save("token"))}),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"apiKey")))}function Q(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field",1)(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",5),n.bIt("change",function(){v.eBV(e);const t=n.XpG();return v.Njj(t.save("baseUrl"))}),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"selfHostBaseUrl")))}const k=Object.freeze({domain:"domain",token:"token",baseUrl:"baseUrl"});class T{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.forwarder=null,this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({[k.domain]:[""],[k.token]:[""],[k.baseUrl]:[""]}),this.vendor=new o.m(1),this.saveSettings=new s.B,this.displayDomain=!1,this.displayToken=!1,this.displayBaseUrl=!1,this.refresh$=new s.B,this.destroyed$=new s.B}ngOnInit(){return B(this,void 0,void 0,function*(){const e=new o.m(1);this.vendor.pipe((0,a.T)(e=>this.generatorService.forwarder(e)),(0,d.Q)(this.destroyed$)).subscribe(t=>{this.displayDomain=t.capabilities.fields.includes("domain"),this.displayToken=t.capabilities.fields.includes("token"),this.displayBaseUrl=t.capabilities.fields.includes("baseUrl"),e.next(t)});const t=e.pipe((0,a.T)(e=>this.generatorService.settings(e,{account$:this.account$})));t.pipe((0,c.w)(),(0,d.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,d.Q)(this.destroyed$)).subscribe(e=>{for(const t in k){const i=this.settings.get(t);e.capabilities.fields.includes(t)?null==i||i.enable({emitEvent:!1}):null==i||i.disable({emitEvent:!1})}}),t.pipe((0,a.T)(e=>e.pipe((0,l.i)(1))),(0,c.w)(),(0,d.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,u.E)(this.settings.valueChanges,t),(0,d.Q)(this.destroyed$)).subscribe(([,e,t])=>{t.next(e)})})}save(e="component api call"){this.saveSettings.next(e)}ngOnChanges(e){return B(this,void 0,void 0,function*(){this.refresh$.complete(),"forwarder"in e&&this.vendor.next(this.forwarder),"account"in e&&this.account$.next(this.account)})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}T.ɵfac=function(e){return new(e||T)(n.rXU(r.ok),n.rXU(g.iE))},T.ɵcmp=n.VBU({type:T,selectors:[["tools-forwarder-settings"]],inputs:{account:"account",forwarder:"forwarder"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:4,vars:4,consts:[[1,"tw-container",3,"formGroup"],["disableMargin",""],["bitInput","","formControlName","domain","type","text","placeholder","example.com",3,"change"],["bitInput","","formControlName","token","type","password",3,"change"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"change"],["bitInput","","formControlName","baseUrl","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0),n.nVh(1,E,8,6,"bit-form-field"),n.nVh(2,S,6,3,"bit-form-field"),n.nVh(3,Q,5,3,"bit-form-field",1),n.k0s()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(),n.vxM(t.displayDomain?1:-1),n.R7$(),n.vxM(t.displayToken?2:-1),n.R7$(),n.vxM(t.displayBaseUrl?3:-1))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,A.L,f.j,m.I,y.J,C.h,w.e,I.a,p.s,h.p,b.$],encapsulation:2})},24072(e,t,i){"use strict";i.d(t,{e:()=>r,u:()=>s});var n=i(39306);const r=e=>null!=e?new n.k(e):void 0,s=e=>null!=e?n.k.fromJSON(e):void 0},24137(e,t,i){"use strict";i.d(t,{f:()=>l});var n=i(44087),r=i(65067),s=i(42503),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({imports:[n.O,r.u,s.K]})},24374(e,t,i){"use strict";i.d(t,{d:()=>p});var n=i(94573),r=i(89033),s=i(51757),o=i(15033),a=i(33812);let l=0;class c{constructor(e){this.ngControl=e,this.id=(0,n.hFB)("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-[1.12rem]","tw-h-[1.12rem]","!tw-p-[.125rem]","tw-flex-none","hover:tw-border-2","[&>label:hover]:tw-border-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-offset-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-primary-600","before:tw-content-['']","before:tw-transition","before:tw-block","before:tw-rounded-full","before:tw-size-full","disabled:tw-cursor-auto","disabled:tw-bg-secondary-100","disabled:hover:tw-border","checked:tw-bg-text-contrast","checked:tw-border-primary-600","checked:tw-border-2","checked:hover:tw-border-2","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-600","checked:disabled:hover:tw-border-secondary-600","checked:disabled:hover:tw-border-2","checked:disabled:tw-bg-background","checked:disabled:hover:before:tw-bg-secondary-600","checked:disabled:before:tw-bg-secondary-600"],this.disabledInput=(0,n.hFB)(!1,{transform:n.L39,alias:"disabled"})}get disabled(){var e;return this.disabledInput()||(null===(e=this.ngControl)||void 0===e?void 0:e.disabled)||!1}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(s.k0.requiredTrue))&&void 0!==i&&i}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=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}c.ɵfac=function(e){return new(e||c)(a.rXU(s.vO,10))},c.ɵcmp=a.VBU({type:c,selectors:[["input","type","radio","bitRadio",""]],hostVars:4,hostBindings:function(e,t){2&e&&(a.Avn("id",t.id())("disabled",t.disabled),a.HbH(t.inputClasses))},inputs:{id:[1,"id"],disabledInput:[1,"disabled","disabledInput"]},features:[a.Jv_([{provide:o.J,useExisting:c}])],attrs:["type","radio","bitRadio",""],decls:0,vars:0,template:function(e,t){},encapsulation:2});var d=i(17721),u=i(90246);const h=[[["bit-label"]],[["bit-hint"]]];let A=0;class p{get classList(){return[this.block?"tw-block":"tw-inline-block","tw-mb-1","[&_bit-hint]:tw-mt-0"]}constructor(e){this.groupComponent=e,this.id=(0,n.hFB)("bit-radio-button-"+A++),this.value=(0,n.hFB)(),this.disabled=(0,n.hFB)(!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)(a.rXU(d.Y))},p.ɵcmp=a.VBU({type:p,selectors:[["bit-radio-button"]],hostVars:3,hostBindings:function(e,t){2&e&&(a.Avn("id",t.id()),a.HbH(t.classList))},inputs:{id:[1,"id"],value:[1,"value"],disabled:[1,"disabled"]},ngContentSelectors:["bit-label","bit-hint"],decls:4,vars:5,consts:[["disableMargin","",3,"inline"],["type","radio","bitRadio","",3,"change","blur","id","disabled","value","checked"]],template:function(e,t){1&e&&(a.NAR(h),a.j41(0,"bit-form-control",0)(1,"input",1),a.bIt("change",function(){return t.onInputChange()})("blur",function(){return t.onBlur()}),a.k0s(),a.SdG(2,0,["ngProjectAs","bit-label",5,["bit-label"]]),a.SdG(3,1,["ngProjectAs","bit-hint",5,["bit-hint"]]),a.k0s()),2&e&&(a.Y8G("inline",!t.block),a.R7$(),a.Y8G("id",t.inputId)("disabled",t.groupDisabled||t.disabled())("value",t.value())("checked",t.selected))},dependencies:[r.c,u.f,c],encapsulation:2})},24558(e,t,i){"use strict";i.d(t,{R:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M0 14.8A4.8 4.8 0 0 1 4.8 10h45.4a4.8 4.8 0 0 1 4.8 4.8v32.067a4.8 4.8 0 0 1-4.8 4.8H4.8a4.8 4.8 0 0 1-4.8-4.8V14.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.2 11.6H4.8a3.2 3.2 0 0 0-3.2 3.2v32.067a3.2 3.2 0 0 0 3.2 3.2h45.4a3.2 3.2 0 0 0 3.2-3.2V14.8a3.2 3.2 0 0 0-3.2-3.2ZM4.8 10A4.8 4.8 0 0 0 0 14.8v32.067a4.8 4.8 0 0 0 4.8 4.8h45.4a4.8 4.8 0 0 0 4.8-4.8V14.8a4.8 4.8 0 0 0-4.8-4.8H4.8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M54.167 19.966H.834v-1.6h53.333v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M51.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM46.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM41.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M33.6 50.4c0 7.29-5.91 13.2-13.2 13.2-7.29 0-13.2-5.91-13.2-13.2 0-7.29 5.91-13.2 13.2-13.2 7.29 0 13.2 5.91 13.2 13.2Z"/>
    <path class="tw-fill-illustration-tertiary" d="M30.3 50.4c0 5.468-4.432 9.9-9.9 9.9-5.467 0-9.9-4.432-9.9-9.9s4.433-9.9 9.9-9.9c5.468 0 9.9 4.432 9.9 9.9Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.4 58.716a8.316 8.316 0 1 0 0-16.632 8.316 8.316 0 0 0 0 16.632Zm0 1.584c5.468 0 9.9-4.432 9.9-9.9s-4.432-9.9-9.9-9.9c-5.467 0-9.9 4.432-9.9 9.9s4.433 9.9 9.9 9.9Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M19.575 46.275a.825.825 0 1 1 1.65 0v8.25a.825.825 0 0 1-1.65 0v-8.25Z"/>
    <path class="tw-fill-illustration-outline" d="M24.525 49.575a.825.825 0 1 1 0 1.65h-8.25a.825.825 0 0 1 0-1.65h8.25Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.443-5.223 11.666-11.666 11.666C50.223 46.666 45 41.443 45 35c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45.066c5.56 0 10.066-4.507 10.066-10.066 0-5.56-4.507-10.067-10.066-10.067C51.107 24.933 46.6 29.44 46.6 35c0 5.56 4.507 10.066 10.067 10.066Zm0 1.6c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.333 45 28.556 45 35c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M78.255 59.98A22.916 22.916 0 0 1 80 68.75c0 .69-.56 1.25-1.25 1.25H35.417c-.69 0-1.25-.56-1.25-1.25a22.916 22.916 0 0 1 44.088-8.77Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.397 68.4a21.317 21.317 0 0 0-42.628 0h42.628Zm1.603.35a22.916 22.916 0 0 0-45.833 0c0 .69.56 1.25 1.25 1.25H78.75c.69 0 1.25-.56 1.25-1.25Z" clip-rule="evenodd"/>
  </svg>
`},24593(e,t,i){"use strict";i.d(t,{V:()=>me,r:()=>fe});var n=i(77468),r=i(94573),s=i(74208),o=i(83731),a=i(66046),l=i(44500),c=i(72245),d=i(3204),u=i(30675),h=i(50790),A=i(3633),p=i(54931),g=i(56962),v=i(83516),f=i(43090),m=i(75421),y=i(31442),C=i(50451),w=i(23293),I=i(11979),b=i(68016),B=i(66316),E=i(81525),S=i(29029),Q=i(81573),k=i(37579),T=i(98403),F=i(90118),P=i(62963),R=i(36801),D=i(33812),M=i(50700),x=i(56898),O=i(67311);const G="selected",U="canceled";class V{get isPassword(){return"password"===this.params.type}constructor(e,t,i){this.params=e,this.dialogRef=t,this.i18nService=i,this.titleKey=this.isPassword?"passwordGenerator":"usernameGenerator",this.generatedValue="",this.close=()=>{this.dialogRef.close({action:U})},this.selectValue=()=>{this.dialogRef.close({action:G,generatedValue:this.generatedValue})},this.onAlgorithmSelected=e=>{this.buttonLabel=e?e.useGeneratedValue:this.i18nService.t("useThisEmail"),this.generatedValue=void 0},this.uri=e.uri}onValueGenerated(e){this.generatedValue=e}static open(e,t){return e.open(V,Object.assign({},t))}}V.ɵfac=function(e){return new(e||V)(D.rXU(E.Qs),D.rXU(B.ce),D.rXU(M.W))},V.ɵcmp=D.VBU({type:V,selectors:[["web-vault-generator-dialog"]],decls:9,vars:7,consts:[["dialogSize","default","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin","",3,"valueGenerated","algorithmSelected","type","uri"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary","data-testid","select-button",3,"click","disabled"]],template:function(e,t){1&e&&(D.j41(0,"bit-dialog",0)(1,"span",1),D.EFF(2),D.nI1(3,"i18n"),D.k0s(),D.qex(4,2),D.j41(5,"vault-cipher-form-generator",3),D.bIt("valueGenerated",function(e){return t.onValueGenerated(e)})("algorithmSelected",function(e){return t.onAlgorithmSelected(e)}),D.k0s(),D.bVm(),D.qex(6,4),D.j41(7,"button",5),D.bIt("click",function(){return t.selectValue()}),D.EFF(8),D.k0s(),D.bVm(),D.k0s()),2&e&&(D.R7$(2),D.SpI(" ",D.bMT(3,5,t.titleKey)," "),D.R7$(3),D.Y8G("type",t.params.type)("uri",t.uri),D.R7$(2),D.Y8G("disabled",!(t.buttonLabel&&t.generatedValue)),D.R7$(),D.SpI(" ",t.buttonLabel," "))},dependencies:[n.MD,F.Wg,S.t,x.Q,Q.P,b.m,O.hJ,R.$Z],encapsulation:2});var j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class N{constructor(){this.dialogService=(0,s.WQX)(B.o3)}generatePassword(){return j(this,void 0,void 0,function*(){const e=V.open(this.dialogService,{data:{type:"password"}}),t=yield(0,c._)(e.closed);return null==t||"canceled"===t.action?null:t.generatedValue})}generateUsername(e){return j(this,void 0,void 0,function*(){const t=V.open(this.dialogService,{data:{type:"username",uri:e}}),i=yield(0,c._)(t.closed);return null==i||"canceled"===i.action?null:i.generatedValue})}}N.ɵfac=function(e){return new(e||N)},N.ɵprov=s.jDH({token:N,factory:N.ɵfac});var z=i(39960),Y=i(69855),L=i(5556),K=i(35500),X=i(23649),q=i(58329),H=i(12012),W=i(92411),$=i(3892),J=i(47696),Z=i(36288),_=i(86639),ee=i(75556),te=i(90300),ie=i(25740),ne=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const re=["dialogContent"];function se(e,t){1&e&&(D.j41(0,"span",4),D.EFF(1),D.nI1(2,"i18n"),D.k0s()),2&e&&(D.R7$(),D.SpI(" ",D.bMT(2,1,"archived")," "))}function oe(e,t){if(1&e&&D.nrm(0,"app-cipher-view",6),2&e){const e=D.XpG();D.Y8G("cipher",e.cipher)("collections",e.collections)("isAdminConsole",e.formConfig.isAdminConsole)}}function ae(e,t){if(1&e){const e=D.RV6();D.j41(0,"vault-cipher-form",14),D.bIt("formReady",function(){s.eBV(e);const t=D.XpG();return s.Njj(t.onFormReady())})("cipherSaved",function(t){s.eBV(e);const i=D.XpG();return s.Njj(i.onCipherSaved(t))})("formStatusChange$",function(t){s.eBV(e);const i=D.XpG();return s.Njj(i.formStatusChanged(t))}),D.j41(1,"bit-item",15)(2,"button",16),D.bIt("click",function(){s.eBV(e);const t=D.XpG();return s.Njj(t.openAttachmentsDialog())}),D.j41(3,"div",17),D.EFF(4),D.nI1(5,"i18n"),D.nrm(6,"app-premium-badge"),D.k0s(),D.nrm(7,"i",18),D.k0s()()()}if(2&e){const e=D.XpG(),t=D.sdS(12);D.Y8G("config",e.formConfig)("submitBtn",t),D.R7$(2),D.Y8G("disabled",e.attachmentsButtonDisabled),D.R7$(2),D.SpI(" ",D.bMT(5,4,"attachments")," ")}}function le(e,t){if(1&e&&(D.j41(0,"button",9),D.EFF(1),D.nI1(2,"i18n"),D.k0s()),2&e){const e=D.XpG();D.Y8G("bitAction",e.restore),D.R7$(),D.SpI(" ",D.bMT(2,2,"restore")," ")}}function ce(e,t){if(1&e&&(D.j41(0,"button",10),D.EFF(1),D.nI1(2,"i18n"),D.k0s()),2&e){const e=D.XpG();D.Y8G("bitAction",e.switchToEdit)("disabled",e.disableEdit),D.R7$(),D.SpI(" ",D.bMT(2,3,"edit")," ")}}function de(e,t){if(1&e){const e=D.RV6();D.j41(0,"button",19),D.bIt("click",function(){s.eBV(e);const t=D.XpG();return s.Njj(t.cancel())}),D.EFF(1),D.nI1(2,"i18n"),D.k0s()}2&e&&(D.R7$(),D.SpI(" ",D.bMT(2,1,"cancel")," "))}function ue(e,t){if(1&e){const e=D.RV6();D.j41(0,"button",19),D.bIt("click",function(){s.eBV(e);const t=D.XpG();return s.Njj(t.cancel())}),D.EFF(1),D.nI1(2,"i18n"),D.k0s()}2&e&&(D.R7$(),D.SpI(" ",D.bMT(2,1,"close")," "))}function he(e,t){if(1&e&&(D.nrm(0,"button",21),D.nI1(1,"i18n")),2&e){const e=D.XpG(3);D.Y8G("bitAction",e.unarchive)("label",D.bMT(1,2,"unArchive"))}}function Ae(e,t){if(1&e&&(D.nrm(0,"button",22),D.nI1(1,"i18n")),2&e){const e=D.XpG(3);D.Y8G("bitAction",e.archive)("label",D.bMT(1,2,"archiveVerb"))}}function pe(e,t){if(1&e&&(D.nVh(0,he,2,4,"button",21),D.nVh(1,Ae,2,4,"button",22)),2&e){const e=D.XpG(2);D.vxM(e.showUnarchiveBtn?0:-1),D.R7$(),D.vxM(e.showArchiveBtn?1:-1)}}function ge(e,t){if(1&e&&(D.nrm(0,"button",20),D.nI1(1,"i18n")),2&e){const e=D.XpG(2);D.Y8G("label",D.bMT(1,3,"delete"))("bitAction",e.delete)("disabled",!e.canDelete)}}function ve(e,t){if(1&e&&(D.j41(0,"div",13),D.nVh(1,pe,2,2),D.nVh(2,ge,2,5,"button",20),D.k0s()),2&e){const e=D.XpG();D.R7$(),D.vxM(e.showArchiveOptions?1:-1),D.R7$(),D.vxM(e.cipher?2:-1)}}const fe={Saved:"saved",Deleted:"deleted",PremiumUpgrade:"premiumUpgrade",Restored:"restored"};class me{get isTrashFilter(){var e;return"trash"===(null===(e=this.filter)||void 0===e?void 0:e.type)}get showCancel(){return!this.isTrashFilter&&!this.showCipherView}get showClose(){return this.isTrashFilter&&!this.showRestore}get showActionButtons(){return null!==this.cipher&&"clone"!==this.formConfig.mode}canUserRestore(){return ne(this,void 0,void 0,function*(){var e,t;return this.isTrashFilter&&(null===(e=this.cipher)||void 0===e?void 0:e.isDeleted)&&(null===(t=this.cipher)||void 0===t?void 0:t.permissions.restore)})}get loadingForm(){return this.loadForm&&!this.formReady}get disableEdit(){return!this.canEdit&&"partial-edit"!==this.formConfig.mode}get showEdit(){return this.showCipherView&&!this.isTrashFilter&&!this.showRestore}get showCipherView(){return null!=this.cipher&&("view"===this.params.mode||this.loadingForm)}get submitButtonText$(){return this.userHasPremium$.pipe((0,d.T)(e=>this.isCipherArchived&&!e?this.i18nService.t("unArchiveAndSave"):this.i18nService.t("save")))}get isCipherArchived(){var e;return null===(e=this.cipher)||void 0===e?void 0:e.isArchived}get showArchiveOptions(){return!this.params.isAdminConsoleAction&&"view"===this.params.mode}get showArchiveBtn(){var e;return this.userCanArchive()&&(null===(e=this.cipher)||void 0===e?void 0:e.canBeArchived)}get showUnarchiveBtn(){var e;return this.isCipherArchived&&!(null===(e=this.cipher)||void 0===e?void 0:e.isDeleted)}constructor(e,t,i,n,s,u,h,p,g,v,f,m,y,I,B,E,S){this.params=e,this.dialogRef=t,this.dialogService=i,this.i18nService=n,this.toastService=s,this.messagingService=u,this.logService=h,this.cipherService=p,this.accountService=g,this.router=v,this.billingAccountProfileStateService=f,this.premiumUpgradeService=m,this.cipherAuthorizationService=y,this.apiService=I,this.eventCollectionService=B,this.routedVaultFilterService=E,this.archiveService=S,this.dialogContent=r.ebz.required("dialogContent"),this.cipherFormComponent=r.ebz.required(F.zu),this.dialogComponent=(0,r.ebz)(b.m),this._cipherModified=!1,this._originalFormMode=this.params.formConfig.mode,this._formReadySubject=new a.B,this.performingInitialLoad=!0,this.userHasPremium$=this.accountService.activeAccount$.pipe((0,l.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id))),this.userId$=this.accountService.activeAccount$.pipe(A.F6),this.userCanArchive$=this.userId$.pipe((0,l.n)(e=>this.archiveService.userCanArchive$(e))),this.userCanArchive=(0,o.ot)(this.userCanArchive$,{initialValue:!1}),this.loadForm="form"===this.params.mode,this.formReady=!1,this.formConfig=this.params.formConfig,this.canDelete=!1,this.canEdit=!1,this.attachmentsButtonDisabled=!1,this.confirmedPremiumUpgrade=!1,this.restore=()=>ne(this,void 0,void 0,function*(){var e,t;yield null===(t=(e=this.params).restore)||void 0===t?void 0:t.call(e,this.cipher),this.dialogRef.close(fe.Restored)}),this.delete=()=>ne(this,void 0,void 0,function*(){if(!this.cipher)return;if(yield this.dialogService.openSimpleDialog({title:{key:"deleteItem"},content:{key:this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})){try{yield this.deleteCipher(),this.toastService.showToast({variant:"success",title:this.i18nService.t("success"),message:this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")}),this.messagingService.send(this.cipher.isDeleted?"permanentlyDeletedCipher":"deletedCipher")}catch(e){this.logService.error(e)}this._cipherModified=!1,this.dialogRef.close(fe.Deleted)}}),this.openAttachmentsDialog=()=>ne(this,void 0,void 0,function*(){var e,t,i,n,r,s;if(!(yield(0,c._)(this.userHasPremium$)))return void(yield this.premiumUpgradeService.promptForPremium(null===(e=this.cipher)||void 0===e?void 0:e.organizationId));const o=this.dialogService.open(F._A,{data:{cipherId:null===(t=this.formConfig.originalCipher)||void 0===t?void 0:t.id,organizationId:null===(i=this.formConfig.originalCipher)||void 0===i?void 0:i.organizationId,canEditCipher:null===(n=this.formConfig.originalCipher)||void 0===n?void 0:n.edit,admin:this.formConfig.admin}}),a=yield(0,c._)(o.closed);if(a.action===F.NY.Removed||a.action===F.NY.Uploaded){const e=yield(0,c._)(this.userId$);let t;if(this.formConfig.admin){const i=yield this.apiService.getCipherAdmin(null===(r=this.formConfig.originalCipher)||void 0===r?void 0:r.id),n=new C.A(i),s=new w.o(n);t=yield s.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(s,e))}else{const i=yield this.cipherService.get(null===(s=this.formConfig.originalCipher)||void 0===s?void 0:s.id,e);t=yield this.cipherService.decrypt(i,e)}this.cipherFormComponent().patchCipher(e=>(e.attachments=t.attachments,e.revisionDate=t.revisionDate,e)),this._cipherModified=!0}}),this.switchToEdit=()=>ne(this,void 0,void 0,function*(){this.cipher&&(yield this.changeMode("form"))}),this.cancel=()=>ne(this,void 0,void 0,function*(){"view"!==this.params.mode&&null!=this.cipher&&"clone"!==this.formConfig.mode?yield this.changeMode("view"):this.dialogRef.close(this._cipherModified?fe.Saved:void 0)}),this.updateCipherFromResponse=(e,t)=>ne(this,void 0,void 0,function*(){const i=new w.o(e);i.collectionIds=[...this.cipher.collectionIds];const n=yield this.cipherService.decrypt(i,t);yield this.onCipherSaved(n)}),this.archive=()=>ne(this,void 0,void 0,function*(){const e=yield(0,c._)(this.userId$);try{const t=yield this.archiveService.archiveWithServer(this.cipher.id,e);yield this.updateCipherFromResponse(t,e),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemArchiveToast")})}catch(t){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}}),this.unarchive=()=>ne(this,void 0,void 0,function*(){const e=yield(0,c._)(this.userId$);try{const t=yield this.archiveService.unarchiveWithServer(this.cipher.id,e);yield this.updateCipherFromResponse(t,e),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemUnarchivedToast")})}catch(t){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}}),this.updateTitle(),this.premiumUpgradeService.upgradeConfirmed$.pipe((0,d.T)(e=>e&&(this.confirmedPremiumUpgrade=!0)),(0,o.pQ)()).subscribe()}ngOnInit(){return ne(this,void 0,void 0,function*(){if(this.cipher=yield this.getDecryptedCipherView(this.formConfig),this.cipher){if(this.cipher.decryptionFailure)return this.dialogService.open(F.Tp,{data:{cipherIds:[this.cipher.id]},positionStrategy:new B.u3}),void this.dialogRef.close();this.collections=this.formConfig.collections.filter(e=>{var t;return null===(t=this.cipher.collectionIds)||void 0===t?void 0:t.includes(e.id)}),this.organization=this.formConfig.organizations.find(e=>e.id===this.cipher.organizationId),this.canDelete=yield(0,c._)(this.cipherAuthorizationService.canDeleteCipher$(this.cipher,this.params.isAdminConsoleAction)),this.canEdit=yield(0,c._)(this.cipherAuthorizationService.canEditCipher$(this.cipher,this.params.isAdminConsoleAction)),this.canEdit||"partial-edit"===this.formConfig.mode||"form"!==this.params.mode||(this.params.mode="view",this.loadForm=!1,this.updateTitle()),yield this.eventCollectionService.collect(p.Bx.Cipher_ClientViewed,this.cipher.id,!1,this.cipher.organizationId)}this.filter=yield(0,c._)(this.routedVaultFilterService.filter$),this.showRestore=yield this.canUserRestore(),this.performingInitialLoad=!1})}ngOnDestroy(){this.confirmedPremiumUpgrade||this._cipherModified&&this.dialogRef.close(fe.Saved)}formStatusChanged(e){this.attachmentsButtonDisabled="disabled"===e}onCipherSaved(e){return ne(this,void 0,void 0,function*(){this.cipher=e,this.collections=this.formConfig.collections.filter(t=>{var i;return null===(i=e.collectionIds)||void 0===i?void 0:i.includes(t.id)}),"add"!==this._originalFormMode&&"clone"!==this._originalFormMode||(this.formConfig.mode="edit",this.formConfig.initialValues=null);const t=yield(0,c._)(this.userId$);let i=yield this.cipherService.get(e.id,t);if(this.formConfig.isAdminConsole&&(null==i||this.formConfig.admin)){const t=yield this.apiService.getCipherAdmin(e.id);t.edit=!0,t.viewPassword=!0;const n=new C.A(t);i=new w.o(n),this.cipher.organizationUseTotp=i.organizationUseTotp}this.formConfig.originalCipher=i,this._cipherModified=!0,yield this.changeMode("view")})}onFormReady(){this.formReady=!0,this._formReadySubject.next()}getDecryptedCipherView(e){return ne(this,void 0,void 0,function*(){if(null==e.originalCipher)return;const t=yield(0,c._)(this.userId$);return yield this.cipherService.decrypt(e.originalCipher,t)})}updateTitle(){var e,t;const i={view:{[y.gC.Login]:"viewItemHeaderLogin",[y.gC.Card]:"viewItemHeaderCard",[y.gC.Identity]:"viewItemHeaderIdentity",[y.gC.SecureNote]:"viewItemHeaderNote",[y.gC.SshKey]:"viewItemHeaderSshKey"},new:{[y.gC.Login]:"newItemHeaderLogin",[y.gC.Card]:"newItemHeaderCard",[y.gC.Identity]:"newItemHeaderIdentity",[y.gC.SecureNote]:"newItemHeaderNote",[y.gC.SshKey]:"newItemHeaderSshKey"},edit:{[y.gC.Login]:"editItemHeaderLogin",[y.gC.Card]:"editItemHeaderCard",[y.gC.Identity]:"editItemHeaderIdentity",[y.gC.SecureNote]:"editItemHeaderNote",[y.gC.SshKey]:"editItemHeaderSshKey"}},n=null!==(t=null===(e=this.cipher)||void 0===e?void 0:e.type)&&void 0!==t?t:this.formConfig.cipherType;let r="view";"form"===this.params.mode&&(r="edit"===this.formConfig.mode||"partial-edit"===this.formConfig.mode?"edit":"new");const s=i[r][n];this.title=this.i18nService.t(s)}changeMode(e){return ne(this,void 0,void 0,function*(){var t;this.formReady=!1,"form"==e?(this.loadForm=!0,yield(0,c._)(this._formReadySubject)):this.loadForm=!1,this.params.mode=e,this.updateTitle(),this.dialogContent().nativeElement.parentElement.scrollTop=0,this.dialogComponent().focusHeader(),yield this.router.navigate([],{queryParams:{action:"form"===e?"edit":"view",itemId:null===(t=this.cipher)||void 0===t?void 0:t.id},queryParamsHandling:"merge",replaceUrl:!0})})}deleteCipher(){return ne(this,void 0,void 0,function*(){var e;const t=this.cipher.isUnassigned,i=(null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers)||t,n=yield(0,c._)(this.accountService.activeAccount$.pipe((0,d.T)(e=>null==e?void 0:e.id)));this.cipher.isDeleted?yield this.cipherService.deleteWithServer(this.cipher.id,n,i):yield this.cipherService.softDeleteWithServer(this.cipher.id,n,i)})}static open(e,t){return e.open(me,{data:t})}}me.ɵfac=function(e){return new(e||me)(D.rXU(E.Qs),D.rXU(B.ce),D.rXU(B.o3),D.rXU(M.W),D.rXU(Y.f),D.rXU(v.U),D.rXU(g.K),D.rXU(L.p),D.rXU(K.D),D.rXU(X.Ix),D.rXU(q.Q),D.rXU(f.l),D.rXU(I.y),D.rXU(H.G),D.rXU(p.c_),D.rXU(F.BR),D.rXU(W.J))},me.ɵcmp=D.VBU({type:me,selectors:[["app-vault-item-dialog"]],viewQuery:function(e,t){1&e&&(D.wEZ(t.dialogContent,re,5),D.wEZ(t.cipherFormComponent,F.zu,5),D.wEZ(t.dialogComponent,b.m,5)),2&e&&D.NyB(3)},features:[D.Jv_([{provide:f.l,useClass:(0,s.Rfq)(()=>z.x)},{provide:m.Q,useClass:h.I},{provide:F.vv,useClass:N},F.BR,{provide:F.e3,useClass:F.bj}])],decls:18,vars:14,consts:[["dialogContent",""],["submitBtn",""],["dialogSize","large","background","alt",3,"loading"],["bitDialogTitle","","aria-live","polite"],["bitBadge","","bitDialogHeaderEnd",""],["bitDialogContent",""],[3,"cipher","collections","isAdminConsole"],["formId","cipherForm",3,"config","submitBtn"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"bitAction"],["bitButton","","buttonType","primary","type","button",3,"bitAction","disabled"],["bitButton","","type","submit","form","cipherForm","buttonType","primary",3,"hidden"],["bitButton","","type","button","buttonType","secondary"],[1,"tw-ml-auto"],["formId","cipherForm",3,"formReady","cipherSaved","formStatusChange$","config","submitBtn"],["slot","attachment-button"],["bit-item-content","","type","button",3,"click","disabled"],[1,"tw-flex","tw-items-center","tw-gap-2"],["slot","end","aria-hidden","true",1,"bwi","bwi-angle-right"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitIconButton","bwi-trash","type","button","buttonType","dangerGhost","data-testid","delete-cipher-btn",3,"label","bitAction","disabled"],["type","button","bitIconButton","bwi-unarchive",1,"tw-mr-1",3,"bitAction","label"],["type","button","bitIconButton","bwi-archive",1,"tw-mr-1",3,"bitAction","label"]],template:function(e,t){1&e&&(D.j41(0,"bit-dialog",2)(1,"span",3),D.EFF(2),D.k0s(),D.nVh(3,se,3,3,"span",4),D.j41(4,"div",5,0),D.nVh(6,oe,1,3,"app-cipher-view",6),D.nVh(7,ae,8,6,"vault-cipher-form",7),D.k0s(),D.qex(8,8),D.nVh(9,le,3,4,"button",9),D.nVh(10,ce,3,5,"button",10),D.j41(11,"button",11,1),D.EFF(13),D.nI1(14,"async"),D.k0s(),D.nVh(15,de,3,3,"button",12),D.nVh(16,ue,3,3,"button",12),D.nVh(17,ve,3,2,"div",13),D.bVm(),D.k0s()),2&e&&(D.Y8G("loading",t.performingInitialLoad),D.R7$(2),D.SpI(" ",t.title," "),D.R7$(),D.vxM(t.isCipherArchived&&!t.params.isAdminConsoleAction?3:-1),D.R7$(3),D.vxM(t.showCipherView?6:-1),D.R7$(),D.vxM(t.loadForm?7:-1),D.R7$(2),D.vxM(t.showRestore?9:-1),D.R7$(),D.vxM(t.showEdit?10:-1),D.R7$(),D.Y8G("hidden",t.showCipherView||t.showRestore),D.R7$(2),D.SpI(" ",D.bMT(14,12,t.submitButtonText$)," "),D.R7$(2),D.vxM(t.showCancel?15:-1),D.R7$(),D.vxM(t.showClose?16:-1),D.R7$(),D.vxM(t.showActionButtons?17:-1))},dependencies:[S.t,x.Q,F.k,Q.P,b.m,O.hJ,n.MD,P.G,$.p,J.n,Z.s,F.QZ,_.z,k.C,T.k,ee.J,te.g,u.a,n.Jj,ie.$],encapsulation:2})},25024(e,t,i){"use strict";i.d(t,{D:()=>u});var n=i(94573),r=i(74208),s=i(33277),o=i(33812),a=i(37115),l=i(69855),c=i(50700);const d=new r.nKC("CopyClickListener");class u{constructor(e,t,i,r){this.platformUtilsService=e,this.toastService=t,this.i18nService=i,this.copyListener=r,this._showToast=(0,s.EW)(()=>void 0!==this.showToast()),this.toastVariant=(0,s.EW)(()=>{const e=this.showToast();return""===e||void 0===e?"success":e}),this.valueToCopy=(0,n.hFB)("",{alias:"appCopyClick"}),this.valueLabel=(0,n.hFB)(),this.showToast=(0,n.hFB)()}onClick(){const e=this.valueToCopy();if(this.platformUtilsService.copyToClipboard(e),this.copyListener&&this.copyListener.onCopy(e),this._showToast()){const e=this.valueLabel(),t=e?this.i18nService.t("valueCopied",e):this.i18nService.t("copySuccessful");this.toastService.showToast({variant:this.toastVariant(),message:t})}}}u.ɵfac=function(e){return new(e||u)(o.rXU(a.y),o.rXU(l.f),o.rXU(c.W),o.rXU(d,8))},u.ɵdir=o.FsC({type:u,selectors:[["","appCopyClick",""]],hostBindings:function(e,t){1&e&&o.bIt("click",function(){return t.onClick()})},inputs:{valueToCopy:[1,"appCopyClick","valueToCopy"],valueLabel:[1,"valueLabel"],showToast:[1,"showToast"]}})},25065(e,t,i){"use strict";i.d(t,{G:()=>n.G});var n=i(62963)},25156(){},25219(e,t,i){"use strict";i.d(t,{i:()=>y});var n=i(94573),r=i(33812),s=i(80378),o=i(77468),a=i(6056),l=i(47696),c=i(8168),d=i(67379);class u{}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=r.VBU({type:u,selectors:[["bit-card-content"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-p-4","[@media(min-width:650px)]:tw-p-6"]],template:function(e,t){1&e&&(r.NAR(),r.rj2(0,"div",0),r.SdG(1),r.eux())},encapsulation:2});var h=i(37856),A=i(25740);const p=e=>({"tw-grayscale":e});function g(e,t){1&e&&r.nrm(0,"app-premium-badge",8)}function v(e,t){1&e&&(r.j41(0,"span",9),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI(" ",r.bMT(2,1,"upgrade")," "))}class f{get disabled(){return this.variant!=s.C.Enabled}get requiresPremium(){return this.variant==s.C.RequiresPremium}get requiresUpgrade(){return this.variant==s.C.RequiresUpgrade}}function m(e,t){if(1&e&&(r.j41(0,"div"),r.nrm(1,"app-report-card",1),r.nI1(2,"i18n"),r.nI1(3,"i18n"),r.k0s()),2&e){const e=t.$implicit;r.R7$(),r.Y8G("title",r.bMT(2,5,e.title))("description",r.bMT(3,7,e.description))("route",e.route)("variant",e.variant)("icon",e.icon)}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=r.VBU({type:f,selectors:[["app-report-card"]],inputs:{title:"title",description:"description",route:"route",icon:"icon",variant:"variant"},standalone:!1,decls:12,vars:11,consts:[[1,"tw-block","tw-h-full","tw-max-w-72","tw-rounded-xl","!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","tw-overflow-hidden","tw-h-full"],[1,"tw-flex","tw-h-28","tw-bg-background-alt2","tw-text-center","tw-text-primary-300",3,"ngClass"],[1,"tw-m-auto","tw-size-20","tw-content-center"],["aria-hidden","true",1,"tw-h-full",3,"content"],[3,"ngClass"],[1,"tw-mb-4","tw-text-xl","tw-font-medium"],[1,"tw-mb-0"],[1,"tw-absolute","tw-left-2","tw-top-2"],["bitBadge","","variant","primary",1,"tw-absolute","tw-left-2","tw-top-2"]],template:function(e,t){1&e&&(r.j41(0,"a",0)(1,"bit-base-card",1)(2,"div",2)(3,"div",3),r.nrm(4,"bit-svg",4),r.k0s()(),r.j41(5,"bit-card-content",5)(6,"h3",6),r.EFF(7),r.k0s(),r.j41(8,"p",7),r.EFF(9),r.k0s()(),r.nVh(10,g,1,0,"app-premium-badge",8)(11,v,3,3,"span",9),r.k0s()()),2&e&&(r.Y8G("routerLink",t.route),r.R7$(2),r.Y8G("ngClass",r.eq3(7,p,t.disabled)),r.R7$(2),r.Y8G("content",t.icon),r.R7$(),r.Y8G("ngClass",r.eq3(9,p,t.disabled)),r.R7$(2),r.JRh(t.title),r.R7$(2),r.JRh(t.description),r.R7$(),r.vxM(t.requiresPremium?10:t.requiresUpgrade?11:-1))},dependencies:[o.YU,a.Wk,l.n,c.k,d.f,u,h.a,A.$],encapsulation:2});class y{constructor(){this.reports=(0,n.hFB)([])}}y.ɵfac=function(e){return new(e||y)},y.ɵcmp=r.VBU({type:y,selectors:[["app-report-list"]],inputs:{reports:[1,"reports"]},standalone:!1,decls:3,vars:0,consts:[[1,"tw-inline-grid","tw-place-items-stretch","tw-place-content-center","tw-grid-cols-1","@xl:tw-grid-cols-2","@4xl:tw-grid-cols-3","tw-gap-4","[&_a]:tw-max-w-none","@5xl:[&_a]:tw-max-w-72"],[3,"title","description","route","variant","icon"]],template:function(e,t){1&e&&(r.j41(0,"div",0),r.Z7z(1,m,4,9,"div",null,r.fX1),r.k0s()),2&e&&(r.R7$(),r.Dyx(t.reports()))},dependencies:[f,A.$],encapsulation:2,changeDetection:0})},25279(e,t,i){"use strict";i.d(t,{u:()=>n});class n{}},25304(e,t,i){"use strict";i.d(t,{FG:()=>a,YY:()=>o,iP:()=>r,xN:()=>s});var n=i(23549);const r=Object.freeze(Object.keys(n._z)),s=Object.freeze(Object.keys(n.D0)),o={[n._z.forwarder]:{id:n._z.forwarder,availableFields:[n.D0.baseUrl,n.D0.domain,n.D0.prefix,n.D0.token]}},a=Object.freeze(Object.values(n.aX))},25607(e,t,i){"use strict";i.d(t,{i:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;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"),this.canToggleState=null===(t=this.getResponseProperty("CanToggleState"))||void 0===t||t,this.revisionDate=this.getResponseProperty("RevisionDate")}}},25740(e,t,i){"use strict";i.d(t,{$:()=>s});var n=i(33812),r=i(50700);class s{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}s.ɵfac=function(e){return new(e||s)(n.rXU(r.W,16))},s.ɵpipe=n.EJ8({name:"i18n",type:s,pure:!0})},26038(e,t,i){"use strict";i.d(t,{Z:()=>l});var n=i(48479),r=i(84079),s=i(93695),o=i(37567),a=i(78781);function l(e){let t;try{t=e()}catch(i){return(0,o.$)(()=>i)}return a.A.isPromise(t)?(0,r.H)(t):t instanceof n.c?t:(0,s.of)(t)}},26061(e,t,i){"use strict";i.d(t,{s:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 10 71.27 66.67">
    <path class="tw-fill-illustration-bg-primary" d="M19.6 14.8a4.8 4.8 0 0 1 4.8-4.8h45.4a4.8 4.8 0 0 1 4.8 4.8v32.067a4.8 4.8 0 0 1-4.8 4.8H24.4a4.8 4.8 0 0 1-4.8-4.8V14.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M69.8 11.6H24.4a3.2 3.2 0 0 0-3.2 3.2v32.067a3.2 3.2 0 0 0 3.2 3.2h45.4a3.2 3.2 0 0 0 3.2-3.2V14.8a3.2 3.2 0 0 0-3.2-3.2ZM24.4 10a4.8 4.8 0 0 0-4.8 4.8v32.067a4.8 4.8 0 0 0 4.8 4.8h45.4a4.8 4.8 0 0 0 4.8-4.8V14.8a4.8 4.8 0 0 0-4.8-4.8H24.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M73.767 19.966H20.434v-1.6h53.333v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M71.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM66.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM61.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M67.2 50.4c0 7.29-5.91 13.2-13.2 13.2-7.29 0-13.2-5.91-13.2-13.2 0-7.29 5.91-13.2 13.2-13.2 7.29 0 13.2 5.91 13.2 13.2Z"/>
    <path class="tw-fill-illustration-tertiary" d="M46.235 47.977a2.236 2.236 0 0 1 2.236-2.236h11.057a2.236 2.236 0 0 1 2.236 2.236v7.952a2.236 2.236 0 0 1-2.236 2.236H48.471a2.236 2.236 0 0 1-2.236-2.236v-7.952Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.528 47.232H48.471a.745.745 0 0 0-.745.745v7.952c0 .411.334.745.745.745h11.057a.745.745 0 0 0 .746-.745v-7.952a.745.745 0 0 0-.746-.745Zm-11.057-1.49a2.236 2.236 0 0 0-2.236 2.235v7.952a2.236 2.236 0 0 0 2.236 2.236h11.057a2.236 2.236 0 0 0 2.236-2.236v-7.952a2.236 2.236 0 0 0-2.236-2.236H48.471Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M53.223 50.4a.776.776 0 1 1 1.553 0v3.105a.776.776 0 1 1-1.553 0V50.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.148 44.965a3.851 3.851 0 0 1 7.703 0v.776h-1.49v-.776a2.36 2.36 0 1 0-4.722 0v.776h-1.49v-.776Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M7.5 25.767a1.6 1.6 0 0 1 1.6-1.6h12.633a1.6 1.6 0 0 1 1.6 1.6v12.567H7.5V25.767Z"/>
    <path class="tw-fill-illustration-tertiary" d="M10 26.667h2.5v9.167H10v-9.167ZM14.167 28.333h2.5v7.5h-2.5v-7.5ZM18.333 26.667h2.5v9.167h-2.5v-9.167Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.533 36.667a3.2 3.2 0 0 0-3.2 3.2v33.6a3.2 3.2 0 0 0 3.2 3.2H24.3a3.2 3.2 0 0 0 3.2-3.2v-33.6a3.2 3.2 0 0 0-3.2-3.2H6.533Zm8.884 30a2.083 2.083 0 1 1 0 4.167 2.083 2.083 0 0 1 0-4.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.533 38.267a1.6 1.6 0 0 0-1.6 1.6v33.6a1.6 1.6 0 0 0 1.6 1.6H24.3a1.6 1.6 0 0 0 1.6-1.6v-33.6a1.6 1.6 0 0 0-1.6-1.6H6.533Zm8.884 26.8a3.683 3.683 0 1 1 0 7.367 3.683 3.683 0 0 1 0-7.367Zm-12.084-25.2a3.2 3.2 0 0 1 3.2-3.2H24.3a3.2 3.2 0 0 1 3.2 3.2v33.6a3.2 3.2 0 0 1-3.2 3.2H6.533a3.2 3.2 0 0 1-3.2-3.2v-33.6ZM17.5 68.75a2.083 2.083 0 1 0-4.167 0 2.083 2.083 0 0 0 4.167 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M15.417 60.066a6.317 6.317 0 1 0 0-12.633 6.317 6.317 0 0 0 0 12.633Zm0 1.6a7.917 7.917 0 1 0 0-15.833 7.917 7.917 0 0 0 0 15.833Z" clip-rule="evenodd"/>
  </svg>
`},26076(e,t,i){"use strict";i.d(t,{q:()=>r});var n=i(20702);class r extends n.r{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}}},26193(e,t,i){"use strict";i.d(t,{i:()=>d});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(58384),l=i(6307),c=i(23542);class d{constructor(){this.disabled=(0,n.hFB)(!1),this.el=(0,r.WQX)(s.aKT),this.size=(0,n.hFB)("large"),this.classList=(0,o.EW)(()=>["tw-bg-transparent","hover:tw-bg-bg-hover","focus-visible:tw-bg-bg-hover","tw-outline-none","tw-rounded-md","tw-p-0.5","tw-text-[color:inherit]","tw-text-[length:inherit]","tw-border-solid","tw-border","tw-border-transparent","tw-flex","tw-items-center","tw-justify-center","focus-visible:tw-ring-2","tw-ring-border-focus","hover:aria-disabled:tw-bg-transparent","focus-visible:aria-disabled:tw-bg-transparent",..."small"===this.size()?["tw-text-xs","tw-size-4"]:["tw-text-sm","tw-size-5"]]),(0,l.m)(this.el.nativeElement,this.disabled)}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=s.VBU({type:d,selectors:[["button","bit-chip-dismiss-button",""]],hostVars:4,hostBindings:function(e,t){2&e&&(s.HbH(t.classList()),s.AVh("tw-cursor-not-allowed",t.disabled()))},inputs:{disabled:[1,"disabled"],size:[1,"size"]},features:[s.nM4([c.v])],attrs:["bit-chip-dismiss-button",""],decls:1,vars:0,consts:[["name","bwi-close"]],template:function(e,t){1&e&&s.nrm(0,"bit-icon",0)},dependencies:[a.R],encapsulation:2,changeDetection:0})},26333(e,t,i){"use strict";i.d(t,{R:()=>S});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(83731),l=i(33338),c=i(3204),d=i(34040),u=i(12610),h=i(39444),A=i(36359),p=i(60276),g=i(29377),v=i(78781),f=i(7919),m=i(61325);var y=i(33812);const C=(e,t)=>({"tw-invisible tw-absolute":e,"tw-size-6":t}),w=(e,t)=>({"tw-flex tw-items-center tw-justify-center":e,"tw-bg-illustration-bg-primary tw-rounded-full":t}),I=(e,t,i,n)=>({color:e,width:t,height:i,fontSize:n});function b(e,t){if(1&e){const e=y.RV6();y.j41(0,"img",4),y.bIt("load",function(){s.eBV(e);const t=y.XpG(2);return s.Njj(t.imageLoaded.set(!0))})("error",function(){s.eBV(e);const t=y.XpG(2);return s.Njj(t.imageLoaded.set(!1))}),y.k0s()}if(2&e){const e=y.XpG().ngIf,t=y.XpG();y.Y8G("src",e.image,y.B4B)("ngClass",y.l_i(3,C,!t.imageLoaded(),!t.coloredIcon()))("ngStyle",t.iconStyle())}}function B(e,t){if(1&e&&(y.j41(0,"div",3),y.nrm(1,"i",5),y.k0s()),2&e){const e=y.XpG().ngIf,t=y.XpG();y.Y8G("ngClass",y.l_i(6,w,t.coloredIcon(),(null==e.icon?null:e.icon.startsWith("bwi-"))&&t.coloredIcon()))("ngStyle",t.iconStyle()),y.R7$(),y.HbH(y.VkB("tw-text-muted bwi bwi-lg ",e.icon)),y.Y8G("ngStyle",y.ziG(9,I,t.coloredIcon()?"rgb(var(--color-illustration-outline))":null,null!=e.icon&&e.icon.startsWith("credit-card")&&t.coloredIcon()?"36px":null,null!=e.icon&&e.icon.startsWith("credit-card")&&t.coloredIcon()?"30px":null,t.size()?t.size()+"px":null))}}function E(e,t){if(1&e&&(y.qex(0),y.nVh(1,b,1,6,"img",2),y.nVh(2,B,2,14,"div",3),y.bVm()),2&e){const e=t.ngIf,i=y.XpG();y.R7$(),y.vxM(e.imageEnabled&&e.image?1:-1),y.R7$(),y.vxM(e.imageEnabled&&e.image&&i.imageLoaded()?-1:2)}}class S{constructor(e,t){this.environmentService=e,this.domainSettingsService=t,this.cipher=r.hFB.required(),this.coloredIcon=(0,r.hFB)(!1),this.size=(0,r.hFB)(),this.imageLoaded=(0,s.vPA)(!1),this.iconStyle=(0,o.EW)(()=>{if(this.coloredIcon())return{width:"36px",height:"36px"};const e=this.size();return e?{width:e+"px",height:e+"px"}:{}});const i=(0,l.z)([this.environmentService.environment$.pipe((0,c.T)(e=>e.getIconsUrl())),this.domainSettingsService.showFavicons$.pipe((0,d.F)())]).pipe((0,c.T)(([e,t])=>({iconsUrl:e,showFavicon:t})),(0,u.Z)({iconsUrl:null,showFavicon:!1}),(0,d.F)());this.data$=(0,l.z)([i,(0,a.br)(this.cipher)]).pipe((0,c.T)(([{iconsUrl:e,showFavicon:t},i])=>function(e,t,i){let n="bwi-globe",r=null,s="";const o={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"};null==e&&(i=!1);const a=m.n.getType(t),l=m.n.uri(t),c=m.n.getCard(t);switch(a){case f.gC.Login:if(n="bwi-globe",l){let t=l,n=!1;if(0===t.indexOf("androidapp://")||0===t.indexOf("iosapp://")?r=null:i&&-1===t.indexOf("://")&&t.indexOf(".")>-1?(t=`http://${t}`,n=!0):i&&(n=0===t.indexOf("http")&&t.indexOf(".")>-1),n&&(t.endsWith(".onion")||t.endsWith(".i2p"))){r=null,s="images/bwi-globe.png";break}if(i&&n)try{r=`${e}/${v.A.getHostname(t)}/icon.png`,s="images/bwi-globe.png"}catch(d){}}else r=null;break;case f.gC.SecureNote:n="bwi-sticky-note";break;case f.gC.Card:n="bwi-credit-card",i&&(null==c?void 0:c.brand)&&c.brand in o&&(n=`credit-card-icon ${o[c.brand]}`);break;case f.gC.Identity:n="bwi-id-card";break;case f.gC.SshKey:n="bwi-key"}return{imageEnabled:i,image:r,fallbackImage:s,icon:n}}(e,i,t)),(0,u.Z)(null),(0,h.J)(),(0,A.M)(([e,t])=>{(null==e?void 0:e.image)!==(null==t?void 0:t.image)&&this.imageLoaded.set(!1)}),(0,c.T)(([e,t])=>t))}}S.ɵfac=function(e){return new(e||S)(y.rXU(g.v),y.rXU(p.V))},S.ɵcmp=y.VBU({type:S,selectors:[["app-vault-icon"]],inputs:{cipher:[1,"cipher"],coloredIcon:[1,"coloredIcon"],size:[1,"size"]},decls:3,vars:4,consts:[["aria-hidden","true",1,"tw-flex","tw-justify-center","tw-items-center",3,"ngStyle"],[4,"ngIf"],["alt","","decoding","async","loading","lazy",1,"tw-rounded-md",3,"src","ngClass","ngStyle"],[3,"ngClass","ngStyle"],["alt","","decoding","async","loading","lazy",1,"tw-rounded-md",3,"load","error","src","ngClass","ngStyle"],[3,"ngStyle"]],template:function(e,t){1&e&&(y.j41(0,"div",0),y.DNE(1,E,3,2,"ng-container",1),y.nI1(2,"async"),y.k0s()),2&e&&(y.Y8G("ngStyle",t.iconStyle()),y.R7$(),y.Y8G("ngIf",y.bMT(2,2,t.data$)))},dependencies:[n.MD,n.YU,n.bT,n.B3,n.Jj],encapsulation:2,changeDetection:0})},26411(e,t,i){"use strict";i.d(t,{L:()=>c});var n=i(89033),r=i(89479),s=i(61465),o=i(43759),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[n.c,r.x,s.i,o.h,n.c,r.x,s.i]})},26477(e,t,i){"use strict";i.d(t,{V:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},26657(e,t,i){"use strict";i.d(t,{$:()=>c});var n=i(94573),r=i(83731),s=i(33812),o=i(53100),a=i(38620),l=i(3892);class c{constructor(e,t,i){this.type=(0,n.hFB)(),this.disabled=(0,n.hFB)(),t&&e&&(t.loading$.pipe((0,r.pQ)()).subscribe(t=>{"submit"===this.type()?e.loading.set(t):e.disabled.set(this.disabled()||t)}),t.disabled$.pipe((0,r.pQ)()).subscribe(t=>{const i=this.disabled();!1!==i&&e.disabled.set(i||t)})),t&&i&&(i.loading$.pipe((0,r.pQ)()).subscribe(e=>{t.disabled=e}),t.disabled$.pipe((0,r.pQ)()).subscribe(e=>{i.disabled=e}))}}c.ɵfac=function(e){return new(e||c)(s.rXU(o.E),s.rXU(a.L,8),s.rXU(l.p,8))},c.ɵdir=s.FsC({type:c,selectors:[["button","bitFormButton",""]],inputs:{type:[1,"type"],disabled:[1,"disabled"]}})},27197(e,t,i){"use strict";i.d(t,{fA:()=>N,L0:()=>a,aI:()=>B,oE:()=>S,Ew:()=>D,hV:()=>F,u3:()=>U,yB:()=>Q.y});var n=i(347),r=i(33331),s=i(60512),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends n.kg{constructor(e,t,i,n,r,s,o){super(e,t,i,n),this.keyService=e,this.masterPasswordApiService=t,this.masterPasswordService=i,this.masterPasswordUnlockService=n,this.syncService=r,this.userKeyRotationService=s,this.routerService=o}changePasswordAndRotateUserKey(e,t){return o(this,void 0,void 0,function*(){const i="Could not change password and rotate user key.";(0,r.B)(e.currentPassword,"currentPassword",i),(0,r.B)(e.newPassword,"newPassword",i),(0,s.x)(e.newPasswordHint,"newPasswordHint",i);if(!(yield this.masterPasswordUnlockService.proofOfDecryption(e.currentPassword,t.id)))throw new n.AW;yield this.syncService.fullSync(!0),yield this.userKeyRotationService.rotateUserKeyMasterPasswordAndEncryptedData(e.currentPassword,e.newPassword,t,e.newPasswordHint)})}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return o(this,void 0,void 0,function*(){yield this.userKeyRotationService.rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n)})}clearDeeplinkState(){return o(this,void 0,void 0,function*(){yield this.routerService.getAndClearLoginRedirectUrl()})}}var l=i(48003),c=i(29377),d=i(56962),u=i(71373),h=i(51971),A=i(74208),p=i(52717),g=i(27866),v=i(18499),f=i(45872),m=i(37115),y=i(86214),C=i(23649),w=i(35500),I=i(1601),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class B extends l.nF{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){super(s,o,a,l,c),this.organizationInviteService=e,this.logService=t,this.policyApiService=i,this.policyService=n,this.routerService=r,this.router=d,this.accountService=u,this.configService=h}redirectToSso(e,t,i,n){return b(this,void 0,void 0,function*(){yield this.router.navigate(["/sso"],{queryParams:{identifier:n}})})}getOrgPoliciesFromOrgInvite(e){return b(this,void 0,void 0,function*(){const t=yield this.organizationInviteService.getOrganizationInvite();if(null!=t){if(t.email!==e.toLowerCase())return yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation(),void this.logService.error(`WebLoginComponentService.getOrgPoliciesFromOrgInvite: Email mismatch. Expected: ${t.email}, Received: ${e}`);let n;try{n=yield this.policyApiService.getPoliciesByToken(t.organizationId,t.token,t.email,t.organizationUserId)}catch(i){this.logService.error(i)}if(null==n)return;const r=this.policyService.getResetPasswordPolicyOptions(n,t.organizationId);return{policies:n,isPolicyAndAutoEnrollEnabled:r[1]&&r[0].autoEnrollEnabled,enforcedPasswordPolicyOptions:this.policyService.combinePoliciesIntoMasterPasswordPolicyOptions(n)}}})}}B.ɵfac=function(e){return new(e||B)(A.KVO(p.i),A.KVO(d.K),A.KVO(g.m),A.KVO(v.N),A.KVO(h.H),A.KVO(f.R),A.KVO(c.v),A.KVO(u.JJ),A.KVO(m.y),A.KVO(y._),A.KVO(C.Ix),A.KVO(w.D),A.KVO(I.w))},B.ɵprov=A.jDH({token:B,factory:B.ɵfac});var E=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class S extends l.dl{constructor(e,t,i){super(e),this.messagingService=e,this.routerService=t,this.organizationInviteService=i}handleCreateUserSuccess(){return E(this,void 0,void 0,function*(){try{yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation()}catch(e){throw new Error(e)}})}}var Q=i(29096),k=i(35185),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F extends k.K{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A){super(e,t,i,n,r,s,o,a,l,c,h,A),this.apiService=e,this.encryptService=t,this.i18nService=i,this.kdfConfigService=n,this.keyService=r,this.masterPasswordApiService=s,this.masterPasswordService=o,this.organizationApiService=a,this.organizationUserApiService=l,this.userDecryptionOptionsService=c,this.organizationInviteService=d,this.routerService=u,this.accountCryptographicStateService=h,this.registerSdkService=A}setInitialPassword(e,t,i){const n=Object.create(null,{setInitialPassword:{get:()=>super.setInitialPassword}});return T(this,void 0,void 0,function*(){yield n.setInitialPassword.call(this,e,t,i),yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation()})}initializePasswordJitPasswordUserV2Encryption(e,t){const i=Object.create(null,{initializePasswordJitPasswordUserV2Encryption:{get:()=>super.initializePasswordJitPasswordUserV2Encryption}});return T(this,void 0,void 0,function*(){yield i.initializePasswordJitPasswordUserV2Encryption.call(this,e,t),yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation()})}}var P=i(72245),R=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class D extends l.v2{constructor(e,t,i,n,r,s,o,a){super(e,t,i,n),this.keyService=e,this.accountApiService=t,this.masterPasswordService=i,this.configService=n,this.organizationInviteService=r,this.policyApiService=s,this.logService=o,this.policyService=a}getOrgNameFromOrgInvite(){return R(this,void 0,void 0,function*(){const e=yield this.organizationInviteService.getOrganizationInvite();return null==e?null:e.organizationName})}getMasterPasswordPolicyOptsFromOrgInvite(){return R(this,void 0,void 0,function*(){const e=yield this.organizationInviteService.getOrganizationInvite();if(null==e)return null;let t=null;try{t=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(i){this.logService.error(i)}if(null==t)return null;return yield(0,P._)(this.policyService.masterPasswordPolicyOptions$(null,t))})}buildRegisterRequest(e,t,i,n,r,s,o,a,l,c,d){const u=Object.create(null,{buildRegisterRequest:{get:()=>super.buildRegisterRequest}});return R(this,void 0,void 0,function*(){const h=yield u.buildRegisterRequest.call(this,e,t,i,n,r,s),A=yield this.organizationInviteService.getOrganizationInvite();return null!=A&&(h.organizationUserId=A.organizationUserId,h.orgInviteToken=A.token),o&&(h.orgSponsoredFreeFamilyPlanToken=o),a&&l&&(h.acceptEmergencyAccessInviteToken=a,h.acceptEmergencyAccessId=l),c&&d&&(h.providerInviteToken=c,h.providerUserId=d),h})}}var M=i(31436),x=i(3204),O=i(3097),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class U{constructor(e){this.platformUtilsService=e;const t=new BroadcastChannel("duoResult");this.duo2faResult$=(0,M.R)(t,"message").pipe((0,x.T)(e=>({code:e.data.code,state:e.data.state,token:`${e.data.code}|${e.data.state}`})),(0,O.u)())}listenForDuo2faResult$(){return this.duo2faResult$}launchDuoFrameless(e){return G(this,void 0,void 0,function*(){this.platformUtilsService.launchUri(e)})}}var V=i(78781),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class N{constructor(e,t,i,n,r,s){this.ssoLoginService=e,this.apiService=t,this.cryptoFunctionService=i,this.environmentService=n,this.passwordGenerationService=r,this.platformUtilsService=s}linkSso(e){return j(this,void 0,void 0,function*(){if(null==e||""===e)throw new Error("SSO identifier is required");const t=window.location.origin+"/sso-connector.html",i=yield this.apiService.preValidateSso(e),n={type:"password",length:64,uppercase:!0,lowercase:!0,number:!0,special:!1},r=yield this.passwordGenerationService.generatePassword(n),s=yield this.cryptoFunctionService.hash(r,"sha256"),o=V.A.fromArrayToUrlB64(s);yield this.ssoLoginService.setCodeVerifier(r);let a=yield this.passwordGenerationService.generatePassword(n);a+="_returnUri='/settings/organizations'",a+=`_identifier=${e}`,yield this.ssoLoginService.setSsoState(a);let l=(yield(0,P._)(this.environmentService.environment$)).getIdentityUrl()+"/connect/authorize?client_id=web&redirect_uri="+encodeURIComponent(t)+"&response_type=code&scope=api offline_access&state="+a+"&code_challenge="+o+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(e)+"&ssoToken="+encodeURIComponent(i.token);const c=yield this.apiService.getSsoUserIdentifier();l+=`&user_identifier=${encodeURIComponent(c)}`,this.platformUtilsService.launchUri(l,{sameWindow:!0})})}}},27280(e,t,i){"use strict";i.d(t,{e:()=>r});var n=i(31442);class r{constructor(e){this.type=n.ak.Generic,null!=e&&(this.type=e.type)}}},27485(e,t,i){"use strict";i.d(t,{gY:()=>Ue,PD:()=>Oe,TT:()=>Ge});var n=i(81525),r=i(77468),s=i(74208),o=i(81573),a=i(29029),l=i(45482),c=i(60989),d=i(94573),u=i(33277),h=i(83731),A=i(75811),p=i(93695),g=i(58412),v=i(65731),f=i(25065),m=i(33812),y=i(50700),C=i(3160),w=i(69855),I=i(36288),b=i(57178),B=i(58806),E=i(25740);function S(e,t){if(1&e){const e=m.RV6();m.j41(0,"billing-pricing-card",12),m.bIt("buttonClick",function(){s.eBV(e);const t=m.XpG(2);return s.Njj(t.planSelected.emit(t.premiumPlanType))}),m.j41(1,"h3",13),m.EFF(2),m.k0s()()}if(2&e){const e=m.XpG(2);m.Y8G("tagline",e.premiumCardDetails.tagline)("price",e.premiumCardDetails.price)("button",e.premiumCardDetails.button)("features",e.premiumCardDetails.features),m.R7$(2),m.SpI(" ",e.premiumCardDetails.title," ")}}function Q(e,t){if(1&e){const e=m.RV6();m.j41(0,"billing-pricing-card",12),m.bIt("buttonClick",function(){s.eBV(e);const t=m.XpG(2);return s.Njj(t.planSelected.emit(t.familiesPlanType))}),m.j41(1,"h3",13),m.EFF(2),m.k0s()()}if(2&e){const e=m.XpG(2);m.Y8G("tagline",e.familiesCardDetails.tagline)("price",e.familiesCardDetails.price)("button",e.familiesCardDetails.button)("features",e.familiesCardDetails.features),m.R7$(2),m.SpI(" ",e.familiesCardDetails.title," ")}}function k(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",14),m.bIt("click",function(){s.eBV(e);const t=m.XpG(2);return s.Njj(t.closeClicked.emit(t.closeStatus))}),m.EFF(1),m.nI1(2,"i18n"),m.k0s()}2&e&&(m.R7$(),m.SpI(" ",m.bMT(2,1,"continueWithoutUpgrading")," "))}function T(e,t){if(1&e){const e=m.RV6();m.j41(0,"section",0)(1,"header",1)(2,"button",2),m.nI1(3,"i18n"),m.bIt("click",function(){s.eBV(e);const t=m.XpG();return s.Njj(t.closeClicked.emit(t.closeStatus))}),m.k0s()(),m.j41(4,"div",3)(5,"div",4)(6,"h1",5),m.EFF(7),m.nI1(8,"i18n"),m.k0s(),m.j41(9,"p",6),m.EFF(10),m.nI1(11,"i18n"),m.k0s()(),m.j41(12,"div",7),m.nVh(13,S,3,5,"billing-pricing-card",8),m.nVh(14,Q,3,5,"billing-pricing-card",8),m.k0s(),m.j41(15,"div",9)(16,"p",10),m.EFF(17),m.nI1(18,"i18n"),m.k0s(),m.nVh(19,k,3,3,"button",11),m.k0s()()()}if(2&e){const e=m.XpG();m.R7$(2),m.Y8G("label",m.bMT(3,7,"close")),m.R7$(5),m.SpI(" ",m.bMT(8,9,e.dialogTitle())," "),m.R7$(3),m.SpI(" ",m.bMT(11,11,"individualUpgradeDescriptionMessage")," "),m.R7$(3),m.vxM(e.premiumCardDetails?13:-1),m.R7$(),m.vxM(e.familiesCardDetails?14:-1),m.R7$(3),m.SpI(" ",m.bMT(18,13,"individualUpgradeTaxInformationMessage")," "),m.R7$(2),m.vxM(e.hideContinueWithoutUpgradingButton()?-1:19)}}const F="closed";class P{constructor(e,t,i,n){this.i18nService=e,this.subscriptionPricingService=t,this.toastService=i,this.destroyRef=n,this.dialogTitleMessageOverride=(0,d.hFB)(null),this.hideContinueWithoutUpgradingButton=(0,d.hFB)(!1),this.planSelected=(0,d.CGW)(),this.closeClicked=(0,d.CGW)(),this.loading=(0,s.vPA)(!0),this.familiesPlanType=g.OU.Families,this.premiumPlanType=g.OU.Premium,this.closeStatus=F,this.dialogTitle=(0,u.EW)(()=>this.dialogTitleMessageOverride()||"individualUpgradeWelcomeMessage")}ngOnInit(){this.subscriptionPricingService.getPersonalSubscriptionPricingTiers$().pipe((0,A.W)(e=>(this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("unexpectedError")}),this.loading.set(!1),(0,p.of)([]))),(0,h.pQ)(this.destroyRef)).subscribe(e=>{this.setupCardDetails(e),this.loading.set(!1)})}setupCardDetails(e){const t=e.find(e=>e.id===g.OU.Premium),i=e.find(e=>e.id===g.OU.Families);t&&(this.premiumCardDetails=this.createCardDetails(t,"primary")),i&&(this.familiesCardDetails=this.createCardDetails(i,"secondary"))}createCardDetails(e,t){return{title:e.name,tagline:e.description,price:e.passwordManager.annualPrice?{amount:e.passwordManager.annualPrice/12,cadence:g.fQ.Monthly}:void 0,button:{text:this.i18nService.t(this.isFamiliesPlan(e.id)?"startFreeFamiliesTrial":"upgradeToPremium"),type:t},features:e.passwordManager.features.map(e=>e.value)}}isFamiliesPlan(e){return e===g.OU.Families}}P.ɵfac=function(e){return new(e||P)(m.rXU(y.W),m.rXU(C.z),m.rXU(w.f),m.rXU(s.abz))},P.ɵcmp=m.VBU({type:P,selectors:[["app-upgrade-account"]],inputs:{dialogTitleMessageOverride:[1,"dialogTitleMessageOverride"],hideContinueWithoutUpgradingButton:[1,"hideContinueWithoutUpgradingButton"]},outputs:{planSelected:"planSelected",closeClicked:"closeClicked"},decls:1,vars:1,consts:[["cdkTrapFocus","","cdkTrapFocusAutoCapture","",1,"tw-w-screen","tw-max-h-screen","tw-min-w-[332px]","md:tw-max-w-4xl","tw-overflow-y-auto","tw-self-center","tw-bg-background","tw-rounded-xl","tw-shadow-lg","tw-border-secondary-100","tw-border-solid","tw-border"],[1,"tw-flex","tw-items-center","tw-justify-end","tw-pl-6","tw-pt-3","tw-pr-2"],["cdkFocusInitial","","type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","default",3,"click","label"],[1,"tw-px-14","tw-pb-8"],[1,"tw-flex","tw-text-center","tw-flex-col","tw-pb-4"],[1,"tw-font-medium","tw-text-[32px]"],["bitTypography","body1",1,"tw-text-muted"],[1,"tw-grid","tw-grid-cols-1","sm:tw-grid-cols-2","tw-gap-5","tw-mb-4"],[1,"tw-w-full","tw-min-w-[216px]","tw-max-w-[456px]",3,"tagline","price","button","features"],[1,"tw-text-center","tw-w-full"],["bitTypography","helper",1,"tw-text-muted","tw-italic"],["bitLink","","linkType","primary","type","button"],[1,"tw-w-full","tw-min-w-[216px]","tw-max-w-[456px]",3,"buttonClick","tagline","price","button","features"],["slot","title","bitTypography","h3",1,"tw-m-0"],["bitLink","","linkType","primary","type","button",3,"click"]],template:function(e,t){1&e&&m.nVh(0,T,20,15,"section",0),2&e&&m.vxM(t.loading()?-1:0)},dependencies:[r.MD,o.P,f.G,I.s,b.g,B.r,l.IJ,v.Y2,c.kB,E.$],encapsulation:2});var R=i(51757),D=i(44500),M=i(27442),x=i(43008),O=i(83892),G=i(12610),U=i(36006),V=i(33338),j=i(3204),N=i(84079),z=i(32706),Y=i(90107),L=i(9753),K=i(14055),X=i(69022),q=i(55159),H=i(1035),W=i(68395),$=i(67553),J=i(84488),Z=i(3633),_=i(64447),ee=i(82468),te=i(39488),ie=i(9327),ne=i(76687),re=i(58605),se=i(35500),oe=i(1601),ae=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class le{constructor(e,t,i,n,r,s,o,a,l){this.organizationBillingService=e,this.accountBillingClient=t,this.previewInvoiceClient=i,this.logService=n,this.syncService=r,this.organizationService=s,this.accountService=o,this.subscriberBillingClient=a,this.configService=l,this.userIsOwnerOfFreeOrg$=this.accountService.activeAccount$.pipe(Z.F6,(0,D.n)(e=>this.organizationService.organizations$(e)),(0,q.Z)(e=>e),(0,H.I)(e=>e.isFreeOrg&&e.isOwner),(0,W.U)(!1),(0,j.T)(e=>e instanceof J.y)),this.adminConsoleRouteForOwnedOrganization$=this.accountService.activeAccount$.pipe(Z.F6,(0,D.n)(e=>this.organizationService.organizations$(e)),(0,q.Z)(e=>e),(0,H.I)(e=>e.isFreeOrg&&e.isOwner),(0,j.T)(e=>`/organizations/${e.id}/billing/subscription`)),this.accountCredit$=this.accountService.activeAccount$.pipe(ne.$i,(0,D.n)(e=>this.subscriberBillingClient.getCredit(e)))}calculateEstimatedTax(e,t,i){return ae(this,void 0,void 0,function*(){const n=e.tier===g.OU.Families,r=e.tier===g.OU.Premium;let s=null;if(n){const e={tier:"families",cadence:"annually",passwordManager:{seats:1,additionalStorage:0,sponsored:!1}};s=this.previewInvoiceClient.previewTaxForOrganizationSubscriptionPurchase(e,t,i)}if(r&&(s=this.previewInvoiceClient.previewTaxForPremiumSubscriptionPurchase(0,t,i)),null===s)throw new Error("Preview client call is not defined");try{return(yield s).tax}catch(o){throw this.logService.error("Tax calculation failed:",o),o}})}upgradeToPremium(e,t,i){return ae(this,void 0,void 0,function*(){this.validatePaymentAndBillingInfo(e,t),yield this.accountBillingClient.purchaseSubscription(e,t,i),yield this.refreshAndSync()})}upgradeToFamilies(e,t,i,n,r){return ae(this,void 0,void 0,function*(){const s=n.billingAddress;if(!n.organizationName)throw new Error("Organization name is required for families upgrade");this.validatePaymentAndBillingInfo(i,s);const o=this.getPasswordManagerSeats(t),a=(yield this.configService.getFeatureFlag(ee.TO.PM26462_Milestone_3))?_.OL.FamiliesAnnually:_.OL.FamiliesAnnually2025,l=Object.assign({organization:{name:n.organizationName,billingEmail:e.email},plan:{type:a,passwordManagerSeats:o},payment:{paymentMethod:[i.token,this.getPaymentMethodType(i)],billing:{country:s.country,postalCode:s.postalCode}}},(null==r?void 0:r.length)?{coupons:r}:{}),c=yield this.organizationBillingService.purchaseSubscription(l,e.id);return yield this.refreshAndSync(),c})}getPasswordManagerSeats(e){return"users"in e.details.passwordManager&&e.details.passwordManager.users?e.details.passwordManager.users:0}validatePaymentAndBillingInfo(e,t){if(!(null==e?void 0:e.type))throw new Error("Payment method type is missing");if(e.type!==K.mv.accountCredit&&!(null==e?void 0:e.token))throw new Error("Payment method token is missing");if(!(null==t?void 0:t.country)||!(null==t?void 0:t.postalCode))throw new Error("Billing address information is incomplete")}refreshAndSync(){return ae(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0)})}getPaymentMethodType(e){return e.type===K.mv.accountCredit?_.eq.Credit:(0,K.x$)(e.type)}}le.ɵfac=function(e){return new(e||le)(s.KVO(re.Y),s.KVO(ie.cH),s.KVO(ie.dA),s.KVO(Y.Kc),s.KVO(te.H),s.KVO($.PV),s.KVO(se.D),s.KVO(ie.Hd),s.KVO(oe.w))},le.ɵprov=s.jDH({token:le,factory:le.ɵfac,providedIn:"root"});var ce=i(7730),de=i(68016),ue=i(67311),he=i(6056),Ae=i(26657),pe=i(38620),ge=i(56898),ve=i(44432),fe=i(86226),me=i(93199),ye=i(97553),Ce=i(43759),we=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ie=()=>({type:"checkout",supportsTaxId:!1});function be(e,t){if(1&e&&(m.j41(0,"div",16)(1,"bit-callout",21),m.EFF(2),m.nI1(3,"i18n"),m.j41(4,"a",22),m.nI1(5,"async"),m.EFF(6),m.nI1(7,"i18n"),m.nrm(8,"i",23),m.k0s()()()),2&e){const e=m.XpG(2);m.R7$(2),m.SpI(" ",m.bMT(3,3,"formWillCreateNewFamiliesOrgMessage")," "),m.R7$(2),m.Y8G("routerLink",m.bMT(5,5,e.adminConsoleRouteForOwnedOrganization$)),m.R7$(2),m.SpI(" ",m.bMT(7,7,"upgradeNow")," ")}}function Be(e,t){if(1&e&&(m.nVh(0,be,9,9,"div",16),m.nI1(1,"async"),m.j41(2,"div",17)(3,"bit-form-field",18)(4,"bit-label"),m.EFF(5),m.nI1(6,"i18n"),m.k0s(),m.nrm(7,"input",19),m.j41(8,"bit-hint",20),m.EFF(9),m.nI1(10,"i18n"),m.k0s()()()),2&e){const e=m.XpG();m.vxM(m.bMT(1,3,e.userIsOwnerOfFreeOrg$)?0:-1),m.R7$(5),m.JRh(m.bMT(6,5,"organizationName")),m.R7$(4),m.SpI(" ",m.bMT(10,7,"organizationNameDescription")," ")}}function Ee(e,t){1&e&&(m.j41(0,"p",12),m.EFF(1),m.nI1(2,"i18n"),m.k0s()),2&e&&(m.R7$(),m.SpI(" ",m.bMT(2,1,"paymentChargedWithTrial")," "))}const Se="closed",Qe="upgradedToPremium",ke="upgradedToFamilies";class Te{constructor(e,t,i,n,r,o,a){this.i18nService=e,this.subscriptionPricingService=t,this.toastService=i,this.logService=n,this.destroyRef=r,this.upgradePaymentService=o,this.subscriptionDiscountService=a,this.INITIAL_TAX_VALUE=0,this.selectedPlanId=d.hFB.required(),this.account=d.hFB.required(),this.goBack=(0,d.CGW)(),this.complete=(0,d.CGW)(),this.paymentComponent=d.ebz.required(L.Pu),this.cartSummaryComponent=d.ebz.required(v.Oo),this.formGroup=new R.gE({organizationName:new R.MJ("",[R.k0.required]),paymentForm:L.Pu.getFormGroup(),billingAddress:L.vU.getFormGroup()}),this.selectedPlan=(0,s.vPA)(null),this.loading=(0,s.vPA)(!0),this.upgradeToMessage=(0,s.vPA)(""),this.isFamiliesPlan=(0,u.EW)(()=>this.selectedPlanId()===g.OU.Families),this.discountTierType=(0,u.EW)(()=>this.isFamiliesPlan()?z.A.Families:z.A.Premium),this.eligibleDiscounts$=(0,h.br)(this.discountTierType).pipe((0,D.n)(e=>this.subscriptionDiscountService.getEligibleDiscountsForTier$(e).pipe((0,A.W)(()=>(0,p.of)([])))),(0,M.t)({bufferSize:1,refCount:!1})),this.eligibleDiscounts=(0,h.ot)(this.eligibleDiscounts$,{initialValue:[]}),this.cartDiscounts=(0,u.EW)(()=>this.eligibleDiscounts().map(e=>this.subscriptionDiscountService.mapToCartDiscount(e)).filter(e=>!!e)),this.eligibleCouponIds=(0,u.EW)(()=>this.eligibleDiscounts().map(e=>e.stripeCouponId)),this.estimatedTax$=(0,x.v)(()=>(0,O.h)(this.formGroup.controls.billingAddress.valueChanges.pipe((0,G.Z)(this.formGroup.controls.billingAddress.value)),this.eligibleDiscounts$).pipe((0,U.B)(1e3),(0,D.n)(()=>this.refreshSalesTax$()))),this.estimatedTax=(0,h.ot)(this.estimatedTax$,{initialValue:this.INITIAL_TAX_VALUE}),this.cart=(0,u.EW)(()=>{var e,t;return this.selectedPlan()?{passwordManager:{seats:{translationKey:this.isFamiliesPlan()?"familiesMembership":"premiumMembership",cost:null!==(e=this.selectedPlan().details.passwordManager.annualPrice)&&void 0!==e?e:0,quantity:1}},cadence:"annually",estimatedTax:null!==(t=this.estimatedTax())&&void 0!==t?t:0,discounts:this.cartDiscounts().length>0?this.cartDiscounts():void 0}:{passwordManager:{seats:{translationKey:"",cost:0,quantity:0}},cadence:"annually",estimatedTax:0}}),this.userIsOwnerOfFreeOrg$=this.upgradePaymentService.userIsOwnerOfFreeOrg$,this.adminConsoleRouteForOwnedOrganization$=this.upgradePaymentService.adminConsoleRouteForOwnedOrganization$,this.submit=()=>we(this,void 0,void 0,function*(){if(this.isFormValid()){if(!this.selectedPlan())throw new Error("No plan selected");try{const e=yield this.processUpgrade();e.status===ke?this.toastService.showToast({variant:"success",message:this.i18nService.t("familiesUpdated")}):e.status===Qe&&this.toastService.showToast({variant:"success",message:this.i18nService.t("premiumUpdated")}),this.complete.emit(e)}catch(e){if(this.logService.error("Upgrade failed:",e),this.subscriptionDiscountService.isDiscountExpiredError(e))return this.subscriptionDiscountService.refresh(),void this.toastService.showToast({variant:"warning",message:this.i18nService.t("discountExpiredOnPurchase")});this.toastService.showToast({variant:"error",message:this.i18nService.t("upgradeErrorMessage")})}}else this.formGroup.markAllAsTouched()})}ngOnInit(){this.isFamiliesPlan()||this.formGroup.controls.organizationName.disable(),this.pricingTiers$=this.subscriptionPricingService.getPersonalSubscriptionPricingTiers$(),this.pricingTiers$.pipe((0,A.W)(e=>(this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("unexpectedError")}),this.loading.set(!1),(0,p.of)([]))),(0,h.pQ)(this.destroyRef)).subscribe(e=>{const t=e.find(e=>e.id===this.selectedPlanId());t?(this.selectedPlan.set({tier:this.selectedPlanId(),details:t}),this.upgradeToMessage.set(this.i18nService.t(this.isFamiliesPlan()?"startFreeFamiliesTrial":"upgradeToPremium"))):this.complete.emit({status:Se,organizationId:null})}),this.loading.set(!1)}ngAfterViewInit(){const e=this.cartSummaryComponent();e.isExpanded.set(!1),this.hasEnoughAccountCredit$=(0,V.z)([e.total$,this.upgradePaymentService.accountCredit$,this.formGroup.controls.paymentForm.valueChanges.pipe((0,G.Z)(this.formGroup.controls.paymentForm.value))]).pipe((0,j.T)(([e,t,i])=>(null==i?void 0:i.type)!==K.mv.accountCredit||!!t&&t>=e),(0,M.t)({bufferSize:1,refCount:!0}))}isFormValid(){return this.formGroup.valid&&this.paymentComponent().validate()}processUpgrade(){return we(this,void 0,void 0,function*(){var e;if(!this.selectedPlan())throw new Error("No plan selected");const t=(0,L.c3)(this.formGroup.controls.billingAddress),i=null===(e=this.formGroup.value)||void 0===e?void 0:e.organizationName;if(!t.country||!t.postalCode)throw new Error("Billing address is incomplete");if(this.isFamiliesPlan()&&!i)throw new Error("Organization name is required");const n=yield this.getPaymentMethod();if(!n)throw new Error("Payment method is required");if(!("token"in n)&&this.isFamiliesPlan())throw new Error("Tokenized payment is required for families plan");return this.isFamiliesPlan()?this.processFamiliesUpgrade(i,t,n):this.processPremiumUpgrade(n,t)})}processFamiliesUpgrade(e,t,i){return we(this,void 0,void 0,function*(){const n={organizationName:e,billingAddress:t},r=yield this.upgradePaymentService.upgradeToFamilies(this.account(),this.selectedPlan(),i,n,this.eligibleCouponIds());return{status:ke,organizationId:r.id}})}processPremiumUpgrade(e,t){return we(this,void 0,void 0,function*(){return yield this.upgradePaymentService.upgradeToPremium(e,t,this.eligibleCouponIds()),{status:Qe,organizationId:null}})}getPaymentMethod(){return we(this,void 0,void 0,function*(){var e,t;return(null===(t=null===(e=this.formGroup.value)||void 0===e?void 0:e.paymentForm)||void 0===t?void 0:t.type)===K.mv.accountCredit?{type:K.mv.accountCredit}:yield this.paymentComponent().tokenize()})}refreshSalesTax$(){if(this.formGroup.invalid||!this.selectedPlan())return(0,p.of)(this.INITIAL_TAX_VALUE);const e=(0,L.c3)(this.formGroup.controls.billingAddress);return e.country&&e.postalCode?(0,N.H)(this.upgradePaymentService.calculateEstimatedTax(this.selectedPlan(),e,this.eligibleCouponIds())).pipe((0,A.W)(e=>(this.logService.error("Tax calculation failed:",e),this.toastService.showToast({variant:"error",message:this.i18nService.t("taxCalculationError")}),(0,p.of)(this.INITIAL_TAX_VALUE)))):(0,p.of)(this.INITIAL_TAX_VALUE)}}Te.ɵfac=function(e){return new(e||Te)(m.rXU(y.W),m.rXU(C.z),m.rXU(w.f),m.rXU(Y.Kc),m.rXU(s.abz),m.rXU(le),m.rXU(X.s))},Te.ɵcmp=m.VBU({type:Te,selectors:[["app-upgrade-payment"]],viewQuery:function(e,t){1&e&&(m.wEZ(t.paymentComponent,L.Pu,5),m.wEZ(t.cartSummaryComponent,v.Oo,5)),2&e&&m.NyB(2)},inputs:{selectedPlanId:[1,"selectedPlanId"],account:[1,"account"]},outputs:{goBack:"goBack",complete:"complete"},decls:30,vars:34,consts:[["paymentComponent",""],["cartSummaryComponent",""],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[1,"tw-pb-8","!tw-mx-0"],["bitTypography","h5"],[3,"showBankAccount","showAccountCredit","group","includeBillingAddress","hasEnoughAccountCredit"],["bitTypography","h5",1,"tw-pt-4","tw-pb-2"],[3,"group","scenario"],[3,"cart","showDiscountBadges"],["bitTypography","helper",1,"tw-italic","tw-text-muted","!tw-mb-0"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit",3,"disabled"],["bitButton","","type","button","buttonType","secondary",3,"click","disabled"],[1,"tw-pb-2"],[1,"tw-pb-4"],[1,"!tw-mb-0"],["bitInput","","type","text","formControlName","organizationName","required",""],["bitTypography","helper",1,"tw-text-muted"],["type","info"],["bitLink","","bitDialogClose","","linkType","primary",3,"routerLink"],["slot","end","aria-hidden","true",1,"bwi","bwi-angle-right"]],template:function(e,t){if(1&e){const e=m.RV6();m.j41(0,"form",2)(1,"bit-dialog",3)(2,"span",4),m.EFF(3),m.k0s(),m.qex(4,5),m.j41(5,"section"),m.nVh(6,Be,11,9),m.j41(7,"div",6)(8,"h5",7),m.EFF(9),m.nI1(10,"i18n"),m.k0s(),m.nrm(11,"app-enter-payment-method",8,0),m.nI1(13,"async"),m.j41(14,"h5",9),m.EFF(15),m.nI1(16,"i18n"),m.k0s(),m.nrm(17,"app-enter-billing-address",10),m.k0s()(),m.j41(18,"section"),m.nrm(19,"billing-cart-summary",11,1),m.nVh(21,Ee,3,3,"p",12),m.k0s(),m.bVm(),m.qex(22,13),m.j41(23,"button",14),m.nI1(24,"async"),m.EFF(25),m.nI1(26,"i18n"),m.k0s(),m.j41(27,"button",15),m.bIt("click",function(){return s.eBV(e),s.Njj(t.goBack.emit())}),m.EFF(28),m.nI1(29,"i18n"),m.k0s(),m.bVm(),m.k0s()()}2&e&&(m.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),m.R7$(),m.Y8G("loading",t.loading()),m.R7$(2),m.JRh(t.upgradeToMessage()),m.R7$(3),m.vxM(t.isFamiliesPlan()?6:-1),m.R7$(3),m.JRh(m.bMT(10,21,"paymentMethod")),m.R7$(2),m.Y8G("showBankAccount",t.isFamiliesPlan())("showAccountCredit",!t.isFamiliesPlan())("group",t.formGroup.controls.paymentForm)("includeBillingAddress",!1)("hasEnoughAccountCredit",m.bMT(13,23,t.hasEnoughAccountCredit$)),m.R7$(4),m.JRh(m.bMT(16,25,"billingAddress")),m.R7$(2),m.Y8G("group",t.formGroup.controls.billingAddress)("scenario",m.lJ4(33,Ie)),m.R7$(2),m.Y8G("cart",t.cart())("showDiscountBadges",!0),m.R7$(2),m.vxM(t.isFamiliesPlan()?21:-1),m.R7$(2),m.Y8G("disabled",t.loading()||!t.isFormValid()||!m.bMT(24,27,t.hasEnoughAccountCredit$)),m.R7$(2),m.SpI(" ",m.bMT(26,29,"upgrade")," "),m.R7$(2),m.Y8G("disabled",t.loading()),m.R7$(),m.SpI(" ",m.bMT(29,31,"back")," "))},dependencies:[o.P,ce.I,de.m,ue.hJ,f.G,R.qT,R.me,R.BC,R.cb,R.YS,R.j4,R.JD,he.Wk,Ae.$,pe.L,ge.Q,ve.G,fe.j,me.I,ye.J,Ce.h,b.g,B.r,v.Oo,a.t,L.Pu,L.vU,l.IJ,r.Jj,E.$],encapsulation:2});var Fe=i(66316),Pe=i(23649),Re=i(71613),De=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Me(e,t){if(1&e){const e=m.RV6();m.j41(0,"app-upgrade-account",2),m.bIt("planSelected",function(t){s.eBV(e);const i=m.XpG();return s.Njj(i.onPlanSelected(t))})("closeClicked",function(){s.eBV(e);const t=m.XpG();return s.Njj(t.onCloseClicked())}),m.k0s()}if(2&e){const e=m.XpG();m.Y8G("dialogTitleMessageOverride",e.planSelectionStepTitleOverride())("hideContinueWithoutUpgradingButton",e.hideContinueWithoutUpgradingButton())}}function xe(e,t){if(1&e){const e=m.RV6();m.j41(0,"app-upgrade-payment",3),m.bIt("goBack",function(){s.eBV(e);const t=m.XpG();return s.Njj(t.previousStep())})("complete",function(t){s.eBV(e);const i=m.XpG();return s.Njj(i.onComplete(t))}),m.k0s()}if(2&e){const e=m.XpG();m.Y8G("selectedPlanId",e.selectedPlan())("account",e.account())}}const Oe={Closed:"closed",UpgradedToPremium:"upgradedToPremium",UpgradedToFamilies:"upgradedToFamilies"},Ge={PlanSelection:"planSelection",Payment:"payment"};class Ue{constructor(e,t,i,n){this.dialogRef=e,this.params=t,this.router=i,this.premiumInterestStateService=n,this.step=(0,s.vPA)(Ge.PlanSelection),this.selectedPlan=(0,s.vPA)(null),this.account=(0,s.vPA)(null),this.planSelectionStepTitleOverride=(0,s.vPA)(null),this.hideContinueWithoutUpgradingButton=(0,s.vPA)(!1),this.hasPremiumInterest=(0,s.vPA)(!1),this.PaymentStep=Ge.Payment,this.PlanSelectionStep=Ge.PlanSelection}ngOnInit(){return De(this,void 0,void 0,function*(){var e,t,i,n;this.account.set(this.params.account),this.step.set(null!==(e=this.params.initialStep)&&void 0!==e?e:Ge.PlanSelection),this.selectedPlan.set(null!==(t=this.params.selectedPlan)&&void 0!==t?t:null),this.planSelectionStepTitleOverride.set(null!==(i=this.params.planSelectionStepTitleOverride)&&void 0!==i?i:null),this.hideContinueWithoutUpgradingButton.set(null!==(n=this.params.hideContinueWithoutUpgradingButton)&&void 0!==n&&n);(yield this.premiumInterestStateService.getPremiumInterest(this.params.account.id))&&(this.hasPremiumInterest.set(!0),yield this.premiumInterestStateService.clearPremiumInterest(this.params.account.id))})}onPlanSelected(e){this.selectedPlan.set(e),this.nextStep()}onCloseClicked(){return De(this,void 0,void 0,function*(){this.close({status:Oe.Closed})})}close(e){this.dialogRef.close(e)}nextStep(){this.step()===Ge.PlanSelection&&this.step.set(Ge.Payment)}previousStep(){return De(this,void 0,void 0,function*(){var e;this.step()===Ge.Payment&&null==(null===(e=this.params)||void 0===e?void 0:e.initialStep)?(this.step.set(Ge.PlanSelection),this.selectedPlan.set(null)):this.close({status:Oe.Closed})})}onComplete(e){return De(this,void 0,void 0,function*(){let t;switch(e.status){case"upgradedToPremium":t=Oe.UpgradedToPremium;break;case"upgradedToFamilies":t=Oe.UpgradedToFamilies;break;default:t=Oe.Closed}if(this.close({status:t,organizationId:e.organizationId}),t===Oe.UpgradedToPremium&&this.hasPremiumInterest())yield this.router.navigate(["/vault"]);else if(this.params.redirectOnCompletion&&(t===Oe.UpgradedToPremium||t===Oe.UpgradedToFamilies)){const i=t===Oe.UpgradedToFamilies?`/organizations/${e.organizationId}/vault`:"/settings/subscription/user-subscription";yield this.router.navigate([i])}})}static open(e,t){return e.open(Ue,{data:t.data})}}Ue.ɵfac=function(e){return new(e||Ue)(m.rXU(Fe.ce),m.rXU(n.Qs),m.rXU(Pe.Ix),m.rXU(Re.a))},Ue.ɵcmp=m.VBU({type:Ue,selectors:[["app-unified-upgrade-dialog"]],decls:2,vars:1,consts:[[3,"dialogTitleMessageOverride","hideContinueWithoutUpgradingButton"],[3,"selectedPlanId","account"],[3,"planSelected","closeClicked","dialogTitleMessageOverride","hideContinueWithoutUpgradingButton"],[3,"goBack","complete","selectedPlanId","account"]],template:function(e,t){1&e&&m.nVh(0,Me,1,2,"app-upgrade-account",0)(1,xe,1,2,"app-upgrade-payment",1),2&e&&m.vxM(t.step()==t.PlanSelectionStep?0:t.step()==t.PaymentStep&&null!==t.selectedPlan()&&null!==t.account()?1:-1)},dependencies:[r.MD,o.P,a.t,P,Te,l.IJ],encapsulation:2,changeDetection:0})},27520(e,t,i){"use strict";i.d(t,{S:()=>u});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(37115),l=i(78781);function c(e,t){if(1&e&&(s.rj2(0,"span",2),s.EFF(1),s.eux()),2&e){const e=s.XpG().$index;s.R7$(),s.JRh(e+1)}}function d(e,t){if(1&e&&(s.rj2(0,"span",1)(1,"span"),s.EFF(2),s.eux(),s.nVh(3,c,2,1,"span",2),s.eux()),2&e){const e=t.$implicit,i=s.XpG();s.HbH(i.getCharacterClass(e)),s.R7$(2),s.JRh(e),s.R7$(),s.vxM(i.showCount()?3:-1)}}class u{constructor(){this.password=(0,n.hFB)(""),this.showCount=(0,n.hFB)(!1),this.passwordCharArray=(0,o.EW)(()=>{var e;return Array.from(null!==(e=this.password())&&void 0!==e?e:"")}),this.platformUtilsService=(0,r.WQX)(a.y),this.elementRef=(0,r.WQX)(s.aKT),this.characterStyles={emoji:[],letter:["tw-text-main"],special:["tw-text-danger"],number:["tw-text-primary-600"]}}get classList(){return["tw-min-w-0","tw-whitespace-pre-wrap","tw-break-words"]}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(l.A.regexpEmojiPresentation))return"emoji";if(e.match(/\d/))return"number";return["&","<",">"," "].includes(e)||e.match(/[^\w ]/)?"special":"letter"}onCopy(e){e.preventDefault();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=this.elementRef.nativeElement.querySelectorAll("span[data-password-character]");let n="";i.forEach((e,i)=>{t.containsNode(e,!0)&&(n+=this.passwordCharArray()[i])}),n&&this.platformUtilsService.copyToClipboard(n)}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=s.VBU({type:u,selectors:[["bit-color-password"]],hostVars:2,hostBindings:function(e,t){1&e&&s.bIt("copy",function(e){return t.onCopy(e)}),2&e&&s.HbH(t.classList)},inputs:{password:[1,"password"],showCount:[1,"showCount"]},decls:2,vars:0,consts:[["data-password-character","",1,"tw-font-mono",3,"class"],["data-password-character","",1,"tw-font-mono"],[1,"tw-whitespace-nowrap","tw-text-xs","tw-leading-5","tw-text-main"]],template:function(e,t){1&e&&s.Z7z(0,d,4,4,"span",0,s.Vm6),2&e&&s.Dyx(t.passwordCharArray())},encapsulation:2})},27545(e,t,i){"use strict";i.d(t,{gA:()=>W,Im:()=>Z,_h:()=>be});var n=i(286),r=i(77468),s=i(66046),o=i(16878),a=i(72737),l=i(36359),c=i(44500),d=i(3204),u=i(14803),h=i(94735),A=i(56962),p=i(20136),g=i(98479),v=i(22191),f=i(59525),m=i(98403),y=i(73638),C=i(192),w=i(18030),I=i(33812),b=i(50700),B=i(27520),E=i(36288),S=i(25024),Q=i(75556),k=i(90300),T=i(4017),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function P(e,t){if(1&e&&(I.j41(0,"bit-item")(1,"bit-item-content"),I.nrm(2,"bit-color-password",0),I.j41(3,"div",1),I.EFF(4),I.nI1(5,"date"),I.k0s()(),I.qex(6,2),I.j41(7,"bit-item-action")(8,"button",3),I.EFF(9),I.k0s()(),I.bVm(),I.k0s()),2&e){const e=t.$implicit,i=I.XpG();I.R7$(2),I.Y8G("password",e.credential),I.R7$(2),I.SpI(" ",I.i5U(5,6,e.generationDate,"medium")," "),I.R7$(4),I.Y8G("appCopyClick",e.credential)("valueLabel",i.getGeneratedValueText(e))("label",i.getCopyText(e)),I.R7$(),I.SpI(" ",i.getCopyText(e)," ")}}class R{constructor(e,t,i,n){this.generatorService=e,this.history=t,this.i18nService=i,this.logService=n,this.destroyed=new s.B,this.credentials$=new o.t([]),this.account$=new a.m(1),this.debug=!1,this.log=(0,p.S2)({})}ngOnChanges(e){return F(this,void 0,void 0,function*(){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))})}ngOnInit(){this.log=(0,p.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),this.account$.pipe((0,l.M)(e=>this.log.info({accountId:e.id},"loading credential history")),(0,c.n)(e=>this.history.credentials$(e.id)),(0,d.T)(e=>e.filter(e=>{var t;return""!==(null!==(t=e.credential)&&void 0!==t?t:"")})),(0,u.Q)(this.destroyed)).subscribe(this.credentials$)}getCopyText(e){const[t]=y.I4[e.category],i=this.generatorService.algorithm(t);return(0,w.Tl)(i.i18nKeys.copyCredential,this.i18nService)}getGeneratedValueText(e){const[t]=y.I4[e.category],i=this.generatorService.algorithm(t);return(0,w.Tl)(i.i18nKeys.credentialType,this.i18nService)}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.log.debug("component destroyed")}}R.ɵfac=function(e){return new(e||R)(I.rXU(y.iE),I.rXU(C.ZS),I.rXU(b.W),I.rXU(A.K))},R.ɵcmp=I.VBU({type:R,selectors:[["bit-credential-generator-history"]],inputs:{account:"account",debug:"debug"},features:[I.OA$],decls:3,vars:2,consts:[[1,"tw-font-mono",3,"password"],["slot","secondary"],["slot","end"],["type","button","bitIconButton","bwi-clone","showToast","",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(I.Z7z(0,P,10,9,"bit-item",null,I.fX1),I.nI1(2,"async")),2&e&&I.Dyx(I.bMT(2,0,t.credentials$))},dependencies:[r.MD,g.p,B.S,v.Q,E.s,f.s,h.p,S.D,m.k,Q.J,k.g,T.D,r.Jj,r.vh],encapsulation:2});var D=i(72245),M=i(29029),x=i(81573),O=i(9171),G=i(22690),U=i(25740);class V{constructor(){this.noCredentialsIcon=O.R}}V.ɵfac=function(e){return new(e||V)},V.ɵcmp=I.VBU({type:V,selectors:[["bit-empty-credential-history"]],decls:7,vars:7,consts:[[3,"icon"],["slot","title"],["slot","description"]],template:function(e,t){1&e&&(I.j41(0,"bit-no-items",0),I.qex(1,1),I.EFF(2),I.nI1(3,"i18n"),I.bVm(),I.qex(4,2),I.EFF(5),I.nI1(6,"i18n"),I.bVm(),I.k0s()),2&e&&(I.Y8G("icon",t.noCredentialsIcon),I.R7$(2),I.JRh(I.bMT(3,3,"nothingToShow")),I.R7$(3),I.JRh(I.bMT(6,5,"nothingGeneratedRecently")))},dependencies:[h.p,f.s,G.D,U.$],encapsulation:2});var j=i(74208),N=i(35500),z=i(66316),Y=i(56898),L=i(68016),K=i(67311),X=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function q(e,t){if(1&e&&(I.nrm(0,"bit-credential-generator-history",4),I.nI1(1,"async")),2&e){const e=I.XpG();I.Y8G("account",I.bMT(1,1,e.account$))}}function H(e,t){1&e&&I.nrm(0,"bit-empty-credential-history",5)}class W{constructor(e,t,i,n){this.accountService=e,this.history=t,this.dialogService=i,this.logService=n,this.destroyed=new s.B,this.hasHistory$=new o.t(!1),this.account$=new a.m(1),this.debug=!1,this.log=(0,p.S2)({})}ngOnChanges(e){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))}ngOnInit(){return X(this,void 0,void 0,function*(){this.log=(0,p.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),this.account||(this.account=yield(0,D._)(this.accountService.activeAccount$),this.log.info({userId:this.account.id},"account not specified; using active account settings"),this.account$.next(this.account)),this.account$.pipe((0,c.n)(e=>e.id&&this.history.credentials$(e.id)),(0,d.T)(e=>e.length>0),(0,u.Q)(this.destroyed)).subscribe(this.hasHistory$)})}clear(){return X(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"clearGeneratorHistoryTitle"},content:{key:"cleargGeneratorHistoryDescription"},type:"warning",acceptButtonText:{key:"clearHistory"},cancelButtonText:{key:"cancel"}}))&&(yield this.history.clear((yield(0,D._)(this.account$)).id))})}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.log.debug("component destroyed")}}W.ɵfac=function(e){return new(e||W)(I.rXU(N.D),I.rXU(C.ZS),I.rXU(z.o3),I.rXU(A.K))},W.ɵcmp=I.VBU({type:W,selectors:[["ng-component"]],inputs:{account:"account",debug:"debug"},features:[I.OA$],decls:14,vars:12,consts:[["dialog",""],["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"account"],[2,"display","contents"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary",3,"click","disabled"]],template:function(e,t){if(1&e){const e=I.RV6();I.j41(0,"bit-dialog",1,0)(2,"span",2),I.EFF(3),I.nI1(4,"i18n"),I.k0s(),I.qex(5,3),I.nVh(6,q,2,3,"bit-credential-generator-history",4),I.nI1(7,"async"),I.vZN(8,H,1,0,"bit-empty-credential-history",5),I.bVm(),I.qex(9,6),I.j41(10,"button",7),I.nI1(11,"async"),I.bIt("click",function(){return j.eBV(e),j.Njj(t.clear())}),I.EFF(12),I.nI1(13,"i18n"),I.k0s(),I.bVm(),I.k0s()}2&e&&(I.R7$(3),I.JRh(I.bMT(4,4,"generatorHistory")),I.R7$(3),I.vxM(I.bMT(7,6,t.hasHistory$)?6:8),I.R7$(4),I.Y8G("disabled",!I.bMT(11,8,t.hasHistory$)),I.R7$(2),I.SpI(" ",I.bMT(13,10,"clearHistory")," "))},dependencies:[M.t,Y.Q,r.MD,h.p,x.P,L.m,K.hJ,R,V,r.Jj,U.$],encapsulation:2});var $=i(4162),J=i(99327);class Z{constructor(){}}Z.ɵfac=function(e){return new(e||Z)},Z.ɵmod=I.$C({type:Z}),Z.ɵinj=j.G2t({imports:[n.y,$.M,J.d]});var _=i(84079),ee=i(58363),te=i(21495),ie=i(2073),ne=i(12012),re=i(18499),se=i(82468),oe=i(89105),ae=i(1601),le=i(37115),ce=i(31857),de=i(97445),ue=i(43946),he=i(23549),Ae=i(43348),pe=i(63344),ge=i(25304),ve=i(48856),fe=i(8936),me=i(39307);var ye=i(8916);const Ce=new ie.aZ("Randomizer"),we=new ie.aZ("CredentialGeneratorProviders"),Ie=new ie.aZ("SystemServices");class be{constructor(){}}be.ɵfac=function(e){return new(e||be)},be.ɵmod=I.$C({type:be}),be.ɵinj=j.G2t({providers:[(0,te.F)({provide:Ce,useFactory:y.WX,deps:[]}),(0,te.F)({provide:ue.p,useClass:de.p,deps:[oe.N,ye.Lu]}),(0,te.F)({provide:Ae.F,useFactory:()=>{const e=new ve.T(ge.iP,ge.xN);e.registerSite(ge.YY[he._z.forwarder]);for(const t of fe.G)e.registerVendor(t);for(const t of fe.B)e.registerExtension(t);return e.setPermission({all:!0},"default"),e},deps:[]}),(0,te.F)({provide:Ie,useFactory:(e,t,i,n,r,s,o)=>{let a;a=s.isDev()?(0,p.oR)(r,[]):p.S2;return{policy:i,extension:new pe.r(n,{encryptor:e,state:t,log:a,now:Date.now}),log:a,configService:o}},deps:[ue.p,ce.v2,re.m,Ae.F,A.K,le.y,ae.w]}),(0,te.F)({provide:we,useFactory:(e,t,i,n,r,s)=>{const o={encryptor:i,state:n,log:e.log,now:Date.now},a=(0,_.H)(e.configService.getFeatureFlag(se.TO.UseSdkPasswordGenerators));let l=!1;a.pipe((0,ee.s)(1)).subscribe(e=>l=e);const c=new y.r5.i(o,e,Object.values(y.qG)),d=l?e.sdk:void 0,u=new y.r5.O(o,e.policy),h={randomizer:t,client:new me.e(s,r),i18nService:r,sdk:d,now:Date.now};return{userState:{encryptor:i,state:n,log:e.log,now:Date.now},generator:h,profile:u,metadata:c}},deps:[Ie,Ce,ue.p,ce.v2,b.W,ne.G]}),(0,te.F)({provide:class{},useFactory:(e,t)=>Object.freeze({encryptor:e,state:t,log:p.S2,now:Date.now}),deps:[ue.p,ce.v2]}),(0,te.F)({provide:y.iE,useClass:y.PG,deps:[we,Ie]})],imports:[h.p]})},27650(e,t,i){"use strict";i.d(t,{G:()=>n});class n{}},27760(e,t,i){"use strict";i.d(t,{S:()=>it});var n=i(66046),r=i(16878),s=i(83892),o=i(44500),a=i(3204),l=i(36359),c=i(88565),d=i(69194),u=i(84079),h=i(93695),A=i(58363),p=i(9327),g=i(74208),v=i(33812),f=i(51757),m=i(72245),y=i(33338),C=i(14803),w=i(12610),I=i(36006),b=i(67553),B=i(64447);class E{constructor(e){this.newPlanType=e}}var S=i(81525),Q=i(9753),k=i(12012),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F{constructor(e){this.apiService=e}getCadenceCards(e,t,i){return T(this,void 0,void 0,function*(){const n=(yield this.apiService.getPlans()).data.filter(e=>!!e.PasswordManager);return((null==n?void 0:n.filter(t=>t.productTier===e.productTier&&!t.disabled&&!t.legacyYear))||[]).map(e=>{var n,r;let s=0;if(e.PasswordManager.basePrice)s=e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice;else if(!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption){s=((t.useSecretsManager?e.SecretsManager.seatPrice:0)+(i?0:e.PasswordManager.seatPrice))/(e.isAnnual?12:1)}const o=null!==(r=null===(n=t.customerDiscount)||void 0===n?void 0:n.percentOff)&&void 0!==r?r:0,a=0===o&&e.isAnnual||i?20:o;return{title:e.isAnnual?"Annually":"Monthly",costPerMember:s,discount:a,isDisabled:!1,isSelected:e.isAnnual,isAnnual:e.isAnnual,productTier:e.productTier}}).reverse()})}}F.ɵfac=function(e){return new(e||F)(g.KVO(k.G))},F.ɵprov=g.jDH({token:F,factory:F.ɵfac,providedIn:"root"});var P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class R{getPricingSummaryData(e,t,i,n,r,s){return P(this,void 0,void 0,function*(){var o,a,l,c,d,u,h,A,p,g,v,f;const m=(null===(o=e.PasswordManager)||void 0===o?void 0:o.hasAdditionalSeatsOption)&&!r?e.PasswordManager.seatPrice*Math.abs((null==t?void 0:t.seats)||0):0,y=(null===(a=e.SecretsManager)||void 0===a?void 0:a.hasAdditionalSeatsOption)?e.SecretsManager.seatPrice*Math.abs((null==t?void 0:t.smSeats)||0):0,C=this.getAdditionalServiceAccount(e,t),w=Math.max(0,(null!==(l=null==t?void 0:t.maxStorageGb)&&void 0!==l?l:0)-e.PasswordManager.baseStorageGb),I=(null===(c=e.PasswordManager)||void 0===c?void 0:c.hasAdditionalStorageOption)?e.PasswordManager.additionalStoragePricePerGb*w:0,b=(null===(d=e.PasswordManager)||void 0===d?void 0:d.additionalStoragePricePerGb)||0,E=(null===(u=e.SecretsManager)||void 0===u?void 0:u.hasAdditionalServiceAccountOption)&&C>0?e.SecretsManager.additionalPricePerServiceAccount*C:0;let S=(null===(h=e.PasswordManager)||void 0===h?void 0:h.basePrice)||0;(null===(A=e.PasswordManager)||void 0===A?void 0:A.hasAdditionalSeatsOption)&&(S+=m),(null===(p=e.PasswordManager)||void 0===p?void 0:p.hasPremiumAccessOption)&&(S+=e.PasswordManager.premiumAccessOptionPrice),(null===(g=e.PasswordManager)||void 0===g?void 0:g.hasAdditionalStorageOption)&&(S+=I);const Q=e.SecretsManager?(e.SecretsManager.basePrice||0)+y+E:0,k=r?0:null!==(f=null===(v=null==t?void 0:t.customerDiscount)||void 0===v?void 0:v.percentOff)&&void 0!==f?f:0,T=(null==i?void 0:i.useSecretsManager)?S+Q+s:S+s;return{selectedPlanInterval:n===B.$y.Annually?"year":"month",passwordManagerSeats:e.productTier===B.K_.Families?e.PasswordManager.baseSeats:null==t?void 0:t.seats,passwordManagerSeatTotal:m,secretsManagerSeatTotal:y,additionalStorageTotal:I,additionalStoragePriceMonthly:b,additionalServiceAccountTotal:E,totalAppliedDiscount:0,secretsManagerSubtotal:Q,passwordManagerSubtotal:S,total:T,organization:i,sub:t,selectedPlan:e,selectedInterval:n,discountPercentageFromSub:k,discountPercentage:20,acceptingSponsorship:!1,additionalServiceAccount:C,storageGb:w,isSecretsManagerTrial:r,estimatedTax:s}})}getAdditionalServiceAccount(e,t){var i;if(!e||!e.SecretsManager)return 0;const n=((null===(i=e.SecretsManager)||void 0===i?void 0:i.baseServiceAccount)||0)-((null==t?void 0:t.smServiceAccounts)||0);return n<=0?Math.abs(n):0}}R.ɵfac=function(e){return new(e||R)},R.ɵprov=g.jDH({token:R,factory:R.ɵfac,providedIn:"root"});var D=i(66316),M=i(69855),x=i(50700),O=i(11224),G=i(35500),U=i(49247),V=i(77468),j=i(3892),N=i(56898),z=i(7730),Y=i(68016),L=i(67311),K=i(58806),X=i(21587),q=i(34923),H=i(94573),W=i(25740);const $=(e,t)=>({"tw-py-1":e,"tw-py-0":t}),J=(e,t)=>({"tw-bg-primary-700 !tw-text-contrast":e,"tw-bg-secondary-100":t});function Z(e,t){if(1&e&&(v.j41(0,"div",2),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e){const e=v.XpG();v.Y8G("ngClass",v.l_i(4,J,e.plan().isSelected,!e.plan().isSelected)),v.R7$(),v.SpI(" ",v.bMT(2,2,"recommended")," ")}}class _{constructor(){this.plan=H.hFB.required(),this.productTiers=B.K_,this.cardClicked=(0,H.CGW)()}getPlanCardContainerClasses(){const e=this.plan().isSelected;return this.plan().isDisabled?["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded"]:e?["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-primary-600","tw-border-2","tw-rounded-lg","hover:tw-border-primary-700","focus:tw-border-3","focus:tw-border-primary-700","focus:tw-rounded-lg"]:["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","hover:tw-border-text-main","focus:tw-border-2","focus:tw-border-primary-700"]}}_.ɵfac=function(e){return new(e||_)},_.ɵcmp=v.VBU({type:_,selectors:[["app-plan-card"]],inputs:{plan:[1,"plan"]},outputs:{cardClicked:"cardClicked"},standalone:!1,decls:14,vars:16,consts:[[1,"tw-h-full",3,"click","ngClass"],[1,"tw-relative"],[1,"tw-bg-secondary-100","tw-text-center","!tw-border-0","tw-text-sm","tw-font-medium","tw-py-1",3,"ngClass"],[1,"tw-px-2","tw-pb-[4px]",3,"ngClass"],[1,"tw-text-[1.25rem]","tw-mt-[6px]","tw-font-medium","tw-mb-0","tw-leading-[2rem]","tw-flex","tw-items-center"],[1,"tw-capitalize","tw-whitespace-nowrap"],[1,"tw-text-lg","tw-font-medium"],[1,"tw-text-xs","tw-px-0"]],template:function(e,t){if(1&e){const e=v.RV6();v.j41(0,"bit-card",0),v.bIt("click",function(){return g.eBV(e),g.Njj(t.cardClicked.emit())}),v.j41(1,"div",1),v.nVh(2,Z,3,7,"div",2),v.j41(3,"div",3)(4,"h3",4)(5,"span",5),v.EFF(6),v.k0s()(),v.j41(7,"span")(8,"b",6),v.EFF(9),v.nI1(10,"currency"),v.k0s(),v.j41(11,"span",7),v.EFF(12),v.nI1(13,"i18n"),v.k0s()()()()()}if(2&e){let e;const i=t.plan().isSelected,n=t.plan().isAnnual;v.Y8G("ngClass",t.getPlanCardContainerClasses()),v.BMQ("tabindex",!i||t.plan().isDisabled?"-1":"0")("data-selected",null==(e=t.plan())?null:e.isSelected),v.R7$(2),v.vxM(n?2:-1),v.R7$(),v.Y8G("ngClass",v.l_i(13,$,!t.plan().isSelected,t.plan().isSelected)),v.R7$(3),v.JRh(t.plan().title),v.R7$(3),v.SpI("",v.i5U(10,8,t.plan().costPerMember,"$")," "),v.R7$(3),v.SpI(" /",v.bMT(13,11,"monthPerMember"))}},dependencies:[V.YU,V.oe,W.$],encapsulation:2});var ee=i(93199),te=i(36288);function ie(e,t){1&e&&v.eu8(0)}function ne(e,t){1&e&&v.eu8(0)}function re(e,t){if(1&e&&(v.qex(0),v.DNE(1,ie,1,0,"ng-container",16)(2,ne,1,0,"ng-container",16),v.bVm()),2&e){v.XpG();const e=v.sdS(7),t=v.sdS(9);v.R7$(),v.Y8G("ngTemplateOutlet",t),v.R7$(),v.Y8G("ngTemplateOutlet",e)}}function se(e,t){1&e&&v.eu8(0)}function oe(e,t){1&e&&v.eu8(0)}function ae(e,t){if(1&e&&v.DNE(0,se,1,0,"ng-container",16)(1,oe,1,0,"ng-container",16),2&e){v.XpG();const e=v.sdS(7),t=v.sdS(9);v.Y8G("ngTemplateOutlet",e),v.R7$(),v.Y8G("ngTemplateOutlet",t)}}function le(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.nI1(3,"currency"),v.nI1(4,"i18n"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.LHq(" ",e.summaryData.passwordManagerSeats," ",v.bMT(2,4,"members")," × ",v.i5U(3,6,e.summaryData.selectedPlan.isAnnual?e.summaryData.selectedPlan.PasswordManager.basePrice/12:e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," /",v.bMT(4,9,e.summaryData.selectedPlanInterval)," ")}}function ce(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.nI1(3,"currency"),v.nI1(4,"i18n"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.E5c(" ",v.bMT(2,3,"basePrice"),": ",v.i5U(3,5,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," ",v.bMT(4,8,"monthAbbr")," ")}}function de(e,t){if(1&e&&(v.qex(0),v.j41(1,"span",22),v.EFF(2),v.nI1(3,"currency"),v.k0s(),v.EFF(4),v.nI1(5,"i18n"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(2),v.JRh(v.i5U(3,2,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")),v.R7$(2),v.SpI(" ",v.bMT(5,5,"freeWithSponsorship")," ")}}function ue(e,t){if(1&e&&(v.EFF(0),v.nI1(1,"currency")),2&e){const e=v.XpG(5);v.SpI(" ",v.i5U(1,1,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," ")}}function he(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",18)(2,"span"),v.qex(3,19),v.DNE(4,le,5,11,"ng-container",20)(5,ce,5,10,"ng-container",21),v.bVm(),v.k0s(),v.j41(6,"span"),v.DNE(7,de,6,7,"ng-container",12)(8,ue,2,4,"ng-template",null,3,v.C5r),v.k0s()(),v.bVm()),2&e){const e=v.sdS(9),t=v.XpG(4);v.R7$(3),v.Y8G("ngSwitch",t.summaryData.selectedInterval),v.R7$(),v.Y8G("ngSwitchCase",t.planIntervals.Annually),v.R7$(3),v.Y8G("ngIf",t.summaryData.acceptingSponsorship)("ngIfElse",e)}}function Ae(e,t){1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI("",v.bMT(2,1,"additionalUsers"),":"))}function pe(e,t){1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.JRh(v.bMT(2,1,"members")))}function ge(e,t){if(1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"currency"),v.k0s()),2&e){const e=v.XpG(5);v.R7$(),v.SpI(" ",v.i5U(2,1,e.summaryData.passwordManagerSeatTotal,"$")," ")}}function ve(e,t){1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"freeForOneYear")," "))}function fe(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",23)(2,"span"),v.DNE(3,Ae,3,3,"span",9),v.EFF(4),v.DNE(5,pe,3,3,"span",9),v.EFF(6),v.nI1(7,"currency"),v.nI1(8,"i18n"),v.k0s(),v.DNE(9,ge,3,4,"span",9)(10,ve,3,3,"span",9),v.k0s(),v.bVm()),2&e){const e=v.XpG(4);v.R7$(3),v.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.baseSeats),v.R7$(),v.SpI(" ",e.summaryData.passwordManagerSeats||0,"  "),v.R7$(),v.Y8G("ngIf",!e.summaryData.selectedPlan.PasswordManager.baseSeats),v.R7$(),v.Lme(" × ",v.i5U(7,7,e.summaryData.selectedPlan.PasswordManager.seatPrice,"$")," /",v.bMT(8,10,e.summaryData.selectedPlanInterval)," "),v.R7$(3),v.Y8G("ngIf",!e.summaryData.isSecretsManagerTrial),v.R7$(),v.Y8G("ngIf",e.summaryData.isSecretsManagerTrial)}}function me(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"currency"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.SpI(" ",v.i5U(2,1,e.summaryData.additionalStorageTotal,"$")," ")}}function ye(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"currency"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.SpI(" ",v.i5U(2,1,e.summaryData.storageGb*e.summaryData.selectedPlan.PasswordManager.additionalStoragePricePerGb,"$")," ")}}function Ce(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",23)(2,"span"),v.EFF(3),v.nI1(4,"i18n"),v.nI1(5,"currency"),v.nI1(6,"i18n"),v.k0s(),v.j41(7,"span"),v.qex(8,19),v.DNE(9,me,3,4,"ng-container",20)(10,ye,3,4,"ng-container",21),v.bVm(),v.k0s()(),v.bVm()),2&e){const e=v.XpG(4);v.R7$(3),v.LHq(" ",e.summaryData.storageGb," ",v.bMT(4,6,"additionalStorageGbMessage")," × ",v.i5U(5,8,e.summaryData.additionalStoragePriceMonthly,"$")," /",v.bMT(6,11,e.summaryData.selectedPlanInterval)," "),v.R7$(5),v.Y8G("ngSwitch",e.summaryData.selectedInterval),v.R7$(),v.Y8G("ngSwitchCase",e.planIntervals.Annually)}}function we(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",17),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.DNE(4,he,10,4,"ng-container",9)(5,fe,11,12,"ng-container",9)(6,Ce,11,13,"ng-container",9),v.bVm()),2&e){const e=v.XpG(3);v.R7$(2),v.JRh(v.bMT(3,4,"passwordManager")),v.R7$(2),v.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.basePrice),v.R7$(),v.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.hasAdditionalSeatsOption),v.R7$(),v.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.summaryData.storageGb>0)}}function Ie(e,t){if(1&e&&v.DNE(0,we,7,6,"ng-container",9),2&e){const e=v.XpG(2);v.Y8G("ngIf",!e.summaryData.isSecretsManagerTrial||e.summaryData.organization.useSecretsManager)}}function be(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.nI1(3,"currency"),v.nI1(4,"i18n"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.LHq(" ",null==e.summaryData.sub?null:e.summaryData.sub.smSeats," ",v.bMT(2,4,"members")," × ",v.i5U(3,6,e.summaryData.selectedPlan.isAnnual?e.summaryData.selectedPlan.SecretsManager.basePrice/12:e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," /",v.bMT(4,9,e.summaryData.selectedPlanInterval)," ")}}function Be(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.nI1(3,"currency"),v.nI1(4,"i18n"),v.bVm()),2&e){const e=v.XpG(5);v.R7$(),v.E5c(" ",v.bMT(2,3,"basePrice"),": ",v.i5U(3,5,e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," ",v.bMT(4,8,"monthAbbr")," ")}}function Ee(e,t){if(1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"currency"),v.k0s()),2&e){const e=v.XpG(5);v.R7$(),v.SpI(" ",v.i5U(2,1,e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," ")}}function Se(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",18)(2,"span"),v.qex(3,19),v.DNE(4,be,5,11,"ng-container",20)(5,Be,5,10,"ng-container",21),v.bVm(),v.k0s(),v.DNE(6,Ee,3,4,"span",9),v.k0s(),v.bVm()),2&e){const e=v.XpG(4);v.R7$(3),v.Y8G("ngSwitch",e.summaryData.selectedInterval),v.R7$(),v.Y8G("ngSwitchCase",e.planIntervals.Annually),v.R7$(2),v.Y8G("ngIf",e.summaryData.selectedInterval===e.planIntervals.Monthly)}}function Qe(e,t){1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI("",v.bMT(2,1,"additionalUsers"),":"))}function ke(e,t){1&e&&(v.j41(0,"span"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.JRh(v.bMT(2,1,"members")))}function Te(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",23)(2,"span"),v.DNE(3,Qe,3,3,"span",9),v.EFF(4),v.DNE(5,ke,3,3,"span",9),v.EFF(6),v.nI1(7,"currency"),v.nI1(8,"i18n"),v.k0s(),v.j41(9,"span"),v.EFF(10),v.nI1(11,"currency"),v.k0s()(),v.bVm()),2&e){const e=v.XpG(4);v.R7$(3),v.Y8G("ngIf",e.summaryData.selectedPlan.SecretsManager.baseSeats),v.R7$(),v.SpI(" ",(null==e.summaryData.sub?null:e.summaryData.sub.smSeats)||0,"  "),v.R7$(),v.Y8G("ngIf",!e.summaryData.selectedPlan.SecretsManager.baseSeats),v.R7$(),v.Lme(" × ",v.i5U(7,6,e.summaryData.selectedPlan.SecretsManager.seatPrice,"$")," /",v.bMT(8,9,e.summaryData.selectedPlanInterval)," "),v.R7$(4),v.SpI(" ",v.i5U(11,11,e.summaryData.secretsManagerSeatTotal,"$")," ")}}function Fe(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",23)(2,"span"),v.EFF(3),v.nI1(4,"i18n"),v.nI1(5,"lowercase"),v.nI1(6,"currency"),v.nI1(7,"i18n"),v.k0s(),v.j41(8,"span"),v.EFF(9),v.nI1(10,"currency"),v.k0s()(),v.bVm()),2&e){const e=v.XpG(4);v.R7$(3),v.LHq(" ",e.summaryData.additionalServiceAccount," ",v.bMT(5,7,v.bMT(4,5,"serviceAccounts"))," × ",v.i5U(6,9,null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",v.bMT(7,12,e.summaryData.selectedPlanInterval)," "),v.R7$(6),v.JRh(v.i5U(10,14,e.summaryData.additionalServiceAccountTotal,"$"))}}function Pe(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",17),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.DNE(4,Se,7,3,"ng-container",9)(5,Te,12,14,"ng-container",9)(6,Fe,11,17,"ng-container",9),v.bVm()),2&e){const e=v.XpG(3);v.R7$(2),v.JRh(v.bMT(3,4,"secretsManager")),v.R7$(2),v.Y8G("ngIf",null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.basePrice),v.R7$(),v.Y8G("ngIf",null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.hasAdditionalSeatsOption),v.R7$(),v.Y8G("ngIf",(null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption)&&e.summaryData.additionalServiceAccount>0)}}function Re(e,t){if(1&e&&v.DNE(0,Pe,7,6,"ng-container",9),2&e){const e=v.XpG(2);v.Y8G("ngIf",e.summaryData.organization.useSecretsManager)}}function De(e,t){if(1&e&&(v.qex(0),v.j41(1,"p",23)(2,"span",24),v.EFF(3),v.nI1(4,"i18n"),v.nI1(5,"lowercase"),v.k0s(),v.j41(6,"span",25),v.EFF(7),v.nI1(8,"currency"),v.k0s()(),v.bVm()),2&e){const e=v.XpG(2);v.R7$(3),v.SpI(" ",v.bMT(5,5,v.i5U(4,2,"providerDiscount",e.summaryData.discountPercentageFromSub))," "),v.R7$(4),v.SpI(" ",v.i5U(8,7,e.summaryData.totalAppliedDiscount,"$")," ")}}function Me(e,t){if(1&e&&(v.qex(0),v.j41(1,"div",10)(2,"bit-hint",11),v.DNE(3,re,3,2,"ng-container",12)(4,ae,2,2,"ng-template",null,0,v.C5r)(6,Ie,1,1,"ng-template",null,1,v.C5r)(8,Re,1,1,"ng-template",null,2,v.C5r)(10,De,9,10,"ng-container",9),v.k0s()(),v.j41(11,"div",13)(12,"bit-hint",11)(13,"p",14)(14,"span",6),v.EFF(15),v.nI1(16,"i18n"),v.k0s(),v.j41(17,"span"),v.EFF(18),v.nI1(19,"currency"),v.k0s()()()(),v.j41(20,"div",13)(21,"bit-hint",11)(22,"p",14)(23,"span",6),v.EFF(24),v.nI1(25,"i18n"),v.k0s(),v.j41(26,"span"),v.EFF(27),v.nI1(28,"currency"),v.j41(29,"span",15),v.EFF(30),v.nI1(31,"i18n"),v.k0s()()()()(),v.bVm()),2&e){const e=v.sdS(5),t=v.XpG();v.R7$(3),v.Y8G("ngIf",t.summaryData.isSecretsManagerTrial)("ngIfElse",e),v.R7$(7),v.Y8G("ngIf",t.summaryData.discountPercentageFromSub>0),v.R7$(5),v.JRh(v.bMT(16,8,"estimatedTax")),v.R7$(3),v.JRh(v.brH(19,10,t.summaryData.estimatedTax,"USD","$")),v.R7$(6),v.JRh(v.bMT(25,14,"total")),v.R7$(3),v.SpI(" ",v.brH(28,16,t.summaryData.total-t.summaryData.totalAppliedDiscount,"USD","$")," "),v.R7$(3),v.SpI("/ ",v.bMT(31,20,t.summaryData.selectedPlanInterval))}}class xe{constructor(){this.planIntervals=B.$y}toggleTotalOpened(){this.summaryData&&(this.summaryData.totalOpened=!this.summaryData.totalOpened)}}xe.ɵfac=function(e){return new(e||xe)},xe.ɵcmp=v.VBU({type:xe,selectors:[["app-pricing-summary"]],inputs:{summaryData:"summaryData"},standalone:!1,decls:14,vars:18,consts:[["showPasswordManagerFirst",""],["passwordManagerSection",""],["secretsManagerSection",""],["notAcceptingSponsorship",""],[1,"tw-mt-4"],[1,"tw-text-lg","tw-mb-1"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-font-light"],["type","button","size","small",3,"click","bitIconButton","label"],[4,"ngIf"],[1,"tw-flex","tw-flex-wrap","tw-gap-4"],[1,"tw-w-full"],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-flex-wrap","tw-gap-4","tw-mt-4"],[1,"tw-flex","tw-justify-between","tw-border-0","tw-border-solid","tw-border-t","tw-border-secondary-300","tw-pt-2","tw-mb-0"],[1,"tw-text-xs","tw-font-medium"],[4,"ngTemplateOutlet"],[1,"tw-font-medium","tw-mt-3","tw-mb-1"],["bitTypography","body2",1,"tw-mb-1","tw-flex","tw-justify-between"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"tw-line-through"],["bitTypography","body2",1,"tw-mb-0","tw-flex","tw-justify-between"],[1,"tw-text-xs"],[1,"tw-line-through","tw-text-xs"]],template:function(e,t){1&e&&(v.qex(0),v.j41(1,"div",4)(2,"p",5)(3,"span",6),v.EFF(4),v.nI1(5,"i18n"),v.nI1(6,"currency"),v.k0s(),v.j41(7,"span",7),v.EFF(8),v.nI1(9,"i18n"),v.k0s(),v.j41(10,"button",8),v.nI1(11,"i18n"),v.nI1(12,"i18n"),v.bIt("click",function(){return t.toggleTotalOpened()}),v.k0s()()(),v.DNE(13,Me,32,22,"ng-container",9),v.bVm()),2&e&&(v.R7$(4),v.Lme("",v.bMT(5,6,"total"),": ",v.brH(6,8,t.summaryData.total-t.summaryData.totalAppliedDiscount,"USD","$")," USD"),v.R7$(4),v.SpI(" / ",v.bMT(9,12,t.summaryData.selectedPlanInterval)),v.R7$(2),v.Y8G("bitIconButton",t.summaryData.totalOpened?"bwi-angle-down":"bwi-angle-up")("label",t.summaryData.totalOpened?v.bMT(11,14,"hidePricingSummary"):v.bMT(12,16,"showPricingSummary")),v.R7$(3),v.Y8G("ngIf",t.summaryData.totalOpened))},dependencies:[V.bT,V.T3,V.ux,V.e1,V.fG,ee.I,te.s,K.r,V.GH,V.oe,W.$],encapsulation:2});var Oe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Ge=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};const Ue=e=>({type:"checkout",supportsTaxId:e});function Ve(e,t){1&e&&(v.j41(0,"li"),v.nrm(1,"i",14),v.EFF(2),v.nI1(3,"i18n"),v.k0s()),2&e&&(v.R7$(2),v.SpI(" ",v.bMT(3,1,"customRoles")," "))}function je(e,t){1&e&&(v.j41(0,"li"),v.nrm(1,"i",14),v.EFF(2),v.nI1(3,"i18n"),v.k0s()),2&e&&(v.R7$(2),v.SpI(" ",v.bMT(3,1,"unlimitedSecretsAndProjects")," "))}function Ne(e,t){if(1&e&&(v.j41(0,"ul",13)(1,"li"),v.nrm(2,"i",14),v.EFF(3),v.nI1(4,"i18n"),v.k0s(),v.j41(5,"li"),v.nrm(6,"i",14),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.j41(9,"li"),v.nrm(10,"i",14),v.EFF(11),v.nI1(12,"i18n"),v.k0s(),v.DNE(13,Ve,4,3,"li",5)(14,je,4,3,"li",5),v.k0s()),2&e){const e=v.XpG();v.R7$(3),v.SpI(" ",v.bMT(4,5,"includeEnterprisePolicies")," "),v.R7$(4),v.SpI(" ",v.bMT(8,7,"passwordLessSso")," "),v.R7$(4),v.SpI(" ",v.bMT(12,9,"accountRecovery")," "),v.R7$(2),v.Y8G("ngIf",!(null!=e.organization&&e.organization.canAccessSecretsManager)),v.R7$(),v.Y8G("ngIf",null==e.organization?null:e.organization.canAccessSecretsManager)}}function ze(e,t){1&e&&(v.j41(0,"li"),v.nrm(1,"i",14),v.EFF(2),v.nI1(3,"i18n"),v.k0s()),2&e&&(v.R7$(2),v.SpI(" ",v.bMT(3,1,"unlimitedSecretsAndProjects")," "))}function Ye(e,t){if(1&e&&(v.j41(0,"ul",13)(1,"li"),v.nrm(2,"i",14),v.EFF(3),v.nI1(4,"i18n"),v.k0s(),v.j41(5,"li"),v.nrm(6,"i",14),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.j41(9,"li"),v.nrm(10,"i",14),v.EFF(11),v.nI1(12,"i18n"),v.k0s(),v.DNE(13,ze,4,3,"li",5),v.k0s()),2&e){const e=v.XpG();v.R7$(3),v.SpI(" ",v.bMT(4,4,"secureDataSharing")," "),v.R7$(4),v.SpI(" ",v.bMT(8,6,"eventLogMonitoring")," "),v.R7$(4),v.SpI(" ",v.bMT(12,8,"directoryIntegration")," "),v.R7$(2),v.Y8G("ngIf",null==e.organization?null:e.organization.canAccessSecretsManager)}}function Le(e,t){1&e&&(v.j41(0,"ul",13)(1,"li"),v.nrm(2,"i",14),v.EFF(3),v.nI1(4,"i18n"),v.k0s(),v.j41(5,"li"),v.nrm(6,"i",14),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.j41(9,"li"),v.nrm(10,"i",14),v.EFF(11),v.nI1(12,"i18n"),v.k0s()()),2&e&&(v.R7$(3),v.SpI(" ",v.bMT(4,3,"premiumAccounts")," "),v.R7$(4),v.SpI(" ",v.bMT(8,5,"unlimitedSharing")," "),v.R7$(4),v.SpI(" ",v.bMT(12,7,"createUnlimitedCollections")," "))}function Ke(e,t){if(1&e){const e=v.RV6();v.j41(0,"app-plan-card",19),v.bIt("cardClicked",function(){const t=g.eBV(e).$implicit,i=v.XpG(3);return g.Njj(i.setSelected(t))}),v.k0s()}if(2&e){const e=t.$implicit;v.Y8G("plan",e)}}function Xe(e,t){if(1&e&&(v.qex(0),v.j41(1,"div",17),v.Z7z(2,Ke,1,1,"app-plan-card",18,v.Vm6),v.k0s(),v.bVm()),2&e){const e=v.XpG(2);v.R7$(),v.HbH("tw-grid-cols-"+e.planCards().length),v.R7$(),v.Dyx(e.planCards())}}function qe(e,t){if(1&e&&(v.j41(0,"div")(1,"div",15)(2,"h4",16),v.EFF(3),v.nI1(4,"i18n"),v.k0s()(),v.DNE(5,Xe,4,2,"ng-container",5),v.k0s()),2&e){const e=v.XpG();v.R7$(3),v.JRh(v.bMT(4,2,"selectAPlan")),v.R7$(2),v.Y8G("ngIf",e.planCards().length>0)}}function He(e,t){if(1&e&&v.nrm(0,"app-pricing-summary",20),2&e){const e=v.XpG();v.Y8G("summaryData",e.pricingSummaryData)}}const We={CLOSED:"closed",SUBMITTED:"submitted"};class $e{constructor(e,t,i,r,s,o,a,l,c,d,u,h,A){var p;this.dialogParams=e,this.dialogRef=t,this.organizationService=i,this.i18nService=r,this.organizationApiService=s,this.accountService=o,this.planCardService=a,this.pricingSummaryService=l,this.apiService=c,this.toastService=d,this.organizationBillingApiServiceAbstraction=u,this.subscriberBillingClient=h,this.previewInvoiceClient=A,this.productTypes=B.K_,this.selectedInterval=B.$y.Annually,this.planCards=(0,g.vPA)([]),this.onSuccess=new v.bkB,this.ResultType=We,this.formGroup=new f.gE({paymentMethod:Q.Pu.getFormGroup(),billingAddress:Q.vU.getFormGroup()}),this.destroy$=new n.B,this.refreshPricingSummary=()=>Oe(this,void 0,void 0,function*(){const e=yield this.getEstimatedTax();this.pricingSummaryData=yield this.pricingSummaryService.getPricingSummaryData(this.currentPlan,this.sub,this.organization,this.selectedInterval,this.isSecretsManagerTrial(),e)}),this.getEstimatedTax=()=>Oe(this,void 0,void 0,function*(){if(this.formGroup.controls.billingAddress.invalid)return 0;const e=this.currentPlan.productTier!==B.K_.Families?this.currentPlan.isAnnual?"annually":"monthly":null,t=(0,Q.c3)(this.formGroup.controls.billingAddress),i=(e=>{switch(e.productTierType){case B.K_.Families:return"families";case B.K_.Teams:return"teams";case B.K_.Enterprise:return"enterprise"}})(this.organization);if(i&&e){return(yield this.previewInvoiceClient.previewTaxForOrganizationSubscriptionPlanChange(this.organization.id,{tier:i,cadence:e},t)).tax}return 0}),this.initialPaymentMethod=null!==(p=this.dialogParams.initialPaymentMethod)&&void 0!==p?p:B.eq.Card}ngOnInit(){return Oe(this,void 0,void 0,function*(){var e,t,i;this.currentPlanName=this.resolvePlanName(this.dialogParams.productTierType),this.sub=null!==(e=this.dialogParams.subscription)&&void 0!==e?e:yield this.organizationApiService.getSubscription(this.dialogParams.organizationId),this.organizationId=this.dialogParams.organizationId,this.currentPlan=null===(t=this.sub)||void 0===t?void 0:t.plan;const n=yield(0,m._)(this.accountService.activeAccount$.pipe((0,a.T)(e=>null==e?void 0:e.id)));if(!n)throw new Error("User ID is required");const r=yield(0,m._)(this.organizationService.organizations$(n).pipe((0,b.Sw)(this.organizationId)));if(!r)throw new Error("Organization not found");this.organization=r;const s=yield this.planCardService.getCadenceCards(this.currentPlan,this.sub,this.isSecretsManagerTrial());this.planCards.set(s),this.selectedInterval||(this.selectedInterval=(null===(i=s.find(e=>e.isSelected))||void 0===i?void 0:i.isAnnual)?B.$y.Annually:B.$y.Monthly);const l=yield this.subscriberBillingClient.getBillingAddress({type:"organization",data:this.organization});if(l){const{taxId:e}=l,t=Ge(l,["taxId"]);this.formGroup.controls.billingAddress.patchValue(Object.assign(Object.assign({},t),{taxId:e?e.value:null}))}yield this.refreshPricingSummary(),this.plans=yield this.apiService.getPlans(),(0,y.z)([this.formGroup.controls.billingAddress.controls.country.valueChanges.pipe((0,w.Z)(this.formGroup.controls.billingAddress.controls.country.value)),this.formGroup.controls.billingAddress.controls.postalCode.valueChanges.pipe((0,w.Z)(this.formGroup.controls.billingAddress.controls.postalCode.value)),this.formGroup.controls.billingAddress.controls.taxId.valueChanges.pipe((0,w.Z)(this.formGroup.controls.billingAddress.controls.taxId.value))]).pipe((0,I.B)(500),(0,o.n)(()=>this.refreshPricingSummary()),(0,C.Q)(this.destroy$)).subscribe()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setSelected(e){return Oe(this,void 0,void 0,function*(){this.selectedInterval=e.isAnnual?B.$y.Annually:B.$y.Monthly,this.planCards.update(e=>e.map(e=>e.isSelected?Object.assign(Object.assign({},e),{isSelected:!1}):Object.assign(Object.assign({},e),{isSelected:!0}))),yield this.selectPlan(),yield this.refreshPricingSummary()})}selectPlan(){return Oe(this,void 0,void 0,function*(){if(this.selectedInterval===B.$y.Monthly&&this.currentPlan.productTier==B.K_.Families)return;const e=this.plans.data.filter(e=>e.productTier===this.currentPlan.productTier&&e.isAnnual===(this.selectedInterval===B.$y.Annually));e.length>0&&(this.currentPlan=e[0]);try{yield this.refreshPricingSummary()}catch(t){const e=t instanceof Error?t.message:String(t),i=this.i18nService.t(e);this.toastService.showToast({title:"",variant:"error",message:i&&""!==i?i:e})}})}isSecretsManagerTrial(){var e,t,i,n;return null!==(n=null===(i=null===(t=null===(e=this.sub)||void 0===e?void 0:e.subscription)||void 0===t?void 0:t.items)||void 0===i?void 0:i.some(e=>{var t,i,n;return null===(n=null===(i=null===(t=this.sub)||void 0===t?void 0:t.customerDiscount)||void 0===i?void 0:i.appliesTo)||void 0===n?void 0:n.includes(e.productId)}))&&void 0!==n&&n}onSubscribe(){return Oe(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.invalid)try{const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t=(0,Q.c3)(this.formGroup.controls.billingAddress),i={type:"organization",data:this.organization};if(yield Promise.all([this.subscriberBillingClient.updatePaymentMethod(i,e,null),this.subscriberBillingClient.updateBillingAddress(i,t)]),this.currentPlan.type!==this.sub.planType){const e=new E;e.newPlanType=this.currentPlan.type,yield this.organizationBillingApiServiceAbstraction.changeSubscriptionFrequency(this.organizationId,e)}this.toastService.showToast({variant:"success",title:void 0,message:this.i18nService.t("updatedPaymentMethod")}),this.onSuccess.emit({organizationId:this.organizationId}),this.dialogRef.close(We.SUBMITTED)}catch(e){const t="object"==typeof e&&null!==e&&"message"in e?e.message:String(e);this.toastService.showToast({variant:"error",title:void 0,message:this.i18nService.t(t)||t})}})}resolvePlanName(e){switch(e){case B.K_.Enterprise:return this.i18nService.t("planNameEnterprise");case B.K_.Free:return this.i18nService.t("planNameFree");case B.K_.Families:return this.i18nService.t("planNameFamilies");case B.K_.Teams:return this.i18nService.t("planNameTeams");case B.K_.TeamsStarter:return this.i18nService.t("planNameTeamsStarter");default:return this.i18nService.t("planNameFree")}}get supportsTaxId(){return!!this.organization&&this.organization.productTierType!==B.K_.Families}}$e.open=(e,t)=>e.open($e,t),$e.ɵfac=function(e){return new(e||$e)(v.rXU(S.Qs),v.rXU(D.ce),v.rXU(b.PV),v.rXU(x.W),v.rXU(O.X),v.rXU(G.D),v.rXU(F),v.rXU(R),v.rXU(k.G),v.rXU(M.f),v.rXU(U.C),v.rXU(p.Hd),v.rXU(p.dA))},$e.ɵcmp=v.VBU({type:$e,selectors:[["app-trial-payment-dialog"]],viewQuery:function(e,t){if(1&e&&v.GBs(Q.Pu,5),2&e){let e;v.mGM(e=v.lsd())&&(t.enterPaymentMethodComponent=e.first)}},outputs:{onSuccess:"onSuccess"},standalone:!1,decls:28,vars:30,consts:[["dialogSize","default"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"ngSwitch"],["class","bwi-ul tw-text-xs",4,"ngSwitchCase"],[4,"ngIf"],["bitTypography","h4"],[3,"group"],[3,"group","scenario"],[3,"summaryData",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"bitAction"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"],[1,"bwi-ul","tw-text-xs"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-muted","bwi-li"],[1,"tw-mb-3","tw-flex","tw-justify-between"],[1,"tw-text-lg","tw-text-main"],[1,"tw-grid","tw-grid-flow-col","tw-gap-4","tw-mb-2"],[3,"plan"],[3,"cardClicked","plan"],[3,"summaryData"]],template:function(e,t){1&e&&(v.j41(0,"bit-dialog",0)(1,"span",1),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.j41(4,"div",2)(5,"p"),v.EFF(6),v.nI1(7,"i18n"),v.k0s(),v.qex(8,3),v.DNE(9,Ne,15,11,"ul",4)(10,Ye,14,10,"ul",4)(11,Le,13,9,"ul",4),v.bVm(),v.DNE(12,qe,6,4,"div",5),v.qex(13),v.j41(14,"h2",6),v.EFF(15),v.nI1(16,"i18n"),v.k0s(),v.qex(17,2),v.nrm(18,"app-enter-payment-method",7)(19,"app-enter-billing-address",8),v.bVm(),v.DNE(20,He,1,1,"app-pricing-summary",9),v.bVm(),v.k0s(),v.qex(21,10),v.j41(22,"button",11),v.EFF(23),v.nI1(24,"i18n"),v.k0s(),v.j41(25,"button",12),v.EFF(26),v.nI1(27,"i18n"),v.k0s(),v.bVm(),v.k0s()),2&e&&(v.R7$(2),v.SpI(" ",v.i5U(3,16,"subscribetoEnterprise",t.currentPlanName)," "),v.R7$(4),v.JRh(v.i5U(7,19,"subscribeEnterpriseSubtitle",t.currentPlanName)),v.R7$(2),v.Y8G("ngSwitch",null==t.currentPlan?null:t.currentPlan.productTier),v.R7$(),v.Y8G("ngSwitchCase",t.productTypes.Enterprise),v.R7$(),v.Y8G("ngSwitchCase",t.productTypes.Teams),v.R7$(),v.Y8G("ngSwitchCase",t.productTypes.Families),v.R7$(),v.Y8G("ngIf",!((null==t.currentPlan?null:t.currentPlan.productTier)===t.productTypes.Families)),v.R7$(3),v.JRh(v.bMT(16,22,"paymentMethod")),v.R7$(3),v.Y8G("group",t.formGroup.controls.paymentMethod),v.R7$(),v.Y8G("group",t.formGroup.controls.billingAddress)("scenario",v.eq3(28,Ue,t.supportsTaxId)),v.R7$(),v.Y8G("ngIf",t.pricingSummaryData),v.R7$(2),v.Y8G("bitAction",t.onSubscribe.bind(t)),v.R7$(),v.SpI(" ",v.bMT(24,24,"subscribe")," "),v.R7$(2),v.Y8G("bitDialogClose",t.ResultType.CLOSED),v.R7$(),v.SpI(" ",v.bMT(27,26,"later")," "))},dependencies:[V.bT,V.ux,V.e1,j.p,N.Q,z.I,Y.m,L.hJ,K.r,X.P,q.vU,_,xe,W.$],encapsulation:2});var Je=i(16452),Ze=i(37115),_e=i(23649),et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const tt=e=>e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"});class it{constructor(e,t,i,p,g,v){this.dialogService=e,this.i18nService=t,this.organizationApiService=i,this.organizationBillingClient=p,this.platformUtilsService=g,this.router=v,this.cache$=new Map,this.refreshFreeTrialWarningTrigger=new n.B,this.refreshTaxIdWarningTrigger=new n.B,this.refreshInactiveSubscriptionWarningTrigger=new n.B,this.taxIdWarningRefreshedSubject=new r.t(null),this.taxIdWarningRefreshed$=this.taxIdWarningRefreshedSubject.asObservable(),this.getFreeTrialWarning$=(e,t=!1)=>(0,s.h)(this.getWarning$(e,e=>e.freeTrial),this.refreshFreeTrialWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.freeTrial,!0)))).pipe((0,a.T)(i=>{if(!i)return null;const{remainingTrialDays:n}=i;return n>=2?{organization:e,message:t?this.i18nService.t("freeTrialEndPromptMultipleDays",e.name,n):this.i18nService.t("freeTrialEndPromptCount",n)}:1==n?{organization:e,message:t?this.i18nService.t("freeTrialEndPromptTomorrow",e.name):this.i18nService.t("freeTrialEndPromptTomorrowNoOrgName")}:{organization:e,message:t?this.i18nService.t("freeTrialEndPromptToday",e.name):this.i18nService.t("freeTrialEndingTodayWithoutOrgName")}})),this.getResellerRenewalWarning$=e=>this.getWarning$(e,e=>e.resellerRenewal).pipe((0,a.T)(t=>{if(!t)return null;switch(t.type){case"upcoming":return{type:"info",message:this.i18nService.t("resellerRenewalWarningMsg",e.providerName,tt(t.upcoming.renewalDate))};case"issued":return{type:"info",message:this.i18nService.t("resellerOpenInvoiceWarningMgs",e.providerName,tt(t.issued.issuedDate),tt(t.issued.dueDate))};case"past_due":return{type:"warning",message:this.i18nService.t("resellerPastDueWarningMsg",e.providerName,tt(t.pastDue.suspensionDate))}}})),this.getTaxIdWarning$=e=>(0,s.h)(this.getWarning$(e,e=>e.taxId),this.refreshTaxIdWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.taxId,!0).pipe((0,l.M)(e=>this.taxIdWarningRefreshedSubject.next(e?e.type:null)))))).pipe((0,a.T)(e=>e?e.type:null)),this.refreshFreeTrialWarning=()=>this.refreshFreeTrialWarningTrigger.next(),this.refreshInactiveSubscriptionWarning=()=>this.refreshInactiveSubscriptionWarningTrigger.next(),this.refreshTaxIdWarning=()=>this.refreshTaxIdWarningTrigger.next(),this.showInactiveSubscriptionDialog$=e=>(0,s.h)(this.getWarning$(e,e=>e.inactiveSubscription),this.refreshInactiveSubscriptionWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.inactiveSubscription,!0)))).pipe((0,o.n)(t=>et(this,void 0,void 0,function*(){if(t)switch(t.resolution){case"contact_provider":yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedManagedOrgMessage",placeholders:[e.providerName]},type:"danger",acceptButtonText:this.i18nService.t("close"),cancelButtonText:null});break;case"add_payment_method":(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedOwnerOrgMessage"},type:"danger",acceptButtonText:this.i18nService.t("continue"),cancelButtonText:this.i18nService.t("close")}))&&(yield this.router.navigate(["organizations",`${e.id}`,"billing","payment-details"],{state:{launchPaymentModalAutomatically:!0}}));break;case"resubscribe":{const t=yield this.organizationApiService.getSubscription(e.id),i=(0,Je.IO)(this.dialogService,{data:{organizationId:e.id,subscription:t,productTierType:e.productTierType}});yield(0,c.s)(i.closed);break}case"contact_owner":yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedUserOrgMessage"},type:"danger",acceptButtonText:this.i18nService.t("close"),cancelButtonText:null})}}))),this.showSubscribeBeforeFreeTrialEndsDialog$=e=>this.getWarning$(e,e=>e.freeTrial).pipe((0,d.p)(e=>null!==e),(0,o.n)(()=>et(this,void 0,void 0,function*(){const t=yield this.organizationApiService.getSubscription(e.id),i=$e.open(this.dialogService,{data:{organizationId:e.id,subscription:t,productTierType:null==e?void 0:e.productTierType}});(yield(0,c.s)(i.closed))===We.SUBMITTED&&this.refreshFreeTrialWarningTrigger.next()}))),this.readThroughWarnings$=(e,t=!1)=>{const i=e.id,n=this.cache$.get(i);if(n&&!t)return n;const r=(0,u.H)(this.organizationBillingClient.getWarnings(i));return this.cache$.set(i,r),r},this.getWarning$=(e,t,i=!1)=>this.platformUtilsService.isSelfHost()?(0,h.of)(null):this.readThroughWarnings$(e,i).pipe((0,a.T)(e=>{const i=t(e);return i||null}),(0,A.s)(1))}}it.ɵfac=function(e){return new(e||it)(g.KVO(D.o3),g.KVO(x.W),g.KVO(O.X),g.KVO(p.cK),g.KVO(Ze.y),g.KVO(_e.Ix))},it.ɵprov=g.jDH({token:it,factory:it.ɵfac,providedIn:"root"})},27790(e,t,i){"use strict";i.d(t,{u:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.ssoOrganizationIdentifier=this.getResponseProperty("SsoOrganizationIdentifier")}}},27866(e,t,i){"use strict";i.d(t,{m:()=>n});class n{}},28209(e,t,i){"use strict";i.d(t,{Q:()=>n});const n=[{id:"importData",titleKey:"coachmarkImportTitle",descriptionKey:"coachmarkImportDescription",position:"right-center",learnMoreUrl:"https://bitwarden.com/help/import-data/",route:"/tools/import"},{id:"addItem",titleKey:"coachmarkAddItemTitle",descriptionKey:"coachmarkAddItemDescription",position:"below-center",learnMoreUrl:"https://bitwarden.com/help/managing-items/",route:"/vault"},{id:"shareWithCollections",titleKey:"coachmarkShareWithCollectionsTitle",descriptionKey:"coachmarkShareWithCollectionsDescription",position:"right-center",learnMoreUrl:"https://bitwarden.com/help/about-collections/",requiresOrganization:!0,route:"/vault"},{id:"monitorSecurity",titleKey:"coachmarkMonitorSecurityTitle",descriptionKey:"coachmarkMonitorSecurityDescription",position:"right-center",learnMoreUrl:"https://bitwarden.com/help/reports/",route:"/reports"}]},29029(e,t,i){"use strict";i.d(t,{t:()=>o});var n=i(56898),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.Q]})},29096(e,t,i){"use strict";i.d(t,{y:()=>j});var n=i(16878),r=i(36359),s=i(44500),o=i(27442),a=i(72245),l=i(3204),c=i(69194),d=i(84079);class u{constructor(e,t,i){this.id=e,this.encryptedPublicKey=t,this.encryptedUserKey=i}static fromRotateableKeyset(e,t){return new u(e,t.encryptedPublicKey,t.encryptedPrivateKey)}}var h=i(12117),A=i(56962),p=i(8916);class g{constructor(e,t){this.options=e,this.token=t}}class v{constructor(e,t,i){this.createOptions=e,this.deviceResponse=t,this.supportsPrf=i}}class f{constructor(e,t,i){this.id=e,this.name=t,this.prfStatus=i}}class m{}class y{}var C=i(78781);class w{constructor(e){this.id=e.id,this.rawId=C.A.fromBufferToB64(e.rawId),this.type=e.type,this.extensions={}}}class I extends w{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAttestationResponse))throw new Error("Invalid authenticator response");this.response={attestationObject:C.A.fromBufferToUrlB64(e.response.attestationObject),clientDataJson:C.A.fromBufferToUrlB64(e.response.clientDataJSON)}}}var b=i(93824),B=i(12277),E=i(73556),S=i(20702);class Q extends S.r{constructor(e){super(e),this.options=new E.Jq(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}var k=i(39306),T=i(67529),F=i(40640);class P extends S.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.prfStatus=this.getResponseProperty("PrfStatus"),this.encryptedPublicKey=this.getResponseProperty("EncryptedPublicKey"),this.encryptedUserKey=this.getResponseProperty("EncryptedUserKey")}getRotateableKeyset(){if(!k.k.isSerializedEncString(this.encryptedUserKey))throw new Error("Invalid encrypted user key");if(!k.k.isSerializedEncString(this.encryptedPublicKey))throw new Error("Invalid encrypted public key");return new T.B(new k.k(this.encryptedUserKey),new k.k(this.encryptedPublicKey))}hasPrfKeyset(){return this.prfStatus===F.j.Enabled}}var R=i(74208),D=i(12012),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x{constructor(e){this.apiService=e}getCredentialCreateOptions(e){return M(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/webauthn/attestation-options",e,!0,!0);return new Q(t)})}getCredentialAssertionOptions(e){return M(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/webauthn/assertion-options",e,!0,!0);return new b.x(t)})}saveCredential(e){return M(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/webauthn",e,!0,!0),!0})}getCredentials(){return M(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/webauthn",null,!0,!0);return new B.s(e,P)})}deleteCredential(e,t){return M(this,void 0,void 0,function*(){yield this.apiService.send("POST",`/webauthn/${e}/delete`,t,!0,!0)})}updateCredential(e){return M(this,void 0,void 0,function*(){yield this.apiService.send("PUT","/webauthn",e,!0,!0)})}}x.ɵfac=function(e){return new(e||x)(R.KVO(D.G))},x.ɵprov=R.jDH({token:x,factory:x.ɵfac,providedIn:"root"});var O=i(62166),G=i(66827),U=i(25279),V=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class j{constructor(e,t,i,a,l,c,d){this.apiService=e,this.userVerificationService=t,this.rotateableKeySetService=i,this.webAuthnLoginPrfKeyService=a,this.keyService=l,this.logService=d,this._refresh$=new n.t(void 0),this._loading$=new n.t(!0),this.credentials$=this._refresh$.pipe((0,r.M)(()=>this._loading$.next(!0)),(0,s.n)(()=>this.fetchCredentials$()),(0,r.M)(()=>this._loading$.next(!1)),(0,o.t)({bufferSize:1,refCount:!0})),this.loading$=this._loading$.asObservable(),this.navigatorCredentials=null!=c?c:navigator.credentials}getCredentialAssertOptions(e){return V(this,void 0,void 0,function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialAssertionOptions(t);return new h.E(i.options,i.token)})}getCredentialAttestationOptions(e){return V(this,void 0,void 0,function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialCreateOptions(t);return new g(i.options,i.token)})}createCredential(e){return V(this,void 0,void 0,function*(){var t,i;const n={publicKey:e.options};n.publicKey.extensions={prf:{}};try{const i=yield this.navigatorCredentials.create(n);if(!(i instanceof PublicKeyCredential))return;const r=Boolean(null===(t=i.getClientExtensionResults().prf)||void 0===t?void 0:t.enabled);return new v(e,i,r)}catch(r){return void(null===(i=this.logService)||void 0===i||i.error(r))}})}createKeySet(e,t){return V(this,void 0,void 0,function*(){var i,n,r;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.webAuthnLoginPrfKeyService.getLoginWithPrfSalt()}}}}};try{const e=yield this.navigatorCredentials.get(s);if(!(e instanceof PublicKeyCredential))return;const r=null===(n=null===(i=e.getClientExtensionResults().prf)||void 0===i?void 0:i.results)||void 0===n?void 0:n.first;if(void 0===r)return;const o=yield this.webAuthnLoginPrfKeyService.createSymmetricKeyFromPrf(r),l=yield(0,a._)(this.keyService.userKey$(t));return yield this.rotateableKeySetService.createKeySet(o,l)}catch(o){return void(null===(r=this.logService)||void 0===r||r.error(o))}})}saveCredential(e,t,i){return V(this,void 0,void 0,function*(){const n=new y;n.deviceResponse=new I(t.deviceResponse),n.token=t.createOptions.token,n.name=e,n.supportsPrf=t.supportsPrf,n.encryptedUserKey=null==i?void 0:i.encapsulatedDownstreamKey.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,t){return V(this,void 0,void 0,function*(){if(void 0===e||void 0===(null==e?void 0:e.prfKey))throw new Error("invalid credential");if(!t)throw new Error("userId is required");const i=yield(0,a._)(this.keyService.userKey$(t)),n=yield this.rotateableKeySetService.createKeySet(e.prfKey,i),r=new m;r.token=e.token,r.deviceResponse=e.deviceResponse,r.encryptedUserKey=n.encapsulatedDownstreamKey.encryptedString,r.encryptedPublicKey=n.encryptedPublicKey.encryptedString,r.encryptedPrivateKey=n.encryptedPrivateKey.encryptedString,yield this.apiService.updateCredential(r),this.refresh()})}getCredentials$(){return this.credentials$}getCredential$(e){return this.credentials$.pipe((0,l.T)(t=>t.find(t=>t.id===e)),(0,c.p)(e=>void 0!==e))}deleteCredential(e,t){return V(this,void 0,void 0,function*(){const i=yield this.userVerificationService.buildRequest(t);yield this.apiService.deleteCredential(e,i),this.refresh()})}fetchCredentials$(){return(0,d.H)(this.apiService.getCredentials()).pipe((0,l.T)(e=>e.data.map(e=>new f(e.id,e.name,e.prfStatus))))}refresh(){this._refresh$.next()}getRotatedData(e,t,i){return V(this,void 0,void 0,function*(){if(!e)throw new Error("oldUserKey is required");if(!t)throw new Error("newUserKey is required");return Promise.all((yield this.apiService.getCredentials()).data.filter(e=>e.hasPrfKeyset()).map(i=>V(this,void 0,void 0,function*(){const n=i.getRotateableKeyset(),r=yield this.rotateableKeySetService.rotateKeySet(n,e,t);return new u(i.id,r.encryptedPublicKey,r.encapsulatedDownstreamKey)})))})}}j.MaxCredentialCount=5,j.ɵfac=function(e){return new(e||j)(R.KVO(x),R.KVO(O.i),R.KVO(G.y),R.KVO(U.u),R.KVO(p.Lu),R.KVO(CredentialsContainer,8),R.KVO(A.K,8))},j.ɵprov=R.jDH({token:j,factory:j.ɵfac,providedIn:"root"})},29377(e,t,i){"use strict";var n;i.d(t,{T:()=>n,v:()=>r}),function(e){e.US="US",e.EU="EU",e.SelfHosted="Self-hosted"}(n||(n={}));class r{}},29744(e,t,i){"use strict";i.d(t,{k:()=>n});class n{}},30038(e,t,i){"use strict";i.d(t,{US:()=>A,ng:()=>p});var n=i(44500),r=i(43978),s=i(3633),o=i(54931),a=i(51151),l=i(74208),c=i(50700),d=i(18499),u=i(35500),h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class A{constructor(e,t,i){this.i18nService=e,i.activeAccount$.pipe(s.F6,(0,n.n)(e=>t.policies$(e))).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){return h(this,arguments,void 0,function*(e,t=new p){const i=this.getAppInfo(e),{message:n,humanReadableMessage:r}=yield this.getEventMessage(e,t);return{message:n,humanReadableMessage:r,appIcon:i[0],appName:i[1]}})}getEventMessage(e,t){return h(this,void 0,void 0,function*(){let i="",n="";switch(e.type){case o.Bx.User_LoggedIn:i=n=this.i18nService.t("loggedIn");break;case o.Bx.User_ChangedPassword:i=n=this.i18nService.t("changedPassword");break;case o.Bx.User_Updated2fa:i=n=this.i18nService.t("enabledUpdated2fa");break;case o.Bx.User_Disabled2fa:i=n=this.i18nService.t("disabled2fa");break;case o.Bx.User_Recovered2fa:i=n=this.i18nService.t("recovered2fa");break;case o.Bx.User_FailedLogIn:i=n=this.i18nService.t("failedLogin");break;case o.Bx.User_FailedLogIn2fa:i=n=this.i18nService.t("failedLogin2fa");break;case o.Bx.User_ClientExportedVault:i=n=this.i18nService.t("exportedVault");break;case o.Bx.User_UpdatedTempPassword:i=n=this.i18nService.t("updatedTempPassword");break;case o.Bx.User_MigratedKeyToKeyConnector:i=n=this.i18nService.t("migratedKeyConnector");break;case o.Bx.User_RequestedDeviceApproval:i=n=this.i18nService.t("requestedDeviceApproval");break;case o.Bx.User_TdeOffboardingPasswordSet:i=n=this.i18nService.t("tdeOffboardingPasswordSet");break;case o.Bx.Cipher_Created:i=this.i18nService.t("createdItemId",this.formatCipherId(e,t)),n=this.i18nService.t("createdItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_Updated:i=this.i18nService.t("editedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("editedItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_Deleted:i=this.i18nService.t("permanentlyDeletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("permanentlyDeletedItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_SoftDeleted:i=this.i18nService.t("deletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("deletedItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_Restored:i=this.i18nService.t("restoredItemId",this.formatCipherId(e,t)),n=this.i18nService.t("restoredItemId",this.formatCipherId(e,t));break;case o.Bx.Cipher_AttachmentCreated:i=this.i18nService.t("createdAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("createdAttachmentForItem",this.getShortId(e.cipherId));break;case o.Bx.Cipher_AttachmentDeleted:i=this.i18nService.t("deletedAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("deletedAttachmentForItem",this.getShortId(e.cipherId));break;case o.Bx.Cipher_Shared:i=this.i18nService.t("movedItemIdToOrg",this.formatCipherId(e,t)),n=this.i18nService.t("movedItemIdToOrg",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientViewed:i=this.i18nService.t("viewedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientToggledPasswordVisible:i=this.i18nService.t("viewedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedPasswordItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientToggledHiddenFieldVisible:i=this.i18nService.t("viewedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedHiddenFieldItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientToggledCardNumberVisible:i=this.i18nService.t("viewedCardNumberItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedCardNumberItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientToggledCardCodeVisible:i=this.i18nService.t("viewedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedSecurityCodeItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientCopiedHiddenField:i=this.i18nService.t("copiedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedHiddenFieldItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientCopiedPassword:i=this.i18nService.t("copiedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedPasswordItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientCopiedCardCode:i=this.i18nService.t("copiedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedSecurityCodeItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_ClientAutofilled:i=this.i18nService.t("autofilledItemId",this.formatCipherId(e,t)),n=this.i18nService.t("autofilledItemId",this.getShortId(e.cipherId));break;case o.Bx.Cipher_UpdatedCollections:i=this.i18nService.t("editedCollectionsForItem",this.formatCipherId(e,t)),n=this.i18nService.t("editedCollectionsForItem",this.getShortId(e.cipherId));break;case o.Bx.Collection_Created:i=this.i18nService.t("createdCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("createdCollectionId",this.getShortId(e.collectionId));break;case o.Bx.Collection_Updated:i=this.i18nService.t("editedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("editedCollectionId",this.getShortId(e.collectionId));break;case o.Bx.Collection_Deleted:i=this.i18nService.t("deletedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("deletedCollectionId",this.getShortId(e.collectionId));break;case o.Bx.Group_Created:i=this.i18nService.t("createdGroupId",this.formatGroupId(e)),n=this.i18nService.t("createdGroupId",this.getShortId(e.groupId));break;case o.Bx.Group_Updated:i=this.i18nService.t("editedGroupId",this.formatGroupId(e)),n=this.i18nService.t("editedGroupId",this.getShortId(e.groupId));break;case o.Bx.Group_Deleted:i=this.i18nService.t("deletedGroupId",this.formatGroupId(e)),n=this.i18nService.t("deletedGroupId",this.getShortId(e.groupId));break;case o.Bx.OrganizationUser_Invited:i=this.i18nService.t("invitedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Updated:i=this.i18nService.t("editedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Removed:i=this.i18nService.t("removedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_UpdatedGroups:i=this.i18nService.t("editedGroupsForUser",this.formatOrgUserId(e)),n=this.i18nService.t("editedGroupsForUser",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_UnlinkedSso:i=this.i18nService.t("unlinkedSsoUser",this.formatOrgUserId(e)),n=this.i18nService.t("unlinkedSsoUser",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_ResetPassword_Enroll:i=this.i18nService.t("eventEnrollAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventEnrollAccountRecovery",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_ResetPassword_Withdraw:i=this.i18nService.t("eventWithdrawAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventWithdrawAccountRecovery",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_AdminResetPassword:i=this.i18nService.t("eventAdminPasswordReset",this.formatOrgUserId(e)),n=this.i18nService.t("eventAdminPasswordReset",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_ResetSsoLink:i=this.i18nService.t("eventResetSsoLink",this.formatOrgUserId(e)),n=this.i18nService.t("eventResetSsoLink",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_FirstSsoLogin:i=this.i18nService.t("firstSsoLogin",this.formatOrgUserId(e)),n=this.i18nService.t("firstSsoLogin",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Revoked:i=this.i18nService.t("revokedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("revokedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Restored:i=this.i18nService.t("restoredUserId",this.formatOrgUserId(e)),n=this.i18nService.t("restoredUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_ApprovedAuthRequest:i=this.i18nService.t("approvedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("approvedAuthRequest",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_RejectedAuthRequest:i=this.i18nService.t("rejectedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("rejectedAuthRequest",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Deleted:i=this.i18nService.t("deletedUserIdEventMessage",this.formatOrgUserId(e)),n=this.i18nService.t("deletedUserIdEventMessage",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_Left:i=this.i18nService.t("userLeftOrganization",this.formatOrgUserId(e)),n=this.i18nService.t("userLeftOrganization",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_AutomaticallyConfirmed:i=this.i18nService.t("automaticallyConfirmedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("automaticallyConfirmedUserId",this.getShortId(e.organizationUserId));break;case o.Bx.OrganizationUser_SelfRevoked:i=n=this.i18nService.t("userSelfRevokedOrganizationOwnership");break;case o.Bx.Organization_Updated:i=n=this.i18nService.t("editedOrgSettings");break;case o.Bx.Organization_PurgedVault:i=n=this.i18nService.t("purgedOrganizationVault");break;case o.Bx.Organization_ClientExportedVault:i=n=this.i18nService.t("exportedOrganizationVault");break;case o.Bx.Organization_VaultAccessed:i=n=this.i18nService.t("vaultAccessedByProvider");break;case o.Bx.Organization_EnabledSso:i=n=this.i18nService.t("enabledSso");break;case o.Bx.Organization_DisabledSso:i=n=this.i18nService.t("ssoTurnedOff");break;case o.Bx.Organization_EnabledKeyConnector:i=n=this.i18nService.t("enabledKeyConnector");break;case o.Bx.Organization_DisabledKeyConnector:i=n=this.i18nService.t("disabledKeyConnector");break;case o.Bx.Organization_SponsorshipsSynced:i=n=this.i18nService.t("sponsorshipsSynced");break;case o.Bx.Organization_CollectionManagementUpdated:i=this.i18nService.t("modifiedCollectionManagement",this.formatOrganizationId(e)),n=this.i18nService.t("modifiedCollectionManagement",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitCollectionCreationEnabled:i=this.i18nService.t("limitCollectionCreationEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionCreationEnabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitCollectionCreationDisabled:i=this.i18nService.t("limitCollectionCreationDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionCreationDisabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitCollectionDeletionEnabled:i=this.i18nService.t("limitCollectionDeletionEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionDeletionEnabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitCollectionDeletionDisabled:i=this.i18nService.t("limitCollectionDeletionDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionDeletionDisabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitItemDeletionEnabled:i=this.i18nService.t("limitItemDeletionEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitItemDeletionEnabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_LimitItemDeletionDisabled:i=this.i18nService.t("limitItemDeletionDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitItemDeletionDisabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled:i=this.i18nService.t("allowAdminAccessToAllCollectionItemsEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("allowAdminAccessToAllCollectionItemsEnabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled:i=this.i18nService.t("allowAdminAccessToAllCollectionItemsDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("allowAdminAccessToAllCollectionItemsDisabled",this.getShortId(e.organizationId));break;case o.Bx.Organization_ItemOrganization_Accepted:i=n=this.i18nService.t("userAcceptedTransfer");break;case o.Bx.Organization_ItemOrganization_Declined:i=n=this.i18nService.t("userDeclinedTransfer");break;case o.Bx.Organization_AutoConfirmEnabled_Admin:i=n=this.i18nService.t("autoConfirmEnabledByAdmin");break;case o.Bx.Organization_AutoConfirmDisabled_Admin:i=n=this.i18nService.t("autoConfirmDisabledByAdmin");break;case o.Bx.Organization_AutoConfirmEnabled_Portal:i=n=this.i18nService.t("autoConfirmEnabledByPortal");break;case o.Bx.Organization_AutoConfirmDisabled_Portal:i=n=this.i18nService.t("autoConfirmDisabledByPortal");break;case o.Bx.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=r.tt[t.type]),n=this.i18nService.t("modifiedPolicyId",s);break}case o.Bx.ProviderUser_Invited:i=this.i18nService.t("invitedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.providerUserId));break;case o.Bx.ProviderUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.providerUserId));break;case o.Bx.ProviderUser_Updated:i=this.i18nService.t("editedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.providerUserId));break;case o.Bx.ProviderUser_Removed:i=this.i18nService.t("removedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.providerUserId));break;case o.Bx.ProviderOrganization_Created:i=this.i18nService.t("createdOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("createdOrganizationId",this.getShortId(e.providerOrganizationId));break;case o.Bx.ProviderOrganization_Added:i=this.i18nService.t("addedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("addedOrganizationId",this.getShortId(e.providerOrganizationId));break;case o.Bx.ProviderOrganization_Removed:i=this.i18nService.t("removedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("removedOrganizationId",this.getShortId(e.providerOrganizationId));break;case o.Bx.ProviderOrganization_VaultAccessed:i=this.i18nService.t("accessedClientVault",this.formatProviderOrganizationId(e)),n=this.i18nService.t("accessedClientVault",this.getShortId(e.providerOrganizationId));break;case o.Bx.OrganizationDomain_Added:i=n=this.i18nService.t("addedDomain",this.escapeHtml(e.domainName));break;case o.Bx.OrganizationDomain_Removed:i=n=this.i18nService.t("removedDomain",this.escapeHtml(e.domainName));break;case o.Bx.OrganizationDomain_Verified:i=n=this.i18nService.t("domainClaimedEvent",this.escapeHtml(e.domainName));break;case o.Bx.OrganizationDomain_NotVerified:i=n=this.i18nService.t("domainNotClaimedEvent",this.escapeHtml(e.domainName));break;case o.Bx.Secret_Retrieved:i=this.i18nService.t("accessedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("accessedSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Secret_Created:i=this.i18nService.t("createdSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("createdSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Secret_Deleted:i=this.i18nService.t("deletedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("deletedSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Secret_Permanently_Deleted:i=this.i18nService.t("permanentlyDeletedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("permanentlyDeletedSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Secret_Restored:i=this.i18nService.t("restoredSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("restoredSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Secret_Edited:i=this.i18nService.t("editedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("editedSecretWithId",this.getShortId(e.secretId));break;case o.Bx.Project_Retrieved:i=this.i18nService.t("accessedProjectWithIdentifier",this.formatProjectId(e,t)),n=this.i18nService.t("accessedProjectWithIdentifier",this.getShortId(e.projectId));break;case o.Bx.Project_Created:i=this.i18nService.t("createdProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("createdProjectWithId",this.getShortId(e.projectId));break;case o.Bx.Project_Deleted:i=this.i18nService.t("deletedProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("deletedProjectWithId",this.getShortId(e.projectId));break;case o.Bx.Project_Edited:i=this.i18nService.t("editedProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("editedProjectWithId",this.getShortId(e.projectId));break;case o.Bx.ServiceAccount_UserAdded:i=this.i18nService.t("addedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t)),n=this.i18nService.t("addedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t));break;case o.Bx.ServiceAccount_UserRemoved:i=this.i18nService.t("removedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t)),n=this.i18nService.t("removedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t));break;case o.Bx.ServiceAccount_GroupRemoved:i=this.i18nService.t("removedGroupFromServiceAccountWithId",this.formatGroupId(e),this.formatServiceAccountId(e,t)),n=this.i18nService.t("removedGroupFromServiceAccountWithId",this.formatGroupId(e),this.formatServiceAccountId(e,t));break;case o.Bx.ServiceAccount_GroupAdded:i=this.i18nService.t("addedGroupToServiceAccountId",this.formatGroupId(e),this.formatServiceAccountId(e,t)),n=this.i18nService.t("addedGroupToServiceAccountId",this.formatGroupId(e),this.formatServiceAccountId(e,t));break;case o.Bx.ServiceAccount_Created:i=this.i18nService.t("serviceAccountCreatedWithId",this.formatServiceAccountId(e,t)),n=this.i18nService.t("serviceAccountCreatedWithId",this.formatServiceAccountId(e,t));break;case o.Bx.ServiceAccount_Deleted:i=this.i18nService.t("serviceAccountDeletedWithId",this.formatServiceAccountId(e,t)),n=this.i18nService.t("serviceAccountDeletedWithId",this.formatServiceAccountId(e,t))}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 a.bq.Android:return["bwi-mobile",this.i18nService.t("mobile")+" - Android"];case a.bq.iOS:return["bwi-mobile",this.i18nService.t("mobile")+" - iOS"];case a.bq.UWP:return["bwi-mobile",this.i18nService.t("mobile")+" - Windows"];case a.bq.ChromeExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Chrome"];case a.bq.FirefoxExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Firefox"];case a.bq.OperaExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Opera"];case a.bq.EdgeExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Edge"];case a.bq.VivaldiExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Vivaldi"];case a.bq.SafariExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Safari"];case a.bq.WindowsDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - Windows"];case a.bq.MacOsDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - macOS"];case a.bq.LinuxDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - Linux"];case a.bq.ChromeBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Chrome"];case a.bq.FirefoxBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Firefox"];case a.bq.OperaBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Opera"];case a.bq.SafariBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Safari"];case a.bq.VivaldiBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Vivaldi"];case a.bq.EdgeBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Edge"];case a.bq.IEBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - IE"];case a.bq.DuckDuckGoBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - DuckDuckGo"];case a.bq.Server:return["bwi-user-monitor",this.i18nService.t("server")];case a.bq.WindowsCLI:return["bwi-cli",this.i18nService.t("cli")+" - Windows"];case a.bq.MacOsCLI:return["bwi-cli",this.i18nService.t("cli")+" - macOS"];case a.bq.LinuxCLI:return["bwi-cli",this.i18nService.t("cli")+" - Linux"];case a.bq.UnknownBrowser:return["bwi-browser",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,t){const i=this.getShortId(e.secretId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/secrets?search="+i+"&viewEvents="+e.secretId+"&type=all"),n.outerHTML}formatServiceAccountId(e,t){const i=this.getShortId(e.grantedServiceAccountId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/machine-accounts?search="+i+"&viewEvents="+e.grantedServiceAccountId+"&type=all"),n.outerHTML}formatUserId(e,t){const i=this.getShortId(e.userId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/organizations/"+e.organizationId+"/members?search="+i),n.outerHTML}formatProjectId(e,t){const i=this.getShortId(e.projectId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/projects?search="+i+"&viewEvents="+e.projectId+"&type=all"),n.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)}escapeHtml(e){if(!e)return e;const t=document.createElement("div");return t.textContent=e,t.innerHTML}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}}A.ɵfac=function(e){return new(e||A)(l.KVO(c.W),l.KVO(d.m),l.KVO(u.D))},A.ɵprov=l.jDH({token:A,factory:A.ɵfac});class p{constructor(){this.cipherInfo=!0,this.disableLink=!1}}},30126(e,t,i){"use strict";i.d(t,{o:()=>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"]},30414(e,t,i){"use strict";i.d(t,{O:()=>ie});var n=i(67553),r=i(56962),s=i(78781),o=i(39488),a=i(31442),l=i(90118),c=i(24593),d=i(62819),u=i(77723),h=i(94573),A=i(74208),p=i(33812),g=i(5556),v=i(66316),f=i(35500),m=i(50700),y=i(51757),C=i(26333),w=i(93103),I=i(47428),b=i(44432),B=i(10672),E=i(57178),S=i(30930),Q=i(38410),k=i(12694),T=i(16496),F=i(75697),P=i(49112),R=i(58604),D=i(5884),M=i(16568),x=i(77468),O=i(25740),G=i(55818),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function V(e,t){1&e&&(p.j41(0,"div"),p.nrm(1,"i",1),p.nI1(2,"i18n"),p.j41(3,"span",2),p.EFF(4),p.nI1(5,"i18n"),p.k0s()()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"loading"))),p.R7$(3),p.JRh(p.bMT(5,5,"loading")))}function j(e,t){1&e&&(p.j41(0,"bit-callout",3),p.nI1(1,"i18n"),p.EFF(2),p.nI1(3,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"goodNews"))),p.R7$(2),p.SpI(" ",p.bMT(3,5,"noInactive2fa")," "))}function N(e,t){if(1&e&&(p.j41(0,"bit-toggle",14),p.EFF(1),p.nrm(2,"bit-berry",14),p.k0s()),2&e){const e=t.$implicit,i=p.XpG(5);p.Y8G("value",e),p.R7$(),p.SpI(" ",i.getName(e)," "),p.R7$(),p.Y8G("value",i.getCount(e))}}function z(e,t){if(1&e){const e=p.RV6();p.j41(0,"bit-toggle-group",13),p.nI1(1,"async"),p.nI1(2,"i18n"),p.bIt("selectedChange",function(t){A.eBV(e);const i=p.XpG(4);return A.Njj(i.filterOrgToggle(t))}),p.Z7z(3,N,3,3,"bit-toggle",14,p.fX1),p.k0s()}if(2&e){const e=p.XpG(4);p.Y8G("selected",p.bMT(1,2,e.filterOrgStatus$)),p.BMQ("aria-label",p.bMT(2,4,"addAccessFilter")),p.R7$(3),p.Dyx(e.filterStatus)}}function Y(e,t){if(1&e){const e=p.RV6();p.j41(0,"bit-chip-filter",15),p.bIt("ngModelChange",function(t){A.eBV(e);const i=p.XpG(4);return A.Njj(i.filterOrgToggleChipSelect(t))}),p.k0s()}if(2&e){const e=p.XpG(4);p.Y8G("placeholderText",e.chipSelectOptions[0].label)("options",e.chipSelectOptions)("ngModel",e.selectedFilterChip)}}function L(e,t){if(1&e&&p.nVh(0,z,5,6,"bit-toggle-group",11)(1,Y,1,3,"bit-chip-filter",12),2&e){const e=p.XpG(3);p.vxM(e.canDisplayToggleGroup()?0:1)}}function K(e,t){1&e&&(p.j41(0,"th",9),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e&&(p.R7$(),p.JRh(p.bMT(2,1,"owner")))}function X(e,t){if(1&e){const e=p.RV6();p.j41(0,"a",22),p.nI1(1,"i18n"),p.bIt("click",function(){A.eBV(e);const t=p.XpG().$implicit,i=p.XpG(3);return A.Njj(i.selectCipher(t))}),p.EFF(2),p.k0s()}if(2&e){const e=p.XpG().$implicit;p.Y8G("title",p.mNQ(p.i5U(1,3,"editItemWithName",e.name))),p.R7$(2),p.JRh(e.name)}}function q(e,t){if(1&e&&(p.j41(0,"span",19),p.EFF(1),p.k0s()),2&e){const e=p.XpG().$implicit;p.Y8G("title",p.mNQ(e.name)),p.R7$(),p.JRh(e.name)}}function H(e,t){1&e&&(p.nrm(0,"i",23),p.nI1(1,"i18n"),p.j41(2,"span",2),p.EFF(3),p.nI1(4,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"shared"))),p.R7$(3),p.JRh(p.bMT(4,5,"shared")))}function W(e,t){1&e&&(p.nrm(0,"i",24),p.nI1(1,"i18n"),p.j41(2,"span",2),p.EFF(3),p.nI1(4,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"attachments"))),p.R7$(3),p.JRh(p.bMT(4,5,"attachments")))}function $(e,t){if(1&e&&(p.nrm(0,"app-org-badge",25),p.nI1(1,"async"),p.nI1(2,"orgNameFromId")),2&e){const e=p.XpG(2).$implicit,t=p.XpG(3);p.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",p.i5U(2,5,e.organizationId,p.bMT(1,3,t.organizations$)))}}function J(e,t){if(1&e&&(p.j41(0,"td",8),p.nVh(1,$,3,8,"app-org-badge",25),p.k0s()),2&e){const e=p.XpG(4);p.R7$(),p.vxM(e.organization?-1:1)}}function Z(e,t){if(1&e&&(p.nrm(0,"a",21),p.nI1(1,"i18n")),2&e){const e=p.XpG().$implicit,t=p.XpG(3);p.Y8G("href",t.cipherDocs.get(e.id),p.B4B)("label",p.bMT(1,2,"instructions"))}}function _(e,t){if(1&e&&(p.j41(0,"td",8),p.nrm(1,"app-vault-icon",16),p.k0s(),p.j41(2,"td",17),p.nVh(3,X,3,6,"a",18)(4,q,2,3,"span",19),p.nVh(5,H,5,7),p.nVh(6,W,5,7),p.nrm(7,"br"),p.j41(8,"small"),p.EFF(9),p.k0s()(),p.nVh(10,J,2,1,"td",8),p.j41(11,"td",20),p.nVh(12,Z,2,4,"a",21),p.k0s()),2&e){const e=t.$implicit,i=p.XpG(3);p.R7$(),p.Y8G("cipher",e),p.R7$(2),p.vxM(!i.organization||i.canManageCipher(e)?3:4),p.R7$(2),p.vxM(!i.organization&&e.organizationId?5:-1),p.R7$(),p.vxM(e.hasAttachments?6:-1),p.R7$(3),p.JRh(e.subTitle),p.R7$(),p.vxM(i.isAdminConsoleActive?-1:10),p.R7$(2),p.vxM(i.cipherDocs.has(e.id)?12:-1)}}function ee(e,t){if(1&e&&(p.j41(0,"bit-callout",4),p.nI1(1,"i18n"),p.EFF(2),p.nI1(3,"number"),p.nI1(4,"i18n"),p.k0s(),p.nVh(5,L,2,1),p.j41(6,"bit-table-scroll",5),p.qex(7,6),p.nrm(8,"th",7),p.j41(9,"th",8),p.EFF(10),p.nI1(11,"i18n"),p.k0s(),p.nVh(12,K,3,3,"th",9),p.nrm(13,"th",9),p.bVm(),p.DNE(14,_,13,7,"ng-template",10),p.k0s()),2&e){const e=p.XpG(2);p.Y8G("title",p.mNQ(p.bMT(1,8,"inactive2faFound"))),p.R7$(2),p.SpI(" ",p.brH(4,12,"inactive2faFoundReportDesc",p.bMT(3,10,e.ciphers.length),e.vaultMsg)," "),p.R7$(3),p.vxM(e.showFilterToggle&&!e.isAdminConsoleActive?5:-1),p.R7$(),p.Y8G("dataSource",e.dataSource)("rowSize",75),p.R7$(4),p.JRh(p.bMT(11,16,"name")),p.R7$(2),p.vxM(e.isAdminConsoleActive?-1:12)}}function te(e,t){if(1&e&&(p.j41(0,"div",0),p.nVh(1,j,4,7,"bit-callout",3)(2,ee,15,18),p.k0s()),2&e){const e=p.XpG();p.R7$(),p.vxM(e.ciphers.length?2:1)}}class ie extends u.n{constructor(e,t,i,n,r,s,o,a,l,c,d){super(e,i,s,t,n,o,a,l,c),this.cipherService=e,this.organizationService=t,this.logService=r,this.changeDetectorRef=d,this.services=new Map,this.cipherDocs=new Map,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return U(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return U(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[n,r]=this.isInactive2faCipher(e);r&&(t.push(e),""!==n&&i.set(e.id,n))}),this.filterCiphersByOrg(t),this.cipherDocs=i,this.changeDetectorRef.markForCheck()}})}isInactive2faCipher(e){let t="",i=!1;const{type:n,login:r,isDeleted:o,edit:l,viewPassword:c}=e;if(n!==a.gC.Login||null!=r.totp&&""!==r.totp||!r.hasUris||o||!this.organization&&!l||!c)return[t,i];for(let a=0;a<r.uris.length;a++){const e=r.uris[a];if(null!=e.uri&&""!==e.uri){const n=e.uri.replace("www.",""),r=s.A.getHost(n),o=s.A.getDomain(n);if(null!=r&&this.services.has(r)){null!=this.services.get(r)&&(t=this.services.get(r)||""),i=!0;break}if(null!=o&&this.services.has(o)){null!=this.services.get(o)&&(t=this.services.get(o)||""),i=!0;break}}}return[t,i]}load2fa(){return U(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)}}this.changeDetectorRef.markForCheck()})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return U(this,void 0,void 0,function*(){if(e===c.r.Deleted)return null;const[i,n]=this.isInactive2faCipher(t);return n?(this.cipherDocs.set(t.id,i),t):null})}}ie.ɵfac=function(e){return new(e||ie)(p.rXU(g.p),p.rXU(n.PV),p.rXU(v.o3),p.rXU(f.D),p.rXU(r.K),p.rXU(l.qX),p.rXU(m.W),p.rXU(o.H),p.rXU(l.hI),p.rXU(d.l),p.rXU(h.gRc))},ie.ɵcmp=p.VBU({type:ie,selectors:[["app-inactive-two-factor-report"]],standalone:!1,features:[p.Vt3],decls:7,vars:4,consts:[[1,"tw-mt-4"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","success",3,"title"],["type","danger",3,"title"],["layout","fixed",3,"dataSource","rowSize"],["header",""],["bitCell","",1,"tw-w-12"],["bitCell",""],["bitCell","",1,"tw-w-1/4"],["bitRowDef",""],[3,"selected"],["fullWidth","true",3,"placeholderText","options","ngModel"],[3,"selectedChange","selected"],[3,"value"],["fullWidth","true",3,"ngModelChange","placeholderText","options","ngModel"],[3,"cipher"],["bitCell","",1,"tw-truncate","tw-max-w-0"],["bitLink","","href","#","appStopClick","",3,"title"],[3,"title"],["bitCell","",1,"tw-text-right"],["bit-chip-action","","target","_blank","rel","noreferrer",3,"href","label"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared","tw-ml-1",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-1",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(p.nrm(0,"app-header"),p.j41(1,"bit-container")(2,"p"),p.EFF(3),p.nI1(4,"i18n"),p.k0s(),p.nVh(5,V,6,7,"div")(6,te,3,1,"div",0),p.k0s()),2&e&&(p.R7$(3),p.JRh(p.bMT(4,2,"inactive2faReportDesc")),p.R7$(2),p.vxM(!t.hasLoaded&&t.loading?5:6))},dependencies:[y.BC,y.vS,C.R,w.Y,I.x,b.G,B.H,E.g,S.a,Q.Q,S.N,k.H,T.a,F.P,P.f,R.g,D.W,M.c,x.Jj,x.QX,O.$,G.t],encapsulation:2,changeDetection:0})},30623(e,t,i){"use strict";i.d(t,{r:()=>g});var n=i(74208),r=i(94735),s=i(37115),o=i(57178),a=i(81573),l=i(29029),c=i(66316),d=i(81525),u=i(33812),h=i(56898),A=i(67311),p=i(25740);class g{constructor(e){this.dialogRef=e,this.platformUtilsService=(0,n.WQX)(s.y),this.params=(0,n.WQX)(d.Qs)}get contentKey(){return this.params.contentKey}onCancel(){var e,t;null===(t=(e=this.params).onCancel)||void 0===t||t.call(e),this.dialogRef.close(!1)}onContinue(){var e,t;null===(t=(e=this.params).onContinue)||void 0===t||t.call(e),this.dialogRef.close(!0)}openLink(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/uri-match-detection/")}static open(e,t){return e.open(g,{data:t,disableClose:!0,positionStrategy:new c.u3})}}g.ɵfac=function(e){return new(e||g)(u.rXU(c.ce))},g.ɵcmp=u.VBU({type:g,selectors:[["ng-component"]],decls:20,vars:15,consts:[["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl","bwi-exclamation-triangle","tw-text-warning"],["bitDialogTitle",""],["bitDialogContent","",1,"tw-mb-1"],[1,"tw-mb-1","tw-hyphens-none"],["bitLink","","type","button","linkType","primary",3,"click"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(u.j41(0,"bit-simple-dialog"),u.nrm(1,"i",0),u.j41(2,"span",1),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.j41(5,"div",2)(6,"p",3),u.EFF(7),u.nI1(8,"i18n"),u.nrm(9,"br"),u.j41(10,"button",4),u.bIt("click",function(e){return t.openLink(e)}),u.EFF(11),u.nI1(12,"i18n"),u.k0s()()(),u.qex(13,5),u.j41(14,"button",6),u.bIt("click",function(){return t.onContinue()}),u.EFF(15),u.nI1(16,"i18n"),u.k0s(),u.j41(17,"button",7),u.bIt("click",function(){return t.onCancel()}),u.EFF(18),u.nI1(19,"i18n"),u.k0s(),u.bVm(),u.k0s()),2&e&&(u.R7$(3),u.SpI(" ",u.bMT(4,5,"warningCapitalized")," "),u.R7$(4),u.SpI(" ",u.bMT(8,7,t.contentKey)," "),u.R7$(4),u.SpI(" ",u.bMT(12,9,"uriMatchWarningDialogLink")," "),u.R7$(4),u.SpI(" ",u.bMT(16,11,"continue")," "),u.R7$(3),u.SpI(" ",u.bMT(19,13,"cancel")," "))},dependencies:[o.g,l.t,h.Q,a.P,A.LJ,A.hJ,A.o_,r.p,p.$],encapsulation:2})},30634(e,t,i){"use strict";function n({element:e,title:t,label:i}){t&&e.setAttribute("title",t),i&&e.setAttribute("aria-label",i)}i.d(t,{J:()=>n})},30675(e,t,i){"use strict";i.d(t,{a:()=>n.a});var n=i(37856)},30930(e,t,i){"use strict";i.d(t,{N:()=>v,a:()=>g});var n=i(94251),r=i(77468),s=i(94573),o=i(69672),a=i(22466),l=i(36572),c=i(33812);const d=[[["","header",""]]],u=e=>({paddingBottom:e}),h=e=>({$implicit:e});function A(e,t){1&e&&c.eu8(0)}function p(e,t){if(1&e&&(c.j41(0,"tr",4),c.DNE(1,A,1,0,"ng-container",5),c.k0s()),2&e){const e=t.$implicit,i=c.XpG();c.R7$(),c.Y8G("ngTemplateOutlet",i.rowDef().template)("ngTemplateOutletContext",c.eq3(2,h,e))}}class g{constructor(e){this.template=e}}g.ɵfac=function(e){return new(e||g)(c.rXU(c.C4Q))},g.ɵdir=c.FsC({type:g,selectors:[["","bitRowDef",""]]});class v extends l.O{constructor(e,t){super(),this.zone=e,this.el=t,this.rowSize=s.hFB.required(),this.trackBy=(0,s.hFB)(),this.rowDef=(0,s.sbv)(g),this.headerHeight=0}ngAfterViewInit(){this.headerObserver=new ResizeObserver(e=>{this.zone.run(()=>{this.headerHeight=e[0].contentRect.height})}),this.headerObserver.observe(this.el.nativeElement.querySelector("thead"))}ngOnDestroy(){super.ngOnDestroy(),this.headerObserver&&this.headerObserver.disconnect()}}v.ɵfac=function(e){return new(e||v)(c.rXU(c.SKi),c.rXU(c.aKT))},v.ɵcmp=c.VBU({type:v,selectors:[["bit-table-scroll"]],contentQueries:function(e,t,i){1&e&&c.C6U(i,t.rowDef,g,5),2&e&&c.NyB()},inputs:{rowSize:[1,"rowSize"],trackBy:[1,"trackBy"]},features:[c.Jv_([{provide:l.O,useExisting:v}]),c.Vt3],ngContentSelectors:["[header]"],decls:7,vars:8,consts:[["bitScrollLayout","",3,"itemSize","ngStyle"],[3,"ngClass"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-medium","tw-text-muted"],["bitRow","",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy","cdkVirtualForTemplateCacheSize"],["bitRow",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(c.NAR(d),c.j41(0,"cdk-virtual-scroll-viewport",0)(1,"table",1)(2,"thead",2)(3,"tr"),c.SdG(4),c.k0s()(),c.j41(5,"tbody"),c.DNE(6,p,2,4,"tr",3),c.k0s()()()),2&e&&(c.Y8G("itemSize",t.rowSize())("ngStyle",c.eq3(6,u,t.headerHeight+"px")),c.R7$(),c.Y8G("ngClass",t.tableClass),c.R7$(5),c.Y8G("cdkVirtualForOf",t.rows$)("cdkVirtualForTrackBy",t.trackBy())("cdkVirtualForTemplateCacheSize",0))},dependencies:[r.MD,r.YU,r.T3,r.B3,n.d6,n.yg,n.E$,a.Y,o.lp],encapsulation:2})},31442(e,t,i){"use strict";i.d(t,{xP:()=>l,b1:()=>n.b,gC:()=>r.gC,XS:()=>A,PU:()=>s,ZX:()=>c,EU:()=>a,ak:()=>u,KN:()=>r.KN,D1:()=>o,NI:()=>d,aw:()=>h,g7:()=>r.g7});var n=i(36501),r=i(7919);const s=Object.freeze({Text:0,Hidden:1,Boolean:2,Linked:3});function o(e){switch(e){case s.Text:case s.Hidden:case s.Boolean:case s.Linked:return e;default:return s.Text}}const a={Username:100,Password:101},l={CardholderName:300,ExpMonth:301,ExpYear:302,Code:303,Brand:304,Number:305},c={Title:400,MiddleName:401,Address1:402,Address2:403,Address3:404,City:405,State:406,PostalCode:407,Country:408,Company:409,Email:410,Phone:411,Ssn:412,Username:413,PassportNumber:414,LicenseNumber:415,FirstName:416,LastName:417,FullName:418};function d(e){if(null==e)return;return[...Object.values(a),...Object.values(l),...Object.values(c)].includes(e)?e:void 0}const u={Generic:0};function h(e){return u.Generic}const A={Index:"popup/index.html#/",AtRiskPasswords:"popup/index.html#/at-risk-passwords"}},31539(e,t,i){"use strict";i.d(t,{CV:()=>m,W_:()=>p,HG:()=>E,EO:()=>k,Xt:()=>P,Z6:()=>M});var n=i(74208),r=i(23649),s=i(72245),o=i(35500),a=i(68455),l=i(84110),c=i(81441),d=i(52057),u=i(83541),h=i(83516),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const p=(e,t)=>A(void 0,void 0,void 0,function*(){const e=(0,n.WQX)(a.u),i=(0,n.WQX)(r.Ix),A=(0,n.WQX)(h.U),p=(0,n.WQX)(d.K),g=(0,n.WQX)(o.D),v=(0,n.WQX)(u.L),f=yield e.getAuthStatus();if(f===l.J.LoggedOut)return A.send("authBlocked",{url:t.url}),!1;const m=(yield(0,s._)(g.activeAccount$)).id,y=yield(0,s._)(v.forceSetPasswordReason$(m));if(f===l.J.Locked&&y===c.n.SsoNewJitProvisionedUser&&!t.url.includes("set-initial-password"))return i.createUrlTree(["/set-initial-password"]);if(f===l.J.Locked&&y===c.n.TdeOffboardingUntrustedDevice&&!t.url.includes("set-initial-password"))return i.createUrlTree(["/set-initial-password"]);if(f===l.J.Locked&&y!==c.n.SsoNewJitProvisionedUser&&y!==c.n.TdeOffboardingUntrustedDevice)return null!=t&&A.send("lockedUrl",{url:t.url}),i.createUrlTree(["lock"],{queryParams:{promptBiometric:!0}});if((y===c.n.TdeUserWithoutPasswordHasPasswordResetPermission||y===c.n.TdeOffboarding)&&!t.url.includes("set-initial-password")){const e="/set-initial-password";return i.createUrlTree([e])}if((y===c.n.AdminForcePasswordReset||y===c.n.WeakMasterPassword)&&!t.url.includes("change-password")){const e="/change-password";return i.createUrlTree([e])}return!(y==c.n.None&&!t.url.includes("remove-password")&&(yield(0,s._)(p.convertAccountRequired$)))||i.createUrlTree(["/remove-password"])});var g=i(12058),v=i(56962),f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function m(){return()=>f(this,void 0,void 0,function*(){const e=(0,n.WQX)(g.sg),t=(0,n.WQX)(v.K),i=(0,n.WQX)(r.Ix);return null!==(yield(0,s._)(e.currentAuthType$))||(t.error("No active login session found."),i.createUrlTree(["/login"]))})}var y=i(3633);var C=i(62166),w=i(39935),I=i(16184),b=i(8916),B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function E(){return(e,t)=>B(this,void 0,void 0,function*(){const t=(0,n.WQX)(a.u),i=(0,n.WQX)(b.Lu),c=(0,n.WQX)(w.M),u=(0,n.WQX)(r.Ix),h=(0,n.WQX)(C.i),A=(0,n.WQX)(I.ep),p=(0,n.WQX)(o.D),g=(0,n.WQX)(d.K),v=yield(0,s._)(p.activeAccount$);if(!v)return u.createUrlTree(["/"]);if((yield(0,s._)(t.authStatusFor$(v.id)))!==l.J.Locked)return u.createUrlTree(["/"]);if(null!=(yield(0,s._)(g.requiresDomainConfirmation$(v.id))))return u.createUrlTree(["confirm-key-connector-domain"]);if(!(yield A.canLock(v.id)))return!1;const f=yield(0,s._)(c.supportsDeviceTrust$);if("login-initiated"===e.queryParams.from&&f&&(yield h.hasMasterPassword()))return!0;const m=yield(0,s._)(i.everHadUserKey$(v.id));return!(f&&!m)})}var S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Q={loggedIn:"/vault",loggedOut:"/login",locked:"/lock",notDecrypted:"/login-initiated"};function k(e={}){const t=Object.assign(Object.assign({},Q),e);return e=>S(this,void 0,void 0,function*(){const i=(0,n.WQX)(a.u),c=(0,n.WQX)(b.Lu),d=(0,n.WQX)(w.M),u=(0,n.WQX)(o.D),h=(0,n.WQX)(v.K),A=(0,n.WQX)(r.Ix),p=yield i.getAuthStatus();if(p===l.J.LoggedOut)return A.createUrlTree([t.loggedOut],{queryParams:e.queryParams});if(p===l.J.Unlocked)return A.createUrlTree([t.loggedIn],{queryParams:e.queryParams});const g=yield(0,s._)(d.supportsDeviceTrust$),f=yield(0,s._)(u.activeAccount$.pipe(y.F6)),m=yield(0,s._)(c.everHadUserKey$(f));return p===l.J.Locked&&g&&!m?(h.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[p],g,m),A.createUrlTree([t.notDecrypted],{queryParams:e.queryParams})):p===l.J.Locked?A.createUrlTree([t.locked],{queryParams:e.queryParams}):A.createUrlTree(["/"])})}var T=i(3204),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function P(){return(e,t)=>F(this,void 0,void 0,function*(){const e=(0,n.WQX)(a.u),t=(0,n.WQX)(b.Lu),i=(0,n.WQX)(w.M),c=(0,n.WQX)(o.D),d=(0,n.WQX)(v.K),u=(0,n.WQX)(r.Ix),h=yield(0,s._)(c.activeAccount$.pipe((0,T.T)(e=>null==e?void 0:e.id)));if(null==h)return u.createUrlTree(["/"]);const A=yield e.getAuthStatus(),p=yield(0,s._)(i.supportsDeviceTrust$),g=yield(0,s._)(t.everHadUserKey$(h));return A!==l.J.Locked||!p||g?u.createUrlTree(["/"]):(d.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[A],p,g),!0)})}var R=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const D={homepage:()=>"/vault",locked:"/lock"};function M(e={}){return t=>R(this,void 0,void 0,function*(){return function(e,t){return R(this,void 0,void 0,function*(){const e=(0,n.WQX)(o.D),i=(0,n.WQX)(a.u),c=(0,n.WQX)(r.Ix),d=(0,n.WQX)(b.Lu),u=(0,n.WQX)(w.M),h=(0,n.WQX)(v.K),A=yield(0,s._)(e.activeAccount$);if(!A)return!0;const p=yield(0,s._)(i.authStatusFor$(A.id));if(null==p||p===l.J.LoggedOut)return!0;if(p===l.J.Unlocked)return c.createUrlTree([t.homepage()]);const g=yield(0,s._)(u.supportsDeviceTrustByUserId$(A.id)),f=yield(0,s._)(d.everHadUserKey$(A.id));return p===l.J.Locked&&g&&!f?(h.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[p],g,f),c.createUrlTree(["/login-initiated"])):c.createUrlTree([t.locked])})}(0,Object.assign(Object.assign({},D),e))})}},31857(e,t,i){"use strict";i.d(t,{$g:()=>n.$g,BA:()=>n.BA,Br:()=>n.Br,EF:()=>n.EF,Gd:()=>n.Gd,Gg:()=>n.Gg,Gm:()=>n.Gm,HR:()=>n.HR,Iw:()=>n.Iw,Jb:()=>n.Jb,K8:()=>n.K8,L_:()=>n.L_,MC:()=>n.MC,O2:()=>n.O2,OB:()=>n.OB,Ok:()=>n.Ok,P7:()=>n.P7,PM:()=>n.PM,Qb:()=>n.Qb,Rv:()=>n.Rv,Sc:()=>n.Sc,Tf:()=>n.Tf,Ud:()=>n.Ud,Vl:()=>n.Vl,W$:()=>n.W$,Wm:()=>n.Wm,XH:()=>n.XH,Xk:()=>n.Xk,Y2:()=>n.Y2,Z6:()=>n.Z6,Zs:()=>n.Zs,_Q:()=>n._Q,aC:()=>n.aC,aL:()=>n.aL,bI:()=>n.bI,bh:()=>n.bh,bj:()=>n.bj,d1:()=>n.d1,dD:()=>n.dD,dn:()=>n.dn,dp:()=>n.dp,dr:()=>n.dr,eP:()=>n.eP,fK:()=>n.fK,fn:()=>n.fn,g4:()=>n.g4,gc:()=>n.gc,hs:()=>n.hs,i9:()=>n.i9,iK:()=>n.iK,ie:()=>n.ie,iy:()=>n.iy,jB:()=>n.jB,jb:()=>n.jb,jx:()=>n.jx,k2:()=>n.k2,kj:()=>n.kj,km:()=>n.km,lR:()=>n.lR,ll:()=>n.ll,nr:()=>n.nr,oR:()=>n.oR,q9:()=>n.q9,qd:()=>n.qd,rB:()=>n.rB,s2:()=>n.s2,uv:()=>n.uv,v2:()=>n.v2,wt:()=>n.wt,ww:()=>n.ww,xS:()=>n.xS,xu:()=>n.xu,y7:()=>n.y7});var n=i(21879);i(93173)},31925(e,t,i){"use strict";i.d(t,{Kl:()=>B,zN:()=>I});var n=i(69194),r=i(44500),s=i(33338),o=i(93695),a=i(72245),l=i(3204),c=i(8916),d=i(43978),u=i(82468),h=i(48541),A=i(78781),p=i(43890),g=i(31857),v=i(39306);class f{constructor(e){this.key=e}}class m{constructor(e,t,i,n){this.key=e,this.kdf=t.kdfType,this.kdfIterations=t.iterations,t.kdfType===c.ao.Argon2id&&(this.kdfMemory=t.memory,this.kdfParallelism=t.parallelism),this.orgIdentifier=i,this.keys=n}}var y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},C=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},w=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});const I=new g.Ok(g._Q,"usesKeyConnector",{deserializer:e=>e,clearOn:["logout"],cleanupDelayMs:0}),b=new g.Ok(g._Q,"newSsoUserKeyConnectorConversion",{deserializer:e=>null==e?null:{kdfConfig:e.kdfConfig.kdfType===c.ao.PBKDF2_SHA256?c.n1.fromJSON(e.kdfConfig):c.hU.fromJSON(e.kdfConfig),keyConnectorUrl:e.keyConnectorUrl,organizationId:e.organizationId},clearOn:["logout"],cleanupDelayMs:0});class B{constructor(e,t,i,a,l,c,d,u,h,A,p,g,v,f,m){this.masterPasswordService=t,this.keyService=i,this.apiService=a,this.tokenService=l,this.logService=c,this.organizationService=d,this.keyGenerationService=u,this.logoutCallback=h,this.stateProvider=A,this.configService=p,this.registerSdkService=g,this.accountCryptographicStateService=v,this.sdkService=f,this.userDecryptionOptionsService=m,this.convertAccountRequired$=e.activeAccount$.pipe((0,n.p)(e=>null!=e),(0,r.n)(e=>(0,s.z)([(0,o.of)(e.id),this.organizationService.organizations$(e.id).pipe((0,n.p)(e=>null!=e)),this.stateProvider.getUserState$(I,e.id).pipe((0,n.p)(e=>null!=e)),l.hasAccessToken$(e.id).pipe((0,n.p)(e=>e))])),(0,r.n)(e=>y(this,[e],void 0,function*([e,t,i]){const n=yield this.tokenService.getIsExternal(e),r=null!=this.findManagingOrganization(t);return n&&r&&!i})))}setUsesKeyConnector(e,t){return y(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,I).update(()=>e)})}getUsesKeyConnector(e){return y(this,void 0,void 0,function*(){var t;return null!==(t=yield(0,a._)(this.stateProvider.getUserState$(I,e)))&&void 0!==t&&t})}migrateUser(e,t){return y(this,void 0,void 0,function*(){if(yield(0,a._)(this.configService.getFeatureFlag$(u.TO.SdkKeyConnectorMigration)))try{yield(0,a._)(this.sdkService.userClient$(t).pipe((0,l.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");return C(i,t.take(),!1).value.user_crypto_management().migrate_to_key_connector(e)}catch(n){i.error=n,i.hasError=!0}finally{w(i)}})))}catch(n){this.handleKeyConnectorError(n)}else{const i=yield(0,a._)(this.masterPasswordService.masterKey$(t)),r=new f(A.A.fromBufferToB64(i.inner().encryptionKey));try{yield this.apiService.postUserKeyToKeyConnector(e,r)}catch(n){this.handleKeyConnectorError(n)}yield this.apiService.postConvertToKeyConnector()}yield this.setUsesKeyConnector(!0,t),yield this.masterPasswordService.clearMasterKeyHash(t),yield this.masterPasswordService.clearMasterPasswordUnlockData(t);const i=yield(0,a._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(t));i.hasMasterPassword=!1,i.keyConnectorOption={keyConnectorUrl:e},yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(t,i)})}setMasterKeyFromUrl(e,t){return y(this,void 0,void 0,function*(){try{const i=yield this.apiService.getMasterKeyFromKeyConnector(e),n=A.A.fromB64ToArray(i.key),r=new p.e(n);yield this.masterPasswordService.setMasterKey(r,t)}catch(i){this.handleKeyConnectorError(i)}})}getManagingOrganization(e){return y(this,void 0,void 0,function*(){const t=yield(0,a._)(this.organizationService.organizations$(e));return this.findManagingOrganization(t)})}convertNewSsoUserToKeyConnector(e){return y(this,void 0,void 0,function*(){const t=yield(0,a._)(this.stateProvider.getUserState$(b,e));if(null==t)throw new Error("Key Connector conversion not found");const{kdfConfig:i,keyConnectorUrl:n,organizationId:r}=t;(yield(0,a._)(this.configService.getFeatureFlag$(u.TO.EnableAccountEncryptionV2KeyConnectorRegistration)))?yield this.convertNewSsoUserToKeyConnectorV2(e,n,r):yield this.convertNewSsoUserToKeyConnectorV1(e,i,n,r),yield this.stateProvider.getUser(e,b).update(()=>null)})}convertNewSsoUserToKeyConnectorV2(e,t,i){return y(this,void 0,void 0,function*(){const n=yield(0,a._)(this.registerSdkService.registerClient$(e).pipe((0,l.T)(e=>{const n={stack:[],error:void 0,hasError:!1};try{if(!e)throw new Error("SDK not available");return C(n,e.take(),!1).value.auth().registration().post_keys_for_key_connector_registration(t,i)}catch(r){n.error=r,n.hasError=!0}finally{w(n)}})));if(!("V2"in n.account_cryptographic_state)){const e=Object.keys(n.account_cryptographic_state);throw new Error(`Unexpected account cryptographic state version ${e}`)}yield this.masterPasswordService.setMasterKey(p.e.fromString(n.key_connector_key),e),yield this.keyService.setUserKey(p.e.fromString(n.user_key),e),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(new v.k(n.key_connector_key_wrapped_user_key),e),yield this.accountCryptographicStateService.setAccountCryptographicState(n.account_cryptographic_state,e)})}convertNewSsoUserToKeyConnectorV1(e,t,i,n){return y(this,void 0,void 0,function*(){const r=yield this.keyGenerationService.createKey(512),s=yield this.keyService.makeMasterKey(r.keyB64,yield this.tokenService.getEmail(),t),o=new f(A.A.fromBufferToB64(s.inner().encryptionKey));yield this.masterPasswordService.setMasterKey(s,e);const a=yield this.keyService.makeUserKey(s);yield this.keyService.setUserKey(a[0],e),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(a[1],e);const[l,c]=yield this.keyService.makeKeyPair(a[0]);try{yield this.apiService.postUserKeyToKeyConnector(i,o)}catch(p){this.handleKeyConnectorError(p)}const d=new h.G(l,c.encryptedString),u=new m(a[1].encryptedString,t,n,d);yield this.apiService.postSetKeyConnectorKey(u)})}setNewSsoUserKeyConnectorConversionData(e,t){return y(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,b).update(()=>e)})}requiresDomainConfirmation$(e){return this.stateProvider.getUserState$(b,e).pipe((0,l.T)(e=>null!=e?{keyConnectorUrl:e.keyConnectorUrl,organizationSsoIdentifier:e.organizationId}:null))}handleKeyConnectorError(e){throw this.logService.error(e),null!=this.logoutCallback&&this.logoutCallback("keyConnectorError"),new Error("Key Connector error")}findManagingOrganization(e){return e.find(e=>e.keyConnectorEnabled&&e.type!==d.D7.Admin&&e.type!==d.D7.Owner&&!e.isProviderUser)}}},31944(e,t,i){"use strict";i.d(t,{E:()=>n});class n{}},32072(e,t,i){"use strict";i.d(t,{l:()=>a});var n=i(17989),r=i(24072),s=i(82696),o=i(67036);class a extends n.A{constructor(e){super(),null!=e&&(this.title=(0,r.e)(e.title),this.firstName=(0,r.e)(e.firstName),this.middleName=(0,r.e)(e.middleName),this.lastName=(0,r.e)(e.lastName),this.address1=(0,r.e)(e.address1),this.address2=(0,r.e)(e.address2),this.address3=(0,r.e)(e.address3),this.city=(0,r.e)(e.city),this.state=(0,r.e)(e.state),this.postalCode=(0,r.e)(e.postalCode),this.country=(0,r.e)(e.country),this.company=(0,r.e)(e.company),this.email=(0,r.e)(e.email),this.phone=(0,r.e)(e.phone),this.ssn=(0,r.e)(e.ssn),this.username=(0,r.e)(e.username),this.passportNumber=(0,r.e)(e.passportNumber),this.licenseNumber=(0,r.e)(e.licenseNumber))}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new o.O,["title","firstName","middleName","lastName","address1","address2","address3","city","state","postalCode","country","company","email","phone","ssn","username","passportNumber","licenseNumber"],e,"DomainType: Identity; "+t)}toIdentityData(){const e=new s.j;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;const t=new a;return t.title=(0,r.u)(e.title),t.firstName=(0,r.u)(e.firstName),t.middleName=(0,r.u)(e.middleName),t.lastName=(0,r.u)(e.lastName),t.address1=(0,r.u)(e.address1),t.address2=(0,r.u)(e.address2),t.address3=(0,r.u)(e.address3),t.city=(0,r.u)(e.city),t.state=(0,r.u)(e.state),t.postalCode=(0,r.u)(e.postalCode),t.country=(0,r.u)(e.country),t.company=(0,r.u)(e.company),t.email=(0,r.u)(e.email),t.phone=(0,r.u)(e.phone),t.ssn=(0,r.u)(e.ssn),t.username=(0,r.u)(e.username),t.passportNumber=(0,r.u)(e.passportNumber),t.licenseNumber=(0,r.u)(e.licenseNumber),t}toSdkIdentity(){var e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f;return{title:null===(e=this.title)||void 0===e?void 0:e.toSdk(),firstName:null===(t=this.firstName)||void 0===t?void 0:t.toSdk(),middleName:null===(i=this.middleName)||void 0===i?void 0:i.toSdk(),lastName:null===(n=this.lastName)||void 0===n?void 0:n.toSdk(),address1:null===(r=this.address1)||void 0===r?void 0:r.toSdk(),address2:null===(s=this.address2)||void 0===s?void 0:s.toSdk(),address3:null===(o=this.address3)||void 0===o?void 0:o.toSdk(),city:null===(a=this.city)||void 0===a?void 0:a.toSdk(),state:null===(l=this.state)||void 0===l?void 0:l.toSdk(),postalCode:null===(c=this.postalCode)||void 0===c?void 0:c.toSdk(),country:null===(d=this.country)||void 0===d?void 0:d.toSdk(),company:null===(u=this.company)||void 0===u?void 0:u.toSdk(),email:null===(h=this.email)||void 0===h?void 0:h.toSdk(),phone:null===(A=this.phone)||void 0===A?void 0:A.toSdk(),ssn:null===(p=this.ssn)||void 0===p?void 0:p.toSdk(),username:null===(g=this.username)||void 0===g?void 0:g.toSdk(),passportNumber:null===(v=this.passportNumber)||void 0===v?void 0:v.toSdk(),licenseNumber:null===(f=this.licenseNumber)||void 0===f?void 0:f.toSdk()}}static fromSdkIdentity(e){if(null==e)return;const t=new a;return t.title=(0,r.u)(e.title),t.firstName=(0,r.u)(e.firstName),t.middleName=(0,r.u)(e.middleName),t.lastName=(0,r.u)(e.lastName),t.address1=(0,r.u)(e.address1),t.address2=(0,r.u)(e.address2),t.address3=(0,r.u)(e.address3),t.city=(0,r.u)(e.city),t.state=(0,r.u)(e.state),t.postalCode=(0,r.u)(e.postalCode),t.country=(0,r.u)(e.country),t.company=(0,r.u)(e.company),t.email=(0,r.u)(e.email),t.phone=(0,r.u)(e.phone),t.ssn=(0,r.u)(e.ssn),t.username=(0,r.u)(e.username),t.passportNumber=(0,r.u)(e.passportNumber),t.licenseNumber=(0,r.u)(e.licenseNumber),t}}},32287(e,t,i){"use strict";i.d(t,{m:()=>h});var n=i(94573),r=i(26411),s=i(25065),o=i(33812),a=i(86226),l=i(77468),c=i(25740);function d(e,t){1&e&&o.SdG(0)}function u(e,t){1&e&&o.eu8(0)}class h{constructor(){this.required=!1}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=o.VBU({type:h,selectors:[["app-payment-label"]],inputs:{for:"for",required:[2,"required","required",n.L39]},ngContentSelectors:["*"],decls:8,vars:5,consts:[["defaultContent",""],[1,"tw-relative","tw-mt-2"],[1,"tw-absolute","tw-bg-background","tw-px-1","tw-text-sm","tw-text-muted","-tw-top-2.5","tw-left-3","tw-mb-0","tw-max-w-full","tw-pointer-events-auto"],[4,"ngTemplateOutlet"],[1,"tw-text-[0.625rem]","tw-font-normal"]],template:function(e,t){if(1&e&&(o.NAR(),o.DNE(0,d,1,0,"ng-template",null,0,o.C5r),o.j41(2,"div",1)(3,"bit-label",2),o.DNE(4,u,1,0,"ng-container",3),o.j41(5,"span",4),o.EFF(6),o.nI1(7,"i18n"),o.k0s()()()),2&e){const e=o.sdS(1);o.R7$(3),o.BMQ("for",t.for),o.R7$(),o.Y8G("ngTemplateOutlet",e),o.R7$(2),o.SpI("(",o.bMT(7,3,"required"),")")}},dependencies:[r.L,a.j,s.G,l.T3,c.$],encapsulation:2})},32316(e,t,i){"use strict";i.d(t,{O:()=>l});var n=i(93161),r=i(77468),s=i(94573),o=i(33812),a=i(36572);class l{constructor(e){this.table=e,this.bitSortable=s.hFB.required(),this.default=(0,s.hFB)(!1,{transform:e=>"desc"===e||"asc"===e?e:!!(0,n.he)(e)&&"asc"}),this.fn=(0,s.hFB)()}ngOnInit(){this.default()&&!this.isActive&&this.setActive()}get ariaSort(){var e;if(this.isActive)return"asc"===(null===(e=this.sort)||void 0===e?void 0:e.direction)?"ascending":"descending"}setActive(){const e=this.table.dataSource();if(e){const t="desc"===this.default()?"desc":"asc",i=this.isActive?"asc"===this.direction?"desc":"asc":t;e.sort={column:this.bitSortable(),direction:i,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-min-w-max","tw-font-medium","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"]}}l.ɵfac=function(e){return new(e||l)(o.rXU(a.O))},l.ɵcmp=o.VBU({type:l,selectors:[["th","bitSortable",""]],hostVars:1,hostBindings:function(e,t){2&e&&o.BMQ("aria-sort",t.ariaSort)},inputs:{bitSortable:[1,"bitSortable"],default:[1,"default"],fn:[1,"fn"]},attrs:["bitSortable",""],ngContentSelectors:["*"],decls:3,vars:3,consts:[["type","button",3,"click","ngClass"],[1,"bwi","tw-ms-2",3,"ngClass"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"button",0),o.bIt("click",function(){return t.setActive()}),o.SdG(1),o.nrm(2,"i",1),o.k0s()),2&e&&(o.Y8G("ngClass",t.classList),o.BMQ("aria-pressed",t.isActive),o.R7$(2),o.Y8G("ngClass",t.icon))},dependencies:[r.YU],encapsulation:2})},32415(e,t,i){"use strict";i.d(t,{c:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5 4 87 87">
    <circle cx="48" cy="48" r="42" class="tw-fill-illustration-bg-primary tw-stroke-illustration-outline" stroke-width="2"/>
    <rect width="18" height="14" x="12" y="70" class="tw-fill-illustration-bg-secondary tw-stroke-illustration-outline" stroke-width="2" rx="2"/>
    <rect width="2" height="6" x="20" y="74" class="tw-fill-illustration-outline" rx="1"/>
    <path class="tw-stroke-illustration-outline" stroke-width="2" d="M25 69v-1a4 4 0 0 0-8 0v1"/>
    <circle cx="80" cy="16" r="11" class="tw-fill-illustration-tertiary tw-stroke-illustration-outline" stroke-width="2"/>
    <path class="tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m76.673 19.495 3.5-3.5m3.5-3.5-3.5 3.5m0 0-3.5-3.5 7 7"/>
    <circle cx="48" cy="48" r="15.5" class="tw-fill-illustration-bg-tertiary tw-stroke-illustration-outline" stroke-width="2"/>
    <path class="tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M52.95 52.243 48 48.707v-9.9"/>
  </svg>
`},32501(e,t,i){"use strict";i.d(t,{Y:()=>o});var n=i(25065),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},32706(e,t,i){"use strict";i.d(t,{A:()=>n});const n=Object.freeze({Premium:"Premium",Families:"Families"})},32924(e,t,i){"use strict";i.d(t,{M:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-menu-divider"]],decls:1,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-100"]],template:function(e,t){1&e&&n.Hgh(0,"div",0)},encapsulation:2})},33102(e,t,i){"use strict";i.d(t,{J:()=>h});var n=i(64447),r=i(58412),s=i(39488),o=i(8916),a=i(9327),l=i(74208),c=i(50700),d=i(89105),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class h{constructor(e,t,i,n,r,s){this.accountBillingClient=e,this.previewInvoiceClient=t,this.keyService=i,this.i18nService=n,this.encryptService=r,this.syncService=s}previewProratedInvoice(e,t){return u(this,void 0,void 0,function*(){const i=this.ProductTierTypeFromSubscriptionTierId(e.tier),n=yield this.previewInvoiceClient.previewProrationForPremiumUpgrade(i,t);return{tax:n.tax,total:n.total,credit:n.credit,newPlanProratedMonths:n.newPlanProratedMonths,newPlanProratedAmount:n.newPlanProratedAmount}})}upgradeToOrganization(e,t,i,n){return u(this,void 0,void 0,function*(){if(!t)throw new Error("Organization name is required for organization upgrade");if(!(null==n?void 0:n.country)||!(null==n?void 0:n.postalCode))throw new Error("Billing address information is incomplete");const s=this.ProductTierTypeFromSubscriptionTierId(i),o=yield this.generateOrganizationEncryptionData(e.id),a=yield this.accountBillingClient.upgradePremiumToOrganization({organizationName:t,organizationKey:o.key,collectionName:o.collectionCt,publicKey:o.orgKeys[0],encryptedPrivateKey:o.orgKeys[1].encryptedString,planTier:s,cadence:r.fQ.Annually,billingAddress:n});return yield this.syncService.fullSync(!0),a})}ProductTierTypeFromSubscriptionTierId(e){switch(e){case"families":return n.K_.Families;case"teams":return n.K_.Teams;case"enterprise":return n.K_.Enterprise;default:throw new Error("Invalid plan tier for organization upgrade")}}SubscriptionTierIdFromProductTier(e){switch(e){case n.K_.Families:return r.OU.Families;case n.K_.Teams:return r.ql.Teams;case n.K_.Enterprise:return r.ql.Enterprise;default:throw new Error("Invalid plan tier for organization upgrade")}}generateOrganizationEncryptionData(e){return u(this,void 0,void 0,function*(){const t=yield this.keyService.makeOrgKey(e);return{key:t[0].encryptedString,collectionCt:(yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),t[1])).encryptedString,orgKeys:yield this.keyService.makeKeyPair(t[1]),orgKey:t[1],activeUserId:e}})}}h.ɵfac=function(e){return new(e||h)(l.KVO(a.cH),l.KVO(a.dA),l.KVO(o.Lu),l.KVO(c.W),l.KVO(d.N),l.KVO(s.H))},h.ɵprov=l.jDH({token:h,factory:h.ɵfac,providedIn:"root"})},33189(e,t,i){"use strict";i.d(t,{A:()=>g});var n=i(33338),r=i(93695),s=i(69194),o=i(3204),a=i(44500),l=i(67553),c=i(43978),d=i(3633),u=i(64447),h=i(74208),A=i(18499),p=i(35500);class g{constructor(e,t,i){this.policyService=e,this.organizationService=t,this.accountService=i,this.organizations$=this.accountService.activeAccount$.pipe((0,a.n)(e=>(null==e?void 0:e.id)?this.organizationService.organizations$(null==e?void 0:e.id):(0,r.of)()))}get showFreeFamilies$(){return this.getFreeFamiliesVisibility$()}showSponsoredFamiliesDropdown$(e){const t=e.pipe((0,o.T)(e=>e.productTierType===u.K_.Enterprise));return this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(i=>{const r=this.policyService.policiesByType$(c.tt.FreeFamiliesSponsorshipPolicy,i);return(0,n.z)([t,e,r]).pipe((0,o.T)(([e,t,i])=>{const n=i.some(e=>e.organizationId===t.id&&e.enabled);return e&&!n&&t.useAdminSponsoredFamilies&&(t.isAdmin||t.isOwner||t.canManageUsers)}))}))}getFreeFamiliesVisibility$(){return(0,n.z)([this.checkEnterpriseOrganizationsAndFetchPolicy(),this.organizations$]).pipe((0,o.T)(([e,t])=>this.shouldShowFreeFamilyLink(e,t)))}shouldShowFreeFamilyLink(e,t){if(!e)return!1;const{isFreeFamilyPolicyEnabled:i}=e;return t.some(e=>e.canManageSponsorships)&&!i}checkEnterpriseOrganizationsAndFetchPolicy(){return this.organizations$.pipe((0,s.p)(e=>Array.isArray(e)&&e.length>0),(0,a.n)(e=>this.fetchEnterpriseOrganizationPolicy(e)))}fetchEnterpriseOrganizationPolicy(e){const{belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i}=this.evaluateEnterpriseOrganizations(e),n=e.filter(e=>e.canManageSponsorships).map(e=>e.id);return 0===n.length?(0,r.of)({isFreeFamilyPolicyEnabled:!1,belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i}):this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(e=>this.policyService.policiesByType$(c.tt.FreeFamiliesSponsorshipPolicy,e)),(0,o.T)(e=>({isFreeFamilyPolicyEnabled:n.every(t=>e.some(e=>e.organizationId===t&&e.enabled)),belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i})))}evaluateEnterpriseOrganizations(e){const t=e.filter(e=>e.canManageSponsorships).length;return{belongToOneEnterpriseOrgs:1===t,belongToMultipleEnterpriseOrgs:t>1}}}g.ɵfac=function(e){return new(e||g)(h.KVO(A.m),h.KVO(l.PV),h.KVO(p.D))},g.ɵprov=h.jDH({token:g,factory:g.ɵfac,providedIn:"root"})},33331(e,t,i){"use strict";function n(e,t,i){if(!e||"number"==typeof e&&Number.isNaN(e))throw new Error(`${t} is falsy.${i?` ${i}`:""}`)}i.d(t,{B:()=>n})},33413(e,t,i){"use strict";i.d(t,{vW:()=>n});i(78781);Error;Error;class n{}},33818(e,t,i){"use strict";i.d(t,{U:()=>L});var n=i(77468),r=i(33812),s=i(51757),o=i(71804),a=i(7248);class l extends a.V{}var c=i(37380),d=i(56962),u=i(81525),h=i(81573),A=i(26411),p=i(89479),g=i(75583),v=i(29029),f=i(45383),m=i(37579),y=i(80351),C=i(36801),w=i(89294),I=i(50700),b=i(37115),B=i(62166),E=i(66316),S=i(69855),Q=i(7730),k=i(68016),T=i(67311),F=i(86226),P=i(97553),R=i(43759),D=i(58806),M=i(56898),x=i(26657),O=i(38620),G=i(44432),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function V(e,t){if(1&e&&(r.qex(0),r.j41(1,"bit-callout",8),r.nI1(2,"i18n"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"strong"),r.EFF(6),r.nI1(7,"i18n"),r.k0s(),r.EFF(8),r.nrm(9,"br"),r.j41(10,"strong"),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.EFF(13),r.nrm(14,"br"),r.j41(15,"strong"),r.EFF(16),r.nI1(17,"i18n"),r.k0s(),r.EFF(18),r.bVm()),2&e){const e=r.XpG(2);r.R7$(),r.Y8G("title",r.bMT(2,8,"enabled")),r.R7$(2),r.SpI(" ",r.bMT(4,10,"twoStepLoginProviderEnabled")," "),r.R7$(3),r.SpI("",r.bMT(7,12,"twoFactorDuoClientId"),":"),r.R7$(2),r.SpI(" ",e.clientId," "),r.R7$(3),r.SpI("",r.bMT(12,14,"twoFactorDuoClientSecret"),":"),r.R7$(2),r.SpI(" ",e.clientSecret," "),r.R7$(3),r.SpI("",r.bMT(17,16,"twoFactorDuoApiHostname"),":"),r.R7$(2),r.SpI(" ",e.host," ")}}function j(e,t){1&e&&(r.qex(0),r.j41(1,"p",9),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.j41(4,"bit-form-field")(5,"bit-label"),r.EFF(6),r.nI1(7,"i18n"),r.k0s(),r.nrm(8,"input",10),r.k0s(),r.j41(9,"bit-form-field")(10,"bit-label"),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.nrm(13,"input",11),r.k0s(),r.j41(14,"bit-form-field")(15,"bit-label"),r.EFF(16),r.nI1(17,"i18n"),r.k0s(),r.nrm(18,"input",12),r.nI1(19,"i18n"),r.k0s(),r.bVm()),2&e&&(r.R7$(2),r.JRh(r.bMT(3,6,"twoFactorDuoDesc")),r.R7$(4),r.JRh(r.bMT(7,8,"twoFactorDuoClientId")),r.R7$(5),r.JRh(r.bMT(12,10,"twoFactorDuoClientSecret")),r.R7$(5),r.JRh(r.bMT(17,12,"twoFactorDuoApiHostname")),r.R7$(2),r.Y8G("placeholder",r.VkB("",r.bMT(19,14,"ex")," api-xxxxxxxx.duosecurity.com")))}function N(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"enable")))}function z(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"disable")))}function Y(e,t){if(1&e&&(r.j41(0,"form",1)(1,"bit-dialog",2),r.nI1(2,"i18n"),r.qex(3,3),r.DNE(4,V,19,18,"ng-container",4)(5,j,20,16,"ng-container",4),r.bVm(),r.qex(6,5),r.j41(7,"button",6),r.DNE(8,N,3,3,"span",4)(9,z,3,3,"span",4),r.k0s(),r.j41(10,"button",7),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e){const e=r.XpG();r.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),r.R7$(),r.Y8G("title",r.bMT(2,9,"twoStepLogin"))("subtitle","Duo"),r.R7$(3),r.Y8G("ngIf",e.enabled),r.R7$(),r.Y8G("ngIf",!e.enabled),r.R7$(3),r.Y8G("ngIf",!e.enabled),r.R7$(),r.Y8G("ngIf",e.enabled),r.R7$(2),r.SpI(" ",r.bMT(12,11,"close")," ")}}class L extends w.g{constructor(e,t,i,n,a,l,c,d,u,h){super(t,i,n,a,l,c,h),this.data=e,this.formBuilder=d,this.dialogRef=u,this.toastService=h,this.onChangeStatus=new r.bkB,this.type=o.R.Duo,this.formGroup=this.formBuilder.group({clientId:["",[s.k0.required]],clientSecret:["",[s.k0.required]],host:["",[s.k0.required]]}),this.componentName="app-two-factor-duo",this.submit=()=>U(this,void 0,void 0,function*(){this.formGroup.markAllAsTouched(),this.formGroup.invalid||(this.enabled?yield this.disableMethod():yield this.enable(),this.onChangeStatus.emit(this.enabled))}),this.onClose=()=>{this.dialogRef.close(this.enabled)}}get clientId(){var e;return(null===(e=this.formGroup.get("clientId"))||void 0===e?void 0:e.value)||""}get clientSecret(){var e;return(null===(e=this.formGroup.get("clientSecret"))||void 0===e?void 0:e.value)||""}get host(){var e;return(null===(e=this.formGroup.get("host"))||void 0===e?void 0:e.value)||""}set clientId(e){var t;null===(t=this.formGroup.get("clientId"))||void 0===t||t.setValue(e)}set clientSecret(e){var t;null===(t=this.formGroup.get("clientSecret"))||void 0===t||t.setValue(e)}set host(e){var t;null===(t=this.formGroup.get("host"))||void 0===t||t.setValue(e)}ngOnInit(){const e=Object.create(null,{auth:{get:()=>super.auth}});return U(this,void 0,void 0,function*(){var t;if(!(null===(t=this.data)||void 0===t?void 0:t.authResponse))throw Error("TwoFactorDuoComponent requires a TwoFactorDuoResponse to initialize");e.auth.call(this,this.data.authResponse),this.processResponse(this.data.authResponse.response),this.data.organizationId&&(this.type=o.R.OrganizationDuo,this.organizationId=this.data.organizationId)})}enable(){return U(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(l);let t;e.clientId=this.clientId,e.clientSecret=this.clientSecret,e.host=this.host,t=null!=this.organizationId?yield this.twoFactorService.putTwoFactorOrganizationDuo(this.organizationId,e):yield this.twoFactorService.putTwoFactorDuo(e),this.processResponse(t),this.onUpdated.emit(!0)})}processResponse(e){this.clientId=e.clientId,this.clientSecret=e.clientSecret,this.host=e.host,this.enabled=e.enabled}}L.open=(e,t)=>e.open(L,t),L.ɵfac=function(e){return new(e||L)(r.rXU(u.Qs),r.rXU(c.fz),r.rXU(I.W),r.rXU(b.y),r.rXU(d.K),r.rXU(B.i),r.rXU(E.o3),r.rXU(s.ok),r.rXU(E.ce),r.rXU(S.f))},L.ɵcmp=r.VBU({type:L,selectors:[["app-two-factor-setup-duo"]],outputs:{onChangeStatus:"onChangeStatus"},features:[r.Vt3],decls:1,vars:1,consts:[["autocomplete","off",3,"formGroup","bitSubmit",4,"ngIf"],["autocomplete","off",3,"formGroup","bitSubmit"],[3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],["bitTypography","body1"],["bitInput","","type","text","formControlName","clientId","appInputVerbatim",""],["bitInput","","type","password","formControlName","clientSecret","appInputVerbatim",""],["bitInput","","type","text","formControlName","host","appInputVerbatim","",3,"placeholder"]],template:function(e,t){1&e&&r.DNE(0,Y,13,13,"form",0),2&e&&r.Y8G("ngIf",t.authed)},dependencies:[n.MD,n.bT,h.P,Q.I,k.m,T.hJ,A.L,F.j,P.J,R.h,p.x,g.E,D.r,v.t,M.Q,f.Z,s.X1,s.qT,s.me,s.BC,s.cb,s.j4,s.JD,m.C,x.$,O.L,y.j,G.G,C.$Z],encapsulation:2})},33886(e,t,i){"use strict";i.d(t,{w:()=>v});var n=i(39180),r=i(94573),s=i(74208),o=i(33812),a=i(33277),l=i(51757),c=i(97658),d=i(22949),u=i(68923),h=i(50700);function A(e,t){if(1&e&&o.nrm(0,"i",6),2&e){const e=o.XpG().item;o.HbH(o.VkB("bwi bwi-fw ",e.icon))}}function p(e,t){if(1&e&&(o.j41(0,"div",2)(1,"div",3),o.nVh(2,A,1,3,"i",4),o.k0s(),o.j41(3,"div",5),o.EFF(4),o.k0s()()),2&e){const e=t.item;o.Y8G("title",e.label),o.R7$(2),o.vxM(null!=e.icon?2:-1),o.R7$(2),o.SpI(" ",e.label," ")}}let g=0;class v{constructor(e,t){this.i18nService=e,this.ngControl=t,this.select=r.ebz.required(c.vr),this.items=(0,r.geq)(),this.placeholder=(0,r.hFB)(this.i18nService.t("selectPlaceholder")),this.closed=new o.bkB,this.selectedValue=(0,s.vPA)(void 0),this.selectedOption=(0,a.EW)(()=>this.findSelectedOption(this.items(),this.selectedValue())),this.searchInputId="bit-select-search-input-"+g++,this.classes=["tw-block","tw-w-full","tw-h-full"],this.id=(0,r.hFB)("bit-multi-select-"+g++),this.onKeyDown=e=>(this.select().isOpen()&&"Escape"===e.key&&!(0,n.rp)(e)&&e.stopPropagation(),!0),null!=t&&(t.valueAccessor=this)}set options(e){null!=e&&0!=e.length&&this.items.set(e.toArray().map(e=>({icon:e.icon(),value:e.value(),label:e.label(),disabled:e.disabled()})))}get disabledAttr(){return this.disabled||null}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.set(e)}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabled=e}onChange(e){this.selectedValue.set(null==e?void 0:e.value),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",null!=e?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(l.k0.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=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}findSelectedOption(e,t){return null==e?void 0:e.find(e=>e.value===t)}onClose(){this.closed.emit()}}v.ɵfac=function(e){return new(e||v)(o.rXU(h.W),o.rXU(l.vO,10))},v.ɵcmp=o.VBU({type:v,selectors:[["bit-select"]],contentQueries:function(e,t,i){if(1&e&&o.wni(i,u.P,4),2&e){let e;o.mGM(e=o.lsd())&&(t.options=e)}},viewQuery:function(e,t){1&e&&o.wEZ(t.select,c.vr,5),2&e&&o.NyB()},hostVars:6,hostBindings:function(e,t){2&e&&(o.Avn("id",t.id()),o.BMQ("disabled",t.disabledAttr)("aria-describedby",t.ariaDescribedBy)("required",t.required),o.HbH(t.classes))},inputs:{items:[1,"items"],placeholder:[1,"placeholder"],disabled:"disabled",id:[1,"id"],required:"required"},outputs:{items:"itemsChange",closed:"closed"},features:[o.Jv_([{provide:d.p,useExisting:v}])],decls:2,vars:8,consts:[["appendTo","body",3,"ngModelChange","blur","close","ngModel","disabled","placeholder","items","labelForId","clearable","keyDownFn"],["ng-option-tmp",""],[1,"tw-flex",3,"title"],[1,"tw-me-2","tw-flex-initial"],["aria-hidden","true",3,"class"],[1,"tw-flex-1","tw-text-ellipsis","tw-overflow-hidden"],["aria-hidden","true"]],template:function(e,t){var i;if(1&e&&(o.j41(0,"ng-select",0),o.bIt("ngModelChange",function(e){return t.onChange(e)})("blur",function(){return t.onBlur()})("close",function(){return t.onClose()}),o.DNE(1,p,5,3,"ng-template",1),o.k0s()),2&e){let e;o.Y8G("ngModel",t.selectedOption())("disabled",t.disabled)("placeholder",t.placeholder())("items",t.items())("labelForId",t.labelForId)("clearable",!1)("keyDownFn",t.onKeyDown),o.BMQ("aria-label",null!==(i=null==(e=t.selectedOption())?null:e.label)&&void 0!==i?i:t.placeholder())}},dependencies:[c.MQ,c.vr,c.Uq,l.X1,l.BC,l.YN,l.vS],encapsulation:2})},34461(e,t,i){"use strict";i.d(t,{$:()=>s});var n=i(39306),r=i(43890);class s{constructor(e){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)}catch(e){}return 0}get hasDecryptionError(){return this._hasDecryptionError||this.fileName===n.h}set hasDecryptionError(e){this._hasDecryptionError=e}static fromJSON(e){const t=null==e.key?null:r.e.fromJSON(e.key);let i;return null!=e.encryptedKey&&("string"==typeof e.encryptedKey?i=n.k.fromJSON(e.encryptedKey):e.encryptedKey instanceof n.k&&(i=e.encryptedKey)),Object.assign(new s,e,{key:t,encryptedKey:i})}toSdkAttachmentView(){var e;return{id:this.id,url:this.url,size:this.size,sizeName:this.sizeName,fileName:this.fileName,key:null===(e=this.encryptedKey)||void 0===e?void 0:e.toSdk(),decryptedKey:this.key?this.key.toBase64():void 0}}static fromSdkAttachmentView(e,t=!1){if(!e)return;const i=new s;return i.id=e.id,i.url=e.url,i.size=e.size,i.sizeName=e.sizeName,i.fileName=e.fileName,i.key=e.decryptedKey?r.e.fromString(e.decryptedKey):void 0,i.encryptedKey=e.key?new n.k(e.key):void 0,i._hasDecryptionError=t,i}}},34465(e,t,i){"use strict";i.d(t,{S:()=>s});var n=i(94573),r=i(33812);class s{constructor(){this.text=(0,n.hFB)(),this.ariaLabel=(0,n.hFB)(),this.icon=(0,n.hFB)(),this.treeDepth=(0,n.geq)(0),this.route=(0,n.hFB)(),this.relativeTo=(0,n.hFB)(),this.routerLinkActiveOptions=(0,n.hFB)({paths:"subset",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"}),this.hideActiveStyles=(0,n.hFB)(!1),this.mainContentClicked=(0,n.CGW)()}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=r.FsC({type:s,inputs:{text:[1,"text"],ariaLabel:[1,"ariaLabel"],icon:[1,"icon"],treeDepth:[1,"treeDepth"],route:[1,"route"],relativeTo:[1,"relativeTo"],routerLinkActiveOptions:[1,"routerLinkActiveOptions"],hideActiveStyles:[1,"hideActiveStyles"]},outputs:{treeDepth:"treeDepthChange",mainContentClicked:"mainContentClicked"}})},34530(e,t,i){"use strict";i.d(t,{R:()=>r});var n=i(33812);class r{transform(e,t,i,n,r){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!=r){const i="function"==typeof r?r(e):e[r];if((null==i?void 0:i.toString().toLowerCase().indexOf(t))>-1)return!0}return!1}))}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"search",type:r,pure:!0,standalone:!1})},34693(e,t,i){"use strict";var n;i.d(t,{M:()=>n}),function(e){e[e.Cipher=0]="Cipher",e[e.CipherView=1]="CipherView"}(n||(n={}))},34923(e,t,i){"use strict";i.d(t,{c3:()=>Q,kx:()=>k,vU:()=>T});var n=i(51757),r=i(66046),s=i(3204),o=i(12610),a=i(14803),l=i(47438),c=i(25065),d=i(14055),u=i(33812),h=i(50700),A=i(86226),p=i(93199),g=i(97553),v=i(43759),f=i(33886),m=i(68923),y=i(77468),C=i(25740),w=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};const I=(e,t)=>t.value;function b(e,t){if(1&e&&u.nrm(0,"bit-option",5),2&e){const e=t.$implicit;u.Y8G("value",e.value)("disabled",e.disabled)("label",e.name)}}function B(e,t){if(1&e&&(u.j41(0,"div",2)(1,"bit-form-field",3)(2,"bit-label"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.nrm(5,"input",8),u.k0s()(),u.j41(6,"div",2)(7,"bit-form-field",3)(8,"bit-label"),u.EFF(9),u.nI1(10,"i18n"),u.k0s(),u.nrm(11,"input",9),u.k0s()(),u.j41(12,"div",2)(13,"bit-form-field",3)(14,"bit-label"),u.EFF(15),u.nI1(16,"i18n"),u.k0s(),u.nrm(17,"input",10),u.k0s()(),u.j41(18,"div",2)(19,"bit-form-field",3)(20,"bit-label"),u.EFF(21),u.nI1(22,"i18n"),u.k0s(),u.nrm(23,"input",11),u.k0s()()),2&e){const e=u.XpG();u.R7$(),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(4,12,"address1")),u.R7$(2),u.Y8G("formControl",e.group.controls.line1),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(10,14,"address2")),u.R7$(2),u.Y8G("formControl",e.group.controls.line2),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(16,16,"cityTown")),u.R7$(2),u.Y8G("formControl",e.group.controls.city),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(22,18,"stateProvince")),u.R7$(2),u.Y8G("formControl",e.group.controls.state)}}function E(e,t){if(1&e&&(u.j41(0,"bit-hint"),u.nrm(1,"i",13),u.EFF(2),u.k0s()),2&e){u.XpG();const e=u.r8f(6);u.R7$(),u.Y8G("title",u.mNQ(e)),u.R7$(),u.JRh(e)}}function S(e,t){if(1&e&&(u.j41(0,"div",7)(1,"bit-form-field",3)(2,"bit-label"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.nrm(5,"input",12),u.SS7(6),u.nVh(7,E,3,3,"bit-hint"),u.k0s()()),2&e){const e=u.XpG();u.R7$(),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(4,4,"taxIdNumber")),u.R7$(2),u.Y8G("formControl",e.group.controls.taxId),u.R7$();const t=u.bH3(e.taxIdWarningHint);u.R7$(),u.vxM(t?7:-1)}}const Q=e=>k(e.getRawValue()),k=e=>{const{taxId:t}=e,i=w(e,["taxId"]),n=t?(0,d.i5)(i.country):null;return n?Object.assign(Object.assign({},i),{taxId:{code:n.code,value:t}}):Object.assign(Object.assign({},i),{taxId:null})};class T{constructor(e){this.i18nService=e,this.selectableCountries=d.Lx,this.destroy$=new r.B,this.disableAddressControls=()=>{this.group.controls.line1.disable(),this.group.controls.line2.disable(),this.group.controls.city.disable(),this.group.controls.state.disable()}}ngOnInit(){var e,t;switch(this.scenario.type){case"checkout":this.disableAddressControls();break;case"update":this.scenario.existing&&this.group.patchValue(Object.assign(Object.assign({},this.scenario.existing),{taxId:null===(e=this.scenario.existing.taxId)||void 0===e?void 0:e.value}))}this.supportsTaxId$=this.group.controls.country.valueChanges.pipe((0,o.Z)(null!==(t=this.group.value.country)&&void 0!==t?t:this.selectableCountries[0].value),(0,s.T)(e=>!(!this.scenario.supportsTaxId||"US"===e)&&d.qk.filter(t=>t.iso===e).length>0)),this.supportsTaxId$.pipe((0,a.Q)(this.destroy$)).subscribe(e=>{e?this.group.controls.taxId.enable():this.group.controls.taxId.disable()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get taxIdWarningHint(){if("checkout"===this.scenario.type||!this.scenario.supportsTaxId||!this.group.value.country||this.scenario.taxIdWarning!==l.e.FailedVerification)return null;const e=(0,d.i5)(this.group.value.country);if(!e)return null;const t=this.i18nService.t("checkInputFormat");switch(e.code){case"au_abn":return`${t} ${this.i18nService.t("exampleTaxIdFormat","ABN",e.example)}`;case"eu_vat":return`${t} ${this.i18nService.t("exampleTaxIdFormat","EU VAT",e.example)}`;case"gb_vat":return`${t} ${this.i18nService.t("exampleTaxIdFormat","GB VAT",e.example)}`}}}T.getFormGroup=()=>new n.gE({country:new n.MJ("",{nonNullable:!0,validators:[n.k0.required]}),postalCode:new n.MJ("",{nonNullable:!0,validators:[n.k0.required]}),line1:new n.MJ(null),line2:new n.MJ(null),city:new n.MJ(null),state:new n.MJ(null),taxId:new n.MJ(null)}),T.ɵfac=function(e){return new(e||T)(u.rXU(h.W))},T.ɵcmp=u.VBU({type:T,selectors:[["app-enter-billing-address"]],inputs:{scenario:"scenario",group:"group"},decls:19,vars:15,consts:[[3,"formGroup"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],[3,"disableMargin"],["data-testid","country",3,"formControl"],[3,"value","disabled","label"],["bitInput","","type","text","autocomplete","postal-code","data-testid","postal-code",3,"formControl"],[1,"tw-col-span-12"],["bitInput","","type","text","autocomplete","address-line1","data-testid","address-line1",3,"formControl"],["bitInput","","type","text","autocomplete","address-line2","data-testid","address-line2",3,"formControl"],["bitInput","","type","text","autocomplete","address-level2","data-testid","city",3,"formControl"],["bitInput","","type","text","autocomplete","address-level1","data-testid","state",3,"formControl"],["bitInput","","type","text","data-testid","tax-id",3,"formControl"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-mr-1",3,"title"]],template:function(e,t){1&e&&(u.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"bit-form-field",3)(4,"bit-label"),u.EFF(5),u.nI1(6,"i18n"),u.k0s(),u.j41(7,"bit-select",4),u.Z7z(8,b,1,3,"bit-option",5,I),u.k0s()()(),u.j41(10,"div",2)(11,"bit-form-field",3)(12,"bit-label"),u.EFF(13),u.nI1(14,"i18n"),u.k0s(),u.nrm(15,"input",6),u.k0s()(),u.nVh(16,B,24,20),u.nVh(17,S,8,7,"div",7),u.nI1(18,"async"),u.k0s()()),2&e&&(u.Y8G("formGroup",t.group),u.R7$(3),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(6,9,"country")),u.R7$(2),u.Y8G("formControl",t.group.controls.country),u.R7$(),u.Dyx(t.selectableCountries),u.R7$(3),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(14,11,"zipPostalCodeLabel")),u.R7$(2),u.Y8G("formControl",t.group.controls.postalCode),u.R7$(),u.vxM("update"===t.scenario.type?16:-1),u.R7$(),u.vxM(u.bMT(18,13,t.supportsTaxId$)?17:-1))},dependencies:[c.G,n.qT,n.me,n.BC,n.cb,n.l_,n.j4,A.j,p.I,g.J,v.h,f.w,m.P,y.Jj,C.$],encapsulation:2})},35014(e,t,i){"use strict";i.d(t,{Zr:()=>w,kJ:()=>I,xg:()=>S});var n=i(72245),r=i(64336),s=i(3204),o=i(44500),a=i(60512),l=i(62870),c=i(68467),d=i(78781),u=i(82781),h=i(81441),A=i(82468),p=i(43890),g=i(2334),v=i(31857),f=i(39306),m=i(31925),y=i(10459),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const w=new v.Ok(v.Tf,"masterKey",{deserializer:e=>p.e.fromJSON(e),clearOn:["lock","logout"]}),I=new v.Ok(v.Br,"masterKeyHash",{deserializer:e=>e,clearOn:["logout"]}),b=new v.Ok(v.Br,"masterKeyEncryptedUserKey",{deserializer:e=>e,clearOn:["logout"]}),B=new v.Ok(v.Br,"forceSetPasswordReason",{deserializer:e=>e,clearOn:["logout"]}),E=new v.Ok(v.y7,"masterPasswordUnlockKey",{deserializer:e=>y.k.fromJSON(e),clearOn:["logout"]});class S{constructor(e,t,i,n,r){this.stateProvider=e,this.keyGenerationService=t,this.logService=i,this.cryptoFunctionService=n,this.accountService=r}userHasMasterPassword(e){return C(this,void 0,void 0,function*(){(0,a.x)(e,"userId");const t=yield(0,n._)(this.stateProvider.getUser(e,m.zN).state$);return(yield(0,n._)(this.stateProvider.getUser(e,b).state$))&&!t})}saltForUser$(e){return(0,a.x)(e,"userId"),this.stateProvider.getUser(e,g.fc).state$.pipe((0,s.T)(e=>(0,A.Y6)(e,A.TO.PM31088_MasterPasswordServiceEmitSalt)),(0,o.n)(t=>(0,r.T)(()=>t,this.masterPasswordUnlockData$(e).pipe((0,s.T)(e=>{if(null==e)throw new Error("Master password unlock data not found for user.");return e.salt})),this.accountService.accounts$.pipe((0,s.T)(t=>t[e].email),(0,s.T)(e=>this.emailToSalt(e))))))}masterKey$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,w).state$}masterKeyHash$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,I).state$}forceSetPasswordReason$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,B).state$.pipe((0,s.T)(e=>null!=e?e:h.n.None))}getMasterKeyEncryptedUserKey(e){return C(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");const t=yield(0,n._)(this.stateProvider.getUser(e,b).state$);return f.k.fromJSON(t)})}emailToSalt(e){return e.toLowerCase().trim()}setMasterKey(e,t){return C(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,w).update(t=>e)})}clearMasterKey(e){return C(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,w).update(e=>null)})}setMasterKeyHash(e,t){return C(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,I).update(t=>e,{shouldUpdate:t=>t!==e})})}clearMasterKeyHash(e){return C(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,I).update(e=>null,{shouldUpdate:e=>null!==e})})}setMasterKeyEncryptedUserKey(e,t){return C(this,void 0,void 0,function*(){if(null==e||null==e.encryptedString)throw new Error("Encrypted Key is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,b).update(t=>e.toJSON())})}setForceSetPasswordReason(e,t){return C(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(0,n._)(this.forceSetPasswordReason$(t)))===h.n.AdminForcePasswordReset&&e!==h.n.None||(yield this.stateProvider.getUser(t,B).update(t=>e))})}decryptUserKeyWithMasterKey(e,t,i){return C(this,void 0,void 0,function*(){if(null!=i||(i=yield this.getMasterKeyEncryptedUserKey(t)),null!=e||(e=yield(0,n._)(this.masterKey$(t))),null==e)throw new Error("No master key found.");yield l.B.Ready;try{return new p.e(u.PureCrypto.decrypt_user_key_with_master_key(i.toSdk(),e.toEncoded()))}catch(r){return this.logService.warning("Failed to decrypt user key with master key."),null}})}makeMasterPasswordAuthenticationData(e,t,i){return C(this,void 0,void 0,function*(){if((0,a.x)(e,"password"),(0,a.x)(t,"kdf"),(0,a.x)(i,"salt"),""===e)throw new Error("Master password cannot be empty.");i=i.toLowerCase().trim();const n=yield this.keyGenerationService.deriveKeyFromPassword(e,i,t),r=d.A.fromBufferToB64(yield this.cryptoFunctionService.pbkdf2(n.toEncoded(),e,"sha256",1));return{salt:i,kdf:t,masterPasswordAuthenticationHash:r}})}makeMasterPasswordUnlockData(e,t,i,n){return C(this,void 0,void 0,function*(){if((0,a.x)(e,"password"),(0,a.x)(t,"kdf"),(0,a.x)(i,"salt"),(0,a.x)(n,"userKey"),""===e)throw new Error("Master password cannot be empty.");i=i.toLowerCase().trim(),yield l.B.Ready;const r=u.PureCrypto.encrypt_user_key_with_master_password(n.toEncoded(),e,i,t.toSdkConfig());return new y.k(i,t,r)})}unwrapUserKeyFromMasterPasswordUnlockData(e,t){return C(this,void 0,void 0,function*(){(0,a.x)(e,"password"),(0,a.x)(t,"masterPasswordUnlockData"),yield l.B.Ready;return new p.e(u.PureCrypto.decrypt_user_key_with_master_password(t.masterKeyWrappedUserKey,e,t.salt,t.kdf.toSdkConfig()))})}setMasterPasswordUnlockData(e,t){return C(this,void 0,void 0,function*(){(0,a.x)(e,"masterPasswordUnlockData"),(0,a.x)(t,"userId"),yield this.stateProvider.getUser(t,E).update(()=>e.toJSON())})}clearMasterPasswordUnlockData(e){return C(this,void 0,void 0,function*(){(0,a.x)(e,"userId"),yield this.stateProvider.getUser(e,E).update(()=>null)})}masterPasswordUnlockData$(e){return(0,a.x)(e,"userId"),this.stateProvider.getUser(e,E).state$}setLegacyMasterKeyFromUnlockData(e,t,i){return C(this,void 0,void 0,function*(){(0,a.x)(e,"password"),(0,a.x)(t,"masterPasswordUnlockData"),(0,a.x)(i,"userId");const n=yield this.keyGenerationService.deriveKeyFromPassword(e,t.salt,t.kdf),r=yield this.hashMasterKey(e,n,c.VK.LocalAuthorization);yield this.setMasterKey(n,i),yield this.setMasterKeyHash(r,i)})}hashMasterKey(e,t,i){return C(this,void 0,void 0,function*(){if(null==e)throw new Error("password is required.");if(null==t)throw new Error("key is required.");const n=i===c.VK.LocalAuthorization?2:1,r=yield this.cryptoFunctionService.pbkdf2(t.inner().encryptionKey,e,"sha256",n);return d.A.fromBufferToB64(r)})}}},35042(e,t,i){"use strict";i.d(t,{h:()=>a});var n=i(94573),r=i(33812),s=i(81525);let o=0;class a{constructor(e){this.dialogRef=e,this.id="bit-dialog-title-"+o++,this.simple=(0,n.hFB)(!1)}ngOnInit(){this.dialogRef&&Promise.resolve().then(()=>{const e=this.dialogRef.containerInstance;e&&0===e._ariaLabelledByQueue.length&&e._ariaLabelledByQueue.push(this.id)})}}a.ɵfac=function(e){return new(e||a)(r.rXU(s.ce,8))},a.ɵdir=r.FsC({type:a,selectors:[["","bitDialogTitleContainer",""]],hostVars:1,hostBindings:function(e,t){2&e&&r.Avn("id",t.id)},inputs:{simple:[1,"simple"]}})},35185(e,t,i){"use strict";i.d(t,{K:()=>I});var n=i(72245),r=i(73276),s=i(23965),o=i(81441),a=i(8916);class l{constructor(e,t,i,n,r,s){if(this.masterPasswordHash=e,this.key=t,this.masterPasswordHint=i,this.orgIdentifier=n,this.keys=r,s.kdfType===a.ao.PBKDF2_SHA256)this.kdf=a.ao.PBKDF2_SHA256,this.kdfIterations=s.iterations;else{if(s.kdfType!==a.ao.Argon2id)throw new Error(`Unsupported KDF type: ${s}`);this.kdf=a.ao.Argon2id,this.kdfIterations=s.iterations,this.kdfMemory=s.memory,this.kdfParallelism=s.parallelism}}static newConstructor(e,t,i,n,r){return new l(e.masterPasswordAuthenticationHash,t.masterKeyWrappedUserKey,i,n,r,t.kdf)}}class c extends s.W7{static newConstructorWithHint(e,t,i){const n=new c;return n.newMasterPasswordHash=e.masterPasswordAuthenticationHash,n.key=t.masterKeyWrappedUserKey,n.masterPasswordHint=i,n}}var d=i(33331),u=i(60512),h=i(39306),A=i(10459),p=i(48541),g=i(66523),v=i(78781),f=i(43890),m=i(21001),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},C=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},w=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});class I{constructor(e,t,i,n,r,s,o,a,l,c,d,u){this.apiService=e,this.encryptService=t,this.i18nService=i,this.kdfConfigService=n,this.keyService=r,this.masterPasswordApiService=s,this.masterPasswordService=o,this.organizationApiService=a,this.organizationUserApiService=l,this.userDecryptionOptionsService=c,this.accountCryptographicStateService=d,this.registerSdkService=u}setInitialPassword(e,t,i){return y(this,void 0,void 0,function*(){const{newMasterKey:r,newServerMasterKeyHash:s,newLocalMasterKeyHash:a,newPasswordHint:c,kdfConfig:d,orgSsoIdentifier:u,orgId:h,resetPasswordAutoEnroll:A,newPassword:g,salt:f}=e;for(const[t,i]of Object.entries(e))if(null==i)throw new Error(`${t} not found. Could not set password.`);if(null==i)throw new Error("userId not found. Could not set password.");if(null==t)throw new Error("userType not found. Could not set password.");const y=yield this.makeMasterKeyEncryptedUserKey(r,i);if(null==y||!y[1].encryptedString)throw new Error("masterKeyEncryptedUserKey not found. Could not set password.");let C=null,w=null;if(t===m.bg.JIT_PROVISIONED_MP_ORG_USER){const e=yield(0,n._)(this.keyService.userPrivateKey$(i)),t=yield(0,n._)(this.keyService.userPublicKey$(i));if(null!=e&&null!=t){C=[v.A.fromBufferToB64(t),yield this.encryptService.wrapDecapsulationKey(e,y[0])]}else C=yield this.keyService.makeKeyPair(y[0]);if(null==C)throw new Error("keyPair not found. Could not set password.");if(!C[1].encryptedString)throw new Error("encrypted private key not found. Could not set password.");w=new p.G(C[0],C[1].encryptedString)}const I=new l(s,y[1].encryptedString,c,u,w,d);if(yield this.masterPasswordApiService.setPassword(I),yield this.masterPasswordService.setForceSetPasswordReason(o.n.None,i),yield this.updateAccountDecryptionProperties(r,d,y,i),yield this.setMasterPasswordUnlockData(g,f,d,y[0],i),null!=C&&t===m.bg.JIT_PROVISIONED_MP_ORG_USER){if(!C[1].encryptedString)throw new Error("encrypted private key not found. Could not set private key in state.");yield this.accountCryptographicStateService.setAccountCryptographicState({V1:{private_key:C[1].encryptedString}},i)}yield this.masterPasswordService.setMasterKeyHash(a,i),A&&(yield this.handleResetPasswordAutoEnrollOld(s,h,i))})}setInitialPasswordTdeOffboarding(e,t){return y(this,void 0,void 0,function*(){const i="Could not set initial password.";if((0,d.B)(e.newPassword,"newPassword",i),(0,d.B)(e.salt,"salt",i),(0,u.x)(e.kdfConfig,"kdfConfig",i),(0,u.x)(e.newPasswordHint,"newPasswordHint",i),null==t)throw new Error("userId not found. Could not set password.");const{newPassword:r,salt:s,kdfConfig:a,newPasswordHint:l}=e,h=yield(0,n._)(this.keyService.userKey$(t));if(null==h)throw new Error("userKey not found. Could not set password.");const A=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(r,a,s),p=yield this.masterPasswordService.makeMasterPasswordUnlockData(r,a,s,h),g=c.newConstructorWithHint(A,p,l);yield this.masterPasswordApiService.putUpdateTdeOffboardingPassword(g),yield this.masterPasswordService.setForceSetPasswordReason(o.n.None,t)})}setInitialPasswordTdeOffboardingOld(e,t){return y(this,void 0,void 0,function*(){const{newMasterKey:i,newServerMasterKeyHash:r,newPasswordHint:s}=e;for(const[t,n]of Object.entries(e))if(null==n)throw new Error(`${t} not found. Could not set password.`);if(null==t)throw new Error("userId not found. Could not set password.");const a=yield(0,n._)(this.keyService.userKey$(t));if(null==a)throw new Error("userKey not found. Could not set password.");const l=yield this.keyService.encryptUserKeyWithMasterKey(i,a);if(!l[1].encryptedString)throw new Error("newMasterKeyEncryptedUserKey not found. Could not set password.");const d=new c;d.key=l[1].encryptedString,d.newMasterPasswordHash=r,d.masterPasswordHint=s,yield this.masterPasswordApiService.putUpdateTdeOffboardingPassword(d),yield this.masterPasswordService.setForceSetPasswordReason(o.n.None,t)})}initializePasswordJitPasswordUserV2Encryption(e,t){return y(this,void 0,void 0,function*(){if(null==t)throw new Error("User ID is required.");for(const[t,n]of Object.entries(e))if(null==n)throw new Error(`${t} is required.`);const{newPasswordHint:i,orgSsoIdentifier:s,orgId:l,resetPasswordAutoEnroll:c,newPassword:d,salt:u}=e,p=yield this.organizationApiService.getKeys(l);if(null==p)throw new Error("Organization keys response is null.");const v=yield(0,n._)(this.registerSdkService.registerClient$(t).pipe((0,r.H)(e=>y(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!e)throw new Error("SDK not available");const r=C(n,e.take(),!1);return yield r.value.auth().registration().post_keys_for_jit_password_registration({org_id:(0,g.WD)(l),org_public_key:p.publicKey,master_password:d,master_password_hint:i,salt:u,organization_sso_identifier:s,user_id:(0,g.WD)(t),reset_password_enroll:c})}catch(r){n.error=r,n.hasError=!0}finally{w(n)}}))));if(!("V2"in v.account_cryptographic_state))throw new Error("Unexpected V2 account cryptographic state");yield this.accountCryptographicStateService.setAccountCryptographicState(v.account_cryptographic_state,t),yield this.masterPasswordService.setForceSetPasswordReason(o.n.None,t);const m=A.k.fromSdk(v.master_password_unlock);yield this.masterPasswordService.setMasterPasswordUnlockData(m,t),yield this.keyService.setUserKey(f.e.fromString(v.user_key),t),yield this.updateLegacyState(d,(0,a.E$)(v.master_password_unlock.kdf),new h.k(v.master_password_unlock.masterKeyWrappedUserKey),t,m)})}setInitialPasswordTdeUserWithPermission(e,t){return y(this,void 0,void 0,function*(){const i="Could not set initial password for TDE user with Manage Account Recovery permission.";(0,d.B)(e.newPassword,"newPassword",i),(0,d.B)(e.salt,"salt",i),(0,u.x)(e.kdfConfig,"kdfConfig",i),(0,u.x)(e.newPasswordHint,"newPasswordHint",i),(0,d.B)(e.orgSsoIdentifier,"orgSsoIdentifier",i),(0,d.B)(e.orgId,"orgId",i),(0,u.x)(e.resetPasswordAutoEnroll,"resetPasswordAutoEnroll",i),(0,d.B)(t,"userId",i);const{newPassword:r,salt:s,kdfConfig:a,newPasswordHint:c,orgSsoIdentifier:A,orgId:p,resetPasswordAutoEnroll:g}=e,v=yield(0,n._)(this.keyService.userKey$(t));if(!v)throw new Error("userKey not found.");const f=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(r,a,s),m=yield this.masterPasswordService.makeMasterPasswordUnlockData(r,a,s,v),y=l.newConstructor(f,m,c,A,null);yield this.masterPasswordApiService.setPassword(y),yield this.masterPasswordService.setForceSetPasswordReason(o.n.None,t),yield this.masterPasswordService.setMasterPasswordUnlockData(m,t),yield this.updateLegacyState(r,m.kdf,new h.k(m.masterKeyWrappedUserKey),t,m),g&&(yield this.handleResetPasswordAutoEnroll(f.masterPasswordAuthenticationHash,p,t,v))})}makeMasterKeyEncryptedUserKey(e,t){return y(this,void 0,void 0,function*(){let i=null;const r=yield(0,n._)(this.keyService.userKey$(t));return i=null==r?yield this.keyService.makeUserKey(e):yield this.keyService.encryptUserKeyWithMasterKey(e,r),i})}updateAccountDecryptionProperties(e,t,i,r){return y(this,void 0,void 0,function*(){const s=yield(0,n._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(r));s.hasMasterPassword=!0,yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(r,s),yield this.kdfConfigService.setKdfConfig(r,t),yield this.masterPasswordService.setMasterKey(e,r),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(i[1],r),yield this.keyService.setUserKey(i[0],r)})}updateLegacyState(e,t,i,r,s){return y(this,void 0,void 0,function*(){const o=yield(0,n._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(r));o.hasMasterPassword=!0,yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(r,o),yield this.kdfConfigService.setKdfConfig(r,t),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(i,r),yield this.masterPasswordService.setLegacyMasterKeyFromUnlockData(e,s,r)})}setMasterPasswordUnlockData(e,t,i,n,r){return y(this,void 0,void 0,function*(){const s=yield this.masterPasswordService.makeMasterPasswordUnlockData(e,i,t,n);yield this.masterPasswordService.setMasterPasswordUnlockData(s,r)})}handleResetPasswordAutoEnrollOld(e,t,i){return y(this,void 0,void 0,function*(){const r=yield this.organizationApiService.getKeys(t);if(null==r)throw new Error("Organization keys response is null. Could not handle reset password auto enroll.");const o=v.A.fromB64ToArray(r.publicKey),a=yield(0,n._)(this.keyService.userKey$(i));if(null==a)throw new Error("userKey not found. Could not handle reset password auto enroll.");const l=yield this.encryptService.encapsulateKeyUnsigned(a,o);if(null==l||!l.encryptedString)throw new Error("orgPublicKeyEncryptedUserKey not found. Could not handle reset password auto enroll.");const c=new s.Wt;c.masterPasswordHash=e,c.resetPasswordKey=l.encryptedString,yield this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(t,i,c)})}handleResetPasswordAutoEnroll(e,t,i,n){return y(this,void 0,void 0,function*(){const r=yield this.organizationApiService.getKeys(t);if(null==r)throw new Error("Organization keys response is null. Could not handle reset password auto enroll.");const o=v.A.fromB64ToArray(r.publicKey),a=yield this.encryptService.encapsulateKeyUnsigned(n,o);if(null==a||!a.encryptedString)throw new Error("orgPublicKeyEncryptedUserKey not found. Could not handle reset password auto enroll.");const l=new s.Wt;l.masterPasswordHash=e,l.resetPasswordKey=a.encryptedString,yield this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(t,i,l)})}}},35500(e,t,i){"use strict";i.d(t,{A:()=>r,D:()=>n});class n{}class r extends n{}},35631(e,t,i){"use strict";i.d(t,{i:()=>n,y:()=>r});class n{constructor(e,t){this.state$=e,this.set=t}}class r{}},35770(e,t,i){"use strict";i.d(t,{h:()=>n});class n{}},36107(e,t,i){"use strict";i.d(t,{a:()=>o});var n=i(20702),r=i(36304),s=i(26076);class o extends n.r{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 s.q(e)));const i=this.getResponseProperty("Fido2Credentials");null!=i&&(this.fido2Credentials=i.map(e=>new r.K(e)))}}},36288(e,t,i){"use strict";i.d(t,{s:()=>f});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(30634),l=i(43749),c=i(53100),d=i(70171),u=i(83632),h=i(5513),A=i(6307),p=i(23542);function g(e,t){1&e&&s.nrm(0,"bit-spinner",1)}function v(e,t){if(1&e&&s.nrm(0,"i",3),2&e){const e=s.XpG();s.HbH(e.iconClass())}}class f{get showLoadingStyle(){return this.baseButton.showLoadingStyle()}getFocusTarget(){return this.elementRef.nativeElement}constructor(){this.baseButton=(0,r.WQX)(l.$H),this.elementRef=(0,r.WQX)(s.aKT),this.tooltip=(0,r.WQX)(h.d,{host:!0,optional:!0}),this.icon=n.geq.required({alias:"bitIconButton"}),this.label=(0,n.hFB)(),this.buttonType=(0,n.hFB)("primaryGhost"),this.size=(0,n.geq)("default"),this.loading=this.baseButton.loading,this.disabled=this.baseButton.disabled,this.iconClass=(0,o.EW)(()=>[this.icon(),"!tw-m-0"]),this.classList=(0,o.EW)(()=>{const e=[];return e.push("tw-relative","tw-inline-block","tw-align-middle","tw-shrink-0"),e.push(...m(this.size())),e.push(y(this.size())),e.join(" ")});const e=this.elementRef.nativeElement;(0,o.QZ)(()=>this.baseButton.buttonType.set(this.buttonType())),(0,A.m)(e,this.baseButton.disabledAttr);const t=e.getAttribute("title");(0,o.QZ)(()=>{var e;(0,a.J)({element:this.elementRef.nativeElement,title:void 0,label:this.label()});const i=t||this.label();i&&(null===(e=this.tooltip)||void 0===e||e.tooltipContent.set(i))})}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=s.VBU({type:f,selectors:[["button","bitIconButton","",5,"button","bitButton",""]],hostVars:3,hostBindings:function(e,t){2&e&&(s.BMQ("bitIconButton",t.icon()),s.HbH(t.classList()))},inputs:{icon:[1,"bitIconButton","icon"],label:[1,"label"],buttonType:[1,"buttonType"],size:[1,"size"]},outputs:{icon:"bitIconButtonChange",size:"sizeChange"},features:[s.Jv_([{provide:c.E,useExisting:f},{provide:d.H,useExisting:f}]),s.nM4([p.v,{directive:h.d,inputs:["tooltipPosition","tooltipPosition"]},{directive:l.$H,inputs:["loading","loading","disabled","disabled"]}])],attrs:["bitIconButton",""],decls:3,vars:1,consts:[[1,"tw-absolute","tw-top-[50%]","tw-left-[50%]","tw-translate-x-[-50%]","tw-translate-y-[-50%]","tw-leading-[0px]"],["size","fill","noColor",""],["aria-hidden","true",1,"bwi",3,"class"],["aria-hidden","true",1,"bwi"]],template:function(e,t){1&e&&(s.j41(0,"span",0),s.nVh(1,g,1,0,"bit-spinner",1)(2,v,1,2,"i",2),s.k0s()),2&e&&(s.R7$(),s.vxM(t.showLoadingStyle?1:2))},dependencies:[u.t],encapsulation:2});const m=e=>{const t={xsmall:["tw-text-xl","tw-size-6"],small:["tw-text-xl","tw-size-8"],default:["tw-text-2xl","tw-size-10"],large:["tw-text-[2rem]","tw-size-11"]};return t[e]||t.default},y=e=>"xsmall"===e?"tw-rounded":"tw-rounded-xl"},36304(e,t,i){"use strict";i.d(t,{K:()=>r});var n=i(20702);class r extends n.r{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"))}}},36501(e,t,i){"use strict";i.d(t,{b:()=>n,x:()=>r});const n={None:0,Password:1};function r(e){switch(e){case n.None:case n.Password:return e;default:return n.None}}},36572(e,t,i){"use strict";i.d(t,{O:()=>u,_:()=>d});var n=i(93585),r=i(77468),s=i(94573),o=i(33812);const a=[[["","header",""]]],l=e=>({$implicit:e});function c(e,t){1&e&&o.eu8(0)}class d{constructor(e){this.template=e}}d.ɵfac=function(e){return new(e||d)(o.rXU(o.C4Q))},d.ɵdir=o.FsC({type:d,selectors:[["ng-template","body",""]]});class u{constructor(){this.dataSource=(0,s.hFB)(),this.layout=(0,s.hFB)("auto"),this.templateVariable=(0,s.sbv)(d),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(){const e=this.dataSource();if(!this._initialized&&(0,n.y)(e)){this._initialized=!0;const t=e.connect();this.rows$=t}}ngOnDestroy(){const e=this.dataSource();(0,n.y)(e)&&e.disconnect()}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.VBU({type:u,selectors:[["bit-table"]],contentQueries:function(e,t,i){1&e&&o.C6U(i,t.templateVariable,d,5),2&e&&o.NyB()},inputs:{dataSource:[1,"dataSource"],layout:[1,"layout"]},ngContentSelectors:["[header]"],decls:5,vars:5,consts:[[3,"ngClass"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-medium","tw-text-muted"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(o.NAR(a),o.j41(0,"table",0)(1,"thead",1),o.SdG(2),o.k0s(),o.j41(3,"tbody"),o.DNE(4,c,1,0,"ng-container",2),o.k0s()()),2&e&&(o.Y8G("ngClass",t.tableClass),o.R7$(4),o.Y8G("ngTemplateOutlet",t.templateVariable().template)("ngTemplateOutletContext",o.eq3(3,l,t.rows$)))},dependencies:[r.MD,r.YU,r.T3],encapsulation:2})},36801(e,t,i){"use strict";i.d(t,{$Z:()=>o.$,aZ:()=>r,F:()=>s});var n=i(74208);class r extends n.nKC{}const s=e=>e;var o=i(25740)},36890(e,t,i){"use strict";i.d(t,{m:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey"),this.keyFingerprint=this.getResponseProperty("KeyFingerprint"))}}},36951(e,t,i){"use strict";i.d(t,{f:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 0.46 73.33 76.8">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 32.89a5 5 0 0 1 1.745-3.796L37.287 1.46a4.167 4.167 0 0 1 5.426 0l32.21 27.635a5 5 0 0 1 1.744 3.794v41.035a3.333 3.333 0 0 1-3.334 3.334H6.667a3.333 3.333 0 0 1-3.334-3.334V32.89Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 73.924V32.89c0-.972-.425-1.896-1.163-2.53L41.627 2.725a2.5 2.5 0 0 0-3.255 0L6.162 30.36A3.333 3.333 0 0 0 5 32.89v41.035c0 .92.746 1.667 1.667 1.667h66.666c.92 0 1.667-.746 1.667-1.667ZM5.078 29.094a5 5 0 0 0-1.745 3.795v41.035a3.333 3.333 0 0 0 3.334 3.334h66.666a3.333 3.333 0 0 0 3.334-3.334V32.89a5 5 0 0 0-1.745-3.795L42.713 1.46a4.167 4.167 0 0 0-5.426 0L5.077 29.095Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M5.793 32.464a2.5 2.5 0 0 1-.113-3.886L37.287 1.46a4.167 4.167 0 0 1 5.426 0L74.32 28.578a2.5 2.5 0 0 1-.114 3.886L42.02 56.97a3.333 3.333 0 0 1-4.038 0L5.793 32.464Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m41.01 55.644 32.187-24.506a.833.833 0 0 0 .038-1.295L41.628 2.725a2.5 2.5 0 0 0-3.256 0L6.765 29.843a.833.833 0 0 0 .038 1.295L38.99 55.644a1.667 1.667 0 0 0 2.02 0ZM5.68 28.578a2.5 2.5 0 0 0 .113 3.886L37.981 56.97a3.333 3.333 0 0 0 4.038 0l32.187-24.506a2.5 2.5 0 0 0 .114-3.886L42.713 1.46a4.167 4.167 0 0 0-5.426 0L5.68 28.578Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.98 54.761a3.333 3.333 0 0 1-3.96 0L5.496 30.754a.833.833 0 1 0-.99 1.341l32.526 24.007a5 5 0 0 0 5.938 0l32.526-24.007a.833.833 0 0 0-.99-1.341L41.98 54.761Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M12.5 9.758h55V38.09L40.999 57.766a1.667 1.667 0 0 1-1.994-.004L12.5 37.882V9.759Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65.833 11.425H14.167v25.624l25.838 19.38 25.828-19.176V11.425ZM67.5 38.09 40.999 57.766a1.667 1.667 0 0 1-1.994-.004L12.5 37.882V9.759h55V38.09Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="m40 49.758 18.333 10.416L40 70.591 21.667 60.175 40 49.758Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.02 51.51a3.333 3.333 0 0 0-4.04 0L5.505 76.254a.833.833 0 1 1-1.01-1.325L36.97 50.185a5 5 0 0 1 6.06 0l-.494.648.494-.648 32.475 24.743a.833.833 0 0 1-1.01 1.325L42.02 51.511Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M21.667 29.757a5.833 5.833 0 0 1 5.833-5.833h25a5.833 5.833 0 0 1 0 11.666h-25a5.833 5.833 0 0 1-5.833-5.833Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M52.5 25.59h-25a4.167 4.167 0 0 0 0 8.334h25a4.167 4.167 0 1 0 0-8.334Zm-25-1.666a5.833 5.833 0 1 0 0 11.666h25a5.833 5.833 0 0 0 0-11.666h-25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M27.5 31.424a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm5 0a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm6.667-1.666a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Zm3.333 1.666a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm6.667-1.666a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Zm3.333 1.666a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Z" clip-rule="evenodd"/>
  </svg>
`},37115(e,t,i){"use strict";i.d(t,{y:()=>n});class n{}},37380(e,t,i){"use strict";i.d(t,{Ap:()=>w,q9:()=>E,tE:()=>n,Ow:()=>o,fz:()=>c});class n{}var r=i(31857),s=i(71804);const o={[s.R.Authenticator]:{type:s.R.Authenticator,name:null,description:null,priority:1,sort:2,premium:!1},[s.R.Yubikey]:{type:s.R.Yubikey,name:null,description:null,priority:3,sort:4,premium:!0},[s.R.Duo]:{type:s.R.Duo,name:"Duo",description:null,priority:2,sort:5,premium:!0},[s.R.OrganizationDuo]:{type:s.R.OrganizationDuo,name:"Duo (Organization)",description:null,priority:10,sort:6,premium:!1},[s.R.Email]:{type:s.R.Email,name:null,description:null,priority:0,sort:1,premium:!1},[s.R.WebAuthn]:{type:s.R.WebAuthn,name:null,description:null,priority:4,sort:3,premium:!1}},a=r.Zs.record(r.bh,"providers",{deserializer:e=>e}),l=new r.Zs(r.bh,"selected",{deserializer:e=>e});class c{}var d=i(20702);class u extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key=this.getResponseProperty("Key"),this.userVerificationToken=this.getResponseProperty("UserVerificationToken")}}class h extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.host=this.getResponseProperty("Host"),this.clientSecret=this.getResponseProperty("ClientSecret"),this.clientId=this.getResponseProperty("ClientId")}}class A extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.email=this.getResponseProperty("Email")}}class p extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.type=this.getResponseProperty("Type")}}class g extends d.r{constructor(e){super(e),this.code=this.getResponseProperty("Code")}}var v=i(73556);class f extends d.r{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")}}var m=i(12277),y=i(78781),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class w{constructor(e){this.apiService=e}getTwoFactorProviders(){return C(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/two-factor",null,!0,!0);return new m.s(e,p)})}getTwoFactorOrganizationProviders(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/two-factor`,null,!0,!0);return new m.s(t,p)})}getTwoFactorAuthenticator(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-authenticator",e,!0,!0);return new u(t)})}putTwoFactorAuthenticator(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/authenticator",e,!0,!0);return new u(t)})}deleteTwoFactorAuthenticator(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("DELETE","/two-factor/authenticator",e,!0,!0);return new p(t)})}getTwoFactorEmail(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-email",e,!0,!0);return new A(t)})}postTwoFactorEmailSetup(e){return C(this,void 0,void 0,function*(){return this.apiService.send("POST","/two-factor/send-email",e,!0,!1)})}postTwoFactorEmail(e){return C(this,void 0,void 0,function*(){return this.apiService.send("POST","/two-factor/send-email-login",e,!1,!1)})}putTwoFactorEmail(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/email",e,!0,!0);return new A(t)})}getTwoFactorDuo(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-duo",e,!0,!0);return new h(t)})}getTwoFactorOrganizationDuo(e,t){return C(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/two-factor/get-duo`,t,!0,!0);return new h(i)})}putTwoFactorDuo(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/duo",e,!0,!0);return new h(t)})}putTwoFactorOrganizationDuo(e,t){return C(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT",`/organizations/${e}/two-factor/duo`,t,!0,!0);return new h(i)})}getTwoFactorYubiKey(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-yubikey",e,!0,!0);return new f(t)})}putTwoFactorYubiKey(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/yubikey",e,!0,!0);return new f(t)})}getTwoFactorWebAuthn(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-webauthn",e,!0,!0);return new v.j(t)})}getTwoFactorWebAuthnChallenge(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-webauthn-challenge",e,!0,!0);return new v.Jq(t)})}putTwoFactorWebAuthn(e){return C(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:y.A.fromBufferToB64(t.attestationObject),clientDataJson:y.A.fromBufferToB64(t.clientDataJSON)}};const n=yield this.apiService.send("PUT","/two-factor/webauthn",i,!0,!0);return new v.j(n)})}deleteTwoFactorWebAuthn(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("DELETE","/two-factor/webauthn",e,!0,!0);return new v.j(t)})}getTwoFactorRecover(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-recover",e,!0,!0);return new g(t)})}putTwoFactorDisable(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/disable",e,!0,!0);return new p(t)})}putTwoFactorOrganizationDisable(e,t){return C(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT",`/organizations/${e}/two-factor/disable`,t,!0,!0);return new p(i)})}}var I=i(3204),b=i(72245),B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E{constructor(e,t,i,n){this.i18nService=e,this.platformUtilsService=t,this.globalStateProvider=i,this.twoFactorApiService=n,this.providersState=this.globalStateProvider.get(a),this.selectedState=this.globalStateProvider.get(l),this.providers$=this.providersState.state$.pipe((0,I.T)(e=>y.A.recordToMap(e))),this.selected$=this.selectedState.state$}init(){o[s.R.Email].name=this.i18nService.t("emailTitle"),o[s.R.Email].description=this.i18nService.t("emailDescV2"),o[s.R.Authenticator].name=this.i18nService.t("authenticatorAppTitle"),o[s.R.Authenticator].description=this.i18nService.t("authenticatorAppDescV2"),o[s.R.Duo].description=this.i18nService.t("duoDescV2"),o[s.R.OrganizationDuo].name="Duo ("+this.i18nService.t("organization")+")",o[s.R.OrganizationDuo].description=this.i18nService.t("duoOrganizationDesc"),o[s.R.WebAuthn].name=this.i18nService.t("webAuthnTitle"),o[s.R.WebAuthn].description=this.i18nService.t("webAuthnDesc"),o[s.R.Yubikey].name=this.i18nService.t("yubiKeyTitleV2"),o[s.R.Yubikey].description=this.i18nService.t("yubiKeyDesc")}getSupportedProviders(e){return B(this,void 0,void 0,function*(){const t=yield(0,b._)(this.providers$),i=[];return null==t||(t.has(s.R.OrganizationDuo)&&this.platformUtilsService.supportsDuo()&&i.push(o[s.R.OrganizationDuo]),t.has(s.R.Authenticator)&&i.push(o[s.R.Authenticator]),t.has(s.R.Yubikey)&&i.push(o[s.R.Yubikey]),t.has(s.R.Duo)&&this.platformUtilsService.supportsDuo()&&i.push(o[s.R.Duo]),t.has(s.R.WebAuthn)&&this.platformUtilsService.supportsWebAuthn(e)&&i.push(o[s.R.WebAuthn]),t.has(s.R.Email)&&i.push(o[s.R.Email])),i})}getDefaultProvider(e){return B(this,void 0,void 0,function*(){const t=yield(0,b._)(this.providers$),i=yield(0,b._)(this.selected$);if(null==t)return null;if(null!=i&&t.has(i))return i;let n=null,r=-1;return t.forEach((t,i)=>{const a=o[i];if(null!=a&&a.priority>r){if(i===s.R.WebAuthn&&!e)return;n=i,r=a.priority}}),n})}setSelectedProvider(e){return B(this,void 0,void 0,function*(){yield this.selectedState.update(()=>e)})}clearSelectedProvider(){return B(this,void 0,void 0,function*(){yield this.selectedState.update(()=>null)})}setProviders(e){return B(this,void 0,void 0,function*(){yield this.providersState.update(()=>e.twoFactorProviders2)})}clearProviders(){return B(this,void 0,void 0,function*(){yield this.providersState.update(()=>null)})}getProviders(){return(0,b._)(this.providers$)}getEnabledTwoFactorProviders(){return this.twoFactorApiService.getTwoFactorProviders()}getTwoFactorOrganizationProviders(e){return this.twoFactorApiService.getTwoFactorOrganizationProviders(e)}getTwoFactorAuthenticator(e){return this.twoFactorApiService.getTwoFactorAuthenticator(e)}getTwoFactorEmail(e){return this.twoFactorApiService.getTwoFactorEmail(e)}getTwoFactorDuo(e){return this.twoFactorApiService.getTwoFactorDuo(e)}getTwoFactorOrganizationDuo(e,t){return this.twoFactorApiService.getTwoFactorOrganizationDuo(e,t)}getTwoFactorYubiKey(e){return this.twoFactorApiService.getTwoFactorYubiKey(e)}getTwoFactorWebAuthn(e){return this.twoFactorApiService.getTwoFactorWebAuthn(e)}getTwoFactorWebAuthnChallenge(e){return this.twoFactorApiService.getTwoFactorWebAuthnChallenge(e)}getTwoFactorRecover(e){return this.twoFactorApiService.getTwoFactorRecover(e)}putTwoFactorAuthenticator(e){return this.twoFactorApiService.putTwoFactorAuthenticator(e)}deleteTwoFactorAuthenticator(e){return this.twoFactorApiService.deleteTwoFactorAuthenticator(e)}putTwoFactorEmail(e){return this.twoFactorApiService.putTwoFactorEmail(e)}putTwoFactorDuo(e){return this.twoFactorApiService.putTwoFactorDuo(e)}putTwoFactorOrganizationDuo(e,t){return this.twoFactorApiService.putTwoFactorOrganizationDuo(e,t)}putTwoFactorYubiKey(e){return this.twoFactorApiService.putTwoFactorYubiKey(e)}putTwoFactorWebAuthn(e){return this.twoFactorApiService.putTwoFactorWebAuthn(e)}deleteTwoFactorWebAuthn(e){return this.twoFactorApiService.deleteTwoFactorWebAuthn(e)}putTwoFactorDisable(e){return this.twoFactorApiService.putTwoFactorDisable(e)}putTwoFactorOrganizationDisable(e,t){return this.twoFactorApiService.putTwoFactorOrganizationDisable(e,t)}postTwoFactorEmailSetup(e){return this.twoFactorApiService.postTwoFactorEmailSetup(e)}postTwoFactorEmail(e){return this.twoFactorApiService.postTwoFactorEmail(e)}}},37579(e,t,i){"use strict";i.d(t,{C:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},37798(e,t,i){"use strict";i.d(t,{fq:()=>n.fq});var n=i(77867)},37806(e,t,i){"use strict";i.d(t,{r:()=>d});var n=i(90097),r=i(65731),s=i(9753),o=i(72932),a=i(25065),l=i(74208),c=i(33812);class d{}d.ɵfac=function(e){return new(e||d)},d.ɵmod=c.$C({type:d}),d.ɵinj=l.G2t({imports:[a.G,o.G,n.H,s.Pu,s.vU,r.UJ,a.G]})},37856(e,t,i){"use strict";i.d(t,{a:()=>f});var n=i(94573),r=i(58604),s=i(36801),o=i(83731),a=i(72245),l=i(33812),c=i(74208),d=i(58329),u=i(35500),h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class A{constructor(e,t,i,n,r){this.templateRef=e,this.viewContainer=t,this.billingAccountProfileStateService=i,this.destroyRef=n,this.accountService=r}ngOnInit(){return h(this,void 0,void 0,function*(){const e=yield(0,a._)(this.accountService.activeAccount$);e?this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id).pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{e?this.viewContainer.clear():this.viewContainer.createEmbeddedView(this.templateRef)}):this.viewContainer.createEmbeddedView(this.templateRef)})}}A.ɵfac=function(e){return new(e||A)(l.rXU(l.C4Q),l.rXU(l.c1b),l.rXU(d.Q),l.rXU(c.abz),l.rXU(u.D))},A.ɵdir=l.FsC({type:A,selectors:[["","appNotPremium",""]]});var p=i(43090),g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function v(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",1),l.nI1(1,"i18n"),l.bIt("click",function(t){c.eBV(e);const i=l.XpG();return c.Njj(i.promptForPremium(t))}),l.k0s()}2&e&&l.Y8G("variant","accent-primary")("label",l.bMT(1,2,"upgrade"))}class f{constructor(e){this.premiumUpgradePromptService=e,this.organizationId=(0,n.hFB)()}promptForPremium(e){return g(this,void 0,void 0,function*(){e.stopPropagation(),e.preventDefault(),yield this.premiumUpgradePromptService.promptForPremium(this.organizationId())})}}f.ɵfac=function(e){return new(e||f)(l.rXU(p.l))},f.ɵcmp=l.VBU({type:f,selectors:[["app-premium-badge"]],inputs:{organizationId:[1,"organizationId"]},decls:1,vars:0,consts:[["type","button","bit-chip-action","","startIcon","bwi-premium",3,"variant","label","click",4,"appNotPremium"],["type","button","bit-chip-action","","startIcon","bwi-premium",3,"click","variant","label"]],template:function(e,t){1&e&&l.DNE(0,v,2,4,"button",0)},dependencies:[r.g,A,s.$Z],encapsulation:2})},38140(e,t,i){"use strict";i.d(t,{X:()=>d});var n=i(77468),r=i(94573),s=i(33812);const o=e=>({width:e});function a(e,t){if(1&e&&(s.j41(0,"div",2)(1,"div",3),s.EFF(2," "),s.k0s(),s.j41(3,"div",4),s.EFF(4),s.k0s()()),2&e){const e=s.XpG();s.R7$(4),s.JRh(e.textContent)}}const l={small:["tw-h-1"],default:["tw-h-4"],large:["tw-h-6"]},c={danger:["tw-bg-danger-600"],primary:["tw-bg-primary-600"],success:["tw-bg-success-600"],warning:["tw-bg-warning-600"]};class d{constructor(){this.barWidth=(0,r.hFB)(0),this.bgColor=(0,r.hFB)("primary"),this.showText=(0,r.hFB)(!0),this.size=(0,r.hFB)("default"),this.text=(0,r.hFB)()}get displayText(){return this.showText()&&"small"!==this.size()}get outerBarStyles(){return["tw-overflow-hidden","tw-rounded","tw-bg-secondary-100"].concat(l[this.size()])}get innerBarStyles(){return["tw-flex","tw-justify-center","tw-items-center","tw-whitespace-nowrap","tw-text-xs","tw-font-medium","tw-text-contrast","tw-transition-all"].concat(l[this.size()]).concat(c[this.bgColor()])}get textContent(){return this.text()||this.barWidth()+"%"}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=s.VBU({type:d,selectors:[["bit-progress"]],inputs:{barWidth:[1,"barWidth"],bgColor:[1,"bgColor"],showText:[1,"showText"],size:[1,"size"],text:[1,"text"]},decls:3,vars:7,consts:[[3,"ngClass"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngClass","ngStyle"],[1,"tw-flex","tw-h-full","tw-flex-wrap","tw-items-center","tw-overflow-hidden"],[1,"tw-h-full"],[1,"tw-pe-1"]],template:function(e,t){1&e&&(s.j41(0,"div",0)(1,"div",1),s.nVh(2,a,5,1,"div",2),s.k0s()()),2&e&&(s.Y8G("ngClass",t.outerBarStyles),s.R7$(),s.Y8G("ngClass",t.innerBarStyles)("ngStyle",s.eq3(5,o,t.barWidth()+"%")),s.BMQ("aria-valuenow",t.barWidth()),s.R7$(),s.vxM(t.displayText?2:-1))},dependencies:[n.MD,n.YU,n.B3],encapsulation:2})},38190(e,t,i){"use strict";i.d(t,{Sw:()=>d,vP:()=>g,Ld:()=>v});var n=i(84079),r=i(3204),s=i(75811),o=i(27442),a=i(8916);class l{constructor(e){this.kdfConfig=e}static fromResponse(e){const t=e.kdf===a.ao.PBKDF2_SHA256?new a.n1(e.kdfIterations):new a.hU(e.kdfIterations,e.kdfMemory,e.kdfParallelism);return t.validateKdfConfigForPrelogin(),new l(t)}}class c{constructor(e){this.email=e}}class d{constructor(e){this.passwordPreloginApiService=e,this.currentEmail=null,this.currentPreloginData$=null}getPreloginData$(e){const t=e.trim().toLowerCase();return t===this.currentEmail&&null!==this.currentPreloginData$||(this.currentEmail=t,this.currentPreloginData$=(0,n.H)(this.passwordPreloginApiService.getPreloginData(new c(t))).pipe((0,r.T)(l.fromResponse),(0,s.W)(e=>{throw this.currentEmail=null,this.currentPreloginData$=null,e}),(0,o.t)({bufferSize:1,refCount:!1}))),this.currentPreloginData$}clearCache(){this.currentEmail=null,this.currentPreloginData$=null}}var u=i(72245),h=i(20702);class A extends h.r{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism")}}var p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class g{constructor(e,t){this.apiService=e,this.environmentService=t}getPreloginData(e){return p(this,void 0,void 0,function*(){const t=yield(0,u._)(this.environmentService.environment$),i=yield this.apiService.send("POST","/accounts/prelogin/password",e,!1,!0,t.getIdentityUrl());return new A(i)})}}class v{}},38410(e,t,i){"use strict";i.d(t,{Q:()=>r});var n=i(33812);class r{get classList(){return["tw-p-3","has-[[biticonbutton]]:tw-py-1"]}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["th","bitCell",""],["td","bitCell",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.HbH(t.classList)}})},38411(e,t,i){"use strict";i.d(t,{d:()=>v});var n=i(39180),r=i(37831),s=i(33812),o=i(94573),a=i(74208),l=i(33277),c=i(69194),d=i(65023);const u=14,h=24,A=[{id:"right-start",offsetX:u,offsetY:-24,originX:"end",originY:"center",overlayX:"start",overlayY:"top",panelClass:["bit-popover-right","bit-popover-right-start"]},{id:"right-center",offsetX:u,originX:"end",originY:"center",overlayX:"start",overlayY:"center",panelClass:["bit-popover-right","bit-popover-right-center"]},{id:"right-end",offsetX:u,offsetY:h,originX:"end",originY:"center",overlayX:"start",overlayY:"bottom",panelClass:["bit-popover-right","bit-popover-right-end"]},{id:"left-start",offsetX:-14,offsetY:-24,originX:"start",originY:"center",overlayX:"end",overlayY:"top",panelClass:["bit-popover-left","bit-popover-left-start"]},{id:"left-center",offsetX:-14,originX:"start",originY:"center",overlayX:"end",overlayY:"center",panelClass:["bit-popover-left","bit-popover-left-center"]},{id:"left-end",offsetX:-14,offsetY:h,originX:"start",originY:"center",overlayX:"end",overlayY:"bottom",panelClass:["bit-popover-left","bit-popover-left-end"]},{id:"below-center",offsetY:u,originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-center"]},{id:"below-start",offsetX:-24,offsetY:u,originX:"center",originY:"bottom",overlayX:"start",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-start"]},{id:"below-end",offsetX:h,offsetY:u,originX:"center",originY:"bottom",overlayX:"end",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-end"]},{id:"above-center",offsetY:-14,originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-center"]},{id:"above-start",offsetX:-24,offsetY:-14,originX:"center",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-start"]},{id:"above-end",offsetX:h,offsetY:-14,originX:"center",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-end"]}];var p=i(43380);class g{constructor(){this.overlay=(0,a.WQX)(p.hJ),this.currentTarget=null,this.currentPadding=0,this.borderOverlayRef=null,this.resizeObserver=null,this.hideTimeout=null,this.activePopover=null,this.backdropElement=document.createElement("div"),this.backdropElement.style.cssText="\n      position: fixed;\n      inset: 0;\n      background: transparent;\n      z-index: 999;\n      pointer-events: auto;\n      display: none;\n    ",this.backdropElement.setAttribute("data-spotlight-backdrop","true"),document.body.appendChild(this.backdropElement),this.borderElement=document.createElement("div"),this.borderElement.style.cssText="\n      box-shadow: 0 0 0 9999px var(--color-bg-overlay);\n      width: 100%;\n      height: 100%;\n      pointer-events: none;\n      display: none;\n    ",this.borderElement.setAttribute("data-spotlight-border","true"),document.body.appendChild(this.borderElement)}showSpotlight(e,t){if(null!==this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.currentTarget===e&&this.currentPadding===t)return;const i=this.currentTarget!==e;this.currentTarget=e,this.currentPadding=t,i&&"function"==typeof e.scrollIntoView&&e.scrollIntoView({block:"center",inline:"nearest"}),this.backdropElement.style.display="block",this.disposeBorderOverlay(),this.createBorderOverlay(e,t)}get overlayElement(){var e,t;return null!==(t=null===(e=this.borderOverlayRef)||void 0===e?void 0:e.overlayElement)&&void 0!==t?t:null}register(e){this.activePopover&&this.activePopover!==e&&this.activePopover.closePopover(),this.activePopover=e}unregister(e){this.activePopover===e&&(this.activePopover=null)}hideSpotlight(){this.hideTimeout=window.setTimeout(()=>{this.backdropElement.style.display="none",this.disposeBorderOverlay(),this.currentTarget=null,this.currentPadding=0,this.hideTimeout=null},100)}createBorderOverlay(e,t){const i=window.getComputedStyle(e);this.borderElement.style.borderRadius=i.borderRadius;const n=this.overlay.position().flexibleConnectedTo(new s.aKT(e)).withPositions([{originX:"start",originY:"top",overlayX:"start",overlayY:"top",offsetX:-t,offsetY:-t}]).withLockedPosition(!1).withFlexibleDimensions(!1).withPush(!1);this.borderOverlayRef=this.overlay.create({positionStrategy:n,scrollStrategy:this.overlay.scrollStrategies.reposition(),width:e.offsetWidth+2*t,height:e.offsetHeight+2*t}),this.borderElement.style.display="block",this.borderOverlayRef.attach(new r.pc(this.borderElement)),this.resizeObserver=new ResizeObserver(()=>{this.currentTarget&&this.borderOverlayRef&&(this.borderOverlayRef.updateSize({width:this.currentTarget.offsetWidth+2*t,height:this.currentTarget.offsetHeight+2*t}),this.borderOverlayRef.updatePosition())}),this.resizeObserver.observe(e)}disposeBorderOverlay(){var e,t;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.resizeObserver=null,null===(t=this.borderOverlayRef)||void 0===t||t.dispose(),this.borderOverlayRef=null,this.borderElement.style.display="none"}}g.ɵfac=function(e){return new(e||g)},g.ɵprov=a.jDH({token:g,factory:g.ɵfac,providedIn:"root"});class v{get positions(){if(!this.position())return A;const e=A.find(e=>e.id===this.position());return e?[e,...A]:A}get defaultPopoverConfig(){return{hasBackdrop:!this.spotlight(),backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:this.overlay.position().flexibleConnectedTo(this.spotlight()&&this.spotlightService.overlayElement?new s.aKT(this.spotlightService.overlayElement):this.elementRef).withPositions(this.positions).withLockedPosition(!0).withFlexibleDimensions(!1).withPush(!0)}}constructor(e,t,i){this.elementRef=e,this.viewContainerRef=t,this.overlay=i,this.popoverOpen=(0,o.geq)(!1),this.popover=o.hFB.required({alias:"bitPopoverAnchorFor"}),this.closeOnBackdropClick=(0,o.hFB)(!0),this.position=(0,o.hFB)(),this.spotlight=(0,o.hFB)(!1),this.spotlightPadding=(0,o.hFB)(0),this.overlayRef=null,this.closedEventsSub=null,this.hasInitialized=(0,a.vPA)(!1),this.isDestroyed=!1,this.spotlightService=(0,a.WQX)(g),(0,s.mal)(()=>this.hasInitialized.set(!0)),(0,l.QZ)(()=>{this.isDestroyed||(this.popoverOpen()||!this.overlayRef?this.popoverOpen()&&!this.overlayRef&&this.hasInitialized()&&this.openPopover():this.disposeAll())})}openPopover(){if(this.overlayRef)return;this.spotlight()&&(this.spotlightService.register(this),this.spotlightService.showSpotlight(this.elementRef.nativeElement,this.spotlightPadding())),this.popoverOpen.set(!0),this.overlayRef=this.overlay.create(this.defaultPopoverConfig);const e=new r.VA(this.popover().templateRef(),this.viewContainerRef);this.overlayRef.attach(e),this.closedEventsSub=this.getClosedEvents().subscribe(e=>{e instanceof KeyboardEvent&&"Escape"===e.key&&!(0,n.rp)(e)&&e.preventDefault(),this.destroyPopover()})}getClosedEvents(){if(!this.overlayRef)throw new Error("Overlay reference is not available");const e=this.overlayRef.detachments(),t=this.overlayRef.keydownEvents().pipe((0,c.p)(e=>"Escape"===e.key&&!this.spotlight())),i=this.overlayRef.backdropClick().pipe((0,c.p)(()=>!this.spotlight()&&this.closeOnBackdropClick())),n=this.popover().closed;return e.pipe((0,d.X)(t,i,n))}destroyPopover(){this.popoverOpen()&&(this.popoverOpen.set(!1),this.disposeAll())}disposeAll(){var e,t;null===(e=this.closedEventsSub)||void 0===e||e.unsubscribe(),this.closedEventsSub=null,null===(t=this.overlayRef)||void 0===t||t.dispose(),this.overlayRef=null,this.spotlight()&&(this.spotlightService.unregister(this),this.spotlightService.hideSpotlight())}ngOnDestroy(){this.isDestroyed=!0,this.disposeAll()}closePopover(){this.destroyPopover()}}v.ɵfac=function(e){return new(e||v)(s.rXU(s.aKT),s.rXU(s.c1b),s.rXU(p.hJ))},v.ɵdir=s.FsC({type:v,selectors:[["","bitPopoverAnchorFor",""]],inputs:{popoverOpen:[1,"popoverOpen"],popover:[1,"bitPopoverAnchorFor","popover"],closeOnBackdropClick:[1,"closeOnBackdropClick"],position:[1,"position"],spotlight:[1,"spotlight"],spotlightPadding:[1,"spotlightPadding"]},outputs:{popoverOpen:"popoverOpenChange"},exportAs:["popoverAnchor"]})},38449(e,t,i){"use strict";i.d(t,{P:()=>s});var n=i(17989),r=i(54967);class s extends n.A{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,this.revisionDate=new Date(e.revisionDate))}static fromResponse(e){return new s(new r.L(e))}static fromListResponse(e){return e.data.map(e=>s.fromResponse(e))}}},38453(e,t,i){"use strict";function n(e){if(null!=e)return{lastUsedDate:e.lastUsedDate?new Date(e.lastUsedDate).getTime():void 0,lastLaunched:e.lastLaunched?new Date(e.lastLaunched).getTime():void 0}}function r(e){if(null!=e)return{lastUsedDate:e.lastUsedDate?new Date(e.lastUsedDate).toISOString():void 0,lastLaunched:e.lastLaunched?new Date(e.lastLaunched).toISOString():void 0}}i.d(t,{H:()=>r,e:()=>n})},38620(e,t,i){"use strict";i.d(t,{L:()=>f});var n=i(74208),r=i(94573),s=i(83731),o=i(16878),a=i(69194),l=i(44500),c=i(75811),d=i(93695),u=i(56962),h=i(26038);class A{constructor(){this.registeredDirectives=new Set}registerForm(e){this.registeredDirectives.add(e)}deregisterForm(e){this.registeredDirectives.delete(e)}hasDirtyForm(){var e;for(const t of this.registeredDirectives)if(null===(e=t.form)||void 0===e?void 0:e.dirty)return!0;return!1}}A.ɵfac=function(e){return new(e||A)},A.ɵprov=n.jDH({token:A,factory:A.ɵfac,providedIn:"root"});var p=i(33812),g=i(51757),v=i(2471);class f{constructor(e,t,i){this.formGroupDirective=e,this.destroyRef=(0,n.WQX)(n.abz),this.dirtyFormService=(0,n.WQX)(A),this._loading$=new o.t(!1),this._disabled$=new o.t(!1),this.handler=r.hFB.required({alias:"bitSubmit"}),this.allowDisabledFormSubmit=(0,r.hFB)(!1),this.loading$=this._loading$.asObservable(),this.disabled$=this._disabled$.asObservable(),e.ngSubmit.pipe((0,a.p)(()=>!this.disabled),(0,l.n)(()=>{const e=(0,h.Z)(this.handler());return this.loading=!0,e.pipe((0,c.W)(e=>(null==i||i.error(`Async submit exception: ${e}`),null==t||t.showError(e),(0,d.of)(void 0))))}),(0,s.pQ)()).subscribe({next:()=>this.loading=!1,complete:()=>this.loading=!1})}ngOnInit(){var e;this.dirtyFormService.registerForm(this.formGroupDirective),this.destroyRef.onDestroy(()=>{this.dirtyFormService.deregisterForm(this.formGroupDirective)}),null===(e=this.formGroupDirective.statusChanges)||void 0===e||e.pipe((0,s.pQ)(this.destroyRef)).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)}}f.ɵfac=function(e){return new(e||f)(p.rXU(g.j4),p.rXU(v.B,8),p.rXU(u.K,8))},f.ɵdir=p.FsC({type:f,selectors:[["","formGroup","","bitSubmit",""]],inputs:{handler:[1,"bitSubmit","handler"],allowDisabledFormSubmit:[1,"allowDisabledFormSubmit"]}})},39200(e,t,i){"use strict";i.d(t,{y:()=>s});var n=i(94573),r=i(33812);class s{get disabledAttr(){return this.disabled||null}constructor(e){this.elementRef=e,this.active=(0,n.hFB)(),this.disabled=!1}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-secondary-300","hover:!tw-text-secondary-300"]: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-medium","tw-transition","tw-rounded-t-lg","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-600"]}get disabledClassList(){return["!tw-no-underline","tw-cursor-not-allowed"]}get activeClassList(){return["tw--mb-px","tw-border-x-secondary-100","tw-border-t-primary-600","tw-border-b","tw-border-b-background","!tw-bg-background","hover:tw-no-underline","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)(r.rXU(r.aKT))},s.ɵdir=r.FsC({type:s,selectors:[["","bitTabListItem",""]],hostVars:3,hostBindings:function(e,t){2&e&&(r.BMQ("disabled",t.disabledAttr),r.HbH(t.classList))},inputs:{active:[1,"active"],disabled:"disabled"}})},39306(e,t,i){"use strict";i.d(t,{h:()=>s,k:()=>o});var n=i(68467),r=i(78781);const s="[error: cannot decrypt]";class o{constructor(e,t,i,n){null!=t?this.initFromData(e,t,i,n):this.initFromEncryptedString(e)}get ivBytes(){return null==this.iv?null:r.A.fromB64ToArray(this.iv)}get macBytes(){return null==this.mac?null:r.A.fromB64ToArray(this.mac)}get dataBytes(){return null==this.data?null:r.A.fromB64ToArray(this.data)}toSdk(){return this.encryptedString}toJSON(){return this.encryptedString}static fromJSON(e){return null==e?null:new o(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}=o.parseEncryptedString(this.encryptedString);if(this.encryptionType=t,i.length===n.iS[t])switch(t){case n.Qd.AesCbc256_HmacSha256_B64:this.iv=i[0],this.data=i[1],this.mac=i[2];break;case n.Qd.AesCbc256_B64:this.iv=i[0],this.data=i[1];break;case n.Qd.Rsa2048_OaepSha256_B64:case n.Qd.Rsa2048_OaepSha1_B64:this.data=i[0];break;case n.Qd.Rsa2048_OaepSha256_HmacSha256_B64:case n.Qd.Rsa2048_OaepSha1_HmacSha256_B64:this.data=i[0],this.mac=i[1];break;default:return}}static parseEncryptedString(e){const t=e.split(".");let i,r=null;if(2===t.length)try{i=parseInt(t[0],null),r=t[1].split("|")}catch(s){return{encType:NaN,encPieces:[]}}else r=e.split("|"),i=n.Qd.AesCbc256_B64;return{encType:i,encPieces:r}}static isSerializedEncString(e){if(null==e)return!1;const{encType:t,encPieces:i}=this.parseEncryptedString(e);return!isNaN(t)&&0!==i.length&&n.iS[t]===i.length}}},39307(e,t,i){"use strict";i.d(t,{e:()=>r});var n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class r{constructor(e,t){this.api=e,this.i18n=t}fetchJson(e,t){return n(this,void 0,void 0,function*(){const i=e.toRequest(t),n=yield this.api.nativeFetch(i);let r,s,o;const a=yield this.detectCommonErrors(n);if(a?[s,o]=a:e.hasJsonPayload(n)&&([r,o]=e.processJson(yield n.json())),r)return r;null!=s||(s=o?"forwarderError":"forwarderUnknownError");throw this.i18n.t(s,e.requestor.name,o)})}detectCommonErrors(e){return n(this,void 0,void 0,function*(){if(401===e.status){const t=yield this.tryGetErrorMessage(e);return[t?"forwaderInvalidTokenWithMessage":"forwaderInvalidToken",t]}if(403===e.status){const t=yield this.tryGetErrorMessage(e);return[t?"forwaderInvalidOperationWithMessage":"forwaderInvalidOperation",t]}if(e.status>=400){const t=yield this.tryGetErrorMessage(e);return[t?"forwarderError":"forwarderUnknownError",t]}})}tryGetErrorMessage(e){return n(this,void 0,void 0,function*(){var t,i,n;const r=null!==(t=yield e.text())&&void 0!==t?t:"";return(null!==(n=null!==(i=this.tryFindErrorAsJson(r))&&void 0!==i?i:this.tryFindErrorAsText(r))&&void 0!==n?n:e.statusText)||void 0})}tryFindErrorAsJson(e){var t,i,n,r,s;if(!(e.startsWith("{")||e.startsWith("'")||e.startsWith('"')))return;let o;try{o=JSON.parse(e)}catch(c){return!1}if(o&&"string"==typeof o)return o;const a=null!==(i=null===(t=o.error)||void 0===t?void 0:t.toString())&&void 0!==i?i:null,l=null!==(r=null===(n=o.message)||void 0===n?void 0:n.toString())&&void 0!==r?r:null;return a&&l?`${a}: ${l}`:null!==(s=null!=a?a:l)&&void 0!==s&&s}tryFindErrorAsText(e){if(e.length&&!e.includes("<"))return e}}},39326(e,t,i){"use strict";i.d(t,{p:()=>r});var n=i(20702);class r extends n.r{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"))}}},39364(e,t,i){"use strict";i.d(t,{f:()=>n});class n{constructor(e){var t;this.disableUserRegistration=null!==(t=null==e?void 0:e.disableUserRegistration)&&void 0!==t&&t}}},39488(e,t,i){"use strict";i.d(t,{H:()=>n.H});var n=i(49272)},39805(e,t,i){"use strict";i.d(t,{J:()=>d});var n=i(58716),r=i(94573),s=i(74208),o=i(40443),a=i(17386),l=i(97560),c=i(33812);class d{constructor(){this.tabLabels=(0,r.tEk)((0,s.Rfq)(()=>l.T)),this.label=(0,r.hFB)("")}ngAfterContentInit(){this.keyManager=new n.B(this.tabLabels()).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}updateActiveLink(){var e;const t=this.tabLabels();for(let i=0;i<t.length;i++)t[i].active&&(null===(e=this.keyManager)||void 0===e||e.updateActiveItem(i))}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=c.VBU({type:d,selectors:[["bit-tab-nav-bar"]],contentQueries:function(e,t,i){1&e&&c.C6U(i,t.tabLabels,l.T,4),2&e&&c.NyB()},hostAttrs:[1,"tw-block"],inputs:{label:[1,"label"]},ngContentSelectors:["*"],decls:3,vars:1,consts:[["bitTabListContainer","",3,"keydown"]],template:function(e,t){1&e&&(c.NAR(),c.j41(0,"bit-tab-header")(1,"nav",0),c.bIt("keydown",function(e){return t.keyManager.onKeydown(e)}),c.SdG(2),c.k0s()()),2&e&&(c.R7$(),c.BMQ("aria-label",t.label()))},dependencies:[o.g,a.k],encapsulation:2})},39907(e,t,i){"use strict";i.d(t,{jd:()=>n,ov:()=>r});i(78781),i(97440);function n(e){const t=null==e||""===e;let i=t?null:`${e}`;if(t||i&&/^[1-9]{1}\d{3}$/.test(i))return i;if(i=(i||"").replace(/[^\d]/g,"").replace(/^[0]+(?=.)/,""),""===i&&(i=null),i&&4!==i.length){const e=("00"+i).slice(-2);i=`${(new Date).getFullYear()}`.slice(0,2)+e}return i}function r(e){if(e){const{expMonth:t=null,expYear:i=null}=e;if(!i)return!1;const r=new Date,s=n(i),o=s?parseInt(s,10):NaN,a=o<r.getFullYear(),l=o>r.getFullYear();if(s&&a)return!0;if(s&&l)return!1;if(s&&t){const e=parseInt(t,10);if(!(e&&!isNaN(e)))return!1;return new Date(o,e-1+1,1)<=r}}return!1}},39935(e,t,i){"use strict";i.d(t,{M:()=>n});class n{}},39960(e,t,i){"use strict";i.d(t,{x:()=>y});var n=i(66046),r=i(88565),s=i(72245),o=i(82468),a=i(49272),l=i(27485),c=i(24593),d=i(74208),u=i(66316),h=i(1601),A=i(35500),p=i(12012),g=i(58329),v=i(37115),f=i(23649),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class y{constructor(e,t,i,r,s,o,a,l,c){this.dialogService=e,this.configService=t,this.accountService=i,this.apiService=r,this.syncService=s,this.billingAccountProfileStateService=o,this.platformUtilsService=a,this.router=l,this.dialog=c,this._upgradeConfirmed$=new n.B,this.upgradeConfirmed$=this._upgradeConfirmed$.asObservable(),this.subscriptionPageRoute="settings/subscription/premium"}promptForPremium(e){return m(this,void 0,void 0,function*(){const t=yield(0,s._)(this.accountService.activeAccount$);if(!t)return;if(yield(0,s._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id)))return;if((yield this.configService.getFeatureFlag(o.TO.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog))&&!e)return void(yield this.promptForPremiumVNext(t));let i=!1,n=null;e?(i=yield this.dialogService.openSimpleDialog({title:{key:"upgradeOrganization"},content:{key:"upgradeOrganizationDesc"},acceptButtonText:{key:"upgradeOrganization"},type:"info"}),i&&(n=["organizations",e,"billing","subscription"])):(i=yield this.dialogService.openSimpleDialog({title:{key:"premiumRequired"},content:{key:"premiumRequiredDesc"},acceptButtonText:{key:"upgrade"},type:"success"}),i&&(n=[this.subscriptionPageRoute])),this._upgradeConfirmed$.next(i),n&&(yield this.router.navigate(n)),i&&this.dialog&&this.dialog.close(c.r.PremiumUpgrade)})}promptForPremiumVNext(e){return m(this,void 0,void 0,function*(){yield this.platformUtilsService.isSelfHost()?this.redirectToSubscriptionPage():this.openUpgradeDialog(e)})}redirectToSubscriptionPage(){return m(this,void 0,void 0,function*(){yield this.router.navigate([this.subscriptionPageRoute]),this.dialog&&this.dialog.close(c.r.PremiumUpgrade)})}openUpgradeDialog(e){return m(this,void 0,void 0,function*(){const t=l.gY.open(this.dialogService,{data:{account:e,planSelectionStepTitleOverride:"upgradeYourPlan",hideContinueWithoutUpgradingButton:!0}}),i=yield(0,r.s)(t.closed);(null==i?void 0:i.status)!==l.PD.UpgradedToPremium&&(null==i?void 0:i.status)!==l.PD.UpgradedToFamilies||(yield this.syncService.fullSync(!0))})}}y.ɵfac=function(e){return new(e||y)(d.KVO(u.o3),d.KVO(h.w),d.KVO(A.D),d.KVO(p.G),d.KVO(a.H),d.KVO(g.Q),d.KVO(v.y),d.KVO(f.Ix),d.KVO(u.ce,8))},y.ɵprov=d.jDH({token:y,factory:y.ɵfac})},40101(e,t,i){"use strict";i.d(t,{Fk:()=>r.F,rd:()=>n.r});var n=i(37806),r=i(91517)},40271(e,t,i){"use strict";i.d(t,{T:()=>n});class n{}},40443(e,t,i){"use strict";i.d(t,{g:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-tab-header"]],hostAttrs:[1,"tw-min-h-16","tw-ps-4","tw-bg-background-alt","tw-flex","tw-items-end","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},40640(e,t,i){"use strict";var n;i.d(t,{j:()=>n}),function(e){e[e.Enabled=0]="Enabled",e[e.Supported=1]="Supported",e[e.Unsupported=2]="Unsupported"}(n||(n={}))},41103(e,t,i){"use strict";i.d(t,{w:()=>n});class n{}},41226(e,t,i){"use strict";i.d(t,{g:()=>a});var n=i(7861),r=i(56962),s=i(74208),o=i(69855);class a{constructor(e,t){this.logService=e,this.toastService=t}handleError(e,t=""){throw this.logService.error(e),e instanceof n._&&this.toastService.showToast({variant:"error",title:t,message:e.getSingleMessage()}),e}showSuccess(e,t=""){this.toastService.showToast({variant:"success",title:t,message:e})}showError(e,t=""){this.toastService.showToast({variant:"error",title:t,message:e})}}a.ɵfac=function(e){return new(e||a)(s.KVO(r.K),s.KVO(o.f))},a.ɵprov=s.jDH({token:a,factory:a.ɵfac,providedIn:"root"})},41347(e,t,i){"use strict";i.d(t,{h:()=>r});var n=i(20702);class r extends n.r{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"))}}},41445(e,t,i){"use strict";i.d(t,{Q:()=>n});class n{}},42234(e,t,i){"use strict";i.d(t,{a:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),this.delete=!1,this.restore=!1,null!=e&&(this.delete=this.getResponseProperty("Delete"),this.restore=this.getResponseProperty("Restore"))}static fromJSON(e){return Object.assign(new r,e)}static fromSdkCipherPermissions(e){if(!e)return;const t=new r;return t.delete=e.delete,t.restore=e.restore,t}toSdkCipherPermissions(){return this}}},42503(e,t,i){"use strict";i.d(t,{K:()=>f});var n=i(60989),r=i(34003),s=i(77468),o=i(94573),a=i(74208),l=i(33812),c=i(36801),d=i(36288),u=i(74269),h=i(21823);const A=["toggleButton"],p=["*",[["","slot","product-switcher"]],[["","slot","footer"]]];function g(e,t){1&e&&(l.j41(0,"div",6),l.SdG(1,1),l.k0s())}function v(e,t){1&e&&l.SdG(0,2)}class f{constructor(){this.sideNavService=(0,a.WQX)(h.G),this.variant=(0,o.hFB)("primary"),this.toggleButton=(0,o.ebz)("toggleButton",{read:l.aKT}),this.elementRef=(0,a.WQX)(l.aKT),this.handleKeyDown=e=>{var t;return"Escape"!==e.key||(this.sideNavService.open.set(!1),null===(t=this.toggleButton())||void 0===t||t.nativeElement.focus(),!1)}}onDragMoved(e){const t=this.elementRef.nativeElement.getBoundingClientRect().x,i=e.pointerPosition.x;this.sideNavService.setWidthFromDrag(i,t);e.source.element.nativeElement.style.transform="none"}onKeydown(e){"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||this.sideNavService.setWidthFromKeys(e.key)}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=l.VBU({type:f,selectors:[["bit-side-nav"]],viewQuery:function(e,t){1&e&&l.wEZ(t.toggleButton,A,5,l.aKT),2&e&&l.NyB()},hostAttrs:[1,"tw-block","tw-h-full","tw-col-start-1","tw-row-start-1"],hostVars:2,hostBindings:function(e,t){2&e&&l.HbH(t.sideNavService.isOverlay()?"tw-fixed tw-top-0 tw-bottom-0 tw-left-0 tw-z-50":"")},inputs:{variant:[1,"variant"]},ngContentSelectors:["*","[slot=product-switcher]","[slot=footer]"],decls:18,vars:26,consts:[["toggleButton",""],[1,"tw-relative","tw-h-full"],["id","bit-side-nav",1,"tw-sticky","tw-inset-y-0","tw-left-0","tw-z-30","tw-flex","tw-h-full","tw-flex-col","tw-overflow-hidden","tw-bg-bg-nav","tw-text-fg-nav","tw-outline-none",3,"keydown","cdkTrapFocus"],[1,"tw-flex-1","tw-min-h-0","tw-overflow-auto","tw-overscroll-none",2,"container-type","size"],[1,"tw-flex","tw-flex-col","tw-min-h-full"],[1,"tw-flex-1"],[1,"tw-w-full","tw-bg-bg-nav","[@container_(min-height:600px)]:tw-sticky","[@container_(min-height:600px)]:tw-bottom-0"],[1,"tw-w-full","tw-bg-bg-nav"],[1,"tw-m-4"],["type","button","buttonType","side-nav","size","small","aria-controls","bit-side-nav",1,"tw-mx-auto","tw-block",3,"click","bitIconButton","label"],["cdkDrag","","tabindex","0","role","separator","aria-orientation","vertical","aria-controls","bit-side-nav",1,"tw-absolute","tw-top-0","-tw-right-0.5","tw-z-30","tw-h-full","tw-w-1","tw-cursor-col-resize","tw-transition-colors","tw-duration-[250ms]","hover:tw-ease-in-out","hover:tw-delay-[250ms]","hover:tw-bg-primary-300","focus:tw-outline-none","focus-visible:tw-bg-primary-300","before:tw-content-['']","before:tw-absolute","before:tw-block","before:tw-inset-y-0","before:-tw-left-0.5","before:-tw-right-1",3,"cdkDragMoved","keydown"]],template:function(e,t){if(1&e){const e=l.RV6();l.NAR(p),l.j41(0,"div",1)(1,"nav",2),l.nI1(2,"async"),l.bIt("keydown",function(i){return a.eBV(e),a.Njj(t.handleKeyDown(i))}),l.j41(3,"div",3)(4,"div",4)(5,"div",5),l.SdG(6),l.k0s(),l.nVh(7,g,2,0,"div",6),l.k0s()(),l.j41(8,"div",7),l.nrm(9,"bit-nav-divider"),l.nVh(10,v,1,0),l.j41(11,"div",8)(12,"button",9,0),l.nI1(14,"i18n"),l.bIt("click",function(){return a.eBV(e),a.Njj(t.sideNavService.toggle())}),l.k0s()()()(),l.j41(15,"div",10),l.nI1(16,"async"),l.nI1(17,"i18n"),l.bIt("cdkDragMoved",function(i){return a.eBV(e),a.Njj(t.onDragMoved(i))})("keydown",function(i){return a.eBV(e),a.Njj(t.onKeydown(i))}),l.k0s()()}if(2&e){const e=t.sideNavService.open(),i=t.sideNavService.isOverlay();l.R7$(),l.Aen("secondary"===t.variant()?"--color-nav-fg-primary: var(--color-nav-fg-secondary); --color-nav-bg-primary: var(--color-nav-bg-secondary); --color-nav-bg-primary-strong: var(--color-nav-bg-secondary-strong); --color-nav-bg-primary-hover: var(--color-nav-bg-secondary-hover); --color-nav-bg-primary-hover-strong: var(--color-nav-bg-secondary-hover-strong); --color-nav-border-primary-focus: var(--color-nav-border-secondary-focus); --color-nav-border-primary: var(--color-nav-border-secondary);":""),l.xc7("width",e?l.bMT(2,18,t.sideNavService.width$):void 0,"rem"),l.Y8G("cdkTrapFocus",i),l.BMQ("role",i?"dialog":null)("aria-modal",i?"true":null),l.R7$(6),l.vxM(e?7:-1),l.R7$(3),l.vxM(e?10:-1),l.R7$(2),l.Y8G("bitIconButton",e?"bwi-angle-left":"bwi-angle-right")("label",l.bMT(14,20,"toggleSideNavigation")),l.BMQ("aria-expanded",e),l.R7$(3),l.AVh("tw-hidden",!e),l.BMQ("aria-valuenow",l.bMT(16,22,t.sideNavService.width$))("aria-valuemax",t.sideNavService.MAX_OPEN_WIDTH)("aria-valuemin",t.sideNavService.MIN_OPEN_WIDTH)("aria-label",l.bMT(17,24,"resizeSideNavigation"))}},dependencies:[n.kB,u.K,d.s,r.ad,r.T1,c.$Z,s.Jj],encapsulation:2,changeDetection:0})},42700(e,t,i){"use strict";i.d(t,{N:()=>p});var n=i(20702),r=i(36501),s=i(61782),o=i(42234),a=i(61182),l=i(39326),c=i(36107),d=i(10070),u=i(36890),h=i(74865);class A extends n.r{constructor(e){super(e),this.password=this.getResponseProperty("Password"),this.lastUsedDate=this.getResponseProperty("LastUsedDate")}}class p extends n.r{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.permissions=new o.a(this.getResponseProperty("Permissions")),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"),this.archivedDate=this.getResponseProperty("ArchivedDate");const t=this.getResponseProperty("Login");null!=t&&(this.login=new c.a(t));const i=this.getResponseProperty("Card");null!=i&&(this.card=new s.j(i));const n=this.getResponseProperty("Identity");null!=n&&(this.identity=new l.p(n));const p=this.getResponseProperty("SecureNote");null!=p&&(this.secureNote=new d.c(p));const g=this.getResponseProperty("sshKey");null!=g&&(this.sshKey=new u.m(g));const v=this.getResponseProperty("Fields");null!=v&&(this.fields=v.map(e=>new a.d(e)));const f=this.getResponseProperty("Attachments");null!=f&&(this.attachments=f.map(e=>new h.l(e)));const m=this.getResponseProperty("PasswordHistory");null!=m&&(this.passwordHistory=m.map(e=>new A(e))),this.reprompt=this.getResponseProperty("Reprompt")||r.b.None,this.key=this.getResponseProperty("Key")||null}}},43090(e,t,i){"use strict";i.d(t,{l:()=>n});class n{}},43184(e,t,i){"use strict";i.d(t,{t:()=>te,Z:()=>ee});var n=i(74208),r=i(51757),s=i(66046),o=i(14803);function a(e,t,i){let n=0,r=e.length||0,s=-1,o=0;for(;n<r;)if(s=Math.floor((n+r)/2),o=i(e[s],t),o<0)n=s+1;else{if(!(o>0))return s;r=s}return n}class l{constructor(e,t){this.controlFactory=e,this.compareFn=t,this.allItems=[],this.selectedItems=[],this.deselectedItems=[],this.formArray=new r.Yp([])}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 r=a(this.selectedItems,n,this.compareFn);this.selectedItems=[...this.selectedItems.slice(0,r),n,...this.selectedItems.slice(r)];const s=this.controlFactory(n);s.patchValue(Object.assign({id:e},t)),this.formArray.insert(r,s)}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(45980),d=i(33812),u=i(50700),h=i(77468),A=i(54471),p=i(47696),g=i(86226),v=i(93199),f=i(89812),m=i(43759),y=i(36288),C=i(33886),w=i(68923),I=i(38410),b=i(22466),B=i(36572),E=i(25740),S=i(43978);class Q{constructor(e){this.i18nService=e}transform(e,t){if(null==e)return null!=t?t:this.i18nService.t("unknown");switch(e){case S.D7.Owner:return this.i18nService.t("owner");case S.D7.Admin:return this.i18nService.t("admin");case S.D7.User:return this.i18nService.t("user");case S.D7.Custom:return this.i18nService.t("custom")}}}Q.ɵfac=function(e){return new(e||Q)(d.rXU(u.W,16))},Q.ɵpipe=d.EJ8({name:"userType",type:Q,pure:!0,standalone:!1});var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const T=()=>({standalone:!0}),F=e=>({"tw-text-muted":e});function P(e,t){if(1&e&&(d.nrm(0,"bit-option",16),d.nI1(1,"i18n")),2&e){const e=t.$implicit;d.Y8G("value",e.perm)("label",d.bMT(1,2,e.labelId))}}function R(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field",13)(1,"bit-label"),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"bit-select",14),d.mxI("ngModelChange",function(t){n.eBV(e);const i=d.XpG(2);return d.DH7(i.initialPermission,t)||(i.initialPermission=t),n.Njj(t)}),d.bIt("closed",function(){n.eBV(e);const t=d.XpG(2);return n.Njj(t.handleBlur())}),d.DNE(5,P,2,4,"bit-option",15),d.k0s()()}if(2&e){const e=d.XpG(2);d.R7$(2),d.JRh(d.bMT(3,5,"permission")),d.R7$(2),d.Y8G("disabled",e.disabled),d.R50("ngModel",e.initialPermission),d.Y8G("ngModelOptions",d.lJ4(7,T)),d.R7$(),d.Y8G("ngForOf",e.permissionList)}}function D(e,t){if(1&e&&(d.j41(0,"bit-hint"),d.EFF(1),d.k0s()),2&e){const e=d.XpG(3);d.R7$(),d.JRh(e.selectorHelpText)}}function M(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field",17)(1,"bit-label"),d.EFF(2),d.k0s(),d.j41(3,"bit-multi-select",18),d.bIt("onItemsConfirmed",function(t){n.eBV(e);const i=d.XpG(2);return n.Njj(i.selectItems(t))})("blur",function(){n.eBV(e);const t=d.XpG(2);return n.Njj(t.handleBlur())}),d.k0s(),d.DNE(4,D,2,1,"bit-hint",19),d.k0s()}if(2&e){const e=d.XpG(2);d.R7$(2),d.JRh(e.selectorLabelText),d.R7$(),d.Y8G("baseItems",e.selectionList.deselectedItems)("removeSelectedItems",!0)("disabled",e.disabled),d.R7$(),d.Y8G("ngIf",e.selectorHelpText)}}function x(e,t){if(1&e&&(d.j41(0,"div",10),d.DNE(1,R,6,8,"bit-form-field",11)(2,M,5,5,"bit-form-field",12),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.Y8G("ngIf","edit"==e.permissionMode),d.R7$(),d.Y8G("ngIf",!e.disabled)}}function O(e,t){1&e&&(d.j41(0,"th",20)(1,"div",21),d.EFF(2),d.nI1(3,"i18n"),d.k0s()()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,1,"permission")," "))}function G(e,t){1&e&&(d.j41(0,"th",22),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.JRh(d.bMT(2,1,"role")))}function U(e,t){1&e&&(d.j41(0,"th",23),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.JRh(d.bMT(2,1,"group")))}function V(e,t){1&e&&(d.j41(0,"span",37),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" ",d.bMT(2,1,"invited")," "))}function j(e,t){if(1&e&&(d.j41(0,"div",38),d.EFF(1),d.k0s()),2&e){const e=d.XpG(2).$implicit;d.R7$(),d.SpI(" ",e.email," ")}}function N(e,t){if(1&e&&(d.j41(0,"div",32),d.nrm(1,"i",33),d.j41(2,"div",34)(3,"div"),d.EFF(4),d.DNE(5,V,3,3,"span",35),d.k0s(),d.DNE(6,j,2,1,"div",36),d.k0s()()),2&e){const e=d.XpG().$implicit;d.R7$(),d.HbH(d.VkB("bwi tw-mr-3 ",e.icon)),d.R7$(3),d.SpI(" ",e.labelName," "),d.R7$(),d.Y8G("ngIf",0==e.status),d.R7$(),d.Y8G("ngIf",0!=e.status&&e.labelName!=e.email)}}function z(e,t){if(1&e&&(d.j41(0,"div",32),d.nrm(1,"i",39),d.j41(2,"span"),d.EFF(3),d.k0s()()),2&e){const e=d.XpG().$implicit,t=d.XpG(2);d.R7$(),d.Y8G("ngClass",e.icon||t.itemIcon(e)),d.R7$(2),d.JRh(e.labelName)}}function Y(e,t){if(1&e&&(d.nrm(0,"bit-option",16),d.nI1(1,"i18n")),2&e){const e=t.$implicit;d.Y8G("value",e.perm)("label",d.bMT(1,2,e.labelId))}}function L(e,t){if(1&e){const e=d.RV6();d.qex(0),d.j41(1,"bit-form-field")(2,"bit-select",41),d.nI1(3,"i18n"),d.bIt("closed",function(){n.eBV(e);const t=d.XpG(4);return n.Njj(t.handleBlur())}),d.DNE(4,Y,2,4,"bit-option",15),d.k0s()(),d.bVm()}if(2&e){const e=d.XpG(2),t=e.$implicit,i=e.index,n=d.XpG(2);d.R7$(2),d.Y8G("appA11yTitle",d.ai1("",t.labelName," ",d.bMT(3,5,"permission")))("id","permission"+i),d.R7$(2),d.Y8G("ngForOf",n.permissionList)}}function K(e,t){if(1&e&&(d.j41(0,"div",43),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e){const e=d.XpG(3).$implicit,t=d.XpG(2);d.Y8G("title",d.bMT(1,2,t.permissionLabelId(e.readonlyPermission))),d.R7$(2),d.SpI(" ",d.bMT(3,4,t.permissionLabelId(e.readonlyPermission))," ")}}function X(e,t){if(1&e&&d.DNE(0,K,4,6,"div",42),2&e){const e=d.XpG(2).$implicit,t=d.XpG(2);d.Y8G("ngIf",e.readonly||t.disabled)}}function q(e,t){if(1&e&&(d.j41(0,"td",4),d.DNE(1,L,5,7,"ng-container",40)(2,X,1,1,"ng-template",null,0,d.C5r),d.k0s()),2&e){const e=d.sdS(3),t=d.XpG().$implicit,i=d.XpG(2);d.R7$(),d.Y8G("ngIf",i.canEditItemPermission(t))("ngIfElse",e)}}function H(e,t){if(1&e&&(d.j41(0,"td",4),d.EFF(1),d.nI1(2,"userType"),d.k0s()),2&e){const e=d.XpG().$implicit;d.R7$(),d.SpI(" ",d.i5U(2,1,e.role,"-")," ")}}function W(e,t){var i;if(1&e&&(d.j41(0,"td",4),d.EFF(1),d.k0s()),2&e){const e=d.XpG().$implicit;d.R7$(),d.SpI(" ",null!==(i=e.viaGroupName)&&void 0!==i?i:"-"," ")}}function $(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",44),d.nI1(1,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG().$implicit,i=d.XpG(2);return i.selectionList.deselectItem(t.id),n.Njj(i.handleBlur())}),d.k0s()}if(2&e){const e=d.XpG().$implicit,t=d.XpG(2);d.Y8G("label",d.ai1("",d.bMT(1,4,"remove")," ",e.labelName))("disabled",t.disabled)}}function J(e,t){if(1&e&&(d.j41(0,"tr",25)(1,"td",26),d.DNE(2,N,7,6,"div",27)(3,z,4,2,"div",28),d.k0s(),d.DNE(4,q,4,2,"td",29)(5,H,3,4,"td",29)(6,W,2,1,"td",29),d.j41(7,"td",30),d.DNE(8,$,2,6,"button",31),d.k0s()()),2&e){const e=t.$implicit,i=t.index,n=d.XpG(2);d.Y8G("formGroupName",i)("ngClass",d.eq3(8,F,e.readonly)),d.R7$(),d.Y8G("ngSwitch",e.type),d.R7$(),d.Y8G("ngSwitchCase",n.itemType.Member),d.R7$(2),d.Y8G("ngIf","hidden"!=n.permissionMode),d.R7$(),d.Y8G("ngIf",n.showMemberRoles),d.R7$(),d.Y8G("ngIf",n.showGroupColumn),d.R7$(2),d.Y8G("ngIf",!n.disabled&&!e.readonly)}}function Z(e,t){if(1&e&&(d.j41(0,"tr")(1,"td",4),d.EFF(2),d.k0s()()),2&e){const e=d.XpG(2);d.R7$(2),d.JRh(e.emptySelectionText)}}function _(e,t){if(1&e&&d.DNE(0,J,9,10,"tr",24)(1,Z,3,1,"tr",19),2&e){const e=d.XpG();d.Y8G("ngForOf",e.selectionList.selectedItems),d.R7$(),d.Y8G("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()}constructor(e,t){this.formBuilder=e,this.i18nService=t,this.destroy$=new s.B,this.updateRowControlDisableState=(e,t)=>{t.readonly?e.disable():(e.enable(),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 r.MJ(e.id),type:new r.MJ(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.Uv,this._permissionMode=ee.Hidden,this.hideMultiSelect=!1,this.initialPermission=c.aF.View}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 k(this,void 0,void 0,function*(){this.permissionList=(0,c.M3)(),this.selectionList.formArray.valueChanges.pipe((0,o.Q)(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.Uv.Collection:return"bwi-collection-shared";case c.Uv.Group:return"bwi-users";case c.Uv.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}canEditItemPermission(e){return this.permissionMode==ee.Edit&&!e.readonly}_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)(d.rXU(r.ok),d.rXU(u.W))},te.ɵcmp=d.VBU({type:te,selectors:[["bit-access-selector"]],inputs:{items:"items",permissionMode:"permissionMode",columnHeader:"columnHeader",selectorLabelText:"selectorLabelText",selectorHelpText:"selectorHelpText",emptySelectionText:"emptySelectionText",showMemberRoles:"showMemberRoles",showGroupColumn:"showGroupColumn",hideMultiSelect:"hideMultiSelect",initialPermission:"initialPermission"},standalone:!1,features:[d.Jv_([{provide:r.kq,useExisting:(0,n.Rfq)(()=>te),multi:!0}])],decls:11,vars:6,consts:[["readOnlyPerm",""],["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 tw-basis-2/5",4,"ngIf"],["class","tw-grow tw-p-3",4,"ngIf"],[1,"tw-mr-3","tw-shrink-0","tw-basis-2/5"],["bitInput","",3,"ngModelChange","closed","disabled","ngModel","ngModelOptions"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],[1,"tw-grow","tw-p-3"],[1,"tw-w-full",3,"onItemsConfirmed","blur","baseItems","removeSelectedItems","disabled"],[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","",1,"tw-w-5/12",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","primaryGhost",3,"label","disabled","click",4,"ngIf"],[1,"tw-flex","tw-items-center"],["aria-hidden","true"],[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"],["bitInput","","formControlName","permission",3,"closed","appA11yTitle","id"],["class","tw-max-w-40 tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap tw-font-medium tw-text-muted",3,"title",4,"ngIf"],[1,"tw-max-w-40","tw-overflow-hidden","tw-overflow-ellipsis","tw-whitespace-nowrap","tw-font-medium","tw-text-muted",3,"title"],["type","button","bitIconButton","bwi-close","buttonType","primaryGhost",3,"click","label","disabled"]],template:function(e,t){1&e&&(d.DNE(0,x,3,2,"div",1),d.j41(1,"bit-table",2),d.qex(2,3),d.j41(3,"tr")(4,"th",4),d.EFF(5),d.k0s(),d.DNE(6,O,4,3,"th",5)(7,G,3,3,"th",6)(8,U,3,3,"th",7),d.nrm(9,"th",8),d.k0s(),d.bVm(),d.DNE(10,_,2,2,"ng-template",9),d.k0s()),2&e&&(d.Y8G("ngIf",!t.hideMultiSelect),d.R7$(),d.Y8G("formGroup",t.formGroup),d.R7$(4),d.JRh(t.columnHeader),d.R7$(),d.Y8G("ngIf","hidden"!=t.permissionMode),d.R7$(),d.Y8G("ngIf",t.showMemberRoles),d.R7$(),d.Y8G("ngIf",t.showGroupColumn))},dependencies:[h.YU,h.Sq,h.bT,h.ux,h.e1,h.fG,r.BC,r.cb,r.vS,r.j4,r.JD,r.$R,r.v8,A.C,p.n,g.j,v.I,f.b,m.h,y.s,C.w,w.P,I.Q,b.Y,B._,B.O,E.$,Q],encapsulation:2})},43215(e,t,i){"use strict";i.d(t,{Pi:()=>En,F3:()=>ge,Uz:()=>pe,AM:()=>N});var n=i(77468),r=i(94735),s=i(55542),o=i(81525),a=i(81573),l=i(47659),c=i(29029),d=i(33812),u=i(66316),h=i(7730),A=i(68016),p=i(67311),g=i(38410),v=i(22466),f=i(36572),m=i(56898),y=i(25740);function C(e,t){if(1&e&&(d.j41(0,"tr",9)(1,"td",4),d.EFF(2),d.k0s(),d.j41(3,"td",4),d.EFF(4),d.k0s()()),2&e){const e=t.$implicit;d.R7$(2),d.JRh(e.type),d.R7$(2),d.JRh(e.message)}}function w(e,t){if(1&e&&(d.DNE(0,C,5,2,"tr",8),d.nI1(1,"async")),2&e){const e=t.$implicit;d.Y8G("ngForOf",d.bMT(1,1,e))}}class I{constructor(e,t){this.dialogRef=e,this.data=t,this.dataSource=new s.s}ngOnInit(){const e=this.data.message.split("\n\n");if(1==e.length)return void(this.dataSource.data=[{type:"",message:this.data.message}]);const t=[];e.forEach(e=>{t.push({type:"",message:e})}),this.dataSource.data=t}}I.ɵfac=function(e){return new(e||I)(d.rXU(u.ce),d.rXU(o.Qs))},I.ɵcmp=d.VBU({type:I,selectors:[["ng-component"]],decls:22,vars:16,consts:[["bitDialogTitle",""],["bitDialogContent",""],[3,"dataSource"],["header",""],["bitCell",""],["body",""],["bitDialogFooter",""],["bitButton","","bitDialogClose","","buttonType","primary","type","button"],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""]],template:function(e,t){1&e&&(d.j41(0,"bit-dialog")(1,"span",0),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"span",1)(5,"div"),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.j41(8,"bit-table",2),d.qex(9,3),d.j41(10,"tr")(11,"th",4),d.EFF(12),d.nI1(13,"i18n"),d.k0s(),d.j41(14,"th",4),d.EFF(15),d.nI1(16,"i18n"),d.k0s()(),d.bVm(),d.DNE(17,w,2,3,"ng-template",5),d.k0s()(),d.qex(18,6),d.j41(19,"button",7),d.EFF(20),d.nI1(21,"i18n"),d.k0s(),d.bVm(),d.k0s()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,6,"importError")," "),d.R7$(4),d.JRh(d.bMT(7,8,"resolveTheErrorsBelowAndTryAgain")),d.R7$(2),d.Y8G("dataSource",t.dataSource),d.R7$(4),d.JRh(d.bMT(13,10,"name")),d.R7$(3),d.JRh(d.bMT(16,12,"description")),d.R7$(5),d.SpI(" ",d.bMT(21,14,"ok")," "))},dependencies:[n.MD,n.Sq,r.p,a.P,h.I,A.m,p.hJ,l.b,g.Q,v.Y,f._,f.O,c.t,m.Q,n.Jj,y.$],encapsulation:2});var b=i(31442);function B(e,t){if(1&e&&(d.j41(0,"tr",9)(1,"td",4),d.nrm(2,"i",10),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"td",4),d.EFF(6),d.k0s()()),2&e){const e=t.$implicit;d.R7$(2),d.HbH(d.VkB("bwi bwi-fw bwi-",e.icon)),d.R7$(),d.SpI(" ",d.bMT(4,5,e.type)," "),d.R7$(3),d.JRh(e.count)}}function E(e,t){if(1&e&&(d.DNE(0,B,7,7,"tr",8),d.nI1(1,"async")),2&e){const e=t.$implicit;d.Y8G("ngForOf",d.bMT(1,1,e))}}class S{constructor(e,t){this.dialogRef=e,this.data=t,this.dataSource=new s.s}ngOnInit(){null!=this.data&&(this.dataSource.data=this.buildResultList())}buildResultList(){let e=0,t=0,i=0,n=0,r=0;this.data.ciphers.map(s=>{switch(s.type){case b.gC.Login:e++;break;case b.gC.Card:t++;break;case b.gC.SecureNote:n++;break;case b.gC.Identity:i++;break;case b.gC.SshKey:r++}});const s=[];return e>0&&s.push({icon:"globe",type:"typeLogin",count:e}),t>0&&s.push({icon:"credit-card",type:"typeCard",count:t}),i>0&&s.push({icon:"id-card",type:"typeIdentity",count:i}),n>0&&s.push({icon:"sticky-note",type:"typeSecureNote",count:n}),r>0&&s.push({icon:"key",type:"typeSshKey",count:r}),this.data.folders.length>0&&s.push({icon:"folder",type:"folders",count:this.data.folders.length}),this.data.collections.length>0&&s.push({icon:"collection",type:"collections",count:this.data.collections.length}),s}}S.ɵfac=function(e){return new(e||S)(d.rXU(u.ce),d.rXU(o.Qs))},S.ɵcmp=d.VBU({type:S,selectors:[["ng-component"]],decls:22,vars:17,consts:[["bitDialogTitle",""],["bitDialogContent",""],[3,"dataSource"],["header",""],["bitCell",""],["body",""],["bitDialogFooter",""],["bitButton","","bitDialogClose","","buttonType","primary","type","button"],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["aria-hidden","true"]],template:function(e,t){1&e&&(d.j41(0,"bit-dialog")(1,"span",0),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"div",1)(5,"span"),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.j41(8,"bit-table",2),d.qex(9,3),d.j41(10,"tr")(11,"th",4),d.EFF(12),d.nI1(13,"i18n"),d.k0s(),d.j41(14,"th",4),d.EFF(15),d.nI1(16,"i18n"),d.k0s()(),d.bVm(),d.DNE(17,E,2,3,"ng-template",5),d.k0s()(),d.qex(18,6),d.j41(19,"button",7),d.EFF(20),d.nI1(21,"i18n"),d.k0s(),d.bVm(),d.k0s()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,6,"importSuccess")," "),d.R7$(4),d.JRh(d.i5U(7,8,"importSuccessNumberOfItems",t.data.ciphers.length)),d.R7$(2),d.Y8G("dataSource",t.dataSource),d.R7$(4),d.JRh(d.bMT(13,11,"type")),d.R7$(3),d.JRh(d.bMT(16,13,"total")),d.R7$(5),d.SpI(" ",d.bMT(21,15,"ok")," "))},dependencies:[n.MD,n.Sq,r.p,a.P,h.I,A.m,p.hJ,l.b,g.Q,v.Y,f._,f.O,c.t,m.Q,n.Jj,y.$],encapsulation:2});var Q=i(51757),k=i(26411),T=i(37579),F=i(22191),P=i(49519),R=i(57083),D=i(86226),M=i(97553),x=i(43759),O=i(76356),G=i(69896),U=i(38620),V=i(36288);class j{constructor(e,t){this.dialogRef=e,this.formBuilder=t,this.formGroup=this.formBuilder.group({filePassword:["",Q.k0.required]}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.filePassword)}}}j.ɵfac=function(e){return new(e||j)(d.rXU(u.ce),d.rXU(Q.ok))},j.ɵcmp=d.VBU({type:j,selectors:[["ng-component"]],decls:22,vars:17,consts:[["bit-dialog","",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-6"],["bitInput","","type","password","formControlName","filePassword","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"span",1),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"div",2),d.EFF(5),d.nI1(6,"i18n"),d.j41(7,"bit-form-field",3)(8,"bit-label"),d.EFF(9),d.nI1(10,"i18n"),d.k0s(),d.nrm(11,"input",4)(12,"button",5),d.k0s()(),d.qex(13,6),d.j41(14,"button",7)(15,"span"),d.EFF(16),d.nI1(17,"i18n"),d.k0s()(),d.j41(18,"button",8)(19,"span"),d.EFF(20),d.nI1(21,"i18n"),d.k0s()(),d.bVm(),d.k0s()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(2),d.SpI(" ",d.bMT(3,7,"confirmVaultImport")," "),d.R7$(3),d.SpI(" ",d.bMT(6,9,"confirmVaultImportDesc")," "),d.R7$(4),d.JRh(d.bMT(10,11,"confirmFilePassword")),d.R7$(7),d.JRh(d.bMT(17,13,"importVerb")),d.R7$(4),d.JRh(d.bMT(21,15,"cancel")))},dependencies:[n.MD,r.p,P.B,R.q,a.P,h.I,A.m,p.hJ,k.L,D.j,M.J,x.h,O.e,G.a,T.C,U.L,c.t,m.Q,F.Q,V.s,Q.X1,Q.qT,Q.me,Q.BC,Q.cb,Q.j4,Q.JD,y.$],encapsulation:2});class N{constructor(e,t){this.dialogRef=e,this.formBuilder=t,this.formGroup=this.formBuilder.group({sshKeyPassword:["",Q.k0.required]}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.sshKeyPassword)}}}N.ɵfac=function(e){return new(e||N)(d.rXU(u.ce),d.rXU(Q.ok))},N.ɵcmp=d.VBU({type:N,selectors:[["ng-component"]],decls:23,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-6"],["bitInput","","type","password","formControlName","sshKeyPassword","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2),d.EFF(6),d.nI1(7,"i18n"),d.j41(8,"bit-form-field",3)(9,"bit-label"),d.EFF(10),d.nI1(11,"i18n"),d.k0s(),d.nrm(12,"input",4)(13,"button",5),d.k0s()(),d.qex(14,6),d.j41(15,"button",7)(16,"span"),d.EFF(17),d.nI1(18,"i18n"),d.k0s()(),d.j41(19,"button",8)(20,"span"),d.EFF(21),d.nI1(22,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,7,"enterSshKeyPassword")," "),d.R7$(3),d.SpI(" ",d.bMT(7,9,"enterSshKeyPasswordDesc")," "),d.R7$(4),d.JRh(d.bMT(11,11,"confirmSshKeyPassword")),d.R7$(7),d.JRh(d.bMT(18,13,"importSshKey")),d.R7$(4),d.JRh(d.bMT(22,15,"cancel")))},dependencies:[n.MD,r.p,P.B,R.q,a.P,h.I,A.m,p.hJ,k.L,D.j,M.J,x.h,O.e,G.a,T.C,U.L,c.t,m.Q,F.Q,V.s,Q.X1,Q.qT,Q.me,Q.BC,Q.cb,Q.j4,Q.JD,y.$],encapsulation:2});var z=i(23965),Y=i(21495),L=i(12012),K=i(18499),X=i(35500),q=i(8943),H=i(89105),W=i(1601),$=i(50700),J=i(56962),Z=i(37115),_=i(97445),ee=i(43946),te=i(43348),ie=i(25304),ne=i(48856),re=i(8936);var se=i(63344),oe=i(20136);var ae=i(5556),le=i(74526),ce=i(66983),de=i(8916),ue=i(21879),he=i(36801),Ae=i(68052);const pe=new he.aZ("SystemServices"),ge=[(0,Y.F)({provide:Ae.RI,useClass:Ae.Bd,deps:[L.G]}),(0,Y.F)({provide:ee.p,useClass:_.p,deps:[H.N,de.Lu]}),(0,Y.F)({provide:te.F,useFactory:()=>function(){const e=new ne.T(ie.iP,ie.xN);for(const t of Reflect.ownKeys(ie.YY))e.registerSite(ie.YY[t]);for(const t of re.G)e.registerVendor(t);for(const t of re.B)e.registerExtension(t);return e}(),deps:[]}),(0,Y.F)({provide:pe,useFactory:function(e,t,i,n,r,s,o){let a;return a=s.isDev()?(0,oe.oR)(r,[]):oe.S2,{policy:i,extension:new se.r(n,{encryptor:e,state:t,log:a,now:Date.now}),log:a,configService:o,environment:s}},deps:[ee.p,ue.v2,K.m,te.F,J.K,Z.y,W.w]}),(0,Y.F)({provide:Ae.Tt,useClass:Ae.XM,deps:[ae.p,le.k,Ae.RI,$.W,z.YD,de.Lu,H.N,q.$9,X.D,ce.b]})];var ve=i(83731),fe=i(74794),me=i(66046),ye=i(16878),Ce=i(72245),we=i(33338),Ie=i(88565),be=i(44500),Be=i(14803),Ee=i(3204),Se=i(80909),Qe=i(69194),ke=i(67553),Te=i(43978),Fe=i(52237),Pe=i(3633),Re=i(51151),De=i(15639),Me=i(78781),xe=i(5076),Oe=i(39488),Ge=i(8433),Ue=i(80351),Ve=i(8297),je=i(14318),Ne=i(58950),ze=i(88832),Ye=i(26477),Le=i(83586),Ke=i(94573),Xe=i(33277),qe=i(98869),He=i(75583),We=i(47135),$e=i(33886),Je=i(68923),Ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function _e(e,t){if(1&e&&d.nrm(0,"bit-option",3),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}class et{constructor(e,t,i,n){this.formBuilder=e,this.controlContainer=t,this.logService=i,this.i18nService=n,this.formGroup=this.formBuilder.group({profile:["",{nonNullable:!0,validators:[Q.k0.required],asyncValidators:[this.validateAndEmitData()],updateOn:"submit"}]}),this.profileList=[],this.format=Ke.hFB.required(),this.csvDataLoaded=new d.bkB,(0,Xe.QZ)(()=>Ze(this,void 0,void 0,function*(){this.profileList=yield this.onLoadProfilesFromBrowser(this.getBrowserName(this.format()))}))}ngOnInit(){return Ze(this,void 0,void 0,function*(){this._parentFormGroup=this.controlContainer.control,this._parentFormGroup.addControl("chromeOptions",this.formGroup)})}ngOnDestroy(){this._parentFormGroup.removeControl("chromeOptions")}validateAndEmitData(){return()=>Ze(this,void 0,void 0,function*(){try{const e=yield this.onImportFromBrowser(this.getBrowserName(this.format()),this.formGroup.controls.profile.value);if(e.some(e=>null!=e.failure)){const t=e.find(e=>null!=e.failure);return this.logService.error("Chromium importer failure:",t.failure.error),{errors:{message:this.i18nService.t("errorOccurred")}}}if(0===e.length)return{errors:{message:this.i18nService.t("importNothingError")}};const t=[];for(const n of e)null!=n.login&&t.push(new tt(n.login));const i=qe.unparse(t);return this.csvDataLoaded.emit(i),null}catch(e){return this.logService.error(`Chromium importer error: ${e}`),{errors:{message:this.i18nService.t(this.getValidationErrorI18nKey(e))}}}})}getValidationErrorI18nKey(e){"string"==typeof e||null==e||e.message;return"errorOccurred"}getBrowserName(e){return"edgecsv"===e?"Microsoft Edge":"operacsv"===e?"Opera":"bravecsv"===e?"Brave":"vivaldicsv"===e?"Vivaldi":"arccsv"===e?"Arc":"Chrome"}}et.ɵfac=function(e){return new(e||et)(d.rXU(Q.ok),d.rXU(Q.ZU),d.rXU(J.K),d.rXU($.W))},et.ɵcmp=d.VBU({type:et,selectors:[["import-chrome"]],inputs:{format:[1,"format"],onLoadProfilesFromBrowser:"onLoadProfilesFromBrowser",onImportFromBrowser:"onImportFromBrowser"},outputs:{csvDataLoaded:"csvDataLoaded"},decls:7,vars:5,consts:[[3,"formGroup"],["formControlName","profile"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"]],template:function(e,t){1&e&&(d.j41(0,"div",0)(1,"bit-form-field")(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"bit-select",1),d.DNE(6,_e,1,2,"bit-option",2),d.k0s()()()),2&e&&(d.Y8G("formGroup",t.formGroup),d.R7$(3),d.JRh(d.bMT(4,3,"browserProfile")),d.R7$(3),d.Y8G("ngForOf",t.profileList))},dependencies:[n.MD,n.Sq,r.p,Ue.j,He.E,k.L,D.j,x.h,Q.X1,Q.BC,Q.cb,Q.j4,Q.JD,F.Q,We.q,Ge.p,$e.w,Je.P,y.$],encapsulation:2});class tt{constructor(e){const t=Me.A.getUrl(null==e?void 0:e.url);null!=t&&(this.name=new URL(t).hostname),null==this.name&&(this.name=e.url),this.url=e.url,this.username=e.username,this.password=e.password,this.note=e.note}}var it=i(44280),nt=i(29377),rt=i(71373),st=i(90107);class ot{}class at{}const lt=Object.freeze({Azure:0,OktaAuthServer:1,OktaNoAuthServer:2,Google:3,PingOne:4,OneLogin:5}),ct=Object.freeze({MasterPassword:0,Federated:3}),dt=Object.freeze({GoogleAuth:0,MicrosoftAuth:1,Yubikey:2}),ut=Object.freeze({Desktop:0,Mobile:1});class ht{static createClientInfo(e,t){return{platform:ut.Desktop,id:e,description:"Importer",loginType:t}}}class At{constructor(e){this.url=e.url,this.username=e.username,this.password=e.password,this.totp=e.totp,this.extra=e.notes,this.name=e.name,this.grouping="(none)"===e.path?null:e.path,this.fav=e.isFavorite?1:0}}class pt{}class gt{constructor(e,t,i){this.waitForOutOfBand=e,this.passcode=t,this.rememberMe=i}waitForApproval(e){return new gt(!0,"",e)}continueWithPasscode(e,t){return new gt(!1,e,t)}}gt.cancel=new gt(!1,"cancel",!1);class vt{constructor(e,t){this.passcode=e,this.rememberMe=t}}vt.cancel=new vt("cancel",!1);class ft{constructor(){this.parseSecureNotesToAccount=!0}}ft.default=new ft;class mt{}class yt{}class Ct{isFederated(){return this.type===ct.Federated&&this.hasValue(this.identityProviderURL)&&this.hasValue(this.openIDConnectAuthority)&&this.hasValue(this.openIDConnectClientId)}get oidcScope(){let e="openid profile email";return this.provider===lt.PingOne&&(e+=" lastpass"),e}get openIDConnectAuthorityBase(){return this.openIDConnectAuthority.replace("/.well-known/openid-configuration","")}hasValue(e){return null!=e&&""!==e.trim()}}var wt=i(12058);class It{constructor(e){this.arr=e,this.position=0;const t=new Uint32Array([287454020]),i=new Uint8Array(t.buffer);this.isLittleEndian=68===i[0]}readBytes(e){if(this.position+e>this.arr.length)throw new Error("End of array reached");const t=this.arr.subarray(this.position,this.position+e);return this.position+=e,t}readUInt16(){const e=this.readBytes(2);return(e[0]|e[1]<<8)>>>0}readUInt32(){const e=this.readBytes(4);return(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0}readUInt16BigEndian(){let e=this.readUInt16();if(this.isLittleEndian){e=(255&e)<<8|e>>8&255}return e}readUInt32BigEndian(){let e=this.readUInt32();if(this.isLittleEndian){e=(255&e)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>24&255}return e}seekFromCurrentPosition(e){const t=this.position+e;if(t<0)throw new Error("Position cannot be negative");if(t>this.arr.length)throw new Error("Array not large enough to seek to this position");this.position=t}atEnd(){return this.position>=this.arr.length-1}}var bt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Bt{constructor(){this.isBrowser=!0}get(e){return bt(this,arguments,void 0,function*(e,t=null,i=null){const n={method:"GET",credentials:"include"};this.setHeaders(n,t,i);const r=new Request(this.baseUrl+"/"+e,n);return yield fetch(r)})}postForm(e){return bt(this,arguments,void 0,function*(e,t=null,i=null,n=null){return yield this.post(e,(e,i)=>{if(null!=t&&t.size>0){const i=new FormData;for(const[e,n]of t)i.set(e,n);e.body=i}},i,n)})}postJson(e,t){return bt(this,arguments,void 0,function*(e,t,i=null,n=null){return yield this.post(e,(e,i)=>{null!=t&&(i.set("Content-Type","application/json; charset=utf-8"),e.body=JSON.stringify(t))},i,n)})}post(e,t){return bt(this,arguments,void 0,function*(e,t,i=null,n=null){const r={method:"POST",credentials:"include"};null==i&&(i=new Map),t(r,i),this.setHeaders(r,i,n);const s=new Request(this.baseUrl+"/"+e,r);return yield fetch(s)})}setHeaders(e,t=null,i=null){const n=new Headers;let r=!1;if(null!=t&&t.size>0){r=!0;for(const[e,i]of t)n.set(e,i)}if(!this.isBrowser&&null!=i&&i.size>0){r=!0;const e=Array.from(i.keys()).map(e=>`${e}=${i.get(e)}`).join("; ");n.set("cookie",e)}r&&(e.headers=n)}}var Et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const St=new Map([[ut.Desktop,"cli"],[ut.Mobile,"android"]]),Qt=new Map([["googleauthrequired",dt.GoogleAuth],["microsoftauthrequired",dt.MicrosoftAuth],["otprequired",dt.Yubikey]]);class kt{constructor(e,t){this.parser=e,this.cryptoUtils=t}openVault(e,t,i,n,r,s){return Et(this,void 0,void 0,function*(){const o=e.toLowerCase(),[a,l]=yield this.login(o,t,i,n,r);try{const e=yield this.downloadVault(a,l),i=yield this.cryptoUtils.deriveKey(o,t,a.keyIterationCount);let r=null,c=null;if(null!=a.encryptedPrivateKey&&""!=a.encryptedPrivateKey){let e=null;if(n.loginType==ct.MasterPassword)e=Me.A.fromHexToArray(a.encryptedPrivateKey),c=i.subarray(0,16);else{if(n.loginType!=ct.Federated)throw new Error("Unsupported LastPass login");{const t=a.encryptedPrivateKey.split("|");if(2!==t.length)throw new Error("Invalid LastPass private key format, no | separator");if(!t[0].startsWith("!"))throw new Error("Invalid LastPass private key format, no ! starting separator");if(c=Me.A.fromB64ToArray(t[0].slice(1)),16!==c.length)throw new Error(`Invalid LastPass private key init vector length (${c.length})`);e=Me.A.fromB64ToArray(t[1])}}r=yield this.parser.parseEncryptedPrivateKey(e,i,c)}return this.parseVault(e,i,r,s)}finally{yield this.logout(a,l)}})}parseVault(e,t,i,n){return Et(this,void 0,void 0,function*(){const r=new It(e),s=this.parser.extractChunks(r);if(!this.isComplete(s))throw new Error("Blob is truncated or corrupted");return yield this.parseAccounts(s,t,i,n)})}parseAccounts(e,t,i,n){return Et(this,void 0,void 0,function*(){const r=new Array;let s=null;for(const o of e)if("ACCT"===o.id){const e=null==s?t:s.encryptionKey,i=yield this.parser.parseAcct(o,e,s,n);null!=i&&r.push(i)}else"SHAR"===o.id&&(s=yield this.parser.parseShar(o,t,i));return r})}isComplete(e){if(e.length>0&&"ENDM"===e[e.length-1].id){return"OK"===Me.A.fromArrayToUtf8(e[e.length-1].payload)}return!1}login(e,t,i,n,r){return Et(this,void 0,void 0,function*(){const s=new Bt;s.baseUrl="https://lastpass.com";let o=100100,a=null,l=null;for(let r=0;r<3;r++){if(a=yield this.performSingleLoginRequest(e,t,i,o,new Map,n,s),l=this.extractSessionFromLoginResponse(a,o,n),null!=l)return[l,s];const r=this.getOptionalErrorAttribute(a,"server");if(null!=r&&""!=r.trim()){s.baseUrl="https://"+r;continue}const c=this.getOptionalErrorAttribute(a,"iterations");if(null==c)break;try{o=parseInt(c)}catch(u){throw"Failed to parse the iteration count, expected an integer value '"+c+"'"}}const c=this.getOptionalErrorAttribute(a,"cause");if(null==c)throw this.makeLoginError(a);const d=Qt.get(c);if(null!=d?l=yield this.loginWithOtp(e,t,i,o,d,n,r,s):"outofbandrequired"===c&&(l=yield this.loginWithOob(e,t,i,o,this.getAllErrorAttributes(a),n,r,s)),null==l)throw this.makeLoginError(a);return[l,s]})}loginWithOtp(e,t,i,n,r,s,o,a){return Et(this,void 0,void 0,function*(){let l=null;switch(r){case dt.GoogleAuth:l=yield o.provideGoogleAuthPasscode();break;case dt.MicrosoftAuth:l=yield o.provideMicrosoftAuthPasscode();break;case dt.Yubikey:l=yield o.provideYubikeyPasscode();break;default:throw new Error("Invalid OTP method")}if(l==vt.cancel)throw new Error("Second factor step is canceled by the user");const c=yield this.performSingleLoginRequest(e,t,i,n,new Map([["otp",l.passcode]]),s,a),d=this.extractSessionFromLoginResponse(c,n,s);if(null==d)throw this.makeLoginError(c);return l.rememberMe&&(yield this.markDeviceAsTrusted(d,s,a)),d})}loginWithOob(e,t,i,n,r,s,o,a){return Et(this,void 0,void 0,function*(){const l=r=>Et(this,void 0,void 0,function*(){const o=yield this.performSingleLoginRequest(e,t,i,n,r,s,a),c=this.extractSessionFromLoginResponse(o,n,s);if(null!=c)return c;if("outofbandrequired"!=this.getOptionalErrorAttribute(o,"cause"))throw this.makeLoginError(o);return r.set("outofbandretry","1"),r.set("outofbandretryid",this.getErrorAttribute(o,"retryid")),l(r)});return yield Promise.race([(()=>{const e=new Map;return e.set("outofbandrequest",1),l(e)})(),(()=>Et(this,void 0,void 0,function*(){const t=yield this.approveOob(e,r,o,a);if(t==gt.cancel)throw new Error("Out of band step is canceled by the user");const i=new Map;i.set("otp",t.passcode);const n=yield l(i);return t.rememberMe&&(yield this.markDeviceAsTrusted(n,s,a)),n}))()]).finally(()=>{o.closeMFADialog()})})}approveOob(e,t,i,n){return Et(this,void 0,void 0,function*(){const r=t.get("outofbandtype");if(null==r)throw new Error("Out of band method is not specified");switch(r){case"lastpassauth":return i.approveLastPassAuth();case"duo":return this.approveDuo(e,t,i,n);case"salesforcehash":return i.approveSalesforceAuth();default:throw new Error("Out of band method "+r+" is not supported")}})}approveDuo(e,t,i,n){return Et(this,void 0,void 0,function*(){return"1"==t.get("preferduowebsdk")?this.approveDuoWebSdk(e,t,i,n):i.approveDuo()})}approveDuoWebSdk(e,t,i,n){return i.approveDuo()}markDeviceAsTrusted(e,t,i){return Et(this,void 0,void 0,function*(){const n=new Map([["uuid",t.id],["trustlabel",t.description],["token",e.token]]),r=yield i.postForm("trust.php",n,null,this.getSessionCookies(e));r.status!=Re.kG.Ok&&this.makeError(r)})}logout(e,t){return Et(this,void 0,void 0,function*(){const i=new Map([["method",St.get(e.platform)],["noredirect",1]]),n=yield t.postForm("logout.php",i,null,this.getSessionCookies(e));n.status!=Re.kG.Ok&&this.makeError(n)})}downloadVault(e,t){return Et(this,void 0,void 0,function*(){const i="getaccts.php?mobile=1&b64=1&hash=0.0&hasplugin=3.0.23&requestsrc="+St.get(e.platform),n=yield t.get(i,null,this.getSessionCookies(e));if(n.status==Re.kG.Ok){const e=yield n.text();return Me.A.fromB64ToArray(e)}this.makeError(n)})}getSessionCookies(e){return new Map([["PHPSESSID",encodeURIComponent(e.id)]])}getErrorAttribute(e,t){const i=this.getOptionalErrorAttribute(e,t);if(null!=i)return i;throw new Error("Unknown response schema: attribute "+t+" is missing")}getOptionalErrorAttribute(e,t){const i=e.querySelector("response > error");if(null==i)return null;const n=i.attributes.getNamedItem(t);return null==n?null:n.value}getAllErrorAttributes(e){const t=e.querySelector("response > error");if(null==t)return null;const i=new Map;for(const n of Array.from(t.attributes))i.set(n.name,n.value);return i}extractSessionFromLoginResponse(e,t,i){const n=e.querySelector("response > ok");if(null==n)return null;const r=n.attributes.getNamedItem("sessionid");if(null==r)return null;const s=n.attributes.getNamedItem("token");if(null==s)return null;const o=new mt;o.id=r.value,o.keyIterationCount=t,o.token=s.value,o.platform=i.platform;const a=n.attributes.getNamedItem("privatekeyenc");return null!=a&&null!=a.value&&""!=a.value.trim()&&(o.encryptedPrivateKey=a.value),o}performSingleLoginRequest(e,t,i,n,r,s,o){return Et(this,void 0,void 0,function*(){const a=yield this.cryptoUtils.deriveKeyHash(e,t,n),l=new Map([["method",St.get(s.platform)],["xml","2"],["username",e],["hash",Me.A.fromArrayToHex(a)],["iterations",n],["includeprivatekeyenc","1"],["outofbandsupported","1"],["uuid",s.id],["trustlabel",s.description]]);null!=i&&(l.set("alpfragmentid",i),l.set("calculatedfragmentid",i));for(const[e,t]of r)l.set(e,t);const c=yield o.postForm("login.php",l);if(c.status==Re.kG.Ok){const e=yield c.text();return(new window.DOMParser).parseFromString(e,"text/xml")}this.makeError(c)})}makeError(e){throw new Error("HTTP request to "+e.url+" failed with status "+e.status+".")}makeLoginError(e){var t;const i=e.querySelector("response > error");if(null==i)return"Unknown response schema";const n=i.attributes.getNamedItem("cause"),r=i.attributes.getNamedItem("message");if(null!=n)switch(n.value){case"unknownemail":return"Invalid username";case"password_invalid":case"unknownpassword":return"Invalid password";case"googleauthfailed":case"microsoftauthfailed":case"otpfailed":return"Second factor code is incorrect";case"multifactorresponsefailed":return"Out of band authentication failed";case"unifiedloginresult":return"unifiedloginresult";default:return null!==(t=null==r?void 0:r.value)&&void 0!==t?t:n.value}return null!=r?r.value:"Unknown error"}}var Tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ft{constructor(e){this.cryptoFunctionService=e}deriveKey(e,t,i){return Tt(this,void 0,void 0,function*(){if(i<0)throw new Error("Iteration count should be positive");return 1==i?yield this.cryptoFunctionService.hash(e+t,"sha256"):yield this.cryptoFunctionService.pbkdf2(t,e,"sha256",i)})}deriveKeyHash(e,t,i){return Tt(this,void 0,void 0,function*(){const n=yield this.deriveKey(e,t,i);return 1==i?yield this.cryptoFunctionService.hash(Me.A.fromArrayToHex(n)+t,"sha256"):yield this.cryptoFunctionService.pbkdf2(n,t,"sha256",1)})}ExclusiveOr(e,t){if(e.length!==t.length)throw new Error("Arrays must be the same length.");const i=new Uint8Array(e.length);for(let n=0;n<e.length;n++)i[n]=e[n]^t[n];return i}decryptAes256PlainWithDefault(e,t,i){return Tt(this,void 0,void 0,function*(){try{return this.decryptAes256Plain(e,t)}catch(n){return i}})}decryptAes256Base64WithDefault(e,t,i){return Tt(this,void 0,void 0,function*(){try{return this.decryptAes256Base64(e,t)}catch(n){return i}})}decryptAes256Plain(e,t){return Tt(this,void 0,void 0,function*(){return 0===e.length?"":33===e[0]&&e.length%16==1&&e.length>32?this.decryptAes256CbcPlain(e,t):this.decryptAes256EcbPlain(e,t)})}decryptAes256Base64(e,t){return Tt(this,void 0,void 0,function*(){return 0===e.length?"":33===e[0]?this.decryptAes256CbcBase64(e,t):this.decryptAes256EcbBase64(e,t)})}decryptAes256(e,t,i){return Tt(this,arguments,void 0,function*(e,t,i,n=new Uint8Array(16)){return 0===e.length?"":"ecb"===i?Me.A.fromArrayToByteString((0,q.mI)(e,t)):Me.A.fromArrayToByteString((0,q.AJ)(e,t,n))})}decryptAes256EcbPlain(e,t){return Tt(this,void 0,void 0,function*(){return this.decryptAes256(e,t,"ecb")})}decryptAes256EcbBase64(e,t){return Tt(this,void 0,void 0,function*(){const i=Me.A.fromB64ToArray(Me.A.fromArrayToUtf8(e));return this.decryptAes256(i,t,"ecb")})}decryptAes256CbcPlain(e,t){return Tt(this,void 0,void 0,function*(){const i=e.subarray(17),n=e.subarray(1,17);return this.decryptAes256(i,t,"cbc",n)})}decryptAes256CbcBase64(e,t){return Tt(this,void 0,void 0,function*(){const i=Me.A.fromB64ToArray(Me.A.fromArrayToUtf8(e.subarray(26))),n=Me.A.fromB64ToArray(Me.A.fromArrayToUtf8(e.subarray(1,25)));return this.decryptAes256(i,t,"cbc",n)})}}var Pt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Rt=new Set(["Server","Email Account","Database","Instant Messenger"]);class Dt{constructor(e,t){this.cryptoFunctionService=e,this.cryptoUtils=t}parseAcct(e,t,i,n){return Pt(this,void 0,void 0,function*(){let r,s=0;try{const o="decryption failed",a=new It(e.payload);r=Me.A.fromArrayToUtf8(this.readItem(a)),s=1;const l=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=2;const c=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=3;const d=this.readItem(a);let u=d.length>0&&33===d[0]?yield this.cryptoUtils.decryptAes256PlainWithDefault(d,t,o):Me.A.fromArrayToUtf8(this.decodeHexLoose(Me.A.fromArrayToUtf8(d)));if("http://group"==u)return null;s=4;const h=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=5;const A="1"===Me.A.fromArrayToUtf8(this.readItem(a));this.skipItem(a),s=7;let p=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=8;let g=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);this.skipItem(a),this.skipItem(a),s=11;const v="1"===Me.A.fromArrayToUtf8(this.readItem(a));if(n.parseSecureNotesToAccount&&v){let e="";for(const t of h.split("\n")){const i=t.split(":",2);if(!(i.length<2))switch(i[0]){case"NoteType":e=i[1];break;case"Hostname":u=i[1];break;case"Username":p=i[1];break;case"Password":g=i[1]}}if(!Rt.has(e))return null}this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),s=39;const f=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=42;const m=this.makeAccountPath(c,i),y=new ot;return y.id=r,y.name=l,y.username=p,y.password=g,y.url=u,y.path=m,y.notes=h,y.totp=f,y.isFavorite=A,y.isShared=null!=i,y}catch(o){throw new Error("Error parsing accounts on item with ID:"+r+" step #"+s+" errorMessage: "+o.message)}})}parseShar(e,t,i){return Pt(this,void 0,void 0,function*(){let t;try{const n=new It(e.payload);t=Me.A.fromArrayToUtf8(this.readItem(n));const r=this.readItem(n),s=Me.A.fromHexToArray(Me.A.fromArrayToUtf8(r)),o=yield this.cryptoFunctionService.rsaDecrypt(s,i,"sha1"),a=Me.A.fromHexToArray(Me.A.fromArrayToUtf8(o)),l=this.readItem(n),c=yield this.cryptoUtils.decryptAes256Base64(l,a),d=new yt;return d.id=t,d.name=c,d.encryptionKey=a,d}catch(n){throw new Error("Error parsing shared folder with ID:"+t+" errorMessage: "+n.message)}})}parseEncryptedPrivateKey(e,t,i){return Pt(this,void 0,void 0,function*(){const n=yield this.cryptoUtils.decryptAes256(e,t,"cbc",i),r="LastPassPrivateKey<",s=">LastPassPrivateKey";if(!n.startsWith(r)||!n.endsWith(s))throw new Error("Failed to decrypt private key");const o=n.substring(19,n.length-19);return Me.A.fromHexToArray(o)})}makeAccountPath(e,t){const i=null==e||""===e.trim();return null==t?i?"(none)":e:i?t.name:t.name+"\\"+e}extractChunks(e){const t=new Array;for(;!e.atEnd();){const i=this.readChunk(e);t.push(i)}return t}readChunk(e){const t=new at;return t.id=this.readId(e),t.payload=this.readPayload(e,this.readSize(e)),t}readItem(e){return this.readPayload(e,this.readSize(e))}skipItem(e){e.seekFromCurrentPosition(this.readSize(e))}readId(e){return Me.A.fromArrayToUtf8(e.readBytes(4))}readSize(e){return e.readUInt32BigEndian()}readPayload(e,t){return e.readBytes(t)}decodeHexLoose(e){return Me.A.fromHexToArray(e.length%2==0?e:"0"+e)}}var Mt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class xt{constructor(e){this.cryptoFunctionService=e,this.cryptoUtils=new Ft(e);const t=new Dt(e,this.cryptoUtils);this.client=new kt(t,this.cryptoUtils)}open(e,t,i,n){return Mt(this,arguments,void 0,function*(e,t,i,n,r=ft.default){this.accounts=yield this.client.openVault(e,t,null,i,n,r)})}openFederated(e,t,i){return Mt(this,arguments,void 0,function*(e,t,i,n=ft.default){if(null==e)throw new Error("Federated user context is not set.");const r=yield this.getK1(e),[s,o]=yield this.getK2FragmentId(e),a=yield this.cryptoFunctionService.hash(this.cryptoUtils.ExclusiveOr(r,s),"sha256"),l=Me.A.fromBufferToB64(a);this.accounts=yield this.client.openVault(e.username,l,o,t,i,n)})}setUserTypeContext(e){return Mt(this,void 0,void 0,function*(){const t=e.toLowerCase(),i=new Bt;i.baseUrl="https://lastpass.com";const n="lmiapi/login/type?username="+encodeURIComponent(t),r=yield i.get(n);if(r.status===Re.kG.Ok){const e=yield r.json();if(this.userType=new Ct,this.userType.companyId=e.CompanyId,this.userType.identityProviderGUID=e.IdentityProviderGUID,this.userType.identityProviderURL=e.IdentityProviderURL,this.userType.isPasswordlessEnabled=e.IsPasswordlessEnabled,this.userType.openIDConnectAuthority=e.OpenIDConnectAuthority,this.userType.openIDConnectClientId=e.OpenIDConnectClientId,this.userType.pkceEnabled=e.PkceEnabled,this.userType.provider=e.Provider,this.userType.type=e.type,this.userType.provider===lt.Azure){const e=this.userType.openIDConnectAuthority.indexOf("?app");e>-1&&(this.userType.openIDConnectAuthority=this.userType.openIDConnectAuthority.substring(0,e))}return}throw new Error("Cannot determine LastPass user type.")})}accountsToExportedCsvString(e=!1){if(null==this.accounts)throw new Error("Vault has not opened any accounts.");const t=this.accounts.filter(t=>!t.isShared||t.isShared&&!e).map(e=>new At(e));if(0===t.length)throw new Error("No accounts to transform");return qe.unparse(t)}getK1(e){return Mt(this,void 0,void 0,function*(){var t;if(null==this.userType)throw new Error("User type is not set.");if(!this.userType.isFederated())throw new Error("Cannot get k1 for LastPass user that is not federated.");if(null==e)throw new Error("Federated user is not set.");let i=null;if(null!=(null===(t=e.idpUserInfo)||void 0===t?void 0:t.LastPassK1))return Me.A.fromByteStringToArray(e.idpUserInfo.LastPassK1);if(this.userType.provider===lt.Azure)i=yield this.getK1Azure(e);else if(this.userType.provider===lt.Google)i=yield this.getK1Google(e);else{const t=this.userType.provider===lt.PingOne;i=yield this.getK1FromAccessToken(e,t)}if(null!=i)return i;throw new Error("Cannot get k1.")})}getK1Azure(e){return Mt(this,void 0,void 0,function*(){const t=new Bt;t.baseUrl="https://graph.microsoft.com";const i=yield t.get("v1.0/me?$select=id,displayName,mail&$expand=extensions",new Map([["Authorization","Bearer "+e.accessToken]]));if(i.status===Re.kG.Ok){const e=yield i.json();if(null!=(null==e?void 0:e.extensions)&&e.extensions.length>0){const t=e.extensions[0].LastPassK1;if(null!=t)return Me.A.fromB64ToArray(t)}}return null})}getK1Google(e){return Mt(this,void 0,void 0,function*(){const t=new Map([["Authorization","Bearer "+e.accessToken]]),i=new Bt;i.baseUrl="https://content.googleapis.com";const n=yield i.get("drive/v3/files?pageSize=1&q=name%20%3D%20%27k1.lp%27&spaces=appDataFolder&fields=nextPageToken%2C%20files(id%2C%20name)",t);if(n.status===Re.kG.Ok){const e=yield n.json(),r=null==e?void 0:e.files;if(null!=r&&r.length>0&&null!=r[0].id&&"k1.lp"===r[0].name){i.baseUrl="https://www.googleapis.com";const e=yield i.get("drive/v3/files/"+r[0].id+"?alt=media",t);if(e.status===Re.kG.Ok){const t=yield e.text();return Me.A.fromB64ToArray(t)}}}return null})}getK1FromAccessToken(e,t){return Mt(this,void 0,void 0,function*(){const i=(0,wt.iD)(e.accessToken),n=null==i?void 0:i.LastPassK1;return null!=n?t?Me.A.fromB64ToArray(n):Me.A.fromByteStringToArray(n):null})}getK2FragmentId(e){return Mt(this,void 0,void 0,function*(){if(null==this.userType)throw new Error("User type is not set.");if(!this.userType.isFederated())throw new Error("Cannot get k2 for LastPass user that is not federated.");const t=new Bt;t.baseUrl=this.userType.identityProviderURL;const i=yield t.postJson("federatedlogin/api/v1/getkey",{company_id:this.userType.companyId,id_token:e.idToken});if(i.status===Re.kG.Ok){const e=yield i.json(),t=null==e?void 0:e.k2,n=null==e?void 0:e.fragment_id;if(null!=t&&null!=n)return[Me.A.fromB64ToArray(t),n]}throw new Error("Cannot get k2 and/or fragment ID.")})}}var Ot=i(93199),Gt=i(26657);class Ut{constructor(e){this.dialogRef=e,this.formGroup=new Q.gE({password:new Q.MJ("",{validators:Q.k0.required,updateOn:"submit"})}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.controls.password.value)}}static open(e){const t=e.open(Ut);return(0,Ce._)(t.closed)}}Ut.ɵfac=function(e){return new(e||Ut)(d.rXU(u.ce))},Ut.ɵcmp=d.VBU({type:Ut,selectors:[["ng-component"]],decls:24,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"!tw-mb-0"],["bitInput","","type","password","formControlName","password","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","bitDialogClose","","buttonType","secondary","type","button","bitFormButton",""]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2)(6,"bit-form-field",3)(7,"bit-label"),d.EFF(8),d.nI1(9,"i18n"),d.k0s(),d.nrm(10,"input",4)(11,"button",5),d.j41(12,"bit-hint"),d.EFF(13),d.nI1(14,"i18n"),d.k0s()()(),d.qex(15,6),d.j41(16,"button",7)(17,"span"),d.EFF(18),d.nI1(19,"i18n"),d.k0s()(),d.j41(20,"button",8)(21,"span"),d.EFF(22),d.nI1(23,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,7,"lastPassAuthRequired")," "),d.R7$(5),d.JRh(d.bMT(9,9,"lastPassMasterPassword")),d.R7$(5),d.JRh(d.bMT(14,11,"confirmIdentity")),d.R7$(5),d.JRh(d.bMT(19,13,"submit")),d.R7$(4),d.JRh(d.bMT(23,15,"cancel")))},dependencies:[n.MD,r.p,P.B,R.q,Q.X1,Q.qT,Q.me,Q.BC,Q.cb,Q.j4,Q.JD,a.P,h.I,A.m,p.hJ,k.L,D.j,Ot.I,M.J,x.h,O.e,G.a,T.C,Gt.$,U.L,c.t,m.Q,F.Q,V.s,He.E,y.$],encapsulation:2});class Vt{get descriptionI18nKey(){switch(this.variant){case"oob":return"lastPassOOBDesc";case"yubikey":return"lastPassYubikeyDesc";default:return"lastPassMFADesc"}}constructor(e,t){this.dialogRef=e,this.data=t,this.variant=this.data.variant,this.formGroup=new Q.gE({passcode:new Q.MJ("",{validators:Q.k0.required,updateOn:"submit"})}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.passcode)}}static open(e,t){return e.open(Vt,{data:t})}}Vt.ɵfac=function(e){return new(e||Vt)(d.rXU(u.ce),d.rXU(o.Qs))},Vt.ɵcmp=d.VBU({type:Vt,selectors:[["ng-component"]],decls:26,vars:20,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"!tw-mb-0"],["bitInput","","type","text","formControlName","passcode","appAutofocus","","appInputVerbatim",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","bitDialogClose","cancel","buttonType","secondary","type","button","bitFormButton",""]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2)(6,"p"),d.EFF(7),d.nI1(8,"i18n"),d.k0s(),d.j41(9,"bit-form-field",3)(10,"bit-label"),d.EFF(11),d.nI1(12,"i18n"),d.k0s(),d.nrm(13,"input",4),d.j41(14,"bit-hint"),d.EFF(15),d.nI1(16,"i18n"),d.k0s()()(),d.qex(17,5),d.j41(18,"button",6)(19,"span"),d.EFF(20),d.nI1(21,"i18n"),d.k0s()(),d.j41(22,"button",7)(23,"span"),d.EFF(24),d.nI1(25,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,8,"lastPassMFARequired")," "),d.R7$(4),d.JRh(d.bMT(8,10,t.descriptionI18nKey)),d.R7$(4),d.JRh(d.bMT(12,12,"passcode")),d.R7$(4),d.JRh(d.bMT(16,14,"confirmIdentity")),d.R7$(5),d.JRh(d.bMT(21,16,"continue")),d.R7$(4),d.JRh(d.bMT(25,18,"cancel")))},dependencies:[n.MD,r.p,P.B,R.q,Q.X1,Q.qT,Q.me,Q.BC,Q.cb,Q.j4,Q.JD,a.P,h.I,A.m,p.hJ,k.L,D.j,Ot.I,M.J,x.h,T.C,Gt.$,U.L,c.t,m.Q,F.Q,He.E,y.$],encapsulation:2});var jt=i(74208),Nt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class zt{constructor(e){this.dialogService=e}getOTPResult(e){return Nt(this,void 0,void 0,function*(){const t=yield this.openMFADialog(e);return new vt(t,!1)})}getOOBResult(e){return Nt(this,void 0,void 0,function*(){const t=yield this.openMFADialog(e);return new gt(!1,t,!1)})}openMFADialog(e){return this.mfaDialogRef=Vt.open(this.dialogService,{variant:e}),(0,Ce._)(this.mfaDialogRef.closed)}closeMFADialog(){var e;null===(e=this.mfaDialogRef)||void 0===e||e.close()}provideGoogleAuthPasscode(){return Nt(this,void 0,void 0,function*(){return this.getOTPResult("otp")})}provideMicrosoftAuthPasscode(){return Nt(this,void 0,void 0,function*(){return this.getOTPResult("otp")})}provideYubikeyPasscode(){return Nt(this,void 0,void 0,function*(){return this.getOTPResult("yubikey")})}approveLastPassAuth(){return Nt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}approveDuo(){return Nt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}approveSalesforceAuth(){return Nt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}}zt.ɵfac=function(e){return new(e||zt)(jt.KVO(u.o3))},zt.ɵprov=jt.jDH({token:zt,factory:zt.ɵfac,providedIn:"root"});var Yt=i(45872),Lt=i(91059),Kt=i(52396),Xt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qt{constructor(e,t,i,n,r,s,o,a,l,c,d){this.cryptoFunctionService=e,this.environmentService=t,this.appIdService=i,this.lastPassDirectImportUIService=n,this.platformUtilsService=r,this.passwordGenerationService=s,this.broadcasterService=o,this.ngZone=a,this.dialogService=l,this.i18nService=c,this.logService=d,this._ssoImportCallback$=new me.B,this.ssoImportCallback$=this._ssoImportCallback$.asObservable(),this.vault=new xt(this.cryptoFunctionService),this.broadcasterService.subscribe("LastPassDirectImportService",e=>{this.ngZone.run(()=>Xt(this,void 0,void 0,function*(){if("importCallbackLastPass"===e.command)this._ssoImportCallback$.next({oidcCode:e.code,oidcState:e.state})}))})}handleImport(e,t){return Xt(this,void 0,void 0,function*(){if(yield this.verifyLastPassAccountExists(e),this.isAccountFederated){const i=yield this.handleFederatedLogin(e);return yield this.handleFederatedImport(i.oidcCode,i.oidcState,t)}const i=yield Ut.open(this.dialogService);return yield this.handleStandardImport(e,i,t)})}get isAccountFederated(){return this.vault.userType.isFederated()}verifyLastPassAccountExists(e){return Xt(this,void 0,void 0,function*(){yield this.vault.setUserTypeContext(e)})}handleFederatedLogin(e){return Xt(this,void 0,void 0,function*(){const t=(0,Ce._)(this.ssoImportCallback$),i=yield this.createOidcSigninRequest(e);this.platformUtilsService.launchUri(i.url);const n=this.dialogService.openSimpleDialogRef({title:this.i18nService.t("awaitingSSO"),content:this.i18nService.t("awaitingSSODesc"),type:"warning",icon:"bwi-key",acceptButtonText:this.i18nService.t("cancel"),cancelButtonText:null}),r=(0,Ce._)(n.closed).then(e=>{throw Error("SSO auth cancelled")});return Promise.race([r,t]).finally(()=>{n.close()})})}createOidcSigninRequest(e){return Xt(this,void 0,void 0,function*(){this.oidcClient=new it.hz({authority:this.vault.userType.openIDConnectAuthorityBase,client_id:this.vault.userType.openIDConnectClientId,redirect_uri:yield this.getOidcRedirectUrl(),response_type:"code",scope:this.vault.userType.oidcScope,response_mode:"query",loadUserInfo:!0});try{return yield this.oidcClient.createSigninRequest({state:{email:e},nonce:yield this.passwordGenerationService.generatePassword({length:20,uppercase:!0,lowercase:!0,number:!0})})}catch(t){throw this.logService.error("Unable to generate OIDC sign in request"),t}})}getOidcRedirectUrlWithParams(e,t){const i=this.oidcClient.settings.redirect_uri,n="code="+e+"&state="+t;return 0===i.indexOf("bitwarden://")?i+"/?"+n:i+"&"+n}getOidcRedirectUrl(){return Xt(this,void 0,void 0,function*(){if(this.platformUtilsService.getClientType()===Re.sK.Desktop)return"bitwarden://import-callback-lp";return(yield(0,Ce._)(this.environmentService.environment$)).getWebVaultUrl()+"/sso-connector.html?lp=1"})}handleStandardImport(e,t,i){return Xt(this,void 0,void 0,function*(){const n=yield this.createClientInfo(e,ct.MasterPassword);try{yield this.vault.open(e,t,n,this.lastPassDirectImportUIService,{parseSecureNotesToAccount:!1})}catch(r){throw this.logService.error("Unable to open LastPass vault"),r}return this.vault.accountsToExportedCsvString(!i)})}handleFederatedImport(e,t,i){return Xt(this,void 0,void 0,function*(){const n=new pt;try{const i=yield this.oidcClient.processSigninResponse(this.getOidcRedirectUrlWithParams(e,t)),r=i.userState;n.idToken=i.id_token,n.accessToken=i.access_token,n.idpUserInfo=i.profile,n.username=r.email}catch(s){throw this.logService.error("Unable to process OIDC sign in response"),s}const r=yield this.createClientInfo(n.username,ct.Federated);try{yield this.vault.openFederated(n,r,this.lastPassDirectImportUIService,{parseSecureNotesToAccount:!1})}catch(s){throw this.logService.error("Unable to open LastPass vault with federated user"),s}return this.vault.accountsToExportedCsvString(!i)})}createClientInfo(e,t){return Xt(this,void 0,void 0,function*(){const i="lastpass"+(yield this.appIdService.getAppId())+e,n=yield this.cryptoFunctionService.hash(i,"sha256");return ht.createClientInfo(Me.A.fromArrayToHex(n),t)})}}qt.ɵfac=function(e){return new(e||qt)(jt.KVO(Yt.R),jt.KVO(nt.v),jt.KVO(Lt.Y),jt.KVO(zt),jt.KVO(Z.y),jt.KVO(rt.JJ),jt.KVO(Kt.y),jt.KVO(d.SKi),jt.KVO(u.o3),jt.KVO($.W),jt.KVO(st.Kc))},qt.ɵprov=jt.jDH({token:qt,factory:qt.ɵfac,providedIn:"root"});var Ht=i(90246),Wt=i(50352),$t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Jt{constructor(e,t,i,n,r){this.formBuilder=e,this.controlContainer=t,this.logService=i,this.lastPassDirectImportService=n,this.i18nService=r,this.formGroup=this.formBuilder.group({email:["",{validators:[Q.k0.required,Q.k0.email],asyncValidators:[this.validateAndEmitData()],updateOn:"submit"}],includeSharedFolders:[!1]}),this.emailHint$=this.formGroup.controls.email.statusChanges.pipe((0,Ee.T)(e=>{if("PENDING"===e)return this.i18nService.t("importingYourAccount")})),this.csvDataLoaded=new d.bkB}ngOnInit(){this._parentFormGroup=this.controlContainer.control,this._parentFormGroup.addControl("lastpassOptions",this.formGroup)}ngOnDestroy(){this._parentFormGroup.removeControl("lastpassOptions")}validateAndEmitData(){return()=>$t(this,void 0,void 0,function*(){try{const e=yield this.lastPassDirectImportService.handleImport(this.formGroup.controls.email.value,this.formGroup.controls.includeSharedFolders.value);return this.csvDataLoaded.emit(e),null}catch(e){return this.logService.error(`LP importer error: ${e}`),{errors:{message:this.i18nService.t(this.getValidationErrorI18nKey(e))}}}})}getValidationErrorI18nKey(e){switch("string"==typeof e?e:null==e?void 0:e.message){case"SSO auth cancelled":case"Second factor step is canceled by the user":case"Out of band step is canceled by the user":return"multifactorAuthenticationCancelled";case"No accounts to transform":case"Vault has not opened any accounts.":return"noLastPassDataFound";case"Invalid username":case"Invalid password":return"incorrectUsernameOrPassword";case"Second factor code is incorrect":case"Out of band authentication failed":return"multifactorAuthenticationFailed";case"unifiedloginresult":return"lastPassTryAgainCheckEmail";default:return"errorOccurred"}}}Jt.ɵfac=function(e){return new(e||Jt)(d.rXU(Q.ok),d.rXU(Q.ZU),d.rXU(J.K),d.rXU(qt),d.rXU($.W))},Jt.ɵcmp=d.VBU({type:Jt,selectors:[["import-lastpass"]],outputs:{csvDataLoaded:"csvDataLoaded"},decls:14,vars:10,consts:[[3,"formGroup"],["bitInput","","type","text","formControlName","email"],["bitCheckbox","","type","checkbox","formControlName","includeSharedFolders","id","import-lastpass_input_includeSharedFolders"]],template:function(e,t){1&e&&(d.j41(0,"div",0)(1,"bit-form-field")(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.nrm(5,"input",1),d.j41(6,"bit-hint"),d.EFF(7),d.nI1(8,"async"),d.k0s()(),d.j41(9,"bit-form-control"),d.nrm(10,"input",2),d.j41(11,"bit-label"),d.EFF(12),d.nI1(13,"i18n"),d.k0s()()()),2&e&&(d.Y8G("formGroup",t.formGroup),d.R7$(3),d.JRh(d.bMT(4,4,"lastPassEmail")),d.R7$(4),d.JRh(d.bMT(8,6,t.emailHint$)),d.R7$(5),d.JRh(d.bMT(13,8,"includeSharedFolders")))},dependencies:[n.MD,r.p,Ue.j,He.E,k.L,Ht.f,D.j,Ot.I,M.J,x.h,Q.X1,Q.me,Q.Zm,Q.BC,Q.cb,Q.j4,Q.JD,F.Q,We.q,Wt.P,n.Jj,y.$],encapsulation:2});var Zt=i(69855),_t=i(44432),ei=i(24374),ti=i(17721),ii=i(57178),ni=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ri(e,t){1&e&&(d.j41(0,"bit-callout",18),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.bMT(1,2,"restrictCardTypeImport")),d.R7$(2),d.SpI(" ",d.bMT(3,4,"restrictCardTypeImportDesc"),"\n"))}function si(e,t){1&e&&(d.nrm(0,"bit-option",19),d.nI1(1,"i18n")),2&e&&d.Y8G("label",d.bMT(1,1,"myVault"))}function oi(e,t){if(1&e&&d.nrm(0,"bit-option",20),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function ai(e,t){if(1&e&&d.nrm(0,"bit-option",23),2&e){const e=t.$implicit;d.Y8G("value",e)("label",e.name)}}function li(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",21),d.nI1(2,"i18n"),d.DNE(3,ai,1,2,"bit-option",22),d.nI1(4,"async"),d.bVm()),2&e){const e=d.XpG();d.R7$(),d.Y8G("label",d.VkB("-- ",d.bMT(2,4,"selectImportFolder")," --"))("value",null),d.R7$(2),d.Y8G("ngForOf",d.bMT(4,6,e.folders$))}}function ci(e,t){if(1&e&&d.nrm(0,"bit-option",25),2&e){const e=t.$implicit,i=d.XpG(2);d.Y8G("value",e)("label",e.name)("icon",e.type===i.DefaultCollectionType?"bwi-user":"bwi-collection-shared")}}function di(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",21),d.nI1(2,"i18n"),d.DNE(3,ci,1,3,"bit-option",24),d.nI1(4,"async"),d.bVm()),2&e){const e=d.XpG();d.R7$(),d.Y8G("label",d.VkB("-- ",d.bMT(2,4,"selectImportCollection")," --"))("value",null),d.R7$(2),d.Y8G("ngForOf",d.bMT(4,6,e.collections$))}}function ui(e,t){if(1&e&&d.nrm(0,"bit-option",21),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function hi(e,t){if(1&e&&d.nrm(0,"bit-option",21),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function Ai(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",26),d.DNE(2,hi,1,2,"bit-option",15),d.bVm()),2&e){const e=d.XpG();d.R7$(2),d.Y8G("ngForOf",e.importOptions)}}function pi(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",27),d.EFF(3," https://bitwarden.com/help/export-your-data/"),d.k0s(),d.bVm())}function gi(e,t){1&e&&(d.j41(0,"bit-radio-group",31)(1,"bit-radio-button",32)(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s()(),d.j41(5,"bit-radio-button",33)(6,"bit-label"),d.EFF(7),d.nI1(8,"i18n"),d.k0s()()()),2&e&&(d.R7$(3),d.JRh(d.bMT(4,2,"importDirectlyFromLastPass")),d.R7$(4),d.JRh(d.bMT(8,4,"importFromCSV")))}function vi(e,t){if(1&e&&(d.qex(0),d.j41(1,"p",28),d.EFF(2),d.nI1(3,"i18n"),d.j41(4,"a",29),d.EFF(5," https://bitwarden.com/help/import-from-lastpass/"),d.k0s()(),d.DNE(6,gi,9,6,"bit-radio-group",30),d.bVm()),2&e){const e=d.XpG(2);d.R7$(2),d.SpI(" ",d.bMT(3,2,"seeDetailedInstructions")," "),d.R7$(4),d.Y8G("ngIf",e.showLastPassToggle)}}function fi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file. '),d.bVm())}function mi(e,t){1&e&&(d.qex(0),d.EFF(1,' In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file. '),d.bVm())}function yi(e,t){1&e&&(d.qex(0),d.EFF(1,' In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV" for your "Accounts". '),d.bVm())}function Ci(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file. '),d.bVm())}function wi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" → "Export" button and save the file "As CSV". '),d.bVm())}function Ii(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option. '),d.bVm())}function bi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file. '),d.bVm())}function Bi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export accounts" button to save the CSV file. '),d.bVm())}function Ei(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save the CSV file. '),d.bVm())}function Si(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Keeper web vault (keepersecurity.com/vault). Click on your "account email" (top right) and select "Settings". Go to "Export" and find the "Export to .csv File" option. Click "Export" to save the CSV file. '),d.bVm())}function Qi(e,t){1&e&&(d.j41(0,"span"),d.EFF(1," The process is exactly the same as importing from Google Chrome. "),d.k0s())}function ki(e,t){if(1&e&&(d.qex(0),d.DNE(1,Qi,2,0,"span",10),d.j41(2,"p"),d.EFF(3," See detailed instructions on our help site at "),d.j41(4,"a",34),d.EFF(5," https://bitwarden.com/help/import-from-chrome/"),d.k0s()(),d.j41(6,"bit-radio-group",35),d.nI1(7,"async"),d.j41(8,"bit-radio-button",36)(9,"bit-label"),d.EFF(10),d.nI1(11,"i18n"),d.k0s()(),d.j41(12,"bit-radio-button",37)(13,"bit-label"),d.EFF(14),d.nI1(15,"i18n"),d.k0s()()(),d.bVm()),2&e){const e=d.XpG(2);d.R7$(),d.Y8G("ngIf","chromecsv"!==e.format),d.R7$(5),d.Y8G("hidden",!d.bMT(7,4,e.browserImporterAvailable$)),d.R7$(4),d.JRh(d.bMT(11,6,"importDirectlyFromBrowser")),d.R7$(4),d.JRh(d.bMT(15,8,"importFromCSV"))}}function Ti(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",38),d.EFF(3," https://bitwarden.com/help/import-from-firefox/"),d.k0s(),d.EFF(4,". "),d.bVm())}function Fi(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",39),d.EFF(3," https://bitwarden.com/help/import-from-safari/"),d.k0s(),d.EFF(4,". "),d.bVm())}function Pi(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",40),d.EFF(3," https://bitwarden.com/help/import-from-1password/"),d.k0s(),d.EFF(4,". "),d.bVm())}function Ri(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops up select "All Rows" and check all fields. Click the "Export" button and save the XML file. '),d.bVm())}function Di(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English language, so adjust your settings accordingly. '),d.bVm())}function Mi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Enpass 6 desktop application, click the menu button and navigate to "File" → "Export". Select the ".json" file format option and save the JSON file. '),d.bVm())}function xi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML file. '),d.bVm())}function Oi(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to Dashlane, click on "My Account" → "Settings" → "Export file" and select "Export as a CSV file". This will download a zip archive containing various CSV files. Unzip the archive and import each CSV file individually. '),d.bVm())}function Gi(e,t){1&e&&(d.qex(0),d.EFF(1," Dashlane no longer supports the JSON format. Only use this if you have an existing JSON for import. Use the CSV importer when creating new exports. "),d.bVm())}function Ui(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file. '),d.bVm())}function Vi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select the unencrypted format XML option and save the XML file. '),d.bVm())}function ji(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export" button, enter your password and save the CSV file. '),d.bVm())}function Ni(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file. '),d.bVm())}function zi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data" and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be exported. '),d.bVm())}function Yi(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click the "Export" button. '),d.bVm())}function Li(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file. '),d.bVm())}function Ki(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted" and save the JSON file. '),d.bVm())}function Xi(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as '),d.j41(2,"code"),d.EFF(3,"zoho_export.csv"),d.k0s(),d.EFF(4,". "),d.bVm())}function qi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export" → "Export as CSV" and save the CSV file. '),d.bVm())}function Hi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to CSV" to save the CSV file. '),d.bVm())}function Wi(e,t){1&e&&(d.qex(0),d.EFF(1," Make sure you have python-keyring and python-gnomekeyring installed. Save the "),d.j41(2,"a",41),d.EFF(3,"GNOME Keyring Import/Export"),d.k0s(),d.EFF(4," python script to your desktop as "),d.j41(5,"code"),d.EFF(6,"pw_helper.py"),d.k0s(),d.EFF(7,". Open terminal and run "),d.j41(8,"code"),d.EFF(9,"chmod +rx Desktop/pw_helper.py"),d.k0s(),d.EFF(10," and then "),d.j41(11,"code"),d.EFF(12,"python Desktop/pw_helper.py export Desktop/my_passwords.json"),d.k0s(),d.EFF(13,". Then upload the resulting "),d.j41(14,"code"),d.EFF(15,"my_passwords.json"),d.k0s(),d.EFF(16," file here to Bitwarden. "),d.bVm())}function $i(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV file. '),d.bVm())}function Ji(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Passpack website vault and navigate to "Settings" → "Export", then click the "Download" button to save the CSV file. '),d.bVm())}function Zi(e,t){1&e&&(d.qex(0),d.EFF(1,' Open your Passman vault and click on "Settings" in the bottom left corner. In the "Settings" window switch to the "Export credentials" tab and choose "JSON" as the export type. Enter your vault\'s passphrase and click the "Export" button to save the JSON file. '),d.bVm())}function _i(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Avast Passwords desktop application and navigate to "Settings" → "Import/export data". Select the "Export" button for the "Export to CSV file" option to save the CSV file. '),d.bVm())}function en(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Avast Passwords desktop application and navigate to "Settings" → "Import/export data". Select the "Export" button for the "Export to JSON file" option to save the JSON file. '),d.bVm())}function tn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the F-Secure KEY desktop application and navigate to "Settings" → "Export Passwords". Select the "Export" button, enter your master password, and save the FSK file. '),d.bVm())}function nn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Kaspersky Password Manager desktop application and navigate to "Settings" → "Import/Export". Locate the "Export to text file" section and select the "Export" button to save the TXT file. '),d.bVm())}function rn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the RememBear desktop application and navigate to "Settings" → "Account" → "Export". Enter your master password and select the "Export Anyway" button to save the CSV file. '),d.bVm())}function sn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the PasswordWallet desktop application and navigate to "File" → "Export" → "Visible entries to text file". Enter your password and select the "Ok" button to save the TXT file. '),d.bVm())}function on(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Myki desktop browser extension and navigate to "Advanced" → "Export Accounts" and then scan the QR code with your mobile device. Various CSV files will then be saved to your computer\'s downloads folder. '),d.bVm())}function an(e,t){1&e&&(d.qex(0),d.EFF(1," Export your SecureSafe password safe to a CSV file with a comma delimiter. "),d.bVm())}function ln(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the LogMeOnce browser extension, then navigate to "Open Menu" → "Export To" and select "CSV File" to save the CSV file. '),d.bVm())}function cn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the BlackBerry Password Keeper application, then navigate to "Settings" → "Import/Export". Select "Export Passwords" and follow the instructions on screen to save the unencrypted CSV file. '),d.bVm())}function dn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Buttercup desktop application and unlock your vault. Right click on your vault\'s icon and select "Export" to save the CSV file. '),d.bVm())}function un(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Codebook desktop application and log in. Navigate to "File" → "Export all", then click "Yes" on the dialog and save the CSV file. '),d.bVm())}function hn(e,t){1&e&&(d.qex(0),d.EFF(1," Open the newest version of the Encryptr desktop application and allow all of your data to sync. Once syncing of your data is complete, the download icon in the top right corner will turn pink. Click the download icon and save the CSV file. "),d.bVm())}function An(e,t){1&e&&(d.qex(0),d.EFF(1,' From the Yoti browser extension, click on "Settings", then "Export Saved Logins" and save the CSV file. '),d.bVm())}function pn(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to the Psono web vault, click on the "Signed in as"-dropdown, select "Others". Go to the "Export"-tab and select the json type export and then click on Export. '),d.bVm())}function gn(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to "https://vault.passky.org" → "Import & Export" → "Export" in the Passky section. ("Backup" is unsupported as it is encrypted). '),d.bVm())}function vn(e,t){1&e&&(d.qex(0),d.EFF(1," In the ProtonPass browser extension, go to Settings > Export. Export without PGP encryption and save the zip file. "),d.bVm())}function fn(e,t){1&e&&(d.qex(0),d.EFF(1," Select Database → Export to file... menu. → Within the export options, ensure Folder names and Column titles is checked. → Press Browse... button and choose the target file and set it's type to CSV file. "),d.bVm())}function mn(e,t){1&e&&(d.qex(0),d.EFF(1," Open the FullClient, go to the Main Menu and select Export. Start the export passwords wizard and follow the instructions to export a CSV file. "),d.bVm())}function yn(e,t){1&e&&(d.qex(0),d.EFF(1," Log in to NordPass and open Settings → Scroll down to the Import and Export section and select Export items → Enter your Master Password and select Continue. → Save the CSV file on your device. "),d.bVm())}function Cn(e,t){1&e&&(d.qex(0),d.EFF(1," On the desktop application, go to Tools → Export → Enter your master password → Select XML Format (*.xml) as Export format → Click on next → Choose which entries should be included in the export → Click on next to export into the location previously chosen. "),d.bVm())}function wn(e,t){if(1&e&&(d.j41(0,"bit-callout",18),d.DNE(1,pi,4,0,"ng-container",10)(2,vi,7,4,"ng-container",10)(3,fi,2,0,"ng-container",10)(4,mi,2,0,"ng-container",10)(5,yi,2,0,"ng-container",10)(6,Ci,2,0,"ng-container",10)(7,wi,2,0,"ng-container",10)(8,Ii,2,0,"ng-container",10)(9,bi,2,0,"ng-container",10)(10,Bi,2,0,"ng-container",10)(11,Ei,2,0,"ng-container",10)(12,Si,2,0,"ng-container",10)(13,ki,16,10,"ng-container",10),d.nI1(14,"async"),d.DNE(15,Ti,5,0,"ng-container",10)(16,Fi,5,0,"ng-container",10)(17,Pi,5,0,"ng-container",10)(18,Ri,2,0,"ng-container",10)(19,Di,2,0,"ng-container",10)(20,Mi,2,0,"ng-container",10)(21,xi,2,0,"ng-container",10)(22,Oi,2,0,"ng-container",10)(23,Gi,2,0,"ng-container",10)(24,Ui,2,0,"ng-container",10)(25,Vi,2,0,"ng-container",10)(26,ji,2,0,"ng-container",10)(27,Ni,2,0,"ng-container",10)(28,zi,2,0,"ng-container",10)(29,Yi,2,0,"ng-container",10)(30,Li,2,0,"ng-container",10)(31,Ki,2,0,"ng-container",10)(32,Xi,5,0,"ng-container",10)(33,qi,2,0,"ng-container",10)(34,Hi,2,0,"ng-container",10)(35,Wi,17,0,"ng-container",10)(36,$i,2,0,"ng-container",10)(37,Ji,2,0,"ng-container",10)(38,Zi,2,0,"ng-container",10)(39,_i,2,0,"ng-container",10)(40,en,2,0,"ng-container",10)(41,tn,2,0,"ng-container",10)(42,nn,2,0,"ng-container",10)(43,rn,2,0,"ng-container",10)(44,sn,2,0,"ng-container",10)(45,on,2,0,"ng-container",10)(46,an,2,0,"ng-container",10)(47,ln,2,0,"ng-container",10)(48,cn,2,0,"ng-container",10)(49,dn,2,0,"ng-container",10)(50,un,2,0,"ng-container",10)(51,hn,2,0,"ng-container",10)(52,An,2,0,"ng-container",10)(53,pn,2,0,"ng-container",10)(54,gn,2,0,"ng-container",10)(55,vn,2,0,"ng-container",10)(56,fn,2,0,"ng-container",10)(57,mn,2,0,"ng-container",10)(58,yn,2,0,"ng-container",10)(59,Cn,2,0,"ng-container",10),d.k0s()),2&e){const e=d.XpG();d.Y8G("title",d.mNQ(e.getFormatInstructionTitle())),d.R7$(),d.Y8G("ngIf","bitwardencsv"===e.format||"bitwardenjson"===e.format),d.R7$(),d.Y8G("ngIf","lastpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","keepassxcsv"===e.format),d.R7$(),d.Y8G("ngIf","aviracsv"===e.format),d.R7$(),d.Y8G("ngIf","blurcsv"===e.format),d.R7$(),d.Y8G("ngIf","safeincloudxml"===e.format),d.R7$(),d.Y8G("ngIf","padlockcsv"===e.format),d.R7$(),d.Y8G("ngIf","keepass2xml"===e.format),d.R7$(),d.Y8G("ngIf","upmcsv"===e.format),d.R7$(),d.Y8G("ngIf","saferpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","meldiumcsv"===e.format),d.R7$(),d.Y8G("ngIf","keepercsv"===e.format),d.R7$(),d.Y8G("ngIf",d.bMT(14,60,e.showChromiumInstructions$)),d.R7$(2),d.Y8G("ngIf","firefoxcsv"===e.format),d.R7$(),d.Y8G("ngIf","safaricsv"===e.format),d.R7$(),d.Y8G("ngIf","1password1pux"===e.format||"1password1pif"===e.format||"1passwordwincsv"===e.format||"1passwordmaccsv"===e.format),d.R7$(),d.Y8G("ngIf","passworddragonxml"===e.format),d.R7$(),d.Y8G("ngIf","enpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","enpassjson"===e.format),d.R7$(),d.Y8G("ngIf","pwsafexml"===e.format),d.R7$(),d.Y8G("ngIf","dashlanecsv"===e.format),d.R7$(),d.Y8G("ngIf","dashlanejson"===e.format),d.R7$(),d.Y8G("ngIf","msecurecsv"===e.format),d.R7$(),d.Y8G("ngIf","stickypasswordxml"===e.format),d.R7$(),d.Y8G("ngIf","truekeycsv"===e.format),d.R7$(),d.Y8G("ngIf","clipperzhtml"===e.format),d.R7$(),d.Y8G("ngIf","roboformcsv"===e.format),d.R7$(),d.Y8G("ngIf","passboltcsv"===e.format),d.R7$(),d.Y8G("ngIf","ascendocsv"===e.format),d.R7$(),d.Y8G("ngIf","passwordbossjson"===e.format),d.R7$(),d.Y8G("ngIf","zohovaultcsv"===e.format),d.R7$(),d.Y8G("ngIf","splashidcsv"===e.format),d.R7$(),d.Y8G("ngIf","passkeepcsv"===e.format),d.R7$(),d.Y8G("ngIf","gnomejson"===e.format),d.R7$(),d.Y8G("ngIf","passwordagentcsv"===e.format),d.R7$(),d.Y8G("ngIf","passpackcsv"===e.format),d.R7$(),d.Y8G("ngIf","passmanjson"===e.format),d.R7$(),d.Y8G("ngIf","avastcsv"===e.format),d.R7$(),d.Y8G("ngIf","avastjson"===e.format),d.R7$(),d.Y8G("ngIf","fsecurefsk"===e.format),d.R7$(),d.Y8G("ngIf","kasperskytxt"===e.format),d.R7$(),d.Y8G("ngIf","remembearcsv"===e.format),d.R7$(),d.Y8G("ngIf","passwordwallettxt"===e.format),d.R7$(),d.Y8G("ngIf","mykicsv"===e.format),d.R7$(),d.Y8G("ngIf","securesafecsv"===e.format),d.R7$(),d.Y8G("ngIf","logmeoncecsv"===e.format),d.R7$(),d.Y8G("ngIf","blackberrycsv"===e.format),d.R7$(),d.Y8G("ngIf","buttercupcsv"===e.format),d.R7$(),d.Y8G("ngIf","codebookcsv"===e.format),d.R7$(),d.Y8G("ngIf","encryptrcsv"===e.format),d.R7$(),d.Y8G("ngIf","yoticsv"===e.format),d.R7$(),d.Y8G("ngIf","psonojson"===e.format),d.R7$(),d.Y8G("ngIf","passkyjson"===e.format),d.R7$(),d.Y8G("ngIf","protonpass"===e.format),d.R7$(),d.Y8G("ngIf","passwordxpcsv"===e.format),d.R7$(),d.Y8G("ngIf","netwrixpasswordsecure"===e.format),d.R7$(),d.Y8G("ngIf","nordpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","passworddepot17xml"===e.format)}}function In(e,t){if(1&e){const e=d.RV6();d.j41(0,"import-lastpass",42),d.bIt("csvDataLoaded",function(t){jt.eBV(e);const i=d.XpG();return jt.Njj(i.formGroup.controls.fileContents.setValue(t))}),d.k0s()}if(2&e){const e=d.XpG();d.Y8G("formGroup",e.formGroup)}}function bn(e,t){if(1&e){const e=d.RV6();d.j41(0,"import-chrome",43),d.bIt("csvDataLoaded",function(t){jt.eBV(e);const i=d.XpG();return jt.Njj(i.formGroup.controls.fileContents.setValue(t))}),d.k0s()}if(2&e){const e=d.XpG();d.Y8G("formGroup",e.formGroup)("onImportFromBrowser",e.onImportFromBrowser)("onLoadProfilesFromBrowser",e.onLoadProfilesFromBrowser)("format",e.format)}}function Bn(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field")(1,"bit-label"),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"div",44)(5,"button",45),d.bIt("click",function(){jt.eBV(e);const t=d.sdS(11);return jt.Njj(t.click())}),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.EFF(8),d.nI1(9,"i18n"),d.k0s(),d.j41(10,"input",46,0),d.bIt("change",function(t){jt.eBV(e);const i=d.XpG();return jt.Njj(i.setSelectedFile(t))}),d.k0s()(),d.j41(12,"bit-form-field",8)(13,"bit-label"),d.EFF(14),d.nI1(15,"i18n"),d.k0s(),d.nrm(16,"textarea",47),d.k0s()}if(2&e){const e=d.XpG();d.R7$(2),d.JRh(d.bMT(3,4,"selectImportFile")),d.R7$(4),d.SpI(" ",d.bMT(7,6,"chooseFile")," "),d.R7$(2),d.SpI(" ",e.fileSelected?e.fileSelected.name:d.bMT(9,8,"noFileChosen")," "),d.R7$(6),d.JRh(d.bMT(15,10,"orCopyPasteFileContents"))}}class En{get organizationId(){return this._organizationId}set organizationId(e){return Me.A.isNullOrEmpty(e)?(this._organizationId=void 0,void(this.organization=void 0)):(0,xe.e)(e)?(this._organizationId=e,void(0,Pe.F6)(this.accountService.activeAccount$).pipe((0,be.n)(t=>this.organizationService.organizations$(t).pipe((0,De.Hc)(e)))).pipe((0,Be.Q)(this.destroy$)).subscribe(e=>{this._organizationId=null==e?void 0:e.id,this.organization=e})):(this._organizationId=void 0,void(this.organization=void 0))}ngAfterViewInit(){this.bitSubmit.loading$.pipe((0,Be.Q)(this.destroy$)).subscribe(e=>{this.formLoading.emit(e)}),this.bitSubmit.disabled$.pipe((0,Be.Q)(this.destroy$)).subscribe(e=>{this.formDisabled.emit(e)})}constructor(e,t,i,n,r,s,o,a,l,c,u,h,A,p,g,v,f){this.i18nService=e,this.importService=t,this.platformUtilsService=i,this.policyService=n,this.logService=r,this.syncService=s,this.dialogService=o,this.folderService=a,this.organizationService=l,this.collectionService=c,this.formBuilder=u,this.importCollectionService=h,this.toastService=A,this.accountService=p,this.restrictedItemTypesService=g,this.destroyRef=v,this.importMetadataService=f,this.DefaultCollectionType=Fe.it.DefaultUserCollection,this.format=null,this.organization=void 0,this.destroy$=new me.B,this.isCardTypeRestricted$=this.restrictedItemTypesService.restricted$.pipe((0,Ee.T)(e=>e.length>0)),this._importBlockedByPolicy=!1,this.isFromAC=!1,this.activeUserId$=this.accountService.activeAccount$.pipe((0,Ee.T)(e=>null==e?void 0:e.id)),this.formGroup=this.formBuilder.group({vaultSelector:["myVault",{nonNullable:!0,validators:[Q.k0.required]}],targetSelector:[null],format:[null,[Q.k0.required]],fileContents:[],file:[],lastPassType:["direct"],chromiumLoader:[Le.aH.file]}),this.formLoading=new d.bkB,this.formDisabled=new d.bkB,this.onSuccessfulImport=new d.bkB,this.importer$=new ye.t(void 0),this.showChromiumInstructions$=this.importer$.pipe((0,Ee.T)(e=>(null==e?void 0:e.instructions)===Le.wP.chromium)),this.browserImporterAvailable$=this.importer$.pipe((0,Ee.T)(e=>{var t;return(null!==(t=null==e?void 0:e.loaders)&&void 0!==t?t:[]).includes(Le.aH.chromium)})),this.showChromiumOptions$=this.formGroup.controls.chromiumLoader.valueChanges.pipe((0,Ee.T)(e=>e===Le.aH.chromium)),this.submit=()=>ni(this,void 0,void 0,function*(){yield this.asyncValidatorsFinished(),this.formGroup.invalid?this.formGroup.markAllAsTouched():yield this.performImport()})}get importBlockedByPolicy(){return this._importBlockedByPolicy}get showLastPassToggle(){return"lastpasscsv"===this.format&&(this.platformUtilsService.getClientType()===Re.sK.Desktop||this.platformUtilsService.getClientType()===Re.sK.Browser)}get showLastPassOptions(){return this.showLastPassToggle&&"direct"===this.formGroup.controls.lastPassType.value}ngOnInit(){return ni(this,void 0,void 0,function*(){yield this.importMetadataService.init(),this.setImportOptions(),this.importMetadataService.metadata$(this.formGroup.controls.format.valueChanges).pipe((0,ve.pQ)(this.destroyRef)).subscribe({next:e=>{var t,i;this.importer$.next(e);const n=(null===(t=e.loaders)||void 0===t?void 0:t.includes(Le.aH.chromium))?Le.aH.chromium:null===(i=e.loaders)||void 0===i?void 0:i[0];this.formGroup.controls.chromiumLoader.setValue(null!=n?n:Le.aH.file)},error:e=>this.logService.error("an error occurred",e)}),this.organizationId?yield this.handleOrganizationImportInit():yield this.handleImportInit(),this.formGroup.controls.format.valueChanges.pipe((0,Be.Q)(this.destroy$)).subscribe(e=>{this.format=e}),yield this.handlePolicies()})}handleOrganizationImportInit(){return ni(this,void 0,void 0,function*(){const e=yield(0,Ce._)((0,Pe.F6)(this.accountService.activeAccount$));this.organizations$=this.organizationService.memberOrganizations$(e).pipe((0,Ee.T)(e=>e.filter(e=>e.id==this.organizationId&&(e.canAccessImport||e.canCreateNewCollections)))),this.formGroup.controls.vaultSelector.patchValue(this.organizationId),this.formGroup.controls.vaultSelector.disable(),this.collections$=Me.A.asyncToObservable(()=>this.importCollectionService.getAllAdminCollections(this.organizationId,e).then(e=>e.sort(Me.A.getSortFunction(this.i18nService,"name")))),this.isFromAC=!0})}handleImportInit(){return ni(this,void 0,void 0,function*(){this.folders$=this.activeUserId$.pipe((0,be.n)(e=>this.folderService.folderViews$(e)),(0,Ee.T)(e=>e.filter(e=>!!e.id))),this.formGroup.controls.targetSelector.disable();const e=yield(0,Ce._)((0,Pe.F6)(this.accountService.activeAccount$));this.organizations$=this.organizationService.memberOrganizations$(e).pipe((0,Se.v)(this.collectionService.decryptedCollections$(e)),(0,Ee.T)(([e,t])=>e.filter(e=>t.some(t=>t.organizationId===e.id&&t.manage)).sort(Me.A.getSortFunction(this.i18nService,"name")))),(0,we.z)([this.formGroup.controls.vaultSelector.valueChanges,this.organizations$]).pipe((0,Be.Q)(this.destroy$)).subscribe(([t,i])=>{this.organizationId="myVault"!==t?t:void 0,this.formGroup.controls.targetSelector.enable(),t&&(this.collections$=this.collectionService.decryptedCollections$(e).pipe((0,Ee.T)(e=>e.filter(e=>e.organizationId===t&&e.manage).sort(Me.A.getSortFunction(this.i18nService,"name")))))}),this.formGroup.controls.vaultSelector.setValue("myVault")})}handlePolicies(){return ni(this,void 0,void 0,function*(){const e=yield(0,Ce._)((0,Pe.F6)(this.accountService.activeAccount$)),t=(0,we.z)([this.accountService.activeAccount$.pipe(Pe.F6,(0,be.n)(e=>this.policyService.policyAppliesToUser$(Te.tt.OrganizationDataOwnership,e))),this.organizations$]);t.pipe((0,Be.Q)(this.destroy$)).subscribe(([e,t])=>{this._importBlockedByPolicy=e,e&&0==t.length&&this.formGroup.disable(),e&&t.length>0&&this.formGroup.controls.vaultSelector.setValue(t[0].id)}),t.pipe((0,Qe.p)(([e,t])=>e&&t.length>0),(0,be.n)(([,t])=>this.collectionService.defaultUserCollection$(e,t[0].id)),(0,Qe.p)(Boolean),(0,Be.Q)(this.destroy$)).subscribe(e=>{this.formGroup.controls.targetSelector.setValue(e)})})}asyncValidatorsFinished(){return ni(this,void 0,void 0,function*(){this.formGroup.pending&&(yield(0,Ce._)(this.formGroup.statusChanges.pipe((0,Qe.p)(e=>"PENDING"!==e))))})}performImport(){return ni(this,void 0,void 0,function*(){var e;if(!(yield this.validateImport()))return;const t=this.importService.getImporter(this.format,()=>ni(this,void 0,void 0,function*(){return yield this.getFilePassword()}),this.organizationId);if(null===t)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFormat")});const i=yield this.setImportContents();if(null!=i&&""!==i)try{const n=yield this.importService.import(t,i,this.organizationId,this.formGroup.controls.targetSelector.value,(null===(e=this.organization)||void 0===e?void 0:e.canAccessImport)&&this.isFromAC);this.dialogService.open(S,{data:n}),this.syncService.fullSync(!0),this.onSuccessfulImport.emit(this._organizationId)}catch(n){this.dialogService.open(I,{data:n}),this.logService.error(n)}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")})})}getFormatInstructionTitle(){if(null==this.format)return null;const e=this.featuredImportOptions.concat(this.importOptions).filter(e=>e.id===this.format);return e.length>0?this.i18nService.t("instructionsFor",e[0].name):null}setImportOptions(){this.featuredImportOptions=[...this.importService.featuredImportOptions],this.importOptions=[...this.importService.regularImportOptions].sort((e,t)=>null==e.name&&null!=t.name?-1:null!=e.name&&null==t.name?1:null==e.name&&null==t.name?0:this.i18nService.collator?this.i18nService.collator.compare(e.name,t.name):e.name.localeCompare(t.name))}setSelectedFile(e){const t=e.target;this.fileSelected=t.files.length>0?t.files[0]:null}getFileContents(e){return"1password1pux"===this.format&&e.name.endsWith(".1pux")?this.extractZipContent(e,"export.data"):"protonpass"!==this.format||"application/zip"!==e.type&&"application/x-zip-compressed"!=e.type&&!e.name.endsWith(".zip")?new Promise((t,i)=>{const n=new FileReader;n.readAsText(e,"utf-8"),n.onload=n=>{if("lastpasscsv"===this.format&&"text/html"===e.type){const e=(new DOMParser).parseFromString(n.target.result,"text/html").querySelector("pre");return null!=e?void t(e.textContent):void i()}t(n.target.result)},n.onerror=()=>{i()}}):this.extractZipContent(e,"Proton Pass/data.json")}extractZipContent(e,t){return(new fe).loadAsync(e).then(e=>e.file(t).async("string")).then(function(e){return e},function(e){return""})}getFilePassword(){return ni(this,void 0,void 0,function*(){const e=this.dialogService.open(j,{ariaModal:!0});return yield(0,Ie.s)(e.closed)})}validateImport(){return ni(this,void 0,void 0,function*(){const e=this.formGroup.controls.targetSelector.value,t=(null==e?void 0:e.type)===Fe.it.DefaultUserCollection;if(this.organization&&!t){if(!(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"importWarning",placeholders:[this.organization.name]},type:"warning"})))return!1}return!this.importBlockedByPolicy||null!=this.organizationId||(this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("personalOwnershipPolicyInEffectImports")}),!1)})}setImportContents(){return ni(this,void 0,void 0,function*(){const e=document.getElementById("import_input_file"),t=null==e?void 0:e.files;let i=this.formGroup.controls.fileContents.value;if(null!=t&&t.length>0)try{const e=yield this.getFileContents(t[0]);null!=e&&(i=e)}catch(n){this.logService.error(n)}return i})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}En.ɵfac=function(e){return new(e||En)(d.rXU($.W),d.rXU(Ae.Tt),d.rXU(Z.y),d.rXU(K.m),d.rXU(J.K),d.rXU(Oe.H),d.rXU(u.o3),d.rXU(le.k),d.rXU(ke.PV),d.rXU(z.YD),d.rXU(Q.ok),d.rXU(Ae.H7,8),d.rXU(Zt.f),d.rXU(X.D),d.rXU(ce.b),d.rXU(jt.abz),d.rXU(Ae.UN))},En.ɵcmp=d.VBU({type:En,selectors:[["tools-import"]],viewQuery:function(e,t){if(1&e&&d.GBs(U.L,5),2&e){let e;d.mGM(e=d.lsd())&&(t.bitSubmit=e.first)}},inputs:{organizationId:"organizationId",onLoadProfilesFromBrowser:"onLoadProfilesFromBrowser",onImportFromBrowser:"onImportFromBrowser"},outputs:{formLoading:"formLoading",formDisabled:"formDisabled",onSuccessfulImport:"onSuccessfulImport"},features:[d.Jv_(ge)],decls:51,vars:48,consts:[["fileSelector",""],["type","info",3,"title",4,"ngIf"],["id","import_form_importForm",3,"formGroup","bitSubmit"],["bitTypography","h6",1,"tw-font-medium"],[3,"hidden"],["formControlName","vaultSelector"],["value","myVault","icon","bwi-user",3,"label",4,"ngIf"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["disableMargin",""],["formControlName","targetSelector"],[4,"ngIf"],[1,"@2xl:tw-w-1/2"],["formControlName","format"],["value","",3,"label"],["value","-","disabled","",1,"tw-font-medium","tw-text-muted","tw-text-xs",3,"label"],[3,"value","label",4,"ngFor","ngForOf"],[3,"formGroup"],[3,"formGroup","onImportFromBrowser","onLoadProfilesFromBrowser","format"],["type","info",3,"title"],["value","myVault","icon","bwi-user",3,"label"],["icon","bwi-business",3,"value","label"],[3,"value","label"],["icon","bwi-folder",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-folder",3,"value","label"],[3,"value","label","icon",4,"ngFor","ngForOf"],[3,"value","label","icon"],["value","-","label","--------------------------------------","disabled",""],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/export-your-data/"],["bitTypography","body1"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-lastpass/"],["formControlName","lastPassType",4,"ngIf"],["formControlName","lastPassType"],["id","import_bit-radio-button_lp-direct","value","direct",1,"tw-block"],["id","import_bit-radio-button_lp-csv","value","csv",1,"tw-block"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-chrome/"],["formControlName","chromiumLoader",3,"hidden"],["id","import_bit-radio-button_chrome-browser","value","chromium",1,"tw-block"],["id","import_bit-radio-button_chrome-file","value","file",1,"tw-block"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-firefox/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-safari/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-1password/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://github.com/spookylukey/gnome-keyring-import-export"],[3,"csvDataLoaded","formGroup"],[3,"csvDataLoaded","formGroup","onImportFromBrowser","onLoadProfilesFromBrowser","format"],[1,"file-selector","tw-pt-2","tw-pb-1","tw-break-words"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitInput","","type","file","id","import_input_file","formControlName","file","hidden","",1,"tw-hidden",3,"change"],["id","import_textarea_fileContents","bitInput","","formControlName","fileContents"]],template:function(e,t){1&e&&(d.DNE(0,ri,4,6,"bit-callout",1),d.nI1(1,"async"),d.j41(2,"form",2)(3,"bit-section")(4,"bit-section-header")(5,"h2",3),d.EFF(6),d.nI1(7,"i18n"),d.k0s()(),d.j41(8,"bit-card")(9,"bit-form-field",4)(10,"bit-label"),d.EFF(11),d.nI1(12,"i18n"),d.k0s(),d.j41(13,"bit-select",5),d.DNE(14,si,2,3,"bit-option",6)(15,oi,1,2,"bit-option",7),d.nI1(16,"async"),d.k0s()(),d.j41(17,"bit-form-field",8)(18,"bit-label"),d.EFF(19),d.nI1(20,"i18n"),d.nI1(21,"i18n"),d.k0s(),d.j41(22,"bit-select",9),d.DNE(23,li,5,8,"ng-container",10)(24,di,5,8,"ng-container",10),d.k0s(),d.j41(25,"bit-hint"),d.EFF(26),d.nI1(27,"i18n"),d.nI1(28,"i18n"),d.k0s()()()(),d.j41(29,"bit-section")(30,"bit-section-header")(31,"h2",3),d.EFF(32),d.nI1(33,"i18n"),d.k0s()(),d.j41(34,"bit-card")(35,"bit-form-field",11)(36,"bit-label"),d.EFF(37),d.nI1(38,"i18n"),d.k0s(),d.j41(39,"bit-select",12),d.nrm(40,"bit-option",13),d.nI1(41,"i18n"),d.nrm(42,"bit-option",14),d.nI1(43,"i18n"),d.DNE(44,ui,1,2,"bit-option",15)(45,Ai,3,1,"ng-container",10),d.k0s()(),d.DNE(46,wn,60,62,"bit-callout",1),d.nVh(47,In,1,1,"import-lastpass",16),d.nI1(48,"async"),d.vZN(49,bn,1,4,"import-chrome",17)(50,Bn,17,12),d.k0s()()()),2&e&&(d.Y8G("ngIf",d.bMT(1,22,t.isCardTypeRestricted$)),d.R7$(2),d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(4),d.JRh(d.bMT(7,24,"destination")),d.R7$(3),d.Y8G("hidden",t.isFromAC),d.R7$(2),d.JRh(d.bMT(12,26,"vault")),d.R7$(3),d.Y8G("ngIf",!t.importBlockedByPolicy),d.R7$(),d.Y8G("ngForOf",d.bMT(16,28,t.organizations$)),d.R7$(4),d.JRh(t.organizationId?d.bMT(20,30,"collection"):d.bMT(21,32,"folder")),d.R7$(4),d.Y8G("ngIf",!t.organizationId),d.R7$(),d.Y8G("ngIf",t.organizationId),d.R7$(2),d.JRh(t.organizationId?d.bMT(27,34,"importTargetHintCollection"):d.bMT(28,36,"importTargetHintFolder")),d.R7$(6),d.JRh(d.bMT(33,38,"data")),d.R7$(5),d.JRh(d.bMT(38,40,"fileFormat")),d.R7$(3),d.Y8G("label",d.VkB("-- ",d.bMT(41,42,"select")," --")),d.R7$(2),d.Y8G("label",d.mNQ(d.bMT(43,44,"commonImportFormats"))),d.R7$(2),d.Y8G("ngForOf",t.featuredImportOptions),d.R7$(),d.Y8G("ngIf",t.importOptions&&t.importOptions.length),d.R7$(),d.Y8G("ngIf",t.format),d.R7$(),d.vxM(t.showLastPassOptions?47:d.bMT(48,46,t.showChromiumOptions$)?49:50))},dependencies:[n.MD,n.Sq,n.bT,r.p,k.L,D.j,Ot.I,M.J,x.h,T.C,U.L,c.t,m.Q,F.Q,Ge.p,$e.w,Je.P,Ue.j,_t.G,Q.X1,Q.qT,Q.me,Q.BC,Q.cb,Q.j4,Q.JD,et,Jt,Ve.K,ei.d,ti.Y,je.i,Ne.U,ze.n,Ye.V,ii.g,n.Jj,y.$],encapsulation:2})},43317(e,t,i){"use strict";i.d(t,{eO:()=>a,mw:()=>s,sE:()=>o});var n=i(52237),r=i(23567);function s(e){if(!e)return[];const t=e.sort((e,t)=>e.name.localeCompare(t.name)).map(o),i=[],s=new Map;t.map(e=>{var t;const i=e.organizationId;(null!==(t=s.get(i))&&void 0!==t?t:s.set(i,[]).get(i)).push(e)});for(const o of s.values()){const e=[];for(const t of o){const i=t.name?t.name.replace(/^\/+|\/+$/g,"").split(n.Kt):[];r.F.nestedTraverse(e,0,i,t,void 0,n.Kt)}i.push(...e)}return i}function o(e){let t;return t=e instanceof n.nb?Object.assign(new n.nb(Object.assign(Object.assign({},e),{name:e.name})),e):Object.assign(new n.iY(Object.assign(Object.assign({},e),{name:e.name})),e),t}function a(e){return e&&0!==e.length?e.flatMap(e=>{if(!e.children||0===e.children.length)return[e.node];const t=a(e.children);return[e.node,...t]}):[]}},43348(e,t,i){"use strict";i.d(t,{F:()=>n});class n{}},43600(e,t,i){"use strict";i.d(t,{q:()=>Jt});var n=i(66046),r=i(44500),s=i(14803),o=i(88565),a=i(14928),l=i(23327),c=i(30675),d=i(48003),u=i(43978),h=i(71804),A=i(16888),p=i(3633),g=i(37380),v=i(64447),f=i(83516),m=i(98403),y=i(72932),C=i(62963),w=i(77468),I=i(81525),b=i(81573),B=i(29029),E=i(75583),S=i(36801),Q=i(33812),k=i(74208),T=i(50700),F=i(7730),P=i(68016),R=i(67311),D=i(56898),M=i(58806);function x(e,t){if(1&e&&(Q.qex(0),Q.j41(1,"p",7),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"code",8),Q.EFF(5),Q.k0s(),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(2),Q.SpI("",Q.bMT(3,2,"twoFactorRecoveryYourCode"),":"),Q.R7$(3),Q.JRh(e.code)}}function O(e,t){1&e&&(Q.qex(0),Q.EFF(1),Q.nI1(2,"i18n"),Q.bVm()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"twoFactorRecoveryNoCode")," "))}function G(e,t){if(1&e&&(Q.qex(0,5),Q.DNE(1,x,6,4,"ng-container",6)(2,O,3,3,"ng-container",6),Q.bVm()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("ngIf",e.code),Q.R7$(),Q.Y8G("ngIf",!e.code)}}function U(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",9),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG();return k.Njj(t.print())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"printCode")," "))}class V{constructor(e,t){this.data=e,this.i18nService=t,this.type=-1,this.code="",this.authed=!1,this.twoFactorProviderType=h.R,this.auth(e.response)}auth(e){this.authed=!0,this.processResponse(e.response)}print(){const e=window.open();e&&(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?"":e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()}processResponse(e){this.code=this.formatString(e.code)}static open(e,t){return e.open(V,t)}}V.ɵfac=function(e){return new(e||V)(Q.rXU(I.Qs),Q.rXU(T.W))},V.ɵcmp=Q.VBU({type:V,selectors:[["app-two-factor-recovery"]],decls:9,vars:11,consts:[["dialogSize","default",3,"title","subtitle"],["bitDialogContent","",4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click",4,"ngIf"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],["bitDialogContent",""],[4,"ngIf"],["bitTypography","body1",1,"tw-text-center"],[1,"tw-text-lg","tw-w-full","tw-flex","tw-justify-center"],["bitButton","","type","button","buttonType","primary",3,"click"]],template:function(e,t){1&e&&(Q.j41(0,"bit-dialog",0),Q.nI1(1,"i18n"),Q.nI1(2,"i18n"),Q.DNE(3,G,3,2,"ng-container",1),Q.qex(4,2),Q.DNE(5,U,3,3,"button",3),Q.j41(6,"button",4),Q.EFF(7),Q.nI1(8,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.Y8G("title",Q.bMT(1,5,"twoStepLogin"))("subtitle",Q.bMT(2,7,"recoveryCodeTitle")),Q.R7$(3),Q.Y8G("ngIf",t.authed),Q.R7$(2),Q.Y8G("ngIf",t.code),Q.R7$(2),Q.SpI(" ",Q.bMT(8,9,"close")," "))},dependencies:[w.MD,w.bT,b.P,F.I,P.m,R.hJ,B.t,D.Q,E.E,M.r,S.$Z],encapsulation:2});var j=i(51757),N=i(72245),z=i(3204),Y=i(94735);class L extends A.G{}var K=i(7248);class X extends K.V{}var q=i(56962),H=i(78781),W=i(26411),$=i(55807),J=i(89479),Z=i(26477),_=i(80351),ee=i(45383),te=i(37579),ie=i(89294),ne=i(66316),re=i(69855),se=i(62166),oe=i(37115),ae=i(35500),le=i(1601),ce=i(86226),de=i(97553),ue=i(43759),he=i(58384),Ae=i(57178),pe=i(44432),ge=i(26657),ve=i(38620),fe=i(54471),me=i(57083),ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ce(e,t){1&e&&(Q.qex(0),Q.j41(1,"bit-callout",13),Q.nI1(2,"i18n"),Q.j41(3,"p",14),Q.EFF(4),Q.nI1(5,"i18n"),Q.k0s(),Q.EFF(6),Q.nI1(7,"i18n"),Q.k0s(),Q.j41(8,"p",14),Q.EFF(9),Q.nI1(10,"i18n"),Q.k0s(),Q.bVm()),2&e&&(Q.R7$(),Q.Y8G("title",Q.mNQ(Q.bMT(2,5,"enabled"))),Q.R7$(3),Q.JRh(Q.bMT(5,7,"twoStepLoginProviderEnabled")),Q.R7$(2),Q.SpI(" ",Q.bMT(7,9,"twoStepAuthenticatorReaddDesc")," "),Q.R7$(3),Q.JRh(Q.bMT(10,11,"twoStepAuthenticatorNeedApp")))}function we(e,t){if(1&e){const e=Q.RV6();Q.qex(0),Q.j41(1,"p"),Q.EFF(2),Q.nI1(3,"i18n"),Q.j41(4,"a",15),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG(2);return k.Njj(t.launchExternalUrl("https://getaegis.app"))}),Q.EFF(5,"Aegis"),Q.k0s(),Q.EFF(6),Q.nI1(7,"i18n"),Q.j41(8,"a",15),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG(2);return k.Njj(t.launchExternalUrl("https://2fas.com"))}),Q.EFF(9,"2FAS"),Q.k0s(),Q.EFF(10),Q.nI1(11,"i18n"),Q.j41(12,"a",15),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG(2);return k.Njj(t.launchBitwardenUrl("https://bitwarden.com/products/authenticator/"))}),Q.EFF(13,"Bitwarden Authenticator"),Q.k0s(),Q.EFF(14),Q.nI1(15,"i18n"),Q.k0s(),Q.j41(16,"p",16)(17,"a",17),Q.nrm(18,"img",18),Q.k0s(),Q.j41(19,"a",19),Q.nrm(20,"img",20),Q.k0s()(),Q.EFF(21),Q.nI1(22,"i18n"),Q.bVm()}2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,5,"twoStepAuthenticatorInstructionPrefix")," "),Q.R7$(4),Q.SpI(" ",Q.bMT(7,7,"twoStepAuthenticatorInstructionInfix1")," "),Q.R7$(4),Q.SpI(" ",Q.bMT(11,9,"twoStepAuthenticatorInstructionInfix2")," "),Q.R7$(4),Q.SpI(" ",Q.bMT(15,11,"twoStepAuthenticatorInstructionSuffix")," "),Q.R7$(7),Q.SpI(" ",Q.bMT(22,13,"twoStepAuthenticatorScanCodeV2")," "))}function Ie(e,t){1&e&&Q.nrm(0,"hr")}function be(e,t){1&e&&(Q.qex(0,21),Q.nrm(1,"bit-icon",22),Q.j41(2,"p"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.bVm()),2&e&&(Q.R7$(3),Q.SpI(" ",Q.bMT(4,1,"twoStepAuthenticatorQRCanvasError")," "))}function Be(e,t){1&e&&Q.nrm(0,"canvas",23)}function Ee(e,t){1&e&&(Q.j41(0,"bit-form-field",24)(1,"bit-label"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",25),Q.k0s()),2&e&&(Q.Y8G("disableMargin",!0),Q.R7$(2),Q.JRh(Q.bMT(3,2,"twoStepAuthenticatorEnterCodeV2")))}function Se(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"form",1)(1,"bit-dialog",2),Q.nI1(2,"i18n"),Q.nI1(3,"i18n"),Q.qex(4,3),Q.DNE(5,Ce,11,13,"ng-container",4)(6,we,23,15,"ng-container",4)(7,Ie,1,0,"hr",4),Q.j41(8,"p",5),Q.DNE(9,be,5,3,"ng-container",6)(10,Be,1,0,"canvas",7),Q.nrm(11,"br"),Q.j41(12,"code",8),Q.nI1(13,"i18n"),Q.EFF(14),Q.k0s()(),Q.DNE(15,Ee,5,4,"bit-form-field",9),Q.bVm(),Q.qex(16,10),Q.j41(17,"button",11),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG();return k.Njj(t.validateTokenControl())}),Q.EFF(18),Q.nI1(19,"i18n"),Q.k0s(),Q.j41(20,"button",12),Q.EFF(21),Q.nI1(22,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()()}if(2&e){const e=Q.XpG();Q.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),Q.R7$(),Q.Y8G("title",Q.bMT(2,15,"twoStepLogin"))("subtitle",Q.bMT(3,17,"authenticatorAppTitle")),Q.R7$(4),Q.Y8G("ngIf",e.enabled),Q.R7$(),Q.Y8G("ngIf",!e.enabled),Q.R7$(),Q.Y8G("ngIf",e.enabled),Q.R7$(2),Q.Y8G("ngIf",e.qrScriptError),Q.R7$(),Q.Y8G("ngIf",!e.qrScriptError),Q.R7$(2),Q.Y8G("appA11yTitle",Q.mNQ(Q.bMT(13,19,"key"))),Q.R7$(2),Q.JRh(e.key),Q.R7$(),Q.Y8G("ngIf",!e.enabled),Q.R7$(3),Q.SpI(" ",Q.bMT(19,21,e.enabled?"disable":"enable")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(22,23,"close")," ")}}class Qe extends ie.g{constructor(e,t,i,n,r,s,o,a,l,c,d,u){super(i,n,o,a,r,c,u),this.data=e,this.dialogRef=t,this.formBuilder=s,this.accountService=l,this.configService=d,this.toastService=u,this.onChangeStatus=new Q.bkB,this.type=h.R.Authenticator,this.componentName="app-two-factor-authenticator",this.qrScriptError=!1,this.formGroup=this.formBuilder.group({token:new j.MJ(null,[j.k0.required,j.k0.minLength(6)])}),this.submit=()=>ye(this,void 0,void 0,function*(){this.formGroup.invalid&&!this.enabled||(this.enabled?(yield this.disableMethod(),this.dialogRef.close(this.enabled)):yield this.enable(),this.onChangeStatus.emit(this.enabled))}),this.qrScript=window.document.createElement("script"),this.qrScript.src="scripts/qrious.min.js",this.qrScript.async=!0}ngOnInit(){return ye(this,void 0,void 0,function*(){window.document.body.appendChild(this.qrScript),yield this.auth(this.data)})}ngOnDestroy(){window.document.body.removeChild(this.qrScript)}validateTokenControl(){this.formGroup.controls.token.markAsTouched()}auth(e){const t=Object.create(null,{auth:{get:()=>super.auth}});return ye(this,void 0,void 0,function*(){return t.auth.call(this,e),this.processResponse(e.response)})}enable(){return ye(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(X);e.token=this.formGroup.value.token,e.key=this.key,e.userVerificationToken=this.userVerificationToken;const t=yield this.twoFactorService.putTwoFactorAuthenticator(e);yield this.processResponse(t),this.onUpdated.emit(!0)})}disableMethod(){return ye(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"disable"},content:{key:"twoStepDisableDesc"},type:"warning"})))return;const e=yield this.buildRequestModel(L);e.type=this.type,e.key=this.key,e.userVerificationToken=this.userVerificationToken,yield this.twoFactorService.deleteTwoFactorAuthenticator(e),this.enabled=!1,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("twoStepDisabled")}),this.onUpdated.emit(!1)})}processResponse(e){return ye(this,void 0,void 0,function*(){this.formGroup.get("token").setValue(null),this.enabled=e.enabled,this.key=e.key,this.userVerificationToken=e.userVerificationToken,yield this.waitForQRiousToLoadOrError().catch(e=>{this.logService.error(e),this.qrScriptError=!0}),yield this.createQRCode()})}waitForQRiousToLoadOrError(){return ye(this,void 0,void 0,function*(){return void 0!==window.QRious||this.qrScriptError?Promise.resolve():new Promise((e,t)=>{this.qrScript.onload=()=>e(),this.qrScript.onerror=()=>t(new Error(this.i18nService.t("twoStepAuthenticatorQRCanvasError")))})})}createQRCode(){return ye(this,void 0,void 0,function*(){if(this.qrScriptError)return;const e=yield(0,N._)(this.accountService.activeAccount$.pipe((0,z.T)(e=>null==e?void 0:e.email)));new window.QRious({element:document.getElementById("qr"),value:"otpauth://totp/Vaultwarden:"+H.A.encodeRFC3986URIComponent(e)+"?secret="+encodeURIComponent(this.key)+"&issuer=Vaultwarden",size:160})})}static open(e,t){return e.open(Qe,t)}launchExternalUrl(e){return ye(this,void 0,void 0,function*(){const t=new URL(e).hostname;(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("continueToExternalUrlTitle",t),content:this.i18nService.t("continueToExternalUrlDesc"),type:"info",acceptButtonText:{key:"continue"}}))&&this.platformUtilsService.launchUri(e)})}launchBitwardenUrl(e){return ye(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("twoStepContinueToBitwardenUrlTitle"),content:this.i18nService.t("twoStepContinueToBitwardenUrlDesc"),type:"info",acceptButtonText:{key:"continue"}}))&&this.platformUtilsService.launchUri(e)})}}Qe.ɵfac=function(e){return new(e||Qe)(Q.rXU(I.Qs),Q.rXU(ne.ce),Q.rXU(g.fz),Q.rXU(T.W),Q.rXU(se.i),Q.rXU(j.ok),Q.rXU(oe.y),Q.rXU(q.K),Q.rXU(ae.D),Q.rXU(ne.o3),Q.rXU(le.w),Q.rXU(re.f))},Qe.ɵcmp=Q.VBU({type:Qe,selectors:[["app-two-factor-setup-authenticator"]],outputs:{onChangeStatus:"onChangeStatus"},features:[Q.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],[1,"tw-text-center","tw-mb-0"],["class","tw-mt-2",4,"ngIf"],["id","qr",4,"ngIf"],[3,"appA11yTitle"],[3,"disableMargin",4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"click"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],["bitTypography","body1"],["bitLink","","target","_blank","rel","noreferrer",3,"click"],[1,"tw-text-center"],["href","https://apps.apple.com/ca/app/bitwarden-authenticator/id6497335175","target","_blank"],["src","../../../images/download_apple_appstore.svg","alt","Download on App Store","max-width","120","height","40"],["href","https://play.google.com/store/apps/details?id=com.bitwarden.authenticator","target","_blank"],["src","../../../images/download_google_playstore.svg","alt","Get it on Google Play","max-width","120","height","40",2,"margin-left","10px"],[1,"tw-mt-2"],["name","bwi-error",1,"tw-text-3xl","tw-text-danger"],["id","qr"],[3,"disableMargin"],["bitInput","","type","text","formControlName","token","appInputVerbatim",""]],template:function(e,t){1&e&&Q.DNE(0,Se,23,25,"form",0),2&e&&Q.Y8G("ngIf",t.authed)},dependencies:[w.MD,w.bT,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,b.P,F.I,P.m,R.hJ,W.L,ce.j,de.J,ue.h,$.o,he.R,J.x,Z.V,Ae.g,E.E,M.r,_.j,pe.G,B.t,D.Q,ee.Z,te.C,ge.$,ve.L,Y.p,fe.C,me.q,S.$Z],encapsulation:2});var ke=i(33818),Te=i(74199);class Fe extends K.V{}var Pe=i(3892),Re=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function De(e,t){if(1&e&&(Q.qex(0),Q.j41(1,"bit-callout",8),Q.nI1(2,"i18n"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.j41(5,"strong"),Q.EFF(6),Q.nI1(7,"i18n"),Q.k0s(),Q.EFF(8),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("title",Q.mNQ(Q.bMT(2,5,"enabled"))),Q.R7$(2),Q.SpI(" ",Q.bMT(4,7,"twoStepLoginProviderEnabled")," "),Q.R7$(3),Q.SpI("",Q.bMT(7,9,"email"),":"),Q.R7$(2),Q.SpI(" ",e.email," ")}}function Me(e,t){1&e&&(Q.j41(0,"span",14),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"emailSent")," "))}function xe(e,t){if(1&e&&(Q.qex(0),Q.j41(1,"p"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"bit-form-field")(5,"bit-label"),Q.EFF(6),Q.nI1(7,"i18n"),Q.k0s(),Q.nrm(8,"input",9),Q.k0s(),Q.j41(9,"div",10)(10,"button",11),Q.EFF(11),Q.nI1(12,"i18n"),Q.k0s(),Q.DNE(13,Me,3,3,"span",12),Q.k0s(),Q.j41(14,"bit-form-field")(15,"bit-label"),Q.EFF(16),Q.nI1(17,"i18n"),Q.k0s(),Q.nrm(18,"input",13),Q.k0s(),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(2),Q.JRh(Q.bMT(3,6,"twoFactorEmailDesc")),Q.R7$(4),Q.SpI("1. ",Q.bMT(7,8,"twoFactorEmailEnterEmail")),Q.R7$(4),Q.Y8G("bitAction",e.sendEmail),Q.R7$(),Q.SpI(" ",Q.bMT(12,10,"sendEmail")," "),Q.R7$(2),Q.Y8G("ngIf",e.sentEmail),Q.R7$(3),Q.SpI("2. ",Q.bMT(17,12,"twoFactorEmailEnterCode"))}}function Oe(e,t){1&e&&(Q.j41(0,"span"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.JRh(Q.bMT(2,1,"enable")))}function Ge(e,t){1&e&&(Q.j41(0,"span"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.JRh(Q.bMT(2,1,"disable")))}function Ue(e,t){if(1&e&&(Q.j41(0,"form",1)(1,"bit-dialog",2),Q.nI1(2,"i18n"),Q.nI1(3,"i18n"),Q.qex(4,3),Q.DNE(5,De,9,11,"ng-container",4)(6,xe,19,14,"ng-container",4),Q.bVm(),Q.qex(7,5),Q.j41(8,"button",6),Q.DNE(9,Oe,3,3,"span",4)(10,Ge,3,3,"span",4),Q.k0s(),Q.j41(11,"button",7),Q.EFF(12),Q.nI1(13,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()()),2&e){const e=Q.XpG();Q.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),Q.R7$(),Q.Y8G("title",Q.bMT(2,9,"twoStepLogin"))("subtitle",Q.bMT(3,11,"emailTitle")),Q.R7$(4),Q.Y8G("ngIf",e.enabled),Q.R7$(),Q.Y8G("ngIf",!e.enabled),Q.R7$(3),Q.Y8G("ngIf",!e.enabled),Q.R7$(),Q.Y8G("ngIf",e.enabled),Q.R7$(2),Q.SpI(" ",Q.bMT(13,13,"close")," ")}}class Ve extends ie.g{constructor(e,t,i,n,r,s,o,a,l,c,d){super(t,i,n,r,s,a,d),this.data=e,this.accountService=o,this.formBuilder=l,this.dialogRef=c,this.toastService=d,this.onChangeStatus=new Q.bkB,this.type=h.R.Email,this.sentEmail="",this.componentName="app-two-factor-email",this.formGroup=this.formBuilder.group({token:["",[j.k0.required]],email:["",[j.k0.email,j.k0.required]]}),this.submit=()=>Re(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.enabled)yield this.disableEmail(),this.onChangeStatus.emit(!1);else{if(this.formGroup.invalid)return;yield this.enable(),this.onChangeStatus.emit(!0)}}),this.sendEmail=()=>Re(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(Te.v);e.email=this.email,this.emailPromise=this.twoFactorService.postTwoFactorEmailSetup(e),yield this.emailPromise,this.sentEmail=this.email}),this.onClose=()=>{this.dialogRef.close(this.enabled)}}get token(){var e;return(null===(e=this.formGroup.get("token"))||void 0===e?void 0:e.value)||""}set token(e){var t;null===(t=this.formGroup.get("token"))||void 0===t||t.setValue(e||"")}get email(){var e;return(null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value)||""}set email(e){var t;null===(t=this.formGroup.get("email"))||void 0===t||t.setValue(e||"")}ngOnInit(){return Re(this,void 0,void 0,function*(){yield this.auth(this.data)})}auth(e){return super.auth(e),this.processResponse(e.response)}disableEmail(){return super.disableMethod()}enable(){return Re(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(Fe);e.email=this.email,e.token=this.token;const t=yield this.twoFactorService.putTwoFactorEmail(e);yield this.processResponse(t),this.onUpdated.emit(!0)})}processResponse(e){return Re(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(0,N._)(this.accountService.activeAccount$.pipe((0,z.T)(e=>null==e?void 0:e.email))))})}static open(e,t){return e.open(Ve,t)}}Ve.ɵfac=function(e){return new(e||Ve)(Q.rXU(I.Qs),Q.rXU(g.fz),Q.rXU(T.W),Q.rXU(oe.y),Q.rXU(q.K),Q.rXU(se.i),Q.rXU(ae.D),Q.rXU(ne.o3),Q.rXU(j.ok),Q.rXU(ne.ce),Q.rXU(re.f))},Ve.ɵcmp=Q.VBU({type:Ve,selectors:[["app-two-factor-setup-email"]],outputs:{onChangeStatus:"onChangeStatus"},features:[Q.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],[3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],["bitInput","","type","text","formControlName","email","inputmode","email","appInputVerbatim","false"],[1,"tw-mb-3","tw-flex","tw-items-center"],["bitButton","","type","button","buttonType","primary",3,"bitAction"],["class","tw-text-success tw-ml-3",4,"ngIf"],["bitInput","","type","text","formControlName","token","appInputVerbatim",""],[1,"tw-text-success","tw-ml-3"]],template:function(e,t){1&e&&Q.DNE(0,Ue,14,15,"form",0),2&e&&Q.Y8G("ngIf",t.authed)},dependencies:[te.C,Pe.p,ge.$,ve.L,B.t,D.Q,_.j,pe.G,w.MD,w.bT,b.P,F.I,P.m,R.hJ,W.L,ce.j,de.J,ue.h,ee.Z,J.x,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,E.E,S.$Z],encapsulation:2});class je extends K.V{}class Ne extends K.V{}var ze=i(5771),Ye=i(93103),Le=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ke(e,t){1&e&&(Q.j41(0,"bit-callout",19),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()),2&e&&(Q.Y8G("title",Q.mNQ(Q.bMT(1,3,"enabled"))),Q.R7$(2),Q.SpI(" ",Q.bMT(3,5,"twoStepLoginProviderEnabled")," "))}function Xe(e,t){if(1&e&&(Q.j41(0,"span",23),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2).$implicit;Q.R7$(),Q.SpI(" ",e.name||Q.bMT(2,1,"unnamedKey")," ")}}function qe(e,t){1&e&&(Q.qex(0),Q.j41(1,"span"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.bVm()),2&e&&(Q.R7$(2),Q.JRh(Q.bMT(3,1,"webAuthnMigrated")))}function He(e,t){if(1&e&&(Q.qex(0),Q.DNE(1,qe,4,3,"ng-container",14),Q.bVm()),2&e){const e=Q.XpG(2).$implicit;Q.R7$(),Q.Y8G("ngIf",e.migrated)}}function We(e,t){1&e&&(Q.nrm(0,"bit-icon",26),Q.nI1(1,"i18n")),2&e&&Q.Y8G("ariaLabel",Q.bMT(1,1,"loading"))}function $e(e,t){if(1&e){const e=Q.RV6();Q.qex(0),Q.DNE(1,We,2,3,"bit-icon",24),Q.EFF(2," - "),Q.j41(3,"a",25),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG(2).$implicit,i=Q.XpG(2);return k.Njj(i.remove(t))}),Q.EFF(4),Q.nI1(5,"i18n"),Q.k0s(),Q.bVm()}if(2&e){Q.XpG(2);const e=Q.sdS(1);Q.R7$(),Q.Y8G("ngIf",e.loading),Q.R7$(3),Q.JRh(Q.bMT(5,2,"remove"))}}function Je(e,t){if(1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",21),Q.DNE(2,Xe,3,3,"span",22)(3,He,2,1,"ng-container",14)(4,$e,6,4,"ng-container",14),Q.bVm()),2&e){const e=Q.XpG().$implicit,t=Q.sdS(1),i=Q.XpG(2);Q.R7$(2),Q.Y8G("ngIf",e.configured),Q.R7$(),Q.Y8G("ngIf",e.configured&&!t.loading),Q.R7$(),Q.Y8G("ngIf",i.keysConfiguredCount>1&&e.configured)}}function Ze(e,t){if(1&e&&(Q.j41(0,"li",20,1),Q.DNE(2,Je,5,3,"ng-container",14),Q.k0s()),2&e){const e=t.$implicit;Q.Y8G("appApiAction",e.removePromise),Q.R7$(2),Q.Y8G("ngIf",e.configured)}}function _e(e,t){1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",27),Q.nI1(2,"i18n"),Q.bVm()),2&e&&(Q.R7$(),Q.Y8G("ariaLabel",Q.bMT(2,1,"loading")))}function et(e,t){1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",27),Q.nI1(2,"i18n"),Q.EFF(3),Q.nI1(4,"i18n"),Q.bVm()),2&e&&(Q.R7$(),Q.Y8G("ariaLabel",Q.bMT(2,2,"loading")),Q.R7$(2),Q.SpI(" ",Q.bMT(4,4,"twoFactorU2fWaiting"),"... "))}function tt(e,t){1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",28),Q.EFF(2),Q.nI1(3,"i18n"),Q.bVm()),2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,1,"twoFactorU2fClickSave")," "))}function it(e,t){1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",29),Q.EFF(2),Q.nI1(3,"i18n"),Q.bVm()),2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,1,"twoFactorU2fProblemReadingTryAgain")," "))}function nt(e,t){if(1&e&&(Q.qex(0),Q.DNE(1,et,5,6,"ng-container",14)(2,tt,4,3,"ng-container",14)(3,it,4,3,"ng-container",14),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("ngIf",e.webAuthnListening),Q.R7$(),Q.Y8G("ngIf",e.webAuthnResponse),Q.R7$(),Q.Y8G("ngIf",e.webAuthnError)}}function rt(e,t){if(1&e&&(Q.j41(0,"button",30),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.Y8G("bitAction",e.disable),Q.R7$(),Q.SpI(" ",Q.bMT(2,2,"disableAllKeys")," ")}}function st(e,t){if(1&e&&(Q.j41(0,"form",3)(1,"bit-dialog",4),Q.nI1(2,"i18n"),Q.nI1(3,"i18n"),Q.qex(4,5),Q.DNE(5,Ke,4,7,"bit-callout",6),Q.j41(6,"ul",7),Q.DNE(7,Ze,3,2,"li",8),Q.k0s(),Q.nrm(8,"hr"),Q.j41(9,"p",9),Q.EFF(10),Q.nI1(11,"i18n"),Q.k0s(),Q.j41(12,"ol",9)(13,"li"),Q.EFF(14),Q.nI1(15,"i18n"),Q.k0s(),Q.j41(16,"li"),Q.EFF(17),Q.nI1(18,"i18n"),Q.k0s(),Q.j41(19,"li"),Q.EFF(20),Q.nI1(21,"i18n"),Q.k0s(),Q.j41(22,"li"),Q.EFF(23),Q.nI1(24,"i18n"),Q.k0s()(),Q.j41(25,"div",10)(26,"bit-form-field",11)(27,"bit-label"),Q.EFF(28),Q.nI1(29,"i18n"),Q.k0s(),Q.nrm(30,"input",12),Q.k0s()(),Q.j41(31,"button",13,0),Q.EFF(33),Q.nI1(34,"i18n"),Q.k0s(),Q.DNE(35,_e,3,3,"ng-container",14)(36,nt,4,3,"ng-container",14),Q.bVm(),Q.qex(37,15),Q.j41(38,"button",16),Q.EFF(39),Q.nI1(40,"i18n"),Q.k0s(),Q.DNE(41,rt,3,4,"button",17),Q.j41(42,"button",18),Q.EFF(43),Q.nI1(44,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()()),2&e){const e=Q.sdS(32),t=Q.XpG();Q.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),Q.R7$(),Q.Y8G("title",Q.bMT(2,21,"twoStepLogin"))("subtitle",Q.bMT(3,23,"webAuthnTitle")),Q.R7$(4),Q.Y8G("ngIf",t.enabled),Q.R7$(2),Q.Y8G("ngForOf",t.keys),Q.R7$(3),Q.SpI("",Q.bMT(11,25,"twoFactorWebAuthnAdd"),":"),Q.R7$(4),Q.JRh(Q.bMT(15,27,"twoFactorU2fGiveName")),Q.R7$(3),Q.JRh(Q.bMT(18,29,"twoFactorU2fPlugInReadKey")),Q.R7$(3),Q.JRh(Q.bMT(21,31,"twoFactorU2fTouchButton")),Q.R7$(3),Q.JRh(Q.bMT(24,33,"twoFactorU2fSaveForm")),Q.R7$(5),Q.JRh(Q.bMT(29,35,"name")),Q.R7$(3),Q.Y8G("bitAction",t.readKey)("disabled",e.loading()||t.webAuthnListening||!t.keyIdAvailable||t.formGroup.invalid),Q.R7$(2),Q.SpI(" ",Q.bMT(34,37,"readKey")," "),Q.R7$(2),Q.Y8G("ngIf",e.loading()),Q.R7$(),Q.Y8G("ngIf",!e.loading()),Q.R7$(2),Q.Y8G("disabled",!t.webAuthnResponse),Q.R7$(),Q.SpI(" ",Q.bMT(40,39,"save")," "),Q.R7$(2),Q.Y8G("ngIf",t.enabled),Q.R7$(2),Q.SpI(" ",Q.bMT(44,41,"close")," ")}}class ot extends ie.g{constructor(e,t,i,n,r,s,o,a,l,c){super(i,n,r,o,a,l,c),this.data=e,this.dialogRef=t,this.ngZone=s,this.type=h.R.WebAuthn,this.name="",this.keys=[],this.keyIdAvailable=null,this.keysConfiguredCount=0,this.webAuthnError=!1,this.webAuthnListening=!1,this.webAuthnResponse=null,this.componentName="app-two-factor-webauthn",this.submit=()=>Le(this,void 0,void 0,function*(){return null==this.webAuthnResponse||null==this.keyIdAvailable?Promise.reject():this.enable()}),this.disable=()=>Le(this,void 0,void 0,function*(){yield this.disableMethod(),this.enabled||(this.onUpdated.emit(this.enabled),this.dialogRef.close())}),this.readKey=()=>Le(this,void 0,void 0,function*(){if(null==this.keyIdAvailable)return;const e=yield this.buildRequestModel(K.V);this.challengePromise=this.twoFactorService.getTwoFactorWebAuthnChallenge(e);const t=yield this.challengePromise;this.readDevice(t)}),this.formGroup=new j.gE({name:new j.MJ({value:"",disabled:!1},j.k0.required)}),this.auth(e)}auth(e){super.auth(e),this.processResponse(e.response)}enable(){return Le(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(Ne);if(null==this.webAuthnResponse||null==this.keyIdAvailable)throw new Error("WebAuthn response or key ID is missing");e.deviceResponse=this.webAuthnResponse,e.id=this.keyIdAvailable,e.name=this.formGroup.value.name||"";const t=yield this.twoFactorService.putTwoFactorWebAuthn(e);this.processResponse(t),this.toastService.showToast({title:this.i18nService.t("success"),message:this.i18nService.t("twoFactorProviderEnabled"),variant:"success"}),this.onUpdated.emit(t.enabled)})}remove(e){return Le(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(je);i.id=e.id;try{e.removePromise=this.twoFactorService.deleteTwoFactorWebAuthn(i);const t=yield e.removePromise;e.removePromise=null,yield this.processResponse(t)}catch(n){this.logService.error(n)}})}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}findNextAvailableKeyId(e){for(let t=1;t<=e.size+1;t++)if(!e.has(t))return t;throw new Error("Unable to find next available key ID")}processResponse(e){e.keys&&0!==e.keys.length||(e.keys=[]),this.resetWebAuthn(),this.keys=[],this.keyIdAvailable=null;const t=this.formGroup.get("name");t&&(t.enable(),t.setValue("")),this.keysConfiguredCount=0;for(const r of e.keys)this.keysConfiguredCount++,this.keys.push({id:r.id,name:r.name,configured:!0,migrated:r.migrated,removePromise:null});const i=new Set(e.keys.map(e=>e.id)),n=this.findNextAvailableKeyId(i);this.keys.push({id:n,name:"",configured:!1,removePromise:null}),this.keyIdAvailable=n,this.enabled=e.enabled,this.onUpdated.emit(this.enabled)}static open(e,t){return e.open(ot,t)}}ot.ɵfac=function(e){return new(e||ot)(Q.rXU(I.Qs),Q.rXU(ne.ce),Q.rXU(g.fz),Q.rXU(T.W),Q.rXU(oe.y),Q.rXU(Q.SKi),Q.rXU(q.K),Q.rXU(se.i),Q.rXU(ne.o3),Q.rXU(re.f))},ot.ɵcmp=Q.VBU({type:ot,selectors:[["app-two-factor-setup-webauthn"]],features:[Q.Vt3],decls:1,vars:1,consts:[["readKeyBtn",""],["removeKeyBtn",""],[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"title","subtitle"],["bitDialogContent",""],["type","success","icon","bwi-check-circle",3,"title",4,"ngIf"],[1,"bwi-ul"],[3,"appApiAction",4,"ngFor","ngForOf"],["bitTypography","body1"],[1,"tw-flex"],[1,"tw-basis-1/2"],["bitInput","","type","text","formControlName","name"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",1,"tw-mr-2",3,"bitAction","disabled"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"disabled"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],[3,"appApiAction"],["name","bwi-key",1,"bwi-li"],["bitTypography","body1","class","tw-font-medium",4,"ngIf"],["bitTypography","body1",1,"tw-font-medium"],["name","bwi-spinner","class","bwi-spin tw-text-muted bwi-fw",3,"ariaLabel",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click"],["name","bwi-spinner",1,"bwi-spin","tw-text-muted","bwi-fw",3,"ariaLabel"],["name","bwi-spinner",1,"bwi-spin","tw-text-muted",3,"ariaLabel"],["name","bwi-check-circle",1,"tw-text-success"],["name","bwi-exclamation-triangle",1,"tw-text-danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&Q.DNE(0,st,45,43,"form",2),2&e&&Q.Y8G("ngIf",t.authed)},dependencies:[te.C,Pe.p,ge.$,ve.L,B.t,D.Q,_.j,pe.G,w.MD,w.Sq,w.bT,b.P,F.I,P.m,R.hJ,W.L,ce.j,de.J,ue.h,$.o,he.R,Y.p,ze.k,Ye.Y,Z.V,Ae.g,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,E.E,M.r,S.$Z],encapsulation:2});class at extends K.V{}var lt=i(22191),ct=i(47135),dt=i(90246),ut=i(93199),ht=i(36288),At=i(50352),pt=i(25740),gt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function vt(e,t){1&e&&(Q.j41(0,"bit-callout",18),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()),2&e&&(Q.Y8G("title",Q.mNQ(Q.bMT(1,3,"enabled"))),Q.R7$(2),Q.SpI(" ",Q.bMT(3,5,"twoStepLoginProviderEnabled")," "))}function ft(e,t){1&e&&(Q.j41(0,"bit-form-field"),Q.nrm(1,"input",22),Q.k0s())}function mt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"div",23)(1,"span",24),Q.EFF(2),Q.k0s(),Q.j41(3,"button",25),Q.nI1(4,"i18n"),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG().index,i=Q.XpG(2);return k.Njj(i.remove(t))}),Q.k0s()()}if(2&e){const e=Q.XpG().index,t=Q.XpG(2);Q.R7$(2),Q.JRh(t.keys[e].existingKey),Q.R7$(),Q.Y8G("label",Q.mNQ(Q.bMT(4,3,"remove")))}}function yt(e,t){if(1&e&&(Q.j41(0,"div",19)(1,"bit-label"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.DNE(4,ft,2,0,"bit-form-field",20)(5,mt,5,5,"div",21),Q.k0s()),2&e){const e=t.index,i=Q.XpG(2);Q.Y8G("formGroupName",e),Q.R7$(2),Q.JRh(Q.i5U(3,4,"yubikeyX",(e+1).toString())),Q.R7$(2),Q.Y8G("ngIf",!i.keys[e].existingKey),Q.R7$(),Q.Y8G("ngIf",i.keys[e].existingKey)}}function Ct(e,t){if(1&e&&(Q.j41(0,"button",26),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.Y8G("bitAction",e.disable),Q.R7$(),Q.SpI(" ",Q.bMT(2,2,"disableAllKeys")," ")}}function wt(e,t){if(1&e&&(Q.j41(0,"form",1)(1,"bit-dialog",2),Q.nI1(2,"i18n"),Q.qex(3,3),Q.DNE(4,vt,4,7,"bit-callout",4),Q.j41(5,"bit-callout",5)(6,"p",6),Q.EFF(7),Q.nI1(8,"i18n"),Q.k0s(),Q.j41(9,"ul",7)(10,"li"),Q.EFF(11),Q.nI1(12,"i18n"),Q.k0s(),Q.j41(13,"li"),Q.EFF(14),Q.nI1(15,"i18n"),Q.k0s()()(),Q.j41(16,"p",6),Q.EFF(17),Q.nI1(18,"i18n"),Q.k0s(),Q.j41(19,"ol",6)(20,"li"),Q.EFF(21),Q.nI1(22,"i18n"),Q.k0s(),Q.j41(23,"li"),Q.EFF(24),Q.nI1(25,"i18n"),Q.k0s(),Q.j41(26,"li"),Q.EFF(27),Q.nI1(28,"i18n"),Q.k0s(),Q.j41(29,"li"),Q.EFF(30),Q.nI1(31,"i18n"),Q.k0s()(),Q.nrm(32,"hr"),Q.j41(33,"div",8),Q.DNE(34,yt,6,7,"div",9),Q.k0s(),Q.j41(35,"p",10),Q.EFF(36),Q.nI1(37,"i18n"),Q.k0s(),Q.j41(38,"bit-form-control",11)(39,"bit-label"),Q.EFF(40),Q.nI1(41,"i18n"),Q.k0s(),Q.nrm(42,"input",12),Q.j41(43,"bit-hint",13),Q.EFF(44),Q.nI1(45,"i18n"),Q.k0s()(),Q.bVm(),Q.qex(46,14),Q.j41(47,"button",15),Q.EFF(48),Q.nI1(49,"i18n"),Q.k0s(),Q.DNE(50,Ct,3,4,"button",16),Q.j41(51,"button",17),Q.EFF(52),Q.nI1(53,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()()),2&e){const e=Q.XpG();Q.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),Q.R7$(),Q.Y8G("title",Q.bMT(2,22,"twoStepLogin"))("subtitle","YubiKey"),Q.R7$(3),Q.Y8G("ngIf",e.enabled),Q.R7$(3),Q.JRh(Q.bMT(8,24,"twoFactorYubikeyWarning")),Q.R7$(4),Q.JRh(Q.bMT(12,26,"twoFactorYubikeySupportUsb")),Q.R7$(3),Q.JRh(Q.bMT(15,28,"twoFactorYubikeySupportMobile")),Q.R7$(3),Q.SpI("",Q.bMT(18,30,"twoFactorYubikeyAdd"),":"),Q.R7$(4),Q.JRh(Q.bMT(22,32,"twoFactorYubikeyPlugIn")),Q.R7$(3),Q.JRh(Q.bMT(25,34,"twoFactorYubikeySelectKey")),Q.R7$(3),Q.JRh(Q.bMT(28,36,"twoFactorYubikeyTouchButton")),Q.R7$(3),Q.JRh(Q.bMT(31,38,"twoFactorYubikeySaveForm")),Q.R7$(4),Q.Y8G("ngForOf",e.keys),Q.R7$(2),Q.JRh(Q.bMT(37,40,"nfcSupport")),Q.R7$(2),Q.Y8G("disableMargin",!0),Q.R7$(2),Q.JRh(Q.bMT(41,42,"twoFactorYubikeySupportsNfc")),Q.R7$(4),Q.JRh(Q.bMT(45,44,"twoFactorYubikeySupportsNfcDesc")),Q.R7$(4),Q.SpI(" ",Q.bMT(49,46,"save")," "),Q.R7$(2),Q.Y8G("ngIf",e.enabled),Q.R7$(),Q.Y8G("bitDialogClose",e.enabled),Q.R7$(),Q.SpI(" ",Q.bMT(53,48,"close")," ")}}class It extends ie.g{get keysFormControl(){var e;return null===(e=this.formGroup)||void 0===e?void 0:e.controls.formKeys.controls}get anyKeyHasNfcFormControl(){var e;return null===(e=this.formGroup)||void 0===e?void 0:e.controls.anyKeyHasNfc}constructor(e,t,i,n,r,s,o,a,l){super(t,i,n,r,s,o,l),this.data=e,this.formBuilder=a,this.toastService=l,this.type=h.R.Yubikey,this.keys=[],this.anyKeyHasNfc=!1,this.componentName="app-two-factor-yubikey",this.submit=()=>gt(this,void 0,void 0,function*(){this.formGroup&&(this.formGroup.markAllAsTouched(),this.formGroup.invalid||(yield this.enable()))}),this.disable=()=>gt(this,void 0,void 0,function*(){if(yield this.disableMethod(),!this.enabled)for(let e=0;e<this.keys.length;e++)this.remove(e)})}ngOnInit(){this.auth(this.data),this.formGroup=this.formBuilder.group({formKeys:this.formBuilder.array([]),anyKeyHasNfc:this.formBuilder.control(this.anyKeyHasNfc)}),this.refreshFormArrayData()}refreshFormArrayData(){if(!this.formGroup)return;const e=this.formGroup.get("formKeys");e.clear(),this.keys.forEach(t=>{const i=this.formBuilder.group({key:t.key,existingKey:t.existingKey});e.push(i)})}auth(e){super.auth(e),this.processResponse(e.response)}enable(){return gt(this,void 0,void 0,function*(){var e,t,i,n,r,s,o,a,l,c,d;if(!this.formGroup)return;const u=this.formGroup.controls.formKeys.value,h=yield this.buildRequestModel(at);h.key1=null!=u&&u.length>0&&null!==(t=null===(e=u[0])||void 0===e?void 0:e.key)&&void 0!==t?t:"",h.key2=null!=u&&u.length>1&&null!==(n=null===(i=u[1])||void 0===i?void 0:i.key)&&void 0!==n?n:"",h.key3=null!=u&&u.length>2&&null!==(s=null===(r=u[2])||void 0===r?void 0:r.key)&&void 0!==s?s:"",h.key4=null!=u&&u.length>3&&null!==(a=null===(o=u[3])||void 0===o?void 0:o.key)&&void 0!==a?a:"",h.key5=null!=u&&u.length>4&&null!==(c=null===(l=u[4])||void 0===l?void 0:l.key)&&void 0!==c?c:"",h.nfc=null!==(d=this.formGroup.value.anyKeyHasNfc)&&void 0!==d&&d,this.processResponse(yield this.twoFactorService.putTwoFactorYubiKey(h)),this.refreshFormArrayData(),this.toastService.showToast({title:this.i18nService.t("success"),message:this.i18nService.t("yubikeysUpdated"),variant:"success"}),this.onUpdated.emit(this.enabled)})}remove(e){this.keys[e].key="",this.keys[e].existingKey="",this.keysFormControl&&this.keysFormControl[e]&&this.keysFormControl[e].setValue({existingKey:"",key:""})}processResponse(e){this.enabled=e.enabled,this.anyKeyHasNfc=e.nfc||!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)}]}padRight(e,t="•",i=44){if(null==e||null==t||e.length>=i)return e;const n=(i-e.length)/t.length;for(let r=0;r<n;r++)e+=t;return e}static open(e,t){return e.open(It,t)}}It.ɵfac=function(e){return new(e||It)(Q.rXU(I.Qs),Q.rXU(g.fz),Q.rXU(T.W),Q.rXU(oe.y),Q.rXU(q.K),Q.rXU(se.i),Q.rXU(ne.o3),Q.rXU(j.ok),Q.rXU(re.f))},It.ɵcmp=Q.VBU({type:It,selectors:[["app-two-factor-setup-yubikey"]],features:[Q.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"title","subtitle"],["bitDialogContent",""],["type","success","icon","bwi-check-circle",3,"title",4,"ngIf"],["type","warning"],["bitTypography","body1"],["bitTypography","body1",1,"tw-mb-0"],["formArrayName","formKeys",1,"tw-flex","tw-flex-col","tw-mt-4"],[3,"formGroupName",4,"ngFor","ngForOf"],["bitTypography","body1",1,"tw-font-medium","tw-mb-2"],[3,"disableMargin"],["bitCheckbox","","type","checkbox","formControlName","anyKeyHasNfc"],[1,"tw-text-sm"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitDialogClose"],["type","success","icon","bwi-check-circle",3,"title"],[3,"formGroupName"],[4,"ngIf"],["class","tw-flex tw-justify-between tw-mb-4",4,"ngIf"],["bitInput","","type","password","formControlName","key","appInputVerbatim",""],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-mr-2","tw-self-center"],["bitIconButton","bwi-minus-circle","type","button","buttonType","dangerGhost",3,"click","label"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&Q.DNE(0,wt,54,50,"form",0),2&e&&Q.Y8G("ngIf",t.authed)},dependencies:[w.MD,w.Sq,w.bT,j.X1,j.qT,j.me,j.Zm,j.BC,j.cb,j.j4,j.JD,j.$R,j.v8,Y.p,me.q,b.P,F.I,P.m,R.hJ,W.L,dt.f,ce.j,ut.I,de.J,ue.h,B.t,D.Q,lt.Q,ht.s,_.j,pe.G,ct.q,At.P,Z.V,E.E,M.r,J.x,te.C,Pe.p,ge.$,ve.L,pt.$],encapsulation:2});var bt=i(6804),Bt=i(18499),Et=i(58329),St=i(75556),Qt=i(90300),kt=i(4017),Tt=i(91962),Ft=i(49112),Pt=i(6056),Rt=i(10672),Dt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Mt=e=>({"mt-5":e});function xt(e,t){1&e&&Q.nrm(0,"app-header")}function Ot(e,t){1&e&&(Q.j41(0,"h1"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.JRh(Q.bMT(2,1,"twoStepLogin")))}function Gt(e,t){1&e&&(Q.j41(0,"h1"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.JRh(Q.bMT(2,1,"twoStepLoginEnforcement")))}function Ut(e,t){if(1&e&&(Q.j41(0,"div",6),Q.DNE(1,Ot,3,3,"h1",1)(2,Gt,3,3,"h1",1),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("ngIf",!e.organizationId||!e.isEnterpriseOrg),Q.R7$(),Q.Y8G("ngIf",e.organizationId&&e.isEnterpriseOrg)}}function Vt(e,t){1&e&&(Q.j41(0,"p"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.JRh(Q.bMT(2,1,"twoStepLoginDesc")))}function jt(e,t){1&e&&(Q.qex(0),Q.EFF(1),Q.nI1(2,"i18n"),Q.j41(3,"a",8),Q.EFF(4),Q.nI1(5,"i18n"),Q.k0s(),Q.nrm(6,"br"),Q.EFF(7),Q.nI1(8,"i18n"),Q.nrm(9,"br")(10,"br"),Q.j41(11,"p"),Q.EFF(12),Q.nI1(13,"i18n"),Q.k0s(),Q.bVm()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,4,"twoStepLoginEnterpriseDescStart")," "),Q.R7$(3),Q.SpI("",Q.bMT(5,6,"twoStepLoginPolicy"),"."),Q.R7$(3),Q.SpI(" ",Q.bMT(8,8,"twoStepLoginOrganizationDuoDesc")," "),Q.R7$(5),Q.JRh(Q.bMT(13,10,"twoStepLoginOrganizationSsoDesc")))}function Nt(e,t){1&e&&(Q.EFF(0),Q.nI1(1,"i18n"),Q.nrm(2,"br"),Q.EFF(3),Q.nI1(4,"i18n")),2&e&&(Q.SpI(" ",Q.bMT(1,2,"twoStepLoginTeamsDesc")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(4,4,"twoStepLoginOrganizationDuoDesc")," "))}function zt(e,t){if(1&e&&(Q.qex(0),Q.j41(1,"p"),Q.DNE(2,jt,14,12,"ng-container",7)(3,Nt,5,6,"ng-template",null,0,Q.C5r),Q.k0s(),Q.bVm()),2&e){const e=Q.sdS(4),t=Q.XpG();Q.R7$(2),Q.Y8G("ngIf",t.isEnterpriseOrg)("ngIfElse",e)}}function Yt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-callout",9)(1,"p"),Q.EFF(2),Q.k0s(),Q.j41(3,"button",10),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG();return k.Njj(t.recoveryCode())}),Q.EFF(4),Q.nI1(5,"i18n"),Q.k0s()()}if(2&e){const e=Q.XpG();Q.R7$(2),Q.JRh(e.recoveryCodeWarningMessage),Q.R7$(2),Q.SpI(" ",Q.bMT(5,2,"viewRecoveryCode")," ")}}function Lt(e,t){1&e&&(Q.j41(0,"small"),Q.nrm(1,"bit-icon",11),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.Y8G("ariaLabel",Q.bMT(2,1,"loading")))}function Kt(e,t){1&e&&(Q.j41(0,"bit-callout",9),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"twoStepLoginPolicyUserWarning")," "))}function Xt(e,t){1&e&&(Q.qex(0),Q.nrm(1,"bit-icon",22),Q.nI1(2,"i18n"),Q.bVm()),2&e&&(Q.R7$(),Q.Y8G("ariaLabel",Q.bMT(2,1,"enabled")))}function qt(e,t){1&e&&Q.nrm(0,"app-premium-badge",23)}function Ht(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",24),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG().$implicit,i=Q.XpG();return k.Njj(i.disablePremium2faTypeForNonPremiumUser(t.type))}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"disable")," "))}function Wt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",25),Q.nI1(1,"async"),Q.bIt("click",function(){k.eBV(e);const t=Q.XpG().$implicit,i=Q.XpG();return k.Njj(i.manage(t.type))}),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()}if(2&e){const e=Q.XpG().$implicit,t=Q.XpG();Q.Y8G("disabled",!Q.bMT(1,2,t.canAccessPremium$)&&e.premium),Q.R7$(2),Q.SpI(" ",Q.bMT(3,4,"manage")," ")}}function $t(e,t){if(1&e&&(Q.j41(0,"bit-item")(1,"div",12),Q.nrm(2,"auth-two-factor-icon",13),Q.k0s(),Q.j41(3,"div",14)(4,"h3",15)(5,"div",16),Q.EFF(6),Q.k0s(),Q.DNE(7,Xt,3,3,"ng-container",1)(8,qt,1,0,"app-premium-badge",17),Q.k0s(),Q.j41(9,"div",18),Q.EFF(10),Q.k0s()(),Q.j41(11,"bit-item-action",19),Q.nVh(12,Ht,3,3,"button",20),Q.nI1(13,"async"),Q.vZN(14,Wt,4,6,"button",21),Q.k0s()()),2&e){const e=t.$implicit,i=Q.XpG();Q.HbH(Q.VkB("tw-py-4 providers-2fa-",e.type)),Q.R7$(2),Q.Y8G("provider",e.type)("name",e.name),Q.R7$(3),Q.Aen(e.enabled||e.premium?"display:inline-block":""),Q.R7$(),Q.SpI(" ",e.name," "),Q.R7$(),Q.Y8G("ngIf",e.enabled),Q.R7$(),Q.Y8G("ngIf",e.premium),Q.R7$(2),Q.JRh(e.description),Q.R7$(2),Q.vxM(e.premium&&e.enabled&&!Q.bMT(13,12,i.canAccessPremium$)?12:14)}}class Jt{constructor(e,t,i,s,o,a,l,c,d,u){this.dialogService=e,this.twoFactorService=t,this.messagingService=i,this.policyService=s,this.accountService=a,this.configService=l,this.i18nService=c,this.userVerificationService=d,this.toastService=u,this.providers=[],this.showPolicyWarning=!1,this.loading=!0,this.tabbedHeader=!0,this.destroy$=new n.B,this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,r.n)(e=>o.hasPremiumFromAnySource$(e.id)))}ngOnInit(){return Dt(this,void 0,void 0,function*(){this.recoveryCodeWarningMessage=this.i18nService.t("yourSingleUseRecoveryCode");for(const e in g.Ow){if(!g.Ow.hasOwnProperty(e))continue;const t=g.Ow[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.accountService.activeAccount$.pipe(p.F6,(0,r.n)(e=>this.policyService.policyAppliesToUser$(u.tt.TwoFactorAuthentication,e)),(0,s.Q)(this.destroy$)).subscribe(e=>{this.twoFactorAuthPolicyAppliesToActiveUser=e}),yield this.load()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}load(){return Dt(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 Dt(this,void 0,void 0,function*(){const t=bt.S.open(this.dialogService,{data:{type:e,organizationId:this.organizationId}});return yield(0,o.s)(t.closed)})}disablePremium2faTypeForNonPremiumUser(e){return Dt(this,void 0,void 0,function*(){const t=yield d.GA.open(this.dialogService,{title:"twoStepLogin",verificationType:{type:"custom",verificationFn:t=>Dt(this,void 0,void 0,function*(){const i=yield this.userVerificationService.buildRequest(t,A.G);return i.type=e,yield this.twoFactorService.putTwoFactorDisable(i),!0})}});"cancel"!==t.userAction&&t.verificationSuccess&&(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepDisabled")}),this.updateStatus(!1,e))})}manage(e){return Dt(this,void 0,void 0,function*(){var t;switch(null===(t=this.twoFactorSetupSubscription)||void 0===t||t.unsubscribe(),e){case h.R.Authenticator:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=Qe.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,h.R.Authenticator)});break}case h.R.Yubikey:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;It.open(this.dialogService,{data:t}).componentInstance.onUpdated.pipe((0,s.Q)(this.destroy$)).subscribe(e=>{this.updateStatus(e,h.R.Yubikey)});break}case h.R.Duo:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=ke.U.open(this.dialogService,{data:{authResponse:t}});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,h.R.Duo)});break}case h.R.Email:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=Ve.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,h.R.Email)});break}case h.R.WebAuthn:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=ot.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onUpdated.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,h.R.WebAuthn)});break}}})}recoveryCode(){return Dt(this,void 0,void 0,function*(){const e=yield this.callTwoFactorVerifyDialog(-1);if(e){const t=V.open(this.dialogService,{data:e});yield(0,o.s)(t.closed)}})}getTwoFactorProviders(){return this.twoFactorService.getEnabledTwoFactorProviders()}filterProvider(e){return e===h.R.OrganizationDuo}updateStatus(e,t){this.providers.forEach(i=>{i.type===t&&void 0!==e&&(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.productTierType)===v.K_.Enterprise}}Jt.ɵfac=function(e){return new(e||Jt)(Q.rXU(ne.o3),Q.rXU(g.fz),Q.rXU(f.U),Q.rXU(Bt.m),Q.rXU(Et.Q),Q.rXU(ae.D),Q.rXU(le.w),Q.rXU(T.W),Q.rXU(se.i),Q.rXU(re.f))},Jt.ɵcmp=Q.VBU({type:Jt,selectors:[["app-two-factor-setup"]],decls:14,vars:17,consts:[["teamsDescription",""],[4,"ngIf"],["class","tw-mt-6 tw-mb-2 tw-pb-2.5",4,"ngIf"],["type","warning",4,"ngIf"],[3,"ngClass"],[3,"class",4,"ngFor","ngForOf"],[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[4,"ngIf","ngIfElse"],["bitLink","","routerLink","../policies"],["type","warning"],["type","button","bitButton","","buttonType","warning",3,"click"],["name","bwi-spinner",1,"bwi-spin","bwi-fw","tw-text-muted",3,"ariaLabel"],["slot","start",1,"tw-min-w-[120px]","tw-flex","tw-justify-center"],[1,"tw-flex","tw-items-center",3,"provider","name"],["bit-item-content","",1,"tw-px-4"],[1,"tw-mb-0"],[1,"tw-font-medium","tw-text-base"],["class","tw-ml-2",4,"ngIf"],[1,"tw-mt-2","tw-text-wrap"],["slot","end"],["type","button","bitButton","","buttonType","danger"],["type","button","bitButton","","buttonType","secondary",3,"disabled"],["name","bwi-check",1,"tw-text-success-600","bwi-fw","tw-ml-2",3,"ariaLabel"],[1,"tw-ml-2"],["type","button","bitButton","","buttonType","danger",3,"click"],["type","button","bitButton","","buttonType","secondary",3,"click","disabled"]],template:function(e,t){1&e&&(Q.DNE(0,xt,1,0,"app-header",1),Q.j41(1,"bit-container"),Q.DNE(2,Ut,3,2,"div",2)(3,Vt,3,3,"p",1)(4,zt,5,2,"ng-container",1)(5,Yt,6,4,"bit-callout",3),Q.j41(6,"h2",4),Q.EFF(7),Q.nI1(8,"i18n"),Q.DNE(9,Lt,3,3,"small",1),Q.k0s(),Q.DNE(10,Kt,3,3,"bit-callout",3),Q.j41(11,"bit-item-group"),Q.nI1(12,"i18n"),Q.DNE(13,$t,15,14,"bit-item",5),Q.k0s()()),2&e&&(Q.Y8G("ngIf",null!=t.organizationId),Q.R7$(2),Q.Y8G("ngIf",null==t.organizationId),Q.R7$(),Q.Y8G("ngIf",!t.organizationId),Q.R7$(),Q.Y8G("ngIf",t.organizationId),Q.R7$(),Q.Y8G("ngIf",!t.organizationId),Q.R7$(),Q.Y8G("ngClass",Q.eq3(15,Mt,!t.organizationId)),Q.R7$(),Q.SpI(" ",Q.bMT(8,11,"providers")," "),Q.R7$(2),Q.Y8G("ngIf",t.loading),Q.R7$(),Q.Y8G("ngIf",t.showPolicyWarning),Q.R7$(),Q.BMQ("aria-label",Q.bMT(12,13,"providers")),Q.R7$(2),Q.Y8G("ngForOf",t.providers))},dependencies:[m.k,St.J,Qt.g,kt.D,Tt._,y.G,Ft.f,c.a,l.U,C.G,w.YU,w.Sq,w.bT,Pt.Wk,D.Q,pe.G,Rt.H,he.R,Ae.g,w.Jj,pt.$],encapsulation:2})},43749(e,t,i){"use strict";i.d(t,{$H:()=>d});var n=i(94573),r=i(33277),s=i(83731),o=i(25479),a=i(50147),l=i(33812);const c=["focus-visible:tw-ring-2","focus-visible:tw-ring-offset-1","focus-visible:tw-ring-border-focus","focus-visible:!tw-border-transparent","focus-visible:tw-z-10"];class d{constructor(){this.buttonType=(0,n.geq)("secondary"),this.block=(0,n.hFB)(!1,{transform:n.L39}),this.loading=(0,n.geq)(!1),this.disabled=(0,n.geq)(!1),this.disabledAttr=(0,r.EW)(()=>null!=this.disabled()&&!1!==this.disabled()||this.loading()),this.showLoadingStyle=(0,s.ot)((0,s.br)(this.loading).pipe((0,a.s)(e=>(0,o.Y)(e?75:0)))),this.colorClassList=(0,r.EW)(()=>(({buttonType:e,isDisabled:t})=>{const i=(e||"secondary").toLowerCase(),n={primary:["tw-border-border-brand","tw-bg-bg-brand","hover:tw-bg-bg-brand-strong","hover:tw-border-border-brand-strong","aria-expanded:tw-bg-bg-brand-strong","aria-expanded:tw-border-border-brand-strong","focus-visible:tw-bg-bg-brand-strong","focus-visible:tw-border-border-brand-strong"],primaryOutline:["tw-border-border-brand","tw-text-fg-brand","hover:tw-border-border-brand-strong","hover:tw-text-fg-brand-strong","aria-expanded:tw-border-border-brand-strong","aria-expanded:tw-text-fg-brand-strong","focus-visible:tw-text-fg-brand-strong"],primaryGhost:["tw-text-fg-heading","hover:tw-text-fg-brand","aria-expanded:tw-text-fg-brand","focus-visible:tw-text-fg-brand"],secondary:["tw-bg-bg-secondary","tw-border-border-base","tw-text-fg-heading","hover:tw-bg-bg-quaternary","hover:tw-text-fg-brand-strong","aria-expanded:tw-bg-bg-quaternary","aria-expanded:tw-text-fg-brand-strong","focus-visible:tw-text-fg-brand-strong","focus-visible:tw-bg-bg-quaternary"],subtle:["tw-border-border-contrast","tw-bg-bg-contrast","hover:tw-bg-bg-contrast-strong","hover:tw-border-border-contrast-strong","aria-expanded:tw-bg-bg-contrast-strong","aria-expanded:tw-border-border-contrast-strong","focus-visible:tw-border-border-contrast-strong","focus-visible:tw-bg-bg-contrast-strong"],subtleOutline:["tw-border-border-contrast","tw-text-fg-heading","hover:tw-border-border-contrast-strong","hover:tw-text-fg-heading","aria-expanded:tw-border-border-contrast-strong","aria-expanded:tw-text-fg-heading","focus-visible:tw-text-fg-heading"],subtleGhost:["tw-text-fg-heading","hover:tw-text-fg-heading","aria-expanded:tw-text-fg-heading","focus-visible:tw-text-fg-heading"],danger:["tw-bg-bg-danger","tw-border-border-danger","hover:tw-bg-bg-danger-strong","hover:tw-border-border-danger-strong","hover:tw-text-fg-contrast","aria-expanded:tw-bg-bg-danger-strong","aria-expanded:tw-border-border-danger-strong","aria-expanded:tw-text-fg-contrast","focus-visible:tw-border-border-danger-strong","focus-visible:tw-text-fg-contrast","focus-visible:tw-bg-bg-danger-strong"],dangerOutline:["tw-border-border-danger","tw-text-fg-danger","hover:tw-border-border-danger-strong","hover:!tw-text-fg-danger-strong","aria-expanded:tw-border-border-danger-strong","aria-expanded:!tw-text-fg-danger-strong","focus-visible:!tw-text-fg-danger-strong"],dangerGhost:["tw-text-fg-danger","hover:tw-text-fg-danger","aria-expanded:tw-text-fg-danger","focus-visible:tw-text-fg-danger"],warning:["tw-bg-bg-warning","tw-border-border-warning","hover:tw-bg-bg-warning-strong","hover:tw-border-border-warning-strong","aria-expanded:tw-bg-bg-warning-strong","aria-expanded:tw-border-border-warning-strong","focus-visible:tw-bg-bg-warning-strong","focus-visible:tw-border-border-warning-strong"],warningOutline:["tw-border-border-warning","tw-text-fg-warning","hover:tw-border-border-warning-strong","hover:!tw-text-fg-warning-strong","aria-expanded:tw-border-border-warning-strong","aria-expanded:!tw-text-fg-warning-strong","focus-visible:!tw-text-fg-warning-strong"],warningGhost:["tw-text-fg-warning","hover:tw-text-fg-warning-strong","aria-expanded:tw-text-fg-warning-strong","focus-visible:tw-text-fg-warning-strong"],success:["tw-bg-bg-success","tw-border-border-success","hover:tw-bg-bg-success-strong","hover:tw-border-border-success-strong","aria-expanded:tw-bg-bg-success-strong","aria-expanded:tw-border-border-success-strong","focus-visible:tw-bg-bg-success-strong","focus-visible:tw-border-border-success-strong"],successOutline:["tw-border-border-success","tw-text-fg-success","hover:tw-border-border-success-strong","hover:tw-text-fg-success-strong","aria-expanded:tw-border-border-success-strong","aria-expanded:tw-text-fg-success-strong","focus-visible:tw-text-fg-success-strong"],successGhost:["tw-text-fg-success","hover:tw-text-fg-success-strong","aria-expanded:tw-text-fg-success-strong","focus-visible:tw-text-fg-success-strong"],contrast:["tw-text-fg-heading","tw-bg-bg-primary","tw-border-bg-primary","hover:tw-bg-bg-quaternary","hover:tw-text-fg-heading","hover:tw-border-bg-quaternary","aria-expanded:tw-bg-bg-quaternary","aria-expanded:tw-text-fg-heading","aria-expanded:tw-border-bg-quaternary","focus-visible:tw-text-fg-heading","focus-visible:tw-bg-bg-quaternary"],contrastOutline:["tw-border-border-contrast","tw-text-fg-contrast","hover:tw-border-border-contrast-strong","hover:tw-text-fg-contrast-strong","hover:tw-bg-bg-hover-contrast","aria-expanded:tw-border-border-contrast-strong","aria-expanded:tw-text-fg-contrast-strong","aria-expanded:tw-bg-bg-hover-contrast","focus-visible:tw-text-fg-contrast-strong","focus-visible:tw-bg-bg-hover-contrast"],contrastGhost:["tw-text-fg-contrast","hover:tw-text-fg-contrast-strong","hover:tw-bg-bg-hover-contrast","hover:tw-border-bg-hover-contrast","aria-expanded:tw-text-fg-contrast-strong","aria-expanded:tw-bg-bg-hover-contrast","aria-expanded:tw-border-bg-hover-contrast","focus-visible:tw-text-fg-contrast-strong","focus-visible:tw-bg-bg-hover-contrast","focus-visible:tw-border-bg-hover-contrast"],"side-nav":["!tw-text-fg-nav","tw-border-transparent","tw-bg-transparent","hover:tw-text-fg-nav","hover:tw-bg-bg-nav-hover","aria-expanded:!tw-text-fg-nav","aria-expanded:tw-bg-transparent","focus-visible:!tw-ring-fg-nav","focus-visible:!tw-ring-offset-bg-nav","focus-visible:!tw-text-fg-nav","focus-visible:tw-bg-bg-nav-hover","focus-visible:tw-border-transparent"],unstyled:[]},r=["tw-font-medium","tw-outline-none","tw-transition","tw-border","tw-border-solid","tw-text-center","tw-no-underline","hover:tw-no-underline","focus-visible:tw-outline-none",...c],s=["aria-disabled:!tw-text-fg-disabled","hover:!tw-text-fg-disabled","aria-disabled:tw-cursor-not-allowed","hover:tw-no-underline"],o=i.includes("outline"),a=i.includes("ghost"),l="secondary"===i,d="unstyled"===i,u=!o&&!a&&!d,h=i.includes("contrast");return t&&(a?r.push(...s,"aria-disabled:!tw-bg-transparent","hover:tw-bg-transparent","hover:tw-border-transparent"):r.push(...s,"aria-disabled:!tw-bg-bg-disabled","hover:tw-bg-bg-hover","aria-disabled:tw-border-border-base","aria-disabled:hover:tw-border-border-base","hover:tw-border-border-base")),(o||a)&&r.push("tw-bg-transparent","tw-bg-clip-padding","hover:tw-bg-bg-hover","aria-expanded:tw-bg-bg-hover","focus-visible:tw-bg-bg-hover"),u&&!l&&r.push("tw-text-fg-contrast","hover:tw-text-fg-contrast","aria-expanded:tw-text-fg-contrast"),a&&r.push("tw-border-transparent","hover:tw-border-bg-hover","aria-expanded:tw-border-bg-hover","focus-visible:tw-border-bg-hover"),d&&r.push("tw-text-current"),h&&r.push("focus-visible:!tw-ring-border-focus-contrast"),[...r,...n[e]||n.secondary]})({buttonType:this.buttonType()||"secondary",isDisabled:this.showLoadingStyle()||this.disabledAttr()}).join(" "))}}d.ɵfac=function(e){return new(e||d)},d.ɵdir=l.FsC({type:d,hostVars:2,hostBindings:function(e,t){2&e&&l.HbH(t.colorClassList())},inputs:{buttonType:[1,"buttonType"],block:[1,"block"],loading:[1,"loading"],disabled:[1,"disabled"]},outputs:{buttonType:"buttonTypeChange",loading:"loadingChange",disabled:"disabledChange"}})},43759(e,t,i){"use strict";i.d(t,{h:()=>G});var n=i(77468),r=i(94573),s=i(74208),o=i(36801),a=i(93199),l=i(86226),c=i(97553),d=i(33812),u=i(50700);let h=0;class A{constructor(e){this.i18nService=e,this.id="bit-error-"+h++,this.error=(0,r.hFB)()}get displayError(){var e,t,i,n,r,s,o;const a=this.error();if(!a)return"";switch(a[0]){case"required":return this.i18nService.t("inputRequired");case"email":return this.i18nService.t("inputEmail");case"minlength":return this.i18nService.t("inputMinLength",null===(e=a[1])||void 0===e?void 0:e.requiredLength);case"maxlength":return this.i18nService.t("inputMaxLength",null===(t=a[1])||void 0===t?void 0:t.requiredLength);case"min":return this.i18nService.t("inputMinValue",null===(i=a[1])||void 0===i?void 0:i.min);case"max":return this.i18nService.t("inputMaxValue",null===(n=a[1])||void 0===n?void 0:n.max);case"forbiddenCharacters":return this.i18nService.t("inputForbiddenCharacters",null===(r=a[1])||void 0===r?void 0:r.characters.join(", "));case"multipleEmails":return this.i18nService.t("multipleInputEmails");case"trim":return this.i18nService.t("inputTrimValidator");default:return(null===(s=a[1])||void 0===s?void 0:s.message)?null===(o=a[1])||void 0===o?void 0:o.message:a}}}A.ɵfac=function(e){return new(e||A)(d.rXU(u.W))},A.ɵcmp=d.VBU({type:A,selectors:[["bit-error"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-mt-1","tw-text-danger","tw-text-xs"],hostVars:1,hostBindings:function(e,t){2&e&&d.Avn("id",t.id)},inputs:{error:[1,"error"]},decls:2,vars:1,consts:[[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(d.Hgh(0,"i",0),d.EFF(1)),2&e&&(d.R7$(),d.SpI(" ",t.displayError))},encapsulation:2});var p=i(22949);const g=["prefixContainer"],v=["suffixContainer"],f=["*",[["bit-label"]],[["","bitPrefix",""]],[["","bitSuffix",""]],[["bit-hint"]]],m=(e,t)=>[e,t],y=(e,t)=>({"tw-border-secondary-300/50 tw-border-b tw-pb-[2px]":e,"tw-border-transparent tw-pb-[3px]":t});function C(e,t){1&e&&d.SdG(0)}function w(e,t){1&e&&d.SdG(0,1)}function I(e,t){1&e&&d.SdG(0,2)}function b(e,t){1&e&&d.SdG(0,3)}function B(e,t){1&e&&d.eu8(0)}function E(e,t){1&e&&(d.j41(0,"span",15),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" (",d.bMT(2,1,"required"),")"))}function S(e,t){1&e&&d.eu8(0)}function Q(e,t){1&e&&d.eu8(0)}function k(e,t){1&e&&d.eu8(0)}function T(e,t){if(1&e&&(d.j41(0,"div",6)(1,"div",9)(2,"div",10),d.nrm(3,"div",11),d.j41(4,"div",12)(5,"label",13),d.DNE(6,B,1,0,"ng-container",14),d.nVh(7,E,3,3,"span",15),d.k0s()(),d.nrm(8,"div",16),d.k0s()(),d.j41(9,"div",17)(10,"div",18,4),d.DNE(12,S,1,0,"ng-container",14),d.k0s(),d.j41(13,"div",19),d.DNE(14,Q,1,0,"ng-container",14),d.k0s(),d.j41(15,"div",20,5),d.DNE(17,k,1,0,"ng-container",14),d.k0s()()()),2&e){const e=d.XpG(),t=d.sdS(1),i=d.sdS(3),n=d.sdS(5),r=d.sdS(7);d.R7$(3),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(),d.BMQ("for",e.input().labelForId),d.R7$(),d.Y8G("ngTemplateOutlet",i),d.R7$(),d.vxM(e.input().required?7:-1),d.R7$(),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(2),d.Y8G("hidden",!e.prefixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",n),d.R7$(),d.Y8G("ngClass",d.l_i(12,m,e.prefixHasChildren()?"":"tw-rounded-s-lg tw-ps-3",e.suffixHasChildren()?"":"tw-rounded-e-lg tw-pe-3")),d.R7$(),d.Y8G("ngTemplateOutlet",t),d.R7$(),d.Y8G("hidden",!e.suffixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",r)}}function F(e,t){1&e&&d.eu8(0)}function P(e,t){1&e&&d.eu8(0)}function R(e,t){1&e&&d.eu8(0)}function D(e,t){1&e&&d.eu8(0)}function M(e,t){if(1&e&&(d.j41(0,"div",7)(1,"label",21),d.DNE(2,F,1,0,"ng-container",14),d.k0s(),d.j41(3,"div",22)(4,"div",23,4),d.DNE(6,P,1,0,"ng-container",14),d.k0s(),d.j41(7,"div",24),d.DNE(8,R,1,0,"ng-container",14),d.k0s(),d.j41(9,"div",25,5),d.DNE(11,D,1,0,"ng-container",14),d.k0s()()()),2&e){const e=d.XpG(),t=d.sdS(1),i=d.sdS(3),n=d.sdS(5),r=d.sdS(7);d.R7$(),d.BMQ("for",e.input().labelForId),d.R7$(),d.Y8G("ngTemplateOutlet",i),d.R7$(),d.Y8G("ngClass",d.l_i(8,y,!e.disableReadOnlyBorder,e.disableReadOnlyBorder)),d.R7$(),d.Y8G("hidden",!e.prefixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",n),d.R7$(2),d.Y8G("ngTemplateOutlet",t),d.R7$(),d.Y8G("hidden",!e.suffixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",r)}}function x(e,t){1&e&&d.SdG(0,4)}function O(e,t){if(1&e&&d.nrm(0,"bit-error",8),2&e){const e=d.XpG();d.Y8G("error",e.input().error)}}class G{constructor(){this.input=r.sbv.required(p.p),this.hint=(0,r.sbv)(a.I),this.label=(0,r.sbv)(l.j),this.prefixContainer=(0,r.ebz)("prefixContainer"),this.suffixContainer=(0,r.ebz)("suffixContainer"),this.error=(0,r.ebz)(A),this.disableMargin=(0,r.hFB)(!1,{transform:r.L39}),this.disableReadOnlyBorder=!1,this.prefixHasChildren=(0,s.vPA)(!1),this.suffixHasChildren=(0,s.vPA)(!1),this.defaultContentIsFocused=(0,s.vPA)(!1)}get inputBorderClasses(){const e=this.defaultContentIsFocused(),t=[this.input().hasError?"group-hover/bit-form-field:tw-border-danger-700":"group-hover/bit-form-field:tw-border-primary-600","group-has-[input:read-only]/bit-form-field:group-hover/bit-form-field:tw-border-secondary-500","group-has-[textarea:read-only]/bit-form-field:group-hover/bit-form-field:tw-border-secondary-500","group-focus-within/bit-form-field:tw-outline-none",e?"group-focus-within/bit-form-field:tw-border-2":"",e?"group-focus-within/bit-form-field:tw-border-primary-600":"",e?"group-focus-within/bit-form-field:group-hover/bit-form-field:tw-border-primary-600":""];return(0,c.V)(this.input().hasError).concat(t).join(" ")}get classList(){return["tw-block"].concat(this.disableMargin()?[]:["tw-mb-4","bit-compact:tw-mb-3"]).concat(this.readOnly?[]:"tw-pt-2")}onFocusIn(e){this.defaultContentIsFocused.set(e.matches("[data-default-content] *:focus-visible"))}onFocusOut(){this.defaultContentIsFocused.set(!1)}get readOnly(){return!!this.input().readOnly}ngAfterContentChecked(){var e,t,i,n;const r=this.error(),s=this.hint();this.input().ariaDescribedBy=r?r.id:s?s.id:void 0,this.prefixHasChildren.set((null!==(t=null===(e=this.prefixContainer())||void 0===e?void 0:e.nativeElement.childElementCount)&&void 0!==t?t:0)>0),this.suffixHasChildren.set((null!==(n=null===(i=this.suffixContainer())||void 0===i?void 0:i.nativeElement.childElementCount)&&void 0!==n?n:0)>0)}}G.ɵfac=function(e){return new(e||G)},G.ɵcmp=d.VBU({type:G,selectors:[["bit-form-field"]],contentQueries:function(e,t,i){1&e&&(d.C6U(i,t.input,p.p,5),d.C6U(i,t.hint,a.I,5),d.C6U(i,t.label,l.j,5)),2&e&&d.NyB(3)},viewQuery:function(e,t){1&e&&(d.wEZ(t.prefixContainer,g,5),d.wEZ(t.suffixContainer,v,5),d.wEZ(t.error,A,5)),2&e&&d.NyB(3)},hostVars:2,hostBindings:function(e,t){1&e&&d.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()}),2&e&&d.HbH(t.classList)},inputs:{disableMargin:[1,"disableMargin"],disableReadOnlyBorder:[2,"disableReadOnlyBorder","disableReadOnlyBorder",r.L39]},ngContentSelectors:["*","bit-label","[bitPrefix]","[bitSuffix]","bit-hint"],decls:12,vars:2,consts:[["defaultContent",""],["labelContent",""],["prefixContent",""],["suffixContent",""],["prefixContainer",""],["suffixContainer",""],[1,"tw-w-full","tw-relative","tw-group/bit-form-field"],[1,"tw-w-full","tw-relative"],[3,"error"],[1,"tw-absolute","tw-size-full","tw-top-0","tw-pointer-events-none","tw-z-20"],[1,"tw-size-full","tw-flex"],[1,"tw-min-w-3","tw-border-r-0","group-focus-within/bit-form-field:tw-border-r-0","!tw-rounded-s-lg",3,"ngClass"],[1,"tw-px-1","tw-shrink","tw-min-w-0","tw-mt-px","tw-border-x-0","tw-border-t-0","group-focus-within/bit-form-field:tw-border-x-0","group-focus-within/bit-form-field:tw-border-t-0","tw-hidden","group-has-[bit-label]/bit-form-field:tw-block",3,"ngClass"],[1,"tw-flex","tw-gap-1","tw-text-sm","tw-text-muted","-tw-translate-y-[0.675rem]","tw-mb-0","tw-max-w-full","tw-pointer-events-auto"],[4,"ngTemplateOutlet"],[1,"tw-text-[0.625rem]","tw-relative","tw-bottom-[-1px]"],[1,"tw-min-w-3","tw-grow","tw-border-l-0","group-focus-within/bit-form-field:tw-border-l-0","!tw-rounded-e-lg",3,"ngClass"],[1,"tw-gap-1","tw-bg-background","tw-rounded-lg","tw-flex","tw-min-h-11","[&:has(input:read-only,textarea:read-only):not(:has(button:not([aria-disabled='true'])))]:tw-bg-secondary-100"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-ps-3","has-[[biticonbutton]]:tw-ps-1","tw-py-1",3,"hidden"],["data-default-content","",1,"tw-w-full","tw-relative","tw-py-1","[&:has(select)_select]:tw-pe-6","has-[select]:after:tw-absolute","has-[select]:after:tw-end-4","has-[select]:after:tw-top-[calc(50%_-_2px)]","has-[select]:after:tw-rotate-[45deg]","has-[select]:after:-tw-translate-y-1/2","has-[select]:after:tw-size-2","has-[select]:after:tw-border-text-main","has-[select]:after:tw-border-r-[2px]","has-[select]:after:tw-border-b-[2px]","has-[bit-select]:tw-p-0","has-[bit-multi-select]:tw-p-0","has-[input:read-only:not([hidden])]:tw-bg-secondary-100","has-[textarea:read-only:not([hidden])]:tw-bg-secondary-100","has-[textarea]:tw-my-1",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-pe-3","has-[[biticonbutton]]:tw-pe-1","tw-py-1",3,"hidden"],[1,"tw-flex","tw-gap-1","tw-text-sm","tw-text-muted","tw-mb-0","tw-max-w-full"],[1,"tw-gap-1","tw-flex","tw-min-h-[1.85rem]","tw-border-0","tw-border-solid","tw-items-center",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-ps-1",3,"hidden"],["data-default-content","",1,"tw-w-full","tw-min-w-0","tw-pb-0","tw-relative","[&>*]:tw-p-0","[&>*::selection]:tw-bg-primary-700","[&>*::selection]:tw-text-contrast"],[1,"tw-flex","tw-items-center","tw-pe-1",3,"hidden"]],template:function(e,t){if(1&e&&(d.NAR(f),d.DNE(0,C,1,0,"ng-template",null,0,d.C5r)(2,w,1,0,"ng-template",null,1,d.C5r)(4,I,1,0,"ng-template",null,2,d.C5r)(6,b,1,0,"ng-template",null,3,d.C5r),d.nVh(8,T,18,15,"div",6)(9,M,12,11,"div",7),d.nVh(10,x,1,0)(11,O,1,1,"bit-error",8)),2&e){let e;d.R7$(8),d.vxM(t.readOnly?9:8),d.R7$(2),d.vxM(!1===(e=t.input().hasError)?10:!0===e?11:-1)}},dependencies:[n.MD,n.YU,n.T3,A,o.$Z],encapsulation:2})},43890(e,t,i){"use strict";i.d(t,{e:()=>s});var n=i(78781),r=i(68467);class s{constructor(e){if(null==e)throw new Error("Must provide key");if(32===e.byteLength)this.innerKey={type:r.Qd.AesCbc256_B64,encryptionKey:e},this.keyB64=this.toBase64();else if(64===e.byteLength)this.innerKey={type:r.Qd.AesCbc256_HmacSha256_B64,encryptionKey:e.slice(0,32),authenticationKey:e.slice(32)},this.keyB64=this.toBase64();else{if(!(e.byteLength>64))throw new Error(`Unsupported encType/key length ${e.byteLength}`);this.innerKey={type:r.Qd.CoseEncrypt0,encryptionKey:e},this.keyB64=this.toBase64()}}toJSON(){return{keyB64:this.keyB64}}inner(){return this.innerKey}toBase64(){return n.A.fromBufferToB64(this.toEncoded())}toEncoded(){if(this.innerKey.type===r.Qd.AesCbc256_B64)return this.innerKey.encryptionKey;if(this.innerKey.type===r.Qd.AesCbc256_HmacSha256_B64){const e=new Uint8Array(64);return e.set(this.innerKey.encryptionKey,0),e.set(this.innerKey.authenticationKey,32),e}if(this.innerKey.type===r.Qd.CoseEncrypt0)return this.innerKey.encryptionKey;throw new Error("Unsupported encryption type.")}static fromString(e){if(null==e)return null;const t=n.A.fromB64ToArray(e);return new s(t)}static fromJSON(e){return s.fromString(null==e?void 0:e.keyB64)}}},43946(e,t,i){"use strict";i.d(t,{p:()=>n});class n{}},43978(e,t,i){"use strict";var n,r,s,o;i.d(t,{pC:()=>n,eH:()=>r,Zx:()=>s,D7:()=>o,tt:()=>h.t,kC:()=>u,cp:()=>a,PN:()=>l,pP:()=>c}),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"}(r||(r={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(s||(s={})),function(e){e[e.Owner=0]="Owner",e[e.Admin=1]="Admin",e[e.User=2]="User",e[e.Custom=4]="Custom"}(o||(o={}));var a,l,c,d,u,h=i(1036);!function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller",e[e.BusinessUnit=2]="BusinessUnit"}(a||(a={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(l||(l={})),function(e){e[e.ProviderAdmin=0]="ProviderAdmin",e[e.ServiceUser=1]="ServiceUser"}(c||(c={})),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"}(u||(u={}))},44087(e,t,i){"use strict";i.d(t,{O:()=>m});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(36801),l=i(22191),c=i(34465),d=i(65067),u=i(21823),h=i(36288);const A=[[["","slot","end"]],"*"],p=(e,t)=>[e,t];function g(e,t){if(1&e&&(s.j41(0,"div",3),s.nI1(1,"i18n"),s.SdG(2,1),s.k0s()),2&e){const e=s.XpG(3);s.BMQ("id",e.contentId)("aria-label",s.l_i(4,p,e.text(),s.bMT(1,2,"submenu")).join(" "))}}function v(e,t){if(1&e&&s.nVh(0,g,3,7,"div",3),2&e){const e=s.XpG(2);s.vxM(e.open()?0:-1)}}function f(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-nav-item",0),s.bIt("mainContentClicked",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.handleMainContentClicked())}),s.j41(1,"button",1),s.nI1(2,"i18n"),s.bIt("click",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.toggle(t))}),s.k0s(),s.qex(3,2),s.SdG(4),s.bVm(),s.k0s(),s.nVh(5,v,1,1)}if(2&e){const e=s.XpG();s.Y8G("text",e.text())("icon",e.icon())("route",e.route())("treeDepth",e.treeDepth())("relativeTo",e.relativeTo())("routerLinkActiveOptions",e.routerLinkActiveOptions())("ariaLabel",e.ariaLabel())("hideActiveStyles",e.parentHideActiveStyles())("ariaCurrentWhenActive",e.ariaCurrent())("forceActiveStyles",e.forceActiveStyles()),s.R7$(),s.HbH(e.open()?"":"tw-transform tw-rotate-[-90deg]"),s.Y8G("label",s.l_i(18,p,s.bMT(2,16,"toggleCollapse"),e.text()).join(" ")),s.BMQ("aria-expanded",e.open().toString())("aria-controls",e.contentId),s.R7$(4),s.vxM(e.sideNavOpen()?5:-1)}}class m extends c.S{constructor(){super(),this.sideNavService=(0,r.WQX)(u.G),this.parentNavGroup=(0,r.WQX)(m,{optional:!0,skipSelf:!0}),this.el=(0,r.WQX)(s.aKT),this.nestedNavComponents=(0,n.tEk)(c.S,{descendants:!1}),this.sideNavOpen=this.sideNavService.open,this.sideNavAndGroupOpen=(0,o.EW)(()=>this.open()&&this.sideNavOpen()),this.parentHideActiveStyles=(0,o.EW)(()=>this.hideActiveStyles()||this.sideNavAndGroupOpen()),this.ariaCurrentWhenActive=(0,n.hFB)(),this.ariaCurrent=(0,o.EW)(()=>{var e;return null!==(e=this.ariaCurrentWhenActive())&&void 0!==e?e:this.sideNavAndGroupOpen()?void 0:"page"}),this.contentId=Math.random().toString(36).substring(2),this.open=(0,n.geq)(!1),this.hideIfEmpty=(0,n.hFB)(!1,{transform:n.L39}),this.forceActiveStyles=(0,n.hFB)(!1,{transform:n.L39}),this.disableToggleOnClick=(0,n.hFB)(!1,{transform:n.L39}),this.parentNavGroup&&this.treeDepth.set(this.parentNavGroup.treeDepth()+1)}setOpen(e){this.open.set(e),this.open()&&this.parentNavGroup&&this.parentNavGroup.setOpen(this.open())}toggle(e){null==e||e.stopPropagation(),this.setOpen(!this.open())}handleMainContentClicked(){this.sideNavService.open()?this.disableToggleOnClick()||this.toggle():(this.route()||this.sideNavService.open.set(!0),this.open.set(!0)),this.mainContentClicked.emit()}}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=s.VBU({type:m,selectors:[["bit-nav-group"]],contentQueries:function(e,t,i){1&e&&s.C6U(i,t.nestedNavComponents,c.S,4),2&e&&s.NyB()},inputs:{ariaCurrentWhenActive:[1,"ariaCurrentWhenActive"],open:[1,"open"],hideIfEmpty:[1,"hideIfEmpty"],forceActiveStyles:[1,"forceActiveStyles"],disableToggleOnClick:[1,"disableToggleOnClick"]},outputs:{open:"openChange"},features:[s.Jv_([{provide:c.S,useExisting:m},{provide:d.H,useExisting:m}]),s.Vt3],ngContentSelectors:["[slot=end]","*"],decls:1,vars:1,consts:[[3,"mainContentClicked","text","icon","route","treeDepth","relativeTo","routerLinkActiveOptions","ariaLabel","hideActiveStyles","ariaCurrentWhenActive","forceActiveStyles"],["slot","start","type","button","bitIconButton","bwi-down-solid","buttonType","side-nav","size","xsmall","data-testid","nav-group-collapse-arrow",1,"tw-ms-auto",3,"click","label"],["slot","end"],["role","group"]],template:function(e,t){1&e&&(s.NAR(A),s.nVh(0,f,6,21)),2&e&&s.vxM(!t.hideIfEmpty()||t.nestedNavComponents().length>0?0:-1)},dependencies:[d.u,l.Q,h.s,a.$Z],encapsulation:2,changeDetection:0})},44432(e,t,i){"use strict";i.d(t,{G:()=>T});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(83731),l=i(66046),c=i(55807),d=i(22191),u=i(75583),h=i(33812),A=i(50700),p=i(58806),g=i(36288),v=i(58384);const f=[[["","slot","end"]],"*",[["","slot","title"]]];function m(e,t){1&e&&(h.j41(0,"div",9),h.SdG(1,1),h.k0s())}function y(e,t){if(1&e&&h.nrm(0,"bit-icon",5),2&e){h.XpG();const e=h.r8f(2);h.Y8G("name",e)}}function C(e,t){if(1&e&&(h.j41(0,"header",6),h.SdG(1,2),h.EFF(2),h.k0s()),2&e){const e=h.XpG(),t=h.r8f(1);h.Y8G("id",e.titleId),h.R7$(2),h.SpI(" ",t," ")}}function w(e,t){1&e&&h.eu8(0)}function I(e,t){if(1&e&&h.DNE(0,w,1,0,"ng-container",10),2&e){h.XpG();const e=h.sdS(4);h.Y8G("ngTemplateOutlet",e)}}function b(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",11),h.bIt("click",function(){s.eBV(e);const t=h.XpG();return s.Njj(t.onDismiss())}),h.k0s()}if(2&e){const e=h.XpG();h.HbH(e.fgClass()),h.Y8G("label",e.closeLabel)}}function B(e,t){1&e&&h.eu8(0)}function E(e,t){if(1&e&&h.DNE(0,B,1,0,"ng-container",10),2&e){h.XpG();const e=h.sdS(4);h.Y8G("ngTemplateOutlet",e)}}const S={success:"bwi-check-circle",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error",subtle:"bwi-info-circle"},Q={warning:"warning",danger:"error"};let k=0;class T{onDismiss(){this.dismiss$.next()}ngOnInit(){this.isDismissible.set(this.dismiss$.observed)}constructor(e){this.i18nService=e,this.type=(0,r.hFB)("info"),this.icon=(0,r.hFB)(),this.title=(0,r.hFB)(),this.closeLabel=this.i18nService.t("close"),this.dismiss$=new l.B,this.dismiss=(0,a.p)(this.dismiss$),this.isDismissible=(0,s.vPA)(!1),this.iconComputed=(0,o.EW)(()=>{if(null!==this.icon())return this.icon()||S[this.type()]}),this.titleComputed=(0,o.EW)(()=>{const e=this.title();if(null===e)return;const t=this.type();return null==e&&null!=Q[t]?this.i18nService.t(Q[t]):e}),this.titleId="bit-callout-title-"+k++,this.variantClass=(0,o.EW)(()=>{switch(this.type()){case"danger":return"tw-bg-bg-danger-soft tw-border-border-danger-soft";case"info":return"tw-bg-bg-brand-softer tw-border-border-brand-soft";case"success":return"tw-bg-bg-success-soft tw-border-border-success-soft";case"warning":return"tw-bg-bg-warning-soft tw-border-border-warning-soft";case"subtle":return"tw-bg-bg-secondary tw-border-border-base"}}),this.fgClass=(0,o.EW)(()=>{switch(this.type()){case"danger":return"!tw-text-fg-danger-strong";case"info":return"!tw-text-fg-brand-strong";case"success":return"!tw-text-fg-success-strong";case"warning":return"!tw-text-fg-warning-strong";case"subtle":return"!tw-text-fg-heading"}}),this.paddingClass=(0,o.EW)(()=>this.title()?"tw-pt-3 tw-pb-4":"tw-py-2"),this.calloutClass=(0,o.EW)(()=>`${this.variantClass()} ${this.fgClass()} ${this.paddingClass()}`),this.paddingTopClass=(0,o.EW)(()=>this.isDismissible()?"tw-pt-1.5":void 0)}}T.ɵfac=function(e){return new(e||T)(h.rXU(A.W))},T.ɵcmp=h.VBU({type:T,selectors:[["bit-callout"]],inputs:{type:[1,"type"],icon:[1,"icon"],title:[1,"title"]},outputs:{dismiss:"dismiss"},ngContentSelectors:["[slot=end]","*","[slot=title]"],decls:15,vars:11,consts:[["contentTpl",""],[1,"tw-mb-4","tw-border","tw-border-solid","tw-rounded-xl","tw-ps-4","tw-pe-2","tw-flex","tw-flex-col","tw-relative"],[1,"tw-flex","tw-flex-col","tw-gap-2"],[1,"tw-flex","tw-justify-between"],[1,"tw-flex","tw-gap-2","tw-items-baseline"],[3,"name"],[1,"tw-text-base","tw-font-medium",3,"id"],["type","button","bitIconButton","bwi-close","buttonType","subtleGhost","size","small",1,"tw-shrink-0",3,"class","label"],[1,"tw-flex","tw-gap-3","[&>*]:tw-mt-4"],["bitTypography","body2",1,"tw-pr-4"],[4,"ngTemplateOutlet"],["type","button","bitIconButton","bwi-close","buttonType","subtleGhost","size","small",1,"tw-shrink-0",3,"click","label"]],template:function(e,t){if(1&e&&(h.NAR(f),h.j41(0,"aside",1),h.SS7(1)(2),h.DNE(3,m,2,0,"ng-template",null,0,h.C5r),h.j41(5,"div",2)(6,"div",3)(7,"div",4),h.nVh(8,y,1,1,"bit-icon",5),h.nVh(9,C,3,2,"header",6)(10,I,1,1,"ng-container"),h.k0s(),h.nVh(11,b,1,3,"button",7),h.k0s(),h.nVh(12,E,1,1,"ng-container"),h.k0s(),h.j41(13,"div",8),h.SdG(14),h.k0s()()),2&e){h.HbH(t.calloutClass()),h.BMQ("aria-labelledby",t.titleId),h.R7$();const e=h.bH3(t.titleComputed());h.R7$();const i=h.bH3(t.iconComputed());h.R7$(5),h.HbH(t.paddingTopClass()),h.R7$(),h.vxM(i?8:-1),h.R7$(),h.vxM(e?9:10),h.R7$(2),h.vxM(t.isDismissible()?11:-1),h.R7$(),h.vxM(e?12:-1)}},dependencies:[n.MD,n.T3,u.E,p.r,d.Q,g.s,c.o,v.R],encapsulation:2,changeDetection:0})},45113(e,t,i){"use strict";i.d(t,{P:()=>A});var n=i(7919),r=i(61782),s=i(36304),o=i(61182),a=i(39326),l=i(26076),c=i(36107),d=i(10070),u=i(36890);class h{}class A{constructor({cipher:e,encryptedFor:t}){var i,A,p;switch(this.type=e.type,this.encryptedFor=t,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.archivedDate=e.archivedDate,this.reprompt=e.reprompt,this.key=null===(i=e.key)||void 0===i?void 0:i.encryptedString,this.type){case n.gC.Login:this.login=new c.a,this.login.uris=null!==(p=null===(A=e.login.uris)||void 0===A?void 0:A.map(e=>{const t=new l.q;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 s.K;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.gC.SecureNote:this.secureNote=new d.c,this.secureNote.type=e.secureNote.type;break;case n.gC.SshKey:this.sshKey=new u.m,this.sshKey.privateKey=null!=e.sshKey.privateKey?e.sshKey.privateKey.encryptedString:null,this.sshKey.publicKey=null!=e.sshKey.publicKey?e.sshKey.publicKey.encryptedString:null,this.sshKey.keyFingerprint=null!=e.sshKey.keyFingerprint?e.sshKey.keyFingerprint.encryptedString:null;break;case n.gC.Card:this.card=new r.j,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.gC.Identity:this.identity=new a.p,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 o.d;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(t=>{const i=t.fileName?t.fileName.encryptedString:null;this.attachments[t.id]=i;const n=new h;n.fileName=i,n.lastKnownRevisionDate=e.revisionDate,null!=t.key&&(n.key=t.key.encryptedString),this.attachments2[t.id]=n}))}}},45151(e,t,i){"use strict";i.d(t,{w:()=>I});var n=i(72245),r=i(44500),s=i(3204),o=i(23965),a=i(67553),l=i(3633),c=i(82468),d=i(39306),u=i(78781),h=i(8916);class A{constructor(e,t,i){this.orgId=e,this.publicKey=t,this.orgName=i}}var p=i(74208),g=i(89105),v=i(11224),f=i(50700),m=i(35500),y=i(83541),C=i(1601),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(e,t,i,n,r,s,o,a,l){this.keyService=e,this.encryptService=t,this.organizationService=i,this.organizationUserApiService=n,this.organizationApiService=r,this.i18nService=s,this.accountService=o,this.masterPasswordService=a,this.configService=l}buildRecoveryKey(e,t,i){return w(this,void 0,void 0,function*(){if(null==t)throw new Error("User key is required for recovery.");const n=yield this.organizationApiService.getKeys(e);if(null==n)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const r=u.A.fromB64ToArray(n.publicKey);if(!i.some(e=>u.A.fromArrayToHex(e)===u.A.fromArrayToHex(r)))throw new Error("Untrusted public key");return(yield this.encryptService.encapsulateKeyUnsigned(t,r)).encryptedString})}resetMasterPassword(e,t,i,a){return w(this,void 0,void 0,function*(){const u=yield this.organizationUserApiService.getOrganizationUserResetPasswordDetails(a,i);if(null==u)throw new Error(this.i18nService.t("resetPasswordDetailsError"));const A=yield(0,n._)(this.accountService.activeAccount$.pipe(l.F6,(0,r.n)(e=>this.keyService.orgKeys$(e)),(0,s.T)(e=>{var t;return null!==(t=e[a])&&void 0!==t?t:null})));if(null==A)throw new Error("No org key found");const p=yield this.encryptService.unwrapDecapsulationKey(new d.k(u.encryptedPrivateKey),A),g=yield this.encryptService.decapsulateKeyUnsigned(new d.k(u.resetPasswordKey),p),v=u.kdf===h.ao.PBKDF2_SHA256?new h.n1(u.kdfIterations):new h.hU(u.kdfIterations,u.kdfMemory,u.kdfParallelism);if(yield this.configService.getFeatureFlag(c.TO.PM27086_UpdateAuthenticationApisForInputPassword)){const n=this.masterPasswordService.emailToSalt(t),r=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e,v,n),s=yield this.masterPasswordService.makeMasterPasswordUnlockData(e,v,n,g),l=o.W7.newConstructor(r,s);return void(yield this.organizationUserApiService.putOrganizationUserResetPassword(a,i,l))}const f=yield this.keyService.makeMasterKey(e,t.trim().toLowerCase(),v),m=yield this.keyService.hashMasterKey(e,f),y=yield this.keyService.encryptUserKeyWithMasterKey(f,g),C=new o.W7;C.key=y[1].encryptedString,C.newMasterPasswordHash=m,yield this.organizationUserApiService.putOrganizationUserResetPassword(a,i,C)})}getPublicKeys(e){return w(this,void 0,void 0,function*(){const t=(yield(0,n._)(this.organizationService.organizations$(e))).filter(e=>e.resetPasswordEnrolled),i=[];for(const e of t){const t=yield this.organizationApiService.getKeys(e.id),n=u.A.fromB64ToArray(t.publicKey),r=new A(e.id,n,e.name);i.push(r)}return i})}getRotatedData(e,t,i){return w(this,void 0,void 0,function*(){if(null==e)throw new Error("New user key is required for rotation.");const r=yield(0,n._)(this.organizationService.organizations$(i));if(!r)throw new Error("Could not get organizations");const s=[];for(const i of r){if(!i.resetPasswordEnrolled)continue;const n=yield this.buildRecoveryKey(i.id,e,t),r=new o.Fw;r.organizationId=i.id,r.resetPasswordKey=n,r.masterPasswordHash="ignored",s.push(r)}return s})}}I.ɵfac=function(e){return new(e||I)(p.KVO(h.Lu),p.KVO(g.N),p.KVO(a.PV),p.KVO(o.uB),p.KVO(v.X),p.KVO(f.W),p.KVO(m.D),p.KVO(y.L),p.KVO(C.w))},I.ɵprov=p.jDH({token:I,factory:I.ɵfac,providedIn:"root"})},45383(e,t,i){"use strict";i.d(t,{Z:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},45482(e,t,i){"use strict";i.d(t,{IJ:()=>o,qb:()=>l,d$:()=>u});var n=i(41226),r=i(33812),s=i(74208);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=r.$C({type:o}),o.ɵinj=s.G2t({providers:[n.g]});var a=i(56962);class l{constructor(e){this.logService=e}createDropin(){window.setTimeout(()=>{window.braintree.dropin.create({authorization:"",container:this.containerId,paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue",tagline:"false"}}},(e,t)=>{null==e?this.braintree=t:this.logService.error(e)})},250)}loadBraintree(e,t){const i=window.document.createElement("script");i.id="dropin-script",i.src="scripts/dropin.js?cache=zqcxrhd",i.async=!0,t&&(i.onload=()=>this.createDropin()),this.containerId=e,window.document.head.appendChild(i)}requestPaymentMethod(){return new Promise((e,t)=>{this.braintree.requestPaymentMethod((i,n)=>{i?(this.logService.error(i),t(i.message)):e(n.nonce)})})}unloadBraintree(){const e=window.document.getElementById("dropin-script");window.document.head.removeChild(e),window.setTimeout(()=>{const e=Array.from(window.document.head.querySelectorAll("script")).filter(e=>null!=e.src&&e.src.indexOf("paypal")>-1);e.forEach(e=>{try{window.document.head.removeChild(e)}catch(t){this.logService.error(t)}});const t=window.document.head.querySelector("#braintree-dropin-stylesheet");if(null!=t)try{window.document.head.removeChild(t)}catch(i){this.logService.error(i)}},500)}}l.ɵfac=function(e){return new(e||l)(s.KVO(a.K))},l.ɵprov=s.jDH({token:l,factory:l.ɵfac,providedIn:o});var c=i(12012),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e,t){this.apiService=e,this.logService=t,this.stripe=null,this.stripeScriptLoaded=!1,this.instanceCount=0,this.instances=new Map,this.createSetupIntent=e=>d(this,void 0,void 0,function*(){return yield this.apiService.send("POST",(()=>{switch(e){case"bankAccount":return"/setup-intent/bank-account";case"card":return"/setup-intent/card"}})(),null,!0,!0)})}loadStripe(e,t,i){if(this.stripeScriptLoaded)this.initializeInstance(e,t,i);else if(window.document.getElementById("stripe-script"))this.initializeInstance(e,t,i);else{const n=window.document.createElement("script");n.id="stripe-script",n.src="https://js.stripe.com/v3?advancedFraudSignals=false",n.onload=()=>d(this,void 0,void 0,function*(){const n=window;this.stripe=n.Stripe(""),this.stripeScriptLoaded=!0,this.initializeInstance(e,t,i)}),window.document.head.appendChild(n)}}initializeInstance(e,t,i,n=1){if(!this.stripe)return void(n<10?(this.logService.warning(`Stripe not yet loaded for instance ${e}, retrying attempt ${n}...`),setTimeout(()=>this.initializeInstance(e,t,i,n+1),50)):this.logService.error(`Stripe failed to load for instance ${e} after ${n} attempts`));const r=this.stripe.elements();this.instances.set(e,{elements:r,elementIds:t}),this.instanceCount++,setTimeout(()=>{r.create("cardNumber",this.getElementOptions("cardNumber")),r.create("cardExpiry",this.getElementOptions("cardExpiry")),r.create("cardCvc",this.getElementOptions("cardCvc")),i&&this.mountElements(e)},50)}mountElements(e,t=1){setTimeout(()=>{const i=this.instances.get(e);if(i)if(i.elements){const n=i.elements.getElement("cardNumber"),r=i.elements.getElement("cardExpiry"),s=i.elements.getElement("cardCvc");[n,r,s].some(e=>!e)?(this.logService.warning(`Some Stripe card elements for instance ${e} are missing, retrying for attempt ${t}...`),this.mountElements(e,t+1)):(n.mount(i.elementIds.cardNumber),r.mount(i.elementIds.cardExpiry),s.mount(i.elementIds.cardCvc))}else this.logService.warning(`Stripe elements for instance ${e} are missing, retrying for attempt ${t}...`),this.mountElements(e,t+1);else t<10?(this.logService.warning(`Stripe instance ${e} not found, retrying for attempt ${t}...`),this.mountElements(e,t+1)):this.logService.error(`Stripe instance ${e} not found after ${t} attempts`)},100)}setupBankAccountPaymentMethod(e,t,i){return d(this,arguments,void 0,function*(e,{accountHolderName:t,routingNumber:i,accountNumber:n,accountHolderType:r},s){const o={payment_method:{us_bank_account:{routing_number:i,account_number:n,account_holder_type:r},billing_details:{name:t}}};s&&(o.payment_method.billing_details.address={country:s.country,postal_code:s.postalCode});const a=yield this.stripe.confirmUsBankAccountSetup(e,o);if(a.error||a.setupIntent&&"requires_action"!==a.setupIntent.status)throw this.logService.error(a.error),a.error;return a.setupIntent.payment_method})}setupCardPaymentMethod(e,t,i){return d(this,void 0,void 0,function*(){const n=this.instances.get(e);if(!n){const t=Array.from(this.instances.keys());throw this.logService.error(`Stripe instance ${e} not found. Available instances: [${t.join(", ")}]. This may occur if the component was destroyed during the payment flow.`),new Error("Payment method initialization failed. Please try again.")}const r={payment_method:{card:n.elements.getElement("cardNumber")}};i&&(r.payment_method.billing_details={address:{country:i.country,postal_code:i.postalCode}});const s=yield this.stripe.confirmCardSetup(t,r);if(s.error||s.setupIntent&&"succeeded"!==s.setupIntent.status)throw this.logService.error(s.error),s.error;return s.setupIntent.payment_method})}unloadStripe(e){const t=this.instances.get(e);if(t){if(t.elements)try{const e=t.elements.getElement("cardNumber"),i=t.elements.getElement("cardExpiry"),n=t.elements.getElement("cardCvc");e&&e.unmount(),i&&i.unmount(),n&&n.unmount()}catch(i){this.logService.error(`Error unmounting Stripe elements for instance ${e}:`,i)}if(this.instances.delete(e),this.instanceCount--,this.instanceCount<=0){this.instanceCount<0&&this.logService.error(`Stripe instance count became negative (${this.instanceCount}). This indicates a reference counting bug.`),this.instanceCount=0,this.stripeScriptLoaded=!1,this.stripe=null;const e=window.document.getElementById("stripe-script");e&&window.document.head.removeChild(e),window.setTimeout(()=>{Array.from(window.document.querySelectorAll("iframe")).filter(e=>null!=e.src&&e.src.indexOf("stripe")>-1).forEach(e=>{try{e.remove()}catch(i){this.logService.error(i)}})},500)}}}getElementOptions(e){const t={style:{base:{color:null,fontFamily:'Inter, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"16px",fontSmoothing:"antialiased",lineHeight:"1.5",padding:"8px 12px","::placeholder":{color:null}},invalid:{color:null}},classes:{base:"tw-stripe-form-control",focus:"is-focused",empty:"is-empty",invalid:"is-invalid"}};t.style.base.fontWeight="500",["cardNumber","cardCvc"].includes(e)&&(t.placeholder="");const i=getComputedStyle(document.documentElement);return t.style.base.color=`rgb(${i.getPropertyValue("--color-text-main")})`,t.style.base["::placeholder"].color=`rgb(${i.getPropertyValue("--color-text-muted")})`,t.style.invalid.color=`rgb(${i.getPropertyValue("--color-text-main")})`,t.style.invalid.borderColor=`rgb(${i.getPropertyValue("--color-danger-600")})`,t}}u.ɵfac=function(e){return new(e||u)(s.KVO(c.G),s.KVO(a.K))},u.ɵprov=s.jDH({token:u,factory:u.ɵfac,providedIn:"root"})},45872(e,t,i){"use strict";i.d(t,{R:()=>n});class n{}},45891(e,t,i){"use strict";i.d(t,{_:()=>n});class n{}},45977(e,t,i){"use strict";var n;i.d(t,{B:()=>n}),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.User_TdeOffboardingPasswordSet=1011]="User_TdeOffboardingPasswordSet",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.OrganizationUser_Deleted=1515]="OrganizationUser_Deleted",e[e.OrganizationUser_Left=1516]="OrganizationUser_Left",e[e.OrganizationUser_AutomaticallyConfirmed=1517]="OrganizationUser_AutomaticallyConfirmed",e[e.OrganizationUser_SelfRevoked=1518]="OrganizationUser_SelfRevoked",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.Organization_CollectionManagement_LimitCollectionCreationEnabled=1610]="Organization_CollectionManagement_LimitCollectionCreationEnabled",e[e.Organization_CollectionManagement_LimitCollectionCreationDisabled=1611]="Organization_CollectionManagement_LimitCollectionCreationDisabled",e[e.Organization_CollectionManagement_LimitCollectionDeletionEnabled=1612]="Organization_CollectionManagement_LimitCollectionDeletionEnabled",e[e.Organization_CollectionManagement_LimitCollectionDeletionDisabled=1613]="Organization_CollectionManagement_LimitCollectionDeletionDisabled",e[e.Organization_CollectionManagement_LimitItemDeletionEnabled=1614]="Organization_CollectionManagement_LimitItemDeletionEnabled",e[e.Organization_CollectionManagement_LimitItemDeletionDisabled=1615]="Organization_CollectionManagement_LimitItemDeletionDisabled",e[e.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled=1616]="Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled",e[e.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled=1617]="Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled",e[e.Organization_ItemOrganization_Accepted=1618]="Organization_ItemOrganization_Accepted",e[e.Organization_ItemOrganization_Declined=1619]="Organization_ItemOrganization_Declined",e[e.Organization_AutoConfirmEnabled_Admin=1620]="Organization_AutoConfirmEnabled_Admin",e[e.Organization_AutoConfirmDisabled_Admin=1621]="Organization_AutoConfirmDisabled_Admin",e[e.Organization_AutoConfirmEnabled_Portal=1622]="Organization_AutoConfirmEnabled_Portal",e[e.Organization_AutoConfirmDisabled_Portal=1623]="Organization_AutoConfirmDisabled_Portal",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",e[e.Secret_Created=2101]="Secret_Created",e[e.Secret_Edited=2102]="Secret_Edited",e[e.Secret_Deleted=2103]="Secret_Deleted",e[e.Secret_Permanently_Deleted=2104]="Secret_Permanently_Deleted",e[e.Secret_Restored=2105]="Secret_Restored",e[e.Project_Retrieved=2200]="Project_Retrieved",e[e.Project_Created=2201]="Project_Created",e[e.Project_Edited=2202]="Project_Edited",e[e.Project_Deleted=2203]="Project_Deleted",e[e.ServiceAccount_UserAdded=2300]="ServiceAccount_UserAdded",e[e.ServiceAccount_UserRemoved=2301]="ServiceAccount_UserRemoved",e[e.ServiceAccount_GroupAdded=2302]="ServiceAccount_GroupAdded",e[e.ServiceAccount_GroupRemoved=2303]="ServiceAccount_GroupRemoved",e[e.ServiceAccount_Created=2304]="ServiceAccount_Created",e[e.ServiceAccount_Deleted=2305]="ServiceAccount_Deleted"}(n||(n={}))},45980(e,t,i){"use strict";i.d(t,{Jh:()=>a,M3:()=>o,NU:()=>u,Uv:()=>r,aF:()=>n,df:()=>h,yo:()=>l});var n,r,s=i(52237);!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"}(r||(r={}));const o=()=>[{perm:n.ViewExceptPass,labelId:"viewItemsHidePass"},{perm:n.View,labelId:"viewItems"},{perm:n.EditExceptPass,labelId:"editItemsHidePass"},{perm:n.Edit,labelId:"editItems"},{perm:n.Manage,labelId:"manageCollection"}],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 s.sK({id:e.id,readOnly:c(e.permission),hidePasswords:d(e.permission),manage:e.permission===n.Manage}),c=e=>[n.View,n.ViewExceptPass].includes(e),d=e=>[n.ViewExceptPass,n.EditExceptPass].includes(e);function u(e){return{id:e.id,type:r.Group,listName:e.name,labelName:e.name}}function h(e){var t,i;return{id:e.id,type:r.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}}},46131(e,t,i){"use strict";i.d(t,{t:()=>l});var n=i(77468),r=i(75583),s=i(36801),o=i(33812),a=i(58806);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["app-danger-zone"]],ngContentSelectors:["*"],decls:7,vars:3,consts:[["content",""],["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-grid","tw-auto-rows-fr","@2xl:tw-grid-cols-2","@3xl:tw-flex","tw-gap-2","@2xl:tw-gap-4","@3xl:tw-gap-2"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"h1",1),o.EFF(1),o.nI1(2,"i18n"),o.k0s(),o.j41(3,"div",2)(4,"div",3,0),o.SdG(6),o.k0s()()),2&e&&(o.R7$(),o.JRh(o.bMT(2,1,"dangerZone")))},dependencies:[n.MD,r.E,a.r,s.$Z],encapsulation:2})},46217(e,t,i){"use strict";i.d(t,{U:()=>r});var n=i(17989);class r extends n.A{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 r;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}}},46357(e,t,i){"use strict";i.d(t,{T:()=>n});class n{}},46730(e,t,i){"use strict";i.d(t,{C:()=>n});const n=i(82392).JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 121 33">
    <g fill="#84BD00" clip-path="url(#two-factor-auth-yubico-clip)">
        <path
            d="M11.011 19.366 15.18 7.47h6.02L11.054 32.622H4.698l2.903-6.891L.5 7.47h6.147l4.364 11.895ZM42.446 25.872h-5.87V23.84c-.925.73-1.92 1.364-2.971 1.892-.9.432-1.971.648-3.216.646-2.014 0-3.562-.584-4.645-1.751-1.082-1.168-1.627-2.895-1.633-5.18V7.471h5.865v9.127c0 .929.03 1.702.09 2.319.036.533.177 1.054.414 1.532.199.396.53.71.935.884.418.186 1 .279 1.749.279a5.726 5.726 0 0 0 1.657-.28 7.101 7.101 0 0 0 1.757-.818V7.47h5.868v18.4ZM66.065 16.42c0 2.894-.793 5.254-2.38 7.078-1.586 1.824-3.565 2.736-5.935 2.736a9.864 9.864 0 0 1-2.68-.327 9.183 9.183 0 0 1-2.191-.95l-.245.916H47.01V.377h5.87v9.012a14.137 14.137 0 0 1 2.753-1.754 7.413 7.413 0 0 1 3.24-.671c2.305 0 4.08.84 5.327 2.52 1.245 1.68 1.867 3.992 1.865 6.935Zm-6.032.122c0-1.637-.276-2.897-.828-3.78-.553-.884-1.537-1.326-2.952-1.326-.577.004-1.15.09-1.704.254a6.987 6.987 0 0 0-1.67.72v9.227c.388.144.79.249 1.2.311a9.8 9.8 0 0 0 1.363.083c1.548 0 2.7-.459 3.455-1.375.755-.918 1.135-2.289 1.138-4.114h-.002ZM75.961 4.85h-6.195V.377h6.195V4.85ZM75.8 25.872h-5.87v-18.4h5.87v18.4ZM90.789 26.363a15.651 15.651 0 0 1-4.36-.572 9.575 9.575 0 0 1-3.438-1.77 8.005 8.005 0 0 1-2.244-3.015c-.53-1.211-.796-2.631-.797-4.26 0-1.716.285-3.196.854-4.44a8.377 8.377 0 0 1 2.382-3.097A9.675 9.675 0 0 1 86.6 7.504a14.864 14.864 0 0 1 4.017-.54c1.16-.01 2.319.127 3.446.408 1.013.26 1.999.616 2.944 1.066v5.03h-.83c-.225-.197-.499-.426-.82-.688a7.315 7.315 0 0 0-1.176-.77 7.73 7.73 0 0 0-1.46-.598 6.497 6.497 0 0 0-1.858-.234c-1.56 0-2.76.5-3.598 1.5-.839 1-1.255 2.357-1.25 4.072 0 1.77.43 3.114 1.29 4.03.86.918 2.08 1.376 3.662 1.376a7.202 7.202 0 0 0 1.988-.254 6.426 6.426 0 0 0 1.47-.597c.344-.201.67-.431.974-.688.282-.241.536-.475.779-.706h.829v5.041c-.931.434-1.9.778-2.896 1.028a13.455 13.455 0 0 1-3.323.383ZM120.4 16.68c0 3.027-.875 5.411-2.626 7.153-1.751 1.741-4.209 2.613-7.375 2.614-3.165 0-5.624-.871-7.374-2.614-1.751-1.743-2.627-4.127-2.627-7.153 0-3.048.882-5.44 2.644-7.176 1.763-1.735 4.215-2.603 7.357-2.605 3.187 0 5.651.874 7.391 2.622 1.74 1.747 2.61 4.134 2.61 7.16Zm-7.203 4.474a4.741 4.741 0 0 0 .852-1.696c.192-.661.287-1.576.286-2.745.018-.915-.08-1.829-.293-2.719a4.768 4.768 0 0 0-.818-1.753 2.853 2.853 0 0 0-1.251-.95 4.4 4.4 0 0 0-1.577-.28 4.607 4.607 0 0 0-1.504.229c-.489.192-.92.508-1.251.918a4.687 4.687 0 0 0-.854 1.754 10.45 10.45 0 0 0-.318 2.8c-.014.88.079 1.758.277 2.615.141.645.418 1.251.813 1.778a3.11 3.11 0 0 0 1.25.935 4.6 4.6 0 0 0 3.17.023 2.794 2.794 0 0 0 1.218-.909Z" />
    </g>
    <defs>
        <clipPath id="two-factor-auth-yubico-clip">
            <path class="tw-fill-text-alt2" d="M.5.377h120v32.247H.5z" />
        </clipPath>
    </defs>
</svg>
`},47135(e,t,i){"use strict";i.d(t,{q:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},47328(e,t,i){"use strict";i.d(t,{S:()=>l});var n=i(17989),r=i(31442),s=i(27280),o=i(86346),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class l extends n.A{constructor(e){super(),this.type=r.ak.Generic,null!=e&&(this.type=e.type)}decrypt(){return a(this,void 0,void 0,function*(){return new o.Z(this)})}toSecureNoteData(){const e=new s.e;return e.type=this.type,e}static fromJSON(e){if(null==e)return;const t=new l;return t.type=e.type,t}toSdkSecureNote(){return{type:(0,r.aw)(this.type)}}static fromSdkSecureNote(e){if(null==e)return;const t=new l;return t.type=e.type,t}}},47428(e,t,i){"use strict";i.d(t,{x:()=>r});var n=i(33812);class r{onClick(e){e.stopPropagation()}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","appStopProp",""]],hostBindings:function(e,t){1&e&&n.bIt("click",function(e){return t.onClick(e)})}})},47438(e,t,i){"use strict";i.d(t,{c:()=>s,e:()=>r});var n=i(20702);const r={Missing:"tax_id_missing",PendingVerification:"tax_id_pending_verification",FailedVerification:"tax_id_failed_verification"};class s extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type")}}},47523(e,t,i){"use strict";function n(e){return"string"==typeof e?JSON.parse(e):e}function r(e){var t;const i=null!==(t=n({sdk:!0}))&&void 0!==t?t:{};return null==i[e]||!!i[e]}function s(e){return!1}function o(e){throw new Error("This method should not be called, it is protected by a disabled dev flag.")}i.d(t,{U5:()=>r,dB:()=>o,fE:()=>s})},47593(e,t,i){"use strict";i.d(t,{U:()=>A});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(50700),l=i(639),c=i(22733),d=i(33812),u=i(47696);function h(e,t){if(1&e&&(d.j41(0,"span",0),d.EFF(1),d.k0s()),2&e){const e=d.XpG();d.BMQ("aria-label",e.label()),d.R7$(),d.SpI(" ",e.label()," ")}}class A{constructor(){this.i18nService=(0,s.WQX)(a.W),this.discount=(0,r.hFB)(null),this.display=(0,o.EW)(()=>{const e=this.discount();return!!e&&e.value>0}),this.label=(0,o.EW)(()=>{const e=this.discount();if(e)return(0,c.p9)(this.i18nService,e)})}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=d.VBU({type:A,selectors:[["billing-discount-badge"]],inputs:{discount:[1,"discount"]},decls:1,vars:1,consts:[["bitBadge","","variant","success","role","status",1,"tw-w-fit"]],template:function(e,t){1&e&&d.nVh(0,h,2,2,"span",0),2&e&&d.vxM(t.display()?0:-1)},dependencies:[n.MD,l.E,u.n],encapsulation:2,changeDetection:0})},47659(e,t,i){"use strict";i.d(t,{b:()=>c});var n=i(94251),r=i(77468),s=i(30930),o=i(36572),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[r.MD,n.E9,o.O,s.N]})},47696(e,t,i){"use strict";i.d(t,{n:()=>A});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(58384);function l(e,t){if(1&e&&s.nrm(0,"bit-icon",3),2&e){const e=s.XpG();s.HbH(e.iconSizeStyles()),s.Y8G("name",e.computedIcon())}}const c={primary:["tw-bg-bg-brand-softer","tw-border-border-brand-soft","tw-text-fg-brand-strong"],info:["tw-bg-bg-brand-softer","tw-border-border-brand-soft","tw-text-fg-brand-strong"],subtle:["tw-bg-bg-secondary","tw-border-border-base","tw-text-fg-body"],secondary:["tw-bg-bg-secondary","tw-border-border-base","tw-text-fg-body"],success:["tw-bg-bg-success-soft","tw-border-border-success-soft","tw-text-fg-success-strong"],warning:["tw-bg-bg-warning-soft","tw-border-border-warning-soft","tw-text-fg-warning-strong"],danger:["tw-bg-bg-danger-soft","tw-border-border-danger-soft","tw-text-fg-danger-strong"],"accent-primary":["tw-bg-bg-accent-primary-soft","tw-border-border-accent-primary-soft","tw-text-fg-accent-primary-strong"]},d={small:{label:["tw-text-xs/4","tw-px-1","tw-py-0.5"],icon:["tw-text-sm/3"]},large:{label:["tw-text-sm/5","tw-px-1.5","tw-py-1"],icon:["tw-text-base/5"]}},u=["tw-inline-flex","tw-items-center","tw-rounded-full","tw-border","tw-font-medium","tw-cursor-default"],h={info:null,subtle:null,secondary:null,primary:null,success:"bwi-check-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error","accent-primary":null};class A{constructor(){this.el=(0,r.WQX)(s.aKT),this.title=(0,n.hFB)(),this.variant=(0,n.hFB)("primary"),this.size=(0,n.hFB)("large"),this.truncate=(0,n.hFB)(!0),this.maxWidthClass=(0,n.hFB)("tw-max-w-40"),this.startIcon=(0,n.hFB)(void 0),this.computedIcon=(0,o.EW)(()=>{return null===this.startIcon()?null:this.startIcon()||(e=this.variant(),h[e]);var e}),this.iconSizeStyles=(0,o.EW)(()=>{var e;return null===(e=d[this.size()])||void 0===e?void 0:e.icon}),this.classList=(0,o.EW)(()=>[...u,...d[this.size()].label,...c[this.variant()]].concat(this.truncate()?this.maxWidthClass():"")),this.titleContent=(0,o.EW)(()=>{var e,t;const i=this.title();return void 0!==i?i:this.truncate()?(null===(t=null===(e=this.el.nativeElement)||void 0===e?void 0:e.textContent)||void 0===t?void 0:t.trim())||"":void 0})}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=s.VBU({type:A,selectors:[["span","bitBadge",""],["bit-badge"]],hostVars:3,hostBindings:function(e,t){2&e&&(s.BMQ("title",t.titleContent()),s.HbH(t.classList()))},inputs:{title:[1,"title"],variant:[1,"variant"],size:[1,"size"],truncate:[1,"truncate"],maxWidthClass:[1,"maxWidthClass"],startIcon:[1,"startIcon"]},attrs:["bitBadge",""],ngContentSelectors:["*"],decls:4,vars:3,consts:[[1,"tw-inline-flex","tw-min-w-0","tw-w-full","tw-max-w-full","tw-items-center","tw-gap-0.5"],[3,"name","class"],[1,"tw-px-1","tw-text-start","tw-min-w-0","tw-flex-1"],[3,"name"]],template:function(e,t){1&e&&(s.NAR(),s.j41(0,"div",0),s.nVh(1,l,1,3,"bit-icon",1),s.j41(2,"span",2),s.SdG(3),s.k0s()()),2&e&&(s.R7$(),s.vxM(t.computedIcon()?1:-1),s.R7$(),s.AVh("tw-truncate",t.truncate()))},dependencies:[a.R],encapsulation:2,changeDetection:0})},47836(e,t,i){"use strict";i.d(t,{Z:()=>n});class n{}},48003(e,t,i){"use strict";i.d(t,{nF:()=>Te,dl:()=>ft,$w:()=>vs,v2:()=>Wi,FX:()=>Hn,NH:()=>$n,jr:()=>ls,tu:()=>v.t,m5:()=>v.m,XJ:()=>Be,qG:()=>Z,K3:()=>pt,Ak:()=>He,O_:()=>Qe,Mf:()=>jt,l$:()=>gs,o:()=>us,Rz:()=>Nt.R,s7:()=>$t,el:()=>Ui,mZ:()=>Pi,MP:()=>Ni,dz:()=>Ti,Xj:()=>Yi,r0:()=>qn,C5:()=>Nn,Yi:()=>ss,yX:()=>Wn,Ms:()=>lr,lA:()=>as,ag:()=>mr,GA:()=>Gn,wV:()=>Sn});var n=i(94735),r=i(66316),s=i(81525),o=i(29029),a=i(81573),l=i(55807),c=i(33812),d=i(56898),u=i(7730),h=i(67311),A=i(58384),p=i(25740);class g{constructor(e){this.data=e}static open(e,t){return e.open(g,{data:t,positionStrategy:new r.u3})}}g.ɵfac=function(e){return new(e||g)(c.rXU(s.Qs))},g.ɵcmp=c.VBU({type:g,selectors:[["ng-component"]],decls:16,vars:10,consts:[["bitDialogIcon","","name","bwi-info-circle",1,"tw-text-info","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["bitButton","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer","buttonType","primary","bitDialogClose",""],["name","bwi-external-link",1,"bwi-fw"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(c.j41(0,"bit-simple-dialog"),c.nrm(1,"bit-icon",0),c.j41(2,"span",1)(3,"strong"),c.EFF(4),c.nI1(5,"i18n"),c.k0s()(),c.j41(6,"span",2),c.EFF(7),c.k0s(),c.qex(8,3),c.j41(9,"a",4),c.EFF(10),c.nI1(11,"i18n"),c.nrm(12,"bit-icon",5),c.k0s(),c.j41(13,"button",6),c.EFF(14),c.nI1(15,"i18n"),c.k0s(),c.bVm(),c.k0s()),2&e&&(c.R7$(4),c.SpI("",c.bMT(5,4,"yourAccountsFingerprint"),":"),c.R7$(3),c.SpI(" ",t.data.fingerprint.join("-")," "),c.R7$(3),c.SpI(" ",c.bMT(11,6,"learnMore")," "),c.R7$(4),c.SpI(" ",c.bMT(15,8,"close")," "))},dependencies:[n.p,o.t,d.Q,a.P,u.I,h.LJ,h.hJ,h.o_,l.o,A.R,p.$],encapsulation:2});var v=i(54873),f=i(77468),m=i(83731),y=i(51757),C=i(6056),w=i(66046),I=i(72245),b=i(58363),B=i(14803),E=i(82392);const S=E.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 3.33 73.33 73.33">
    <path class="tw-fill-illustration-bg-primary" d="m16.921 66.662-1.673-1.674a17.425 17.425 0 0 1-3.735-19.09l3.215-7.627c.717-1.7 1.283-3.46 1.692-5.26l3.285-14.46a2.222 2.222 0 0 1 2.666-1.673 5.079 5.079 0 0 1 3.855 5.857l-2.025 11.138a4.14 4.14 0 0 0 .58 2.963c.433.68 1.443.626 1.8-.097l9.292-18.772L41.46 8.09a2.163 2.163 0 0 1 2.85-.87 4.944 4.944 0 0 1 2.158 6.735l-3.95 7.46-4.144 10.261a3.619 3.619 0 0 0 .252 3.218.905.905 0 0 0 1.478.105l9.44-11.595 10.003-10.718a2.359 2.359 0 0 1 3.474.026 5.392 5.392 0 0 1-.048 7.287l-7.595 8.178-8.34 10.405a3.512 3.512 0 0 0-.649 3.12.878.878 0 0 0 1.344.493l11.092-7.608 11.191-5.598a2.29 2.29 0 0 1 3.215 1.375 5.236 5.236 0 0 1-2.74 6.26l-8.625 4.14c-.26.124-.51.267-.749.428l-9.414 6.322a3.73 3.73 0 0 0-1.64 3.383.933.933 0 0 0 1.284.792l8.651-3.544 8.318-2.138a1.731 1.731 0 0 1 2.057 1.084 3.957 3.957 0 0 1-2.402 5.088l-6.886 2.428-9.987 4.926c-.446.22-.863.495-1.241.818l-8.522 7.274c-7.143 6.098-17.774 5.68-24.415-.962Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M24.185 36.4a.833.833 0 0 1 1.175-.082c6.917 6.003 7.658 16.477 1.655 23.394a.833.833 0 1 1-1.259-1.093c5.4-6.221 4.734-15.643-1.488-21.043a.833.833 0 0 1-.083-1.175Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M75.833 61.667c.46 0 .834.373.834.833 0 7.824-6.343 14.167-14.167 14.167a.833.833 0 1 1 0-1.667C69.403 75 75 69.404 75 62.5c0-.46.373-.833.833-.833ZM4.167 18.334a.833.833 0 0 1-.834-.833c0-7.824 6.343-14.167 14.167-14.167a.833.833 0 0 1 0 1.667C10.596 5 5 10.597 5 17.5c0 .46-.373.833-.833.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M71.667 61.667c.46 0 .833.373.833.833 0 5.523-4.477 10-10 10a.833.833 0 0 1 0-1.666 8.333 8.333 0 0 0 8.333-8.334c0-.46.373-.833.834-.833ZM8.333 18.334a.833.833 0 0 1-.833-.833c0-5.523 4.477-10 10-10a.833.833 0 0 1 0 1.666 8.333 8.333 0 0 0-8.333 8.334c0 .46-.373.833-.834.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M58.968 12.05a3.16 3.16 0 0 1 4.632.058 6.15 6.15 0 0 1-.164 8.427l-7.431 7.597-8.351 10.945a2.74 2.74 0 0 0-.466 2.384c.004.014.01.02.014.025a.063.063 0 0 0 .024.015c.01.004.02.005.028.004a.056.056 0 0 0 .027-.01l11.12-7.63 11.244-5.622a3.124 3.124 0 0 1 4.383 1.875 6.07 6.07 0 0 1-3.175 7.257l-7.942 3.811c-.678.325-1.332.7-1.957 1.119l-8.785 5.9a2.898 2.898 0 0 0-1.274 2.628.1.1 0 0 0 .137.084l8.705-3.565 8.372-2.153a2.565 2.565 0 0 1 3.048 1.605 4.79 4.79 0 0 1-2.907 6.16l-6.84 2.41-9.942 4.905c-.384.19-.743.426-1.069.704l-8.522 7.275c-7.474 6.38-18.597 5.942-25.545-1.007l-1.674-1.673a18.259 18.259 0 0 1-3.913-20.004l3.215-7.627a30.676 30.676 0 0 0 1.647-5.12l3.285-14.461a3.055 3.055 0 0 1 3.667-2.3 5.912 5.912 0 0 1 4.487 6.818l-2.025 11.138a3.306 3.306 0 0 0 .463 2.366c.085.133.281.122.351-.018l9.301-18.793 5.6-9.899a2.996 2.996 0 0 1 3.947-1.204 5.777 5.777 0 0 1 2.522 7.87l-3.93 7.422-4.128 10.223a2.782 2.782 0 0 0 .194 2.473.07.07 0 0 0 .115.008l10.415-12.856 9.096-9.564Zm3.396 1.176a1.493 1.493 0 0 0-2.189-.027l-9.05 9.516L40.75 35.52a1.737 1.737 0 0 1-2.84-.2 4.45 4.45 0 0 1-.31-3.955l4.16-10.302 3.971-7.499a4.11 4.11 0 0 0-1.794-5.6 1.33 1.33 0 0 0-1.752.535l-5.576 9.859-9.281 18.75c-.646 1.305-2.47 1.403-3.25.175a4.972 4.972 0 0 1-.698-3.559l2.025-11.138a4.246 4.246 0 0 0-3.222-4.896 1.389 1.389 0 0 0-1.667 1.045l-3.284 14.461c-.42 1.847-1.001 3.654-1.737 5.399l-3.215 7.627a16.592 16.592 0 0 0 3.556 18.177l1.674 1.674c6.333 6.333 16.472 6.733 23.284.918l8.522-7.275c.43-.368.906-.68 1.414-.931l10.031-4.949 6.933-2.444a3.124 3.124 0 0 0 1.897-4.017.898.898 0 0 0-1.068-.562l-8.261 2.124-8.6 3.522a1.766 1.766 0 0 1-2.43-1.499 4.564 4.564 0 0 1 2.007-4.139l8.785-5.9c.691-.464 1.414-.877 2.165-1.237l7.942-3.812a4.403 4.403 0 0 0 2.303-5.264 1.457 1.457 0 0 0-2.045-.875l-11.14 5.572-11.027 7.564c-.98.672-2.33.177-2.642-.97a4.407 4.407 0 0 1 .748-3.833l8.413-11.026 7.502-7.67a4.483 4.483 0 0 0 .12-6.144Z" clip-rule="evenodd"/>
  </svg>
`;var Q=i(9045),k=i(12058),T=i(54967),F=i(38190),P=i(51151),R=i(7861),D=i(29377),M=i(56962),x=i(83516),O=i(78781),G=i(63457),U=i(37579),V=i(47135),j=i(26411),N=i(22191),z=i(26477),Y=i(5513),L=i(74208),K=i(23649),X=i(1221),q=i(69855),H=i(91059),W=i(52396),$=i(40271),J=i(50700);class Z{}var _=i(37115),ee=i(18499),te=i(2471),ie=i(1601),ne=i(86214),re=i(26657),se=i(38620),oe=i(50352),ae=i(90246),le=i(86226),ce=i(97553),de=i(43759),ue=i(76356),he=i(69896),Ae=i(36288),pe=i(57178),ge=i(49519),ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const fe=["masterPasswordInputRef"],me=e=>({"tw-hidden":e});function ye(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"button",18),c.nI1(2,"i18n"),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.handleLoginWithPasskeyClick())}),c.nrm(3,"bit-icon",19),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.bVm()}if(2&e){const e=c.XpG();c.R7$(),c.Y8G("bitTooltip",e.ssoRequired?c.bMT(2,4,"yourOrganizationRequiresSingleSignOn"):"")("addTooltipToDescribedby",e.ssoRequired)("disabled",e.ssoRequired),c.R7$(3),c.SpI(" ",c.bMT(5,6,"logInWithPasskey")," ")}}function Ce(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"div",20),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"button",21),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.startAuthRequestLogin())}),c.nrm(5,"bit-icon",22),c.EFF(6),c.nI1(7,"i18n"),c.k0s(),c.bVm()}2&e&&(c.R7$(2),c.JRh(c.bMT(3,2,"or")),c.R7$(4),c.SpI(" ",c.bMT(7,4,"loginWithDevice")," "))}function we(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"button",21),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.backButtonClicked())}),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.bVm()}2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"back")," "))}const Ie="LoginComponent";var be;!function(e){e.EMAIL_ENTRY="EmailEntry",e.MASTER_PASSWORD_ENTRY="MasterPasswordEntry"}(be||(be={}));class Be{get emailFormControl(){return this.formGroup.controls.email}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,C,b,B,E,T,F){this.activatedRoute=e,this.anonLayoutWrapperDataService=t,this.appIdService=i,this.broadcasterService=n,this.destroyRef=r,this.devicesApiService=s,this.formBuilder=o,this.i18nService=a,this.loginEmailService=l,this.loginComponentService=c,this.loginStrategyService=d,this.messagingService=u,this.ngZone=h,this.passwordStrengthService=A,this.platformUtilsService=p,this.policyService=g,this.router=v,this.toastService=f,this.logService=m,this.validationService=C,this.loginSuccessHandlerService=b,this.configService=B,this.ssoLoginService=E,this.environmentService=T,this.passwordPreloginService=F,this.destroy$=new w.B,this.Icons={WaveIcon:S,VaultIcon:Q.E},this.ClientType=P.sK,this.orgPoliciesFromInvite=null,this.LoginUiState=be,this.isKnownDevice=!1,this.loginUiState=be.EMAIL_ENTRY,this.ssoRequired=!1,this.formGroup=this.formBuilder.group({email:["",[y.k0.required,y.k0.email]],masterPassword:["",[y.k0.required,y.k0.minLength(O.A.originalMinimumPasswordLength)]],rememberEmail:[!1]},{updateOn:"submit"}),this.deferFocus=null,this.submit=()=>ve(this,void 0,void 0,function*(){var e;if(this.clientType===P.sK.Desktop&&this.loginUiState!==be.MASTER_PASSWORD_ENTRY)return;const{email:t,masterPassword:i}=this.formGroup.value;if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;if(!t||!i)return void this.logService.error("Email and master password are required");this.orgPoliciesFromInvite=this.loginComponentService.getOrgPoliciesFromOrgInvite?yield this.loginComponentService.getOrgPoliciesFromOrgInvite(t):null;const n=null===(e=this.orgPoliciesFromInvite)||void 0===e?void 0:e.enforcedPasswordPolicyOptions,r=yield(0,I._)(this.passwordPreloginService.getPreloginData$(t)),s=new k.F2(t,i,void 0,n,r);try{const e=yield this.loginStrategyService.logIn(s);yield this.handleAuthResult(e)}catch(o){this.logService.error(o),yield this.handleSubmitError(o)}}),this.handlePopState=e=>ve(this,void 0,void 0,function*(){this.loginUiState===be.MASTER_PASSWORD_ENTRY?(e.preventDefault(),this.toggleLoginUiState(be.EMAIL_ENTRY)):this.loginUiState===be.EMAIL_ENTRY&&(e.preventDefault(),yield this.continue())}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return ve(this,void 0,void 0,function*(){window.addEventListener("popstate",this.handlePopState),yield this.defaultOnInit(),this.clientType===P.sK.Desktop&&(yield this.desktopOnInit())})}ngOnDestroy(){window.removeEventListener("popstate",this.handlePopState),this.clientType===P.sK.Desktop&&this.broadcasterService.unsubscribe(Ie),this.destroy$.next(),this.destroy$.complete()}defaultOnInit(){return ve(this,void 0,void 0,function*(){let e=!1;const t=yield(0,I._)(this.activatedRoute.queryParams);if(t){const i=t.email;null!=i&&i.indexOf("@")>-1&&(this.formGroup.controls.email.setValue(i),e=!0)}e||(yield this.loadRememberedEmail()),this.emailFormControl.value&&(yield this.getKnownDevice(this.emailFormControl.value)),this.activatedRoute||(yield this.loadRememberedEmail()),yield this.determineIfSsoRequired()})}desktopOnInit(){return ve(this,void 0,void 0,function*(){this.broadcasterService.subscribe(Ie,e=>ve(this,void 0,void 0,function*(){this.ngZone.run(()=>{if("windowIsFocused"===e.command)null===this.deferFocus?(this.deferFocus=!e.windowIsFocused,this.deferFocus||this.focusInput()):this.deferFocus&&e.windowIsFocused&&(this.focusInput(),this.deferFocus=!1)})})),this.messagingService.send("getWindowIsFocused")})}determineIfSsoRequired(){return ve(this,void 0,void 0,function*(){const e=yield(0,I._)(this.ssoLoginService.ssoRequiredCache$);null!=e&&e.size>0&&(this.emailFormControl.value&&e.has(this.emailFormControl.value.toLowerCase())&&(this.ssoRequired=!0),this.listenForEmailChanges(e))})}listenForEmailChanges(e){this.formGroup.controls.email.valueChanges.pipe((0,m.pQ)(this.destroyRef)).subscribe(()=>{this.emailFormControl.value&&e.has(this.emailFormControl.value.toLowerCase())?this.ssoRequired=!0:this.ssoRequired=!1})}handleSubmitError(e){return ve(this,void 0,void 0,function*(){var t;if(e instanceof R._)if(e.statusCode===P.kG.BadRequest)if(null===(t=e.message)||void 0===t?void 0:t.toLowerCase().includes("username or password is incorrect")){const e=yield(0,I._)(this.environmentService.environment$),t=O.A.getHost(e.getWebVaultUrl());this.formGroup.controls.masterPassword.setErrors({error:{message:this.i18nService.t("invalidMasterPasswordConfirmEmailAndHost",t)}})}else this.validationService.showError(e);else this.validationService.showError(e);else this.validationService.showError(e)})}handleAuthResult(e){return ve(this,void 0,void 0,function*(){var t,i;if(e.requiresEncryptionKeyMigration)this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("legacyEncryptionUnsupported")});else if(e.requiresTwoFactor)yield this.router.navigate(["2fa"]);else if(e.requiresDeviceVerification)yield this.router.navigate(["device-verification"]);else{if(e.requiresSso){const n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.value)||void 0===i?void 0:i.email;return n?void(yield this.loginComponentService.redirectToSsoLoginWithOrganizationSsoIdentifier(n,e.ssoOrganizationIdentifier)):void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("emailRequiredForSsoLogin")})}if(yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword),this.orgPoliciesFromInvite){yield this.setPoliciesIntoState(e.userId,this.orgPoliciesFromInvite.policies);if(yield this.isPasswordChangeRequiredByOrgPolicy(this.orgPoliciesFromInvite.enforcedPasswordPolicyOptions))return void(yield this.router.navigate(["change-password"]))}this.clientType===P.sK.Browser?yield this.router.navigate(["/tabs/vault"]):yield this.router.navigate(["vault"])}})}isPasswordChangeRequiredByOrgPolicy(e){return ve(this,void 0,void 0,function*(){var t,i;try{if(null==e)return!1;const n=this.formGroup.controls.masterPassword.value;if(!n)return!1;const r=null===(i=this.passwordStrengthService.getPasswordStrength(n,null!==(t=this.formGroup.value.email)&&void 0!==t?t:void 0))||void 0===i?void 0:i.score;return!this.policyService.evaluateMasterPassword(r,n,e)}catch(n){return this.logService.error(n),!1}})}setPoliciesIntoState(e,t){return ve(this,void 0,void 0,function*(){const i={};t.map(e=>i[e.id]=T.L.fromPolicy(e)),yield this.policyService.replace(i,e)})}startAuthRequestLogin(){return ve(this,void 0,void 0,function*(){var e,t;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&&(yield this.router.navigate(["/login-with-device"]))})}toggleLoginUiState(e){return ve(this,void 0,void 0,function*(){var t,i;if(this.loginUiState=e,this.loginUiState===be.EMAIL_ENTRY)this.loginComponentService.showBackButton(!1),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"logIn"},pageIcon:this.Icons.VaultIcon,pageSubtitle:null}),this.formGroup.controls.masterPassword.reset(),this.isKnownDevice=!1;else if(this.loginUiState===be.MASTER_PASSWORD_ENTRY){this.loginComponentService.showBackButton(!0),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"welcomeBack"},pageSubtitle:this.emailFormControl.value,pageIcon:this.Icons.WaveIcon}),this.formGroup.controls.masterPassword.markAsUntouched(),this.ngZone.isStable?null===(i=null===(t=this.masterPasswordInputRef)||void 0===t?void 0:t.nativeElement)||void 0===i||i.focus():this.ngZone.onStable.pipe((0,b.s)(1),(0,B.Q)(this.destroy$)).subscribe(()=>{var e,t;null===(t=null===(e=this.masterPasswordInputRef)||void 0===e?void 0:e.nativeElement)||void 0===t||t.focus()});const e=this.emailFormControl.value;e&&(yield this.getKnownDevice(e))}})}isLoginWithPasskeySupported(){return this.loginComponentService.isLoginWithPasskeySupported()}goToHint(){return ve(this,void 0,void 0,function*(){yield this.router.navigateByUrl("/hint")})}continuePressed(){return ve(this,void 0,void 0,function*(){history.pushState({},"",window.location.href),yield this.continue()})}continue(){return ve(this,void 0,void 0,function*(){this.validateEmail()&&(this.prefetchPasswordPreloginData(),yield this.toggleLoginUiState(be.MASTER_PASSWORD_ENTRY))})}handleLoginWithPasskeyClick(){return ve(this,void 0,void 0,function*(){yield this.router.navigate(["/login-with-passkey"])})}handleSsoClick(){return ve(this,void 0,void 0,function*(){if(!this.validateEmail())return;const e=this.formGroup.value.email;e?yield this.loginComponentService.redirectToSsoLogin(e):this.logService.error("Email is required for SSO")})}getKnownDevice(e){return ve(this,void 0,void 0,function*(){if(e)try{const t=yield this.appIdService.getAppId();this.isKnownDevice=yield this.devicesApiService.getKnownDevice(e,t)}catch(t){this.isKnownDevice=!1}else this.isKnownDevice=!1})}loadRememberedEmail(){return ve(this,void 0,void 0,function*(){const e=yield(0,I._)(this.loginEmailService.rememberedEmail$);e?(this.formGroup.controls.email.setValue(e),this.formGroup.controls.rememberEmail.setValue(!0),yield this.loginEmailService.setLoginEmail(e)):this.formGroup.controls.rememberEmail.setValue(!1)})}focusInput(){var e;null===(e=document.getElementById(null==this.emailFormControl.value||""===this.emailFormControl.value?"email":"masterPassword"))||void 0===e||e.focus()}shouldShowBackButton(){return this.loginUiState===be.MASTER_PASSWORD_ENTRY&&this.clientType!==P.sK.Browser}backButtonClicked(){return ve(this,void 0,void 0,function*(){history.back()})}prefetchPasswordPreloginData(){const e=this.formGroup.value.email;e&&this.passwordPreloginService.getPreloginData$(e)}validateEmail(){return this.formGroup.controls.email.markAsTouched(),this.formGroup.controls.email.updateValueAndValidity({onlySelf:!0,emitEvent:!0}),this.formGroup.controls.email.valid}persistEmailIfValid(){return ve(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.email.valid){const t=this.formGroup.value.email,i=null!==(e=this.formGroup.value.rememberEmail)&&void 0!==e&&e;if(!t)return;yield this.loginEmailService.setLoginEmail(t),yield this.loginEmailService.setRememberedEmailChoice(t,i)}else yield this.loginEmailService.clearLoginEmail(),yield this.loginEmailService.clearRememberedEmail()})}onEmailInput(e){return ve(this,void 0,void 0,function*(){const t=e.target;this.formGroup.controls.email.setValue(t.value),yield this.persistEmailIfValid()})}onRememberEmailInput(e){return ve(this,void 0,void 0,function*(){const t=e.target;this.formGroup.controls.rememberEmail.setValue(t.checked),yield this.persistEmailIfValid()})}}Be.ɵfac=function(e){return new(e||Be)(c.rXU(K.nX),c.rXU(X.f),c.rXU(H.Y),c.rXU(W.y),c.rXU(L.abz),c.rXU($.T),c.rXU(y.ok),c.rXU(J.W),c.rXU(k.DS),c.rXU(Z),c.rXU(k.sg),c.rXU(x.U),c.rXU(c.SKi),c.rXU(G.Q),c.rXU(_.y),c.rXU(ee.N),c.rXU(K.Ix),c.rXU(q.f),c.rXU(M.K),c.rXU(te.B),c.rXU(k.aJ),c.rXU(ie.w),c.rXU(ne._),c.rXU(D.v),c.rXU(F.Ld))},Be.ɵcmp=c.VBU({type:Be,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&c.GBs(fe,5),2&e){let e;c.mGM(e=c.lsd())&&(t.masterPasswordInputRef=e.first)}},decls:46,vars:45,consts:[["masterPasswordInputRef",""],[3,"bitSubmit","formGroup"],[3,"ngClass"],["type","email","formControlName","email","bitInput","","appAutofocus","",1,"vw-email-continue",3,"input","keyup.enter","disabled"],["type","email","formControlName","email","bitInput","","appAutofocus","",1,"vw-email-sso",3,"input","keyup.enter"],["type","checkbox","formControlName","rememberEmail","bitCheckbox","",3,"input"],[1,"tw-grid","tw-gap-3"],["type","button","bitButton","","block","","buttonType","primary",1,"vw-continue-login",3,"click","bitTooltip","addTooltipToDescribedby"],["type","button","bitButton","","block","",1,"vw-sso-login",3,"click","buttonType"],["name","bwi-provider",1,"tw-mr-1"],[1,"tw-text-center","vw-or-text"],[4,"ngIf"],["type","button","bitButton","","block","","buttonType","secondary",1,"vw-other-login",3,"click","disabled"],[1,"!tw-mb-1"],["type","password","formControlName","masterPassword","bitInput",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["bitLink","","routerLink","/hint",1,"tw-inline-block","tw-mb-4",3,"click"],["type","submit","bitButton","","bitFormButton","","block","","buttonType","primary"],["type","button","bitButton","","block","","buttonType","secondary",1,"vw-passkey-login",3,"click","bitTooltip","addTooltipToDescribedby","disabled"],["name","bwi-passkey",1,"tw-mr-1"],[1,"tw-text-center"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"],["name","bwi-mobile"]],template:function(e,t){if(1&e){const e=c.RV6();c.j41(0,"form",1)(1,"div",2)(2,"bit-form-field")(3,"bit-label"),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.j41(6,"input",3),c.bIt("input",function(i){return L.eBV(e),L.Njj(t.onEmailInput(i))})("keyup.enter",function(){return L.eBV(e),L.Njj(t.continuePressed())}),c.k0s(),c.j41(7,"input",4),c.bIt("input",function(i){return L.eBV(e),L.Njj(t.onEmailInput(i))})("keyup.enter",function(){return L.eBV(e),L.Njj(t.handleSsoClick())}),c.k0s()(),c.j41(8,"bit-form-control")(9,"input",5),c.bIt("input",function(i){return L.eBV(e),L.Njj(t.onRememberEmailInput(i))}),c.k0s(),c.j41(10,"bit-label"),c.EFF(11),c.nI1(12,"i18n"),c.k0s()(),c.j41(13,"div",6)(14,"button",7),c.nI1(15,"i18n"),c.bIt("click",function(){return L.eBV(e),L.Njj(t.continuePressed())}),c.EFF(16),c.nI1(17,"i18n"),c.k0s(),c.j41(18,"button",8),c.bIt("click",function(){return L.eBV(e),L.Njj(t.handleSsoClick())}),c.nrm(19,"bit-icon",9),c.EFF(20),c.nI1(21,"i18n"),c.k0s(),c.j41(22,"div",10),c.EFF(23),c.nI1(24,"i18n"),c.k0s(),c.DNE(25,ye,6,8,"ng-container",11),c.j41(26,"button",12),c.bIt("click",function(){return L.eBV(e),L.Njj(t.continuePressed())}),c.EFF(27),c.nI1(28,"i18n"),c.k0s()()(),c.j41(29,"div",2)(30,"bit-form-field",13)(31,"bit-label"),c.EFF(32),c.nI1(33,"i18n"),c.k0s(),c.nrm(34,"input",14,0)(36,"button",15),c.k0s(),c.j41(37,"a",16),c.bIt("click",function(){return L.eBV(e),L.Njj(t.goToHint())}),c.EFF(38),c.nI1(39,"i18n"),c.k0s(),c.j41(40,"div",6)(41,"button",17),c.EFF(42),c.nI1(43,"i18n"),c.k0s(),c.DNE(44,Ce,8,6,"ng-container",11)(45,we,4,3,"ng-container",11),c.k0s()()()}2&e&&(c.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),c.R7$(),c.Y8G("ngClass",c.eq3(41,me,t.loginUiState!==t.LoginUiState.EMAIL_ENTRY)),c.R7$(3),c.JRh(c.bMT(5,21,"emailAddress")),c.R7$(2),c.Y8G("disabled",t.ssoRequired),c.R7$(5),c.JRh(c.bMT(12,23,"rememberEmail")),c.R7$(3),c.Y8G("bitTooltip",t.ssoRequired?c.bMT(15,25,"yourOrganizationRequiresSingleSignOn"):"")("addTooltipToDescribedby",t.ssoRequired),c.R7$(2),c.SpI(" ",c.bMT(17,27,"continue")," "),c.R7$(2),c.Y8G("buttonType",t.ssoRequired?"primary":"secondary"),c.R7$(2),c.SpI(" ",c.bMT(21,29,"useSingleSignOn")," "),c.R7$(3),c.JRh(c.bMT(24,31,"or")),c.R7$(2),c.Y8G("ngIf",t.isLoginWithPasskeySupported()),c.R7$(),c.Y8G("disabled",t.ssoRequired),c.R7$(),c.SpI(" ",c.bMT(28,33,"other")," "),c.R7$(2),c.Y8G("ngClass",c.eq3(43,me,t.loginUiState!==t.LoginUiState.MASTER_PASSWORD_ENTRY)),c.R7$(3),c.JRh(c.bMT(33,35,"masterPass")),c.R7$(6),c.SpI(" ",c.bMT(39,37,"getMasterPasswordHint")," "),c.R7$(4),c.SpI(" ",c.bMT(43,39,"loginWithMasterPassword")," "),c.R7$(2),c.Y8G("ngIf",t.isKnownDevice),c.R7$(),c.Y8G("ngIf",t.shouldShowBackButton()))},dependencies:[U.C,re.$,se.L,o.t,d.Q,V.q,oe.P,f.MD,f.YU,f.bT,j.L,ae.f,le.j,ce.J,de.h,ue.e,he.a,N.Q,Ae.s,l.o,A.R,z.V,pe.g,n.p,ge.B,y.X1,y.qT,y.me,y.Zm,y.BC,y.cb,y.j4,y.JD,C.iI,C.Wk,Y.d,p.$],encapsulation:2});var Ee=i(62602);function Se(e,t){1&e&&(c.j41(0,"div",1)(1,"a",2),c.EFF(2),c.nI1(3,"i18n"),c.k0s()()),2&e&&(c.R7$(2),c.JRh(c.bMT(3,1,"createAccount")))}class Qe{constructor(){this.serverSettingsService=(0,L.WQX)(Ee.t),this.isUserRegistrationDisabled$=this.serverSettingsService.isUserRegistrationDisabled$}}Qe.ɵfac=function(e){return new(e||Qe)},Qe.ɵcmp=c.VBU({type:Qe,selectors:[["ng-component"]],decls:2,vars:3,consts:[["class","tw-text-center vw-signup-link",4,"ngIf"],[1,"tw-text-center","vw-signup-link"],["bitLink","","routerLink","/signup"]],template:function(e,t){1&e&&(c.DNE(0,Se,4,3,"div",0),c.nI1(1,"async")),2&e&&c.Y8G("ngIf",!c.bMT(1,1,t.isUserRegistrationDisabled$))},dependencies:[f.MD,f.bT,n.p,z.V,pe.g,C.iI,C.Wk,f.Jj,p.$],encapsulation:2});var ke=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Te{constructor(e,t,i,n,r){this.cryptoFunctionService=e,this.environmentService=t,this.passwordGenerationService=i,this.platformUtilsService=n,this.ssoLoginService=r,this.clientType=this.platformUtilsService.getClientType()}isLoginWithPasskeySupported(){return this.clientType===P.sK.Web}redirectToSsoLogin(e){return ke(this,void 0,void 0,function*(){const[t,i]=yield this.setSsoPreLoginState(e);yield this.redirectToSso(e,t,i)})}redirectToSsoLoginWithOrganizationSsoIdentifier(e,t){return ke(this,void 0,void 0,function*(){const[i,n]=yield this.setSsoPreLoginState(e);yield this.redirectToSso(e,i,n,t)})}redirectToSso(e,t,i,n){return ke(this,void 0,void 0,function*(){})}showBackButton(e){}setSsoPreLoginState(e){return ke(this,void 0,void 0,function*(){const t={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};let i=yield this.passwordGenerationService.generatePassword(t);this.clientType===P.sK.Browser&&(i+=":clientId=browser");const n=yield this.passwordGenerationService.generatePassword(t),r=yield this.cryptoFunctionService.hash(n,"sha256"),s=O.A.fromArrayToUrlB64(r);return yield this.ssoLoginService.setSsoState(i),yield this.ssoLoginService.setCodeVerifier(n),yield this.ssoLoginService.setSsoEmail(e),[i,s]})}}var Fe=i(73276),Pe=i(3204),Re=i(44500),De=i(43008),Me=i(37567),xe=i(84079),Oe=i(75811),Ge=i(93695),Ue=i(82468),Ve=i(48541),je=i(33413),Ne=i(66523),ze=i(43890),Ye=i(75583),Le=i(8916),Ke=i(35500),Xe=i(12012),qe=i(39935);class He{}var We,$e=i(11224),Je=i(45891),Ze=i(75633),_e=i(35770),et=i(3892),tt=i(93199),it=i(58806),nt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},rt=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},st=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});function ot(e,t){1&e&&(c.qex(0),c.j41(1,"div",2),c.nrm(2,"bit-icon",3),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.Y8G("ariaLabel",c.bMT(3,1,"loading")))}function at(e,t){if(1&e&&(c.j41(0,"form",4)(1,"bit-form-control"),c.nrm(2,"input",5),c.j41(3,"bit-label"),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.j41(6,"bit-hint",6),c.EFF(7),c.nI1(8,"i18n"),c.k0s()()()),2&e){const e=c.XpG();c.Y8G("formGroup",e.formGroup),c.R7$(4),c.JRh(c.bMT(5,3,"rememberThisDevice")),c.R7$(3),c.JRh(c.bMT(8,5,"uncheckIfPublicDevice"))}}function lt(e,t){if(1&e&&(c.qex(0),c.j41(1,"button",7),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.Y8G("bitAction",e.createUser),c.R7$(),c.SpI(" ",c.bMT(3,2,"continue")," ")}}function ct(e,t){1&e&&(c.j41(0,"div",2),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"or")," "))}function dt(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"button",11),c.bIt("click",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.approveFromOtherDevice())}),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.DNE(4,ct,3,3,"div",12),c.bVm()}if(2&e){const e=c.XpG(2);c.R7$(2),c.SpI(" ",c.bMT(3,2,"approveFromYourOtherDevice")," "),c.R7$(2),c.Y8G("ngIf",e.canApproveWithMasterPassword||e.canRequestAdminApproval)}}function ut(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",13),c.bIt("click",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.approveWithMasterPassword())}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"useMasterPassword")," "))}function ht(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",13),c.bIt("click",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.requestAdminApproval())}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"requestAdminApproval")," "))}function At(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"div",8),c.DNE(2,dt,5,4,"ng-container",0)(3,ut,3,3,"button",9)(4,ht,3,3,"button",9),c.j41(5,"button",10),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.logOut())}),c.EFF(6),c.nI1(7,"i18n"),c.k0s()(),c.bVm()}if(2&e){const e=c.XpG();c.R7$(2),c.Y8G("ngIf",e.canApproveFromOtherDevice),c.R7$(),c.Y8G("ngIf",e.canApproveWithMasterPassword),c.R7$(),c.Y8G("ngIf",e.canRequestAdminApproval),c.R7$(2),c.SpI(" ",c.bMT(7,4,"logOut")," ")}}!function(e){e[e.NewUser=0]="NewUser",e[e.ExistingUserUntrustedDevice=1]="ExistingUserUntrustedDevice"}(We||(We={}));class pt{get rememberDeviceControl(){return this.formGroup.controls.rememberDevice}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,b,B,E,S){this.accountService=e,this.anonLayoutWrapperDataService=t,this.apiService=i,this.destroyRef=n,this.deviceTrustService=r,this.dialogService=s,this.formBuilder=o,this.i18nService=a,this.keyService=l,this.loginDecryptionOptionsService=c,this.loginEmailService=d,this.messagingService=u,this.organizationApiService=h,this.passwordResetEnrollmentService=A,this.platformUtilsService=p,this.router=g,this.ssoLoginService=v,this.toastService=f,this.userDecryptionOptionsService=m,this.validationService=y,this.logoutService=C,this.registerSdkService=w,this.securityStateService=b,this.appIdService=B,this.configService=E,this.accountCryptographicStateService=S,this.loading=!1,this.State=We,this.formGroup=this.formBuilder.group({rememberDevice:[!0]}),this.canApproveFromOtherDevice=!1,this.canRequestAdminApproval=!1,this.canApproveWithMasterPassword=!1,this.createUser=()=>nt(this,void 0,void 0,function*(){if(this.state===We.NewUser)try{if(yield this.configService.getFeatureFlag(Ue.TO.PM27279_V2RegistrationTdeJit)){const e=yield this.appIdService.getAppId(),t=this.activeAccountId,i=this.newUserOrgId,n=yield this.organizationApiService.getKeys(i),r=yield(0,I._)(this.registerSdkService.registerClient$(t).pipe((0,Fe.H)(r=>nt(this,void 0,void 0,function*(){const s={stack:[],error:void 0,hasError:!1};try{if(!r)throw new Error("SDK not available");const o=rt(s,r.take(),!1);return yield o.value.auth().registration().post_keys_for_tde_registration({org_id:(0,Ne.WD)(i),org_public_key:n.publicKey,user_id:(0,Ne.WD)(t),device_identifier:e,trust_device:this.formGroup.value.rememberDevice})}catch(o){s.error=o,s.hasError=!0}finally{st(s)}}))));if("V1"in r.account_cryptographic_state)throw new Error("Unexpected V1 account cryptographic state");yield this.accountCryptographicStateService.setAccountCryptographicState(r.account_cryptographic_state,t),yield this.deviceTrustService.setDeviceKey(t,ze.e.fromString(r.device_key)),yield this.keyService.setUserKey(ze.e.fromString(r.user_key),t)}else{const{publicKey:e,privateKey:t}=yield this.keyService.initAccount(this.activeAccountId),i=new Ve.G(e,t.encryptedString);yield this.apiService.postAccountKeys(i),yield this.passwordResetEnrollmentService.enroll(this.newUserOrgId),this.formGroup.value.rememberDevice&&(yield this.deviceTrustService.trustDevice(this.activeAccountId))}this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("accountSuccessfullyCreated")}),yield this.loginDecryptionOptionsService.handleCreateUserSuccess(),this.clientType===P.sK.Desktop&&this.messagingService.send("redrawMenu"),yield this.handleCreateUserSuccessNavigation()}catch(e){this.validationService.showError(e)}}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return nt(this,void 0,void 0,function*(){var e,t;if(this.loading=!0,this.activeAccountId=null===(e=yield(0,I._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id,this.email=yield(0,I._)(this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email))),this.email){this.observeAndPersistRememberDeviceValueChanges(),yield this.setRememberDeviceDefaultValueFromState();try{const e=yield(0,I._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(this.activeAccountId));(null===(t=null==e?void 0:e.trustedDeviceOption)||void 0===t?void 0:t.hasAdminApproval)||(null==e?void 0:e.hasMasterPassword)?this.loadExistingUserUntrustedDeviceData(e):yield this.loadNewUserData()}catch(i){this.validationService.showError(i)}finally{this.loading=!1}}else yield this.handleMissingEmail()})}handleMissingEmail(){return nt(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("activeUserEmailNotFoundLoggingYouOut")}),yield this.logoutService.logout(this.activeAccountId),yield this.router.navigate(["/"])})}observeAndPersistRememberDeviceValueChanges(){this.rememberDeviceControl.valueChanges.pipe((0,m.pQ)(this.destroyRef),(0,Re.n)(e=>(0,De.v)(()=>this.deviceTrustService.setShouldTrustDevice(this.activeAccountId,e)))).subscribe()}setRememberDeviceDefaultValueFromState(){return nt(this,void 0,void 0,function*(){const e=yield this.deviceTrustService.getShouldTrustDevice(this.activeAccountId),t=null==e||e;this.rememberDeviceControl.setValue(t)})}loadNewUserData(){return nt(this,void 0,void 0,function*(){this.state=We.NewUser,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"loggedInExclamation"},pageSubtitle:{key:"rememberThisDeviceToMakeFutureLoginsSeamless"}});const e=(0,De.v)(()=>this.ssoLoginService.getActiveUserOrganizationSsoIdentifier(this.activeAccountId)).pipe((0,Re.n)(e=>null==e?(0,Me.$)(()=>new Error(this.i18nService.t("ssoIdentifierRequired"))):(0,xe.H)(this.organizationApiService.getAutoEnrollStatus(e))),(0,Oe.W)(e=>(this.validationService.showError(e),(0,Ge.of)(void 0)))),t=yield(0,I._)(e);this.newUserOrgId=t.id})}loadExistingUserUntrustedDeviceData(e){var t,i;this.state=We.ExistingUserUntrustedDevice,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"deviceApprovalRequiredV2"},pageSubtitle:{key:"selectAnApprovalOptionBelow"}}),this.canApproveFromOtherDevice=(null===(t=null==e?void 0:e.trustedDeviceOption)||void 0===t?void 0:t.hasLoginApprovingDevice)||!1,this.canRequestAdminApproval=(null===(i=null==e?void 0:e.trustedDeviceOption)||void 0===i?void 0:i.hasAdminApproval)||!1,this.canApproveWithMasterPassword=(null==e?void 0:e.hasMasterPassword)||!1}handleCreateUserSuccessNavigation(){return nt(this,void 0,void 0,function*(){this.clientType===P.sK.Browser?yield this.router.navigate(["/tabs/vault"]):yield this.router.navigate(["/vault"])})}approveFromOtherDevice(){return nt(this,void 0,void 0,function*(){yield this.router.navigate(["/login-with-device"])})}approveWithMasterPassword(){return nt(this,void 0,void 0,function*(){yield this.router.navigate(["/lock"],{queryParams:{from:"login-initiated"}})})}requestAdminApproval(){return nt(this,void 0,void 0,function*(){yield this.router.navigate(["/admin-approval-requested"])})}logOut(){return nt(this,void 0,void 0,function*(){var e;const t=yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}),i=null===(e=yield(0,I._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;t&&(yield this.logoutService.logout(i),yield this.router.navigate(["/"]))})}}pt.ɵfac=function(e){return new(e||pt)(c.rXU(Ke.D),c.rXU(X.f),c.rXU(Xe.G),c.rXU(L.abz),c.rXU(qe.M),c.rXU(r.o3),c.rXU(y.ok),c.rXU(J.W),c.rXU(Le.Lu),c.rXU(He),c.rXU(k.DS),c.rXU(x.U),c.rXU($e.X),c.rXU(Je._),c.rXU(_.y),c.rXU(K.Ix),c.rXU(ne._),c.rXU(q.f),c.rXU(k.Ym),c.rXU(te.B),c.rXU(k.k4),c.rXU(je.vW),c.rXU(Ze.p),c.rXU(H.Y),c.rXU(ie.w),c.rXU(_e.h))},pt.ɵcmp=c.VBU({type:pt,selectors:[["ng-component"]],decls:4,vars:4,consts:[[4,"ngIf"],[3,"formGroup",4,"ngIf"],[1,"tw-text-center"],["name","bwi-spinner",1,"bwi-spin","bwi-2x","tw-text-muted",3,"ariaLabel"],[3,"formGroup"],["type","checkbox","bitCheckbox","","formControlName","rememberDevice"],["bitTypography","body2"],["type","button","bitButton","","block","","buttonType","primary",3,"bitAction"],[1,"tw-grid","tw-gap-3"],["type","button","bitButton","","block","","buttonType","secondary",3,"click",4,"ngIf"],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","block","","buttonType","primary",3,"click"],["class","tw-text-center",4,"ngIf"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&c.DNE(0,ot,4,3,"ng-container",0)(1,at,9,7,"form",1)(2,lt,4,4,"ng-container",0)(3,At,8,6,"ng-container",0),2&e&&(c.Y8G("ngIf",t.loading),c.R7$(),c.Y8G("ngIf",!t.loading),c.R7$(),c.Y8G("ngIf",t.state===t.State.NewUser),c.R7$(),c.Y8G("ngIf",t.state===t.State.ExistingUserUntrustedDevice))},dependencies:[U.C,et.p,re.$,o.t,d.Q,V.q,oe.P,f.MD,f.bT,l.o,A.R,j.L,ae.f,le.j,tt.I,n.p,y.X1,y.qT,y.Zm,y.BC,y.cb,y.j4,y.JD,Ye.E,it.r,p.$],encapsulation:2});var gt,vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ft{constructor(e){this.messagingService=e}handleCreateUserSuccess(){return null}logOut(){return vt(this,void 0,void 0,function*(){this.messagingService.send("logout")})}}!function(e){e[e.AuthenticateAndUnlock=0]="AuthenticateAndUnlock",e[e.Unlock=1]="Unlock",e[e.AdminApproval=2]="AdminApproval"}(gt||(gt={}));var mt=i(84110),yt=i(99352);class Ct{constructor(e,t,i,n,r){this.email=e,this.deviceIdentifier=t,this.publicKey=i,this.type=n,this.accessCode=r}}var wt=i(71373),It=i(47836);class bt{constructor(){this.id=void 0,this.accessCode=void 0,this.privateKey=void 0}static fromJSON(e){return null==e?null:Object.assign(new bt,e)}}class Bt{constructor(){this.viewCacheService=(0,L.WQX)(It.Z),this.defaultLoginViaAuthRequestCache=this.viewCacheService.signal({key:"login-via-auth-request-form-cache",initialValue:null,deserializer:bt.fromJSON})}cacheLoginView(e,t,i){this.defaultLoginViaAuthRequestCache.set({id:e,privateKey:O.A.fromArrayToB64(t),accessCode:i})}clearCacheLoginView(){this.defaultLoginViaAuthRequestCache.set(null)}getCachedLoginViaAuthRequestView(){return this.defaultLoginViaAuthRequestCache()}}Bt.ɵfac=function(e){return new(e||Bt)},Bt.ɵprov=L.jDH({token:Bt,factory:Bt.ɵfac});var Et,St=i(29744),Qt=i(77312),kt=i(68455),Tt=i(45872),Ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Pt(e,t){1&e&&(c.qex(0),c.j41(1,"div",1),c.nrm(2,"bit-icon",2),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.Y8G("ariaLabel",c.bMT(3,1,"loading")))}function Rt(e,t){if(1&e&&(c.j41(0,"p"),c.EFF(1),c.nI1(2,"i18n"),c.j41(3,"a",8),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.EFF(6),c.nI1(7,"i18n"),c.k0s()),2&e){const e=c.XpG(3);c.R7$(),c.SpI(" ",c.bMT(2,4,"notificationSentDevicePart1")," "),c.R7$(2),c.Y8G("href",e.deviceManagementUrl,c.B4B),c.R7$(),c.JRh(c.bMT(5,6,"notificationSentDeviceAnchor")),c.R7$(2),c.SpI(". ",c.bMT(7,8,"notificationSentDevicePart2")," ")}}function Dt(e,t){1&e&&(c.j41(0,"p"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"notificationSentDeviceComplete")," "))}function Mt(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",9),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.handleNewStandardAuthRequestLogin())}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"resendNotification")," "))}function xt(e,t){if(1&e&&(c.j41(0,"div",10)(1,"span"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.EFF(4,"  "),c.j41(5,"a",11),c.EFF(6),c.nI1(7,"i18n"),c.k0s()()),2&e){const e=c.XpG(3);c.R7$(2),c.JRh(c.bMT(3,3,"needAnotherOptionV1")),c.R7$(3),c.Y8G("routerLink",e.backToRoute),c.R7$(),c.JRh(c.bMT(7,5,"viewAllLogInOptions"))}}function Ot(e,t){if(1&e&&(c.qex(0),c.DNE(1,Rt,8,10,"p",0)(2,Dt,3,3,"p",0),c.j41(3,"div",4),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.j41(6,"code",5),c.EFF(7),c.k0s(),c.DNE(8,Mt,3,3,"button",6)(9,xt,8,7,"div",7),c.bVm()),2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",e.clientType!==e.ClientType.Web),c.R7$(),c.Y8G("ngIf",e.clientType===e.ClientType.Web),c.R7$(2),c.JRh(c.bMT(5,6,"fingerprintPhraseHeader")),c.R7$(3),c.JRh(e.fingerprintPhrase),c.R7$(),c.Y8G("ngIf",e.showResendNotification),c.R7$(),c.Y8G("ngIf",e.clientType!==e.ClientType.Browser)}}function Gt(e,t){if(1&e&&(c.qex(0),c.j41(1,"p"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"div",4),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.j41(7,"code",5),c.EFF(8),c.k0s(),c.j41(9,"div",10)(10,"span"),c.EFF(11),c.nI1(12,"i18n"),c.k0s(),c.EFF(13,"  "),c.j41(14,"a",11),c.EFF(15),c.nI1(16,"i18n"),c.k0s()(),c.bVm()),2&e){const e=c.XpG(2);c.R7$(2),c.JRh(c.bMT(3,6,"youWillBeNotifiedOnceTheRequestIsApproved")),c.R7$(3),c.JRh(c.bMT(6,8,"fingerprintPhraseHeader")),c.R7$(3),c.JRh(e.fingerprintPhrase),c.R7$(3),c.JRh(c.bMT(12,10,"troubleLoggingIn")),c.R7$(3),c.Y8G("routerLink",e.backToRoute),c.R7$(),c.JRh(c.bMT(16,12,"viewAllLogInOptions"))}}function Ut(e,t){if(1&e&&(c.qex(0),c.j41(1,"div",3),c.DNE(2,Ot,10,8,"ng-container",0)(3,Gt,17,14,"ng-container",0),c.k0s(),c.bVm()),2&e){const e=c.XpG();c.R7$(2),c.Y8G("ngIf",e.flow===e.Flow.StandardAuthRequest),c.R7$(),c.Y8G("ngIf",e.flow===e.Flow.AdminAuthRequest)}}!function(e){e[e.StandardAuthRequest=0]="StandardAuthRequest",e[e.AdminAuthRequest=1]="AdminAuthRequest"}(Et||(Et={}));const Vt={paths:"exact",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"};class jt{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,y,C){this.accountService=e,this.anonymousHubService=t,this.appIdService=i,this.authRequestApiService=n,this.authRequestService=r,this.authService=s,this.cryptoFunctionService=o,this.deviceTrustService=a,this.environmentService=l,this.i18nService=c,this.logService=d,this.loginEmailService=u,this.loginStrategyService=h,this.passwordGenerationService=A,this.platformUtilsService=p,this.router=g,this.toastService=v,this.validationService=f,this.loginSuccessHandlerService=y,this.loginViaAuthRequestCacheService=C,this.authRequestKeyPair=void 0,this.accessCode=void 0,this.authStatus=void 0,this.showResendNotificationTimeoutSeconds=12,this.loading=!0,this.backToRoute="/login",this.ClientType=P.sK,this.email=void 0,this.fingerprintPhrase=void 0,this.showResendNotification=!1,this.Flow=Et,this.flow=Et.StandardAuthRequest,this.webVaultUrl=void 0,this.clientType=this.platformUtilsService.getClientType(),this.authRequestService.authRequestPushNotification$.pipe((0,m.pQ)()).subscribe(e=>{this.loading=!0,this.handleExistingAuthRequestLogin(e).catch(e=>{this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:e.message}),this.loading=!1,this.logService.error("Failed to use approved auth request: "+e.message)})}),this.environmentService.environment$.pipe((0,m.pQ)()).subscribe(e=>{this.webVaultUrl=e.getWebVaultUrl(),this.deviceManagementUrl=`${this.webVaultUrl}/#/settings/security/device-management`})}ngOnInit(){return Ft(this,void 0,void 0,function*(){this.authStatus=yield(0,I._)(this.authService.activeAccountStatus$);this.authStatus===mt.J.Locked&&(this.backToRoute="/login-initiated"),this.router.isActive("admin-approval-requested",Vt)?yield this.initAdminAuthRequestFlow():yield this.initStandardAuthRequestFlow(),this.loading=!1})}initAdminAuthRequestFlow(){return Ft(this,void 0,void 0,function*(){var e;this.flow=Et.AdminAuthRequest;const t=null===(e=yield(0,I._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;if(!t)return void this.logService.error("Not able to get a user id from the account service active account observable.");const i=yield this.reloadCachedAdminAuthRequest(t);i?yield this.handleExistingAdminAuthRequestLogin(i,t):yield this.handleNewAdminAuthRequestLogin()})}initStandardAuthRequestFlow(){return Ft(this,void 0,void 0,function*(){var e,t;this.flow=Et.StandardAuthRequest;const i=this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email)),n=this.loginEmailService.loginEmail$;let r=null!==(e=yield(0,I._)(n))&&void 0!==e?e:void 0;if(r||(r=null!==(t=yield(0,I._)(i))&&void 0!==t?t:void 0),this.email=r,!this.email)return void(yield this.handleMissingEmail());const s=this.loginViaAuthRequestCacheService.getCachedLoginViaAuthRequestView();if(s){if(this.logService.info("Found cached auth request."),!s.id)return void this.logService.error("No id on the cached auth request when in the standard auth request flow.");yield this.reloadCachedStandardAuthRequest(s),yield this.handleExistingAuthRequestLogin(s.id)}else yield this.handleNewStandardAuthRequestLogin()})}handleMissingEmail(){return Ft(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",message:this.i18nService.t("userEmailMissing")}),yield this.router.navigate([this.backToRoute])})}ngOnDestroy(){return Ft(this,void 0,void 0,function*(){yield this.anonymousHubService.stopHubConnection(),this.loginViaAuthRequestCacheService.clearCacheLoginView()})}handleNewAdminAuthRequestLogin(){return Ft(this,void 0,void 0,function*(){var e;try{if(!this.email)return void this.logService.error("No email when starting admin auth request login.");const t=yield this.buildAuthRequest(this.email,gt.AdminApproval);if(!t)return void this.logService.error("Auth request failed to build.");if(!this.authRequestKeyPair)return void this.logService.error("Key pairs failed to initialize from buildAuthRequest.");const i=yield this.authRequestApiService.postAdminAuthRequest(t),n=new yt.x({id:i.id,privateKey:this.authRequestKeyPair.privateKey}),r=null===(e=yield(0,I._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;if(!r)return void this.logService.error("Not able to get a user id from the account service active account observable.");yield this.authRequestService.setAdminAuthRequest(n,r),i.id&&(yield this.anonymousHubService.createHubConnection(i.id))}catch(t){this.logService.error(t)}})}reloadCachedAdminAuthRequest(e){return Ft(this,void 0,void 0,function*(){return this.email=yield(0,I._)(this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email))),this.email?yield this.authRequestService.getAdminAuthRequest(e):(yield this.handleMissingEmail(),null)})}reloadCachedStandardAuthRequest(e){return Ft(this,void 0,void 0,function*(){if(e){if(!this.email)return void this.logService.error("Email not defined when trying to reload cached standard auth request.");if(!e.privateKey)return void this.logService.error("No private key on the cached auth request when trying to reload cached standard auth request.");if(!e.accessCode)return void this.logService.error("No access code on the cached auth request when trying to reload cached standard auth request.");const t=O.A.fromB64ToArray(e.privateKey),i=yield this.cryptoFunctionService.rsaExtractPublicKey(t);this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,i),this.authRequestKeyPair={privateKey:t,publicKey:void 0},this.accessCode=e.accessCode}})}handleNewStandardAuthRequestLogin(){return Ft(this,void 0,void 0,function*(){this.showResendNotification=!1;try{if(!this.email)return void this.logService.error("Email not defined when starting standard auth request login.");const e=yield this.buildAuthRequest(this.email,gt.AuthenticateAndUnlock);if(!e)return void this.logService.error("AuthRequest failed to initialize from buildAuthRequest.");if(!this.fingerprintPhrase)return void this.logService.error("FingerprintPhrase failed to initialize from buildAuthRequest.");if(!this.authRequestKeyPair)return void this.logService.error("KeyPair failed to initialize from buildAuthRequest.");const t=yield this.authRequestApiService.postAuthRequest(e);if(!this.authRequestKeyPair.privateKey)return void this.logService.error("No private key when trying to cache the login view.");if(!this.accessCode)return void this.logService.error("No access code when trying to cache the login view.");this.loginViaAuthRequestCacheService.cacheLoginView(t.id,this.authRequestKeyPair.privateKey,this.accessCode),t.id&&(yield this.anonymousHubService.createHubConnection(t.id))}catch(e){this.logService.error(e)}setTimeout(()=>{this.showResendNotification=!0},1e3*this.showResendNotificationTimeoutSeconds)})}buildAuthRequest(e,t){return Ft(this,void 0,void 0,function*(){const i=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);this.authRequestKeyPair={publicKey:i[0],privateKey:i[1]};const n=yield this.appIdService.getAppId();if(!this.authRequestKeyPair.publicKey){const e="No public key when building an auth request.";throw this.logService.error(e),new Error(e)}this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(e,this.authRequestKeyPair.publicKey),this.accessCode=yield this.passwordGenerationService.generatePassword({type:"password",length:25});const r=O.A.fromBufferToB64(this.authRequestKeyPair.publicKey);return new Ct(e,n,r,t,this.accessCode)})}handleExistingAdminAuthRequestLogin(e,t){return Ft(this,void 0,void 0,function*(){let i;try{i=yield this.authRequestApiService.getAuthRequest(e.id)}catch(r){return r instanceof R._&&r.statusCode===P.kG.NotFound?yield this.clearExistingAdminAuthRequestAndStartNewRequest(t):void this.logService.error(r)}if(!i)return yield this.clearExistingAdminAuthRequestAndStartNewRequest(t);if(i.isAnswered&&!i.requestApproved)return yield this.clearExistingAdminAuthRequestAndStartNewRequest(t);if(i.requestApproved)return yield this.decryptViaApprovedAuthRequest(i,e.privateKey,t);if(!this.email)return void this.logService.error("Email not defined when handling an existing an admin auth request.");const n=yield this.cryptoFunctionService.rsaExtractPublicKey(e.privateKey);this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,n),this.authRequestKeyPair={privateKey:e.privateKey,publicKey:void 0},yield this.anonymousHubService.createHubConnection(e.id)})}retrieveAuthRequest(e){return Ft(this,void 0,void 0,function*(){let t;try{if(this.authStatus===mt.J.Locked)t=yield this.authRequestApiService.getAuthRequest(e);else{if(!this.accessCode){const e="No access code available when handling approved auth request.";throw this.logService.error(e),new Error(e)}t=yield this.authRequestApiService.getAuthResponse(e,this.accessCode)}}catch(i){i instanceof R._&&i.statusCode===P.kG.NotFound?t=void 0:this.logService.error(i)}if(void 0===t)throw new Error("Auth request response not generated");return t})}handleExistingAuthRequestLogin(e){return Ft(this,void 0,void 0,function*(){this.showResendNotification=!1;try{const t=yield this.retrieveAuthRequest(e);if(!t)return yield this.clearExistingStandardAuthRequestAndStartNewRequest();if(t.isAnswered&&!t.requestApproved)return yield this.clearExistingStandardAuthRequestAndStartNewRequest();if(t.requestApproved){return this.authStatus===mt.J.Locked?yield this.handleAuthenticatedFlows(t):yield this.handleUnauthenticatedFlows(t,e)}yield this.anonymousHubService.createHubConnection(e)}catch(t){t instanceof R._&&(yield this.router.navigate([this.backToRoute]),this.validationService.showError(t)),this.logService.error(t)}setTimeout(()=>{this.showResendNotification=!0},1e3*this.showResendNotificationTimeoutSeconds)})}handleAuthenticatedFlows(e){return Ft(this,void 0,void 0,function*(){var t;const i=null===(t=yield(0,I._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;i?this.authRequestKeyPair&&this.authRequestKeyPair.privateKey?yield this.decryptViaApprovedAuthRequest(e,this.authRequestKeyPair.privateKey,i):this.logService.error("No private key set when handling the authenticated flows."):this.logService.error("Not able to get a user id from the account service active account observable.")})}handleUnauthenticatedFlows(e,t){return Ft(this,void 0,void 0,function*(){const i=yield this.buildAuthRequestLoginCredentials(t,e);if(!i)return void this.logService.error("Didn't set up auth request login credentials properly.");this.loginViaAuthRequestCacheService.clearCacheLoginView();const n=yield this.loginStrategyService.logIn(i);yield this.handlePostLoginNavigation(n)})}decryptViaApprovedAuthRequest(e,t,i){return Ft(this,void 0,void 0,function*(){yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(e,t,i),yield this.authRequestService.clearAdminAuthRequest(i),this.loginViaAuthRequestCacheService.clearCacheLoginView(),this.toastService.showToast({variant:"success",message:this.i18nService.t("loginApproved")});const n=yield(0,I._)(this.accountService.activeAccount$);n?(yield this.deviceTrustService.trustDeviceIfRequired(n.id),yield this.handleSuccessfulLoginNavigation(i)):this.logService.error("No active account defined from the account service.")})}buildAuthRequestLoginCredentials(e,t){return Ft(this,void 0,void 0,function*(){if(!this.authRequestKeyPair||!this.authRequestKeyPair.privateKey)return void this.logService.error("No private key set when building auth request login credentials.");if(!this.email)return void this.logService.error("Email not defined.");if(!this.accessCode)return void this.logService.error("Access code not defined when building auth request login credentials.");const i=yield this.authRequestService.decryptPubKeyEncryptedUserKey(t.key,this.authRequestKeyPair.privateKey);return new k.xM(this.email,this.accessCode,e,i)})}clearExistingAdminAuthRequestAndStartNewRequest(e){return Ft(this,void 0,void 0,function*(){yield this.authRequestService.clearAdminAuthRequest(e),yield this.handleNewAdminAuthRequestLogin()})}clearExistingStandardAuthRequestAndStartNewRequest(){return Ft(this,void 0,void 0,function*(){this.loginViaAuthRequestCacheService.clearCacheLoginView(),yield this.handleNewStandardAuthRequestLogin()})}handlePostLoginNavigation(e){return Ft(this,void 0,void 0,function*(){e.requiresTwoFactor?yield this.router.navigate(["2fa"]):yield this.handleSuccessfulLoginNavigation(e.userId)})}handleSuccessfulLoginNavigation(e){return Ft(this,void 0,void 0,function*(){yield this.loginSuccessHandlerService.run(e,null),yield this.router.navigate(["vault"])})}}jt.ɵfac=function(e){return new(e||jt)(c.rXU(Ke.D),c.rXU(St.k),c.rXU(H.Y),c.rXU(Qt.d),c.rXU(k.XF),c.rXU(kt.u),c.rXU(Tt.R),c.rXU(qe.M),c.rXU(D.v),c.rXU(J.W),c.rXU(M.K),c.rXU(k.DS),c.rXU(k.sg),c.rXU(wt.JJ),c.rXU(_.y),c.rXU(K.Ix),c.rXU(q.f),c.rXU(te.B),c.rXU(k.aJ),c.rXU(Bt))},jt.ɵcmp=c.VBU({type:jt,selectors:[["ng-component"]],features:[c.Jv_([{provide:Bt}])],decls:2,vars:2,consts:[[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],[1,"tw-text-center"],[1,"tw-font-medium"],[1,"tw-text-code"],["type","button","bitButton","","block","","buttonType","secondary","class","tw-mt-4",3,"click",4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer",1,"tw-cursor-pointer",3,"href"],["type","button","bitButton","","block","","buttonType","secondary",1,"tw-mt-4",3,"click"],[1,"tw-mt-4"],["bitLink","","linkType","primary",3,"routerLink"]],template:function(e,t){1&e&&c.DNE(0,Pt,4,3,"ng-container",0)(1,Ut,4,2,"ng-container",0),2&e&&(c.Y8G("ngIf",t.loading),c.R7$(),c.Y8G("ngIf",!t.loading))},dependencies:[o.t,d.Q,f.MD,f.bT,n.p,z.V,pe.g,C.iI,C.Wk,l.o,A.R,p.$],encapsulation:2});var Nt=i(65113);class zt{constructor(e){this.email=e}}var Yt=i(57083),Lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Kt(e,t){if(1&e){const e=c.RV6();c.j41(0,"bit-form-field")(1,"bit-label"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.nrm(4,"input",4),c.k0s(),c.j41(5,"button",5),c.EFF(6),c.nI1(7,"i18n"),c.k0s(),c.j41(8,"button",6),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.cancel())}),c.EFF(9),c.nI1(10,"i18n"),c.k0s()}2&e&&(c.R7$(2),c.JRh(c.bMT(3,5,"accountEmail")),c.R7$(3),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(7,7,"requestHint")," "),c.R7$(2),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(10,9,"cancel")," "))}function Xt(e,t){1&e&&c.eu8(0)}function qt(e,t){if(1&e&&(c.j41(0,"main",7),c.DNE(1,Xt,1,0,"ng-container",8),c.k0s()),2&e){c.XpG();const e=c.sdS(2);c.R7$(),c.Y8G("ngTemplateOutlet",e)}}function Ht(e,t){1&e&&c.eu8(0)}function Wt(e,t){if(1&e&&(c.qex(0),c.DNE(1,Ht,1,0,"ng-container",8),c.bVm()),2&e){c.XpG();const e=c.sdS(2);c.R7$(),c.Y8G("ngTemplateOutlet",e)}}class $t{get email(){return this.formGroup.controls.email.value}constructor(e,t,i,n,r,s,o){this.apiService=e,this.formBuilder=t,this.i18nService=i,this.loginEmailService=n,this.platformUtilsService=r,this.toastService=s,this.router=o,this.formGroup=this.formBuilder.group({email:["",[y.k0.required,y.k0.email]]}),this.submit=()=>Lt(this,void 0,void 0,function*(){this.validateEmailOrShowToast(this.email)&&(yield this.apiService.postPasswordHint(new zt(this.email)),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("masterPassSent")}),yield this.router.navigate(["login"]))}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return Lt(this,void 0,void 0,function*(){var e;const t=null!==(e=yield(0,I._)(this.loginEmailService.loginEmail$))&&void 0!==e?e:"";this.formGroup.controls.email.setValue(t)})}cancel(){return Lt(this,void 0,void 0,function*(){yield this.loginEmailService.setLoginEmail(this.email),yield this.router.navigate(["login"])})}validateEmailOrShowToast(e){return null==e||""===e?(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("emailRequired")}),!1):-1!==e.indexOf("@")||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidEmail")}),!1)}}$t.ɵfac=function(e){return new(e||$t)(c.rXU(Xe.G),c.rXU(y.ok),c.rXU(J.W),c.rXU(k.DS),c.rXU(_.y),c.rXU(q.f),c.rXU(K.Ix))},$t.ɵcmp=c.VBU({type:$t,selectors:[["ng-component"]],decls:5,vars:4,consts:[["formContentTemplate",""],[3,"bitSubmit","formGroup"],["tabindex","-1",4,"ngIf"],[4,"ngIf"],["bitInput","","appAutofocus","","inputmode","email","appInputVerbatim","false","type","email","formControlName","email"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",1,"tw-mb-2",3,"block"],["type","button","bitButton","","buttonType","secondary",3,"click","block"],["tabindex","-1"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(c.j41(0,"form",1),c.DNE(1,Kt,11,11,"ng-template",null,0,c.C5r)(3,qt,2,1,"main",2)(4,Wt,2,1,"ng-container",3),c.k0s()),2&e&&(c.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),c.R7$(3),c.Y8G("ngIf","browser"===t.clientType),c.R7$(),c.Y8G("ngIf","browser"!==t.clientType))},dependencies:[U.C,re.$,se.L,o.t,d.Q,f.MD,f.bT,f.T3,j.L,le.j,ce.J,de.h,n.p,ge.B,Yt.q,y.X1,y.qT,y.me,y.BC,y.cb,y.j4,y.JD,C.iI,p.$],encapsulation:2});const Jt=E.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 0.87 76.36 76.8">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 33.298a5 5 0 0 1 1.745-3.794L37.287 1.87a4.167 4.167 0 0 1 5.426 0l32.21 27.634a5 5 0 0 1 1.744 3.794v41.035a3.333 3.333 0 0 1-3.334 3.334H6.667a3.333 3.333 0 0 1-3.334-3.334V33.299Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 74.334V33.297c0-.972-.425-1.896-1.163-2.53L41.627 3.136a2.5 2.5 0 0 0-3.255 0L6.162 30.769A3.333 3.333 0 0 0 5 33.299v41.035C5 75.254 5.746 76 6.667 76h66.666c.92 0 1.667-.746 1.667-1.666ZM5.078 29.504a5 5 0 0 0-1.745 3.794v41.035a3.333 3.333 0 0 0 3.334 3.334h66.666a3.333 3.333 0 0 0 3.334-3.334V33.299a5 5 0 0 0-1.745-3.794L42.713 1.87a4.167 4.167 0 0 0-5.426 0L5.077 29.504Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.98 55.17a3.333 3.333 0 0 1-3.96 0L5.496 31.161a.833.833 0 1 0-.99 1.341L37.031 56.51a5 5 0 0 0 5.938 0l32.526-24.007a.833.833 0 0 0-.99-1.34L41.98 55.168Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M12.5 10.166h55v28.333L40.999 58.175a1.667 1.667 0 0 1-1.994-.005L12.5 38.29V10.166Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65.833 11.833H14.167v25.625l25.838 19.379L65.833 37.66V11.833ZM67.5 38.499 40.999 58.175a1.667 1.667 0 0 1-1.994-.005L12.5 38.29V10.166h55v28.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="m40 50.166 18.333 10.417L40 70.999 21.667 60.583 40 50.166Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.02 51.92a3.333 3.333 0 0 0-4.04 0L5.505 76.663a.833.833 0 0 1-1.01-1.326L36.97 50.594a5 5 0 0 1 6.06 0l-.494.648.494-.648 32.475 24.743a.833.833 0 0 1-1.01 1.326L42.02 51.92Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M70 41c0 9.204-7.462 16.666-16.667 16.666-9.204 0-16.666-7.462-16.666-16.666 0-9.205 7.462-16.667 16.666-16.667C62.538 24.333 70 31.795 70 41Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M53.333 56c8.285 0 15-6.716 15-15 0-8.285-6.715-15-15-15-8.284 0-15 6.715-15 15 0 8.284 6.716 15 15 15Zm0 1.666C62.538 57.666 70 50.204 70 41c0-9.205-7.462-16.667-16.667-16.667-9.204 0-16.666 7.462-16.666 16.667 0 9.204 7.462 16.666 16.666 16.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M65.833 41c0 6.904-5.596 12.5-12.5 12.5-6.903 0-12.5-5.596-12.5-12.5s5.597-12.5 12.5-12.5c6.904 0 12.5 5.596 12.5 12.5Z"/>
    <path class="tw-fill-illustration-outline" d="M79.17 65.24 65.417 52.25l-1.667 1.667L76.74 67.67a1.667 1.667 0 0 0 2.39.034l.074-.075a1.667 1.667 0 0 0-.034-2.39Z"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M18.333 17.666a.833.833 0 0 0 0 1.667h8.334a.833.833 0 0 0 0-1.667h-8.334ZM55 20.999a.833.833 0 0 1 0 1.667h-8.333a.833.833 0 1 1 0-1.667H55Zm.453 3.467a.83.83 0 0 0-.453-.133h-8.333a.833.833 0 0 0-.397 1.566 16.603 16.603 0 0 1 7.063-1.566c.718 0 1.425.045 2.12.133Zm-17.737 10.7a16.551 16.551 0 0 0-.524 1.667H35a.833.833 0 0 1 0-1.667h2.716Zm1.696-3.333a16.643 16.643 0 0 0-.966 1.666H32.5a.833.833 0 1 1 0-1.666h6.912ZM30 17.666a.833.833 0 0 0 0 1.667h8.333a.833.833 0 1 0 0-1.667H30Zm14.167 4.167a.833.833 0 0 0-.834-.834H35a.833.833 0 0 0 0 1.667h8.333c.46 0 .834-.373.834-.833Zm-.834 4.166a.833.833 0 1 0 0-1.666h-10a.833.833 0 0 0 0 1.666h10Zm-1.666-8.333a.833.833 0 1 0 0 1.667h1.666a.833.833 0 1 0 0-1.667h-1.666ZM32.5 21.833a.833.833 0 0 0-.833-.834H30a.833.833 0 0 0 0 1.667h1.667c.46 0 .833-.373.833-.833ZM30 25.999a.833.833 0 1 0 0-1.666h-3.333a.833.833 0 1 0 0 1.666H30Zm0 6.667c0 .46-.373.833-.833.833h-5a.833.833 0 1 1 0-1.666h5c.46 0 .833.373.833.833Zm1.667 4.167a.833.833 0 0 0 0-1.667H18.333a.833.833 0 0 0 0 1.667h13.334Zm15-19.167a.833.833 0 1 0 0 1.667H55a.833.833 0 0 0 0-1.667h-8.333ZM27.5 21.833a.833.833 0 0 0-.833-.834h-8.334a.833.833 0 0 0 0 1.667h8.334c.46 0 .833-.373.833-.833Zm-4.167 4.166a.833.833 0 1 0 0-1.666h-5a.833.833 0 0 0 0 1.666h5Zm-1.666 6.667c0 .46-.373.833-.834.833h-2.5a.833.833 0 1 1 0-1.666h2.5c.46 0 .834.373.834.833Z" clip-rule="evenodd"/>
  </svg>
`;var Zt=i(24558);class _t{constructor(e,t,i){this.email=e,this.name=t,this.receiveMarketingEmails=i}}var ei=i(45383),ti=i(36359),ii=i(12610),ni=i(39444),ri=i(8433),si=i(69194),oi=i(68016),ai=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function li(e,t){1&e&&(c.qex(0),c.j41(1,"p",11),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"bit-form-field")(5,"bit-label"),c.EFF(6),c.nI1(7,"i18n"),c.k0s(),c.nrm(8,"input",12),c.k0s(),c.j41(9,"bit-form-field")(10,"bit-label"),c.EFF(11),c.nI1(12,"i18n"),c.k0s(),c.nrm(13,"input",13),c.k0s(),c.j41(14,"bit-form-field")(15,"bit-label"),c.EFF(16),c.nI1(17,"i18n"),c.k0s(),c.nrm(18,"input",14),c.k0s(),c.j41(19,"bit-form-field")(20,"bit-label"),c.EFF(21),c.nI1(22,"i18n"),c.k0s(),c.nrm(23,"input",15),c.k0s(),c.j41(24,"bit-form-field")(25,"bit-label"),c.EFF(26),c.nI1(27,"i18n"),c.k0s(),c.nrm(28,"input",16),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,6,"selfHostedCustomEnvHeader")," "),c.R7$(4),c.JRh(c.bMT(7,8,"webVaultUrl")),c.R7$(5),c.JRh(c.bMT(12,10,"apiUrl")),c.R7$(5),c.JRh(c.bMT(17,12,"identityUrl")),c.R7$(5),c.JRh(c.bMT(22,14,"notificationsUrl")),c.R7$(5),c.JRh(c.bMT(27,16,"iconsUrl")))}function ci(e,t){1&e&&(c.j41(0,"span",17),c.nrm(1,"bit-icon",18),c.EFF(2),c.nI1(3,"i18n"),c.k0s()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"selfHostedEnvFormInvalid")," "))}function di(){const e=(0,L.WQX)(J.W),t=(0,L.WQX)(_.y);return i=>{const n=i.value;return!n||n.startsWith("https://")||t.isDev()?null:{onlyHttpsAllowed:{message:e.t("selfHostedEnvMustUseHttps")}}}}class ui{static open(e){return ai(this,void 0,void 0,function*(){const t=e.open(ui,{disableClose:!1}),i=yield(0,I._)(t.closed);return null!=i&&i})}get baseUrl(){return this.formGroup.get("baseUrl")}get webVaultUrl(){return this.formGroup.get("webVaultUrl")}get apiUrl(){return this.formGroup.get("apiUrl")}get identityUrl(){return this.formGroup.get("identityUrl")}get iconsUrl(){return this.formGroup.get("iconsUrl")}get notificationsUrl(){return this.formGroup.get("notificationsUrl")}constructor(e,t,i){this.dialogRef=e,this.formBuilder=t,this.environmentService=i,this.formGroup=this.formBuilder.group({baseUrl:["",[di()]],webVaultUrl:["",[di()]],apiUrl:["",[di()]],identityUrl:["",[di()]],iconsUrl:["",[di()]],notificationsUrl:["",[di()]]},{validators:e=>{var t,i,n,r,s,o;const a=e,l=null===(t=a.get("baseUrl"))||void 0===t?void 0:t.value,c=null===(i=a.get("webVaultUrl"))||void 0===i?void 0:i.value,d=null===(n=a.get("apiUrl"))||void 0===n?void 0:n.value,u=null===(r=a.get("identityUrl"))||void 0===r?void 0:r.value,h=null===(s=a.get("iconsUrl"))||void 0===s?void 0:s.value,A=null===(o=a.get("notificationsUrl"))||void 0===o?void 0:o.value;return l||c||d||u||h||A?null:{atLeastOneUrlIsRequired:!0}}}),this.showCustomEnv=!1,this.showErrorSummary=!1,this.destroy$=new w.B,this.submit=()=>ai(this,void 0,void 0,function*(){var e;this.formGroup.markAllAsTouched(),this.showErrorSummary=!1,this.formGroup.invalid?this.showErrorSummary=Boolean(null===(e=this.formGroup.errors)||void 0===e?void 0:e.atLeastOneUrlIsRequired):(yield this.environmentService.setEnvironment(D.T.SelfHosted,{base:this.baseUrl.value,api:this.apiUrl.value,identity:this.identityUrl.value,webVault:this.webVaultUrl.value,icons:this.iconsUrl.value,notifications:this.notificationsUrl.value}),this.dialogRef.close(!0))})}ngOnInit(){this.environmentService.environment$.pipe((0,b.s)(1),(0,si.p)(e=>e.getRegion()===D.T.SelfHosted),(0,B.Q)(this.destroy$)).subscribe({next:e=>{const t=e.getUrls();this.formGroup.patchValue({baseUrl:t.base||"",webVaultUrl:t.webVault||"",apiUrl:t.api||"",identityUrl:t.identity||"",iconsUrl:t.icons||"",notificationsUrl:t.notifications||""})}})}cancel(){return ai(this,void 0,void 0,function*(){this.dialogRef.close(!1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}ui.ɵfac=function(e){return new(e||ui)(c.rXU(r.ce),c.rXU(y.ok),c.rXU(D.v))},ui.ɵcmp=c.VBU({type:ui,selectors:[["self-hosted-env-config-dialog"]],decls:26,vars:20,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["id","self_hosted_env_settings_form_input_base_url","bitInput","","type","text","formControlName","baseUrl","appAutofocus","","appInputVerbatim",""],["bitLink","","linkType","primary","type","button",3,"click"],[1,"bwi-fw","bwi-sm",3,"name"],[4,"ngIf"],["class","tw-block tw-text-danger tw-mt-2","aria-live","assertive","role","alert",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"],["bitTypography","body1",1,"tw-text-muted","tw-mt-3"],["id","self_hosted_env_settings_form_input_web_vault_url","bitInput","","type","text","formControlName","webVaultUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_api_url","bitInput","","type","text","formControlName","apiUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_identity_url","bitInput","","type","text","formControlName","identityUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_notifications_url","bitInput","","type","text","formControlName","notificationsUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_icons_url","bitInput","","type","text","formControlName","iconsUrl","appInputVerbatim",""],["aria-live","assertive","role","alert",1,"tw-block","tw-text-danger","tw-mt-2"],["name","bwi-error"]],template:function(e,t){1&e&&(c.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),c.EFF(3," Self-hosted environment"),c.k0s(),c.qex(4,2),c.j41(5,"bit-form-field")(6,"bit-label"),c.EFF(7),c.nI1(8,"i18n"),c.k0s(),c.nrm(9,"input",3),c.j41(10,"bit-hint"),c.EFF(11),c.nI1(12,"i18n"),c.k0s()(),c.j41(13,"button",4),c.bIt("click",function(){return t.showCustomEnv=!t.showCustomEnv}),c.nrm(14,"bit-icon",5),c.EFF(15),c.nI1(16,"i18n"),c.k0s(),c.DNE(17,li,29,18,"ng-container",6)(18,ci,4,3,"span",7),c.bVm(),c.qex(19,8),c.j41(20,"button",9),c.EFF(21),c.nI1(22,"i18n"),c.k0s(),c.j41(23,"button",10),c.bIt("click",function(){return t.cancel()}),c.EFF(24),c.nI1(25,"i18n"),c.k0s(),c.bVm(),c.k0s()()),2&e&&(c.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),c.R7$(7),c.JRh(c.bMT(8,10,"baseUrl")),c.R7$(4),c.JRh(c.bMT(12,12,"selfHostedBaseUrlHint")),c.R7$(3),c.Y8G("name",t.showCustomEnv?"bwi-angle-down":"bwi-angle-right"),c.R7$(),c.SpI(" ",c.bMT(16,14,"customEnvironment")," "),c.R7$(2),c.Y8G("ngIf",t.showCustomEnv),c.R7$(),c.Y8G("ngIf",t.showErrorSummary),c.R7$(3),c.SpI(" ",c.bMT(22,16,"save")," "),c.R7$(3),c.SpI(" ",c.bMT(25,18,"cancel")," "))},dependencies:[f.MD,f.bT,n.p,ge.B,Yt.q,a.P,oi.m,h.hJ,o.t,d.Q,l.o,A.R,z.V,pe.g,Ye.E,it.r,y.X1,y.qT,y.me,y.BC,y.cb,y.j4,y.JD,j.L,le.j,tt.I,ce.J,de.h,U.C,re.$,se.L,p.$],encapsulation:2});var hi=i(33886),Ai=i(68923),pi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function gi(e,t){if(1&e&&c.nrm(0,"bit-option",5),2&e){const e=t.$implicit;c.Y8G("value",e)("label",e.domain)}}function vi(e,t){if(1&e&&(c.nrm(0,"bit-option",5),c.nI1(1,"i18n")),2&e){const e=c.XpG(2);c.Y8G("value",e.ServerEnvironmentType.SelfHosted)("label",c.bMT(1,2,"selfHostedServer"))}}function fi(e,t){if(1&e){const e=c.RV6();c.j41(0,"form",1)(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.j41(5,"bit-select",2),c.bIt("closed",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.onSelectClosed())}),c.DNE(6,gi,1,2,"bit-option",3)(7,vi,2,4,"bit-option",4),c.k0s()()()}if(2&e){const e=c.XpG();c.Y8G("formGroup",e.formGroup),c.R7$(3),c.JRh(c.bMT(4,4,"creatingAccountOn")),c.R7$(3),c.Y8G("ngForOf",e.availableRegionConfigs),c.R7$(),c.Y8G("ngIf",e.isDesktopOrBrowserExtension)}}class mi{get selectedRegion(){return this.formGroup.get("selectedRegion")}constructor(e,t,i,n,r,s){this.formBuilder=e,this.environmentService=t,this.dialogService=i,this.i18nService=n,this.toastService=r,this.platformUtilsService=s,this.selectedRegionChange=new c.bkB,this.ServerEnvironmentType=D.T,this.formGroup=this.formBuilder.group({selectedRegion:[null,y.k0.required]}),this.availableRegionConfigs=this.environmentService.availableRegions(),this.hideEnvSelector=!1,this.isDesktopOrBrowserExtension=!1,this.destroy$=new w.B;const o=s.getClientType();this.isDesktopOrBrowserExtension=o===P.sK.Desktop||o===P.sK.Browser,this.hideEnvSelector=o===P.sK.Web&&this.platformUtilsService.isSelfHost()}ngOnInit(){return pi(this,void 0,void 0,function*(){this.hideEnvSelector||(yield this.initSelectedRegionAndListenForEnvChanges(),this.listenForSelectedRegionChanges())})}initSelectedRegionAndListenForEnvChanges(){return pi(this,void 0,void 0,function*(){this.environmentService.environment$.pipe((0,Pe.T)(e=>{const t=e.getRegion(),i=this.availableRegionConfigs.find(e=>e.key===t);return void 0===i?D.T.SelfHosted:i}),(0,ti.M)(e=>{e!==this.selectedRegion.value&&this.selectedRegion.setValue(e,{emitEvent:!1}),this.selectedRegionFromEnv=e,this.selectedRegionChange.emit(e)}),(0,B.Q)(this.destroy$)).subscribe()})}listenForSelectedRegionChanges(){this.selectedRegion.valueChanges.pipe((0,ii.Z)(null),(0,ni.J)(),(0,Re.n)(([e,t])=>null===t?(this.selectedRegionChange.emit(t),(0,Ge.of)(null)):t!==D.T.SelfHosted?(this.selectedRegionChange.emit(t),(0,xe.H)(this.environmentService.setEnvironment(t.key))):(0,Ge.of)(null)),(0,B.Q)(this.destroy$)).subscribe()}handleSelfHostedEnvConfigDialogResult(e,t){if(!0===e)return this.selectedRegionChange.emit(D.T.SelfHosted),void this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("environmentSaved")});!1!==e&&void 0!==e||null===t||t===D.T.SelfHosted?(this.selectedRegionChange.emit(this.selectedRegionFromEnv),this.selectedRegion.setValue(this.selectedRegionFromEnv,{emitEvent:!1})):(this.selectedRegionChange.emit(t),this.selectedRegion.setValue(t,{emitEvent:!1}))}onSelectClosed(){return pi(this,void 0,void 0,function*(){if(this.selectedRegion.value===D.T.SelfHosted){const e=yield ui.open(this.dialogService);return this.handleSelfHostedEnvConfigDialogResult(e,this.selectedRegion.value)}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}mi.ɵfac=function(e){return new(e||mi)(c.rXU(y.ok),c.rXU(D.v),c.rXU(r.o3),c.rXU(J.W),c.rXU(q.f),c.rXU(_.y))},mi.ɵcmp=c.VBU({type:mi,selectors:[["auth-registration-env-selector"]],outputs:{selectedRegionChange:"selectedRegionChange"},decls:1,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formControlName","selectedRegion",3,"closed"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label",4,"ngIf"],[3,"value","label"]],template:function(e,t){1&e&&c.DNE(0,fi,8,6,"form",0),2&e&&c.Y8G("ngIf",!t.hideEnvSelector)},dependencies:[f.MD,f.Sq,f.bT,n.p,y.X1,y.qT,y.BC,y.cb,y.j4,y.JD,j.L,le.j,de.h,ri.p,hi.w,Ai.P,p.$],encapsulation:2});var yi,Ci=i(46357),wi=i(68466),Ii=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function bi(e,t){1&e&&(c.j41(0,"bit-form-control"),c.nrm(1,"input",8),c.j41(2,"bit-label",9),c.EFF(3),c.nI1(4,"i18n"),c.j41(5,"a",10),c.EFF(6),c.nI1(7,"i18n"),c.k0s(),c.EFF(8),c.nI1(9,"i18n"),c.k0s()()),2&e&&(c.R7$(3),c.SpI(" ",c.bMT(4,3,"receiveMarketingEmailsV2")," "),c.R7$(3),c.SpI(" ",c.bMT(7,5,"unsubscribe")," "),c.R7$(2),c.SpI(" ",c.bMT(9,7,"atAnyTime")," "))}function Bi(e,t){1&e&&(c.j41(0,"p",11),c.EFF(1),c.nI1(2,"i18n"),c.j41(3,"a",12),c.EFF(4),c.nI1(5,"i18n"),c.k0s(),c.EFF(6),c.nI1(7,"i18n"),c.j41(8,"a",13),c.EFF(9),c.nI1(10,"i18n"),c.k0s()()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,4,"byContinuingYouAgreeToThe")," "),c.R7$(3),c.JRh(c.bMT(5,6,"termsOfService")),c.R7$(2),c.SpI(" ",c.bMT(7,8,"and")," "),c.R7$(3),c.JRh(c.bMT(10,10,"privacyPolicy")))}function Ei(e,t){if(1&e&&c.nrm(0,"bit-error-summary",14),2&e){const e=c.XpG(2);c.Y8G("formGroup",e.formGroup)}}function Si(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"form",1)(2,"auth-registration-env-selector",2),c.bIt("selectedRegionChange",function(t){L.eBV(e);const i=c.XpG();return L.Njj(i.handleSelectedRegionChange(t))}),c.k0s(),c.j41(3,"bit-form-field")(4,"bit-label"),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.nrm(7,"input",3),c.k0s(),c.j41(8,"bit-form-field")(9,"bit-label"),c.EFF(10),c.nI1(11,"i18n"),c.k0s(),c.nrm(12,"input",4),c.k0s(),c.DNE(13,bi,10,9,"bit-form-control",0),c.j41(14,"button",5),c.EFF(15),c.nI1(16,"i18n"),c.k0s(),c.DNE(17,Bi,11,12,"p",6)(18,Ei,1,1,"bit-error-summary",7),c.k0s(),c.bVm()}if(2&e){const e=c.XpG();c.R7$(),c.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),c.R7$(4),c.JRh(c.bMT(6,10,"emailAddress")),c.R7$(2),c.BMQ("readonly",!!e.emailReadonly||null),c.R7$(3),c.JRh(c.bMT(11,12,"name")),c.R7$(3),c.Y8G("ngIf",!e.isSelfHost),c.R7$(),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(16,14,"continue")," "),c.R7$(2),c.Y8G("ngIf",!e.isSelfHost),c.R7$(),c.Y8G("ngIf",e.showErrorSummary)}}function Qi(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"div",15)(2,"p",16),c.EFF(3),c.nI1(4,"i18n"),c.j41(5,"span",17),c.EFF(6),c.k0s(),c.EFF(7),c.nI1(8,"i18n"),c.k0s(),c.j41(9,"p",18),c.EFF(10),c.nI1(11,"i18n"),c.j41(12,"a",19),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.goBack())}),c.EFF(13),c.nI1(14,"i18n"),c.k0s(),c.EFF(15),c.nI1(16,"i18n"),c.k0s()(),c.bVm()}if(2&e){const e=c.XpG();c.R7$(3),c.SpI(" ",c.bMT(4,6,"followTheLinkInTheEmailSentTo")," "),c.R7$(3),c.JRh(e.email.value),c.R7$(),c.SpI(" ",c.bMT(8,8,"andContinueCreatingYourAccount")," "),c.R7$(3),c.SpI(" ",c.bMT(11,10,"noEmail")," "),c.R7$(3),c.SpI(" ",c.bMT(14,12,"goBack")," "),c.R7$(2),c.SpI(" ",c.bMT(16,14,"toEditYourEmailAddress")," ")}}!function(e){e.USER_DATA_ENTRY="UserDataEntry",e.CHECK_EMAIL="CheckEmail"}(yi||(yi={}));const ki={[D.T.US]:!0,[D.T.EU]:!1,[D.T.SelfHosted]:!1};class Ti{get email(){return this.formGroup.controls.email}get name(){return this.formGroup.controls.name}get receiveMarketingEmails(){return this.formGroup.controls.receiveMarketingEmails}constructor(e,t,i,n,r,s,o){this.formBuilder=e,this.route=t,this.platformUtilsService=i,this.accountApiService=n,this.router=r,this.loginEmailService=s,this.anonLayoutWrapperDataService=o,this.registrationStartStateChange=new c.bkB,this.state=yi.USER_DATA_ENTRY,this.RegistrationStartState=yi,this.isSelfHost=!1,this.formGroup=this.formBuilder.group({email:["",[y.k0.required,y.k0.email]],name:[""],receiveMarketingEmails:[!1]}),this.emailReadonly=!1,this.showErrorSummary=!1,this.destroy$=new w.B,this.submit=()=>Ii(this,void 0,void 0,function*(){if(!this.validateForm())return;const e=""===this.name.value?null:this.name.value,t=new _t(this.email.value,e,this.receiveMarketingEmails.value),i=yield this.accountApiService.registerSendVerificationEmail(t);"string"!=typeof i?(this.state=yi.CHECK_EMAIL,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"checkYourEmail"},pageIcon:Jt}),this.registrationStartStateChange.emit(this.state)):yield this.router.navigate(["/finish-signup"],{queryParams:{token:i,email:this.email.value}})}),this.isSelfHost=i.isSelfHost()}ngOnInit(){return Ii(this,void 0,void 0,function*(){this.registrationStartStateChange.emit(this.state),this.listenForQueryParamChanges(),this.loginEmailService.loginEmail$.pipe((0,B.Q)(this.destroy$)).subscribe(e=>{e&&this.formGroup.patchValue({email:e})})})}listenForQueryParamChanges(){this.route.queryParams.pipe((0,B.Q)(this.destroy$)).subscribe(e=>{var t;null!=e.email&&e.email.indexOf("@")>-1&&(null===(t=this.email)||void 0===t||t.setValue(e.email),this.emailReadonly="true"===e.emailReadonly)})}setReceiveMarketingEmailsByRegion(e){let t;if(e===D.T.SelfHosted)t=ki[e];else{const i=e.key;t=ki[i]}this.receiveMarketingEmails.setValue(t)}handleSelectedRegionChange(e){this.isSelfHost=e===D.T.SelfHosted,null!==e&&this.setReceiveMarketingEmailsByRegion(e)}validateForm(){return this.formGroup.markAllAsTouched(),this.formGroup.invalid&&(this.showErrorSummary=!0),this.formGroup.valid}goBack(){this.state=yi.USER_DATA_ENTRY,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:Zt.R,pageTitle:{key:"createAccount"}}),this.registrationStartStateChange.emit(this.state)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Ti.ɵfac=function(e){return new(e||Ti)(c.rXU(y.ok),c.rXU(K.nX),c.rXU(_.y),c.rXU(Ci.T),c.rXU(K.Ix),c.rXU(k.pi),c.rXU(X.f))},Ti.ɵcmp=c.VBU({type:Ti,selectors:[["auth-registration-start"]],outputs:{registrationStartStateChange:"registrationStartStateChange"},decls:2,vars:2,consts:[[4,"ngIf"],[3,"formGroup","bitSubmit"],[3,"selectedRegionChange"],["id","register-start_form_input_email","bitInput","","type","email","formControlName","email"],["id","register-start_form_input_name","bitInput","","type","text","formControlName","name"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",1,"tw-mb-3",3,"block"],["bitTypography","helper","class","tw-text-main tw-text-xs tw-mb-0",4,"ngIf"],[3,"formGroup",4,"ngIf"],["id","register-start-form-input-receive-marketing-emails","type","checkbox","bitCheckbox","","formControlName","receiveMarketingEmails"],["for","register-start-form-input-receive-marketing-emails"],["bitLink","","linkType","primary","href","https://bitwarden.com/email-preferences","target","_blank","rel","noreferrer"],["bitTypography","helper",1,"tw-text-main","tw-text-xs","tw-mb-0"],["bitLink","","linkType","primary","href","https://bitwarden.com/terms/","target","_blank","rel","noreferrer"],["bitLink","","linkType","primary","href","https://bitwarden.com/privacy/","target","_blank","rel","noreferrer"],[3,"formGroup"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center"],["bitTypography","body1","id","follow_the_link_body",1,"tw-text-center","tw-mb-3","tw-text-main"],[1,"tw-font-medium"],["bitTypography","helper",1,"tw-text-center","tw-text-main"],["bitLink","","linkType","primary","tabindex","0",1,"tw-cursor-pointer",3,"click"]],template:function(e,t){1&e&&c.DNE(0,Si,19,16,"ng-container",0)(1,Qi,17,16,"ng-container",0),2&e&&(c.Y8G("ngIf",t.state===t.RegistrationStartState.USER_DATA_ENTRY),c.R7$(),c.Y8G("ngIf",t.state===t.RegistrationStartState.CHECK_EMAIL))},dependencies:[f.MD,f.bT,y.X1,y.qT,y.me,y.Zm,y.BC,y.cb,y.j4,y.JD,n.p,j.L,ae.f,le.j,ce.J,wi.L,de.h,U.C,re.$,se.L,V.q,oe.P,o.t,d.Q,z.V,pe.g,ei.Z,mi,p.$],encapsulation:2});class Fi{constructor(e,t){this.email=e,this.emailVerificationToken=t}}class Pi{}var Ri=i(71613),Di=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Mi=()=>({key:"createAccount"});function xi(e,t){1&e&&(c.j41(0,"div",2),c.nrm(1,"bit-icon",3),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.Y8G("ariaLabel",c.bMT(2,1,"loading")))}function Oi(e,t){if(1&e){const e=c.RV6();c.j41(0,"auth-input-password",4),c.bIt("onPasswordFormSubmit",function(t){L.eBV(e);const i=c.XpG();return L.Njj(i.handlePasswordFormSubmit(t))}),c.k0s()}if(2&e){const e=c.XpG();c.Y8G("email",e.email)("flow",e.inputPasswordFlow)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("loading",e.submitting)("primaryButtonText",c.lJ4(5,Mi))}}const Gi=Object.freeze({Premium:"premium"});class Ui{constructor(e,t,i,n,r,s,o,a,l,c,d,u){this.activatedRoute=e,this.router=t,this.toastService=i,this.i18nService=n,this.registrationFinishService=r,this.validationService=s,this.accountApiService=o,this.loginStrategyService=a,this.logService=l,this.anonLayoutWrapperDataService=c,this.loginSuccessHandlerService=d,this.premiumInterestStateService=u,this.destroy$=new w.B,this.inputPasswordFlow=v.m.SetInitialPasswordAccountRegistration,this.loading=!0,this.submitting=!1,this.premiumInterest=!1,this.masterPasswordPolicyOptions=null}ngOnInit(){return Di(this,void 0,void 0,function*(){const e=yield(0,I._)(this.activatedRoute.queryParams);if(this.handleQueryParams(e),e.fromEmail&&"true"===e.fromEmail&&this.email&&this.emailVerificationToken)yield this.initEmailVerificationFlow();else{(yield this.initOrgInviteFlowIfPresent())||this.initRegistrationWithEmailVerificationDisabledFlow()}this.loading=!1})}handleQueryParams(e){null!=e.email&&e.email.indexOf("@")>-1&&(this.email=e.email),null!=e.token&&(this.emailVerificationToken=e.token),null!=e.orgSponsoredFreeFamilyPlanToken&&(this.orgSponsoredFreeFamilyPlanToken=e.orgSponsoredFreeFamilyPlanToken),null!=e.acceptEmergencyAccessInviteToken&&e.emergencyAccessId&&(this.acceptEmergencyAccessInviteToken=e.acceptEmergencyAccessInviteToken,this.emergencyAccessId=e.emergencyAccessId),null!=e.providerInviteToken&&null!=e.providerUserId&&(this.providerInviteToken=e.providerInviteToken,this.providerUserId=e.providerUserId),null!=e.fromMarketing&&e.fromMarketing===Gi.Premium&&(this.premiumInterest=!0)}initOrgInviteFlowIfPresent(){return Di(this,void 0,void 0,function*(){this.masterPasswordPolicyOptions=yield this.registrationFinishService.getMasterPasswordPolicyOptsFromOrgInvite();const e=yield this.registrationFinishService.getOrgNameFromOrgInvite();return!!e&&(this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"joinOrganizationName",placeholders:[e]},pageSubtitle:{key:"finishJoiningThisOrganizationBySettingAMasterPassword"}}),!0)})}handlePasswordFormSubmit(e){return Di(this,void 0,void 0,function*(){var t;this.submitting=!0;try{yield this.registrationFinishService.finishRegistration(this.email,e,this.emailVerificationToken,this.orgSponsoredFreeFamilyPlanToken,this.acceptEmergencyAccessInviteToken,this.emergencyAccessId,this.providerInviteToken,this.providerUserId)}catch(i){const e="Expired token."===(null==i?void 0:i.message)?this.i18nService.t("inviteAcceptFailed"):i;return this.validationService.showError(e),void(this.submitting=!1)}this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("newAccountCreated2")});try{const i=new k.F2(this.email,e.newPassword),n=yield this.loginStrategyService.logIn(i);if(null==n?void 0:n.requiresTwoFactor)return void(yield this.router.navigate(["/2fa"]));yield this.loginSuccessHandlerService.run(n.userId,null!==(t=n.masterPassword)&&void 0!==t?t:null),this.premiumInterest&&(yield this.premiumInterestStateService.setPremiumInterest(n.userId,!0)),yield this.router.navigate(["/vault"])}catch(i){this.logService.error("Error logging in after registration: ",i.message),yield this.router.navigate(["/login"],{queryParams:{email:this.email}})}this.submitting=!1})}setDefaultPageTitleAndSubtitle(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setAStrongPassword"},pageSubtitle:{key:"finishCreatingYourAccountBySettingAPassword"}})}initEmailVerificationFlow(){return Di(this,void 0,void 0,function*(){this.setDefaultPageTitleAndSubtitle(),yield this.registerVerificationEmailClicked(this.email,this.emailVerificationToken)})}registerVerificationEmailClicked(e,t){return Di(this,void 0,void 0,function*(){const i=new Fi(e,t);try{null==(yield this.accountApiService.registerVerificationEmailClicked(i))&&this.toastService.showToast({title:null,message:this.i18nService.t("emailVerifiedV2"),variant:"success"})}catch(n){yield this.handleRegisterVerificationEmailClickedError(n)}})}handleRegisterVerificationEmailClickedError(e){return Di(this,void 0,void 0,function*(){if(e instanceof R._){const t=e;if(t.statusCode===P.kG.BadRequest)t.message.includes("Expired link")?yield this.router.navigate(["/signup-link-expired"]):this.validationService.showError(t);else this.validationService.showError(t)}else this.validationService.showError(e)})}initRegistrationWithEmailVerificationDisabledFlow(){this.setDefaultPageTitleAndSubtitle()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Ui.ɵfac=function(e){return new(e||Ui)(c.rXU(K.nX),c.rXU(K.Ix),c.rXU(q.f),c.rXU(J.W),c.rXU(Pi),c.rXU(te.B),c.rXU(Ci.T),c.rXU(k.sg),c.rXU(M.K),c.rXU(X.f),c.rXU(k.aJ),c.rXU(Ri.a))},Ui.ɵcmp=c.VBU({type:Ui,selectors:[["auth-registration-finish"]],decls:2,vars:2,consts:[["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],[3,"email","flow","masterPasswordPolicyOptions","loading","primaryButtonText","onPasswordFormSubmit",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],[3,"onPasswordFormSubmit","email","flow","masterPasswordPolicyOptions","loading","primaryButtonText"]],template:function(e,t){1&e&&c.DNE(0,xi,3,3,"div",0)(1,Oi,1,6,"auth-input-password",1),2&e&&(c.Y8G("ngIf",t.loading),c.R7$(),c.Y8G("ngIf",!t.loading))},dependencies:[f.MD,f.bT,n.p,C.iI,v.t,l.o,A.R,p.$],encapsulation:2});var Vi=i(32415),ji=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ni{constructor(e){this.activatedRoute=e,this.destroy$=new w.B,this.Icons={TwoFactorTimeoutIcon:Vi.c}}ngOnInit(){return ji(this,void 0,void 0,function*(){const e=yield(0,I._)(this.activatedRoute.data);this.loginRoute=e.loginRoute})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Ni.ɵfac=function(e){return new(e||Ni)(c.rXU(K.nX))},Ni.ɵcmp=c.VBU({type:Ni,selectors:[["auth-registration-link-expired"]],decls:13,vars:15,consts:[[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center"],["bitTypography","body1","id","restart_registration_body",1,"tw-text-center","tw-mb-3","tw-text-main"],["type","button","buttonType","primary","bitButton","","routerLink","/signup",1,"tw-mb-3",3,"block"],["type","button","buttonType","secondary","bitButton","",3,"block","routerLink"]],template:function(e,t){1&e&&(c.j41(0,"div",0)(1,"p",1),c.EFF(2),c.nI1(3,"i18n"),c.nrm(4,"br"),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.j41(7,"a",2),c.EFF(8),c.nI1(9,"i18n"),c.k0s(),c.j41(10,"a",3),c.EFF(11),c.nI1(12,"i18n"),c.k0s()()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,7,"pleaseRestartRegistrationOrTryLoggingIn")),c.R7$(3),c.SpI(" ",c.bMT(6,9,"youMayAlreadyHaveAnAccount")," "),c.R7$(2),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(9,11,"restartRegistration")," "),c.R7$(2),c.Y8G("block",!0)("routerLink",t.loginRoute),c.R7$(),c.SpI(" ",c.bMT(12,13,"logIn")," "))},dependencies:[f.MD,n.p,C.iI,C.Wk,ei.Z,o.t,d.Q,p.$],encapsulation:2});var zi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Yi{constructor(e){this.activatedRoute=e}ngOnInit(){return zi(this,void 0,void 0,function*(){const e=yield(0,I._)(this.activatedRoute.data);this.loginRoute=e.loginRoute})}}Yi.ɵfac=function(e){return new(e||Yi)(c.rXU(K.nX))},Yi.ɵcmp=c.VBU({type:Yi,selectors:[["auth-registration-start-secondary"]],decls:6,vars:7,consts:[["bitLink","",3,"routerLink"]],template:function(e,t){1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.j41(3,"a",0),c.EFF(4),c.nI1(5,"i18n"),c.k0s()()),2&e&&(c.R7$(),c.SpI("",c.bMT(2,3,"alreadyHaveAccount")," "),c.R7$(2),c.Y8G("routerLink",t.loginRoute),c.R7$(),c.JRh(c.bMT(5,5,"logIn")))},dependencies:[f.MD,n.p,C.iI,C.Wk,z.V,pe.g,p.$],encapsulation:2});class Li{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){this.email=e,this.masterPasswordHint=t,this.userAsymmetricKeys=i,this.masterPasswordAuthentication=n,this.masterPasswordUnlock=r,this.emailVerificationToken=s,this.orgSponsoredFreeFamilyPlanToken=o,this.acceptEmergencyAccessInviteToken=a,this.acceptEmergencyAccessId=l,this.providerInviteToken=c,this.providerUserId=d,this.organizationUserId=u,this.orgInviteToken=h}}class Ki{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v){this.email=e,this.masterPasswordHash=t,this.masterPasswordHint=i,this.userSymmetricKey=n,this.userAsymmetricKeys=r,this.kdf=s,this.kdfIterations=o,this.kdfMemory=a,this.kdfParallelism=l,this.emailVerificationToken=c,this.orgSponsoredFreeFamilyPlanToken=d,this.acceptEmergencyAccessInviteToken=u,this.acceptEmergencyAccessId=h,this.providerInviteToken=A,this.providerUserId=p,this.organizationUserId=g,this.orgInviteToken=v}}var Xi=i(33331),qi=i(60512),Hi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Wi{constructor(e,t,i,n){this.keyService=e,this.accountApiService=t,this.masterPasswordService=i,this.configService=n}getOrgNameFromOrgInvite(){return null}getMasterPasswordPolicyOptsFromOrgInvite(){return null}finishRegistration(e,t,i,n,r,s,o,a){return Hi(this,void 0,void 0,function*(){let l,c;if(t.newApisWithInputPasswordFlagEnabled){const e="Could not finish registration.";(0,Xi.B)(t.newPassword,"newPassword",e),(0,qi.x)(t.kdfConfig,"kdfConfig",e),(0,Xi.B)(t.salt,"salt",e);const i=yield this.keyService.makeMasterKey(t.newPassword,t.salt,t.kdfConfig);[l,c]=yield this.keyService.makeUserKey(i)}else[l,c]=yield this.keyService.makeUserKey(t.newMasterKey);if(!l||!c)throw new Error("User key could not be created");const d=yield this.keyService.makeKeyPair(l),u=yield this.buildRegisterRequest(l,e,t,c.encryptedString,d,i,n,r,s,o,a);return yield this.accountApiService.registerFinish(u)})}buildRegisterRequest(e,t,i,n,r,s,o,a,l,c,d){return Hi(this,void 0,void 0,function*(){var o;const a=new Ve.G(r[0],r[1].encryptedString);if(null!==(o=i.newApisWithInputPasswordFlagEnabled)&&void 0!==o&&o){const n=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(i.newPassword,i.kdfConfig,i.salt),r=yield this.masterPasswordService.makeMasterPasswordUnlockData(i.newPassword,i.kdfConfig,i.salt,e),o=new Li(t,i.newPasswordHint,a,n,r);return s&&(o.emailVerificationToken=s),o}{const e=new Ki(t,i.newServerMasterKeyHash,i.newPasswordHint,n,a,i.kdfConfig.kdfType,i.kdfConfig.iterations);return s&&(e.emailVerificationToken=s),e}})}}var $i,Ji=i(80351);!function(e){e.MasterPassword="masterPassword",e.Pin="pin",e.Biometrics="biometrics",e.None="none"}($i||($i={}));var Zi=i(28846),_i=i(16878);const en=E.JW`
    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 4 88 88">
    <path class="tw-fill-illustration-bg-primary" d="M4 10a6 6 0 0 1 6-6h50a6 6 0 0 1 6 6v50a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6V10Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 6H10a4 4 0 0 0-4 4v50a4 4 0 0 0 4 4h50a4 4 0 0 0 4-4V10a4 4 0 0 0-4-4ZM10 4a6 6 0 0 0-6 6v50a6 6 0 0 0 6 6h50a6 6 0 0 0 6-6V10a6 6 0 0 0-6-6H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M14 19a5 5 0 0 1 5-5h7a1 1 0 1 1 0 2h-7a3 3 0 0 0-3 3v7a1 1 0 1 1-2 0v-7Zm29-4a1 1 0 0 1 1-1h7a5 5 0 0 1 5 5v7a1 1 0 1 1-2 0v-7a3 3 0 0 0-3-3h-7a1 1 0 0 1-1-1ZM15 43a1 1 0 0 1 1 1v7a3 3 0 0 0 3 3h7a1 1 0 1 1 0 2h-7a5 5 0 0 1-5-5v-7a1 1 0 0 1 1-1Zm40 0a1 1 0 0 1 1 1v7a5 5 0 0 1-5 5h-7a1 1 0 1 1 0-2h7a3 3 0 0 0 3-3v-7a1 1 0 0 1 1-1ZM26 27a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm11 0a1 1 0 1 0-2 0v10a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3V27Zm-2 19c-2.234 0-4.411-.64-6.494-1.862a1 1 0 1 0-1.012 1.724C29.845 47.242 32.368 48 35 48c2.632 0 5.155-.758 7.506-2.138a1 1 0 1 0-1.012-1.724C39.41 45.36 37.234 46 35 46ZM23.565 24.825C24.378 24.268 25.192 24 26 24s1.622.268 2.435.825a1 1 0 1 0 1.13-1.65C28.478 22.43 27.277 22 26 22c-1.277 0-2.478.43-3.565 1.175a1 1 0 1 0 1.13 1.65ZM44 24c-.808 0-1.622.268-2.435.825a1 1 0 1 1-1.13-1.65C41.522 22.43 42.722 22 44 22s2.478.43 3.565 1.175a1 1 0 1 1-1.13 1.65C45.622 24.268 44.808 24 44 24Zm1 4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0v-5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M92 61.5C92 78.345 80.807 92 67 92S42 78.345 42 61.5 53.193 31 67 31s25 13.655 25 30.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67 90c12.349 0 23-12.37 23-28.5C90 45.37 79.349 33 67 33S44 45.37 44 61.5C44 77.63 54.651 90 67 90Zm0 2c13.807 0 25-13.655 25-30.5S80.807 31 67 31 42 44.655 42 61.5 53.193 92 67 92Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.351 49.196A18.953 18.953 0 0 1 67.001 48c2.342 0 4.582.423 6.65 1.196a1 1 0 0 0 .7-1.873A20.954 20.954 0 0 0 67.001 46c-2.584 0-5.06.467-7.35 1.323a1 1 0 1 0 .7 1.873ZM67.001 52c-4.58 0-8.646 2.198-11.201 5.6a1 1 0 1 1-1.6-1.2A15.977 15.977 0 0 1 67.001 50c5.198 0 9.537 2.124 12.708 5.293a1 1 0 1 1-1.414 1.414C75.462 53.877 71.618 52 67.001 52Zm-.14 2c-6.453 0-11.555 5.467-11.111 11.905l.09 1.297a15.002 15.002 0 0 0 1.175 4.873l.565 1.319a1 1 0 1 0 1.838-.788l-.565-1.319a13 13 0 0 1-1.019-4.223l-.09-1.297C57.382 60.485 61.568 56 66.863 56A9.138 9.138 0 0 1 76 65.138V66a1 1 0 1 1-2 0v-1c0-1.61-.58-3.358-1.827-4.713C70.908 58.912 69.01 58 66.5 58c-2.607 0-4.29 1.188-5.276 2.705C60.276 62.164 60 63.871 60 65c0 2.792.25 4.826.952 6.51.712 1.71 1.848 2.958 3.408 4.258a1 1 0 1 0 1.28-1.536c-1.44-1.2-2.304-2.202-2.842-3.492C62.25 69.424 62 67.708 62 65c0-.871.224-2.164.9-3.205.64-.983 1.707-1.795 3.6-1.795 1.99 0 3.342.707 4.202 1.642A5.018 5.018 0 0 1 72 65v1a3 3 0 1 0 6 0v-.862C78 58.987 73.013 54 66.862 54Zm-.905 10.94c0-.505.417-.94.988-.94.583 0 1.056.473 1.056 1.056v1.636c0 1.768.832 3.432 2.246 4.493l.82.615a6 6 0 0 0 3.6 1.2H75a1 1 0 1 0 0-2h-.333a4 4 0 0 1-2.4-.8l-.82-.615A3.615 3.615 0 0 1 70 66.692v-1.636A3.056 3.056 0 0 0 66.944 62c-1.61 0-2.99 1.267-2.988 2.943.002.984.039 2.22.177 3.365.15 1.243.753 2.218 1.396 3.031.293.372.611.73.909 1.065l.079.09c.328.369.631.715.903 1.072.663.875.84 1.591.651 2.063a1 1 0 0 0 1.858.742c.604-1.51-.165-3.023-.916-4.013a20.143 20.143 0 0 0-1-1.193l-.073-.082c-.306-.344-.587-.66-.842-.983-.546-.692-.893-1.32-.98-2.031-.124-1.034-.16-2.181-.162-3.129Z" clip-rule="evenodd"/>
    </svg>
`;var tn=i(68333),nn=i(62166),rn=i(8168),sn=i(44432),on=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function an(e,t){1&e&&c.eu8(0)}function ln(e,t){if(1&e&&(c.qex(0),c.DNE(1,an,1,0,"ng-container",4),c.bVm()),2&e){c.XpG(2);const e=c.sdS(3);c.R7$(),c.Y8G("ngTemplateOutlet",e)}}function cn(e,t){if(1&e&&(c.qex(0),c.j41(1,"bit-form-field",5)(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",6)(6,"button",7),c.j41(7,"bit-hint"),c.EFF(8),c.nI1(9,"i18n"),c.k0s()(),c.bVm()),2&e){const e=c.XpG(2);c.R7$(3),c.JRh(c.bMT(4,3,"pin")),c.R7$(2),c.Y8G("formControl",e.secret),c.R7$(3),c.JRh(c.bMT(9,5,"confirmIdentity"))}}function dn(e,t){1&e&&(c.j41(0,"div"),c.nrm(1,"bit-icon",13),c.nI1(2,"i18n"),c.EFF(3),c.nI1(4,"i18n"),c.k0s()),2&e&&(c.R7$(),c.Y8G("ariaLabel",c.bMT(2,2,"loading")),c.R7$(2),c.SpI(" ",c.bMT(4,4,"awaitingConfirmation")," "))}function un(e,t){if(1&e){const e=c.RV6();c.j41(0,"bit-callout",14),c.EFF(1),c.nI1(2,"i18n"),c.j41(3,"button",15),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.verifyUserViaBiometrics())}),c.EFF(4),c.nI1(5,"i18n"),c.k0s()()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,2,"couldNotCompleteBiometrics")," "),c.R7$(3),c.SpI(" ",c.bMT(5,4,"tryAgain")," "))}function hn(e,t){if(1&e&&(c.qex(0),c.j41(1,"div",8)(2,"div",9),c.nrm(3,"bit-svg",10),c.k0s(),c.j41(4,"p",11),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.DNE(7,dn,5,6,"div",1),c.k0s(),c.DNE(8,un,6,6,"bit-callout",12),c.bVm()),2&e){const e=c.XpG(2);c.R7$(3),c.Y8G("content",e.Icons.UserVerificationBiometricsIcon),c.R7$(2),c.JRh(c.bMT(6,4,"verifyWithBiometrics")),c.R7$(2),c.Y8G("ngIf",!e.biometricsVerificationFailed),c.R7$(),c.Y8G("ngIf",e.biometricsVerificationFailed)}}function An(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",20),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Biometrics)}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"useBiometrics")," "))}function pn(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",20),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Pin)}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"usePin")," "))}function gn(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",21),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.MasterPassword)}),c.EFF(1),c.nI1(2,"i18n"),c.k0s()}2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"useMasterPassword")," "))}function vn(e,t){if(1&e&&(c.j41(0,"div",16)(1,"p",17),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.DNE(4,An,3,3,"button",18)(5,pn,3,3,"button",18)(6,gn,3,3,"button",19),c.k0s()),2&e){const e=c.XpG(2);c.R7$(2),c.JRh(c.bMT(3,4,"needADifferentMethod")),c.R7$(2),c.Y8G("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Biometrics),c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Pin),c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.MasterPassword)}}function fn(e,t){if(1&e&&(c.qex(0),c.j41(1,"div",2),c.DNE(2,ln,2,1,"ng-container",1)(3,cn,10,7,"ng-container",1)(4,hn,9,6,"ng-container",1)(5,vn,7,6,"div",3),c.k0s(),c.bVm()),2&e){const e=c.XpG();c.R7$(2),c.Y8G("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.MasterPassword),c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Pin),c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Biometrics),c.R7$(),c.Y8G("ngIf",e.hasMultipleClientVerificationOptions)}}function mn(e,t){1&e&&c.eu8(0)}function yn(e,t){if(1&e&&(c.qex(0),c.DNE(1,mn,1,0,"ng-container",4),c.bVm()),2&e){c.XpG(2);const e=c.sdS(3);c.R7$(),c.Y8G("ngTemplateOutlet",e)}}function Cn(e,t){1&e&&(c.j41(0,"div",24),c.nrm(1,"bit-icon",13),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.Y8G("ariaLabel",c.bMT(2,1,"loading")))}function wn(e,t){1&e&&(c.j41(0,"span",27),c.nrm(1,"bit-icon",28),c.EFF(2),c.nI1(3,"i18n"),c.k0s()),2&e&&(c.Y8G("@sent",void 0),c.R7$(2),c.SpI(" ",c.bMT(3,2,"codeSent")," "))}function In(e,t){if(1&e){const e=c.RV6();c.j41(0,"div",24),c.EFF(1),c.nI1(2,"i18n"),c.j41(3,"p",25)(4,"button",15),c.bIt("click",function(){L.eBV(e);const t=c.XpG(3);return L.Njj(t.requestOTP())}),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.DNE(7,wn,4,4,"span",26),c.k0s()()}if(2&e){const e=c.XpG(3);c.R7$(),c.SpI(" ",c.bMT(2,3,"enterVerificationCodeSentToEmail")," "),c.R7$(4),c.SpI(" ",c.bMT(6,5,"resendCode")," "),c.R7$(2),c.Y8G("ngIf",e.sentCode)}}function bn(e,t){if(1&e&&(c.qex(0),c.DNE(1,Cn,3,3,"div",22)(2,In,8,7,"div",22),c.j41(3,"bit-form-field",5)(4,"bit-label"),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.nrm(7,"input",23),c.j41(8,"bit-hint"),c.EFF(9),c.nI1(10,"i18n"),c.k0s()(),c.bVm()),2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",!e.sentInitialCode),c.R7$(),c.Y8G("ngIf",e.sentInitialCode),c.R7$(3),c.JRh(c.bMT(6,5,"verificationCode")),c.R7$(2),c.Y8G("formControl",e.secret),c.R7$(2),c.JRh(c.bMT(10,7,"confirmIdentity"))}}function Bn(e,t){if(1&e&&(c.qex(0),c.DNE(1,yn,2,1,"ng-container",1)(2,bn,11,9,"ng-container",1),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.server.masterPassword),c.R7$(),c.Y8G("ngIf",e.userVerificationOptions.server.otp)}}function En(e,t){if(1&e&&(c.j41(0,"bit-form-field",5)(1,"bit-label"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.nrm(4,"input",29)(5,"button",7),c.j41(6,"bit-hint"),c.EFF(7),c.nI1(8,"i18n"),c.k0s()()),2&e){const e=c.XpG();c.R7$(2),c.JRh(c.bMT(3,3,"masterPass")),c.R7$(2),c.Y8G("formControl",e.secret),c.R7$(3),c.JRh(c.bMT(8,5,"confirmIdentity"))}}class Sn{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===$i.MasterPassword?this.i18nService.t("incorrectPassword"):this.activeClientVerificationOption===$i.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 c.bkB,this.activeClientVerificationOptionChange=new c.bkB,this.biometricsVerificationResultChange=new c.bkB,this.Icons={UserVerificationBiometricsIcon:en},this.userVerificationOptions={client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:!1,otp:!1}},this.ActiveClientVerificationOption=$i,this._activeClientVerificationOptionSubject=new _i.t(null),this.activeClientVerificationOption$=this._activeClientVerificationOptionSubject.asObservable(),this.biometricsVerificationFailed=!1,this.disableRequestOTP=!1,this.sentInitialCode=!1,this.sentCode=!1,this.secret=new y.MJ("",[y.k0.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.getInvalidSecretErrorMessage()}}}]),this.destroy$=new w.B,this.requestOTP=()=>on(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 on(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!==$i.Biometrics&&this.processSecretChanges(this.secret.value),this.secret.valueChanges.pipe((0,B.Q)(this.destroy$)).subscribe(e=>this.processSecretChanges(e))})}setDefaultActiveClientVerificationOption(){this.userVerificationOptions.client.biometrics?this.activeClientVerificationOption=$i.Biometrics:this.userVerificationOptions.client.pin?this.activeClientVerificationOption=$i.Pin:this.userVerificationOptions.client.masterPassword?this.activeClientVerificationOption=$i.MasterPassword:this.activeClientVerificationOption=$i.None}setupClientVerificationOptionChangeHandler(){this.activeClientVerificationOption$.pipe((0,B.Q)(this.destroy$)).subscribe(e=>{this.handleActiveClientVerificationOptionChange(e)})}handleActiveClientVerificationOptionChange(e){return on(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 on(this,void 0,void 0,function*(){this.biometricsVerificationFailed=!1;const e=yield this.userVerificationService.verifyUser({type:tn.k.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!==$i.Biometrics&&null!=this.onChange&&this.onChange({type:this.determineVerificationWithSecretType(),secret:O.A.isNullOrWhitespace(e)?null:e})}determineVerificationWithSecretType(){return"server"===this.verificationType?this.userVerificationOptions.server.masterPassword?tn.k.MasterPassword:tn.k.OTP:this.userVerificationOptions.client.masterPassword&&this.activeClientVerificationOption===$i.MasterPassword?tn.k.MasterPassword:tn.k.PIN}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Sn.ɵfac=function(e){return new(e||Sn)(c.rXU(nn.i),c.rXU(J.W))},Sn.ɵcmp=c.VBU({type:Sn,selectors:[["app-user-verification-form-input"]],inputs:{verificationType:"verificationType",invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange",activeClientVerificationOptionChange:"activeClientVerificationOptionChange",biometricsVerificationResultChange:"biometricsVerificationResultChange"},features:[c.Jv_([{provide:y.kq,multi:!0,useExisting:Sn}])],decls:4,vars:2,consts:[["masterPasswordFormField",""],[4,"ngIf"],[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-size-16","tw-content-center","tw-mb-4"],[3,"content"],[1,"tw-font-medium","tw-mb-1"],["type","danger",4,"ngIf"],["name","bwi-spinner",1,"bwi-spin",3,"ariaLabel"],["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,"tw-mb-0"],["class","tw-ml-2 tw-text-success","role","alert",4,"ngIf"],["role","alert",1,"tw-ml-2","tw-text-success"],["name","bwi-check-circle"],["bitInput","","id","masterPassword","type","password","name","MasterPasswordHash","appAutofocus","","appInputVerbatim","",3,"formControl"]],template:function(e,t){1&e&&c.DNE(0,fn,6,4,"ng-container",1)(1,Bn,3,2,"ng-container",1)(2,En,9,7,"ng-template",null,0,c.C5r),2&e&&(c.Y8G("ngIf","client"===t.verificationType),c.R7$(),c.Y8G("ngIf","server"===t.verificationType))},dependencies:[f.MD,f.bT,f.T3,y.X1,y.me,y.BC,y.l_,n.p,ge.B,Yt.q,j.L,le.j,tt.I,ce.J,de.h,ue.e,he.a,U.C,N.Q,Ae.s,l.o,A.R,ei.Z,rn.k,z.V,pe.g,o.t,Ji.j,sn.G,p.$],encapsulation:2,data:{animation:[(0,Zi.hZ)("sent",[(0,Zi.kY)(":enter",[(0,Zi.iF)({opacity:0}),(0,Zi.i0)("100ms",(0,Zi.iF)({opacity:1}))])])]}});var Qn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function kn(e,t){if(1&e&&(c.j41(0,"p",9),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.bMT(2,1,e.dialogOptions.bodyText)," ")}}function Tn(e,t){if(1&e&&(c.j41(0,"bit-callout",10),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.Y8G("type",e.dialogOptions.calloutOptions.type),c.R7$(),c.SpI(" ",c.bMT(2,2,e.dialogOptions.calloutOptions.text)," ")}}function Fn(e,t){if(1&e&&(c.qex(0),c.DNE(1,kn,3,3,"p",7)(2,Tn,3,4,"bit-callout",8),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.Y8G("ngIf",e.dialogOptions.bodyText),c.R7$(),c.Y8G("ngIf",e.dialogOptions.calloutOptions)}}function Pn(e,t){1&e&&(c.qex(0),c.j41(1,"p",9),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"verificationRequiredForActionSetPinToContinue")," "))}function Rn(e,t){1&e&&(c.j41(0,"button",13),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"submit")," "))}function Dn(e,t){if(1&e&&(c.j41(0,"button",14),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(3);c.Y8G("buttonType",e.dialogOptions.confirmButtonOptions.type),c.R7$(),c.SpI(" ",c.bMT(2,2,e.dialogOptions.confirmButtonOptions.text)," ")}}function Mn(e,t){if(1&e&&(c.qex(0),c.DNE(1,Rn,3,3,"button",11)(2,Dn,3,4,"button",12),c.bVm()),2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",!e.dialogOptions.confirmButtonOptions),c.R7$(),c.Y8G("ngIf",e.dialogOptions.confirmButtonOptions)}}function xn(e,t){1&e&&(c.qex(0),c.j41(1,"button",13),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"setPin")," "))}function On(e,t){if(1&e&&(c.qex(0),c.DNE(1,Mn,3,2,"ng-container",3)(2,xn,4,3,"ng-container",3),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.Y8G("ngIf",e.activeClientVerificationOption!==e.ActiveClientVerificationOption.None),c.R7$(),c.Y8G("ngIf",e.activeClientVerificationOption===e.ActiveClientVerificationOption.None)}}class Gn{get secret(){return this.verificationForm.controls.secret}constructor(e,t,i,n,r,s,o){this.dialogOptions=e,this.dialogRef=t,this.formBuilder=i,this.userVerificationService=n,this.platformUtilsService=r,this.i18nService=s,this.toastService=o,this.verificationForm=this.formBuilder.group({secret:this.formBuilder.control(null)}),this.invalidSecret=!1,this.ActiveClientVerificationOption=$i,this.submit=()=>Qn(this,void 0,void 0,function*(){if(this.activeClientVerificationOption!==$i.None){if(this.verificationForm.markAllAsTouched(),!this.verificationForm.invalid)try{if("object"==typeof this.dialogOptions.verificationType&&"custom"===this.dialogOptions.verificationType.type){const e=yield this.dialogOptions.verificationType.verificationFn(this.secret.value);return void this.close({userAction:"confirm",verificationSuccess:e})}(yield this.userVerificationService.verifyUser(this.secret.value))?(this.invalidSecret=!1,this.close({userAction:"confirm",verificationSuccess:!0,noAvailableClientVerificationMethods:!1})):(this.invalidSecret=!0,this.activeClientVerificationOption===$i.Pin?this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("invalidPin")}):this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("unexpectedError")}))}catch(e){return this.invalidSecret=!0,void this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("userVerificationFailed")})}}else this.close({userAction:"confirm",verificationSuccess:!1,noAvailableClientVerificationMethods:!0})})}static open(e,t){return Qn(this,void 0,void 0,function*(){const i=e.open(Gn,{data:t}),n=yield(0,I._)(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)}}Gn.ɵfac=function(e){return new(e||Gn)(c.rXU(s.Qs),c.rXU(r.ce),c.rXU(y.ok),c.rXU(nn.i),c.rXU(_.y),c.rXU(J.W),c.rXU(q.f))},Gn.ɵcmp=c.VBU({type:Gn,selectors:[["ng-component"]],decls:15,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["formControlName","secret",3,"invalidSecretChange","activeClientVerificationOptionChange","biometricsVerificationResultChange","invalidSecret","verificationType"],["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&&(c.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),c.EFF(3),c.nI1(4,"i18n"),c.nI1(5,"i18n"),c.k0s(),c.qex(6,2),c.DNE(7,Fn,3,2,"ng-container",3)(8,Pn,4,3,"ng-container",3),c.j41(9,"app-user-verification-form-input",4),c.mxI("invalidSecretChange",function(e){return c.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),c.bIt("activeClientVerificationOptionChange",function(e){return t.handleActiveClientVerificationOptionChange(e)})("biometricsVerificationResultChange",function(e){return t.handleBiometricsVerificationResultChange(e)}),c.k0s(),c.bVm(),c.qex(10,5),c.DNE(11,On,3,2,"ng-container",3),c.j41(12,"button",6),c.bIt("click",function(){return t.cancel()}),c.EFF(13),c.nI1(14,"i18n"),c.k0s(),c.bVm(),c.k0s()()),2&e&&(c.Y8G("formGroup",t.verificationForm)("bitSubmit",t.submit),c.R7$(3),c.SpI(" ",t.dialogOptions.title?c.bMT(4,9,t.dialogOptions.title):c.bMT(5,11,"verificationRequired")),c.R7$(4),c.Y8G("ngIf","client"!==t.dialogOptions.verificationType||"client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.None),c.R7$(),c.Y8G("ngIf","client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption===t.ActiveClientVerificationOption.None),c.R7$(),c.R50("invalidSecret",t.invalidSecret),c.Y8G("verificationType","client"===t.dialogOptions.verificationType?"client":"server"),c.R7$(2),c.Y8G("ngIf","client"!==t.dialogOptions.verificationType||"client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.Biometrics),c.R7$(2),c.SpI(" ",c.bMT(14,13,"cancel")," "))},dependencies:[f.MD,f.bT,y.X1,y.qT,y.BC,y.cb,y.j4,y.JD,n.p,o.t,d.Q,a.P,oi.m,h.hJ,U.C,re.$,se.L,Sn,Ji.j,sn.G,p.$],encapsulation:2});var Un=i(81441),Vn=i(4717),jn=i(83541);class Nn{}var zn,Yn=i(52057),Ln=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Kn(e,t){1&e&&(c.j41(0,"div"),c.nrm(1,"bit-icon",2),c.nI1(2,"i18n"),c.EFF(3),c.nI1(4,"i18n"),c.k0s()),2&e&&(c.R7$(),c.Y8G("ariaLabel",c.bMT(2,2,"loading")),c.R7$(2),c.SpI(" ",c.bMT(4,4,"loading")," "))}function Xn(e,t){1&e&&(c.j41(0,"div")(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",3),c.k0s(),c.j41(6,"div",4)(7,"button",5),c.EFF(8),c.nI1(9,"i18n"),c.k0s()()()),2&e&&(c.R7$(3),c.JRh(c.bMT(4,3,"ssoIdentifier")),c.R7$(4),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(9,5,"continue")," "))}class qn{get identifierFormControl(){return this.formGroup.controls.identifier}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,C,w){this.ssoLoginService=e,this.loginStrategyService=t,this.router=i,this.i18nService=n,this.route=r,this.orgDomainApiService=s,this.validationService=o,this.platformUtilsService=a,this.apiService=l,this.cryptoFunctionService=c,this.environmentService=d,this.passwordGenerationService=u,this.logService=h,this.userDecryptionOptionsService=A,this.masterPasswordService=p,this.accountService=g,this.toastService=v,this.ssoComponentService=f,this.loginSuccessHandlerService=C,this.keyConnectorService=w,this.formGroup=new y.gE({identifier:new y.MJ(null,[y.k0.required])}),this.loggingIn=!1,this.submit=()=>Ln(this,void 0,void 0,function*(){var e,t,i;if(this.formGroup.invalid)return;const n=null!=(yield(0,I._)(this.route.queryParams)).identifier;this.identifier=null!==(e=this.identifierFormControl.value)&&void 0!==e?e:"",yield this.ssoLoginService.setOrganizationSsoIdentifier(this.identifier),null===(i=(t=this.ssoComponentService).setDocumentCookies)||void 0===i||i.call(t);try{yield this.submitSso()}catch(r){n?yield this.router.navigate(["/login"]):this.validationService.showError(r)}}),d.environment$.pipe((0,m.pQ)()).subscribe(e=>{this.redirectUri=e.getWebVaultUrl()+"/sso-connector.html"});const b=this.platformUtilsService.getClientType();this.isValidSsoClientType(b)&&(this.clientId=b)}ngOnInit(){return Ln(this,void 0,void 0,function*(){var e;const t=yield(0,I._)(this.route.queryParams);if(this.email=null!==(e=t.email)&&void 0!==e?e:yield this.ssoLoginService.getSsoEmail(),this.userCompletedSsoAuthentication(t))yield this.handleTokenRequestForAuthenticatedUser(t);else{if(this.hasParametersFromOtherClientRedirect(t)&&this.initializeFromRedirectFromOtherClient(t),null!=t.identifier)return this.identifierFormControl.setValue(t.identifier),this.loggingIn=!0,void(yield this.submit());yield this.initializeIdentifierFromEmailOrStorage()}})}initializeFromRedirectFromOtherClient(e){var t,i,n,r;this.redirectUri=null!==(t=e.redirectUri)&&void 0!==t?t:"",this.state=null!==(i=e.state)&&void 0!==i?i:"",this.codeChallenge=null!==(n=e.codeChallenge)&&void 0!==n?n:"";const s=null!==(r=e.clientId)&&void 0!==r?r:"";if(!this.isValidSsoClientType(s))throw new Error(`Invalid SSO client type: ${e.clientId}`);this.clientId=s}isValidSsoClientType(e){return[P.sK.Web,P.sK.Browser,P.sK.Desktop,P.sK.Cli].includes(e)}hasParametersFromOtherClientRedirect(e){return null!=e.clientId&&null!=e.redirectUri&&null!=e.state&&null!=e.codeChallenge}handleTokenRequestForAuthenticatedUser(e){return Ln(this,void 0,void 0,function*(){var t,i;const n=yield this.ssoLoginService.getCodeVerifier(),r=yield this.ssoLoginService.getSsoState();if(yield this.ssoLoginService.setCodeVerifier(""),yield this.ssoLoginService.setSsoState(""),null!=e.redirectUri&&(this.redirectUri=e.redirectUri),null!=e.code&&null!=n&&null!=r&&this.verifyStateMatches(r,null!==(t=e.state)&&void 0!==t?t:"")){const t=this.getOrgIdentifierFromState(null!==(i=e.state)&&void 0!==i?i:"");yield this.logIn(e.code,n,t)}})}userCompletedSsoAuthentication(e){return null!=e.code&&null!=e.state}handleGetClaimedDomainByEmailError(e){if(e instanceof R._){const t=e;if(t.statusCode===P.kG.NotFound)return;this.validationService.showError(t)}}submitSso(e,t){return Ln(this,void 0,void 0,function*(){if(null==this.identifier||""===this.identifier)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("ssoValidationFailed"),message:this.i18nService.t("ssoIdentifierRequired")});if(null==this.clientId)throw new Error("Client ID is required");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 Ln(this,void 0,void 0,function*(){var n,r;let s=this.codeChallenge,o=this.state;const a={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};if(null==s){const e=yield this.passwordGenerationService.generatePassword(a),t=yield this.cryptoFunctionService.hash(e,"sha256");s=O.A.fromArrayToUrlB64(t),yield this.ssoLoginService.setCodeVerifier(e)}null==o&&(o=yield this.passwordGenerationService.generatePassword(a)),e&&(o+=`_returnUri='${e}'`),o+=`_identifier=${this.identifier}`,yield this.ssoLoginService.setSsoState(o);let l=(yield(0,I._)(this.environmentService.environment$)).getIdentityUrl()+"/connect/authorize?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(null!==(n=this.redirectUri)&&void 0!==n?n:"")+"&response_type=code&scope=api offline_access&state="+o+"&code_challenge="+s+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(null!==(r=this.identifier)&&void 0!==r?r:"")+"&ssoToken="+encodeURIComponent(null!=i?i:"");if(t){const e=yield this.apiService.getSsoUserIdentifier();l+=`&user_identifier=${encodeURIComponent(e)}`}return l})}logIn(e,t,i){return Ln(this,void 0,void 0,function*(){var n,r;this.loggingIn=!0;try{const s=null!==(n=this.redirectUri)&&void 0!==n?n:"",o=new k.pS(e,t,s,i,null!==(r=this.email)&&void 0!==r?r:void 0);this.formPromise=this.loginStrategyService.logIn(o);const a=yield this.formPromise;if(a.requiresTwoFactor)return yield this.handleTwoFactorRequired(i);if(yield this.loginSuccessHandlerService.run(a.userId,null),yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(i,a.userId),null!=(yield(0,I._)(this.keyConnectorService.requiresDomainConfirmation$(a.userId))))return void(yield this.router.navigate(["confirm-key-connector-domain"]));const l=yield(0,I._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(a.userId));if(!!l.trustedDeviceOption&&(yield this.isTrustedDeviceEncEnabled(l.trustedDeviceOption)))return yield this.handleTrustedDeviceEncryptionEnabled(l);return!l.hasMasterPassword&&void 0===l.keyConnectorOption?yield this.handleChangePasswordRequired(i):yield this.handleSuccessfulLogin()}catch(s){yield this.handleLoginError(s)}})}isTrustedDeviceEncEnabled(e){return Ln(this,void 0,void 0,function*(){return void 0!==e})}handleTwoFactorRequired(e){return Ln(this,void 0,void 0,function*(){yield this.router.navigate(["2fa"],{queryParams:{identifier:e,sso:"true"}})})}handleTrustedDeviceEncryptionEnabled(e){return Ln(this,void 0,void 0,function*(){var t,i,n,r;const s=null===(t=yield(0,I._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;s&&(!e.hasMasterPassword&&(null===(i=e.trustedDeviceOption)||void 0===i?void 0:i.isTdeOffboarding)?yield this.masterPasswordService.setForceSetPasswordReason(Un.n.TdeOffboarding,s):!e.hasMasterPassword&&(null===(n=e.trustedDeviceOption)||void 0===n?void 0:n.hasManageResetPasswordPermission)&&(yield this.masterPasswordService.setForceSetPasswordReason(Un.n.TdeUserWithoutPasswordHasPasswordResetPermission,s)),(null===(r=this.ssoComponentService)||void 0===r?void 0:r.closeWindow)?yield this.ssoComponentService.closeWindow():yield this.router.navigate(["login-initiated"]))})}handleChangePasswordRequired(e){return Ln(this,void 0,void 0,function*(){yield this.router.navigate(["set-initial-password"],{queryParams:{identifier:e}})})}handleSuccessfulLogin(){return Ln(this,void 0,void 0,function*(){yield this.router.navigate(["lock"])})}handleLoginError(e){return Ln(this,void 0,void 0,function*(){this.logService.error(e),e instanceof Error&&"Key Connector error"===e.message?this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("ssoKeyConnectorError")}):this.toastService.showToast({variant:"error",title:null,message:e.message}),this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,yield this.router.navigate(["/login"])})}getOrgIdentifierFromState(e){if(null==e)return"";const t=e.split("_identifier=");return t.length>1?t[1]:""}verifyStateMatches(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]}initializeIdentifierFromEmailOrStorage(){return Ln(this,void 0,void 0,function*(){if(this.email){this.loggingIn=!0;try{const e=yield this.orgDomainApiService.getVerifiedOrgDomainsByEmail(this.email);if(e.data.length>0)return this.identifierFormControl.setValue(e.data[0].organizationIdentifier),void(yield this.submit())}catch(t){this.handleGetClaimedDomainByEmailError(t)}this.loggingIn=!1}const e=yield this.ssoLoginService.getOrganizationSsoIdentifier();null!=e&&this.identifierFormControl.setValue(e)})}}qn.ɵfac=function(e){return new(e||qn)(c.rXU(ne._),c.rXU(k.sg),c.rXU(K.Ix),c.rXU(J.W),c.rXU(K.nX),c.rXU(Vn.o),c.rXU(te.B),c.rXU(_.y),c.rXU(Xe.G),c.rXU(Tt.R),c.rXU(D.v),c.rXU(wt.JJ),c.rXU(M.K),c.rXU(k.Ym),c.rXU(jn.O),c.rXU(Ke.D),c.rXU(q.f),c.rXU(Nn),c.rXU(k.aJ),c.rXU(Yn.K))},qn.ɵcmp=c.VBU({type:qn,selectors:[["ng-component"]],decls:3,vars:4,consts:[[1,"tw-container",3,"formGroup","bitSubmit"],[4,"ngIf"],["name","bwi-spinner",1,"bwi-spin",3,"ariaLabel"],["bitInput","","type","text","formControlName","identifier","appAutofocus",""],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"]],template:function(e,t){1&e&&(c.j41(0,"form",0),c.DNE(1,Kn,5,6,"div",1)(2,Xn,10,7,"div",1),c.k0s()),2&e&&(c.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),c.R7$(),c.Y8G("ngIf",t.loggingIn),c.R7$(),c.Y8G("ngIf",!t.loggingIn))},dependencies:[U.C,re.$,se.L,o.t,d.Q,V.q,f.MD,f.bT,j.L,le.j,ce.J,de.h,N.Q,l.o,A.R,z.V,n.p,ge.B,y.X1,y.qT,y.me,y.BC,y.cb,y.j4,y.JD,C.iI,p.$],encapsulation:2});class Hn{}!function(e){e[e.DIRECT_LAUNCH=0]="DIRECT_LAUNCH",e[e.SINGLE_ACTION_POPOUT=1]="SINGLE_ACTION_POPOUT"}(zn||(zn={}));class Wn{}class $n{shouldCheckForWebAuthnQueryParamResponse(){return!1}determineDuoLaunchAction(){return zn.DIRECT_LAUNCH}}var Jn=i(88565),Zn=i(2073),_n=i(20266),er=i(36951),tr=i(51111),ir=i(26061),nr=i(87895),rr=i(71804),sr=i(68881),or=i(37380);class ar{constructor(){this.tokenFormControl=void 0,this.tokenChange=new c.bkB}onTokenChange(e){const t=e.target.value||"";this.tokenChange.emit({token:t})}}ar.ɵfac=function(e){return new(e||ar)},ar.ɵcmp=c.VBU({type:ar,selectors:[["app-two-factor-auth-authenticator"]],inputs:{tokenFormControl:"tokenFormControl"},outputs:{tokenChange:"tokenChange"},features:[c.Jv_([])],decls:6,vars:4,consts:[["bitInput","","type","text","appAutofocus","","appInputVerbatim","",3,"keyup","formControl"]],template:function(e,t){1&e&&(c.qex(0),c.j41(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.j41(5,"input",0),c.bIt("keyup",function(e){return t.onTokenChange(e)}),c.k0s()(),c.bVm()),2&e&&(c.R7$(3),c.JRh(c.bMT(4,2,"verificationCode")),c.R7$(2),c.Y8G("formControl",t.tokenFormControl))},dependencies:[f.MD,n.p,ge.B,Yt.q,a.P,o.t,z.V,Ye.E,y.X1,y.me,y.BC,y.l_,j.L,le.j,ce.J,de.h,U.C,y.YN,p.$],encapsulation:2});class lr{}var cr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class dr{constructor(e,t,i,n,r){this.i18nService=e,this.platformUtilsService=t,this.toastService=i,this.twoFactorAuthDuoComponentService=n,this.destroyRef=r,this.tokenEmitter=new c.bkB,this.duoFramelessUrl=void 0}ngOnInit(){return cr(this,void 0,void 0,function*(){this.twoFactorAuthDuoComponentService.listenForDuo2faResult$().pipe((0,m.pQ)(this.destroyRef)).subscribe(e=>{this.tokenEmitter.emit(e.token)}),this.duoFramelessUrl=this.providerData.AuthUrl})}launchDuoFrameless(e){return cr(this,void 0,void 0,function*(){var t,i;switch(e){case zn.DIRECT_LAUNCH:yield this.launchDuoFramelessDirectly();break;case zn.SINGLE_ACTION_POPOUT:yield null===(i=(t=this.twoFactorAuthDuoComponentService).openTwoFactorAuthDuoPopout)||void 0===i?void 0:i.call(t)}})}launchDuoFramelessDirectly(){return cr(this,void 0,void 0,function*(){null!==this.duoFramelessUrl&&void 0!==this.duoFramelessUrl?yield this.twoFactorAuthDuoComponentService.launchDuoFrameless(this.duoFramelessUrl):this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("duoHealthCheckResultsInNullAuthUrlError")})})}}dr.ɵfac=function(e){return new(e||dr)(c.rXU(J.W),c.rXU(_.y),c.rXU(q.f),c.rXU(lr),c.rXU(L.abz))},dr.ɵcmp=c.VBU({type:dr,selectors:[["app-two-factor-auth-duo"]],inputs:{providerData:"providerData"},outputs:{tokenEmitter:"tokenEmitter"},features:[c.Jv_([])],decls:0,vars:0,template:function(e,t){},dependencies:[f.MD,n.p,a.P,o.t,z.V,Ye.E,y.X1,j.L,U.C,y.YN],encapsulation:2});var ur=i(74199);class hr{constructor(){this.emailSent=!1}static fromJSON(e){return null==e?null:Object.assign(new hr,e)}}class Ar{constructor(){this.viewCacheService=(0,L.WQX)(It.Z),this.emailCache=this.viewCacheService.signal({key:"two-factor-auth-email-component-cache",initialValue:null,deserializer:hr.fromJSON})}cacheData(e){this.emailCache.set({emailSent:e.emailSent})}clearCachedData(){this.emailCache.set(null)}getCachedData(){return this.emailCache()}}Ar.ɵfac=function(e){return new(e||Ar)},Ar.ɵprov=L.jDH({token:Ar,factory:Ar.ɵfac});var pr=i(93103),gr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vr{constructor(e,t,i,n,r,s,o,a){this.i18nService=e,this.twoFactorService=t,this.loginStrategyService=i,this.platformUtilsService=n,this.logService=r,this.appIdService=s,this.toastService=o,this.cacheService=a,this.tokenFormControl=void 0,this.tokenChange=new c.bkB,this.twoFactorEmail=void 0,this.emailSent=!1}ngOnInit(){return gr(this,void 0,void 0,function*(){const e=this.cacheService.getCachedData();(null==e?void 0:e.emailSent)&&(this.emailSent=!0);const t=yield this.twoFactorService.getProviders();if(!t||0===t.size)throw new Error("User has no 2FA Providers");const i=t.get(rr.R.Email);if(!i)throw new Error("Unable to retrieve email 2FA provider data");this.twoFactorEmail=i.Email,this.emailSent||(yield this.sendEmail(!1))})}onTokenChange(e){const t=e.target.value||"";this.tokenChange.emit({token:t})}sendEmail(e){return gr(this,void 0,void 0,function*(){var t,i,n,r;if(void 0!==this.emailPromise)return;const s=yield this.loginStrategyService.getEmail();if(null!=s){try{const o=new ur.v;o.email=s,o.masterPasswordHash=null!==(t=yield this.loginStrategyService.getMasterPasswordHash())&&void 0!==t?t:"",o.ssoEmail2FaSessionToken=null!==(i=yield this.loginStrategyService.getSsoEmail2FaSessionToken())&&void 0!==i?i:"",o.deviceIdentifier=yield this.appIdService.getAppId(),o.authRequestAccessCode=null!==(n=yield this.loginStrategyService.getAccessCode())&&void 0!==n?n:"",o.authRequestId=null!==(r=yield this.loginStrategyService.getAuthRequestId())&&void 0!==r?r:"",this.emailPromise=this.twoFactorService.postTwoFactorEmail(o),yield this.emailPromise,this.emailSent=!0,this.cacheService.cacheData({emailSent:this.emailSent}),e&&this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail)})}catch(o){this.logService.error(o)}this.emailPromise=void 0}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("sessionTimeout")})})}}vr.ɵfac=function(e){return new(e||vr)(c.rXU(J.W),c.rXU(or.fz),c.rXU(k.sg),c.rXU(_.y),c.rXU(M.K),c.rXU(H.Y),c.rXU(q.f),c.rXU(Ar))},vr.ɵcmp=c.VBU({type:vr,selectors:[["app-two-factor-auth-email"]],inputs:{tokenFormControl:"tokenFormControl"},outputs:{tokenChange:"tokenChange"},features:[c.Jv_([{provide:Ar,useClass:Ar}])],decls:9,vars:7,consts:[[1,"!tw-mb-0"],["bitInput","","type","text","appAutofocus","","appInputVerbatim","",3,"keyup","formControl"],[1,"tw-mb-4"],["bitTypography","helper","bitLink","","href","#","appStopClick","",1,"tw-text-main",3,"click"]],template:function(e,t){1&e&&(c.j41(0,"bit-form-field",0)(1,"bit-label"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"input",1),c.bIt("keyup",function(e){return t.onTokenChange(e)}),c.k0s()(),c.j41(5,"div",2)(6,"a",3),c.bIt("click",function(){return t.sendEmail(!0)}),c.EFF(7),c.nI1(8,"i18n"),c.k0s()()),2&e&&(c.R7$(2),c.JRh(c.bMT(3,3,"verificationCode")),c.R7$(2),c.Y8G("formControl",t.tokenFormControl),c.R7$(3),c.SpI(" ",c.bMT(8,5,"resendCode")," "))},dependencies:[f.MD,n.p,ge.B,Yt.q,pr.Y,a.P,o.t,z.V,pe.g,Ye.E,it.r,y.X1,y.me,y.BC,y.l_,j.L,le.j,ce.J,de.h,U.C,y.YN,p.$],encapsulation:2});class fr{constructor(e,t,i,n,r,s,o,a){this.win=e,this.webVaultUrl=t,this.webAuthnNewTab=i,this.platformUtilsService=n,this.i18nService=r,this.successCallback=s,this.errorCallback=o,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("readSecurityKey")),btnAwaitingInteractionText:encodeURIComponent(this.i18nService.t("awaitingSecurityKeyInteraction")),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|"))}}class mr{}var yr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Cr=e=>({"tw-hidden":e});function wr(e,t){1&e&&(c.j41(0,"div",5),c.nrm(1,"bit-icon",6),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.Y8G("ariaLabel",c.bMT(2,1,"loading")))}function Ir(e,t){if(1&e&&(c.j41(0,"div",2),c.DNE(1,wr,3,3,"div",3),c.nrm(2,"iframe",4),c.k0s()),2&e){const e=c.XpG();c.R7$(),c.Y8G("ngIf",!e.webAuthnReady),c.R7$(),c.Y8G("ngClass",c.eq3(2,Cr,!e.webAuthnReady))}}function br(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"button",7),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.authWebAuthn())}),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.bVm()}2&e&&(c.R7$(),c.Y8G("block",!0),c.R7$(),c.SpI(" ",c.bMT(3,2,"openInNewTab")," "))}class Br{constructor(e,t,i,n,r,s,o,a,l){this.i18nService=e,this.platformUtilsService=t,this.win=i,this.environmentService=n,this.twoFactorService=r,this.route=s,this.toastService=o,this.twoFactorAuthWebAuthnComponentService=a,this.logService=l,this.webAuthnResultEmitter=new c.bkB,this.webAuthnInNewTabEmitter=new c.bkB,this.webAuthnReady=!1,this.webAuthnNewTab=!1,this.webAuthnSupported=!1,this.webAuthnIframe=void 0,this.webAuthnSupported=this.platformUtilsService.supportsWebAuthn(i),this.webAuthnNewTab=this.twoFactorAuthWebAuthnComponentService.shouldOpenWebAuthnInNewTab()}ngOnInit(){return yr(this,void 0,void 0,function*(){this.webAuthnInNewTabEmitter.emit(this.webAuthnNewTab),this.webAuthnNewTab&&this.route.snapshot.paramMap.has("webAuthnResponse")?this.submitWebAuthnNewTabResponse():yield this.buildWebAuthnIFrame()})}submitWebAuthnNewTabResponse(){const e=this.route.snapshot.paramMap.get("webAuthnResponse"),t="true"===this.route.snapshot.paramMap.get("remember");null!=e&&this.webAuthnResultEmitter.emit({token:e,remember:t})}buildWebAuthnIFrame(){return yr(this,void 0,void 0,function*(){if(null!=this.win&&this.webAuthnSupported){const e=(yield(0,I._)(this.environmentService.environment$)).getWebVaultUrl();this.webAuthnIframe=new fr(this.win,e,this.webAuthnNewTab,this.platformUtilsService,this.i18nService,e=>{this.webAuthnResultEmitter.emit({token:e})},e=>{this.logService.error("WebAuthn error: ",e),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("webauthnCancelOrTimeout")})},e=>{"ready"===e&&(this.webAuthnReady=!0)}),this.webAuthnNewTab||setTimeout(()=>yr(this,void 0,void 0,function*(){yield this.authWebAuthn()}),500)}})}ngOnDestroy(){this.cleanupWebAuthnIframe()}authWebAuthn(){return yr(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getProviders();if(null==e)return void this.logService.error("No 2FA providers found. Unable to authenticate with WebAuthn.");const t=null==e?void 0:e.get(rr.R.WebAuthn);this.webAuthnSupported&&null!=this.webAuthnIframe&&this.webAuthnIframe.init(t)})}cleanupWebAuthnIframe(){null!=this.webAuthnIframe&&(this.webAuthnIframe.stop(),this.webAuthnIframe.cleanup())}}Br.ɵfac=function(e){return new(e||Br)(c.rXU(J.W),c.rXU(_.y),c.rXU(Zn.jf),c.rXU(D.v),c.rXU(or.fz),c.rXU(K.nX),c.rXU(q.f),c.rXU(mr),c.rXU(M.K))},Br.ɵcmp=c.VBU({type:Br,selectors:[["app-two-factor-auth-webauthn"]],outputs:{webAuthnResultEmitter:"webAuthnResultEmitter",webAuthnInNewTabEmitter:"webAuthnInNewTabEmitter"},features:[c.Jv_([])],decls:2,vars:2,consts:[["id","web-authn-frame","class","tw-mb-3",4,"ngIf"],[4,"ngIf"],["id","web-authn-frame",1,"tw-mb-3"],["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],["id","webauthn_iframe","sandbox","allow-scripts allow-same-origin",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],["buttonType","primary","bitButton","","type","button","appStopClick","",1,"tw-mb-3",3,"click","block"]],template:function(e,t){1&e&&c.DNE(0,Ir,3,4,"div",0)(1,br,4,4,"ng-container",1),2&e&&(c.Y8G("ngIf",!t.webAuthnNewTab),c.R7$(),c.Y8G("ngIf",t.webAuthnNewTab))},dependencies:[f.MD,f.YU,f.bT,n.p,pr.Y,a.P,o.t,d.Q,z.V,Ye.E,y.X1,j.L,U.C,y.YN,l.o,A.R,p.$],encapsulation:2});class Er{constructor(){this.tokenFormControl=void 0}}Er.ɵfac=function(e){return new(e||Er)},Er.ɵcmp=c.VBU({type:Er,selectors:[["app-two-factor-auth-yubikey"]],inputs:{tokenFormControl:"tokenFormControl"},features:[c.Jv_([])],decls:5,vars:4,consts:[[1,""],["type","password","bitInput","","appAutofocus","","appInputVerbatim","",3,"formControl"]],template:function(e,t){1&e&&(c.j41(0,"bit-form-field")(1,"bit-label",0),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.nrm(4,"input",1),c.k0s()),2&e&&(c.R7$(2),c.JRh(c.bMT(3,2,"verificationCode")),c.R7$(2),c.Y8G("formControl",t.tokenFormControl))},dependencies:[f.MD,n.p,ge.B,Yt.q,a.P,o.t,z.V,Ye.E,y.X1,y.me,y.BC,y.l_,j.L,le.j,ce.J,de.h,U.C,y.YN,p.$],encapsulation:2});class Sr{constructor(){this.token=void 0,this.remember=void 0,this.selectedProviderType=void 0}static fromJSON(e){return null==e?null:Object.assign(new Sr,e)}}class Qr{constructor(){this.viewCacheService=(0,L.WQX)(It.Z),this.twoFactorAuthComponentCache=this.viewCacheService.signal({key:"two-factor-auth-component-cache",initialValue:null,deserializer:Sr.fromJSON})}cacheData(e){this.twoFactorAuthComponentCache.set({token:e.token,remember:e.remember,selectedProviderType:e.selectedProviderType})}clearCachedData(){this.twoFactorAuthComponentCache.set(null)}getCachedData(){return this.twoFactorAuthComponentCache()}}Qr.ɵfac=function(e){return new(e||Qr)},Qr.ɵprov=L.jDH({token:Qr,factory:Qr.ɵfac});var kr=i(46730),Tr=i(98403),Fr=i(75556),Pr=i(90300),Rr=i(91962),Dr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Mr(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthAuthenticatorIcon)}}function xr(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthEmailIcon)}}function Or(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthDuoIcon)}}function Gr(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthYubicoIcon)}}function Ur(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthDuoIcon)}}function Vr(e,t){if(1&e&&c.nrm(0,"bit-svg",11),2&e){const e=c.XpG(2);c.Y8G("content",e.Icons.TwoFactorAuthWebAuthnIcon)}}function jr(e,t){if(1&e){const e=c.RV6();c.j41(0,"bit-item",6),c.bIt("click",function(){const t=L.eBV(e).$implicit,i=c.XpG();return L.Njj(i.choose(t))}),c.j41(1,"button",7)(2,"div",8),c.DNE(3,Mr,1,1,"bit-svg",9)(4,xr,1,1,"bit-svg",9)(5,Or,1,1,"bit-svg",9)(6,Gr,1,1,"bit-svg",9)(7,Ur,1,1,"bit-svg",9)(8,Vr,1,1,"bit-svg",9),c.k0s(),c.EFF(9),c.qex(10,10),c.EFF(11),c.bVm(),c.k0s()()}if(2&e){const e=t.$implicit,i=c.XpG();c.R7$(),c.Y8G("truncate",!1),c.R7$(),c.Y8G("ngSwitch",e.type),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.Authenticator),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.Email),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.Duo),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.Yubikey),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.OrganizationDuo),c.R7$(),c.Y8G("ngSwitchCase",i.TwoFactorProviderType.WebAuthn),c.R7$(),c.SpI(" ",e.name," "),c.R7$(2),c.SpI(" ",e.description," ")}}class Nr{constructor(e,t){this.twoFactorService=e,this.dialogRef=t,this.providers=[],this.TwoFactorProviderType=rr.R,this.Icons={TwoFactorAuthAuthenticatorIcon:_n.m,TwoFactorAuthEmailIcon:er.f,TwoFactorAuthDuoIcon:tr.x,TwoFactorAuthYubicoIcon:kr.C,TwoFactorAuthWebAuthnIcon:nr.R}}ngOnInit(){return Dr(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getSupportedProviders(window);e.sort((e,t)=>e.sort-t.sort),this.providers=e})}choose(e){return Dr(this,void 0,void 0,function*(){this.dialogRef.close({type:e.type})})}static open(e){return e.open(Nr)}cancel(){this.dialogRef.close()}}Nr.ɵfac=function(e){return new(e||Nr)(c.rXU(or.fz),c.rXU(r.ce))},Nr.ɵcmp=c.VBU({type:Nr,selectors:[["app-two-factor-options"]],features:[c.Jv_([])],decls:11,vars:8,consts:[["dialogSize","large",3,"background"],["bitDialogTitle",""],["bitDialogContent",""],[3,"click",4,"ngFor","ngForOf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","secondary",3,"click"],[3,"click"],["bit-item-content","","type","button",1,"tw-h-auto","md:tw-h-20",3,"truncate"],["slot","start",1,"tw-w-16","md:tw-w-20","tw-mr-2","sm:tw-mr-4",3,"ngSwitch"],[3,"content",4,"ngSwitchCase"],["slot","secondary"],[3,"content"]],template:function(e,t){1&e&&(c.j41(0,"bit-dialog",0)(1,"span",1),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.qex(4,2),c.j41(5,"bit-item-group"),c.DNE(6,jr,12,10,"bit-item",3),c.k0s(),c.bVm(),c.qex(7,4),c.j41(8,"button",5),c.bIt("click",function(){return t.cancel()}),c.EFF(9),c.nI1(10,"i18n"),c.k0s(),c.bVm(),c.k0s()),2&e&&(c.Y8G("background","alt"),c.R7$(2),c.SpI(" ",c.bMT(3,4,"selectTwoStepLoginMethod")," "),c.R7$(4),c.Y8G("ngForOf",t.providers),c.R7$(3),c.SpI(" ",c.bMT(10,6,"cancel")," "))},dependencies:[f.MD,f.Sq,f.ux,f.e1,n.p,a.P,oi.m,h.hJ,o.t,d.Q,Ye.E,Tr.k,Fr.J,Pr.g,Rr._,ei.Z,rn.k,p.$],encapsulation:2});var zr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yr=["continueButton"],Lr=["duoComponent"];function Kr(e,t){1&e&&(c.qex(0),c.j41(1,"div",3),c.nrm(2,"bit-icon",4),c.nI1(3,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.Y8G("ariaLabel",c.bMT(3,1,"loading")))}function Xr(e,t){if(1&e){const e=c.RV6();c.j41(0,"app-two-factor-auth-email",17),c.bIt("tokenChange",function(t){L.eBV(e);const i=c.XpG(2);return L.Njj(i.saveFormDataWithPartialData(t))}),c.k0s()}if(2&e){const e=c.XpG(2);c.Y8G("tokenFormControl",e.tokenFormControl)}}function qr(e,t){if(1&e){const e=c.RV6();c.j41(0,"app-two-factor-auth-authenticator",17),c.bIt("tokenChange",function(t){L.eBV(e);const i=c.XpG(2);return L.Njj(i.saveFormDataWithPartialData(t))}),c.k0s()}if(2&e){const e=c.XpG(2);c.Y8G("tokenFormControl",e.tokenFormControl)}}function Hr(e,t){if(1&e&&c.nrm(0,"app-two-factor-auth-yubikey",18),2&e){const e=c.XpG(2);c.Y8G("tokenFormControl",e.tokenFormControl)}}function Wr(e,t){if(1&e){const e=c.RV6();c.j41(0,"app-two-factor-auth-duo",19,0),c.bIt("tokenEmitter",function(t){L.eBV(e);const i=c.XpG(2);return L.Njj(i.submit(t))}),c.k0s()}if(2&e){const e=c.XpG(2);c.Y8G("providerData",e.selectedProviderData)}}function $r(e,t){if(1&e){const e=c.RV6();c.j41(0,"bit-form-control",20)(1,"bit-label"),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"input",21),c.bIt("change",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.onRememberChange())}),c.k0s()()}2&e&&(c.R7$(2),c.JRh(c.bMT(3,1,"dontAskAgainOnThisDeviceFor30Days")))}function Jr(e,t){if(1&e){const e=c.RV6();c.j41(0,"app-two-factor-auth-webauthn",22),c.bIt("webAuthnResultEmitter",function(t){L.eBV(e);const i=c.XpG(2);return L.Njj(i.submit(t.token,t.remember))})("webAuthnInNewTabEmitter",function(t){L.eBV(e);const i=c.XpG(2);return L.Njj(i.webAuthInNewTab=t)}),c.k0s()}}function Zr(e,t){1&e&&(c.qex(0),c.j41(1,"p",23),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"p",23),c.EFF(5),c.nI1(6,"i18n"),c.k0s(),c.bVm()),2&e&&(c.R7$(2),c.JRh(c.bMT(3,2,"noTwoStepProviders")),c.R7$(3),c.JRh(c.bMT(6,4,"noTwoStepProviders2")))}function _r(e,t){1&e&&(c.j41(0,"button",24,1)(2,"span"),c.EFF(3),c.nI1(4,"i18n"),c.k0s()()),2&e&&(c.R7$(3),c.SpI(" ",c.bMT(4,1,"continueLoggingIn")," "))}function es(e,t){1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"launchDuo")))}function ts(e,t){1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"popoutExtension")))}function is(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",25),c.bIt("click",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.launchDuo())}),c.DNE(1,es,3,3,"span",2)(2,ts,3,3,"span",2),c.k0s()}if(2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",e.duoLaunchAction===e.DuoLaunchAction.DIRECT_LAUNCH),c.R7$(),c.Y8G("ngIf",e.duoLaunchAction===e.DuoLaunchAction.SINGLE_ACTION_POPOUT)}}function ns(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",16),c.bIt("click",function(){L.eBV(e);const t=c.XpG(2);return L.Njj(t.selectOtherTwoFactorMethod())}),c.j41(1,"span"),c.EFF(2),c.nI1(3,"i18n"),c.k0s()()}2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"selectAnotherMethod")," "))}function rs(e,t){if(1&e){const e=c.RV6();c.qex(0),c.j41(1,"form",5),c.bIt("keydown.enter",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.handleEnterKeyPress())}),c.DNE(2,Xr,1,1,"app-two-factor-auth-email",6)(3,qr,1,1,"app-two-factor-auth-authenticator",6)(4,Hr,1,1,"app-two-factor-auth-yubikey",7)(5,Wr,2,1,"app-two-factor-auth-duo",8)(6,$r,5,3,"bit-form-control",9)(7,Jr,1,0,"app-two-factor-auth-webauthn",10)(8,Zr,7,6,"ng-container",2),c.j41(9,"div",11),c.DNE(10,_r,5,3,"button",12)(11,is,3,2,"button",13),c.j41(12,"p",14),c.EFF(13),c.nI1(14,"i18n"),c.k0s(),c.DNE(15,ns,4,3,"button",15),c.j41(16,"button",16),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.use2faRecoveryCode())}),c.j41(17,"span"),c.EFF(18),c.nI1(19,"i18n"),c.k0s()()()(),c.bVm()}if(2&e){const e=c.XpG();c.R7$(),c.Y8G("bitSubmit",e.submit)("formGroup",e.form),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.Email),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.Authenticator),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.Yubikey),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.OrganizationDuo||e.selectedProviderType===e.providerType.Duo),c.R7$(),c.Y8G("ngIf",!e.hideRememberMe()),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.WebAuthn),c.R7$(),c.Y8G("ngIf",null==e.selectedProviderType),c.R7$(2),c.Y8G("ngIf",e.showContinueButton()),c.R7$(),c.Y8G("ngIf",e.selectedProviderType===e.providerType.Duo||e.selectedProviderType===e.providerType.OrganizationDuo),c.R7$(2),c.JRh(c.bMT(14,14,"or")),c.R7$(2),c.Y8G("ngIf",(null==e.twoFactorProviders?null:e.twoFactorProviders.size)>1),c.R7$(3),c.SpI(" ",c.bMT(19,16,"useYourRecoveryCode")," ")}}class ss{get tokenFormControl(){return this.form.controls.token}get rememberFormControl(){return this.form.controls.remember}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,C,w,I,b){this.loginStrategyService=e,this.router=t,this.i18nService=i,this.platformUtilsService=n,this.dialogService=r,this.activatedRoute=s,this.logService=o,this.twoFactorService=a,this.userDecryptionOptionsService=l,this.ssoLoginService=c,this.masterPasswordService=d,this.accountService=u,this.formBuilder=h,this.win=A,this.toastService=p,this.twoFactorAuthComponentService=g,this.destroyRef=v,this.anonLayoutWrapperDataService=f,this.environmentService=m,this.loginSuccessHandlerService=C,this.twoFactorAuthComponentCacheService=w,this.authService=I,this.keyConnectorService=b,this.continueButton=void 0,this.loading=!0,this.orgSsoIdentifier=void 0,this.providerType=rr.R,this.selectedProviderType=rr.R.Authenticator,this.twoFactorProviders=null,this.form=this.formBuilder.group({token:["",{validators:[y.k0.required],updateOn:"submit"}],remember:[!1]}),this.duoLaunchAction=void 0,this.DuoLaunchAction=zn,this.webAuthInNewTab=!1,this.authenticationSessionTimeoutRoute="authentication-timeout",this.submit=(e,t)=>zr(this,void 0,void 0,function*(){var i;let n;if(void 0!==e){if(""===e||null===e)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("verificationCodeRequired")});n=e}else{if(this.tokenFormControl.markAsTouched(),this.tokenFormControl.markAsDirty(),this.tokenFormControl.updateValueAndValidity(),this.form.invalid)return;const e=this.tokenFormControl.value;if(!e)return;n=e.trim()}const r=null!==(i=null!=t?t:this.rememberFormControl.value)&&void 0!==i&&i;this.twoFactorAuthComponentCacheService.cacheData({token:n,remember:r,selectedProviderType:this.selectedProviderType});try{this.formPromise=this.loginStrategyService.logInTwoFactor(new sr.i(this.selectedProviderType,n,r));const e=yield this.formPromise;this.logService.info("Successfully submitted two factor token"),yield this.handleAuthResult(e)}catch(s){this.logService.error("Error submitting two factor token"),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidVerificationCode")})}})}ngOnInit(){return zr(this,void 0,void 0,function*(){var e,t,i;this.orgSsoIdentifier=null!==(e=this.activatedRoute.snapshot.queryParamMap.get("identifier"))&&void 0!==e?e:void 0,this.listenForAuthnSessionTimeout();let n=!1;const r=this.twoFactorAuthComponentCacheService.getCachedData();r&&(r.token&&this.form.patchValue({token:r.token}),void 0!==r.remember&&this.form.patchValue({remember:r.remember}),void 0!==r.selectedProviderType&&(this.selectedProviderType=r.selectedProviderType,n=!0)),n||(this.selectedProviderType=yield this.initializeSelected2faProviderType(),this.twoFactorAuthComponentCacheService.cacheData({selectedProviderType:this.selectedProviderType})),yield this.set2faProvidersAndData(),yield this.setAnonLayoutDataByTwoFactorProviderType(),yield null===(i=(t=this.twoFactorAuthComponentService).extendPopupWidthIfRequired)||void 0===i?void 0:i.call(t,this.selectedProviderType),this.duoLaunchAction=this.twoFactorAuthComponentService.determineDuoLaunchAction(),this.loading=!1})}saveFormDataWithPartialData(e){return zr(this,void 0,void 0,function*(){var t,i,n,r,s;const o=this.twoFactorAuthComponentCacheService.getCachedData();this.twoFactorAuthComponentCacheService.cacheData({token:null!==(i=null!==(t=null==e?void 0:e.token)&&void 0!==t?t:null==o?void 0:o.token)&&void 0!==i?i:"",remember:null!==(r=null!==(n=null==e?void 0:e.remember)&&void 0!==n?n:null==o?void 0:o.remember)&&void 0!==r&&r,selectedProviderType:null!==(s=null==e?void 0:e.selectedProviderType)&&void 0!==s?s:null==o?void 0:o.selectedProviderType})})}onRememberChange(){return zr(this,void 0,void 0,function*(){const e=!!this.rememberFormControl.value;yield this.saveFormDataWithPartialData({remember:e})})}initializeSelected2faProviderType(){return zr(this,void 0,void 0,function*(){const e=this.platformUtilsService.supportsWebAuthn(this.win);if(this.twoFactorAuthComponentService.shouldCheckForWebAuthnQueryParamResponse()&&e){if(this.activatedRoute.snapshot.paramMap.get("webAuthnResponse"))return rr.R.WebAuthn}return yield this.twoFactorService.getDefaultProvider(e)})}set2faProvidersAndData(){return zr(this,void 0,void 0,function*(){var e;if(this.twoFactorProviders=yield this.twoFactorService.getProviders(),void 0!==this.selectedProviderType){const t=null===(e=this.twoFactorProviders)||void 0===e?void 0:e.get(this.selectedProviderType);this.selectedProviderData=t}})}listenForAuthnSessionTimeout(){this.loginStrategyService.authenticationSessionTimeout$.pipe((0,m.pQ)(this.destroyRef)).subscribe(e=>zr(this,void 0,void 0,function*(){if(e)try{yield this.router.navigate([this.authenticationSessionTimeoutRoute])}catch(t){this.logService.error(`Failed to navigate to ${this.authenticationSessionTimeoutRoute} route`,t)}}))}selectOtherTwoFactorMethod(){return zr(this,void 0,void 0,function*(){const e=Nr.open(this.dialogService),t=yield(0,Jn.s)(e.closed);if(null!=t&&"string"!=typeof t){const e=yield this.twoFactorService.getProviders().then(e=>null==e?void 0:e.get(t.type));this.selectedProviderData=e,this.selectedProviderType=t.type,yield this.setAnonLayoutDataByTwoFactorProviderType(),this.twoFactorAuthComponentCacheService.cacheData({token:"",remember:!1,selectedProviderType:t.type}),this.form.reset(),this.form.updateValueAndValidity()}})}launchDuo(){return zr(this,void 0,void 0,function*(){null!=this.duoComponent&&void 0!==this.duoLaunchAction&&(yield this.duoComponent.launchDuoFrameless(this.duoLaunchAction))})}handleMigrateEncryptionKey(e){return zr(this,void 0,void 0,function*(){return!!e.requiresEncryptionKeyMigration&&(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("legacyEncryptionUnsupported")}),!0)})}setAnonLayoutDataByTwoFactorProviderType(){return zr(this,void 0,void 0,function*(){switch(this.selectedProviderType){case rr.R.Authenticator:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("enterTheCodeFromYourAuthenticatorApp"),pageIcon:_n.m});break;case rr.R.Email:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("enterTheCodeSentToYourEmail"),pageIcon:er.f});break;case rr.R.Duo:case rr.R.OrganizationDuo:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("duoTwoFactorRequiredPageSubtitle"),pageIcon:tr.x});break;case rr.R.Yubikey:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("pressYourYubiKeyToAuthenticate"),pageIcon:ir.s});break;case rr.R.WebAuthn:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("followTheStepsBelowToFinishLoggingInWithSecurityKey"),pageIcon:nr.R});break;default:this.logService.error("setAnonLayoutDataByTwoFactorProviderType: Unhandled 2FA provider type",this.selectedProviderType)}})}handleAuthResult(e){return zr(this,void 0,void 0,function*(){var t,i,n,r,s;if(this.twoFactorAuthComponentCacheService.clearCachedData(),yield this.handleMigrateEncryptionKey(e))return;if(yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword),void 0!==this.orgSsoIdentifier){const e=null===(t=yield(0,I._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(this.orgSsoIdentifier,e)}if(null!=(yield(0,I._)(this.keyConnectorService.requiresDomainConfirmation$(e.userId))))return void(yield this.router.navigate(["confirm-key-connector-domain"]));const o=yield(0,I._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e.userId));if(yield this.isTrustedDeviceEncEnabled(o.trustedDeviceOption))return yield this.handleTrustedDeviceEncryptionEnabled(e.userId,o);if(!o.hasMasterPassword&&void 0===o.keyConnectorOption)return yield this.handleChangePasswordRequired(this.orgSsoIdentifier);null===(n=(i=this.twoFactorAuthComponentService).reloadOpenWindows)||void 0===n||n.call(i);if(yield null===(s=(r=this.twoFactorAuthComponentService).closeSingleActionPopouts)||void 0===s?void 0:s.call(r))return;const a=yield this.determineDefaultSuccessRoute(e.userId);yield this.router.navigate([a],{queryParams:{identifier:this.orgSsoIdentifier}})})}determineDefaultSuccessRoute(e){return zr(this,void 0,void 0,function*(){if((yield(0,I._)(this.authService.activeAccountStatus$))===mt.J.Locked)return"lock";const t=yield(0,I._)(this.masterPasswordService.forceSetPasswordReason$(e));return t===Un.n.WeakMasterPassword||t===Un.n.AdminForcePasswordReset?"change-password":"vault"})}isTrustedDeviceEncEnabled(e){return zr(this,void 0,void 0,function*(){return"true"===this.activatedRoute.snapshot.queryParamMap.get("sso")&&void 0!==e})}handleTrustedDeviceEncryptionEnabled(e,t){return zr(this,void 0,void 0,function*(){var i,n,r,s,o,a;!t.hasMasterPassword&&(null===(i=t.trustedDeviceOption)||void 0===i?void 0:i.isTdeOffboarding)?yield this.masterPasswordService.setForceSetPasswordReason(Un.n.TdeOffboarding,e):!t.hasMasterPassword&&(null===(n=t.trustedDeviceOption)||void 0===n?void 0:n.hasManageResetPasswordPermission)&&(yield this.masterPasswordService.setForceSetPasswordReason(Un.n.TdeUserWithoutPasswordHasPasswordResetPermission,e)),null===(s=(r=this.twoFactorAuthComponentService).reloadOpenWindows)||void 0===s||s.call(r);(yield null===(a=(o=this.twoFactorAuthComponentService).closeSingleActionPopouts)||void 0===a?void 0:a.call(o))||(yield this.router.navigate(["login-initiated"]))})}handleChangePasswordRequired(e){return zr(this,void 0,void 0,function*(){yield this.router.navigate(["set-initial-password"],{queryParams:{identifier:e}})})}showContinueButton(){return null!=this.selectedProviderType&&this.selectedProviderType!==rr.R.WebAuthn&&this.selectedProviderType!==rr.R.Duo&&this.selectedProviderType!==rr.R.OrganizationDuo}hideRememberMe(){return(this.selectedProviderType===rr.R.Duo||this.selectedProviderType===rr.R.OrganizationDuo)&&this.duoLaunchAction===zn.SINGLE_ACTION_POPOUT||this.selectedProviderType===rr.R.WebAuthn&&this.webAuthInNewTab}use2faRecoveryCode(){return zr(this,void 0,void 0,function*(){const e=(yield(0,I._)(this.environmentService.environment$)).getWebVaultUrl();this.platformUtilsService.launchUri(e+"/#/recover-2fa")})}handleEnterKeyPress(){return zr(this,void 0,void 0,function*(){var e,t;switch(this.selectedProviderType){case rr.R.Authenticator:case rr.R.Email:null===(t=null===(e=this.continueButton)||void 0===e?void 0:e.nativeElement)||void 0===t||t.click();break;case rr.R.Duo:case rr.R.OrganizationDuo:case rr.R.WebAuthn:case rr.R.Yubikey:break;default:this.logService.error("handleEnterKeyPress: Unhandled 2FA provider type",this.selectedProviderType)}})}ngOnDestroy(){return zr(this,void 0,void 0,function*(){var e,t;null===(t=(e=this.twoFactorAuthComponentService).removePopupWidthExtension)||void 0===t||t.call(e)})}}ss.ɵfac=function(e){return new(e||ss)(c.rXU(k.sg),c.rXU(K.Ix),c.rXU(J.W),c.rXU(_.y),c.rXU(r.o3),c.rXU(K.nX),c.rXU(M.K),c.rXU(or.fz),c.rXU(k.Ym),c.rXU(ne._),c.rXU(jn.O),c.rXU(Ke.D),c.rXU(y.ok),c.rXU(Zn.jf),c.rXU(q.f),c.rXU(Wn),c.rXU(L.abz),c.rXU(X.f),c.rXU(D.v),c.rXU(k.aJ),c.rXU(Qr),c.rXU(kt.u),c.rXU(Yn.K))},ss.ɵcmp=c.VBU({type:ss,selectors:[["app-two-factor-auth"]],viewQuery:function(e,t){if(1&e&&(c.GBs(Yr,5,c.aKT),c.GBs(Lr,5)),2&e){let e;c.mGM(e=c.lsd())&&(t.continueButton=e.first),c.mGM(e=c.lsd())&&(t.duoComponent=e.first)}},features:[c.Jv_([{provide:Qr}])],decls:2,vars:2,consts:[["duoComponent",""],["continueButton",""],[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],["autocomplete","off",3,"keydown.enter","bitSubmit","formGroup"],[3,"tokenFormControl","tokenChange",4,"ngIf"],[3,"tokenFormControl",4,"ngIf"],[3,"providerData","tokenEmitter",4,"ngIf"],["class","vw-remember",4,"ngIf"],[3,"webAuthnResultEmitter","webAuthnInNewTabEmitter",4,"ngIf"],[1,"tw-flex","tw-flex-col","tw-space-y-3"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",4,"ngIf"],["type","button","buttonType","primary","bitButton","",3,"click",4,"ngIf"],[1,"tw-text-center","tw-mb-0"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click",4,"ngIf"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click"],[3,"tokenChange","tokenFormControl"],[3,"tokenFormControl"],[3,"tokenEmitter","providerData"],[1,"vw-remember"],["type","checkbox","bitCheckbox","","formControlName","remember",3,"change"],[3,"webAuthnResultEmitter","webAuthnInNewTabEmitter"],["bitTypography","body1"],["type","submit","buttonType","primary","bitButton","","bitFormButton",""],["type","button","buttonType","primary","bitButton","",3,"click"]],template:function(e,t){1&e&&c.DNE(0,Kr,4,3,"ng-container",2)(1,rs,20,18,"ng-container",2),2&e&&(c.Y8G("ngIf",t.loading),c.R7$(),c.Y8G("ngIf",!t.loading))},dependencies:[f.MD,f.bT,n.p,y.X1,y.qT,y.Zm,y.BC,y.cb,y.j4,y.JD,j.L,ae.f,le.j,U.C,re.$,se.L,V.q,oe.P,o.t,d.Q,l.o,A.R,ar,vr,dr,Er,Br,p.$],encapsulation:2});var os=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const as=(e,t)=>os(void 0,void 0,void 0,function*(){const e=(0,L.WQX)(k.sg),t=(0,L.WQX)(or.fz),i=(0,L.WQX)(K.Ix),n=null!==(yield(0,I._)(e.currentAuthType$)),r=yield t.getProviders();return!(!n||null==r)||i.createUrlTree(["/login"])});class ls{shouldOpenWebAuthnInNewTab(){return!1}}var cs=i(3633),ds=i(65802);class us{}var hs=i(96331),As=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ps(e,t){if(1&e){const e=c.RV6();c.j41(0,"div",6),c.EFF(1),c.nI1(2,"i18n"),c.k0s(),c.j41(3,"button",7),c.bIt("click",function(){L.eBV(e);const t=c.XpG();return L.Njj(t.goBack())}),c.EFF(4),c.nI1(5,"i18n"),c.k0s()}2&e&&(c.R7$(),c.JRh(c.bMT(2,2,"or")),c.R7$(3),c.SpI(" ",c.bMT(5,4,"back")," "))}class gs{constructor(e,t,i,n,r,s,o,a,l,c,d){this.router=e,this.formBuilder=t,this.apiService=i,this.loginStrategyService=n,this.logService=r,this.i18nService=s,this.loginSuccessHandlerService=o,this.accountService=a,this.masterPasswordService=l,this.newDeviceVerificationComponentService=c,this.location=d,this.formGroup=this.formBuilder.group({code:["",{validators:[y.k0.required],updateOn:"change"}]}),this.disableRequestOTP=!1,this.destroy$=new w.B,this.authenticationSessionTimeoutRoute="/authentication-timeout",this.showBackButton=!0,this.submit=()=>As(this,void 0,void 0,function*(){var e,t;const i=this.formGroup.get("code");if(i&&i.value)try{const e=yield this.loginStrategyService.logInNewDeviceVerification(i.value);if(e.requiresTwoFactor)return void(yield this.router.navigate(["/2fa"]));yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword);const t=yield(0,I._)(this.accountService.activeAccount$.pipe(cs.F6)),n=yield(0,I._)(this.masterPasswordService.forceSetPasswordReason$(t));n===Un.n.WeakMasterPassword||n===Un.n.AdminForcePasswordReset?yield this.router.navigate(["/change-password"]):yield this.router.navigate(["/vault"])}catch(n){this.logService.error(n);let r=null!==(t=null===(e=null==n?void 0:n.response)||void 0===e?void 0:e.error_description)&&void 0!==t?t:this.i18nService.t("errorOccurred");r.includes("Invalid New Device OTP")&&(r=this.i18nService.t("invalidVerificationCode")),i.setErrors({serverError:{message:r}}),i.markAsTouched()}})}ngOnInit(){return As(this,void 0,void 0,function*(){this.showBackButton=this.newDeviceVerificationComponentService.showBackButton(),this.loginStrategyService.authenticationSessionTimeout$.pipe((0,B.Q)(this.destroy$)).subscribe(e=>{if(e)try{this.router.navigate([this.authenticationSessionTimeoutRoute])}catch(t){this.logService.error(`Failed to navigate to ${this.authenticationSessionTimeoutRoute} route`,t)}})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}resendOTP(){return As(this,void 0,void 0,function*(){this.disableRequestOTP=!0;try{const e=yield this.loginStrategyService.getEmail(),t=yield this.loginStrategyService.getMasterPasswordHash();if(!e||!t)throw new Error("Missing email or master password hash");yield this.apiService.send("POST","/accounts/resend-new-device-otp",{email:e,masterPasswordHash:t},!1,!1)}catch(e){this.logService.error(e)}finally{this.disableRequestOTP=!1}})}goBack(){this.location.back()}}gs.ɵfac=function(e){return new(e||gs)(c.rXU(K.Ix),c.rXU(y.ok),c.rXU(Xe.G),c.rXU(ds.s),c.rXU(M.K),c.rXU(J.W),c.rXU(k.aJ),c.rXU(Ke.D),c.rXU(jn.L),c.rXU(us),c.rXU(hs.aZ))},gs.ɵcmp=c.VBU({type:gs,selectors:[["app-new-device-verification"]],decls:14,vars:15,consts:[[3,"formGroup","bitSubmit"],[1,"!tw-mb-1"],["bitInput","","type","text","id","verificationCode","name","verificationCode","formControlName","code","appInputVerbatim",""],["bitLink","","type","button","linkType","primary",1,"tw-text-sm",3,"click","disabled"],[1,"tw-grid","tw-gap-3","tw-mt-4"],["bitButton","","bitFormButton","","buttonType","primary","type","submit",3,"block","disabled"],[1,"tw-text-center"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(c.j41(0,"form",0)(1,"bit-form-field",1)(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",2),c.k0s(),c.j41(6,"button",3),c.bIt("click",function(){return t.resendOTP()}),c.EFF(7),c.nI1(8,"i18n"),c.k0s(),c.j41(9,"div",4)(10,"button",5),c.EFF(11),c.nI1(12,"i18n"),c.k0s(),c.nVh(13,ps,6,6),c.k0s()()),2&e&&(c.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),c.R7$(3),c.JRh(c.bMT(4,9,"verificationCode")),c.R7$(3),c.Y8G("disabled",t.disableRequestOTP),c.R7$(),c.SpI(" ",c.bMT(8,11,"resendCode")," "),c.R7$(3),c.Y8G("block",!0)("disabled",t.formGroup.invalid),c.R7$(),c.SpI(" ",c.bMT(12,13,"continueLoggingIn")," "),c.R7$(2),c.vxM(t.showBackButton?13:-1))},dependencies:[f.MD,y.X1,y.qT,y.me,y.BC,y.cb,y.j4,y.JD,U.C,re.$,se.L,n.p,Yt.q,o.t,d.Q,j.L,le.j,ce.J,de.h,N.Q,z.V,pe.g,p.$],encapsulation:2});class vs{showBackButton(){return!0}}i(91834)},48180(e,t,i){"use strict";i.d(t,{P:()=>n});class n{}},48312(e,t,i){"use strict";i.d(t,{r:()=>n});class n{constructor(e=void 0){this.keys=e}classify(e){var t;const i=JSON.parse(JSON.stringify(e)),n=null!==(t=this.keys)&&void 0!==t?t:Object.keys(i),r={};for(const s of n)r[s]=i[s];return{disclosed:null,secret:r}}declassify(e,t){var i;const n={},r=null!==(i=this.keys)&&void 0!==i?i:Object.keys(t);for(const s of r)n[s]=t[s];return n}}},48541(e,t,i){"use strict";i.d(t,{G:()=>n});class n{constructor(e,t){this.publicKey=e,this.encryptedPrivateKey=t}}},48856(e,t,i){"use strict";i.d(t,{T:()=>o});var n=i(78991);class r{constructor(e,t){this.site=e,this.extensions=t,(0,n.ol)(this)}}var s=i(25304);class o{constructor(e,t){this.allowedSites=e,this.allowedFields=t,this.allPermission="default",this.siteRegistrations=new Map,this.sitePermissions=new Map,this.vendorRegistrations=new Map,this.vendorPermissions=new Map,this.extensionRegistrations=new Array,this.extensionsBySiteByVendor=new Map,Object.freeze(this.allowedFields),Object.freeze(this.allowedSites)}registerSite(e){if(!this.allowedSites.includes(e.id))return this;const t=e.availableFields.filter(e=>this.allowedFields.includes(e)),i=(0,n.ol)({id:e.id,availableFields:t});return this.siteRegistrations.has(e.id)||this.siteRegistrations.set(e.id,i),this}site(e){return this.siteRegistrations.get(e)}sites(){const e=[];for(const[t,i]of this.siteRegistrations.entries()){const n={site:i},r=this.sitePermissions.get(t);r&&(n.permission=r),e.push(n)}return e}registerVendor(e){if(!this.vendorRegistrations.has(e.id)){const t=(0,n.ol)(e);this.vendorRegistrations.set(e.id,t)}return this}vendor(e){return this.vendorRegistrations.get(e)}vendors(){const e=[];for(const[t,i]of this.vendorRegistrations.entries()){const n={vendor:i},r=this.vendorPermissions.get(t);r&&(n.permission=r),e.push(n)}return e}setPermission(e,t){if(!s.FG.includes(t))throw new Error(`invalid extension permission: ${t}`);if("all"in e&&e.all)this.allPermission=t;else if("vendor"in e)this.vendorPermissions.set(e.vendor,t);else{if(!("site"in e))throw new Error(`Unrecognized extension set received: ${JSON.stringify(e)}.`);this.allowedSites.includes(e.site)&&this.sitePermissions.set(e.site,t)}return this}permission(e){return"all"in e&&e.all?this.allPermission:"vendor"in e?this.vendorPermissions.get(e.vendor):"site"in e?this.sitePermissions.get(e.site):void 0}permissions(){const e=[];e.push({set:{all:!0},permission:this.allPermission});for(const[t,i]of this.sitePermissions.entries())e.push({set:{site:t},permission:i});for(const[t,i]of this.vendorPermissions.entries())e.push({set:{vendor:t},permission:i});return e}registerExtension(e){var t;const i=this.siteRegistrations.get(e.site.id),n=this.vendorRegistrations.get(e.product.vendor.id);if(!i||!n)return this;const r=null!==(t=this.extensionsBySiteByVendor.get(e.site.id))&&void 0!==t?t:new Map;if(r.has(e.product.vendor.id))return this;const s={vendor:n};e.product.name&&(s.name=e.product.name);const o=Object.freeze({site:i,product:Object.freeze(s),host:Object.freeze(Object.assign({},e.host)),requestedFields:Object.freeze([...e.requestedFields])}),a=this.extensionRegistrations.push(o)-1;return r.set(n.id,a),this.extensionsBySiteByVendor.set(i.id,r),this}extension(e,t){var i,n;const r=null!==(n=null===(i=this.extensionsBySiteByVendor.get(e))||void 0===i?void 0:i.get(t))&&void 0!==n?n:-1;return r<0?void 0:this.extensionRegistrations[r]}getPermissions(e,t){return[this.sitePermissions.get(e),this.vendorPermissions.get(t),this.allPermission].filter(e=>!!e)}extensions(){const e=[];for(const t of this.extensionRegistrations){const i=this.getPermissions(t.site.id,t.product.vendor.id);e.push({extension:t,permissions:i})}return e}build(e){var t,i;const n=this.siteRegistrations.get(e);if(!n)return;if("deny"===this.allPermission)return new r(n,new Map);const s=new Map,o=null!==(i=null===(t=this.extensionsBySiteByVendor.get(e))||void 0===t?void 0:t.entries())&&void 0!==i?i:[];for(const[r,l]of o){const t=a(this.getPermissions(e,r),this.extensionRegistrations[l]);t&&s.set(r,t)}return new r(n,s)}}function a(e,t){if(!e.includes("deny")){if(e.includes("allow"))return t;if(!e.includes("none")){if(e.includes("default"))return t;throw new Error("failed to recognize any permissions")}}}},49112(e,t,i){"use strict";i.d(t,{f:()=>Z});var n=i(74208),r=i(94573),s=i(23649),o=i(3204),a=i(90097),l=i(58806),c=i(33812);const d=[[["","slot","breadcrumbs"]],[["","slot","title-suffix"]],"*",[["","slot","secondary"]],[["","slot","tabs"]]];function u(e,t){if(1&e&&c.nrm(0,"i",10),2&e){const e=c.XpG();c.HbH(c.VkB("bwi ",e.icon()))}}class h{constructor(){this.title=r.hFB.required(),this.icon=(0,r.hFB)()}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=c.VBU({type:h,selectors:[["bit-header"]],inputs:{title:[1,"title"],icon:[1,"icon"]},ngContentSelectors:["[slot=breadcrumbs]","[slot=title-suffix]","*","[slot=secondary]","[slot=tabs]"],decls:17,vars:3,consts:[[1,"-tw-mt-6","-tw-mx-8","tw-mb-3","tw-flex","tw-flex-col","tw-py-6","tw-px-8","has-[[data-tabs]:not(:empty)]:tw-border-0","has-[[data-tabs]:not(:empty)]:tw-border-b","has-[[data-tabs]:not(:empty)]:tw-border-solid","has-[[data-tabs]:not(:empty)]:tw-border-secondary-100","has-[[data-tabs]:not(:empty)]:tw-bg-background-alt","has-[[data-tabs]:not(:empty)]:tw-pb-0"],[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-leading-10","tw-flex","tw-gap-1",3,"title"],[1,"tw-truncate"],["aria-hidden","true",3,"class"],[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"],[1,"tw-ml-auto","empty:tw-hidden"],["data-tabs","",1,"-tw-mx-4","-tw-mb-px","empty:tw-hidden"],["aria-hidden","true"]],template:function(e,t){1&e&&(c.NAR(d),c.j41(0,"header",0)(1,"div",1)(2,"div",2),c.SdG(3),c.j41(4,"h1",3)(5,"div",4),c.nVh(6,u,1,3,"i",5),c.EFF(7),c.k0s(),c.j41(8,"div"),c.SdG(9,1),c.k0s()()(),c.j41(10,"div",6)(11,"div",7),c.SdG(12,2),c.k0s(),c.j41(13,"div",8),c.SdG(14,3),c.k0s()()(),c.j41(15,"div",9),c.SdG(16,4),c.k0s()()),2&e&&(c.R7$(4),c.Y8G("title",t.title()),c.R7$(2),c.vxM(t.icon()?6:-1),c.R7$(),c.SpI(" ",t.title()," "))},dependencies:[l.r],encapsulation:2,changeDetection:0});var A=i(25065),p=i(87916),g=i(83731),v=i(12058),f=i(35500),m=i(16184),y=i(37115),C=i(23490),w=i(6056),I=i(47428),b=i(13496),B=i(53997),E=i(78952),S=i(32924),Q=i(77468),k=i(25740),T=i(90171),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function P(e,t){if(1&e&&(c.nrm(0,"bit-menu-divider"),c.j41(1,"span",16),c.EFF(2),c.k0s()),2&e){const e=c.XpG(2);c.R7$(2),c.SpI(" ",e.hostname," ")}}function R(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",14),c.bIt("click",function(){n.eBV(e);const t=c.XpG(2);return n.Njj(t.lock())}),c.nrm(1,"i",17),c.EFF(2),c.nI1(3,"i18n"),c.k0s()}2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,1,"lockNow")," "))}function D(e,t){if(1&e){const e=c.RV6();c.j41(0,"button",1),c.nrm(1,"dynamic-avatar",2),c.nI1(2,"userName"),c.k0s(),c.j41(3,"bit-menu",null,0)(5,"div",3)(6,"div",4),c.nrm(7,"dynamic-avatar",2),c.nI1(8,"userName"),c.j41(9,"div",5)(10,"span"),c.EFF(11),c.nI1(12,"i18n"),c.k0s(),c.j41(13,"small",6),c.EFF(14),c.nI1(15,"userName"),c.k0s()()(),c.nVh(16,P,3,1),c.nrm(17,"bit-menu-divider"),c.j41(18,"a",7),c.nrm(19,"i",8),c.EFF(20),c.nI1(21,"i18n"),c.k0s(),c.j41(22,"a",9),c.nrm(23,"i",10),c.EFF(24),c.nI1(25,"i18n"),c.k0s(),c.j41(26,"a",11),c.nrm(27,"i",12),c.EFF(28),c.nI1(29,"i18n"),c.k0s(),c.nrm(30,"bit-menu-divider"),c.nVh(31,R,4,3,"button",13),c.nI1(32,"async"),c.j41(33,"button",14),c.bIt("click",function(){n.eBV(e);const t=c.XpG();return n.Njj(t.logout())}),c.nrm(34,"i",15),c.EFF(35),c.nI1(36,"i18n"),c.k0s()()()}if(2&e){const e=c.sdS(4),t=c.XpG();c.Y8G("bitMenuTriggerFor",e),c.R7$(),c.Y8G("id",t.account().id)("text",c.bMT(2,13,t.account())),c.R7$(6),c.Y8G("id",t.account().id)("text",c.bMT(8,15,t.account())),c.R7$(4),c.JRh(c.bMT(12,17,"loggedInAs")),c.R7$(3),c.SpI(" ",c.bMT(15,19,t.account())," "),c.R7$(2),c.vxM(t.selfHosted?16:-1),c.R7$(4),c.SpI(" ",c.bMT(21,21,"accountSettings")," "),c.R7$(4),c.SpI(" ",c.bMT(25,23,"getHelp")," "),c.R7$(4),c.SpI(" ",c.bMT(29,25,"getApps")," "),c.R7$(3),c.vxM(c.bMT(32,27,t.canLock$)?31:-1),c.R7$(4),c.SpI(" ",c.bMT(36,29,"logOut")," ")}}class M{constructor(){this.platformUtilsService=(0,n.WQX)(y.y),this.vaultTimeoutSettingsService=(0,n.WQX)(m.ep),this.accountService=(0,n.WQX)(f.D),this.logoutService=(0,n.WQX)(v.k4),this.lockService=(0,n.WQX)(v.FQ),this.account=(0,g.ot)(this.accountService.activeAccount$),this.canLock$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$().pipe((0,o.T)(e=>e.includes(m.W4.Lock))),this.selfHosted=this.platformUtilsService.isSelfHost(),this.hostname=globalThis.location.hostname}lock(){return F(this,void 0,void 0,function*(){var e;const t=null===(e=this.account())||void 0===e?void 0:e.id;t&&(yield this.lockService.lock(t))})}logout(){return F(this,void 0,void 0,function*(){var e;const t=null===(e=this.account())||void 0===e?void 0:e.id;t&&(yield this.logoutService.logout(t))})}}M.ɵfac=function(e){return new(e||M)},M.ɵcmp=c.VBU({type:M,selectors:[["app-account-menu"]],decls:1,vars:1,consts:[["accountMenu",""],["type","button",1,"tw-border-0","tw-bg-transparent","tw-p-0","tw-shrink-0",3,"bitMenuTriggerFor"],[3,"id","text"],[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-muted"],[1,"tw-ml-2","tw-block","tw-overflow-hidden","tw-whitespace-nowrap"],[1,"tw-block","tw-overflow-hidden","tw-whitespace-nowrap"],["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"],["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&&c.nVh(0,D,37,31),2&e&&c.vxM(t.account()?0:-1)},dependencies:[A.G,w.Wk,I.x,b.Z,B.O,E.S,S.M,C.O,Q.Jj,k.$,T.b],encapsulation:2,changeDetection:0});var x=i(78867),O=i(36288),G=i(57178);const U=["menu"],V=e=>({"--num-products":e,"grid-template-columns":"repeat(min(var(--num-products,1),3),auto)"}),j=()=>({focusAfterNav:"body"});function N(e,t){if(1&e&&(c.j41(0,"a",7),c.nrm(1,"i"),c.j41(2,"span",8),c.EFF(3),c.k0s()()),2&e){const e=t.$implicit;c.Y8G("routerLink",e.appRoute)("ngClass",e.isActive?"tw-bg-primary-600 tw-font-medium !tw-text-contrast tw-ring-offset-2 hover:tw-bg-primary-600":"")("state",c.lJ4(7,j)),c.R7$(),c.HbH(c.VkB("bwi ",e.icon," tw-text-4xl !tw-m-0 !tw-mb-1")),c.R7$(2),c.JRh(e.name)}}function z(e,t){if(1&e&&(c.j41(0,"a",14),c.EFF(1),c.k0s()),2&e){const e=c.XpG().$implicit;c.Y8G("routerLink",e.marketingRoute.route)("startIcon",e.icon),c.R7$(),c.SpI(" ",e.name," ")}}function Y(e,t){if(1&e&&(c.j41(0,"a",15),c.EFF(1),c.k0s()),2&e){const e=c.XpG().$implicit;c.Y8G("href",e.marketingRoute.route,c.B4B)("startIcon",e.icon),c.R7$(),c.SpI(" ",e.name," ")}}function L(e,t){if(1&e&&(c.j41(0,"span"),c.DNE(1,z,2,3,"a",12)(2,Y,2,3,"a",13),c.k0s()),2&e){const e=t.$implicit;c.R7$(),c.Y8G("ngIf",!e.marketingRoute.external),c.R7$(),c.Y8G("ngIf",e.marketingRoute.external)}}function K(e,t){if(1&e&&(c.j41(0,"section",9)(1,"span",10),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.DNE(4,L,3,2,"span",11),c.k0s()),2&e){const e=c.XpG().ngIf;c.R7$(2),c.JRh(c.bMT(3,2,"moreFromBitwarden")),c.R7$(2),c.Y8G("ngForOf",e.other)}}function X(e,t){if(1&e&&(c.j41(0,"div",3)(1,"section",4),c.DNE(2,N,4,8,"a",5),c.k0s(),c.DNE(3,K,5,4,"section",6),c.k0s()),2&e){const e=t.ngIf;c.R7$(),c.Y8G("ngStyle",c.eq3(3,V,e.bento.length)),c.R7$(),c.Y8G("ngForOf",e.bento),c.R7$(),c.Y8G("ngIf",!1)}}class q{constructor(e){this.productSwitcherService=e,this.products$=this.productSwitcherService.products$}}function H(e,t){if(1&e&&(c.nrm(0,"button",2),c.nI1(1,"i18n")),2&e){const e=c.XpG(),t=c.sdS(3);c.Y8G("bitMenuTriggerFor",null==t?null:t.menu)("buttonType",e.buttonType)("label",c.bMT(1,3,"switchProducts"))}}q.ɵfac=function(e){return new(e||q)(c.rXU(x.Y))},q.ɵcmp=c.VBU({type:q,selectors:[["product-switcher-content"]],viewQuery:function(e,t){if(1&e&&c.GBs(U,5),2&e){let e;c.mGM(e=c.lsd())&&(t.menu=e.first)}},standalone:!1,decls:5,vars:6,consts:[["menu",""],["ariaRole","dialog",3,"ariaLabel"],["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/product-link 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","state",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-secondary-100 tw-p-2 tw-pb-0",4,"ngIf"],["ariaCurrentWhenActive","page",1,"tw-group/product-link","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","state"],[1,"tw-max-w-24","tw-text-center","tw-text-sm","tw-leading-snug","group-hover/product-link: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-secondary-100","tw-p-2","tw-pb-0"],[1,"tw-mb-1","tw-text-xs","tw-text-muted"],[4,"ngFor","ngForOf"],["bitLink","",3,"routerLink","startIcon",4,"ngIf"],["bitLink","","target","_blank","rel","noreferrer",3,"href","startIcon",4,"ngIf"],["bitLink","",3,"routerLink","startIcon"],["bitLink","","target","_blank","rel","noreferrer",3,"href","startIcon"]],template:function(e,t){1&e&&(c.j41(0,"bit-menu",1,0),c.nI1(2,"i18n"),c.DNE(3,X,4,5,"div",2),c.nI1(4,"async"),c.k0s()),2&e&&(c.Y8G("ariaLabel",c.bMT(2,2,"switchProducts")),c.R7$(3),c.Y8G("ngIf",c.bMT(4,4,t.products$)))},dependencies:[Q.YU,Q.Sq,Q.bT,Q.B3,w.Wk,G.g,b.Z,Q.Jj,k.$],encapsulation:2});class W{ngAfterViewInit(){this.changeDetector.detectChanges()}constructor(e,t){this.changeDetector=e,this.productSwitcherService=t,this.buttonType="secondary",this.products$=this.productSwitcherService.products$}}W.ɵfac=function(e){return new(e||W)(c.rXU(r.gRc),c.rXU(x.Y))},W.ɵcmp=c.VBU({type:W,selectors:[["product-switcher"]],inputs:{buttonType:"buttonType"},standalone:!1,decls:4,vars:3,consts:[["content",""],["type","button","bitIconButton","bwi-grid",3,"bitMenuTriggerFor","buttonType","label",4,"ngIf"],["type","button","bitIconButton","bwi-grid",3,"bitMenuTriggerFor","buttonType","label"]],template:function(e,t){1&e&&(c.DNE(0,H,2,5,"button",1),c.nI1(1,"async"),c.nrm(2,"product-switcher-content",null,0)),2&e&&c.Y8G("ngIf",c.bMT(1,1,t.products$))},dependencies:[Q.bT,O.s,B.O,q,Q.Jj,k.$],encapsulation:2});const $=[[["","slot","breadcrumbs"]],"*",[["","slot","title-suffix"]],[["","slot","secondary"]],[["","slot","tabs"]]];function J(e,t){if(1&e&&(c.j41(0,"bit-header",0),c.nI1(1,"i18n"),c.qex(2,1),c.SdG(3),c.bVm(),c.SdG(4,1),c.nrm(5,"product-switcher")(6,"app-account-menu"),c.qex(7,2),c.SdG(8,2),c.bVm(),c.qex(9,3),c.SdG(10,3),c.bVm(),c.qex(11,4),c.SdG(12,4),c.bVm(),c.k0s()),2&e){const e=c.XpG(),t=c.r8f(0);c.Y8G("title",e.title()||c.bMT(1,2,t.titleId))("icon",e.icon())}}class Z{constructor(){this.route=(0,n.WQX)(s.nX),this.title=(0,r.hFB)(),this.icon=(0,r.hFB)(),this.routeData$=this.route.data.pipe((0,o.T)(e=>({titleId:e.titleId})))}}Z.ɵfac=function(e){return new(e||Z)},Z.ɵcmp=c.VBU({type:Z,selectors:[["app-header"]],inputs:{title:[1,"title"],icon:[1,"icon"]},ngContentSelectors:["[slot=breadcrumbs]","*","[slot=title-suffix]","[slot=secondary]","[slot=tabs]"],decls:3,vars:4,consts:[[3,"title","icon"],["slot","breadcrumbs"],["slot","title-suffix"],["slot","secondary"],["slot","tabs"]],template:function(e,t){if(1&e&&(c.NAR($),c.SS7(0),c.nI1(1,"async"),c.nVh(2,J,13,4,"bit-header",0)),2&e){const e=c.bH3(c.bMT(1,1,t.routeData$));c.R7$(2),c.vxM(e?2:-1)}},dependencies:[A.G,p.V,W,a.H,h,M,Q.Jj,k.$],encapsulation:2,changeDetection:0})},49247(e,t,i){"use strict";i.d(t,{C:()=>n});class n{}},49272(e,t,i){"use strict";i.d(t,{f:()=>g,H:()=>n.H});var n=i(11009),r=i(52237),s=i(25607),o=i(1002),a=i(20702),l=i(67097);class c extends a.r{constructor(e){super(e);const t=this.getResponseProperty("MasterPasswordUnlock");null!=t&&"object"==typeof t&&(this.masterPasswordUnlock=new l.v(t));const i=this.getResponseProperty("WebAuthnPrfOptions");null!=i&&Array.isArray(i)&&(this.webAuthnPrfOptions=i.map(e=>new o.C(e)))}}var d=i(65791),u=i(16969),h=i(54306),A=i(42700),p=i(98850);class g extends a.r{constructor(e){super(e),this.folders=[],this.collections=[],this.ciphers=[],this.policies=[],this.sends=[];const t=this.getResponseProperty("Profile");null!=t&&(this.profile=new u.l(t));const i=this.getResponseProperty("Folders");null!=i&&(this.folders=i.map(e=>new p.s(e)));const n=this.getResponseProperty("Collections");null!=n&&(this.collections=n.map(e=>new r.yv(e)));const o=this.getResponseProperty("Ciphers");null!=o&&(this.ciphers=o.map(e=>new A.N(e)));const a=this.getResponseProperty("Domains");null!=a&&(this.domains=new d.X(a));const l=this.getResponseProperty("Policies");null!=l&&(this.policies=l.map(e=>new s.i(e)));const g=this.getResponseProperty("Sends");null!=g&&(this.sends=g.map(e=>new h.o(e)));const v=this.getResponseProperty("UserDecryption");null!=v&&"object"==typeof v&&(this.userDecryption=new c(v))}}},49355(e,t,i){"use strict";i.d(t,{k:()=>u});var n=i(77468),r=i(33812),s=i(94735),o=i(63457),a=i(83691),l=i(50700),c=i(38140),d=i(25740);class u{set password(e){this.updatePasswordStrength(e)}constructor(e,t){this.i18nService=e,this.passwordStrengthService=t,this.size="default",this.showText=!1,this.passwordStrengthScore=new r.bkB,this.passwordScoreTextWithColor=new r.bkB,this.scoreWidth=0,this.color="danger"}ngOnChanges(){this.passwordStrengthTimeout=setTimeout(()=>{switch(this.scoreWidth=null==this.passwordScore?0:20*(this.passwordScore+1),this.passwordScore){case 4:this.color="success",this.text=this.i18nService.t("strong");break;case 3:this.color="primary",this.text=this.i18nService.t("good");break;case 2:this.color="warning",this.text=this.i18nService.t("weak");break;default:this.color="danger",this.text=null!=this.passwordScore?this.i18nService.t("weak"):null}this.passwordScoreTextWithColor.emit({color:this.color,text:this.text})},300)}updatePasswordStrength(e){var t;null!=this.passwordStrengthTimeout&&clearTimeout(this.passwordStrengthTimeout);const i=this.passwordStrengthService.getPasswordStrength(e,this.email,null===(t=this.name)||void 0===t?void 0:t.trim().toLowerCase().split(" "));this.passwordScore=null==i?null:i.score,this.passwordStrengthScore.emit(this.passwordScore)}}u.ɵfac=function(e){return new(e||u)(r.rXU(l.W),r.rXU(o.Q))},u.ɵcmp=r.VBU({type:u,selectors:[["tools-password-strength"]],inputs:{size:"size",showText:"showText",email:"email",name:"name",password:"password"},outputs:{passwordStrengthScore:"passwordStrengthScore",passwordScoreTextWithColor:"passwordScoreTextWithColor"},features:[r.OA$],decls:4,vars:9,consts:[[3,"size","text","bgColor","showText","barWidth"],["aria-live","polite",1,"tw-sr-only"]],template:function(e,t){1&e&&(r.nrm(0,"bit-progress",0),r.j41(1,"div",1),r.EFF(2),r.nI1(3,"i18n"),r.k0s()),2&e&&(r.Y8G("size",t.size)("text",t.text)("bgColor",t.color)("showText",t.showText)("barWidth",t.scoreWidth),r.R7$(2),r.SpI(" ",r.i5U(3,6,"passwordStrengthScore",t.text),"\n"))},dependencies:[n.MD,s.p,a.E,c.X,d.$],encapsulation:2})},49492(e,t,i){"use strict";i.d(t,{H:()=>X,n:()=>q});var n=i(74208),r=i(33277),s=i(66046),o=i(72245),a=i(14803),l=i(3204),c=i(84488),d=i(3633),u=i(90118),h=i(15661),A=i(33812),p=i(35500),g=i(77468),v=i(6056),f=i(54471),m=i(37856),y=i(38411),C=i(10931),w=i(25740),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const b=e=>({active:e}),B=e=>({$implicit:e}),E=e=>({"disabled-organization":e}),S=(e,t)=>({"bwi-angle-right":e,"bwi-angle-down":t});function Q(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",11),A.nI1(1,"i18n"),A.nI1(2,"i18n"),A.bIt("click",function(){n.eBV(e);const t=A.XpG(3);return n.Njj(t.onFilterSelect(t.headerNode))}),A.j41(3,"h3",12),A.EFF(4),A.nI1(5,"i18n"),A.k0s()()}if(2&e){const e=A.XpG(3);A.Y8G("appA11yTitle",A.ai1("",A.bMT(1,5,e.isOrganizationFilter?"vault":"filter"),": ",A.bMT(2,7,e.headerNode.node.name))),A.R7$(3),A.Y8G("ngClass",A.eq3(11,b,e.isAllVaultsSelected||e.isNodeSelected(e.headerNode))),A.R7$(),A.SpI("  ",A.bMT(5,9,e.headerNode.node.name)," ")}}function k(e,t){if(1&e&&(A.j41(0,"h3",13),A.EFF(1),A.nI1(2,"i18n"),A.k0s()),2&e){const e=A.XpG(3);A.R7$(),A.SpI("  ",A.bMT(2,1,e.headerNode.node.name)," ")}}function T(e,t){if(1&e){const e=A.RV6();A.j41(0,"div",6)(1,"button",7),A.nI1(2,"i18n"),A.nI1(3,"i18n"),A.bIt("click",function(){n.eBV(e);const t=A.XpG(2);return n.Njj(t.toggleCollapse(t.headerNode.node))}),A.nrm(4,"i",8),A.k0s(),A.DNE(5,Q,6,13,"button",9)(6,k,3,3,"h3",10),A.k0s()}if(2&e){A.XpG();const e=A.sdS(2),t=A.XpG();A.Y8G("bitPopoverAnchorFor",t.isCollectionFilter?e.popover():null)("popoverOpen",!!t.isCollectionFilter&&t.collectionsCoachmarkOpen())("spotlight",t.isCollectionFilter)("spotlightPadding",5)("position",t.coachmarkService.getStepPosition("shareWithCollections"))("closeOnBackdropClick",!1),A.R7$(),A.Y8G("appA11yTitle",A.ai1("",A.bMT(2,13,"toggleCollapse"),": ",A.bMT(3,15,t.headerNode.node.name))),A.BMQ("aria-expanded",!t.isCollapsed(t.headerNode.node)),A.R7$(3),A.Y8G("ngClass",t.isCollapsed(t.headerNode.node)?"bwi-angle-right":"bwi-angle-down"),A.R7$(),A.Y8G("ngIf",t.headerInfo.isSelectable),A.R7$(),A.Y8G("ngIf",!t.headerInfo.isSelectable)}}function F(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",27),A.nI1(1,"i18n"),A.bIt("click",function(){n.eBV(e);const t=A.XpG().$implicit,i=A.XpG(4);return n.Njj(i.toggleCollapse(t.node))}),A.nrm(2,"i",8),A.k0s()}if(2&e){const e=A.XpG().$implicit,t=A.XpG(4);A.Y8G("appA11yTitle",A.ai1("",A.bMT(1,6,"toggleCollapse"),": ",e.node.name)),A.BMQ("aria-expanded",!t.isCollapsed(e.node))("aria-controls",e.node.name+"_children"),A.R7$(2),A.Y8G("ngClass",A.l_i(8,S,t.isCollapsed(e.node),!t.isCollapsed(e.node)))}}function P(e,t){if(1&e&&A.nrm(0,"i",28),2&e){const e=A.XpG().$implicit;A.HbH(A.VkB("bwi bwi-fw ",e.node.icon))}}function R(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",29),A.nI1(1,"i18n"),A.bIt("click",function(){n.eBV(e);const t=A.XpG().$implicit,i=A.XpG(4);return n.Njj(i.onEdit(t))}),A.nrm(2,"i",30),A.k0s()}if(2&e){const e=A.XpG().$implicit,t=A.XpG(4);A.Y8G("appA11yTitle",A.mNQ(A.brH(1,2,"editWithName",t.editInfo.filterName,e.node.name)))}}function D(e,t){1&e&&(A.nrm(0,"i",31),A.nI1(1,"i18n"),A.nI1(2,"i18n")),2&e&&(A.Y8G("appA11yTitle",A.mNQ(A.bMT(1,3,"organizationIsDisabled"))),A.BMQ("aria-label",A.bMT(2,5,"organizationIsDisabled")))}function M(e,t){1&e&&A.eu8(0)}function x(e,t){if(1&e&&(A.qex(0),A.DNE(1,M,1,0,"ng-container",32),A.bVm()),2&e){const e=A.XpG().$implicit,t=A.XpG(4);A.R7$(),A.Y8G("ngComponentOutlet",t.optionsInfo.component)("ngComponentOutletInjector",t.createInjector(e.node))}}function O(e,t){1&e&&(A.qex(0),A.nrm(1,"app-premium-badge"),A.bVm())}function G(e,t){1&e&&A.eu8(0)}function U(e,t){if(1&e&&(A.j41(0,"ul",33),A.DNE(1,G,1,0,"ng-container",15),A.k0s()),2&e){const e=A.XpG().$implicit;A.XpG(2);const t=A.sdS(2);A.Y8G("id",e.node.name+"_children"),A.R7$(),A.Y8G("ngTemplateOutlet",t)("ngTemplateOutletContext",A.eq3(3,B,e.children))}}function V(e,t){if(1&e){const e=A.RV6();A.j41(0,"li",18)(1,"span",19),A.DNE(2,F,3,11,"button",20),A.j41(3,"button",21),A.nI1(4,"i18n"),A.bIt("click",function(){const t=n.eBV(e).$implicit,i=A.XpG(4);return n.Njj(i.onFilterSelect(t))}),A.DNE(5,P,1,3,"i",22),A.EFF(6),A.k0s(),A.j41(7,"span",23),A.DNE(8,R,3,6,"button",24)(9,D,3,7,"i",25)(10,x,2,2,"ng-container",2)(11,O,2,0,"ng-container",2),A.k0s()(),A.DNE(12,U,2,5,"ul",26),A.k0s()}if(2&e){const e=t.$implicit,i=A.XpG(4);A.Y8G("ngClass",A.eq3(15,b,i.isNodeSelected(e))),A.R7$(2),A.Y8G("ngIf",e.children.length),A.R7$(),A.Y8G("appA11yTitle",A.ai1("",i.isOrganizationFilter?"vault":A.bMT(4,13,"filter"),": ",e.node.name))("ngClass",A.eq3(17,E,i.isOrganizationFilter&&!e.node.enabled)),A.R7$(2),A.Y8G("ngIf",0===e.children.length),A.R7$(),A.SpI("  ",e.node.name," "),A.R7$(2),A.Y8G("ngIf",i.editInfo&&e.node.id),A.R7$(),A.Y8G("ngIf",i.isOrganizationFilter&&!e.node.enabled),A.R7$(),A.Y8G("ngIf",i.optionsInfo&&!e.node.hideOptions),A.R7$(),A.Y8G("ngIf",i.premiumFeature),A.R7$(),A.Y8G("ngIf",e.children.length&&!i.isCollapsed(e.node))}}function j(e,t){if(1&e&&A.DNE(0,V,13,19,"li",17),2&e){const e=t.$implicit;A.Y8G("ngForOf",e)}}function N(e,t){1&e&&A.eu8(0)}function z(e,t){if(1&e&&(A.j41(0,"li",34)(1,"span",19)(2,"a",35),A.nrm(3,"i",36),A.EFF(4),A.nI1(5,"i18n"),A.k0s()()()),2&e){const e=A.XpG(3);A.R7$(2),A.Y8G("routerLink",A.mNQ(e.addInfo.route)),A.R7$(2),A.SpI("  ",A.bMT(5,3,e.addInfo.text)," ")}}function Y(e,t){if(1&e&&(A.j41(0,"ul",14),A.DNE(1,j,1,1,"ng-template",null,1,A.C5r)(3,N,1,0,"ng-container",15)(4,z,6,5,"li",16),A.k0s()),2&e){const e=A.sdS(2),t=A.XpG(2);A.Y8G("id",A.VkB("",t.headerNode.node.name,"-filters")),A.R7$(3),A.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",A.eq3(5,B,t.filters)),A.R7$(),A.Y8G("ngIf",t.showAddLink)}}function L(e,t){1&e&&A.nrm(0,"hr")}function K(e,t){if(1&e&&(A.qex(0),A.nrm(1,"app-coachmark",3,0),A.DNE(3,T,7,17,"div",4)(4,Y,5,7,"ul",5)(5,L,1,0,"hr",2),A.bVm()),2&e){const e=A.XpG();A.R7$(3),A.Y8G("ngIf",e.headerInfo.showHeader),A.R7$(),A.Y8G("ngIf",!e.isCollapsed(e.headerNode.node)),A.R7$(),A.Y8G("ngIf",e.divider)}}class X{constructor(e,t,i){this.vaultFilterService=e,this.injector=t,this.accountService=i,this.destroy$=new s.B,this.activeUserId$=(0,d.F6)(this.accountService.activeAccount$),this.isCollectionFilter=!1,this.coachmarkService=(0,n.WQX)(h.Tu),this.collectionsCoachmarkOpen=(0,r.EW)(()=>"shareWithCollections"===this.coachmarkService.activeStepId()),this.collapsedFilterNodes=new Set,this.injectors=new Map,this.vaultFilterService.collapsedFilterNodes$.pipe((0,a.Q)(this.destroy$)).subscribe(e=>{this.collapsedFilterNodes=e})}ngOnInit(){return I(this,void 0,void 0,function*(){var e,t;null===(t=null===(e=this.section)||void 0===e?void 0:e.data$)||void 0===t||t.pipe((0,a.Q)(this.destroy$)).subscribe(e=>{this.data=e})})}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 c.y}get isAllVaultsSelected(){return this.isOrganizationFilter&&!this.activeFilter.selectedOrganizationNode}isNodeSelected(e){const{organizationId:t,cipherTypeId:i,folderId:n,collectionId:r,isCollectionSelected:s}=this.activeFilter,o="AllCollections"===(null==e?void 0:e.node.id)&&(s||"AllCollections"===r);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)||o}onFilterSelect(e){return I(this,void 0,void 0,function*(){var t,i,n;(null===(i=null===(t=this.section)||void 0===t?void 0:t.premiumOptions)||void 0===i?void 0:i.blockFilterAction)?yield this.section.premiumOptions.blockFilterAction():yield null===(n=this.section)||void 0===n?void 0:n.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(){return I(this,void 0,void 0,function*(){var e,t;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 premiumFeature(){var e,t;return null===(t=null===(e=this.section)||void 0===e?void 0:e.premiumOptions)||void 0===t?void 0:t.showBadgeForNonPremium}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 I(this,void 0,void 0,function*(){this.collapsedFilterNodes.has(e.id)?this.collapsedFilterNodes.delete(e.id):this.collapsedFilterNodes.add(e.id);const t=yield(0,o._)(this.activeUserId$);yield this.vaultFilterService.setCollapsedFilterNodes(this.collapsedFilterNodes,t)})}createInjector(e){let t=this.injectors.get(e.id);if(!t){const i=this.section.data$.pipe((0,l.T)(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.zZn.create({providers:[{provide:q,useValue:i}],parent:this.injector}),this.injectors.set(e.id,t)}return t}}X.ɵfac=function(e){return new(e||X)(A.rXU(u.cD),A.rXU(n.zZn),A.rXU(p.D))},X.ɵcmp=A.VBU({type:X,selectors:[["app-filter-section"]],inputs:{activeFilter:"activeFilter",section:"section",isCollectionFilter:"isCollectionFilter"},standalone:!1,decls:1,vars:1,consts:[["collectionsCoachmark",""],["recursiveFilters",""],[4,"ngIf"],["stepId","shareWithCollections"],["class","filter-heading",3,"bitPopoverAnchorFor","popoverOpen","spotlight","spotlightPadding","position","closeOnBackdropClick",4,"ngIf"],["class","filter-options",3,"id",4,"ngIf"],[1,"filter-heading",3,"bitPopoverAnchorFor","popoverOpen","spotlight","spotlightPadding","position","closeOnBackdropClick"],["type","button","aria-controls","sub-filters",1,"toggle-button",3,"click","appA11yTitle"],["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,"click","appA11yTitle"],[3,"ngClass"],[1,"filter-title"],[1,"filter-options",3,"id"],[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,"click","appA11yTitle","ngClass"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"tw-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,"click","appA11yTitle"],["aria-hidden","true"],["type","button",1,"edit-button",3,"click","appA11yTitle"],["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","tw-truncate",3,"routerLink"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"]],template:function(e,t){1&e&&A.DNE(0,K,6,3,"ng-container",2),2&e&&A.Y8G("ngIf",t.filters&&t.filters.length)},dependencies:[g.YU,g.OI,g.Sq,g.bT,g.T3,v.Wk,f.C,m.a,y.d,C.n,w.$],encapsulation:2});const q=new n.nKC("OptionsInput")},49519(e,t,i){"use strict";i.d(t,{B:()=>c,U:()=>l});var n=i(94573),r=i(58363),s=i(78781),o=i(33812),a=i(70171);function l(e){return e.querySelectorAll("[appAutofocus], [bitAutofocus]")}class c{constructor(e,t,i){this.el=e,this.ngZone=t,this.focusableElement=i,this.appAutofocus=(0,n.hFB)(void 0,{transform:n.L39}),this.focused=!1}ngAfterContentChecked(){if(this.focused||!this.appAutofocus()||s.A.isMobileBrowser)return;null!=this.getElement()&&(this.ngZone.isStable?this.focus():this.ngZone.onStable.pipe((0,r.s)(1)).subscribe(this.focus.bind(this)))}focus(){const e=this.getElement();e&&(e.focus(),this.focused=e===document.activeElement)}getElement(){return this.focusableElement?this.focusableElement.getFocusTarget():this.el.nativeElement}}c.ɵfac=function(e){return new(e||c)(o.rXU(o.aKT),o.rXU(o.SKi),o.rXU(a.H,8))},c.ɵdir=o.FsC({type:c,selectors:[["","appAutofocus",""],["","bitAutofocus",""]],inputs:{appAutofocus:[1,"appAutofocus"]}})},49608(e,t,i){"use strict";i.d(t,{j:()=>l});var n=i(37831),r=i(94573),s=i(33812);class o{constructor(e){this.templateRef=e}}o.ɵfac=function(e){return new(e||o)(s.rXU(s.C4Q))},o.ɵdir=s.FsC({type:o,selectors:[["","bitTabLabel",""]]});function a(e,t){1&e&&s.SdG(0)}class l{get content(){return this._contentPortal}constructor(e){this._viewContainerRef=e,this.disabled=(0,r.hFB)(!1),this.textLabel=(0,r.hFB)("",{alias:"label"}),this.contentTabIndex=(0,r.hFB)(),this.implicitContent=r.ebz.required(s.C4Q),this._contentPortal=null}ngOnInit(){this._contentPortal=new n.VA(this.implicitContent(),this._viewContainerRef)}}l.ɵfac=function(e){return new(e||l)(s.rXU(s.c1b))},l.ɵcmp=s.VBU({type:l,selectors:[["bit-tab"]],contentQueries:function(e,t,i){if(1&e&&s.wni(i,o,5),2&e){let e;s.mGM(e=s.lsd())&&(t.templateLabel=e.first)}},viewQuery:function(e,t){1&e&&s.wEZ(t.implicitContent,s.C4Q,5),2&e&&s.NyB()},hostAttrs:["role","tabpanel"],inputs:{disabled:[1,"disabled"],textLabel:[1,"label","textLabel"],contentTabIndex:[1,"contentTabIndex"]},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(s.NAR(),s.PeT(0,a,1,0,"ng-template"))},encapsulation:2})},49701(){},50342(e,t,i){"use strict";i.d(t,{V:()=>B});var n=i(51757),r=i(48003),s=i(81525),o=i(25065),a=i(33812),l=i(62166),c=i(77468),d=i(26657),u=i(38620),h=i(56898),A=i(44432),p=i(7730),g=i(68016),v=i(67311),f=i(58806),m=i(25740),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function C(e,t){1&e&&a.nrm(0,"app-user-verification-form-input",10)}function w(e,t){if(1&e&&(a.j41(0,"bit-callout",11),a.EFF(1),a.nI1(2,"i18n"),a.k0s()),2&e){const e=a.XpG();a.R7$(),a.JRh(a.bMT(2,1,e.data.apiKeyWarning))}}function I(e,t){if(1&e&&(a.j41(0,"bit-callout",12),a.nI1(1,"i18n"),a.j41(2,"p",13)(3,"strong"),a.EFF(4,"client_id:"),a.k0s(),a.nrm(5,"br"),a.j41(6,"code"),a.EFF(7),a.k0s()(),a.j41(8,"p",13)(9,"strong"),a.EFF(10,"client_secret:"),a.k0s(),a.nrm(11,"br"),a.j41(12,"code"),a.EFF(13),a.k0s()(),a.j41(14,"p",13)(15,"strong"),a.EFF(16,"scope:"),a.k0s(),a.nrm(17,"br"),a.j41(18,"code"),a.EFF(19),a.k0s()(),a.j41(20,"p",14)(21,"strong"),a.EFF(22,"grant_type:"),a.k0s(),a.nrm(23,"br"),a.j41(24,"code"),a.EFF(25),a.k0s()()()),2&e){const e=a.XpG();a.Y8G("title",a.mNQ(a.bMT(1,6,"oauth2ClientCredentials"))),a.R7$(7),a.JRh(e.clientId),a.R7$(6),a.JRh(e.clientSecret),a.R7$(6),a.JRh(e.data.scope),a.R7$(6),a.JRh(e.data.grantType)}}function b(e,t){if(1&e&&(a.j41(0,"button",15)(1,"span"),a.EFF(2),a.nI1(3,"i18n"),a.k0s()()),2&e){const e=a.XpG();a.R7$(2),a.JRh(a.bMT(3,1,e.data.isRotation?"rotateApiKey":"viewApiKey"))}}class B{constructor(e,t,i){this.data=e,this.formBuilder=t,this.userVerificationService=i,this.formGroup=this.formBuilder.group({masterPassword:[null,[n.k0.required]]}),this.submit=()=>y(this,void 0,void 0,function*(){if(this.formGroup.invalid)return void this.formGroup.markAllAsTouched();const e=yield this.userVerificationService.buildRequest(this.formGroup.value.masterPassword).then(e=>this.data.postKey(this.data.entityId,e));this.clientSecret=e.apiKey,this.clientId=`${this.data.keyType}.${this.data.entityId}`})}}B.open=(e,t)=>e.open(B,t),B.ɵfac=function(e){return new(e||B)(a.rXU(s.Qs),a.rXU(n.ok),a.rXU(l.i))},B.ɵcmp=a.VBU({type:B,selectors:[["ng-component"]],decls:17,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["formControlName","masterPassword",4,"ngIf"],["type","warning",4,"ngIf"],["type","info","icon","bwi-key",3,"title",4,"ngIf"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton","",4,"ngIf"],["type","button","bitButton","","bitFormButton","","bitDialogClose",""],["formControlName","masterPassword"],["type","warning"],["type","info","icon","bwi-key",3,"title"],["bitTypography","body1",1,"tw-mb-1"],["bitTypography","body1",1,"tw-mb-0"],["type","submit","buttonType","primary","bitButton","","bitFormButton",""]],template:function(e,t){1&e&&(a.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),a.EFF(3),a.nI1(4,"i18n"),a.k0s(),a.j41(5,"div",2)(6,"p",3),a.EFF(7),a.nI1(8,"i18n"),a.k0s(),a.DNE(9,C,1,0,"app-user-verification-form-input",4)(10,w,3,3,"bit-callout",5)(11,I,26,8,"bit-callout",6),a.k0s(),a.qex(12,7),a.DNE(13,b,4,3,"button",8),a.j41(14,"button",9),a.EFF(15),a.nI1(16,"i18n"),a.k0s(),a.bVm(),a.k0s()()),2&e&&(a.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),a.R7$(3),a.JRh(a.bMT(4,9,t.data.apiKeyTitle)),a.R7$(4),a.JRh(a.bMT(8,11,t.data.apiKeyDescription)),a.R7$(2),a.Y8G("ngIf",!t.clientSecret),a.R7$(),a.Y8G("ngIf",t.clientSecret),a.R7$(),a.Y8G("ngIf",t.clientSecret),a.R7$(2),a.Y8G("ngIf",!t.clientSecret),a.R7$(2),a.SpI(" ",a.bMT(16,13,"close")," "))},dependencies:[o.G,c.bT,n.qT,n.BC,n.cb,n.j4,n.JD,d.$,u.L,h.Q,A.G,p.I,g.m,v.hJ,f.r,r.wV,m.$],encapsulation:2})},50352(e,t,i){"use strict";i.d(t,{P:()=>a});var n=i(94573),r=i(51757),s=i(15033),o=i(33812);class a{constructor(e){this.ngControl=e,this.inputClasses=["tw-appearance-none","tw-outline-none","tw-box-border","tw-relative","tw-transition","tw-cursor-pointer","disabled:tw-cursor-default","tw-inline-block","tw-align-sub","tw-flex-none","!tw-p-1","tw-h-[calc(1.12rem_+_theme(spacing.2))]","tw-w-[calc(1.12rem_+_theme(spacing.2))]","after:tw-inset-1","!-tw-mt-1","!-tw-mb-1","!-tw-ms-1","before:tw-content-['']","before:tw-block","before:tw-inset-0","before:tw-h-[1.12rem]","before:tw-w-[1.12rem]","before:tw-rounded","before:tw-border","before:tw-border-solid","before:tw-border-secondary-500","before:tw-box-border","after:tw-content-['']","after:tw-block","after:tw-absolute","after:tw-inset-0","after:tw-h-[1.12rem]","after:tw-w-[1.12rem]","after:tw-box-border","hover:before:tw-border-2","[&>label]:before:tw-border-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-offset-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-primary-600","disabled:before:tw-cursor-default","disabled:before:tw-border","disabled:before:hover:tw-border","disabled:before:tw-bg-secondary-100","disabled:hover:before:tw-bg-secondary-100","checked:before:tw-bg-primary-600","checked:before:tw-border-primary-600","checked:before:hover:tw-bg-primary-700","checked:before:hover:tw-border-primary-700","[&>label:hover]:checked:before:tw-bg-primary-700","[&>label:hover]:checked:before:tw-border-primary-700","checked:after:tw-bg-text-contrast","checked:after:tw-mask-position-[center]","checked:after:tw-mask-repeat-[no-repeat]","checked:disabled:before:tw-border-secondary-100","checked:disabled:hover:before:tw-border-secondary-100","checked:disabled:before:tw-bg-secondary-100","checked:disabled:after:tw-bg-text-muted","[&:not(:indeterminate)]:checked:after:tw-mask-image-[var(--mask-image)]","indeterminate:after:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:before:tw-bg-primary-600","indeterminate:before:tw-border-primary-600","indeterminate:hover:before:tw-bg-primary-700","indeterminate:hover:before:tw-border-primary-700","[&>label:hover]:indeterminate:before:tw-bg-primary-700","[&>label:hover]:indeterminate:before:tw-border-primary-700","indeterminate:after:tw-bg-text-contrast","indeterminate:after:tw-mask-position-[center]","indeterminate:after:tw-mask-repeat-[no-repeat]","indeterminate:after:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:disabled:tw-border-secondary-100","indeterminate:disabled:tw-bg-secondary-100","indeterminate:disabled:after: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="10" height="10" 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="14" height="14" fill="none" viewBox="0 0 13 13"%3E%3Cpath stroke="%23fff" stroke-width="2" d="M2.5 6.5h8"/%3E%3C/svg%3E%0A\')',this.disabledInput=(0,n.hFB)(!1,{transform:n.L39,alias:"disabled"})}get disabled(){var e;return this.disabledInput()||(null===(e=this.ngControl)||void 0===e?void 0:e.disabled)||!1}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(r.k0.requiredTrue))&&void 0!==i&&i}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=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}a.ɵfac=function(e){return new(e||a)(o.rXU(r.vO,10))},a.ɵcmp=o.VBU({type:a,selectors:[["input","type","checkbox","bitCheckbox",""]],hostVars:7,hostBindings:function(e,t){2&e&&(o.Avn("disabled",t.disabled),o.HbH(t.inputClasses),o.xc7("--mask-image",t.maskImage)("--indeterminate-mask-image",t.indeterminateImage))},inputs:{disabledInput:[1,"disabled","disabledInput"]},features:[o.Jv_([{provide:s.J,useExisting:a}])],attrs:["type","checkbox","bitCheckbox",""],decls:0,vars:0,template:function(e,t){},encapsulation:2})},50451(e,t,i){"use strict";i.d(t,{A:()=>p});var n=i(36501),r=i(7919),s=i(42234),o=i(59281),a=i(9184),l=i(91304),c=i(82696),d=i(22203),u=i(11314),h=i(27280),A=i(96540);class p{constructor(e,t){if(this.id="",this.edit=!1,this.viewPassword=!0,this.organizationUseTotp=!1,this.favorite=!1,this.type=r.gC.Login,this.name="",this.reprompt=n.b.None,null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.edit=e.edit,this.viewPassword=e.viewPassword,this.permissions=e.permissions,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.archivedDate=e.archivedDate,this.reprompt=e.reprompt,this.key=e.key,this.type){case r.gC.Login:this.login=new d.k(e.login);break;case r.gC.SecureNote:this.secureNote=new h.e(e.secureNote);break;case r.gC.Card:this.card=new a.b(e.card);break;case r.gC.Identity:this.identity=new c.j(e.identity);break;case r.gC.SshKey:this.sshKey=new A.E(e.sshKey)}null!=e.fields&&(this.fields=e.fields.map(e=>new l.N(e))),null!=e.attachments&&(this.attachments=e.attachments.map(e=>new o.e(e))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new u.k(e)))}else this.creationDate=this.revisionDate=(new Date).toISOString()}static fromJSON(e){const t=Object.assign(new p,e);return null!=e.permissions&&(t.permissions=s.a.fromJSON(e.permissions)),t}}},50545(e,t,i){"use strict";i.d(t,{I:()=>n});class n{constructor(e,t,i,n){this.id=e,this.readOnly=t,this.hidePasswords=i,this.manage=n}}},50700(e,t,i){"use strict";i.d(t,{W:()=>r});class n{}class r extends n{}},50751(e,t,i){"use strict";i.d(t,{_:()=>a});var n=i(39306),r=i(17989),s=i(11314),o=i(12022);class a extends r.A{constructor(e){super(),null!=e&&(this.password=new n.k(e.password),this.lastUsedDate=new Date(e.lastUsedDate))}decrypt(e){return this.decryptObj(this,new o.j(this),["password"],e,"DomainType: PasswordHistory")}toPasswordHistoryData(){const e=new s.k;return e.lastUsedDate=this.lastUsedDate.toISOString(),this.buildDataModel(this,e,{password:null}),e}static fromJSON(e){if(null==e)return;const t=new a;return t.password=n.k.fromJSON(e.password),t.lastUsedDate=new Date(e.lastUsedDate),t}toSdkPasswordHistory(){return{password:this.password.toSdk(),lastUsedDate:this.lastUsedDate.toISOString()}}static fromSdkPasswordHistory(e){if(!e)return;const t=new a;return t.password=n.k.fromJSON(e.password),t.lastUsedDate=new Date(e.lastUsedDate),t}}},50790(e,t,i){"use strict";i.d(t,{I:()=>a});var n=i(90118),r=i(74208),s=i(66316),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a{constructor(e){this.dialogService=e}viewPasswordHistory(e){return o(this,void 0,void 0,function*(){(0,n.IN)(this.dialogService,{data:{cipher:e}})})}}a.ɵfac=function(e){return new(e||a)(r.KVO(s.o3))},a.ɵprov=r.jDH({token:a,factory:a.ɵfac})},50866(e,t,i){"use strict";i.d(t,{R6:()=>a});var n=i(51757),r=i(62963),s=i(33812),o=i(74208);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=s.$C({type:a}),a.ɵinj=o.G2t({imports:[r.G,n.YN,n.X1]});var l=i(7855),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d{constructor(e,t,i,n,r,s,o){this.modalRef=e,this.config=t,this.userVerificationService=i,this.formBuilder=n,this.platformUtilsService=r,this.i18nService=s,this.toastService=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.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:e.message})}this.close(!0)}})}get secret(){return this.formGroup.controls.secret}close(e){this.modalRef.close(e)}}d.ɵfac=function(e){s.QTQ()},d.ɵdir=s.FsC({type:d});var u=i(81525),h=i(66316),A=i(69855),p=i(62166),g=i(37115),v=i(50700),f=i(26657),m=i(38620),y=i(56898),C=i(7730),w=i(68016),I=i(67311),b=i(58806),B=i(25740);class E extends d{constructor(e,t,i,n,r,s,o){super(null,e,i,n,r,s,o),this.dialogRef=t}close(e){this.dialogRef.close(e)}}E.ɵfac=function(e){return new(e||E)(s.rXU(u.Qs),s.rXU(h.ce),s.rXU(p.i),s.rXU(n.ok),s.rXU(g.y),s.rXU(v.W),s.rXU(A.f))},E.ɵcmp=s.VBU({type:E,selectors:[["ng-component"]],standalone:!1,features:[s.Vt3],decls:17,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.qex(5,2),s.j41(6,"p",3),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"app-user-verification",4),s.mxI("invalidSecretChange",function(e){return s.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),s.k0s(),s.bVm(),s.qex(10,5),s.j41(11,"button",6),s.EFF(12),s.nI1(13,"i18n"),s.k0s(),s.j41(14,"button",7),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.bVm(),s.k0s()()),2&e&&(s.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),s.R7$(3),s.JRh(s.bMT(4,7,t.modalTitle)),s.R7$(4),s.JRh(s.bMT(8,9,t.confirmDescription)),s.R7$(2),s.R50("invalidSecret",t.invalidSecret),s.R7$(3),s.SpI(" ",s.bMT(13,11,t.confirmButtonText)," "),s.R7$(3),s.SpI(" ",s.bMT(16,13,"cancel")," "))},dependencies:[n.qT,n.BC,n.cb,n.j4,n.JD,f.$,m.L,y.Q,C.I,w.m,I.hJ,b.r,l.q,B.$],encapsulation:2})},51111(e,t,i){"use strict";i.d(t,{x:()=>n});const n=i(82392).JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 120 40">
    <g clip-path="url(#two-factor-auth-duo-clip)">
        <path fill="#7BCD54" d="M19.359 39.412H0V20.97h38.694c-.505 10.27-8.968 18.44-19.335 18.44Z" />
        <path fill="#63C43F"
            d="M19.359.588H0V19.03h38.694C38.188 8.76 29.726.59 19.358.59ZM100.666.588c-10.367 0-18.83 8.172-19.335 18.441H120C119.496 8.76 111.033.59 100.666.59Z" />
        <path fill="#7BCD54"
            d="M100.666 39.412c-10.367 0-18.83-8.171-19.335-18.441H120c-.504 10.27-8.967 18.44-19.334 18.44Z" />
        <path fill="#63C43F" d="M40.653.588V20c0 10.395 8.15 18.882 18.391 19.388V.588h-18.39Z" />
        <path fill="#7BCD54" d="M79.37 39.412H60.98V.588h18.39v38.824Z" />
    </g>
    <defs>
        <clipPath id="two-factor-auth-duo-clip">
            <path class="tw-fill-text-alt2" d="M0 .588h120v38.824H0z" />
        </clipPath>
    </defs>
</svg>
`},51151(e,t,i){"use strict";i.d(t,{sK:()=>r.s,bq:()=>n,mz:()=>s,kG:()=>o,_n:()=>l,Oc:()=>c});var n,r=i(2738);!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",e[e.DuckDuckGoBrowser=26]="DuckDuckGoBrowser"}(n||(n={}));const s={[n.Android]:{category:"mobile",platform:"Android"},[n.iOS]:{category:"mobile",platform:"iOS"},[n.AndroidAmazon]:{category:"mobile",platform:"Amazon"},[n.ChromeExtension]:{category:"extension",platform:"Chrome"},[n.FirefoxExtension]:{category:"extension",platform:"Firefox"},[n.OperaExtension]:{category:"extension",platform:"Opera"},[n.EdgeExtension]:{category:"extension",platform:"Edge"},[n.VivaldiExtension]:{category:"extension",platform:"Vivaldi"},[n.SafariExtension]:{category:"extension",platform:"Safari"},[n.ChromeBrowser]:{category:"webApp",platform:"Chrome"},[n.FirefoxBrowser]:{category:"webApp",platform:"Firefox"},[n.OperaBrowser]:{category:"webApp",platform:"Opera"},[n.EdgeBrowser]:{category:"webApp",platform:"Edge"},[n.IEBrowser]:{category:"webApp",platform:"IE"},[n.SafariBrowser]:{category:"webApp",platform:"Safari"},[n.VivaldiBrowser]:{category:"webApp",platform:"Vivaldi"},[n.DuckDuckGoBrowser]:{category:"webApp",platform:"DuckDuckGo"},[n.UnknownBrowser]:{category:"webApp",platform:"Unknown"},[n.WindowsDesktop]:{category:"desktop",platform:"Windows"},[n.MacOsDesktop]:{category:"desktop",platform:"macOS"},[n.LinuxDesktop]:{category:"desktop",platform:"Linux"},[n.UWP]:{category:"desktop",platform:"Windows UWP"},[n.WindowsCLI]:{category:"cli",platform:"Windows"},[n.MacOsCLI]:{category:"cli",platform:"macOS"},[n.LinuxCLI]:{category:"cli",platform:"Linux"},[n.SDK]:{category:"sdk",platform:""},[n.Server]:{category:"server",platform:""}};var o;!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"}(o||(o={}));Object.freeze({Integration:"integration",SDK:"sdk",SSO:"sso",SCIM:"scim",BWDC:"bwdc",EVENT:"event",DEVICE:"device"});var a,l;!function(e){e[e.One=1]="One",e[e.Latest=1]="Latest"}(a||(a={})),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",e[e.SyncOrganizationStatusChanged=18]="SyncOrganizationStatusChanged",e[e.SyncOrganizationCollectionSettingChanged=19]="SyncOrganizationCollectionSettingChanged",e[e.Notification=20]="Notification",e[e.NotificationStatus=21]="NotificationStatus",e[e.RefreshSecurityTasks=22]="RefreshSecurityTasks",e[e.OrganizationBankAccountVerified=23]="OrganizationBankAccountVerified",e[e.ProviderBankAccountVerified=24]="ProviderBankAccountVerified",e[e.SyncPolicy=25]="SyncPolicy",e[e.AutoConfirmMember=26]="AutoConfirmMember"}(l||(l={}));const c=Object.freeze({KdfChange:0})},51886(e,t,i){"use strict";i.d(t,{R:()=>n});class n{static fromJSON(e){return Object.assign(new n,e)}}},51971(e,t,i){"use strict";i.d(t,{H:()=>A});var n=i(23649),r=i(72245),s=i(69194),o=i(78781),a=i(31857),l=i(74208),c=i(23197),d=i(50700),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const h=new a.Zs(a.Sc,"deepLinkRedirectUrl",{deserializer:e=>e});class A{constructor(e,t,i,r,o){this.router=e,this.activatedRoute=t,this.titleService=i,this.stateProvider=r,this.previousUrl=void 0,this.currentUrl=void 0,this.deepLinkRedirectUrlState=this.stateProvider.getGlobal(h),this.currentUrl=this.router.url,e.events.pipe((0,s.p)(e=>e instanceof n.wF)).subscribe(e=>{var t,i,n,r,s,a;this.currentUrl=e.url;let l="Vaultwarden Web";this.currentUrl.includes("/sm/")&&(l=o.t("bitSecretsManager"));let c=this.activatedRoute.firstChild;for(;c.firstChild;)c=c.firstChild;const d=null===(i=null===(t=null==c?void 0:c.snapshot)||void 0===t?void 0:t.data)||void 0===i?void 0:i.titleId,u=null===(r=null===(n=null==c?void 0:c.snapshot)||void 0===n?void 0:n.data)||void 0===r?void 0:r.title,h=!(null===(a=null===(s=null==c?void 0:c.snapshot)||void 0===s?void 0:s.data)||void 0===a?void 0:a.doNotSaveUrl);if(null!=d||null!=u){const e=null!=u?u:o.t(d);null!=e&&""!==e&&(l=e+" | "+l)}this.titleService.setTitle(l),h&&this.setPreviousUrl(this.currentUrl)})}getPreviousUrl(){return this.previousUrl}setPreviousUrl(e){this.previousUrl=e}persistLoginRedirectUrl(e){return u(this,void 0,void 0,function*(){yield this.deepLinkRedirectUrlState.update(()=>e)})}getAndClearLoginRedirectUrl(){return u(this,void 0,void 0,function*(){const e=yield(0,r._)(this.deepLinkRedirectUrlState.state$);if(!o.A.isNullOrEmpty(e))return yield this.persistLoginRedirectUrl(null),e})}}A.ɵfac=function(e){return new(e||A)(l.KVO(n.Ix),l.KVO(n.nX),l.KVO(c.hE),l.KVO(a.v2),l.KVO(d.W))},A.ɵprov=l.jDH({token:A,factory:A.ɵfac})},52057(e,t,i){"use strict";i.d(t,{K:()=>n});class n{}},52136(e,t,i){"use strict";i.d(t,{o:()=>n});class n{constructor(e,t){var i;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.useOrganizationDomains=e.useOrganizationDomains,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.useAutomaticUserConfirmation=e.useAutomaticUserConfirmation,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.organizationUserId=e.organizationUserId,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.productTierType=e.productTierType,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.limitCollectionCreation=e.limitCollectionCreation,this.limitCollectionDeletion=e.limitCollectionDeletion,this.limitItemDeletion=e.limitItemDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.userIsManagedByOrganization=e.userIsManagedByOrganization,this.useAccessIntelligence=e.useAccessIntelligence,this.useAdminSponsoredFamilies=e.useAdminSponsoredFamilies,this.useDisableSMAdsForUsers=null!==(i=e.useDisableSMAdsForUsers)&&void 0!==i&&i,this.isAdminInitiated=e.isAdminInitiated,this.ssoEnabled=e.ssoEnabled,this.ssoMemberDecryptionType=e.ssoMemberDecryptionType,this.usePhishingBlocker=e.usePhishingBlocker,this.useMyItems=e.useMyItems,this.isMember=t.isMember,this.isProviderUser=t.isProviderUser)}static fromJSON(e){return Object.assign(new n,e,{familySponsorshipLastSyncDate:null!=e.familySponsorshipLastSyncDate?new Date(e.familySponsorshipLastSyncDate):e.familySponsorshipLastSyncDate,familySponsorshipValidUntil:null!=e.familySponsorshipValidUntil?new Date(e.familySponsorshipValidUntil):e.familySponsorshipValidUntil})}}},52237(e,t,i){"use strict";i.d(t,{pM:()=>c,MH:()=>C,sK:()=>r,nb:()=>g,Fw:()=>w,yv:()=>y,uF:()=>m,it:()=>l,iY:()=>h,Kt:()=>u,I_:()=>p});class n{}class r extends n{constructor(e){super(),e&&(this.id=e.id,this.readOnly=e.readOnly,this.hidePasswords=e.hidePasswords,this.manage=e.manage)}}var s=i(39306),o=i(17989),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const l={SharedCollection:0,DefaultUserCollection:1};class c extends o.A{constructor(e){super(),this.readOnly=!1,this.hidePasswords=!1,this.manage=!1,this.type=l.SharedCollection,this.id=e.id,this.name=e.name,this.organizationId=e.organizationId}static fromCollectionData(e){if(null==e||null==e.name||null==e.organizationId)throw new Error("CollectionData must contain name and organizationId.");const t=new c(Object.assign(Object.assign({},e),{name:new s.k(e.name)}));return t.externalId=e.externalId,t.readOnly=e.readOnly,t.hidePasswords=e.hidePasswords,t.manage=e.manage,t.type=e.type,t.defaultUserCollectionEmail=e.defaultUserCollectionEmail,t}static fromCollectionView(e,t,i){return a(this,void 0,void 0,function*(){const n=new c({name:yield t.encryptString(e.name,i),id:e.id,organizationId:e.organizationId});return n.externalId=e.externalId,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.type=e.type,n})}decrypt(e,t){return h.fromCollection(this,t,e)}static isCollectionId(e){return"string"==typeof e&&null!=e}}var d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const u="/";class h{constructor(e){this.readOnly=!1,this.hidePasswords=!1,this.manage=!1,this.assigned=!1,this.type=l.SharedCollection,this.id=e.id,this.organizationId=e.organizationId,this._name=e.name}set name(e){this._name=e}get name(){var e;return null!==(e=this.defaultUserCollectionEmail)&&void 0!==e?e:this._name}canEditItems(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.canEditAllCiphers)||this.manage||this.assigned&&!this.readOnly}canEdit(e){if(this.isDefaultCollection)return!1;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 this.manage}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.limitCollectionDeletion)||e.isAdmin)&&this.manage&&!this.isDefaultCollection}canViewCollectionInfo(e){return!1}canEditName(e){return this.canEdit(e)&&!this.defaultUserCollectionEmail}get isDefaultCollection(){return this.type==l.DefaultUserCollection}static vaultFilterHead(){return new h({id:"",organizationId:"",name:""})}static fromCollection(e,t,i){return d(this,void 0,void 0,function*(){const n=new h(Object.assign(Object.assign({},e),{name:""}));try{n.name=yield t.decryptString(e.name,i)}catch(r){n.name="[error: cannot decrypt]",console.error("[CollectionView] Error decrypting collection name",r)}return n.assigned=!0,n.externalId=e.externalId,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.type=e.type,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n})}static fromCollectionAccessDetails(e,t,i){return d(this,void 0,void 0,function*(){const n=new h(Object.assign({},e));try{n.name=yield t.decryptString(new s.k(e.name),i)}catch(r){throw console.error("[CollectionView] Error decrypting collection name",r),r}return n.externalId=e.externalId,n.type=e.type,n.assigned=e.assigned,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n})}static fromJSON(e){return Object.assign(new h(Object.assign({},e)),e)}encrypt(e,t){return c.fromCollectionView(this,t,e)}}var A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const p="unassigned";class g extends h{constructor(){super(...arguments),this.groups=[],this.users=[],this.unmanaged=!1,this.assigned=!1}canEdit(e){return!this.isDefaultCollection&&((null==e?void 0:e.canEditAnyCollection)||this.unmanaged&&(null==e?void 0:e.canEditUnmanagedCollections)||super.canEdit(e))}canDelete(e){return!this.isDefaultCollection&&((null==e?void 0:e.canDeleteAnyCollection)||super.canDelete(e))}canEditUserAccess(e){return!this.isDefaultCollection&&(e.permissions.manageUsers&&e.allowAdminAccessToAllCollectionItems||this.canEdit(e))}canEditGroupAccess(e){return!this.isDefaultCollection&&(e.permissions.manageGroups&&e.allowAdminAccessToAllCollectionItems||this.canEdit(e))}canViewCollectionInfo(e){var t,i;if(this.isUnassignedCollection||this.isDefaultCollection)return!1;const n=null!==(t=null==e?void 0:e.isAdmin)&&void 0!==t&&t,r=null!==(i=null==e?void 0:e.permissions.editAnyCollection)&&void 0!==i&&i;return this.manage||n||r}get isUnassignedCollection(){return this.id===p}canEditName(e){return this.canEdit(e)&&!this.defaultUserCollectionEmail||super.canEditName(e)}static fromCollectionAccessDetails(e,t,i){return A(this,void 0,void 0,function*(){const n=new g(Object.assign({},e));try{n.name=yield t.decryptString(new s.k(n.name),i)}catch(o){n.name="[error: cannot decrypt]",console.error("[CollectionAdminView/fromCollectionAccessDetails] Error decrypting collection name",o)}return n.assigned=e.assigned,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.unmanaged=e.unmanaged,n.type=e.type,n.externalId=e.externalId,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n.groups=e.groups?e.groups.map(e=>new r(e)):[],n.users=e.users?e.users.map(e=>new r(e)):[],n})}static fromCollectionResponse(e,t,i){return A(this,void 0,void 0,function*(){let n;try{n=yield t.decryptString(new s.k(e.name),i)}catch(o){throw console.error("[CollectionAdminView/fromCollectionResponse] Failed to decrypt the collection name",o),o}const r=new g({id:e.id,name:n,organizationId:e.organizationId});return r.externalId=e.externalId,r})}}var v=i(73409),f=i(20702);class m extends f.r{constructor(e){var t;super(e),this.type=l.SharedCollection,this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.externalId=this.getResponseProperty("ExternalId"),this.defaultUserCollectionEmail=this.getResponseProperty("DefaultUserCollectionEmail"),this.type=null!==(t=this.getResponseProperty("Type"))&&void 0!==t?t:l.SharedCollection}}class y extends m{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 C extends y{constructor(e){super(e),this.groups=[],this.users=[],this.assigned=this.getResponseProperty("Assigned")||!1,this.unmanaged=this.getResponseProperty("Unmanaged")||!1;const t=this.getResponseProperty("Groups");null!=t&&(this.groups=t.map(e=>new v.U(e)));const i=this.getResponseProperty("Users");null!=i&&(this.users=i.map(e=>new v.U(e)))}}class w{constructor(e){this.readOnly=!1,this.manage=!1,this.hidePasswords=!1,this.type=l.SharedCollection,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,this.type=e.type,this.defaultUserCollectionEmail=e.defaultUserCollectionEmail}static fromJSON(e){return null==e?null:Object.assign(new w(new y({})),e)}}},52396(e,t,i){"use strict";i.d(t,{y:()=>n});class n{}},52717(e,t,i){"use strict";i.d(t,{i:()=>n});class n{}},52892(e,t,i){"use strict";i.d(t,{zh:()=>n,wG:()=>v});class n{}var r=i(21879);class s{constructor(){this.enabled=!1,this.showSetupDialog=!0}}const o=r.Ok.record(r.vZ,"autoConfirm",{deserializer:e=>e,clearOn:[]});var a=i(3204),l=i(33338),c=i(72245),d=i(44500),u=i(43978),h=i(82468),A=i(15639),p=i(78781),g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{constructor(e,t,i,n,r,s,o){this.configService=e,this.apiService=t,this.organizationUserService=i,this.stateProvider=n,this.organizationService=r,this.organizationUserApiService=s,this.policyService=o}autoConfirmState(e){return this.stateProvider.getUser(e,o)}configuration$(e){return this.autoConfirmState(e).state$.pipe((0,a.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:new s}))}upsert(e,t){return g(this,void 0,void 0,function*(){yield this.autoConfirmState(e).update(i=>Object.assign(Object.assign({},i),{[e]:t}))})}canManageAutoConfirm$(e){return(0,l.z)([this.configService.getFeatureFlag$(h.TO.AutoConfirm),this.organizationService.organizations$(e).pipe((0,a.T)(e=>e[0])),this.policyService.policyAppliesToUser$(u.tt.AutoConfirm,e)]).pipe((0,a.T)(([e,t,i])=>{var n;return e&&i&&null!==(n=null==t?void 0:t.canManageAutoConfirm)&&void 0!==n&&n}))}autoConfirmUser(e,t,i,n){return g(this,void 0,void 0,function*(){if(!(yield(0,c._)(this.canManageAutoConfirm$(e))))return;if(!(yield(0,c._)(this.configuration$(e).pipe((0,a.T)(e=>e.enabled)))))return;const r=this.organizationService.organizations$(e).pipe((0,A.Hc)(n),(0,a.T)(e=>{if(null==e)throw new Error("Organization not found");return e})),s=yield this.apiService.getUserPublicKey(t),o=p.A.fromB64ToArray(s.publicKey);yield(0,c._)(r.pipe((0,d.n)(e=>this.organizationUserService.buildConfirmRequest(e,o)),(0,d.n)(e=>this.organizationUserApiService.postOrganizationUserAutoConfirm(n,i,e))))})}}},53021(e,t,i){"use strict";i.d(t,{s:()=>M});var n=i(77468),r=i(60989),s=i(37831),o=i(74208),a=i(94573),l=i(33277),c=i(33812),d=i(6056),u=i(36801),h=i(68016),A=i(66723),p=i(26477),g=i(21823),v=i(9396),f=i(69672),m=i(57178);const y=["sideNavSlotFallback"],C=["container"],w=["main"],I=["drawerContainer"],b=["skipLink"],B=[[["bit-side-nav"],["","slot","side-nav"]],"*"],E=()=>[];function S(e,t){1&e&&c.eu8(0,null,4)}function Q(e,t){1&e&&c.nrm(0,"div",9)}function k(e,t){if(1&e){const e=c.RV6();c.j41(0,"div",15),c.bIt("click",function(){o.eBV(e);const t=c.XpG();return o.Njj(t.sideNavService.toggle())}),c.k0s()}}function T(e,t){}class F{constructor(){this.sideNavService=(0,o.WQX)(g.G),this.drawerService=(0,o.WQX)(A.d),this.drawerPortal=this.drawerService.portal,this.sideNavSlotFallback=(0,a.ebz)("sideNavSlotFallback"),this.hasSideNav=(0,l.EW)(()=>null==this.sideNavSlotFallback()),this.drawerIsActive=(0,l.EW)(()=>null!=this.drawerPortal()),this.destroyRef=(0,o.WQX)(o.abz),this.container=a.ebz.required("container"),this.mainContent=a.ebz.required("main"),this.drawerContainer=a.ebz.required("drawerContainer"),this.containerWidthPx=(0,o.vPA)(0),this.siderailIsPushMode=(0,o.vPA)(!1),this.gridTemplateColumns=(0,l.EW)(()=>{const e=this.sideNavService.open(),t=this.sideNavService.isPushMode(),i=this.siderailIsPushMode(),n=this.drawerIsActive(),r=this.drawerService.pushWidthPx(),s=this.containerWidthPx(),o=(0,v.T)(),a=4*o,l=h.G.small*o,c=24*o;let d,u,A;d=!!n&&(r>0&&s>0?s-a-l>=c:this.drawerService.isPushMode()),u=this.hasSideNav()?e&&t?`${this.sideNavService.widthRem()}rem`:t||i?"auto":"0px":"0px",A=n?d?r>0?`minmax(0px, ${r}px)`:"auto":"1fr":"0px";return`${u} ${!n||d?`minmax(${c}px, 1fr)`:"0px"} ${A}`}),this.rounded=(0,a.hFB)(!1,{transform:a.L39}),this.skipLink=a.ebz.required("skipLink"),(0,c.mal)(()=>{const e=this.container().nativeElement,t=this.drawerContainer().nativeElement,i=new ResizeObserver(()=>{const t=(0,v.T)(),i=e.clientWidth,n=4*t,r=24*t,s=this.sideNavService.widthRem()*t,o=h.G.small*t;this.containerWidthPx.set(i);const a=this.drawerService.pushWidthPx(),l=a>0&&i-s-a>=r,c=a>0&&i-s-o>=r,d=l||a>0&&i-n-a>=r||c||a>0&&i-n-o>=r,u=d?l||c:i-s>=r&&0===a,A=d?Math.min(a,Math.max(0,i-n-r)):0,p=d?i-n-A>=r:i-n>=r,g=this.sideNavService.isPushMode();!u&&this.sideNavService.open()&&g&&this.sideNavService.open.set(!1),u&&!g&&"closed"!==this.sideNavService.userCollapsePreference()&&this.sideNavService.open.set(!0),this.sideNavService.isPushMode.set(u),this.siderailIsPushMode.set(p),this.drawerService.isPushMode.set(d)});i.observe(e),i.observe(t),this.destroyRef.onDestroy(()=>i.disconnect())})}focusMainContent(){this.mainContent().nativeElement.focus()}handleKeydown(e){P()&&(e.preventDefault(),this.skipLink().el.nativeElement.focus())}}F.ɵfac=function(e){return new(e||F)},F.ɵcmp=c.VBU({type:F,selectors:[["bit-layout"]],viewQuery:function(e,t){1&e&&(c.wEZ(t.sideNavSlotFallback,y,5),c.wEZ(t.container,C,5),c.wEZ(t.mainContent,w,5),c.wEZ(t.drawerContainer,I,5),c.wEZ(t.skipLink,b,5)),2&e&&c.NyB(5)},hostAttrs:[1,"tw-block","tw-h-screen"],hostBindings:function(e,t){1&e&&c.bIt("keydown.tab",function(e){return t.handleKeydown(e)},c.EBC)},inputs:{rounded:[1,"rounded"]},ngContentSelectors:["bit-side-nav, [slot=side-nav]","*"],decls:19,vars:18,consts:[["container",""],["skipLink",""],["main",""],["drawerContainer",""],["sideNavSlotFallback",""],["cdkTrapFocus","",1,"tw-grid","tw-relative","tw-size-full","tw-overflow-hidden","tw-grid-rows-[minmax(0,1fr)]"],[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,"click","fragment","routerLink"],["aria-hidden","true",1,"tw-pointer-events-none","tw-w-[3.75rem]","tw-mx-0.5","tw-col-start-1","tw-row-start-1"],["tabindex","-1","bitScrollLayoutHost","",1,"tw-col-start-2","tw-row-start-1","tw-overflow-auto","tw-max-h-full","tw-min-w-96","tw-bg-background","tw-p-8","tw-pt-6","tw-@container",3,"id"],[1,"tw-pointer-events-none","tw-fixed","tw-inset-0","tw-z-40","tw-bg-black","tw-bg-opacity-0","motion-safe:tw-transition-colors"],[1,"tw-pointer-events-auto","tw-size-full"],[1,"tw-col-start-3","tw-row-start-1","tw-relative","tw-z-30","tw-h-full"],[3,"cdkPortalOutlet"],[1,"tw-pointer-events-auto","tw-size-full",3,"click"]],template:function(e,t){if(1&e){const e=c.RV6();c.NAR(B),c.j41(0,"div",5,0)(2,"div",6)(3,"nav",7)(4,"a",8,1),c.bIt("click",function(){return o.eBV(e),o.Njj(t.focusMainContent())}),c.EFF(6),c.nI1(7,"i18n"),c.k0s()()(),c.SdG(8,0,null,S,2,0),c.nVh(10,Q,1,0,"div",9),c.j41(11,"main",10,2),c.SdG(13,1),c.k0s(),c.j41(14,"div",11),c.nVh(15,k,1,0,"div",12),c.k0s(),c.j41(16,"div",13,3),c.DNE(18,T,0,0,"ng-template",14),c.k0s()()}if(2&e){const e="main-content";c.xc7("grid-template-columns",t.gridTemplateColumns()),c.AVh("tw-bg-background-alt3",t.rounded()),c.R7$(4),c.Y8G("fragment",e)("routerLink",c.lJ4(17,E)),c.R7$(2),c.JRh(c.bMT(7,15,"skipToContent")),c.R7$(4),c.vxM(t.sideNavService.isOverlay()&&t.siderailIsPushMode()?10:-1),c.R7$(),c.AVh("tw-rounded-tl-2xl",t.rounded()),c.Y8G("id",e),c.R7$(3),c.AVh("tw-bg-opacity-30",t.sideNavService.isOverlay()),c.R7$(),c.vxM(t.sideNavService.isOverlay()?15:-1),c.R7$(3),c.Y8G("cdkPortalOutlet",t.drawerPortal())}},dependencies:[n.MD,p.V,m.g,d.iI,d.Wk,s.jc,s.I3,r.Pd,r.kB,f.TT,u.$Z],encapsulation:2});const P=()=>[document.documentElement,document.body,null].includes(document.activeElement);var R=i(87916);const D=[[["app-side-nav"],["","slot","side-nav"]],"*"];class M{constructor(){}}M.ɵfac=function(e){return new(e||M)},M.ɵcmp=c.VBU({type:M,selectors:[["app-layout"]],ngContentSelectors:["app-side-nav, [slot=side-nav]","*"],decls:3,vars:0,template:function(e,t){1&e&&(c.NAR(D),c.j41(0,"bit-layout"),c.SdG(1,0,["slot","side-nav"]),c.SdG(2,1),c.k0s())},dependencies:[n.MD,F,R.V],encapsulation:2})},53100(e,t,i){"use strict";i.d(t,{E:()=>n});class n{}},53127(e,t,i){"use strict";i.d(t,{y:()=>n});class n{}},53323(e,t,i){"use strict";i.d(t,{W_:()=>s,aq:()=>r});const n=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function r(){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)})}function s(e){return n.test(e)}},53674(e,t,i){"use strict";i.d(t,{V8:()=>l,X8:()=>s,y7:()=>o});var n=i(20702),r=i(69138);class s extends n.r{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"),n=this.getResponseProperty("CustomerDiscount");this.subscription=null==t?null:new o(t),this.upcomingInvoice=null==i?null:new l(i),this.customerDiscount=null==n?null:new r.P(n)}}class o extends n.r{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 a(e))),this.collectionMethod=this.getResponseProperty("CollectionMethod"),this.suspensionDate=this.getResponseProperty("SuspensionDate"),this.unpaidPeriodEndDate=this.getResponseProperty("unpaidPeriodEndDate"),this.gracePeriod=this.getResponseProperty("GracePeriod")}}class a extends n.r{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 l extends n.r{constructor(e){super(e),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}},53997(e,t,i){"use strict";i.d(t,{O:()=>A});var n=i(39180),r=i(37831),s=i(94573),o=i(83892),a=i(69194),l=i(62179),c=i(14803),d=i(33812),u=i(43380);const h=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"bottom"}];class A{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=(0,s.hFB)("button"),this.menu=s.hFB.required({alias:"bitMenuTriggerFor"}),this.overlayRef=null,this.defaultMenuConfig={panelClass:"bit-menu-panel",hasBackdrop:!0,backdropClass:["cdk-overlay-transparent-backdrop","bit-menu-panel-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"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}]).withLockedPosition(!0).withFlexibleDimensions(!1).withPush(!0)},this.closedEventsSub=null,this.keyDownEventsSub=null,this.menuCloseListenerSub=null}toggleMenu(){this.isOpen?this.destroyMenu():this.openMenu()}toggleMenuOnRightClick(e){e.preventDefault(),this.isOpen?this.updateMenuPosition(e):this.openMenu(e)}ngOnDestroy(){this.disposeAll()}openMenu(e){const t=this.menu();if(null==t)throw new Error("Cannot find bit-menu element");this.isOpen=!0;const i=e?this.overlay.position().flexibleConnectedTo({x:e.clientX,y:e.clientY}).withPositions(h).withLockedPosition(!1).withFlexibleDimensions(!1).withPush(!0):this.defaultMenuConfig.positionStrategy,n=Object.assign(Object.assign({},this.defaultMenuConfig),{positionStrategy:i,hasBackdrop:!e});this.overlayRef=this.overlay.create(n);const s=new r.VA(t.templateRef(),this.viewContainerRef);this.overlayRef.attach(s);const o=!!e;this.setupClosingActions(o),this.setupMenuCloseListener(),t.keyManager&&(t.keyManager.setFirstItemActive(),this.keyDownEventsSub=this.overlayRef.keydownEvents().subscribe(e=>{var t;return null===(t=this.menu().keyManager)||void 0===t?void 0:t.onKeydown(e)}))}updateMenuPosition(e){if(null==this.overlayRef)return;const t=this.overlay.position().flexibleConnectedTo({x:e.clientX,y:e.clientY}).withPositions([{originX:"start",originY:"top",overlayX:"start",overlayY:"top"}]);this.overlayRef.updatePositionStrategy(t)}destroyMenu(){null!=this.overlayRef&&this.isOpen&&(this.isOpen=!1,this.disposeAll(),this.menu().closed.emit())}setupClosingActions(e){if(!this.overlayRef)return;const t=this.overlayRef.keydownEvents().pipe((0,a.p)(e=>("menu"===this.menu().ariaRole()?["Escape","Tab"]:["Escape"]).includes(e.key))),i=this.menu().closed,r=this.overlayRef.detachments(),s=e?(0,o.h)(r,t,i):(0,o.h)(r,t,this.overlayRef.backdropClick(),i);this.closedEventsSub=s.pipe((0,c.Q)(this.overlayRef.detachments())).subscribe(e=>{e instanceof KeyboardEvent&&"Escape"===e.key&&!(0,n.rp)(e)&&e.preventDefault(),this.elementRef.nativeElement.focus(),this.destroyMenu()})}setupMenuCloseListener(){this.overlayRef&&(this.menuCloseListenerSub=this.overlayRef.outsidePointerEvents().pipe((0,l.i)(1),(0,c.Q)(this.overlayRef.detachments())).subscribe(e=>{this.destroyMenu()}))}disposeAll(){var e,t,i,n;null===(e=this.closedEventsSub)||void 0===e||e.unsubscribe(),null===(t=this.keyDownEventsSub)||void 0===t||t.unsubscribe(),null===(i=this.menuCloseListenerSub)||void 0===i||i.unsubscribe(),null===(n=this.overlayRef)||void 0===n||n.dispose()}}A.ɵfac=function(e){return new(e||A)(d.rXU(d.aKT),d.rXU(d.c1b),d.rXU(u.hJ))},A.ɵdir=d.FsC({type:A,selectors:[["","bitMenuTriggerFor",""]],hostVars:3,hostBindings:function(e,t){1&e&&d.bIt("click",function(){return t.toggleMenu()}),2&e&&d.BMQ("role",t.role())("aria-expanded",t.isOpen)("aria-haspopup",t.hasPopup)},inputs:{role:[1,"role"],menu:[1,"bitMenuTriggerFor","menu"]},exportAs:["menuTrigger"]})},54006(e,t,i){"use strict";i.d(t,{u:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M0 15a5 5 0 0 1 5-5h45a5 5 0 0 1 5 5v31.667a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50 11.667H5A3.333 3.333 0 0 0 1.667 15v31.667A3.333 3.333 0 0 0 5 50h45a3.333 3.333 0 0 0 3.333-3.333V15A3.333 3.333 0 0 0 50 11.667ZM5 10a5 5 0 0 0-5 5v31.667a5 5 0 0 0 5 5h45a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5H5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M19.167 30a2.5 2.5 0 0 1 2.5-2.5h11.666a2.5 2.5 0 0 1 2.5 2.5v8.333a2.5 2.5 0 0 1-2.5 2.5H21.667a2.5 2.5 0 0 1-2.5-2.5V30Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.333 29.167H21.667a.833.833 0 0 0-.834.833v8.333c0 .46.373.834.834.834h11.666c.46 0 .834-.373.834-.834V30a.833.833 0 0 0-.834-.833ZM21.667 27.5a2.5 2.5 0 0 0-2.5 2.5v8.333a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H21.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M26.667 32.5a.833.833 0 0 1 1.666 0v3.334a.833.833 0 0 1-1.666 0V32.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M23.334 26.667a4.167 4.167 0 0 1 8.333 0v.833H30v-.833a2.5 2.5 0 0 0-5 0v.833h-1.666v-.833ZM54.167 20H.833v-1.666h53.334v1.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M51.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM46.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM41.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.444-5.223 11.667-11.666 11.667C50.223 46.667 45 41.444 45 35.001c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45c5.523 0 10-4.477 10-10 0-5.522-4.477-10-10-10s-10 4.478-10 10c0 5.523 4.477 10 10 10Zm0 1.667c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.334 45 28.557 45 35.001c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M78.256 59.98A22.918 22.918 0 0 1 80 68.75c0 .691-.56 1.25-1.25 1.25H35.417c-.69 0-1.25-.559-1.25-1.25a22.916 22.916 0 0 1 44.089-8.77Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.33 68.334a21.25 21.25 0 0 0-42.492 0h42.491Zm1.67.417a22.918 22.918 0 0 0-31.686-21.173 22.917 22.917 0 0 0-14.147 21.173c0 .69.56 1.25 1.25 1.25H78.75c.69 0 1.25-.56 1.25-1.25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M9.167 50.834a6.667 6.667 0 0 1 6.666-6.667h22.5a6.667 6.667 0 0 1 0 13.333h-22.5a6.667 6.667 0 0 1-6.666-6.666Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.333 45.834h-22.5a5 5 0 1 0 0 10h22.5a5 5 0 0 0 0-10Zm-22.5-1.667a6.667 6.667 0 0 0 0 13.333h22.5a6.667 6.667 0 1 0 0-13.333h-22.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.67 47.977c.46 0 .834.374.834.834v1.166l1.093-.358a.833.833 0 1 1 .519 1.584l-1.108.363.694.972a.833.833 0 1 1-1.357.969l-.675-.945-.675.945a.833.833 0 0 1-1.356-.969l.694-.972-1.108-.363a.833.833 0 0 1 .518-1.584l1.094.359V48.81c0-.46.373-.834.833-.834Zm7.5 0c.46 0 .834.374.834.834v1.166l1.093-.358a.833.833 0 1 1 .519 1.584l-1.108.363.694.972a.833.833 0 1 1-1.357.969l-.675-.945-.675.945a.833.833 0 0 1-1.356-.969l.694-.972-1.108-.363a.833.833 0 0 1 .518-1.584l1.094.359V48.81c0-.46.373-.834.833-.834ZM29.167 52.5c0-.46.373-.833.833-.833h3.333a.833.833 0 1 1 0 1.667H30a.833.833 0 0 1-.833-.834ZM35.834 52.5c0-.46.373-.833.833-.833H40a.833.833 0 0 1 0 1.667h-3.333a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
  </svg>
  `},54306(e,t,i){"use strict";i.d(t,{o:()=>o});var n=i(20702),r=i(41347),s=i(62046);class o extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.accessId=this.getResponseProperty("AccessId"),this.type=this.getResponseProperty("Type"),this.authType=this.getResponseProperty("AuthType"),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.emails=this.getResponseProperty("Emails"),this.disable=this.getResponseProperty("Disabled")||!1,this.hideEmail=this.getResponseProperty("HideEmail")||!1,this.authType=this.getResponseProperty("AuthType");const t=this.getResponseProperty("Text");null!=t&&(this.text=new s.Y(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new r.h(i))}}},54351(e,t,i){"use strict";i.d(t,{S:()=>n});class n{}},54471(e,t,i){"use strict";i.d(t,{C:()=>a});var n=i(94573),r=i(33277),s=i(30634),o=i(33812);class a{constructor(e){this.el=e,this.title=n.hFB.required({alias:"appA11yTitle"});const t=this.el.nativeElement.getAttribute("title"),i=this.el.nativeElement.getAttribute("aria-label");(0,r.QZ)(()=>{(0,s.J)({element:this.el.nativeElement,title:null!=t?t:this.title(),label:null!=i?i:this.title()})})}}a.ɵfac=function(e){return new(e||a)(o.rXU(o.aKT))},a.ɵdir=o.FsC({type:a,selectors:[["","appA11yTitle",""]],inputs:{title:[1,"appA11yTitle","title"]}})},54873(e,t,i){"use strict";i.d(t,{m:()=>n,t:()=>de});var n,r=i(77468),s=i(33812),o=i(51757),a=i(72245),l=i(94735),c=i(49355),d=(i(46217),i(82468)),u=i(68467),h=i(78781),A=i(37579),p=i(47135),g=i(26411),v=i(22191),f=i(55807),m=i(89479),y=i(29029),C=i(26477),w=i(71373),I=i(8916),b=i(65113),B=i(91834),E=i(74208),S=i(72331),Q=i(5556),k=i(1601),T=i(69855),F=i(66316),P=i(50700),R=i(83541),D=i(37115),M=i(18499),x=i(2471),O=i(26657),G=i(38620),U=i(56898),V=i(50352),j=i(90246),N=i(86226),z=i(93199),Y=i(97553),L=i(68466),K=i(43759),X=i(76356),q=i(69896),H=i(36288),W=i(58384),$=i(54471),J=i(57178),Z=i(25740),_=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ee(e,t){if(1&e&&s.nrm(0,"auth-password-callout",13),2&e){const e=s.XpG();s.Y8G("message",e.flow===e.InputPasswordFlow.ChangePasswordDelegation?"changePasswordDelegationMasterPasswordPolicyInEffect":"masterPasswordPolicyInEffect")("policy",e.masterPasswordPolicyOptions)}}function te(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.nrm(4,"input",14),s.j41(5,"button",8),s.mxI("toggledChange",function(t){E.eBV(e);const i=s.XpG();return s.DH7(i.showPassword,t)||(i.showPassword=t),E.Njj(t)}),s.k0s()()}if(2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,2,"currentMasterPass")),s.R7$(3),s.R50("toggled",e.showPassword)}}function ie(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",15),s.nI1(1,"i18n"),s.bIt("click",function(){E.eBV(e);const t=s.XpG();return E.Njj(t.generatePassword())}),s.k0s()}2&e&&s.Y8G("label",s.bMT(1,1,"generatePassword"))}function ne(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",16),s.nI1(1,"i18n"),s.bIt("click",function(){E.eBV(e);const t=s.XpG();return E.Njj(t.copy())}),s.k0s()}2&e&&s.Y8G("label",s.mNQ(s.bMT(1,2,"copyPassword")))}function re(e,t){if(1&e&&(s.j41(0,"bit-hint")(1,"span",17),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.EFF(4),s.nI1(5,"i18n"),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.SpI("",s.bMT(3,3,"important")," "),s.R7$(2),s.Lme(" ",s.bMT(5,5,"masterPassImportant")," ",e.minPasswordLengthMsg,". ")}}function se(e,t){if(1&e&&(s.qex(0),s.j41(1,"bit-form-field",18)(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"input",19),s.j41(6,"bit-hint"),s.EFF(7),s.nI1(8,"i18n"),s.k0s()(),s.j41(9,"bit-form-control"),s.nrm(10,"input",20),s.j41(11,"bit-label"),s.EFF(12),s.nI1(13,"i18n"),s.k0s()(),s.bVm()),2&e){const e=s.XpG();s.R7$(3),s.JRh(s.bMT(4,3,"masterPassHintLabel")),s.R7$(4),s.SpI(" ",s.brH(8,5,"masterPassHintText",e.formGroup.value.newPasswordHint.length.toString(),e.maxHintLength.toString())," "),s.R7$(5),s.JRh(s.bMT(13,9,"checkForBreaches"))}}function oe(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-form-control")(1,"input",21),s.bIt("change",function(){E.eBV(e);const t=s.XpG();return E.Njj(t.rotateUserKeyClicked())}),s.k0s(),s.j41(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.j41(5,"a",22),s.nI1(6,"i18n"),s.nrm(7,"bit-icon",23),s.k0s()()()}2&e&&(s.R7$(3),s.SpI(" ",s.bMT(4,3,"rotateAccountEncKey")," "),s.R7$(2),s.Y8G("appA11yTitle",s.mNQ(s.bMT(6,5,"impactOfRotatingYourEncryptionKey"))))}function ae(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",27),s.bIt("click",function(){E.eBV(e);const t=s.XpG(2);return E.Njj(t.onSecondaryButtonClick.emit())}),s.EFF(1),s.k0s()}if(2&e){const e=s.XpG(2);s.Y8G("loading",e.loading),s.R7$(),s.SpI(" ",e.secondaryButtonTextStr," ")}}function le(e,t){if(1&e&&(s.j41(0,"div",24)(1,"button",25),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.DNE(4,ae,2,2,"button",26),s.k0s()),2&e){const e=s.XpG();s.Y8G("ngClass",e.inlineButtons?"tw-flex-row":"tw-flex-col"),s.R7$(),s.Y8G("loading",e.loading),s.R7$(),s.SpI(" ",e.primaryButtonTextStr||s.bMT(3,4,"setMasterPassword")," "),s.R7$(2),s.Y8G("ngIf",e.secondaryButtonText)}}function ce(e,t){if(1&e&&s.nrm(0,"bit-error-summary",28),2&e){const e=s.XpG();s.Y8G("formGroup",e.formGroup)}}!function(e){e[e.SetInitialPasswordAccountRegistration=0]="SetInitialPasswordAccountRegistration",e[e.SetInitialPasswordAuthedUser=1]="SetInitialPasswordAuthedUser",e[e.ChangePassword=2]="ChangePassword",e[e.ChangePasswordWithOptionalUserKeyRotation=3]="ChangePasswordWithOptionalUserKeyRotation",e[e.ChangePasswordDelegation=4]="ChangePasswordDelegation"}(n||(n={}));class de{get minPasswordLengthMsg(){return null!=this.masterPasswordPolicyOptions&&this.masterPasswordPolicyOptions.minLength>0?this.i18nService.t("characterMinimum",this.masterPasswordPolicyOptions.minLength):this.i18nService.t("characterMinimum",this.minPasswordLength)}constructor(e,t,i,r,l,c,A,p,g,v,f,m,y,C){this.auditService=e,this.cipherService=t,this.configService=i,this.dialogService=r,this.formBuilder=l,this.i18nService=c,this.kdfConfigService=A,this.keyService=p,this.masterPasswordService=g,this.passwordGenerationService=v,this.platformUtilsService=f,this.policyService=m,this.toastService=y,this.validationService=C,this.passwordStrengthComponent=void 0,this.onPasswordFormSubmit=new s.bkB,this.onSecondaryButtonClick=new s.bkB,this.isSubmitting=new s.bkB,this.loading=!1,this.inlineButtons=!1,this.primaryButtonTextStr="",this.secondaryButtonTextStr="",this.InputPasswordFlow=n,this.kdfConfig=null,this.minHintLength=0,this.maxHintLength=50,this.minPasswordLength=h.A.minimumPasswordLength,this.minPasswordMsg="",this.passwordStrengthScore=0,this.showErrorSummary=!1,this.showPassword=!1,this.formGroup=this.formBuilder.nonNullable.group({newPassword:this.formBuilder.nonNullable.control("",[o.k0.required,o.k0.minLength(this.minPasswordLength)]),newPasswordConfirm:this.formBuilder.nonNullable.control("",o.k0.required)},{validators:[(0,B.R)(B.l.InputsShouldMatch,"newPassword","newPasswordConfirm",this.i18nService.t("masterPassDoesntMatch"))]}),this.submit=()=>_(this,void 0,void 0,function*(){var e,t,i,r,s,o,l,c;try{if(this.isSubmitting.emit(!0),this.verifyFlow(),this.formGroup.markAllAsTouched(),this.formGroup.invalid)return void(this.showErrorSummary=!0);const h=null!==(t=null===(e=this.formGroup.controls.currentPassword)||void 0===e?void 0:e.value)&&void 0!==t?t:"",A=this.formGroup.controls.newPassword.value,p=null!==(r=null===(i=this.formGroup.controls.newPasswordHint)||void 0===i?void 0:i.value)&&void 0!==r?r:"",g=null===(o=null===(s=this.formGroup.controls.checkForBreaches)||void 0===s?void 0:s.value)||void 0===o||o;if(this.flow===n.ChangePasswordDelegation)return yield this.handleChangePasswordDelegationFlow(A);if(!this.email)throw new Error("Email not found.");if(this.flow===n.SetInitialPasswordAccountRegistration)this.kdfConfig=I.fX;else{if(!this.userId)throw new Error("userId not found.");this.kdfConfig=yield(0,a._)(this.kdfConfigService.getKdfConfig$(this.userId))}if(null==this.kdfConfig)throw new Error("KdfConfig not found.");const v=null!=this.userId?yield(0,a._)(this.masterPasswordService.saltForUser$(this.userId)):this.masterPasswordService.emailToSalt(this.email);if(null==v)throw new Error("Salt not found.");const f=yield this.configService.getFeatureFlag(d.TO.PM27086_UpdateAuthenticationApisForInputPassword);if(!f&&(this.flow===n.ChangePassword||this.flow===n.ChangePasswordWithOptionalUserKeyRotation)){if(!(yield this.verifyCurrentPassword(h,this.kdfConfig)))return}if(!(yield this.verifyNewPassword(A,this.passwordStrengthScore,g)))return;if(f){const e={newPassword:A,kdfConfig:this.kdfConfig,salt:v,newPasswordHint:p,newApisWithInputPasswordFlagEnabled:f};return this.flow!==n.ChangePassword&&this.flow!==n.ChangePasswordWithOptionalUserKeyRotation||(e.currentPassword=h),this.flow===n.ChangePasswordWithOptionalUserKeyRotation&&(e.rotateUserKey=null===(l=this.formGroup.controls.rotateUserKey)||void 0===l?void 0:l.value),this.onPasswordFormSubmit.emit(e),e}const m=yield this.keyService.makeMasterKey(A,this.email,this.kdfConfig),y=yield this.keyService.hashMasterKey(A,m,u.VK.ServerAuthorization),C={newPassword:A,salt:v,newMasterKey:m,newServerMasterKeyHash:y,newLocalMasterKeyHash:yield this.keyService.hashMasterKey(A,m,u.VK.LocalAuthorization),newPasswordHint:p,kdfConfig:this.kdfConfig};if(this.flow===n.ChangePassword||this.flow===n.ChangePasswordWithOptionalUserKeyRotation){const e=yield this.keyService.makeMasterKey(h,this.email,this.kdfConfig),t=yield this.keyService.hashMasterKey(h,e,u.VK.ServerAuthorization),i=yield this.keyService.hashMasterKey(h,e,u.VK.LocalAuthorization);C.currentPassword=h,C.currentMasterKey=e,C.currentServerMasterKeyHash=t,C.currentLocalMasterKeyHash=i}return this.flow===n.ChangePasswordWithOptionalUserKeyRotation&&(C.rotateUserKey=null===(c=this.formGroup.controls.rotateUserKey)||void 0===c?void 0:c.value),this.onPasswordFormSubmit.emit(C),C}catch(h){this.validationService.showError(h)}finally{this.isSubmitting.emit(!1)}})}ngOnInit(){this.addFormFieldsIfNecessary(),this.setButtonText()}addFormFieldsIfNecessary(){this.flow!==n.ChangePasswordDelegation&&(this.formGroup.addControl("newPasswordHint",this.formBuilder.nonNullable.control("",[o.k0.minLength(this.minHintLength),o.k0.maxLength(this.maxHintLength)])),this.formGroup.addValidators([(0,B.R)(B.l.InputsShouldNotMatch,"newPassword","newPasswordHint",this.i18nService.t("hintEqualsPassword"))]),this.formGroup.addControl("checkForBreaches",this.formBuilder.nonNullable.control(!0))),this.flow!==n.ChangePassword&&this.flow!==n.ChangePasswordWithOptionalUserKeyRotation||(this.formGroup.addControl("currentPassword",this.formBuilder.nonNullable.control("",o.k0.required)),this.formGroup.addValidators([(0,B.R)(B.l.InputsShouldNotMatch,"currentPassword","newPassword",this.i18nService.t("yourNewPasswordCannotBeTheSameAsYourCurrentPassword"))])),this.flow===n.ChangePasswordWithOptionalUserKeyRotation&&this.formGroup.addControl("rotateUserKey",this.formBuilder.nonNullable.control(!1))}setButtonText(){var e,t,i,n;this.primaryButtonText&&(this.primaryButtonTextStr=this.i18nService.t(this.primaryButtonText.key,...null!==(t=null===(e=this.primaryButtonText)||void 0===e?void 0:e.placeholders)&&void 0!==t?t:[])),this.secondaryButtonText&&(this.secondaryButtonTextStr=this.i18nService.t(this.secondaryButtonText.key,...null!==(n=null===(i=this.secondaryButtonText)||void 0===i?void 0:i.placeholders)&&void 0!==n?n:[]))}verifyFlow(){if((this.flow===n.SetInitialPasswordAccountRegistration||this.flow===n.ChangePasswordDelegation)&&this.userId)throw new Error("There should be no active account userId passed down in a this flow.");if(this.flow!==n.SetInitialPasswordAccountRegistration&&this.flow!==n.ChangePasswordDelegation&&!this.userId)throw new Error("This flow requires that an active account userId be passed down.");if(this.flow===n.ChangePasswordDelegation&&this.email)throw new Error("There should be no email passed down in this flow.");if(this.flow!==n.ChangePasswordDelegation&&!this.email)throw new Error("This flow requires that an email be passed down.")}handleChangePasswordDelegationFlow(e){return _(this,void 0,void 0,function*(){if(!(yield this.verifyNewPassword(e,this.passwordStrengthScore,!1)))return;const t={newPassword:e};return this.onPasswordFormSubmit.emit(t),t})}verifyCurrentPassword(e,t){return _(this,void 0,void 0,function*(){if(!this.email)throw new Error("Email is required to verify current password.");if(!this.userId)throw new Error("userId is required to verify current password.");const i=yield this.keyService.makeMasterKey(e,this.email,t);return null!=(yield this.masterPasswordService.decryptUserKeyWithMasterKey(i,this.userId))||(this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("invalidMasterPassword")}),!1)})}verifyNewPassword(e,t,i){return _(this,void 0,void 0,function*(){const n=i&&(yield this.auditService.passwordLeaked(e))>0,r=null!=t&&t<3;if(n&&r){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakAndExposedMasterPassword"},content:{key:"weakAndBreachedMasterPasswordDesc"},type:"warning"})))return!1}else if(r){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakMasterPassword"},content:{key:"weakMasterPasswordDesc"},type:"warning"})))return!1}else if(n){if(!(yield this.dialogService.openSimpleDialog({title:{key:"exposedMasterPassword"},content:{key:"exposedMasterPasswordDesc"},type:"warning"})))return!1}return!(null!=this.masterPasswordPolicyOptions&&!this.policyService.evaluateMasterPassword(this.passwordStrengthScore,e,this.masterPasswordPolicyOptions))||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("masterPasswordPolicyRequirementsNotMet")}),!1)})}rotateUserKeyClicked(){return _(this,void 0,void 0,function*(){const e=this.formGroup.controls.rotateUserKey;if(null==e?void 0:e.value){if(!this.userId)throw new Error("userId not passed down");const t=yield this.cipherService.getAllDecrypted(this.userId);let i=!1;if(null!=t)for(let e=0;e<t.length;e++)if(null==t[e].organizationId&&t[e].hasOldAttachments){i=!0;break}if(i){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 e.setValue(!1)}(yield this.dialogService.openSimpleDialog({title:{key:"rotateEncKeyTitle"},content:this.i18nService.t("updateEncryptionKeyWarning")+" "+this.i18nService.t("updateEncryptionKeyAccountExportWarning")+" "+this.i18nService.t("rotateEncKeyConfirmation"),type:"warning"}))||e.setValue(!1)}})}getPasswordStrengthScore(e){this.passwordStrengthScore=e}generatePassword(){return _(this,void 0,void 0,function*(){var e,t;const i=null!==(t=null===(e=yield this.passwordGenerationService.getOptions())||void 0===e?void 0:e[0])&&void 0!==t?t:{};if(this.formGroup.patchValue({newPassword:yield this.passwordGenerationService.generatePassword(i)}),!this.passwordStrengthComponent)throw new Error("PasswordStrengthComponent is not initialized");this.passwordStrengthComponent.updatePasswordStrength(this.formGroup.controls.newPassword.value)})}copy(){const e=this.formGroup.value.newPassword;null!=e&&(this.platformUtilsService.copyToClipboard(e,{window}),this.toastService.showToast({variant:"info",title:"",message:this.i18nService.t("valueCopied",this.i18nService.t("password"))}))}}de.ɵfac=function(e){return new(e||de)(s.rXU(S.d),s.rXU(Q.p),s.rXU(k.w),s.rXU(F.o3),s.rXU(o.ok),s.rXU(P.W),s.rXU(I.zZ),s.rXU(I.Lu),s.rXU(R.L),s.rXU(w.JJ),s.rXU(D.y),s.rXU(M.m),s.rXU(T.f),s.rXU(x.B))},de.ɵcmp=s.VBU({type:de,selectors:[["auth-input-password"]],viewQuery:function(e,t){if(1&e&&s.GBs(c.k,5),2&e){let e;s.mGM(e=s.lsd())&&(t.passwordStrengthComponent=e.first)}},inputs:{flow:"flow",email:[2,"email","email",e=>null==e?void 0:e.trim().toLowerCase()],userId:"userId",loading:"loading",masterPasswordPolicyOptions:"masterPasswordPolicyOptions",inlineButtons:"inlineButtons",primaryButtonText:"primaryButtonText",secondaryButtonText:"secondaryButtonText"},outputs:{onPasswordFormSubmit:"onPasswordFormSubmit",onSecondaryButtonClick:"onSecondaryButtonClick",isSubmitting:"isSubmitting"},decls:26,vars:27,consts:[[3,"formGroup","bitSubmit"],[3,"message","policy",4,"ngIf"],[4,"ngIf"],[1,"tw-mb-6"],[3,"disableMargin"],["id","input-password-form_new-password","bitInput","","type","password","formControlName","newPassword"],["type","button","bitIconButton","bwi-generate","bitSuffix","",3,"label","click",4,"ngIf"],["type","button","bitSuffix","","bitIconButton","bwi-clone",3,"label","click",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],[3,"passwordStrengthScore","showText","email","password"],["id","input-password-form_new-password-confirm","bitInput","","type","password","formControlName","newPasswordConfirm"],["class","tw-flex tw-gap-2",3,"ngClass",4,"ngIf"],[3,"formGroup",4,"ngIf"],[3,"message","policy"],["id","input-password-form_current-password","bitInput","","type","password","formControlName","currentPassword"],["type","button","bitIconButton","bwi-generate","bitSuffix","",3,"click","label"],["type","button","bitSuffix","","bitIconButton","bwi-clone",3,"click","label"],[1,"tw-font-medium"],[1,"vw-password-hint"],["id","input-password-form_new-password-hint","bitInput","","formControlName","newPasswordHint"],["id","input-password-form_check-for-breaches","type","checkbox","bitCheckbox","","formControlName","checkForBreaches"],["id","input-password-form_rotate-user-key","type","checkbox","bitCheckbox","","formControlName","rotateUserKey",3,"change"],["bitLink","","href","https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key","target","_blank","rel","noreferrer",3,"appA11yTitle"],["name","bwi-question-circle"],[1,"tw-flex","tw-gap-2",3,"ngClass"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"loading"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"loading","click",4,"ngIf"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click","loading"],[3,"formGroup"]],template:function(e,t){1&e&&(s.j41(0,"form",0),s.DNE(1,ee,1,2,"auth-password-callout",1)(2,te,6,4,"bit-form-field",2),s.j41(3,"div",3)(4,"bit-form-field",4)(5,"bit-label"),s.EFF(6),s.nI1(7,"i18n"),s.nI1(8,"i18n"),s.k0s(),s.nrm(9,"input",5),s.DNE(10,ie,2,3,"button",6)(11,ne,2,4,"button",7),s.j41(12,"button",8),s.mxI("toggledChange",function(e){return s.DH7(t.showPassword,e)||(t.showPassword=e),e}),s.k0s(),s.DNE(13,re,6,7,"bit-hint",2),s.k0s(),s.j41(14,"tools-password-strength",9),s.bIt("passwordStrengthScore",function(e){return t.getPasswordStrengthScore(e)}),s.k0s()(),s.j41(15,"bit-form-field")(16,"bit-label"),s.EFF(17),s.nI1(18,"i18n"),s.nI1(19,"i18n"),s.k0s(),s.nrm(20,"input",10),s.j41(21,"button",8),s.mxI("toggledChange",function(e){return s.DH7(t.showPassword,e)||(t.showPassword=e),e}),s.k0s()(),s.DNE(22,se,14,11,"ng-container",2)(23,oe,8,7,"bit-form-control",2)(24,le,5,6,"div",11)(25,ce,1,1,"bit-error-summary",12),s.k0s()),2&e&&(s.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),s.R7$(),s.Y8G("ngIf",t.masterPasswordPolicyOptions),s.R7$(),s.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePassword||t.flow===t.InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation),s.R7$(2),s.Y8G("disableMargin",!0),s.R7$(2),s.JRh(t.flow===t.InputPasswordFlow.SetInitialPasswordAccountRegistration||t.flow===t.InputPasswordFlow.SetInitialPasswordAuthedUser?s.bMT(7,19,"masterPassword"):s.bMT(8,21,"newMasterPass")),s.R7$(4),s.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordDelegation),s.R7$(),s.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordDelegation),s.R7$(),s.R50("toggled",t.showPassword),s.R7$(),s.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),s.R7$(),s.Y8G("showText",!0)("email",t.email)("password",t.formGroup.controls.newPassword.value),s.R7$(3),s.JRh(t.flow===t.InputPasswordFlow.SetInitialPasswordAccountRegistration||t.flow===t.InputPasswordFlow.SetInitialPasswordAuthedUser?s.bMT(18,23,"confirmMasterPassword"):s.bMT(19,25,"confirmNewMasterPass")),s.R7$(4),s.R50("toggled",t.showPassword),s.R7$(),s.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),s.R7$(),s.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation),s.R7$(),s.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),s.R7$(),s.Y8G("ngIf",t.showErrorSummary))},dependencies:[r.MD,r.YU,r.bT,A.C,O.$,G.L,y.t,U.Q,p.q,V.P,g.L,j.f,N.j,z.I,Y.J,L.L,K.h,X.e,q.a,v.Q,H.s,f.o,W.R,m.x,l.p,$.C,b.R,c.k,o.X1,o.qT,o.me,o.Zm,o.BC,o.cb,o.j4,o.JD,C.V,J.g,Z.$],encapsulation:2})},54931(e,t,i){"use strict";i.d(t,{c_:()=>g,mm:()=>A,p2:()=>n,Bx:()=>r.B,fH:()=>v,g8:()=>p});var n,r=i(45977);!function(e){e[e.SCIM=1]="SCIM",e[e.DomainVerification=2]="DomainVerification",e[e.PublicApi=3]="PublicApi",e[e.BitwardenPortal=5]="BitwardenPortal"}(n||(n={}));const s="userEvents",o="itemEvents",a="collectionEvents",l="groupEvents",c="organizationMemberEvents",d="organizationEvents",u="providerEvents";r.B.User_LoggedIn,r.B.User_ChangedPassword,r.B.User_Updated2fa,r.B.User_Disabled2fa,r.B.User_Recovered2fa,r.B.User_FailedLogIn,r.B.User_FailedLogIn2fa,r.B.User_ClientExportedVault,r.B.User_UpdatedTempPassword,r.B.User_MigratedKeyToKeyConnector,r.B.User_RequestedDeviceApproval,r.B.User_TdeOffboardingPasswordSet,r.B.Cipher_Created,r.B.Cipher_Updated,r.B.Cipher_Deleted,r.B.Cipher_AttachmentCreated,r.B.Cipher_AttachmentDeleted,r.B.Cipher_Shared,r.B.Cipher_UpdatedCollections,r.B.Cipher_ClientViewed,r.B.Cipher_ClientToggledPasswordVisible,r.B.Cipher_ClientToggledHiddenFieldVisible,r.B.Cipher_ClientToggledCardCodeVisible,r.B.Cipher_ClientCopiedPassword,r.B.Cipher_ClientCopiedHiddenField,r.B.Cipher_ClientCopiedCardCode,r.B.Cipher_ClientAutofilled,r.B.Cipher_SoftDeleted,r.B.Cipher_Restored,r.B.Cipher_ClientToggledCardNumberVisible,r.B.Cipher_ClientToggledTOTPSeedVisible,r.B.Collection_Created,r.B.Collection_Updated,r.B.Collection_Deleted,r.B.Group_Created,r.B.Group_Updated,r.B.Group_Deleted,r.B.OrganizationUser_Invited,r.B.OrganizationUser_Confirmed,r.B.OrganizationUser_Updated,r.B.OrganizationUser_Removed,r.B.OrganizationUser_UpdatedGroups,r.B.OrganizationUser_UnlinkedSso,r.B.OrganizationUser_ResetPassword_Enroll,r.B.OrganizationUser_ResetPassword_Withdraw,r.B.OrganizationUser_AdminResetPassword,r.B.OrganizationUser_ResetSsoLink,r.B.OrganizationUser_FirstSsoLogin,r.B.OrganizationUser_Revoked,r.B.OrganizationUser_Restored,r.B.OrganizationUser_ApprovedAuthRequest,r.B.OrganizationUser_RejectedAuthRequest,r.B.OrganizationUser_Deleted,r.B.OrganizationUser_Left,r.B.OrganizationUser_SelfRevoked,r.B.Organization_Updated,r.B.Organization_PurgedVault,r.B.Organization_ClientExportedVault,r.B.Organization_VaultAccessed,r.B.Organization_EnabledSso,r.B.Organization_DisabledSso,r.B.Organization_EnabledKeyConnector,r.B.Organization_DisabledKeyConnector,r.B.Organization_SponsorshipsSynced,r.B.Organization_CollectionManagementUpdated,r.B.Organization_CollectionManagement_LimitCollectionCreationEnabled,r.B.Organization_CollectionManagement_LimitCollectionCreationDisabled,r.B.Organization_CollectionManagement_LimitCollectionDeletionEnabled,r.B.Organization_CollectionManagement_LimitCollectionDeletionDisabled,r.B.Organization_CollectionManagement_LimitItemDeletionEnabled,r.B.Organization_CollectionManagement_LimitItemDeletionDisabled,r.B.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled,r.B.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled,r.B.ProviderUser_Invited,r.B.ProviderUser_Confirmed,r.B.ProviderUser_Updated,r.B.ProviderUser_Removed,r.B.ProviderOrganization_Created,r.B.ProviderOrganization_Added,r.B.ProviderOrganization_Removed,r.B.ProviderOrganization_VaultAccessed;var h=i(20702);class A extends h.r{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.projectId=this.getResponseProperty("ProjectId"),this.serviceAccountId=this.getResponseProperty("ServiceAccountId"),this.grantedServiceAccountId=this.getResponseProperty("GrantedServiceAccountId")}}class p{constructor(e){this.message=e.message,this.humanReadableMessage=e.humanReadableMessage,this.appIcon=e.appIcon,this.appName=e.appName,this.userId=e.userId,this.userName=e.userName,this.userEmail=e.userEmail,this.date=e.date,this.ip=e.ip,this.type=e.type,this.installationId=e.installationId,this.systemUser=e.systemUser,this.serviceAccountId=e.serviceAccountId}}class g{}class v{}i(64503)},54967(e,t,i){"use strict";i.d(t,{L:()=>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,this.revisionDate=e.revisionDate)}static fromPolicy(e){return Object.assign(new n,e)}}},55393(e,t,i){"use strict";i.d(t,{K:()=>u});var n=i(66523),r=i(62963),s=i(33812);class o{transform(e,t){var i;return null===(i=t.find(t=>t.id===e))||void 0===i?void 0:i.name}}o.ɵfac=function(e){return new(e||o)},o.ɵpipe=s.EJ8({name:"collectionNameFromId",type:o,pure:!0});var a=i(77468),l=i(47696);function c(e,t){if(1&e&&(s.qex(0),s.j41(1,"span",2),s.EFF(2),s.nI1(3,"collectionNameFromId"),s.k0s(),s.bVm()),2&e){const e=t.$implicit,i=s.XpG();s.R7$(2),s.JRh(s.i5U(3,1,e,i.collections))}}function d(e,t){if(1&e&&(s.qex(0),s.j41(1,"span",2),s.EFF(2),s.k0s(),s.bVm()),2&e){const e=s.XpG();s.R7$(2),s.SpI("+ ",e.xMoreCount," more")}}class u{get shownCollections(){return(this.showXMore?this.collectionIds.slice(0,2):this.collectionIds).map(n.zw)}get showXMore(){return this.collectionIds.length>3}get xMoreCount(){return this.collectionIds.length-2}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=s.VBU({type:u,selectors:[["app-collection-badge"]],inputs:{collectionIds:"collectionIds",collections:"collections"},decls:2,vars:2,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],["bitBadge","","variant","secondary"]],template:function(e,t){1&e&&s.DNE(0,c,4,4,"ng-container",0)(1,d,3,1,"ng-container",1),2&e&&(s.Y8G("ngForOf",t.shownCollections),s.R7$(),s.Y8G("ngIf",t.showXMore))},dependencies:[r.G,a.Sq,a.bT,l.n,o],encapsulation:2})},55459(e,t,i){"use strict";i.d(t,{J:()=>n});class n{}},55542(e,t,i){"use strict";i.d(t,{s:()=>l});var n=i(54539),r=i(93585),s=i(16878),o=i(33338),a=i(3204);class l extends r.q{constructor(){super(),this._filter=new s.t(()=>!0),this._renderData=new s.t([]),this._renderChangesSubscription=null,this._data=new s.t([]),this._sort=new s.t({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,o.z)([this._data,this._filter]).pipe((0,a.T)(([e])=>this.filterData(e))),i=(0,o.z)([t,this._sort]).pipe((0,a.T)(([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){const t="string"==typeof this.filter?l.simpleStringFilter(this.filter):this.filter;return this.filteredData=null==this.filter?e:e.filter(e=>t(e)),this.filteredData}orderData(e,t){return t?this.sortData(e,t):e}sortingDataAccessor(e,t){const i=e[t];if((0,n.o1)(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,r)=>{if(t.fn)return t.fn(e,r,t.direction)*n;let s=this.sortingDataAccessor(e,i),o=this.sortingDataAccessor(r,i);const a=typeof s,l=typeof o;if(a!==l&&("number"===a&&(s+=""),"number"===l&&(o+="")),"string"==typeof s&&"string"==typeof o)return s.localeCompare(o)*n;let c=0;return null!=s&&null!=o?s>o?c=1:s<o&&(c=-1):null!=s?c=1:null!=o&&(c=-1),c*n}):e}}l.simpleStringFilter=e=>t=>{if(!e)return!0;const i=Object.keys(t).reduce((e,i)=>e+t[i]+"◬","").toLowerCase(),n=e.trim().toLowerCase();return-1!=i.indexOf(n)}},55686(e,t,i){"use strict";i.d(t,{D:()=>u});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(72245),l=i(78781),c=i(49519),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(){this.destroyRef=(0,r.WQX)(r.abz),this.ngZone=(0,r.WQX)(s.SKi),this.el=(0,r.WQX)(s.aKT),this.bitAutofocusFallback=(0,n.geq)(),this.focused=(0,r.vPA)(!1),(0,o.QZ)(()=>d(this,void 0,void 0,function*(){const e=this.bitAutofocusFallback();if(this.focused()||l.A.isMobileBrowser||!e)return;const t=e.nativeElement;this.ngZone.isStable||(yield(0,a._)(this.ngZone.onStable)),this.handleFocus(t)}))}handleFocus(e){this.checkForAutofocusDescendants()||this.focusAfterTimeout(e)}focusAfterTimeout(e){const t=setTimeout(()=>{e.focus(),this.focused.set(e===document.activeElement)},0);this.destroyRef.onDestroy(()=>clearTimeout(t))}checkForAutofocusDescendants(){const e=this.el.nativeElement;if(e){return(0,c.U)(e).length>0}return!1}}u.ɵfac=function(e){return new(e||u)},u.ɵdir=s.FsC({type:u,selectors:[["","bitAutofocusFallback",""]],inputs:{bitAutofocusFallback:[1,"bitAutofocusFallback"]},outputs:{bitAutofocusFallback:"bitAutofocusFallbackChange"}})},55807(e,t,i){"use strict";i.d(t,{o:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},55818(e,t,i){"use strict";i.d(t,{t:()=>r});var n=i(33812);class r{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}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"orgNameFromId",type:r,pure:!0})},56455(e,t,i){"use strict";i.d(t,{pU:()=>U,MA:()=>z,wG:()=>X});var n=i(39306),r=i(19488),s=i(6528);function o(e){if(null!=e)return"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 s.G){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 r.Z){return t.cardholderName=null!=e.cardholderName?new n.k(e.cardholderName):void 0,t.brand=null!=e.brand?new n.k(e.brand):void 0,t.number=null!=e.number?new n.k(e.number):void 0,t.expMonth=null!=e.expMonth?new n.k(e.expMonth):void 0,t.expYear=null!=e.expYear?new n.k(e.expYear):void 0,t.code=null!=e.code?new n.k(e.code):void 0,t}constructor(e){null!=e&&(this.cardholderName=o(e.cardholderName),this.brand=o(e.brand),this.number=o(e.number),this.expMonth=o(e.expMonth),this.expYear=o(e.expYear),this.code=o(e.code))}}var l=i(36501),c=i(7919),d=i(23293),u=i(75751),h=i(31442),A=i(77720),p=i(11766);class g{static template(){const e=new g;return e.name="Field name",e.value="Some value",e.type=h.PU.Text,e}static toView(e,t=new p.g){return t.type=e.type,t.value=e.value,t.name=e.name,t.linkedId=e.linkedId,t}static toDomain(e,t=new A.D){return t.type=e.type,t.value=null!=e.value?new n.k(e.value):void 0,t.name=null!=e.name?new n.k(e.name):void 0,t.linkedId=e.linkedId,t}constructor(e){this.type=h.PU.Text,null!=e&&(this.name=o(e.name),this.value=o(e.value),this.type=e.type,this.linkedId=e.linkedId)}}var v=i(32072),f=i(67036);class m{static template(){const e=new m;return e.title="Mr",e.firstName="John",e.middleName="William",e.lastName="Doe",e.address1="123 Any St",e.address2="Apt #123",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 f.O){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 v.l){return t.title=null!=e.title?new n.k(e.title):void 0,t.firstName=null!=e.firstName?new n.k(e.firstName):void 0,t.middleName=null!=e.middleName?new n.k(e.middleName):void 0,t.lastName=null!=e.lastName?new n.k(e.lastName):void 0,t.address1=null!=e.address1?new n.k(e.address1):void 0,t.address2=null!=e.address2?new n.k(e.address2):void 0,t.address3=null!=e.address3?new n.k(e.address3):void 0,t.city=null!=e.city?new n.k(e.city):void 0,t.state=null!=e.state?new n.k(e.state):void 0,t.postalCode=null!=e.postalCode?new n.k(e.postalCode):void 0,t.country=null!=e.country?new n.k(e.country):void 0,t.company=null!=e.company?new n.k(e.company):void 0,t.email=null!=e.email?new n.k(e.email):void 0,t.phone=null!=e.phone?new n.k(e.phone):void 0,t.ssn=null!=e.ssn?new n.k(e.ssn):void 0,t.username=null!=e.username?new n.k(e.username):void 0,t.passportNumber=null!=e.passportNumber?new n.k(e.passportNumber):void 0,t.licenseNumber=null!=e.licenseNumber?new n.k(e.licenseNumber):void 0,t}constructor(e){null!=e&&(this.title=o(e.title),this.firstName=o(e.firstName),this.middleName=o(e.middleName),this.lastName=o(e.lastName),this.address1=o(e.address1),this.address2=o(e.address2),this.address3=o(e.address3),this.city=o(e.city),this.state=o(e.state),this.postalCode=o(e.postalCode),this.country=o(e.country),this.company=o(e.company),this.email=o(e.email),this.phone=o(e.phone),this.ssn=o(e.ssn),this.username=o(e.username),this.passportNumber=o(e.passportNumber),this.licenseNumber=o(e.licenseNumber))}}var y=i(21925),C=i(14093),w=i(84454),I=i(65918);class b{static template(){const e=new b;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=new Date,e}static toView(e,t=new I.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 w.U){return t.credentialId=new n.k(e.credentialId),t.keyType=new n.k(e.keyType),t.keyAlgorithm=new n.k(e.keyAlgorithm),t.keyCurve=new n.k(e.keyCurve),t.keyValue=new n.k(e.keyValue),t.rpId=new n.k(e.rpId),t.userHandle=null!=e.userHandle?new n.k(e.userHandle):void 0,t.userName=null!=e.userName?new n.k(e.userName):void 0,t.counter=new n.k(e.counter),t.rpName=null!=e.rpName?new n.k(e.rpName):void 0,t.userDisplayName=null!=e.userDisplayName?new n.k(e.userDisplayName):void 0,t.discoverable=new n.k(e.discoverable),t.creationDate=new Date(e.creationDate),t}constructor(e){var t,i,n,r,s,a,l,c;this.credentialId="",this.keyType="",this.keyAlgorithm="",this.keyCurve="",this.keyValue="",this.rpId="",this.counter="",this.discoverable="false",this.creationDate=new Date,null!=e&&(this.credentialId=null!==(t=o(e.credentialId))&&void 0!==t?t:"",this.keyType=null!==(i=o(e.keyType))&&void 0!==i?i:"",this.keyAlgorithm=null!==(n=o(e.keyAlgorithm))&&void 0!==n?n:"",this.keyCurve=null!==(r=o(e.keyCurve))&&void 0!==r?r:"",this.keyValue=null!==(s=o(e.keyValue))&&void 0!==s?s:"",this.rpId=null!==(a=o(e.rpId))&&void 0!==a?a:"",this.userHandle=o(e.userHandle),this.userName=o(e.userName),this.counter=null!==(l=o(e instanceof I.X?String(e.counter):e.counter))&&void 0!==l?l:"",this.rpName=o(e.rpName),this.userDisplayName=o(e.userDisplayName),this.discoverable=null!==(c=o(e instanceof I.X?String(e.discoverable):e.discoverable))&&void 0!==c?c:"false",this.creationDate=e.creationDate)}}var B=i(73386),E=i(16671);class S{static template(){const e=new S;return e.uri="https://google.com",e}static toView(e,t=new E.z){return t.uri=e.uri,t.match=e.match,t}static toDomain(e,t=new B.m){return t.uri=null!=e.uri?new n.k(e.uri):void 0,t.uriChecksum=null!=e.uriChecksum?new n.k(e.uriChecksum):void 0,t.match=e.match,t}constructor(e){var t;null!=e&&(this.uri=o(e.uri),"uriChecksum"in e&&(this.uriChecksum=null===(t=e.uriChecksum)||void 0===t?void 0:t.encryptedString),this.match=e.match)}}class Q{static template(){const e=new Q;return e.uris=[],e.username="jdoe",e.password="myp@ssword123",e.totp="JBSWY3DPEHPK3PXP",e.fido2Credentials=[],e}static toView(e,t=new C.r){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=>b.toView(e))),t}static toDomain(e,t=new y.a){return null!=e.uris&&(t.uris=e.uris.map(e=>S.toDomain(e))),t.username=null!=e.username?new n.k(e.username):void 0,t.password=null!=e.password?new n.k(e.password):void 0,t.totp=null!=e.totp?new n.k(e.totp):void 0,null!=e.fido2Credentials&&(t.fido2Credentials=e.fido2Credentials.map(e=>b.toDomain(e))),t}constructor(e){null!=e&&(null!=e.uris&&(this.uris=e.uris.map(e=>new S(e))),null!=e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map(e=>new b(e))),this.username=o(e.username),this.password=o(e.password),this.totp=o(e.totp))}}var k=i(50751),T=i(12022);class F{static template(){return new F}static toView(e,t=new T.j){return t.password=e.password,t.lastUsedDate=e.lastUsedDate?new Date(e.lastUsedDate):new Date,t}static toDomain(e,t=new k._){return t.password=new n.k(e.password),t.lastUsedDate=e.lastUsedDate?new Date(e.lastUsedDate):new Date,t}constructor(e){var t,i;this.password="",null!=e&&(this.password=null!==(t=o(e.password))&&void 0!==t?t:"",this.lastUsedDate=null!==(i=e.lastUsedDate)&&void 0!==i?i:void 0)}}var P=i(47328),R=i(86346);class D{static template(){const e=new D;return e.type=h.ak.Generic,e}static toView(e,t=new R.Z){return t.type=e.type,t}static toDomain(e,t=new P.S){return t.type=e.type,t}constructor(e){this.type=h.ak.Generic,null!=e&&(this.type=e.type)}}var M=i(67756),x=i(72142);class O{static template(){const e=new O;return e.privateKey="",e.publicKey="",e.keyFingerprint="",e}static toView(e,t=new x.H){if(null!=e){if(!e.privateKey||""===e.privateKey.trim())throw new Error("SSH key private key is required.");if(!e.publicKey||""===e.publicKey.trim())throw new Error("SSH key public key is required.");if(!e.keyFingerprint||""===e.keyFingerprint.trim())throw new Error("SSH key fingerprint is required.");return t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.keyFingerprint,t}}static toDomain(e,t=new M.M){return t.privateKey=new n.k(e.privateKey),t.publicKey=new n.k(e.publicKey),t.keyFingerprint=new n.k(e.keyFingerprint),t}constructor(e){var t,i,n;this.privateKey="",this.publicKey="",this.keyFingerprint="",null!=e&&(this.privateKey=null!==(t=o(e.privateKey))&&void 0!==t?t:"",this.publicKey=null!==(i=o(e.publicKey))&&void 0!==i?i:"",this.keyFingerprint=null!==(n=o(e.keyFingerprint))&&void 0!==n?n:"")}}class G{constructor(){this.type=c.gC.Login,this.name="",this.favorite=!1,this.reprompt=l.b.None}static template(){const e=new G;return e.type=c.gC.Login,e.name="Item name",e.notes="Some notes about this item.",e.favorite=!1,e.fields=[],e.reprompt=l.b.None,e.passwordHistory=[],e}static toView(e,t=new u.f){var i,r,s;if(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.collectionIds||e.collectionIds){const n=new Set((null!==(i=t.collectionIds)&&void 0!==i?i:[]).concat(null!==(r=e.collectionIds)&&void 0!==r?r:[]));t.collectionIds=Array.from(n.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.b.None,t.key=null!=e.key?new n.k(e.key):void 0,null!=e.fields&&(t.fields=e.fields.map(e=>g.toView(e))),e.type){case c.gC.Login:null!=e.login&&(t.login=Q.toView(e.login));break;case c.gC.SecureNote:null!=e.secureNote&&(t.secureNote=D.toView(e.secureNote));break;case c.gC.Card:null!=e.card&&(t.card=a.toView(e.card));break;case c.gC.Identity:null!=e.identity&&(t.identity=m.toView(e.identity));break;case c.gC.SshKey:null!=e.sshKey&&(t.sshKey=O.toView(e.sshKey))}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map(e=>F.toView(e))),t.creationDate=e.creationDate?new Date(e.creationDate):t.creationDate,t.revisionDate=e.revisionDate?new Date(e.revisionDate):t.revisionDate,t.deletedDate=e.deletedDate?new Date(e.deletedDate):t.deletedDate,t.archivedDate=e.archivedDate?new Date(e.archivedDate):t.archivedDate,t}static toDomain(e,t=new d.o){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.k(e.name):new n.k(""),t.notes=null!=e.notes?new n.k(e.notes):void 0,t.favorite=e.favorite,t.reprompt=null!==(i=e.reprompt)&&void 0!==i?i:l.b.None,t.key=null!=e.key?new n.k(e.key):void 0,null!=e.fields&&(t.fields=e.fields.map(e=>g.toDomain(e))),e.type){case c.gC.Login:null!=e.login&&(t.login=Q.toDomain(e.login));break;case c.gC.SecureNote:null!=e.secureNote&&(t.secureNote=D.toDomain(e.secureNote));break;case c.gC.Card:null!=e.card&&(t.card=a.toDomain(e.card));break;case c.gC.Identity:null!=e.identity&&(t.identity=m.toDomain(e.identity));break;case c.gC.SshKey:null!=e.sshKey&&(t.sshKey=O.toDomain(e.sshKey))}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map(e=>F.toDomain(e))),t.creationDate=e.creationDate?new Date(e.creationDate):t.creationDate,t.revisionDate=e.revisionDate?new Date(e.revisionDate):t.revisionDate,t.deletedDate=e.deletedDate?new Date(e.deletedDate):void 0,t.archivedDate=e.archivedDate?new Date(e.archivedDate):void 0,t}build(e){var t,i;switch(this.organizationId=e.organizationId,this.folderId=e.folderId,this.type=e.type,this.reprompt=e.reprompt,this.name=null!==(t=o(e.name))&&void 0!==t?t:"",this.notes=o(e.notes),"key"in e&&(this.key=null===(i=e.key)||void 0===i?void 0:i.encryptedString),this.favorite=e.favorite,null!=e.fields&&(this.fields=e.fields.map(e=>new g(e))),e.type){case c.gC.Login:this.login=new Q(e.login);break;case c.gC.SecureNote:this.secureNote=new D(e.secureNote);break;case c.gC.Card:this.card=new a(e.card);break;case c.gC.Identity:this.identity=new m(e.identity);break;case c.gC.SshKey:this.sshKey=new O(e.sshKey)}null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new F(e))),this.creationDate=e.creationDate,this.revisionDate=e.revisionDate,this.deletedDate=e.deletedDate,this.archivedDate=e.archivedDate}}class U extends G{constructor(){super(...arguments),this.id="",this.collectionIds=[]}build(e){this.id=e.id,super.build(e),this.collectionIds=e.collectionIds}}var V=i(52237),j=i(5076);class N{static template(){const e=new N;return e.organizationId=j.v,e.name="Collection name",e.externalId=null,e}static toView(e,t){const i=new V.iY({name:e.name,organizationId:e.organizationId,id:t});return i.externalId=e.externalId,i}static toDomain(e,t){return t.name=null!=e.name?new n.k(e.name):null,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}build(e){this.organizationId=e.organizationId,this.name=o(e.name),this.externalId=e.externalId}}class z extends N{static toView(e){return super.toView(e,e.id)}static toDomain(e,t){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}var Y=i(84274),L=i(78078);class K{constructor(){this.name=""}static template(){const e=new K;return e.name="Folder name",e}static toView(e,t=new L.u){return t.name=e.name,t}static toDomain(e,t=new Y.v){return t.name=new n.k(e.name),t}build(e){var t,i;this.name=null!==(i=o(null!==(t=e.name)&&void 0!==t?t:""))&&void 0!==i?i:""}}class X extends K{static toView(e,t=new L.u){return t.id=e.id,super.toView(e,t)}static toDomain(e,t=new Y.v){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}},56615(e,t,i){"use strict";i.d(t,{V:()=>o});var n=i(1576),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.m]})},56898(e,t,i){"use strict";i.d(t,{Q:()=>g});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(43749),l=i(53100),c=i(83632),d=i(6307),u=i(23542);function h(e,t){if(1&e&&s.nrm(0,"i"),2&e){const e=s.XpG();s.HbH(e.startIconClasses())}}function A(e,t){if(1&e&&s.nrm(0,"i"),2&e){const e=s.XpG();s.HbH(e.endIconClasses())}}function p(e,t){1&e&&(s.j41(0,"span",3),s.nrm(1,"bit-spinner",4),s.k0s())}class g{get showLoadingStyle(){return this.baseButton.showLoadingStyle}constructor(){this.baseButton=(0,r.WQX)(a.$H),this.el=(0,r.WQX)(s.aKT),this.loading=this.baseButton.loading,this.disabled=this.baseButton.disabled,this.startIcon=(0,n.hFB)(void 0),this.endIcon=(0,n.hFB)(void 0),this.size=(0,n.geq)("default"),this.startIconClasses=(0,o.EW)(()=>["bwi",this.startIcon()]),this.endIconClasses=(0,o.EW)(()=>["bwi",this.endIcon()]),this.classList=(0,o.EW)(()=>{const e=[];return e.push("tw-rounded-xl"),this.baseButton.block()?e.push("tw-w-full","tw-block"):e.push("tw-inline-block"),e.push(...v(this.size())),e.join(" ")}),(0,d.m)(this.el.nativeElement,this.baseButton.disabledAttr)}}g.ɵfac=function(e){return new(e||g)},g.ɵcmp=s.VBU({type:g,selectors:[["button","bitButton",""],["a","bitButton",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classList())},inputs:{startIcon:[1,"startIcon"],endIcon:[1,"endIcon"],size:[1,"size"]},outputs:{size:"sizeChange"},features:[s.Jv_([{provide:l.E,useExisting:g}]),s.nM4([u.v,{directive:a.$H,inputs:["loading","loading","disabled","disabled","buttonType","buttonType","block","block"]}])],attrs:["bitButton",""],ngContentSelectors:["*"],decls:7,vars:5,consts:[[1,"tw-relative","tw-flex","tw-items-center","tw-justify-center"],[1,"tw-flex","tw-items-center","tw-gap-2"],[3,"class"],[1,"tw-absolute","tw-inset-0","tw-flex","tw-items-center","tw-justify-center"],["size","fill","noColor",""]],template:function(e,t){1&e&&(s.NAR(),s.j41(0,"span",0)(1,"span",1),s.nVh(2,h,1,2,"i",2),s.j41(3,"div"),s.SdG(4),s.k0s(),s.nVh(5,A,1,2,"i",2),s.k0s(),s.nVh(6,p,2,0,"span",3),s.k0s()),2&e&&(s.R7$(),s.AVh("tw-invisible",t.showLoadingStyle()),s.R7$(),s.vxM(t.startIcon()?2:-1),s.R7$(3),s.vxM(t.endIcon()?5:-1),s.R7$(),s.vxM(t.showLoadingStyle()?6:-1))},dependencies:[c.t],encapsulation:2});const v=e=>{const t={small:["tw-pt-[calc(theme(spacing.2)_-_1px)]","tw-pb-[calc(theme(spacing.2)_-_1px)]","tw-px-3","tw-text-xs/4"],default:["tw-pt-[calc(0.625rem_-_1px)]","tw-pb-[calc(0.625rem_-_1px)]","tw-px-4","tw-text-sm/5"],large:["tw-pt-[calc(theme(spacing.3)_-_1px)]","tw-pb-[calc(theme(spacing.3)_-_1px)]","tw-px-4","tw-text-base/6"]};return t[e]||t.default}},56953(e,t,i){"use strict";i.d(t,{B:()=>r});var n=i(48541);class r extends n.G{constructor(e,t){super(e,t)}}},56962(e,t,i){"use strict";i.d(t,{K:()=>n.Kc});var n=i(90107)},57083(e,t,i){"use strict";i.d(t,{q:()=>r});var n=i(33812);class r{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")}}r.ɵfac=function(e){return new(e||r)(n.rXU(n.aKT),n.rXU(n.sFG))},r.ɵdir=n.FsC({type:r,selectors:[["","appInputVerbatim",""]],inputs:{appInputVerbatim:"appInputVerbatim"}})},57144(e,t,i){"use strict";i.d(t,{BF:()=>h,fw:()=>p,ls:()=>d});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(78781),l=i(6307),c=i(23542);const d=["teal","coral","brand","green","purple"],u={"2xl":["tw-size-16","tw-min-w-16"],xl:["tw-size-14","tw-min-w-14"],lg:["tw-size-11","tw-min-w-11"],base:["tw-size-8","tw-min-w-8"],sm:["tw-size-6","tw-min-w-6"]},h={teal:"#007c95",coral:"#c71800",brand:"#175ddc",green:"#008236",purple:"#8200db"},A={teal:"#006278",coral:"#a81400",brand:"#0d43af",green:"#016630",purple:"#6e11b0"};class p{constructor(){this.el=(0,r.WQX)(s.aKT),this.color=(0,n.hFB)(),this.id=(0,n.hFB)(),this.text=(0,n.hFB)(),this.title=(0,n.hFB)(),this.size=(0,n.hFB)("base"),this.disabled=(0,n.hFB)(!1),this.svgCharCount=2,this.svgFontSize=12,this.svgFontWeight=400,this.svgSize=32,this.sizeClass=(0,o.EW)(()=>u[this.size()]),this.avatarColors=(0,o.EW)(()=>{const e=this.color(),t=function(e){return void 0!==e&&d.includes(e)}(e),i=null!=e&&""!==e.trim();if(!t&&i)return{bg:e,bgHover:`hsl(from ${e} h calc(s - 10) calc(l - 10))`,text:a.A.pickTextColorBasedOnBgColor(e,135,!0)};{const i=t?e:this.getDefaultColorKey(this.id(),this.text());return{bg:h[i],bgHover:A[i],text:"white"}}}),this.displayChars=(0,o.EW)(()=>{var e,t;const i=null!==(t=null===(e=this.text())||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:"";let n=this.getFirstLetters(i,this.svgCharCount);null==n&&(n=this.unicodeSafeSubstring(i,this.svgCharCount));const r=n.match(a.A.regexpEmojiPresentation);return r&&(n=r[0]),n}),(0,l.m)(this.el.nativeElement,this.disabled)}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}}unicodeSafeSubstring(e,t){const i=e.match(/./gu);return null!=i?i.slice(0,t).join(""):""}getDefaultColorKey(e,t){var i;let n="";n=a.A.isNullOrWhitespace(e)?null!==(i=null==t?void 0:t.toUpperCase())&&void 0!==i?i:"":e.toString();let r=0;for(const o of n)r=o.charCodeAt(0)+((r<<5)-r);const s=Math.abs(r)%d.length;return d[s]}}p.ɵfac=function(e){return new(e||p)},p.ɵcmp=s.VBU({type:p,selectors:[["bit-avatar"],["button","bit-avatar",""]],hostAttrs:[1,"tw-inline-block","tw-leading-[0px]","focus-visible:tw-outline-none","tw-rounded-full","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-1","focus-visible:tw-ring-border-focus","!focus-visible:tw-border-[transparent]","focus-visible:tw-z-10","tw-group/avatar","aria-disabled:tw-cursor-not-allowed","[&.tw-test-hover_svg]:tw-bg-[--avatar-bg-hover]","[&.tw-test-focus-visible_svg]:tw-bg-[--avatar-bg-hover]"],hostVars:6,hostBindings:function(e,t){2&e&&(s.HbH(t.sizeClass()),s.xc7("--avatar-bg",t.avatarColors().bg)("--avatar-bg-hover",t.avatarColors().bgHover))},inputs:{color:[1,"color"],id:[1,"id"],text:[1,"text"],title:[1,"title"],size:[1,"size"],disabled:[1,"disabled"]},features:[s.nM4([c.v])],decls:5,vars:13,consts:[["xmlns","http://www.w3.org/2000/svg","pointer-events","none",1,"tw-rounded-full","tw-size-full","tw-min-w-full","tw-bg-[--avatar-bg]","group-aria-disabled/avatar:tw-bg-bg-disabled","[&:is(button:not([aria-disabled='true'])_*)]:group-hover/avatar:tw-bg-[--avatar-bg-hover]","[&:is(button:not([aria-disabled='true'])_*)]:group-focus-visible/avatar:tw-bg-[--avatar-bg-hover]"],["text-anchor","middle","y","50%","x","50%","dy","0.35em","pointer-events","auto","font-family",'Inter,"Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',1,"[&:is(button:is([aria-disabled='true'])_*)]:tw-fill-fg-disabled"]],template:function(e,t){1&e&&(r.qSk(),s.rj2(0,"svg",0)(1,"title"),s.EFF(2),s.eux(),s.rj2(3,"text",1),s.EFF(4),s.eux()()),2&e&&(s.BMQ("viewBox",s.ai1("0 0 ",t.svgSize," ",t.svgSize)),s.R7$(2),s.JRh(t.title()||t.text()),s.R7$(),s.HbH(t.avatarColors().text.includes("white")?"tw-fill-fg-white":"tw-fill-black"),s.xc7("font-weight",t.svgFontWeight)("font-size",t.svgFontSize,"px")("line-height",16,"px"),s.R7$(),s.SpI(" ",t.displayChars()," "))},encapsulation:2,changeDetection:0})},57178(e,t,i){"use strict";i.d(t,{g:()=>A});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(6307);const l=e=>["bwi",e];function c(e,t){if(1&e&&s.Hgh(0,"i",3),2&e){const e=s.XpG();s.HbH(s.eq3(2,l,e.startIcon()))}}function d(e,t){if(1&e&&s.Hgh(0,"i",3),2&e){const e=s.XpG();s.HbH(s.eq3(2,l,e.endIcon()))}}const u={primary:["tw-text-fg-brand","hover:tw-text-fg-brand-strong","focus-visible:tw-text-fg-brand-strong"],default:["tw-text-fg-brand","hover:tw-text-fg-brand-strong","focus-visible:tw-text-fg-brand-strong"],secondary:["tw-text-fg-heading","hover:tw-text-fg-heading","focus-visible:tw-text-fg-heading"],light:["tw-text-fg-white","hover:tw-text-fg-white","focus-visible:tw-text-fg-white","focus-visible:before:tw-ring-fg-contrast"],subtle:["!tw-text-fg-heading","hover:tw-text-fg-heading","focus-visible:tw-text-fg-heading"],success:["tw-text-fg-success","hover:tw-text-fg-success-strong","focus-visible:tw-text-fg-success-strong"],warning:["tw-text-fg-warning","hover:tw-text-fg-warning-strong","focus-visible:tw-text-fg-warning-strong"],danger:["tw-text-fg-danger","hover:tw-text-fg-danger-strong","focus-visible:tw-text-fg-danger-strong"],contrast:["tw-text-fg-contrast","hover:tw-text-fg-contrast-strong","focus-visible:tw-text-fg-contrast-strong","focus-visible:before:tw-ring-fg-contrast"]},h=["tw-text-unset","tw-leading-none","tw-px-0","tw-py-0.5","tw-font-semibold","tw-bg-transparent","tw-border-0","tw-border-none","tw-rounded","tw-transition","tw-no-underline","tw-cursor-pointer","[&:hover_span]:tw-underline","[&.tw-test-hover_span]:tw-underline","[&:hover_span]:tw-decoration-[.125em]","[&.tw-test-hover_span]:tw-decoration-[.125em]","focus-visible:tw-outline-none","focus-visible:before:tw-ring-border-focus","[&:focus-visible_span]:tw-underline","[&:focus-visible_span]:tw-decoration-[.125em]","[&.tw-test-focus-visible_span]:tw-underline","[&.tw-test-focus-visible_span]:tw-decoration-[.125em]","tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-x-[0.1em]","before:-tw-inset-y-[0]","before:tw-rounded-md","before:tw-transition","before:tw-h-full","before:tw-w-[calc(100%_+_.25rem)]","before:tw-pointer-events-none","focus-visible:before:tw-ring-2","focus-visible:tw-z-10","aria-disabled:tw-no-underline","aria-disabled:tw-pointer-events-none","aria-disabled:!tw-text-fg-disabled","aria-disabled:hover:!tw-text-fg-disabled","aria-disabled:hover:tw-no-underline","[&[aria-disabled]:focus-visible_span]:!tw-no-underline"];class A{focus(){this.el.nativeElement.focus()}constructor(){this.el=(0,r.WQX)(s.aKT),this.linkType=(0,n.hFB)("primary"),this.startIcon=(0,n.hFB)(void 0),this.endIcon=(0,n.hFB)(void 0),this.disabled=(0,n.hFB)(!1,{transform:n.L39}),this.isButton="BUTTON"===this.el.nativeElement.tagName,this.classList=(0,o.EW)(()=>{var e;return[!this.isButton&&"tw-inline-flex"].concat(h).concat(null!==(e=u[this.linkType()])&&void 0!==e?e:[])}),this.isButton&&(0,a.m)(this.el.nativeElement,this.disabled)}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=s.VBU({type:A,selectors:[["a","bitLink",""],["button","bitLink",""]],hostVars:3,hostBindings:function(e,t){2&e&&(s.BMQ("bit-aria-disable",!!t.isButton||null),s.HbH(t.classList()))},inputs:{linkType:[1,"linkType"],startIcon:[1,"startIcon"],endIcon:[1,"endIcon"],disabled:[1,"disabled"]},attrs:["bitLink",""],ngContentSelectors:["*"],decls:5,vars:2,consts:[[1,"tw-flex","tw-gap-2","tw-items-center"],["aria-hidden","true",3,"class"],[1,"empty:tw-hidden"],["aria-hidden","true"]],template:function(e,t){1&e&&(s.NAR(),s.rj2(0,"div",0),s.nVh(1,c,1,4,"i",1),s.rj2(2,"span",2),s.SdG(3),s.eux(),s.nVh(4,d,1,4,"i",1),s.eux()),2&e&&(s.R7$(),s.vxM(t.startIcon()?1:-1),s.R7$(3),s.vxM(t.endIcon()?4:-1))},encapsulation:2,changeDetection:0})},57396(e,t,i){"use strict";i.d(t,{RR:()=>r,_1:()=>s,cY:()=>n});class n{constructor(e={}){Object.assign(this,e)}static fromResponse(e){return new n({id:e.id,granteeId:e.granteeId,name:e.name,email:e.email,type:e.type,status:e.status,waitTimeDays:e.waitTimeDays,creationDate:e.creationDate,avatarColor:e.avatarColor})}}class r{constructor(e={}){Object.assign(this,e)}static fromResponse(e){return new r({id:e.id,grantorId:e.grantorId,name:e.name,email:e.email,type:e.type,status:e.status,waitTimeDays:e.waitTimeDays,creationDate:e.creationDate,avatarColor:e.avatarColor})}}class s extends n{}},58270(e,t,i){"use strict";i.d(t,{c:()=>o});var n=i(43978),r=i(33812),s=i(50700);class o{constructor(e){this.i18nService=e}transform(e){if(null==e)return this.i18nService.t("unknown");switch(e){case n.D7.Owner:return this.i18nService.t("owner");case n.D7.Admin:return this.i18nService.t("admin");case n.D7.User:return this.i18nService.t("user");case n.D7.Custom:return this.i18nService.t("custom")}}}o.ɵfac=function(e){return new(e||o)(r.rXU(s.W,16))},o.ɵpipe=r.EJ8({name:"userType",type:o,pure:!0})},58329(e,t,i){"use strict";i.d(t,{Q:()=>n});class n{}},58384(e,t,i){"use strict";i.d(t,{R:()=>o});var n=i(94573),r=i(33277),s=i(33812);class o{constructor(){this.name=n.hFB.required(),this.ariaLabel=(0,n.hFB)(),this.fixedWidth=(0,n.hFB)(!1,{transform:n.L39}),this.classList=(0,r.EW)(()=>["bwi",this.name(),this.fixedWidth()&&"bwi-fw"].filter(Boolean))}}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=s.VBU({type:o,selectors:[["bit-icon"]],hostVars:4,hostBindings:function(e,t){2&e&&(s.BMQ("aria-hidden",!t.ariaLabel()||null)("aria-label",t.ariaLabel()),s.HbH(t.classList()))},inputs:{name:[1,"name"],ariaLabel:[1,"ariaLabel"],fixedWidth:[1,"fixedWidth"]},decls:0,vars:0,template:function(e,t){},encapsulation:2,changeDetection:0})},58412(e,t,i){"use strict";i.d(t,{OU:()=>n,fQ:()=>s,ql:()=>r});const n={Premium:"premium",Families:"families"},r={Free:"free",Teams:"teams",Enterprise:"enterprise",Custom:"custom"},s={Annually:"annually",Monthly:"monthly"}},58503(e,t,i){"use strict";i.d(t,{b:()=>C});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(94735),h=i(26411),A=i(47135),p=i(73638),g=i(90246),v=i(86226),f=i(50352),m=i(25740),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({wordCapitalize:[!1],wordIncludeNumber:[!1]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return y(this,void 0,void 0,function*(){"account"in e&&this.account$.next(this.account)})}ngOnInit(){return y(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(p.qG.effWordList,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}C.ɵfac=function(e){return new(e||C)(n.rXU(r.ok),n.rXU(p.iE))},C.ɵcmp=n.VBU({type:C,selectors:[["tools-username-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:11,vars:7,consts:[[1,"tw-container",3,"formGroup"],["bitCheckbox","","formControlName","wordCapitalize","type","checkbox",3,"change"],["bitCheckbox","","formControlName","wordIncludeNumber","type","checkbox",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-control")(2,"input",1),n.bIt("change",function(){return t.save("wordCapitalize")}),n.k0s(),n.j41(3,"bit-label"),n.EFF(4),n.nI1(5,"i18n"),n.k0s()(),n.j41(6,"bit-form-control")(7,"input",2),n.bIt("change",function(){return t.save("wordIncludeNumber")}),n.k0s(),n.j41(8,"bit-label"),n.EFF(9),n.nI1(10,"i18n"),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(4),n.JRh(n.bMT(5,3,"capitalize")),n.R7$(5),n.JRh(n.bMT(10,5,"includeNumber")))},dependencies:[r.X1,r.qT,r.Zm,r.BC,r.cb,r.j4,r.JD,h.L,g.f,v.j,A.q,f.P,u.p,m.$],encapsulation:2})},58604(e,t,i){"use strict";i.d(t,{g:()=>l});var n=i(94573),r=i(74208),s=i(67519),o=i(90143),a=i(33812);class l{constructor(){this.baseChip=(0,r.WQX)(s.rg,{host:!0}),this.startIcon=(0,n.hFB)(),this.label=(0,n.hFB)("")}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=a.VBU({type:l,selectors:[["a","bit-chip-action",""],["button","bit-chip-action",""]],inputs:{startIcon:[1,"startIcon"],label:[1,"label"]},features:[a.nM4([{directive:s.rg,inputs:["variant","variant","size","size","disabled","disabled","maxWidthClass","maxWidthClass"]}])],attrs:["bit-chip-action",""],decls:2,vars:3,consts:[[3,"startIcon","size"]],template:function(e,t){1&e&&(a.j41(0,"bit-chip-content",0),a.EFF(1),a.k0s()),2&e&&(a.Y8G("startIcon",t.startIcon())("size",t.baseChip.size()),a.R7$(),a.SpI(" ",t.label(),"\n"))},dependencies:[o.l],encapsulation:2,changeDetection:0})},58605(e,t,i){"use strict";i.d(t,{Y:()=>n});class n{}},58688(e,t,i){"use strict";i.d(t,{T:()=>f});var n=i(33812),r=i(72245),s=i(35500),o=i(77468),a=i(51757),l=i(86226),c=i(97553),d=i(43759),u=i(25740),h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function A(e,t){if(1&e&&(n.j41(0,"form",2,0)(2,"bit-form-field")(3,"bit-label"),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.nrm(6,"input",3),n.k0s()()),2&e){const e=n.XpG();n.Y8G("formGroup",e.formGroup),n.R7$(4),n.JRh(n.bMT(5,2,"organizationName"))}}function p(e,t){1&e&&(n.j41(0,"bit-form-field",6)(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.nrm(4,"input",9),n.k0s()),2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"clientOwnerEmail")))}function g(e,t){if(1&e&&(n.j41(0,"div",5)(1,"bit-form-field",6)(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.nrm(5,"input",3),n.k0s(),n.j41(6,"bit-form-field",6)(7,"bit-label"),n.EFF(8),n.nI1(9,"i18n"),n.k0s(),n.nrm(10,"input",7),n.k0s(),n.DNE(11,p,5,3,"bit-form-field",8),n.k0s()),2&e){const e=n.XpG(2);n.R7$(3),n.JRh(n.bMT(4,3,"organizationName")),n.R7$(5),n.JRh(n.bMT(9,5,"email")),n.R7$(3),n.Y8G("ngIf",e.isProvider)}}function v(e,t){if(1&e&&(n.j41(0,"form",2,0)(2,"h2"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.DNE(5,g,12,7,"div",4),n.k0s()),2&e){const e=n.XpG();n.Y8G("formGroup",e.formGroup),n.R7$(3),n.JRh(n.bMT(4,3,"generalInformation")),n.R7$(2),n.Y8G("ngIf",e.createOrganization)}}class f{constructor(e){this.accountService=e,this.nameOnly=!1,this.createOrganization=!0,this.isProvider=!1,this.acceptingSponsorship=!1,this.changedBusinessOwned=new n.bkB}ngOnInit(){return h(this,void 0,void 0,function*(){var e,t,i;if(null===(i=null===(t=null===(e=this.formGroup)||void 0===e?void 0:e.controls)||void 0===t?void 0:t.billingEmail)||void 0===i?void 0:i.value)return;const n=yield(0,r._)(this.accountService.activeAccount$);(null==n?void 0:n.email)&&this.formGroup.controls.billingEmail.setValue(n.email)})}}f.ɵfac=function(e){return new(e||f)(n.rXU(s.D))},f.ɵcmp=n.VBU({type:f,selectors:[["app-org-info"]],inputs:{nameOnly:"nameOnly",createOrganization:"createOrganization",isProvider:"isProvider",acceptingSponsorship:"acceptingSponsorship",formGroup:"formGroup"},outputs:{changedBusinessOwned:"changedBusinessOwned"},standalone:!1,decls:2,vars:2,consts:[["form",""],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["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&&n.DNE(0,A,7,4,"form",1)(1,v,6,5,"form",1),2&e&&(n.Y8G("ngIf",t.nameOnly),n.R7$(),n.Y8G("ngIf",!t.nameOnly))},dependencies:[o.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,l.j,c.J,d.h,u.$],encapsulation:2})},58806(e,t,i){"use strict";i.d(t,{r:()=>a});var n=i(94573),r=i(33812);const s={h1:["!tw-text-3xl","tw-text-main","tw-font-medium"],h2:["!tw-text-2xl","tw-text-main","tw-font-medium"],h3:["!tw-text-xl","tw-text-main","tw-font-medium"],h4:["!tw-text-lg","tw-text-main","tw-font-medium"],h5:["!tw-text-base","tw-text-main","tw-font-medium"],h6:["!tw-text-sm","tw-text-main","tw-font-medium"],body1:["!tw-text-base"],body2:["!tw-text-sm"],helper:["!tw-text-xs"]},o={h1:["tw-mb-2"],h2:["tw-mb-2"],h3:["tw-mb-2"],h4:["tw-mb-2"],h5:["tw-mb-1.5"],h6:["tw-mb-1.5"],body1:[],body2:[],helper:[]};class a{constructor(){this.bitTypography=n.hFB.required(),this.noMargin=(0,n.hFB)(!1,{transform:n.L39})}get classList(){return s[this.bitTypography()].concat(this.noMargin()?[]:o[this.bitTypography()])}}a.ɵfac=function(e){return new(e||a)},a.ɵdir=r.FsC({type:a,selectors:[["","bitTypography",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)},inputs:{bitTypography:[1,"bitTypography"],noMargin:[1,"noMargin"]}})},58950(e,t,i){"use strict";i.d(t,{U:()=>o});var n=i(75583),r=i(33812);const s=["*",[["","slot","end"]]];class o{}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=r.VBU({type:o,selectors:[["bit-section-header"]],hostAttrs:[1,"tw-block","has-[+_*_bit-card]:tw-pb-1","has-[+_bit-card]:tw-pb-1","has-[+_*_bit-item]:tw-pb-1","has-[+_bit-item]:tw-pb-1","has-[+_*_bit-card]:tw-px-1","has-[+_bit-card]:tw-px-1","has-[+_*_bit-item]:tw-px-1","has-[+_bit-item]:tw-px-1"],ngContentSelectors:["*","[slot=end]"],decls:5,vars:0,consts:[[1,"tw-flex","tw-justify-between","tw-items-end","tw-gap-1"],[1,"[&>*]:tw-mb-0","[&>*]:tw-text-main","tw-flex","tw-items-center","tw-gap-1"],[1,"tw-text-muted","-tw-mb-0.5"]],template:function(e,t){1&e&&(r.NAR(s),r.rj2(0,"div",0)(1,"div",1),r.SdG(2),r.eux(),r.rj2(3,"div",2),r.SdG(4,1),r.eux()())},dependencies:[n.E],encapsulation:2})},59281(e,t,i){"use strict";i.d(t,{e:()=>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)}}},59303(e,t,i){"use strict";i.d(t,{e:()=>s,k:()=>o});var n=i(16878);const r=new Proxy(Object.freeze({}),{get:()=>({})});class s{constructor(){this.constraints=r}calibrate(){return this}adjust(e){return e}fix(e){return e}}function o(){const e=new s;return new n.t(e)}},59333(e,t,i){"use strict";i.d(t,{J:()=>p});var n=i(25607),r=i(12277),s=i(20702),o=i(42700);class a extends s.r{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 s.r{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 s.r{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 d extends s.r{constructor(e){super(e),this.ciphers=[],this.keyEncrypted=this.getResponseProperty("KeyEncrypted");const t=this.getResponseProperty("Ciphers");null!=t&&(this.ciphers=t.map(e=>new o.N(e)))}}var u=i(74208),h=i(12012),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{constructor(e){this.apiService=e}getEmergencyAccessTrusted(){return A(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/emergency-access/trusted",null,!0,!0);return new r.s(e,a)})}getEmergencyAccessGranted(){return A(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/emergency-access/granted",null,!0,!0);return new r.s(e,l)})}getEmergencyAccess(e){return A(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 A(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/emergency-access/"+e+"/policies",null,!0,!0);return new r.s(t,n.i)})}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 A(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 A(this,void 0,void 0,function*(){yield this.apiService.send("POST","/emergency-access/"+e+"/password",t,!0,!0)})}postEmergencyAccessView(e){return A(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/emergency-access/"+e+"/view",null,!0,!0);return new d(t)})}}p.ɵfac=function(e){return new(e||p)(u.KVO(h.G))},p.ɵprov=u.jDH({token:p,factory:p.ɵfac})},59525(e,t,i){"use strict";i.d(t,{s:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},59557(e,t,i){"use strict";i.d(t,{K:()=>h});var n=i(77468),r=i(74208),s=i(94573),o=i(6056);const a=i(82392).JW`
<svg version="1.1" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" fill="none">
<title>Vaultwarden</title>
<g clip-path="url(#bitwarden-shield-clip)">
 <path class="tw-fill-fg-nav" d="m18 11-5.6.00073 15 42h5.3l15-42h-5.6l-9.5 27c-.63 1.7-1.2 3.4-1.6 4.9-.43 1.5-.79 2.9-1.1 4.3-.28-1.4-.63-2.8-1.1-4.4-.43-1.5-.97-3.2-1.6-5l-9.5-27z"/>
 <path class="tw-fill-fg-nav" d="m30 0.05c-0.19 0.068-0.34 0.2-0.44 0.37l-1.5 2.5c-0.27 0.022-0.53 0.046-0.8 0.076l-2-2.2c-0.43-0.44-1.2-0.29-1.4 0.29l-1 2.8c-0.26 0.074-0.51 0.15-0.77 0.23l-2.4-1.8c-0.52-0.45-1.3-0.12-1.4 0.56l-0.44 2.9c-0.23 0.12-0.47 0.24-0.7 0.37l-2.7-1.3c-0.58-0.26-1.2 0.18-1.2 0.81l0.14 3c-0.2 0.16-0.4 0.33-0.6 0.49l-2.9-0.72c-0.59-0.12-1.1 0.41-1 1l0.72 2.9c-0.17 0.2-0.33 0.4-0.49 0.6l-3-0.14c-0.63-0.027-1.1 0.62-0.81 1.2l1.3 2.7c-0.13 0.23-0.25 0.46-0.37 0.7l-2.9 0.44c-0.68 0.068-1 0.88-0.56 1.4l1.8 2.4c-0.081 0.25-0.16 0.51-0.23 0.77l-2.8 1c-0.58 0.22-0.73 0.97-0.29 1.4l2.2 2c-0.03 0.26-0.054 0.53-0.076 0.8l-2.5 1.5c-0.6 0.32-0.6 1.2 0 1.5l2.5 1.5c0.022 0.27 0.046 0.53 0.076 0.8l-2.2 2c-0.44 0.43-0.29 1.2 0.29 1.4l2.8 1c0.074 0.26 0.15 0.51 0.23 0.77l-1.8 2.4c-0.45 0.52-0.12 1.3 0.56 1.4l2.9 0.44c0.12 0.23 0.24 0.47 0.37 0.7l-1.3 2.7c-0.26 0.58 0.18 1.2 0.81 1.2l3-0.14c0.16 0.2 0.33 0.4 0.49 0.6l-0.72 2.9c-0.12 0.59 0.41 1.1 1 1l2.9-0.72c0.2 0.17 0.4 0.33 0.6 0.49l-0.14 3c-0.027 0.63 0.62 1.1 1.2 0.81l2.7-1.3c0.23 0.13 0.46 0.25 0.7 0.37l0.44 2.9c0.068 0.68 0.88 1 1.4 0.56l2.4-1.8c0.25 0.081 0.51 0.16 0.77 0.23l1 2.8c0.22 0.58 0.97 0.73 1.4 0.29l2-2.2c0.26 0.03 0.53 0.054 0.8 0.076l1.5 2.5c0.32 0.6 1.2 0.6 1.5 0l1.5-2.5c0.27-0.022 0.53-0.046 0.8-0.076l2 2.2c0.43 0.44 1.2 0.29 1.4-0.29l1-2.8c0.26-0.074 0.51-0.15 0.77-0.23l2.4 1.8c0.52 0.45 1.3 0.12 1.4-0.56l0.44-2.9c0.23-0.12 0.47-0.24 0.7-0.37l2.7 1.3c0.58 0.26 1.2-0.18 1.2-0.81l-0.14-3c0.2-0.16 0.4-0.33 0.6-0.49l2.9 0.72c0.59 0.12 1.1-0.41 1-1l-0.72-2.9c0.17-0.2 0.33-0.4 0.49-0.6l3 0.14c0.63 0.027 1.1-0.62 0.81-1.2l-1.3-2.7c0.13-0.23 0.25-0.46 0.37-0.7l2.9-0.44c0.68-0.068 1-0.88 0.56-1.4l-1.8-2.4c0.081-0.25 0.16-0.51 0.23-0.77l2.8-1c0.58-0.22 0.73-0.97 0.29-1.4l-2.2-2c0.03-0.26 0.054-0.53 0.076-0.8l2.5-1.5c0.6-0.32 0.6-1.2 0-1.5l-2.5-1.5c-0.022-0.27-0.046-0.53-0.076-0.8l2.2-2c0.44-0.43 0.29-1.2-0.29-1.4l-2.8-1c-0.074-0.26-0.15-0.51-0.23-0.77l1.8-2.4c0.45-0.52 0.12-1.3-0.56-1.4l-2.9-0.44c-0.12-0.23-0.24-0.47-0.37-0.7l1.3-2.7c0.26-0.58-0.18-1.2-0.81-1.2l-3 0.14c-0.16-0.2-0.33-0.4-0.49-0.6l0.72-2.9c0.12-0.59-0.41-1.1-1-1l-2.9 0.72c-0.2-0.17-0.4-0.33-0.6-0.49l0.14-3c0.027-0.63-0.62-1.1-1.2-0.81l-2.7 1.3c-0.23-0.13-0.46-0.25-0.7-0.37l-0.44-2.9c-0.068-0.68-0.88-1-1.4-0.56l-2.4 1.8c-0.25-0.081-0.51-0.16-0.77-0.23l-1-2.8c-0.22-0.58-0.97-0.73-1.4-0.29l-2 2.2c-0.26-0.03-0.53-0.054-0.8-0.076l-1.5-2.5c-0.2-0.34-0.62-0.5-1-0.37zm0.29 5.4c0.94 0 1.7 0.76 1.7 1.7s-0.76 1.7-1.7 1.7-1.7-0.76-1.7-1.7 0.76-1.7 1.7-1.7zm-4 2.9 2.8 2.8c0.66 0.66 1.7 0.66 2.4 0l2.8-2.8c6.6 1.2 12 5.4 15 11l-1.8 3.6c-0.43 0.84-0.097 1.9 0.75 2.3l3.6 1.8c0.12 0.92 0.18 1.9 0.18 2.8 0 5.8-2.3 11-6 15l-4-0.63c-0.94-0.18-1.8 0.45-2 1.4l-0.63 4c-2.8 1.3-6 2.1-9.4 2.1s-6.5-0.76-9.4-2.1l-0.63-4c-0.15-0.95-1.1-1.6-2-1.4l-4 0.63c-3.7-3.9-6-9.2-6-15 0-0.96 0.064-1.9 0.18-2.8l3.6-1.8c0.85-0.42 1.2-1.5 0.75-2.3l-1.8-3.6c3.1-5.7 8.6-9.8 15-11zm-18 13c0.16 0.0045 0.32 0.032 0.48 0.083 0.93 0.29 1.4 1.3 1.1 2.2-0.29 0.93-1.3 1.4-2.2 1.1-0.93-0.29-1.4-1.3-1.1-2.2 0.23-0.74 0.93-1.2 1.7-1.2zm43 0c0.77-0.034 1.5 0.46 1.7 1.2 0.33 0.91-0.17 1.9-1.1 2.2-0.91 0.33-1.9-0.17-2.2-1.1-0.33-0.91 0.17-1.9 1.1-2.2 0.16-0.051 0.32-0.079 0.48-0.083zm-35 25c0.33 0.017 0.64 0.13 0.91 0.32 0.78 0.55 0.95 1.6 0.38 2.4-0.55 0.78-1.6 0.95-2.4 0.38-0.78-0.55-0.95-1.6-0.38-2.4 0.34-0.48 0.91-0.74 1.5-0.7zm27 0c0.59-0.042 1.2 0.22 1.5 0.7 0.57 0.77 0.4 1.8-0.38 2.4-0.77 0.57-1.8 0.4-2.4-0.38-0.57-0.77-0.4-1.8 0.38-2.4 0.27-0.19 0.58-0.3 0.91-0.32z"/>
</g>
<defs>
  <clipPath id="bitwarden-shield-clip">
    <path class="tw-fill-fg-nav" d="M0 0h60v60H0z"/>
  </clipPath>
</defs>
</svg>
`;var l=i(8168),c=i(21823),d=i(33812);const u=(e,t,i,n)=>({"tw-sticky tw-top-0 tw-z-50 tw-pb-4":e,"tw-pb-[calc(theme(spacing.8)_+_2px)]":t,"tw-pt-[calc(0.5rem_+_var(--bit-sidenav-extra-top-padding,_0px))]":i,"tw-pt-2":n});class h{constructor(){this.sideNavService=(0,r.WQX)(c.G),this.closedIcon=(0,s.hFB)(a),this.openIcon=s.hFB.required(),this.route=s.hFB.required(),this.label=s.hFB.required()}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=d.VBU({type:h,selectors:[["bit-nav-logo"]],hostAttrs:[1,"tw-contents"],inputs:{closedIcon:[1,"closedIcon"],openIcon:[1,"openIcon"],route:[1,"route"],label:[1,"label"]},decls:3,vars:12,consts:[[1,"tw-px-2","tw-bg-bg-nav",3,"ngClass"],["routerLinkActive","","ariaCurrentWhenActive","page",1,"tw-relative","tw-p-3","tw-block","tw-rounded-md","tw-outline-none","focus-visible:tw-ring","focus-visible:tw-ring-inset","focus-visible:tw-ring-border-nav-focus","hover:tw-bg-bg-nav-hover","tw-h-[73px]","[&_svg]:tw-absolute","[&_svg]:tw-inset-[.6875rem]","[&_svg]:tw-w-[200px]",3,"routerLink","title"],[3,"content"]],template:function(e,t){1&e&&(d.j41(0,"div",0)(1,"a",1),d.nrm(2,"bit-svg",2),d.k0s()()),2&e&&(d.Y8G("ngClass",d.ziG(7,u,t.sideNavService.open(),!t.sideNavService.open(),t.sideNavService.isOverlay(),!t.sideNavService.isOverlay())),d.R7$(),d.HbH(t.sideNavService.open()?"":"!tw-h-[55px] [&_svg]:!tw-w-[26px]"),d.Y8G("routerLink",t.route())("title",t.label()),d.BMQ("aria-label",t.label()),d.R7$(),d.Y8G("content",t.sideNavService.open()?t.openIcon():t.closedIcon()))},dependencies:[n.YU,o.wQ,o.Wk,l.k],encapsulation:2,changeDetection:0})},59777(e,t,i){"use strict";i.d(t,{D:()=>r,L:()=>n});const n={Domain:0,Host:1,StartsWith:2,Exact:3,RegularExpression:4,Never:5};function r(e){if(null!=e)switch(e){case 0:case 1:case 2:case 3:case 4:case 5:return e;default:return}}},60276(e,t,i){"use strict";i.d(t,{G:()=>C,V:()=>y});var n=i(33338),r=i(3204),s=i(27442),o=i(44500),a=i(1036),l=i(685),c=i(3633),d=i(59777),u=i(78781),h=i(31857),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const p=new h.Zs(h.XH,"showFavicons",{deserializer:e=>null==e||e}),g=new h.Zs(h.XH,"neverDomains",{deserializer:e=>null!=e?e:null}),v=new h.Zs(h.XH,"blockedInteractionsUris",{deserializer:e=>null!=e?e:{}}),f=new h.Ok(h.XH,"equivalentDomains",{deserializer:e=>null!=e?e:null,clearOn:["logout"]}),m=new h.Ok(h.XH,"defaultUriMatchStrategy",{deserializer:e=>null!=e?e:d.L.Domain,clearOn:[]});class y{}class C{constructor(e,t,i){this.stateProvider=e,this.policyService=t,this.accountService=i,this.showFaviconsState=this.stateProvider.getGlobal(p),this.showFavicons$=this.showFaviconsState.state$.pipe((0,r.T)(e=>null==e||e)),this.neverDomainsState=this.stateProvider.getGlobal(g),this.neverDomains$=this.neverDomainsState.state$.pipe((0,r.T)(e=>null!=e?e:null)),this.blockedInteractionsUrisState=this.stateProvider.getGlobal(v),this.blockedInteractionsUris$=this.blockedInteractionsUrisState.state$.pipe((0,r.T)(e=>null!=e?e:{})),this.equivalentDomainsState=this.stateProvider.getActive(f),this.equivalentDomains$=this.equivalentDomainsState.state$.pipe((0,r.T)(e=>null!=e?e:null)),this.defaultUriMatchStrategyState=this.stateProvider.getActive(m),this.defaultUriMatchStrategy$=this.defaultUriMatchStrategyState.state$.pipe((0,r.T)(e=>null!=e?e:d.L.Domain)),this.defaultUriMatchStrategyPolicy$=this.accountService.activeAccount$.pipe(c.F6,(0,o.n)(e=>this.policyService.policiesByType$(a.t.UriMatchDefaults,e)),l.Zc,(0,r.T)(e=>{var t;if(!(null==e?void 0:e.enabled)||null==(null==e?void 0:e.data))return null;const i=null===(t=e.data)||void 0===t?void 0:t.uriMatchDetection;return Object.values(d.L).includes(i)?i:null}),(0,s.t)({bufferSize:1,refCount:!0})),this.resolvedDefaultUriMatchStrategy$=(0,n.z)([this.defaultUriMatchStrategy$,this.defaultUriMatchStrategyPolicy$]).pipe((0,r.T)(([e,t])=>t||e),(0,s.t)({bufferSize:1,refCount:!0}))}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)})}setBlockedInteractionsUris(e){return A(this,void 0,void 0,function*(){yield this.blockedInteractionsUrisState.update(()=>e)})}setEquivalentDomains(e,t){return A(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,f).update(()=>e)})}setDefaultUriMatchStrategy(e){return A(this,void 0,void 0,function*(){yield this.defaultUriMatchStrategyState.update(()=>e)})}getUrlEquivalentDomains(e){return this.equivalentDomains$.pipe((0,r.T)(t=>{const i=u.A.getDomain(e);if(null==i||null==t)return new Set;const n=t.filter(e=>e.includes(i)).flat();return new Set(n)}))}}},60512(e,t,i){"use strict";function n(e,t,i){if(null==e)throw new Error(`${t} is null or undefined.${i?` ${i}`:""}`)}i.d(t,{x:()=>n})},60577(e,t,i){"use strict";i.d(t,{H:()=>l});var n=i(7861),r=i(14055),s=i(74208),o=i(12012),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class l{constructor(e){this.apiService=e,this.getEndpoint=e=>{switch(e.type){case"account":return"/account/billing/vnext";case"organization":return`/organizations/${e.data.id}/billing/vnext`;case"provider":return`/providers/${e.data.id}/billing/vnext`}},this.addCreditWithBitPay=(e,t)=>a(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/credit/bitpay`;try{return{type:"success",value:yield this.apiService.send("POST",i,t,!0,!0)}}catch(r){if(r instanceof n._)return{type:"error",message:r.message};throw r}}),this.getBillingAddress=e=>a(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/address`,i=yield this.apiService.send("GET",t,null,!0,!0);return i?new r.TU(i):null}),this.getCredit=e=>a(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/credit`,i=yield this.apiService.send("GET",t,null,!0,!0);return i||null}),this.getPaymentMethod=e=>a(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/payment-method`,i=yield this.apiService.send("GET",t,null,!0,!0);return i?new r.cD(i).value:null}),this.restartSubscription=(e,t,i)=>a(this,void 0,void 0,function*(){const n=`${this.getEndpoint(e)}/subscription/restart`;yield this.apiService.send("POST",n,{paymentMethod:t,billingAddress:i},!0,!1)}),this.updateBillingAddress=(e,t)=>a(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/address`;try{const e=yield this.apiService.send("PUT",i,t,!0,!0);return{type:"success",value:new r.TU(e)}}catch(s){if(s instanceof n._)return{type:"error",message:s.message};throw s}}),this.updatePaymentMethod=(e,t,i)=>a(this,void 0,void 0,function*(){const s=`${this.getEndpoint(e)}/payment-method`;try{const e=Object.assign(Object.assign({},t),{billingAddress:i}),n=yield this.apiService.send("PUT",s,e,!0,!0);return{type:"success",value:new r.cD(n).value}}catch(o){if(o instanceof n._)return{type:"error",message:o.message};throw o}}),this.verifyBankAccount=(e,t)=>a(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/payment-method/verify-bank-account`;try{const e=yield this.apiService.send("POST",i,{descriptorCode:t},!0,!0);return{type:"success",value:new r.cD(e).value}}catch(s){if(s instanceof n._)return{type:"error",message:s.message};throw s}})}}l.ɵfac=function(e){return new(e||l)(s.KVO(o.G))},l.ɵprov=s.jDH({token:l,factory:l.ɵfac,providedIn:"root"})},60893(e,t,i){"use strict";i.d(t,{t:()=>o});var n=i(5520),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.S]})},61182(e,t,i){"use strict";i.d(t,{d:()=>r});var n=i(20702);class r extends n.r{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"))}}},61325(e,t,i){"use strict";i.d(t,{n:()=>l});var n,r=i(59777),s=i(78781),o=i(31442),a=i(16671);class l{}n=l,l.isCipherListView=e=>"object"==typeof e.type||"string"==typeof e.type,l.getLogin=e=>n.isCipherListView(e)?"object"!=typeof e.type?null:"login"in e.type?e.type.login:null:e.type===o.gC.Login?e.login:null,l.uri=e=>{var t;const i=n.getLogin(e);return i?"uri"in i?i.uri:(null===(t=i.uris)||void 0===t?void 0:t.length)?i.uris[0].uri:null:null},l.getCard=e=>n.isCipherListView(e)?"object"!=typeof e.type?null:"card"in e.type?e.type.card:null:e.type===o.gC.Card?e.card:null,l.isArchived=e=>n.isCipherListView(e)?!!e.archivedDate:e.isArchived,l.isDeleted=e=>n.isCipherListView(e)?!!e.deletedDate:e.isDeleted,l.isUnassigned=e=>n.isCipherListView(e)?null!=e.organizationId&&(null==e.collectionIds||0===e.collectionIds.length):e.isUnassigned,l.canAssignToCollections=e=>n.isCipherListView(e)?!e.organizationId||e.edit&&e.viewPassword:e.canAssignToCollections,l.getType=e=>{if(!n.isCipherListView(e))return e.type;switch(!0){case"secureNote"===e.type:return o.gC.SecureNote;case"sshKey"===e.type:return o.gC.SshKey;case"identity"===e.type:return o.gC.Identity;case"object"==typeof e.type&&"card"in e.type:return o.gC.Card;case"object"==typeof e.type&&"login"in e.type:return o.gC.Login;default:throw new Error(`Unknown cipher type: ${e.type}`)}},l.subtitle=e=>n.isCipherListView(e)?e.subtitle:e.subTitle,l.hasAttachments=e=>n.isCipherListView(e)?"number"==typeof e.attachments&&e.attachments>0:e.hasAttachments,l.canLaunch=e=>{var t;const i=n.getLogin(e);return!!i&&!!(null===(t=i.uris)||void 0===t?void 0:t.map(e=>d(e)).some(e=>e.canLaunch))},l.getLaunchUri=e=>{var t,i;const r=n.getLogin(e);if(r)return null===(i=null===(t=r.uris)||void 0===t?void 0:t.map(e=>d(e)).find(e=>e.canLaunch))||void 0===i?void 0:i.launchUri},l.matchesUri=(e,t,i,s=r.L.Domain,l)=>{var c;if(n.getType(e)!==o.gC.Login)return!1;if(!n.isCipherListView(e))return e.login.matchesUri(t,i,s,l);const d=n.getLogin(e);if(!(null===(c=null==d?void 0:d.uris)||void 0===c?void 0:c.length))return!1;const u=d.uris.filter(e=>!!e.uri).map(e=>{var t;const i=new a.z;return i.match=null!==(t=e.match)&&void 0!==t?t:s,i.uri=e.uri,i});return u.some(e=>e.matchesUri(t,i,s,l))},l.hasCopyableValue=(e,t)=>{var i,r,s,a,l,d,u,h,A,p,g,v,f,m;if(n.isCipherListView(e)){let s=t;return"username"===s&&n.getType(e)===o.gC.Login?s="usernameLogin":"username"===s&&n.getType(e)===o.gC.Identity&&(s="usernameIdentity"),null!==(r=null===(i=e.copyableFields)||void 0===i?void 0:i.includes(c[s]))&&void 0!==r&&r}switch(t){case"username":return!!(null===(s=e.login)||void 0===s?void 0:s.username)||!!(null===(a=e.identity)||void 0===a?void 0:a.username);case"password":return!!(null===(l=e.login)||void 0===l?void 0:l.password);case"totp":return!!(null===(d=e.login)||void 0===d?void 0:d.totp);case"cardNumber":return!!(null===(u=e.card)||void 0===u?void 0:u.number);case"securityCode":return!!(null===(h=e.card)||void 0===h?void 0:h.code);case"email":return!!(null===(A=e.identity)||void 0===A?void 0:A.email);case"phone":return!!(null===(p=e.identity)||void 0===p?void 0:p.phone);case"address":return!!(null===(g=e.identity)||void 0===g?void 0:g.fullAddressForCopy);case"secureNote":return!!e.notes;case"privateKey":return!!(null===(v=e.sshKey)||void 0===v?void 0:v.privateKey);case"publicKey":return!!(null===(f=e.sshKey)||void 0===f?void 0:f.publicKey);case"keyFingerprint":return!!(null===(m=e.sshKey)||void 0===m?void 0:m.keyFingerprint);default:return!1}},l.hasFido2Credentials=e=>{var t;const i=n.getLogin(e);return!!(null===(t=null==i?void 0:i.fido2Credentials)||void 0===t?void 0:t.length)},l.decryptionFailure=e=>"decryptionFailure"in e&&e.decryptionFailure,l.getNotes=e=>e.notes,l.getFields=e=>(n.isCipherListView(e),e.fields),l.getAttachmentNames=e=>{var t;return n.isCipherListView(e)?e.attachmentNames:null===(t=e.attachments)||void 0===t?void 0:t.map(e=>e.fileName).filter(e=>null!=e)},l.getUriHostname=e=>{var t;if("hostname"in e&&void 0!==e.hostname)return null!==(t=e.hostname)&&void 0!==t?t:void 0;if(e.match!==r.L.RegularExpression&&e.uri){const t=s.A.getHostname(e.uri);return""===t?void 0:t}};const c={usernameLogin:"LoginUsername",password:"LoginPassword",totp:"LoginTotp",cardNumber:"CardNumber",securityCode:"CardSecurityCode",usernameIdentity:"IdentityUsername",email:"IdentityEmail",phone:"IdentityPhone",address:"IdentityAddress",secureNote:"SecureNotes",privateKey:"SshKey",publicKey:"SshKey",keyFingerprint:"SshKey"},d=e=>{if(e instanceof a.z)return e;const t=new a.z;return e.match&&(t.match=e.match),e.uri&&(t.uri=e.uri),t}},61465(e,t,i){"use strict";i.d(t,{i:()=>o});var n=i(89812),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.b]})},61782(e,t,i){"use strict";i.d(t,{j:()=>r});var n=i(20702);class r extends n.r{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"))}}},62046(e,t,i){"use strict";i.d(t,{Y:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.text=this.getResponseProperty("Text"),this.hidden=this.getResponseProperty("Hidden")||!1)}}},62166(e,t,i){"use strict";i.d(t,{i:()=>n});class n{}},62316(e,t,i){"use strict";i.d(t,{J:()=>n});class n{}},62602(e,t,i){"use strict";i.d(t,{t:()=>r});var n=i(3204);class r{constructor(e){this.configService=e}getSettings$(){return this.configService.serverSettings$}get isUserRegistrationDisabled$(){return this.getSettings$().pipe((0,n.T)(e=>e.disableUserRegistration))}}},62627(e,t,i){"use strict";i.d(t,{V:()=>n.V$});var n=i(90107)},62780(e,t,i){"use strict";i.d(t,{L:()=>A});var n=i(8916),r=i(39306),s=i(98267),o=i(20702),a=i(81387),l=i(67097);class c extends o.r{constructor(e){super(e),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl")}}class d extends o.r{constructor(e){super(e),this.hasAdminApproval=this.getResponseProperty("HasAdminApproval"),this.hasLoginApprovingDevice=this.getResponseProperty("HasLoginApprovingDevice"),this.hasManageResetPasswordPermission=this.getResponseProperty("HasManageResetPasswordPermission"),this.isTdeOffboarding=this.getResponseProperty("IsTdeOffboarding"),e.EncryptedPrivateKey&&(this.encryptedPrivateKey=new r.k(this.getResponseProperty("EncryptedPrivateKey"))),e.EncryptedUserKey&&(this.encryptedUserKey=new r.k(this.getResponseProperty("EncryptedUserKey")))}}var u=i(1002);class h extends o.r{constructor(e){super(e),this.hasMasterPassword=this.getResponseProperty("HasMasterPassword");const t=this.getResponseProperty("MasterPasswordUnlock");null!=t&&"object"==typeof t&&(this.masterPasswordUnlock=new l.v(t)),e.TrustedDeviceOption&&(this.trustedDeviceOption=new d(this.getResponseProperty("TrustedDeviceOption"))),e.KeyConnectorOption&&(this.keyConnectorOption=new c(this.getResponseProperty("KeyConnectorOption"))),e.WebAuthnPrfOption&&(this.webAuthnPrfOption=new u.C(this.getResponseProperty("WebAuthnPrfOption")))}}class A extends o.r{constructor(e){super(e),this.accountKeysResponseModel=null;const t=this.getResponseProperty("access_token");if(null==t||"string"!=typeof t)throw new Error("Identity response does not contain a valid access token");const i=this.getResponseProperty("token_type");if(null==i||"string"!=typeof i)throw new Error("Identity response does not contain a valid token type");this.accessToken=t,this.tokenType=i;const o=this.getResponseProperty("expires_in");null!=o&&"number"==typeof o&&(this.expiresIn=o);const l=this.getResponseProperty("refresh_token");null!=l&&"string"==typeof l&&(this.refreshToken=l),this.privateKey=this.getResponseProperty("PrivateKey"),null!=this.getResponseProperty("AccountKeys")&&(this.accountKeysResponseModel=new s.s(this.getResponseProperty("AccountKeys")));const c=this.getResponseProperty("Key");c&&(this.key=new r.k(c)),this.twoFactorToken=this.getResponseProperty("TwoFactorToken");const d=this.getResponseProperty("Kdf"),u=this.getResponseProperty("KdfIterations"),A=this.getResponseProperty("KdfMemory"),p=this.getResponseProperty("KdfParallelism");this.kdfConfig=d==n.ao.PBKDF2_SHA256?new n.n1(u):new n.hU(u,A,p),this.forcePasswordReset=this.getResponseProperty("ForcePasswordReset"),this.apiUseKeyConnector=this.getResponseProperty("ApiUseKeyConnector"),this.masterPasswordPolicy=new a.$(this.getResponseProperty("MasterPasswordPolicy"));const g=this.getResponseProperty("UserDecryptionOptions");null!=g&&"object"==typeof g&&(this.userDecryptionOptions=new h(g))}hasMasterKeyEncryptedUserKey(){return Boolean(this.key)}}},62819(e,t,i){"use strict";i.d(t,{l:()=>I});var n=i(74208),r=i(72245),s=i(33338),o=i(69194),a=i(3204),l=i(44500),c=i(23965),d=i(12012),u=i(67553),h=i(18499),A=i(43978),p=i(35500),g=i(3633),v=i(5556),f=i(31442),m=i(50451),y=i(23293),C=i(90118),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(){this.policyService=(0,n.WQX)(h.m),this.organizationService=(0,n.WQX)(u.PV),this.routedVaultFilterService=(0,n.WQX)(C.BR),this.collectionAdminService=(0,n.WQX)(c.vE),this.cipherService=(0,n.WQX)(v.p),this.apiService=(0,n.WQX)(d.G),this.accountService=(0,n.WQX)(p.D),this.userId$=this.accountService.activeAccount$.pipe(g.F6),this.organizationDataOwnershipDisabled$=this.userId$.pipe((0,l.n)(e=>this.policyService.policyAppliesToUser$(A.tt.OrganizationDataOwnership,e)),(0,a.T)(e=>!e)),this.organizationId$=this.routedVaultFilterService.filter$.pipe((0,a.T)(e=>e.organizationId),(0,o.p)(e=>void 0!==e)),this.allOrganizations$=this.userId$.pipe((0,l.n)(e=>this.organizationService.organizations$(e).pipe((0,a.T)(e=>e.filter(e=>e.isMember&&e.enabled&&e.status===A.Zx.Confirmed))))),this.organization$=(0,s.z)([this.allOrganizations$,this.organizationId$]).pipe((0,a.T)(([e,t])=>e.find(e=>e.id===t))),this.allCollections$=(0,s.z)([this.organization$,this.userId$]).pipe((0,l.n)(([e,t])=>this.collectionAdminService.collectionAdminViews$(e.id,t)))}buildConfig(e,t,i){return w(this,void 0,void 0,function*(){var n,o,a;const[l,c,d,u]=yield(0,r._)((0,s.z)([this.organization$,this.organizationDataOwnershipDisabled$,this.allOrganizations$,this.allCollections$])),h="clone"===e?d:[l],A="clone"===e&&c,p=yield this.getCipher(t,l);return{mode:e,cipherType:null!==(o=null!==(n=null==p?void 0:p.type)&&void 0!==n?n:i)&&void 0!==o?o:f.gC.Login,admin:null!==(a=l.canEditAllCiphers)&&void 0!==a&&a,organizationDataOwnershipDisabled:A,originalCipher:p,collections:u,organizations:h,folders:[],hideIndividualVaultFields:!0,isAdminConsole:!0}})}getCipher(e,t){return w(this,void 0,void 0,function*(){if(null==e)return null;const i=yield this.cipherService.get(e,t.userId);return t.canEditAllCiphers||null==i?yield this.getCipherFromAdminApi(e):i})}getCipherFromAdminApi(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.getCipherAdmin(e);t.edit=!0,t.viewPassword=!0;const i=new m.A(t);return new y.o(i)})}}I.ɵfac=function(e){return new(e||I)},I.ɵprov=n.jDH({token:I,factory:I.ɵfac})},62870(e,t,i){"use strict";i.d(t,{B:()=>o});var n=i(82781),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s extends Error{constructor(e){super(`SDK loading failed: ${e}`)}}class o{loadAndInit(){return r(this,void 0,void 0,function*(){try{yield this.load(),(0,n.init_sdk)(o.logLevel),o.markAsReady()}catch(e){o.markAsFailed(e)}})}}o.logLevel=n.LogLevel.Info,o.Ready=new Promise((e,t)=>{o.markAsReady=e,o.markAsFailed=e=>t(new s(e))})},62963(e,t,i){"use strict";i.d(t,{G:()=>x});var n=i(34003),r=i(77468),s=i(51757),o=i(6056),a=i(94735),l=i(37579),c=i(79703),d=i(33812),u=i(74208);class h{}h.ɵfac=function(e){return new(e||h)},h.ɵmod=d.$C({type:h}),h.ɵinj=u.G2t({});var A=i(639),p=i(29029),g=i(80351),v=i(47135),f=i(81573),m=i(26411),y=i(22191),C=i(55807),w=i(45383),I=i(26477),b=i(90647),B=i(61465),E=i(59525),S=i(83691),Q=i(8297),k=i(88832),T=i(47659),F=i(97560);class P{}P.ɵfac=function(e){return new(e||P)},P.ɵmod=d.$C({type:P}),P.ɵinj=u.G2t({imports:[r.MD,F.T]});var R=i(92697),D=i(75583),M=i(8433);class x{}x.ɵfac=function(e){return new(e||x)},x.ɵmod=d.$C({type:x}),x.ɵinj=u.G2t({providers:[r.vh],imports:[r.MD,n.ad,s.YN,s.X1,o.iI,a.p,l.C,c.m,h,A.E,p.t,g.j,v.q,f.P,m.L,y.Q,C.o,w.Z,I.V,b.M,B.i,E.s,S.E,Q.K,k.n,T.b,P,R.E,D.E,r.MD,n.ad,s.YN,s.X1,o.iI,a.p,l.C,c.m,h,A.E,p.t,g.j,v.q,f.P,m.L,y.Q,C.o,w.Z,I.V,b.M,B.i,E.s,S.E,Q.K,M.p,T.b,P,R.E,D.E]})},63098(e,t,i){"use strict";i.d(t,{R:()=>n});class n{}},63344(e,t,i){"use strict";i.d(t,{r:()=>a});var n=i(27442),r=i(89222),s=i(31857),o=i(48312);class a{constructor(e,t){this.registry=e,this.providers=t,this.log=t.log({type:"ExtensionService"})}settings(e,t,i){const a=this.registry.extension(e.site,t);a||this.log.panic({site:e.site,vendor:t},"extension not defined");const l=function(e,t){const i=new o.r;return Object.assign(Object.assign({},e.storage),{target:"object",key:`${t.site.id}.${t.product.vendor.id}.${e.storage.key}`,state:s.OB,classifier:i,format:"classified"})}(e,a),c=i.account$.pipe((0,n.t)({bufferSize:1,refCount:!0}));return new r.p(l,this.providers,{account$:c})}site(e){return this.registry.build(e)}}},63457(e,t,i){"use strict";i.d(t,{y:()=>o,Q:()=>n});class n{}var r=i(77789),s=i.n(r);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)],r=Array.from(new Set(n));return s()(e,r)}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]/)}}},63581(e,t,i){"use strict";i.d(t,{k:()=>o});var n=i(74208),r=i(38411),s=i(33812);class o{constructor(){this.anchor=(0,n.WQX)(r.d)}get popoverOpen(){return this.anchor.popoverOpen}togglePopover(){this.anchor.popoverOpen()?this.anchor.closePopover():this.anchor.openPopover()}closePopover(){this.anchor.closePopover()}}o.ɵfac=function(e){return new(e||o)},o.ɵdir=s.FsC({type:o,selectors:[["","bitPopoverTriggerFor",""]],hostVars:1,hostBindings:function(e,t){1&e&&s.bIt("click",function(){return t.togglePopover()}),2&e&&s.BMQ("aria-expanded",t.anchor.popoverOpen())},exportAs:["popoverTrigger"],features:[s.nM4([{directive:r.d,inputs:["bitPopoverAnchorFor","bitPopoverTriggerFor","position","position","popoverOpen","popoverOpen"],outputs:["popoverOpenChange","popoverOpenChange"]}])]})},63629(e,t,i){"use strict";i.d(t,{i:()=>d});var n=i(74208),r=i(23649),s=i(68455),o=i(84110),a=i(78781),l=i(51971),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function d(){return(t,i)=>c(this,void 0,void 0,function*(){const t=(0,n.WQX)(s.u),c=(0,n.WQX)(r.Ix),d=(0,n.WQX)(l.H),u=i.url,h=d.getPreviousUrl();if((yield t.getAuthStatus())===o.J.Unlocked){const e=yield d.getAndClearLoginRedirectUrl();return void 0===e||(!!a.A.isNullOrEmpty(e)||c.navigateByUrl(e))}return e(u)?yield d.persistLoginRedirectUrl(u):e(h)&&void 0!==h&&(yield d.persistLoginRedirectUrl(h)),!0});function e(e){if(null==e)return!1;if(a.A.isNullOrEmpty(e))return!1;const t=e.toLocaleLowerCase();return!t.includes("/login-initiated")&&!t.includes("/lock")}}},63968(e,t,i){"use strict";i.d(t,{q:()=>G});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(72737),c=i(69194),d=i(3204),u=i(62179),h=i(14803),A=i(36359),p=i(8131),g=i(94735),v=i(88832),f=i(75583),m=i(26411),y=i(47135),C=i(58950),w=i(14318),I=i(73638),b=i(18030),B=i(50700),E=i(58806),S=i(90246),Q=i(86226),k=i(93199),T=i(97553),F=i(43759),P=i(50352),R=i(25740),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function M(e,t){1&e&&(s.j41(0,"bit-section-header")(1,"h2",20),s.EFF(2),s.nI1(3,"i18n"),s.k0s()()),2&e&&(s.R7$(2),s.JRh(s.bMT(3,1,"options")))}function x(e,t){1&e&&(s.j41(0,"p",19),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.JRh(s.bMT(2,1,"generatorPolicyInEffect")))}const O=Object.freeze({length:"length",uppercase:"uppercase",lowercase:"lowercase",number:"number",special:"special",minNumber:"minNumber",minSpecial:"minSpecial",avoidAmbiguous:"avoidAmbiguous"});class G{constructor(e,t,i){this.formBuilder=e,this.generatorService=t,this.i18nService=i,this.account=null,this.account$=new l.m(1),this.showHeader=!0,this.waitMs=100,this.disableMargin=!1,this.onUpdated=new s.bkB,this.settings=this.formBuilder.group({[O.length]:[0],[O.uppercase]:[!1],[O.lowercase]:[!1],[O.number]:[!1],[O.special]:[!1],[O.minNumber]:[0],[O.minSpecial]:[0],[O.avoidAmbiguous]:[!1]}),this.saveSettings=new a.B,this.policyInEffect=!1,this.lengthBoundariesHint=new l.m(1),this.lengthBoundariesHint$=this.lengthBoundariesHint.asObservable(),this.destroyed$=new a.B}ngOnChanges(e){return D(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}get numbers(){return this.settings.get(O.number)}get special(){return this.settings.get(O.special)}get minNumber(){return this.settings.get(O.minNumber)}get minSpecial(){return this.settings.get(O.minSpecial)}ngOnInit(){return D(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(I.qG.password,{account$:this.account$});e.withConstraints$.pipe((0,d.T)(({state:e,constraints:t})=>{const i=Object.assign({},e);return i.avoidAmbiguous=!i.ambiguous,delete i.ambiguous,[i,t]}),(0,h.Q)(this.destroyed$)).subscribe(([e,t])=>{var i,n,r,s,o,a,l,c;let d=this.i18nService.t("spinboxBoundariesHint",null===(n=null===(i=t.length)||void 0===i?void 0:i.min)||void 0===n?void 0:n.toString(),null===(s=null===(r=t.length)||void 0===r?void 0:r.max)||void 0===s?void 0:s.toString());e.length<=(null!==(a=null===(o=t.length)||void 0===o?void 0:o.recommendation)&&void 0!==a?a:0)&&(d+=this.i18nService.t("passwordLengthRecommendationHint",null===(c=null===(l=t.length)||void 0===l?void 0:l.recommendation)||void 0===c?void 0:c.toString())),this.lengthBoundariesHint.next(d),this.settings.patchValue(e,{emitEvent:!1})}),this.generatorService.policy$(I.qG.password,{account$:this.account$}).pipe((0,h.Q)(this.destroyed$)).subscribe(({constraints:e})=>{var t,i,n,r,s,o,a,l,c,d,u;this.policyInEffect=null!==(t=e.policyInEffect)&&void 0!==t&&t;const h=[[O.length,(0,b.jo)(null===(i=e.length)||void 0===i?void 0:i.min,null===(n=e.length)||void 0===n?void 0:n.max)],[O.uppercase,!(null===(r=e.uppercase)||void 0===r?void 0:r.readonly)],[O.lowercase,!(null===(s=e.lowercase)||void 0===s?void 0:s.readonly)],[O.number,!(null===(o=e.number)||void 0===o?void 0:o.readonly)],[O.special,!(null===(a=e.special)||void 0===a?void 0:a.readonly)],[O.minNumber,(0,b.jo)(null===(l=e.minNumber)||void 0===l?void 0:l.min,null===(c=e.minNumber)||void 0===c?void 0:c.max)],[O.minSpecial,(0,b.jo)(null===(d=e.minSpecial)||void 0===d?void 0:d.min,null===(u=e.minSpecial)||void 0===u?void 0:u.max)]];for(const[A,p]of h)this.toggleEnabled(A,p)});let t=1;this.numbers.valueChanges.pipe((0,c.p)(e=>{var t;return!(e&&(null!==(t=this.minNumber.value)&&void 0!==t?t:0)>0)}),(0,d.T)(e=>e?t:0),(0,h.Q)(this.destroyed$)).subscribe(e=>this.minNumber.setValue(e,{emitEvent:!1})),this.minNumber.valueChanges.pipe((0,d.T)(e=>[e,(null!=e?e:0)>0]),(0,A.M)(([e,i])=>t=i&&e?e:t),(0,h.Q)(this.destroyed$)).subscribe(([,e])=>this.numbers.setValue(e,{emitEvent:!1}));let i=1;this.special.valueChanges.pipe((0,c.p)(e=>{var t;return!(e&&(null!==(t=this.minSpecial.value)&&void 0!==t?t:0)>0)}),(0,d.T)(e=>e?i:0),(0,h.Q)(this.destroyed$)).subscribe(e=>this.minSpecial.setValue(e,{emitEvent:!1})),this.minSpecial.valueChanges.pipe((0,d.T)(e=>[e,(null!=e?e:0)>0]),(0,A.M)(([e,t])=>i=t&&e?e:i),(0,h.Q)(this.destroyed$)).subscribe(([,e])=>this.special.setValue(e,{emitEvent:!1})),e.pipe((0,u.i)(1),(0,h.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,p.E)(this.settings.valueChanges),(0,d.T)(([,e])=>{const t=Object.assign({},e);return t.ambiguous=!t.avoidAmbiguous,delete t.avoidAmbiguous,t}),(0,h.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}toggleEnabled(e,t){var i,n;t?null===(i=this.settings.get(e))||void 0===i||i.enable({emitEvent:!1}):null===(n=this.settings.get(e))||void 0===n||n.disable({emitEvent:!1})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}G.ɵfac=function(e){return new(e||G)(s.rXU(o.ok),s.rXU(I.iE),s.rXU(B.W))},G.ɵcmp=s.VBU({type:G,selectors:[["tools-password-settings"]],inputs:{account:"account",showHeader:"showHeader",waitMs:"waitMs",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onUpdated:"onUpdated"},features:[s.OA$],decls:66,vars:61,consts:[[3,"disableMargin"],[1,"tw-container",3,"formGroup"],[1,"tw-mb-4"],["disableMargin",""],["bitInput","","formControlName","length","type","number",3,"change"],[1,"tw-mb-4","tw-flex","tw-flex-wrap","tw-gap-4","sm:tw-gap-8"],[1,"!tw-mb-0",3,"title"],["bitCheckbox","","type","checkbox","formControlName","uppercase",3,"change"],["bitCheckbox","","type","checkbox","formControlName","lowercase",3,"change"],["bitCheckbox","","type","checkbox","formControlName","number",3,"change"],["bitCheckbox","","type","checkbox","formControlName","special",3,"change"],["aria-hidden","true"],[1,"tw-sr-only"],[1,"tw-flex"],[1,"tw-w-full","tw-basis-1/2","tw-mr-4"],["bitInput","","type","number","formControlName","minNumber",3,"change"],[1,"tw-w-full","tw-basis-1/2"],["bitInput","","type","number","formControlName","minSpecial",3,"change"],["bitCheckbox","","type","checkbox","formControlName","avoidAmbiguous",3,"change"],["bitTypography","helper"],["bitTypography","h6"]],template:function(e,t){1&e&&(s.j41(0,"bit-section",0),s.nVh(1,M,4,3,"bit-section-header"),s.j41(2,"form",1)(3,"div",2)(4,"bit-card")(5,"bit-form-field",3)(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"input",4),s.bIt("change",function(){return t.save("length")}),s.k0s(),s.j41(10,"bit-hint"),s.EFF(11),s.nI1(12,"async"),s.k0s()()()(),s.j41(13,"div")(14,"bit-card")(15,"div",2),s.EFF(16),s.nI1(17,"i18n"),s.k0s(),s.j41(18,"div",5)(19,"bit-form-control",6),s.nI1(20,"i18n"),s.nI1(21,"i18n"),s.j41(22,"input",7),s.bIt("change",function(){return t.save("uppercase")}),s.k0s(),s.j41(23,"bit-label"),s.EFF(24),s.nI1(25,"i18n"),s.k0s()(),s.j41(26,"bit-form-control",6),s.nI1(27,"i18n"),s.nI1(28,"i18n"),s.j41(29,"input",8),s.bIt("change",function(){return t.save("lowercase")}),s.k0s(),s.j41(30,"bit-label"),s.EFF(31),s.nI1(32,"i18n"),s.k0s()(),s.j41(33,"bit-form-control",6),s.nI1(34,"i18n"),s.nI1(35,"i18n"),s.j41(36,"input",9),s.bIt("change",function(){return t.save("number")}),s.k0s(),s.j41(37,"bit-label"),s.EFF(38),s.nI1(39,"i18n"),s.k0s()(),s.j41(40,"bit-form-control",6),s.nI1(41,"i18n"),s.j41(42,"input",10),s.bIt("change",function(){return t.save("special")}),s.k0s(),s.j41(43,"bit-label")(44,"span",11),s.EFF(45),s.k0s(),s.j41(46,"span",12),s.EFF(47),s.nI1(48,"i18n"),s.k0s()()()(),s.j41(49,"div",13)(50,"bit-form-field",14)(51,"bit-label"),s.EFF(52),s.nI1(53,"i18n"),s.k0s(),s.j41(54,"input",15),s.bIt("change",function(){return t.save("minNumbers")}),s.k0s()(),s.j41(55,"bit-form-field",16)(56,"bit-label"),s.EFF(57),s.nI1(58,"i18n"),s.k0s(),s.j41(59,"input",17),s.bIt("change",function(){return t.save("minSpecial")}),s.k0s()()(),s.j41(60,"bit-form-control",0)(61,"input",18),s.bIt("change",function(){return t.save("avoidAmbiguous")}),s.k0s(),s.j41(62,"bit-label"),s.EFF(63),s.nI1(64,"i18n"),s.k0s()(),s.nVh(65,x,3,3,"p",19),s.k0s()()()()),2&e&&(s.Y8G("disableMargin",t.disableMargin),s.R7$(),s.vxM(t.showHeader?1:-1),s.R7$(),s.Y8G("formGroup",t.settings),s.R7$(5),s.JRh(s.bMT(8,27,"length")),s.R7$(4),s.JRh(s.bMT(12,29,t.lengthBoundariesHint$)),s.R7$(5),s.JRh(s.bMT(17,31,"include")),s.R7$(3),s.Y8G("title",s.mNQ(s.bMT(20,33,"uppercaseDescription"))),s.BMQ("aria-description",s.bMT(21,35,"uppercaseDescription")),s.R7$(5),s.JRh(s.bMT(25,37,"uppercaseLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(27,39,"lowercaseDescription"))),s.BMQ("aria-description",s.bMT(28,41,"lowercaseDescription")),s.R7$(5),s.JRh(s.bMT(32,43,"lowercaseLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(34,45,"numbersDescription"))),s.BMQ("aria-description",s.bMT(35,47,"numbersDescription")),s.R7$(5),s.JRh(s.bMT(39,49,"numbersLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(41,51,"specialCharactersDescription"))),s.R7$(5),s.JRh("!@#$%^&*"),s.R7$(2),s.SpI(" ",s.bMT(48,53,"specialCharactersDescription")," "),s.R7$(5),s.JRh(s.bMT(53,55,"minNumbers")),s.R7$(5),s.JRh(s.bMT(58,57,"minSpecial")),s.R7$(3),s.Y8G("disableMargin",!t.policyInEffect),s.R7$(3),s.JRh(s.bMT(64,59,"avoidAmbiguous")),s.R7$(2),s.vxM(t.policyInEffect?65:-1))},dependencies:[v.n,C.U,f.E,E.r,o.X1,o.qT,o.me,o.Q0,o.Zm,o.BC,o.cb,o.j4,o.JD,w.i,m.L,S.f,Q.j,k.I,T.J,F.h,y.q,P.P,g.p,r.Jj,R.$],encapsulation:2})},64447(e,t,i){"use strict";i.d(t,{eq:()=>n,$y:()=>l,MM:()=>r,OL:()=>s,K_:()=>c.K,ch:()=>a,D_:()=>o,LF:()=>c.L});var n,r,s,o;i(32706);!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"}(r||(r={})),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.FamiliesAnnually2025=7]="FamiliesAnnually2025",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",e[e.FamiliesAnnually=22]="FamiliesAnnually"}(s||(s={})),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"}(o||(o={}));var a,l,c=i(68104);!function(e){e[e.PasswordManager=0]="PasswordManager",e[e.SecretsManager=1]="SecretsManager"}(a||(a={})),function(e){e[e.Monthly=0]="Monthly",e[e.Annually=1]="Annually"}(l||(l={}))},64503(e,t,i){"use strict";i.d(t,{k:()=>s});var n=i(31857),r=i(51886);const s=n.Ok.array(n.Qb,"events",{deserializer:e=>r.R.fromJSON(e),clearOn:["logout"]})},65067(e,t,i){"use strict";i.d(t,{H:()=>E,u:()=>S});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(6056),l=i(58384),c=i(22191),d=i(34465),u=i(21823),h=i(33812);const A=[[["","slot","start"]],[["","slot","end"]]],p=e=>({focusAfterNav:e});function g(e,t){1&e&&(h.j41(0,"div",5),h.SdG(1),h.k0s())}function v(e,t){1&e&&h.eu8(0)}function f(e,t){if(1&e){const e=h.RV6();h.j41(0,"a",9),h.bIt("isActiveChange",function(t){s.eBV(e);const i=h.XpG(2);return s.Njj(i.setIsActive(t))})("click",function(){s.eBV(e);const t=h.XpG(2);return s.Njj(t.mainContentClicked.emit())}),h.DNE(1,v,1,0,"ng-container",10),h.k0s()}if(2&e){const e=h.XpG(2),t=h.sdS(5),i=h.r8f(1);h.HbH(i),h.Y8G("routerLink",e.route())("relativeTo",e.relativeTo())("routerLinkActiveOptions",e.routerLinkActiveOptions())("ariaCurrentWhenActive",e.ariaCurrentWhenActive())("state",h.eq3(9,p,e.focusAfterNavTarget())),h.BMQ("aria-label",e.ariaLabel()||e.text()),h.R7$(),h.Y8G("ngTemplateOutlet",t)}}function m(e,t){1&e&&h.eu8(0)}function y(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",11),h.bIt("click",function(){s.eBV(e);const t=h.XpG(2);return s.Njj(t.mainContentClicked.emit())}),h.DNE(1,m,1,0,"ng-container",10),h.k0s()}if(2&e){h.XpG(2);const e=h.sdS(5),t=h.r8f(1);h.HbH(t),h.R7$(),h.Y8G("ngTemplateOutlet",e)}}function C(e,t){if(1&e){const e=h.RV6();h.j41(0,"div",12),h.bIt("click",function(t){return s.eBV(e),s.Njj(t.stopPropagation())}),h.SdG(1,1),h.k0s()}}function w(e,t){if(1&e&&(h.j41(0,"div",3)(1,"div",4),h.nVh(2,g,2,0,"div",5),h.nVh(3,f,2,11,"a",6)(4,y,2,3,"button",7),h.nVh(5,C,2,0,"div",8),h.k0s()()),2&e){const e=h.XpG(),t=h.r8f(0);h.Aen(e.showActiveStyles()?"--color-nav-bg-primary: var(--color-nav-bg-primary-strong); --color-nav-bg-secondary: var(--color-nav-bg-secondary-strong); --color-nav-bg-primary-hover: var(--color-nav-bg-primary-hover-strong); --color-nav-bg-secondary-hover: var(--color-nav-bg-secondary-hover-strong);":""),h.HbH(e.fvwStyles()),h.xc7("padding-inline-start",e.navItemIndentationPadding()),h.R7$(2),h.vxM(t?2:-1),h.R7$(),h.vxM(e.route()?3:4),h.R7$(2),h.vxM(t?5:-1)}}function I(e,t){if(1&e&&h.nrm(0,"bit-icon",14),2&e){const e=h.XpG(2),t=h.r8f(0);h.Y8G("name",e.icon()),h.BMQ("aria-hidden",t)("aria-label",e.text())}}function b(e,t){if(1&e&&(h.j41(0,"span",15),h.EFF(1),h.k0s()),2&e){const e=h.XpG(2);h.R7$(),h.JRh(e.text())}}function B(e,t){if(1&e&&(h.j41(0,"div",13),h.nVh(1,I,1,3,"bit-icon",14),h.nVh(2,b,2,1,"span",15),h.k0s()),2&e){const e=h.XpG(),t=h.r8f(0);h.AVh("tw-text-center",!t)("tw-justify-center",!t),h.Y8G("title",e.text()),h.R7$(),h.vxM(e.icon()?1:-1),h.R7$(),h.vxM(t?2:-1)}}class E{}class S extends d.S{setIsActive(e){this._isActive.set(e),e&&this.parentNavGroup&&this.parentNavGroup.setOpen(!0)}onFocusIn(e){this.focusVisibleWithin.set(e.matches("[data-fvw]:focus-visible"))}onFocusOut(){this.focusVisibleWithin.set(!1)}constructor(){super(),this.TREE_BASE_PADDING=2.25,this.TREE_DEPTH_PADDING=1.5,this.forceActiveStyles=(0,r.hFB)(!1),this.sideNavService=(0,s.WQX)(u.G),this.parentNavGroup=(0,s.WQX)(E,{optional:!0}),this._isActive=(0,s.vPA)(!1),this.showActiveStyles=(0,o.EW)(()=>this.forceActiveStyles()||this._isActive()&&!this.hideActiveStyles()),this.navItemIndentationPadding=(0,o.EW)(()=>{var e;const t=this.sideNavService.open(),i=null!==(e=this.treeDepth())&&void 0!==e?e:0;return t?`${this.TREE_BASE_PADDING+i*this.TREE_DEPTH_PADDING}rem`:"0"}),this.ariaCurrentWhenActive=(0,r.hFB)("page"),this.focusAfterNavTarget=(0,r.hFB)(),this.focusVisibleWithin=(0,s.vPA)(!1),this.fvwStyles=(0,o.EW)(()=>this.focusVisibleWithin()?"tw-z-10 tw-rounded tw-outline-none tw-ring tw-ring-inset tw-ring-border-nav-focus tw-bg-bg-nav-hover":""),this.parentNavGroup&&this.treeDepth.set(this.parentNavGroup.treeDepth()+1)}}S.ɵfac=function(e){return new(e||S)},S.ɵcmp=h.VBU({type:S,selectors:[["bit-nav-item"]],hostBindings:function(e,t){1&e&&h.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()})},inputs:{forceActiveStyles:[1,"forceActiveStyles"],ariaCurrentWhenActive:[1,"ariaCurrentWhenActive"],focusAfterNavTarget:[1,"focusAfterNavTarget"]},features:[h.Jv_([{provide:d.S,useExisting:S}]),h.Vt3],ngContentSelectors:["[slot=start]","[slot=end]"],decls:6,vars:3,consts:[["anchorAndButtonContent",""],[1,"tw-cursor-pointer","tw-ps-3","tw-pe-3"],["data-testid","nav-item-container",1,"tw-relative","tw-rounded-xl","tw-h-10","tw-bg-bg-nav","hover:tw-bg-bg-nav-hover",3,"padding-inline-start","class","style"],["data-testid","nav-item-container",1,"tw-relative","tw-rounded-xl","tw-h-10","tw-bg-bg-nav","hover:tw-bg-bg-nav-hover"],[1,"tw-relative","tw-flex","tw-items-center","tw-h-full"],[1,"tw-absolute","tw-left-[0px]","tw-transform","tw--translate-x-[calc(100%_+_4px)]"],["data-fvw","","routerLinkActive","","data-testid","nav-item-interactive",3,"class","routerLink","relativeTo","routerLinkActiveOptions","ariaCurrentWhenActive","state"],["type","button","data-fvw","","data-testid","nav-item-interactive",3,"class"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-pe-3","[&:has(button)]:tw-pe-2","empty:tw-hidden"],["data-fvw","","routerLinkActive","","data-testid","nav-item-interactive",3,"isActiveChange","click","routerLink","relativeTo","routerLinkActiveOptions","ariaCurrentWhenActive","state"],[4,"ngTemplateOutlet"],["type","button","data-fvw","","data-testid","nav-item-interactive",3,"click"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-pe-3","[&:has(button)]:tw-pe-2","empty:tw-hidden",3,"click"],[1,"tw-gap-2","tw-py-0","tw-flex","tw-items-center","tw-font-medium","tw-h-full",3,"title"],["fixedWidth","true",1,"!tw-m-0","tw-w-4","tw-shrink-0",3,"name"],[1,"tw-truncate"]],template:function(e,t){if(1&e&&(h.NAR(A),h.SS7(0)(1),h.j41(2,"div",1),h.nVh(3,w,6,9,"div",2),h.k0s(),h.DNE(4,B,3,7,"ng-template",null,0,h.C5r)),2&e){const e=h.bH3(t.sideNavService.open());h.R7$(),h.bH3("tw-size-full tw-px-0 tw-block tw-truncate tw-border-none !tw-text-fg-nav tw-text-start hover:tw-no-underline focus:tw-outline-none [&_i]:tw-leading-[1.5rem]"),h.R7$(2),h.vxM(e||t.icon()?3:-1)}},dependencies:[n.T3,c.Q,a.iI,a.Wk,a.wQ,l.R],encapsulation:2,changeDetection:0})},65113(e,t,i){"use strict";i.d(t,{R:()=>f});var n=i(77468),r=i(94735),s=(i(46217),i(80351)),o=i(33812),a=i(50700),l=i(44432),c=i(25740);function d(e,t){if(1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e){const e=o.XpG(2);o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectMinComplexity",e.getPasswordScoreAlertDisplay())," ")}}function u(e,t){if(1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e){const e=o.XpG(2);o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectMinLength",null==e.policy?null:e.policy.minLength.toString())," ")}}function h(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectUppercase")," "))}function A(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectLowercase")," "))}function p(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectNumbers")," "))}function g(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectSpecial","!@#$%^&*")," "))}function v(e,t){if(1&e&&(o.j41(0,"ul",1),o.DNE(1,d,3,4,"li",2)(2,u,3,4,"li",2)(3,h,3,3,"li",2)(4,A,3,3,"li",2)(5,p,3,3,"li",2)(6,g,3,4,"li",2),o.k0s()),2&e){const e=o.XpG();o.R7$(),o.Y8G("ngIf",(null==e.policy?null:e.policy.minComplexity)>0),o.R7$(),o.Y8G("ngIf",(null==e.policy?null:e.policy.minLength)>0),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireUpper),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireLower),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireNumbers),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireSpecial)}}class f{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+")"}}f.ɵfac=function(e){return new(e||f)(o.rXU(a.W))},f.ɵcmp=o.VBU({type:f,selectors:[["auth-password-callout"]],inputs:{message:"message",policy:"policy"},decls:4,vars:4,consts:[["class","tw-mb-0 tw-ml-8 tw-ps-0",4,"ngIf"],[1,"tw-mb-0","tw-ml-8","tw-ps-0"],[4,"ngIf"]],template:function(e,t){1&e&&(o.j41(0,"bit-callout"),o.EFF(1),o.nI1(2,"i18n"),o.DNE(3,v,7,6,"ul",0),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,2,t.message)," "),o.R7$(2),o.Y8G("ngIf",t.policy))},dependencies:[n.MD,n.bT,r.p,s.j,l.G,c.$],encapsulation:2})},65485(e,t,i){"use strict";i.d(t,{i:()=>o});var n=i(9997),r=i(68881),s=i(6912);class o extends s.D{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(o.prototype),e,{device:e.device?n.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new r.i,e.twoFactor):void 0})}}},65551(e,t,i){"use strict";i.d(t,{i:()=>r});var n=i(52237);class r{constructor(){this.collections=[],this.groups=[],this.groupNames=[],this.collectionNames=[]}static fromResponse(e){const t=Object.assign(new r,e);return null!=e.collections&&(t.collections=e.collections.map(e=>new n.sK(e))),null!=e.groups&&(t.groups=e.groups),t}}},65731(e,t,i){"use strict";i.d(t,{Oo:()=>ae,UJ:()=>M.U,Tu:()=>D.Tu,Y2:()=>k});var n=i(77468),r=i(94573),s=i(639),o=i(29029),a=i(45383),l=i(55807),c=i(75583),d=i(14318),u=i(36801),h=i(33812),A=i(74208),p=i(47696),g=i(56898),v=i(58384),f=i(58806);const m=[[["","slot","title"]]];function y(e,t){if(1&e&&(h.j41(0,"span",2),h.EFF(1),h.k0s()),2&e){const e=t;h.Y8G("variant",e.variant||"primary"),h.R7$(),h.SpI(" ",e.text," ")}}function C(e,t){1&e&&(h.EFF(0),h.nI1(1,"i18n")),2&e&&h.SpI(" ",h.bMT(1,1,"perUser")," ")}function w(e,t){if(1&e&&(h.j41(0,"div",5)(1,"div",8)(2,"span",9),h.EFF(3),h.nI1(4,"currency"),h.k0s(),h.j41(5,"span",10),h.EFF(6),h.nI1(7,"i18n"),h.nVh(8,C,2,3),h.k0s()()()),2&e){const e=t;h.R7$(3),h.JRh(h.ii3(4,3,e.amount,"$",!0,e.amount%1==0?"1.0-0":"1.2-2")),h.R7$(3),h.SpI(" / ",h.bMT(7,8,e.cadence)," "),h.R7$(2),h.vxM(e.showPerUser?8:-1)}}function I(e,t){if(1&e&&h.nrm(0,"bit-icon",12),2&e){const e=h.XpG();h.Y8G("name",e.icon.type)}}function b(e,t){if(1&e&&h.nrm(0,"bit-icon",13),2&e){const e=h.XpG();h.Y8G("name",e.icon.type)}}function B(e,t){if(1&e){const e=h.RV6();h.j41(0,"div",6)(1,"button",11),h.bIt("click",function(){A.eBV(e);const t=h.XpG();return A.Njj(t.buttonClick.emit())}),h.nVh(2,I,1,1,"bit-icon",12),h.EFF(3),h.nVh(4,b,1,1,"bit-icon",13),h.k0s()()}if(2&e){const e=t;h.R7$(),h.Y8G("buttonType",e.type)("block",!0)("disabled",e.disabled),h.R7$(),h.vxM(e.icon&&"before"===e.icon.position?2:-1),h.R7$(),h.SpI(" ",e.text," "),h.R7$(),h.vxM(!e.icon||"after"!==e.icon.position&&e.icon.position?-1:4)}}function E(e,t){if(1&e&&(h.j41(0,"li",15),h.nrm(1,"bit-icon",16),h.j41(2,"span",17),h.EFF(3),h.k0s()()),2&e){const e=t.$implicit;h.R7$(3),h.JRh(e)}}function S(e,t){if(1&e&&(h.j41(0,"ul",14),h.Z7z(1,E,4,1,"li",15,h.fX1),h.k0s()),2&e){const e=h.XpG();h.R7$(),h.Dyx(e)}}function Q(e,t){1&e&&h.nVh(0,S,3,0,"ul",14),2&e&&h.vxM(t.length>0?0:-1)}class k{constructor(){this.tagline=r.hFB.required(),this.price=(0,r.hFB)(),this.button=(0,r.hFB)(),this.features=(0,r.hFB)(),this.activeBadge=(0,r.hFB)(),this.buttonClick=(0,r.CGW)()}}k.ɵfac=function(e){return new(e||k)},k.ɵcmp=h.VBU({type:k,selectors:[["billing-pricing-card"]],inputs:{tagline:[1,"tagline"],price:[1,"price"],button:[1,"button"],features:[1,"features"],activeBadge:[1,"activeBadge"]},outputs:{buttonClick:"buttonClick"},ngContentSelectors:["[slot=title]"],decls:11,vars:5,consts:[[1,"tw-size-full","tw-flex","tw-flex-col"],[1,"tw-flex","tw-items-center","tw-justify-between","tw-mb-2"],["bitBadge","",1,"tw-ml-3",3,"variant"],[1,"tw-mb-6","tw-h-6"],["bitTypography","helper",1,"tw-text-muted","tw-m-0","tw-leading-relaxed","tw-line-clamp-2"],[1,"tw-mb-6"],[1,"tw-mb-6","tw-h-12"],[1,"tw-flex-grow"],[1,"tw-flex","tw-items-baseline","tw-gap-1","tw-flex-wrap"],[1,"tw-text-3xl","tw-font-medium","tw-leading-none","tw-m-0"],["bitTypography","helper",1,"tw-text-muted"],["bitButton","","type","button",3,"click","buttonType","block","disabled"],["aria-hidden","true",1,"tw-me-2",3,"name"],["aria-hidden","true",1,"tw-ms-2",3,"name"],[1,"tw-list-none","tw-p-0","tw-m-0"],[1,"tw-flex","tw-items-start","tw-gap-2","tw-mb-2","last:tw-mb-0"],["name","bwi-check","aria-hidden","true",1,"tw-text-primary-600","tw-mt-0.5","tw-flex-shrink-0"],["bitTypography","helper",1,"tw-text-muted","tw-leading-relaxed"]],template:function(e,t){if(1&e&&(h.NAR(m),h.j41(0,"bit-card",0)(1,"div",1),h.SdG(2),h.nVh(3,y,2,2,"span",2),h.k0s(),h.j41(4,"div",3)(5,"p",4),h.EFF(6),h.k0s()(),h.nVh(7,w,9,10,"div",5),h.nVh(8,B,5,6,"div",6),h.j41(9,"div",7),h.nVh(10,Q,1,1),h.k0s()()),2&e){let e,i,n,r;h.R7$(3),h.vxM((e=t.activeBadge())?3:-1,e),h.R7$(3),h.SpI(" ",t.tagline()," "),h.R7$(),h.vxM((i=t.price())?7:-1,i),h.R7$(),h.vxM((n=t.button())?8:-1,n),h.R7$(2),h.vxM((r=t.features())?10:-1,r)}},dependencies:[s.E,p.n,o.t,g.Q,a.Z,l.o,v.R,c.E,f.r,d.i,n.oe,u.$Z],encapsulation:2,changeDetection:0});var T=i(33277),F=i(83731),P=i(50700),R=i(22191),D=i(22733),M=i(47593),x=i(36288);const O=e=>({total:e}),G=(e,t)=>t.label;function U(e,t){1&e&&h.eu8(0)}function V(e,t){if(1&e&&h.DNE(0,U,1,0,"ng-container",5),2&e){const e=h.XpG();h.Y8G("ngTemplateOutlet",t)("ngTemplateOutletContext",h.eq3(2,O,e.total()))}}function j(e,t){if(1&e&&(h.j41(0,"span",8),h.EFF(1),h.nI1(2,"i18n"),h.k0s()),2&e){h.XpG(2);const e=h.r8f(1);h.R7$(),h.SpI(" / ",h.bMT(2,1,e)," ")}}function N(e,t){if(1&e&&(h.j41(0,"h2",6),h.EFF(1),h.nI1(2,"i18n"),h.nI1(3,"currency"),h.k0s(),h.j41(4,"span",7),h.EFF(5," "),h.k0s(),h.nVh(6,j,3,3,"span",8)),2&e){const e=h.XpG(),t=h.r8f(2);h.R7$(),h.Lme(" ",h.bMT(2,3,"total"),": ",h.brH(3,5,e.total(),"USD","symbol")," USD "),h.R7$(5),h.vxM(t?-1:6)}}function z(e,t){if(1&e&&h.nrm(0,"billing-discount-badge",9),2&e){const e=t.$implicit;h.Y8G("discount",e)}}function Y(e,t){if(1&e&&h.Z7z(0,z,1,1,"billing-discount-badge",9,h.fX1),2&e){h.XpG();const e=h.r8f(0);h.Dyx(e.discounts)}}function L(e,t){if(1&e&&h.EFF(0),2&e){h.XpG(3);const e=h.r8f(1);h.SpI(" / ",e," ")}}function K(e,t){if(1&e&&(h.EFF(0),h.nI1(1,"currency"),h.nVh(2,L,1,1)),2&e){h.XpG();const e=h.r8f(8);h.XpG();const t=h.r8f(2);h.SpI(" x ",h.brH(1,2,e.cost,"USD","symbol")," "),h.R7$(2),h.vxM(t?-1:2)}}function X(e,t){if(1&e&&(h.j41(0,"div",17)(1,"div",25),h.EFF(2),h.k0s(),h.j41(3,"div",26),h.EFF(4),h.nI1(5,"currency"),h.k0s()()),2&e){const e=h.XpG(2);h.R7$(2),h.SpI(" ",e.passwordManagerSeatsDiscountLabel()," "),h.R7$(2),h.SpI(" -",h.brH(5,2,e.passwordManagerSeatsDiscountAmount(),"USD","symbol")," ")}}function q(e,t){if(1&e&&h.EFF(0),2&e){h.XpG(4);const e=h.r8f(1);h.SpI(" / ",e," ")}}function H(e,t){if(1&e&&(h.EFF(0),h.nI1(1,"currency"),h.nVh(2,q,1,1)),2&e){h.XpG(2);const e=h.r8f(16);h.XpG();const t=h.r8f(2);h.SpI(" x ",h.brH(1,2,e.cost,"USD","symbol")," "),h.R7$(2),h.vxM(t?-1:2)}}function W(e,t){if(1&e&&(h.j41(0,"div",18)(1,"div",14)(2,"div",15),h.EFF(3),h.nVh(4,H,3,6),h.k0s()(),h.j41(5,"div",27),h.EFF(6),h.nI1(7,"currency"),h.k0s()()),2&e){h.XpG();const e=h.r8f(16),t=h.XpG();h.R7$(3),h.Lme(" ",e.quantity," ",t.translateWithParams(e.translationKey,e.translationParams)," "),h.R7$(),h.vxM(e.hideBreakdown?-1:4),h.R7$(2),h.SpI(" ",h.brH(7,4,t.additionalStorageTotal(),"USD","symbol")," ")}}function $(e,t){if(1&e&&h.EFF(0),2&e){h.XpG(4);const e=h.r8f(1);h.SpI(" / ",e," ")}}function J(e,t){if(1&e&&(h.EFF(0),h.nI1(1,"currency"),h.nVh(2,$,1,1)),2&e){h.XpG(2);const e=h.r8f(18);h.XpG();const t=h.r8f(2);h.SpI(" x ",h.brH(1,2,e.cost,"USD","symbol")," "),h.R7$(2),h.vxM(t?-1:2)}}function Z(e,t){if(1&e&&h.EFF(0),2&e){h.XpG(5);const e=h.r8f(1);h.SpI(" / ",e," ")}}function _(e,t){if(1&e&&(h.EFF(0),h.nI1(1,"currency"),h.nVh(2,Z,1,1)),2&e){h.XpG(2);const e=h.r8f(12);h.XpG(2);const t=h.r8f(2);h.SpI(" x ",h.brH(1,2,e.cost,"USD","symbol")," "),h.R7$(2),h.vxM(t?-1:2)}}function ee(e,t){if(1&e&&(h.j41(0,"div",31)(1,"div",15),h.EFF(2),h.nVh(3,_,3,6),h.k0s(),h.j41(4,"div",32),h.EFF(5),h.nI1(6,"currency"),h.k0s()()),2&e){h.XpG();const e=h.r8f(12),t=h.XpG(2);h.R7$(2),h.Lme(" ",e.quantity," ",t.translateWithParams(e.translationKey,e.translationParams)," "),h.R7$(),h.vxM(e.hideBreakdown?-1:3),h.R7$(2),h.SpI(" ",h.brH(6,4,t.additionalServiceAccountsTotal(),"USD","symbol")," ")}}function te(e,t){if(1&e&&(h.j41(0,"div",19)(1,"div",28)(2,"div",12),h.EFF(3),h.nI1(4,"i18n"),h.k0s()(),h.j41(5,"div",29)(6,"div",15),h.EFF(7),h.nVh(8,J,3,6),h.k0s(),h.j41(9,"div",30),h.EFF(10),h.nI1(11,"currency"),h.k0s()(),h.SS7(12),h.nVh(13,ee,7,8,"div",31),h.k0s()),2&e){h.XpG();const e=h.r8f(18),t=h.XpG(),i=h.r8f(0);h.R7$(3),h.SpI(" ",h.bMT(4,6,"secretsManager")," "),h.R7$(4),h.Lme(" ",e.quantity," ",t.translateWithParams(e.translationKey,e.translationParams)," "),h.R7$(),h.vxM(e.hideBreakdown?-1:8),h.R7$(2),h.SpI(" ",h.brH(11,8,t.secretsManagerSeatsTotal(),"USD","symbol")," "),h.R7$(2);const n=h.bH3(null==i.secretsManager?null:i.secretsManager.additionalServiceAccounts);h.R7$(),h.vxM(n?13:-1)}}function ie(e,t){if(1&e&&(h.j41(0,"div",33)(1,"div",34),h.EFF(2),h.k0s(),h.j41(3,"div",35),h.EFF(4),h.nI1(5,"currency"),h.k0s()()),2&e){const e=h.XpG().$implicit;h.R7$(2),h.JRh(e.label),h.R7$(2),h.SpI(" -",h.brH(5,2,e.amount,"USD","symbol")," ")}}function ne(e,t){if(1&e&&h.nVh(0,ie,6,6,"div",33),2&e){const e=t.$implicit;h.vxM(e.amount>0?0:-1)}}function re(e,t){if(1&e&&(h.j41(0,"div",20)(1,"div",15),h.EFF(2),h.k0s(),h.j41(3,"div",36),h.EFF(4),h.nI1(5,"currency"),h.k0s()()),2&e){const e=h.XpG(2),t=h.r8f(0);h.R7$(2),h.SpI(" ",e.translateWithParams(t.credit.translationKey,t.credit.translationParams)," "),h.R7$(2),h.SpI(" -",h.brH(5,2,e.creditAmount(),"USD","symbol")," ")}}function se(e,t){if(1&e&&(h.EFF(0),h.nI1(1,"i18n")),2&e){h.XpG(2);const e=h.r8f(1);h.SpI(" / ",h.bMT(1,1,e)," ")}}function oe(e,t){if(1&e&&(h.j41(0,"div",4)(1,"div",10)(2,"div",11)(3,"h3",12),h.EFF(4),h.nI1(5,"i18n"),h.k0s()(),h.j41(6,"div",13)(7,"div",14),h.SS7(8),h.j41(9,"div",15),h.EFF(10),h.nVh(11,K,3,6),h.k0s()(),h.j41(12,"div",16),h.EFF(13),h.nI1(14,"currency"),h.k0s()(),h.nVh(15,X,6,6,"div",17),h.SS7(16),h.nVh(17,W,8,8,"div",18),h.k0s(),h.SS7(18),h.nVh(19,te,14,13,"div",19),h.Z7z(20,ne,1,1,null,null,G),h.nVh(22,re,6,6,"div",20),h.j41(23,"div",21)(24,"h3",12),h.EFF(25),h.nI1(26,"i18n"),h.k0s(),h.j41(27,"div",22),h.EFF(28),h.nI1(29,"currency"),h.k0s()(),h.j41(30,"div",23)(31,"h3",12),h.EFF(32),h.nI1(33,"i18n"),h.k0s(),h.j41(34,"div",24),h.EFF(35),h.nI1(36,"currency"),h.nVh(37,se,2,3),h.k0s()()()),2&e){const e=h.XpG(),t=h.r8f(0);h.R7$(4),h.SpI(" ",h.bMT(5,14,"passwordManager")," "),h.R7$(4);const i=h.bH3(t.passwordManager.seats);h.R7$(2),h.Lme(" ",i.quantity," ",e.translateWithParams(i.translationKey,i.translationParams)," "),h.R7$(),h.vxM(i.hideBreakdown?-1:11),h.R7$(2),h.SpI(" ",h.brH(14,17,e.passwordManagerSeatsTotal(),"USD","symbol")," "),h.R7$(2),h.vxM(e.passwordManagerSeatsDiscountAmount()>0?15:-1),h.R7$();const n=h.bH3(t.passwordManager.additionalStorage);h.R7$(),h.vxM(n?17:-1),h.R7$();const r=h.bH3(null==t.secretsManager?null:t.secretsManager.seats);h.R7$(),h.vxM(r?19:-1),h.R7$(),h.Dyx(e.discountLineItems()),h.R7$(2),h.vxM(e.creditAmount()>0?22:-1),h.R7$(3),h.SpI(" ",h.bMT(26,23,"estimatedTax")," "),h.R7$(3),h.SpI(" ",h.brH(29,25,e.estimatedTax(),"USD","symbol")," "),h.R7$(4),h.JRh(h.bMT(33,29,"total")),h.R7$(3),h.SpI(" ",h.brH(36,31,e.total(),"USD","symbol")," "),h.R7$(2),h.vxM(e.hidePricingTerm()?-1:37)}}class ae{constructor(){this.i18nService=(0,A.WQX)(P.W),this.cart=r.hFB.required(),this.header=(0,r.hFB)(),this.hidePricingTerm=(0,r.hFB)(!1),this.showDiscountBadges=(0,r.hFB)(!1),this.isExpanded=(0,A.vPA)(!0),this.passwordManagerSeatsTotal=(0,T.EW)(()=>{const{passwordManager:{seats:e}}=this.cart();return e.quantity*e.cost}),this.passwordManagerSeatsDiscountAmount=(0,T.EW)(()=>{const{passwordManager:{seats:e}}=this.cart();return this.getItemDiscountAmount(e)}),this.passwordManagerSeatsDiscountLabel=(0,T.EW)(()=>{const{passwordManager:{seats:e}}=this.cart();return e.discount?(0,D.p9)(this.i18nService,e.discount):""}),this.additionalStorageTotal=(0,T.EW)(()=>{const{passwordManager:{additionalStorage:e}}=this.cart();return e?e.quantity*e.cost:0}),this.secretsManagerSeatsTotal=(0,T.EW)(()=>{const{secretsManager:e}=this.cart();return e?e.seats.quantity*e.seats.cost:0}),this.additionalServiceAccountsTotal=(0,T.EW)(()=>{const{secretsManager:e}=this.cart();return e&&e.additionalServiceAccounts?e.additionalServiceAccounts.quantity*e.additionalServiceAccounts.cost:0}),this.estimatedTax=(0,T.EW)(()=>this.cart().estimatedTax),this.term=(0,T.EW)(()=>{const{cadence:e}=this.cart();switch(e){case"annually":return this.i18nService.t("year");case"monthly":return this.i18nService.t("month")}}),this.subtotal=(0,T.EW)(()=>this.passwordManagerSeatsTotal()+this.additionalStorageTotal()+this.secretsManagerSeatsTotal()+this.additionalServiceAccountsTotal()),this.discountLineItems=(0,T.EW)(()=>{const{discounts:e}=this.cart();return(null==e?void 0:e.length)?this.calculateDiscountLineItems(e,this.subtotal()):[]}),this.discountAmount=(0,T.EW)(()=>this.discountLineItems().reduce((e,t)=>e+t.amount,0)),this.creditAmount=(0,T.EW)(()=>{const{credit:e}=this.cart();return e?e.value:0}),this.total=(0,T.EW)(()=>this.subtotal()-this.discountAmount()-this.passwordManagerSeatsDiscountAmount()-this.creditAmount()+this.estimatedTax()),this.total$=(0,F.br)(this.total)}calculateDiscountLineItems(e,t){let i=t;return e.map(e=>{const t=(0,D.fE)(e,i);return i-=t,{label:(0,D.p9)(this.i18nService,e),amount:t}})}translateWithParams(e,t){return t&&0!==t.length?this.i18nService.t(e,...t):this.i18nService.t(e)}toggleExpanded(){this.isExpanded.update(e=>!e)}getItemDiscountAmount(e){return e.discount?(0,D.fE)(e.discount,e.quantity*e.cost):0}}ae.ɵfac=function(e){return new(e||ae)},ae.ɵcmp=h.VBU({type:ae,selectors:[["billing-cart-summary"]],inputs:{cart:[1,"cart"],header:[1,"header"],hidePricingTerm:[1,"hidePricingTerm"],showDiscountBadges:[1,"showDiscountBadges"]},decls:13,vars:14,consts:[[1,"tw-size-full"],[1,"tw-flex","tw-items-center","tw-pb-2","tw-gap-0.5"],[1,"tw-flex","tw-items-center"],["type","button","size","small","data-testid","toggle-purchase-summary-details",3,"click","bitIconButton","label"],["id","purchase-summary-details",1,"tw-pb-2"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["bitTypography","h4","id","purchase-summary-heading","data-testid","purchase-summary-heading-total",1,"!tw-m-0"],["bitTypography","h3"],["bitTypography","body1",1,"tw-text-muted","tw-ms-1"],[1,"tw-mr-1",3,"discount"],["id","password-manager",1,"tw-border-b","tw-border-secondary-100","tw-pb-2"],[1,"tw-flex","tw-justify-between","tw-mb-1"],["bitTypography","h5",1,"tw-text-muted","tw-font-semibold"],["id","password-manager-members",1,"tw-flex","tw-justify-between"],[1,"tw-flex-1"],["bitTypography","body1",1,"tw-text-muted","tw-font-normal"],["bitTypography","body1","data-testid","password-manager-total",1,"tw-text-muted","tw-font-normal"],["data-testid","password-manager-seats-discount",1,"tw-flex","tw-justify-between"],["id","additional-storage",1,"tw-flex","tw-justify-between"],["id","secrets-manager",1,"tw-border-b","tw-border-secondary-100","tw-py-2"],["id","credit-section","data-testid","credit-section",1,"tw-flex","tw-justify-between","tw-border-b","tw-border-secondary-100","tw-py-2"],["id","estimated-tax-section",1,"tw-flex","tw-justify-between","tw-border-b","tw-border-secondary-100","tw-pt-2","tw-pb-0.5"],["bitTypography","body1","data-testid","estimated-tax",1,"tw-text-muted"],["id","total-section",1,"tw-flex","tw-justify-between","tw-items-center","tw-pt-2"],["bitTypography","body1","data-testid","final-total",1,"tw-text-muted"],["bitTypography","body1","data-testid","password-manager-seats-discount-label",1,"tw-text-success-600"],["bitTypography","body1","data-testid","password-manager-seats-discount-amount",1,"tw-text-success-600"],["bitTypography","body1","data-testid","additional-storage-total",1,"tw-text-muted","tw-font-normal"],[1,"tw-flex","tw-justify-between"],["id","secrets-manager-members",1,"tw-flex","tw-justify-between"],["bitTypography","body1","data-testid","secrets-manager-seats-total",1,"tw-text-muted","tw-font-normal"],["id","additional-service-accounts",1,"tw-flex","tw-justify-between"],["bitTypography","body1","data-testid","additional-service-accounts-total",1,"tw-text-muted"],["data-testid","discount-section",1,"tw-flex","tw-justify-between","tw-border-b","tw-border-secondary-100","tw-py-2"],["bitTypography","body1",1,"tw-text-success-600"],["bitTypography","body1","data-testid","discount-amount",1,"tw-text-success-600"],["bitTypography","body1","data-testid","credit-amount",1,"tw-text-muted","tw-font-normal"]],template:function(e,t){if(1&e){const e=h.RV6();h.SS7(0)(1)(2),h.j41(3,"div",0)(4,"div",1)(5,"div",2),h.nVh(6,V,1,4,"ng-container")(7,N,7,9),h.k0s(),h.j41(8,"button",3),h.nI1(9,"i18n"),h.nI1(10,"i18n"),h.bIt("click",function(){return A.eBV(e),A.Njj(t.toggleExpanded())}),h.k0s(),h.nVh(11,Y,2,0),h.k0s(),h.nVh(12,oe,38,35,"div",4),h.k0s()}if(2&e){let e;h.bH3(t.cart()),h.R7$(),h.bH3(t.term()),h.R7$(),h.bH3(t.hidePricingTerm()),h.R7$(4),h.vxM((e=t.header())?6:7,e),h.R7$(2),h.Y8G("bitIconButton",t.isExpanded()?"bwi-angle-up":"bwi-angle-down")("label",t.isExpanded()?h.bMT(9,10,"Collapse purchase details"):h.bMT(10,12,"Expand purchase details")),h.BMQ("aria-expanded",t.isExpanded())("aria-controls","purchase-summary-details"),h.R7$(3),h.vxM(t.showDiscountBadges()?11:-1),h.R7$(),h.vxM(t.isExpanded()?12:-1)}},dependencies:[c.E,f.r,R.Q,x.s,n.T3,M.U,n.oe,u.$Z],encapsulation:2,changeDetection:0})},65791(e,t,i){"use strict";i.d(t,{X:()=>s});var n=i(20702);class r extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.domains=this.getResponseProperty("Domains"),this.excluded=this.getResponseProperty("Excluded")}}class s extends n.r{constructor(e){super(e),this.globalEquivalentDomains=[],this.equivalentDomains=this.getResponseProperty("EquivalentDomains");const t=this.getResponseProperty("GlobalEquivalentDomains");this.globalEquivalentDomains=null!=t?t.map(e=>new r(e)):[]}}},65802(e,t,i){"use strict";i.d(t,{s:()=>n});class n{}},65918(e,t,i){"use strict";i.d(t,{X:()=>r});var n=i(8583);class r extends n.n{constructor(e){var t;super(),this.discoverable=!1,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=null!==(t=e.discoverable)&&void 0!==t&&t,this.creationDate=e.creationDate)}get subTitle(){return this.userDisplayName}static fromJSON(e){const t=null!=e.creationDate?new Date(e.creationDate):null;return Object.assign(new r,e,{creationDate:t})}static fromSdkFido2CredentialView(e){var t;if(e)return new r({credentialId:e.credentialId,keyType:e.keyType,keyAlgorithm:e.keyAlgorithm,keyCurve:e.keyCurve,keyValue:e.keyValue,rpId:e.rpId,userHandle:e.userHandle,userName:e.userName,counter:parseInt(e.counter),rpName:e.rpName,userDisplayName:e.userDisplayName,discoverable:"true"===(null===(t=e.discoverable)||void 0===t?void 0:t.toLowerCase()),creationDate:new Date(e.creationDate)})}toSdkFido2CredentialFullView(){var e;return{credentialId:this.credentialId,keyType:this.keyType,keyAlgorithm:this.keyAlgorithm,keyCurve:this.keyCurve,keyValue:this.keyValue,rpId:this.rpId,userHandle:this.userHandle,userName:this.userName,counter:this.counter.toString(),rpName:this.rpName,userDisplayName:this.userDisplayName,discoverable:this.discoverable?"true":"false",creationDate:null===(e=this.creationDate)||void 0===e?void 0:e.toISOString()}}}},65963(e,t,i){"use strict";i.d(t,{J:()=>s});var n=i(33812),r=i(51757);class s{constructor(e,t){this.el=e,this.ngControl=t}onInput(){const e=this.el.nativeElement.value.replace(/\s+/g,"");this.ngControl.control.setValue(e)}}s.ɵfac=function(e){return new(e||s)(n.rXU(n.aKT),n.rXU(r.vO,2))},s.ɵdir=n.FsC({type:s,selectors:[["input","appInputStripSpaces",""]],hostBindings:function(e,t){1&e&&n.bIt("input",function(){return t.onInput()})}})},66316(e,t,i){"use strict";i.d(t,{u3:()=>G,ce:()=>x,o3:()=>j});var n=i(81525),r=i(43380),s=i(37831),o=i(74208),a=i(83731),l=i(23649),c=i(66046),d=i(69194),u=i(44500),h=i(3204),A=i(12610),p=i(34040),g=i(72245),v=i(58363),f=i(68455),m=i(84110);const y={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};var C=i(66723),w=i(51757),I=i(38620),b=i(26657),B=i(56898),E=i(67311),S=i(33812),Q=i(50700),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function T(e,t){if(1&e){const e=S.RV6();S.j41(0,"button",7),S.bIt("click",function(){o.eBV(e);const t=S.XpG();return o.Njj(t.dialogRef.close(!1))}),S.EFF(1),S.k0s()}if(2&e){const e=S.XpG();S.R7$(),S.SpI(" ",e.cancelButtonText," ")}}const F={primary:"bwi-business",success:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"},P={primary:"tw-text-primary-600",success:"tw-text-success",info:"tw-text-info",warning:"tw-text-warning",danger:"tw-text-danger"};class R{get iconClasses(){var e;return[null!==(e=this.simpleDialogOpts.icon)&&void 0!==e?e:F[this.simpleDialogOpts.type],P[this.simpleDialogOpts.type]]}constructor(e,t,i){this.dialogRef=e,this.i18nService=t,this.simpleDialogOpts=i,this.formGroup=new w.gE({}),this.showCancelButton=null!==this.simpleDialogOpts.cancelButtonText,this.accept=()=>k(this,void 0,void 0,function*(){this.simpleDialogOpts.acceptAction&&(yield this.simpleDialogOpts.acceptAction()),this.simpleDialogOpts.disableClose||this.dialogRef.close(!0)}),this.localizeText()}localizeText(){var e,t;this.title=this.translate(this.simpleDialogOpts.title),this.content=this.translate(this.simpleDialogOpts.content),this.acceptButtonText=this.translate(null!==(e=this.simpleDialogOpts.acceptButtonText)&&void 0!==e?e:{key:"yes"}),this.showCancelButton&&(this.cancelButtonText=this.translate(null!==(t=this.simpleDialogOpts.cancelButtonText)&&void 0!==t?t:void 0!==this.simpleDialogOpts.acceptButtonText?{key:"cancel"}:{key:"no"}))}translate(e){var t;return"object"==typeof e?this.i18nService.t(e.key,...null!==(t=e.placeholders)&&void 0!==t?t:[]):e}}R.ɵfac=function(e){return new(e||R)(S.rXU(n.ce),S.rXU(Q.W),S.rXU(n.Qs))},R.ɵcmp=S.VBU({type:R,selectors:[["ng-component"]],decls:10,vars:8,consts:[["bit-simple-dialog","",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"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(S.j41(0,"form",0),S.nrm(1,"i",1),S.j41(2,"span",2),S.EFF(3),S.k0s(),S.j41(4,"div",3),S.EFF(5),S.k0s(),S.qex(6,4),S.j41(7,"button",5),S.EFF(8),S.k0s(),S.nVh(9,T,2,1,"button",6),S.bVm(),S.k0s()),2&e&&(S.Y8G("formGroup",t.formGroup)("bitSubmit",t.accept),S.R7$(),S.HbH(t.iconClasses),S.R7$(2),S.JRh(t.title),S.R7$(2),S.JRh(t.content),S.R7$(3),S.SpI(" ",t.acceptButtonText," "),S.R7$(),S.vxM(t.showCancelButton?9:-1))},dependencies:[w.X1,w.qT,w.cb,w.j4,I.L,E.o_,E.LJ,E.hJ,B.Q,b.$],encapsulation:2});var D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M{enable(){document.body.classList.add("tw-overflow-hidden")}disable(){document.body.classList.remove("tw-overflow-hidden")}attach(){}detach(){}}class x{}class O extends r.qC{constructor(){super(),this.abortController=null,this.prevBreakpoint=null,"undefined"!=typeof window&&(this.abortController=new AbortController,this.updatePosition(),window.addEventListener("resize",this.updatePosition.bind(this),{signal:this.abortController.signal}))}dispose(){var e;null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=null,super.dispose()}updatePosition(){const e=!(e=>{if("undefined"==typeof window||!window.matchMedia)return!1;const t=`(min-width: ${y[e]}px)`;return window.matchMedia(t).matches})("md"),t=e?"small":"large";this.prevBreakpoint!==t&&(this.prevBreakpoint=t,e?this.bottom().centerHorizontally():this.centerVertically().centerHorizontally(),this.apply())}}class G extends r.qC{constructor(){super(),this.centerHorizontally().centerVertically()}}class U{constructor(e,t=!1){this.drawerService=e,this.closeOnNavigation=t,this.isDrawer=!0,this._closed=new c.B,this.closed=this._closed.asObservable(),this.disableClose=!1,this.componentInstance=null}close(e,t){this.disableClose||(this.drawerService.close(this.portal),this._closed.next(e),this._closed.complete())}}class V{constructor(){this.isDrawer=!1}close(e,t){this.cdkDialogRefBase.close(e,t)}get closed(){return this.cdkDialogRefBase.closed}get disableClose(){return this.cdkDialogRefBase.disableClose}set disableClose(e){this.cdkDialogRefBase.disableClose=e}get componentInstance(){return this.cdkDialogRefBase.componentInstance}}class j{constructor(){this.dialog=(0,o.WQX)(n.lG),this.drawerService=(0,o.WQX)(C.d),this.injector=(0,o.WQX)(o.zZn),this.router=(0,o.WQX)(l.Ix),this.authService=(0,o.WQX)(f.u,{optional:!0}),this.backDropClasses=["tw-fixed","tw-bg-bg-overlay","tw-inset-0"],this.defaultScrollStrategy=new M,this.activeDrawer=null,this.router&&this.authService&&this.router.events.pipe((0,d.p)(e=>e instanceof l.wF),(0,u.n)(()=>this.authService.getAuthStatus()),(0,d.p)(e=>e!==m.J.Unlocked),(0,a.pQ)()).subscribe(()=>this.closeAll()),this.router&&this.router.events.pipe((0,d.p)(e=>e instanceof l.wF),(0,h.T)(e=>e.urlAfterRedirects.split("?")[0]),(0,A.Z)(this.router.url.split("?")[0]),(0,p.F)(),(0,d.p)(()=>{var e;return!0===(null===(e=this.activeDrawer)||void 0===e?void 0:e.closeOnNavigation)}),(0,a.pQ)()).subscribe(()=>this.closeDrawer())}open(e,t){var i;const n=new V,r=this.createInjector({data:null==t?void 0:t.data,dialogRef:n}),s=Object.assign({backdropClass:this.backDropClasses,scrollStrategy:this.defaultScrollStrategy,positionStrategy:null!==(i=null==t?void 0:t.positionStrategy)&&void 0!==i?i:new O,closeOnNavigation:null==t?void 0:t.closeOnNavigation,injector:r},t);return n.cdkDialogRefBase=this.dialog.open(e,s),void 0===(null==t?void 0:t.restoreFocus)&&this.setRestoreFocusEl(n),n}openDrawer(e,t){var i,n;null===(i=this.activeDrawer)||void 0===i||i.close(),this.activeDrawer=new U(this.drawerService,null!==(n=null==t?void 0:t.closeOnNavigation)&&void 0!==n&&n);const r=new s.A8(e,null,this.createInjector({data:null==t?void 0:t.data,dialogRef:this.activeDrawer}));return this.activeDrawer.portal=r,this.drawerService.open(r),this.activeDrawer}openSimpleDialog(e){return D(this,void 0,void 0,function*(){const t=this.openSimpleDialogRef(e);return(0,g._)(t.closed.pipe((0,h.T)(e=>!!e)))})}openSimpleDialogRef(e){return this.open(R,{data:e,disableClose:e.disableClose,positionStrategy:new G})}closeAll(){return this.dialog.closeAll()}closeDrawer(){var e;return null===(e=this.activeDrawer)||void 0===e?void 0:e.close()}setRestoreFocusEl(e){const t=document.activeElement,i=setTimeout(()=>{let i=t;(null==i?void 0:i.isConnected)||(i=document.activeElement),i instanceof HTMLElement&&(e.cdkDialogRefBase.config.restoreFocus=i)},0);e.closed.pipe((0,v.s)(1)).subscribe(()=>{clearTimeout(i)})}createInjector(e){return o.zZn.create({providers:[{provide:n.Qs,useValue:e.data},{provide:x,useValue:e.dialogRef},{provide:n.ce,useValue:e.dialogRef}],parent:this.injector})}}j.ɵfac=function(e){return new(e||j)},j.ɵprov=o.jDH({token:j,factory:j.ɵfac})},66523(e,t,i){"use strict";i.d(t,{K5:()=>d,WD:()=>l,m8:()=>s,yL:()=>a,zw:()=>c});var n=i(51151),r=i(78781);class s extends Error{constructor(e){super(`User (${e}) is not logged in`)}}class o extends Error{constructor(e){super(`Invalid UUID: ${e}`)}}function a(e){switch(e){case n.bq.Android:return"Android";case n.bq.iOS:return"iOS";case n.bq.ChromeExtension:return"ChromeExtension";case n.bq.FirefoxExtension:return"FirefoxExtension";case n.bq.OperaExtension:return"OperaExtension";case n.bq.EdgeExtension:return"EdgeExtension";case n.bq.WindowsDesktop:return"WindowsDesktop";case n.bq.MacOsDesktop:return"MacOsDesktop";case n.bq.LinuxDesktop:return"LinuxDesktop";case n.bq.ChromeBrowser:return"ChromeBrowser";case n.bq.FirefoxBrowser:return"FirefoxBrowser";case n.bq.OperaBrowser:return"OperaBrowser";case n.bq.EdgeBrowser:return"EdgeBrowser";case n.bq.IEBrowser:return"IEBrowser";case n.bq.UnknownBrowser:return"UnknownBrowser";case n.bq.AndroidAmazon:return"AndroidAmazon";case n.bq.UWP:return"UWP";case n.bq.SafariBrowser:return"SafariBrowser";case n.bq.VivaldiBrowser:return"VivaldiBrowser";case n.bq.VivaldiExtension:return"VivaldiExtension";case n.bq.SafariExtension:return"SafariExtension";case n.bq.Server:return"Server";case n.bq.WindowsCLI:return"WindowsCLI";case n.bq.MacOsCLI:return"MacOsCLI";case n.bq.LinuxCLI:return"LinuxCLI";default:return"SDK"}}function l(e){if(r.A.isGuid(e))return e;throw new o(e)}function c(e){return e}class d{}},66723(e,t,i){"use strict";i.d(t,{d:()=>r});var n=i(74208);class r{constructor(){this.portal=(0,n.vPA)(void 0),this.pushWidthPx=(0,n.vPA)(0),this.isPushMode=(0,n.vPA)(!1)}open(e){this.portal.set(e)}close(e){e===this.portal()&&(this.portal.set(void 0),this.pushWidthPx.set(0),this.isPushMode.set(!1))}declarePushWidth(e){this.pushWidthPx.set(e)}}r.ɵfac=function(e){return new(e||r)},r.ɵprov=n.jDH({token:r,factory:r.ɵfac,providedIn:"root"})},66827(e,t,i){"use strict";i.d(t,{y:()=>n});class n{}},66983(e,t,i){"use strict";i.d(t,{b:()=>p});var n=i(33338),r=i(93695),s=i(3204),o=i(34040),a=i(27442),l=i(44500),c=i(43978),d=i(3633),u=i(31442),h=i(66523),A=i(61325);class p{constructor(e,t,i){this.accountService=e,this.organizationService=t,this.policyService=i,this.restricted$=this.accountService.activeAccount$.pipe(d.bB,(0,l.n)(e=>null==e?(0,r.of)([]):(0,n.z)([this.organizationService.organizations$(e),this.policyService.policiesByType$(c.tt.RestrictedItemTypes,e)]).pipe((0,s.T)(([e,t])=>{const i=e=>{var t;return null!==(t=e.data)&&void 0!==t?t:[u.gC.Card]};return Array.from(new Set(t.flatMap(i))).map(n=>{const r=e.filter(e=>{const r=t.find(t=>t.organizationId===e.id);return!r||!i(r).includes(n)}).map(e=>e.id);return{cipherType:n,allowViewOrgIds:r}})}))),(0,o.F)(),(0,a.t)({bufferSize:1,refCount:!0}))}isCipherRestricted(e,t){const i=t.find(t=>t.cipherType===A.n.getType(e));return!!i&&(!e.organizationId||!i.allowViewOrgIds.includes((0,h.zw)(e.organizationId)))}isCipherRestricted$(e){return this.restricted$.pipe((0,s.T)(t=>this.isCipherRestricted(e,t)))}}},67036(e,t,i){"use strict";i.d(t,{O:()=>c});var n=i(78781),r=i(31442),s=i(69473),o=i(8583),a=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class c extends o.n{constructor(){super()}get firstName(){return this._firstName}set firstName(e){this._firstName=e,this._subTitle=void 0}get lastName(){return this._lastName}set lastName(e){this._lastName=e,this._subTitle=void 0}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 n.A.isNullOrWhitespace(this.title)||(e+=this.title+" "),n.A.isNullOrWhitespace(this.firstName)||(e+=this.firstName+" "),n.A.isNullOrWhitespace(this.middleName)||(e+=this.middleName+" "),n.A.isNullOrWhitespace(this.lastName)||(e+=this.lastName),e.trim()}}get fullAddress(){var e;let t=null!==(e=this.address1)&&void 0!==e?e:"";return n.A.isNullOrWhitespace(this.address2)||(n.A.isNullOrWhitespace(t)||(t+=", "),t+=this.address2),n.A.isNullOrWhitespace(this.address3)||(n.A.isNullOrWhitespace(t)||(t+=", "),t+=this.address3),t}get fullAddressPart2(){const e=!n.A.isNullOrWhitespace(this.city),t=!n.A.isNullOrWhitespace(this.state),i=!n.A.isNullOrWhitespace(this.postalCode);if(!e&&!t&&!i)return;const r=e?this.city:"-",s=this.state;let o=r;return t&&(o+=", "+s),o+=", "+(i?this.postalCode:"-"),o}get fullAddressForCopy(){let e=this.fullAddress;return null==this.city&&null==this.state&&null==this.postalCode||(e+="\n"+this.fullAddressPart2),null!=this.country&&(e+="\n"+this.country),e}static fromJSON(e){return Object.assign(new c,e)}static fromSdkIdentityView(e){const t=new c;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}toSdkIdentityView(){return this}}a([(0,s.V)(r.ZX.Title,{sortPosition:0}),l("design:type",String)],c.prototype,"title",void 0),a([(0,s.V)(r.ZX.MiddleName,{sortPosition:2}),l("design:type",String)],c.prototype,"middleName",void 0),a([(0,s.V)(r.ZX.Address1,{sortPosition:12}),l("design:type",String)],c.prototype,"address1",void 0),a([(0,s.V)(r.ZX.Address2,{sortPosition:13}),l("design:type",String)],c.prototype,"address2",void 0),a([(0,s.V)(r.ZX.Address3,{sortPosition:14}),l("design:type",String)],c.prototype,"address3",void 0),a([(0,s.V)(r.ZX.City,{sortPosition:15,i18nKey:"cityTown"}),l("design:type",String)],c.prototype,"city",void 0),a([(0,s.V)(r.ZX.State,{sortPosition:16,i18nKey:"stateProvince"}),l("design:type",String)],c.prototype,"state",void 0),a([(0,s.V)(r.ZX.PostalCode,{sortPosition:17,i18nKey:"zipPostalCodeLabel"}),l("design:type",String)],c.prototype,"postalCode",void 0),a([(0,s.V)(r.ZX.Country,{sortPosition:18}),l("design:type",String)],c.prototype,"country",void 0),a([(0,s.V)(r.ZX.Company,{sortPosition:6}),l("design:type",String)],c.prototype,"company",void 0),a([(0,s.V)(r.ZX.Email,{sortPosition:10}),l("design:type",String)],c.prototype,"email",void 0),a([(0,s.V)(r.ZX.Phone,{sortPosition:11}),l("design:type",String)],c.prototype,"phone",void 0),a([(0,s.V)(r.ZX.Ssn,{sortPosition:7}),l("design:type",String)],c.prototype,"ssn",void 0),a([(0,s.V)(r.ZX.Username,{sortPosition:5}),l("design:type",String)],c.prototype,"username",void 0),a([(0,s.V)(r.ZX.PassportNumber,{sortPosition:8}),l("design:type",String)],c.prototype,"passportNumber",void 0),a([(0,s.V)(r.ZX.LicenseNumber,{sortPosition:9}),l("design:type",String)],c.prototype,"licenseNumber",void 0),a([(0,s.V)(r.ZX.FirstName,{sortPosition:1}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"firstName",null),a([(0,s.V)(r.ZX.LastName,{sortPosition:4}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"lastName",null),a([(0,s.V)(r.ZX.FullName,{sortPosition:3}),l("design:type",String),l("design:paramtypes",[])],c.prototype,"fullName",null)},67097(e,t,i){"use strict";i.d(t,{v:()=>a});var n=i(20702),r=i(8916);class s extends n.r{constructor(e){super(e);const t=this.getResponseProperty("KdfType");if(null==t||"number"!=typeof t)throw new Error("KDF config response does not contain a valid KDF type");this.kdfType=t;const i=this.getResponseProperty("Iterations");if(null==i||"number"!=typeof i)throw new Error("KDF config response does not contain a valid number of iterations");if(this.iterations=i,this.kdfType===r.ao.Argon2id){const e=this.getResponseProperty("Memory");if(null==e||"number"!=typeof e)throw new Error("KDF config response does not contain a valid memory size for Argon2id");const t=this.getResponseProperty("Parallelism");if(null==t||"number"!=typeof t)throw new Error("KDF config response does not contain a valid parallelism for Argon2id");this.memory=e,this.parallelism=t}}toKdfConfig(){switch(this.kdfType){case r.ao.Argon2id:return new r.hU(this.iterations,this.memory,this.parallelism);case r.ao.PBKDF2_SHA256:return new r.n1(this.iterations)}}}var o=i(10459);class a extends n.r{constructor(e){super(e);const t=this.getResponseProperty("Salt");if(null==t||"string"!=typeof t)throw new Error("MasterPasswordUnlockResponse does not contain a valid salt");this.salt=t,this.kdf=new s(this.getResponseProperty("Kdf"));const i=this.getResponseProperty("MasterKeyEncryptedUserKey");if(null==i||"string"!=typeof i)throw new Error("MasterPasswordUnlockResponse does not contain a valid master key encrypted user key");this.masterKeyWrappedUserKey=i}toMasterPasswordUnlockData(){return new o.k(this.salt,this.kdf.toKdfConfig(),this.masterKeyWrappedUserKey)}}},67253(e,t,i){"use strict";function n(e){return null!=e&&!0!==e.encrypted}function r(e){return n(e)&&null!=e.collections}function s(e){return null!=e&&!0===e.encrypted}function o(e){return null!=e&&!0===e.encrypted&&!0===e.passwordProtected}function a(e){return s(e)&&null!=e.collections}i.d(t,{Rf:()=>j,Ly:()=>k,n_:()=>M,DX:()=>P,zo:()=>F,to:()=>g,SF:()=>x,C8:()=>p,Os:()=>l,TS:()=>a,SX:()=>r,og:()=>o,oK:()=>n});class l{}var c=i(93695),d=i(72245),u=i(3633),h=i(78781),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{constructor(e,t,i){this.individualVaultExportService=e,this.organizationVaultExportService=t,this.accountService=i}getExport(e){return A(this,arguments,void 0,function*(e,t="csv",i=""){if(yield this.checkForImpersonation(e),!h.A.isNullOrWhitespace(i)){if("csv"==t)throw new Error("CSV does not support password protected export");return this.individualVaultExportService.getPasswordProtectedExport(e,i)}return this.individualVaultExportService.getExport(e,t)})}getOrganizationExport(e,t,i,n){return A(this,arguments,void 0,function*(e,t,i,n,r=!1){if(yield this.checkForImpersonation(e),!h.A.isNullOrWhitespace(n)){if("csv"==i)throw new Error("CSV does not support password protected export");return this.organizationVaultExportService.getPasswordProtectedExport(e,t,n,r)}return this.organizationVaultExportService.getOrganizationExport(e,t,i,r)})}formats$(e){const t=[{name:".json",format:"json"},{name:".csv",format:"csv"},{name:".json (Encrypted)",format:"encrypted_json"}];return e.isMyVault?(0,c.of)([...t,{name:".zip (with attachments)",format:"zip"}]):(0,c.of)(t)}checkForImpersonation(e){return A(this,void 0,void 0,function*(){const t=yield(0,d._)(this.accountService.activeAccount$.pipe(u.F6));if(e!==t)throw new Error("UserId does not match the currently authenticated user")})}}class g{}var v=i(98869),f=i(69194),m=i(3204),y=i(52237),C=i(56455),w=i(31442),I=i(50451),b=i(23293),B=i(53323),E=i(8916),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Q{constructor(e,t,i,n){this.keyGenerationService=e,this.encryptService=t,this.cryptoFunctionService=i,this.kdfConfigService=n}buildPasswordExport(e,t,i){return S(this,void 0,void 0,function*(){const n=yield this.kdfConfigService.getKdfConfig(e),r=h.A.fromBufferToB64(yield this.cryptoFunctionService.randomBytes(16)),s=yield this.keyGenerationService.deriveVaultExportKey(i,r,n),o=yield this.encryptService.encryptString(h.A.newGuid(),s),a=yield this.encryptService.encryptString(t,s),l={encrypted:!0,passwordProtected:!0,salt:r,kdfType:n.kdfType,kdfIterations:n.iterations,encKeyValidation_DO_NOT_EDIT:o.encryptedString,data:a.encryptedString};return n.kdfType===E.ao.Argon2id&&(l.kdfMemory=n.memory,l.kdfParallelism=n.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.archivedDate=t.archivedDate?t.archivedDate.toISOString():null,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 w.gC.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 w.gC.SecureNote:e.type="note";break;default:return}return e}}class k{static getFileName(e="",t="csv"){"encrypted_json"===t&&(e=""==e?"encrypted":"encrypted_"+e,t="json");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 T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F extends Q{constructor(e,t,i,n,r,s,o,a,l){super(i,r,s,a),this.cipherService=e,this.vaultExportApiService=t,this.keyService=n,this.collectionService=o,this.restrictedItemTypesService=l}getPasswordProtectedExport(e,t,i,n){return T(this,void 0,void 0,function*(){const r=yield this.getOrganizationExport(e,t,"json",n);return{type:"text/plain",data:yield this.buildPasswordExport(e,r.data,i),fileName:k.getFileName("org","encrypted_json")}})}getOrganizationExport(e,t){return T(this,arguments,void 0,function*(e,t,i="csv",n){if(h.A.isNullOrWhitespace(t))throw new Error("OrganizationId must be set");if("zip"===i)throw new Error("Zip export not supported for organization");return"encrypted_json"===i?{type:"text/plain",data:n?yield this.getEncryptedManagedExport(e,t):yield this.getOrganizationEncryptedExport(e,t),fileName:k.getFileName("org","encrypted_json")}:{type:"text/plain",data:n?yield this.getDecryptedManagedExport(e,t,i):yield this.getOrganizationDecryptedExport(e,t,i),fileName:k.getFileName("org",i)}})}getOrganizationDecryptedExport(e,t,i){return T(this,void 0,void 0,function*(){const n=[],r=[],s=[],o=yield(0,d._)(this.keyService.orgKeys$(e).pipe((0,f.p)(e=>null!=e))),a=yield(0,d._)(this.restrictedItemTypesService.restricted$);return s.push(this.vaultExportApiService.getOrganizationExport(t).then(i=>{const s=[];return null!=i&&(null!=i.collections&&i.collections.length>0&&i.collections.forEach(e=>{const i=y.pM.fromCollectionData(new y.Fw(e)),r=o[t];s.push(i.decrypt(r,this.encryptService).then(e=>{n.push(e)}))}),null!=i.ciphers&&i.ciphers.length>0&&i.ciphers.filter(e=>null===e.deletedDate).forEach(t=>T(this,void 0,void 0,function*(){const i=new b.o(new I.A(t));s.push(this.cipherService.decrypt(i,e).then(e=>{this.restrictedItemTypesService.isCipherRestricted(e,a)||r.push(e)}))}))),Promise.all(s)})),yield Promise.all(s),"csv"===i?this.buildCsvExport(n,r):this.buildJsonExport(n,r)})}getOrganizationEncryptedExport(e,t){return T(this,void 0,void 0,function*(){const i=[],n=[],r=yield(0,d._)(this.restrictedItemTypesService.restricted$),s=yield this.vaultExportApiService.getOrganizationExport(t);if(null!=s)return null!=s.collections&&s.collections.length>0&&s.collections.forEach(e=>{const t=y.pM.fromCollectionData(new y.Fw(e));i.push(t)}),null!=s.ciphers&&s.ciphers.length>0&&s.ciphers.filter(e=>null===e.deletedDate).forEach(e=>{const t=new b.o(new I.A(e));this.restrictedItemTypesService.isCipherRestricted(t,r)||n.push(t)}),this.BuildEncryptedExport(e,t,i,n)})}getDecryptedManagedExport(e,t,i){return T(this,void 0,void 0,function*(){let n=[],r=[];const s=[];s.push(this.cipherService.getAllDecrypted(e).then(e=>{r=e})),yield Promise.all(s);const o=yield(0,d._)(this.collectionService.decryptedCollections$(e).pipe((0,m.T)(e=>e.filter(e=>e.organizationId==t&&e.manage)))),a=yield(0,d._)(this.restrictedItemTypesService.restricted$);return n=r.filter(e=>null==e.deletedDate&&e.organizationId==t&&o.some(t=>e.collectionIds.some(e=>t.id===e))&&!this.restrictedItemTypesService.isCipherRestricted(e,a)),"csv"===i?this.buildCsvExport(o,n):this.buildJsonExport(o,n)})}getEncryptedManagedExport(e,t){return T(this,void 0,void 0,function*(){let i=[],n=[];const r=[];r.push(this.cipherService.getAll(e).then(e=>{n=e})),yield Promise.all(r);const s=yield(0,d._)(this.collectionService.encryptedCollections$(e).pipe((0,m.T)(e=>null!=e?e:[]),(0,m.T)(e=>e.filter(e=>e.organizationId==t&&e.manage)))),o=yield(0,d._)(this.restrictedItemTypesService.restricted$);return i=n.filter(e=>null==e.deletedDate&&e.organizationId==t&&s.some(t=>e.collectionIds.some(e=>t.id===e))&&!this.restrictedItemTypesService.isCipherRestricted(e,o)),this.BuildEncryptedExport(e,t,s,i)})}BuildEncryptedExport(e,t,i,n){return T(this,void 0,void 0,function*(){const r=yield(0,d._)(this.keyService.orgKeys$(e)),s=null==r?void 0:r[t];if(null==s)throw new Error("No encryption key found for organization");const o={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.encryptService.encryptString((0,B.aq)(),s)).encryptedString,collections:[],items:[]};return i.forEach(e=>{const t=new C.MA;t.build(e),o.collections.push(t)}),n.forEach(e=>{const t=new C.pU;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!==w.gC.Login&&e.type!==w.gC.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)}),v.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,collections:[],items:[]};return e.forEach(e=>{const t=new C.MA;t.build(e),i.collections.push(t)}),t.forEach(e=>{const t=new C.pU;t.build(e),delete t.key,i.items.push(t)}),JSON.stringify(i,null,"  ")}}class P{}var R=i(74794),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M extends Q{constructor(e,t,i,n,r,s,o,a,l){super(i,r,s,o),this.folderService=e,this.cipherService=t,this.keyService=n,this.apiService=a,this.restrictedItemTypesService=l}getExport(e){return D(this,arguments,void 0,function*(e,t="csv"){return"encrypted_json"===t?this.getEncryptedExport(e):"zip"===t?this.getDecryptedExportZip(e):this.getDecryptedExport(e,t)})}getPasswordProtectedExport(e,t){return D(this,void 0,void 0,function*(){const i=yield this.getExport(e,"json");if("text/plain"!==i.type)throw new Error("Unexpected export type");return{type:"text/plain",data:yield this.buildPasswordExport(e,i.data,t),fileName:k.getFileName("","encrypted_json")}})}getDecryptedExportZip(e){return D(this,void 0,void 0,function*(){const t=new R,i=yield this.getDecryptedExport(e,"json");t.file("data.json",i.data);const n=t.folder("attachments");if(null==n)throw new Error("Error creating attachments folder");for(const s of yield this.cipherService.getAllDecrypted(e)){if(!s.attachments||0===s.attachments.length||null!=s.deletedDate||null!=s.organizationId)continue;const t=n.folder(s.id);for(const i of s.attachments){const n=yield this.downloadAttachment(s.id,i.id);try{const r=yield this.cipherService.getDecryptedAttachmentBuffer(s.id,i,n,e);t.file(i.fileName,r)}catch(r){throw new Error("Error decrypting attachment")}}}return{type:"application/zip",data:yield t.generateAsync({type:"blob"}),fileName:k.getFileName("","zip")}})}downloadAttachment(e,t){return D(this,void 0,void 0,function*(){const i=(yield this.apiService.getAttachmentData(e,t)).url,n=yield fetch(new Request(i,{cache:"no-store"}));if(200!==n.status)throw new Error("Error downloading attachment");return n})}getDecryptedExport(e,t){return D(this,void 0,void 0,function*(){let i=[],n=[];const r=[];r.push((0,d._)(this.folderService.folderViews$(e)).then(e=>{i=e}));const s=yield(0,d._)(this.restrictedItemTypesService.restricted$);return r.push(this.cipherService.getAllDecrypted(e).then(e=>{n=e.filter(e=>null==e.deletedDate&&!this.restrictedItemTypesService.isCipherRestricted(e,s))})),yield Promise.all(r),"csv"===t?{type:"text/plain",data:this.buildCsvExport(i,n),fileName:k.getFileName("","csv")}:{type:"text/plain",data:this.buildJsonExport(i,n),fileName:k.getFileName("","json")}})}getEncryptedExport(e){return D(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");let t=[],i=[];const n=[];n.push((0,d._)(this.folderService.folders$(e)).then(e=>{t=e}));const r=yield(0,d._)(this.restrictedItemTypesService.restricted$);n.push(this.cipherService.getAll(e).then(e=>{i=e.filter(e=>null==e.deletedDate&&!this.restrictedItemTypesService.isCipherRestricted(e,r))})),yield Promise.all(n);const s=yield(0,d._)(this.keyService.userKey$(e)),o={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.encryptService.encryptString(h.A.newGuid(),s)).encryptedString,folders:[],items:[]};return t.forEach(e=>{if(!e.id)return;const t=new C.wG;t.build(e),o.folders.push(t)}),i.forEach(e=>{if(null!=e.organizationId)return;const t=new C.pU;t.build(e),t.collectionIds=null,o.items.push(t)}),{type:"text/plain",data:JSON.stringify(o,null,"  "),fileName:k.getFileName("","encrypted_json")}})}buildCsvExport(e,t){const i=new Map;e.forEach(e=>{e.id&&i.set(e.id,e)});const n=[];return t.forEach(e=>{if(e.type!==w.gC.Login&&e.type!==w.gC.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)}),v.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,folders:[],items:[]};return e.forEach(e=>{if(!e.id)return;const t=new C.wG;t.build(e),i.folders.push(t)}),t.forEach(e=>{if(null!=e.organizationId)return;const t=new C.pU;t.build(e),t.collectionIds=null,delete t.key,i.items.push(t)}),JSON.stringify(i,null,"  ")}}class x{}var O=i(20702),G=i(42700);class U extends O.r{constructor(e){super(e);const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map(e=>new y.uF(e)));const i=this.getResponseProperty("Ciphers");null!=i&&(this.ciphers=i.map(e=>new G.N(e)))}}var V=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class j{constructor(e){this.apiService=e}getOrganizationExport(e){return V(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/export",void 0,!0,!0);return new U(t)})}}},67311(e,t,i){"use strict";i.d(t,{hJ:()=>m,LJ:()=>f,o_:()=>y});var n=i(94573),r=i(33812),s=i(74208),o=i(55686),a=i(56898),l=i(58384),c=i(58806),d=i(28846);const u=(0,d.hZ)("fadeIn",[(0,d.kY)(":enter",[(0,d.iF)({opacity:0,transform:"translateY(-50px)"}),(0,d.Os)([(0,d.i0)("0.15s linear",(0,d.iF)({opacity:1})),(0,d.i0)("0.3s ease-out",(0,d.iF)({transform:"none"}))])])]);var h=i(35042);const A=["dialogHeader"],p=[[["","bitDialogTitle",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]],[["","bitDialogIcon",""]]];function g(e,t){1&e&&r.nrm(0,"bit-icon",6)}function v(e,t){1&e&&r.SdG(0,3,null,g,1,0)}class f{}f.ɵfac=function(e){return new(e||f)},f.ɵdir=r.FsC({type:f,selectors:[["","bitDialogIcon",""]]});class m{constructor(){this.buttons=(0,n.tEk)(a.Q,{read:r.aKT})}}m.ɵfac=function(e){return new(e||m)},m.ɵdir=r.FsC({type:m,selectors:[["","bitDialogFooter",""]],contentQueries:function(e,t,i){1&e&&r.C6U(i,t.buttons,a.Q,4,r.aKT),2&e&&r.NyB()}});class y{constructor(){this.autofocusFallback=(0,s.WQX)(o.D,{host:!0}),this.dialogHeader=n.ebz.required("dialogHeader"),this.footer=(0,n.sbv)(m),this.hideIcon=(0,n.hFB)(!1,{transform:n.L39})}ngAfterViewInit(){var e,t,i;const n=null!==(t=null===(e=this.footer())||void 0===e?void 0:e.buttons())&&void 0!==t?t:[];this.autofocusFallback.bitAutofocusFallback.set(null!==(i=n[0])&&void 0!==i?i:this.dialogHeader())}}y.ɵfac=function(e){return new(e||y)},y.ɵcmp=r.VBU({type:y,selectors:[["bit-simple-dialog"],["","bit-simple-dialog",""]],contentQueries:function(e,t,i){1&e&&r.C6U(i,t.footer,m,5),2&e&&r.NyB()},viewQuery:function(e,t){1&e&&r.wEZ(t.dialogHeader,A,5),2&e&&r.NyB()},inputs:{hideIcon:[1,"hideIcon"]},features:[r.nM4([o.D])],ngContentSelectors:["[bitDialogTitle]","[bitDialogContent]","[bitDialogFooter]","[bitDialogIcon]"],decls:10,vars:2,consts:[["dialogHeader",""],[1,"tw-my-4","tw-pb-6","tw-pt-8","tw-flex","tw-max-h-screen","tw-w-96","tw-max-w-90vw","tw-flex-col","tw-overflow-hidden","tw-rounded-3xl","tw-border","tw-border-solid","tw-border-secondary-100","tw-shadow-lg","tw-bg-text-contrast","tw-text-main"],[1,"tw-flex","tw-px-6","tw-flex-col","tw-items-center","tw-gap-2","tw-text-center"],["bitDialogTitleContainer","","bitTypography","h3","noMargin","","tabindex","-1",1,"tw-w-full","tw-text-main","tw-break-words","focus-visible:tw-outline-none"],[1,"tw-overflow-y-auto","tw-px-6","tw-mb-6","tw-text-center","tw-text-base","tw-break-words"],[1,"tw-flex","tw-flex-col","tw-gap-2","tw-px-6"],["name","bwi-exclamation-triangle",1,"tw-text-3xl","tw-text-warning"]],template:function(e,t){1&e&&(r.NAR(p),r.j41(0,"div",1)(1,"div",2),r.nVh(2,v,2,0),r.j41(3,"h1",3,0),r.SdG(5),r.k0s()(),r.j41(6,"div",4),r.SdG(7,1),r.k0s(),r.j41(8,"div",5),r.SdG(9,2),r.k0s()()),2&e&&(r.Y8G("@fadeIn",void 0),r.R7$(2),r.vxM(t.hideIcon()?-1:2))},dependencies:[h.h,c.r,l.R],encapsulation:2,data:{animation:[u]},changeDetection:0})},67372(e,t,i){"use strict";i.d(t,{v:()=>Ft});var n=i(94573),r=i(33277),s=i(74208),o=i(83731),a=i(51757),l=i(75811),c=i(93695),d=i(66046),u=i(72245),h=i(14803),A=i(69194),p=i(44500),g=i(3204),v=i(67553),f=i(43978),m=i(77665),y=i(56953),C=i(79667);class w{constructor(e,t){this.clientOwnerEmail=e,this.organizationCreateRequest=t}}var I=i(3633),b=i(60512),B=i(64447),E=i(32706),S=i(82468),Q=i(83516),k=i(39488),T=i(8916),F=i(65731),P=i(9327),R=i(9753),D=i(32501),M=i(33102),x=i(69022),O=i(40101),G=i(33812),U=i(12012),V=i(50700),j=i(37115),N=i(89105),z=i(23649),Y=i(18499),L=i(11224),K=i(62316),X=i(69855),q=i(35500),H=i(1601),W=i(58329),$=i(77468),J=i(26657),Z=i(38620),_=i(56898),ee=i(44432),te=i(50352),ie=i(90246),ne=i(86226),re=i(93199),se=i(97553),oe=i(68466),ae=i(43759),le=i(58384),ce=i(24374),de=i(17721),ue=i(88832),he=i(58806),Ae=i(91517),pe=i(49272),ge=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ve{constructor(e,t,i,n,r){this.formBuilder=e,this.i18nService=t,this.platformUtilsService=i,this.toastService=n,this.tokenService=r;if(!this.platformUtilsService.isSelfHost())throw new Error("This component should only be used in self-hosted environments");this.form=this.formBuilder.group({file:[null,[a.k0.required]]}),this.submit=this.submit.bind(this)}get formValue(){return this.form.value}onLicenseFileSelectedChanged(e){const t=e.target;this.form.value.file=t.files.length>0?t.files[0]:null}submit(){return ge(this,void 0,void 0,function*(){if(this.form.markAllAsTouched(),this.form.invalid)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")});return(yield this.tokenService.getEmailVerified())?void 0:this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("verifyEmailFirst")})})}}var fe=i(83078),me=i(25740),ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ce extends ve{constructor(e,t,i,n,r,s,o,a,l,c,d){super(e,t,i,n,r),this.formBuilder=e,this.i18nService=t,this.platformUtilsService=i,this.toastService=n,this.tokenService=r,this.apiService=s,this.encryptService=o,this.keyService=a,this.organizationApiService=l,this.syncService=c,this.accountService=d,this.onLicenseFileUploaded=new G.bkB}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return ye(this,void 0,void 0,function*(){yield e.submit.call(this);const t=yield(0,u._)((0,I.F6)(this.accountService.activeAccount$)),i=yield this.keyService.makeOrgKey(t),n=i[0].encryptedString,r=(yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),i[1])).encryptedString,s=yield this.keyService.makeKeyPair(i[1]),o=new FormData;o.append("license",this.formValue.file),o.append("key",n),o.append("collectionName",r);const a=(yield this.organizationApiService.createLicense(o)).id;yield this.apiService.refreshIdentityToken();const l=new y.B(s[0],s[1].encryptedString);yield this.organizationApiService.updateKeys(a,l),yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),this.onLicenseFileUploaded.emit(a)})}get description(){return"uploadLicenseFileOrg"}get hintFileName(){return"bitwarden_organization_license.json"}}Ce.ɵfac=function(e){return new(e||Ce)(G.rXU(a.ok),G.rXU(V.W),G.rXU(j.y),G.rXU(X.f),G.rXU(fe.B),G.rXU(U.G),G.rXU(N.N),G.rXU(T.Lu),G.rXU(L.X),G.rXU(pe.H),G.rXU(q.D))},Ce.ɵcmp=G.VBU({type:Ce,selectors:[["organization-self-hosting-license-uploader"]],outputs:{onLicenseFileUploaded:"onLicenseFileUploaded"},standalone:!1,features:[G.Vt3],decls:22,vars:21,consts:[["fileSelector",""],["bitTypography","body1",1,"tw-break-words","tw-whitespace-normal","tw-mb-8"],[3,"formGroup","bitSubmit"],[1,"tw-my-1"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitInput","","type","file","formControlName","file","accept","application/JSON","hidden","",1,"tw-hidden",3,"change"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"]],template:function(e,t){if(1&e){const e=G.RV6();G.j41(0,"p",1),G.EFF(1),G.nI1(2,"i18n"),G.k0s(),G.j41(3,"form",2)(4,"bit-form-field")(5,"bit-label"),G.EFF(6),G.nI1(7,"i18n"),G.k0s(),G.j41(8,"div",3)(9,"button",4),G.bIt("click",function(){s.eBV(e);const t=G.sdS(15);return s.Njj(t.click())}),G.EFF(10),G.nI1(11,"i18n"),G.k0s(),G.EFF(12),G.nI1(13,"i18n"),G.k0s(),G.j41(14,"input",5,0),G.bIt("change",function(i){return s.eBV(e),s.Njj(t.onLicenseFileSelectedChanged(i))}),G.k0s(),G.j41(16,"bit-hint"),G.EFF(17),G.nI1(18,"i18n"),G.k0s()(),G.j41(19,"button",6),G.EFF(20),G.nI1(21,"i18n"),G.k0s()()}2&e&&(G.R7$(),G.SpI(" ",G.bMT(2,8,"uploadLicenseFileOrg"),"\n"),G.R7$(2),G.Y8G("formGroup",t.form)("bitSubmit",t.submit),G.R7$(3),G.JRh(G.bMT(7,10,t.description)),G.R7$(4),G.SpI(" ",G.bMT(11,12,"chooseFile")," "),G.R7$(2),G.SpI(" ",t.form.value.file?t.form.value.file.name:G.bMT(13,14,"noFileChosen")," "),G.R7$(5),G.JRh(G.i5U(18,16,"licenseFileDesc",t.hintFileName)),G.R7$(3),G.SpI(" ",G.bMT(21,19,"submit")," "))},dependencies:[a.qT,a.me,a.BC,a.cb,a.j4,a.JD,J.$,Z.L,_.Q,ne.j,re.I,se.J,ae.h,he.r,me.$],encapsulation:2});var we=i(58688),Ie=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const be=e=>({"tw-hidden":e}),Be=e=>({type:"checkout",supportsTaxId:e});function Ee(e,t){1&e&&(G.qex(0),G.nrm(1,"bit-icon",2),G.nI1(2,"i18n"),G.j41(3,"span",3),G.EFF(4),G.nI1(5,"i18n"),G.k0s(),G.bVm()),2&e&&(G.R7$(),G.Y8G("title",G.mNQ(G.bMT(2,3,"loading"))),G.R7$(3),G.JRh(G.bMT(5,5,"loading")))}function Se(e,t){if(1&e){const e=G.RV6();G.qex(0),G.j41(1,"organization-self-hosting-license-uploader",4),G.bIt("onLicenseFileUploaded",function(t){s.eBV(e);const i=G.XpG();return s.Njj(i.onLicenseFileUploaded(t))}),G.k0s(),G.bVm()}}function Qe(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"onPremHostingOptional")))}function ke(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"includeSsoAuthentication")))}function Te(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"includeEnterprisePolicies")))}function Fe(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(2);const e=G.r8f(9);G.R7$(),G.JRh(G.i5U(2,1,"xDayFreeTrial",e))}}function Pe(e,t){if(1&e&&(G.j41(0,"ul",16)(1,"li"),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.nVh(4,Qe,3,3,"li"),G.nVh(5,ke,3,3,"li"),G.nVh(6,Te,3,3,"li"),G.nVh(7,Fe,3,4,"li"),G.k0s()),2&e){G.XpG();const e=G.r8f(2),t=G.r8f(3),i=G.r8f(4),n=G.r8f(9),r=G.XpG(2),s=G.r8f(0);G.R7$(2),G.JRh(G.bMT(3,5,"includeAllTeamsFeatures")),G.R7$(2),G.vxM(e?4:-1),G.R7$(),G.vxM(t?5:-1),G.R7$(),G.vxM(i?6:-1),G.R7$(),G.vxM(n&&r.createOrganization()&&!s?7:-1)}}function Re(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(9);G.R7$(),G.SpI(" ",G.i5U(2,1,"xDayFreeTrial",e)," ")}}function De(e,t){if(1&e&&(G.j41(0,"ul",16)(1,"li"),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.j41(4,"li"),G.EFF(5),G.nI1(6,"i18n"),G.k0s(),G.j41(7,"li"),G.EFF(8),G.nI1(9,"i18n"),G.k0s(),G.nVh(10,Re,3,4,"li"),G.k0s()),2&e){G.XpG(2);const e=G.r8f(9),t=G.XpG(2),i=G.r8f(0);G.R7$(2),G.JRh(G.bMT(3,4,"includeAllTeamsStarterFeatures")),G.R7$(3),G.JRh(G.bMT(6,6,"chooseMonthlyOrAnnualBilling")),G.R7$(3),G.JRh(G.i5U(9,8,"abilityToAddMoreThanNMembers",10)),G.R7$(2),G.vxM(e&&t.createOrganization()&&!i?10:-1)}}function Me(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,1,"limitedUsers",e.maxSeats))}}function xe(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,1,"addShareLimitedUsers",e.maxSeats))}}function Oe(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"addShareUnlimitedUsers")))}function Ge(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,1,"limitedCollections",e.maxCollections))}}function Ue(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,1,"addShareLimitedUsers",e.maxAdditionalSeats))}}function Ve(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"createUnlimitedCollections")))}function je(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,1,"gbEncryptedFileStorage",e.baseStorageGb+" GB"))}}function Ne(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"controlAccessWithGroups")))}function ze(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"trackAuditLogs")))}function Ye(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"syncUsersFromDirectory")))}function Le(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"onPremHostingOptional")))}function Ke(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"usersGetPremium")))}function Xe(e,t){1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"priorityCustomerSupport")))}function qe(e,t){if(1&e&&(G.j41(0,"li"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e){G.XpG(3);const e=G.r8f(9);G.R7$(),G.JRh(G.i5U(2,1,"xDayFreeTrial",e))}}function He(e,t){if(1&e&&(G.j41(0,"ul",16),G.nVh(1,Me,3,4,"li"),G.nVh(2,xe,3,4,"li"),G.nVh(3,Oe,3,3,"li"),G.nVh(4,Ge,3,4,"li"),G.nVh(5,Ue,3,4,"li"),G.nVh(6,Ve,3,3,"li"),G.nVh(7,je,3,4,"li"),G.nVh(8,Ne,3,3,"li"),G.nVh(9,ze,3,3,"li"),G.nVh(10,Ye,3,3,"li"),G.nVh(11,Le,3,3,"li"),G.nVh(12,Ke,3,3,"li"),G.nVh(13,Xe,3,3,"li"),G.nVh(14,qe,3,4,"li"),G.k0s()),2&e){G.XpG(2);const e=G.r8f(0),t=G.r8f(1),i=G.r8f(2),n=G.r8f(5),r=G.r8f(6),s=G.r8f(7),o=G.r8f(8),a=G.r8f(9),l=G.XpG(2),c=G.r8f(0);G.R7$(),G.vxM(t==l.productTypes.Free?1:-1),G.R7$(),G.vxM(t!=l.productTypes.Free&&t!=l.productTypes.TeamsStarter&&e.maxSeats?2:-1),G.R7$(),G.vxM(e.maxSeats?-1:3),G.R7$(),G.vxM(e.maxCollections?4:-1),G.R7$(),G.vxM(e.maxAdditionalSeats?5:-1),G.R7$(),G.vxM(e.maxCollections?-1:6),G.R7$(),G.vxM(e.baseStorageGb?7:-1),G.R7$(),G.vxM(n?8:-1),G.R7$(),G.vxM(r?9:-1),G.R7$(),G.vxM(s?10:-1),G.R7$(),G.vxM(i?11:-1),G.R7$(),G.vxM(o?12:-1),G.R7$(),G.vxM(t!=l.productTypes.Free?13:-1),G.R7$(),G.vxM(a&&l.createOrganization()&&!c?14:-1)}}function We(e,t){if(1&e&&G.nVh(0,De,11,11,"ul",16)(1,He,15,14,"ul",16),2&e){G.XpG();const e=G.r8f(1),t=G.XpG(2);G.vxM(e===t.productTypes.Teams&&t.teamsStarterPlanIsAvailable()?0:1)}}function $e(e,t){if(1&e&&(G.EFF(0),G.nI1(1,"i18n"),G.nI1(2,"currency"),G.nI1(3,"i18n")),2&e){const e=G.XpG(3).$implicit,t=G.r8f(0);G.E5c(" ",G.bMT(1,3,"additionalUsers").toLowerCase()," ",G.i5U(2,5,e.isAnnual?t.seatPrice/12:t.seatPrice,"$")," /",G.bMT(3,8,"month")," ")}}function Je(e,t){if(1&e&&(G.EFF(0),G.nI1(1,"currency"),G.nI1(2,"i18n"),G.nI1(3,"i18n"),G.nVh(4,$e,4,10)),2&e){const e=G.XpG(2).$implicit,t=G.r8f(0);G.E5c(" ",G.i5U(1,4,e.isAnnual?t.basePrice/12:t.basePrice,"$")," /",G.bMT(2,7,"month"),", ",G.i5U(3,9,"includesXUsers",t.baseSeats)," "),G.R7$(4),G.vxM(t.hasAdditionalSeatsOption?4:-1)}}function Ze(e,t){if(1&e&&(G.j41(0,"span",17),G.nVh(1,Je,5,12),G.k0s()),2&e){G.XpG();const e=G.r8f(0),t=G.XpG(2);G.R7$(),G.vxM(e.basePrice&&!t.acceptingSponsorship()?1:-1)}}function _e(e,t){if(1&e&&(G.j41(0,"span",17),G.EFF(1),G.nI1(2,"currency"),G.nI1(3,"i18n"),G.nI1(4,"i18n"),G.k0s()),2&e){const e=G.XpG().$implicit,t=G.r8f(0);G.R7$(),G.Lme(" ",G.i5U(3,5,"costPerUser",G.i5U(2,2,e.isAnnual?t.seatPrice/12:t.seatPrice,"$"))," /",G.bMT(4,8,"month")," ")}}function et(e,t){1&e&&(G.j41(0,"span",17),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.JRh(G.bMT(2,1,"freeForever")))}function tt(e,t){if(1&e){const e=G.RV6();G.SS7(0)(1)(2)(3)(4)(5)(6)(7)(8)(9),G.j41(10,"div",9)(11,"bit-radio-button",14),G.bIt("change",function(){s.eBV(e);const t=G.XpG(2);return s.Njj(t.changedProduct())}),G.j41(12,"bit-label"),G.EFF(13),G.nI1(14,"i18n"),G.k0s(),G.j41(15,"bit-hint",15),G.EFF(16),G.nI1(17,"i18n"),G.nVh(18,Pe,8,7,"ul",16)(19,We,2,1),G.k0s()(),G.nVh(20,Ze,2,1,"span",17),G.nVh(21,_e,5,10,"span",17),G.nVh(22,et,3,3,"span",17),G.k0s()}if(2&e){const e=t.$implicit,i=G.XpG(2),n=G.bH3(e.PasswordManager);G.R7$();const r=G.bH3(e.productTier);G.R7$(),G.bH3(e.hasSelfHost),G.R7$(),G.bH3(e.hasSso),G.R7$(),G.bH3(e.hasPolicies),G.R7$(),G.bH3(e.hasGroups),G.R7$(),G.bH3(e.hasApi),G.R7$(),G.bH3(e.hasDirectory),G.R7$(),G.bH3(e.usersGetPremium),G.R7$(),G.bH3(e.trialPeriodDays),G.R7$(2),G.Y8G("value",r),G.R7$(2),G.JRh(G.bMT(14,17,e.nameLocalizationKey)),G.R7$(3),G.SpI("",G.i5U(17,19,e.descriptionLocalizationKey,"1")," "),G.R7$(2),G.vxM(r===i.productTypes.Enterprise?18:19),G.R7$(2),G.vxM(r!=i.productTypes.Free?20:-1),G.R7$(),G.vxM(!n.basePrice&&n.hasAdditionalSeatsOption?21:-1),G.R7$(),G.vxM(r==i.productTypes.Free?22:-1)}}function it(e,t){1&e&&(G.j41(0,"bit-section")(1,"h2",7),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.j41(4,"div",18)(5,"bit-form-field",19)(6,"bit-label"),G.EFF(7),G.nI1(8,"i18n"),G.k0s(),G.nrm(9,"input",20),G.nI1(10,"i18n"),G.j41(11,"bit-hint",15),G.EFF(12),G.nI1(13,"i18n"),G.k0s()()()()),2&e&&(G.R7$(2),G.JRh(G.bMT(3,5,"users")),G.R7$(5),G.JRh(G.bMT(8,7,"userSeats")),G.R7$(2),G.Y8G("placeholder",G.mNQ(G.bMT(10,9,"userSeatsDesc"))),G.R7$(3),G.JRh(G.bMT(13,11,"userSeatsHowManyDesc")))}function nt(e,t){if(1&e&&(G.j41(0,"div",18)(1,"bit-form-field",19)(2,"bit-label"),G.EFF(3),G.nI1(4,"i18n"),G.k0s(),G.nrm(5,"input",22),G.nI1(6,"i18n"),G.j41(7,"bit-hint",15),G.EFF(8),G.nI1(9,"currency"),G.nI1(10,"i18n"),G.k0s()()()),2&e){G.XpG(2);const e=G.r8f(0),t=G.XpG(2);G.R7$(3),G.JRh(G.bMT(4,4,"additionalUserSeats")),G.R7$(2),G.Y8G("placeholder",G.mNQ(G.bMT(6,6,"userSeatsDesc"))),G.R7$(3),G.SpI("",G.brH(10,11,"userSeatsAdditionalDesc",e.PasswordManager.baseSeats,G.i5U(9,8,t.seatPriceMonthly(e),"$"))," ")}}function rt(e,t){if(1&e&&(G.j41(0,"bit-section")(1,"h2",7),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.nVh(4,nt,11,15,"div",18),G.j41(5,"div",18)(6,"bit-form-field",19)(7,"bit-label"),G.EFF(8),G.nI1(9,"i18n"),G.k0s(),G.nrm(10,"input",21),G.nI1(11,"i18n"),G.j41(12,"bit-hint",15),G.EFF(13),G.nI1(14,"currency"),G.nI1(15,"i18n"),G.nI1(16,"i18n"),G.k0s()()()()),2&e){G.XpG();const e=G.r8f(0),t=G.XpG(2);G.R7$(2),G.JRh(G.bMT(3,6,"addons")),G.R7$(2),G.vxM(e.PasswordManager.hasAdditionalSeatsOption&&e.PasswordManager.baseSeats?4:-1),G.R7$(4),G.JRh(G.bMT(9,8,"additionalStorageGb")),G.R7$(2),G.Y8G("placeholder",G.mNQ(G.bMT(11,10,"additionalStorageGbDesc"))),G.R7$(3),G.JRh(G.ii3(16,17,"additionalStorageIntervalDesc",`${e.PasswordManager.baseStorageGb} GB`,G.i5U(14,12,t.additionalStoragePriceMonthly(e),"$"),G.bMT(15,15,"month")))}}function st(e,t){1&e&&(G.j41(0,"div",18)(1,"bit-form-control",19)(2,"bit-label"),G.EFF(3),G.nI1(4,"i18n"),G.k0s(),G.nrm(5,"input",23),G.j41(6,"bit-hint",15),G.EFF(7),G.nI1(8,"currency"),G.nI1(9,"i18n"),G.nI1(10,"i18n"),G.k0s()()()),2&e&&(G.R7$(3),G.JRh(G.bMT(4,2,"premiumAccess")),G.R7$(4),G.JRh(G.brH(10,9,"premiumAccessDesc",G.i5U(8,4,3.33,"$"),G.bMT(9,7,"month"))))}function ot(e,t){if(1&e&&(G.j41(0,"span",27),G.EFF(1),G.nI1(2,"currency"),G.k0s(),G.EFF(3),G.nI1(4,"i18n")),2&e){G.XpG(3);const e=G.r8f(0);G.R7$(),G.JRh(G.i5U(2,2,e.basePrice,"$")),G.R7$(2),G.SpI(" ",G.bMT(4,5,"freeWithSponsorship")," ")}}function at(e,t){if(1&e&&(G.EFF(0),G.nI1(1,"currency"),G.nI1(2,"i18n")),2&e){G.XpG(3);const e=G.r8f(0);G.Lme(" ",G.i5U(1,2,e.basePrice,"$")," /",G.bMT(2,5,"year")," ")}}function lt(e,t){if(1&e&&(G.j41(0,"p",26),G.EFF(1),G.nI1(2,"i18n"),G.nI1(3,"currency"),G.nI1(4,"i18n"),G.nVh(5,ot,5,7)(6,at,3,7),G.k0s()),2&e){G.XpG(2);const e=G.r8f(0),t=G.r8f(1),i=G.XpG(4);G.R7$(),G.E5c(" ",G.bMT(2,4,"basePrice"),": ",G.i5U(3,6,t?e.basePrice/12:e.basePrice,"$")," × 12 ",G.bMT(4,9,"monthAbbr")," = "),G.R7$(4),G.vxM(i.acceptingSponsorship()?5:6)}}function ct(e,t){1&e&&(G.j41(0,"span"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.SpI("",G.bMT(2,1,"additionalUsers"),":"))}function dt(e,t){1&e&&(G.j41(0,"span"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.SpI("",G.bMT(2,1,"users"),":"))}function ut(e,t){if(1&e&&(G.j41(0,"p",26),G.nVh(1,ct,3,3,"span")(2,dt,3,3,"span"),G.EFF(3),G.nI1(4,"currency"),G.nI1(5,"i18n"),G.nI1(6,"currency"),G.nI1(7,"i18n"),G.k0s()),2&e){const e=G.XpG(2).$implicit,t=G.r8f(0),i=G.r8f(1),n=G.XpG(4);G.R7$(),G.vxM(t.baseSeats?1:2),G.R7$(2),G.SjE(" ",n.formGroup.controls.additionalSeats.value||0," × ",G.i5U(4,6,i?t.seatPrice/12:t.seatPrice,"$")," × 12 ",G.bMT(5,9,"monthAbbr")," = ",G.i5U(6,11,n.passwordManagerSeatTotal(e,n.formGroup.value.additionalSeats),"$")," /",G.bMT(7,14,"year")," ")}}function ht(e,t){if(1&e&&(G.j41(0,"p",26),G.EFF(1),G.nI1(2,"i18n"),G.nI1(3,"currency"),G.nI1(4,"i18n"),G.nI1(5,"currency"),G.nI1(6,"i18n"),G.k0s()),2&e){const e=G.XpG(2).$implicit,t=G.r8f(0),i=G.r8f(1),n=G.XpG(4);G.R7$(),G.ZXR(" ",G.bMT(2,6,"additionalStorageGb"),": ",n.formGroup.controls.additionalStorage.value||0," × ",G.i5U(3,8,i?t.additionalStoragePricePerGb/12:t.additionalStoragePricePerGb,"$")," × 12 ",G.bMT(4,11,"monthAbbr")," = ",G.i5U(5,13,n.additionalStorageTotal(e),"$")," /",G.bMT(6,16,"year")," ")}}function At(e,t){if(1&e&&(G.j41(0,"bit-hint"),G.nVh(1,lt,7,11,"p",26),G.nVh(2,ut,8,16,"p",26),G.nVh(3,ht,7,18,"p",26),G.k0s()),2&e){G.XpG();const e=G.r8f(0);G.R7$(),G.vxM(e.basePrice?1:-1),G.R7$(),G.vxM(e.hasAdditionalSeatsOption?2:-1),G.R7$(),G.vxM(e.hasAdditionalStorageOption?3:-1)}}function pt(e,t){if(1&e&&(G.j41(0,"p",26),G.EFF(1),G.nI1(2,"i18n"),G.nI1(3,"currency"),G.nI1(4,"i18n"),G.nI1(5,"currency"),G.nI1(6,"i18n"),G.k0s()),2&e){G.XpG(2);const e=G.r8f(0);G.R7$(),G.SjE(" ",G.bMT(2,5,"basePrice"),": ",G.i5U(3,7,e.basePrice,"$")," ",G.bMT(4,10,"monthAbbr")," = ",G.i5U(5,12,e.basePrice,"$")," /",G.bMT(6,15,"month")," ")}}function gt(e,t){1&e&&(G.j41(0,"span"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.SpI("",G.bMT(2,1,"additionalUsers"),":"))}function vt(e,t){1&e&&(G.j41(0,"span"),G.EFF(1),G.nI1(2,"i18n"),G.k0s()),2&e&&(G.R7$(),G.SpI("",G.bMT(2,1,"users"),":"))}function ft(e,t){if(1&e&&(G.j41(0,"p",26),G.nVh(1,gt,3,3,"span")(2,vt,3,3,"span"),G.EFF(3),G.nI1(4,"currency"),G.nI1(5,"i18n"),G.nI1(6,"currency"),G.nI1(7,"i18n"),G.k0s()),2&e){const e=G.XpG(2).$implicit,t=G.r8f(0),i=G.XpG(4);G.R7$(),G.vxM(t.baseSeats?1:2),G.R7$(2),G.SjE(" ",i.formGroup.controls.additionalSeats.value||0," × ",G.i5U(4,6,t.seatPrice,"$")," ",G.bMT(5,9,"monthAbbr")," = ",G.i5U(6,11,i.passwordManagerSeatTotal(e,i.formGroup.value.additionalSeats),"$")," /",G.bMT(7,14,"month")," ")}}function mt(e,t){if(1&e&&(G.j41(0,"p",26),G.EFF(1),G.nI1(2,"i18n"),G.nI1(3,"currency"),G.nI1(4,"i18n"),G.nI1(5,"currency"),G.nI1(6,"i18n"),G.k0s()),2&e){const e=G.XpG(2).$implicit,t=G.r8f(0),i=G.XpG(4);G.R7$(),G.ZXR(" ",G.bMT(2,6,"additionalStorageGb"),": ",i.formGroup.controls.additionalStorage.value||0," × ",G.i5U(3,8,t.additionalStoragePricePerGb,"$")," ",G.bMT(4,11,"monthAbbr")," = ",G.i5U(5,13,i.additionalStorageTotal(e),"$")," /",G.bMT(6,16,"month")," ")}}function yt(e,t){if(1&e&&(G.j41(0,"bit-hint"),G.nVh(1,pt,7,17,"p",26),G.nVh(2,ft,8,16,"p",26),G.nVh(3,mt,7,18,"p",26),G.k0s()),2&e){G.XpG();const e=G.r8f(0);G.R7$(),G.vxM(e.basePrice?1:-1),G.R7$(),G.vxM(e.hasAdditionalSeatsOption?2:-1),G.R7$(),G.vxM(e.hasAdditionalStorageOption?3:-1)}}function Ct(e,t){if(1&e&&(G.SS7(0)(1),G.j41(2,"bit-radio-button",25)(3,"bit-label"),G.EFF(4),G.nI1(5,"i18n"),G.k0s(),G.nVh(6,At,4,3,"bit-hint")(7,yt,4,3,"bit-hint"),G.k0s()),2&e){const e=t.$implicit;G.bH3(e.PasswordManager),G.R7$();const i=G.bH3(e.isAnnual);G.R7$(),G.Y8G("id",G.VkB("interval",e.type))("value",e.type),G.R7$(2),G.JRh(G.bMT(5,7,i?"annually":"monthly")),G.R7$(2),G.vxM(i?6:7)}}function wt(e,t){if(1&e&&(G.j41(0,"bit-section")(1,"h2",7),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.j41(4,"bit-radio-group",24),G.Z7z(5,Ct,8,9,"bit-radio-button",25,G.Vm6),G.k0s()()),2&e){const e=G.XpG(3);G.R7$(2),G.JRh(G.bMT(3,1,"summary")),G.R7$(3),G.Dyx(e.selectablePlans())}}function It(e,t){if(1&e&&(G.SS7(0),G.j41(1,"bit-section"),G.nVh(2,it,14,13,"bit-section"),G.nVh(3,rt,17,22,"bit-section"),G.j41(4,"bit-section"),G.nVh(5,st,11,13,"div",18),G.k0s(),G.nVh(6,wt,7,3,"bit-section"),G.k0s()),2&e){const e=G.XpG(2),t=G.r8f(0),i=G.bH3(e.selectedPlan());G.R7$(2),G.vxM(!i.PasswordManager.hasAdditionalSeatsOption||i.PasswordManager.baseSeats||t?-1:2),G.R7$(),G.vxM(t?-1:3),G.R7$(2),G.vxM(i.PasswordManager.hasPremiumAccessOption?5:-1),G.R7$(),G.vxM(t?-1:6)}}function bt(e,t){if(1&e&&G.nrm(0,"sm-subscribe",10),2&e){const e=G.XpG(2);G.Y8G("formGroup",e.formGroup.controls.secretsManager)("selectedPlan",e.selectedSecretsManagerPlan())("upgradeOrganization",!e.createOrganization())}}function Bt(e,t){if(1&e&&G.nrm(0,"app-enter-payment-method",29,0),2&e){const e=G.XpG(3);G.Y8G("group",e.billingFormGroup.controls.paymentMethod)}}function Et(e,t){if(1&e&&(G.j41(0,"bit-section")(1,"h2",7),G.EFF(2),G.nI1(3,"i18n"),G.k0s(),G.j41(4,"p",28),G.EFF(5),G.k0s(),G.nVh(6,Bt,2,1,"app-enter-payment-method",29),G.nrm(7,"app-enter-billing-address",30),G.j41(8,"div",31),G.nrm(9,"billing-cart-summary",32),G.k0s()()),2&e){const e=G.XpG(2);G.R7$(2),G.SpI(" ",G.bMT(3,7,e.createOrganization()?"paymentInformation":"billingInformation")," "),G.R7$(3),G.SpI(" ",e.paymentDesc," "),G.R7$(),G.vxM(e.createOrganization()||e.upgradeRequiresPaymentMethod?6:-1),G.R7$(),G.Y8G("group",e.billingFormGroup.controls.billingAddress)("scenario",G.eq3(9,Be,e.showTaxIdField())),G.R7$(2),G.Y8G("cart",e.cart())("showDiscountBadges",!0)}}function St(e,t){1&e&&(G.j41(0,"bit-section")(1,"bit-callout",33),G.nI1(2,"i18n"),G.EFF(3),G.nI1(4,"i18n"),G.k0s()()),2&e&&(G.R7$(),G.Y8G("title",G.bMT(2,2,"error")),G.R7$(2),G.SpI(" ",G.bMT(4,4,"singleOrgBlockCreateMessage")," "))}function Qt(e,t){if(1&e){const e=G.RV6();G.j41(0,"button",34),G.bIt("click",function(){s.eBV(e);const t=G.XpG(2);return s.Njj(t.cancel())}),G.EFF(1),G.nI1(2,"i18n"),G.k0s()}2&e&&(G.R7$(),G.SpI(" ",G.bMT(2,1,"cancel")," "))}function kt(e,t){if(1&e){const e=G.RV6();G.j41(0,"form",1)(1,"bit-section",5)(2,"app-org-info",6),G.bIt("changedBusinessOwned",function(){s.eBV(e);const t=G.XpG();return s.Njj(t.changedOwnedBusiness())}),G.k0s()(),G.j41(3,"bit-section")(4,"h2",7),G.EFF(5),G.nI1(6,"i18n"),G.k0s(),G.j41(7,"bit-radio-group",8),G.Z7z(8,tt,23,22,"div",9,G.Vm6),G.k0s()(),G.nVh(10,It,7,5,"bit-section"),G.j41(11,"bit-section"),G.nVh(12,bt,1,3,"sm-subscribe",10),G.k0s(),G.nVh(13,Et,10,11,"bit-section"),G.nVh(14,St,5,6,"bit-section"),G.j41(15,"bit-section")(16,"button",11),G.EFF(17),G.nI1(18,"i18n"),G.k0s(),G.nVh(19,Qt,3,3,"button",12),G.nrm(20,"bit-error-summary",13),G.k0s()()}if(2&e){const e=G.XpG(),t=G.r8f(0);G.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),G.R7$(),G.Y8G("ngClass",G.eq3(21,be,!e.createOrganization())),G.R7$(),G.Y8G("formGroup",e.formGroup)("createOrganization",e.createOrganization())("isProvider",!!e.providerId())("acceptingSponsorship",e.acceptingSponsorship()),G.R7$(3),G.JRh(G.bMT(6,17,"chooseYourPlan")),G.R7$(2),G.Y8G("block",!0),G.R7$(),G.Dyx(e.selectableProducts()),G.R7$(2),G.vxM(e.formGroup.value.productTier!==e.productTypes.Free?10:-1),G.R7$(2),G.vxM(!e.planOffersSecretsManager()||e.hasProvider()||t?-1:12),G.R7$(),G.vxM(e.formGroup.value.productTier!==e.productTypes.Free?13:-1),G.R7$(),G.vxM(e.singleOrgPolicyBlock?14:-1),G.R7$(2),G.Y8G("disabled",!e.formGroup.valid),G.R7$(),G.SpI(" ",G.bMT(18,19,"submit")," "),G.R7$(2),G.vxM(e.showCancel()?19:-1),G.R7$(),G.Y8G("formGroup",e.formGroup)}}const Tt=[B.OL.TeamsMonthly2020,B.OL.TeamsAnnually2020,B.OL.EnterpriseAnnually2020,B.OL.EnterpriseMonthly2020];class Ft{get familiesSponsorshipDiscount(){var e;if(!this.acceptingSponsorship())return 0;const t=this.passwordManagerPlans.find(e=>e.type===this._familyPlan);return null!==(e=null==t?void 0:t.PasswordManager.basePrice)&&void 0!==e?e:0}constructor(e,t,i,h,g,v,f,m,y,C,w,I,b,Q,k,T,P,D,M,x,G){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.keyService=h,this.encryptService=g,this.router=v,this.syncService=f,this.policyService=m,this.organizationService=y,this.messagingService=C,this.formBuilder=w,this.organizationApiService=I,this.providerApiService=b,this.toastService=Q,this.accountService=k,this.subscriberBillingClient=T,this.previewInvoiceClient=P,this.configService=D,this.billingAccountProfileStateService=M,this.premiumOrgUpgradeService=x,this.subscriptionDiscountService=G,this.enterPaymentMethodComponent=(0,n.ebz)(R.Pu),this.organizationId=(0,n.hFB)(null),this.providerId=(0,n.hFB)(null),this.showFree=(0,n.hFB)(!0),this.showCancel=(0,n.hFB)(!1),this.acceptingSponsorship=(0,n.hFB)(!1),this.planSponsorshipType=(0,n.hFB)(null),this.currentPlan=(0,n.hFB)(null),this.preSelectedProductTier=(0,n.hFB)(null),this.enableSecretsManagerByDefault=(0,n.hFB)(!1),this.initialProductTier=(0,n.hFB)(B.K_.Free),this.initialPlan=(0,n.hFB)(B.OL.Free),this.hasPremiumPersonally=(0,o.ot)(this.accountService.activeAccount$.pipe((0,A.p)(Boolean),(0,p.n)(e=>this.billingAccountProfileStateService.hasPremiumPersonally$(e.id))),{initialValue:!1}),this.premiumToOrganizationUpgradeFeatureFlagEnabled=(0,o.ot)(this.configService.getFeatureFlag$(S.TO.PM29593_PremiumToOrganizationUpgrade),{initialValue:!1}),this.createOrganization=(0,r.EW)(()=>null==this.organizationId()),this.hasProvider=(0,r.EW)(()=>null!=this.providerId()),this.canUpgradeFromPremium=(0,r.EW)(()=>{const e=this.hasPremiumPersonally(),t=this.premiumToOrganizationUpgradeFeatureFlagEnabled(),i=this.createOrganization();return e&&i&&t}),this.selectedPlan=(0,r.EW)(()=>this.passwordManagerPlans.find(e=>e.type===this.formValues().plan)),this.selectedSecretsManagerPlan=(0,r.EW)(()=>this.secretsManagerPlans.find(e=>e.type===this.formValues().plan)),this.selectedPlanInterval=(0,r.EW)(()=>{var e;return(null===(e=this.selectedPlan())||void 0===e?void 0:e.isAnnual)?"year":"month"}),this.freeTrial=(0,r.EW)(()=>{var e;return null!=(null===(e=this.selectedPlan())||void 0===e?void 0:e.trialPeriodDays)}),this.planOffersSecretsManager=(0,r.EW)(()=>null!=this.selectedSecretsManagerPlan()),this.selectableProducts=(0,r.EW)(()=>{if(this.acceptingSponsorship()){return[this.passwordManagerPlans.find(e=>e.type===this._familyPlan)]}const e=this.formValues().businessOwned,t=this.currentPlan(),i=this.passwordManagerPlans.filter(i=>{const n=i.type!==B.OL.Custom,r=!e||i.canBeUsedByBusiness,s=i.productTier!==B.K_.Free||this.showFree(),o=i.isAnnual||i.productTier===B.K_.Free||i.productTier===B.K_.TeamsStarter,a=!t||t.upgradeSortOrder<i.upgradeSortOrder,l=!this.hasProvider()||i.productTier!==B.K_.TeamsStarter,c=i.productTier!==B.K_.Families||i.type===this._familyPlan,d=!this.isProviderQualifiedFor2020Plan()&&this.planIsEnabled(i)||this.isProviderQualifiedFor2020Plan()&&Tt.includes(i.type);return n&&r&&s&&o&&a&&l&&c&&d});return i.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),i}),this.selectablePlans=(0,r.EW)(()=>{var e;const t=this.formValues().productTier,i=(null===(e=this.passwordManagerPlans)||void 0===e?void 0:e.filter(e=>{const i=e.productTier===t,n=e.productTier!==B.K_.Families||e.type===this._familyPlan,r=!this.isProviderQualifiedFor2020Plan()&&this.planIsEnabled(e)||this.isProviderQualifiedFor2020Plan()&&Tt.includes(e.type);return i&&n&&r}))||[];return i.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),i}),this.teamsStarterPlanIsAvailable=(0,r.EW)(()=>this.selectablePlans().some(e=>e.type===B.OL.TeamsStarter)),this.eligibleDiscounts$=this.subscriptionDiscountService.getEligibleDiscountsForTier$(E.A.Families).pipe((0,l.W)(()=>(0,c.of)([]))),this.eligibleDiscounts=(0,o.ot)(this.eligibleDiscounts$,{initialValue:[]}),this.cartDiscounts=(0,r.EW)(()=>this.acceptingSponsorship()||this.formValues().productTier!==B.K_.Families?void 0:this.eligibleDiscounts().map(e=>this.subscriptionDiscountService.mapToCartDiscount(e)).filter(e=>!!e)),this.eligibleCouponIds=(0,r.EW)(()=>this.acceptingSponsorship()||this.formValues().productTier!==B.K_.Families?[]:this.eligibleDiscounts().map(e=>e.stripeCouponId)),this.showTaxIdField=(0,r.EW)(()=>{switch(this.formValues().productTier){case B.K_.Free:case B.K_.Families:return!1;default:return!0}}),this.onSuccess=(0,n.CGW)(),this.onCanceled=(0,n.CGW)(),this.onTrialBillingSuccess=(0,n.CGW)(),this.loading=!0,this.selfHosted=!1,this.productTypes=B.K_,this.formPromise=null,this.singleOrgPolicyAppliesToActiveUser=!1,this.isInTrialFlow=!1,this.passwordManagerPlans=[],this.secretsManagerPlans=[],this.organization=null,this.sub=null,this.billing=null,this.provider=null,this.previewInvoice=(0,s.vPA)(null),this.estimatedTax=(0,s.vPA)(0),this.cart=(0,r.EW)(()=>{var e,t,i,n,r,s,o,a,l,c,d,u;const h=this.formValues(),A=this.previewInvoice(),p=this.estimatedTax(),g=this.selectedPlan();let v;if(!g)return{passwordManager:{seats:{translationKey:"passwordManager",cost:0,quantity:1,hideBreakdown:!0}},cadence:"annually",estimatedTax:p};const f=g.PasswordManager.hasAdditionalSeatsOption&&h.additionalSeats,m=f?g.PasswordManager.seatPrice:g.PasswordManager.basePrice,y=f?null!==(e=h.additionalSeats)&&void 0!==e?e:0:1;if(this.canUpgradeFromPremium()){if(!A)return{passwordManager:{seats:{translationKey:"passwordManagerPlanPrice",cost:m,quantity:y,hideBreakdown:!0}},cadence:g.isAnnual?"annually":"monthly",estimatedTax:0};v={passwordManager:{seats:{translationKey:"planProratedMembershipInMonths",translationParams:[g.name,`${A.newPlanProratedMonths} month${A.newPlanProratedMonths>1?"s":""}`],cost:A.newPlanProratedAmount,quantity:1,hideBreakdown:!0}},cadence:g.isAnnual?"annually":"monthly",estimatedTax:A.tax,credit:{translationKey:"premiumSubscriptionCredit",value:A.credit}}}else{let e=m;if(g.PasswordManager.hasPremiumAccessOption&&h.premiumAccessAddon&&(e+=g.PasswordManager.premiumAccessOptionPrice),v={passwordManager:{seats:{translationKey:"passwordManagerPlanPrice",cost:e,quantity:y}},cadence:g.isAnnual?"annually":"monthly",estimatedTax:p},this.acceptingSponsorship()&&this.familiesSponsorshipDiscount>0?v.discounts=[{type:F.Tu.AmountOff,value:this.familiesSponsorshipDiscount}]:v.discounts=this.cartDiscounts(),g.PasswordManager.hasAdditionalStorageOption&&(null!==(t=h.additionalStorage)&&void 0!==t?t:0)>0&&(v.passwordManager.additionalStorage={translationKey:"additionalStorageGb",cost:g.PasswordManager.additionalStoragePricePerGb,quantity:null!==(i=h.additionalStorage)&&void 0!==i?i:0}),this.planOffersSecretsManager()&&(null===(n=h.secretsManager)||void 0===n?void 0:n.enabled)){const e=this.selectedSecretsManagerPlan();let t=e.SecretsManager.baseSeats;const i=e.SecretsManager.seatPrice;e.SecretsManager.hasAdditionalSeatsOption&&(null!==(s=null===(r=h.secretsManager)||void 0===r?void 0:r.userSeats)&&void 0!==s?s:0)>0&&(t+=null!==(a=null===(o=h.secretsManager)||void 0===o?void 0:o.userSeats)&&void 0!==a?a:0),v.secretsManager={seats:{translationKey:"secretsManagerPlanPrice",cost:i,quantity:t}},e.SecretsManager.hasAdditionalServiceAccountOption&&(null!==(c=null===(l=h.secretsManager)||void 0===l?void 0:l.additionalServiceAccounts)&&void 0!==c?c:0)>0&&(v.secretsManager.additionalServiceAccounts={translationKey:"additionalServiceAccounts",cost:e.SecretsManager.additionalPricePerServiceAccount,quantity:null!==(u=null===(d=h.secretsManager)||void 0===d?void 0:d.additionalServiceAccounts)&&void 0!==u?u:0})}}return v}),this._familyPlan=null,this.destroy$=new d.B,this.secretsManagerSubscription=(0,O.Fk)(this.formBuilder),this.formGroup=this.formBuilder.group({name:[""],billingEmail:["",[a.k0.email]],businessOwned:[!1],premiumAccessAddon:[!1],additionalStorage:[0,[a.k0.min(0),a.k0.max(99)]],additionalSeats:[0,[a.k0.min(0),a.k0.max(1e5)]],clientOwnerEmail:["",[a.k0.email]],plan:[this.initialPlan()],productTier:[this.initialProductTier()],secretsManager:this.secretsManagerSubscription}),this.formValues=(0,o.ot)(this.formGroup.valueChanges,{initialValue:this.formGroup.value}),this.billingFormGroup=this.formBuilder.group({paymentMethod:R.Pu.getFormGroup(),billingAddress:R.vU.getFormGroup()}),this.submit=()=>Ie(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;if(this.singleOrgPolicyBlock)return;const e=()=>Ie(this,void 0,void 0,function*(){var e;let t;if(this.createOrganization()){const i=this.canUpgradeFromPremium(),n=yield(0,u._)(this.accountService.activeAccount$);if(i&&(null===(e=this.selectedPlan())||void 0===e?void 0:e.type)!==B.OL.Free)t=yield this.upgradeFromPremiumToOrganization(n);else{const e=yield this.premiumOrgUpgradeService.generateOrganizationEncryptionData(n.id);t=yield this.createCloudHosted(e)}this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")})}else t=yield this.updateOrganization(),this.toastService.showToast({variant:"success",title:void 0,message:this.i18nService.t("organizationUpgraded")});return yield this.syncService.fullSync(!0),this.acceptingSponsorship()||this.isInTrialFlow||this.router.navigate(["/organizations/"+t]),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:t,subLabelText:this.billingSubLabelText()}),t});try{this.formPromise=e();const t=yield this.formPromise;this.onSuccess.emit({organizationId:t}),this.messagingService.send("organizationCreated",{organizationId:t})}catch(t){if(t instanceof Error&&"Payment method validation failed"===t.message)return;if(this.subscriptionDiscountService.isDiscountExpiredError(t))return this.subscriptionDiscountService.refresh(),void this.toastService.showToast({variant:"warning",message:this.i18nService.t("discountExpiredOnPurchase")});throw t}}),this.selfHosted=this.platformUtilsService.isSelfHost()}ngOnInit(){return Ie(this,void 0,void 0,function*(){const e=this.organizationId();e&&(yield this.loadExistingOrganizationData(e)),this.createOrganization()?(this.formGroup.controls.name.addValidators([a.k0.required,a.k0.maxLength(50)]),this.formGroup.controls.billingEmail.addValidators(a.k0.required)):this.upgradeFlowPrefillForm(),this.accountService.activeAccount$.pipe(I.F6,(0,p.n)(e=>this.policyService.policyAppliesToUser$(f.tt.SingleOrg,e)),(0,h.Q)(this.destroy$)).subscribe(e=>{this.singleOrgPolicyAppliesToActiveUser=e}),this.setInitialPlanSelection(),this.selfHosted||this.changedProduct(),this.loading=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get singleOrgPolicyBlock(){return this.singleOrgPolicyAppliesToActiveUser&&!this.hasProvider()}get upgradeRequiresPaymentMethod(){return!1}isProviderQualifiedFor2020Plan(){const e=new Date("2023-11-06");if(!this.provider||!this.provider.creationDate)return!1;return new Date(this.provider.creationDate)<e}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}get paymentDesc(){return this.acceptingSponsorship()?this.i18nService.t("paymentSponsored"):this.freeTrial()&&this.createOrganization()&&!this.canUpgradeFromPremium()?this.i18nService.t("paymentChargedWithTrial"):this.i18nService.t("paymentCharged",this.i18nService.t(this.selectedPlanInterval()))}get secretsManagerForm(){return this.formGroup.controls.secretsManager}changedProduct(){}setPlanType(e){this.formGroup.controls.plan.setValue(e)}handlePremiumAddonAccess(e){this.formGroup.controls.premiumAccessAddon.setValue(!e)}handleAdditionalStorage(e){var t;const i=this.currentPlan();e&&i?(null===(t=this.organization)||void 0===t?void 0:t.maxStorageGb)&&this.formGroup.controls.additionalStorage.setValue(this.organization.maxStorageGb-i.PasswordManager.baseStorageGb):this.formGroup.controls.additionalStorage.setValue(0)}handleAdditionalSeats(e){if(!e)return void this.formGroup.controls.additionalSeats.setValue(0);const t=this.currentPlan();!t||t.PasswordManager.hasAdditionalSeatsOption?this.organization?this.formGroup.controls.additionalSeats.setValue(this.organization.seats):this.formGroup.controls.additionalSeats.setValue(1):this.formGroup.controls.additionalSeats.setValue(t.PasswordManager.baseSeats)}handleSecretsManagerForm(){var e,t,i,n,r,s,o;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!==(n=null===(i=this.sub)||void 0===i?void 0:i.smServiceAccounts)&&void 0!==n?n:0)-(null!==(o=null===(s=null===(r=this.currentPlan())||void 0===r?void 0:r.SecretsManager)||void 0===s?void 0:s.baseServiceAccount)&&void 0!==o?o:0))),this.secretsManagerForm.updateValueAndValidity()}changedOwnedBusiness(){var e;this.formGroup.controls.businessOwned.value&&!(null===(e=this.selectedPlan())||void 0===e?void 0:e.canBeUsedByBusiness)&&(this.teamsStarterPlanIsAvailable()?(this.formGroup.controls.productTier.setValue(B.K_.TeamsStarter),this.formGroup.controls.plan.setValue(B.OL.TeamsStarter)):(this.formGroup.controls.productTier.setValue(B.K_.Teams),this.formGroup.controls.plan.setValue(B.OL.TeamsAnnually)),this.changedProduct())}cancel(){this.onCanceled.emit()}getPlanFromLegacyEnum(){switch(this.formGroup.value.plan){case B.OL.FamiliesAnnually:case B.OL.FamiliesAnnually2025:return{tier:"families",cadence:"annually"};case B.OL.TeamsMonthly:return{tier:"teams",cadence:"monthly"};case B.OL.TeamsAnnually:return{tier:"teams",cadence:"annually"};case B.OL.EnterpriseMonthly:return{tier:"enterprise",cadence:"monthly"};case B.OL.EnterpriseAnnually:return{tier:"enterprise",cadence:"annually"};default:throw new Error(`Unsupported plan type: ${this.formGroup.value.plan}`)}}buildTaxPreviewRequest(e,t){var i,n,r,s;const o=this.selectedPlan().PasswordManager.hasAdditionalSeatsOption?null!==(i=this.formGroup.value.additionalSeats)&&void 0!==i?i:0:1;return Object.assign(Object.assign({},this.getPlanFromLegacyEnum()),{passwordManager:{seats:o,additionalStorage:e,sponsored:t},secretsManager:(null===(n=this.formGroup.value.secretsManager)||void 0===n?void 0:n.enabled)?{seats:null!==(r=this.secretsManagerForm.value.userSeats)&&void 0!==r?r:0,additionalServiceAccounts:null!==(s=this.secretsManagerForm.value.additionalServiceAccounts)&&void 0!==s?s:0,standalone:!1}:void 0})}refreshSalesTax(){return Ie(this,void 0,void 0,function*(){})}updateOrganization(){return Ie(this,void 0,void 0,function*(){var e,t,i,n,r,s,o,a,l,c,d,h,A,p;const v=new C.v;if(v.additionalSeats=null!==(e=this.formGroup.controls.additionalSeats.value)&&void 0!==e?e:0,v.additionalStorageGb=null!==(t=this.formGroup.controls.additionalStorage.value)&&void 0!==t?t:0,v.premiumAccessAddon=null!==(n=null===(i=this.selectedPlan())||void 0===i?void 0:i.PasswordManager.hasPremiumAccessOption)&&void 0!==n&&n&&null!==(r=this.formGroup.controls.premiumAccessAddon.value)&&void 0!==r&&r,v.planType=this.selectedPlan().type,v.billingAddressCountry=null!==(o=null===(s=this.billingFormGroup.value.billingAddress)||void 0===s?void 0:s.country)&&void 0!==o?o:"",v.billingAddressPostalCode=null!==(l=null===(a=this.billingFormGroup.value.billingAddress)||void 0===a?void 0:a.postalCode)&&void 0!==l?l:"",this.buildSecretsManagerRequest(v),this.upgradeRequiresPaymentMethod){if(this.billingFormGroup.invalid)throw new Error("Billing form is invalid");const e=yield null===(c=this.enterPaymentMethodComponent())||void 0===c?void 0:c.tokenize();if(!e)throw new Error("Payment method validation failed");yield this.subscriberBillingClient.updatePaymentMethod({type:"organization",data:this.organization},e,{country:null!==(h=null===(d=this.billingFormGroup.value.billingAddress)||void 0===d?void 0:d.country)&&void 0!==h?h:"",postalCode:null!==(p=null===(A=this.billingFormGroup.value.billingAddress)||void 0===A?void 0:A.postalCode)&&void 0!==p?p:""})}if(!this.organization.hasPublicAndPrivateKeys){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,g.T)(e=>null==e?void 0:e.id))),t=yield(0,u._)(this.keyService.orgKeys$(e).pipe((0,g.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.organizationId()])&&void 0!==t?t:null}))),i=yield this.keyService.makeKeyPair(t);v.keys=new y.B(i[0],i[1].encryptedString)}return yield this.organizationApiService.upgrade(this.organizationId(),v),this.organizationId()})}createCloudHosted(e){return Ie(this,void 0,void 0,function*(){var t,i,n;const r=new m.L;if(r.key=e.key,r.collectionName=e.collectionCt,r.name=null!==(t=this.formGroup.controls.name.value)&&void 0!==t?t:"",r.billingEmail=null!==(i=this.formGroup.controls.billingEmail.value)&&void 0!==i?i:"",r.initiationPath="New organization creation in-product",r.keys=new y.B(e.orgKeys[0],e.orgKeys[1].encryptedString),r.planType=B.OL.Free,this.eligibleCouponIds().length>0&&(r.coupons=this.eligibleCouponIds()),this.hasProvider()){const t=new w(null!==(n=this.formGroup.controls.clientOwnerEmail.value)&&void 0!==n?n:"",r),i=yield(0,u._)(this.keyService.providerKeys$(e.activeUserId).pipe((0,g.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.providerId()])&&void 0!==t?t:null})));(0,b.x)(i,"Provider key not found"),t.organizationCreateRequest.key=(yield this.encryptService.wrapSymmetricKey(e.orgKey,i)).encryptedString;return(yield this.apiService.postProviderCreateOrganization(this.providerId(),t)).organizationId}return(yield this.organizationApiService.create(r)).id})}billingSubLabelText(){const e=this.selectedPlan();if(!e)return"";const 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){}upgradeFlowPrefillForm(){}planIsEnabled(e){return!e.disabled&&!e.legacyYear}determineFamilyPlan(){return Ie(this,void 0,void 0,function*(){return(yield this.configService.getFeatureFlag(S.TO.PM26462_Milestone_3))?B.OL.FamiliesAnnually:B.OL.FamiliesAnnually2025})}loadExistingOrganizationData(e){return Ie(this,void 0,void 0,function*(){var t,i;const n=yield(0,u._)(this.accountService.activeAccount$.pipe((0,g.T)(e=>null==e?void 0:e.id)));this.organization=null!==(t=yield(0,u._)(this.organizationService.organizations$(n).pipe((0,v.Sw)(e))))&&void 0!==t?t:null,this.billing=yield this.organizationApiService.getBilling(e),this.sub=yield this.organizationApiService.getSubscription(e);const r=yield this.subscriberBillingClient.getBillingAddress({type:"organization",data:this.organization});this.billingFormGroup.controls.billingAddress.patchValue(Object.assign(Object.assign({},r),{taxId:null===(i=null==r?void 0:r.taxId)||void 0===i?void 0:i.value}))})}loadPlanData(){return Ie(this,void 0,void 0,function*(){const e=yield this.apiService.getPlans();this.passwordManagerPlans=e.data.filter(e=>!!e.PasswordManager),this.secretsManagerPlans=e.data.filter(e=>!!e.SecretsManager),this.formGroup.controls.productTier.value!==B.K_.Enterprise&&this.formGroup.controls.productTier.value!==B.K_.Teams||this.formGroup.controls.businessOwned.setValue(!0)})}preselectUpgradePlan(e){if(e.productTier==B.K_.Enterprise)return;const t=this.passwordManagerPlans.find(t=>e.productTier===B.K_.Free?t.type===this._familyPlan:t.upgradeSortOrder==e.upgradeSortOrder+1);t&&(this.formGroup.controls.plan.setValue(t.type),this.formGroup.controls.productTier.setValue(t.productTier))}setupProviderConfiguration(){return Ie(this,void 0,void 0,function*(){this.formGroup.controls.businessOwned.setValue(!0),this.formGroup.controls.clientOwnerEmail.addValidators(a.k0.required),this.changedOwnedBusiness(),this.provider=yield this.providerApiService.getProvider(this.providerId());const e=this.passwordManagerPlans.find(e=>e.type===B.OL.TeamsAnnually);e&&(this.formGroup.controls.plan.setValue(e.type),this.formGroup.controls.productTier.setValue(e.productTier))})}setInitialPlanSelection(){var e;const t=this.initialPlan(),i=this.initialProductTier(),n=this.preSelectedProductTier();t!==B.OL.Free&&this.formGroup.controls.plan.setValue(t),i!==B.K_.Free&&this.formGroup.controls.productTier.setValue(i),null!=n&&(null!==(e=this.formGroup.controls.productTier.value)&&void 0!==e?e:0)<n&&this.formGroup.controls.productTier.setValue(n)}onLicenseFileUploaded(e){return Ie(this,void 0,void 0,function*(){this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")}),this.acceptingSponsorship()||this.isInTrialFlow||this.router.navigate(["/organizations/"+e]),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:e,subLabelText:this.billingSubLabelText()}),this.onSuccess.emit({organizationId:e}),this.messagingService.send("organizationCreated",{organizationId:e})})}upgradeFromPremiumToOrganization(e){return Ie(this,void 0,void 0,function*(){var t;const i=null!==(t=this.formGroup.controls.name.value)&&void 0!==t?t:"",n=(0,R.c3)(this.billingFormGroup.controls.billingAddress),r=this.premiumOrgUpgradeService.SubscriptionTierIdFromProductTier(this.formGroup.controls.productTier.value);return yield this.premiumOrgUpgradeService.upgradeToOrganization(e,i,r,n)})}}Ft.ɵfac=function(e){return new(e||Ft)(G.rXU(U.G),G.rXU(V.W),G.rXU(j.y),G.rXU(T.Lu),G.rXU(N.N),G.rXU(z.Ix),G.rXU(k.H),G.rXU(Y.m),G.rXU(v.PV),G.rXU(Q.U),G.rXU(a.ok),G.rXU(L.X),G.rXU(K.J),G.rXU(X.f),G.rXU(q.D),G.rXU(P.Hd),G.rXU(P.dA),G.rXU(H.w),G.rXU(W.Q),G.rXU(M.J),G.rXU(x.s))},Ft.ɵcmp=G.VBU({type:Ft,selectors:[["app-organization-plans"]],viewQuery:function(e,t){1&e&&G.wEZ(t.enterPaymentMethodComponent,R.Pu,5),2&e&&G.NyB()},inputs:{organizationId:[1,"organizationId"],providerId:[1,"providerId"],showFree:[1,"showFree"],showCancel:[1,"showCancel"],acceptingSponsorship:[1,"acceptingSponsorship"],planSponsorshipType:[1,"planSponsorshipType"],currentPlan:[1,"currentPlan"],preSelectedProductTier:[1,"preSelectedProductTier"],enableSecretsManagerByDefault:[1,"enableSecretsManagerByDefault"],initialProductTier:[1,"initialProductTier"],initialPlan:[1,"initialPlan"]},outputs:{onSuccess:"onSuccess",onCanceled:"onCanceled",onTrialBillingSuccess:"onTrialBillingSuccess"},decls:4,vars:4,consts:[["enterPaymentMethodComponent",""],[1,"tw-pt-6",3,"formGroup","bitSubmit"],["name","bwi-spinner","aria-hidden","true",1,"bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"onLicenseFileUploaded"],[3,"ngClass"],[3,"changedBusinessOwned","formGroup","createOrganization","isProvider","acceptingSponsorship"],["bitTypography","h2"],["formControlName","productTier",3,"block"],[1,"tw-mb-3"],[3,"formGroup","selectedPlan","upgradeOrganization"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",3,"disabled"],["type","button","buttonType","secondary","bitButton","","bitFormButton",""],[3,"formGroup"],[3,"change","value"],[1,"tw-text-sm"],[1,"tw-pl-0","tw-list-inside","tw-mb-0"],[1,"tw-pl-4"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],["bitInput","","type","number","formControlName","additionalSeats","required","",3,"placeholder"],["bitInput","","type","number","formControlName","additionalStorage","step","1",3,"placeholder"],["bitInput","","type","number","formControlName","additionalSeats",3,"placeholder"],["type","checkbox","bitCheckbox","","formControlName","premiumAccessAddon"],["formControlName","plan"],["type","radio",3,"id","value"],["bitTypography","body2",1,"tw-mb-0"],[1,"tw-line-through"],["bitTypography","body2",1,"tw-text-muted","tw-italic","tw-mb-3","tw-block"],[3,"group"],[1,"tw-my-4",3,"group","scenario"],["id","price",1,"tw-my-4"],[3,"cart","showDiscountBadges"],["type","danger",3,"title"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click"]],template:function(e,t){if(1&e&&(G.SS7(0),G.nVh(1,Ee,6,7,"ng-container"),G.nVh(2,Se,2,0,"ng-container"),G.nVh(3,kt,21,23,"form",1)),2&e){const e=t.loading;t.passwordManagerPlans,t.secretsManagerPlans,G.bH3(t.canUpgradeFromPremium()),G.R7$(),G.vxM(e?1:-1),G.R7$(),G.vxM(-1),G.R7$(),G.vxM(e?-1:3)}},dependencies:[O.rd,$.YU,a.qT,a.me,a.Q0,a.Zm,a.BC,a.cb,a.YS,a.j4,a.JD,J.$,Z.L,_.Q,ee.G,te.P,ie.f,ne.j,re.I,se.J,oe.L,ae.h,le.R,ce.d,de.Y,ue.n,he.r,Ae.m,Ce,D.Y,we.T,R.Pu,R.vU,F.Oo,$.oe,me.$],encapsulation:2})},67379(e,t,i){"use strict";i.d(t,{f:()=>s});var n=i(33812),r=i(7421);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.VBU({type:s,selectors:[["bit-base-card"]],features:[n.nM4([r.T])],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},67519(e,t,i){"use strict";i.d(t,{rg:()=>h});var n=i(94573),r=i(74208),s=i(33812),o=i(33277),a=i(6307),l=i(23542);const c={primary:["tw-bg-bg-brand-softer","tw-border-border-brand-soft","tw-text-fg-brand-strong","[&:is(button,a)]:hover:tw-bg-bg-brand-soft","[&:is(button,a)]:focus-visible:tw-bg-bg-brand-soft","has-[button:hover:not([bit-chip-dismiss-button])]:tw-bg-bg-brand-soft","has-[a:hover]:tw-bg-bg-brand-soft","has-[button:focus-visible:not([bit-chip-dismiss-button])]:tw-bg-bg-brand-soft","has-[a:focus-visible]:tw-bg-bg-brand-soft"],subtle:["tw-bg-bg-primary","tw-border-border-base","tw-text-fg-body","[&:is(button,a)]:hover:tw-bg-bg-quaternary","[&:is(button,a)]:focus-visible:tw-bg-bg-quaternary","has-[button:hover:not([bit-chip-dismiss-button])]:tw-bg-bg-quaternary","has-[a:hover]:tw-bg-bg-quaternary","has-[button:focus-visible:not([bit-chip-dismiss-button])]:tw-bg-bg-quaternary","has-[a:focus-visible]:tw-bg-bg-quaternary"],"accent-primary":["tw-bg-bg-accent-primary-soft","tw-border-border-accent-primary-soft","tw-text-fg-accent-primary-strong","[&:is(button,a)]:hover:tw-bg-bg-accent-primary-medium","[&:is(button,a)]:focus-visible:tw-bg-bg-accent-primary-medium","has-[button:hover:not([bit-chip-dismiss-button])]:tw-bg-bg-accent-primary-medium","has-[a:hover]:tw-bg-bg-accent-primary-medium","has-[button:focus-visible:not([bit-chip-dismiss-button])]:tw-bg-bg-accent-primary-medium","has-[a:focus-visible]:tw-bg-bg-accent-primary-medium"],"accent-secondary":["tw-bg-bg-accent-secondary-soft","tw-border-border-accent-secondary-soft","tw-text-fg-accent-secondary-strong","[&:is(button,a)]:hover:tw-bg-bg-accent-secondary-medium","[&:is(button,a)]:focus-visible:tw-bg-bg-accent-secondary-medium","has-[button:hover:not([bit-chip-dismiss-button])]:tw-bg-bg-accent-secondary-medium","has-[a:hover]:tw-bg-bg-accent-secondary-medium","has-[button:focus-visible:not([bit-chip-dismiss-button])]:tw-bg-bg-accent-secondary-medium","has-[a:focus-visible]:tw-bg-bg-accent-secondary-medium"]},d=(e,t)=>{const i={hasTrailingIcon:{small:"tw-pe-0.5",large:"tw-pe-1"},noTrailingIcon:{small:"tw-pe-1.5",large:"tw-pe-2"}}[t?"hasTrailingIcon":"noTrailingIcon"][e];return[...{small:["tw-text-xs/4","tw-ps-1.5","tw-py-[calc(theme(spacing[0.5])_-_1px)]"],large:["tw-text-sm/5","tw-ps-2","tw-py-[calc(theme(spacing.1)_-_1px)]"]}[e],i]},u=["tw-inline-flex","tw-items-center","tw-rounded-md","tw-border","tw-font-medium","tw-transition-colors","[&:is(button)]:tw-appearance-none","[&:is(button)]:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-border-focus","focus-visible:tw-z-10","has-[:focus-visible:not([bit-chip-dismiss-button])]:tw-ring-2","has-[:focus-visible:not([bit-chip-dismiss-button])]:tw-ring-offset-2","has-[:focus-visible:not([bit-chip-dismiss-button])]:tw-ring-border-focus","has-[:focus-visible:not([bit-chip-dismiss-button])]:tw-z-10","disabled:tw-bg-bg-disabled","disabled:tw-border-border-base","disabled:tw-text-fg-disabled","disabled:hover:tw-bg-bg-disabled","disabled:tw-pointer-events-none","aria-disabled:tw-bg-bg-disabled","aria-disabled:tw-border-border-base","aria-disabled:tw-text-fg-disabled","aria-disabled:hover:tw-bg-bg-disabled","aria-disabled:focus-visible:tw-bg-bg-disabled","aria-disabled:tw-pointer-events-none"];class h{constructor(){this.variant=(0,n.geq)("primary"),this.size=(0,n.hFB)("large"),this.selected=(0,n.hFB)(!1),this.selectedState=(0,r.vPA)(!1),this.isSelected=(0,o.EW)(()=>this.selected()||this.selectedState()),this.fullWidth=(0,n.hFB)(!1,{transform:n.L39}),this.maxWidthClass=(0,n.hFB)("tw-max-w-52"),this.disabledInput=(0,n.hFB)(!1,{alias:"disabled",transform:n.L39}),this.disabledState=(0,r.vPA)(!1),this.disabled=(0,o.EW)(()=>this.disabledInput()||this.disabledState()),this.hasTrailingIcon=(0,r.vPA)(!1),this.classList=(0,o.EW)(()=>{const e=this.size()||"large",t=[...u,...d(e,this.hasTrailingIcon()),this.fullWidth()?"tw-w-full":this.maxWidthClass()],i=this.variant()||"primary";return this.isSelected()?t.push(...c.primary):t.push(...c[i]),t.join(" ")}),this.el=(0,r.WQX)(s.aKT),(0,a.m)(this.el.nativeElement,this.disabled)}}h.ɵfac=function(e){return new(e||h)},h.ɵdir=s.FsC({type:h,selectors:[["","bitBaseChip",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classList())},inputs:{variant:[1,"variant"],size:[1,"size"],selected:[1,"selected"],fullWidth:[1,"fullWidth"],maxWidthClass:[1,"maxWidthClass"],disabledInput:[1,"disabled","disabledInput"]},outputs:{variant:"variantChange"},features:[s.nM4([l.v])]})},67529(e,t,i){"use strict";i.d(t,{B:()=>n});class n{constructor(e,t,i){this.encapsulatedDownstreamKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}},67553(e,t,i){"use strict";i.d(t,{Dl:()=>l,KP:()=>g,OV:()=>p,PV:()=>f,Sw:()=>v,Ue:()=>u,Vc:()=>h,ex:()=>d,k4:()=>m,o2:()=>A,of:()=>a,pe:()=>c});var n=i(33338),r=i(3204),s=i(82468),o=i(43978);function a(e){return e.canViewAllCollections}function l(e){return e.isOwner||e.canManagePolicies||e.canManageSso||e.canManageScim||e.canAccessImport||e.canAccessExport||e.canManageDeviceApprovals}function c(e){return e.canManageUsers||e.canManageUsersPassword}function d(e){return e.canManageGroups}function u(e){return e.canAccessReports||e.canAccessEventLogs}function h(e){return!1}function A(e){return e.canUseAccessIntelligence&&e.canAccessReports}function p(e){return!(!e.enabled&&!e.isOwner)&&(c(e)||d(e)||u(e)||l(e)||a(e))}function g(e,t,i){return(0,n.z)([t.getFeatureFlag$(s.TO.AutoConfirm),i.policyAppliesToUser$(o.tt.AutoConfirm,e)]).pipe((0,r.T)(([e,t])=>!(e&&t)))}function v(e){return(0,r.T)(t=>t.find(t=>t.id===e))}class f{}class m extends f{}},67756(e,t,i){"use strict";i.d(t,{M:()=>a});var n=i(39306),r=i(17989),s=i(96540),o=i(72142);class a extends r.A{constructor(e){super(),null!=e&&(this.privateKey=new n.k(e.privateKey),this.publicKey=new n.k(e.publicKey),this.keyFingerprint=new n.k(e.keyFingerprint))}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new o.H,["privateKey","publicKey","keyFingerprint"],e,"DomainType: SshKey; "+t)}toSshKeyData(){const e=new s.E;return this.buildDataModel(this,e,{privateKey:null,publicKey:null,keyFingerprint:null}),e}static fromJSON(e){if(null==e)return;const t=new a;return t.privateKey=n.k.fromJSON(e.privateKey),t.publicKey=n.k.fromJSON(e.publicKey),t.keyFingerprint=n.k.fromJSON(e.keyFingerprint),t}toSdkSshKey(){return{privateKey:this.privateKey.toSdk(),publicKey:this.publicKey.toSdk(),fingerprint:this.keyFingerprint.toSdk()}}static fromSdkSshKey(e){if(null==e)return;const t=new a;return t.privateKey=n.k.fromJSON(e.privateKey),t.publicKey=n.k.fromJSON(e.publicKey),t.keyFingerprint=n.k.fromJSON(e.fingerprint),t}}},68016(e,t,i){"use strict";i.d(t,{m:()=>X,G:()=>K});var n=i(60989),r=i(94251),s=i(77468),o=i(74208),a=i(33812),l=i(94573),c=i(33277),d=i(83731),u=i(33338),h=i(44500),A=i(36801),p=i(55686),g=i(36288),v=i(9396),f=i(83632),m=i(58806),y=i(79026),C=i(12610),w=i(50037),I=i(79243),b=i(3204),B=i(34040),E=i(48479);const S=(e,t,i=1)=>((e,t)=>new E.c(i=>{const n=new IntersectionObserver(e=>{for(const t of e)i.next(t)},t);return n.observe(e),()=>n.disconnect()}))(t,{root:e,threshold:i}).pipe((0,C.Z)(null),(0,w.Z)(0,y.X),(0,I.Q)(y.X),(0,b.T)(t=>t?!t.isIntersecting:e.scrollHeight>e.clientHeight),(0,B.F)());var Q=i(66316),k=i(7730),T=i(35042),F=i(66723);const P=["dialogHeader"],R=["scrollBottom"],D=[[["","bitDialogTitle",""]],[["","bitDialogHeaderEnd",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]]],M=(e,t)=>[e,t],x=(e,t,i,n)=>({"tw-p-4 has-[[biticonbutton]]:tw-pe-2":e,"tw-px-6 tw-py-4 has-[[biticonbutton]]:tw-pe-4":t,"tw-border-secondary-100":i,"tw-border-transparent":n}),O=(e,t,i)=>({"tw-min-h-60":e,"tw-bg-background":t,"tw-bg-background-alt":i}),G=(e,t,i,n)=>({"tw-py-2 tw-ps-6 tw-pe-6":e,"tw-overflow-y-auto":t,"tw-invisible tw-overflow-y-hidden":i,"tw-py-4":n}),U=(e,t)=>({"tw-border-transparent":e,"tw-border-secondary-100":t}),V=(e,t)=>({"tw-px-6 tw-py-4":e,"tw-p-4 has-[[biticonbutton]]:tw-pe-2":t});function j(e,t){1&e&&(a.j41(0,"span",5),a.EFF(1),a.k0s()),2&e&&(a.R7$(),a.SpI(" ",t," "))}function N(e,t){1&e&&(a.nrm(0,"button",7),a.nI1(1,"i18n")),2&e&&a.Y8G("label",a.bMT(1,1,"close"))}function z(e,t){1&e&&(a.j41(0,"div",9),a.nrm(1,"bit-spinner"),a.k0s())}const Y={small:"md:tw-max-w-sm",default:"md:tw-max-w-xl",large:"md:tw-max-w-3xl"},L={small:"md:tw-max-w-sm",default:"md:tw-max-w-lg",large:"md:tw-max-w-2xl"},K={small:24,default:32,large:42};class X{constructor(){this.destroyRef=(0,o.WQX)(o.abz),this.ngZone=(0,o.WQX)(a.SKi),this.el=(0,o.WQX)(a.aKT),this.drawerService=(0,o.WQX)(F.d),this.autofocusFallback=(0,o.WQX)(p.D,{host:!0}),this.dialogHeader=l.ebz.required("dialogHeader"),this.scrollableBody=l.ebz.required(r.uv),this.scrollBottom=l.ebz.required("scrollBottom"),this.dialogRef=(0,o.WQX)(Q.ce,{optional:!0}),this.bodyHasScrolledFrom=(e=>{const t=null!=e?e:(0,o.vPA)((0,o.WQX)(r.uv)),i=(0,d.br)(t).pipe((0,h.n)(e=>e.elementScrolled().pipe((0,C.Z)(null),(0,b.T)(()=>({top:e.measureScrollOffset("top")>0,bottom:e.measureScrollOffset("bottom")>1})))));return(0,d.ot)(i,{initialValue:{top:!1,bottom:!1}})})(this.scrollableBody),this.scrollableBody$=(0,d.br)(this.scrollableBody),this.scrollBottom$=(0,d.br)(this.scrollBottom),this.isScrollable$=(0,u.z)([this.scrollableBody$,this.scrollBottom$]).pipe((0,h.n)(([e,t])=>S(e.getElementRef().nativeElement,t.nativeElement))),this.background=(0,l.hFB)("default"),this.dialogSize=(0,l.hFB)("default"),this.title=(0,l.hFB)(),this.subtitle=(0,l.hFB)(),this.disablePadding=(0,l.hFB)(!1,{transform:l.L39}),this.disableAnimations=(0,l.hFB)(!1,{transform:l.L39}),this.loading=(0,l.hFB)(!1),this.animationCompleted=(0,o.vPA)(!1),this.width=(0,c.EW)(()=>{var e;const t=this.dialogSize();return(null===(e=this.dialogRef)||void 0===e?void 0:e.isDrawer)?this.drawerService.isPushMode()?L[t]:"":Y[t]}),this.classes=(0,c.EW)(()=>{var e,t;const i=null===(e=this.dialogRef)||void 0===e?void 0:e.isDrawer,n=["tw-flex","tw-flex-col",i?"tw-w-full":"tw-w-screen"],r=i?["tw-h-full"]:["md:tw-p-4","tw-max-h-[90vh]"],s=this.dialogSize(),o=this.disableAnimations()||this.animationCompleted()||(null===(t=this.dialogRef)||void 0===t?void 0:t.isDrawer)?[]:"small"===s?["tw-animate-slide-down"]:["tw-animate-slide-up","md:tw-animate-slide-down"];return[...n,this.width(),...r,...o]}),(0,c.QZ)(()=>{var e,t;if(!(null===(e=this.dialogRef)||void 0===e?void 0:e.isDrawer))return;const i=this.dialogSize(),n=(0,v.T)();this.drawerService.declarePushWidth((null!==(t=K[i])&&void 0!==t?t:32)*n)})}handleEsc(e){var t,i;(null===(t=this.dialogRef)||void 0===t?void 0:t.disableClose)||(null===(i=this.dialogRef)||void 0===i||i.close(),e.stopPropagation())}onAnimationEnd(){this.animationCompleted.set(!0)}ngAfterViewInit(){this.autofocusFallback.bitAutofocusFallback.set(this.dialogHeader())}focusHeader(){this.dialogHeader().nativeElement.focus()}}X.ɵfac=function(e){return new(e||X)},X.ɵcmp=a.VBU({type:X,selectors:[["bit-dialog"],["","bit-dialog",""]],viewQuery:function(e,t){1&e&&(a.wEZ(t.dialogHeader,P,5),a.wEZ(t.scrollableBody,r.uv,5),a.wEZ(t.scrollBottom,R,5)),2&e&&a.NyB(3)},hostVars:2,hostBindings:function(e,t){1&e&&a.bIt("keydown.esc",function(e){return t.handleEsc(e)})("animationend",function(){return t.onAnimationEnd()}),2&e&&a.HbH(t.classes())},inputs:{background:[1,"background"],dialogSize:[1,"dialogSize"],title:[1,"title"],subtitle:[1,"subtitle"],disablePadding:[1,"disablePadding"],disableAnimations:[1,"disableAnimations"],loading:[1,"loading"]},features:[a.nM4([p.D])],ngContentSelectors:["[bitDialogTitle]","[bitDialogHeaderEnd]","[bitDialogContent]","[bitDialogFooter]"],decls:21,vars:35,consts:[["dialogHeader",""],["scrollBottom",""],["cdkTrapFocus","",1,"tw-flex","tw-w-full","tw-flex-col","tw-self-center","tw-overflow-hidden","tw-border","tw-border-solid","tw-border-secondary-100","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-py-3","tw-ps-6","tw-pe-4",3,"ngClass"],["bitDialogTitleContainer","","bitTypography","h3","noMargin","","tabindex","-1",1,"tw-text-main","tw-mb-0","tw-line-clamp-2","tw-text-ellipsis","tw-break-words","focus-visible:tw-outline-none"],[1,"tw-text-muted","tw-font-normal","tw-text-sm"],[1,"tw-flex","tw-items-center","tw-justify-center"],["type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","default","bitDialogClose","",3,"label"],[1,"tw-relative","tw-flex-1","tw-flex","tw-flex-col","tw-overflow-hidden",3,"ngClass"],[1,"tw-absolute","tw-flex","tw-size-full","tw-items-center","tw-justify-center"],["cdkScrollable","",3,"ngClass"],["data-chromatic","ignore",1,"tw-border-0","tw-border-t","tw-border-solid",3,"ngClass"],[1,"tw-flex","tw-flex-row","tw-items-center","tw-gap-2","tw-bg-background","tw-py-5","tw-ps-6","tw-pe-4",3,"ngClass"]],template:function(e,t){var i;if(1&e&&(a.NAR(D),a.j41(0,"section",2)(1,"header",3)(2,"h2",4,0),a.EFF(4),a.nVh(5,j,2,1,"span",5),a.SdG(6),a.k0s(),a.j41(7,"div",6),a.SdG(8,1),a.nVh(9,N,2,3,"button",7),a.k0s()(),a.j41(10,"div",8),a.nVh(11,z,2,0,"div",9),a.j41(12,"div",10),a.SdG(13,2),a.nrm(14,"div",null,1),a.k0s()(),a.SS7(16),a.nI1(17,"async"),a.nrm(18,"div",11),a.j41(19,"footer",12),a.SdG(20,3),a.k0s()()),2&e){let e;const n=null==t.dialogRef?null:t.dialogRef.isDrawer,r=null!==(i=t.width())&&void 0!==i?i:"";a.Y8G("ngClass",a.l_i(12,M,r,n?"tw-h-full tw-border-t-0":"tw-rounded-t-xl md:tw-rounded-xl tw-shadow-lg"));const s=t.bodyHasScrolledFrom().top;a.R7$(),a.Y8G("ngClass",a.ziG(15,x,!n,n,s,!s)),a.R7$(3),a.SpI(" ",t.title()," "),a.R7$(),a.vxM((e=t.subtitle())?5:-1,e),a.R7$(4),a.vxM(null!=t.dialogRef&&t.dialogRef.disableClose?-1:9),a.R7$(),a.Y8G("ngClass",a.sMw(20,O,t.loading(),"default"===t.background(),"alt"===t.background())),a.R7$(),a.vxM(t.loading()?11:-1),a.R7$(),a.Y8G("ngClass",a.ziG(24,G,!t.disablePadding(),!t.loading(),t.loading(),"alt"===t.background()));const o=a.bMT(17,10,t.isScrollable$),l=!t.bodyHasScrolledFrom().top&&o||t.bodyHasScrolledFrom().bottom;a.R7$(6),a.Y8G("ngClass",a.l_i(29,U,!l,l)),a.R7$(),a.Y8G("ngClass",a.l_i(32,V,n,!n))}},dependencies:[s.MD,s.YU,T.h,m.r,g.s,k.I,n.kB,r.uv,f.t,s.Jj,A.$Z],encapsulation:2})},68052(e,t,i){"use strict";i.d(t,{bf:()=>Nt,Bd:()=>s,RI:()=>n,H7:()=>zt,UN:()=>Ut,XM:()=>Gt,Tt:()=>o});class n{}var r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s{constructor(e){this.apiService=e}postImportCiphers(e){return r(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/ciphers/import",e,!0,!1)})}postImportOrganizationCiphers(e,t){return r(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/ciphers/import-organization?organizationId="+e,t,!0,!1)})}}class o{}var a=i(72245),l=i(3204),c=i(23965),d=i(52237),u=i(3633);class h{constructor(){this.ciphers=[],this.folders=[],this.folderRelationships=[]}}class A{constructor(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]}}class p{constructor(e,t){this.key=e,this.value=t}}var g=i(7861),v=i(78781),f=i(31442),m=i(45113),y=i(89177),C=i(78078);class w{constructor(){this.success=!1,this.ciphers=[],this.folders=[],this.folderRelationships=[],this.collections=[],this.collectionRelationships=[]}}var I=i(98869),b=i(39907),B=i(62627),E=i(75751),S=i(11766),Q=i(16671),k=i(14093),T=i(86346);class F{constructor(){this.organizationId=null,this.logService=new B.V(!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 r=I.parse(e,n);return null!=r.errors&&r.errors.length>0&&r.errors.forEach(e=>{null!=e.row&&this.logService.warning("Error parsing row "+e.row+": "+e.message)}),r.data&&r.data.length>0?r.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 Q.z;return t.uri=this.fixUri(e),this.isNullOrWhitespace(t.uri)?null:[t]}if(e.length>0){const t=[];return e.forEach(e=>{const i=new Q.z;i.uri=this.fixUri(e),this.isNullOrWhitespace(i.uri)||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=v.A.getHostname(e);return this.isNullOrWhitespace(t)?null:t.startsWith("www.")?t.replace("www.",""):t}isNullOrWhitespace(e){return v.A.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 r=n.groups.year;return e.card.expYear=(0,b.jd)(r),!0}moveFoldersToCollections(e){e.folderRelationships.forEach(t=>e.collectionRelationships.push(t)),e.collections=e.folders.map(e=>new d.iY({name:e.name,organizationId:this.organizationId,id:e.id&&""!==e.id?e.id:null})),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 E.f;return e.favorite=!1,e.notes="",e.fields=[],e.login=new k.r,e.type=f.gC.Login,e}cleanupCipher(e){null!=e&&(e.type!==f.gC.Login&&(e.login=null),this.isNullOrWhitespace(e.name)&&(e.name="--"),this.isNullOrWhitespace(e.notes)&&(e.notes=null))}processKvp(e,t,i,n=f.PU.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 r=new S.g;r.type=n,r.name=t,r.value=i,e.fields.push(r)}}processFolder(e,t,i=!0){if(this.isNullOrWhitespace(t))return;let n=e.folders.length;t=t.replace(/\\/g,"/");let r=!0;for(let o=0;o<e.folders.length;o++)if(e.folders[o].name===t){r=!1,n=o;break}if(r){const i=new C.u;i.name=t,e.folders.push(i)}i&&e.folderRelationships.push([e.ciphers.length,n]);const s=t.split("/");for(let o=s.length-1;o>0;o--){const t=s.slice(0,o).join("/");if(null==e.folders.find(e=>e.name===t)){const i=new C.u;i.name=t,e.folders.push(i)}}}convertToNoteIfNeeded(e){e.type===f.gC.Login&&this.isNullOrWhitespace(e.login.username)&&this.isNullOrWhitespace(e.login.password)&&(null==e.login.uris||0===e.login.uris.length)&&(e.type=f.gC.SecureNote,e.secureNote=new T.Z,e.secureNote.type=f.ak.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 P extends F{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(),r=this.getValueOrDefault(e.url);n.name=this.getValueOrDefault(null!==(i=this.nameFromUrl(r))&&void 0!==i?i:"","--"),n.login.username=this.getValueOrDefault(e.username),n.login.password=this.getValueOrDefault(e.password),n.login.uris=this.makeUriArray(e.url),n.notes=this.getValueOrDefault(e.note),this.cleanupCipher(n),t.ciphers.push(n)}),t.success=!0,Promise.resolve(t))}}class R extends F{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],r=e[t+1];if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(r))continue;const s=r.toLowerCase();null==i.login.password&&this.passwordFieldNames.indexOf(s)>-1?i.login.password=this.getValueOrDefault(n):null==i.login.username&&this.usernameFieldNames.indexOf(s)>-1?i.login.username=this.getValueOrDefault(n):(null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(s)>-1?i.login.uris=this.makeUriArray(n):this.processKvp(i,r,n)}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class D extends F{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 M=i(6528);class x extends F{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=f.gC.SecureNote,i.secureNote.type=f.ak.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=f.gC.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=M.G.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 O extends F{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 G extends F{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 U extends F{constructor(){super(...arguments),this.androidPatternRegex=new RegExp("^android:\\/\\/.*(?<=@)(.*)(?=\\/)")}normalizeAndroidUrl(e){const t=null==e?void 0:e.match(this.androidPatternRegex);return t?`androidapp://${t[1]}`:e}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(),n=this.normalizeAndroidUrl(e.url);let r=e.name;!r&&this.androidPatternRegex.test(e.url)&&(r=e.url.match(this.androidPatternRegex)[1]),i.name=this.getValueOrDefault(r,"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(n),i.notes=this.getValueOrDefault(e.note),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}var V=i(36501);class j extends F{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=>{this.processFolder(t,e)})}else this.organization||this.processFolder(t,e.folder);const i=new E.f;i.favorite=!this.organization&&"0"!==this.getValueOrDefault(e.favorite,"0"),i.type=f.gC.Login,i.notes=this.getValueOrDefault(e.notes),i.name=this.getValueOrDefault(e.name,"--");try{i.reprompt=parseInt(this.getValueOrDefault(e.reprompt,V.b.None.toString()),10)}catch(n){console.error("Unable to parse reprompt value",n),i.reprompt=V.b.None}if(!this.isNullOrWhitespace(e.archivedDate))try{i.archivedDate=new Date(e.archivedDate)}catch(n){console.error("Unable to parse archivedDate value",n)}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 r=new S.g;r.name=t[e].substr(0,n),r.value=null,r.type=f.PU.Text,t[e].length>n+2&&(r.value=t[e].substr(n+2)),i.fields.push(r)}}switch(null!=e.type?e.type.toLowerCase():null){case"note":i.type=f.gC.SecureNote,i.secureNote=new T.Z,i.secureNote.type=f.ak.Generic;break;default:{i.type=f.gC.Login,i.login=new k.r,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)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}var N=i(56455),z=i(67253),Y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class L extends F{constructor(){super()}parse(e){return Y(this,void 0,void 0,function*(){const t=JSON.parse(e);if(null==t||null==t.items){const e=new w;return e.success=!1,e}if(!(0,z.oK)(t))throw new Error("Data is encrypted. Use BitwardenEncryptedJsonImporter instead.");return yield this.parseDecrypted(t)})}parseDecrypted(e){return Y(this,void 0,void 0,function*(){const t=new w,i=(0,z.SX)(e)?yield this.parseCollections(e,t):yield this.parseFolders(e,t);return e.items.forEach(e=>{const n=N.pU.toView(e);n.id=null,n.organizationId=null,n.collectionIds=null,null!=n.passwordHistory&&n.passwordHistory.length>5&&(n.passwordHistory=n.passwordHistory.slice(0,5)),!this.organization&&null!=e.folderId&&i.has(e.folderId)?t.folderRelationships.push([t.ciphers.length,i.get(e.folderId)]):this.organization&&null!=e.collectionIds&&e.collectionIds.forEach(e=>{i.has(e)&&t.collectionRelationships.push([t.ciphers.length,i.get(e)])}),this.cleanupCipher(n),t.ciphers.push(n)}),t.success=!0,t})}parseFolders(e,t){return Y(this,void 0,void 0,function*(){const i=new Map;if(null==e.folders)return i;for(const n of e.folders){const e=N.wG.toView(n);null!=e&&(i.set(n.id,t.folders.length),t.folders.push(e))}return i})}parseCollections(e,t){return Y(this,void 0,void 0,function*(){const i=new Map;if(null==e.collections)return i;for(const n of e.collections){const e=N.MA.toView(n);e.organizationId=null,null!=e&&(i.set(n.id,t.collections.length),t.collections.push(e))}return i})}}var K=i(39306),X=i(8916),q=i(69194),H=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class W extends L{constructor(e,t,i,n,r){super(),this.keyService=e,this.encryptService=t,this.i18nService=i,this.cipherService=n,this.accountService=r}parse(e){const t=Object.create(null,{parse:{get:()=>super.parse}});return H(this,void 0,void 0,function*(){const i=JSON.parse(e);if((0,z.og)(i))throw new Error("Data is password-protected. Use BitwardenPasswordProtectedImporter instead.");if(null==i||null==i.items){const e=new w;return e.success=!1,e}return(0,z.oK)(i)?t.parse.call(this,e):yield this.parseEncrypted(i)})}parseEncrypted(e){return H(this,void 0,void 0,function*(){const t=new w,i=yield(0,a._)(this.accountService.activeAccount$);if(this.isNullOrWhitespace(e.encKeyValidation_DO_NOT_EDIT))return t.success=!1,t.errorMessage=this.i18nService.t("importEncKeyError"),t;const n=yield(0,a._)(this.keyService.orgKeys$(i.id));let r=null==n?void 0:n[this.organizationId];if(r||(r=yield(0,a._)(this.keyService.userKey$(i.id))),!r)return t.success=!1,t.errorMessage=this.i18nService.t("importEncKeyError"),t;const s=new K.k(e.encKeyValidation_DO_NOT_EDIT);try{yield this.encryptService.decryptString(s,r)}catch(l){return t.success=!1,t.errorMessage=this.i18nService.t("importEncKeyError"),t}let o=null;o=(0,z.TS)(e)?yield this.parseEncryptedCollections(i.id,e,t):yield this.parseEncryptedFolders(i.id,e,t);for(const a of e.items){const e=N.pU.toDomain(a);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!=a.folderId&&o.has(a.folderId)?t.folderRelationships.push([t.ciphers.length,o.get(a.folderId)]):this.organization&&null!=a.collectionIds&&a.collectionIds.forEach(e=>{o.has(e)&&t.collectionRelationships.push([t.ciphers.length,o.get(e)])});const n=yield this.cipherService.decrypt(e,i.id);this.cleanupCipher(n),t.ciphers.push(n)}return t.success=!0,t})}parseEncryptedFolders(e,t,i){return H(this,void 0,void 0,function*(){const n=new Map;if(null==t.folders)return n;const r=yield(0,a._)(this.keyService.userKey$(e));for(const e of t.folders){let t;const s=N.wG.toDomain(e);null!=s&&(t=yield s.decrypt(r)),null!=t&&(n.set(e.id,i.folders.length),i.folders.push(t))}return n})}parseEncryptedCollections(e,t,i){return H(this,void 0,void 0,function*(){const n=new Map;if(null==t.collections)return n;const r=yield(0,a._)(this.keyService.orgKeys$(e).pipe((0,q.p)(e=>null!=e)));for(const e of t.collections){const t=N.MA.toDomain(e,new d.pM({id:e.id,name:new K.k(e.name),organizationId:this.organizationId})),s=r[e.organizationId],o=yield t.decrypt(s,this.encryptService);null!=o&&(n.set(e.id,i.collections.length),i.collections.push(o))}return n})}}var $=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class J extends W{constructor(e,t,i,n,r,s,o){super(e,t,i,n,s),this.keyGenerationService=r,this.promptForPassword_callback=o}parse(e){const t=Object.create(null,{parse:{get:()=>super.parse}});return $(this,void 0,void 0,function*(){const i=new w,n=JSON.parse(e);if(!n)return i.success=!1,i;if(!(0,z.og)(n))return yield t.parse.call(this,e);if(this.cannotParseFile(n))return i.success=!1,i;const r=yield this.promptForPassword_callback();if(!(yield this.checkPassword(n,r)))return i.success=!1,i.errorMessage=this.i18nService.t("invalidFilePassword"),i;const s=new K.k(n.data),o=yield this.encryptService.decryptString(s,this.key);return yield t.parse.call(this,o)})}checkPassword(e,t){return $(this,void 0,void 0,function*(){if(this.isNullOrWhitespace(t))return!1;const i=e.kdfType===X.ao.PBKDF2_SHA256?new X.n1(e.kdfIterations):new X.hU(e.kdfIterations,e.kdfMemory,e.kdfParallelism);this.key=yield this.keyGenerationService.deriveVaultExportKey(t,e.salt,i);const n=new K.k(e.encKeyValidation_DO_NOT_EDIT);try{return yield this.encryptService.decryptString(n,this.key),!0}catch(r){return!1}})}cannotParseFile(e){return!(e&&e.encrypted&&e.passwordProtected&&e.salt&&e.kdfIterations&&"number"==typeof e.kdfIterations&&null!=e.kdfType&&null!=X.ao[e.kdfType]&&e.encKeyValidation_DO_NOT_EDIT&&e.data)}}class Z extends F{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 _=["!group_id","!group_name","!type","title","username","password","URL","url","note","id"];class ee extends F{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);const n=e.URL||e.url||e.Url;i.login.uris=this.makeUriArray(n);const r=e.note||e.Note||e.notes||e.Notes;r&&(i.notes=r);for(const t in e)if(e.hasOwnProperty(t)){const n=t.toLowerCase();!_.some(e=>e.toLowerCase()===n)&&e[t]&&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 te extends F{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 ie extends F{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 ne=i(67036);const re=new Set(["title","note","username","password","url","otpSecret","category"]),se=new Set(["type","title","first_name","middle_name","last_name","login","email","phone_number","address","country","state","city","zip","item_name"]),oe=new Set(["title","note"]);class ae extends F{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=f.gC.Identity,e.identity=new ne.O,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]&&"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=f.gC.Login,e.login=new k.r,e.name=t.title,e.notes=t.note,e.login.username=t.username,e.login.password=t.password,e.login.totp=Object.keys(t).includes("otpUrl")?t.otpUrl:t.otpSecret,e.login.uris=this.makeUriArray(t.url),this.importUnmappedFields(e,t,re)}parsePaymentRecord(e,t){e.type=f.gC.Card,e.card=new M.G,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=M.G.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=f.gC.Identity,e.identity=new ne.O;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=f.gC.SecureNote,e.secureNote.type=f.ak.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,se)}parseSecureNoteRecords(e,t){e.type=f.gC.SecureNote,e.secureNote.type=f.ak.Generic,e.name=t.title,e.notes=t.note,this.importUnmappedFields(e,t,oe)}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i])})}}const le=new Set(["ADDRESS","AUTHENTIFIANT","BANKSTATEMENT","IDCARD","IDENTITY","PAYMENTMEANS_CREDITCARD","PAYMENTMEAN_PAYPAL","EMAIL"]);class ce extends F{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)&&!le.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 E.f;t.identity=new ne.O,t.type=f.gC.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 E.f;t.identity=new ne.O,t.type=f.gC.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 E.f;t.card=new M.G,t.type=f.gC.Card,t.name=this.getValueOrDefault(e.bank),t.card.number=this.getValueOrDefault(e.cardNumber),t.card.brand=M.G.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 E.f;n.secureNote=new T.Z,n.type=f.gC.SecureNote,n.secureNote.type=f.ak.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 de extends F{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 r=e["Entry Type"];if("Password"===r)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"===r){i.type=f.gC.Card,i.card=new M.G,i.card.cardholderName=this.getValueOrDefault(e["Name on card"]),i.card.number=this.getValueOrDefault(e["Card Number"]),i.card.brand=M.G.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 ue extends F{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=f.gC.SecureNote,i.secureNote=new T.Z,i.secureNote.type=f.ak.Generic),this.containsField(e,"cardholder")&&this.containsField(e,"number")&&this.containsField(e,"expiry date")&&(i.type=f.gC.Card,i.card=new M.G),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 r=e[t+1],s=r.toLowerCase();if(i.type===f.gC.Login){if("url"===s&&(null==i.login.uris||0===i.login.uris.length)){i.login.uris=this.makeUriArray(n);continue}if(("username"===s||"email"===s)&&this.isNullOrWhitespace(i.login.username)){i.login.username=n;continue}if("password"===s&&this.isNullOrWhitespace(i.login.password)){i.login.password=n;continue}if("totp"===s&&this.isNullOrWhitespace(i.login.totp)){i.login.totp=n;continue}}else if(i.type===f.gC.Card){if("cardholder"===s&&this.isNullOrWhitespace(i.card.cardholderName)){i.card.cardholderName=n;continue}if("number"===s&&this.isNullOrWhitespace(i.card.number)){i.card.number=n,i.card.brand=M.G.getCardBrandByPatterns(i.card.number);continue}if("cvc"===s&&this.isNullOrWhitespace(i.card.code)){i.card.code=n;continue}if("expiry date"===s&&this.isNullOrWhitespace(i.card.expMonth)&&this.isNullOrWhitespace(i.card.expYear)){if(this.setCardExpiration(i,n))continue}else if("type"===s)continue}this.processKvp(i,r,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 he=new RegExp("androidapp://.*==@","g");class Ae extends F{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,r=new Map,s=this.buildFolderTree(i.folders);return this.flattenFolderTree(null,s,n),n.forEach((e,i)=>{r.set(i,t.folders.length);const n=new C.u;n.name=e,t.folders.push(n)}),i.items.forEach(e=>{null!=e.folders&&e.folders.length>0&&r.has(e.folders[0])&&t.folderRelationships.push([t.ciphers.length,r.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));const n=this.getValueOrDefault(e.note,"");n&&(i.notes=n.trimEnd()),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(he,"androidapp://"),i.push(e)}else this.processKvp(e,t.label,t.value,1===t.sensitive?f.PU.Hidden:f.PU.Text);else e.login.username=t.value}),e.login.uris=this.makeUriArray(i)}processCard(e,t){e.card=new M.G,e.type=f.gC.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=M.G.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?f.PU.Hidden:f.PU.Text))})}processNote(e,t){t.forEach(t=>{this.isNullOrWhitespace(t.value)||"section"===t.type||this.processKvp(e,t.label,t.value,1===t.sensitive?f.PU.Hidden:f.PU.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 pe extends F{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))}}const ge=Object.freeze({Login:1,CreditCard:2});class ve extends F{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]of Object.entries(i.data)){const e=this.parseEntry(n);null!=e&&t.ciphers.push(e)}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 ge.Login:this.handleLoginEntry(e,t);break;case ge.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=f.gC.Card,t.card=new M.G,t.card.cardholderName=this.getValueOrDefault(e.username),t.card.number=this.getValueOrDefault(e.creditNumber),t.card.brand=M.G.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 fe extends F{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 me="Notes\n\n",ye="Applications\n\n",Ce="Websites\n\n",we="\n---\n";class Ie extends F{parse(e){const t=new w;let i,n,r,s=this.splitNewLine(e).join("\n");if(-1!==s.indexOf(me)){const e=s.split(me);e.length>1&&(s=e[0],i=e[1])}if(-1!==s.indexOf(ye)){const e=s.split(ye);e.length>1&&(s=e[0],n=e[1])}if(0===s.indexOf(Ce)){const e=s.split(Ce);e.length>1&&(s=e[0],r=e[1])}const o=this.parseDataCategory(i),a=this.parseDataCategory(n),l=this.parseDataCategory(r);return o.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(we))return[];const t=[];return e.split(we).forEach(e=>{if(-1===e.indexOf("\n"))return;const i=new Map;let n,r;e.split("\n").forEach(e=>{if(null!=n)return void(n+="\n"+e);const t=e.indexOf(":");let s,o;-1!==t&&(s=e.substring(0,t),e.length>t+1&&(o=e.substring(t+2)),null!=s&&i.set(s,o),"Comment"!==s&&"Text"!==s||(n=o,r=s))}),null!=n&&null!=r&&i.set(r,n),0!==i.size&&t.push(i)}),t}}class be extends F{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 r=n.querySelector("Group");return null==r?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,Promise.resolve(this.result)):(this.traverse(r,!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 r=i;if(!t){""!==r&&(r+="/");const t=this.querySelectorDirectChild(e,"Name");r+=null==t?"-":t.textContent;const i=new C.u;i.name=r,this.result.folders.push(i)}this.querySelectorAllDirectChild(e,"Entry").forEach(e=>{const i=this.result.ciphers.length,r=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"),s=null!=n?n.textContent:null;if("URL"===s)r.login.uris=this.makeUriArray(i);else if("UserName"===s)r.login.username=i;else if("Password"===s)r.login.password=i;else if("otp"===s)r.login.totp=i.replace("key=","");else if("Title"===s)r.name=i;else if("Notes"===s)r.notes+=i+"\n";else{const e=t.attributes;if(e.length>0&&null!=e.ProtectInMemory&&"True"===e.ProtectInMemory.value){null==r.fields&&(r.fields=[]);const e=new S.g;e.type=f.PU.Hidden,e.name=s,e.value=i,r.fields.push(e)}else this.processKvp(r,s,i,f.PU.Text)}}),this.cleanupCipher(r),this.result.ciphers.push(r),t||this.result.folderRelationships.push([i,n])}),this.querySelectorAllDirectChild(e,"Group").forEach(e=>{this.traverse(e,!1,r)})}}class Be extends F{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),n.login.totp=this.getValueOrDefault(e.TOTP),this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class Ee extends F{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.trimEnd()),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 Se extends F{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,r=e.grouping;null!=r&&(r=r.replace(/\\/g,"/").replace(/[\x00-\x1F\x7F-\x9F]/g,""));const s="(none)"!==this.getValueOrDefault(r,"(none)");let o=s;if(s)for(let l=0;l<t.folders.length;l++)if(t.folders[l].name===r){o=!1,n=l;break}const a=this.buildBaseCipher(e);if(a.type===f.gC.Login)a.notes=this.getValueOrDefault(e.extra),a.login=new k.r,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===f.gC.SecureNote)this.parseSecureNote(e,a);else if(a.type===f.gC.Card)a.card=this.parseCard(e),a.notes=this.getValueOrDefault(e.notes);else if(a.type===f.gC.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=f.gC.Card,i.card=this.parseCard(e),t.ciphers.push(i)}if(t.ciphers.push(a),o){const e=new C.u;e.name=r,t.folders.push(e)}s&&t.folderRelationships.push([i,n])}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}buildBaseCipher(e){const t=new E.f;return e.hasOwnProperty("profilename")&&e.hasOwnProperty("profilelanguage")?(t.favorite=!1,t.name=this.getValueOrDefault(e.profilename,"--"),t.type=f.gC.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=f.gC.Identity)):(t.favorite=!this.organization&&"1"===this.getValueOrDefault(e.fav,"0"),t.name=this.getValueOrDefault(e.name,"--"),t.type="http://sn"===e.url?f.gC.SecureNote:f.gC.Login),t}parseCard(e){const t=new M.G;if(t.cardholderName=this.getValueOrDefault(e.ccname),t.number=this.getValueOrDefault(e.ccnum),t.code=this.getValueOrDefault(e.cccsc),t.brand=M.G.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 ne.O;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=f.gC.Card,t.card=new M.G,Object.assign(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=f.gC.Identity,t.identity=new ne.O,Object.assign(t.identity,e)}n=!0}}n||(t.secureNote=new T.Z,t.secureNote.type=f.ak.Generic,t.notes=this.getValueOrDefault(e.extra))}parseSecureNoteMapping(e,t,i){const n={};let r=!1;return t.forEach(t=>{let s=null,o=null;if(!r){if(this.isNullOrWhitespace(t))return;const e=t.indexOf(":");if(-1===e?s=t:(s=t.substring(0,e),t.length>e&&(o=t.substring(e+1))),this.isNullOrWhitespace(s)||this.isNullOrWhitespace(o)||"NoteType"===s)return}r?e.notes+="\n"+t:"Notes"===s?(this.isNullOrWhitespace(e.notes)?e.notes=o:e.notes+="\n"+o,r=!0):i.hasOwnProperty(s)?n[i[s]]=o:this.processKvp(e,s,o)}),n}}class Qe extends F{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 ke extends F{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 Te extends F{parse(e){const t=new w,i=this.parseCsv(e,!1,{delimiter:","});return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<3)return;const i="Unassigned"!==this.getValueOrDefault(e[2],"Unassigned")?e[2]:null;this.processFolder(t,i);const n=this.initLoginCipher();if(n.name=this.getValueOrDefault(e[0].split("|")[0],"--"),"Web Logins"===e[1]||"Login"===e[1])n.login.username=this.getValueOrDefault(this.splitValueRetainingLastPart(e[5])),n.login.uris=this.makeUriArray(this.splitValueRetainingLastPart(e[4])),n.login.password=this.getValueOrDefault(this.splitValueRetainingLastPart(e[6])),n.notes=this.isNullOrWhitespace(e[3])?null:e[3].split("\\n").join("\n");else if("Credit Card"===e[1]){n.type=f.gC.Card,n.card.number=this.getValueOrDefault(this.splitValueRetainingLastPart(e[4]));const[t,i]=this.getValueOrDefault(this.splitValueRetainingLastPart(e[5])).split("/");n.card.expMonth=t.trim(),n.card.expYear=i.trim();const r=RegExp("^Security Code\\|\\d*\\|"),s=e.find(e=>r.test(e));n.card.code=this.getValueOrDefault(this.splitValueRetainingLastPart(s));const o=RegExp("^Name on Card\\|\\d*\\|"),a=e.find(e=>e.match(o));n.card.cardholderName=this.getValueOrDefault(this.splitValueRetainingLastPart(a)),n.card.brand=this.getValueOrDefault(this.splitValueRetainingLastPart(e[9]),"");const l=RegExp("\\|\\d*\\|"),c=e.slice(2).filter(e=>!this.isNullOrWhitespace(e)&&!l.test(e)),d=[8,10,11].filter(t=>e[t]&&l.test(e[t])).map(t=>e[t]).map(e=>`${e.split("|")[0]}: ${this.getValueOrDefault(this.splitValueRetainingLastPart(e),"")}`);n.notes=[...c,...d].join("\n")}else if(e.length>3){n.type=f.gC.SecureNote,n.secureNote=new T.Z,n.secureNote.type=f.ak.Generic;for(let t=3;t<e.length;t++)this.isNullOrWhitespace(e[t])||(n.notes+=e[t]+"\n")}this.isNullOrWhitespace(e[1])||n.type===f.gC.Login||n.type===f.gC.Card||(n.name=e[1]+": "+n.name),this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}splitValueRetainingLastPart(e){return e&&e.split("|").slice(0,2).concat(e.split("|").slice(2).join("|")).pop()}}const Fe=["nickname","additionalInfo"],Pe=new Set(Fe.concat(["url","username","password","twofaSecret"])),Re=new Set(Fe.concat(["cardNumber","cardName","exp_month","exp_year","cvv"])),De=new Set(Fe.concat(["title","firstName","middleName","lastName","email","firstAddressLine","secondAddressLine","city","country","zipCode"])),Me=new Set(Fe.concat(["idName","idNumber","idCountry"])),xe=new Set(Fe.concat(["authToken"])),Oe=new Set(Fe.concat(["content"]));class Ge extends F{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,"").trimEnd(),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,Pe);else if(void 0!==e.authToken)i.login.totp=this.getValueOrDefault(e.authToken),this.importUnmappedFields(i,e,xe);else if(void 0!==e.cardNumber)i.card=new M.G,i.type=f.gC.Card,i.card.cardholderName=this.getValueOrDefault(e.cardName),i.card.number=this.getValueOrDefault(e.cardNumber),i.card.brand=M.G.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,Re);else if(void 0!==e.firstName)i.identity=new ne.O,i.type=f.gC.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,De);else if(void 0!==e.idType){switch(i.identity=new ne.O,i.type=f.gC.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,Me)}else{if(void 0===e.content)return;i.secureNote=new T.Z,i.type=f.gC.SecureNote,i.secureNote.type=f.ak.Generic,i.notes=this.getValueOrDefault(e.content,"").trimEnd(),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])})}}const Ue=new Set(["Organisationseinheit","Informationen","Beschreibung","Benutzername","Passwort","Internetseite","One-Time Passwort"]);class Ve extends F{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,e.Organisationseinheit);const i=this.initLoginCipher(),n=this.getValueOrDefault(e.Informationen);n&&(i.notes=n.trimEnd()),i.name=this.getValueOrDefault(e.Beschreibung,"--"),i.login.username=this.getValueOrDefault(e.Benutzername),i.login.password=this.getValueOrDefault(e.Passwort),i.login.uris=this.makeUriArray(e.Internetseite),i.login.totp=this.getValueOrDefault(e["One-Time Passwort"]),this.importUnmappedFields(i,e,Ue),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),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 je extends F{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.processFolder(t,e.folder);const n=new E.f;if(n.name=this.getValueOrDefault(e.name,"--"),n.notes=this.getValueOrDefault(e.note),e.custom_fields){const t=JSON.parse(e.custom_fields);t&&t.length>0&&t.forEach(e=>{let t=f.PU.Text;"hidden"==e.type&&(t=f.PU.Hidden),this.processKvp(n,e.label,e.value,t)})}switch(i){case f.gC.Login:if(n.type=f.gC.Login,n.login=new k.r,n.login.username=this.getValueOrDefault(e.username),n.login.password=this.getValueOrDefault(e.password),e.additional_urls){const t=JSON.parse(e.additional_urls),i=[e.url,...t];n.login.uris=this.makeUriArray(i)}else n.login.uris=this.makeUriArray(e.url);break;case f.gC.Card:n.type=f.gC.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=M.G.getCardBrandByPatterns(n.card.number),this.setCardExpiration(n,e.expirydate);break;case f.gC.Identity:n.type=f.gC.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 f.gC.SecureNote:n.type=f.gC.SecureNote,n.secureNote.type=f.ak.Generic}this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}evaluateType(e){switch(e.type){case"password":return f.gC.Login;case"credit_card":return f.gC.Card;case"note":return f.gC.SecureNote;case"identity":return f.gC.Identity}}}var Ne=i(12022);class ze extends F{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=f.gC.Identity,t.identity=new ne.O):(t.type=f.gC.Card,t.card=new M.G),t.type!==f.gC.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=f.gC.SecureNote,t.secureNote=new T.Z,t.secureNote.type=f.ak.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=f.gC.Card,t.card=new M.G):"identities.Identity"===e.typeName?(t.type=f.gC.Identity,t.identity=new ne.O):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===f.gC.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 Ne.j;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t})}parseFields(e,t,i,n,r){e.forEach(e=>{if(null==e[n]||""===e[n].toString().trim())return;const s="date"===e.k?new Date(1e3*e[n]).toUTCString():e[n].toString(),o=null!=e[i]?e[i].toString():null;if(t.type===f.gC.Login){if(this.isNullOrWhitespace(t.login.username)&&"username"===o)return void(t.login.username=s);if(this.isNullOrWhitespace(t.login.password)&&"password"===o)return void(t.login.password=s);if(this.isNullOrWhitespace(t.login.totp)&&null!=o&&o.startsWith("TOTP_"))return void(t.login.totp=s)}else if(t.type===f.gC.Card){if(this.isNullOrWhitespace(t.card.number)&&"ccnum"===o)return t.card.number=s,void(t.card.brand=M.G.getCardBrandByPatterns(t.card.number));if(this.isNullOrWhitespace(t.card.code)&&"cvv"===o)return void(t.card.code=s);if(this.isNullOrWhitespace(t.card.cardholderName)&&"cardholder"===o)return void(t.card.cardholderName=s);if(this.isNullOrWhitespace(t.card.expiration)&&"expiry"===o&&6===s.length)return t.card.expMonth=s.substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),void(t.card.expYear=s.substr(0,4));if("type"===o)return}else if(t.type===f.gC.Identity){const i=t.identity;if(this.isNullOrWhitespace(i.firstName)&&"firstname"===o)return void(i.firstName=s);if(this.isNullOrWhitespace(i.lastName)&&"lastname"===o)return void(i.lastName=s);if(this.isNullOrWhitespace(i.middleName)&&"initial"===o)return void(i.middleName=s);if(this.isNullOrWhitespace(i.phone)&&"defphone"===o)return void(i.phone=s);if(this.isNullOrWhitespace(i.company)&&"company"===o)return void(i.company=s);if(this.isNullOrWhitespace(i.email)&&"email"===o)return void(i.email=s);if(this.isNullOrWhitespace(i.username)&&"username"===o)return void(i.username=s);if("address"===o){const{street:t,city:r,country:s,zip:o}=e[n];return i.address1=this.getValueOrDefault(t),i.city=this.getValueOrDefault(r),this.isNullOrWhitespace(s)||(i.country=s.toUpperCase()),void(i.postalCode=this.getValueOrDefault(o))}}const a=this.isNullOrWhitespace(e[r])?"no_name":e[r];if("password"===a&&null!=t.passwordHistory&&t.passwordHistory.some(e=>e.password===s))return;const l="concealed"===e.k?f.PU.Hidden:f.PU.Text;this.processKvp(t,a,s,l)})}}var Ye=i(72142),Le=i(82781);const Ke=Object.freeze({Login:"001",CreditCard:"002",SecureNote:"003",Identity:"004",Password:"005",Document:"006",SoftwareLicense:"100",BankAccount:"101",Database:"102",DriversLicense:"103",OutdoorLicense:"104",Membership:"105",Passport:"106",RewardsProgram:"107",SocialSecurityNumber:"108",WirelessRouter:"109",Server:"110",EmailAccount:"111",API_Credential:"112",MedicalRecord:"113",SSH_Key:"114"}),Xe=Object.freeze({TextOrHtml:"T",EmailAddress:"E",URL:"U",Number:"N",Password:"P",TextArea:"A",PhoneNumber:"TEL",CheckBox:"C"});class qe extends F{constructor(){super(...arguments),this.result=new w}parse(e){return JSON.parse(e).accounts[0].vaults.forEach(e=>{e.items.forEach(e=>{if("archived"===e.state)return;const t=this.initLoginCipher(),i=e.categoryUuid;switch(i){case Ke.Login:case Ke.Database:case Ke.Password:case Ke.WirelessRouter:case Ke.Server:case Ke.API_Credential:t.type=f.gC.Login,t.login=new k.r;break;case Ke.CreditCard:case Ke.BankAccount:t.type=f.gC.Card,t.card=new M.G;break;case Ke.SecureNote:case Ke.SoftwareLicense:case Ke.EmailAccount:case Ke.MedicalRecord:t.type=f.gC.SecureNote,t.secureNote=new T.Z,t.secureNote.type=f.ak.Generic;break;case Ke.Identity:case Ke.DriversLicense:case Ke.OutdoorLicense:case Ke.Membership:case Ke.Passport:case Ke.RewardsProgram:case Ke.SocialSecurityNumber:t.type=f.gC.Identity,t.identity=new ne.O;break;case Ke.SSH_Key:t.type=f.gC.SshKey,t.sshKey=new Ye.H}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").trimEnd()),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=f.gC.Login,void(t.login.username=e.value);if("password"===e.designation&&""!==e.value)return t.type=f.gC.Login,void(t.login.password=e.value);let i=e.value,n=f.PU.Text;switch(e.fieldType){case Xe.Password:n=f.PU.Hidden;break;case Xe.CheckBox:i=""!==e.value?"true":"false",n=f.PU.Boolean}this.processKvp(t,e.name,i,n)})}processDetails(e,t,i){e===Ke.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 r=Object.keys(t.value)[0],s=t;if(null==s.value||null==s.value[r]||""===s.value[r])return;const o=this.getFieldName(t.title,n),a=this.extractValue(t.value,r);if(i.type===f.gC.Login){if(this.fillLogin(t,a,i))return;switch(e){case Ke.Login:case Ke.Database:case Ke.EmailAccount:case Ke.WirelessRouter:break;case Ke.Server:if(this.isNullOrWhitespace(i.login.uri)&&"url"===t.id)return void(i.login.uris=this.makeUriArray(a));break;case Ke.API_Credential:if(this.fillApiCredentials(t,a,i))return}}else if(i.type===f.gC.Card){if(this.fillCreditCard(t,a,i))return;if(e===Ke.BankAccount&&this.fillBankAccount(t,a,i))return}else if(i.type===f.gC.Identity){if(this.fillIdentity(t,a,i,r))return;if("address"===r){const{street:e,city:n,country:r,zip:s,state:o}=t.value.address;return i.identity.address1=this.getValueOrDefault(e),i.identity.city=this.getValueOrDefault(n),this.isNullOrWhitespace(r)||(i.identity.country=r.toUpperCase()),i.identity.postalCode=this.getValueOrDefault(s),void(i.identity.state=this.getValueOrDefault(o))}switch(e){case Ke.Identity:break;case Ke.DriversLicense:if(this.fillDriversLicense(t,a,i))return;break;case Ke.OutdoorLicense:if(this.fillOutdoorLicense(t,a,i))return;break;case Ke.Membership:if(this.fillMembership(t,a,i))return;break;case Ke.Passport:if(this.fillPassport(t,a,i))return;break;case Ke.RewardsProgram:if(this.fillRewardsProgram(t,a,i))return;break;case Ke.SocialSecurityNumber:if(this.fillSSN(t,a,i))return}}else if(i.type===f.gC.SshKey&&"sshKey"===r){const{privateKey:e}=t.value.sshKey.metadata,n=(0,Le.import_ssh_key)(e);return i.sshKey.privateKey=n.privateKey,i.sshKey.publicKey=n.publicKey,void(i.sshKey.keyFingerprint=n.fingerprint)}if("email"===r){const{email_address:e,provider:n}=t.value.email;return this.processKvp(i,o,e,f.PU.Text),void this.processKvp(i,"provider",n,f.PU.Text)}if("password"===t.title&&null!=i.passwordHistory&&i.passwordHistory.some(e=>e.password===a))return;t.guarded&&i.reprompt===V.b.None&&(i.reprompt=V.b.Password);const l="concealed"===r?f.PU.Hidden:f.PU.Text;this.processKvp(i,o,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=M.G.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,f.PU.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 Ne.j;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t})}}class He{constructor(e,t,i){this.importRecord=e,this.property=t,this.cipher=i,this.lowerProperty=t.toLowerCase()}}const We=["ainfo","autosubmit","notesplain","ps","scope","tags","title","uuid","notes"];class $e extends F{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 r=new He(e,t,i);i.type===f.gC.Login&&this.setKnownLoginValue(r)||(i.type===f.gC.Card&&this.setKnownCreditCardValue(r)||i.type===f.gC.Identity&&this.setKnownIdentityValue(r)||(n=this.setUnknownValue(r,n)))}i.type===f.gC.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===We.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],f.PU.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=M.G.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 Je extends $e{setCipherType(e,t){switch(this.getValueOrDefault(this.getProp(e,"type"),"Login")){case"Credit Card":t.type=f.gC.Card,t.card=new M.G,We.push("type");break;case"Identity":t.type=f.gC.Identity,t.identity=new ne.O,We.push("type");break;case"Login":case"Secure Note":We.push("type")}}}class Ze extends $e{constructor(){super(),this.identityPropertyParsers.push(this.setIdentityAddress)}setCipherType(e,t){t.type=f.gC.Login,t.login=new k.r,this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: number/i))||this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: expiry date/i))||(t.type=f.gC.Card,t.card=new M.G),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=f.gC.Identity,t.identity=new ne.O)}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 _e extends F{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 r=0;r<t.collections.length;r++)if(t.collections[r].name===e){i=!1,n=r;break}if(i){const i=new d.iY({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 r=n[t].trim().toLowerCase();this.isNullOrWhitespace(e[t])||this.isNullOrWhitespace(r)||(this.usernameFieldNames.indexOf(r)>-1?i.login.username=e[t]:this.passwordFieldNames.indexOf(r)>-1?i.login.password=e[t]:this.uriFieldNames.indexOf(r)>-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 et extends F{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 tt extends F{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 it extends F{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 nt extends F{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 r=0;r<t.collections.length;r++)if(t.collections[r].name===e){i=!1,n=r;break}if(i){const i=new d.iY({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 r=this.initLoginCipher();r.notes=this.getValueOrDefault(e.Notes,""),r.notes+="\n\n"+this.getValueOrDefault(e["Shared Notes"],"")+"\n",r.name=this.getValueOrDefault(e["Entry Name"],"--"),r.login.username=this.getValueOrDefault(e["User ID"]),r.login.password=this.getValueOrDefault(e.Password),r.login.uris=this.makeUriArray(e.URL),null!=e.__parsed_extra&&e.__parsed_extra.length>0&&e.__parsed_extra.forEach(e=>{this.isNullOrWhitespace(e)||(r.notes+="\n"+e)});const s=this.isNullOrWhitespace(e["Extra Fields"])?null:JSON.parse(e["Extra Fields"]),o=null!=s&&null!=s.extraFields&&s.extraFields.length>0?s.extraFields.map(e=>{try{return JSON.parse(e)}catch(t){}return null}):null;null!=o&&o.forEach(e=>{null!=e&&this.processKvp(r,e.name,e.data)}),this.cleanupCipher(r),t.ciphers.push(r)}),t.success=!0,Promise.resolve(t))}}class rt extends F{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],r=this.initLoginCipher();if(r.name=this.getValueOrDefault(e[i?1:0],"--"),r.login.username=this.getValueOrDefault(e[i?2:1]),r.login.password=this.getValueOrDefault(e[i?3:2]),5===e.length)n=!1,r.notes=this.getValueOrDefault(e[4]),r.login.uris=this.makeUriArray(e[3]);else{const n=this.getValueOrDefault(e[i?9:8],"(None)");let s="(None)"!==n?n.split("\\").join("/"):null;null!=s&&(s=n.split(" > ").join("/"),s=n.split(">").join("/")),this.processFolder(t,s),r.notes=this.getValueOrDefault(e[i?5:3]),r.login.uris=this.makeUriArray(e[4])}this.convertToNoteIfNeeded(r),this.cleanupCipher(r),t.ciphers.push(r)}),n&&this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class st extends F{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 r=new Map;return n.forEach((e,i)=>{r.set(i,t.folders.length);const n=new C.u;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&&r.has(e.folder)&&t.folderRelationships.push([t.ciphers.length,r.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 M.G,i.type=f.gC.Card);for(const t in e.identifiers){if(!e.identifiers.hasOwnProperty(t))continue;const r=e.identifiers[t],s=null!=r?r.toString():null;if(!this.isNullOrWhitespace(s)&&"notes"!==t&&"ignoreItemInSecurityScore"!==t)if("custom_fields"!==t){if(i.type===f.gC.Card){if("cardNumber"===t){i.card.number=s,i.card.brand=M.G.getCardBrandByPatterns(i.card.number);continue}if("nameOnCard"===t){i.card.cardholderName=s;continue}if("security_code"===t){i.card.code=s;continue}if("expires"===t){try{const e=new Date(s);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=s;continue}if("password"===t){i.login.password=s;continue}if("totp"===t){i.login.totp=s;continue}if((null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(t)>-1){i.login.uris=this.makeUriArray(s);continue}}this.processKvp(i,t,s)}else r.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)}}const ot=Object.freeze({Password:"0",CreditCard:"1",SoftwareLicense:"2",Identity:"3",Information:"4",Banking:"5",EncryptedFile:"6",Document:"7",RDP:"8",Putty:"9",TeamViewer:"10",Certificate:"11"}),at=Object.freeze({Password:"1",Memo:"2",Date:"3",Number:"4",Boolean:"5",Decimal:"6",Email:"7",URL:"8"});class lt extends F{constructor(){super(...arguments),this.result=new w,this._favouritesLookupTable=new Set}parse(e){const t=this.parseXml(e);if(null==t)return this.result.success=!1,Promise.resolve(this.result);const i=t.querySelector("passwordfile");if(null==i)return this.result.errorMessage="Missing `passwordfile` node.",this.result.success=!1,Promise.resolve(this.result);const n=this.querySelectorDirectChild(i,"header");if(null==n)return this.result.success=!1,Promise.resolve(this.result);let r=this.querySelectorDirectChild(n,"version");if(null==r&&(r=this.querySelectorDirectChild(n,"dataformat"),null==r))return this.result.success=!1,Promise.resolve(this.result);if(!r.textContent.startsWith("17"))return this.result.errorMessage="Unsupported export version detected - (only 17.0 is supported)",this.result.success=!1,Promise.resolve(this.result);const s=this.querySelectorDirectChild(n,"encrypted");if(null!=s&&"True"==s.textContent)return this.result.errorMessage="Encrypted Password Depot files are not supported.",this.result.success=!1,Promise.resolve(this.result);const o=i.querySelector("passwords");return null==o?(this.result.errorMessage="Missing `passwordfile > passwords` node.",this.result.success=!1,Promise.resolve(this.result)):(this.buildFavouritesLookupTable(i),this.querySelectorAllDirectChild(o,"group").forEach(e=>{this.traverse(e,"")}),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result))}traverse(e,t){const i=this.result.folders.length;let n=t;""!==n&&(n+="/");const r=e.attributes.getNamedItem("fingerprint");if(""!=(null==r?void 0:r.textContent)&&"null"!=r.textContent){const t=e.attributes.getNamedItem("name");n+=null==t?"-":t.textContent;const i=new C.u;i.name=n,this.result.folders.push(i)}this.querySelectorAllDirectChild(e,"item").forEach(e=>{const t=this.result.ciphers.length,r=this.initLoginCipher();let s=ot.Password;const o=e.children;for(let i=0;i<o.length;i++){const e=o[i];if("hitems"!==e.tagName)if("description"!==e.tagName)if("comment"!==e.tagName)if("type"!==e.tagName)(s!==ot.Password&&s!==ot.RDP&&s!==ot.Putty&&s!==ot.TeamViewer&&s!==ot.Banking&&s!==ot.Certificate&&s!==ot.EncryptedFile||!this.parseLoginFields(e,r))&&("fingerprint"===e.tagName&&this._favouritesLookupTable.has(e.textContent)&&(r.favorite=!0),"customfields"!==e.tagName?s!==ot.Banking||"tans"!==e.tagName?this.processKvp(r,e.tagName,e.textContent,f.PU.Text):this.querySelectorAllDirectChild(e,"tan").forEach(e=>{this.parseBankingTANs(e,r)}):this.parseCustomFields(e,s,r));else switch(s=e.textContent,s){case ot.Password:case ot.RDP:case ot.Putty:case ot.TeamViewer:case ot.Banking:case ot.Certificate:case ot.EncryptedFile:r.type=f.gC.Login,r.login=new k.r;break;case ot.CreditCard:r.type=f.gC.Card,r.card=new M.G;break;case ot.SoftwareLicense:case ot.Information:case ot.Document:r.type=f.gC.SecureNote,r.secureNote=new T.Z,r.secureNote.type=f.ak.Generic;break;case ot.Identity:r.type=f.gC.Identity,r.identity=new ne.O}else r.notes=e.textContent;else r.name=e.textContent}this.cleanupCipher(r),this.result.ciphers.push(r),""!==n&&this.result.folderRelationships.push([t,i])}),this.querySelectorAllDirectChild(e,"group").forEach(e=>{this.traverse(e,n)})}parseCustomFields(e,t,i){this.querySelectorAllDirectChild(e,"field").forEach(e=>{const n=this.parseCustomField(e);if(null!=n){switch(t){case ot.CreditCard:if(this.parseCreditCardCustomFields(n,i))return;break;case ot.Identity:if(this.parseIdentityCustomFields(n,i))return;break;case ot.Information:if(this.parseInformationCustomFields(n,i))return}this.processKvp(i,n.name,n.value,n.type)}})}parseLoginFields(e,t){return"username"===e.tagName?(t.login.username=e.textContent,!0):"password"===e.tagName?(t.login.password=e.textContent,!0):"url"===e.tagName&&(t.login.uris=this.makeUriArray(e.textContent),!0)}parseCustomField(e){let t,i,n,r=at.Memo;if(e.hasAttributes()){if(t=e.getAttribute("name"),null==t)return null;i=e.getAttribute("value");const s=e.getAttribute("type");r=null!=s?s:at.Memo,n=e.getAttribute("visible")}else{const s=this.querySelectorDirectChild(e,"name");if(t=null!=s?s.textContent:null,null==t)return null;const o=this.querySelectorDirectChild(e,"value");i=null!=o?o.textContent:null;const a=this.querySelectorDirectChild(e,"type");r=null!=a?a.textContent:at.Memo;const l=this.querySelectorDirectChild(e,"visible");n=null!=l?l.textContent:null}if(r===at.Date&&!isNaN(i)){const e=parseInt(i);i=new Date((e-25569)*(1e3*86400)).toLocaleDateString()}return r===at.Password?{name:t,value:i,type:f.PU.Hidden,linkedId:null}:r===at.Boolean?{name:t,value:i,type:f.PU.Boolean,linkedId:null}:"0"==n?{name:t,value:i,type:f.PU.Hidden,linkedId:null}:{name:t,value:i,type:f.PU.Text,linkedId:null}}parseCreditCardCustomFields(e,t){return"IDS_CardHolder"===e.name?(t.card.cardholderName=e.value,!0):"IDS_CardNumber"===e.name?(t.card.number=e.value,t.card.brand=M.G.getCardBrandByPatterns(t.card.number),!0):"IDS_CardExpires"===e.name?(this.setCardExpiration(t,e.value),!0):"IDS_CardCode"===e.name&&(t.card.code=e.value,!0)}parseIdentityCustomFields(e,t){return"IDS_IdentityName"===e.name?(this.processFullName(t,e.value),!0):"IDS_IdentityEmail"===e.name?(t.identity.email=e.value,!0):"IDS_IdentityFirstName"===e.name?(t.identity.firstName=e.value,!0):"IDS_IdentityLastName"===e.name?(t.identity.lastName=e.value,!0):"IDS_IdentityCompany"===e.name?(t.identity.company=e.value,!0):"IDS_IdentityAddress1"===e.name?(t.identity.address1=e.value,!0):"IDS_IdentityAddress2"===e.name?(t.identity.address2=e.value,!0):"IDS_IdentityCity"===e.name?(t.identity.city=e.value,!0):"IDS_IdentityState"===e.name?(t.identity.state=e.value,!0):"IDS_IdentityZIP"===e.name?(t.identity.postalCode=e.value,!0):"IDS_IdentityCountry"===e.name?(t.identity.country=e.value,!0):"IDS_IdentityPhone"===e.name&&(t.identity.phone=e.value,!0)}parseInformationCustomFields(e,t){return"IDS_InformationText"===e.name&&(t.notes=e.value,!0)}parseBankingTANs(e,t){let i="0";const n=e.children;for(let r=0;r<n.length;r++){const e=n[r];"number"!==e.tagName?this.processKvp(t,`tan_${i}_${e.tagName}`,e.textContent):i=e.textContent}}buildFavouritesLookupTable(e){const t=this.querySelectorDirectChild(e,"favorites");if(null==t)return;const i=atob(t.textContent);i.indexOf("\r\n")>0?i.split("\r\n").forEach(e=>{this._favouritesLookupTable.add(e)}):i.split("\n").forEach(e=>{this._favouritesLookupTable.add(e)})}}class ct extends F{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 r=this.querySelectorDirectChild(e,"Account-Name"),s=this.querySelectorDirectChild(e,"User-Id"),o=this.querySelectorDirectChild(e,"Password"),a=this.querySelectorDirectChild(e,"URL"),l=this.querySelectorDirectChild(e,"Notes"),c=this.initLoginCipher();c.name=null!=r?this.getValueOrDefault(r.textContent,"--"):"--",c.notes=null!=l?this.getValueOrDefault(l.textContent):"",c.login.username=null!=s?this.getValueOrDefault(s.textContent):null,c.login.password=null!=o?this.getValueOrDefault(o.textContent):null,c.login.uris=null!=a?this.makeUriArray(a.textContent):null;const d=[];for(let t=1;t<=10;t++)d.push("Attribute-"+t);this.querySelectorAllDirectChild(e,d.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 dt extends F{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 r=n.getAttribute("delimiter"),s=i.querySelectorAll("passwordsafe > entry");return Array.from(s).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 s=this.querySelectorDirectChild(e,"title"),o=this.querySelectorDirectChild(e,"username"),a=this.querySelectorDirectChild(e,"email"),l=this.querySelectorDirectChild(e,"password"),c=this.querySelectorDirectChild(e,"url"),d=this.querySelectorDirectChild(e,"notes"),u=this.initLoginCipher();u.name=null!=s?this.getValueOrDefault(s.textContent,"--"):"--",u.notes=null!=d?this.getValueOrDefault(d.textContent,"").split(r).join("\n"):null,u.login.username=null!=o?this.getValueOrDefault(o.textContent):null,u.login.password=null!=l?this.getValueOrDefault(l.textContent):null,u.login.uris=null!=c?this.makeUriArray(c.textContent):null,this.isNullOrWhitespace(u.login.username)&&null!=a?u.login.username=this.getValueOrDefault(a.textContent):null==a||this.isNullOrWhitespace(a.textContent)||(u.notes=this.isNullOrWhitespace(u.notes)?"Email: "+a.textContent:u.notes+"\nEmail: "+a.textContent),this.cleanupCipher(u),t.ciphers.push(u)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class ut extends F{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))}}const ht={Titel:"Title",Gebruikersnaam:"Username",Wachtwoord:"Password",Gewijzigd:"Modified",Gemaakt:"Created","Verloopt op":"Expire on",Beschrijving:"Description","Gewijzigd door":"Modified by"},At={Titel:"Title",Benutzername:"Username",Konto:"Account",Passwort:"Password","Geändert am":"Modified","Erstellt am":"Created","Läuft ab am":"Expire on",Beschreibung:"Description","Geändert von":"Modified by"},pt=new Set(["Title","Username","URL","Password","Description"]);function gt(e){return Object.assign(Object.assign({"User name":"Username"},At),ht)[e]||e}class vt extends F{parse(e){const t=new w,i=this.parseCsv(e,!0,{skipEmptyLines:!0,transformHeader:gt});if(null==i)return t.success=!1,Promise.resolve(t);if(!i[0].Title)return t.success=!1,Promise.resolve(t);let n="";return i.forEach(e=>{if(">>>"==e.Title)return;const i=e.Title;if(i.startsWith("[")&&i.endsWith("]"))return void(n=i.startsWith("/")?i.replace("/",""):i.substring(1,i.length-1));v.A.isNullOrWhitespace(n)||this.processFolder(t,n);const r=this.initLoginCipher();r.name=this.getValueOrDefault(e.Title),r.login.username=this.getValueOrDefault(e.Username),r.notes=this.getValueOrDefault(e.Description),r.login.uris=this.makeUriArray(e.URL),r.login.password=this.getValueOrDefault(e.Password),this.importUnmappedFields(r,e,pt),this.convertToNoteIfNeeded(r),this.cleanupCipher(r),t.ciphers.push(r)}),this.organization&&this.moveFoldersToCollections(t),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])})}}function ft(e,t,i,n){let r=t,s=i,o=n;if(e){const a=e.trim().split(/\s+/);r=a[0]||t,o=a.length>1?a[a.length-1]:n,s=a.length>2?a.slice(1,-1).join(" "):i}return{mappedFirstName:r,mappedMiddleName:s,mappedLastName:o}}const mt=Object.freeze({ACTIVE:1,TRASHED:2});class yt extends F{constructor(e){super(),this.i18nService=e,this.mappedIdentityItemKeys=["fullName","firstName","middleName","lastName","email","phoneNumber","company","socialSecurityNumber","passportNumber","licenseNumber","organization","streetAddress","floor","county","city","stateOrProvince","zipOrPostalCode","countryOrRegion"],this.identityItemExtraFieldsKeys=["extraPersonalDetails","extraAddressDetails","extraContactDetails","extraWorkDetails","extraSections"]}processIdentityItemUnmappedAndExtraFields(e,t){Object.keys(t).forEach(i=>{if(this.mappedIdentityItemKeys.includes(i)||this.identityItemExtraFieldsKeys.includes(i)){if(this.identityItemExtraFieldsKeys.includes(i))if("extraSections"!==i){const n=t[i];null==n||n.forEach(t=>{this.processKvp(e,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text)})}else{const n=t[i];null==n||n.forEach(t=>{var i;null===(i=t.sectionFields)||void 0===i||i.forEach(t=>{this.processKvp(e,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text)})})}}else this.processKvp(e,i,t[i])})}parse(e){var t,i;const n=new w,r=JSON.parse(e);if(null==r||null==r.vaults)return n.success=!1,Promise.resolve(n);if(r.encrypted)return n.success=!1,n.errorMessage=this.i18nService.t("unsupportedEncryptedImport"),Promise.resolve(n);for(const[,s]of Object.entries(r.vaults))for(const e of s.items){if(e.state==mt.TRASHED)continue;const r=this.initLoginCipher();switch(r.name=this.getValueOrDefault(e.data.metadata.name,"--"),r.notes=this.getValueOrDefault(e.data.metadata.note),r.favorite=e.pinned,e.data.type){case"login":{const t=e.data.content;r.login.uris=this.makeUriArray(t.urls),r.login.username=this.getValueOrDefault(t.itemUsername),null==r.login.username?r.login.username=this.getValueOrDefault(t.itemEmail):this.processKvp(r,"email",t.itemEmail),r.login.password=this.getValueOrDefault(t.password),r.login.totp=this.getValueOrDefault(t.totpUri);for(const i of e.data.extraFields)this.processKvp(r,i.fieldName,"totp"==i.type?i.data.totpUri:i.data.content,"text"==i.type?f.PU.Text:f.PU.Hidden);break}case"note":r.type=f.gC.SecureNote,r.secureNote=new T.Z,r.secureNote.type=f.ak.Generic;break;case"creditCard":{const t=e.data.content;r.type=f.gC.Card,r.card=new M.G,r.card.cardholderName=this.getValueOrDefault(t.cardholderName),r.card.number=this.getValueOrDefault(t.number),r.card.brand=M.G.getCardBrandByPatterns(t.number),r.card.code=this.getValueOrDefault(t.verificationNumber),this.isNullOrWhitespace(t.expirationDate)||(r.card.expMonth=t.expirationDate.substring(5,7),r.card.expMonth=r.card.expMonth.replace(/^0+/,""),r.card.expYear=t.expirationDate.substring(0,4)),this.isNullOrWhitespace(t.pin)||this.processKvp(r,"PIN",t.pin,f.PU.Hidden);break}case"identity":{const n=e.data.content;r.type=f.gC.Identity,r.identity=new ne.O;const{mappedFirstName:s,mappedMiddleName:o,mappedLastName:a}=ft(this.getValueOrDefault(n.fullName),this.getValueOrDefault(n.firstName),this.getValueOrDefault(n.middleName),this.getValueOrDefault(n.lastName));r.identity.firstName=s,r.identity.middleName=o,r.identity.lastName=a,r.identity.email=this.getValueOrDefault(n.email),r.identity.phone=this.getValueOrDefault(n.phoneNumber),r.identity.company=this.getValueOrDefault(n.company),r.identity.ssn=this.getValueOrDefault(n.socialSecurityNumber),r.identity.passportNumber=this.getValueOrDefault(n.passportNumber),r.identity.licenseNumber=this.getValueOrDefault(n.licenseNumber);const l=`${null!==(t=n.floor)&&void 0!==t?t:""} ${null!==(i=n.county)&&void 0!==i?i:""}`.trim();r.identity.address1=this.getValueOrDefault(n.organization),r.identity.address2=this.getValueOrDefault(n.streetAddress),r.identity.address3=this.getValueOrDefault(l),r.identity.city=this.getValueOrDefault(n.city),r.identity.state=this.getValueOrDefault(n.stateOrProvince),r.identity.postalCode=this.getValueOrDefault(n.zipOrPostalCode),r.identity.country=this.getValueOrDefault(n.countryOrRegion),this.processIdentityItemUnmappedAndExtraFields(r,n);for(const t of e.data.extraFields)this.processKvp(r,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text);break}default:continue}this.processFolder(n,s.name),this.cleanupCipher(r),n.ciphers.push(r)}return this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)}}class Ct extends F{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,r=null!=t.folders&&t.folders.length>0;(n||r)&&(v.A.isNullOrWhitespace(i)||(t.name=i+"/"+t.name),r&&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(),f.PU.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=f.gC.SecureNote,t.secureNote=new T.Z,t.secureNote.type=f.ak.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=f.gC.SecureNote,t.secureNote=new T.Z,t.secureNote.type=f.ak.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=f.gC.SecureNote,t.secureNote=new T.Z,t.secureNote.type=f.ak.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,f.PU.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 wt extends F{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=f.gC.Card,i.card=new M.G,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=M.G.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(r){}const t=this.getValueOrDefault(e.pin);null!=t&&this.processKvp(i,"PIN",t);const s=this.getValueOrDefault(e.zipCode);null!=s&&this.processKvp(i,"Zip Code",s)}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class It extends F{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=>{var r,s;const o=!this.isNullOrWhitespace(e.Folder)&&e.Folder.startsWith("/")?e.Folder.replace("/",""):e.Folder,a=this.isNullOrWhitespace(o)?null:o;this.processFolder(t,a);const l=this.initLoginCipher();l.notes=this.getValueOrDefault(e.Note),l.name=this.getValueOrDefault(e.Name,"--"),l.login.username=this.getValueOrDefault(e.Login),l.login.password=null!==(r=this.getValueOrDefault(e.Pwd))&&void 0!==r?r:this.getValueOrDefault(e.Password),l.login.uris=null!==(s=this.makeUriArray(e.Url))&&void 0!==s?s:this.makeUriArray(e.URL),this.isNullOrWhitespace(e.Rf_fields)?this.isNullOrWhitespace(e.RfFieldsV2)||this.parseRfFieldsV2(l,e):this.parseRfFields(l,e),this.convertToNoteIfNeeded(l),this.cleanupCipher(l),n===i.length&&"--"===l.name&&this.isNullOrWhitespace(l.login.password)||(t.ciphers.push(l),n++)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}parseRfFields(e,t){let i=[t.Rf_fields];null!=t.__parsed_extra&&t.__parsed_extra.length>0&&(i=i.concat(t.__parsed_extra)),i.forEach(t=>{const i=t.split(":");if(i.length<3)return;const n="-no-name-"===i[0]?null:i[0],r=4===i.length&&"rck"===i[2]?i[1]:i[2];this.processKvp(e,n,r)})}parseRfFieldsV2(e,t){let i=[t.RfFieldsV2];null!=t.__parsed_extra&&t.__parsed_extra.length>0&&(i=i.concat(t.__parsed_extra));let n=1,r=1;i.forEach(t=>{const i=t.split(",");if(i.length<5)return;const s="-no-name-"===i[0]?null:i[0],o="pwd"===i[3]?f.PU.Hidden:f.PU.Text,a=i[4];if("TOTP KEY$"===s)return void(e.login.totp=a);if("User ID$"===s&&a===e.login.username)return;if("Password$"===s&&a===e.login.password)return;let l=s;"User ID$"===s?l="Alternate User ID "+n++:"Password$"===s&&(l="Alternate Password "+r++),this.processKvp(e,l,a,o)})}}class bt extends F{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 Bt extends F{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"),r=e.getAttribute("id");if(!this.isNullOrWhitespace(i)&&!this.isNullOrWhitespace(r)){n.set(r,t.folders.length);const e=new C.u;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 r=this.initLoginCipher();r.name=this.getValueOrDefault(e.getAttribute("title"),"--"),"true"===e.getAttribute("star")&&(r.favorite=!0);"note"===e.getAttribute("type")?(r.type=f.gC.SecureNote,r.secureNote=new T.Z,r.secureNote.type=f.ak.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?r.login.username=t:"password"===n||"secret"===n?this.processKvp(r,i,t,f.PU.Hidden):"one_time_password"===n?r.login.totp=t:"notes"===n?r.notes+=t+"\n":"weblogin"===n||"website"===n?r.login.uris.push(...this.makeUriArray(t)):this.processKvp(r,i,t)}),Array.from(this.querySelectorAllDirectChild(e,"notes")).forEach(e=>{r.notes+=e.textContent+"\n"}),this.setPassword(r),this.cleanupCipher(r),t.ciphers.push(r)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}setPassword(e){const t=e.fields.filter(e=>e.type===f.PU.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 Et extends F{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 St extends F{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 Qt extends F{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 kt extends F{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 r=e.getAttribute("Name"),s=e.getAttribute("Password");let o=null,a=null,l=null,c=null,d=null;const u=i.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+n+'"]');if(null!=u){const e=u.parentElement.parentElement;null!=e&&(o=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)||(d=this.buildGroupText(i,c,""),this.processFolder(t,d));const h=this.initLoginCipher();h.name=this.getValueOrDefault(o,"--"),h.notes=this.getValueOrDefault(l),h.login.username=this.getValueOrDefault(r),h.login.password=this.getValueOrDefault(s),h.login.uris=this.makeUriArray(a),this.cleanupCipher(h),t.ciphers.push(h)}),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 Tt=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"];class Ft extends F{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=f.gC.Card,i.card=new M.G,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=M.G.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=f.gC.SecureNote,i.secureNote=new T.Z,i.secureNote.type=f.ak.Generic,this.isNullOrWhitespace(i.notes)||(i.notes=this.getValueOrDefault(e.document_content,""));for(const t in e)e.hasOwnProperty(t)&&Tt.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 Pt extends F{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 Rt extends F{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 Dt extends F{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["Folder Name"]));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"]))),i.login.totp=this.getValueOrDefault(e.login_totp),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),r=t.length>i?t.substring(i+1):null;if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(r)||"SecretType"===n)return;const s=n.toLowerCase();null==e.login.username&&this.usernameFieldNames.indexOf(s)>-1?e.login.username=r:null==e.login.password&&this.passwordFieldNames.indexOf(s)>-1?e.login.password=r:this.processKvp(e,n,r)})}}const Mt=[{id:"bitwardenjson",name:"Bitwarden (json)"},{id:"bitwardencsv",name:"Bitwarden (csv)"},{id:"chromecsv",name:"Chrome"},{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)"}],xt=[{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:"arccsv",name:"Arc"},{id:"edgecsv",name:"Edge"},{id:"operacsv",name:"Opera"},{id:"vivaldicsv",name:"Vivaldi"},{id:"bravecsv",name:"Brave"},{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)"},{id:"passwordxpcsv",name:"Password XP (csv)"},{id:"netwrixpasswordsecure",name:"Netwrix Password Secure (csv)"},{id:"passworddepot17xml",name:"Password Depot 17 (xml)"}];var Ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Gt{constructor(e,t,i,n,r,s,o,a,l,c){this.cipherService=e,this.folderService=t,this.importApiService=i,this.i18nService=n,this.collectionService=r,this.keyService=s,this.encryptService=o,this.keyGenerationService=a,this.accountService=l,this.restrictedItemTypesService=c,this.featuredImportOptions=Mt,this.regularImportOptions=xt}getImportOptions(){return this.featuredImportOptions.concat(this.regularImportOptions)}import(e,t){return Ot(this,arguments,void 0,function*(e,t,i=null,n=null,r){let s;try{s=yield e.parse(t)}catch(c){if(c instanceof SyntaxError)throw new Error(this.i18nService.t("importFormatError"));throw c}if(!s.success){if(!v.A.isNullOrWhitespace(s.errorMessage))throw new Error(s.errorMessage);throw new Error(this.i18nService.t("importFormatError"))}if(0===s.folders.length&&0===s.ciphers.length)throw new Error(this.i18nService.t("importNothingError"));if(s.ciphers.length>0){const e=Math.floor(s.ciphers.length/2),t=s.ciphers.length-1;if(this.badData(s.ciphers[0])&&this.badData(s.ciphers[e])&&this.badData(s.ciphers[t]))throw new Error(this.i18nService.t("importFormatError"))}const o=yield(0,a._)(this.restrictedItemTypesService.restricted$.pipe((0,l.T)(e=>e.map(e=>e.cipherType))));if(s.ciphers=s.ciphers.filter(e=>!o.includes(e.type)),i&&!n&&!r){if(s.collectionRelationships.length<s.ciphers.length)throw new Error(this.i18nService.t("importUnassignedItemsError"))}try{yield this.setImportTarget(s,i,n);const e=yield(0,a._)(this.accountService.activeAccount$.pipe(u.F6));null!=i?yield this.handleOrganizationalImport(s,i,e):yield this.handleIndividualImport(s,e)}catch(c){const e=new g._(c,400);throw this.handleServerError(e,s)}return s})}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 j;case"bitwardenjson":case"bitwardenpasswordprotected":return new J(this.keyService,this.encryptService,this.i18nService,this.cipherService,this.keyGenerationService,this.accountService,t);case"lastpasscsv":case"passboltcsv":return new Se;case"keepassxcsv":return new Be;case"aviracsv":return new O;case"blurcsv":return new Z;case"safeincloudxml":return new Bt;case"padlockcsv":return new _e;case"keepass2xml":return new be;case"arccsv":return new P;case"edgecsv":case"chromecsv":case"operacsv":case"vivaldicsv":case"bravecsv":return new U;case"firefoxcsv":return new pe;case"upmcsv":return new Pt;case"saferpasscsv":return new Et;case"safaricsv":return new bt;case"meldiumcsv":return new ke;case"1password1pif":return new ze;case"1password1pux":return new qe;case"1passwordwincsv":return new Ze;case"1passwordmaccsv":return new Je;case"keepercsv":return new Ee;case"passworddragonxml":return new ct;case"enpasscsv":return new ue;case"enpassjson":return new Ae;case"pwsafexml":return new dt;case"dashlanecsv":return new ae;case"dashlanejson":return new ce;case"msecurecsv":return new Te;case"stickypasswordxml":return new kt;case"truekeycsv":return new Ft;case"clipperzhtml":return new te;case"roboformcsv":return new It;case"ascendocsv":return new R;case"passwordbossjson":return new st;case"zohovaultcsv":return new Dt;case"splashidcsv":return new Qt;case"passkeepcsv":return new et;case"gnomejson":return new fe;case"passwordagentcsv":return new rt;case"passpackcsv":return new nt;case"passmanjson":return new it;case"avastcsv":return new D;case"avastjson":return new x;case"fsecurefsk":return new ve;case"kasperskytxt":return new Ie;case"remembearcsv":return new wt;case"passwordwallettxt":return new ut;case"mykicsv":return new Ge;case"securesafecsv":return new St;case"logmeoncecsv":return new Qe;case"blackberrycsv":return new G;case"buttercupcsv":return new ee;case"codebookcsv":return new ie;case"encryptrcsv":return new de;case"yoticsv":return new Rt;case"nordpasscsv":return new je;case"psonojson":return new Ct;case"passkyjson":return new tt;case"protonpass":return new yt(this.i18nService);case"passwordxpcsv":return new vt;case"netwrixpasswordsecure":return new Ve;case"passworddepot17xml":return new lt;default:return null}}handleIndividualImport(e,t){return Ot(this,void 0,void 0,function*(){const i=new h,n=yield this.cipherService.encryptMany(e.ciphers,t);for(const e of n)i.ciphers.push(new m.P(e));const r=yield(0,a._)(this.keyService.userKey$(t));if(null!=e.folders)for(let t=0;t<e.folders.length;t++){const n=yield this.folderService.encrypt(e.folders[t],r);i.folders.push(new y.T(n))}return null!=e.folderRelationships&&e.folderRelationships.forEach(e=>i.folderRelationships.push(new p(e[0],e[1]))),yield this.importApiService.postImportCiphers(i)})}handleOrganizationalImport(e,t,i){return Ot(this,void 0,void 0,function*(){const n=new A;e.ciphers.forEach(e=>{e.organizationId=t});const r=yield this.cipherService.encryptMany(e.ciphers,i);for(const e of r)n.ciphers.push(new m.P(e));if(null!=e.collections)for(let s=0;s<e.collections.length;s++){e.collections[s].organizationId=t;const r=yield this.collectionService.encrypt(e.collections[s],i);n.collections.push(new c.hQ(r))}return null!=e.collectionRelationships&&e.collectionRelationships.forEach(e=>n.collectionRelationships.push(new p(e[0],e[1]))),yield this.importApiService.postImportOrganizationCiphers(t,n)})}badData(e){return(null==e.name||"--"===e.name)&&e.type===f.gC.Login&&null!=e.login&&v.A.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],r)=>{let s,o;const a=Number(e.match(/[0-9]+/)[0]);switch(e.match(/^\w+/)[0]){case"Ciphers":s=t.ciphers[a],o=(0,f.g7)(s.type);break;case"Folders":s=t.folders[a],o="Folder";break;case"Collections":s=t.collections[a],o="Collection";break;default:return}r>0&&(i+="\n\n"),"Folder"!==o&&"Collection"!==o&&(i+="["+(a+1)+"] "),i+="["+o+'] "'+s.name+'": '+n}),new Error(i)}setImportTarget(e,t,i){return Ot(this,void 0,void 0,function*(){if(!i)return;if(t){if(!(i instanceof d.iY))throw new Error(this.i18nService.t("errorAssigningTargetCollection"));const t=[];if(e.ciphers.forEach((i,n)=>{Array.isArray(e.collectionRelationships)&&e.collectionRelationships.some(([e])=>e===n)||t.push([n,0])}),i.type===d.it.DefaultUserCollection){e.collections=[i];const t=[];return e.ciphers.forEach((e,i)=>{t.push([i,0])}),void(e.collectionRelationships=t)}const n=[...e.collections];e.collections=[i],n.map(t=>{const n=new d.iY(t);n.name=`${i.name}/${t.name}`,e.collections.push(n)});const r=[...e.collectionRelationships];return e.collectionRelationships=[...t],void r.map(t=>{e.collectionRelationships.push([t[0],t[1]+1])})}if(!(i instanceof C.u))throw new Error(this.i18nService.t("errorAssigningTargetFolder"));const n=[];e.ciphers.forEach((e,t)=>{v.A.isNullOrEmpty(e.folderId)&&(e.folderId=i.id,n.push([t,0]))});const r=[...e.folders];e.folders=[i],r.map(t=>{const n=`${i.name}/${t.name}`,r=new C.u;r.name=n,e.folders.push(r)});const s=[...e.folderRelationships];e.folderRelationships=[...n],s.map(t=>{e.folderRelationships.push([t[0],t[1]+1])})})}}class Ut{}var Vt=i(83586);var jt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Nt{constructor(e){this.system=e,this.importers=Vt.qi,this.logger=e.log({type:"ImportMetadataService"})}init(){return jt(this,void 0,void 0,function*(){})}metadata$(e){const t=this.system.environment.getClientType(),i=e.pipe((0,l.T)(e=>{var i;if(!this.importers)return{type:e,loaders:[]};const n=function(e,t,i){var n,r;if(!e)return;if(!(t in e))return;return(null!==(r=null===(n=e[t])||void 0===n?void 0:n.loaders)&&void 0!==r?r:[]).filter(e=>Vt.Dt[e].includes(i))}(this.importers,e,t);if(!n||0===n.length)return{type:e,loaders:[]};const r={type:e,loaders:n};return e in this.importers&&(r.instructions=null===(i=this.importers[e])||void 0===i?void 0:i.instructions),this.logger.debug({importType:e,capabilities:r},"capabilities updated"),r}));return i}}class zt{}},68104(e,t,i){"use strict";var n;function r(e){return e!==n.Free&&e!==n.TeamsStarter&&e!==n.Families}i.d(t,{K:()=>n,L:()=>r}),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"}(n||(n={}))},68333(e,t,i){"use strict";var n;i.d(t,{k:()=>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={}))},68455(e,t,i){"use strict";i.d(t,{u:()=>n});class n{}},68466(e,t,i){"use strict";i.d(t,{L:()=>l});var n=i(94573),r=i(51757),s=i(36801),o=i(33812);function a(e,t){if(1&e&&(o.Hgh(0,"i",0),o.EFF(1),o.nI1(2,"i18n")),2&e){const e=o.XpG();o.R7$(),o.SpI(" ",o.i5U(2,1,"fieldsNeedAttention",e.errorString)," ")}}class l{constructor(){this.formGroup=(0,n.hFB)()}get errorCount(){const e=this.formGroup();return e?this.getErrorCount(e):0}get errorString(){return this.errorCount.toString()}getErrorCount(e){return Object.values(e.controls).reduce((e,t)=>t instanceof r.J3?e+this.getErrorCount(t):null==t.errors||!t.dirty&&t.untouched?e:e+Object.keys(t.errors).length,0)}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-error-summary"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-text-danger","tw-mt-2"],inputs:{formGroup:[1,"formGroup"]},decls:1,vars:1,consts:[[1,"bwi","bwi-error"]],template:function(e,t){1&e&&o.nVh(0,a,3,4),2&e&&o.vxM(t.errorCount>0?0:-1)},dependencies:[s.$Z],encapsulation:2})},68467(e,t,i){"use strict";var n;i.d(t,{iS:()=>r,Qd:()=>n,K9:()=>s,VK:()=>o,EO:()=>l.EO,hq:()=>a,xk:()=>d.$b,$B:()=>l.Kg,NJ:()=>u}),function(e){e[e.AesCbc256_B64=0]="AesCbc256_B64",e[e.AesCbc256_HmacSha256_B64=2]="AesCbc256_HmacSha256_B64",e[e.CoseEncrypt0=7]="CoseEncrypt0",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 r={[n.AesCbc256_B64]:2,[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,[n.CoseEncrypt0]:1};var s,o;!function(e){e[e.Direct=0]="Direct",e[e.Azure=1]="Azure"}(s||(s={})),function(e){e[e.ServerAuthorization=1]="ServerAuthorization",e[e.LocalAuthorization=2]="LocalAuthorization"}(o||(o={}));var a,l=i(21551);!function(e){e.Auto="auto",e.Pin="pin"}(a||(a={}));var c,d=i(90107);!function(e){e.System="system",e.Light="light",e.Dark="dark"}(c||(c={}));const u={System:"system",Light:"light",Dark:"dark"}},68881(e,t,i){"use strict";i.d(t,{i:()=>n});class n{constructor(e=null,t=null,i=!1){this.provider=e,this.token=t,this.remember=i}}},68923(e,t,i){"use strict";i.d(t,{P:()=>o});var n=i(94573),r=i(33812);function s(e,t){1&e&&r.SdG(0)}class o{constructor(){this.icon=(0,n.hFB)(),this.value=n.hFB.required(),this.label=n.hFB.required(),this.disabled=(0,n.hFB)(void 0,{transform:n.L39})}}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=r.VBU({type:o,selectors:[["bit-option"]],inputs:{icon:[1,"icon"],value:[1,"value"],label:[1,"label"],disabled:[1,"disabled"]},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(r.NAR(),r.PeT(0,s,1,0,"ng-template"))},encapsulation:2})},69022(e,t,i){"use strict";i.d(t,{s:()=>v});var n=i(66046),r=i(84079),s=i(83892),o=i(93695),a=i(3204),l=i(27442),c=i(44500),d=i(82468),u=i(7861),h=i(65731),A=i(11728),p=i(74208),g=i(1601);class v{constructor(e,t){this.accountBillingClient=e,this.configService=t,this.refreshTrigger=new n.B,this.getEligibleDiscountsForTier$=e=>this.getEligibleDiscounts$().pipe((0,a.T)(t=>t.filter(t=>t.tierEligibility[e])))}refresh(){this.refreshTrigger.next()}getEligibleDiscounts$(){return this.configService.getFeatureFlag$(d.TO.PM29108_EnablePersonalDiscounts).pipe((0,l.t)({refCount:!0,bufferSize:1})).pipe((0,c.n)(e=>e?(0,s.h)(this.fetchDiscounts$(),this.refreshTrigger.pipe((0,c.n)(()=>this.fetchDiscounts$(!0)))).pipe((0,l.t)({refCount:!0,bufferSize:1})):(0,o.of)([])))}isDiscountExpiredError(e){return e instanceof u._&&400===e.statusCode&&"Discount expired. Please review your cart total and try again"===e.message}mapToCartDiscount(e){return null!=e.percentOff?{type:h.Tu.PercentOff,value:e.percentOff}:null!=e.amountOff?{type:h.Tu.AmountOff,value:e.amountOff/100}:null}fetchDiscounts$(e=!1){return!e&&this.cachedDiscounts$||(this.cachedDiscounts$=(0,r.H)(this.accountBillingClient.getApplicableDiscounts())),this.cachedDiscounts$}}v.ɵfac=function(e){return new(e||v)(p.KVO(A.c),p.KVO(g.w))},v.ɵprov=p.jDH({token:v,factory:v.ɵfac,providedIn:"root"})},69138(e,t,i){"use strict";i.d(t,{P:()=>a,_:()=>o});var n=i(77788),r=i(20702),s=i(53674);class o extends n.t{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 s.y7(t);const i=this.getResponseProperty("UpcomingInvoice");this.upcomingInvoice=null==i?null:new s.V8(i);const n=this.getResponseProperty("CustomerDiscount");this.customerDiscount=null==n?null:new a(n),this.expiration=this.getResponseProperty("Expiration"),this.expirationWithoutGracePeriod=this.getResponseProperty("ExpirationWithoutGracePeriod")}}class a extends r.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.active=this.getResponseProperty("Active"),this.percentOff=this.getResponseProperty("PercentOff"),this.amountOff=this.getResponseProperty("AmountOff"),this.appliesTo=this.getResponseProperty("AppliesTo")||[]}}},69473(e,t,i){"use strict";i.d(t,{V:()=>r});class n{constructor(e,t){this.propertyKey=e,this._i18nKey=null==t?void 0:t.i18nKey,this.sortPosition=t.sortPosition}get i18nKey(){var e;return null!==(e=this._i18nKey)&&void 0!==e?e:this.propertyKey}}function r(e,t){return(i,r)=>{null==i.linkedFieldOptions&&(i.linkedFieldOptions=new Map),i.linkedFieldOptions.set(e,new n(r,t))}}},69554(e,t,i){"use strict";i.d(t,{T:()=>n});class n{}},69580(e,t,i){"use strict";i.d(t,{tQ:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.productTier=this.getResponseProperty("ProductTier"),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.hasMyItems=this.getResponseProperty("HasMyItems"),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 o(t),this.SecretsManager=null==i?null:new s(i)}}class s extends n.r{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 o extends n.r{constructor(e){super(e),this.stripePlanId=this.getResponseProperty("StripePlanId"),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.stripeProviderPortalSeatPlanId=this.getResponseProperty("StripeProviderPortalSeatPlanId"),this.stripeStoragePlanId=this.getResponseProperty("StripeStoragePlanId"),this.stripePremiumAccessPlanId=this.getResponseProperty("StripePremiumAccessPlanId"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.providerPortalSeatPrice=this.getResponseProperty("ProviderPortalSeatPrice"),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")}}},69588(e,t,i){"use strict";i.d(t,{L:()=>n});class n{}},69592(e,t,i){"use strict";i.d(t,{w:()=>p});var n=i(72245),r=i(3633),s=i(66523),o=i(61325),a=i(90118),l=i(33812),c=i(35500),d=i(5556),u=i(36288),h=i(78952),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{constructor(e,t,i,n,r){this.copyCipherFieldService=e,this.accountService=t,this.cipherService=i,this.menuItemComponent=n,this.iconButtonComponent=r,this.disabled=null}get hidden(){return this.disabled&&this.menuItemComponent}copy(){return A(this,void 0,void 0,function*(){const e=yield this.getValueToCopy();yield this.copyCipherFieldService.copy(null!=e?e:"",this.action,this.cipher)})}ngOnChanges(){return A(this,void 0,void 0,function*(){yield this.updateDisabledState()})}updateDisabledState(){return A(this,void 0,void 0,function*(){var e,t;this.disabled=!this.cipher||!this.hasValueToCopy()||"totp"===this.action&&!(yield this.copyCipherFieldService.totpAllowed(this.cipher))||null,this.iconButtonComponent&&this.iconButtonComponent.disabled.set(null!==(e=this.disabled)&&void 0!==e&&e),this.menuItemComponent&&(this.menuItemComponent.disabled=null!==(t=this.disabled)&&void 0!==t&&t)})}hasValueToCopy(){return o.n.hasCopyableValue(this.cipher,this.action)}getValueToCopy(){return A(this,void 0,void 0,function*(){var e,t,i,a,l,c,d,u,h,A,p,g;let v;if(o.n.isCipherListView(this.cipher)){const e=yield(0,n._)(this.accountService.activeAccount$.pipe(r.F6)),t=yield this.cipherService.get((0,s.zw)(this.cipher.id),e);v=yield this.cipherService.decrypt(t,e)}else v=this.cipher;switch(this.action){case"username":return(null===(e=v.login)||void 0===e?void 0:e.username)||(null===(t=v.identity)||void 0===t?void 0:t.username);case"password":return null===(i=v.login)||void 0===i?void 0:i.password;case"totp":return null===(a=v.login)||void 0===a?void 0:a.totp;case"cardNumber":return null===(l=v.card)||void 0===l?void 0:l.number;case"securityCode":return null===(c=v.card)||void 0===c?void 0:c.code;case"email":return null===(d=v.identity)||void 0===d?void 0:d.email;case"phone":return null===(u=v.identity)||void 0===u?void 0:u.phone;case"address":return null===(h=v.identity)||void 0===h?void 0:h.fullAddressForCopy;case"secureNote":return v.notes;case"privateKey":return null===(A=v.sshKey)||void 0===A?void 0:A.privateKey;case"publicKey":return null===(p=v.sshKey)||void 0===p?void 0:p.publicKey;case"keyFingerprint":return null===(g=v.sshKey)||void 0===g?void 0:g.keyFingerprint;default:return null}})}}p.ɵfac=function(e){return new(e||p)(l.rXU(a.nR),l.rXU(c.D),l.rXU(d.p),l.rXU(h.S,8),l.rXU(u.s,8))},p.ɵdir=l.FsC({type:p,selectors:[["","appCopyField",""]],hostVars:3,hostBindings:function(e,t){1&e&&l.bIt("click",function(){return t.copy()}),2&e&&(l.BMQ("disabled",t.disabled),l.AVh("tw-hidden",t.hidden))},inputs:{action:[0,"appCopyField","action"],cipher:"cipher"},features:[l.OA$]})},69650(e,t,i){"use strict";i.d(t,{Sb:()=>S,Wn:()=>s,RB:()=>d});const n=0,r=1,s={UpdateAtRiskCredential:0};class o{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.cipherId=e.cipherId,this.type=e.type,this.status=e.status,this.creationDate=e.creationDate,this.revisionDate=e.revisionDate}}class a{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.cipherId=e.cipherId,this.type=e.type,this.status=e.status,this.creationDate=e.creationDate,this.revisionDate=e.revisionDate}static fromJSON(e){return Object.assign(new a({}),e,{creationDate:new Date(e.creationDate),revisionDate:new Date(e.revisionDate)})}}var l=i(20702);class c extends l.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.cipherId=this.getResponseProperty("CipherId")||void 0,this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate")}}class d{}var u=i(3204),h=i(34040),A=i(44500),p=i(93695),g=i(33338),v=i(69194),f=i(83892),m=i(84110),y=i(51151),C=i(12277),w=i(97432),I=i(31857);const b=I.Ok.array(I.k2,"securityTasks",{deserializer:e=>a.fromJSON(e),clearOn:["logout","lock"]});var B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const E=(0,u.T)(e=>Object.entries(null!=e?e:{}).filter(([,e])=>e>=m.J.Unlocked).map(([e])=>e));class S{constructor(e,t,i,s,a,l){this.stateProvider=e,this.apiService=t,this.organizationService=i,this.authService=s,this.notificationService=a,this.messageListener=l,this.tasksEnabled$=(0,w.j)(e=>this.organizationService.organizations$(e).pipe((0,u.T)(e=>e.some(e=>e.canUseAccessIntelligence)),(0,h.F)())),this.tasks$=(0,w.j)(e=>this.tasksEnabled$(e).pipe((0,A.n)(t=>t?this.taskState(e).state$.pipe((0,A.n)(t=>B(this,void 0,void 0,function*(){return null==t?(yield this.fetchTasksFromApi(e),null):t})),(0,w.w)(),(0,u.T)(e=>e.map(e=>new o(e)))):(0,p.of)([])))),this.pendingTasks$=(0,w.j)(e=>this.tasks$(e).pipe((0,u.T)(e=>e.filter(e=>e.status===n)))),this.completedTasks$=(0,w.j)(e=>this.tasks$(e).pipe((0,u.T)(e=>e.filter(e=>e.status===r)))),this.getOnlyTaskEnabledUsers=(0,A.n)(e=>0===e.length?(0,p.of)([]):(0,g.z)(e.map(e=>this.tasksEnabled$(e).pipe((0,u.T)(t=>t?e:null)))).pipe((0,u.T)(e=>e.filter(e=>null!==e))))}refreshTasks(e){return B(this,void 0,void 0,function*(){yield this.fetchTasksFromApi(e)})}clear(e){return B(this,void 0,void 0,function*(){yield this.updateTaskState(e,[])})}markAsComplete(e,t){return B(this,void 0,void 0,function*(){yield this.apiService.send("PATCH",`/tasks/${e}/complete`,null,!0,!1),yield this.refreshTasks(t)})}fetchTasksFromApi(e){return B(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/tasks",null,!0,!0),i=new C.s(t,c).data.map(e=>new a(e));yield this.updateTaskState(e,i)})}taskState(e){return this.stateProvider.getUser(e,b)}updateTaskState(e,t){return this.taskState(e).update(()=>t)}securityTaskNotifications$(e){return this.notificationService.notifications$.pipe((0,v.p)(([t,i])=>t.type===y._n.RefreshSecurityTasks&&e.includes(i)),(0,u.T)(([,e])=>e))}syncCompletedMessage$(e){return this.messageListener.allMessages$.pipe((0,v.p)(e=>"syncCompleted"===e.command&&!!e.successfully&&!!e.userId),(0,u.T)(e=>e.userId),(0,v.p)(t=>e.includes(t)))}listenForTaskNotifications(){return this.authService.authStatuses$.pipe(E,this.getOnlyTaskEnabledUsers,(0,v.p)(e=>e.length>0),(0,A.n)(e=>(0,f.h)(this.securityTaskNotifications$(e),this.syncCompletedMessage$(e))),(0,A.n)(e=>this.refreshTasks(e))).subscribe()}}},69672(e,t,i){"use strict";i.d(t,{TT:()=>h,lp:()=>A});var n=i(94251),r=i(74208),s=i(33812),o=i(33277),a=i(83731),l=i(31436),c=i(69194),d=i(44500);class u{constructor(){this.scrollableRef=(0,r.vPA)(null),this.scrollableRef$=(0,a.br)(this.scrollableRef)}}u.ɵfac=function(e){return new(e||u)},u.ɵprov=r.jDH({token:u,factory:u.ɵfac,providedIn:"root"});class h{constructor(){this.ref=(0,r.WQX)(s.aKT),this.service=(0,r.WQX)(u),this.service.scrollableRef.set(this.ref)}ngOnDestroy(){this.service.scrollableRef.set(null)}}h.ɵfac=function(e){return new(e||h)},h.ɵdir=s.FsC({type:h,selectors:[["","bitScrollLayoutHost",""]],hostAttrs:[1,"cdk-virtual-scrollable"]});class A extends n.fI{constructor(){super(),this.service=(0,r.WQX)(u),(0,o.QZ)(()=>{const e=this.service.scrollableRef();e?this.elementRef=e:console.error("ScrollLayoutDirective can't find scroll host")})}elementScrolled(){return this.service.scrollableRef$.pipe((0,c.p)(e=>null!==e),(0,d.n)(e=>(0,l.R)(e.nativeElement,"scroll")))}getElementRef(){return this.service.scrollableRef()}measureBoundingClientRectWithScrollOffset(e){return this.service.scrollableRef().nativeElement.getBoundingClientRect()[e]-this.measureScrollOffset(e)}}A.ɵfac=function(e){return new(e||A)},A.ɵdir=s.FsC({type:A,selectors:[["","bitScrollLayout",""]],features:[s.Jv_([{provide:n.qy,useExisting:A}]),s.Vt3]})},69855(e,t,i){"use strict";i.d(t,{f:()=>o});const n=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 r=i(74208),s=i(82630);class o{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:n(e.message)};this.toastrService.show(void 0,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})}}o.ɵfac=function(e){return new(e||o)(r.KVO(s.tw))},o.ɵprov=r.jDH({token:o,factory:o.ɵfac,providedIn:"root"})},69886(e,t,i){"use strict";i.d(t,{w:()=>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)}}},69896(e,t,i){"use strict";i.d(t,{a:()=>o});var n=i(74208),r=i(36288),s=i(33812);class o{constructor(){this.iconButtonComponent=(0,n.WQX)(r.s,{optional:!0}),this.classList=this.iconButtonComponent?[]:["tw-text-muted"]}ngOnInit(){this.iconButtonComponent&&this.iconButtonComponent.size.set("small")}}o.ɵfac=function(e){return new(e||o)},o.ɵdir=s.FsC({type:o,selectors:[["","bitSuffix",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classList)}})},70171(e,t,i){"use strict";i.d(t,{H:()=>n});class n{}},70342(e,t,i){"use strict";i.d(t,{N:()=>b,h:()=>I});var n=i(33338),r=i(3204),s=i(44500),o=i(31442),a=i(43978),l=i(3633),c=i(31857),d=i(97440),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const h=new c.Ok(c.dp,"autofillOnPageLoad",{deserializer:e=>null!=e&&e,clearOn:[]}),A=new c.Ok(c.dp,"autofillOnPageLoadDefault",{deserializer:e=>null!=e&&e,clearOn:[]}),p=new c.Ok(c.dp,"autofillOnPageLoadCalloutIsDismissed",{deserializer:e=>null!=e&&e,clearOn:[]}),g=new c.Ok(c.dp,"autofillOnPageLoadPolicyToastHasDisplayed",{deserializer:e=>null!=e&&e,clearOn:[]}),v=new c.Ok(c.dp,"autoCopyTotp",{deserializer:e=>null==e||e,clearOn:[]}),f=new c.Zs(c.Vl,"inlineMenuVisibility",{deserializer:e=>null!=e?e:d.bZ.Off}),m=new c.Ok(c.dp,"showInlineMenuIdentities",{deserializer:e=>null==e||e,clearOn:[]}),y=new c.Ok(c.dp,"showInlineMenuCards",{deserializer:e=>null==e||e,clearOn:[]}),C=new c.Zs(c.dp,"enableContextMenu",{deserializer:e=>null==e||e}),w=new c.Ok(c.Vl,"clearClipboardDelay",{deserializer:e=>null!=e?e:d.j8.Never,clearOn:[]});class I{}class b{constructor(e,t,i,c){this.stateProvider=e,this.policyService=t,this.accountService=i,this.restrictedItemTypesService=c,this.autofillOnPageLoadState=this.stateProvider.getActive(h),this.autofillOnPageLoad$=this.autofillOnPageLoadState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.autofillOnPageLoadDefaultState=this.stateProvider.getActive(A),this.autofillOnPageLoadDefault$=this.autofillOnPageLoadDefaultState.state$.pipe((0,r.T)(e=>null==e||e)),this.autofillOnPageLoadCalloutIsDismissedState=this.stateProvider.getActive(p),this.autofillOnPageLoadCalloutIsDismissed$=this.autofillOnPageLoadCalloutIsDismissedState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.activateAutofillOnPageLoadFromPolicy$=this.accountService.activeAccount$.pipe(l.F6,(0,s.n)(e=>this.policyService.policyAppliesToUser$(a.tt.ActivateAutofill,e))),this.autofillOnPageLoadPolicyToastHasDisplayedState=this.stateProvider.getActive(g),this.autofillOnPageLoadPolicyToastHasDisplayed$=this.autofillOnPageLoadPolicyToastHasDisplayedState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.autoCopyTotpState=this.stateProvider.getActive(v),this.autoCopyTotp$=this.autoCopyTotpState.state$.pipe((0,r.T)(e=>null==e||e)),this.inlineMenuVisibilityState=this.stateProvider.getGlobal(f),this.inlineMenuVisibility$=this.inlineMenuVisibilityState.state$.pipe((0,r.T)(e=>null!=e?e:d.bZ.Off)),this.showInlineMenuIdentitiesState=this.stateProvider.getActive(m),this.showInlineMenuIdentities$=this.showInlineMenuIdentitiesState.state$.pipe((0,r.T)(e=>null==e||e)),this.showInlineMenuCardsState=this.stateProvider.getActive(y),this.showInlineMenuCards$=(0,n.z)([this.showInlineMenuCardsState.state$.pipe((0,r.T)(e=>null==e||e)),this.restrictedItemTypesService.restricted$]).pipe((0,r.T)(([e,t])=>e&&!t.some(e=>e.cipherType===o.gC.Card))),this.enableContextMenuState=this.stateProvider.getGlobal(C),this.enableContextMenu$=this.enableContextMenuState.state$.pipe((0,r.T)(e=>null==e||e)),this.clearClipboardDelayState=this.stateProvider.getActive(w),this.clearClipboardDelay$=this.clearClipboardDelayState.state$.pipe((0,r.T)(e=>null!=e?e:d.j8.Never))}setAutofillOnPageLoad(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadState.update(()=>e)})}setAutofillOnPageLoadDefault(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadDefaultState.update(()=>e)})}setAutofillOnPageLoadCalloutIsDismissed(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadCalloutIsDismissedState.update(()=>e)})}setAutofillOnPageLoadPolicyToastHasDisplayed(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadPolicyToastHasDisplayedState.update(()=>e)})}setAutoCopyTotp(e){return u(this,void 0,void 0,function*(){yield this.autoCopyTotpState.update(()=>e)})}setInlineMenuVisibility(e){return u(this,void 0,void 0,function*(){yield this.inlineMenuVisibilityState.update(()=>e)})}setShowInlineMenuIdentities(e){return u(this,void 0,void 0,function*(){yield this.showInlineMenuIdentitiesState.update(()=>e)})}setShowInlineMenuCards(e){return u(this,void 0,void 0,function*(){yield this.showInlineMenuCardsState.update(()=>e)})}setEnableContextMenu(e){return u(this,void 0,void 0,function*(){yield this.enableContextMenuState.update(()=>e)})}setClearClipboardDelay(e){return u(this,void 0,void 0,function*(){yield this.clearClipboardDelayState.update(()=>e)})}}},71373(e,t,i){"use strict";i.d(t,{JJ:()=>n,GL:()=>U,Im:()=>G,pV:()=>_});class n{}var r=i(73638),s=i(192);const o=Object.freeze({type:"password",username:"word",forwarder:""});var a=i(16878),l=i(3204),c=i(72245),d=i(43978),u=i(20377);class h{constructor(e){this.policy=e}get policyInEffect(){var e;return r.I4[r.ZU.password].includes(null===(e=this.policy)||void 0===e?void 0:e.overridePasswordType)}applyPolicy(e){var t;const i=Object.assign({},e);return this.policyInEffect&&(i.type=null!==(t=this.policy.overridePasswordType)&&void 0!==t?t:i.type),i}sanitize(e){var t;return Object.assign(Object.assign({},e),{type:null!==(t=e.type)&&void 0!==t?t:o.type})}}function A(e,t){if(!(t.type===d.tt.PasswordGenerator&&t.enabled))return e;return"password"!==e.overridePasswordType&&t.data.overridePasswordType?Object.assign(Object.assign({},e),{overridePasswordType:t.data.overridePasswordType}):e}const p=Object.freeze({overridePasswordType:null});var g=i(31857);const v=new g.Ok(g.qd,"generatorSettings",{deserializer:e=>e,clearOn:["logout"]});var f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{constructor(e,t){this.stateProvider=e,this.policy=t}options$(e){return this.stateProvider.getUserState$(v,e)}defaults$(e){return new a.t(Object.assign({},o))}evaluator$(e){return this.policy.policiesByType$(d.tt.PasswordGenerator,e).pipe((0,u.pP)(A,p),(0,u.LA)(),(0,l.T)(e=>new h(e)))}enforcePolicy(e,t){return f(this,void 0,void 0,function*(){const i=yield(0,c._)(this.evaluator$(e)),n=i.applyPolicy(t);return i.sanitize(n)})}saveOptions(e,t){return f(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(v,t,e)})}}var y=i(93695),C=i(73276),w=i(56986),I=i(33338),b=i(39444),B=i(88507),E=i(22485),S=i(69194),Q=i(17989);class k extends Q.A{constructor(){super(...arguments),this.overridePasswordType="",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.overridePasswordType||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 k;return Object.assign(e,this),e}}var T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F{constructor(e,t,i,n,r){this.accountService=e,this.navigation=t,this.passwords=i,this.passphrases=n,this.history=r}generatePassword(e){return"password"===e.type?this.passwords.generate(e):this.passphrases.generate(e)}generatePassphrase(e){return this.passphrases.generate(e)}getRawOptions$(){function e(e){return e.pipe((0,l.T)((e,t)=>[e,t]))}return this.accountService.activeAccount$.pipe((0,C.H)(t=>(0,w.x)((0,y.of)([null,null,[null,-1],null,null,[null,-1],null,null,[null,-1]]),(0,I.z)([this.passwords.options$(t.id),this.passwords.defaults$(t.id),e(this.passwords.evaluator$(t.id)),this.passphrases.options$(t.id),this.passphrases.defaults$(t.id),e(this.passphrases.evaluator$(t.id)),this.navigation.options$(t.id),this.navigation.defaults$(t.id),e(this.navigation.evaluator$(t.id))]))),(0,b.J)(),(0,l.T)(function([e,t]){const[,,[,i],,,[,n],,,[,r]]=e,[s,o,[a,l],c,d,[u,h],A,p,[g,v]]=t;return[s,o,a,c,d,u,A,p,g,i<l||n<h||r<v]}))}getOptions$(){return this.getRawOptions$().pipe((0,l.T)(([e,t,i,n,r,s,o,a,l,c])=>{const d=i.applyPolicy(null!=e?e:t),u=s.applyPolicy(null!=n?n:r),h=l.applyPolicy(null!=o?o:a);return[this.toPasswordGeneratorOptions({password:i.sanitize(d),passphrase:s.sanitize(u),generator:l.sanitize(h),policyUpdated:c}),Object.assign(new k,i.policy,s.policy,l.policy)]}))}getOptions(){return T(this,void 0,void 0,function*(){return yield(0,c._)(this.getOptions$())})}enforcePasswordGeneratorPoliciesOnOptions(e){return T(this,void 0,void 0,function*(){const t=this.accountService.activeAccount$.pipe((0,C.H)(e=>(0,B.y)(this.passwords.evaluator$(e.id),this.passphrases.evaluator$(e.id),this.navigation.evaluator$(e.id))),(0,l.T)(([t,i,n])=>{const r=Object.assign(new k,t.policy,i.policy,n.policy),s=n.applyPolicy(e),o=Object.assign(Object.assign({},e),n.sanitize(s));if("password"===o.type){const e=t.applyPolicy(o);return[t.sanitize(e),r]}{const e=i.applyPolicy(o);return[i.sanitize(e),r]}})),[i,n]=yield(0,c._)(t);return[Object.assign(e,i),n]})}saveOptions(e){return T(this,void 0,void 0,function*(){const t=this.toStoredOptions(e),i=yield(0,c._)(this.accountService.activeAccount$),n=(0,B.y)(this.navigation.options$(i.id),this.navigation.defaults$(i.id)).pipe((0,l.T)(([e,t])=>null!=e?e:t));let r=yield(0,c._)(n);r=Object.assign(r,t.generator),yield this.navigation.saveOptions(i.id,r),yield this.passwords.saveOptions(i.id,t.password),yield this.passphrases.saveOptions(i.id,t.passphrase)})}toStoredOptions(e){return{generator:{type:e.type},password:{length:e.length,minLength:e.minLength,ambiguous:e.ambiguous,uppercase:e.uppercase,minUppercase:e.minUppercase,lowercase:e.lowercase,minLowercase:e.minLowercase,number:e.number,minNumber:e.minNumber,special:e.special,minSpecial:e.minSpecial},passphrase:{numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber},policyUpdated:!1}}toPasswordGeneratorOptions(e){return{type:e.generator.type,length:e.password.length,minLength:e.password.minLength,ambiguous:e.password.ambiguous,uppercase:e.password.uppercase,minUppercase:e.password.minUppercase,lowercase:e.password.lowercase,minLowercase:e.password.minLowercase,number:e.password.number,minNumber:e.password.minNumber,special:e.password.special,minSpecial:e.password.minSpecial,numWords:e.passphrase.numWords,wordSeparator:e.passphrase.wordSeparator,capitalize:e.passphrase.capitalize,includeNumber:e.passphrase.includeNumber,policyUpdated:e.policyUpdated}}getHistory(){const e=this.accountService.activeAccount$.pipe((0,C.H)(e=>this.history.credentials$(e.id)),(0,E.w)({each:1e3,with:()=>[]}),(0,l.T)(e=>e.map(P)));return(0,c._)(e)}addHistory(e){return T(this,void 0,void 0,function*(){const t=yield(0,c._)(this.accountService.activeAccount$);(null==t?void 0:t.id)&&(yield this.history.track(t.id,e,"password"))})}clear(){const e=this.accountService.activeAccount$.pipe((0,S.p)(e=>!!(null==e?void 0:e.id)),(0,C.H)(e=>this.history.clear(e.id)),(0,E.w)({each:1e3,with:()=>[]}),(0,l.T)(e=>e.map(P)));return(0,c._)(e)}}function P(e){return new s.ZG(e.credential,e.generationDate.valueOf())}const{jK:R,gb:D}=r.Wy,{f3:M,Zx:x}=r.Hi,O=r.$p.q;function G(e,t,i,n,r){const o=new M,a=new x(o,Date.now),l=new O(new D(a,r),i),c=new O(new R(a,r),i),d=new m(r,i),u=new s.Kt(e,t,r);return new F(n,d,l,c,u)}class U{}var V=i(39307),j=i(19638);const N=Object.freeze({AddyIo:Object.freeze({id:"anonaddy",name:"Addy.io",validForSelfHosted:!0}),DuckDuckGo:Object.freeze({id:"duckduckgo",name:"DuckDuckGo",validForSelfHosted:!1}),Fastmail:Object.freeze({id:"fastmail",name:"Fastmail",validForSelfHosted:!0}),FirefoxRelay:Object.freeze({id:"firefoxrelay",name:"Firefox Relay",validForSelfHosted:!1}),ForwardEmail:Object.freeze({id:"forwardemail",name:"Forward Email",validForSelfHosted:!0}),SimpleLogin:Object.freeze({id:"simplelogin",name:"SimpleLogin",validForSelfHosted:!0})});var z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Y{constructor(e,t,i,n,r,s,o,a,l,c,d){this.accountService=e,this.navigation=t,this.catchall=i,this.effUsername=n,this.subaddress=r,this.addyIo=s,this.duckDuckGo=o,this.fastmail=a,this.firefoxRelay=l,this.forwardEmail=c,this.simpleLogin=d}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 this.effUsername.generate(e)}generateSubaddress(e){return this.subaddress.generate(e)}generateCatchall(e){return this.catchall.generate(e)}generateForwarded(e){if(!e.forwardedService)return null;const t=this.toStoredOptions(e);switch(e.forwardedService){case N.AddyIo.id:case j.N.addyio:return this.addyIo.generate(t.forwarders.addyIo);case N.DuckDuckGo.id:return this.duckDuckGo.generate(t.forwarders.duckDuckGo);case N.Fastmail.id:return this.fastmail.generate(t.forwarders.fastmail);case N.FirefoxRelay.id:case j.N.mozilla:return this.firefoxRelay.generate(t.forwarders.firefoxRelay);case N.ForwardEmail.id:return this.forwardEmail.generate(t.forwarders.forwardEmail);case N.SimpleLogin.id:return this.simpleLogin.generate(t.forwarders.simpleLogin)}}getOptions$(){return this.accountService.activeAccount$.pipe((0,C.H)(e=>(0,I.z)([this.navigation.options$(e.id),this.navigation.defaults$(e.id),this.catchall.options$(e.id),this.catchall.defaults$(e.id),this.effUsername.options$(e.id),this.effUsername.defaults$(e.id),this.subaddress.options$(e.id),this.subaddress.defaults$(e.id),this.addyIo.options$(e.id),this.addyIo.defaults$(e.id),this.duckDuckGo.options$(e.id),this.duckDuckGo.defaults$(e.id),this.fastmail.options$(e.id),this.fastmail.defaults$(e.id),this.firefoxRelay.options$(e.id),this.firefoxRelay.defaults$(e.id),this.forwardEmail.options$(e.id),this.forwardEmail.defaults$(e.id),this.simpleLogin.options$(e.id),this.simpleLogin.defaults$(e.id)])),(0,l.T)(([e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y])=>this.toUsernameOptions({generator:null!=e?e:t,algorithms:{catchall:null!=i?i:n,effUsername:null!=r?r:s,subaddress:null!=o?o:a},forwarders:{addyIo:null!=l?l:c,duckDuckGo:null!=d?d:u,fastmail:null!=h?h:A,firefoxRelay:null!=p?p:g,forwardEmail:null!=v?v:f,simpleLogin:null!=m?m:y}})))}getOptions(){return(0,c._)(this.getOptions$())}saveOptions(e){return z(this,void 0,void 0,function*(){const t=this.toStoredOptions(e),i=yield(0,c._)(this.accountService.activeAccount$);(yield this.saveGeneratorOptions(i.id,e.type,t))||(yield this.saveForwarderOptions(i.id,e.forwardedService,t)),yield this.saveNavigationOptions(i.id,t)})}saveNavigationOptions(e,t){return z(this,void 0,void 0,function*(){const i=(0,B.y)(this.navigation.options$(e),this.navigation.defaults$(e)).pipe((0,l.T)(([e,t])=>null!=e?e:t));let n=yield(0,c._)(i);n=Object.assign(n,t.generator),yield this.navigation.saveOptions(e,n)})}saveGeneratorOptions(e,t,i){return z(this,void 0,void 0,function*(){switch(t){case"word":return yield this.effUsername.saveOptions(e,i.algorithms.effUsername),!0;case"subaddress":return yield this.subaddress.saveOptions(e,i.algorithms.subaddress),!0;case"catchall":return yield this.catchall.saveOptions(e,i.algorithms.catchall),!0;default:return!1}})}saveForwarderOptions(e,t,i){return z(this,void 0,void 0,function*(){switch(t){case N.AddyIo.id:case j.N.addyio:return yield this.addyIo.saveOptions(e,i.forwarders.addyIo),!0;case N.DuckDuckGo.id:return yield this.duckDuckGo.saveOptions(e,i.forwarders.duckDuckGo),!0;case N.Fastmail.id:return yield this.fastmail.saveOptions(e,i.forwarders.fastmail),!0;case N.FirefoxRelay.id:case j.N.mozilla:return yield this.firefoxRelay.saveOptions(e,i.forwarders.firefoxRelay),!0;case N.ForwardEmail.id:return yield this.forwardEmail.saveOptions(e,i.forwarders.forwardEmail),!0;case N.SimpleLogin.id:return yield this.simpleLogin.saveOptions(e,i.forwarders.simpleLogin),!0;default:return!1}})}toStoredOptions(e){const t={addyIo:{baseUrl:e.forwardedAnonAddyBaseUrl,token:e.forwardedAnonAddyApiToken,domain:e.forwardedAnonAddyDomain,website:e.website},duckDuckGo:{token:e.forwardedDuckDuckGoToken,website:e.website},fastmail:{token:e.forwardedFastmailApiToken,website:e.website},firefoxRelay:{token:e.forwardedFirefoxApiToken,website:e.website},forwardEmail:{token:e.forwardedForwardEmailApiToken,domain:e.forwardedForwardEmailDomain,website:e.website},simpleLogin:{token:e.forwardedSimpleLoginApiKey,baseUrl:e.forwardedSimpleLoginBaseUrl,website:e.website}};return{generator:{username:e.type,forwarder:e.forwardedService},algorithms:{effUsername:{wordCapitalize:e.wordCapitalize,wordIncludeNumber:e.wordIncludeNumber,website:e.website},subaddress:{subaddressType:e.subaddressType,subaddressEmail:e.subaddressEmail,website:e.website},catchall:{catchallType:e.catchallType,catchallDomain:e.catchallDomain,website:e.website}},forwarders:t}}toUsernameOptions(e){return{type:e.generator.username,wordCapitalize:e.algorithms.effUsername.wordCapitalize,wordIncludeNumber:e.algorithms.effUsername.wordIncludeNumber,subaddressType:e.algorithms.subaddress.subaddressType,subaddressEmail:e.algorithms.subaddress.subaddressEmail,catchallType:e.algorithms.catchall.catchallType,catchallDomain:e.algorithms.catchall.catchallDomain,forwardedService:e.generator.forwarder,forwardedAnonAddyApiToken:e.forwarders.addyIo.token,forwardedAnonAddyDomain:e.forwarders.addyIo.domain,forwardedAnonAddyBaseUrl:e.forwarders.addyIo.baseUrl,forwardedDuckDuckGoToken:e.forwarders.duckDuckGo.token,forwardedFirefoxApiToken:e.forwarders.firefoxRelay.token,forwardedFastmailApiToken:e.forwarders.fastmail.token,forwardedForwardEmailApiToken:e.forwarders.forwardEmail.token,forwardedForwardEmailDomain:e.forwarders.forwardEmail.domain,forwardedSimpleLoginApiKey:e.forwarders.simpleLogin.token,forwardedSimpleLoginBaseUrl:e.forwarders.simpleLogin.baseUrl}}}const{f3:L,QS:K,Mt:X,Lq:q}=r.Hi,H=r.$p.q,{B:W,Vm:$,KQ:J,ji:Z}=r.Wy;function _(e,t,i,n,s,o,a){const l=new L,c=new V.e(e,t),d=new K(l),u=new X(l),h=new q,A=new H(new J(d,a),s),p=new H(new $(h,u,a),s),g=new H(new W(h,u,a),s),v=new H(new Z(r.IQ.AddyIo,c,t,n,i,a),s),f=new H(new Z(r.IQ.DuckDuckGo,c,t,n,i,a),s),y=new H(new Z(r.IQ.Fastmail,c,t,n,i,a),s),C=new H(new Z(r.IQ.FirefoxRelay,c,t,n,i,a),s),w=new H(new Z(r.IQ.ForwardEmail,c,t,n,i,a),s),I=new H(new Z(r.IQ.SimpleLogin,c,t,n,i,a),s),b=new m(a,s);return new Y(o,b,g,A,p,v,f,y,C,w,I)}},71464(e,t,i){"use strict";i.d(t,{T:()=>s,y:()=>o});var n=i(43890),r=i(31857);const s=new r.Ok(r.Gg,"everHadUserKey",{deserializer:e=>e,clearOn:["logout"]}),o=r.Ok.record(r.Gd,"userKey",{deserializer:e=>n.e.fromJSON(e),clearOn:["logout","lock"],cleanupDelayMs:0})},71613(e,t,i){"use strict";i.d(t,{a:()=>n});class n{}},71687(e,t,i){"use strict";i.d(t,{U:()=>Z});var n=i(23965),r=i(67553),s=i(39488),o=i(31442),a=i(90118),l=i(24593),c=i(62819),d=i(77723),u=i(74208),h=i(33812),A=i(5556),p=i(66316),g=i(35500),v=i(50700),f=i(51757),m=i(26333),y=i(93103),C=i(47428),w=i(44432),I=i(10672),b=i(57178),B=i(30930),E=i(38410),S=i(12694),Q=i(16496),k=i(75697),T=i(49112),F=i(5884),P=i(16568),R=i(77468),D=i(25740),M=i(55818),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function O(e,t){1&e&&(h.j41(0,"div"),h.nrm(1,"i",1),h.nI1(2,"i18n"),h.j41(3,"span",2),h.EFF(4),h.nI1(5,"i18n"),h.k0s()()),2&e&&(h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,3,"loading"))),h.R7$(3),h.JRh(h.bMT(5,5,"loading")))}function G(e,t){1&e&&(h.j41(0,"bit-callout",3),h.nI1(1,"i18n"),h.EFF(2),h.nI1(3,"i18n"),h.k0s()),2&e&&(h.Y8G("title",h.mNQ(h.bMT(1,3,"goodNews"))),h.R7$(2),h.SpI(" ",h.bMT(3,5,"noUnsecuredWebsites")," "))}function U(e,t){if(1&e&&(h.j41(0,"bit-toggle",14),h.EFF(1),h.nrm(2,"bit-berry",14),h.k0s()),2&e){const e=t.$implicit,i=h.XpG(5);h.Y8G("value",e),h.R7$(),h.SpI(" ",i.getName(e)," "),h.R7$(),h.Y8G("value",i.getCount(e))}}function V(e,t){if(1&e){const e=h.RV6();h.j41(0,"bit-toggle-group",13),h.nI1(1,"async"),h.nI1(2,"i18n"),h.bIt("selectedChange",function(t){u.eBV(e);const i=h.XpG(4);return u.Njj(i.filterOrgToggle(t))}),h.Z7z(3,U,3,3,"bit-toggle",14,h.fX1),h.k0s()}if(2&e){const e=h.XpG(4);h.Y8G("selected",h.bMT(1,2,e.filterOrgStatus$)),h.BMQ("aria-label",h.bMT(2,4,"addAccessFilter")),h.R7$(3),h.Dyx(e.filterStatus)}}function j(e,t){if(1&e){const e=h.RV6();h.j41(0,"bit-chip-filter",15),h.bIt("ngModelChange",function(t){u.eBV(e);const i=h.XpG(4);return u.Njj(i.filterOrgToggleChipSelect(t))}),h.k0s()}if(2&e){const e=h.XpG(4);h.Y8G("placeholderText",e.chipSelectOptions[0].label)("options",e.chipSelectOptions)("ngModel",e.selectedFilterChip)}}function N(e,t){if(1&e&&h.nVh(0,V,5,6,"bit-toggle-group",11)(1,j,1,3,"bit-chip-filter",12),2&e){const e=h.XpG(3);h.vxM(e.canDisplayToggleGroup()?0:1)}}function z(e,t){1&e&&(h.j41(0,"th",9),h.EFF(1),h.nI1(2,"i18n"),h.k0s()),2&e&&(h.R7$(),h.JRh(h.bMT(2,1,"owner")))}function Y(e,t){if(1&e){const e=h.RV6();h.j41(0,"a",20),h.nI1(1,"i18n"),h.bIt("click",function(){u.eBV(e);const t=h.XpG().$implicit,i=h.XpG(3);return u.Njj(i.selectCipher(t))}),h.EFF(2),h.k0s()}if(2&e){const e=h.XpG().$implicit;h.Y8G("title",h.mNQ(h.i5U(1,3,"editItemWithName",e.name))),h.R7$(2),h.JRh(e.name)}}function L(e,t){if(1&e&&(h.j41(0,"span",19),h.EFF(1),h.k0s()),2&e){const e=h.XpG().$implicit;h.Y8G("title",h.mNQ(e.name)),h.R7$(),h.JRh(e.name)}}function K(e,t){1&e&&(h.nrm(0,"i",21),h.nI1(1,"i18n"),h.j41(2,"span",2),h.EFF(3),h.nI1(4,"i18n"),h.k0s()),2&e&&(h.Y8G("title",h.mNQ(h.bMT(1,3,"shared"))),h.R7$(3),h.JRh(h.bMT(4,5,"shared")))}function X(e,t){1&e&&(h.nrm(0,"i",22),h.nI1(1,"i18n"),h.j41(2,"span",2),h.EFF(3),h.nI1(4,"i18n"),h.k0s()),2&e&&(h.Y8G("title",h.mNQ(h.bMT(1,3,"attachments"))),h.R7$(3),h.JRh(h.bMT(4,5,"attachments")))}function q(e,t){if(1&e&&(h.nrm(0,"app-org-badge",23),h.nI1(1,"async"),h.nI1(2,"orgNameFromId")),2&e){const e=h.XpG(2).$implicit,t=h.XpG(3);h.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",h.i5U(2,5,e.organizationId,h.bMT(1,3,t.organizations$)))}}function H(e,t){if(1&e&&(h.j41(0,"td",8),h.nVh(1,q,3,8,"app-org-badge",23),h.k0s()),2&e){const e=h.XpG(4);h.R7$(),h.vxM(e.organization?-1:1)}}function W(e,t){if(1&e&&(h.j41(0,"td",8),h.nrm(1,"app-vault-icon",16),h.k0s(),h.j41(2,"td",17),h.nVh(3,Y,3,6,"a",18)(4,L,2,3,"span",19),h.nVh(5,K,5,7),h.nVh(6,X,5,7),h.nrm(7,"br"),h.j41(8,"small"),h.EFF(9),h.k0s()(),h.nVh(10,H,2,1,"td",8)),2&e){const e=t.$implicit,i=h.XpG(3);h.R7$(),h.Y8G("cipher",e),h.R7$(2),h.vxM(!i.organization||i.canManageCipher(e)?3:4),h.R7$(2),h.vxM(!i.organization&&e.organizationId?5:-1),h.R7$(),h.vxM(e.hasAttachments?6:-1),h.R7$(3),h.JRh(e.subTitle),h.R7$(),h.vxM(i.isAdminConsoleActive?-1:10)}}function $(e,t){if(1&e&&(h.j41(0,"bit-callout",4),h.nI1(1,"i18n"),h.EFF(2),h.nI1(3,"number"),h.nI1(4,"i18n"),h.k0s(),h.nVh(5,N,2,1),h.j41(6,"bit-table-scroll",5),h.qex(7,6),h.nrm(8,"th",7),h.j41(9,"th",8),h.EFF(10),h.nI1(11,"i18n"),h.k0s(),h.nVh(12,z,3,3,"th",9),h.bVm(),h.DNE(13,W,11,6,"ng-template",10),h.k0s()),2&e){const e=h.XpG(2);h.Y8G("title",h.mNQ(h.bMT(1,8,"unsecuredWebsitesFound"))),h.R7$(2),h.SpI(" ",h.brH(4,12,"unsecuredWebsitesFoundReportDesc",h.bMT(3,10,e.ciphers.length),e.vaultMsg)," "),h.R7$(3),h.vxM(e.showFilterToggle&&!e.isAdminConsoleActive?5:-1),h.R7$(),h.Y8G("dataSource",e.dataSource)("rowSize",75),h.R7$(4),h.JRh(h.bMT(11,16,"name")),h.R7$(2),h.vxM(e.isAdminConsoleActive?-1:12)}}function J(e,t){if(1&e&&(h.j41(0,"div",0),h.nVh(1,G,4,7,"bit-callout",3)(2,$,14,18),h.k0s()),2&e){const e=h.XpG();h.R7$(),h.vxM(e.ciphers.length?2:1)}}class Z extends d.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,i,r,t,n,s,o,l,c),this.cipherService=e,this.organizationService=t,this.collectionService=a,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=>this.cipherContainsUnsecured(e));this.filterCiphersByOrg(t)})}cipherContainsUnsecured(e){if(e.type!==o.gC.Login||!e.login.hasUris||e.isDeleted||!this.organization&&!e.edit)return!1;return e.login.uris.some(e=>null!=e.uri&&0===e.uri.indexOf("http://"))}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return x(this,void 0,void 0,function*(){return e===l.r.Deleted?null:this.cipherContainsUnsecured(t)?t:null})}}Z.ɵfac=function(e){return new(e||Z)(h.rXU(A.p),h.rXU(r.PV),h.rXU(p.o3),h.rXU(g.D),h.rXU(a.qX),h.rXU(v.W),h.rXU(s.H),h.rXU(n.YD),h.rXU(a.hI),h.rXU(c.l))},Z.ɵcmp=h.VBU({type:Z,selectors:[["app-unsecured-websites-report"]],standalone:!1,features:[h.Vt3],decls:7,vars:4,consts:[[1,"tw-mt-4"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","success",3,"title"],["type","danger",3,"title"],["layout","fixed",3,"dataSource","rowSize"],["header",""],["bitCell","",1,"tw-w-12"],["bitCell",""],["bitCell","",1,"tw-w-1/3"],["bitRowDef",""],[3,"selected"],["fullWidth","true",3,"placeholderText","options","ngModel"],[3,"selectedChange","selected"],[3,"value"],["fullWidth","true",3,"ngModelChange","placeholderText","options","ngModel"],[3,"cipher"],["bitCell","",1,"tw-truncate","tw-max-w-0"],["bitLink","","href","#","appStopClick","",3,"title"],[3,"title"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared","tw-ml-1",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-1",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(h.nrm(0,"app-header"),h.j41(1,"bit-container")(2,"p"),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.nVh(5,O,6,7,"div")(6,J,3,1,"div",0),h.k0s()),2&e&&(h.R7$(3),h.JRh(h.bMT(4,2,"unsecuredWebsitesReportDesc")),h.R7$(2),h.vxM(!t.hasLoaded&&t.loading?5:6))},dependencies:[f.BC,f.vS,m.R,y.Y,C.x,w.G,I.H,b.g,B.a,E.Q,B.N,S.H,Q.a,k.P,T.f,F.W,P.c,R.Jj,R.QX,D.$,M.t],encapsulation:2})},71804(e,t,i){"use strict";i.d(t,{R:()=>n});const n=Object.freeze({Authenticator:0,Email:1,Duo:2,Yubikey:3,Remember:5,OrganizationDuo:6,WebAuthn:7,RecoveryCode:8})},71901(e,t,i){"use strict";i.d(t,{ay:()=>n,f$:()=>L});var n,r=i(51757),s=i(66046),o=i(72245),a=i(33338),l=i(14803),c=i(67553),d=i(3633),u=i(78781),h=i(31442),A=i(81525),p=i(50866),g=i(62963),v=i(33812),f=i(66316),m=i(69855),y=i(50700),C=i(37115),w=i(62166),I=i(5556),b=i(35500),B=i(11224),E=i(77468),S=i(26657),Q=i(38620),k=i(56898),T=i(44432),F=i(7730),P=i(68016),R=i(67311),D=i(7855),M=i(25740),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function O(e,t){1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.bVm()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"orgCreatedSponsorshipInvalid")," "))}function G(e,t){if(1&e&&(v.j41(0,"li"),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e){const e=t.$implicit;v.R7$(),v.Lme(" ",e.count," ",v.bMT(2,2,e.localizationKey)," ")}}function U(e,t){if(1&e&&(v.qex(0),v.EFF(1),v.nI1(2,"i18n"),v.j41(3,"ul"),v.DNE(4,G,3,4,"li",13),v.k0s(),v.EFF(5),v.nI1(6,"i18n"),v.bVm()),2&e){const e=v.XpG(2);v.R7$(),v.SpI(" ",v.i5U(2,3,"deletingOrganizationContentWarning",null==e.organization?null:e.organization.name)," "),v.R7$(3),v.Y8G("ngForOf",e.organizationContentSummary.itemCountByType),v.R7$(),v.SpI(" ",v.bMT(6,6,"deletingOrganizationActiveUserAccountsWarning")," ")}}function V(e,t){if(1&e&&v.DNE(0,U,7,8,"ng-container",12),2&e){const e=v.XpG();v.Y8G("ngIf",e.organizationContentSummary.totalItemCount>0)}}class j{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 z{constructor(){this.totalItemCount=0,this.itemCountByType=[]}}!function(e){e.Deleted="deleted",e.Canceled="canceled"}(n||(n={}));class Y{constructor(e,t,i,o,a,l,c,d,u,h,A){this.params=e,this.dialogRef=t,this.i18nService=i,this.platformUtilsService=o,this.userVerificationService=a,this.cipherService=l,this.organizationService=c,this.accountService=d,this.organizationApiService=u,this.formBuilder=h,this.toastService=A,this.destroy$=new s.B,this.deleteOrganizationRequestType="RegularDelete",this.organizationContentSummary=new z,this.formGroup=this.formBuilder.group({secret:new r.MJ(null,[r.k0.required])}),this.submit=()=>x(this,void 0,void 0,function*(){yield this.userVerificationService.buildRequest(this.formGroup.value.secret).then(e=>this.organizationApiService.delete(this.organization.id,e)),this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationDeleted"),message:this.i18nService.t("organizationDeletedDesc")}),this.dialogRef.close(n.Deleted)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnInit(){return x(this,void 0,void 0,function*(){this.deleteOrganizationRequestType=this.params.requestType;const e=yield(0,o._)((0,d.F6)(this.accountService.activeAccount$));(0,a.z)([this.organizationService.organizations$(e).pipe((0,c.Sw)(this.params.organizationId)),this.cipherService.getAllFromApiForOrganization(this.params.organizationId)]).pipe((0,l.Q)(this.destroy$)).subscribe(([e,t])=>{this.organization=e,this.organizationContentSummary=this.buildOrganizationContentSummary(t),this.loaded=!0})})}buildOrganizationContentSummary(e){const t=new z,i=e.filter(e=>null==e.deletedDate);if(i.length<1)return t;t.totalItemCount=i.length;for(const n of u.A.iterateEnum(h.gC)){const e=this.getOrganizationItemCountByType(i,n);e>0&&t.itemCountByType.push(new N(e,this.getOrganizationItemLocalizationKeysByType((0,h.g7)(n))))}return t}getOrganizationItemCountByType(e,t){return e.filter(e=>e.type==t).length}getOrganizationItemLocalizationKeysByType(e){return new j(`type${e}`,`type${e}Plural`)}}function L(e,t){return e.open(Y,t)}Y.ɵfac=function(e){return new(e||Y)(v.rXU(A.Qs),v.rXU(f.ce),v.rXU(y.W),v.rXU(C.y),v.rXU(w.i),v.rXU(I.p),v.rXU(c.PV),v.rXU(b.D),v.rXU(B.X),v.rXU(r.ok),v.rXU(m.f))},Y.ɵcmp=v.VBU({type:Y,selectors:[["app-delete-organization"]],decls:21,vars:19,consts:[["regularDelete",""],[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["id","organizationDeleteDescription"],[4,"ngIf","ngIfElse"],["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&&(v.j41(0,"form",1)(1,"bit-dialog",2)(2,"span",3),v.EFF(3),v.nI1(4,"i18n"),v.k0s(),v.j41(5,"div",4)(6,"bit-callout",5),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.j41(9,"p",6),v.DNE(10,O,3,3,"ng-container",7)(11,V,1,1,"ng-template",null,0,v.C5r),v.k0s(),v.nrm(13,"app-user-verification",8),v.k0s(),v.qex(14,9),v.j41(15,"button",10),v.EFF(16),v.nI1(17,"i18n"),v.k0s(),v.j41(18,"button",11),v.EFF(19),v.nI1(20,"i18n"),v.k0s(),v.bVm(),v.k0s()()),2&e){const e=v.sdS(12);v.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),v.R7$(),v.Y8G("loading",!t.loaded),v.R7$(2),v.JRh(v.bMT(4,10,"deleteOrganization")),v.R7$(4),v.SpI(" ",v.i5U(8,12,"deletingOrganizationIsPermanentWarning",null==t.organization?null:t.organization.name)," "),v.R7$(3),v.Y8G("ngIf","InvalidFamiliesForEnterprise"===t.deleteOrganizationRequestType)("ngIfElse",e),v.R7$(5),v.Y8G("disabled",!t.loaded),v.R7$(),v.SpI(" ",v.bMT(17,15,"deleteOrganization")," "),v.R7$(3),v.SpI(" ",v.bMT(20,17,"cancel")," ")}},dependencies:[g.G,E.Sq,E.bT,r.qT,r.BC,r.cb,r.j4,r.JD,S.$,Q.L,k.Q,T.G,F.I,P.m,R.hJ,p.R6,D.q,M.$],encapsulation:2})},72142(e,t,i){"use strict";i.d(t,{H:()=>r});var n=i(8583);class r extends n.n{get maskedPrivateKey(){if(!this.privateKey||0===this.privateKey.length)return"";let e=this.privateKey.split("\n").filter(e=>""!==e.trim());return e=e.map((t,i)=>0===i||i===e.length-1?t:this.maskLine(t)),e.join("\n")}maskLine(e){return"•".repeat(32)}get subTitle(){return this.keyFingerprint}static fromJSON(e){return Object.assign(new r,e)}static fromSdkSshKeyView(e){const t=new r;return t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.fingerprint,t}toSdkSshKeyView(){return{privateKey:this.privateKey,publicKey:this.publicKey,fingerprint:this.keyFingerprint}}}},72331(e,t,i){"use strict";i.d(t,{d:()=>n});class n{}},72523(e,t,i){"use strict";i.d(t,{w:()=>te});var n=i(67553),r=i(78781),s=i(63457),o=i(39488),a=i(31442),l=i(90118),c=i(24593),d=i(62819),u=i(77723),h=i(74208),A=i(33812),p=i(5556),g=i(66316),v=i(35500),f=i(50700),m=i(51757),y=i(26333),C=i(93103),w=i(47428),I=i(47696),b=i(44432),B=i(10672),E=i(57178),S=i(30930),Q=i(38410),k=i(32316),T=i(12694),F=i(16496),P=i(75697),R=i(49112),D=i(5884),M=i(16568),x=i(77468),O=i(25740),G=i(55818),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function V(e,t){1&e&&(A.j41(0,"div"),A.nrm(1,"i",1),A.nI1(2,"i18n"),A.j41(3,"span",2),A.EFF(4),A.nI1(5,"i18n"),A.k0s()()),2&e&&(A.R7$(),A.Y8G("title",A.mNQ(A.bMT(2,3,"loading"))),A.R7$(3),A.JRh(A.bMT(5,5,"loading")))}function j(e,t){1&e&&(A.j41(0,"bit-callout",3),A.nI1(1,"i18n"),A.EFF(2),A.nI1(3,"i18n"),A.k0s()),2&e&&(A.Y8G("title",A.mNQ(A.bMT(1,3,"goodNews"))),A.R7$(2),A.SpI(" ",A.bMT(3,5,"noWeakPasswords")," "))}function N(e,t){if(1&e&&(A.j41(0,"bit-toggle",15),A.EFF(1),A.nrm(2,"bit-berry",15),A.k0s()),2&e){const e=t.$implicit,i=A.XpG(5);A.Y8G("value",e),A.R7$(),A.SpI(" ",i.getName(e)," "),A.R7$(),A.Y8G("value",i.getCount(e))}}function z(e,t){if(1&e){const e=A.RV6();A.j41(0,"bit-toggle-group",14),A.nI1(1,"async"),A.nI1(2,"i18n"),A.bIt("selectedChange",function(t){h.eBV(e);const i=A.XpG(4);return h.Njj(i.filterOrgToggle(t))}),A.Z7z(3,N,3,3,"bit-toggle",15,A.fX1),A.k0s()}if(2&e){const e=A.XpG(4);A.Y8G("selected",A.bMT(1,2,e.filterOrgStatus$)),A.BMQ("aria-label",A.bMT(2,4,"addAccessFilter")),A.R7$(3),A.Dyx(e.filterStatus)}}function Y(e,t){if(1&e){const e=A.RV6();A.j41(0,"bit-chip-filter",16),A.bIt("ngModelChange",function(t){h.eBV(e);const i=A.XpG(4);return h.Njj(i.filterOrgToggleChipSelect(t))}),A.k0s()}if(2&e){const e=A.XpG(4);A.Y8G("placeholderText",e.chipSelectOptions[0].label)("options",e.chipSelectOptions)("ngModel",e.selectedFilterChip)}}function L(e,t){if(1&e&&A.nVh(0,z,5,6,"bit-toggle-group",12)(1,Y,1,3,"bit-chip-filter",13),2&e){const e=A.XpG(3);A.vxM(e.canDisplayToggleGroup()?0:1)}}function K(e,t){1&e&&(A.j41(0,"th",9),A.EFF(1),A.nI1(2,"i18n"),A.k0s()),2&e&&(A.R7$(),A.SpI(" ",A.bMT(2,1,"owner")," "))}function X(e,t){if(1&e){const e=A.RV6();A.j41(0,"a",24),A.nI1(1,"i18n"),A.bIt("click",function(){h.eBV(e);const t=A.XpG().$implicit,i=A.XpG(3);return h.Njj(i.selectCipher(t))}),A.EFF(2),A.k0s()}if(2&e){const e=A.XpG().$implicit;A.Y8G("title",A.mNQ(A.i5U(1,3,"editItemWithName",e.name))),A.R7$(2),A.JRh(e.name)}}function q(e,t){if(1&e&&(A.j41(0,"span",21),A.EFF(1),A.k0s()),2&e){const e=A.XpG().$implicit;A.Y8G("title",A.mNQ(e.name)),A.R7$(),A.JRh(e.name)}}function H(e,t){1&e&&(A.nrm(0,"i",25),A.nI1(1,"i18n"),A.j41(2,"span",2),A.EFF(3),A.nI1(4,"i18n"),A.k0s()),2&e&&(A.Y8G("title",A.mNQ(A.bMT(1,3,"shared"))),A.R7$(3),A.JRh(A.bMT(4,5,"shared")))}function W(e,t){1&e&&(A.nrm(0,"i",26),A.nI1(1,"i18n"),A.j41(2,"span",2),A.EFF(3),A.nI1(4,"i18n"),A.k0s()),2&e&&(A.Y8G("title",A.mNQ(A.bMT(1,3,"attachments"))),A.R7$(3),A.JRh(A.bMT(4,5,"attachments")))}function $(e,t){if(1&e&&(A.nrm(0,"app-org-badge",27),A.nI1(1,"async"),A.nI1(2,"orgNameFromId")),2&e){const e=A.XpG(2).$implicit,t=A.XpG(3);A.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",A.i5U(2,5,e.organizationId,A.bMT(1,3,t.organizations$)))}}function J(e,t){if(1&e&&(A.j41(0,"td",17),A.nVh(1,$,3,8,"app-org-badge",27),A.k0s()),2&e){const e=A.XpG(4);A.R7$(),A.vxM(e.organization?-1:1)}}function Z(e,t){if(1&e&&(A.j41(0,"td",17),A.nrm(1,"app-vault-icon",18),A.k0s(),A.j41(2,"td",19),A.nVh(3,X,3,6,"a",20)(4,q,2,3,"span",21),A.nVh(5,H,5,7),A.nVh(6,W,5,7),A.nrm(7,"br"),A.j41(8,"small"),A.EFF(9),A.k0s()(),A.nVh(10,J,2,1,"td",17),A.j41(11,"td",22)(12,"span",23),A.EFF(13),A.nI1(14,"i18n"),A.k0s()()),2&e){const e=t.$implicit,i=A.XpG(3);A.R7$(),A.Y8G("cipher",e),A.R7$(2),A.vxM(!i.organization||i.canManageCipher(e)?3:4),A.R7$(2),A.vxM(!i.organization&&e.organizationId?5:-1),A.R7$(),A.vxM(e.hasAttachments?6:-1),A.R7$(3),A.JRh(e.subTitle),A.R7$(),A.vxM(i.isAdminConsoleActive?-1:10),A.R7$(2),A.Y8G("variant",e.reportValue.badgeVariant),A.R7$(),A.SpI(" ",A.bMT(14,8,e.reportValue.label)," ")}}function _(e,t){if(1&e&&(A.j41(0,"bit-callout",4),A.nI1(1,"i18n"),A.EFF(2),A.nI1(3,"number"),A.nI1(4,"i18n"),A.k0s(),A.nVh(5,L,2,1),A.j41(6,"bit-table-scroll",5),A.qex(7,6),A.nrm(8,"th",7),A.j41(9,"th",8),A.EFF(10),A.nI1(11,"i18n"),A.k0s(),A.nVh(12,K,3,3,"th",9),A.j41(13,"th",10),A.EFF(14),A.nI1(15,"i18n"),A.k0s(),A.bVm(),A.DNE(16,Z,15,10,"ng-template",11),A.k0s()),2&e){const e=A.XpG(2);A.Y8G("title",A.mNQ(A.bMT(1,9,"weakPasswordsFound"))),A.R7$(2),A.SpI(" ",A.brH(4,13,"weakPasswordsFoundReportDesc",A.bMT(3,11,e.ciphers.length),e.vaultMsg)," "),A.R7$(3),A.vxM(e.showFilterToggle&&!e.isAdminConsoleActive?5:-1),A.R7$(),A.Y8G("dataSource",e.dataSource)("rowSize",54),A.R7$(4),A.JRh(A.bMT(11,17,"name")),A.R7$(2),A.vxM(e.isAdminConsoleActive?-1:12),A.R7$(2),A.SpI(" ",A.bMT(15,19,"weakness")," ")}}function ee(e,t){if(1&e&&(A.j41(0,"div",0),A.nVh(1,j,4,7,"bit-callout",3)(2,_,17,21),A.k0s()),2&e){const e=A.XpG();A.R7$(),A.vxM(e.ciphers.length?2:1)}}class te extends u.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,n,s,i,r,o,a,l,c),this.cipherService=e,this.passwordStrengthService=t,this.organizationService=i,this.accountService=r,this.adminConsoleCipherFormConfigService=c,this.disabled=!0,this.weakPasswordCiphers=[]}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return U(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return U(this,void 0,void 0,function*(){const e=yield this.getAllCiphers();this.weakPasswordCiphers=[],this.filterStatus=[0],this.findWeakPasswords(e)})}determinedUpdatedCipherReportStatus(e,t){return U(this,void 0,void 0,function*(){if(e===c.r.Deleted)return this.weakPasswordCiphers=this.weakPasswordCiphers.filter(e=>e.id!==t.id),null;const i=yield this.determineWeakPasswordScore(t),n=this.weakPasswordCiphers.findIndex(e=>e.id===t.id);return-1!==n&&(null!==i?this.weakPasswordCiphers[n]=i:this.weakPasswordCiphers.splice(n,1)),i})}findWeakPasswords(e){e.forEach(e=>{const t=this.determineWeakPasswordScore(e);null!=t&&this.weakPasswordCiphers.push(t)}),this.filterCiphersByOrg(this.weakPasswordCiphers)}determineWeakPasswordScore(e){const{type:t,login:i,isDeleted:n,edit:r,viewPassword:s}=e;if(t!==a.gC.Login||null==i||null==i.password||""===i.password||n||!this.organization&&!r||!s)return;let o=[];if(this.isUserNameNotEmpty(e)){const e=i.username.indexOf("@");o=e>-1?o.concat(i.username.substr(0,e).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 l=this.passwordStrengthService.getPasswordStrength(i.password,null,o.length>0?o:null);if(null!=l.score&&l.score<=2){const t=this.scoreKey(l.score);return Object.assign(Object.assign({},e),{score:l.score,reportValue:t,scoreKey:t.sortOrder})}return null}canManageCipher(e){return!0}isUserNameNotEmpty(e){return!r.A.isNullOrWhitespace(e.login.username)}scoreKey(e){switch(e){case 4:return{label:"strong",badgeVariant:"success",sortOrder:1};case 3:return{label:"good",badgeVariant:"primary",sortOrder:2};case 2:return{label:"weak",badgeVariant:"warning",sortOrder:3};default:return{label:"veryWeak",badgeVariant:"danger",sortOrder:4}}}}te.ɵfac=function(e){return new(e||te)(A.rXU(p.p),A.rXU(s.Q),A.rXU(n.PV),A.rXU(g.o3),A.rXU(v.D),A.rXU(l.qX),A.rXU(f.W),A.rXU(o.H),A.rXU(l.hI),A.rXU(d.l))},te.ɵcmp=A.VBU({type:te,selectors:[["app-weak-passwords-report"]],standalone:!1,features:[A.Vt3],decls:7,vars:4,consts:[[1,"tw-mt-4"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","success",3,"title"],["type","danger",3,"title"],["layout","fixed",3,"dataSource","rowSize"],["header",""],["bitCell","",1,"tw-w-12"],["bitCell","","bitSortable","name"],["bitCell","","bitSortable","organizationId",1,"tw-w-1/4"],["bitCell","","bitSortable","scoreKey","default","desc",1,"tw-text-right"],["bitRowDef",""],[3,"selected"],["fullWidth","true",3,"placeholderText","options","ngModel"],[3,"selectedChange","selected"],[3,"value"],["fullWidth","true",3,"ngModelChange","placeholderText","options","ngModel"],["bitCell",""],[3,"cipher"],["bitCell","",1,"tw-truncate","tw-max-w-0"],["bitLink","","href","#","appStopClick","",3,"title"],[3,"title"],["bitCell","",1,"tw-text-right"],["bitBadge","",3,"variant"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared","tw-ml-1",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-1",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(A.nrm(0,"app-header"),A.j41(1,"bit-container")(2,"p"),A.EFF(3),A.nI1(4,"i18n"),A.k0s(),A.nVh(5,V,6,7,"div")(6,ee,3,1,"div",0),A.k0s()),2&e&&(A.R7$(3),A.JRh(A.bMT(4,2,"weakPasswordsReportDesc")),A.R7$(2),A.vxM(!t.hasLoaded&&t.loading?5:6))},dependencies:[m.BC,m.vS,y.R,C.Y,w.x,I.n,b.G,B.H,E.g,S.a,Q.Q,k.O,S.N,T.H,F.a,P.P,R.f,D.W,M.c,x.Jj,x.QX,O.$,G.t],encapsulation:2})},72868(e,t,i){"use strict";i.d(t,{C:()=>s});var n=i(20702),r=i(95919);class s extends n.r{constructor(e){var t,i,n,s,o,a,l,c;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.useOrganizationDomains=this.getResponseProperty("UseOrganizationDomains"),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.useAutomaticUserConfirmation=this.getResponseProperty("UseAutomaticUserConfirmation"),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 r.n(this.getResponseProperty("permissions")),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.userId=this.getResponseProperty("UserId"),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),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.productTierType=this.getResponseProperty("ProductTierType"),this.keyConnectorEnabled=null!==(s=this.getResponseProperty("KeyConnectorEnabled"))&&void 0!==s&&s,this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl");const d=this.getResponseProperty("FamilySponsorshipLastSyncDate");d&&(this.familySponsorshipLastSyncDate=new Date(d));const u=this.getResponseProperty("FamilySponsorshipValidUntil");u&&(this.familySponsorshipValidUntil=new Date(u)),this.familySponsorshipToDelete=this.getResponseProperty("FamilySponsorshipToDelete"),this.accessSecretsManager=this.getResponseProperty("AccessSecretsManager"),this.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion"),this.limitItemDeletion=this.getResponseProperty("LimitItemDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.userIsManagedByOrganization=this.getResponseProperty("UserIsManagedByOrganization"),this.useAccessIntelligence=this.getResponseProperty("UseRiskInsights"),this.useAdminSponsoredFamilies=this.getResponseProperty("UseAdminSponsoredFamilies"),this.useDisableSMAdsForUsers=null!==(o=this.getResponseProperty("UseDisableSMAdsForUsers"))&&void 0!==o&&o,this.isAdminInitiated=this.getResponseProperty("IsAdminInitiated"),this.ssoEnabled=null!==(a=this.getResponseProperty("SsoEnabled"))&&void 0!==a&&a,this.ssoMemberDecryptionType=this.getResponseProperty("SsoMemberDecryptionType"),this.usePhishingBlocker=null!==(l=this.getResponseProperty("UsePhishingBlocker"))&&void 0!==l&&l,this.useMyItems=null!==(c=this.getResponseProperty("UseMyItems"))&&void 0!==c&&c}}},72932(e,t,i){"use strict";i.d(t,{G:()=>o});var n=i(49112),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.f]})},73386(e,t,i){"use strict";i.d(t,{m:()=>d});var n=i(59777),r=i(78781),s=i(17989),o=i(24072),a=i(76506),l=i(16671),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends s.A{constructor(e){var t;super(),null!=e&&(this.uri=(0,o.e)(e.uri),this.uriChecksum=(0,o.e)(e.uriChecksum),this.match=null!==(t=e.match)&&void 0!==t?t:void 0)}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new l.z(this),["uri"],e,t)}validateChecksum(e,t){return c(this,void 0,void 0,function*(){if(null==this.uriChecksum)return!1;const i=r.A.getContainerService().getEncryptService(),n=yield i.hash(e,"sha256");return(yield i.decryptString(this.uriChecksum,t))===n})}toLoginUriData(){const e=new a.S;return this.buildDataModel(this,e,{uri:null,uriChecksum:null,match:null},["match"]),e}static fromJSON(e){var t;if(null==e)return;const i=new d;return i.uri=(0,o.u)(e.uri),i.match=null!==(t=e.match)&&void 0!==t?t:void 0,i.uriChecksum=(0,o.u)(e.uriChecksum),i}toSdkLoginUri(){var e,t;return{uri:null===(e=this.uri)||void 0===e?void 0:e.toSdk(),uriChecksum:null===(t=this.uriChecksum)||void 0===t?void 0:t.toSdk(),match:(0,n.D)(this.match)}}static fromSdkLoginUri(e){if(null==e)return;const t=new d;return t.uri=(0,o.u)(e.uri),t.uriChecksum=(0,o.u)(e.uriChecksum),t.match=e.match,t}}},73409(e,t,i){"use strict";i.d(t,{U:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.readOnly=this.getResponseProperty("ReadOnly"),this.hidePasswords=this.getResponseProperty("HidePasswords"),this.manage=this.getResponseProperty("Manage")}}},73556(e,t,i){"use strict";i.d(t,{Jq:()=>a,j:()=>s});var n=i(20702),r=i(78781);class s extends n.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled");const t=this.getResponseProperty("Keys");this.keys=null==t?null:t.map(e=>new o(e))}}class o extends n.r{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.id=this.getResponseProperty("Id"),this.migrated=this.getResponseProperty("Migrated")}}class a extends n.r{constructor(e){super(e),this.attestation=this.getResponseProperty("attestation"),this.authenticatorSelection=this.getResponseProperty("authenticatorSelection"),this.challenge=r.A.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.excludeCredentials=this.getResponseProperty("excludeCredentials").map(e=>(e.id=r.A.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=r.A.fromUrlB64ToArray(t.id),this.user=t}}},73638(e,t,i){"use strict";i.d(t,{oG:()=>fe,I4:()=>Dt,qG:()=>Rt,iE:()=>a,PG:()=>Vt,IQ:()=>K,WV:()=>ye,ZU:()=>me,WX:()=>J,Hi:()=>n,MP:()=>Ft,$S:()=>Tt,xu:()=>Qt,W0:()=>Pt,yJ:()=>kt,r5:()=>s,$p:()=>r,Wy:()=>o});var n={};i.r(n),i.d(n,{Lq:()=>Re,Mt:()=>Pe,sF:()=>be,Zx:()=>je,f3:()=>$,zT:()=>ze,QS:()=>Le});var r={};i.r(r),i.d(r,{P:()=>Vt,q:()=>ee});var s={};i.r(s),i.d(s,{i:()=>Yt,O:()=>Lt});var o={};i.r(o),i.d(o,{B:()=>Ai,KQ:()=>mi,ji:()=>ii,jK:()=>ci,gb:()=>ui,Vm:()=>gi});class a{}const l=Object.freeze({catchallType:"random",catchallDomain:"",website:null});const c=function(){const e=Object.freeze({min:3,max:20});return Object.freeze({numWords:e})}();const d=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})}(),u=Object.freeze({wordCapitalize:!1,wordIncludeNumber:!1,website:null}),h=Object.freeze({numWords:6,wordSeparator:"-",capitalize:!1,includeNumber:!1}),A=Object.freeze({length:14,minLength:d.length.min,ambiguous:!0,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,number:!0,minNumber:1,special:!1,minSpecial:0}),p=Object.freeze({subaddressType:"random",subaddressEmail:"",website:null});var g=i(31857),v=i(19638),f=i(48312);class m{constructor(e){this.keys=e}classify(e){const t=JSON.parse(JSON.stringify(e)),i={};for(const n of this.keys)i[n]=t[n];return{disclosed:i,secret:null}}declassify(e,t){const i={};for(const n of this.keys)i[n]=e[n];return i}}var y=i(4132);const C=Object.freeze({token:"",domain:"",baseUrl:""}),w=Object.freeze({url:(e,t)=>t.baseUrl()+"/api/v1/aliases",body:(e,t)=>({domain:t.emailDomain(),description:t.generatedBy(e,{extractHostname:!0,maxLength:200})}),hasJsonPayload:e=>200===e.status||201===e.status,processJson(e){var t;return[null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.email]}}),I=Object.freeze({defaultSettings:C,createForwardingEmail:w,request:["token","baseUrl","domain"],settingsConstraints:{token:{required:!0},domain:{required:!0},baseUrl:{}},local:{settings:{key:"addyIoForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:C,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.AddyIo.local.import",target:"object",format:"plain",classifier:new m(["token","baseUrl","domain"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"addyIoForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"addyIoBuffer",{deserializer:e=>e,clearOn:["logout"]})}),b=Object.freeze({id:v.N.addyio,name:"Addy.io",extends:["forwarder"],selfHost:"maybe",baseUrl:"https://app.addy.io",authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:I}),B=Object.freeze({token:""}),E=Object.freeze({url:(e,t)=>t.baseUrl()+"/email/addresses",body(e,t){},hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[`${e.address}@duck.com`]}),S=Object.freeze({defaultSettings:B,createForwardingEmail:E,request:["token"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"duckDuckGoForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:B,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.DuckDuckGo.local.import",target:"object",format:"plain",classifier:new m(["token"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"duckDuckGoForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"duckDuckGoBuffer",{deserializer:e=>e,clearOn:["logout"]})}),Q=Object.freeze({id:v.N.duckduckgo,name:"DuckDuckGo",baseUrl:"https://quack.duckduckgo.com/api",selfHost:"never",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:S}),k=Object.freeze({domain:"",prefix:"",token:""}),T=Object.freeze({url:(e,t)=>t.baseUrl()+"/jmap/session",hasJsonPayload:e=>200===e.status,processJson(e,t){var i,n;const r=null!==(n=null===(i=e.primaryAccounts)||void 0===i?void 0:i["https://www.fastmail.com/dev/maskedemail"])&&void 0!==n?n:void 0;return[r,r?void 0:t.missingAccountIdCause()]}}),F=Object.freeze({url:(e,t)=>t.baseUrl()+"/jmap/api/",body:(e,t)=>({using:["https://www.fastmail.com/dev/maskedemail","urn:ietf:params:jmap:core"],methodCalls:[["MaskedEmail/set",{accountId:e.accountId,create:{"new-masked-email":{state:"enabled",description:"",forDomain:t.website(e),emailPrefix:""}}},"0"]]}),hasJsonPayload:e=>200===e.status,processJson(e){var t,i,n,r,s,o,a,l,c,d,u;if(null!=e.methodResponses&&e.methodResponses.length>0&&e.methodResponses[0].length>0)if("MaskedEmail/set"===e.methodResponses[0][0]){if(null!=(null===(i=null===(t=e.methodResponses[0][1])||void 0===t?void 0:t.created)||void 0===i?void 0:i["new-masked-email"])){return[null===(s=null===(r=null===(n=e.methodResponses[0][1])||void 0===n?void 0:n.created)||void 0===r?void 0:r["new-masked-email"])||void 0===s?void 0:s.email]}if(null!=(null===(a=null===(o=e.methodResponses[0][1])||void 0===o?void 0:o.notCreated)||void 0===a?void 0:a["new-masked-email"])){return[void 0,null===(d=null===(c=null===(l=e.methodResponses[0][1])||void 0===l?void 0:l.notCreated)||void 0===c?void 0:c["new-masked-email"])||void 0===d?void 0:d.description]}}else if("error"===e.methodResponses[0][0]){return[void 0,null===(u=e.methodResponses[0][1])||void 0===u?void 0:u.description]}}}),P=Object.freeze({defaultSettings:k,createForwardingEmail:F,getAccountId:T,request:["token"],settingsConstraints:{token:{required:!0},domain:{required:!0},prefix:{}},local:{settings:{key:"fastmailForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:k,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.Fastmail.local.import",target:"object",format:"plain",classifier:new m(["token"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"fastmailForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"fastmailBuffer",{deserializer:e=>e,clearOn:["logout"]})}),R=Object.freeze({id:v.N.fastmail,name:"Fastmail",baseUrl:"https://api.fastmail.com",selfHost:"maybe",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:P}),D=Object.freeze({token:""}),M=Object.freeze({url:(e,t)=>t.baseUrl()+"/v1/relayaddresses/",body:(e,t)=>({enabled:!0,generated_for:t.website(e,{maxLength:255}),description:t.generatedBy(e,{extractHostname:!0,maxLength:64})}),hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[e.full_address]}),x=Object.freeze({defaultSettings:D,createForwardingEmail:M,request:["token"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"firefoxRelayForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:D,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.Firefox.local.import",target:"object",format:"plain",classifier:new m(["token"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"firefoxRelayForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"firefoxRelayBuffer",{deserializer:e=>e,clearOn:["logout"]})}),O=Object.freeze({id:v.N.mozilla,name:"Firefox Relay",baseUrl:"https://relay.firefox.com/api",selfHost:"never",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Token "+t.authenticationToken()}),forwarder:x}),G=Object.freeze({token:"",domain:""}),U=Object.freeze({url(e,t){const i=t.emailDomain();return t.baseUrl()+`/v1/domains/${i}/aliases`},body:(e,t)=>({labels:t.website(e),description:t.generatedBy(e)}),hasJsonPayload:e=>200===e.status||201===e.status,processJson(e,t){var i;const{name:n,domain:r}=e;return[`${n}@${null!==(i=null==r?void 0:r.name)&&void 0!==i?i:t.emailDomain()}`]}}),V=Object.freeze({defaultSettings:G,request:["token","domain"],settingsConstraints:{token:{required:!0},domain:{required:!0}},local:{settings:{key:"forwardEmailForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:G,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.ForwardEmail.local.import",target:"object",format:"plain",classifier:new m(["token","domain"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"forwardEmailForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"forwardEmailBuffer",{deserializer:e=>e,clearOn:["logout"]}),createForwardingEmail:U}),j=Object.freeze({id:v.N.forwardemail,name:"Forward Email",extends:["forwarder"],selfHost:"never",baseUrl:"https://api.forwardemail.net",authenticate:(e,t)=>({Authorization:"Basic "+t.authenticationToken({base64:!0,suffix:":"})}),forwarder:V}),N=Object.freeze({token:"",domain:"",baseUrl:""}),z=Object.freeze({url(e,t){const i=t.baseUrl()+"/api/alias/random/new",n=t.website(e);return""!==n?`${i}?hostname=${n}`:i},body:(e,t)=>({note:t.generatedBy(e)}),hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[null==e?void 0:e.alias]}),Y=Object.freeze({defaultSettings:N,createForwardingEmail:z,request:["token","baseUrl"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"simpleLoginForwarder",target:"object",format:"secret-state",frame:512,classifier:new f.r,state:g.qd,initial:N,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.SimpleLogin.local.import",target:"object",format:"plain",classifier:new m(["token","baseUrl"]),state:g.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new g.Ok(g.qd,"simpleLoginForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new y.A(g.qd,"simpleLoginBuffer",{deserializer:e=>e,clearOn:["logout"]})}),L=Object.freeze({id:v.N.simplelogin,name:"SimpleLogin",selfHost:"maybe",extends:["forwarder"],baseUrl:"https://app.simplelogin.io",authenticate:(e,t)=>({Authentication:t.authenticationToken()}),forwarder:Y}),K=Object.freeze({AddyIo:b,DuckDuckGo:Q,Fastmail:R,FirefoxRelay:O,ForwardEmail:j,SimpleLogin:L}),X=new Map(Object.values(K).map(e=>[e.id,e]));var q=i(62870),H=i(82781),W=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ${constructor(){}pick(e){return W(this,void 0,void 0,function*(){var t;if((null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)<=0)throw new Error("list must have at least one entry.");const i=yield this.uniform(0,e.length-1);return e[i]})}pickWord(e,t){return W(this,void 0,void 0,function*(){var i,n;let r=yield this.pick(e);if(null!==(i=null==t?void 0:t.titleCase)&&void 0!==i&&i&&(r=r.charAt(0).toUpperCase()+r.slice(1)),null!==(n=null==t?void 0:t.number)&&void 0!==n&&n){yield q.B.Ready;r+=H.PureCrypto.random_number(0,9).toString()}return r})}shuffle(e,t){return W(this,void 0,void 0,function*(){var i,n;if((null!==(i=null==e?void 0:e.length)&&void 0!==i?i:0)<=0)throw new Error("items must have at least one entry.");const r=null===(n=null==t?void 0:t.copy)||void 0===n||n?[...e]:e;for(let e=r.length-1;e>0;e--){const t=yield this.uniform(0,e);[r[e],r[t]]=[r[t],r[e]]}return r})}chars(e){return W(this,void 0,void 0,function*(){let t="";const i="abcdefghijklmnopqrstuvwxyz1234567890";for(let n=0;n<e;n++){const e=yield this.uniform(0,35);t+=i.charAt(e)}return t})}uniform(e,t){return W(this,void 0,void 0,function*(){return yield q.B.Ready,H.PureCrypto.random_number(e,t)})}}function J(){return new $}var Z=i(72245),_=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ee{constructor(e,t){this.strategy=e,this.policy=t,this._evaluators$=new Map}options$(e){return this.strategy.durableState(e).state$}defaults$(e){return this.strategy.defaults$(e)}saveOptions(e,t){return _(this,void 0,void 0,function*(){yield this.strategy.durableState(e).update(()=>t)})}evaluator$(e){let t=this._evaluators$.get(e);return t||(t=this.createEvaluator(e),this._evaluators$.set(e,t)),t}createEvaluator(e){return this.policy.policiesByType$(this.strategy.policy,e).pipe(this.strategy.toEvaluator())}enforcePolicy(e,t){return _(this,void 0,void 0,function*(){const i=yield(0,Z._)(this.evaluator$(e)),n=i.applyPolicy(t);return i.sanitize(n)})}generate(e){return _(this,void 0,void 0,function*(){return yield this.strategy.generate(e)})}}var te=i(27442),ie=i(44500),ne=i(93695),re=i(14928),se=i(69194),oe=i(88507),ae=i(3204),le=i(36359),ce=i(3097),de=i(72737),ue=i(8029),he=i(96141),Ae=i(73276),pe=i(14803),ge=i(20377),ve=i(78991);const fe=Object.freeze({password:"password",passphrase:"passphrase",username:"username",catchall:"catchall",plusAddress:"subaddress"}),me=Object.freeze({password:"password",username:"username",email:"email"}),ye=Object.freeze({account:"account"}),Ce=(0,ve.ol)({[me.password]:[fe.password,fe.passphrase],[me.username]:[fe.username],[me.email]:[fe.catchall,fe.plusAddress]});var we=i(78781);class Ie{constructor(e,t,i){this.metadata=e,this.settings=t,this.i18n=i}baseUrl(){var e,t;const i=null!==(e=this.settings&&"baseUrl"in this.settings?this.settings.baseUrl:void 0)&&void 0!==e?e:"";let n="";if(n="always"===this.metadata.selfHost?i:"never"===this.metadata.selfHost||i.length<=0?null!==(t=this.metadata.baseUrl)&&void 0!==t?t:"":i,""===n){throw this.i18n.t("forwarderNoUrl",this.metadata.name)}return n}authenticationToken(e=null){var t,i;let n="token"in this.settings&&null!==(t=this.settings.token)&&void 0!==t?t:"";if(""===n){throw this.i18n.t("forwaderInvalidToken",this.metadata.name)}return n+=null!==(i=null==e?void 0:e.suffix)&&void 0!==i?i:"",(null==e?void 0:e.base64)&&(n=we.A.fromUtf8ToB64(n)),n}website(e,t){var i,n;let r=null!==(i=e.website)&&void 0!==i?i:"";return(null==t?void 0:t.extractHostname)&&(r=null!==(n=we.A.getHost(r))&&void 0!==n?n:r),r.slice(0,null==t?void 0:t.maxLength)}generatedBy(e,t){var i;const n=this.website(e,{extractHostname:null!==(i=null==t?void 0:t.extractHostname)&&void 0!==i&&i}),r=""===n?"forwarderGeneratedBy":"forwarderGeneratedByWithWebsite";return this.i18n.t(r,n).slice(0,null==t?void 0:t.maxLength)}}class be extends Ie{constructor(e,t,i){super(e,t,i),this.configuration=e}emailDomain(){var e;const t="domain"in this.settings&&null!==(e=this.settings.domain)&&void 0!==e?e:"";if(""===t){throw this.i18n.t("forwarderNoDomain",this.configuration.name)}return t}emailPrefix(){var e;const t="prefix"in this.settings&&null!==(e=this.settings.prefix)&&void 0!==e?e:"";if(""===t){throw this.i18n.t("forwarderNoPrefix",this.configuration.name)}return t}missingAccountIdCause(){return this.i18n.t("forwarderNoAccountId",this.configuration.name)}}var Be=i(30126);class Ee{constructor(e,t,i,n,r){this.credential=e,this.category=t,this.source=n,this.website=r,this.generationDate="number"==typeof i?new Date(i):i}static fromJSON(e){return new Ee(e.credential,e.category,e.generationDate)}toJSON(){return{credential:this.credential,category:this.category,generationDate:this.generationDate.valueOf()}}}function Se(e){const t=e.split("");return Object.freeze(t)}const Qe=Se("!@#$%^&*"),ke=Object.freeze({Full:Object.freeze({Uppercase:Se("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),Lowercase:Se("abcdefghijklmnopqrstuvwxyz"),Digit:Se("0123456789"),Special:Qe}),Unmistakable:Object.freeze({Uppercase:Se("ABCDEFGHJKLMNPQRSTUVWXYZ"),Lowercase:Se("abcdefghijkmnopqrstuvwxyz"),Digit:Se("23456789"),Special:Qe})}),Te=new RegExp("(?<username>[^@+]+)(?<subaddress>\\+.+)?(?<domain>@.+)");var Fe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Pe{constructor(e){this.random=e}randomAsciiSubaddress(e,t){return Fe(this,void 0,void 0,function*(){var i,n;let r=null!=e?e:"";const s=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:8;if(s<1)return r;const o=Te.exec(r);if(!o)return r;let a=null!==(n=o.groups.subaddress)&&void 0!==n?n:"+";return a+=(yield this.random.chars(s)),r=`${o.groups.username}${a}${o.groups.domain}`,r})}randomAsciiCatchall(e,t){return Fe(this,void 0,void 0,function*(){var i;if(((null==e?void 0:e.startsWith("@"))?e.substring(1,1/0):null!=e?e:"").length<1)return null;const n=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:8;if(n<1)return null;return`${yield this.random.chars(n)}@${e}`})}randomWordsCatchall(e,t){return Fe(this,void 0,void 0,function*(){var i,n;if(((null==e?void 0:e.startsWith("@"))?e.substring(1,1/0):null!=e?e:"").length<1)return null;const r=null!==(i=null==t?void 0:t.numberOfWords)&&void 0!==i?i:1;if(r<1)return null;const s=null!==(n=null==t?void 0:t.words)&&void 0!==n?n:Be.o,o=[];for(let e=0;e<r;e++)o[e]=yield this.random.pickWord(s,{titleCase:0!==e});return`${o.join("")}@${e}`})}generate(e,t){return Fe(this,void 0,void 0,function*(){if(function(e){return"catchallDomain"in(null!=e?e:{})}(t)){const i=yield this.randomAsciiCatchall(t.catchallDomain);return new Ee(i,me.email,Date.now(),e.source,e.website)}if(function(e){return"subaddressEmail"in(null!=e?e:{})}(t)){const i=yield this.randomAsciiSubaddress(t.subaddressEmail);return new Ee(i,me.email,Date.now(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}class Re{appendToSubaddress(e,t){var i;let n=(null!=t?t:"").trim();const r=(null!=e?e:"").trim();if(r.length<1)return n;const s=Te.exec(n);if(!s)return n;const o=(null!==(i=s.groups.subaddress)&&void 0!==i?i:"+")+r;return n=`${s.groups.username}${o}${s.groups.domain}`,n}concatenate(e,t){const i=(null==t?void 0:t.startsWith("@"))?t.substring(1,1/0):null!=t?t:"";if(i.length<1)return null;const n=null!=e?e:"";if(n.length<1)return null;return`${n}@${i}`}}var De=i(16878);function Me(e){const t=new Map;return i=>{let n=t.get(i);if(void 0===n){const r=e();n=new De.t(Object.assign({},r)),t.set(i,n)}return n.asObservable()}}function xe(e,t){return i=>t.getUser(i,e)}const Oe=(...e)=>(null!=e?e:[]).reduce((e,t)=>e+(null!=t?t:0),0);function Ge(e){var t,i;function n(e,t,i,n){return(null!=e?e:i)?null!=t?t:n:void 0}const r={uppercase:n(e.uppercase,e.minUppercase,A.uppercase,A.minUppercase),lowercase:n(e.lowercase,e.minLowercase,A.lowercase,A.minLowercase),digits:n(e.number,e.minNumber,A.number,A.minNumber),special:n(e.special,e.minSpecial,A.special,A.minSpecial),ambiguous:null!==(t=e.ambiguous)&&void 0!==t?t:A.ambiguous,all:0},s=Oe(r.uppercase,r.lowercase,r.digits,r.special),o=(null!==(i=e.length)&&void 0!==i?i:0)-s;return r.all=Math.max(o,0),r}function Ue(e){var t,i,n,r;const s=null!==(t=e.numWords)&&void 0!==t?t:h.numWords;return{numberOfWords:Math.max(s,c.numWords.min),capitalize:null!==(i=e.capitalize)&&void 0!==i?i:h.capitalize,number:null!==(n=e.includeNumber)&&void 0!==n?n:h.includeNumber,separator:null!==(r=e.wordSeparator)&&void 0!==r?r:h.wordSeparator}}var Ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class je{constructor(e,t){this.randomizer=e,this.currentTime=t}randomAscii(e){return Ve(this,void 0,void 0,function*(){const t=function(e){function t(e,t){const i=new Array(e>0?e:0);return i.fill(t,0,e),i}const i=[],n=e.ambiguous?ke.Full:ke.Unmistakable,r=[];void 0!==e.uppercase&&(r.push(...t(e.uppercase,n.Uppercase)),i.push(...n.Uppercase));void 0!==e.lowercase&&(r.push(...t(e.lowercase,n.Lowercase)),i.push(...n.Lowercase));void 0!==e.digits&&(r.push(...t(e.digits,n.Digit)),i.push(...n.Digit));void 0!==e.special&&(r.push(...t(e.special,n.Special)),i.push(...n.Special));return r.push(...t(e.all,i)),r}(e),i=(yield this.randomizer.shuffle(t)).flatMap(e=>this.randomizer.pick(e));return(yield Promise.all(i)).join("")})}randomEffLongWords(e){return Ve(this,void 0,void 0,function*(){let t=-1;e.number&&(t=yield this.randomizer.uniform(0,e.numberOfWords-1));const i=new Array(e.numberOfWords);for(let n=0;n<e.numberOfWords;n++){const r=yield this.randomizer.pickWord(Be.o,{titleCase:e.capitalize,number:n===t});i[n]=r}return i.join(e.separator)})}generate(e,t){return Ve(this,void 0,void 0,function*(){if(function(e){return"length"in(null!=e?e:{})}(t)){const i=Ge(t),n=yield this.randomAscii(i);return new Ee(n,me.password,this.currentTime(),e.source,e.website)}if(function(e){return"numWords"in(null!=e?e:{})}(t)){const i=Ue(t),n=yield this.randomEffLongWords(i);return new Ee(n,me.password,this.currentTime(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}var Ne=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ze{constructor(e,t){this.client=e,this.currentTime=t}generate(e,t){return Ne(this,void 0,void 0,function*(){if(function(e){return"length"in(null!=e?e:{})}(t)){const i=yield this.client.generator().password(function(e){return{lowercase:e.lowercase,uppercase:e.uppercase,numbers:e.number,special:e.special,length:e.length,avoidAmbiguous:e.ambiguous,minLowercase:e.minLowercase,minUppercase:e.minUppercase,minNumber:e.minNumber,minSpecial:e.minSpecial}}(t));return new Ee(i,me.password,this.currentTime(),e.source,e.website)}if(function(e){return"numWords"in(null!=e?e:{})}(t)){const i=yield this.client.generator().passphrase(function(e){return{numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber}}(t));return new Ee(i,me.password,this.currentTime(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}var Ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Le{constructor(e){this.random=e}randomWords(e){return Ye(this,void 0,void 0,function*(){var t,i,n;const r=null!==(t=null==e?void 0:e.numberOfWords)&&void 0!==t?t:1;if(r<1)return"";const s=Math.max(null!==(i=null==e?void 0:e.digits)&&void 0!==i?i:0,0);let o=e=>!1;"camelCase"===(null==e?void 0:e.casing)?o=e=>0!==e:"TitleCase"===(null==e?void 0:e.casing)&&(o=e=>!0);const a=null!==(n=null==e?void 0:e.words)&&void 0!==n?n:Be.o,l=[];for(let e=0;e<r;e++){const t=yield this.random.pickWord(a,{titleCase:o(e)});l.push(t)}for(let e=0;e<s;e++){const e=yield this.random.uniform(0,9);l.push(e.toString())}return l.join("")})}generate(e,t){return Ye(this,void 0,void 0,function*(){if(function(e){return"wordIncludeNumber"in(null!=e?e:{})}(t)){const i=yield this.randomWords({digits:t.wordIncludeNumber?4:0,casing:t.wordCapitalize?"TitleCase":"lowercase"});return new Ee(i,"username",Date.now(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}const Ke=new RegExp("[^@]+@(?<domain>.+)");class Xe{constructor(e){var t;if(this.constraints={},!e)return void(this.domain="");const i=Ke.exec(e);i&&(null===(t=i.groups)||void 0===t?void 0:t.domain)&&(this.domain=i.groups.domain)}adjust(e){var t;if(""!==(null!==(t=e.catchallDomain)&&void 0!==t?t:"").trim())return e;const i=Object.assign({},e);return i.catchallDomain=this.domain,i}fix(e){return e}}const qe=(0,ve.ol)({id:fe.catchall,type:me.email,weight:210,i18nKeys:{name:"catchallEmail",description:"catchallEmailDesc",credentialType:"email",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",copyCredential:"copyEmail",useCredential:"useThisEmail"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new Pe(e.randomizer)},profiles:{[ye.account]:{type:"core",storage:{key:"catchallGeneratorSettings",target:"object",format:"plain",classifier:new m(["catchallType","catchallDomain"]),state:g.qd,initial:{catchallType:"random",catchallDomain:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{catchallDomain:{minLength:1}},create(e,t){var i;return new Xe(null!==(i=t.email)&&void 0!==i?i:"")}}}}});class He{constructor(e){this.email=e,this.constraints={},e||(this.email="")}adjust(e){var t;if(""!==(null!==(t=e.subaddressEmail)&&void 0!==t?t:"").trim())return e;const i=Object.assign({},e);return i.subaddressEmail=this.email,i}fix(e){return e}}const We=(0,ve.ol)({id:fe.plusAddress,type:me.email,weight:200,i18nKeys:{name:"plusAddressedEmail",description:"plusAddressedEmailDesc",credentialType:"email",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",copyCredential:"copyEmail",useCredential:"useThisEmail"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new Pe(e.randomizer)},profiles:{[ye.account]:{type:"core",storage:{key:"subaddressGeneratorSettings",target:"object",format:"plain",classifier:new m(["subaddressType","subaddressEmail"]),state:g.qd,initial:{subaddressType:"random",subaddressEmail:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create(e,t){var i;return new He(null!==(i=t.email)&&void 0!==i?i:"")}}}}});var $e=i(43978);class Je{get policy(){return{}}get policyInEffect(){return!1}applyPolicy(e){return e}sanitize(e){return e}}const Ze={min:0,max:0},_e={min:1},et={requiredValue:!0};function tt(e,t){var i;const n=Oe(...t.map(e=>null==e?void 0:e.min));return nt(Math.max(null!==(i=null==e?void 0:e.min)&&void 0!==i?i:0,n),e)}function it(e,t){return e?t:void 0}function nt(e,t){var i;if(null==e)return t;const n=Object.assign({},null!=t?t:{});return n.min=Math.max(null!==(i=n.min)&&void 0!==i?i:-1/0,e),"max"in n&&(n.max=Math.max(n.max,e)),n}function rt(e,t){if(!t)return e;const{min:i,max:n}=t,r=Math.min(null!=e?e:0,null!=n?n:1/0);return Math.max(r,null!=i?i:-1/0)}function st(e,t,i){if(!t)return e;const{minLength:n,maxLength:r}=t,{fillString:s}=null!=i?i:{fillString:" "},o=(null!=e?e:"").slice(0,null!=r?r:1/0);return o.padEnd(null!=n?n:o.length,s)}function ot(e,t){return(null==t?void 0:t.readonly)?t.requiredValue:e}function at(e){return it(e,function(e,t){if(!e)return t;const i=Object.assign({},null!=t?t:{});return i.readonly=!0,i}(e,et))}class lt{constructor(e){this.constraints=e}adjust(e){const t=Object.assign(Object.assign({},null!=e?e:A),{length:rt(e.length,this.constraints.length),lowercase:ot(e.lowercase,this.constraints.lowercase),uppercase:ot(e.uppercase,this.constraints.uppercase),number:ot(e.number,this.constraints.number),special:ot(e.special,this.constraints.special),minLowercase:rt(e.minLowercase,this.constraints.minLowercase),minUppercase:rt(e.minUppercase,this.constraints.minUppercase),minNumber:rt(e.minNumber,this.constraints.minNumber),minSpecial:rt(e.minSpecial,this.constraints.minSpecial)});t.lowercase||(t.lowercase=e.minLowercase>0),t.uppercase||(t.uppercase=e.minUppercase>0),t.number||(t.number=e.minNumber>0),t.special||(t.special=e.minSpecial>0);return[t.lowercase,t.uppercase,t.number,t.special].some(e=>e)||(t.lowercase=!0,t.uppercase=!0),t}fix(e){return e}}class ct{constructor(e,t){this.defaults=t;const i=it(e.useLowercase,_e),n=it(e.useUppercase,_e),r=nt(e.numberCount||e.useNumbers&&_e.min,t.minNumber),s=nt(e.specialCount||e.useSpecial&&_e.min,t.minSpecial),o=tt(nt(e.minLength,t.length),[i,n,r,s]);this.constraints=Object.freeze({policyInEffect:dt(e,t),lowercase:at(e.useLowercase),uppercase:at(e.useUppercase),number:at(e.useNumbers),special:at(e.useSpecial),length:o,minLowercase:i,minUppercase:n,minNumber:r,minSpecial:s})}calibrate(e){var t,i,n,r,s,o,a,l;const c=e.lowercase||(null===(t=this.constraints.lowercase)||void 0===t?void 0:t.requiredValue)||!1,d=e.uppercase||(null===(i=this.constraints.uppercase)||void 0===i?void 0:i.requiredValue)||!1,u=e.number||(null===(n=this.constraints.number)||void 0===n?void 0:n.requiredValue)||!1,h=e.special||(null===(r=this.constraints.special)||void 0===r?void 0:r.requiredValue)||!1,A=Object.assign(Object.assign({},this.constraints),{minLowercase:it(c,null!==(s=this.constraints.minLowercase)&&void 0!==s?s:_e),minUppercase:it(d,null!==(o=this.constraints.minUppercase)&&void 0!==o?o:_e),minNumber:null!==(a=it(u,this.constraints.minNumber))&&void 0!==a?a:Ze,minSpecial:null!==(l=it(h,this.constraints.minSpecial))&&void 0!==l?l:Ze});A.length=tt(this.constraints.length,[nt(e.minNumber,A.minNumber),nt(e.minSpecial,A.minSpecial),nt(e.minLowercase,A.minLowercase),nt(e.minUppercase,A.minUppercase)]);return new lt(A)}}function dt(e,t){return[e.useUppercase,e.useLowercase,e.useNumbers,e.useSpecial,e.minLength>t.length.min,e.numberCount>t.minNumber.min,e.specialCount>t.minSpecial.min].includes(!0)}class ut{constructor(e){var t,i;this.policy=structuredClone(e),this.numWords=(t=e.minNumberWords,i=c.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>c.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,r=Math.min(null!=e?e:t.min,n);return Math.max(r,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:h.wordSeparator;return Object.assign(Object.assign({},e),{wordSeparator:n})}}class ht{constructor(e,t){this.policy=e,this.defaults=t,this.constraints={policyInEffect:At(e,t),wordSeparator:{minLength:0,maxLength:1},capitalize:at(e.capitalize),includeNumber:at(e.includeNumber),numWords:nt(e.minNumberWords,t.numWords)}}adjust(e){return{wordSeparator:st(e.wordSeparator,this.constraints.wordSeparator,{fillString:h.wordSeparator}),capitalize:ot(e.capitalize,this.constraints.capitalize),includeNumber:ot(e.includeNumber,this.constraints.includeNumber),numWords:rt(e.numWords,this.constraints.numWords)}}fix(e){return e}}function At(e,t){return[e.capitalize,e.includeNumber,e.minNumberWords>t.numWords.min].includes(!0)}class pt{get minNumber(){return this.minDigits}get minSpecial(){return this.minSpecialCharacters}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,d.minDigits),this.minSpecialCharacters=t(e.specialCount,d.minSpecialCharacters);const i=this.minDigits.min+this.minSpecialCharacters.min,n=e.minLength>0?e.minLength:d.length.min,r=Math.max(n,i,d.length.min);this.length={min:r,max:Math.max(d.length.max,r)}}get policyInEffect(){return[this.policy.useUppercase,this.policy.useLowercase,this.policy.useNumbers,this.policy.useSpecial,this.policy.minLength>d.length.min,this.policy.numberCount>d.minDigits.min,this.policy.specialCount>d.minSpecialCharacters.min].includes(!0)}applyPolicy(e){function t(e,t){const{min:i,max:n}=t,r=Math.min(e||0,n);return Math.max(r,i)}const i=this.policy.useUppercase||e.uppercase||!1,n=this.policy.useLowercase||e.lowercase||!1,r=this.policy.useNumbers||e.number||e.minNumber>0,s=this.policy.useSpecial||e.special||e.minSpecial>0,o=t(e.length,this.length),a=t(e.minNumber,this.minDigits),l=t(e.minSpecial,this.minSpecialCharacters);return Object.assign(Object.assign({},e),{length:o,uppercase:i,lowercase:n,number:r,minNumber:a,special:s,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,r]=i(e.lowercase,e.minLowercase),[s,o]=i(e.uppercase,e.minUppercase),[a,l]=i(e.number,e.minNumber),[c,d]=i(e.special,e.minSpecial),u=r+o+l+d,h=Math.max(u,this.length.min),A=Math.max(null!==(t=e.length)&&void 0!==t?t:h,h);return Object.assign(Object.assign({},e),{length:A,minLength:h,lowercase:n,minLowercase:r,uppercase:s,minUppercase:o,number:a,minNumber:l,special:c,minSpecial:d})}}function gt(e,t){var i;return t.type!==$e.tt.PasswordGenerator?e:{minNumberWords:Math.max(e.minNumberWords,null!==(i=t.data.minNumberWords)&&void 0!==i?i:e.minNumberWords),capitalize:t.data.capitalize||e.capitalize,includeNumber:t.data.includeNumber||e.includeNumber}}function vt(e,t){var i,n,r;return t.type===$e.tt.PasswordGenerator&&t.enabled?{minLength:Math.max(e.minLength,null!==(i=t.data.minLength)&&void 0!==i?i:e.minLength),useUppercase:t.data.useUpper||e.useUppercase,useLowercase:t.data.useLower||e.useLowercase,useNumbers:t.data.useNumbers||e.useNumbers,numberCount:Math.max(e.numberCount,null!==(n=t.data.minNumbers)&&void 0!==n?n:e.numberCount),useSpecial:t.data.useSpecial||e.useSpecial,specialCount:Math.max(e.specialCount,null!==(r=t.data.minSpecial)&&void 0!==r?r:e.specialCount)}:e}class ft{constructor(e,t,i){this.algorithms=e,this.isAvailable=t,this.system=i,this.constraints={},this.log=i.log({type:"AvailableAlgorithmsConstraint"})}adjust(e){const t={},i=Object.keys(e);for(const n of i)t[n]=this.adjustPreference(n,e[n]);return t}adjustPreference(e,t){var i;if(this.isAvailable(t.algorithm))return this.log.debug({preference:t,type:e},"using preferred algorithm"),t;const n=null!==(i=(e?this.algorithms({type:e}):[]).find(this.isAvailable))&&void 0!==i?i:null;let r;return n?(r=Object.assign(Object.assign({},t),{algorithm:n,updated:this.system.now()}),this.log.debug({preference:t,defaultAlgorithm:n,type:e},"preference not available; defaulting the algorithm")):(this.log.warn({preference:t,type:e},"preference not available and default algorithm not found; continuing with preference"),r=t),r}fix(e){return e}}const mt={id:fe.passphrase,type:me.password,weight:110,i18nKeys:{name:"passphrase",credentialType:"passphrase",generateCredential:"generatePassphrase",credentialGenerated:"passphraseGenerated",copyCredential:"copyPassphrase",useCredential:"useThisPassphrase"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>null==e.sdk?new je(e.randomizer,e.now):new ze(e.sdk,e.now)},profiles:{[ye.account]:{type:"core",storage:{key:"passphraseGeneratorSettings",target:"object",format:"plain",classifier:new m(["numWords","wordSeparator","capitalize","includeNumber"]),state:g.qd,initial:{numWords:6,wordSeparator:"-",capitalize:!1,includeNumber:!1},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{type:$e.tt.PasswordGenerator,default:{wordSeparator:{maxLength:1},numWords:{min:3,max:20,recommendation:6}},create(e,t){const i=e.reduce(gt,{minNumberWords:0,capitalize:!1,includeNumber:!1});return new ht(i,t.defaultConstraints)}}}}},yt=(0,ve.ol)({id:fe.password,type:me.password,weight:100,i18nKeys:{name:"password",generateCredential:"generatePassword",credentialGenerated:"passwordGenerated",credentialType:"password",copyCredential:"copyPassword",useCredential:"useThisPassword"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>null==e.sdk?new je(e.randomizer,e.now):new ze(e.sdk,e.now)},profiles:{[ye.account]:{type:"core",storage:{key:"passwordGeneratorSettings",target:"object",format:"plain",classifier:new m(["length","ambiguous","uppercase","minUppercase","lowercase","minLowercase","number","minNumber","special","minSpecial"]),state:g.qd,initial:{length:14,ambiguous:!0,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,number:!0,minNumber:1,special:!1,minSpecial:0},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{type:$e.tt.PasswordGenerator,default:{length:{min:5,max:128,recommendation:14},minNumber:{min:0,max:9},minSpecial:{min:0,max:9}},create(e,t){const i=e.reduce(vt,{minLength:0,useUppercase:!1,useLowercase:!1,useNumbers:!1,numberCount:0,useSpecial:!1,specialCount:0});return new ct(i,t.defaultConstraints)}}}}});var Ct=i(59303);const wt=(0,ve.ol)({id:fe.username,type:me.username,weight:400,i18nKeys:{name:"randomWord",credentialType:"username",generateCredential:"generateUsername",credentialGenerated:"usernameGenerated",copyCredential:"copyUsername",useCredential:"useThisUsername"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new Le(e.randomizer)},profiles:{[ye.account]:{type:"core",storage:{key:"effUsernameGeneratorSettings",target:"object",format:"plain",classifier:new m(["wordCapitalize","wordIncludeNumber"]),state:g.qd,initial:{wordCapitalize:!1,wordIncludeNumber:!1,website:null},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create:(e,t)=>new Ct.e}}}});class It{constructor(e,t){this.requestor=e,this.context=t}get createForwardingEmail(){return this.requestor.forwarder.createForwardingEmail}toRequest(e){const t=this.createForwardingEmail.url(e,this.context),i=this.requestor.authenticate(e,this.context),n=this.body(e);return new Request(t,{redirect:"manual",cache:"no-store",method:"POST",headers:new Headers(Object.assign(Object.assign({},i),{"Content-Type":"application/json",Accept:"application/json"})),body:n})}body(e){const t=this.createForwardingEmail.body;if(!t)return;const i=t(e,this.context);return i?JSON.stringify(i):void 0}hasJsonPayload(e){return this.createForwardingEmail.hasJsonPayload(e,this.context)}processJson(e){return this.createForwardingEmail.processJson(e,this.context)}}class bt{constructor(e,t){this.requestor=e,this.context=t}hasJsonPayload(e){return this.requestor.forwarder.getAccountId.hasJsonPayload(e,this.context)}processJson(e){return this.requestor.forwarder.getAccountId.processJson(e,this.context)}toRequest(e){const t=this.requestor.forwarder.getAccountId.url(e,this.context),i=this.requestor.authenticate(e,this.context);return new Request(t,{redirect:"manual",cache:"no-store",method:"GET",headers:new Headers(Object.assign(Object.assign({},i),{"Content-Type":"application/json",Accept:"application/json"}))})}}var Bt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Et{constructor(e,t,i){this.configuration=e,this.client=t,this.i18nService=i}generate(e,t){return Bt(this,void 0,void 0,function*(){const i={website:e.website},n=yield this.getAccountId(this.configuration,t);n&&(i.accountId=yield this.client.fetchJson(n,i));const r=this.createForwardingAddress(this.configuration,t),s=yield this.client.fetchJson(r,i);return new Ee(s,me.email,Date.now())})}createContext(e,t){return new be(e,t,this.i18nService)}createForwardingAddress(e,t){const i=this.createContext(e,t);return new It(e,i)}getAccountId(e,t){if(!e.forwarder.getAccountId)return null;const i=this.createContext(e,t);return new bt(e,i)}}function St(e){var t;if("forwarder"!==e.site.id)throw new Error(`expected forwarder extension; received ${e.site.id} (${e.product.vendor.id})`);const i={literal:null!==(t=e.product.name)&&void 0!==t?t:e.product.vendor.name};return{id:{forwarder:e.product.vendor.id},type:me.email,weight:300,i18nKeys:{name:i,description:"forwardedEmailDesc",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",useCredential:"useThisEmail",credentialType:"email",copyCredential:"copyEmail"},capabilities:{autogenerate:!1,fields:[...e.requestedFields]},engine:{create(t){const i=function(e){const t=X.get(e);return t&&"forwarder"in t?t:null}(e.product.vendor.id);return new Et(i,t.client,t.i18nService)}},profiles:{[ye.account]:{type:"extension",site:"forwarder",storage:{key:"forwarder",frame:512,initial:{token:"",baseUrl:"",domain:"",prefix:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create:()=>new Ct.e}}}}}function Qt(e){return Ce.password.includes(e)}function kt(e){return Ce.username.includes(e)}function Tt(e){return!(!e||"object"!=typeof e||!("forwarder"in e))}function Ft(e){return Ce.email.includes(e)||Tt(e)}function Pt(e,t){return e===t||!(!Tt(e)||!Tt(t))&&e.forwarder===t.forwarder}const Rt=Object.freeze({catchall:qe,plusAddress:We,passphrase:mt,password:yt,effWordList:wt}),Dt=Ce,Mt=Object.freeze(Object.values(fe)),xt=Object.freeze(Object.values(me));function Ot(e){return!!e.algorithm}function Gt(e){return!!e.type}const Ut=18e4;class Vt{constructor(e,t){this.provide=e,this.system=t,this.log=t.log({type:"DefaultCredentialGeneratorService"})}generate$(e){const t=e.on$.pipe((0,te.t)({refCount:!0,bufferSize:1})),i=e.account$.pipe((0,te.t)({refCount:!0,bufferSize:1})),n=t.pipe((0,ie.n)(e=>Ot(e)?(0,ne.of)(e.algorithm):Gt(e)?this.provide.metadata.preference$(e.type,{account$:i}).pipe((0,re.$)()):void this.log.panic(e,"algorithm or category required")),(0,se.p)(e=>!!e),(0,ge.Zm)(e=>this.provide.metadata.metadata(e),{size:10}),(0,te.t)({refCount:!0,bufferSize:1})),r=(0,oe.y)(t,n).pipe((0,ae.T)(([e,t])=>{var i;return[Object.assign(Object.assign({},e),{profile:null!==(i=e.profile)&&void 0!==i?i:ye.account}),t]}),(0,ge.Zm)(([e,t])=>{const[n,r]=[e.profile,t.id],s=this.settings(t,{account$:i},n).pipe((0,le.M)(()=>this.log.debug({algorithm:r,profile:n},"settings update received")),(0,ce.u)({connector:()=>new de.m(1,Ut),resetOnRefCountZero:()=>(0,ue.O)(Ut)}),(0,le.M)({subscribe:()=>this.log.debug({algorithm:r,profile:n},"settings hot"),complete:()=>this.log.debug({algorithm:r,profile:n},"settings cold")}),(0,re.$)());return this.log.debug({algorithm:r,profile:n},"settings cached"),s},{key:([e,t])=>`${t.id}:${e.profile}`}),(0,he.w)()),s=n.pipe((0,ge.Zm)(e=>{const t=e.engine.create(this.provide.generator);return this.log.debug({algorithm:e.id},"engine cached"),t},{size:10}));return(0,oe.y)([t,r,s]).pipe((0,le.M)(([e])=>this.log.debug(e,"generating credential")),(0,Ae.H)(([e,t,i])=>i.generate(e,t)),(0,pe.Q)((0,ge.E)([r])))}algorithms$(e,t){return this.provide.metadata.algorithms$({type:e},t).pipe((0,ae.T)(e=>e.map(e=>this.algorithm(e))))}algorithms(e){return(Array.isArray(e)?e:[e]).flatMap(e=>this.provide.metadata.algorithms({type:e})).map(e=>this.algorithm(e))}algorithm(e){const t=this.provide.metadata.metadata(e);return t||this.log.panic({algorithm:e},"invalid credential algorithm"),t}forwarder(e){const t=this.provide.metadata.metadata({forwarder:e});return t||this.log.panic({algorithm:e},"invalid vendor"),t}preferences(e){return this.provide.metadata.preferences(e)}settings(e,t,i=ye.account){const n=e.profiles[i];let r;if(n||this.log.panic({algorithm:e.id,profile:i},"failed to load settings; profile metadata not found"),"extension"===(s=n).type&&"forwarder"===s.site){const s=function(e){if(Tt(e))return e.forwarder}(e.id);s||this.log.panic({algorithm:e.id,profile:i},"failed to load extension profile; vendor not specified"),this.log.info({profile:i,vendor:s,site:n.site},"loading extension profile"),r=this.system.extension.settings(n,s,t)}else this.log.info({profile:i,algorithm:e.id},"loading generator profile"),r=this.provide.profile.settings(n,t);var s;return r}policy$(e,t,i=ye.account){const n=e.profiles[i];return n||this.log.panic({algorithm:e.id,profile:i},"failed to load policy; profile metadata not found"),this.provide.profile.constraints$(n,t)}}var jt=i(34040),Nt=i(89222);const zt=new g.Ok(g.qd,"credentialPreferences",{deserializer:e=>{var t;const i=null!==(t=e)&&void 0!==t?t:{};for(const n in Dt){const e=n;if(i[e])i[e].updated=new Date(i[e].updated);else{const[t]=Dt[e];i[e]={algorithm:t,updated:new Date}}}return i},clearOn:["logout"]});class Yt{constructor(e,t,i){this.system=e,this.application=t,this.log=e.log({type:"GeneratorMetadataProvider"});const n=t.extension.site("forwarder");n||this.log.panic("forwarder extension site not found"),this.site=n,this._metadata=new Map(i.map(e=>[e.id,e]))}metadata(e){let t=null;if(Tt(e)){const i=this.site.extensions.get(e.forwarder);i||this.log.panic(e,"extension not found"),t=St(i)}else t=this._metadata.get(e);return t||this.log.panic({algorithm:e},"metadata not found"),t}types(){return xt}algorithms(e){let t;if(Gt(e)){let i=[];e.type===me.email&&(i=Array.from(this.site.extensions.keys()).map(e=>({forwarder:e}))),t=Dt[e.type].concat(i)}else Ot(e)&&Tt(e.algorithm)?t=this.site.extensions.has(e.algorithm.forwarder)?[e.algorithm]:[]:Ot(e)?t=Mt.includes(e.algorithm)?[e.algorithm]:[]:this.log.panic(e,"algorithm or type required");return t}isAvailable$(e){const t=e.account$.pipe((0,ae.T)(e=>e.id),(0,ge.y_)(),(0,te.t)({bufferSize:1,refCount:!0}));return t.pipe((0,ie.n)(e=>this.application.policy.policiesByType$($e.tt.PasswordGenerator,e).pipe((0,ae.T)(e=>function(e){const t=e.filter(e=>e.type===$e.tt.PasswordGenerator&&e.enabled).reduce((e,t)=>{var i;return"password"===e?e:null!==(i=t.data.overridePasswordType)&&void 0!==i?i:e},null),i=[...Dt[me.email],...Dt[me.username]];return t?i.push(t):i.push(...Dt[me.password]),i}(e).filter(e=>this._metadata.has(e)).sort()),(0,ge.Zm)(e=>new Set(e),{key:e=>e.join(":")}),(0,jt.F)(),(0,pe.Q)((0,ge.E)(t)))),(0,ae.T)(e=>function(t){return Tt(t)||e.has(t)}))}algorithms$(e,t){if(Gt(e)){const{type:i}=e;return this.isAvailable$(t).pipe((0,ae.T)(e=>this.algorithms({type:i}).filter(e)))}if(Ot(e)){const{algorithm:i}=e;return this.isAvailable$(t).pipe((0,ae.T)(e=>e(i)?[i]:[]))}this.log.panic(e,"algorithm or type required")}preference$(e,t){const i=t.account$.pipe((0,te.t)({bufferSize:1,refCount:!0}));return this.preferences({account$:i}).pipe((0,ae.T)(t=>t[e].algorithm),(0,jt.F)())}preferences(e){const t=e.account$.pipe((0,te.t)({bufferSize:1,refCount:!0})),i=this.isAvailable$({account$:t}).pipe((0,ae.T)(e=>new ft(this.algorithms.bind(this),e,this.system)));return new Nt.p(zt,this.system,{account$:t,constraints$:i})}}class Lt{constructor(e,t){this.providers=e,this.policyService=t,this.log=e.log({type:"GeneratorProfileProvider"})}settings(e,t){const i=t.account$.pipe((0,te.t)({bufferSize:1,refCount:!0})),n=this.constraints$(e,{account$:i});return new Nt.p(e.storage,this.providers,{constraints$:n,account$:i})}constraints$(e,t){const i=t.account$.pipe((0,te.t)({bufferSize:1,refCount:!0}));return i.pipe((0,jt.F)((e,t)=>e.email===t.email&&e.emailVerified===t.emailVerified),(0,ie.n)(t=>{var i;this.log.debug({accountId:t.id,profileType:e.type,policyType:null!==(i=e.constraints.type)&&void 0!==i?i:"N/A",defaultConstraints:e.constraints.default},"initializing constraints$");const n=e.constraints.type?this.policyService.policiesByType$(e.constraints.type,t.id):(0,ne.of)([]),r={defaultConstraints:e.constraints.default};t.emailVerified&&(this.log.debug({email:t.email},"verified email detected; including in context"),r.email=t.email);const s=n.pipe((0,ae.T)(t=>e.constraints.create(t,r)),(0,jt.F)((e,t)=>function(e,t){var i,n;if(e.constraints.policyInEffect!==t.constraints.policyInEffect)return!1;const r=Object.keys(e.constraints);for(const s of r){if(!(s in t.constraints))return!1;const r=null!==(i=e.constraints[s])&&void 0!==i?i:{},o=null!==(n=t.constraints[s])&&void 0!==n?n:{};if(Object.keys(r).some(e=>r[e]!==o[e]))return!1}return!0}(e,t)),(0,le.M)(e=>this.log.debug(e,"constraints updated")));return s}),(0,pe.Q)((0,ge.E)(i)))}}var Kt=i(45505);function Xt(e){return(0,Kt.F)((0,ge.pP)(e.combine,e.disabledValue),(0,ge.LA)(),(0,ae.T)(e.createEvaluator))}function qt(){return()=>(0,Kt.F)((0,ae.T)(e=>new Je))}var Ht=i(22327),Wt=i(21590),$t=i(9764),Jt=i(89097),Zt=i(16845);class _t{}class ei{classify(e){const t=JSON.parse(JSON.stringify(e));delete t.website;return{disclosed:{},secret:t}}declassify(e,t){return Object.assign(Object.assign({},t),{website:null})}}var ti=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ii extends _t{constructor(e,t,i,n,r,s){super(),this.configuration=e,this.client=t,this.i18nService=i,this.encryptService=n,this.keyService=r,this.stateProvider=s,this.policy=$e.tt.PasswordGenerator,this.defaults$=Me(()=>this.configuration.forwarder.defaultSettings),this.toEvaluator=qt(),this.durableState=function(e){const t=new Map;return i=>{let n=t.get(i);return void 0===n&&(n=e(i),t.set(i,n)),n}}(e=>this.getUserSecrets(e)),this.generate=e=>ti(this,void 0,void 0,function*(){const t={website:e.website},i=yield this.getAccountId(this.configuration,e);i&&(t.accountId=yield this.client.fetchJson(i,t));const n=this.createForwardingAddress(this.configuration,e);return yield this.client.fetchJson(n,t)})}get key(){return this.configuration.forwarder.settings}get rolloverKey(){return this.configuration.forwarder.importBuffer}getUserSecrets(e){const t=new $t.n(512),i=this.keyService.userKey$(e).pipe((0,ae.T)(i=>i?new Ht.f(e,this.encryptService,i,t):null),(0,se.p)(e=>!!e)),n=new ei,r=Jt.l.value(this.key.stateDefinition,this.key.key,n,{deserializer:e=>this.key.deserializer(e),cleanupDelayMs:this.key.cleanupDelayMs,clearOn:this.key.clearOn}),s=Zt.m.from(e,r,this.stateProvider,i),o=this.keyService.userKey$(e).pipe((0,ae.T)(e=>null!==e));return new Wt.d(this.stateProvider,this.rolloverKey,s,o)}createContext(e,t){return new be(e,t,this.i18nService)}createForwardingAddress(e,t){const i=this.createContext(e,t);return new It(e,i)}getAccountId(e,t){if(!e.forwarder.getAccountId)return null;const i=this.createContext(e,t);return new bt(e,i)}}const ni=new g.Ok(g.qd,"passwordGeneratorSettings",{deserializer:e=>e,clearOn:[]}),ri=new g.Ok(g.qd,"passphraseGeneratorSettings",{deserializer:e=>e,clearOn:[]}),si=new g.Ok(g.qd,"effUsernameGeneratorSettings",{deserializer:e=>e,clearOn:[]}),oi=new g.Ok(g.qd,"catchallGeneratorSettings",{deserializer:e=>e,clearOn:[]}),ai=new g.Ok(g.qd,"subaddressGeneratorSettings",{deserializer:e=>e,clearOn:[]});var li=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ci{constructor(e,t){this.randomizer=e,this.stateProvider=t,this.durableState=xe(ri,this.stateProvider),this.defaults$=Me(()=>h),this.policy=$e.tt.PasswordGenerator}toEvaluator(){return Xt({type:$e.tt.PasswordGenerator,disabledValue:Object.freeze({minNumberWords:0,capitalize:!1,includeNumber:!1}),combine:gt,createEvaluator:e=>new ut(e)})}generate(e){return li(this,void 0,void 0,function*(){const t=Ue(e);return this.randomizer.randomEffLongWords(t)})}}var di=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ui{constructor(e,t){this.randomizer=e,this.stateProvider=t,this.durableState=xe(ni,this.stateProvider),this.defaults$=Me(()=>A),this.policy=$e.tt.PasswordGenerator}toEvaluator(){return Xt({type:$e.tt.PasswordGenerator,disabledValue:{minLength:0,useUppercase:!1,useLowercase:!1,useNumbers:!1,numberCount:0,useSpecial:!1,specialCount:0},combine:vt,createEvaluator:e=>new pt(e)})}generate(e){return di(this,void 0,void 0,function*(){const t=Ge(e);return yield this.randomizer.randomAscii(t)})}}var hi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ai{constructor(e,t,i,n=l){this.emailCalculator=e,this.emailRandomizer=t,this.stateProvider=i,this.defaultOptions=n,this.durableState=xe(oi,this.stateProvider),this.defaults$=Me(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=$e.tt.PasswordGenerator}generate(e){return hi(this,void 0,void 0,function*(){return null==e.catchallType&&(e.catchallType="random"),"website-name"===e.catchallType?yield this.emailCalculator.concatenate(e.website,e.catchallDomain):this.emailRandomizer.randomAsciiCatchall(e.catchallDomain)})}}var pi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class gi{constructor(e,t,i,n=p){this.emailCalculator=e,this.emailRandomizer=t,this.stateProvider=i,this.defaultOptions=n,this.durableState=xe(ai,this.stateProvider),this.defaults$=Me(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=$e.tt.PasswordGenerator}generate(e){return pi(this,void 0,void 0,function*(){return null==e.subaddressType&&(e.subaddressType="random"),"website-name"===e.subaddressType?this.emailCalculator.appendToSubaddress(e.website,e.subaddressEmail):this.emailRandomizer.randomAsciiSubaddress(e.subaddressEmail)})}}var vi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const fi=Object.freeze({enabled:4,disabled:0});class mi{constructor(e,t,i=u){this.randomizer=e,this.stateProvider=t,this.defaultOptions=i,this.durableState=xe(si,this.stateProvider),this.defaults$=Me(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=$e.tt.PasswordGenerator}generate(e){return vi(this,void 0,void 0,function*(){var t,i;const n=(null!==(t=e.wordCapitalize)&&void 0!==t?t:u.wordCapitalize)?"TitleCase":"lowercase",r=(null!==(i=e.wordIncludeNumber)&&void 0!==i?i:u.wordIncludeNumber)?fi.enabled:fi.disabled;return yield this.randomizer.randomWords({numberOfWords:1,casing:n,digits:r})})}}},74199(e,t,i){"use strict";i.d(t,{v:()=>r});var n=i(7248);class r extends n.V{}},74269(e,t,i){"use strict";i.d(t,{K:()=>a});var n=i(74208),r=i(21823),s=i(33812);function o(e,t){1&e&&s.Hgh(0,"div",0)}class a{constructor(){this.sideNavService=(0,n.WQX)(r.G)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-nav-divider"]],decls:1,vars:1,consts:[[1,"tw-h-px","tw-w-full","tw-my-2","tw-bg-border-nav-divider"]],template:function(e,t){1&e&&s.nVh(0,o,1,0,"div",0),2&e&&s.vxM(t.sideNavService.open()?0:-1)},encapsulation:2,changeDetection:0})},74526(e,t,i){"use strict";i.d(t,{Z:()=>r,k:()=>n});class n{}class r extends n{}},74865(e,t,i){"use strict";i.d(t,{l:()=>r});var n=i(20702);class r extends n.r{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")}}},75174(e,t,i){"use strict";i.d(t,{O:()=>n});class n{constructor(e){this.name=e.name?e.name.encryptedString:null}}},75421(e,t,i){"use strict";i.d(t,{Q:()=>n});class n{}},75556(e,t,i){"use strict";i.d(t,{J:()=>a});var n=i(74208),r=i(4017),s=i(33812);const o=["*",[["","slot","end"]]];class a{constructor(){this.focusVisibleWithin=(0,n.vPA)(!1)}onFocusIn(e){this.focusVisibleWithin.set(e.matches("[data-fvw-target]:focus-visible"))}onFocusOut(){this.focusVisibleWithin.set(!1)}get classList(){return[this.focusVisibleWithin()?"tw-z-10 tw-rounded tw-outline-none tw-ring-2 bit-compact:tw-ring-inset tw-ring-primary-600 tw-border-transparent".split(" "):"tw-border-b-shadow"].flat()}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-item"]],hostAttrs:[1,"tw-block","tw-box-border","tw-overflow-hidden","tw-flex","tw-bg-background","[&:has([data-item-main-content]_button:hover,[data-item-main-content]_a:hover)]:tw-cursor-pointer","[&:has([data-item-main-content]_button:enabled:hover,[data-item-main-content]_a:hover)]:tw-bg-hover-default","tw-text-main","tw-border-solid","tw-border-b","tw-border-0","[&:not(bit-layout_*)]:tw-rounded-lg","bit-compact:[&:not(bit-layout_*)]:tw-rounded-none","bit-compact:[&:not(bit-layout_*)]:last-of-type:tw-rounded-b-lg","bit-compact:[&:not(bit-layout_*)]:first-of-type:tw-rounded-t-lg","tw-min-h-9","tw-mb-1.5","bit-compact:tw-mb-0"],hostVars:2,hostBindings:function(e,t){1&e&&s.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()}),2&e&&s.HbH(t.classList)},ngContentSelectors:["*","[slot=end]"],decls:5,vars:1,consts:[["endSlot",""],["data-item-main-content","",1,"tw-flex","tw-flex-1","tw-overflow-hidden"],[1,"tw-px-2","tw-flex","tw-items-center","tw-gap-2","[&_button[biticonbutton]]:-tw-mx-1",3,"hidden"]],template:function(e,t){if(1&e&&(s.NAR(o),s.j41(0,"bit-item-action",1),s.SdG(1),s.k0s(),s.j41(2,"div",2,0),s.SdG(4,1),s.k0s()),2&e){const e=s.sdS(3);s.R7$(2),s.Y8G("hidden",0===e.childElementCount)}},dependencies:[r.D],encapsulation:2,changeDetection:0})},75583(e,t,i){"use strict";i.d(t,{E:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},75633(e,t,i){"use strict";i.d(t,{p:()=>n});class n{}},75697(e,t,i){"use strict";i.d(t,{P:()=>A});var n=i(6056),r=i(94735),s=i(52237),o=i(58604),a=i(33812),l=i(50700),c=i(54471);class d{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)}}d.ɵfac=function(e){return new(e||d)},d.ɵpipe=a.EJ8({name:"ellipsis",type:d,pure:!0});var u=i(25740);const h=e=>({organizationId:e});class A{constructor(e){this.i18nService=e}ngOnChanges(){null==this.organizationName||""===this.organizationName?this.name=this.i18nService.t("me"):this.name=this.organizationName}get organizationIdLink(){var e;return null!==(e=this.organizationId)&&void 0!==e?e:s.I_}}A.ɵfac=function(e){return new(e||A)(a.rXU(l.W))},A.ɵcmp=a.VBU({type:A,selectors:[["app-org-badge"]],inputs:{organizationId:"organizationId",organizationName:"organizationName",disabled:"disabled"},features:[a.OA$],decls:3,vars:13,consts:[["bit-chip-action","","type","button","routerLink","","queryParamsHandling","merge",3,"disabled","appA11yTitle","queryParams","label"]],template:function(e,t){1&e&&(a.nrm(0,"button",0),a.nI1(1,"i18n"),a.nI1(2,"ellipsis")),2&e&&a.Y8G("appA11yTitle",a.mNQ(a.i5U(1,5,"ownerBadgeA11yDescription",t.name)))("disabled",t.disabled)("queryParams",a.eq3(11,h,t.organizationIdLink))("label",a.i5U(2,8,t.name,13))},dependencies:[n.iI,n.Wk,r.p,c.C,o.g,d,u.$],encapsulation:2})},75751(e,t,i){"use strict";i.d(t,{f:()=>y});var n=i(39306),r=i(66523),s=i(34693),o=i(31442),a=i(36501),l=i(42234),c=i(38453),d=i(34461),u=i(6528),h=i(65918),A=i(11766),p=i(67036),g=i(14093),v=i(12022),f=i(86346),m=i(72142);class y{constructor(e){var t;this.initializerKey=s.M.CipherView,this.id="",this.name="",this.type=o.gC.Login,this.favorite=!1,this.organizationUseTotp=!1,this.permissions=new l.a,this.edit=!1,this.viewPassword=!0,this.login=new g.r,this.identity=new p.O,this.card=new u.G,this.secureNote=new f.Z,this.sshKey=new m.H,this.attachments=[],this.fields=[],this.passwordHistory=[],this.collectionIds=[],this.reprompt=a.b.None,this.decryptionFailure=!1,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.permissions=e.permissions,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.archivedDate=e.archivedDate,this.reprompt=null!==(t=e.reprompt)&&void 0!==t?t:a.b.None,this.key=e.key):this.creationDate=this.revisionDate=new Date}get item(){switch(this.type){case o.gC.Login:return this.login;case o.gC.SecureNote:return this.secureNote;case o.gC.Card:return this.card;case o.gC.Identity:return this.identity;case o.gC.SshKey:return this.sshKey}}get subTitle(){var e;return null===(e=this.item)||void 0===e?void 0:e.subTitle}get canBeArchived(){return!this.isDeleted&&!this.isArchived}get hasPasswordHistory(){return this.passwordHistory&&this.passwordHistory.length>0}get hasLoginPassword(){var e;return this.type===o.gC.Login&&null!=(null===(e=this.login)||void 0===e?void 0:e.password)&&""!==this.login.password}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&&null==this.attachments[e].encryptedKey)return!0;return!1}get hasFields(){return this.fields&&this.fields.length>0}get passwordRevisionDisplayDate(){if(this.type===o.gC.Login&&null!=this.login&&null!=this.login.password&&""!==this.login.password)return this.login.passwordRevisionDate}get isDeleted(){return null!=this.deletedDate}get isArchived(){return null!=this.archivedDate}get linkedFieldOptions(){var e;return null===(e=this.item)||void 0===e?void 0:e.linkedFieldOptions}get isUnassigned(){return null!=this.organizationId&&(null==this.collectionIds||0===this.collectionIds.length)}get canAssignToCollections(){return null==this.organizationId||this.edit&&this.viewPassword}get canLaunch(){return this.type===o.gC.Login&&this.login.canLaunch}linkedFieldValue(e){var t;const i=null===(t=this.linkedFieldOptions)||void 0===t?void 0:t.get(e),n=this.item;if(null!=i&&null!=n)return n[i.propertyKey]}toJSON(){return this}static fromJSON(e){var t,i,r,s,c,h,C,w,I,b,B,E,S,Q,k,T,F,P;if(null==e)return null;const R=new y;if(R.type=null!==(t=e.type)&&void 0!==t?t:o.gC.Login,R.id=null!==(i=e.id)&&void 0!==i?i:"",R.organizationId=null!==(r=e.organizationId)&&void 0!==r?r:void 0,R.folderId=null!==(s=e.folderId)&&void 0!==s?s:void 0,R.collectionIds=null!==(c=e.collectionIds)&&void 0!==c?c:[],R.name=null!==(h=e.name)&&void 0!==h?h:"",R.notes=e.notes,R.edit=null!==(C=e.edit)&&void 0!==C&&C,R.viewPassword=null===(w=e.viewPassword)||void 0===w||w,R.favorite=null!==(I=e.favorite)&&void 0!==I&&I,R.organizationUseTotp=null!==(b=e.organizationUseTotp)&&void 0!==b&&b,R.localData=e.localData?e.localData:void 0,R.permissions=e.permissions?l.a.fromJSON(e.permissions):void 0,R.reprompt=null!==(B=e.reprompt)&&void 0!==B?B:a.b.None,R.decryptionFailure=null!==(E=e.decryptionFailure)&&void 0!==E&&E,e.creationDate&&(R.creationDate=new Date(e.creationDate)),e.revisionDate&&(R.revisionDate=new Date(e.revisionDate)),R.deletedDate=null==e.deletedDate?void 0:new Date(e.deletedDate),R.archivedDate=null==e.archivedDate?void 0:new Date(e.archivedDate),R.attachments=null!==(Q=null===(S=e.attachments)||void 0===S?void 0:S.map(e=>d.$.fromJSON(e)))&&void 0!==Q?Q:[],R.fields=null!==(T=null===(k=e.fields)||void 0===k?void 0:k.map(e=>A.g.fromJSON(e)))&&void 0!==T?T:[],R.passwordHistory=null!==(P=null===(F=e.passwordHistory)||void 0===F?void 0:F.map(e=>v.j.fromJSON(e)))&&void 0!==P?P:[],null!=e.key){let t;"string"==typeof e.key?t=n.k.fromJSON(e.key):e.key instanceof n.k&&(t=e.key),R.key=t}switch(e.type){case o.gC.Card:R.card=u.G.fromJSON(e.card);break;case o.gC.Identity:R.identity=p.O.fromJSON(e.identity);break;case o.gC.Login:R.login=g.r.fromJSON(e.login);break;case o.gC.SecureNote:R.secureNote=f.Z.fromJSON(e.secureNote);break;case o.gC.SshKey:R.sshKey=m.H.fromJSON(e.sshKey)}return R}static fromSdkCipherView(e,t){var i,s,C,w,I,b,B,E,S,Q,k,T;if(null==e)return;const F=null!==(s=null===(i=e.attachments)||void 0===i?void 0:i.map(e=>d.$.fromSdkAttachmentView(e)))&&void 0!==s?s:[];(null===(C=e.attachmentDecryptionFailures)||void 0===C?void 0:C.length)&&e.attachmentDecryptionFailures.forEach(e=>{const t=d.$.fromSdkAttachmentView(e,!0);t&&F.push(t)});const P=new y;switch(P.id=(0,r.zw)(e.id),P.organizationId=(0,r.zw)(e.organizationId),P.folderId=(0,r.zw)(e.folderId),P.name=e.name,P.notes=e.notes,P.type=e.type,P.favorite=e.favorite,P.organizationUseTotp=e.organizationUseTotp,P.permissions=e.permissions?l.a.fromSdkCipherPermissions(e.permissions):void 0,P.edit=e.edit,P.viewPassword=e.viewPassword,P.localData=(0,c.e)(e.localData),P.attachments=F,P.fields=null!==(I=null===(w=e.fields)||void 0===w?void 0:w.map(e=>A.g.fromSdkFieldView(e)))&&void 0!==I?I:[],P.passwordHistory=null!==(B=null===(b=e.passwordHistory)||void 0===b?void 0:b.map(e=>v.j.fromSdkPasswordHistoryView(e)))&&void 0!==B?B:[],P.collectionIds=null!==(S=null===(E=e.collectionIds)||void 0===E?void 0:E.map(e=>(0,r.zw)(e)))&&void 0!==S?S:[],P.revisionDate=new Date(e.revisionDate),P.creationDate=new Date(e.creationDate),P.deletedDate=null==e.deletedDate?void 0:new Date(e.deletedDate),P.archivedDate=null==e.archivedDate?void 0:new Date(e.archivedDate),P.reprompt=null!==(Q=e.reprompt)&&void 0!==Q?Q:a.b.None,P.key=e.key?n.k.fromJSON(e.key):void 0,e.type){case o.gC.Card:P.card=e.card?u.G.fromSdkCardView(e.card):new u.G;break;case o.gC.Identity:P.identity=e.identity?p.O.fromSdkIdentityView(e.identity):new p.O;break;case o.gC.Login:if(P.login=e.login?g.r.fromSdkLoginView(e.login):new g.r,t&&(null===(T=null===(k=e.login)||void 0===k?void 0:k.fido2Credentials)||void 0===T?void 0:T.length)){const i=t.decrypt_fido2_credentials(e),n=t.decrypt_fido2_private_key(e);P.login.fido2Credentials=i.map(e=>{const t=h.X.fromSdkFido2CredentialView(e);return t&&(t.keyValue=n),t}).filter(e=>!!e)}break;case o.gC.SecureNote:P.secureNote=e.secureNote?f.Z.fromSdkSecureNoteView(e.secureNote):new f.Z;break;case o.gC.SshKey:P.sshKey=e.sshKey?m.H.fromSdkSshKeyView(e.sshKey):new m.H}return P}toSdkCreateCipherRequest(e){var t,i,n,s,l;const c={organizationId:this.organizationId?(0,r.WD)(this.organizationId):void 0,collectionIds:this.collectionIds?this.collectionIds.map(e=>(0,r.WD)(e)):[],folderId:this.folderId?(0,r.WD)(this.folderId):void 0,name:null!==(t=this.name)&&void 0!==t?t:"",notes:this.notes,favorite:null!==(i=this.favorite)&&void 0!==i&&i,reprompt:null!==(n=this.reprompt)&&void 0!==n?n:a.b.None,fields:null===(s=this.fields)||void 0===s?void 0:s.map(e=>e.toSdkFieldView()),type:this.getSdkCipherViewType()};if(this.type===o.gC.Login&&(null===(l=this.login)||void 0===l?void 0:l.hasFido2Credentials)){const t=this.toSdkCipherView(e);c.type={login:t.login}}return c}toSdkUpdateCipherRequest(e){var t,i,n,s,l,c,d,u,h;const A={id:(0,r.WD)(this.id),organizationId:this.organizationId?(0,r.WD)(this.organizationId):void 0,folderId:this.folderId?(0,r.WD)(this.folderId):void 0,name:null!==(t=this.name)&&void 0!==t?t:"",notes:this.notes,favorite:null!==(i=this.favorite)&&void 0!==i&&i,reprompt:null!==(n=this.reprompt)&&void 0!==n?n:a.b.None,fields:null===(s=this.fields)||void 0===s?void 0:s.map(e=>e.toSdkFieldView()),type:this.getSdkCipherViewType(),revisionDate:null===(l=this.revisionDate)||void 0===l?void 0:l.toISOString(),archivedDate:null===(c=this.archivedDate)||void 0===c?void 0:c.toISOString(),attachments:null===(d=this.attachments)||void 0===d?void 0:d.map(e=>e.toSdkAttachmentView()),key:null===(u=this.key)||void 0===u?void 0:u.toSdk()};if(this.type===o.gC.Login&&(null===(h=this.login)||void 0===h?void 0:h.hasFido2Credentials)){const t=this.toSdkCipherView(e);A.type={login:t.login}}return A}getSdkCipherViewType(){var e,t,i,n,r;let s;switch(this.type){case o.gC.Card:s={card:null===(e=this.card)||void 0===e?void 0:e.toSdkCardView()};break;case o.gC.Identity:s={identity:null===(t=this.identity)||void 0===t?void 0:t.toSdkIdentityView()};break;case o.gC.Login:s={login:null===(i=this.login)||void 0===i?void 0:i.toSdkLoginView()};break;case o.gC.SecureNote:s={secureNote:null===(n=this.secureNote)||void 0===n?void 0:n.toSdkSecureNoteView()};break;case o.gC.SshKey:s={sshKey:null===(r=this.sshKey)||void 0===r?void 0:r.toSdkSshKeyView()};break;default:s={login:(new g.r).toSdkLoginView()}}return s}toSdkCipherView(e){var t,i,n,s,l,d,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S,Q,k;let T={id:this.id?(0,r.WD)(this.id):void 0,organizationId:this.organizationId?(0,r.WD)(this.organizationId):void 0,folderId:this.folderId?(0,r.WD)(this.folderId):void 0,name:null!==(t=this.name)&&void 0!==t?t:"",notes:this.notes,type:null!==(i=this.type)&&void 0!==i?i:o.gC.Login,favorite:null!==(n=this.favorite)&&void 0!==n&&n,organizationUseTotp:null!==(s=this.organizationUseTotp)&&void 0!==s&&s,permissions:null===(l=this.permissions)||void 0===l?void 0:l.toSdkCipherPermissions(),edit:null===(d=this.edit)||void 0===d||d,viewPassword:null===(u=this.viewPassword)||void 0===u||u,localData:(0,c.H)(this.localData),attachments:null===(h=this.attachments)||void 0===h?void 0:h.map(e=>e.toSdkAttachmentView()),fields:null===(A=this.fields)||void 0===A?void 0:A.map(e=>e.toSdkFieldView()),passwordHistory:null===(p=this.passwordHistory)||void 0===p?void 0:p.map(e=>e.toSdkPasswordHistoryView()),collectionIds:null!==(v=null===(g=this.collectionIds)||void 0===g?void 0:g.map(e=>(0,r.WD)(e)))&&void 0!==v?v:[],revisionDate:(null!==(f=this.revisionDate)&&void 0!==f?f:new Date).toISOString(),creationDate:(null!==(m=this.creationDate)&&void 0!==m?m:new Date).toISOString(),deletedDate:null===(y=this.deletedDate)||void 0===y?void 0:y.toISOString(),archivedDate:null===(C=this.archivedDate)||void 0===C?void 0:C.toISOString(),reprompt:null!==(w=this.reprompt)&&void 0!==w?w:a.b.None,key:null===(I=this.key)||void 0===I?void 0:I.toSdk(),login:void 0,card:void 0,identity:void 0,secureNote:void 0,sshKey:void 0};switch(this.type){case o.gC.Card:T.card=null===(b=this.card)||void 0===b?void 0:b.toSdkCardView();break;case o.gC.Identity:T.identity=null===(B=this.identity)||void 0===B?void 0:B.toSdkIdentityView();break;case o.gC.Login:T.login=null===(E=this.login)||void 0===E?void 0:E.toSdkLoginView();break;case o.gC.SecureNote:T.secureNote=null===(S=this.secureNote)||void 0===S?void 0:S.toSdkSecureNoteView();break;case o.gC.SshKey:T.sshKey=null===(Q=this.sshKey)||void 0===Q?void 0:Q.toSdkSshKeyView()}if(e&&this.type===o.gC.Login&&(null===(k=this.login)||void 0===k?void 0:k.hasFido2Credentials)){const t=this.login.fido2Credentials.map(e=>e.toSdkFido2CredentialFullView());T=e.set_fido2_credentials(T,t)}return T}}},76356(e,t,i){"use strict";i.d(t,{e:()=>l});var n=i(94573),r=i(33812),s=i(36288),o=i(43759),a=i(50700);class l{onClick(){this.toggled.update(e=>!e),this.toggledChange.emit(this.toggled()),this.update()}constructor(e,t,i){this.button=e,this.formField=t,this.i18nService=i,this.toggled=(0,n.geq)(!1),this.toggledChange=new r.bkB,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(){const e=this.formField.input();(null==e?void 0:e.type)&&this.toggled.set("password"!==e.type()),this.button.icon.set(this.icon)}update(){var e;this.button.icon.set(this.icon);const t=this.formField.input();null!=(null==t?void 0:t.type)&&(t.type.set(this.toggled()?"text":"password"),null===(e=null==t?void 0:t.spellcheck)||void 0===e||e.set(!this.toggled()&&void 0))}}l.ɵfac=function(e){return new(e||l)(r.rXU(s.s,1),r.rXU(o.h),r.rXU(a.W))},l.ɵdir=r.FsC({type:l,selectors:[["","bitPasswordInputToggle",""]],hostVars:3,hostBindings:function(e,t){1&e&&r.bIt("click",function(){return t.onClick()}),2&e&&r.BMQ("aria-pressed",t.toggled())("title",t.title)("aria-label",t.label)},inputs:{toggled:[1,"toggled"]},outputs:{toggled:"toggledChange",toggledChange:"toggledChange"},features:[r.OA$]})},76506(e,t,i){"use strict";i.d(t,{S:()=>n});class n{constructor(e){null!=e&&(this.uri=e.uri,this.uriChecksum=e.uriChecksum,this.match=e.match)}}},76687(e,t,i){"use strict";i.d(t,{$i:()=>r,bL:()=>s});var n=i(3204);const r=(0,n.T)(e=>{if(!e)throw new Error("Account not found");return{type:"account",data:e}}),s=(0,n.T)(e=>{if(!e)throw new Error("Organization not found");return{type:"organization",data:e}});(0,n.T)(e=>{if(!e)throw new Error("Organization not found");return{type:"provider",data:e}})},76758(e,t,i){"use strict";i.d(t,{QY:()=>it,O0:()=>bt,r2:()=>Ne,$t:()=>ot,Fh:()=>$e,jN:()=>Oe,qi:()=>R,jg:()=>vt,C7:()=>ri,TP:()=>jt,QP:()=>X});var n=i(77468),r=i(51757),s=i(66046),o=i(16878),a=i(8029),l=i(55159),c=i(72245),d=i(14803),u=i(36359),h=i(69194),A=i(44500),p=i(94735),g=i(12058),v=i(81441),f=i(3633),m=i(51151),y=i(82468),C=i(56962),w=i(83516),I=i(49272),b=i(63457),B=i(29029),E=i(26411),S=i(37579),Q=i(22191),k=i(5513),T=i(8916),F=i(92027);const P=Object.freeze({MasterPassword:"masterPassword",Pin:"pin",Biometrics:"biometrics",Prf:"prf"});class R{}var D=i(74208),M=i(94573),x=i(33277),O=i(2738),G=i(35500),U=i(17898),V=i(1601),j=i(50700),N=i(37115),z=i(69855),Y=i(90107),L=i(5819),K=i(33812);class X{}var q=i(66316),H=i(56898),W=i(26657),$=i(25740),J=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Z(e,t){if(1&e){const e=K.RV6();K.j41(0,"button",2),K.bIt("click",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.unlockViaPrf())}),K.nrm(1,"i",3),K.EFF(2),K.nI1(3,"i18n"),K.k0s()}if(2&e){const e=K.XpG(2);K.Y8G("disabled",e.unlocking)("loading",e.unlocking),K.R7$(2),K.SpI(" ",K.bMT(3,3,"unlockWithPasskey")," ")}}function _(e,t){if(1&e){const e=K.RV6();K.j41(0,"button",4),K.bIt("click",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.unlockViaPrf())}),K.nrm(1,"i",3),K.EFF(2),K.nI1(3,"i18n"),K.k0s()}if(2&e){const e=K.XpG(2);K.Y8G("disabled",e.unlocking)("loading",e.unlocking),K.R7$(2),K.SpI(" ",K.bMT(3,3,"unlockWithPasskey")," ")}}function ee(e,t){if(1&e&&(K.nVh(0,Z,4,5,"button",0),K.nVh(1,_,4,5,"button",1)),2&e){const e=K.XpG();K.vxM(e.formButton()?0:-1),K.R7$(),K.vxM(e.formButton()?-1:1)}}class te{constructor(e,t,i,n,r){this.accountService=e,this.webAuthnPrfUnlockService=t,this.dialogService=i,this.i18nService=n,this.logService=r,this.formButton=(0,M.hFB)(!1),this.unlockSuccess=(0,M.CGW)(),this.unlocking=!1,this.isAvailable=!1,this.userId=null}ngOnInit(){return J(this,void 0,void 0,function*(){const e=yield(0,c._)(this.accountService.activeAccount$);(null==e?void 0:e.id)&&(this.userId=e.id,this.isAvailable=yield this.webAuthnPrfUnlockService.isPrfUnlockAvailable(this.userId))})}unlockViaPrf(){return J(this,void 0,void 0,function*(){if(this.userId&&this.isAvailable){this.unlocking=!0;try{const e=yield this.webAuthnPrfUnlockService.unlockVaultWithPrf(this.userId);this.unlockSuccess.emit(e)}catch(e){this.logService.error("[UnlockViaPrfComponent] Failed to unlock via PRF:",e);let t=this.i18nService.t("unexpectedError");if(e instanceof Error)if(e.message.includes("No PRF credentials"))t=this.i18nService.t("noPrfCredentialsAvailable");else if(e.message.includes("canceled"))return void(this.unlocking=!1);yield this.dialogService.openSimpleDialog({title:{key:"error"},content:t,acceptButtonText:{key:"ok"},type:"danger"})}finally{this.unlocking=!1}}})}}te.ɵfac=function(e){return new(e||te)(K.rXU(G.D),K.rXU(X),K.rXU(q.o3),K.rXU(j.W),K.rXU(C.K))},te.ɵcmp=K.VBU({type:te,selectors:[["bit-unlock-via-prf"]],inputs:{formButton:[1,"formButton"]},outputs:{unlockSuccess:"unlockSuccess"},decls:1,vars:1,consts:[["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"disabled","loading"],["type","button","bitButton","","buttonType","secondary","block","",3,"disabled","loading"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click","disabled","loading"],["aria-hidden","true",1,"bwi","bwi-passkey","tw-mr-1"],["type","button","bitButton","","buttonType","secondary","block","",3,"click","disabled","loading"]],template:function(e,t){1&e&&K.nVh(0,ee,2,2),2&e&&K.vxM(t.isAvailable?0:-1)},dependencies:[n.MD,p.p,B.t,H.Q,S.C,W.$,$.$],encapsulation:2});var ie=i(49519),ne=i(57083),re=i(86226),se=i(97553),oe=i(43759),ae=i(76356),le=i(69896),ce=i(38620),de=i(36288),ue=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function he(e,t){if(1&e){const e=K.RV6();K.j41(0,"button",10),K.bIt("click",function(){D.eBV(e);const t=K.XpG();return D.Njj(t.activeUnlockOption.set(t.UnlockOption.Biometrics))}),K.j41(1,"span"),K.EFF(2),K.nI1(3,"i18n"),K.k0s()()}if(2&e){const e=K.XpG();K.Y8G("disabled",!e.biometricsAvailable()),K.R7$(2),K.SpI(" ",K.bMT(3,2,e.biometricUnlockBtnText()))}}function Ae(e,t){if(1&e){const e=K.RV6();K.j41(0,"button",11),K.bIt("click",function(){D.eBV(e);const t=K.XpG();return D.Njj(t.activeUnlockOption.set(t.UnlockOption.Pin))}),K.EFF(1),K.nI1(2,"i18n"),K.k0s()}2&e&&(K.R7$(),K.SpI(" ",K.bMT(2,1,"unlockWithPin")," "))}class pe{constructor(){this.accountService=(0,D.WQX)(G.D),this.masterPasswordUnlockService=(0,D.WQX)(U.b),this.i18nService=(0,D.WQX)(j.W),this.toastService=(0,D.WQX)(z.f),this.logService=(0,D.WQX)(Y.Kc),this.platformUtilsService=(0,D.WQX)(N.y),this.messageListener=(0,D.WQX)(L.qk),this.unlockService=(0,D.WQX)(F.M),this.keyService=(0,D.WQX)(T.Lu),this.configService=(0,D.WQX)(V.w),this.UnlockOption=P,this.activeUnlockOption=M.geq.required(),this.unlockOptions=M.hFB.required(),this.biometricUnlockBtnText=M.hFB.required(),this.showPinSwap=(0,x.EW)(()=>{var e;return null!==(e=this.unlockOptions().pin.enabled)&&void 0!==e&&e}),this.biometricsAvailable=(0,x.EW)(()=>{var e;return null!==(e=this.unlockOptions().biometrics.enabled)&&void 0!==e&&e}),this.showBiometricsSwap=(0,x.EW)(()=>{const e=this.unlockOptions().biometrics.biometricsStatus;return e!==T.cR.PlatformUnsupported&&e!==T.cR.NotEnabledLocally}),this.successfulUnlock=(0,M.CGW)(),this.prfUnlockSuccess=(0,M.CGW)(),this.logOut=(0,M.CGW)(),this.showPassword=!1,this.destroy$=new s.B,this.formGroup=new r.gE({masterPassword:new r.MJ("",{validators:[r.k0.required],updateOn:"submit"})}),this.submit=()=>ue(this,void 0,void 0,function*(){this.formGroup.markAllAsTouched();const e=this.formGroup.controls.masterPassword.value;if(this.formGroup.invalid||!e)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("masterPasswordRequired")});const t=yield(0,c._)((0,f.F6)(this.accountService.activeAccount$));yield this.unlockViaMasterPassword(e,t)})}ngOnInit(){return ue(this,void 0,void 0,function*(){this.platformUtilsService.getClientType()===O.s.Desktop&&this.messageListener.messages$(new L.Lg("windowHidden")).pipe((0,d.Q)(this.destroy$)).subscribe(()=>{this.showPassword=!1})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}unlockViaMasterPassword(e,t){return ue(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(y.TO.UnlockViaSDK))try{yield this.unlockService.unlockWithMasterPassword(t,e);const i=yield(0,c._)(this.keyService.userKey$(t));if(!i)throw this.logService.error("[MasterPasswordLockComponent] Failed to retrieve user key after master password unlock"),Error("Failed to retrieve user key");this.successfulUnlock.emit({userKey:i,masterPassword:e})}catch(i){this.logService.error("[MasterPasswordLockComponent] Failed to unlock via master password",i),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})}else try{const i=yield this.masterPasswordUnlockService.unlockWithMasterPassword(e,t);this.successfulUnlock.emit({userKey:i,masterPassword:e})}catch(i){this.logService.error("[MasterPasswordLockComponent] Failed to unlock via master password",i),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})}})}onPrfUnlockSuccess(e){this.prfUnlockSuccess.emit(e)}}pe.ɵfac=function(e){return new(e||pe)},pe.ɵcmp=K.VBU({type:pe,selectors:[["bit-master-password-lock"]],inputs:{activeUnlockOption:[1,"activeUnlockOption"],unlockOptions:[1,"unlockOptions"],biometricUnlockBtnText:[1,"biometricUnlockBtnText"]},outputs:{activeUnlockOption:"activeUnlockOptionChange",successfulUnlock:"successfulUnlock",prfUnlockSuccess:"prfUnlockSuccess",logOut:"logOut"},decls:20,vars:18,consts:[[3,"formGroup","bitSubmit"],["type","password","formControlName","masterPassword","bitInput","","appAutofocus","","name","masterPassword","required","","appInputVerbatim","",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],[1,"tw-flex","tw-flex-col","tw-space-y-3"],["type","submit","bitButton","","bitFormButton","","buttonType","primary","block",""],[1,"tw-text-center"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block",""],[3,"unlockSuccess","formButton"],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click","disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click"]],template:function(e,t){1&e&&(K.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),K.EFF(3),K.nI1(4,"i18n"),K.k0s(),K.nrm(5,"input",1),K.j41(6,"button",2),K.mxI("toggledChange",function(e){return K.DH7(t.showPassword,e)||(t.showPassword=e),e}),K.k0s()(),K.j41(7,"div",3)(8,"button",4),K.EFF(9),K.nI1(10,"i18n"),K.k0s(),K.j41(11,"p",5),K.EFF(12),K.nI1(13,"i18n"),K.k0s(),K.nVh(14,he,4,4,"button",6),K.nVh(15,Ae,3,3,"button",7),K.j41(16,"bit-unlock-via-prf",8),K.bIt("unlockSuccess",function(e){return t.onPrfUnlockSuccess(e)}),K.k0s(),K.j41(17,"button",9),K.bIt("click",function(){return t.logOut.emit()}),K.EFF(18),K.nI1(19,"i18n"),K.k0s()()()),2&e&&(K.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),K.R7$(3),K.JRh(K.bMT(4,10,"masterPass")),K.R7$(3),K.R50("toggled",t.showPassword),K.R7$(3),K.SpI(" ",K.bMT(10,12,"unlock")," "),K.R7$(3),K.JRh(K.bMT(13,14,"or")),K.R7$(2),K.vxM(t.showBiometricsSwap()?14:-1),K.R7$(),K.vxM(t.showPinSwap()?15:-1),K.R7$(),K.Y8G("formButton",!0),K.R7$(2),K.SpI(" ",K.bMT(19,16,"logOut")," "))},dependencies:[p.p,ie.B,ne.q,r.X1,r.qT,r.me,r.BC,r.cb,r.YS,r.j4,r.JD,B.t,H.Q,E.L,re.j,se.J,oe.h,ae.e,le.a,S.C,W.$,ce.L,Q.Q,de.s,te,$.$],encapsulation:2});var ge=i(84101),ve=i(23649),fe=i(1221),me=i(83541),ye=i(39935),Ce=i(18499),we=i(27650),Ie=i(52396),be=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Be(e,t){1&e&&(K.j41(0,"div",2),K.nrm(1,"i",3),K.k0s())}function Ee(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"button",11),K.bIt("click",function(){D.eBV(e);const t=K.XpG(3);return D.Njj(t.activeUnlockOption=t.UnlockOption.Pin)}),K.EFF(2),K.nI1(3,"i18n"),K.k0s(),K.bVm()}2&e&&(K.R7$(2),K.SpI(" ",K.bMT(3,1,"unlockWithPin")," "))}function Se(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"button",11),K.bIt("click",function(){D.eBV(e);const t=K.XpG(3);return D.Njj(t.activeUnlockOption=t.UnlockOption.MasterPassword)}),K.EFF(2),K.nI1(3,"i18n"),K.k0s(),K.bVm()}2&e&&(K.R7$(2),K.SpI(" ",K.bMT(3,1,"unlockWithMasterPassword")," "))}function Qe(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"button",6),K.bIt("click",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.unlockViaBiometrics())}),K.j41(2,"span"),K.EFF(3),K.nI1(4,"i18n"),K.k0s()(),K.j41(5,"div",7)(6,"p",8),K.EFF(7),K.nI1(8,"i18n"),K.k0s(),K.DNE(9,Ee,4,3,"ng-container",4)(10,Se,4,3,"ng-container",4),K.j41(11,"bit-unlock-via-prf",9),K.bIt("unlockSuccess",function(t){D.eBV(e);const i=K.XpG(2);return D.Njj(i.onPrfUnlockSuccess(t))}),K.k0s(),K.j41(12,"button",10),K.bIt("click",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.logOut())}),K.EFF(13),K.nI1(14,"i18n"),K.k0s()(),K.bVm()}if(2&e){const e=K.XpG(2);K.R7$(),K.Y8G("disabled",e.unlockingViaBiometrics||!e.biometricsAvailable)("loading",e.unlockingViaBiometrics)("bitTooltip",e.biometricUnavailabilityReason),K.R7$(2),K.SpI(" ",K.bMT(4,8,e.biometricUnlockBtnText)),K.R7$(4),K.JRh(K.bMT(8,10,"or")),K.R7$(2),K.Y8G("ngIf",e.unlockOptions.pin.enabled),K.R7$(),K.Y8G("ngIf",e.unlockOptions.masterPassword.enabled),K.R7$(3),K.SpI(" ",K.bMT(14,12,"logOut")," ")}}function ke(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"button",19),K.bIt("click",function(){D.eBV(e);const t=K.XpG(3);return D.Njj(t.activeUnlockOption=t.UnlockOption.Biometrics)}),K.j41(2,"span"),K.EFF(3),K.nI1(4,"i18n"),K.k0s()(),K.bVm()}if(2&e){const e=K.XpG(3);K.R7$(),K.Y8G("disabled",!e.biometricsAvailable),K.R7$(2),K.SpI(" ",K.bMT(4,2,e.biometricUnlockBtnText))}}function Te(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"button",20),K.bIt("click",function(){D.eBV(e);const t=K.XpG(3);return D.Njj(t.activeUnlockOption=t.UnlockOption.MasterPassword)}),K.EFF(2),K.nI1(3,"i18n"),K.k0s(),K.bVm()}2&e&&(K.R7$(2),K.SpI(" ",K.bMT(3,1,"unlockWithMasterPassword")," "))}function Fe(e,t){if(1&e){const e=K.RV6();K.qex(0),K.j41(1,"form",12)(2,"bit-form-field")(3,"bit-label"),K.EFF(4),K.nI1(5,"i18n"),K.k0s(),K.nrm(6,"input",13),K.j41(7,"button",14),K.mxI("toggledChange",function(t){D.eBV(e);const i=K.XpG(2);return K.DH7(i.showPassword,t)||(i.showPassword=t),D.Njj(t)}),K.k0s()(),K.j41(8,"div",7)(9,"button",15),K.EFF(10),K.nI1(11,"i18n"),K.k0s(),K.j41(12,"p",16),K.EFF(13),K.nI1(14,"i18n"),K.k0s(),K.DNE(15,ke,5,4,"ng-container",4)(16,Te,4,3,"ng-container",4),K.j41(17,"bit-unlock-via-prf",17),K.bIt("unlockSuccess",function(t){D.eBV(e);const i=K.XpG(2);return D.Njj(i.onPrfUnlockSuccess(t))}),K.k0s(),K.j41(18,"button",18),K.bIt("click",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.logOut())}),K.EFF(19),K.nI1(20,"i18n"),K.k0s()()(),K.bVm()}if(2&e){const e=K.XpG(2);K.R7$(),K.Y8G("bitSubmit",e.submit)("formGroup",e.formGroup),K.R7$(3),K.JRh(K.bMT(5,10,"pin")),K.R7$(3),K.R50("toggled",e.showPassword),K.R7$(3),K.SpI(" ",K.bMT(11,12,"unlock")," "),K.R7$(3),K.JRh(K.bMT(14,14,"or")),K.R7$(2),K.Y8G("ngIf",e.showBiometrics),K.R7$(),K.Y8G("ngIf",e.unlockOptions.masterPassword.enabled),K.R7$(),K.Y8G("formButton",!0),K.R7$(2),K.SpI(" ",K.bMT(20,16,"logOut")," ")}}function Pe(e,t){if(1&e){const e=K.RV6();K.j41(0,"bit-master-password-lock",21),K.mxI("activeUnlockOptionChange",function(t){D.eBV(e);const i=K.XpG(2);return K.DH7(i.activeUnlockOption,t)||(i.activeUnlockOption=t),D.Njj(t)}),K.bIt("successfulUnlock",function(t){D.eBV(e);const i=K.XpG(2);return D.Njj(i.successfulMasterPasswordUnlock(t))})("prfUnlockSuccess",function(t){D.eBV(e);const i=K.XpG(2);return D.Njj(i.onPrfUnlockSuccess(t))})("logOut",function(){D.eBV(e);const t=K.XpG(2);return D.Njj(t.logOut())}),K.k0s()}if(2&e){const e=K.XpG(2);K.R50("activeUnlockOption",e.activeUnlockOption),K.Y8G("unlockOptions",e.unlockOptions)("biometricUnlockBtnText",e.biometricUnlockBtnText)}}function Re(e,t){if(1&e&&(K.qex(0),K.DNE(1,Qe,15,14,"ng-container",4)(2,Fe,21,18,"ng-container",4),K.nVh(3,Pe,1,3,"bit-master-password-lock",5),K.bVm()),2&e){const e=K.XpG();K.R7$(),K.Y8G("ngIf",e.activeUnlockOption===e.UnlockOption.Biometrics),K.R7$(),K.Y8G("ngIf",e.unlockOptions.pin.enabled&&e.activeUnlockOption===e.UnlockOption.Pin),K.R7$(),K.vxM(e.unlockOptions.masterPassword.enabled&&e.activeUnlockOption===e.UnlockOption.MasterPassword?3:-1)}}const De="LockComponent",Me={[m.sK.Web]:"vault",[m.sK.Desktop]:"vault",[m.sK.Browser]:"/tabs/current"},xe=[T.cR.HardwareUnavailable,T.cR.DesktopDisconnected,T.cR.NotEnabledInConnectedDesktopApp];class Oe{set activeUnlockOption(e){this._activeUnlockOptionBSubject.next(e)}get activeUnlockOption(){return this._activeUnlockOptionBSubject.value}constructor(e,t,i,n,r,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S,Q,k,T){this.accountService=e,this.pinService=t,this.keyService=i,this.platformUtilsService=n,this.router=r,this.activatedRoute=a,this.dialogService=l,this.messagingService=c,this.biometricStateService=d,this.ngZone=u,this.i18nService=h,this.masterPasswordService=A,this.logService=p,this.deviceTrustService=g,this.syncService=v,this.policyService=f,this.passwordStrengthService=m,this.formBuilder=y,this.toastService=C,this.userAsymmetricKeysRegenerationService=w,this.biometricService=I,this.logoutService=b,this.lockComponentService=B,this.anonLayoutWrapperDataService=E,this.encryptedMigrator=S,this.broadcasterService=Q,this.unlockService=k,this.configService=T,this.destroy$=new s.B,this.loading=!0,this.activeAccount=null,this.unlockOptions=null,this.UnlockOption=P,this._activeUnlockOptionBSubject=new o.t(null),this.activeUnlockOption$=this._activeUnlockOptionBSubject.asObservable(),this.invalidPinAttempts=0,this.showPassword=!1,this.enforcedMasterPasswordOptions=void 0,this.formGroup=null,this.shouldClosePopout=!1,this.deferFocus=null,this.biometricAsked=!1,this.defaultUnlockOptionSetForUser=!1,this.unlockingViaBiometrics=!1,this.submit=()=>be(this,void 0,void 0,function*(){if(this.activeUnlockOption===P.Pin)return yield this.unlockViaPin()})}ngOnInit(){return be(this,void 0,void 0,function*(){this.listenForActiveUnlockOptionChanges(),this.listenForActiveAccountChanges(),this.listenForUnlockOptionsChanges(),this.clientType=this.platformUtilsService.getClientType(),this.clientType===m.sK.Desktop?yield this.desktopOnInit():this.clientType===m.sK.Browser&&(this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText())})}listenForUnlockOptionsChanges(){(0,a.O)(0,1e3).pipe((0,l.Z)(()=>be(this,void 0,void 0,function*(){var e,t,i;if(!1===this.loading&&null!=(null===(e=this.activeAccount)||void 0===e?void 0:e.id)){const e=null===(t=this.unlockOptions)||void 0===t?void 0:t.biometrics.enabled;this.unlockOptions=yield(0,c._)(this.lockComponentService.getAvailableUnlockOptions$(this.activeAccount.id)),null==this.activeUnlockOption?yield this.setDefaultActiveUnlockOption(this.unlockOptions):!e&&(null===(i=this.unlockOptions)||void 0===i?void 0:i.biometrics.enabled)&&(yield this.setDefaultActiveUnlockOption(this.unlockOptions),this.activeUnlockOption===P.Biometrics&&(yield this.handleBiometricsUnlockEnabled()))}})),(0,d.Q)(this.destroy$)).subscribe()}listenForActiveUnlockOptionChanges(){this.activeUnlockOption$.pipe((0,d.Q)(this.destroy$)).subscribe(e=>{e===P.Pin&&this.buildPinForm()})}buildPinForm(){this.formGroup=this.formBuilder.group({pin:["",[r.k0.required]]},{updateOn:"submit"})}listenForActiveAccountChanges(){this.accountService.activeAccount$.pipe((0,u.M)(e=>{this.loading=!0,this.activeAccount=e,this.resetDataOnActiveAccountChange()}),(0,h.p)(e=>null!=e),(0,A.n)(e=>be(this,void 0,void 0,function*(){yield this.handleActiveAccountChange(e),this.loading=!1})),(0,d.Q)(this.destroy$)).subscribe()}handleActiveAccountChange(e){return be(this,void 0,void 0,function*(){var t,i,n;if(!(yield this.keyService.hasUserKey(e.id))){if(this.setEmailAsPageSubtitle(e.email),this.unlockOptions=yield(0,c._)(this.lockComponentService.getAvailableUnlockOptions$(e.id)),!(null===(t=this.unlockOptions)||void 0===t?void 0:t.masterPassword.enabled)&&!(null===(i=this.unlockOptions)||void 0===i?void 0:i.pin.enabled)){if(![T.cR.Available,...xe].includes(yield this.biometricService.getBiometricsStatusForUser(e.id)))return this.logService.warning("[LockComponent] User cannot unlock again. Logging out!"),void(yield this.logoutService.logout(e.id))}yield this.setDefaultActiveUnlockOption(this.unlockOptions),(null===(n=this.unlockOptions)||void 0===n?void 0:n.biometrics.enabled)&&(yield this.handleBiometricsUnlockEnabled())}})}resetDataOnActiveAccountChange(){this.defaultUnlockOptionSetForUser=!1,this.unlockOptions=null,this.activeUnlockOption=null,this.formGroup=null,this.biometricAsked=!1}setEmailAsPageSubtitle(e){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:e})}setDefaultActiveUnlockOption(e){return be(this,void 0,void 0,function*(){(null==e?void 0:e.biometrics.enabled)?this.activeUnlockOption=P.Biometrics:(null==e?void 0:e.pin.enabled)?this.activeUnlockOption=P.Pin:(null==e?void 0:e.masterPassword.enabled)?this.activeUnlockOption=P.MasterPassword:null!=e&&xe.includes(e.biometrics.biometricsStatus)&&(this.activeUnlockOption=P.Biometrics)})}handleBiometricsUnlockEnabled(){return be(this,void 0,void 0,function*(){var e;this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText();const t=yield(0,c._)(this.biometricStateService.promptAutomatically$);if("desktop"===this.clientType&&t&&(this.loading=!1,yield this.desktopAutoPromptBiometrics()),"browser"===this.clientType&&(null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.enabled)&&t&&(yield this.biometricService.getShouldAutopromptNow())){yield this.biometricService.setShouldAutopromptNow(!1);const e=yield this.biometricStateService.getLastProcessReload();(null==e||isNaN(e.getTime())||Date.now()-e.getTime()>5e3)&&(this.platformUtilsService.getDevice()===m.bq.FirefoxExtension&&(yield this.lockComponentService.popOutBrowserExtension(),this.shouldClosePopout=!0),this.loading=!1,yield this.unlockViaBiometrics())}})}logOut(){return be(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&null!=this.activeAccount&&(yield this.logoutService.logout(this.activeAccount.id),yield this.router.navigate(["/"]))})}unlockViaBiometrics(){return be(this,void 0,void 0,function*(){if(this.unlockingViaBiometrics=!0,null!=this.unlockOptions&&this.unlockOptions.biometrics.enabled&&null!=this.activeAccount)try{let e;yield this.biometricStateService.setUserPromptCancelled(),(yield this.configService.getFeatureFlag(y.TO.UnlockViaSDK))?(yield this.unlockService.unlockWithBiometrics(this.activeAccount.id),e=yield(0,c._)(this.keyService.userKey$(this.activeAccount.id))):e=yield this.biometricService.unlockWithBiometricsForUser(this.activeAccount.id),e&&(yield this.setUserKeyAndContinue(e)),this.unlockingViaBiometrics=!1}catch(e){if(e instanceof Error&&"canceled"===e.message)return void(this.unlockingViaBiometrics=!1);let t;if(this.logService.error("[LockComponent] Failed to unlock via biometrics.",e),"browser"===this.clientType){const i=this.lockComponentService.getBiometricsError(e);i&&(t=this.i18nService.t(i))}t||(t=this.i18nService.t("unexpectedError"));(yield this.dialogService.openSimpleDialog({title:{key:"error"},content:t,acceptButtonText:{key:"tryAgain"},type:"danger"}))&&(yield this.unlockViaBiometrics()),this.unlockingViaBiometrics=!1}else this.unlockingViaBiometrics=!1})}onPrfUnlockSuccess(e){return be(this,void 0,void 0,function*(){yield this.setUserKeyAndContinue(e)})}togglePassword(){this.showPassword=!this.showPassword}validatePin(){var e;return!(null===(e=this.formGroup)||void 0===e?void 0:e.invalid)||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("pinRequired")}),!1)}unlockViaPin(){return be(this,void 0,void 0,function*(){if(!this.validatePin()||null==this.formGroup||null==this.activeAccount)return;const e=this.formGroup.controls.pin.value;if(yield this.configService.getFeatureFlag(y.TO.UnlockViaSDK))try{yield this.unlockService.unlockWithPin(this.activeAccount.id,e);const t=yield this.keyService.getUserKey(this.activeAccount.id);yield this.setUserKeyAndContinue(t)}catch(t){if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return this.toastService.showToast({variant:"error",message:this.i18nService.t("tooManyInvalidPinEntryAttemptsLoggingOut")}),void this.messagingService.send("logout");this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidPin")})}else try{const t=yield this.pinService.decryptUserKeyWithPin(e,this.activeAccount.id);if(t)return void(yield this.setUserKeyAndContinue(t));if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return this.toastService.showToast({variant:"error",message:this.i18nService.t("tooManyInvalidPinEntryAttemptsLoggingOut")}),void this.messagingService.send("logout");this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidPin")})}catch(i){this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("unexpectedError")})}})}successfulMasterPasswordUnlock(e){return be(this,void 0,void 0,function*(){null!=e.userKey&&e.masterPassword?yield this.setUserKeyAndContinue(e.userKey,{passwordEvaluation:{masterPassword:e.masterPassword}}):this.logService.error("[LockComponent] successfulMasterPasswordUnlock called with invalid data.")})}setUserKeyAndContinue(e){return be(this,arguments,void 0,function*(e,t={}){if(null==this.activeAccount)throw new Error("No active user.");this.logService.mark("Vault unlocked"),yield this.keyService.setUserKey(e,this.activeAccount.id),yield this.pinService.userUnlocked(this.activeAccount.id),yield this.deviceTrustService.trustDeviceIfRequired(this.activeAccount.id),yield this.doContinue(t)})}doContinue(e){return be(this,void 0,void 0,function*(){var t,i,n;if(null==this.activeAccount)throw new Error("No active user.");yield this.biometricStateService.resetUserPromptCancelled();try{yield this.encryptedMigrator.runMigrations(this.activeAccount.id,null!==(i=null===(t=e.passwordEvaluation)||void 0===t?void 0:t.masterPassword)&&void 0!==i?i:null)}catch(s){}if(this.messagingService.send("unlocked"),e.passwordEvaluation){const t=null===(n=yield(0,c._)(this.accountService.activeAccount$))||void 0===n?void 0:n.id;if(null==t)throw new Error("No active user.");try{null==this.enforcedMasterPasswordOptions&&(this.enforcedMasterPasswordOptions=yield(0,c._)(this.accountService.activeAccount$.pipe(f.F6,(0,A.n)(e=>this.policyService.masterPasswordPolicyOptions$(e))))),this.requirePasswordChange(e.passwordEvaluation.masterPassword)&&(yield this.masterPasswordService.setForceSetPasswordReason(v.n.WeakMasterPassword,t))}catch(o){this.logService.error(o)}}if(this.platformUtilsService.getClientType()==m.sK.Web){const e=performance.now();yield this.syncService.fullSync(!0),this.logService.measure(e,"KeyManagement","LockComponent","sync complete")}else this.syncService.fullSync(!1);const r=(new Date).getTime();if(yield this.userAsymmetricKeysRegenerationService.regenerateIfNeeded(this.activeAccount.id),this.logService.info(`[LockComponent] Private key regeneration took ${(new Date).getTime()-r}ms`),"browser"===this.clientType){const e=this.lockComponentService.getPreviousUrl();if(e)return void(yield this.router.navigateByUrl(e))}if(null!=this.clientType&&null===this.activatedRoute.snapshot.paramMap.get("disable-redirect")){const e=Me[this.clientType];yield this.router.navigate([e])}this.shouldClosePopout&&this.platformUtilsService.getDevice()===m.bq.FirefoxExtension&&this.lockComponentService.closeBrowserExtensionPopout()})}requirePasswordChange(e){var t;if(null==this.enforcedMasterPasswordOptions||!this.enforcedMasterPasswordOptions.enforceOnLogin||null==this.activeAccount)return!1;const i=null===(t=this.passwordStrengthService.getPasswordStrength(e,this.activeAccount.email))||void 0===t?void 0:t.score;return!this.policyService.evaluateMasterPassword(i,e,this.enforcedMasterPasswordOptions)}desktopOnInit(){return be(this,void 0,void 0,function*(){this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText(),this.broadcasterService.subscribe(De,e=>be(this,void 0,void 0,function*(){this.ngZone.run(()=>{switch(e.command){case"windowHidden":this.onWindowHidden();break;case"windowIsFocused":null===this.deferFocus?(this.deferFocus=!e.windowIsFocused,this.deferFocus||this.focusInput()):this.deferFocus&&e.windowIsFocused&&(this.focusInput(),this.deferFocus=!1)}})})),this.messagingService.send("getWindowIsFocused")})}desktopAutoPromptBiometrics(){return be(this,void 0,void 0,function*(){var e,t;if(!(null===(t=null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics)||void 0===t?void 0:t.enabled)||this.biometricAsked)return;if(!(yield this.biometricService.getShouldAutopromptNow()))return;if(yield(0,c._)(this.biometricStateService.promptCancelled$))return;(yield this.lockComponentService.isWindowVisible())&&(this.biometricAsked=!0,yield this.unlockViaBiometrics())})}onWindowHidden(){this.showPassword=!1}focusInput(){var e;this.unlockOptions&&(null===(e=document.getElementById(this.unlockOptions.pin.enabled?"pin":"masterPassword"))||void 0===e||e.focus())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),"desktop"===this.clientType&&this.broadcasterService.unsubscribe(De)}get biometricsAvailable(){var e,t;return null!==(t=null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.enabled)&&void 0!==t&&t}get showBiometrics(){return null!=this.unlockOptions&&(this.unlockOptions.biometrics.biometricsStatus!==T.cR.PlatformUnsupported&&this.unlockOptions.biometrics.biometricsStatus!==T.cR.NotEnabledLocally)}get biometricUnavailabilityReason(){var e,t,i,n;switch(null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.biometricsStatus){case T.cR.Available:return"";case T.cR.UnlockNeeded:return this.i18nService.t("biometricsStatusHelptextUnlockNeeded");case T.cR.HardwareUnavailable:return this.i18nService.t("biometricsStatusHelptextHardwareUnavailable");case T.cR.AutoSetupNeeded:return this.i18nService.t("biometricsStatusHelptextAutoSetupNeeded");case T.cR.ManualSetupNeeded:return this.i18nService.t("biometricsStatusHelptextManualSetupNeeded");case T.cR.NotEnabledInConnectedDesktopApp:return this.i18nService.t("biometricsStatusHelptextNotEnabledInDesktop",null===(t=this.activeAccount)||void 0===t?void 0:t.email);case T.cR.NotEnabledLocally:return this.i18nService.t("biometricsStatusHelptextNotEnabledInDesktop",null===(i=this.activeAccount)||void 0===i?void 0:i.email);case T.cR.DesktopDisconnected:return this.i18nService.t("biometricsStatusHelptextDesktopDisconnected");default:return this.i18nService.t("biometricsStatusHelptextUnavailableReasonUnknown")+(null===(n=this.unlockOptions)||void 0===n?void 0:n.biometrics.biometricsStatus)}}}Oe.ɵfac=function(e){return new(e||Oe)(K.rXU(G.D),K.rXU(ge.t),K.rXU(T.Lu),K.rXU(N.y),K.rXU(ve.Ix),K.rXU(ve.nX),K.rXU(q.o3),K.rXU(w.U),K.rXU(T.vB),K.rXU(K.SKi),K.rXU(j.W),K.rXU(me.O),K.rXU(C.K),K.rXU(ye.M),K.rXU(I.H),K.rXU(Ce.N),K.rXU(b.Q),K.rXU(r.ok),K.rXU(z.f),K.rXU(T.wM),K.rXU(T.Zm),K.rXU(g.k4),K.rXU(R),K.rXU(fe.f),K.rXU(we.G),K.rXU(Ie.y),K.rXU(F.M),K.rXU(V.w))},Oe.ɵcmp=K.VBU({type:Oe,selectors:[["bit-lock"]],decls:3,vars:2,consts:[["spinner",""],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[4,"ngIf"],[3,"activeUnlockOption","unlockOptions","biometricUnlockBtnText"],["type","button","bitButton","","appAutofocus","","buttonType","primary","block","",1,"tw-mb-3",3,"click","disabled","loading","bitTooltip"],[1,"tw-flex","tw-flex-col","tw-space-y-3"],[1,"tw-text-center","tw-mb-0"],[3,"unlockSuccess"],["type","button","bitButton","","block","",3,"click"],["type","button","bitButton","","buttonType","secondary","block","",3,"click"],[3,"bitSubmit","formGroup"],["type","password","formControlName","pin","bitInput","","appAutofocus","","name","pin","required","","appInputVerbatim","",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],["type","submit","bitButton","","bitFormButton","","buttonType","primary","block",""],[1,"tw-text-center"],[3,"unlockSuccess","formButton"],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click","disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click"],[3,"activeUnlockOptionChange","successfulUnlock","prfUnlockSuccess","logOut","activeUnlockOption","unlockOptions","biometricUnlockBtnText"]],template:function(e,t){if(1&e&&K.DNE(0,Be,2,0,"ng-template",null,0,K.C5r)(2,Re,4,3,"ng-container",1),2&e){const e=K.sdS(1);K.R7$(2),K.Y8G("ngIf",t.unlockOptions&&!t.loading)("ngIfElse",e)}},dependencies:[n.MD,n.bT,p.p,ie.B,ne.q,r.X1,r.qT,r.me,r.BC,r.cb,r.YS,r.j4,r.JD,B.t,H.Q,E.L,re.j,se.J,oe.h,ae.e,le.a,S.C,W.$,ce.L,Q.Q,de.s,te,pe,k.d,$.$],encapsulation:2});var Ge=i(39306),Ue=i(78781);class Ve{static createResultToJson(e){return{id:e.credentialId,rawId:e.credentialId,response:{clientDataJSON:e.clientDataJSON,authenticatorData:e.authData,transports:e.transports,publicKey:e.publicKey,publicKeyAlgorithm:e.publicKeyAlgorithm,attestationObject:e.attestationObject},authenticatorAttachment:"platform",clientExtensionResults:e.extensions,type:"public-key"}}static getResultToJson(e){return{id:e.credentialId,rawId:e.credentialId,response:{clientDataJSON:e.clientDataJSON,authenticatorData:e.authenticatorData,signature:e.signature,userHandle:e.userHandle},authenticatorAttachment:"platform",clientExtensionResults:{},type:"public-key"}}static arrayToString(e){return Ve.fromBufferToB64(Ve.bufferSourceToUint8Array(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static stringToArray(e){return Ve.fromB64ToArray(Ve.fromUrlB64ToB64(e))}static bufferSourceToUint8Array(e){return Ve.isArrayBuffer(e)?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}static isArrayBuffer(e){return e instanceof ArrayBuffer||void 0===e.buffer}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToB64(e){if(null==e)return null;let t="";const i=new Uint8Array(e);for(let n=0;n<i.byteLength;n++)t+=String.fromCharCode(i[n]);return globalThis.btoa(t)}static fromB64ToArray(e){if(null==e)return null;const t=globalThis.atob(e),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}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 cipherHasNoOtherPasskeys(e,t){return null==e.login.fido2Credentials||0===e.login.fido2Credentials.length||e.login.fido2Credentials.some(e=>e.userHandle===t)}}var je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ne{constructor(e,t,i,n,r,s,o,a,l){this.webAuthnLoginPrfKeyService=e,this.keyService=t,this.userDecryptionOptionsService=i,this.encryptService=n,this.environmentService=r,this.platformUtilsService=s,this.window=o,this.logService=a,this.configService=l,this.navigatorCredentials=this.window.navigator.credentials}isPrfUnlockAvailable(e){return je(this,void 0,void 0,function*(){try{if(!(yield this.configService.getFeatureFlag(y.TO.PasskeyUnlock)))return!1;if(!this.navigatorCredentials||!this.navigatorCredentials.get)return!1;const t=this.platformUtilsService.getClientType();if(t===m.sK.Browser&&!this.platformUtilsService.isChromium())return!1;if(t!==m.sK.Web&&t!==m.sK.Browser)return!1;return 0!==(yield this.getPrfUnlockCredentials(e)).length}catch(t){return this.logService.error("Error checking PRF unlock availability:",t),!1}})}getPrfUnlockCredentials(e){return je(this,void 0,void 0,function*(){try{const t=yield this.getUserDecryptionOptions(e);return(null==t?void 0:t.webAuthnPrfOptions)?t.webAuthnPrfOptions.map(e=>({credentialId:e.credentialId,transports:e.transports})):[]}catch(t){return this.logService.error("Error getting PRF unlock credentials:",t),[]}})}unlockVaultWithPrf(e){return je(this,void 0,void 0,function*(){const t=yield this.getPrfUnlockCredentials(e);if(0===t.length)throw new Error("No PRF credentials available for unlock");const i=yield this.performWebAuthnGetWithPrf(t,e),n=yield this.createPrfKeyFromResponse(i),r=yield this.getPrfOptionForCredential(i.id,e),s=yield this.encryptService.unwrapDecapsulationKey(new Ge.k(r.encryptedPrivateKey),n),o=yield this.encryptService.decapsulateKeyUnsigned(new Ge.k(r.encryptedUserKey),s);if(!o)throw new Error("Failed to decrypt user key from private key");return o})}performWebAuthnGetWithPrf(e,t){return je(this,void 0,void 0,function*(){const i=yield this.getRpIdForUser(t),n=yield this.getUnlockWithPrfSalt(),r={publicKey:{challenge:new Uint8Array(32),allowCredentials:e.map(({credentialId:e,transports:t})=>({type:"public-key",id:Ve.stringToArray(e),transports:t||[]})),rpId:i,userVerification:"preferred",extensions:{prf:{eval:{first:n}}}}},s=yield this.navigatorCredentials.get(r);if(!s)throw new Error("WebAuthn get() returned null/undefined");if(!(s instanceof PublicKeyCredential))throw new Error("Failed to get PRF credential for unlock");return s})}createPrfKeyFromResponse(e){return je(this,void 0,void 0,function*(){var t,i;const n=null===(i=null===(t=e.getClientExtensionResults().prf)||void 0===t?void 0:t.results)||void 0===i?void 0:i.first;if(!n)throw new Error("No PRF result received from authenticator");try{return yield this.webAuthnLoginPrfKeyService.createSymmetricKeyFromPrf(n)}catch(r){throw this.logService.error("Failed to create unlock key from PRF:",r),r}})}getPrfOptionForCredential(e,t){return je(this,void 0,void 0,function*(){const i=yield this.getUserDecryptionOptions(t);if(!(null==i?void 0:i.webAuthnPrfOptions)||0===i.webAuthnPrfOptions.length)throw new Error("No WebAuthn PRF option found for user - cannot perform PRF unlock");const n=i.webAuthnPrfOptions.find(t=>t.credentialId===e);if(!n)throw new Error("No matching WebAuthn PRF option found for this credential");return n})}getUnlockWithPrfSalt(){return je(this,void 0,void 0,function*(){try{return yield this.webAuthnLoginPrfKeyService.getLoginWithPrfSalt()}catch(e){throw this.logService.error("Error getting unlock PRF salt:",e),e}})}getUserDecryptionOptions(e){return je(this,void 0,void 0,function*(){try{return yield(0,c._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e))}catch(t){return this.logService.error("Error getting user decryption options:",t),null}})}getRpIdForUser(e){return je(this,void 0,void 0,function*(){try{const t=yield(0,c._)(this.environmentService.getEnvironment$(e)),i=Ue.A.getHost(t.getWebVaultUrl());if(!i)return;const n=new URL(`https://${i}`);return n.hostname}catch(t){return void this.logService.error("Error getting rpId",t)}})}}var ze=i(81525),Ye=i(81573),Le=i(7730),Ke=i(68016),Xe=i(67311),qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function He(e,t){if(1&e&&(K.j41(0,"li"),K.EFF(1),K.nI1(2,"i18n"),K.k0s()),2&e){const e=K.XpG();K.R7$(),K.SpI(" ",K.i5U(2,1,"userkeyRotationDisclaimerAccountRecoveryOrgsText",e.params.orgName)," ")}}function We(e,t){if(1&e&&(K.j41(0,"li"),K.EFF(1),K.nI1(2,"i18n"),K.k0s()),2&e){const e=K.XpG();K.R7$(),K.SpI(" ",K.i5U(2,1,"userkeyRotationDisclaimerEmergencyAccessText",e.params.numberOfEmergencyAccessUsers)," ")}}class $e{constructor(e,t,i){this.params=e,this.logService=t,this.dialogRef=i}submit(){return qe(this,void 0,void 0,function*(){try{this.dialogRef.close(!0)}catch(e){this.logService.error(e)}})}static open(e,t){return e.open($e,{data:t})}}$e.ɵfac=function(e){return new(e||$e)(K.rXU(ze.Qs),K.rXU(C.K),K.rXU(ze.ce))},$e.ɵcmp=K.VBU({type:$e,selectors:[["key-rotation-trust-info"]],decls:18,vars:14,consts:[["dialogSize","large"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-2","tw-mb-0","tw-pl-4"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","target","_blank","rel","noreferrer","buttonType","primary",3,"click"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(K.j41(0,"bit-dialog",0)(1,"span",1)(2,"strong"),K.EFF(3),K.nI1(4,"i18n"),K.k0s()(),K.j41(5,"span",2),K.EFF(6),K.nI1(7,"i18n"),K.j41(8,"ul",3),K.DNE(9,He,3,4,"li",4)(10,We,3,4,"li",4),K.k0s()(),K.qex(11,5),K.j41(12,"a",6),K.bIt("click",function(){return t.submit()}),K.EFF(13),K.nI1(14,"i18n"),K.k0s(),K.j41(15,"button",7),K.EFF(16),K.nI1(17,"i18n"),K.k0s(),K.bVm(),K.k0s()),2&e&&(K.R7$(3),K.SpI(" ",K.bMT(4,6,"userkeyRotationDisclaimerTitle")," "),K.R7$(3),K.SpI(" ",K.bMT(7,8,"userkeyRotationDisclaimerDescription")," "),K.R7$(3),K.Y8G("ngIf",null!=t.params.orgName),K.R7$(),K.Y8G("ngIf",t.params.numberOfEmergencyAccessUsers>0),K.R7$(3),K.SpI(" ",K.bMT(14,10,"continue")," "),K.R7$(3),K.SpI(" ",K.bMT(17,12,"close")," "))},dependencies:[n.MD,n.bT,p.p,Ye.P,Le.I,Ke.m,Xe.hJ,B.t,H.Q,r.X1,S.C,r.YN,$.$],encapsulation:2});var Je=i(26477),Ze=i(75583),_e=i(80351),et=i(58806),tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class it{constructor(e,t,i,n,r){this.params=e,this.formBuilder=t,this.keyService=i,this.logService=n,this.dialogRef=r,this.loading=!0,this.fingerprint="",this.confirmForm=this.formBuilder.group({})}ngOnInit(){return tt(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.orgId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}submit(){return tt(this,void 0,void 0,function*(){this.loading||this.dialogRef.close(!0)})}static open(e,t){return e.open(it,{data:t})}}it.ɵfac=function(e){return new(e||it)(K.rXU(ze.Qs),K.rXU(r.ok),K.rXU(T.Lu),K.rXU(C.K),K.rXU(ze.ce))},it.ɵcmp=K.VBU({type:it,selectors:[["account-recovery-trust"]],decls:20,vars:18,consts:[["dialogSize","large",3,"loading","title","subtitle"],["bitDialogContent",""],["bitTypography","body1"],["bitDialogFooter",""],["buttonType","primary","bitButton","","bitFormButton","","type","button",3,"click"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(K.j41(0,"bit-dialog",0),K.nI1(1,"i18n"),K.qex(2,1),K.j41(3,"p",2),K.EFF(4),K.nI1(5,"i18n"),K.nrm(6,"br")(7,"br"),K.EFF(8),K.nI1(9,"i18n"),K.j41(10,"code"),K.EFF(11),K.k0s()(),K.bVm(),K.qex(12,3),K.j41(13,"button",4),K.bIt("click",function(){return t.submit()}),K.j41(14,"span"),K.EFF(15),K.nI1(16,"i18n"),K.k0s()(),K.j41(17,"button",5),K.EFF(18),K.nI1(19,"i18n"),K.k0s(),K.bVm(),K.k0s()),2&e&&(K.Y8G("loading",t.loading)("title",K.bMT(1,8,"trustOrganization"))("subtitle",t.params.name),K.R7$(4),K.SpI(" ",K.bMT(5,10,"orgTrustWarning1")," "),K.R7$(4),K.SpI(" ",K.bMT(9,12,"fingerprintPhrase")," "),K.R7$(3),K.JRh(t.fingerprint),K.R7$(4),K.JRh(K.bMT(16,14,"trust")),K.R7$(3),K.SpI(" ",K.bMT(19,16,"doNotTrust")," "))},dependencies:[n.MD,p.p,Ye.P,Le.I,Ke.m,Xe.hJ,B.t,H.Q,Je.V,Ze.E,et.r,r.X1,E.L,S.C,W.$,r.YN,_e.j,$.$],encapsulation:2});var nt=i(57178),rt=i(44432),st=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ot{constructor(e,t,i,n,r){this.params=e,this.formBuilder=t,this.keyService=i,this.logService=n,this.dialogRef=r,this.loading=!0,this.fingerprint="",this.confirmForm=this.formBuilder.group({})}ngOnInit(){return st(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.userId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}submit(){return st(this,void 0,void 0,function*(){this.loading||this.dialogRef.close(!0)})}static open(e,t){return e.open(ot,{data:t})}}ot.ɵfac=function(e){return new(e||ot)(K.rXU(ze.Qs),K.rXU(r.ok),K.rXU(T.Lu),K.rXU(C.K),K.rXU(ze.ce))},ot.ɵcmp=K.VBU({type:ot,selectors:[["emergency-access-trust"]],decls:23,vars:21,consts:[["dialogSize","large",3,"loading","title","subtitle"],["bitDialogContent",""],["type","warning"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noopener"],["bitDialogFooter",""],["buttonType","primary","bitButton","","bitFormButton","","type","button",3,"click"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(K.j41(0,"bit-dialog",0),K.nI1(1,"i18n"),K.qex(2,1),K.j41(3,"bit-callout",2),K.EFF(4),K.nI1(5,"i18n"),K.k0s(),K.j41(6,"p",3),K.EFF(7),K.nI1(8,"i18n"),K.j41(9,"a",4),K.EFF(10),K.nI1(11,"i18n"),K.k0s()(),K.j41(12,"p",3)(13,"code"),K.EFF(14),K.k0s()(),K.bVm(),K.qex(15,5),K.j41(16,"button",6),K.bIt("click",function(){return t.submit()}),K.j41(17,"span"),K.EFF(18),K.nI1(19,"i18n"),K.k0s()(),K.j41(20,"button",7),K.EFF(21),K.nI1(22,"i18n"),K.k0s(),K.bVm(),K.k0s()),2&e&&(K.Y8G("loading",t.loading)("title",K.bMT(1,9,"trustUser"))("subtitle",t.params.name),K.R7$(4),K.JRh(K.bMT(5,11,"emergencyAccessTrustWarning")),K.R7$(3),K.SpI(" ",K.bMT(8,13,"fingerprintEnsureIntegrityVerify")," "),K.R7$(3),K.SpI(" ",K.bMT(11,15,"learnMore")),K.R7$(4),K.JRh(t.fingerprint),K.R7$(4),K.JRh(K.bMT(19,17,"trust")),K.R7$(3),K.SpI(" ",K.bMT(22,19,"doNotTrust")," "))},dependencies:[n.MD,p.p,Ye.P,Le.I,Ke.m,Xe.hJ,B.t,H.Q,Je.V,nt.g,Ze.E,et.r,r.X1,E.L,S.C,W.$,r.YN,_e.j,rt.G,$.$],encapsulation:2});var at=i(7861),lt=i(39488),ct=i(3892),dt=i(36801),ut=i(52057),ht=i(11224),At=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function pt(e,t){1&e&&(K.j41(0,"div",0),K.nrm(1,"i",1),K.nI1(2,"i18n"),K.j41(3,"span",2),K.EFF(4),K.nI1(5,"i18n"),K.k0s()()),2&e&&(K.R7$(),K.Y8G("title",K.mNQ(K.bMT(2,3,"loading"))),K.R7$(3),K.JRh(K.bMT(5,5,"loading")))}function gt(e,t){if(1&e&&(K.j41(0,"p"),K.EFF(1),K.nI1(2,"i18n"),K.k0s(),K.j41(3,"p",3),K.EFF(4),K.nI1(5,"i18n"),K.k0s(),K.j41(6,"p",4),K.EFF(7),K.k0s(),K.j41(8,"p",5),K.EFF(9),K.nI1(10,"i18n"),K.nrm(11,"button",6),K.nI1(12,"i18n"),K.k0s(),K.j41(13,"p",7),K.EFF(14),K.k0s(),K.j41(15,"div",8)(16,"button",9),K.EFF(17),K.nI1(18,"i18n"),K.k0s(),K.j41(19,"button",10),K.EFF(20),K.nI1(21,"i18n"),K.k0s()()),2&e){const e=K.XpG();K.R7$(),K.JRh(K.bMT(2,12,"removeMasterPasswordForOrgUserKeyConnector")),K.R7$(3),K.JRh(K.bMT(5,14,"organization")),K.R7$(3),K.JRh(e.organization.name),K.R7$(2),K.SpI(" ",K.bMT(10,16,"domain")," "),K.R7$(2),K.Y8G("label",K.bMT(12,18,"keyConnectorDomainTooltip")),K.R7$(3),K.JRh(e.keyConnectorHostName),K.R7$(2),K.Y8G("block",!0)("bitAction",e.convert),K.R7$(),K.SpI(" ",K.bMT(18,20,"continueWithLogIn")," "),K.R7$(2),K.Y8G("block",!0)("bitAction",e.leave),K.R7$(),K.SpI(" ",K.bMT(21,22,"doNotContinue")," ")}}class vt{constructor(e,t,i,n,r,s,o,a,l){this.logService=e,this.router=t,this.accountService=i,this.syncService=n,this.i18nService=r,this.keyConnectorService=s,this.organizationApiService=o,this.dialogService=a,this.toastService=l,this.continuing=!1,this.leaving=!1,this.loading=!0,this.convert=()=>At(this,void 0,void 0,function*(){this.continuing=!0;try{yield this.keyConnectorService.migrateUser(this.organization.keyConnectorUrl,this.activeUserId),this.toastService.showToast({variant:"success",message:this.i18nService.t("organizationVerified")}),yield this.router.navigate(["/"])}catch(e){this.continuing=!1,this.handleActionError(e)}}),this.leave=()=>At(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"leaveOrganization"},content:{key:"leaveOrganizationContent"},type:"warning",acceptButtonText:{key:"leaveNow"},cancelButtonText:{key:"cancel"}})))return!1;this.leaving=!0;try{yield this.organizationApiService.leave(this.organization.id),this.toastService.showToast({variant:"success",message:this.i18nService.t("leftOrganization")}),yield this.router.navigate(["/"])}catch(e){this.leaving=!1,this.handleActionError(e)}})}ngOnInit(){return At(this,void 0,void 0,function*(){const e=yield(0,c._)(this.accountService.activeAccount$);return null==e?(this.logService.info("[Key Connector remove password] No active account found, redirecting to login."),void(yield this.router.navigate(["/"]))):(this.activeUserId=e.id,yield this.syncService.fullSync(!1),this.organization=yield this.keyConnectorService.getManagingOrganization(this.activeUserId),null==this.organization?(this.logService.info("[Key Connector remove password] No organization found, redirecting to login."),void(yield this.router.navigate(["/"]))):(this.keyConnectorHostName=Ue.A.getHostname(this.organization.keyConnectorUrl),void(this.loading=!1)))})}get action(){return this.continuing||this.leaving}handleActionError(e){let t="";(e instanceof at._||e instanceof Error)&&(t=e.message),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:t})}}vt.ɵfac=function(e){return new(e||vt)(K.rXU(C.K),K.rXU(ve.Ix),K.rXU(G.D),K.rXU(lt.H),K.rXU(j.W),K.rXU(ut.K),K.rXU(ht.X),K.rXU(q.o3),K.rXU(z.f))},vt.ɵcmp=K.VBU({type:vt,selectors:[["km-ui-remove-password"]],decls:2,vars:1,consts:[[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mb-0","tw-font-bold"],[1,"tw-mb-6"],[1,"tw-mb-0","tw-font-bold","tw-inline-flex","tw-items-center"],["type","button","tooltipPosition","above-center","bitIconButton","bwi-info-circle","size","small",3,"label"],[1,"tw-mb-6","tw-font-mono"],[1,"tw-flex","tw-flex-col","tw-gap-2"],["bitButton","","type","button","buttonType","primary",3,"block","bitAction"],["bitButton","","type","button","buttonType","secondary",3,"block","bitAction"]],template:function(e,t){1&e&&K.nVh(0,pt,6,7,"div",0)(1,gt,22,24),2&e&&K.vxM(t.loading?0:1)},dependencies:[n.MD,B.t,H.Q,ct.p,Q.Q,de.s,dt.$Z],encapsulation:2});var ft=i(31944),mt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function yt(e,t){1&e&&(K.j41(0,"div",0),K.nrm(1,"i",1),K.nI1(2,"i18n"),K.j41(3,"span",2),K.EFF(4),K.nI1(5,"i18n"),K.k0s()()),2&e&&(K.R7$(),K.Y8G("title",K.mNQ(K.bMT(2,3,"loading"))),K.R7$(3),K.JRh(K.bMT(5,5,"loading")))}function Ct(e,t){if(1&e&&(K.j41(0,"p"),K.EFF(1),K.nI1(2,"i18n"),K.k0s(),K.j41(3,"p",9),K.EFF(4),K.nI1(5,"i18n"),K.k0s(),K.j41(6,"p",10),K.EFF(7),K.k0s()),2&e){const e=K.XpG(2);K.R7$(),K.JRh(K.bMT(2,3,"confirmKeyConnectorOrganizationUserDescription")),K.R7$(3),K.JRh(K.bMT(5,5,"organization")),K.R7$(3),K.JRh(e.organizationName)}}function wt(e,t){1&e&&(K.j41(0,"p"),K.EFF(1),K.nI1(2,"i18n"),K.k0s()),2&e&&(K.R7$(),K.JRh(K.bMT(2,1,"verifyYourDomainDescription")))}function It(e,t){if(1&e&&(K.nVh(0,Ct,8,7)(1,wt,3,3,"p"),K.j41(2,"p",3),K.EFF(3),K.nI1(4,"i18n"),K.nrm(5,"button",4),K.nI1(6,"i18n"),K.k0s(),K.j41(7,"p",5),K.EFF(8),K.k0s(),K.j41(9,"div",6)(10,"button",7),K.EFF(11),K.nI1(12,"i18n"),K.k0s(),K.j41(13,"button",8),K.EFF(14),K.nI1(15,"i18n"),K.k0s()()),2&e){const e=K.XpG();K.vxM(e.organizationName?0:1),K.R7$(3),K.SpI(" ",K.bMT(4,10,"domain")," "),K.R7$(2),K.Y8G("label",K.bMT(6,12,"keyConnectorDomainTooltip")),K.R7$(3),K.JRh(e.keyConnectorHostName),K.R7$(2),K.Y8G("bitAction",e.confirm)("block",!0),K.R7$(),K.SpI(" ",K.bMT(12,14,"continueWithLogIn")," "),K.R7$(2),K.Y8G("bitAction",e.cancel)("block",!0),K.R7$(),K.SpI(" ",K.bMT(15,16,"doNotContinue")," ")}}class bt{constructor(e,t,i,n,r,s,o,a,l,c){this.router=e,this.logService=t,this.keyConnectorService=i,this.messagingService=n,this.syncService=r,this.accountService=s,this.keyConnectorApiService=o,this.toastService=a,this.i18nService=l,this.anonLayoutWrapperDataService=c,this.loading=!0,this.onBeforeNavigation=()=>mt(this,void 0,void 0,function*(){}),this.confirm=()=>mt(this,void 0,void 0,function*(){yield this.keyConnectorService.convertNewSsoUserToKeyConnector(this.userId),this.organizationName?this.toastService.showToast({variant:"success",message:this.i18nService.t("organizationVerified")}):this.toastService.showToast({variant:"success",message:this.i18nService.t("domainVerified")}),yield this.syncService.fullSync(!0),this.messagingService.send("loggedIn"),yield this.onBeforeNavigation(),yield this.router.navigate(["/"])}),this.cancel=()=>mt(this,void 0,void 0,function*(){this.messagingService.send("logout")})}ngOnInit(){return mt(this,void 0,void 0,function*(){try{this.userId=yield(0,c._)((0,f.F6)(this.accountService.activeAccount$))}catch(t){return this.logService.info("[confirm-key-connector-domain] no active account"),void this.messagingService.send("logout")}const e=yield(0,c._)(this.keyConnectorService.requiresDomainConfirmation$(this.userId));if(null==e)return this.logService.info("[confirm-key-connector-domain] missing required parameters"),void this.messagingService.send("logout");this.organizationName=yield this.getOrganizationName(e.organizationSsoIdentifier),null==this.organizationName&&this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"verifyYourDomainToLogin"}}),this.keyConnectorUrl=e.keyConnectorUrl,this.keyConnectorHostName=Ue.A.getHostname(e.keyConnectorUrl),this.loading=!1})}getOrganizationName(e){return mt(this,void 0,void 0,function*(){try{return(yield this.keyConnectorApiService.getConfirmationDetails(e)).organizationName}catch(t){return void this.logService.warning(`[ConfirmKeyConnectorDomainComponent] Unable to get key connector confirmation details for organizationSsoIdentifier ${e}:`,t)}})}}bt.ɵfac=function(e){return new(e||bt)(K.rXU(ve.Ix),K.rXU(C.K),K.rXU(ut.K),K.rXU(w.U),K.rXU(I.H),K.rXU(G.D),K.rXU(ft.E),K.rXU(z.f),K.rXU(j.W),K.rXU(fe.f))},bt.ɵcmp=K.VBU({type:bt,selectors:[["confirm-key-connector-domain"]],inputs:{onBeforeNavigation:"onBeforeNavigation"},decls:2,vars:1,consts:[[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mb-0","tw-font-bold","tw-inline-flex","tw-items-center"],["type","button","tooltipPosition","above-center","bitIconButton","bwi-info-circle","size","small",3,"label"],[1,"tw-mb-6","tw-font-mono"],[1,"tw-flex","tw-flex-col","tw-gap-2"],["bitButton","","type","button","buttonType","primary",3,"bitAction","block"],["bitButton","","type","button","buttonType","secondary",3,"bitAction","block"],[1,"tw-mb-0","tw-font-bold"],[1,"tw-mb-6"]],template:function(e,t){1&e&&K.nVh(0,yt,6,7,"div",0)(1,It,16,18),2&e&&K.vxM(t.loading?0:1)},dependencies:[n.MD,B.t,H.Q,ct.p,Q.Q,de.s,dt.$Z],encapsulation:2});var Bt=i(83731),Et=i(6056),St=i(3204),Qt=i(12610),kt=i(33338),Tt=i(34040),Ft=i(39444),Pt=i(73276),Rt=i(43978),Dt=i(685),Mt=i(16184),xt=i(47135),Ot=i(98403),Gt=i(8433),Ut=i(43008),Vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class jt{constructor(e,t,i){this.i18nService=e,this.sessionTimeoutTypeService=t,this.policyService=i,this.availableTimeoutOptions$=(0,Ut.v)(()=>Vt(this,void 0,void 0,function*(){const e=this.getAllTimeoutOptions();return(yield Promise.all(e.map(e=>Vt(this,void 0,void 0,function*(){return{option:e,available:yield this.sessionTimeoutTypeService.isAvailable(e.value)}})))).filter(e=>e.available).map(e=>e.option)}))}onTimeoutSave(e){}policyFilteredTimeoutOptions$(e){const t=this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e).pipe(Dt.Zc,(0,St.T)(e=>{var t;return null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}));return(0,kt.z)([this.availableTimeoutOptions$,t,t.pipe((0,Pt.H)(e=>Vt(this,void 0,void 0,function*(){if(null==e)return null;switch(e.type){case"immediately":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(Mt.BF.Immediately);case"onSystemLock":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(Mt.Lw.OnLocked)}return null})))]).pipe((0,Pt.H)(e=>Vt(this,[e],void 0,function*([e,t,i]){return null==t?e:e.filter(e=>{switch(t.type){case"immediately":return e.value===i;case"onSystemLock":return!(e.value!==Mt.BF.Immediately&&!(0,Mt.ft)(e.value)&&e.value!==Mt.Lw.Custom&&e.value!==Mt.Lw.OnLocked&&e.value!==Mt.Lw.OnIdle&&e.value!==Mt.Lw.OnSleep)||e.value===i;case"onAppRestart":return e.value===Mt.BF.Immediately||(0,Mt.ft)(e.value)||e.value===Mt.Lw.Custom||e.value===Mt.Lw.OnRestart;case"custom":case null:case void 0:return e.value===Mt.BF.Immediately||e.value===Mt.Lw.Custom||(0,Mt.ft)(e.value)&&e.value<=t.minutes;case"never":return!0;default:throw Error(`Unsupported policy type: ${t.type}`)}})})))}getAllTimeoutOptions(){return[{name:"immediately",value:Mt.BF.Immediately},{name:"oneMinute",value:Mt.BF.OnMinute},{name:"fiveMinutes",value:5},{name:"fifteenMinutes",value:15},{name:"thirtyMinutes",value:30},{name:"oneHour",value:60},{name:"fourHours",value:240},{name:"onIdle",value:Mt.Lw.OnIdle},{name:"onSleep",value:Mt.Lw.OnSleep},{name:"onLocked",value:Mt.Lw.OnLocked},{name:"sessionTimeoutOnRestart",value:Mt.Lw.OnRestart},{name:"never",value:Mt.Lw.Never},{name:"custom",value:Mt.Lw.Custom}]}}var Nt=i(69554),zt=i(93199),Yt=i(33886),Lt=i(68923),Kt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xt=(e,t)=>t.value;function qt(e,t){if(1&e&&(K.nrm(0,"bit-option",3),K.nI1(1,"i18n")),2&e){const e=t.$implicit;K.Y8G("value",e.value)("label",K.bMT(1,2,e.name))}}function Ht(e,t){if(1&e&&(K.j41(0,"div",4)(1,"bit-form-field",6),K.nrm(2,"input",7),K.j41(3,"bit-label"),K.EFF(4),K.nI1(5,"i18n"),K.k0s()(),K.j41(6,"bit-form-field",8),K.nrm(7,"input",9),K.j41(8,"bit-label"),K.EFF(9),K.nI1(10,"i18n"),K.k0s()()()),2&e){const e=K.XpG();K.R7$(4),K.JRh(K.bMT(5,3,"hours")),K.R7$(3),K.Y8G("min",e.customMinutesMin),K.R7$(2),K.JRh(K.bMT(10,5,"minutes"))}}function Wt(e,t){if(1&e&&(K.j41(0,"div",5),K.nrm(1,"i",10),K.EFF(2),K.nI1(3,"i18n"),K.k0s()),2&e){const e=K.XpG();K.R7$(2),K.SpI(" ",K.brH(3,1,"sessionTimeoutSettingsPolicyMaximumError",e.maxSessionTimeoutPolicyHours,e.maxSessionTimeoutPolicyMinutes)," ")}}function $t(e,t){if(1&e&&(K.j41(0,"bit-hint",11),K.EFF(1),K.k0s()),2&e){K.XpG();const e=K.r8f(0);K.R7$(),K.SpI(" ",e," ")}}function Jt(e,t){if(1&e&&(K.SS7(0),K.nI1(1,"async"),K.nVh(2,$t,2,1,"bit-hint",11)),2&e){const e=K.bH3(K.bMT(1,1,K.XpG().policyTimeoutMessage$));K.R7$(2),K.vxM(null!=e?2:-1)}}class Zt{constructor(){this.formBuilder=(0,D.WQX)(r.ok),this.policyService=(0,D.WQX)(Ce.m),this.i18nService=(0,D.WQX)(j.W),this.accountService=(0,D.WQX)(G.D),this.destroyRef=(0,D.WQX)(D.abz),this.sessionTimeoutTypeService=(0,D.WQX)(Nt.T),this.logService=(0,D.WQX)(Y.Kc),this.availableTimeoutOptions=M.hFB.required(),this.maxSessionTimeoutPolicyData=null,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[0,[r.k0.required,r.k0.min(0)]],minutes:[0,[r.k0.required,r.k0.min(0),r.k0.max(59)]]})},{validators:[this.formValidator.bind(this)]}),this.onChange=null,this.validatorChange=null}get isCustomTimeoutType(){return this.form.controls.vaultTimeout.value===Mt.Lw.Custom}get customMinutesMin(){return 0===this.form.controls.custom.controls.hours.value?1:0}get exceedsPolicyMaximumTimeout(){var e;return(null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.type)===Mt.Lw.Custom&&this.isCustomTimeoutType&&this.getTotalMinutesFromCustomValue(this.form.value.custom)>this.maxSessionTimeoutPolicyMinutes+60*this.maxSessionTimeoutPolicyHours}ngOnInit(){const e=this.accountService.activeAccount$.pipe(f.F6,(0,A.n)(e=>this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e)),Dt.Zc,(0,h.p)(e=>null!=e),(0,St.T)(e=>e.data));this.policyTimeoutMessage$=e.pipe((0,A.n)(e=>this.getPolicyTimeoutMessage(e))),e.pipe((0,Bt.pQ)(this.destroyRef)).subscribe(e=>{this.maxSessionTimeoutPolicyData=e,this.form.controls.custom.updateValueAndValidity(),this.validatorChange&&this.validatorChange()}),this.form.valueChanges.pipe((0,Bt.pQ)(this.destroyRef)).subscribe(e=>{if(this.onChange){const t=this.getVaultTimeout(e);if(null!=t){(!this.isCustomTimeoutType||this.form.controls.custom.valid)&&this.onChange(t)}}}),this.form.controls.vaultTimeout.valueChanges.pipe((0,h.p)(e=>null!=e&&e!==Mt.Lw.Custom),(0,Bt.pQ)(this.destroyRef)).subscribe(e=>{const t=(0,Mt.ft)(e)?e:Mt.BF.EightHours;this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}},{emitEvent:!1}),this.form.controls.custom.markAllAsTouched()})}get maxSessionTimeoutPolicyHours(){var e,t;return Math.floor((null!==(t=null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.minutes)&&void 0!==t?t:0)/60)}get maxSessionTimeoutPolicyMinutes(){var e,t;return(null!==(t=null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.minutes)&&void 0!==t?t:0)%60}writeValue(e){if(null==e)return;if(!this.availableTimeoutOptions().some(t=>t.value===e))return this.logService.debug(`[SessionTimeoutInputComponent] form control write value as custom ${e}`),void this.form.setValue({vaultTimeout:Mt.Lw.Custom,custom:{hours:Math.floor(e/60),minutes:e%60}});this.logService.debug(`[SessionTimeoutInputComponent] form control write value as preset ${e}`),this.form.patchValue({vaultTimeout:e})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){return this.form.errors}registerOnValidatorChange(e){this.validatorChange=e}getTotalMinutesFromCustomValue(e){var t,i;return 60*(null!==(t=null==e?void 0:e.hours)&&void 0!==t?t:0)+(null!==(i=null==e?void 0:e.minutes)&&void 0!==i?i:0)}formValidator(e){var t,i;const n=e.value;if(!(n.vaultTimeout===Mt.Lw.Custom))return null;const r=null===(t=n.custom)||void 0===t?void 0:t.hours,s=null===(i=n.custom)||void 0===i?void 0:i.minutes;if(null==r||null==s)return{required:!0};return 0===this.getTotalMinutesFromCustomValue(n.custom)?{minTimeoutError:!0}:this.exceedsPolicyMaximumTimeout?{maxTimeoutError:!0}:null}getVaultTimeout(e){var t;return e.vaultTimeout!==Mt.Lw.Custom?null!==(t=e.vaultTimeout)&&void 0!==t?t:null:this.getTotalMinutesFromCustomValue(e.custom)}getPolicyTimeoutMessage(e){return Kt(this,void 0,void 0,function*(){const t=yield this.getPolicyAppliedTimeout(e);switch(t){case null:return null;case Mt.BF.Immediately:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToImmediately");case Mt.Lw.OnLocked:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToOnLocked");case Mt.Lw.OnRestart:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToOnRestart");default:if((0,Mt.ft)(t)){const e=Math.floor(t/60),i=t%60;return this.i18nService.t("sessionTimeoutSettingsPolicySetMaximumTimeoutToHoursMinutes",e,i)}throw new Error("Invalid timeout parameter")}})}getPolicyAppliedTimeout(e){return Kt(this,void 0,void 0,function*(){switch(e.type){case"immediately":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(Mt.BF.Immediately);case"onSystemLock":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(Mt.Lw.OnLocked);case"onAppRestart":return Mt.Lw.OnRestart;case"never":{const e=yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(Mt.Lw.Never);return e==Mt.Lw.Never?null:e}default:return e.minutes}})}}Zt.MIN_CUSTOM_MINUTES=0,Zt.ɵfac=function(e){return new(e||Zt)},Zt.ɵcmp=K.VBU({type:Zt,selectors:[["bit-session-timeout-input"]],inputs:{availableTimeoutOptions:[1,"availableTimeoutOptions"]},features:[K.Jv_([{provide:r.kq,multi:!0,useExisting:Zt},{provide:r.cz,multi:!0,useExisting:Zt}])],decls:11,vars:7,consts:[[1,"tw-mb-4",3,"formGroup"],[3,"disableMargin"],["formControlName","vaultTimeout"],[3,"value","label"],["formGroupName","custom",1,"tw-grid","tw-grid-cols-12","tw-gap-4"],["id","session-timeout-maximum-error",1,"tw-mt-1","tw-text-danger","tw-text-xs"],["disableMargin","",1,"tw-col-span-6"],["bitInput","","type","number","min","0","formControlName","hours","aria-describedby","session-timeout-maximum-error"],["disableMargin","",1,"tw-col-span-6","tw-self-start"],["bitInput","","type","number","max","59","formControlName","minutes","aria-describedby","session-timeout-maximum-error",3,"min"],["aria-hidden","true",1,"bwi","bwi-error"],["id","session-timeout-maximum-error",1,"tw-mb-1"]],template:function(e,t){1&e&&(K.j41(0,"div",0)(1,"bit-form-field",1)(2,"bit-label"),K.EFF(3),K.nI1(4,"i18n"),K.k0s(),K.j41(5,"bit-select",2),K.Z7z(6,qt,2,4,"bit-option",3,Xt),K.k0s()(),K.nVh(8,Ht,11,7,"div",4),K.nVh(9,Wt,4,5,"div",5)(10,Jt,3,4),K.k0s()),2&e&&(K.Y8G("formGroup",t.form),K.R7$(),K.Y8G("disableMargin",!t.isCustomTimeoutType),K.R7$(2),K.JRh(K.bMT(4,5,"vaultTimeout1")),K.R7$(3),K.Dyx(t.availableTimeoutOptions()),K.R7$(2),K.vxM(t.isCustomTimeoutType?8:-1),K.R7$(),K.vxM(t.form.hasError("maxTimeoutError")?9:null!=t.maxSessionTimeoutPolicyData?10:-1))},dependencies:[n.MD,p.p,r.X1,r.me,r.Q0,r.BC,r.cb,r.VZ,r.zX,r.j4,r.JD,r.$R,E.L,re.j,zt.I,se.J,oe.h,Gt.p,Yt.w,Lt.P,n.Jj,$.$],encapsulation:2,changeDetection:0});var _t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ei(e,t){if(1&e&&K.nrm(0,"bit-session-timeout-input",1),2&e){const e=K.XpG();K.Y8G("availableTimeoutOptions",t)("formControl",e.formGroup.controls.timeout)}}function ti(e,t){if(1&e&&(K.nrm(0,"bit-option",4),K.nI1(1,"i18n")),2&e){const e=t.$implicit;K.Y8G("value",e)("label",K.bMT(1,2,e))}}function ii(e,t){1&e&&(K.j41(0,"bit-hint"),K.EFF(1),K.nI1(2,"i18n"),K.k0s()),2&e&&(K.R7$(),K.JRh(K.bMT(2,1,"sessionTimeoutSettingsSetUnlockMethodToChangeTimeoutAction")))}function ni(e,t){1&e&&(K.j41(0,"bit-hint"),K.EFF(1),K.nI1(2,"i18n"),K.k0s()),2&e&&(K.R7$(),K.JRh(K.bMT(2,1,"sessionTimeoutSettingsManagedByOrganization")))}class ri{constructor(){this.refreshTimeoutActionSettings=(0,M.hFB)(new o.t(void 0)),this.vaultTimeoutSettingsService=(0,D.WQX)(Mt.ep),this.sessionTimeoutSettingsComponentService=(0,D.WQX)(jt),this.i18nService=(0,D.WQX)(j.W),this.toastService=(0,D.WQX)(z.f),this.policyService=(0,D.WQX)(Ce.m),this.accountService=(0,D.WQX)(G.D),this.dialogService=(0,D.WQX)(q.o3),this.logService=(0,D.WQX)(Y.Kc),this.destroyRef=(0,D.WQX)(D.abz),this.platformUtilsService=(0,D.WQX)(N.y),this.formGroup=new r.gE({timeout:new r.MJ(null,[r.k0.required]),timeoutAction:new r.MJ(Mt.W4.Lock,[r.k0.required])}),this.availableTimeoutActions=(0,D.vPA)([]),this.availableTimeoutOptions$=this.accountService.activeAccount$.pipe(f.F6,(0,A.n)(e=>this.sessionTimeoutSettingsComponentService.policyFilteredTimeoutOptions$(e)),(0,u.M)(e=>{this.logService.debug("[SessionTimeoutSettings] Available timeout options",e)})),this.sessionTimeoutActionFromPolicy$=this.accountService.activeAccount$.pipe(f.F6,(0,A.n)(e=>this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e)),Dt.Zc,(0,St.T)(e=>null==e?void 0:e.data),(0,St.T)(e=>{var t;return null!==(t=null==e?void 0:e.action)&&void 0!==t?t:null})),this.sessionTimeoutActionFromPolicy=(0,Bt.ot)(this.sessionTimeoutActionFromPolicy$)}get canLock(){return this.availableTimeoutActions().includes(Mt.W4.Lock)}get supportsLock(){return this.platformUtilsService.getClientType()!==O.s.Web&&"logOut"!==this.sessionTimeoutActionFromPolicy()}ngOnInit(){return _t(this,void 0,void 0,function*(){this.userId=yield(0,c._)((0,f.F6)(this.accountService.activeAccount$));const e=yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(this.userId));this.formGroup.patchValue({timeout:e,timeoutAction:yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId))},{emitEvent:!1}),this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(this.userId).pipe((0,h.p)(e=>this.formGroup.controls.timeout.value!==e),(0,u.M)(e=>this.logService.debug(`[SessionTimeoutSettings] Updating initial form timeout from ${this.formGroup.controls.timeout.value} to ${e}`)),(0,Bt.pQ)(this.destroyRef)).subscribe(e=>{this.formGroup.controls.timeout.setValue(e,{emitEvent:!1})}),this.refreshTimeoutActionSettings().pipe((0,Qt.Z)(void 0),(0,A.n)(()=>(0,kt.z)([this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(this.userId),this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId),this.sessionTimeoutActionFromPolicy$])),(0,Bt.pQ)(this.destroyRef)).subscribe(([e,t,i])=>{this.availableTimeoutActions.set(e),this.formGroup.controls.timeoutAction.setValue(t,{emitEvent:!1}),null!=i||e.length<=1?this.formGroup.controls.timeoutAction.disable({emitEvent:!1}):this.formGroup.controls.timeoutAction.enable({emitEvent:!1})}),this.formGroup.controls.timeout.valueChanges.pipe((0,Qt.Z)(e),(0,h.p)(e=>null!=e),(0,Tt.F)(),(0,Ft.J)(),(0,Pt.H)(e=>_t(this,[e],void 0,function*([e,t]){yield this.saveTimeout(e,t)})),(0,Bt.pQ)(this.destroyRef)).subscribe(),this.formGroup.controls.timeoutAction.valueChanges.pipe((0,h.p)(e=>null!=e),(0,St.T)(e=>_t(this,void 0,void 0,function*(){yield this.saveTimeoutAction(e)})),(0,Bt.pQ)(this.destroyRef)).subscribe()})}saveTimeout(e,t){return _t(this,void 0,void 0,function*(){if(this.formGroup.controls.timeout.markAllAsTouched(),this.formGroup.controls.timeout.invalid)return;if(this.logService.debug("[SessionTimeoutSettings] Saving timeout",{previousValue:e,newValue:t}),t===Mt.Lw.Never){if(!(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"neverLockWarning"},type:"warning"})))return void this.formGroup.controls.timeout.setValue(e,{emitEvent:!1})}const i=yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId));yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.userId,t,i),this.sessionTimeoutSettingsComponentService.onTimeoutSave(t)})}saveTimeoutAction(e){return _t(this,void 0,void 0,function*(){if(this.logService.debug("[SessionTimeoutSettings] Saving timeout action",e),e===Mt.W4.LogOut){if(!(yield this.dialogService.openSimpleDialog({title:{key:"vaultTimeoutLogOutConfirmationTitle"},content:{key:"vaultTimeoutLogOutConfirmation"},type:"warning"})))return void this.formGroup.controls.timeoutAction.setValue(Mt.W4.Lock,{emitEvent:!1})}this.formGroup.controls.timeout.hasError("policyError")?this.toastService.showToast({variant:"error",message:this.i18nService.t("vaultTimeoutTooLarge")}):yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.userId,this.formGroup.controls.timeout.value,e)})}}ri.ɵfac=function(e){return new(e||ri)},ri.ɵcmp=K.VBU({type:ri,selectors:[["bit-session-timeout-settings"]],inputs:{refreshTimeoutActionSettings:[1,"refreshTimeoutActionSettings"]},decls:13,vars:13,consts:[[3,"formGroup"],[3,"availableTimeoutOptions","formControl"],[3,"disableMargin"],["id","timeoutAction",3,"formControl","required"],[3,"value","label"]],template:function(e,t){if(1&e&&(K.j41(0,"div",0),K.nVh(1,ei,1,2,"bit-session-timeout-input",1),K.nI1(2,"async"),K.j41(3,"bit-form-field",2)(4,"bit-label"),K.EFF(5),K.nI1(6,"i18n"),K.k0s(),K.j41(7,"bit-select",3),K.Z7z(8,ti,2,4,"bit-option",4,K.fX1),K.k0s(),K.nVh(10,ii,3,3,"bit-hint"),K.nI1(11,"async"),K.vZN(12,ni,3,3,"bit-hint"),K.k0s()()),2&e){let e;K.Y8G("formGroup",t.formGroup),K.R7$(),K.vxM((e=K.bMT(2,7,t.availableTimeoutOptions$))?1:-1,e),K.R7$(2),K.Y8G("disableMargin",!0),K.R7$(2),K.JRh(K.bMT(6,9,"sessionTimeoutSettingsAction")),K.R7$(2),K.Y8G("formControl",t.formGroup.controls.timeoutAction)("required",!1),K.R7$(),K.Dyx(t.availableTimeoutActions()),K.R7$(2),K.vxM(!t.canLock&&t.supportsLock?10:null!=K.bMT(11,11,t.sessionTimeoutActionFromPolicy$)?12:-1)}},dependencies:[xt.q,n.MD,E.L,re.j,zt.I,oe.h,r.YN,r.BC,r.cb,r.YS,r.X1,r.l_,r.j4,Q.Q,Ot.k,p.p,Je.V,Et.iI,Gt.p,Yt.w,Lt.P,Ze.E,Zt,n.Jj,$.$],encapsulation:2})},77243(e,t,i){"use strict";i.d(t,{l:()=>h});var n=i(8916),r=i(62963),s=i(33812),o=i(77468),a=i(54471),l=i(58384),c=i(25740),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function u(e,t){if(1&e&&(s.j41(0,"p"),s.EFF(1),s.j41(2,"a",1),s.nI1(3,"i18n"),s.nrm(4,"bit-icon",2),s.k0s(),s.nrm(5,"br"),s.j41(6,"code",3),s.EFF(7),s.k0s()()),2&e){const e=s.XpG();s.R7$(),s.SpI(" ",e.fingerprintLabel,": "),s.R7$(),s.Y8G("appA11yTitle",s.mNQ(s.bMT(3,4,"learnMoreAboutYourAccountFingerprintPhrase"))),s.R7$(5),s.JRh(e.fingerprint)}}class h{constructor(e){this.keyService=e}ngOnInit(){return d(this,void 0,void 0,function*(){var e;const t=yield this.keyService.getFingerprint(this.fingerprintMaterial,this.publicKeyBuffer);this.fingerprint=null!==(e=null==t?void 0:t.join("-"))&&void 0!==e?e:null})}}h.ɵfac=function(e){return new(e||h)(s.rXU(n.Lu))},h.ɵcmp=s.VBU({type:h,selectors:[["app-account-fingerprint"]],inputs:{fingerprintMaterial:"fingerprintMaterial",publicKeyBuffer:"publicKeyBuffer",fingerprintLabel:"fingerprintLabel"},decls:3,vars:1,consts:[[4,"ngIf"],["href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer",3,"appA11yTitle"],["name","bwi-question-circle"],[1,"tw-text-code"]],template:function(e,t){1&e&&(s.qex(0),s.nrm(1,"hr"),s.DNE(2,u,8,6,"p",0),s.bVm()),2&e&&(s.R7$(2),s.Y8G("ngIf",t.fingerprint))},dependencies:[r.G,o.bT,a.C,l.R,c.$],encapsulation:2})},77312(e,t,i){"use strict";i.d(t,{d:()=>n});class n{}},77665(e,t,i){"use strict";i.d(t,{L:()=>r});var n=i(55459);class r extends n.J{}},77720(e,t,i){"use strict";i.d(t,{D:()=>l});var n=i(17989),r=i(31442),s=i(24072),o=i(91304),a=i(11766);class l extends n.A{constructor(e){var t;super(),this.type=r.PU.Text,null!=e&&(this.type=e.type,this.linkedId=null!==(t=e.linkedId)&&void 0!==t?t:void 0,this.name=(0,s.e)(e.name),this.value=(0,s.e)(e.value))}decrypt(e){return this.decryptObj(this,new a.g(this),["name","value"],e)}toFieldData(){const e=new o.N;return this.buildDataModel(this,e,{name:null,value:null,type:null,linkedId:null},["type","linkedId"]),e}static fromJSON(e){var t,i;if(null==e)return;const n=new l;return n.type=null!==(t=e.type)&&void 0!==t?t:r.PU.Text,n.linkedId=null!==(i=e.linkedId)&&void 0!==i?i:void 0,n.name=(0,s.u)(e.name),n.value=(0,s.u)(e.value),n}toSdkField(){var e,t;return{name:null===(e=this.name)||void 0===e?void 0:e.toSdk(),value:null===(t=this.value)||void 0===t?void 0:t.toSdk(),type:(0,r.D1)(this.type),linkedId:(0,r.NI)(this.linkedId)}}static fromSdkField(e){if(null==e)return;const t=new l;return t.name=(0,s.u)(e.name),t.value=(0,s.u)(e.value),t.type=e.type,t.linkedId=e.linkedId,t}}},77723(e,t,i){"use strict";i.d(t,{n:()=>b});var n=i(66046),r=i(16878),s=i(88565),o=i(72245),a=i(44500),l=i(14803),c=i(67553),d=i(3633),u=i(39488),h=i(36501),A=i(55542),p=i(90118),g=i(24593),v=i(62819),f=i(33812),m=i(5556),y=i(66316),C=i(35500),w=i(50700),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e,t,i,s,o,c,u,h,p){this.cipherService=e,this.dialogService=t,this.passwordRepromptService=i,this.organizationService=s,this.accountService=o,this.i18nService=c,this.syncService=u,this.cipherFormConfigService=h,this.adminConsoleCipherFormConfigService=p,this.isAdminConsoleActive=!1,this.loading=!1,this.hasLoaded=!1,this.ciphers=[],this.allCiphers=[],this.dataSource=new A.s,this.organization=void 0,this.organizations=[],this.maxItemsToSwitchToChipSelect=5,this.filterStatus=[0],this.showFilterToggle=!1,this.selectedFilterChip="0",this.chipSelectOptions=[],this.vaultMsg="vault",this.currentFilterStatus=0,this.filterOrgStatus$=new r.t(0),this.destroyed$=new n.B,this.organizations$=this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(e=>this.organizationService.organizations$(e))),this.organizations$.pipe((0,l.Q)(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=>!e.organizationId).length:(this.organizations.filter(i=>{if(i.id===e)return t=i.id,i}),i=this.allCiphers.filter(e=>e.organizationId===t).length),i}filterOrgToggle(e){return I(this,void 0,void 0,function*(){let t=e=>!0;if("number"==typeof e&&1===e)t=e=>!e.organizationId;else if("string"==typeof e){const i=e;t=e=>e.organizationId===i}this.dataSource.filter=t})}load(){return I(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 I(this,void 0,void 0,function*(){if(yield this.repromptCipher(e))if(this.organization){const t=yield this.adminConsoleCipherFormConfigService.buildConfig("edit",e.id,e.type);yield this.openVaultItemDialog("view",t,e)}else{const t=yield this.cipherFormConfigService.buildConfig("edit",e.id,e.type);yield this.openVaultItemDialog("view",t,e)}})}openVaultItemDialog(e,t,i,n){return I(this,void 0,void 0,function*(){this.vaultItemDialogRef=g.V.open(this.dialogService,{mode:e,formConfig:t,activeCollectionId:n,isAdminConsoleAction:null!=this.organization});const r=yield(0,s.s)(this.vaultItemDialogRef.closed);this.vaultItemDialogRef=void 0,r!==g.r.PremiumUpgrade&&(r!==g.r.Deleted&&r!==g.r.Saved||(yield this.refresh(r,i)))})}setCiphers(){return I(this,void 0,void 0,function*(){this.allCiphers=[]})}refresh(e,t){return I(this,void 0,void 0,function*(){var i;if(e===g.r.Deleted)return yield this.determinedUpdatedCipherReportStatus(e,t),this.ciphers=this.ciphers.filter(e=>e.id!==t.id),void this.filterCiphersByOrg(this.ciphers);if(e==g.r.Saved){const n=yield(0,o._)(this.accountService.activeAccount$.pipe(d.F6));let r=yield this.cipherService.get(t.id,n);this.isAdminConsoleActive&&(r=null!==(i=yield this.adminConsoleCipherFormConfigService.getCipher(t.id,this.organization))&&void 0!==i?i:r);const s=yield r.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(r,n)),a=yield this.determinedUpdatedCipherReportStatus(e,s),l=this.ciphers.findIndex(e=>e.id===s.id);null===a&&l>-1&&this.ciphers.splice(l,1),null!==a&&l>-1&&(this.ciphers[l]=a),this.filterCiphersByOrg(this.ciphers)}})}determinedUpdatedCipherReportStatus(e,t){return I(this,void 0,void 0,function*(){return t})}repromptCipher(e){return I(this,void 0,void 0,function*(){return e.reprompt===h.b.None||(yield this.passwordRepromptService.showPasswordPrompt())})}getAllCiphers(){return I(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$.pipe(d.F6));return yield this.cipherService.getAllDecrypted(e)})}canDisplayToggleGroup(){return this.filterStatus.length<=this.maxItemsToSwitchToChipSelect}filterOrgToggleChipSelect(e){return I(this,void 0,void 0,function*(){const t=null!=e?e:0;yield this.filterOrgToggle(t)})}filterCiphersByOrg(e){this.allCiphers=[...e],this.ciphers=e.map(e=>(-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.dataSource.data=this.ciphers,this.filterStatus.length>2?(this.showFilterToggle=!0,this.vaultMsg="vaults"):(this.showFilterToggle=!1,this.vaultMsg="vault"),this.chipSelectOptions=this.setupChipSelectOptions(this.filterStatus)}setupChipSelectOptions(e){return e.map((e,t)=>{const i=this.getName(e),n=this.getCount(e);return{label:i+(null!=n?` (${n})`:""),value:e}})}}b.ɵfac=function(e){return new(e||b)(f.rXU(m.p),f.rXU(y.o3),f.rXU(p.qX),f.rXU(c.PV),f.rXU(C.D),f.rXU(w.W),f.rXU(u.H),f.rXU(p.hI),f.rXU(v.l))},b.ɵdir=f.FsC({type:b})},77788(e,t,i){"use strict";i.d(t,{t:()=>s});var n=i(69580),r=i(20702);class s extends r.r{constructor(e){var t,i,r;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 s=this.getResponseProperty("Plan");this.plan=null==s?null:new n.tQ(s),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.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion"),this.limitItemDeletion=this.getResponseProperty("LimitItemDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.useDisableSMAdsForUsers=null!==(t=this.getResponseProperty("UseDisableSMAdsForUsers"))&&void 0!==t&&t,this.useAccessIntelligence=this.getResponseProperty("UseRiskInsights"),this.usePhishingBlocker=null!==(i=this.getResponseProperty("UsePhishingBlocker"))&&void 0!==i&&i,this.useMyItems=null!==(r=this.getResponseProperty("UseMyItems"))&&void 0!==r&&r}}},77867(e,t,i){"use strict";i.d(t,{P8:()=>a,fq:()=>n,Cc:()=>r});const n={generatePasswordClearClipboardTimeout:"generatePasswordClearClipboardTimeout",systemClearClipboardTimeout:"systemClearClipboardTimeout",loginStrategySessionTimeout:"loginStrategySessionTimeout",notificationsReconnectTimeout:"notificationsReconnectTimeout",fido2ClientAbortTimeout:"fido2ClientAbortTimeout",scheduleNextSyncInterval:"scheduleNextSyncInterval",eventUploadsInterval:"eventUploadsInterval",vaultTimeoutCheckInterval:"vaultTimeoutCheckInterval",clearPopupViewCache:"clearPopupViewCache",phishingDomainUpdate:"phishingDomainUpdate"};class r{}var s=i(1472),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends r{constructor(e){super(),this.logService=e,this.taskHandlers=new Map}setTimeout(e,t){this.validateRegisteredTask(e);const i=globalThis.setTimeout(()=>this.triggerTask(e),t);return new s.yU(()=>globalThis.clearTimeout(i))}setInterval(e,t,i){this.validateRegisteredTask(e);const n=globalThis.setInterval(()=>this.triggerTask(e),t);return new s.yU(()=>globalThis.clearInterval(n))}registerTaskHandler(e,t){this.taskHandlers.get(e)&&(this.logService.warning(`Task handler for ${e} already exists. Overwriting.`),this.unregisterTaskHandler(e)),this.taskHandlers.set(e,t)}unregisterTaskHandler(e){this.taskHandlers.delete(e)}triggerTask(e,t){return o(this,void 0,void 0,function*(){const t=this.taskHandlers.get(e);t&&t()})}validateRegisteredTask(e){if(!this.taskHandlers.has(e))throw new Error(`Task handler for ${e} not registered. Unable to schedule task.`)}}},78070(e,t,i){"use strict";i.d(t,{G:()=>r,z:()=>s});var n=i(31857);const r=new n.Ok(n.dr,"vaultTimeoutAction",{deserializer:e=>e,clearOn:[]}),s=new n.Ok(n.dr,"vaultTimeout",{deserializer:e=>e,clearOn:[]})},78078(e,t,i){"use strict";i.d(t,{u:()=>n});class n{constructor(e){this.id="",this.name="",e?(this.id=e.id,this.revisionDate=e.revisionDate):this.revisionDate=new Date}static fromJSON(e){var t,i;const r=new n;return r.id=null!==(t=e.id)&&void 0!==t?t:"",r.name=null!==(i=e.name)&&void 0!==i?i:"",null!=e.revisionDate&&(r.revisionDate=new Date(e.revisionDate)),r}}},78107(e,t,i){"use strict";i.d(t,{H:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;super(e),this.deviceVerified=null!==(t=this.getResponseProperty("DeviceVerified"))&&void 0!==t&&t}}},78510(e,t,i){"use strict";i.d(t,{a:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 4.5 91.63 88">
    <path class="tw-fill-illustration-bg-secondary" d="M62 12.5a2 2 0 0 1 2 2v76a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-76a2 2 0 0 1 2-2h56Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M62 90.5v-76H6v76h56Zm2-76a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v76a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2v-76Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M72 82.5v-76a2 2 0 0 0-2-2H27.328c-.53 0-1.034.206-1.41.581L12.585 18.416A1.993 1.993 0 0 0 12 19.828V82.5a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 82.5v-76H27.328L14 19.828V82.5h56ZM27.333 6.495ZM72 6.5v76a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2V19.828c0-.53.209-1.037.584-1.412L25.919 5.081c.375-.375.879-.581 1.41-.581H70a2 2 0 0 1 2 2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M84 48.5c0 11.046-8.954 20-20 20s-20-8.954-20-20 8.954-20 20-20 20 8.954 20 20Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M64 66.5c9.941 0 18-8.059 18-18s-8.059-18-18-18-18 8.059-18 18 8.059 18 18 18Zm0 2c11.046 0 20-8.954 20-20s-8.954-20-20-20-20 8.954-20 20 8.954 20 20 20Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M79 48.5c0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 8.284 0 15 6.716 15 15Z"/>
    <path class="tw-fill-illustration-outline" d="M95.004 77.587 78.5 62l-2 2 15.587 16.504a2 2 0 0 0 2.868.04l.09-.089a2 2 0 0 0-.041-2.868Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 5.5a1 1 0 0 1 1 1v15H14a1 1 0 1 1 0-2h13v-13a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M20 28.5a1 1 0 1 0 0 2h10a1 1 0 1 0 0-2H20Zm14 0a1 1 0 1 0 0 2h10a1 1 0 1 0 0-2H34Zm16.983 4.815A1 1 0 0 0 50 32.5H40a1 1 0 1 0 0 2h9.717c.405-.413.827-.808 1.266-1.185ZM44.025 49.5c.033.676.1 1.343.199 2H40a1 1 0 1 1 0-2h4.025Zm.199-4a20.086 20.086 0 0 0-.2 2H37a1 1 0 1 1 0-2h7.224Zm3.775-9c-.48.638-.922 1.306-1.323 2H38a1 1 0 1 1 0-2h9.998ZM64 28.5c-3.13 0-6.09.719-8.728 2H54a1 1 0 1 1 0-2h10Zm-16 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2Zm-11 5a1 1 0 0 0-1-1h-2a1 1 0 1 0 0 2h2a1 1 0 0 0 1-1Zm-3 5a1 1 0 1 0 0-2h-4a1 1 0 1 0 0 2h4Zm0 8a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h6a1 1 0 0 1 1 1Zm2 5a1 1 0 1 0 0-2H20a1 1 0 1 0 0 2h16Zm-5-18a1 1 0 0 0-1-1H20a1 1 0 1 0 0 2h10a1 1 0 0 0 1-1Zm-5 5a1 1 0 1 0 0-2h-6a1 1 0 1 0 0 2h6Zm-2 8a1 1 0 0 1-1 1h-3a1 1 0 1 1 0-2h3a1 1 0 0 1 1 1Z" clip-rule="evenodd"/>
  </svg>
`},78781(e,t,i){"use strict";i.d(t,{A:()=>h});var n=i(58803),r=i(97763),s=i(93695),o=i(44500),a=i(76144),l=(i(14049),i(45202));const c="undefined"==typeof self?i(10967):null,d=["..","%2e","\\","%5c","\t","%09","\n","%0a","\r","%0d","\0","%00"],u=["/","%2f","#","%23"];class h{static init(){h.inited||(h.inited=!0,h.isNode=void 0!==l&&null!=l.release&&"node"===l.release.name,h.isBrowser="undefined"!=typeof window,h.isMobileBrowser=h.isBrowser&&this.isMobile(window),h.isAppleMobileBrowser=h.isBrowser&&this.isAppleMobile(window),h.isNode?h.global=i.g:h.isBrowser?h.global=window:h.global=self)}static fromB64ToArray(e){if(null==e)return null;if(h.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=h.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 h.fromB64ToArray(h.fromUrlB64ToB64(e))}static fromHexToArray(e){if(h.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(h.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 fromArrayToHex(e){return null==e?null:e.toHex()}static fromArrayToB64(e){return null==e?null:e.toBase64({alphabet:"base64"})}static fromArrayToUrlB64(e){return null==e?null:e.toBase64({alphabet:"base64url",omitPadding:!0})}static fromArrayToByteString(e){if(null==e)return null;let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t}static fromArrayToUtf8(e){return null==e?null:r.hp.from(e).toString("utf8")}static fromBufferToB64(e){if(null==e)return null;const t=h.normalizeToUint8Array(e);if(0===t.length)return"";if(h.isNode)return Buffer.from(t).toString("base64");{let e="";for(let i=0;i<t.byteLength;i++)e+=String.fromCharCode(t[i]);return h.global.btoa(e)}}static normalizeToUint8Array(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);{const t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}}static fromBufferToUrlB64(e){return h.fromB64toUrlB64(h.fromBufferToB64(e))}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToUtf8(e){return r.hp.from(e).toString("utf8")}static fromBufferToByteString(e){return String.fromCharCode.apply(null,new Uint8Array(e))}static fromBufferToHex(e){if(h.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),r=parseInt(t,16);i[n]=r}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 h.fromB64ToUtf8(h.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return h.isNode?Buffer.from(e,"utf8").toString("base64"):r.hp.from(e,"utf8").toString("base64")}static fromUtf8ToUrlB64(e){return h.fromArrayToUrlB64(h.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return h.isNode?Buffer.from(e,"base64").toString("utf8"):r.hp.from(e,"base64").toString("utf8")}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(h.guidRegex,"i").test(e)}static getHostname(e){if(h.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;if(e.startsWith("file:"))return null;try{const t=(0,a.EW)(e,{validHosts:this.validHosts});if(null!=t)return t}catch(t){return null}return null}static getHost(e){const t=h.getUrl(e);try{return null!=t&&""!==t.host?t.host:null}catch(i){return null}}static getDomain(e){if(h.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;try{const t=(0,a.qg)(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=h.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(),h.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 containsTraversalIndicators(e){let t;try{t=decodeURIComponent(e.toLowerCase())}catch(i){return!0}return!!d.some(e=>t.includes(e))||!!t.includes("?")&&this.containsDangerousQueryPatterns(t)}static containsDangerousQueryPatterns(e){const t=e.split("?")[1];return!!t&&u.some(e=>t.includes(e))}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,s.of)(void 0).pipe((0,o.n)(()=>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}}h.inited=!1,h.isNode=!1,h.isBrowser=!0,h.isMobileBrowser=!1,h.isAppleMobileBrowser=!1,h.global=null,h.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,h.validHosts=["localhost"],h.originalMinimumPasswordLength=8,h.minimumPasswordLength=12,h.maximumPasswordLength=128,h.DomainMatchBlacklist=new Map([["google.com",new Set(["script.google.com"])]]),h.guidRegex=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/,h.init()},78867(e,t,i){"use strict";i.d(t,{Y:()=>E});var n=i(23649),r=i(72737),s=i(33338),o=i(93695),a=i(69194),l=i(3204),c=i(12610),d=i(44500),u=i(67553),h=i(43978),A=i(3633),p=i(82468),g=i(49272),v=i(74208),f=i(13417),m=i(35500),y=i(37115),C=i(18499),w=i(50700),I=i(58329),b=i(1601),B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E{constructor(e,t,i,g,v,f,m,y,C,w,I){this.organizationService=e,this.providerService=t,this.route=i,this.router=g,this.syncService=v,this.accountService=f,this.platformUtilsService=m,this.policyService=y,this.i18nService=C,this.billingAccountProfileStateService=w,this.configService=I,this.syncCompleted$=new r.m(1),this.triggerProductUpdate$=(0,s.z)([this.syncCompleted$,this.router.events.pipe((0,c.Z)(null),(0,a.p)(e=>e instanceof n.wF||e instanceof n.Z||null===e))]).pipe((0,l.T)(()=>null)),this.organizations$=this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id),(0,d.n)(e=>this.organizationService.organizations$(e))),this.providers$=this.accountService.activeAccount$.pipe(A.F6,(0,d.n)(e=>this.providerService.providers$(e))),this.userHasSingleOrgPolicy$=this.accountService.activeAccount$.pipe(A.F6,(0,d.n)(e=>this.policyService.policyAppliesToUser$(h.tt.SingleOrg,e))),this.shouldShowPremiumUpgradeButton$=(0,s.z)([this.configService.getFeatureFlag$(p.TO.PM24032_NewNavigationPremiumUpgradeButton),this.accountService.activeAccount$]).pipe((0,d.n)(([e,t])=>e&&t?this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id).pipe((0,l.T)(e=>!e)):(0,o.of)(!1))),this.products$=(0,s.z)([this.organizations$,this.providers$,this.userHasSingleOrgPolicy$,this.route.paramMap,this.triggerProductUpdate$]).pipe((0,l.T)(([e,t,i,n])=>{var r,s,o;e.sort((e,t)=>e.name.localeCompare(t.name));let a=e.find(e=>e.id===n.get("organizationId")),l=null;["/sm/","/organizations/"].some(e=>this.router.url.includes(e))&&(l=null!==(r=this.router.url.split("/")[2])&&void 0!==r?r:null),l&&!a&&(a=e.find(e=>e.id===l));const c=(null==a?void 0:a.canAccessSecretsManager)&&1==(null==a?void 0:a.enabled)?a:e.find(e=>e.canAccessSecretsManager&&1==e.enabled),d=null!=a&&(0,u.OV)(a)?a:e.find(e=>(0,u.OV)(e)),A=(null===(s=t[0])||void 0===s?void 0:s.providerType)===h.cp.BusinessUnit?"Business Unit Portal":"Provider Portal",p=this.platformUtilsService.isSelfHost()?{route:"https://bitwarden.com/products/business/",external:!0}:{route:"/create-organization",external:!1},g={pm:{name:"Password Manager",icon:"bwi-lock",appRoute:"/vault",marketingRoute:{route:"https://bitwarden.com/products/personal/",external:!0},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==c?void 0:c.id],marketingRoute:{route:"/sm-landing",external:!1},isActive:this.router.url.includes("/sm/"),otherProductOverrides:{supportingText:this.i18nService.t("secureYourInfrastructure")}},ac:{name:"Admin Console",icon:"bwi-business",appRoute:["/organizations",null==d?void 0:d.id],marketingRoute:{route:"https://bitwarden.com/products/business/",external:!0},isActive:this.router.url.includes("/organizations/")},provider:{name:A,icon:"bwi-provider",appRoute:["/providers",null===(o=t[0])||void 0===o?void 0:o.id],isActive:this.router.url.includes("/providers/")},orgs:{name:"Organizations",icon:"bwi-business",marketingRoute:p,otherProductOverrides:{name:"Share your passwords",supportingText:this.i18nService.t("protectYourFamilyOrBusiness")}}},v=[g.pm],f=[];return c&&v.push(g.sm),d&&v.push(g.ac),t.length>0&&v.push(g.provider),{bento:v,other:f}})),this.pollUntilSynced()}pollUntilSynced(){const e=setInterval(()=>B(this,void 0,void 0,function*(){null!==(yield this.syncService.getLastSync())&&(clearInterval(e),this.syncCompleted$.next())}),200)}}E.ɵfac=function(e){return new(e||E)(v.KVO(u.PV),v.KVO(f.$),v.KVO(n.nX),v.KVO(n.Ix),v.KVO(g.H),v.KVO(m.D),v.KVO(y.y),v.KVO(C.m),v.KVO(w.W),v.KVO(I.Q),v.KVO(b.w))},E.ɵprov=v.jDH({token:E,factory:E.ɵfac,providedIn:"root"})},78952(e,t,i){"use strict";i.d(t,{S:()=>l});var n=i(93161),r=i(77468),s=i(33812);const o=[[["","slot","start"]],"*",[["","slot","end"]]],a=e=>({"tw-hidden":e});class l{get disabledAttr(){return this.disabled||null}constructor(e){this.elementRef=e,this.classList=["tw-block","tw-w-full","tw-py-1.5","tw-px-3","!tw-text-main","!tw-no-underline","tw-cursor-pointer","tw-border-none","tw-bg-background","tw-text-left","hover:tw-bg-hover-default","focus-visible:tw-z-50","focus-visible:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-rounded-lg","focus-visible:tw-ring-inset","focus-visible:tw-ring-border-focus","active:!tw-ring-0","active:!tw-ring-offset-0","disabled:!tw-text-muted","disabled:hover:tw-bg-background","disabled:tw-cursor-not-allowed"],this.role="menuitem",this.tabIndex="-1",this.disabled=!1}focus(){this.elementRef.nativeElement.focus()}}l.ɵfac=function(e){return new(e||l)(s.rXU(s.aKT))},l.ɵcmp=s.VBU({type:l,selectors:[["","bitMenuItem",""]],hostVars:5,hostBindings:function(e,t){2&e&&(s.Avn("tabIndex",t.tabIndex),s.BMQ("role",t.role)("disabled",t.disabledAttr),s.HbH(t.classList))},inputs:{disabled:[2,"disabled","disabled",n.he]},attrs:["bitMenuItem",""],ngContentSelectors:["[slot=start]","*","[slot=end]"],decls:10,vars:6,consts:[["startSlot",""],["endSlot",""],[1,"tw-flex","tw-w-full","tw-justify-between","tw-items-center","tw-gap-2"],[1,"tw-flex","tw-gap-2","tw-items-center","tw-overflow-hidden"],[3,"ngClass"],[1,"tw-truncate"]],template:function(e,t){if(1&e&&(s.NAR(o),s.j41(0,"div",2)(1,"span",3)(2,"span",4,0),s.SdG(4),s.k0s(),s.j41(5,"span",5),s.SdG(6,1),s.k0s()(),s.j41(7,"span",4,1),s.SdG(9,2),s.k0s()()),2&e){const e=s.sdS(3),t=s.sdS(8);s.R7$(2),s.Y8G("ngClass",s.eq3(2,a,0===e.childElementCount)),s.R7$(5),s.Y8G("ngClass",s.eq3(4,a,0===t.childElementCount))}},dependencies:[r.YU],encapsulation:2})},78991(e,t,i){"use strict";function n(e){const t=Reflect.ownKeys(e);for(const i of t){const t=e[i];t&&"object"==typeof t&&n(t)}return Object.freeze(e)}function r(e){return"string"==typeof e}i.d(t,{_g:()=>r,ol:()=>n})},79303(e,t,i){"use strict";i.d(t,{B:()=>a});var n=i(62963),r=i(10840),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({imports:[n.G,r.Y]})},79667(e,t,i){"use strict";i.d(t,{v:()=>n});class n{}},79703(e,t,i){"use strict";i.d(t,{m:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},79783(e,t,i){"use strict";i.d(t,{k:()=>o});var n=i(85800),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.r]})},80351(e,t,i){"use strict";i.d(t,{j:()=>o});var n=i(44432),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},80378(e,t,i){"use strict";var n;i.d(t,{C:()=>n}),function(e){e.Enabled="Enabled",e.RequiresPremium="RequiresPremium",e.RequiresUpgrade="RequiresUpgrade",e.RequiresEnterprise="RequiresEnterprise"}(n||(n={}))},80504(e,t,i){"use strict";i.d(t,{nI:()=>ie,C0:()=>se.C,AX:()=>Be,DF:()=>ae,uE:()=>re});var n=i(43380),r=i(77468),s=i(5884),o=i(90118),a=i(72932),l=i(25065),c=i(14092),d=i(10840),u=i(62819),h=i(6056),A=i(31539),p=i(74208),g=i(23649),v=i(93695),f=i(84079),m=i(44500),y=i(36359),C=i(35500),w=i(58329),I=i(43090);function b(){return(e,t)=>{const i=(0,p.WQX)(g.Ix),n=(0,p.WQX)(I.l),r=(0,p.WQX)(w.Q);return(0,p.WQX)(C.D).activeAccount$.pipe((0,m.n)(e=>e?r.hasPremiumFromAnySource$(e.id):(0,v.of)(!1)),(0,m.n)(e=>e?(0,v.of)(e):(0,f.H)(n.promptForPremium()).pipe((0,m.n)(()=>(0,v.of)(e)))),(0,y.M)(e=>{if(!e&&"/login"===i.url)return i.createUrlTree(["/"])}))}}var B=i(51757),E=i(72245),S=i(3204),Q=i(33812),k=i(72331),T=i(38620),F=i(56898),P=i(44432),R=i(10672),D=i(86226),M=i(97553),x=i(43759),O=i(49112),G=i(25740),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function V(e,t){1&e&&(Q.j41(0,"p"),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.SpI("",Q.bMT(2,1,"reportError"),"..."))}function j(e,t){if(1&e&&(Q.j41(0,"bit-callout",6),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()),2&e){const e=Q.XpG(3);Q.Y8G("title",Q.mNQ(Q.bMT(1,3,"goodNews"))),Q.R7$(2),Q.SpI(" ",Q.i5U(3,5,"breachEmailNotFound",e.checkedEmail)," ")}}function N(e,t){if(1&e&&(Q.j41(0,"li"),Q.EFF(1),Q.k0s()),2&e){const e=t.$implicit;Q.R7$(),Q.JRh(e)}}function z(e,t){if(1&e&&(Q.j41(0,"li",9)(1,"div",10),Q.nrm(2,"img",11),Q.k0s(),Q.j41(3,"div",12)(4,"h3",13),Q.EFF(5),Q.k0s(),Q.nrm(6,"p",14),Q.j41(7,"p",15),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.j41(10,"ul"),Q.Z7z(11,N,2,1,"li",null,Q.fX1),Q.k0s()(),Q.j41(13,"div",16)(14,"dl")(15,"dt"),Q.EFF(16),Q.nI1(17,"i18n"),Q.k0s(),Q.j41(18,"dd"),Q.EFF(19),Q.k0s(),Q.j41(20,"dt"),Q.EFF(21),Q.nI1(22,"i18n"),Q.k0s(),Q.j41(23,"dd"),Q.EFF(24),Q.nI1(25,"number"),Q.k0s(),Q.j41(26,"dt"),Q.EFF(27),Q.nI1(28,"i18n"),Q.k0s(),Q.j41(29,"dd"),Q.EFF(30),Q.nI1(31,"date"),Q.k0s(),Q.j41(32,"dt"),Q.EFF(33),Q.nI1(34,"i18n"),Q.k0s(),Q.j41(35,"dd"),Q.EFF(36),Q.nI1(37,"date"),Q.k0s()()()()),2&e){const e=t.$implicit;Q.R7$(2),Q.Y8G("src",e.logoPath,Q.B4B),Q.R7$(3),Q.JRh(e.title),Q.R7$(),Q.Y8G("innerHTML",e.description,Q.npT),Q.R7$(2),Q.SpI("",Q.bMT(9,12,"compromisedData"),":"),Q.R7$(3),Q.Dyx(e.dataClasses),Q.R7$(5),Q.JRh(Q.bMT(17,14,"website")),Q.R7$(3),Q.JRh(e.domain),Q.R7$(2),Q.JRh(Q.bMT(22,16,"affectedUsers")),Q.R7$(3),Q.JRh(Q.bMT(25,18,e.pwnCount)),Q.R7$(3),Q.JRh(Q.bMT(28,20,"breachOccurred")),Q.R7$(3),Q.JRh(Q.i5U(31,22,e.breachDate,"mediumDate")),Q.R7$(3),Q.JRh(Q.bMT(34,25,"breachReported")),Q.R7$(3),Q.JRh(Q.i5U(37,27,e.addedDate,"mediumDate"))}}function Y(e,t){if(1&e&&(Q.j41(0,"bit-callout",7),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"ul",8),Q.Z7z(5,z,38,30,"li",9,Q.fX1),Q.k0s()),2&e){const e=Q.XpG(3);Q.Y8G("title",Q.mNQ(Q.bMT(1,3,"breachFound"))),Q.R7$(2),Q.SpI(" ",Q.brH(3,5,"breachEmailFound",e.checkedEmail,e.breachedAccounts.length)," "),Q.R7$(3),Q.Dyx(e.breachedAccounts)}}function L(e,t){if(1&e&&Q.nVh(0,j,4,8,"bit-callout",6)(1,Y,7,9),2&e){const e=Q.XpG(2);Q.vxM(e.breachedAccounts.length?1:0)}}function K(e,t){if(1&e&&(Q.j41(0,"div",5),Q.nVh(1,V,3,3,"p")(2,L,2,1),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.vxM(e.error?1:2)}}class X{constructor(e,t,i){this.auditService=e,this.accountService=t,this.formBuilder=i,this.loading=!1,this.error=!1,this.breachedAccounts=[],this.formGroup=this.formBuilder.group({email:["",{validators:[B.k0.required,B.k0.email],updateOn:"change"}]}),this.submit=()=>U(this,void 0,void 0,function*(){if(this.formGroup.markAsTouched(),this.formGroup.invalid)return;this.error=!1,this.loading=!0;const e=this.formGroup.value.email.toLowerCase();try{this.breachedAccounts=yield this.auditService.breachedAccounts(e)}catch(t){this.error=!0}finally{this.loading=!1}this.checkedEmail=e})}ngOnInit(){return U(this,void 0,void 0,function*(){this.formGroup.get("email").setValue(yield(0,E._)(this.accountService.activeAccount$.pipe((0,S.T)(e=>null==e?void 0:e.email))))})}}X.ɵfac=function(e){return new(e||X)(Q.rXU(k.d),Q.rXU(C.D),Q.rXU(B.ok))},X.ɵcmp=Q.VBU({type:X,selectors:[["app-breach-report"]],standalone:!1,decls:18,vars:16,consts:[[3,"bitSubmit","formGroup"],["disableMargin","",1,"tw-w-1/2"],["id","email","type","text","formControlName","email","bitInput",""],[1,"tw-mb-4","tw-block","tw-text-muted"],["type","submit","buttonType","primary","bitButton","",3,"loading"],[1,"tw-mt-4"],["type","success",3,"title"],["type","danger",3,"title"],[1,"tw-list-none","tw-flex-col","tw-divide-x-0","tw-divide-y","tw-divide-solid","tw-divide-secondary-300","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-p-0"],[1,"tw-flex","tw-gap-4","tw-p-4"],[1,"tw-w-32","tw-flex-none"],["alt","",1,"tw-max-w-32","tw-items-stretch",3,"src"],[1,"tw-flex-auto"],[1,"tw-text-lg"],[3,"innerHTML"],[1,"tw-mb-1"],[1,"tw-w-48","tw-flex-none"]],template:function(e,t){1&e&&(Q.nrm(0,"app-header"),Q.j41(1,"bit-container")(2,"p"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.j41(5,"form",0)(6,"bit-form-field",1)(7,"bit-label"),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.nrm(10,"input",2),Q.k0s(),Q.j41(11,"small",3),Q.EFF(12),Q.nI1(13,"i18n"),Q.k0s(),Q.j41(14,"button",4),Q.EFF(15),Q.nI1(16,"i18n"),Q.k0s()(),Q.nVh(17,K,3,1,"div",5),Q.k0s()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,8,"breachDesc")),Q.R7$(2),Q.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),Q.R7$(3),Q.JRh(Q.bMT(9,10,"email")),Q.R7$(4),Q.JRh(Q.bMT(13,12,"breachCheckEmail")),Q.R7$(2),Q.Y8G("loading",t.loading),Q.R7$(),Q.SpI(" ",Q.bMT(16,14,"checkBreaches")," "),Q.R7$(2),Q.vxM(!t.loading&&t.checkedEmail?17:-1))},dependencies:[B.qT,B.me,B.BC,B.cb,B.j4,B.JD,T.L,F.Q,P.G,R.H,D.j,M.J,x.h,O.f,r.QX,r.vh,G.$],encapsulation:2});var q=i(85037),H=i(30414),W=i(82392);const $=W.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.7 2.4 79.3 77.2">
    <path class="tw-fill-illustration-bg-primary" d="M17.6 26.8a4.8 4.8 0 0 1 4.8-4.8h52.8a4.8 4.8 0 0 1 4.8 4.8v33.6a4.8 4.8 0 0 1-4.8 4.8H22.4a4.8 4.8 0 0 1-4.8-4.8V26.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75.2 23.6H22.4a3.2 3.2 0 0 0-3.2 3.2v33.6a3.2 3.2 0 0 0 3.2 3.2h52.8a3.2 3.2 0 0 0 3.2-3.2V26.8a3.2 3.2 0 0 0-3.2-3.2ZM22.4 22a4.8 4.8 0 0 0-4.8 4.8v33.6a4.8 4.8 0 0 0 4.8 4.8h52.8a4.8 4.8 0 0 0 4.8-4.8V26.8a4.8 4.8 0 0 0-4.8-4.8H22.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M17.6 26.8H80v33.6H17.6V26.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.4 28.4H19.2v30.4h59.2V28.4Zm-60.8-1.6v33.6H80V26.8H17.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M41.6 64.4H56v14.4H41.6V64.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M40.8 63.6h16V78h6.4a.8.8 0 0 1 0 1.6H34.4a.8.8 0 0 1 0-1.6h6.4V63.6ZM42.4 78h12.8V65.2H42.4V78Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M42.4 65.2h12.8V70H42.4v-4.8Z"/>
    <path class="tw-fill-illustration-tertiary" d="M56.8 43.6a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48.8 50a6.4 6.4 0 1 0 0-12.8 6.4 6.4 0 0 0 0 12.8Zm0 1.6a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M11.496 20.793c0 10.158 8.235 18.392 18.393 18.392 10.158 0 18.392-8.234 18.392-18.392S40.047 2.4 29.89 2.4s-18.393 8.235-18.393 18.393Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.889 37.585c-9.274 0-16.793-7.518-16.793-16.792C13.096 11.519 20.614 4 29.89 4 39.163 4 46.68 11.52 46.68 20.793S39.163 37.585 29.89 37.585Zm0 1.6c-10.158 0-18.393-8.234-18.393-18.392S19.731 2.4 29.89 2.4c10.158 0 18.392 8.235 18.392 18.393 0 10.158-8.234 18.392-18.392 18.392Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M16.093 20.792c0 7.619 6.176 13.795 13.794 13.795 7.619 0 13.795-6.176 13.795-13.795 0-7.618-6.176-13.794-13.795-13.794-7.618 0-13.794 6.176-13.794 13.794Z"/>
    <path class="tw-fill-illustration-outline" d="m1.197 47.71 15.356-14.503 1.84 1.84L3.889 50.402a1.6 1.6 0 0 1-2.294.032l-.43-.43a1.6 1.6 0 0 1 .032-2.295Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M22.402 18.041c.445 0 .806.36.806.806v2.232a.806.806 0 1 1-1.612 0v-2.232c0-.445.36-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M25.407 20.22a.794.794 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.006-.55.793.793 0 0 1 .543-.995l2.232-.637a.819.819 0 0 1 1.006.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.465 23.968a.828.828 0 0 1-1.134-.204l-1.594-2.232a.785.785 0 0 1 .195-1.11.828.828 0 0 1 1.134.204l1.595 2.232c.259.363.171.86-.196 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M19.395 20.22a.794.794 0 0 0 .544.994l2.231.638a.819.819 0 0 0 1.007-.551.793.793 0 0 0-.543-.994l-2.232-.637a.819.819 0 0 0-1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.338 23.968a.828.828 0 0 0 1.134-.204l1.594-2.232a.785.785 0 0 0-.195-1.11.828.828 0 0 0-1.135.204l-1.594 2.232a.785.785 0 0 0 .196 1.11ZM29.954 18.041c.446 0 .807.36.807.806v2.232a.806.806 0 1 1-1.613 0v-2.232c0-.445.361-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M32.96 20.22a.793.793 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.006-.55.794.794 0 0 1 .543-.995l2.231-.637a.819.819 0 0 1 1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M32.018 23.968a.828.828 0 0 1-1.135-.204l-1.594-2.232a.785.785 0 0 1 .196-1.11.828.828 0 0 1 1.134.204l1.594 2.232c.26.363.172.86-.195 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M26.948 20.22a.793.793 0 0 0 .543.994l2.232.638a.82.82 0 0 0 1.006-.551.794.794 0 0 0-.543-.994l-2.231-.637a.819.819 0 0 0-1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M27.89 23.968a.828.828 0 0 0 1.135-.204l1.594-2.232a.785.785 0 0 0-.195-1.11.828.828 0 0 0-1.135.204l-1.594 2.232a.785.785 0 0 0 .195 1.11ZM37.505 18.041c.445 0 .806.36.806.806v2.232a.806.806 0 1 1-1.612 0v-2.232c0-.445.361-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M40.513 20.22a.793.793 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.007-.55.793.793 0 0 1 .543-.995l2.232-.637a.819.819 0 0 1 1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M39.569 23.968a.828.828 0 0 1-1.135-.204l-1.594-2.232a.785.785 0 0 1 .195-1.11.828.828 0 0 1 1.135.204l1.594 2.232c.26.363.172.86-.195 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.5 20.22a.793.793 0 0 0 .542.994l2.232.638a.82.82 0 0 0 1.006-.551.794.794 0 0 0-.543-.994l-2.232-.637a.819.819 0 0 0-1.006.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.443 23.968a.828.828 0 0 0 1.135-.204l1.594-2.232a.785.785 0 0 0-.196-1.11.828.828 0 0 0-1.134.204l-1.594 2.232a.785.785 0 0 0 .195 1.11Z" clip-rule="evenodd"/>
  </svg>
`;var J=i(9171);const Z=W.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0.99 80 73.35">
    <path class="tw-fill-illustration-bg-primary" d="M11.666 32.667c0-5.523 3.806-10 8.5-10h39.667c4.694 0 8.5 4.477 8.5 10v31.667c0 5.522-3.806 10-8.5 10H20.166c-4.694 0-8.5-4.478-8.5-10V32.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.833 24.334H20.166c-3.912 0-7.083 3.73-7.083 8.333v31.667c0 4.602 3.171 8.333 7.083 8.333h39.667c3.912 0 7.083-3.731 7.083-8.333V32.667c0-4.602-3.171-8.333-7.083-8.333Zm-39.667-1.667c-4.694 0-8.5 4.477-8.5 10v31.667c0 5.522 3.806 10 8.5 10h39.667c4.694 0 8.5-4.478 8.5-10V32.667c0-5.523-3.806-10-8.5-10H20.166Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M13.334 56.833h53.333V63.5H13.334v-6.667Z"/>
    <path class="tw-fill-illustration-tertiary" d="M0 48.5c0-5.523 4.477-10 10-10h60c5.523 0 10 4.477 10 10s-4.477 10-10 10H10c-5.523 0-10-4.477-10-10Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 40.167H10a8.333 8.333 0 1 0 0 16.666h60a8.333 8.333 0 1 0 0-16.666ZM10 38.5c-5.523 0-10 4.477-10 10s4.477 10 10 10h60c5.523 0 10-4.477 10-10s-4.477-10-10-10H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.667 43.5c.46 0 .834.389.834.868v3.48l3.117-1.658c.423-.225.942-.078 1.158.328.216.407.047.919-.376 1.144l-3.364 1.789 2.69 2.885c.327.35.319.89-.018 1.203-.336.314-.874.284-1.201-.067l-2.84-3.045-2.84 3.045c-.326.351-.864.38-1.2.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.424-.224-.592-.736-.376-1.143.216-.406.735-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.833-.868Zm13.334 0c.46 0 .833.389.833.868v3.48l3.117-1.658c.423-.225.942-.078 1.158.328.216.407.048.919-.376 1.144L31.37 49.45l2.69 2.885c.327.35.32.89-.017 1.203-.337.314-.875.284-1.202-.067L30 50.427l-2.839 3.045c-.327.351-.865.38-1.201.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.424-.224-.592-.736-.376-1.143.216-.406.735-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.834-.868Zm14.166.868c0-.48-.373-.868-.833-.868-.46 0-.833.389-.833.868v3.48l-3.117-1.658c-.424-.225-.942-.078-1.158.328-.216.407-.048.919.375 1.144l3.365 1.789-2.69 2.885c-.328.35-.32.89.017 1.203.337.314.874.284 1.202-.067l2.839-3.045 2.84 3.045c.327.351.864.38 1.201.067.337-.314.344-.853.017-1.203l-2.69-2.885 3.365-1.79c.423-.224.591-.736.375-1.143-.216-.406-.734-.553-1.158-.328l-3.117 1.657v-3.479Zm6.667 8.299c0-.46.373-.834.833-.834h6.667a.833.833 0 0 1 0 1.667h-6.667a.833.833 0 0 1-.833-.833Zm10.833-.834a.833.833 0 0 0 0 1.667h6.667a.833.833 0 0 0 0-1.667h-6.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M55.833 17.644v-.025c0-8.745-7.09-15.834-15.834-15.834S24.166 8.874 24.166 17.62v5.833h5v-5.834c0-5.983 4.85-10.833 10.833-10.833 5.983 0 10.834 4.85 10.834 10.834v.025h5Z"/>
    <path class="tw-fill-illustration-bg-primary" d="M24.785 19.488h3.775v3.333h-3.775z"/>
    <path class="tw-fill-illustration-outline" d="M28.367 17.618c0-6.424 5.208-11.632 11.633-11.633 6.164 0 11.206 4.795 11.605 10.859h3.409C54.61 8.9 48.043 2.585 40 2.585c-8.302 0-15.033 6.73-15.033 15.033v5.033h3.4v-5.033Zm1.6 5.834a.8.8 0 0 1-.8.8h-5a.8.8 0 0 1-.8-.8v-5.834C23.367 8.432 30.814.986 40 .985c9.186 0 16.634 7.447 16.634 16.633v.027a.8.8 0 0 1-.8.8h-5a.802.802 0 0 1-.8-.8v-.027C50.032 12.078 45.54 7.585 40 7.585s-10.033 4.492-10.033 10.033v5.834Z"/>
  </svg>
`,_=W.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.4 10.07 79.2 60">
    <path class="tw-fill-illustration-bg-primary" d="M.4 14.872a4.8 4.8 0 0 1 4.8-4.8h69.6a4.8 4.8 0 0 1 4.8 4.8v50.4a4.8 4.8 0 0 1-4.8 4.8H5.2a4.8 4.8 0 0 1-4.8-4.8v-50.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.8 11.672H5.2a3.2 3.2 0 0 0-3.2 3.2v50.4a3.2 3.2 0 0 0 3.2 3.2h69.6a3.2 3.2 0 0 0 3.2-3.2v-50.4a3.2 3.2 0 0 0-3.2-3.2Zm-69.6-1.6a4.8 4.8 0 0 0-4.8 4.8v50.4a4.8 4.8 0 0 0 4.8 4.8h69.6a4.8 4.8 0 0 0 4.8-4.8v-50.4a4.8 4.8 0 0 0-4.8-4.8H5.2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M79.6 24.166H.4v-1.6h79.2v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M75.176 17.323a2.415 2.415 0 0 1-2.412 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417ZM67.94 17.323a2.415 2.415 0 0 1-2.413 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417ZM60.705 17.323a2.415 2.415 0 0 1-2.412 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M40.104 65.54c10.696 0 19.367-8.67 19.367-19.367 0-10.696-8.671-19.367-19.367-19.367-10.697 0-19.368 8.67-19.368 19.367 0 10.696 8.671 19.367 19.368 19.367Zm-9.705-26.63a2.4 2.4 0 0 0-2.4 2.4v14.568a2.4 2.4 0 0 0 2.4 2.4h19.41a2.4 2.4 0 0 0 2.4-2.4V41.31a2.4 2.4 0 0 0-2.4-2.4h-19.41Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M28 41.31a2.4 2.4 0 0 1 2.4-2.4h19.41a2.4 2.4 0 0 1 2.4 2.4v14.568a2.4 2.4 0 0 1-2.4 2.4H30.4a2.4 2.4 0 0 1-2.4-2.4V41.31Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M49.81 40.51H30.4a.8.8 0 0 0-.8.8v14.568a.8.8 0 0 0 .8.8h19.41a.8.8 0 0 0 .8-.8V41.31a.8.8 0 0 0-.8-.8Zm-19.41-1.6a2.4 2.4 0 0 0-2.4 2.4v14.568a2.4 2.4 0 0 0 2.4 2.4h19.41a2.4 2.4 0 0 0 2.4-2.4V41.31a2.4 2.4 0 0 0-2.4-2.4H30.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M38.895 46.172a1.21 1.21 0 0 1 2.42 0v4.842a1.21 1.21 0 0 1-2.42 0v-4.842Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.928 39.108a5.642 5.642 0 0 1 9.772-5.642l.605 1.048a.8.8 0 1 1-1.385.8l-.605-1.048a4.042 4.042 0 0 0-7.001 4.042l.605 1.048a.8.8 0 0 1-1.385.8l-.606-1.048Z" clip-rule="evenodd"/>
  </svg>
`;var ee=i(90005);const te=W.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="11.6 3.33 56.67 73.33">
    <path class="tw-fill-illustration-bg-secondary" d="M60 10a1.6 1.6 0 0 1 1.6 1.6v63.467a1.6 1.6 0 0 1-1.6 1.6H13.2a1.6 1.6 0 0 1-1.6-1.6V11.6a1.6 1.6 0 0 1 1.6-1.6H60Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 75.067V11.6H13.2v63.467H60ZM61.6 11.6A1.6 1.6 0 0 0 60 10H13.2a1.6 1.6 0 0 0-1.6 1.6v63.467a1.6 1.6 0 0 0 1.6 1.6H60a1.6 1.6 0 0 0 1.6-1.6V11.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M68.266 68.4V4.933a1.6 1.6 0 0 0-1.6-1.6H31.012c-.425 0-.827.164-1.127.464L18.733 14.95c-.3.3-.467.706-.467 1.13V68.4a1.6 1.6 0 0 0 1.6 1.6h46.8a1.6 1.6 0 0 0 1.6-1.6Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M66.666 68.4V4.933H31.012L19.866 16.079V68.4h46.8Zm1.6-63.467V68.4a1.6 1.6 0 0 1-1.6 1.6h-46.8a1.6 1.6 0 0 1-1.6-1.6V16.08c0-.425.167-.83.467-1.13L29.885 3.796c.3-.3.702-.464 1.127-.464h35.654a1.6 1.6 0 0 1 1.6 1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M31.6 4.2a.8.8 0 0 1 .8.8v11.666a.8.8 0 0 1-.8.8H19.932a.8.8 0 0 1 0-1.6h10.866V4.999a.8.8 0 0 1 .8-.8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M39.617 22.914c1.642-2.825 5.723-2.825 7.365 0l10.896 18.741c1.651 2.84-.397 6.401-3.682 6.401H32.403c-3.285 0-5.334-3.56-3.683-6.4l10.897-18.742Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.925 22.51c1.951-3.355 6.798-3.355 8.75 0L58.57 41.254c1.962 3.373-.472 7.603-4.374 7.603H32.403c-3.901 0-6.335-4.23-4.374-7.603L38.925 22.51Zm7.366.805c-1.334-2.295-4.648-2.295-5.982 0L29.412 42.057c-1.34 2.306.323 5.199 2.991 5.199h21.793c2.668 0 4.332-2.893 2.991-5.2L46.291 23.316Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M44.764 42.2a1.464 1.464 0 1 1-2.928 0 1.464 1.464 0 0 1 2.928 0ZM41.155 29.495a.426.426 0 0 1 .423-.472h3.444c.254 0 .45.22.424.472l-1.007 9.396a.426.426 0 0 1-.423.38h-1.43a.426.426 0 0 1-.424-.38l-.509-4.743-.498-4.653Z"/>
  </svg>
`;var ie,ne=i(54006);!function(e){e.ExposedPasswords="exposedPasswords",e.ReusedPasswords="reusedPasswords",e.WeakPasswords="weakPasswords",e.UnsecuredWebsites="unsecuredWebsites",e.Inactive2fa="inactive2fa",e.DataBreach="dataBreach",e.MemberAccessReport="memberAccessReport"}(ie||(ie={}));const re={[ie.ExposedPasswords]:{title:"exposedPasswordsReport",description:"exposedPasswordsReportDesc",route:"exposed-passwords-report",icon:$},[ie.ReusedPasswords]:{title:"reusedPasswordsReport",description:"reusedPasswordsReportDesc",route:"reused-passwords-report",icon:J.R},[ie.WeakPasswords]:{title:"weakPasswordsReport",description:"weakPasswordsReportDesc",route:"weak-passwords-report",icon:Z},[ie.UnsecuredWebsites]:{title:"unsecuredWebsitesReport",description:"unsecuredWebsitesReportDesc",route:"unsecured-websites-report",icon:_},[ie.Inactive2fa]:{title:"inactive2faReport",description:"inactive2faReportDesc",route:"inactive-two-factor-report",icon:ee.f},[ie.DataBreach]:{title:"dataBreachReport",description:"breachDesc",route:"breach-report",icon:te},[ie.MemberAccessReport]:{title:"memberAccessReport",description:"memberAccessReportDesc",route:"member-access-report",icon:ne.u}};var se=i(80378),oe=i(62963);class ae{}ae.ɵfac=function(e){return new(e||ae)},ae.ɵmod=Q.$C({type:ae}),ae.ɵinj=p.G2t({imports:[r.MD,oe.G]});var le=i(25219),ce=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class de{constructor(e,t){this.billingAccountProfileStateService=e,this.accountService=t,this.reports=(0,p.vPA)([])}ngOnInit(){return ce(this,void 0,void 0,function*(){const e=yield(0,E._)(this.accountService.activeAccount$),t=(yield(0,E._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)))?se.C.Enabled:se.C.RequiresPremium;this.reports.set([Object.assign(Object.assign({},re[ie.ExposedPasswords]),{variant:t}),Object.assign(Object.assign({},re[ie.ReusedPasswords]),{variant:t}),Object.assign(Object.assign({},re[ie.WeakPasswords]),{variant:t}),Object.assign(Object.assign({},re[ie.UnsecuredWebsites]),{variant:t}),Object.assign(Object.assign({},re[ie.Inactive2fa]),{variant:t}),Object.assign(Object.assign({},re[ie.DataBreach]),{variant:se.C.Enabled})])})}}de.ɵfac=function(e){return new(e||de)(Q.rXU(w.Q),Q.rXU(C.D))},de.ɵcmp=Q.VBU({type:de,selectors:[["app-reports-home"]],standalone:!1,decls:6,vars:4,consts:[[3,"reports"]],template:function(e,t){1&e&&(Q.nrm(0,"app-header"),Q.j41(1,"bit-container")(2,"p"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.nrm(5,"app-report-list",0),Q.k0s()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,2,"reportsDesc")),Q.R7$(2),Q.Y8G("reports",t.reports()))},dependencies:[R.H,le.i,O.f,G.$],encapsulation:2,changeDetection:0});var ue=i(17343),he=i(71687),Ae=i(72523),pe=i(37831),ge=i(94573),ve=i(83731),fe=i(69194);const me=["backButtonTemplate"];function ye(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"span",2),Q.bIt("keydown.tab",function(t){p.eBV(e);const i=Q.XpG();return p.Njj(i.focusOverlayButton(t))}),Q.k0s()}}function Ce(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"div",3)(1,"a",4),Q.bIt("keydown.tab",function(t){p.eBV(e);const i=Q.XpG();return p.Njj(i.returnFocusToPage(t))}),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()()}2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,1,"backToReports")," "))}class we{constructor(){this.homepage=!0,this.backButtonTemplate=ge.ebz.required("backButtonTemplate"),this.overlayRef=null,this.overlay=(0,p.WQX)(n.hJ),this.viewContainerRef=(0,p.WQX)(Q.c1b),this.router=(0,p.WQX)(g.Ix),this.router.events.pipe((0,ve.pQ)(),(0,fe.p)(e=>e instanceof g.wF)).subscribe(()=>this.updateOverlay())}ngAfterViewInit(){this.updateOverlay()}ngOnDestroy(){var e;null===(e=this.overlayRef)||void 0===e||e.dispose()}returnFocusToPage(e){if(e.shiftKey)return;e.preventDefault();const t=document.querySelector("[cdktrapfocus] a:not([tabindex='-1'])");null==t||t.focus()}focusOverlayButton(e){var t,i;if(e.shiftKey)return;e.preventDefault();const n=null===(i=null===(t=this.overlayRef)||void 0===t?void 0:t.overlayElement)||void 0===i?void 0:i.querySelector("a");null==n||n.focus()}updateOverlay(){var e;"/reports"===this.router.url?(this.homepage=!0,null===(e=this.overlayRef)||void 0===e||e.dispose(),this.overlayRef=null):this.overlayRef||(this.homepage=!1,this.overlayRef=this.overlay.create({positionStrategy:this.overlay.position().global().bottom("20px").right("32px")}),this.overlayRef.attach(new pe.VA(this.backButtonTemplate(),this.viewContainerRef)))}}we.ɵfac=function(e){return new(e||we)},we.ɵcmp=Q.VBU({type:we,selectors:[["app-reports-layout"]],viewQuery:function(e,t){1&e&&Q.wEZ(t.backButtonTemplate,me,5),2&e&&Q.NyB()},standalone:!1,decls:4,vars:1,consts:[["backButtonTemplate",""],["tabindex","0","aria-hidden","true",1,"tw-sr-only"],["tabindex","0","aria-hidden","true",1,"tw-sr-only",3,"keydown.tab"],[1,"tw-p-3","tw-rounded-lg","tw-opacity-90"],["bitButton","","buttonType","primary","routerLink","./","tabindex","0",3,"keydown.tab"]],template:function(e,t){1&e&&(Q.nrm(0,"router-outlet"),Q.nVh(1,ye,1,0,"span",1),Q.DNE(2,Ce,4,3,"ng-template",null,0,Q.C5r)),2&e&&(Q.R7$(),Q.vxM(t.homepage?-1:1))},dependencies:[g.n3,h.Wk,F.Q,G.$],encapsulation:2});const Ie=[{path:"",component:we,canActivate:[A.W_],children:[{path:"",pathMatch:"full",component:de,data:{titleId:"reports",homepage:!0}},{path:"breach-report",component:X,data:{titleId:"dataBreachReport"}},{path:"reused-passwords-report",component:ue.A,data:{titleId:"reusedPasswordsReport"},canActivate:[b()]},{path:"unsecured-websites-report",component:he.U,data:{titleId:"unsecuredWebsitesReport"},canActivate:[b()]},{path:"weak-passwords-report",component:Ae.w,data:{titleId:"weakPasswordsReport"},canActivate:[b()]},{path:"exposed-passwords-report",component:q.y,data:{titleId:"exposedPasswordsReport"},canActivate:[b()]},{path:"inactive-two-factor-report",component:H.O,data:{titleId:"inactive2faReport"},canActivate:[b()]}]}];class be{}be.ɵfac=function(e){return new(e||be)},be.ɵmod=Q.$C({type:be}),be.ɵinj=p.G2t({imports:[h.iI.forChild(Ie),h.iI]});class Be{}Be.ɵfac=function(e){return new(e||Be)},Be.ɵmod=Q.$C({type:Be}),Be.ɵinj=p.G2t({providers:[{provide:o.hI,useClass:o.Ws},o.BR,u.l,o.aC],imports:[r.MD,n.z_,l.G,ae,be,c.t,d.Y,a.G,s.W]})},80755(e,t,i){"use strict";i.d(t,{p:()=>k});var n=i(72245),r=i(54967),s=i(38449),o=i(82468),a=i(39306),l=i(56962),c=i(78781),d=i(23293),u=i(8916),h=i(15740),A=i(57396);class p{}class g{}class v{}class f{static newConstructor(e,t){const i=new f;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i}}class m{}class y extends m{}var C=i(59333),w=i(74208),I=i(12012),b=i(89105),B=i(5556),E=i(83541),S=i(1601),Q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k{constructor(e,t,i,n,r,s,o,a){this.emergencyAccessApiService=e,this.apiService=t,this.keyService=i,this.encryptService=n,this.cipherService=r,this.logService=s,this.masterPasswordService=o,this.configService=a}getEmergencyAccess(e){return this.emergencyAccessApiService.getEmergencyAccess(e)}getEmergencyAccessTrusted(){return Q(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessTrusted();return e&&0!==e.data.length?e.data.map(e=>A.cY.fromResponse(e)):[]})}getEmergencyAccessGranted(){return Q(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessGranted();return e&&0!==e.data.length?e.data.map(e=>A.RR.fromResponse(e)):[]})}getGrantorPolicies(e){return Q(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.P(new r.L(e)))),i})}invite(e,t,i){return Q(this,void 0,void 0,function*(){const n=new v;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 Q(this,void 0,void 0,function*(){const n=new m;n.type=t,n.waitTimeDays=i,yield this.emergencyAccessApiService.putEmergencyAccess(e,n)})}accept(e,t){return Q(this,void 0,void 0,function*(){const i=new p;i.token=t,yield this.emergencyAccessApiService.postEmergencyAccessAccept(e,i)})}confirm(e,t,i,r){return Q(this,void 0,void 0,function*(){const s=yield(0,n._)(this.keyService.userKey$(r));if(!s)throw new Error("No user key found");try{this.logService.debug("User's fingerprint: "+(yield this.keyService.getFingerprint(t,i)).join("-"))}catch(a){}const o=new g;o.key=yield this.encryptKey(s,i),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,t){return Q(this,void 0,void 0,function*(){const i=yield this.emergencyAccessApiService.postEmergencyAccessView(e),r=yield(0,n._)(this.keyService.userPrivateKey$(t));if(null==r)throw new Error("Active user does not have a private key, cannot get view only ciphers.");const s=yield this.encryptService.decapsulateKeyUnsigned(new a.k(i.keyEncrypted),r);let o=[];const l=i.ciphers.map(e=>new d.o(e));return o=yield Promise.all(l.map(e=>Q(this,void 0,void 0,function*(){return e.decrypt(s)}))),o.sort(this.cipherService.getLocaleSortingFunction())})}takeover(e,t,i,r){return Q(this,void 0,void 0,function*(){const s=yield this.emergencyAccessApiService.postEmergencyAccessTakeover(e),l=yield(0,n._)(this.keyService.userPrivateKey$(r));if(null==l)throw new Error("Active user does not have a private key, cannot complete a takeover.");const c=yield this.encryptService.decapsulateKeyUnsigned(new a.k(s.keyEncrypted),l);if(null==c)throw new Error("Failed to decrypt grantor key");const d=c;let h;switch(s.kdf){case u.ao.PBKDF2_SHA256:h=new u.n1(s.kdfIterations);break;case u.ao.Argon2id:h=new u.hU(s.kdfIterations,s.kdfMemory,s.kdfParallelism)}if(yield this.configService.getFeatureFlag(o.TO.PM27086_UpdateAuthenticationApisForInputPassword)){const n=this.masterPasswordService.emailToSalt(i),r=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(t,h,n),s=yield this.masterPasswordService.makeMasterPasswordUnlockData(t,h,n,d),o=f.newConstructor(r,s);return void(yield this.emergencyAccessApiService.postEmergencyAccessPassword(e,o))}const A=yield this.keyService.makeMasterKey(t,i,h),p=yield this.keyService.hashMasterKey(t,A),g=yield this.keyService.encryptUserKeyWithMasterKey(A,d);if(null==g||!g[1].encryptedString)throw new Error("masterKeyEncryptedUserKey not found");const v=new f;v.newMasterPasswordHash=p,v.key=g[1].encryptedString,yield this.emergencyAccessApiService.postEmergencyAccessPassword(e,v)})}getEmergencyAccessData(){return Q(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessTrusted();if(!e||0===e.data.length)return[];const t=new Set([h.c.Confirmed,h.c.RecoveryInitiated,h.c.RecoveryApproved]);return e.data.filter(e=>t.has(e.status))})}getPublicKeys(){return Q(this,void 0,void 0,function*(){const e=yield this.getEmergencyAccessData();return yield Promise.all(e.map(e=>Q(this,void 0,void 0,function*(){const t=new A._1;return t.id=e.id,t.granteeId=e.granteeId,t.name=e.name,t.email=e.email,t.type=e.type,t.status=e.status,t.waitTimeDays=e.waitTimeDays,t.creationDate=e.creationDate,t.avatarColor=e.avatarColor,t.publicKey=c.A.fromB64ToArray((yield this.apiService.getUserPublicKey(e.granteeId)).publicKey),t})))})}getRotatedData(e,t,i){return Q(this,void 0,void 0,function*(){if(null==e)throw new Error("New user key is required for rotation.");const i=[];this.logService.info("Starting emergency access rotation, with trusted keys: ",t);const n=yield this.getPublicKeys();for(const r of n){if(null==t.find(e=>c.A.fromArrayToHex(e)===c.A.fromArrayToHex(r.publicKey)))throw this.logService.info(`Public key for user ${r.granteeId} is not trusted, skipping rotation.`),new Error("Public key for user is not trusted.");const n=yield this.encryptKey(e,r.publicKey),s=new y;s.id=r.id,s.type=r.type,s.waitTimeDays=r.waitTimeDays,s.keyEncrypted=n,i.push(s)}return i})}encryptKey(e,t){return Q(this,void 0,void 0,function*(){const i=yield this.encryptService.encapsulateKeyUnsigned(e,t);if(null==i||!i.encryptedString)throw new Error("publicKeyEncryptedUserKey not found");return i.encryptedString})}}k.ɵfac=function(e){return new(e||k)(w.KVO(C.J),w.KVO(I.G),w.KVO(u.Lu),w.KVO(b.N),w.KVO(B.p),w.KVO(l.K),w.KVO(E.L),w.KVO(S.w))},k.ɵprov=w.jDH({token:k,factory:k.ɵfac})},80885(e,t,i){"use strict";i.d(t,{X:()=>g});var n=i(66046),r=i(72245),s=i(14928),o=i(44500),a=i(14803),l=i(84110),c=i(33812),d=i(23649),u=i(37115),h=i(50700),A=i(68455),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class g{constructor(e,t,i,r,s){this.router=e,this.platformUtilService=t,this.i18nService=i,this.route=r,this.authService=s,this.loading=!0,this.authed=!1,this.requiredParameters=[],this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.destroy$=new n.B}getErrorMessage(e){return null!=e?this.i18nService.t(this.failedShortMessage,e):this.i18nService.t(this.failedMessage)}ngOnInit(){return p(this,void 0,void 0,function*(){this.route.queryParams.pipe((0,s.$)(),(0,o.n)(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){this.email=e.email;if((yield(0,r._)(this.authService.activeAccountStatus$))!==l.J.LoggedOut)try{yield this.authedHandler(e)}catch(n){t=!0,i=n.message}else yield this.unauthedHandler(e)}if(t){const e=this.getErrorMessage(i);this.platformUtilService.showToast("error",null,e,{timeout:1e4}),this.router.navigate(["/"])}this.loading=!1})),(0,a.Q)(this.destroy$)).subscribe()})}}g.ɵfac=function(e){return new(e||g)(c.rXU(d.Ix),c.rXU(u.y),c.rXU(h.W),c.rXU(d.nX),c.rXU(A.u))},g.ɵdir=c.FsC({type:g})},81289(e,t,i){"use strict";i.d(t,{WS:()=>kt,PI:()=>Ht,WM:()=>_,sU:()=>me,bS:()=>pi});var n=i(83731),r=i(93695),s=i(33338),o=i(3204),a=i(44500),l=i(27442),c=i(14928),d=i(67553),u=i(3633),h=i(15639),A=i(58950),p=i(98403),g=i(36801),v=i(72932),f=i(25065),m=i(94573),y=i(33812),C=i(74208),w=i(72245),I=i(69194),b=i(43978),B=i(25607),E=i(81525),S=i(8916),Q=i(35500),k=i(27866),T=i(50700),F=i(51757),P=i(66316),R=i(69855),D=i(77468),M=i(26657),x=i(38620),O=i(56898),G=i(7730),U=i(68016),V=i(67311),j=i(58806),N=i(25740),z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Y=["policyForm"];function L(e,t){1&e&&(y.j41(0,"div"),y.nrm(1,"i",10),y.nI1(2,"i18n"),y.j41(3,"span",11),y.EFF(4),y.nI1(5,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("title",y.mNQ(y.bMT(2,3,"loading"))),y.R7$(3),y.JRh(y.bMT(5,5,"loading")))}function K(e,t){if(1&e&&(y.j41(0,"p",6),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e){const e=y.XpG();y.R7$(),y.JRh(y.bMT(2,1,e.policy.description))}}function X(e,t){}class q{constructor(e,t,i,n,r,s,o,a,l){this.data=e,this.accountService=t,this.policyApiService=i,this.i18nService=n,this.cdr=r,this.formBuilder=s,this.dialogRef=o,this.toastService=a,this.keyService=l,this.policyFormRef=(0,m.ebz)("policyForm",{read:y.c1b}),this.destroyRef=(0,C.WQX)(C.abz),this.policyType=b.tt,this.loading=(0,C.vPA)(!0),this.enabled=!1,this.saveDisabled=(0,C.vPA)(!1),this.policyComponent=(0,C.vPA)(void 0),this.formGroup=this.formBuilder.group({enabled:[this.enabled]}),this.submit=()=>z(this,void 0,void 0,function*(){const e=this.policyComponent();if(!e)throw new Error("PolicyComponent not initialized.");if(0!=(yield e.confirm()))try{yield this.handleVNextSubmission(e),this.toastService.showToast({variant:"success",message:this.i18nService.t("editedPolicyId",this.i18nService.t(this.data.policy.name))}),this.dialogRef.close("saved")}catch(t){this.toastService.showToast({variant:"error",message:t.message})}else this.dialogRef.close()})}get policy(){return this.data.policy}hasVNextRequest(e){return"buildVNextRequest"in e&&"function"==typeof e.buildVNextRequest}ngAfterViewInit(){return z(this,void 0,void 0,function*(){const e=yield this.load();this.loading.set(!1);const t=this.policyFormRef();if(!t)throw new Error("Template not initialized.");const i=t.createComponent(this.data.policy.component).instance;i.policy=this.data.policy,i.policyResponse=e,this.policyComponent.set(i),i.data&&i.data.statusChanges.pipe((0,o.T)(t=>"VALID"!==t||!e.canToggleState),(0,n.pQ)(this.destroyRef)).subscribe(e=>this.saveDisabled.set(e)),this.cdr.detectChanges()})}load(){return z(this,void 0,void 0,function*(){try{return yield this.policyApiService.getPolicy(this.data.organization.id,this.data.policy.type)}catch(e){if(404===e.statusCode)return new B.i({Enabled:!1});throw e}})}handleVNextSubmission(e){return z(this,void 0,void 0,function*(){const t=yield(0,w._)(this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.keyService.orgKeys$(e)),(0,I.p)(e=>null!=e),(0,o.T)(e=>{var t;return null!==(t=e[this.data.organization.id])&&void 0!==t?t:null})));if(null==t)throw new Error("No encryption key for this organization.");const i=yield e.buildVNextRequest(t);yield this.policyApiService.putPolicyVNext(this.data.organization.id,this.data.policy.type,i)})}}q.open=(e,t)=>e.open(q,t),q.ɵfac=function(e){return new(e||q)(y.rXU(E.Qs),y.rXU(Q.D),y.rXU(k.m),y.rXU(T.W),y.rXU(m.gRc),y.rXU(F.ok),y.rXU(P.ce),y.rXU(R.f),y.rXU(S.Lu))},q.ɵcmp=y.VBU({type:q,selectors:[["ng-component"]],viewQuery:function(e,t){1&e&&y.wEZ(t.policyFormRef,Y,5,y.c1b),2&e&&y.NyB()},decls:17,vars:19,consts:[["policyForm",""],[3,"formGroup","bitSubmit"],[3,"loading","title","subtitle"],["bitDialogContent",""],[4,"ngIf"],[3,"hidden"],["bitTypography","body1"],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit",3,"disabled"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(y.j41(0,"form",1)(1,"bit-dialog",2),y.nI1(2,"i18n"),y.nI1(3,"i18n"),y.qex(4,3),y.DNE(5,L,6,7,"div",4),y.j41(6,"div",5),y.nVh(7,K,3,3,"p",6),y.DNE(8,X,0,0,"ng-template",null,0,y.C5r),y.k0s(),y.bVm(),y.qex(10,7),y.j41(11,"button",8),y.EFF(12),y.nI1(13,"i18n"),y.k0s(),y.j41(14,"button",9),y.EFF(15),y.nI1(16,"i18n"),y.k0s(),y.bVm(),y.k0s()()),2&e&&(y.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),y.R7$(),y.Y8G("loading",t.loading())("title",y.bMT(2,11,"editPolicy"))("subtitle",y.bMT(3,13,t.policy.name)),y.R7$(4),y.Y8G("ngIf",t.loading()),y.R7$(),y.Y8G("hidden",t.loading()),y.R7$(),y.vxM(t.policy.showDescription?7:-1),y.R7$(4),y.Y8G("disabled",t.saveDisabled()),y.R7$(),y.SpI(" ",y.bMT(13,15,"save")," "),y.R7$(3),y.SpI(" ",y.bMT(16,17,"cancel")," "))},dependencies:[f.G,D.bT,F.qT,F.cb,F.j4,M.$,x.L,O.Q,G.I,U.m,V.hJ,j.r,N.$],encapsulation:2,changeDetection:0});const H="data-controls",W="authentication",$="vault-management",J=[{category:H,labelKey:"dataControls"},{category:W,labelKey:"authentication"},{category:$,labelKey:"vaultManagement"}];class Z{constructor(e){const t=[...e].sort((t,i)=>t.priority!==i.priority?t.priority-i.priority:e.indexOf(t)-e.indexOf(i));this.allPolicies=Object.freeze(t),this.sections=J.map(e=>Object.assign(Object.assign({},e),{policies:t.filter(t=>t.category===e.category)}))}getPolicies(){return this.allPolicies}}const _=new g.aZ("POLICY_EDIT_REGISTER");var ee=i(23649),te=i(18499),ie=i(1601),ne=i(47696),re=i(10672),se=i(88832),oe=i(49112),ae=i(75556),le=i(90300),ce=i(91962);const de=(e,t)=>t.category,ue=(e,t)=>t.type;function he(e,t){1&e&&(y.nrm(0,"i",0),y.nI1(1,"i18n"),y.j41(2,"span",1),y.EFF(3),y.nI1(4,"i18n"),y.k0s()),2&e&&(y.Y8G("title",y.mNQ(y.bMT(1,3,"loading"))),y.R7$(3),y.JRh(y.bMT(4,5,"loading")))}function Ae(e,t){1&e&&(y.j41(0,"span",5),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.JRh(y.bMT(2,1,"on")))}function pe(e,t){1&e&&(y.j41(0,"span",6),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.JRh(y.bMT(2,1,"off")))}function ge(e,t){if(1&e){const e=y.RV6();y.j41(0,"bit-item")(1,"button",3),y.bIt("click",function(){const t=C.eBV(e).$implicit,i=y.XpG(3),n=y.r8f(5);return C.Njj(i.edit(t,n))}),y.EFF(2),y.nI1(3,"i18n"),y.j41(4,"span",4),y.EFF(5),y.nI1(6,"i18n"),y.k0s(),y.nVh(7,Ae,3,3,"span",5)(8,pe,3,3,"span",6),y.k0s()()}if(2&e){const e=t.$implicit;y.XpG(3);const i=y.r8f(3);y.R7$(2),y.SpI(" ",y.bMT(3,3,e.name)," "),y.R7$(3),y.JRh(y.bMT(6,5,e.description)),y.R7$(2),y.vxM(i.get(e.type)?7:8)}}function ve(e,t){if(1&e&&(y.j41(0,"bit-section")(1,"bit-section-header")(2,"h2",2),y.EFF(3),y.nI1(4,"i18n"),y.k0s()(),y.j41(5,"bit-item-group"),y.nI1(6,"i18n"),y.Z7z(7,ge,9,7,"bit-item",null,ue),y.k0s()()),2&e){const e=t.$implicit;y.R7$(3),y.JRh(y.bMT(4,2,e.labelKey)),y.R7$(2),y.BMQ("aria-label",y.bMT(6,4,e.labelKey)),y.R7$(2),y.Dyx(e.policies)}}function fe(e,t){if(1&e&&y.Z7z(0,ve,9,6,"bit-section",null,de),2&e){y.XpG();const e=y.r8f(1);y.Dyx(e)}}class me{visiblePoliciesInSection$(e,t){return 0===e.policies.length?(0,r.of)(Object.assign(Object.assign({},e),{policies:[]})):(0,s.z)(e.policies.map(e=>e.display$(t,this.configService).pipe((0,o.T)(t=>t?e:null)))).pipe((0,o.T)(t=>Object.assign(Object.assign({},e),{policies:t.filter(e=>null!==e)})))}constructor(e,t,i,n,c,d,A,p,g){this.route=e,this.organizationService=t,this.accountService=i,this.policyApiService=n,this.policyListService=c,this.dialogService=d,this.policyService=A,this.configService=p,this.destroyRef=g,this.userId$=this.accountService.activeAccount$.pipe(u.F6),this.organizationId$=this.route.params.pipe((0,o.T)(e=>e.organizationId)),this.organization$=(0,s.z)([this.userId$,this.organizationId$]).pipe((0,a.n)(([e,t])=>this.organizationService.organizations$(e).pipe((0,h.Hc)(t),(0,o.T)(e=>{if(null==e)throw new Error("No organization found for provided userId");return e})))),this.policies$=(0,r.of)(this.policyListService.getPolicies()),this.orgPolicies$=this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.policyService.policies$(e)),(0,a.n)(()=>this.organizationId$),(0,a.n)(e=>this.policyApiService.getPolicies(e)),(0,o.T)(e=>null!=e.data&&e.data.length>0?e.data:[]),(0,l.t)({bufferSize:1,refCount:!0})),this.policiesEnabledMap$=this.orgPolicies$.pipe((0,o.T)(e=>{const t=new Map;return e.forEach(e=>{t.set(e.type,e.enabled)}),t})),this.policySections$=this.organization$.pipe((0,a.n)(e=>(0,s.z)(this.policyListService.sections.map(t=>this.visiblePoliciesInSection$(t,e)))),(0,o.T)(e=>e.filter(e=>e.policies.length>0))),this.handleLaunchEvent()}handleLaunchEvent(){(0,s.z)([this.route.queryParams.pipe((0,c.$)()),this.orgPolicies$,this.organization$]).pipe((0,o.T)(([e,t,i])=>{if(null!=e.policyId){const n=e.policyId,r=this.policyListService.getPolicies();for(const e of t)if(e.id===n){for(const t of r)if(t.type===e.type){this.edit(t,i);break}break}}}),(0,n.pQ)(this.destroyRef)).subscribe()}edit(e,t){var i;(null!==(i=e.editDialogComponent)&&void 0!==i?i:q).open(this.dialogService,{data:{policy:e,organization:t}})}}me.ɵfac=function(e){return new(e||me)(y.rXU(ee.nX),y.rXU(d.PV),y.rXU(Q.D),y.rXU(k.m),y.rXU(Z),y.rXU(P.o3),y.rXU(te.m),y.rXU(ie.w),y.rXU(C.abz))},me.ɵcmp=y.VBU({type:me,selectors:[["ng-component"]],features:[y.Jv_([(0,g.F)({provide:Z,deps:[_]})])],decls:10,vars:10,consts:[["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitTypography","h2"],["type","button","bit-item-content","",3,"click"],["slot","secondary"],["bitBadge","","variant","success","slot","end"],["bitBadge","","variant","secondary","slot","end"]],template:function(e,t){if(1&e&&(y.nrm(0,"app-header"),y.SS7(1),y.nI1(2,"async"),y.SS7(3),y.nI1(4,"async"),y.SS7(5),y.nI1(6,"async"),y.j41(7,"bit-container"),y.nVh(8,he,5,7)(9,fe,2,0),y.k0s()),2&e){y.R7$();const e=y.bH3(y.bMT(2,1,t.policySections$));y.R7$(2);const i=y.bH3(y.bMT(4,4,t.policiesEnabledMap$));y.R7$(2);const n=y.bH3(y.bMT(6,7,t.organization$));y.R7$(3),y.vxM(e&&i&&n?9:8)}},dependencies:[f.G,ne.n,re.H,se.n,j.r,v.G,oe.f,A.U,p.k,ae.J,le.g,ce._,D.Jj,N.$],encapsulation:2,changeDetection:0});var ye=i(82468),Ce=i(20702);Ce.r;var we=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ie{constructor(){this.showDescription=!0}display$(e,t){return(0,r.of)(!0)}}class be{constructor(){this.enabled=new F.MJ(!1)}ngOnInit(){var e,t,i;this.enabled.setValue(null!==(t=null===(e=this.policyResponse)||void 0===e?void 0:e.enabled)&&void 0!==t&&t),null!=(null===(i=this.policyResponse)||void 0===i?void 0:i.data)&&this.loadData()}buildVNextRequest(e){return we(this,void 0,void 0,function*(){if(!this.policy)throw new Error("Policy was not found");return{policy:yield this.buildRequest(),metadata:null}})}buildRequest(){var e;if(!this.policy)throw new Error("Policy was not found");const t={enabled:null!==(e=this.enabled.value)&&void 0!==e&&e,data:this.buildRequestData()};return Promise.resolve(t)}confirm(){return!0}loadData(){var e,t,i;null===(e=this.data)||void 0===e||e.patchValue(null!==(i=null===(t=this.policyResponse)||void 0===t?void 0:t.data)&&void 0!==i?i:{})}buildRequestData(){return null!=this.data?this.data.value:null}}be.ɵfac=function(e){return new(e||be)},be.ɵdir=y.FsC({type:be,inputs:{policyResponse:"policyResponse",policy:"policy"}});var Be=i(44432),Ee=i(50352),Se=i(90246),Qe=i(86226);class ke extends be{}ke.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(ke)))(t||ke)}})(),ke.ɵcmp=y.VBU({type:ke,selectors:[["disable-send-policy-edit"]],features:[y.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"bit-form-control"),y.nrm(4,"input",1),y.j41(5,"bit-label"),y.EFF(6),y.nI1(7,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,3,"disableSendExemption"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(7,5,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Be.G,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});var Te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Fe extends be{constructor(e){super(),this.formBuilder=e,this.data=this.formBuilder.group({disableSend:!1,disableHideEmail:!1})}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Te(this,void 0,void 0,function*(){e.ngOnInit.call(this)})}}Fe.ɵfac=function(e){return new(e||Fe)(y.rXU(F.ze))},Fe.ɵcmp=y.VBU({type:Fe,selectors:[["send-controls-policy-edit"]],features:[y.Vt3],decls:22,vars:19,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],["bitTypography","h3",1,"tw-mt-4"],["type","checkbox","bitCheckbox","","formControlName","disableSend","id","disableSend",3,"disabled"],["type","checkbox","bitCheckbox","","formControlName","disableHideEmail","id","disableHideEmail",3,"disabled"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"bit-form-control"),y.nrm(4,"input",1),y.j41(5,"bit-label"),y.EFF(6),y.nI1(7,"i18n"),y.k0s()(),y.j41(8,"div",2)(9,"h3",3),y.EFF(10),y.nI1(11,"i18n"),y.k0s(),y.j41(12,"bit-form-control"),y.nrm(13,"input",4),y.j41(14,"bit-label"),y.EFF(15),y.nI1(16,"i18n"),y.k0s()(),y.j41(17,"bit-form-control"),y.nrm(18,"input",5),y.j41(19,"bit-label"),y.EFF(20),y.nI1(21,"i18n"),y.k0s()()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,9,"sendControlsExemption"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(7,11,"turnOn")),y.R7$(2),y.Y8G("formGroup",t.data),y.R7$(2),y.JRh(y.bMT(11,13,"options")),y.R7$(3),y.Y8G("disabled",!t.enabled.value),y.R7$(2),y.JRh(y.bMT(16,15,"disableSend")),y.R7$(3),y.Y8G("disabled",!t.enabled.value),y.R7$(2),y.JRh(y.bMT(21,17,"disableHideEmail")))},dependencies:[f.G,F.Zm,F.BC,F.cb,F.l_,F.j4,F.JD,Be.G,Ee.P,Se.f,Qe.j,j.r,N.$],encapsulation:2,changeDetection:0});class Pe extends be{}Pe.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(Pe)))(t||Pe)}})(),Pe.ɵcmp=y.VBU({type:Pe,selectors:[["autotype-policy-edit"]],features:[y.Vt3],decls:5,vars:4,consts:[["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-form-control"),y.nrm(1,"input",0),y.j41(2,"bit-label"),y.EFF(3),y.nI1(4,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(4,2,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});var Re=i(78781),De=i(97553),Me=i(43759),xe=i(33886),Oe=i(68923),Ge=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ue(e,t){1&e&&(y.j41(0,"bit-callout",14),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,1,"keyConnectorPolicyRestriction"),"\n"))}function Ve(e,t){if(1&e&&y.nrm(0,"bit-option",15),2&e){const e=t.$implicit;y.Y8G("value",e.value)("label",e.name)}}class je extends be{constructor(e,t,i,n){super(),this.formBuilder=e,this.organizationService=i,this.accountService=n,this.MinPasswordLength=Re.A.minimumPasswordLength,this.MaxPasswordLength=Re.A.maximumPasswordLength,this.data=this.formBuilder.group({minComplexity:[null],minLength:[this.MinPasswordLength,[F.k0.min(Re.A.minimumPasswordLength),F.k0.max(this.MaxPasswordLength)]],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 Ge(this,void 0,void 0,function*(){e.ngOnInit.call(this);const t=yield(0,w._)((0,u.F6)(this.accountService.activeAccount$)),i=yield(0,w._)(this.organizationService.organizations$(t).pipe((0,d.Sw)(this.policyResponse.organizationId)));this.showKeyConnectorInfo=i.keyConnectorEnabled})}}je.ɵfac=function(e){return new(e||je)(y.rXU(F.ok),y.rXU(T.W),y.rXU(d.PV),y.rXU(Q.D))},je.ɵcmp=y.VBU({type:je,selectors:[["master-password-policy-edit"]],features:[y.Vt3],decls:40,vars:18,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","max"],[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&&(y.DNE(0,Ue,3,3,"bit-callout",0),y.j41(1,"div",1)(2,"bit-form-control"),y.nrm(3,"input",2),y.j41(4,"bit-label"),y.EFF(5),y.nI1(6,"i18n"),y.k0s()(),y.j41(7,"bit-form-control"),y.nrm(8,"input",3),y.j41(9,"bit-label"),y.EFF(10),y.nI1(11,"i18n"),y.k0s()(),y.j41(12,"div",4)(13,"bit-form-field",5)(14,"bit-label"),y.EFF(15),y.nI1(16,"i18n"),y.k0s(),y.j41(17,"bit-select",6),y.DNE(18,Ve,1,2,"bit-option",7),y.k0s()(),y.j41(19,"bit-form-field",5)(20,"bit-label"),y.EFF(21),y.nI1(22,"i18n"),y.k0s(),y.nrm(23,"input",8),y.k0s()(),y.j41(24,"bit-form-control",9),y.nrm(25,"input",10),y.j41(26,"bit-label"),y.EFF(27,"A-Z"),y.k0s()(),y.j41(28,"bit-form-control",9),y.nrm(29,"input",11),y.j41(30,"bit-label"),y.EFF(31,"a-z"),y.k0s()(),y.j41(32,"bit-form-control",9),y.nrm(33,"input",12),y.j41(34,"bit-label"),y.EFF(35,"0-9"),y.k0s()(),y.j41(36,"bit-form-control"),y.nrm(37,"input",13),y.j41(38,"bit-label"),y.EFF(39,"!@#$%^&*"),y.k0s()()()),2&e&&(y.Y8G("ngIf",t.showKeyConnectorInfo),y.R7$(),y.Y8G("formGroup",t.data),y.R7$(2),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(6,10,"turnOn")),y.R7$(5),y.JRh(y.bMT(11,12,"enforceOnLoginDesc")),y.R7$(5),y.JRh(y.bMT(16,14,"minComplexityScore")),y.R7$(3),y.Y8G("ngForOf",t.passwordScores),y.R7$(3),y.JRh(y.bMT(22,16,"minLength")),y.R7$(2),y.Y8G("min",t.MinPasswordLength)("max",t.MaxPasswordLength))},dependencies:[f.G,D.Sq,D.bT,F.me,F.Q0,F.Zm,F.BC,F.cb,F.VZ,F.zX,F.l_,F.j4,F.JD,Be.G,Ee.P,Se.f,Qe.j,De.J,Me.h,xe.w,Oe.P,N.$],encapsulation:2,changeDetection:0});var Ne=i(88565),ze=i(89105),Ye=i(57178),Le=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ke=["dialog"];function Xe(e,t){1&e&&(y.j41(0,"bit-simple-dialog",3)(1,"span",4),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.qex(4,5),y.j41(5,"div",6),y.EFF(6),y.nI1(7,"i18n"),y.j41(8,"div",7)(9,"ul",8)(10,"li"),y.EFF(11),y.nI1(12,"i18n"),y.k0s(),y.j41(13,"li"),y.EFF(14),y.nI1(15,"i18n"),y.k0s(),y.j41(16,"li"),y.EFF(17),y.nI1(18,"i18n"),y.k0s()()(),y.EFF(19),y.nI1(20,"i18n"),y.j41(21,"a",1),y.EFF(22),y.nI1(23,"i18n"),y.k0s()(),y.bVm(),y.qex(24,9),y.j41(25,"span",10)(26,"button",11),y.EFF(27),y.nI1(28,"i18n"),y.k0s(),y.j41(29,"button",12),y.EFF(30),y.nI1(31,"i18n"),y.k0s()(),y.bVm(),y.k0s()),2&e&&(y.R7$(2),y.JRh(y.bMT(3,11,"organizationDataOwnershipWarningTitle")),y.R7$(4),y.SpI(" ",y.bMT(7,13,"organizationDataOwnershipWarningContentTop")," "),y.R7$(5),y.SpI(" ",y.bMT(12,15,"organizationDataOwnershipWarning1")," "),y.R7$(3),y.SpI(" ",y.bMT(15,17,"organizationDataOwnershipWarning2")," "),y.R7$(3),y.SpI(" ",y.bMT(18,19,"organizationDataOwnershipWarning3")," "),y.R7$(2),y.SpI(" ",y.bMT(20,21,"organizationDataOwnershipWarningContentBottom")," "),y.R7$(3),y.SpI(" ",y.bMT(23,23,"organizationDataOwnershipContentAnchor"),". "),y.R7$(4),y.Y8G("bitDialogClose",!0),y.R7$(),y.SpI(" ",y.bMT(28,25,"continue")," "),y.R7$(2),y.Y8G("bitDialogClose",!1),y.R7$(),y.SpI(" ",y.bMT(31,27,"cancel")," "))}class qe extends be{constructor(e,t,i){super(),this.dialogService=e,this.i18nService=t,this.encryptService=i}confirm(){return Le(this,void 0,void 0,function*(){var e;if((null===(e=this.policyResponse)||void 0===e?void 0:e.enabled)&&!this.enabled.value){const e=this.dialogService.open(this.warningContent,{positionStrategy:new P.u3}),t=yield(0,Ne.s)(e.closed);return Boolean(t)}return!0})}buildVNextRequest(e){return Le(this,void 0,void 0,function*(){var t;if(!this.policy)throw new Error("Policy was not found");const i=yield this.getEncryptedDefaultUserCollectionName(e);return{policy:{enabled:null!==(t=this.enabled.value)&&void 0!==t&&t,data:this.buildRequestData()},metadata:{defaultUserCollectionName:i}}})}getEncryptedDefaultUserCollectionName(e){return Le(this,void 0,void 0,function*(){const t=this.i18nService.t("myItems"),i=yield this.encryptService.encryptString(t,e);if(!i.encryptedString)throw new Error("Encryption error");return i.encryptedString})}}qe.ɵfac=function(e){return new(e||qe)(y.rXU(P.o3),y.rXU(T.W),y.rXU(ze.N))},qe.ɵcmp=y.VBU({type:qe,selectors:[["organization-data-ownership-policy-edit"]],viewQuery:function(e,t){if(1&e&&y.GBs(Ke,7),2&e){let e;y.mGM(e=y.lsd())&&(t.warningContent=e.first)}},features:[y.Vt3],decls:13,vars:10,consts:[["dialog",""],["bitLink","","href","https://bitwarden.com/resources/credential-lifecycle-management/","target","_blank"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-text-left","tw-overflow-hidden"],[1,"tw-flex","tw-flex-col","tw-p-2"],[1,"tw-list-disc","tw-pl-5","tw-space-y-2","tw-break-words","tw-mb-0"],["bitDialogFooter",""],[1,"tw-flex","tw-gap-2"],["bitButton","","buttonType","primary","type","submit",3,"bitDialogClose"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){1&e&&(y.j41(0,"p"),y.EFF(1),y.nI1(2,"i18n"),y.j41(3,"a",1),y.EFF(4),y.nI1(5,"i18n"),y.k0s()(),y.j41(6,"bit-form-control"),y.nrm(7,"input",2),y.j41(8,"bit-label"),y.EFF(9),y.nI1(10,"i18n"),y.k0s()(),y.DNE(11,Xe,32,29,"ng-template",null,0,y.C5r)),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,4,"organizationDataOwnershipDescContent")," "),y.R7$(3),y.SpI(" ",y.bMT(5,6,"organizationDataOwnershipContentAnchor"),". "),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(10,8,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,O.Q,Ee.P,G.I,V.hJ,V.o_,Se.f,Qe.j,Ye.g,N.$],encapsulation:2,changeDetection:0});var He=i(16878),We=i(73638);function $e(e,t){if(1&e&&y.nrm(0,"bit-option",7),2&e){const e=t.$implicit;y.Y8G("value",e.value)("label",e.name)}}function Je(e,t){if(1&e&&(y.j41(0,"div")(1,"h3",8),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"div",2)(5,"bit-form-field",9)(6,"bit-label"),y.EFF(7),y.nI1(8,"i18n"),y.k0s(),y.nrm(9,"input",10),y.k0s()(),y.j41(10,"div",2)(11,"bit-form-field",9)(12,"bit-label"),y.EFF(13),y.nI1(14,"i18n"),y.k0s(),y.nrm(15,"input",11),y.k0s(),y.j41(16,"bit-form-field",9)(17,"bit-label"),y.EFF(18),y.nI1(19,"i18n"),y.k0s(),y.nrm(20,"input",12),y.k0s()(),y.j41(21,"bit-form-control"),y.nrm(22,"input",13),y.j41(23,"bit-label"),y.EFF(24),y.nI1(25,"i18n"),y.k0s()(),y.j41(26,"bit-form-control"),y.nrm(27,"input",14),y.j41(28,"bit-label"),y.EFF(29),y.nI1(30,"i18n"),y.k0s()(),y.j41(31,"bit-form-control"),y.nrm(32,"input",15),y.j41(33,"bit-label"),y.EFF(34),y.nI1(35,"i18n"),y.k0s()(),y.j41(36,"bit-form-control"),y.nrm(37,"input",16),y.j41(38,"bit-label"),y.EFF(39),y.k0s()()()),2&e){const e=y.XpG();y.R7$(2),y.JRh(y.bMT(3,14,"password")),y.R7$(5),y.JRh(y.bMT(8,16,"minLength")),y.R7$(2),y.Y8G("min",e.minLengthMin)("max",e.minLengthMax),y.R7$(4),y.JRh(y.bMT(14,18,"minNumbers")),y.R7$(2),y.Y8G("min",e.minNumbersMin)("max",e.minNumbersMax),y.R7$(3),y.JRh(y.bMT(19,20,"minSpecial")),y.R7$(2),y.Y8G("min",e.minSpecialMin)("max",e.minSpecialMax),y.R7$(4),y.JRh(y.bMT(25,22,"uppercaseLabel")),y.R7$(5),y.JRh(y.bMT(30,24,"lowercaseLabel")),y.R7$(5),y.JRh(y.bMT(35,26,"numbersLabel")),y.R7$(5),y.JRh("!@#$%^&*")}}function Ze(e,t){if(1&e&&(y.j41(0,"div")(1,"h3",8),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"div",2)(5,"bit-form-field",9)(6,"bit-label"),y.EFF(7),y.nI1(8,"i18n"),y.k0s(),y.nrm(9,"input",17),y.k0s()(),y.j41(10,"bit-form-control"),y.nrm(11,"input",18),y.j41(12,"bit-label"),y.EFF(13),y.nI1(14,"i18n"),y.k0s()(),y.j41(15,"bit-form-control"),y.nrm(16,"input",19),y.j41(17,"bit-label"),y.EFF(18),y.nI1(19,"i18n"),y.k0s()()()),2&e){const e=y.XpG();y.R7$(2),y.JRh(y.bMT(3,6,"passphrase")),y.R7$(5),y.JRh(y.bMT(8,8,"minimumNumberOfWords")),y.R7$(2),y.Y8G("min",e.minNumberWordsMin)("max",e.minNumberWordsMax),y.R7$(4),y.JRh(y.bMT(14,10,"capitalize")),y.R7$(5),y.JRh(y.bMT(19,12,"includeNumber"))}}class _e extends be{get showPasswordPolicies$(){return this.showPasswordPolicies.asObservable()}get showPassphrasePolicies$(){return this.showPassphrasePolicies.asObservable()}constructor(e,t){super(),this.formBuilder=e,this.minLengthMin=We.qG.password.profiles[We.WV.account].constraints.default.length.min,this.minLengthMax=We.qG.password.profiles[We.WV.account].constraints.default.length.max,this.minNumbersMin=We.qG.password.profiles[We.WV.account].constraints.default.minNumber.min,this.minNumbersMax=We.qG.password.profiles[We.WV.account].constraints.default.minNumber.max,this.minSpecialMin=We.qG.password.profiles[We.WV.account].constraints.default.minSpecial.min,this.minSpecialMax=We.qG.password.profiles[We.WV.account].constraints.default.minSpecial.max,this.minNumberWordsMin=We.qG.passphrase.profiles[We.WV.account].constraints.default.numWords.min,this.minNumberWordsMax=We.qG.passphrase.profiles[We.WV.account].constraints.default.numWords.max,this.data=this.formBuilder.group({overridePasswordType:[null],minLength:[null,[F.k0.min(this.minLengthMin),F.k0.max(this.minLengthMax)]],useUpper:[null],useLower:[null],useNumbers:[null],useSpecial:[null],minNumbers:[null,[F.k0.min(this.minNumbersMin),F.k0.max(this.minNumbersMax)]],minSpecial:[null,[F.k0.min(this.minSpecialMin),F.k0.max(this.minSpecialMax)]],minNumberWords:[null,[F.k0.min(this.minNumberWordsMin),F.k0.max(this.minNumberWordsMax)]],capitalize:[null],includeNumber:[null]}),this.showPasswordPolicies=new He.t(!0),this.showPassphrasePolicies=new He.t(!0),this.overridePasswordTypeOptions=[{name:t.t("userPreference"),value:null},{name:t.t("password"),value:et},{name:t.t("passphrase"),value:"passphrase"}],this.data.valueChanges.pipe(it(et),(0,n.pQ)()).subscribe(this.showPasswordPolicies),this.data.valueChanges.pipe(it(tt),(0,n.pQ)()).subscribe(this.showPassphrasePolicies)}}_e.ɵfac=function(e){return new(e||_e)(y.rXU(F.ze),y.rXU(T.W))},_e.ɵcmp=y.VBU({type:_e,selectors:[["password-generator-policy-edit"]],features:[y.Vt3],decls:17,vars:15,consts:[[3,"formGroup"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6","tw-mb-0"],["formControlName","overridePasswordType","id","overrideType"],[3,"value","label",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"value","label"],["bitTypography","h3",1,"tw-mt-4"],[1,"tw-col-span-6"],["bitInput","","type","number","formControlName","minLength",3,"min","max"],["bitInput","","type","number","formControlName","minNumbers",3,"min","max"],["bitInput","","type","number","formControlName","minSpecial",3,"min","max"],["type","checkbox","bitCheckbox","","formControlName","useUpper","id","useUpper"],["type","checkbox","bitCheckbox","","formControlName","useLower","id","useLower"],["type","checkbox","bitCheckbox","","formControlName","useNumbers","id","useNumbers"],["type","checkbox","bitCheckbox","","formControlName","useSpecial","id","useSpecial"],["bitInput","","type","number","formControlName","minNumberWords",3,"min","max"],["type","checkbox","bitCheckbox","","formControlName","capitalize","id","capitalize"],["type","checkbox","bitCheckbox","","formControlName","includeNumber","id","includeNumber"]],template:function(e,t){1&e&&(y.j41(0,"div",0)(1,"bit-form-control"),y.nrm(2,"input",1),y.j41(3,"bit-label"),y.EFF(4),y.nI1(5,"i18n"),y.k0s()(),y.j41(6,"div",2)(7,"bit-form-field",3)(8,"bit-label"),y.EFF(9),y.nI1(10,"i18n"),y.k0s(),y.j41(11,"bit-select",4),y.DNE(12,$e,1,2,"bit-option",5),y.k0s()()(),y.DNE(13,Je,40,28,"div",6),y.nI1(14,"async"),y.DNE(15,Ze,20,14,"div",6),y.nI1(16,"async"),y.k0s()),2&e&&(y.Y8G("formGroup",t.data),y.R7$(2),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(5,7,"turnOn")),y.R7$(5),y.JRh(y.bMT(10,9,"overridePasswordTypePolicy")),y.R7$(3),y.Y8G("ngForOf",t.overridePasswordTypeOptions),y.R7$(),y.Y8G("ngIf",y.bMT(14,11,t.showPasswordPolicies$)),y.R7$(2),y.Y8G("ngIf",y.bMT(16,13,t.showPassphrasePolicies$)))},dependencies:[f.G,D.Sq,D.bT,F.me,F.Q0,F.Zm,F.BC,F.cb,F.VZ,F.zX,F.l_,F.j4,F.JD,Ee.P,Se.f,Qe.j,De.J,Me.h,xe.w,Oe.P,j.r,D.Jj,N.$],encapsulation:2,changeDetection:0});const et="password",tt="passphrase";function it(e){return(0,o.T)(t=>{var i;return(null!==(i=null==t?void 0:t.overridePasswordType)&&void 0!==i?i:e)===e})}class nt extends be{}nt.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(nt)))(t||nt)}})(),nt.ɵcmp=y.VBU({type:nt,selectors:[["remove-unlock-with-pin-policy-edit"]],features:[y.Vt3],decls:5,vars:4,consts:[["type","checkbox","id","enabled","bitCheckbox","",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-form-control"),y.nrm(1,"input",0),y.j41(2,"bit-label"),y.EFF(3),y.nI1(4,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(4,2,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});class rt extends be{}rt.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(rt)))(t||rt)}})(),rt.ɵcmp=y.VBU({type:rt,selectors:[["require-sso-policy-edit"]],features:[y.Vt3],decls:12,vars:14,consts:[["type","info",3,"title"],["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.nI1(1,"i18n"),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"bit-callout",1),y.EFF(5),y.nI1(6,"i18n"),y.k0s(),y.j41(7,"bit-form-control"),y.nrm(8,"input",2),y.j41(9,"bit-label"),y.EFF(10),y.nI1(11,"i18n"),y.k0s()()),2&e&&(y.Y8G("title",y.mNQ(y.bMT(1,6,"prerequisite"))),y.R7$(2),y.SpI(" ",y.bMT(3,8,"requireSsoPolicyReq"),"\n"),y.R7$(3),y.SpI(" ",y.bMT(6,10,"requireSsoExemption"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(11,12,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Be.G,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});var st=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ot(e,t){1&e&&(y.j41(0,"bit-callout",7),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,1,"keyConnectorPolicyRestriction"),"\n"))}class at extends be{constructor(e,t,i){super(),this.formBuilder=e,this.organizationService=t,this.accountService=i,this.data=this.formBuilder.group({autoEnrollEnabled:!1}),this.showKeyConnectorInfo=!1}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return st(this,void 0,void 0,function*(){e.ngOnInit.call(this);const t=yield(0,w._)((0,u.F6)(this.accountService.activeAccount$));if(!t)throw new Error("No user found.");if(!this.policyResponse)throw new Error("Policies not found");const i=yield(0,w._)(this.organizationService.organizations$(t).pipe((0,d.Sw)(this.policyResponse.organizationId)));if(!i)throw new Error("No organization found.");this.showKeyConnectorInfo=i.keyConnectorEnabled})}}at.ɵfac=function(e){return new(e||at)(y.rXU(F.ok),y.rXU(d.PV),y.rXU(Q.D))},at.ɵcmp=y.VBU({type:at,selectors:[["reset-password-policy-edit"]],features:[y.Vt3],decls:19,vars:18,consts:[["type","info",4,"ngIf"],["type","info",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&&(y.DNE(0,ot,3,3,"bit-callout",0),y.j41(1,"bit-callout",1),y.nI1(2,"i18n"),y.EFF(3),y.nI1(4,"i18n"),y.k0s(),y.j41(5,"bit-callout",2),y.EFF(6),y.nI1(7,"i18n"),y.k0s(),y.j41(8,"bit-form-control",3),y.nrm(9,"input",4),y.j41(10,"bit-label"),y.EFF(11),y.nI1(12,"i18n"),y.k0s()(),y.qex(13,5),y.j41(14,"bit-form-control",3),y.nrm(15,"input",6),y.j41(16,"bit-label"),y.EFF(17),y.nI1(18,"i18n"),y.k0s()(),y.bVm()),2&e&&(y.Y8G("ngIf",t.showKeyConnectorInfo),y.R7$(),y.Y8G("title",y.bMT(2,8,"prerequisite")),y.R7$(2),y.SpI(" ",y.bMT(4,10,"accountRecoverySingleOrgRequirementDesc"),"\n"),y.R7$(3),y.SpI(" ",y.bMT(7,12,"accountRecoveryPolicyWarning"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(12,14,"turnOn")),y.R7$(2),y.Y8G("formGroup",t.data),y.R7$(4),y.JRh(y.bMT(18,16,"resetPasswordPolicyAutoEnrollCheckbox")))},dependencies:[f.G,D.bT,F.Zm,F.BC,F.cb,F.l_,F.j4,F.JD,Be.G,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});class lt extends be{constructor(){super()}}lt.ɵfac=function(e){return new(e||lt)},lt.ɵcmp=y.VBU({type:lt,selectors:[["restricted-item-types-policy-edit"]],features:[y.Vt3],decls:5,vars:4,consts:[["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-form-control"),y.nrm(1,"input",0),y.j41(2,"bit-label"),y.EFF(3),y.nI1(4,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(4,2,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});class ct extends be{constructor(e){super(),this.formBuilder=e,this.data=this.formBuilder.group({disableHideEmail:!1})}}ct.ɵfac=function(e){return new(e||ct)(y.rXU(F.ze))},ct.ɵcmp=y.VBU({type:ct,selectors:[["send-options-policy-edit"]],features:[y.Vt3],decls:17,vars:14,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],["bitTypography","h3",1,"tw-mt-4"],["type","checkbox","bitCheckbox","","formControlName","disableHideEmail","id","disableHideEmail"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"bit-form-control"),y.nrm(4,"input",1),y.j41(5,"bit-label"),y.EFF(6),y.nI1(7,"i18n"),y.k0s()(),y.j41(8,"div",2)(9,"h3",3),y.EFF(10),y.nI1(11,"i18n"),y.k0s(),y.j41(12,"bit-form-control"),y.nrm(13,"input",4),y.j41(14,"bit-label"),y.EFF(15),y.nI1(16,"i18n"),y.k0s()()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,6,"sendOptionsExemption"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(7,8,"turnOn")),y.R7$(2),y.Y8G("formGroup",t.data),y.R7$(2),y.JRh(y.bMT(11,10,"options")),y.R7$(5),y.JRh(y.bMT(16,12,"disableHideEmail")))},dependencies:[f.G,F.Zm,F.BC,F.cb,F.l_,F.j4,F.JD,Be.G,Ee.P,Se.f,Qe.j,j.r,N.$],encapsulation:2,changeDetection:0});var dt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ut extends be{ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return dt(this,void 0,void 0,function*(){if(e.ngOnInit.call(this),!this.policyResponse)throw new Error("Policies not found");this.policyResponse.canToggleState||this.enabled.disable()})}}ut.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(ut)))(t||ut)}})(),ut.ɵcmp=y.VBU({type:ut,selectors:[["single-org-policy-edit"]],features:[y.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"bit-form-control"),y.nrm(4,"input",1),y.j41(5,"bit-label"),y.EFF(6),y.nI1(7,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,3,"singleOrgPolicyMemberWarning"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(7,5,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Be.G,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});class ht extends be{}ht.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(ht)))(t||ht)}})(),ht.ɵcmp=y.VBU({type:ht,selectors:[["two-factor-authentication-policy-edit"]],features:[y.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","id","enabled","bitCheckbox","",3,"formControl"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"bit-form-control"),y.nrm(4,"input",1),y.j41(5,"bit-label"),y.EFF(6),y.nI1(7,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,3,"twoStepLoginPolicyWarning"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(7,5,"turnOn")))},dependencies:[f.G,F.Zm,F.BC,F.l_,Be.G,Ee.P,Se.f,Qe.j,N.$],encapsulation:2,changeDetection:0});var At=i(59777),pt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function gt(e,t){if(1&e&&y.nrm(0,"bit-option",6),2&e){const e=t.$implicit;y.Y8G("label",e.label)("value",e.value)("disabled",e.disabled)}}class vt extends be{constructor(e,t){super(),this.formBuilder=e,this.i18nService=t,this.data=this.formBuilder.group({uriMatchDetection:new F.MJ(At.L.Domain,{validators:[F.k0.required],nonNullable:!0})}),this.uriMatchOptions=[{label:t.t("baseDomain"),value:At.L.Domain},{label:t.t("host"),value:At.L.Host},{label:t.t("exact"),value:At.L.Exact},{label:t.t("never"),value:At.L.Never}]}loadData(){var e,t,i;const n=null===(t=null===(e=this.policyResponse)||void 0===e?void 0:e.data)||void 0===t?void 0:t.uriMatchDetection;null===(i=this.data)||void 0===i||i.patchValue({uriMatchDetection:n})}buildRequestData(){var e,t;return{uriMatchDetection:null===(t=null===(e=this.data)||void 0===e?void 0:e.value)||void 0===t?void 0:t.uriMatchDetection}}buildRequest(){const e=Object.create(null,{buildRequest:{get:()=>super.buildRequest}});return pt(this,void 0,void 0,function*(){var t;const i=yield e.buildRequest.call(this);if(null==(null===(t=i.data)||void 0===t?void 0:t.uriMatchDetection))throw new Error(this.i18nService.t("invalidUriMatchDefaultPolicySetting"));return i})}}vt.ɵfac=function(e){return new(e||vt)(y.rXU(F.ok),y.rXU(T.W))},vt.ɵcmp=y.VBU({type:vt,selectors:[["uri-match-default-policy-edit"]],features:[y.Vt3],decls:16,vars:16,consts:[[3,"title"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],[1,"tw-flex-auto"],["formControlName","uriMatchDetection","id","uriMatchDetection"],[3,"label","value","disabled",4,"ngFor","ngForOf"],[3,"label","value","disabled"]],template:function(e,t){1&e&&(y.j41(0,"bit-callout",0),y.nI1(1,"i18n"),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"bit-form-control"),y.nrm(5,"input",1),y.j41(6,"bit-label"),y.EFF(7),y.nI1(8,"i18n"),y.k0s()(),y.j41(9,"div",2)(10,"bit-form-field",3)(11,"bit-label"),y.EFF(12),y.nI1(13,"i18n"),y.k0s(),y.j41(14,"bit-select",4),y.DNE(15,gt,1,3,"bit-option",5),y.k0s()()()),2&e&&(y.Y8G("title",y.mNQ(y.bMT(1,8,"prerequisite"))),y.R7$(2),y.SpI(" ",y.bMT(3,10,"requireSsoPolicyReq"),"\n"),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(8,12,"turnOn")),y.R7$(2),y.Y8G("formGroup",t.data),y.R7$(3),y.JRh(y.bMT(13,14,"uriMatchDetectionOptionsLabel")),y.R7$(3),y.Y8G("ngForOf",t.uriMatchOptions))},dependencies:[f.G,D.Sq,F.Zm,F.BC,F.cb,F.l_,F.j4,F.JD,Be.G,Ee.P,Se.f,Qe.j,Me.h,xe.w,Oe.P,N.$],encapsulation:2,changeDetection:0});var ft=i(12610),mt=i(36359),yt=i(52892);const Ct=i(82392).JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 197 232"><g filter="url(#a)"><path class="tw-fill-background-alt" d="M8 11a8 8 0 0 1 8-8h166a8 8 0 0 1 8 8v16.673H8z"/><path class="tw-fill-background" d="M8 26.686h182V229H8z"/><path class="tw-fill-illustration-logo" d="M153.366 8.3a2.31 2.31 0 0 1 2.31-2.31h11.687a2.31 2.31 0 0 1 2.309 2.31v11.472a2.31 2.31 0 0 1-2.31 2.31h-11.686a2.31 2.31 0 0 1-2.31-2.31z"/><g clip-path="url(#b)"><path class="tw-fill-background" d="M166.143 8.46a.46.46 0 0 0-.334-.143h-8.579a.46.46 0 0 0-.334.143.45.45 0 0 0-.143.335v5.718c.002.436.086.867.249 1.27q.232.602.618 1.118.395.516.879.95.448.411.941.767.429.304.901.577.471.272.666.368.197.097.315.149.094.045.198.043a.4.4 0 0 0 .193-.045q.12-.053.317-.149c.132-.064.357-.187.666-.368s.613-.374.901-.577q.494-.356.943-.767.484-.434.878-.95c.256-.343.464-.719.619-1.117.163-.404.247-.835.248-1.27v-5.72a.45.45 0 0 0-.142-.332m-1.106 6.106c0 2.073-3.517 3.853-3.517 3.853V9.542h3.517z"/></g><path class="tw-fill-secondary-500" d="M178.484 10.454c0 .577.474 1.044 1.059 1.044s1.059-.467 1.059-1.044-.474-1.045-1.059-1.045-1.059.468-1.059 1.045M179.543 14.633a1.05 1.05 0 0 1-1.059-1.045c0-.577.474-1.045 1.059-1.045s1.059.468 1.059 1.045-.474 1.045-1.059 1.045M179.543 17.767a1.05 1.05 0 0 1-1.059-1.045c0-.577.474-1.045 1.059-1.045s1.059.468 1.059 1.045-.474 1.045-1.059 1.045"/></g><g clip-path="url(#c)"><rect width="154" height="205" x="16" y="24" class="tw-fill-background-alt" rx="4.918"/><path class="tw-fill-background" d="M16 24h155v27.419H16z"/><path class="tw-fill-text-main" d="m24.595 40.71-2.107-5.739h1.057l1.648 4.73 1.664-4.73h1.041l-2.107 5.738zm4.891.098q-.492 0-.828-.18a1.2 1.2 0 0 1-.492-.484 1.4 1.4 0 0 1-.155-.656q0-.394.196-.689a1.33 1.33 0 0 1 .59-.459q.395-.164.951-.164h1.025q0-.36-.074-.598a.62.62 0 0 0-.254-.353q-.18-.123-.516-.123-.32 0-.533.148a.64.64 0 0 0-.262.418h-.968q.05-.426.279-.73a1.5 1.5 0 0 1 .623-.475q.386-.165.86-.164.6 0 1 .205.41.197.616.566.213.368.213.901v2.738h-.845l-.098-.664a1.3 1.3 0 0 1-.213.303 1.4 1.4 0 0 1-.287.246q-.165.099-.377.156a1.7 1.7 0 0 1-.45.058m.213-.78q.222 0 .402-.09a.9.9 0 0 0 .32-.253q.14-.164.22-.378.083-.213.1-.45v-.05h-.886q-.279 0-.46.082-.18.074-.27.213a.6.6 0 0 0-.082.312q0 .197.082.336a.56.56 0 0 0 .23.205.76.76 0 0 0 .344.074m4.787.78q-.491 0-.844-.18a1.3 1.3 0 0 1-.549-.558q-.189-.378-.189-.926v-2.747h.984v2.615q0 .493.238.73.246.237.672.238.27 0 .492-.115a.9.9 0 0 0 .352-.36 1.15 1.15 0 0 0 .14-.591v-2.517h.983v4.312h-.868l-.074-.656q-.165.352-.508.558-.345.197-.828.197m3.43-.099v-5.902h.983v5.902zm3.966 0a1.9 1.9 0 0 1-.73-.13 1 1 0 0 1-.476-.435q-.163-.304-.163-.82v-2.107h-.746v-.82h.746l.114-1.164h.87v1.164h1.139v.82h-1.14v2.107q0 .311.131.434.131.115.46.115h.565v.836z"/><path class="tw-fill-secondary-300" d="M102.538 37.71a7.38 7.38 0 0 1 7.378-7.378h27.871a7.378 7.378 0 0 1 0 14.755h-27.871a7.38 7.38 0 0 1-7.378-7.378"/><path class="tw-fill-secondary-100" d="M149.913 37.71a7.378 7.378 0 1 1 14.755 0 7.378 7.378 0 0 1-14.755 0"/><g clip-path="url(#d)"><path class="tw-fill-background" d="M21.874 64.308a6.56 6.56 0 0 1 6.558-6.558h130.137a6.56 6.56 0 0 1 6.558 6.558v1.23a6.56 6.56 0 0 1-6.558 6.558H28.432a6.56 6.56 0 0 1-6.558-6.558z"/></g><path class="tw-fill-secondary-100" d="M22.332 84.759a3.166 3.166 0 0 1 3.166-3.166H68.78a3.166 3.166 0 0 1 0 6.332H25.498a3.166 3.166 0 0 1-3.166-3.166M22.332 97.422a6.33 6.33 0 0 1 6.332-6.331h129.673a6.33 6.33 0 0 1 6.332 6.331v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332zM22.332 122.749a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332zM22.332 148.075a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332z"/><path class="tw-fill-secondary-100" d="M41.477 101.706a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 0 0 0 15.454h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 106.13a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.993 1.993 0 0 0 1.994-1.994M86.31 98.591a3.303 3.303 0 0 0-3.303-3.303h-35.06a3.303 3.303 0 1 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.304M161.816 101.706a5.84 5.84 0 0 0-5.84-5.84h-29.987a5.84 5.84 0 0 0 0 11.681h29.987a5.84 5.84 0 0 0 5.84-5.841M41.477 127.032a7.726 7.726 0 0 0-7.727-7.726h-.337a7.726 7.726 0 1 0 0 15.453h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 131.457a1.993 1.993 0 0 0-1.994-1.994H46.637a1.993 1.993 0 1 0 0 3.987H93.98a1.993 1.993 0 0 0 1.994-1.993M86.31 123.918a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 127.032a5.84 5.84 0 0 0-5.84-5.84h-29.987a5.84 5.84 0 0 0 0 11.681h29.987a5.84 5.84 0 0 0 5.84-5.841M41.477 152.359a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 0 0 0 15.454h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 156.783a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.994 1.994 0 0 0 1.994-1.994M86.31 149.244a3.303 3.303 0 0 0-3.303-3.303h-35.06a3.303 3.303 0 1 0 0 6.606h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 152.359a5.84 5.84 0 0 0-5.84-5.841h-29.987a5.84 5.84 0 0 0 0 11.682h29.987a5.84 5.84 0 0 0 5.84-5.841M22.332 176.567a3.166 3.166 0 0 1 3.166-3.166H68.78a3.166 3.166 0 0 1 0 6.332H25.498a3.166 3.166 0 0 1-3.166-3.166M22.332 189.23a6.33 6.33 0 0 1 6.332-6.331h129.673a6.33 6.33 0 0 1 6.332 6.331v9.498a6.33 6.33 0 0 1-6.332 6.331H28.664a6.33 6.33 0 0 1-6.332-6.331z"/><path class="tw-fill-secondary-100" d="M41.477 193.514a7.726 7.726 0 0 0-7.727-7.726h-.337a7.726 7.726 0 1 0 0 15.453h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 197.938a1.993 1.993 0 0 0-1.994-1.993H46.637a1.993 1.993 0 1 0 0 3.987H93.98a1.993 1.993 0 0 0 1.994-1.994M86.31 190.4a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 193.514a5.84 5.84 0 0 0-5.84-5.841h-9.038a5.842 5.842 0 0 0 0 11.682h9.038a5.84 5.84 0 0 0 5.84-5.841M22.332 214.557a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332z"/><path class="tw-fill-secondary-100" d="M41.477 220.424a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 1 0 0 15.453h.337a7.726 7.726 0 0 0 7.727-7.726M95.974 224.848a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.994 1.994 0 0 0 1.994-1.994M86.31 217.309a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 220.423a5.84 5.84 0 0 0-5.84-5.84h-9.038a5.84 5.84 0 1 0 0 11.681h9.038a5.84 5.84 0 0 0 5.84-5.841"/></g><g clip-path="url(#e)"><rect width="154" height="205" x="16" y="24" class="tw-fill-primary-700" fill-opacity=".1" rx="4.918"/><g filter="url(#f)"><g clip-path="url(#g)"><path class="tw-fill-background" d="M20.84 73.484c0-5.577 4.521-10.098 10.098-10.098h124.125c5.577 0 10.098 4.521 10.098 10.098v106.032c0 5.577-4.521 10.098-10.098 10.098H30.938c-5.577 0-10.098-4.521-10.098-10.098z"/><path class="tw-fill-primary-100" d="M36.121 75.434h30.366a5.078 5.078 0 1 1 0 10.155H36.121a5.078 5.078 0 0 1 0-10.156"/><path class="tw-stroke-primary-700" stroke-width=".21" d="M36.121 75.434h30.366a5.078 5.078 0 1 1 0 10.155H36.121a5.078 5.078 0 0 1 0-10.156Z"/><path class="tw-fill-primary-700" d="m36.214 78.64-1.161 3.371h-.703l1.464-3.889h.448zm.973 3.371-1.165-3.37-.05-.519h.45l1.47 3.889zm-.057-1.442v.531h-2.115v-.531zm1.94.932.707-2.38h.668l-1.004 2.89h-.417zm-.543-2.38.721 2.39.035.5h-.416l-1.01-2.89zm3.902 2.31v-1.378a.6.6 0 0 0-.056-.267.4.4 0 0 0-.17-.173.6.6 0 0 0-.284-.062.64.64 0 0 0-.272.054.44.44 0 0 0-.18.144.35.35 0 0 0-.063.205h-.641q0-.17.083-.33a.9.9 0 0 1 .24-.286 1.2 1.2 0 0 1 .377-.198q.22-.072.491-.072.326 0 .577.11.254.109.398.33.147.22.147.55v1.285q0 .198.026.355.03.156.083.27v.043h-.66a1.2 1.2 0 0 1-.072-.264 2 2 0 0 1-.024-.316m.094-1.177.005.397h-.462q-.18 0-.315.035a.7.7 0 0 0-.227.096.42.42 0 0 0-.182.361q0 .114.054.211a.38.38 0 0 0 .155.147q.105.053.25.053a.7.7 0 0 0 .58-.28.44.44 0 0 0 .091-.227l.209.286a1 1 0 0 1-.11.235 1.1 1.1 0 0 1-.203.24 1 1 0 0 1-.692.256q-.283 0-.505-.112a.9.9 0 0 1-.347-.307.8.8 0 0 1-.125-.44.9.9 0 0 1 .085-.407.8.8 0 0 1 .257-.299q.17-.12.416-.181.246-.064.561-.064zm1.915-1.133v2.89h-.647v-2.89zm-.69-.758a.33.33 0 0 1 .097-.243.37.37 0 0 1 .272-.1q.171 0 .27.1a.33.33 0 0 1 .099.243.32.32 0 0 1-.099.24.37.37 0 0 1-.27.096.37.37 0 0 1-.272-.096.33.33 0 0 1-.096-.24m2.084-.454v4.102h-.646v-4.102zm2.334 3.522v-1.378a.6.6 0 0 0-.056-.267.4.4 0 0 0-.17-.173.6.6 0 0 0-.284-.062.64.64 0 0 0-.272.054.44.44 0 0 0-.18.144.35.35 0 0 0-.063.205H46.5q0-.17.083-.33a.9.9 0 0 1 .24-.286q.157-.126.377-.198.219-.072.491-.072.326 0 .577.11.254.109.398.33.147.22.147.55v1.285q0 .198.026.355.03.156.083.27v.043h-.66a1.2 1.2 0 0 1-.072-.264 2 2 0 0 1-.024-.316m.094-1.177.005.397h-.462q-.18 0-.315.035a.7.7 0 0 0-.227.096.42.42 0 0 0-.182.361q0 .114.054.211a.38.38 0 0 0 .155.147q.105.053.25.053a.7.7 0 0 0 .58-.28.44.44 0 0 0 .091-.227l.208.286a1 1 0 0 1-.11.235q-.075.125-.202.24a1 1 0 0 1-.692.256q-.282 0-.505-.112a.9.9 0 0 1-.347-.307.8.8 0 0 1-.125-.44.9.9 0 0 1 .085-.407.8.8 0 0 1 .257-.299q.17-.12.416-.181.246-.064.561-.064zm1.228-2.345h.644v3.485l-.061.617h-.583zm2.53 2.63v.056q0 .32-.072.59a1.4 1.4 0 0 1-.214.465 1 1 0 0 1-.353.308q-.209.105-.483.106-.27 0-.47-.101a.94.94 0 0 1-.337-.288 1.6 1.6 0 0 1-.216-.447 3 3 0 0 1-.117-.571v-.18q.034-.315.117-.57a1.6 1.6 0 0 1 .216-.447.93.93 0 0 1 .334-.29q.201-.103.468-.102.278 0 .488.106a.96.96 0 0 1 .356.305q.141.195.21.465.073.27.073.595m-.644.056v-.056q0-.195-.032-.366a1 1 0 0 0-.107-.304.54.54 0 0 0-.197-.206.57.57 0 0 0-.308-.077.7.7 0 0 0-.293.059.6.6 0 0 0-.206.16.8.8 0 0 0-.13.235q-.047.134-.062.288v.484q.024.2.101.368.08.166.224.267.145.1.372.1.179 0 .302-.073a.53.53 0 0 0 .195-.2 1 1 0 0 0 .106-.305q.035-.173.035-.374m1.878-2.686v4.102h-.647v-4.102zm1.979 4.155a1.5 1.5 0 0 1-.58-.104 1.3 1.3 0 0 1-.438-.296 1.3 1.3 0 0 1-.275-.446 1.6 1.6 0 0 1-.096-.553v-.107q0-.338.099-.614t.275-.47q.176-.198.416-.302.24-.105.521-.104.31 0 .543.104.232.104.384.294.155.186.23.446.077.258.077.571v.275h-2.233v-.462h1.598v-.05a.9.9 0 0 0-.07-.326.55.55 0 0 0-.19-.246.57.57 0 0 0-.341-.094.566.566 0 0 0-.491.264 1 1 0 0 0-.129.31 1.7 1.7 0 0 0-.043.404v.107q0 .19.051.352.054.16.155.28t.246.19a.8.8 0 0 0 .328.067.89.89 0 0 0 .73-.358l.339.329a1.215 1.215 0 0 1-.609.462 1.5 1.5 0 0 1-.497.077m3.659-2.326v2.273h-.644v-2.89h.606zm-.115.721-.208-.002a1.9 1.9 0 0 1 .085-.564 1.4 1.4 0 0 1 .235-.44q.153-.186.363-.284a1.1 1.1 0 0 1 .47-.101q.21 0 .377.058a.7.7 0 0 1 .291.185.8.8 0 0 1 .187.334q.064.202.064.5v1.866h-.646v-1.87a.7.7 0 0 0-.062-.328.34.34 0 0 0-.173-.174.65.65 0 0 0-.28-.053.62.62 0 0 0-.519.259.9.9 0 0 0-.136.278 1.2 1.2 0 0 0-.048.336m2.398.14v-.062q0-.313.091-.58.09-.27.262-.467.173-.2.422-.31.25-.112.566-.112.318 0 .566.112.252.11.425.31.174.198.264.467.091.267.091.58v.061q0 .313-.09.58-.092.267-.265.467a1.2 1.2 0 0 1-.422.31q-.248.11-.563.11a1.4 1.4 0 0 1-.57-.11 1.2 1.2 0 0 1-.421-.31 1.4 1.4 0 0 1-.265-.467 1.8 1.8 0 0 1-.09-.58m.644-.062v.061q0 .195.04.369a1 1 0 0 0 .126.304.6.6 0 0 0 .219.206.64.64 0 0 0 .318.075.61.61 0 0 0 .528-.28 1 1 0 0 0 .126-.305q.042-.174.043-.369v-.061q0-.193-.043-.364a1 1 0 0 0-.128-.307.61.61 0 0 0-.532-.285.6.6 0 0 0-.315.077.6.6 0 0 0-.216.208 1 1 0 0 0-.126.307 1.6 1.6 0 0 0-.04.364m3.368.833.668-2.249h.411l-.112.673-.673 2.217h-.369zm-.393-2.249.521 2.26.043.63h-.411l-.783-2.89zm2.097 2.233.505-2.233h.627l-.78 2.89h-.41zm-.555-2.233.66 2.222.082.668h-.369l-.68-2.22-.113-.67z"/><path class="tw-fill-text-main" d="m33.889 92.986-1.706 5.074h-1.195l2.235-5.983h.764zm1.426 5.074L33.6 92.986l-.103-.909h.769l2.247 5.983zm-.078-2.223v.892h-3.21v-.892zm4.408 1.167v-3.39h1.093v4.446h-1.027zm.14-.92.337-.008q0 .447-.099.825a1.9 1.9 0 0 1-.308.658 1.4 1.4 0 0 1-.522.431 1.7 1.7 0 0 1-.747.152q-.33 0-.6-.09a1.2 1.2 0 0 1-.469-.292 1.4 1.4 0 0 1-.3-.513 2.4 2.4 0 0 1-.106-.76v-2.873h1.084v2.88q0 .223.05.37.053.15.143.243.095.09.218.131a1 1 0 0 0 .271.037q.395 0 .62-.156a.88.88 0 0 0 .33-.427q.098-.271.098-.608m4.019-2.47v.781h-2.548v-.78zm-1.866-1.093h1.09v4.257q0 .198.053.304.053.108.16.144a.8.8 0 0 0 .255.037q.105 0 .197-.012.09-.012.152-.025l.004.814q-.135.045-.308.074-.17.028-.382.028-.366 0-.641-.123a.9.9 0 0 1-.428-.407q-.152-.284-.152-.747zm2.289 3.361v-.086q0-.489.14-.9a2.1 2.1 0 0 1 .407-.719q.266-.304.653-.472.385-.173.88-.173.5 0 .887.173.39.168.657.472t.407.72q.14.41.14.9v.085q0 .486-.14.9a2.1 2.1 0 0 1-.407.72q-.267.303-.653.472a2.2 2.2 0 0 1-.884.168 2.2 2.2 0 0 1-.883-.168q-.39-.168-.657-.473a2.1 2.1 0 0 1-.407-.719 2.8 2.8 0 0 1-.14-.9m1.085-.086v.086q0 .292.057.547.059.255.177.448.12.193.308.304a.94.94 0 0 0 .46.107.9.9 0 0 0 .452-.107.9.9 0 0 0 .309-.304q.123-.193.18-.448a2.5 2.5 0 0 0 .058-.547v-.086q0-.288-.058-.538a1.4 1.4 0 0 0-.18-.448.86.86 0 0 0-.769-.423.85.85 0 0 0-.76.423q-.12.193-.177.448a2.4 2.4 0 0 0-.057.538m4.955-1.27v3.534h-1.085v-4.446h1.023zm-.16 1.151h-.333q0-.465.111-.855.116-.39.337-.678a1.5 1.5 0 0 1 .547-.452q.328-.16.76-.16.3 0 .55.09.25.087.432.276.184.185.283.485.099.296.099.71v2.967h-1.085v-2.856q0-.312-.09-.488a.5.5 0 0 0-.251-.247 1 1 0 0 0-.395-.074.9.9 0 0 0-.44.103.85.85 0 0 0-.3.275 1.3 1.3 0 0 0-.172.407q-.053.23-.053.497m2.704-.201-.448.082q.003-.42.115-.785.111-.37.324-.645.219-.28.539-.436.324-.16.748-.16.328 0 .591.095.267.09.456.291.189.198.288.514.102.316.103.772v2.856h-1.093V95.2q0-.324-.09-.497a.47.47 0 0 0-.251-.238 1 1 0 0 0-.387-.07.808.808 0 0 0-.674.316q-.11.148-.168.346a1.6 1.6 0 0 0-.053.419m6.139 1.64v-2.051q0-.226-.079-.39a.56.56 0 0 0-.238-.255.8.8 0 0 0-.407-.09.9.9 0 0 0-.382.073.56.56 0 0 0-.246.21.54.54 0 0 0-.087.304h-1.089q0-.276.132-.522.132-.25.374-.444.246-.197.587-.308.345-.11.773-.11.506 0 .9.172.398.168.624.51.23.34.23.858v1.94q0 .332.042.57.045.235.131.407v.07H59.11a1.6 1.6 0 0 1-.12-.427 3.4 3.4 0 0 1-.04-.518m.151-1.764.009.645h-.687q-.255 0-.447.054a.8.8 0 0 0-.317.148.6.6 0 0 0-.185.23.7.7 0 0 0 .013.596.56.56 0 0 0 .222.21q.147.073.345.073.287 0 .501-.115a1 1 0 0 0 .333-.287.6.6 0 0 0 .127-.32l.313.468a2 2 0 0 1-.173.357 1.6 1.6 0 0 1-.296.353q-.18.165-.436.272a1.5 1.5 0 0 1-.591.106q-.431 0-.773-.172a1.37 1.37 0 0 1-.538-.473 1.2 1.2 0 0 1-.197-.682q0-.353.131-.624.132-.271.39-.457.26-.188.642-.283.386-.099.883-.099zm4.023-1.738v.781h-2.547v-.78zm-1.865-1.093h1.089v4.257q0 .198.053.304.054.108.16.144a.8.8 0 0 0 .255.037q.107 0 .197-.012t.152-.025l.004.814q-.135.045-.308.074-.169.028-.382.028-.366 0-.64-.123a.9.9 0 0 1-.428-.407q-.153-.284-.152-.747zm3.739 1.093v4.446h-1.089v-4.446zm-1.163-1.163A.54.54 0 0 1 64 92.05a.63.63 0 0 1 .452-.16q.285 0 .448.16a.53.53 0 0 1 .169.402.53.53 0 0 1-.169.399.61.61 0 0 1-.448.16.63.63 0 0 1-.452-.16.53.53 0 0 1-.164-.399m4.023 4.837q.23 0 .41-.09a.7.7 0 0 0 .288-.255.7.7 0 0 0 .12-.383h1.023a1.44 1.44 0 0 1-.255.81 1.75 1.75 0 0 1-.658.567 2 2 0 0 1-.912.205 2.2 2.2 0 0 1-.895-.172 1.74 1.74 0 0 1-.637-.481 2.1 2.1 0 0 1-.379-.715 3 3 0 0 1-.123-.871v-.132q0-.465.123-.87a2.1 2.1 0 0 1 .379-.716q.255-.308.636-.48.382-.173.892-.173.538 0 .945.21.411.21.641.591.234.382.243.9h-1.023a1 1 0 0 0-.107-.427.8.8 0 0 0-.28-.304.8.8 0 0 0-.44-.115.86.86 0 0 0-.46.115.8.8 0 0 0-.283.316q-.099.198-.14.444a3.4 3.4 0 0 0-.037.51v.131q0 .27.037.518.041.246.14.444a.8.8 0 0 0 .283.308q.186.114.469.115m5.013-.173v-2.05q0-.226-.078-.39a.56.56 0 0 0-.239-.255.8.8 0 0 0-.406-.09.9.9 0 0 0-.383.073.56.56 0 0 0-.246.21.54.54 0 0 0-.086.304h-1.09q0-.276.132-.522.132-.25.374-.444.246-.197.588-.308.345-.11.772-.11.505 0 .9.172.399.168.625.51.23.34.23.858v1.94q0 .332.04.57.047.235.132.407v.07h-1.105a1.6 1.6 0 0 1-.12-.427 3.4 3.4 0 0 1-.04-.518m.152-1.763.008.645h-.686q-.255 0-.448.054a.8.8 0 0 0-.317.148.6.6 0 0 0-.184.23.7.7 0 0 0 .012.596.57.57 0 0 0 .222.21q.148.073.345.073.288 0 .501-.115a1 1 0 0 0 .333-.287.6.6 0 0 0 .127-.32l.313.468a2 2 0 0 1-.173.357 1.6 1.6 0 0 1-.296.353q-.18.165-.435.272-.255.105-.592.106-.431 0-.772-.172a1.37 1.37 0 0 1-.539-.473 1.2 1.2 0 0 1-.197-.682q0-.353.132-.624.13-.271.39-.457.258-.188.64-.283.387-.099.884-.099zm3.07-3.603v6.311h-1.09V91.75zm2.185 0v6.311H77.19V91.75zm2.338 5.818 1.192-3.953h1.163l-1.784 5.12q-.06.165-.16.358-.094.192-.255.365a1.2 1.2 0 0 1-.402.288q-.239.11-.58.11-.147 0-.263-.02a3 3 0 0 1-.242-.053v-.814a1 1 0 0 0 .094.004q.059.005.099.005.238 0 .395-.058a.5.5 0 0 0 .25-.177 1 1 0 0 0 .164-.312zm-.587-3.953 1.006 3.275.177 1.147-.748.135-1.606-4.557zm7.388 3.674q.23 0 .41-.09a.7.7 0 0 0 .288-.255.7.7 0 0 0 .12-.383h1.022a1.44 1.44 0 0 1-.254.81 1.75 1.75 0 0 1-.658.567 2 2 0 0 1-.912.205 2.2 2.2 0 0 1-.896-.172 1.74 1.74 0 0 1-.637-.481 2.1 2.1 0 0 1-.378-.715 3 3 0 0 1-.123-.871v-.132q0-.465.123-.87a2.1 2.1 0 0 1 .378-.716q.255-.308.637-.48.382-.173.892-.173.539 0 .945.21.411.21.641.591.234.382.242.9h-1.023a1 1 0 0 0-.107-.427.8.8 0 0 0-.279-.304.8.8 0 0 0-.44-.115.86.86 0 0 0-.46.115.8.8 0 0 0-.283.316q-.1.198-.14.444a3.4 3.4 0 0 0-.037.51v.131q0 .27.037.518.04.246.14.444a.8.8 0 0 0 .283.308q.185.114.469.115m2.37-1.406v-.086q0-.489.14-.9a2.1 2.1 0 0 1 .407-.719q.267-.304.653-.472.386-.173.88-.173.501 0 .887.173.39.168.658.472.267.304.406.72.14.41.14.9v.085q0 .486-.14.9a2.1 2.1 0 0 1-.406.72q-.267.303-.654.472a2.2 2.2 0 0 1-.883.168 2.2 2.2 0 0 1-.884-.168q-.39-.168-.657-.473a2.1 2.1 0 0 1-.407-.719 2.8 2.8 0 0 1-.14-.9m1.085-.086v.086q0 .292.058.547.057.255.176.448.12.193.309.304a.94.94 0 0 0 .46.107.9.9 0 0 0 .452-.107.9.9 0 0 0 .308-.304q.123-.193.18-.448.059-.255.058-.547v-.086a2.4 2.4 0 0 0-.057-.538 1.4 1.4 0 0 0-.181-.448.86.86 0 0 0-.768-.423.85.85 0 0 0-.76.423q-.12.193-.177.448a2.4 2.4 0 0 0-.058.538m4.94-1.233v3.497h-1.085v-4.446h1.019zm-.173 1.114h-.32a3 3 0 0 1 .13-.88q.129-.393.358-.677.234-.285.555-.436.32-.152.715-.152.32 0 .58.09.258.09.443.288.189.197.288.518.102.316.102.78v2.852h-1.093V95.2q0-.304-.09-.48a.5.5 0 0 0-.255-.251 1 1 0 0 0-.407-.074.9.9 0 0 0-.44.103.9.9 0 0 0-.312.275 1.4 1.4 0 0 0-.189.407q-.065.23-.065.497m5.181 2.383h-1.093v-4.692q0-.55.222-.929.226-.382.645-.58.423-.196 1.007-.197.34 0 .657.07.32.066.658.173l-.161.88a7 7 0 0 0-.476-.132 2.6 2.6 0 0 0-.604-.062q-.432 0-.645.197-.21.198-.21.58zm.888-4.446v.781h-2.65v-.78zm1.717 0v4.446h-1.089v-4.446zm2.137.908v3.538h-1.085v-4.446h1.027zm1.352-.937-.017 1.011a2.894 2.894 0 0 0-.415-.033q-.25 0-.439.07a.8.8 0 0 0-.317.193.9.9 0 0 0-.189.313 1.4 1.4 0 0 0-.074.41l-.234-.028q0-.423.086-.785.087-.361.251-.633.165-.27.411-.419.25-.152.575-.152.09 0 .193.017.108.012.169.036m1.676.941v3.534h-1.085v-4.446h1.024zm-.16 1.151h-.333q0-.465.111-.855.115-.39.337-.678.222-.291.547-.452.328-.16.76-.16.3 0 .55.09.25.087.432.276.185.185.283.485.099.296.099.71v2.967h-1.085v-2.856q0-.312-.09-.488a.5.5 0 0 0-.251-.247 1 1 0 0 0-.394-.074.84.84 0 0 0-.74.378 1.3 1.3 0 0 0-.173.407q-.053.23-.053.497m2.704-.201-.448.082q.004-.42.115-.785.111-.37.324-.645a1.5 1.5 0 0 1 .539-.436q.324-.16.748-.16.329 0 .591.095.267.09.456.291.189.198.288.514.102.316.103.772v2.856h-1.093V95.2q0-.324-.091-.497a.47.47 0 0 0-.25-.238 1 1 0 0 0-.387-.07.85.85 0 0 0-.394.086.8.8 0 0 0-.279.23 1.1 1.1 0 0 0-.169.346 1.6 1.6 0 0 0-.053.419m6.849-.913v3.497h-1.084v-4.446h1.019zm-.172 1.114h-.321a3 3 0 0 1 .132-.88q.127-.393.357-.677.234-.285.555-.436.32-.152.715-.152.321 0 .579.09.26.09.444.288.189.197.288.518.102.316.102.78v2.852h-1.093V95.2q0-.304-.09-.48a.5.5 0 0 0-.255-.251 1 1 0 0 0-.406-.074.9.9 0 0 0-.44.103.9.9 0 0 0-.312.275 1.3 1.3 0 0 0-.189.407q-.066.23-.066.497m5.806 2.465q-.506 0-.908-.164a2 2 0 0 1-.686-.456 2.1 2.1 0 0 1-.432-.686 2.4 2.4 0 0 1-.148-.847v-.164q0-.514.148-.933a2.1 2.1 0 0 1 .419-.727q.271-.304.649-.469t.835-.164q.473 0 .834.16.361.156.604.444.242.288.365.69.124.399.124.884v.456h-3.485v-.748h2.416v-.082a1.3 1.3 0 0 0-.098-.473.76.76 0 0 0-.28-.345.84.84 0 0 0-.489-.131.8.8 0 0 0-.423.107.85.85 0 0 0-.296.295 1.5 1.5 0 0 0-.172.452q-.058.264-.058.584v.164q0 .28.074.518.078.238.226.415.152.172.362.271.213.095.485.095.34 0 .616-.132.28-.135.485-.398l.546.567a1.926 1.926 0 0 1-.945.703 2.4 2.4 0 0 1-.768.114m3.768-1.15.974-3.378h.69l-.206 1.167-.982 3.28h-.595zm-.539-3.378.732 3.386.066 1.06h-.687l-1.167-4.446zm3.107 3.337.715-3.337h1.052l-1.159 4.446h-.686zm-.797-3.337.965 3.345.128 1.101h-.596l-.99-3.279-.202-1.167zm7.947 3.39v-3.39h1.093v4.446h-1.028zm.139-.92.337-.008q0 .447-.098.825a1.9 1.9 0 0 1-.309.658 1.44 1.44 0 0 1-.521.431 1.7 1.7 0 0 1-.748.152q-.328 0-.6-.09a1.2 1.2 0 0 1-.469-.292 1.4 1.4 0 0 1-.3-.513 2.4 2.4 0 0 1-.106-.76v-2.873h1.084v2.88q0 .223.05.37.053.15.143.243.095.09.218.131a1 1 0 0 0 .271.037q.395 0 .621-.156a.9.9 0 0 0 .329-.427q.098-.271.098-.608m4.36.76a.44.44 0 0 0-.074-.25q-.074-.112-.279-.202a3 3 0 0 0-.592-.177q-.346-.074-.637-.185a2 2 0 0 1-.501-.267 1.2 1.2 0 0 1-.329-.374 1.05 1.05 0 0 1-.115-.501q0-.275.119-.518.119-.246.345-.431.226-.19.551-.296.324-.11.731-.11.567-.001.974.184.41.184.629.51.217.32.217.723h-1.084a.63.63 0 0 0-.083-.32.56.56 0 0 0-.242-.23.86.86 0 0 0-.415-.091.9.9 0 0 0-.382.074.56.56 0 0 0-.23.193.47.47 0 0 0-.078.263q0 .106.041.193.045.082.144.152.097.07.267.127.173.058.423.111.497.1.867.263.374.161.583.427.21.268.21.683 0 .296-.127.542a1.3 1.3 0 0 1-.37.423q-.243.18-.58.284a2.7 2.7 0 0 1-.76.098q-.612 0-1.035-.217a1.66 1.66 0 0 1-.641-.56 1.3 1.3 0 0 1-.218-.706h1.04q.012.259.139.415t.321.226q.197.066.415.066.246 0 .415-.066a.6.6 0 0 0 .255-.185.45.45 0 0 0 .086-.271m3.883 1.298q-.506 0-.908-.164a2 2 0 0 1-.686-.456 2.1 2.1 0 0 1-.432-.686 2.4 2.4 0 0 1-.148-.847v-.164q0-.514.148-.933a2.1 2.1 0 0 1 .419-.727q.271-.304.649-.469.379-.165.835-.164.472 0 .834.16.361.156.604.444.242.288.365.69.124.399.124.884v.456h-3.485v-.748h2.416v-.082a1.3 1.3 0 0 0-.098-.473.76.76 0 0 0-.28-.345.84.84 0 0 0-.489-.131.8.8 0 0 0-.423.107.85.85 0 0 0-.296.295 1.5 1.5 0 0 0-.172.452q-.058.264-.058.584v.164q0 .28.074.518.078.238.226.415.152.172.362.271.213.095.485.095.34 0 .616-.132.28-.135.485-.398l.546.567a1.926 1.926 0 0 1-.945.703 2.4 2.4 0 0 1-.768.114m3.616-3.62v3.538h-1.085v-4.446h1.027zm1.352-.937-.017 1.011a2.894 2.894 0 0 0-.415-.033q-.25 0-.439.07a.8.8 0 0 0-.317.193.9.9 0 0 0-.189.313 1.4 1.4 0 0 0-.074.41l-.234-.028q0-.423.086-.785.086-.361.251-.633.164-.27.411-.419.25-.152.575-.152.09 0 .193.017.107.012.169.036m3.04 3.259a.44.44 0 0 0-.074-.25q-.073-.112-.279-.202a3 3 0 0 0-.592-.177q-.345-.074-.637-.185a2 2 0 0 1-.501-.267 1.2 1.2 0 0 1-.329-.374 1.07 1.07 0 0 1-.115-.501q0-.275.119-.518a1.3 1.3 0 0 1 .346-.431q.226-.19.55-.296.325-.11.732-.11.567-.001.973.184.411.184.629.51.218.32.218.723h-1.085a.63.63 0 0 0-.082-.32.56.56 0 0 0-.243-.23.85.85 0 0 0-.415-.091.9.9 0 0 0-.382.074.56.56 0 0 0-.23.193.47.47 0 0 0-.037.456q.045.082.144.152t.267.127q.172.058.423.111.498.1.867.263.375.161.584.427.21.268.209.683 0 .296-.127.542a1.25 1.25 0 0 1-.37.423q-.242.18-.579.284a2.7 2.7 0 0 1-.76.098q-.612 0-1.036-.217a1.66 1.66 0 0 1-.641-.56 1.3 1.3 0 0 1-.218-.706h1.04q.012.259.14.415a.7.7 0 0 0 .32.226q.198.066.415.066.247 0 .415-.066a.6.6 0 0 0 .255-.185.45.45 0 0 0 .086-.271M34.646 104.555v4.188h-.558l-2.108-3.23v3.23h-.555v-4.188h.555l2.117 3.239v-3.239zm2.195 4.246q-.326 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.193-.207.437-.313.245-.107.507-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.325v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.431-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.18.34.121.147.291.23a.9.9 0 0 0 .391.083.9.9 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224 1.5 1.5 0 0 1-.532.087m2.62-.61.8-2.56h.35l-.069.509-.814 2.603h-.342zm-.538-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.782 2.517.09.595h-.34l-.837-2.609-.069-.503zm5.779 2.393v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.104.032.212.032.34 0 .538-.129a.74.74 0 0 0 .285-.354q.09-.225.09-.498m3.058.55a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.785.785 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.366-.199t.474-.072q.374 0 .639.133a1 1 0 0 1 .405.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.031.374.34.34 0 0 0 .109.124 1 1 0 0 0 .218.104q.141.049.36.097.382.087.63.207.248.121.368.297t.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.491.066q-.412 0-.697-.147a1.1 1.1 0 0 1-.43-.38.9.9 0 0 1-.148-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m2.522.883q-.324 0-.59-.11a1.3 1.3 0 0 1-.45-.313 1.4 1.4 0 0 1-.289-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.334 0 .575.116.245.114.4.322.156.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.712.712 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.064.193.181.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.195-.114.343-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m2.365-2.681v2.623h-.532v-3.112h.517zm.972-.506-.003.494a1.289 1.289 0 0 0-.259-.023.9.9 0 0 0-.325.058.7.7 0 0 0-.239.161.8.8 0 0 0-.155.247 1.2 1.2 0 0 0-.072.311l-.15.086q0-.282.055-.529.057-.248.176-.437a.85.85 0 0 1 .299-.299.84.84 0 0 1 .673-.069m2.304 2.304a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.374 0 .639.133a1 1 0 0 1 .405.354.87.87 0 0 1 .141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.383.087.63.207.248.121.368.297t.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.492.066q-.411 0-.696-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m3.48.273.8-2.56h.35l-.069.509-.814 2.603h-.342zm-.538-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.782 2.517.09.595h-.34l-.837-2.609-.069-.503zm2.992 0v3.112h-.535v-3.112zm-.576-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .083.219.3.3 0 0 1-.083.212q-.081.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.078-.212m2.008-.481v4.418h-.535v-4.418zm1.432 0v4.418h-.535v-4.418zm2.313 0h.535v3.814l-.046.604h-.49zm2.637 2.836v.061q0 .339-.08.63a1.6 1.6 0 0 1-.236.5q-.155.213-.38.331-.224.118-.514.118-.296 0-.521-.101a1 1 0 0 1-.374-.296 1.5 1.5 0 0 1-.244-.466q-.09-.273-.124-.616v-.264a3 3 0 0 1 .124-.619 1.5 1.5 0 0 1 .244-.466 1 1 0 0 1 .374-.296q.221-.104.515-.104.293 0 .52.116.228.112.38.322.155.21.236.503.08.29.08.647m-.535.061v-.061a2 2 0 0 0-.043-.437 1.1 1.1 0 0 0-.138-.362.69.69 0 0 0-.633-.34.8.8 0 0 0-.35.069.8.8 0 0 0-.25.187 1 1 0 0 0-.17.265 1.5 1.5 0 0 0-.095.305v.693q.045.201.15.388a.9.9 0 0 0 .281.302.8.8 0 0 0 .44.118.74.74 0 0 0 .368-.086.7.7 0 0 0 .25-.245q.099-.155.144-.359.046-.204.046-.437m2.5 1.579q-.325 0-.59-.11a1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.111-.3.305-.507.192-.207.437-.313.244-.107.506-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.181.34.12.147.29.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.342-.307l.323.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m5.128-.59v-1.602a.65.65 0 0 0-.074-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.6.6 0 0 0-.236.181.4.4 0 0 0-.084.242h-.532q0-.167.087-.331a1 1 0 0 1 .247-.296q.165-.135.391-.213.23-.081.512-.081.34 0 .599.116.261.114.408.348.15.23.15.578v1.449q0 .156.025.331.03.176.084.302v.046h-.555a1 1 0 0 1-.064-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538a2 2 0 0 0-.405.038.9.9 0 0 0-.3.106.482.482 0 0 0-.247.431.55.55 0 0 0 .066.268.5.5 0 0 0 .199.193q.135.069.33.069a.894.894 0 0 0 .728-.357.54.54 0 0 0 .121-.29l.227.256a.8.8 0 0 1-.109.267 1.27 1.27 0 0 1-.59.503 1.1 1.1 0 0 1-.454.087q-.317 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.13-.469q0-.25.098-.44a.85.85 0 0 1 .282-.319q.184-.129.443-.196.258-.066.578-.066zm3.182 1.168v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.103.032.213.032.339 0 .537-.129a.74.74 0 0 0 .285-.354q.09-.225.09-.498m2.549-1.737v.408h-1.683v-.408zm-1.114-.756h.533v3.097q0 .159.049.239a.23.23 0 0 0 .126.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.1.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.262-.259 1.1 1.1 0 0 1-.094-.495zm1.54 2.347v-.067q0-.336.097-.624a1.5 1.5 0 0 1 .282-.503 1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121.327 0 .59.121.264.118.448.334.188.213.285.503.097.288.097.624v.067q0 .336-.097.624-.098.287-.285.503a1.3 1.3 0 0 1-.446.334 1.4 1.4 0 0 1-.587.118 1.4 1.4 0 0 1-.59-.118 1.3 1.3 0 0 1-.448-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.531-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .28.25q.166.09.387.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25q.109-.158.164-.362a1.6 1.6 0 0 0 .058-.44v-.067q0-.23-.058-.434a1.1 1.1 0 0 0-.167-.365.768.768 0 0 0-.662-.345.8.8 0 0 0-.385.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m3.498-.906v2.494h-.535v-3.112h.506zm-.11.82-.247-.008q.003-.32.084-.59.08-.273.239-.475.157-.2.394-.31.236-.113.546-.113.219 0 .403.064a.81.81 0 0 1 .529.532q.075.207.075.5v2.074h-.532v-2.048a.8.8 0 0 0-.084-.391.48.48 0 0 0-.23-.213.8.8 0 0 0-.35-.069.83.83 0 0 0-.395.084.66.66 0 0 0-.253.23q-.095.146-.138.336-.04.187-.04.397m2.017-.293-.357.109q.003-.257.084-.492.083-.236.239-.42.157-.183.388-.29.23-.11.526-.11.25 0 .443.067a.8.8 0 0 1 .328.204q.135.135.204.348.07.213.07.506v2.045h-.536v-2.051a.8.8 0 0 0-.083-.405.43.43 0 0 0-.23-.204.9.9 0 0 0-.351-.061q-.175 0-.31.061a.6.6 0 0 0-.228.166.7.7 0 0 0-.141.239.9.9 0 0 0-.046.288m4.565 1.435v-1.602a.65.65 0 0 0-.075-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.6.6 0 0 0-.236.181.4.4 0 0 0-.083.242h-.532q0-.167.086-.331a1 1 0 0 1 .247-.296q.165-.135.392-.213.23-.081.511-.081.34 0 .599.116.261.114.408.348.15.23.15.578v1.449q0 .156.026.331.029.176.083.302v.046h-.555a1 1 0 0 1-.063-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538q-.228 0-.406.038a.9.9 0 0 0-.3.106.482.482 0 0 0-.247.431.55.55 0 0 0 .067.268.5.5 0 0 0 .198.193q.135.069.331.069a.895.895 0 0 0 .728-.357.54.54 0 0 0 .12-.29l.228.256a.8.8 0 0 1-.11.267 1.27 1.27 0 0 1-.59.503 1.1 1.1 0 0 1-.454.087q-.316 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.13-.469q0-.25.098-.44a.85.85 0 0 1 .282-.319q.184-.129.443-.196.259-.066.578-.066zm2.58-1.225v.408h-1.683v-.408zm-1.113-.756h.532v3.097q0 .159.049.239a.23.23 0 0 0 .126.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.1.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.261-.259 1.1 1.1 0 0 1-.095-.495zm2.315.756v3.112h-.535v-3.112zm-.575-.825q0-.13.077-.219.081-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.233.087-.155 0-.236-.087a.31.31 0 0 1-.077-.212m2.675 3.557a.8.8 0 0 0 .351-.077.7.7 0 0 0 .264-.213.6.6 0 0 0 .118-.314h.506a.94.94 0 0 1-.187.515 1.3 1.3 0 0 1-.445.383 1.3 1.3 0 0 1-.607.144 1.4 1.4 0 0 1-.613-.124 1.2 1.2 0 0 1-.431-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.084-.596v-.12q0-.314.084-.593.086-.282.256-.497.173-.216.431-.34a1.4 1.4 0 0 1 .613-.124q.365 0 .638.15.273.147.429.403.158.252.172.575h-.506a.8.8 0 0 0-.109-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.371-.095q-.244 0-.412.097a.7.7 0 0 0-.261.259q-.096.162-.138.36-.04.196-.041.4v.12q0 .205.041.403.04.198.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m3.673-.152v-1.602a.65.65 0 0 0-.075-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.63.63 0 0 0-.236.181.4.4 0 0 0-.083.242h-.532a.7.7 0 0 1 .086-.331 1 1 0 0 1 .247-.296q.164-.135.392-.213.23-.081.512-.081.339 0 .598.116a.9.9 0 0 1 .408.348q.15.23.15.578v1.449q0 .156.026.331a1.3 1.3 0 0 0 .083.302v.046h-.555a1 1 0 0 1-.063-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538a2 2 0 0 0-.406.038 1 1 0 0 0-.299.106.484.484 0 0 0-.247.431q0 .147.066.268t.198.193q.135.069.331.069a.9.9 0 0 0 .728-.357.55.55 0 0 0 .121-.29l.227.256a.8.8 0 0 1-.11.267 1.27 1.27 0 0 1-.589.503 1.1 1.1 0 0 1-.455.087q-.317 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.129-.469q0-.25.097-.44a.86.86 0 0 1 .282-.319q.185-.129.443-.196.26-.066.578-.066zm1.855-2.531v4.418h-.535v-4.418zm1.432 0v4.418h-.535v-4.418zm1.729 4.096.866-2.79h.569l-1.248 3.593a2 2 0 0 1-.115.247q-.069.135-.178.256a.84.84 0 0 1-.791.256 2 2 0 0 1-.138-.029l-.003-.431.072.005.072.006q.18 0 .307-.049a.45.45 0 0 0 .213-.158 1 1 0 0 0 .153-.302zm-.636-2.79.809 2.416.138.561-.383.196-1.145-3.173zm5.258 2.732a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.291 1.291 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2.1 2.1 0 0 1-.083-.596v-.12q0-.314.083-.593.087-.282.256-.497.172-.216.432-.34.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.67.67 0 0 0-.253-.247.7.7 0 0 0-.371-.095q-.244 0-.411.097a.73.73 0 0 0-.262.259 1.2 1.2 0 0 0-.138.36q-.04.196-.04.4v.12q0 .205.04.403t.135.36a.8.8 0 0 0 .262.259.83.83 0 0 0 .414.094m1.697-1.141v-.067q0-.336.098-.624.098-.29.282-.503a1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121.328 0 .589.121.265.118.449.334.187.213.285.503.097.288.097.624v.067q0 .336-.097.624a1.5 1.5 0 0 1-.285.503 1.3 1.3 0 0 1-1.033.452q-.328 0-.589-.118a1.3 1.3 0 0 1-.449-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.532-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .279.25q.167.09.388.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25 1.1 1.1 0 0 0 .164-.362q.057-.207.057-.44v-.067q0-.23-.057-.434a1.1 1.1 0 0 0-.167-.365.767.767 0 0 0-.661-.345.8.8 0 0 0-.386.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m3.501-.86v2.448h-.532v-3.112h.503zm-.127.774-.221-.008q.002-.32.095-.59.091-.273.259-.475.166-.2.397-.31.232-.113.514-.113.23 0 .415.064.183.06.313.195.132.135.201.351.069.213.069.521v2.039h-.534v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.76.76 0 0 0-.34-.069.8.8 0 0 0-.362.084.84.84 0 0 0-.279.23q-.115.146-.181.336a1.2 1.2 0 0 0-.064.397m3.561 1.674h-.532v-3.382q0-.354.138-.599a.9.9 0 0 1 .394-.371q.256-.126.607-.126.207 0 .406.052.198.048.408.123l-.089.449a3 3 0 0 0-.308-.098 1.4 1.4 0 0 0-.38-.049q-.342 0-.494.156-.15.152-.15.463zm.636-3.112v.408h-1.66v-.408zm1.047 0v3.112h-.532v-3.112zm1.406.489v2.623h-.532v-3.112h.518zm.973-.506-.003.494a1.277 1.277 0 0 0-.259-.023.9.9 0 0 0-.325.058.7.7 0 0 0-.239.161.8.8 0 0 0-.155.247 1.2 1.2 0 0 0-.072.311l-.15.086q0-.282.055-.529.058-.248.175-.437a.86.86 0 0 1 .299-.299.84.84 0 0 1 .674-.069m1.021.635v2.494h-.535v-3.112h.506zm-.11.82-.247-.008q.003-.32.083-.59.081-.273.239-.475.159-.2.394-.31.236-.113.547-.113.218 0 .402.064a.82.82 0 0 1 .53.532q.074.207.074.5v2.074h-.532v-2.048a.8.8 0 0 0-.083-.391.48.48 0 0 0-.23-.213.8.8 0 0 0-.351-.069.83.83 0 0 0-.394.084.65.65 0 0 0-.253.23 1 1 0 0 0-.138.336 2 2 0 0 0-.041.397m2.017-.293-.357.109q.003-.257.083-.492a1.4 1.4 0 0 1 .239-.42q.159-.183.388-.29.23-.11.527-.11.25 0 .443.067.195.066.328.204.135.135.204.348t.069.506v2.045h-.535v-2.051a.8.8 0 0 0-.084-.405.43.43 0 0 0-.23-.204.9.9 0 0 0-.351-.061.7.7 0 0 0-.31.061.6.6 0 0 0-.227.166.7.7 0 0 0-.141.239.9.9 0 0 0-.046.288m4.021 2.025q-.326 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.101-.604v-.12q0-.38.112-.676.113-.3.305-.507a1.3 1.3 0 0 1 .437-.313q.245-.107.507-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.791v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.71.71 0 0 0-.596.302 1.1 1.1 0 0 0-.169.365q-.061.216-.061.498v.12q0 .222.061.417.063.193.181.34.12.147.29.23a.9.9 0 0 0 .391.083.93.93 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224q-.225.087-.532.087m3.793-.662v-3.814h.535v4.418h-.489zm-2.093-.917v-.061q0-.356.086-.647a1.6 1.6 0 0 1 .25-.503q.164-.21.388-.322.228-.116.507-.116.293 0 .512.104a1 1 0 0 1 .373.296q.156.193.245.466.089.274.124.619v.264a2.7 2.7 0 0 1-.124.616 1.4 1.4 0 0 1-.245.466 1 1 0 0 1-.373.296 1.25 1.25 0 0 1-.518.101 1.08 1.08 0 0 1-.889-.449 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.086-.63m.535-.061v.061q0 .233.046.437.048.204.149.359a.75.75 0 0 0 .256.245.76.76 0 0 0 .371.086.77.77 0 0 0 .434-.112.84.84 0 0 0 .277-.296q.103-.184.161-.4v-.693a1.5 1.5 0 0 0-.101-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.149.362 2 2 0 0 0-.046.437m-106.9 10.03.799-2.56h.35l-.068.509-.814 2.603h-.343zm-.539-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.783 2.517.089.595h-.34l-.837-2.609-.069-.503zm2.946-1.306v4.418h-.532v-4.418zm-.127 2.744-.221-.008q.003-.32.095-.59.09-.273.258-.475a1.16 1.16 0 0 1 .912-.423q.231 0 .414.064.185.06.314.195a.9.9 0 0 1 .201.351q.07.213.07.521v2.039h-.536v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.339-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.28.23 1.15 1.15 0 0 0-.244.733m3.417-1.438v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.235-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.077-.212m2.008-.481v4.418h-.536v-4.418zm2.145 4.476q-.324 0-.59-.11a1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.334 0 .576.116.244.114.4.322.155.204.23.483.075.276.074.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.181.34.121.147.29.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.343-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m4.597-3.17v.408h-1.683v-.408zm-1.114-.756h.533v3.097q0 .159.048.239a.23.23 0 0 0 .127.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.101.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.262-.259 1.1 1.1 0 0 1-.095-.495zm2.27-.55v4.418h-.532v-4.418zm-.127 2.744-.221-.008a1.9 1.9 0 0 1 .095-.59q.091-.273.259-.475a1.16 1.16 0 0 1 .911-.423q.231 0 .414.064.185.06.314.195a.9.9 0 0 1 .201.351q.07.213.07.521v2.039h-.536v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.339-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.28.23 1.15 1.15 0 0 0-.244.733m3.417-1.438v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.152 0 .232.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.232.087-.156 0-.236-.087a.3.3 0 0 1-.078-.212m3.242 3.112a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.374 0 .639.133a1 1 0 0 1 .405.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.383.087.63.207.247.121.368.297.12.176.12.425a.838.838 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.491.066q-.412 0-.697-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m4.654.221v-3.814h.535v4.418h-.49zm-2.094-.917v-.061q0-.356.086-.647.09-.294.25-.503.165-.21.388-.322a1.1 1.1 0 0 1 .507-.116q.293 0 .512.104a1 1 0 0 1 .373.296q.156.193.245.466.089.274.124.619v.264a2.7 2.7 0 0 1-.124.616q-.09.273-.245.466a1 1 0 0 1-.373.296q-.222.1-.518.101-.274 0-.5-.118a1.2 1.2 0 0 1-.389-.331 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.087-.63m.534-.061v.061q0 .233.047.437.048.204.15.359a.75.75 0 0 0 .255.245.76.76 0 0 0 .371.086.77.77 0 0 0 .434-.112.84.84 0 0 0 .277-.296q.103-.184.16-.4v-.693a1.5 1.5 0 0 0-.1-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.15.362 2 2 0 0 0-.046.437m4.214 1.64q-.324 0-.59-.11a1.3 1.3 0 0 1-.45-.313 1.4 1.4 0 0 1-.289-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.335 0 .576.116.244.114.4.322.155.204.23.483.075.276.074.604v.239H61.08v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.71.71 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.064.193.181.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m2.738-.538.852-2.632h.544l-1.12 3.112h-.356zm-.71-2.632.877 2.646.06.466h-.356l-1.127-3.112zm3.196 0v3.112h-.535v-3.112zm-.576-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .083.219.3.3 0 0 1-.083.212q-.081.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.078-.212m2.675 3.557a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.27 1.27 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.083-.596v-.12q0-.314.083-.593a1.5 1.5 0 0 1 .256-.497 1.2 1.2 0 0 1 .432-.34q.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.37-.095q-.245 0-.412.097a.73.73 0 0 0-.262.259q-.094.162-.138.36a2 2 0 0 0-.04.4v.12q0 .205.04.403t.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m3.13.438q-.325 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.193-.207.438-.313.244-.107.506-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.159-.126-.431-.126a.71.71 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.063.193.18.34.121.147.291.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224 1.5 1.5 0 0 1-.532.087m3.871-3.17v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.235-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.079.087-.233.087t-.235-.087a.3.3 0 0 1-.078-.212m3.242 3.112a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.375 0 .638.133a1 1 0 0 1 .406.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.382.087.63.207.247.121.368.297.12.176.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.492.066q-.411 0-.696-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.114.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m4.596.106v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.104.032.213.032.339 0 .538-.129a.74.74 0 0 0 .284-.354q.09-.225.09-.498m1.778-1.073v2.448h-.532v-3.112h.503zm-.126.774-.222-.008a1.9 1.9 0 0 1 .095-.59q.092-.273.259-.475a1.16 1.16 0 0 1 .912-.423q.23 0 .414.064.184.06.313.195.133.135.202.351.069.213.069.521v2.039h-.535v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.34-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.279.23 1.15 1.15 0 0 0-.244.733m3.428-2.744v4.418h-.535v-4.418zm.713 2.897v-.067q0-.336.098-.624a1.5 1.5 0 0 1 .282-.503 1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121a1.4 1.4 0 0 1 .59.121q.264.118.448.334.188.213.285.503.098.288.098.624v.067q0 .336-.098.624a1.5 1.5 0 0 1-.285.503 1.3 1.3 0 0 1-.446.334 1.4 1.4 0 0 1-.587.118 1.4 1.4 0 0 1-.59-.118 1.3 1.3 0 0 1-.448-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.532-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .28.25q.166.09.387.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25q.11-.158.164-.362.057-.207.058-.44v-.067q0-.23-.058-.434a1.1 1.1 0 0 0-.167-.365.768.768 0 0 0-.662-.345.8.8 0 0 0-.385.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m4.214 1.208a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.293 1.293 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.083-.596v-.12q0-.314.083-.593a1.5 1.5 0 0 1 .256-.497 1.2 1.2 0 0 1 .432-.34q.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.37-.095q-.245 0-.412.097a.73.73 0 0 0-.262.259q-.095.162-.138.36-.04.196-.04.4v.12q0 .205.04.403t.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m2.373-4.038v4.418h-.535v-4.418zm1.901 1.306-1.357 1.453-.76.788-.043-.567.544-.65.966-1.024zm-.486 3.112-1.11-1.484.276-.475 1.461 1.959zm2.27.058a1.5 1.5 0 0 1-.59-.11 1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.194-.207.438-.313t.506-.107q.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.711.711 0 0 0-.596.302q-.109.149-.17.365-.06.216-.06.498v.12q0 .222.06.417.064.193.182.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224q-.225.087-.532.087m3.794-.662v-3.814h.535v4.418h-.489zm-2.094-.917v-.061q0-.356.086-.647a1.6 1.6 0 0 1 .25-.503q.164-.21.388-.322.228-.116.507-.116.293 0 .512.104a1 1 0 0 1 .374.296q.155.193.244.466.09.274.124.619v.264a2.7 2.7 0 0 1-.124.616 1.5 1.5 0 0 1-.244.466 1.04 1.04 0 0 1-.374.296 1.25 1.25 0 0 1-.518.101 1.08 1.08 0 0 1-.889-.449 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.086-.63m.535-.061v.061q0 .233.046.437.048.204.149.359a.75.75 0 0 0 .256.245.76.76 0 0 0 .371.086.77.77 0 0 0 .435-.112.84.84 0 0 0 .276-.296q.103-.184.161-.4v-.693a1.5 1.5 0 0 0-.101-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.149.362 2 2 0 0 0-.046.437m2.931 1.3q0-.135.083-.227a.32.32 0 0 1 .247-.095q.162 0 .245.095a.32.32 0 0 1 .086.227.32.32 0 0 1-.086.225q-.083.092-.245.092a.32.32 0 0 1-.247-.092.32.32 0 0 1-.083-.225"/><path class="tw-fill-background" d="M20.84 126.475h144.32v64.661H20.84z"/><rect width="124.124" height="16.049" x="30.939" y="129.842" class="tw-fill-secondary-500" rx="4.039"/><path class="tw-fill-background" d="M83.974 134.58v4.786h-.983v-4.786zm1.473 0v.772h-3.905v-.772zm2.357 3.935v-2.706h.947v3.557h-.891zm.105-.73.28-.007q0 .355-.083.661a1.6 1.6 0 0 1-.246.526q-.165.22-.414.345a1.3 1.3 0 0 1-.589.122q-.26 0-.48-.072a1 1 0 0 1-.374-.234 1.1 1.1 0 0 1-.244-.411 1.9 1.9 0 0 1-.085-.608v-2.298h.947v2.305q0 .158.036.266a.5.5 0 0 0 .108.177.4.4 0 0 0 .161.099q.096.03.21.03.294 0 .46-.119a.62.62 0 0 0 .24-.322q.073-.207.073-.46m2.511-1.2v2.781h-.946v-3.557h.89zm1.072-.799-.016.878a2 2 0 0 0-.168-.016 2 2 0 0 0-.174-.01q-.2 0-.349.052a.6.6 0 0 0-.243.148.65.65 0 0 0-.145.24 1.2 1.2 0 0 0-.052.322l-.19-.059q0-.345.068-.634.07-.293.2-.51.135-.216.33-.335a.83.83 0 0 1 .443-.118q.08 0 .161.013.082.01.135.029m1.374.783v2.797h-.947v-3.557h.888zm-.138.894h-.256q0-.395.102-.71.102-.32.286-.543.183-.227.437-.345a1.3 1.3 0 0 1 .572-.121q.25 0 .457.072a.9.9 0 0 1 .355.23q.15.158.23.417.082.26.082.635v2.268h-.953v-2.271a.84.84 0 0 0-.066-.369.37.37 0 0 0-.194-.184.8.8 0 0 0-.309-.055.7.7 0 0 0-.332.075.7.7 0 0 0-.23.21 1 1 0 0 0-.135.309q-.046.178-.046.382m4.51.161v-.069q0-.392.112-.72.111-.332.325-.575t.526-.378q.313-.138.717-.138.405 0 .72.138.315.135.529.378.217.243.329.575.111.328.112.72v.069q0 .387-.112.72a1.7 1.7 0 0 1-.329.575 1.46 1.46 0 0 1-.526.378q-.312.135-.717.135t-.72-.135a1.5 1.5 0 0 1-.529-.378 1.7 1.7 0 0 1-.325-.575 2.3 2.3 0 0 1-.112-.72m.947-.069v.069q0 .223.04.417.039.195.124.342a.65.65 0 0 0 .23.227q.142.082.346.082a.66.66 0 0 0 .338-.082.6.6 0 0 0 .227-.227q.086-.147.125-.342.043-.194.043-.417v-.069a2 2 0 0 0-.043-.408 1.1 1.1 0 0 0-.128-.342.64.64 0 0 0-.227-.236.65.65 0 0 0-.342-.086.65.65 0 0 0-.342.086.7.7 0 0 0-.227.236 1.1 1.1 0 0 0-.125.342 2 2 0 0 0-.04.408m3.931-.986v2.797h-.946v-3.557h.887zm-.138.894h-.256q0-.395.102-.71.102-.32.286-.543.184-.227.437-.345a1.3 1.3 0 0 1 .572-.121q.25 0 .457.072a.9.9 0 0 1 .355.23q.151.158.23.417.082.26.082.635v2.268h-.953v-2.271a.84.84 0 0 0-.066-.369.37.37 0 0 0-.194-.184.8.8 0 0 0-.309-.055.7.7 0 0 0-.332.075.7.7 0 0 0-.23.21 1 1 0 0 0-.135.309q-.046.178-.046.382"/><rect width="123.283" height="15.208" x="31.359" y="149.677" class="tw-stroke-secondary-500" stroke-width=".842" rx="3.619"/><path class="tw-fill-secondary-500" d="M87.663 157.194h.982q-.03.483-.266.857-.233.375-.654.586-.418.21-1.006.21-.46 0-.825-.158a1.76 1.76 0 0 1-.625-.46 2 2 0 0 1-.39-.723q-.136-.425-.136-.95v-.332q0-.526.139-.95.14-.427.4-.727a1.8 1.8 0 0 1 .629-.46q.364-.16.815-.161.598 0 1.009.217.414.217.64.598.23.382.277.868h-.986a1.3 1.3 0 0 0-.115-.49.65.65 0 0 0-.3-.305q-.196-.106-.525-.106a.96.96 0 0 0-.43.092.8.8 0 0 0-.31.28 1.4 1.4 0 0 0-.187.473q-.06.283-.06.664v.339q.001.371.056.654a1.5 1.5 0 0 0 .171.473.8.8 0 0 0 .303.29 1 1 0 0 0 .45.095q.309 0 .51-.099a.68.68 0 0 0 .305-.292q.109-.195.129-.483m2.57-3.462v5.049h-.95v-5.049zm.631 3.307v-.069q0-.391.112-.72.112-.332.326-.575.213-.243.525-.378.313-.138.717-.138.405 0 .72.138.315.135.53.378t.328.575q.111.329.112.72v.069q0 .388-.112.72a1.7 1.7 0 0 1-.329.575 1.5 1.5 0 0 1-.526.378 1.8 1.8 0 0 1-.716.135q-.405 0-.72-.135a1.5 1.5 0 0 1-.53-.378 1.7 1.7 0 0 1-.325-.575 2.2 2.2 0 0 1-.112-.72m.947-.069v.069q0 .223.04.418.039.194.124.341.09.145.23.227.142.082.346.082a.66.66 0 0 0 .338-.082.6.6 0 0 0 .227-.227q.086-.147.125-.341.042-.195.043-.418v-.069a2 2 0 0 0-.043-.408 1.1 1.1 0 0 0-.128-.341.64.64 0 0 0-.227-.237.65.65 0 0 0-.342-.086.65.65 0 0 0-.342.086.7.7 0 0 0-.227.237 1.1 1.1 0 0 0-.124.341 2 2 0 0 0-.04.408m4.927.828a.3.3 0 0 0-.059-.184.5.5 0 0 0-.22-.151 2 2 0 0 0-.457-.131 4 4 0 0 1-.503-.148 1.8 1.8 0 0 1-.4-.221.84.84 0 0 1-.358-.706q-.002-.224.094-.421.1-.198.28-.349.183-.155.447-.239.266-.09.598-.089.463 0 .796.148.335.147.512.407a1 1 0 0 1 .181.585h-.947a.5.5 0 0 0-.059-.246.4.4 0 0 0-.177-.174.63.63 0 0 0-.31-.066.6.6 0 0 0-.272.056.4.4 0 0 0-.178.144.35.35 0 0 0-.026.346q.037.062.115.115t.204.098q.127.043.316.079.384.08.686.207.303.125.48.342.178.214.178.562a.9.9 0 0 1-.105.434q-.105.198-.303.345-.197.145-.473.227a2.2 2.2 0 0 1-.615.079q-.496 0-.841-.178a1.33 1.33 0 0 1-.52-.45 1.05 1.05 0 0 1-.174-.565h.897a.53.53 0 0 0 .1.312.54.54 0 0 0 .24.171 1 1 0 0 0 .318.053.8.8 0 0 0 .306-.05.43.43 0 0 0 .184-.138.33.33 0 0 0 .066-.204m3.173 1.049q-.414 0-.743-.131a1.6 1.6 0 0 1-.56-.372 1.7 1.7 0 0 1-.348-.549 1.9 1.9 0 0 1-.121-.67v-.132q0-.404.115-.74t.329-.581a1.4 1.4 0 0 1 .526-.378q.309-.135.697-.135.377 0 .67.125.292.124.49.355.2.23.302.552.102.319.102.71v.394h-2.827v-.631h1.897v-.072a.8.8 0 0 0-.072-.352.57.57 0 0 0-.211-.25.65.65 0 0 0-.361-.092.6.6 0 0 0-.323.083.6.6 0 0 0-.22.23 1.2 1.2 0 0 0-.125.348 2.2 2.2 0 0 0-.04.434v.132q0 .213.06.394.063.18.174.312a.8.8 0 0 0 .276.204q.165.072.372.072.257 0 .476-.098a1 1 0 0 0 .385-.306l.46.5q-.111.16-.305.309a1.7 1.7 0 0 1-.461.243 1.9 1.9 0 0 1-.614.092"/><path class="tw-fill-secondary-700" d="m41.003 177.374.834-3.524h.466l.107.587-.889 3.601h-.5zm-.428-3.524.69 3.524-.057.664h-.558l-.93-4.188zm2.568 3.509.682-3.509h.854l-.926 4.188h-.558zm-.578-3.509.84 3.538-.023.65h-.5l-.895-3.604.115-.584zm3.34-.23v4.418h-.829v-4.418zm-.118 2.753h-.228q.003-.325.087-.599.083-.276.238-.477.156-.205.371-.316a1.04 1.04 0 0 1 .484-.113q.23 0 .417.067a.8.8 0 0 1 .325.207.9.9 0 0 1 .213.371q.074.23.074.558v1.967h-.834v-1.973a.7.7 0 0 0-.06-.325.33.33 0 0 0-.17-.17.6.6 0 0 0-.27-.052.65.65 0 0 0-.305.067.5.5 0 0 0-.199.184.8.8 0 0 0-.109.27 1.5 1.5 0 0 0-.034.334m4.291.963v-1.386q0-.15-.049-.256a.36.36 0 0 0-.152-.17.5.5 0 0 0-.262-.06.54.54 0 0 0-.239.049.34.34 0 0 0-.155.135.37.37 0 0 0-.055.204h-.828q0-.198.092-.377a.9.9 0 0 1 .267-.313q.175-.138.417-.216.246-.078.547-.078.362 0 .644.121a1 1 0 0 1 .443.363q.165.241.164.604v1.331q0 .257.032.42.031.162.092.282v.049h-.837q-.06-.126-.092-.316a3 3 0 0 1-.029-.386m.11-1.193.005.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.198.106.4.4 0 0 0-.115.156.5.5 0 0 0-.035.195q0 .106.05.193.048.083.14.132a.5.5 0 0 0 .216.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.219.351q-.045.118-.127.245a1.024 1.024 0 0 1-.489.42 1.1 1.1 0 0 1-.402.069q-.297 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.138-.483q0-.245.092-.435a.85.85 0 0 1 .27-.319 1.3 1.3 0 0 1 .452-.198q.27-.069.627-.069zm2.887-1.217v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .109.1.6.6 0 0 0 .181.026q.078 0 .138-.006.063-.008.107-.017l.002.61q-.105.035-.23.054a1.6 1.6 0 0 1-.273.021q-.273 0-.477-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm4.981 3.178v-1.386q0-.15-.048-.256a.36.36 0 0 0-.153-.17.5.5 0 0 0-.262-.06.54.54 0 0 0-.238.049.34.34 0 0 0-.156.135.37.37 0 0 0-.054.204h-.829q0-.198.092-.377a.9.9 0 0 1 .268-.313q.175-.138.417-.216.244-.078.546-.078.363 0 .645.121a1 1 0 0 1 .443.363q.164.241.164.604v1.331q0 .257.031.42.032.162.092.282v.049h-.837q-.06-.126-.092-.316a3 3 0 0 1-.029-.386m.11-1.193.006.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.199.106.4.4 0 0 0-.115.156.5.5 0 0 0-.034.195q0 .106.049.193.049.083.14.132a.5.5 0 0 0 .216.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.22.351q-.047.118-.127.245a1.022 1.022 0 0 1-.489.42 1.1 1.1 0 0 1-.403.069q-.296 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.138-.483q0-.245.093-.435a.85.85 0 0 1 .27-.319q.18-.132.451-.198.27-.069.627-.069zm2.192-.538v2.433h-.829v-3.112h.78zm.937-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.152-.008.9.9 0 0 0-.305.046.55.55 0 0 0-.213.129.6.6 0 0 0-.127.21 1 1 0 0 0-.046.282l-.166-.052q0-.302.06-.555.06-.255.175-.446a.9.9 0 0 1 .288-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.766 3.19q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.106-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331.27-.118.61-.118.33 0 .587.11t.429.31q.175.202.264.484.09.279.09.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .152.273.7.7 0 0 0 .242.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.402.437a1.2 1.2 0 0 1-.267.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m4.74-3.17v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .18.026q.078 0 .139-.006.063-.008.106-.017l.003.61a1.638 1.638 0 0 1-.503.075q-.274 0-.478-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm2.643-.538v4.418h-.828v-4.418zm-.118 2.753h-.227q.002-.325.087-.599.083-.276.238-.477.156-.205.371-.316a1.04 1.04 0 0 1 .483-.113q.231 0 .417.067a.8.8 0 0 1 .326.207.9.9 0 0 1 .212.371q.075.23.075.558v1.967h-.834v-1.973a.7.7 0 0 0-.06-.325.33.33 0 0 0-.17-.17.6.6 0 0 0-.27-.052.65.65 0 0 0-.305.067.5.5 0 0 0-.199.184.8.8 0 0 0-.11.27 1.5 1.5 0 0 0-.034.334m4.044 1.723q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.304-.481 1.6 1.6 0 0 1-.107-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331a1.5 1.5 0 0 1 .61-.118q.332 0 .587.11.256.11.429.31.175.202.264.484.09.279.09.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .153.273.7.7 0 0 0 .241.178.8.8 0 0 0 .325.063 1 1 0 0 0 .417-.086.9.9 0 0 0 .337-.267l.403.437a1.2 1.2 0 0 1-.268.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m4.045-2.572v3.711h-.829v-4.309h.768zm1.97.923v.061q0 .339-.08.63a1.6 1.6 0 0 1-.23.506 1.1 1.1 0 0 1-.38.334q-.225.118-.518.118-.285 0-.495-.115a1.04 1.04 0 0 1-.354-.323 1.9 1.9 0 0 1-.227-.486 4 4 0 0 1-.132-.592v-.158q.046-.34.132-.622.087-.284.227-.492.144-.209.351-.325.21-.114.492-.115.297 0 .52.113.228.111.38.322.155.21.233.5.08.291.08.644m-.831.061v-.061q0-.198-.035-.365a1 1 0 0 0-.104-.296.51.51 0 0 0-.457-.268.7.7 0 0 0-.29.055.5.5 0 0 0-.193.158.7.7 0 0 0-.112.248q-.037.144-.046.325v.399q.015.213.08.383a.6.6 0 0 0 .204.265.6.6 0 0 0 .363.097.5.5 0 0 0 .276-.071.55.55 0 0 0 .181-.205 1 1 0 0 0 .1-.299q.033-.17.033-.365m1.213.006v-.061q0-.342.098-.63.097-.29.285-.503a1.3 1.3 0 0 1 .46-.331q.273-.12.627-.121.354 0 .63.121.276.118.463.331.19.213.288.503.098.288.098.63v.061q0 .339-.098.63a1.5 1.5 0 0 1-.288.503 1.3 1.3 0 0 1-.46.331 1.6 1.6 0 0 1-.627.118q-.354 0-.63-.118a1.3 1.3 0 0 1-.463-.331 1.5 1.5 0 0 1-.285-.503 2 2 0 0 1-.098-.63m.829-.061v.061q0 .195.034.365.035.17.11.299a.6.6 0 0 0 .2.199.6.6 0 0 0 .303.071.6.6 0 0 0 .296-.071.55.55 0 0 0 .199-.199 1 1 0 0 0 .109-.299 1.7 1.7 0 0 0 .037-.365v-.061a1.6 1.6 0 0 0-.037-.356 1 1 0 0 0-.112-.3.56.56 0 0 0-.199-.207.6.6 0 0 0-.299-.074.6.6 0 0 0-.299.074.6.6 0 0 0-.198.207 1 1 0 0 0-.11.3q-.034.167-.034.356m4.153-1.527v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .109.1.6.6 0 0 0 .181.026q.078 0 .138-.006.063-.008.107-.017l.002.61q-.105.035-.23.054a1.6 1.6 0 0 1-.273.021q-.273 0-.477-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm3.267 3.938q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.106-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331.27-.118.61-.118.33 0 .587.11t.428.31q.177.202.265.484.09.279.09.621v.345H83.73v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .152.273.7.7 0 0 0 .242.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.402.437a1.2 1.2 0 0 1-.267.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m2.56-2.506v2.448h-.828v-3.112h.776zm-.12.783h-.225q0-.345.09-.622.088-.279.25-.474.16-.198.382-.302.225-.107.5-.107.22 0 .4.064.182.063.31.201a.9.9 0 0 1 .202.365q.072.228.072.555v1.985h-.834v-1.987a.74.74 0 0 0-.058-.323.33.33 0 0 0-.17-.161.7.7 0 0 0-.27-.049.6.6 0 0 0-.29.067.6.6 0 0 0-.201.184.9.9 0 0 0-.118.27q-.04.156-.04.334m4.135-1.447v.587H89.69v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .18.026q.078 0 .138-.006.064-.008.107-.017l.003.61q-.107.035-.23.054a1.6 1.6 0 0 1-.273.021q-.274 0-.478-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm2.71.768v3.112h-.832v-3.112zm-.883-.811a.4.4 0 0 1 .126-.299.48.48 0 0 1 .34-.118q.21 0 .336.118.13.117.13.299 0 .181-.13.299a.47.47 0 0 1-.337.118.48.48 0 0 1-.339-.118.4.4 0 0 1-.126-.299m3.247 3.221v-1.386q0-.15-.049-.256a.36.36 0 0 0-.153-.17.5.5 0 0 0-.261-.06.54.54 0 0 0-.239.049.34.34 0 0 0-.155.135.37.37 0 0 0-.055.204h-.828q0-.198.092-.377a.9.9 0 0 1 .267-.313q.175-.138.417-.216.245-.078.547-.078.362 0 .644.121a1 1 0 0 1 .443.363q.164.241.164.604v1.331q0 .257.032.42.03.162.092.282v.049h-.837a1.2 1.2 0 0 1-.092-.316 3 3 0 0 1-.03-.386m.11-1.193.005.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.198.106.4.4 0 0 0-.115.156.5.5 0 0 0-.035.195q0 .106.049.193.049.083.14.132a.5.5 0 0 0 .217.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.219.351q-.046.118-.127.245a1.025 1.025 0 0 1-.489.42 1.1 1.1 0 0 1-.403.069q-.295 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.137-.483q0-.245.092-.435a.85.85 0 0 1 .27-.319 1.3 1.3 0 0 1 .452-.198q.27-.069.627-.069zm2.237-2.523v4.418h-.831v-4.418zm3.834 3.558a.27.27 0 0 0-.052-.161.45.45 0 0 0-.192-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.739.739 0 0 1-.313-.618q0-.195.083-.368a.95.95 0 0 1 .244-.305q.162-.135.391-.21.234-.078.524-.078.405 0 .696.13.293.129.449.357.158.224.158.511h-.829a.45.45 0 0 0-.051-.215.35.35 0 0 0-.156-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.3.3 0 0 0-.023.302q.032.055.101.101a1 1 0 0 0 .178.086q.112.037.276.069.337.07.601.181.266.11.42.3.155.186.155.491 0 .207-.092.38a.9.9 0 0 1-.264.302 1.4 1.4 0 0 1-.414.199q-.24.069-.538.069-.434 0-.737-.156-.299-.155-.454-.394a.9.9 0 0 1-.153-.494h.786a.46.46 0 0 0 .086.273.47.47 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .267-.043.37.37 0 0 0 .161-.121.3.3 0 0 0 .058-.178m2.776.918q-.363 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.107-.587v-.115q0-.353.101-.647.1-.293.288-.509.19-.216.46-.331.27-.118.61-.118.33 0 .586.11t.429.31q.175.202.265.484.089.279.089.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.109.305 2 2 0 0 0-.034.379v.115q0 .187.051.346a.9.9 0 0 0 .153.273.7.7 0 0 0 .241.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.403.437a1.417 1.417 0 0 1-.67.483 1.7 1.7 0 0 1-.538.081m3.034-.648a.6.6 0 0 0 .271-.057.46.46 0 0 0 .255-.423h.78q-.003.328-.175.584-.173.253-.464.4a1.44 1.44 0 0 1-.65.144q-.362 0-.632-.121a1.2 1.2 0 0 1-.446-.334 1.5 1.5 0 0 1-.268-.5 2.1 2.1 0 0 1-.089-.616v-.083q0-.331.089-.616.09-.288.268-.5.178-.216.446-.337.267-.12.627-.121.382 0 .67.147.29.147.454.42.167.27.17.641h-.78a.6.6 0 0 0-.066-.281.497.497 0 0 0-.463-.279.5.5 0 0 0-.296.077.5.5 0 0 0-.178.207 1 1 0 0 0-.089.297 2.4 2.4 0 0 0-.024.345v.083q0 .182.024.348.023.167.086.296a.5.5 0 0 0 .181.205q.115.075.299.074m3.627-.155v-2.367h.829v3.112h-.78zm.092-.638.245-.006q0 .31-.072.578-.072.264-.216.46a1 1 0 0 1-.362.302 1.2 1.2 0 0 1-.515.107q-.228 0-.42-.064a.85.85 0 0 1-.328-.204 1 1 0 0 1-.213-.359 1.7 1.7 0 0 1-.075-.533v-2.01h.829v2.016q0 .138.031.233a.4.4 0 0 0 .095.156q.06.06.141.086a.6.6 0 0 0 .184.026.7.7 0 0 0 .403-.104q.15-.103.21-.282a1.2 1.2 0 0 0 .063-.402m2.198-1.05v2.433h-.829v-3.112h.78zm.937-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.152-.008.9.9 0 0 0-.305.046.6.6 0 0 0-.213.129.56.56 0 0 0-.126.21 1 1 0 0 0-.046.282l-.167-.052q0-.302.06-.555.06-.255.176-.446a.9.9 0 0 1 .287-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.266.02v3.112h-.831v-3.112zm-.883-.811a.4.4 0 0 1 .126-.299.48.48 0 0 1 .34-.118.47.47 0 0 1 .336.118q.13.117.13.299 0 .181-.13.299a.47.47 0 0 1-.336.118.48.48 0 0 1-.34-.118.4.4 0 0 1-.126-.299m3.092.811v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.034.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .181.026q.078 0 .138-.006.064-.008.106-.017l.003.61a1.629 1.629 0 0 1-.503.075q-.273 0-.478-.09a.66.66 0 0 1-.31-.293q-.11-.201-.109-.529zm2.758 3.529.825-2.761h.889l-1.251 3.581a2 2 0 0 1-.109.253 1 1 0 0 1-.182.256.8.8 0 0 1-.284.201 1 1 0 0 1-.417.078q-.118 0-.193-.014a3 3 0 0 1-.178-.041v-.607h.066l.066.003a.8.8 0 0 0 .267-.037.37.37 0 0 0 .167-.115.6.6 0 0 0 .101-.196zm-.345-2.761.676 2.255.118.877-.564.061-1.119-3.193zm4.685.679v2.433h-.828v-3.112h.779zm.938-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.153-.008.9.9 0 0 0-.304.046.54.54 0 0 0-.213.129.6.6 0 0 0-.127.21 1 1 0 0 0-.046.282l-.167-.052q0-.302.061-.555.06-.255.175-.446a.9.9 0 0 1 .288-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.265.02v3.112h-.831v-3.112zm-.883-.811q0-.182.127-.299a.48.48 0 0 1 .339-.118q.21 0 .337.118a.39.39 0 0 1 .129.299q0 .181-.129.299a.47.47 0 0 1-.337.118.48.48 0 0 1-.339-.118.4.4 0 0 1-.127-.299m3.251 3.063a.27.27 0 0 0-.052-.161.46.46 0 0 0-.193-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.8.8 0 0 1-.23-.264.75.75 0 0 1-.083-.354.84.84 0 0 1 .328-.673q.161-.135.391-.21.233-.078.523-.078.406 0 .697.13.293.129.448.357a.86.86 0 0 1 .158.511h-.828a.44.44 0 0 0-.052-.215.34.34 0 0 0-.155-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.3.3 0 0 0-.052.173q0 .072.029.129.031.055.1.101a1 1 0 0 0 .179.086q.111.037.276.069.336.07.601.181t.42.3a.74.74 0 0 1 .155.491.8.8 0 0 1-.092.38.9.9 0 0 1-.265.302 1.4 1.4 0 0 1-.414.199 2 2 0 0 1-.538.069q-.434 0-.736-.156a1.16 1.16 0 0 1-.454-.394.9.9 0 0 1-.153-.494h.785a.46.46 0 0 0 .087.273.46.46 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .267-.043.37.37 0 0 0 .161-.121.3.3 0 0 0 .058-.178m2.171-3.561v4.421h-.828v-4.421zm1.962 1.309-1.352 1.542-.725.733-.302-.598.575-.731.809-.946zm-.86 3.112-.921-1.438.573-.501 1.303 1.939zm2.899-.86a.27.27 0 0 0-.052-.161.44.44 0 0 0-.192-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.735.735 0 0 1-.314-.618.8.8 0 0 1 .084-.368.95.95 0 0 1 .244-.305q.162-.135.391-.21.233-.078.524-.078.405 0 .696.13.293.129.449.357.158.224.158.511h-.828a.45.45 0 0 0-.052-.215.35.35 0 0 0-.156-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.31.31 0 0 0-.023.302q.032.055.101.101a1 1 0 0 0 .178.086q.112.037.276.069.337.07.601.181.266.11.42.3a.74.74 0 0 1 .156.491.8.8 0 0 1-.092.38.9.9 0 0 1-.265.302 1.4 1.4 0 0 1-.414.199 2 2 0 0 1-.538.069q-.435 0-.736-.156a1.17 1.17 0 0 1-.455-.394.9.9 0 0 1-.152-.494h.785a.46.46 0 0 0 .086.273.47.47 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .268-.043.4.4 0 0 0 .161-.121.3.3 0 0 0 .057-.178m2.756-.42h-.734a2.5 2.5 0 0 1 .041-.446q.039-.189.135-.342.097-.153.259-.302.135-.121.235-.23a1 1 0 0 0 .159-.224.6.6 0 0 0 .057-.262.64.64 0 0 0-.052-.276.35.35 0 0 0-.149-.17.5.5 0 0 0-.248-.058.5.5 0 0 0-.23.055.43.43 0 0 0-.175.161.6.6 0 0 0-.069.288h-.834q.008-.395.181-.65.175-.259.469-.383a1.65 1.65 0 0 1 .658-.126q.403 0 .691.132a.96.96 0 0 1 .44.383q.152.25.152.609a1 1 0 0 1-.098.446q-.097.193-.256.36a8 8 0 0 1-.348.345.8.8 0 0 0-.224.308 1.2 1.2 0 0 0-.06.382m-.82.889q0-.184.127-.305a.47.47 0 0 1 .339-.124.46.46 0 0 1 .336.124q.13.121.13.305a.4.4 0 0 1-.13.302.46.46 0 0 1-.336.124.47.47 0 0 1-.339-.124.4.4 0 0 1-.127-.302"/><g class="tw-fill-secondary-700" clip-path="url(#h)"><path d="M141.027 174.75c0-.291.235-.526.526-.526h1.472a.315.315 0 1 0 0-.631h-1.472c-.639 0-1.157.518-1.157 1.157v3.576c0 .639.518 1.157 1.157 1.157h3.576c.639 0 1.157-.518 1.157-1.157v-1.472a.315.315 0 1 0-.631 0v1.472a.525.525 0 0 1-.526.526h-3.576a.525.525 0 0 1-.526-.526z"/><path d="M144.498 173.593a.316.316 0 1 0 0 .631h.711l-1.776 1.775a.317.317 0 0 0 .447.447l1.775-1.776v.711a.316.316 0 0 0 .631 0v-1.473a.315.315 0 0 0-.315-.315z"/></g></g><path class="tw-stroke-secondary-100" stroke-width=".421" d="M30.939 63.596h124.123c5.461 0 9.888 4.428 9.888 9.889v106.031c0 5.461-4.427 9.887-9.888 9.887H30.939c-5.461 0-9.89-4.426-9.89-9.887V73.485c0-5.461 4.429-9.89 9.89-9.89Z"/></g></g><defs><clipPath id="b"><path class="tw-fill-background" d="M155.801 8.317h11.438v11.438h-11.438z"/></clipPath><clipPath id="c"><rect width="154" height="205" x="16" y="24" class="tw-fill-background" rx="4.918"/></clipPath><clipPath id="d"><path class="tw-fill-background" d="M21.874 57.75h143.253v14.345H21.874z"/></clipPath><clipPath id="e"><rect width="154" height="205" x="16" y="24" class="tw-fill-background" rx="4.918"/></clipPath><clipPath id="g"><path class="tw-fill-background" d="M20.84 73.484c0-5.577 4.521-10.098 10.098-10.098h124.125c5.577 0 10.098 4.521 10.098 10.098v106.032c0 5.577-4.521 10.098-10.098 10.098H30.938c-5.577 0-10.098-4.521-10.098-10.098z"/></clipPath><clipPath id="h"><path class="tw-fill-background" d="M139.976 173.172h6.732v6.732h-6.732z"/></clipPath><filter id="a" width="184.857" height="228.234" x="6.26" y="1.883" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation=".558"/><feColorMatrix values="0 0 0 0 0.4 0 0 0 0 0.4 0 0 0 0 0.5 0 0 0 0.35 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_6463_20789"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_6463_20789" result="shape"/></filter><filter id="f" width="161.152" height="143.059" x="12.425" y="63.386" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feMorphology in="SourceAlpha" radius="2.104" result="effect1_dropShadow_6463_20789"/><feOffset dy="8.415"/><feGaussianBlur stdDeviation="5.26"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_6463_20789"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feMorphology in="SourceAlpha" radius="2.525" result="effect2_dropShadow_6463_20789"/><feOffset dy="3.366"/><feGaussianBlur stdDeviation="2.104"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend in2="effect1_dropShadow_6463_20789" result="effect2_dropShadow_6463_20789"/><feBlend in="SourceGraphic" in2="effect2_dropShadow_6463_20789" result="shape"/></filter></defs></svg>
`;var wt=i(8168);const It=["step0"],bt=["step1"];function Bt(e,t){1&e&&(y.j41(0,"span",5),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,1,"autoConfirmSingleOrgExemption")," "))}function Et(e,t){1&e&&(y.j41(0,"span",5),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,1,"autoConfirmSingleOrgRequired")," "))}function St(e,t){if(1&e&&(y.j41(0,"p",3),y.EFF(1),y.nI1(2,"i18n"),y.k0s(),y.j41(3,"ul",4)(4,"li")(5,"span",5),y.EFF(6),y.nI1(7,"i18n"),y.k0s(),y.EFF(8),y.nI1(9,"i18n"),y.j41(10,"a",6),y.EFF(11),y.nI1(12,"i18n"),y.k0s()(),y.j41(13,"li"),y.nVh(14,Bt,3,3,"span",5),y.nI1(15,"async"),y.vZN(16,Et,3,3,"span",5),y.EFF(17),y.nI1(18,"i18n"),y.k0s(),y.j41(19,"li")(20,"span",5),y.EFF(21),y.nI1(22,"i18n"),y.k0s(),y.EFF(23),y.nI1(24,"i18n"),y.k0s()(),y.nrm(25,"input",7),y.j41(26,"bit-label"),y.EFF(27),y.nI1(28,"i18n"),y.k0s()),2&e){const e=y.XpG();y.R7$(),y.SpI(" ",y.bMT(2,10,"autoConfirmPolicyEditDescription")," "),y.R7$(5),y.SpI(" ",y.bMT(7,12,"autoConfirmAcceptSecurityRiskTitle")," "),y.R7$(2),y.SpI(" ",y.bMT(9,14,"autoConfirmAcceptSecurityRiskDescription")," "),y.R7$(3),y.SpI(" ",y.bMT(12,16,"autoConfirmAcceptSecurityRiskLearnMore")," "),y.R7$(3),y.vxM(y.bMT(15,18,e.singleOrgEnabled$)?14:16),y.R7$(3),y.SpI(" ",y.bMT(18,20,"autoConfirmSingleOrgRequiredDesc")," "),y.R7$(4),y.SpI(" ",y.bMT(22,22,"autoConfirmNoEmergencyAccess")," "),y.R7$(2),y.SpI(" ",y.bMT(24,24,"autoConfirmNoEmergencyAccessDescription")," "),y.R7$(2),y.Y8G("formControl",e.enabled),y.R7$(2),y.JRh(y.bMT(28,26,"autoConfirmCheckBoxLabel"))}}function Qt(e,t){if(1&e&&(y.j41(0,"div",8),y.nrm(1,"bit-svg",9),y.k0s(),y.j41(2,"ol")(3,"li"),y.EFF(4),y.nI1(5,"i18n"),y.k0s(),y.j41(6,"li"),y.EFF(7),y.nI1(8,"i18n"),y.j41(9,"strong"),y.EFF(10),y.nI1(11,"i18n"),y.k0s()()()),2&e){const e=y.XpG();y.R7$(),y.Y8G("content",e.autoConfirmSvg),y.R7$(3),y.SpI("1. ",y.bMT(5,4,"autoConfirmExtension1")),y.R7$(3),y.SpI(" 2. ",y.bMT(8,6,"autoConfirmExtension2")," "),y.R7$(3),y.SpI(" ",y.bMT(11,8,"autoConfirmExtension3")," ")}}class kt extends Ie{constructor(){super(...arguments),this.name="automaticUserConfirmation",this.description="autoConfirmDescription",this.type=b.tt.AutoConfirm,this.category=$,this.priority=90,this.component=Tt,this.showDescription=!1,this.editDialogComponent=Ht}display$(e,t){return t.getFeatureFlag$(ye.TO.AutoConfirm).pipe((0,o.T)(t=>t&&e.useAutomaticUserConfirmation))}}class Tt extends be{constructor(){super(...arguments),this.autoConfirmSvg=Ct,this.policyForm=(0,m.ebz)("step0"),this.extensionButton=(0,m.ebz)("step1"),this.step=0,this.steps=[this.policyForm,this.extensionButton],this.singleOrgEnabled$=new He.t(!1)}setSingleOrgEnabled(e){this.singleOrgEnabled$.next(e)}setStep(e){this.step=e}}Tt.ɵfac=(()=>{let e;return function(t){return(e||(e=y.xGo(Tt)))(t||Tt)}})(),Tt.ɵcmp=y.VBU({type:Tt,selectors:[["auto-confirm-policy-edit"]],viewQuery:function(e,t){1&e&&(y.wEZ(t.policyForm,It,5),y.wEZ(t.extensionButton,bt,5)),2&e&&y.NyB(2)},features:[y.Vt3],decls:5,vars:1,consts:[["step0",""],["step1",""],[3,"ngTemplateOutlet"],[1,"tw-mb-6"],[1,"tw-mb-6","tw-pl-6"],[1,"tw-font-medium"],["bitLink","","href","https://bitwarden.com/help/automatic-confirmation/","target","_blank","endIcon","bwi-external-link"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[1,"tw-flex","tw-justify-center","tw-mb-6"],[1,"tw-w-[233px]",3,"content"]],template:function(e,t){1&e&&(y.eu8(0,2),y.DNE(1,St,29,28,"ng-template",null,0,y.C5r)(3,Qt,12,10,"ng-template",null,1,y.C5r)),2&e&&y.Y8G("ngTemplateOutlet",t.steps[t.step]())},dependencies:[f.G,D.T3,F.Zm,F.BC,F.l_,Ee.P,Qe.j,wt.k,Ye.g,D.Jj,N.$],encapsulation:2,changeDetection:0});var Ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Pt=["step0"],Rt=["step1"],Dt=["step0Title"],Mt=["step1Title"];function xt(e,t){if(1&e&&y.eu8(0,8),2&e){y.XpG();const e=y.r8f(3);y.Y8G("ngTemplateOutlet",e)}}function Ot(e,t){1&e&&(y.j41(0,"div"),y.nrm(1,"i",13),y.nI1(2,"i18n"),y.j41(3,"span",14),y.EFF(4),y.nI1(5,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("title",y.mNQ(y.bMT(2,3,"loading"))),y.R7$(3),y.JRh(y.bMT(5,5,"loading")))}function Gt(e,t){if(1&e&&(y.j41(0,"p",11),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e){const e=y.XpG();y.R7$(),y.JRh(y.bMT(2,1,e.policy.description))}}function Ut(e,t){}function Vt(e,t){if(1&e&&y.eu8(0,8),2&e){y.XpG();const e=y.r8f(13);y.Y8G("ngTemplateOutlet",e)}}function jt(e,t){1&e&&(y.j41(0,"span",16),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,1,"availableNow")))}function Nt(e,t){if(1&e&&(y.j41(0,"span",18),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e){const e=y.XpG(2);y.R7$(),y.SpI(" ",y.bMT(2,1,e.policy.name)," ")}}function zt(e,t){if(1&e&&(y.j41(0,"div",15),y.nVh(1,jt,3,3,"span",16),y.j41(2,"span",17),y.EFF(3),y.nI1(4,"i18n"),y.nVh(5,Nt,3,3,"span",18),y.k0s()()),2&e){const e=y.XpG().firstTimeDialog();y.R7$(),y.vxM(e?1:-1),y.R7$(2),y.SpI(" ",y.bMT(4,3,e?"automaticUserConfirmation":"editPolicy")," "),y.R7$(2),y.vxM(e?-1:5)}}function Yt(e,t){1&e&&(y.EFF(0),y.nI1(1,"i18n")),2&e&&y.SpI(" ",y.bMT(1,1,"howToTurnOnAutoConfirm"),"\n")}function Lt(e,t){1&e&&(y.EFF(0),y.nI1(1,"i18n")),2&e&&y.SpI(" ",y.bMT(1,1,"save")," ")}function Kt(e,t){1&e&&(y.EFF(0),y.nI1(1,"i18n")),2&e&&y.SpI(" ",y.bMT(1,1,"continue")," ")}function Xt(e,t){if(1&e&&(y.j41(0,"button",19),y.nI1(1,"async"),y.SS7(2),y.nI1(3,"async"),y.SS7(4),y.nI1(5,"async"),y.nVh(6,Lt,2,3)(7,Kt,2,3),y.k0s(),y.j41(8,"button",20),y.EFF(9),y.nI1(10,"i18n"),y.k0s()),2&e){const e=y.XpG();y.Y8G("disabled",y.bMT(1,3,e.saveDisabled$));const t=y.bMT(3,5,e.autoConfirmEnabled$),i=y.bMT(5,7,e.managePoliciesOnly$);y.R7$(6),y.vxM(t||i?6:7),y.R7$(3),y.SpI(" ",y.bMT(10,9,"cancel")," ")}}function qt(e,t){if(1&e&&(y.j41(0,"button",21),y.nI1(1,"async"),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"button",20),y.EFF(5),y.nI1(6,"i18n"),y.k0s()),2&e){const e=y.XpG();y.Y8G("disabled",y.bMT(1,3,e.saveDisabled$)),y.R7$(2),y.SpI(" ",y.bMT(3,5,"openExtension")," "),y.R7$(3),y.SpI(" ",y.bMT(6,7,"close")," ")}}class Ht extends q{get typedPolicyComponent(){const e=this.policyComponent();return e instanceof Tt?e:void 0}constructor(e,t,i,n,s,l,c,d,A,p,g,v,f){var y;super(e,t,i,n,s,l,c,d,A),this.data=e,this.organizationService=p,this.policyService=g,this.router=v,this.autoConfirmService=f,this.policyType=b.tt,this.firstTimeDialog=(0,C.vPA)(!1),this.currentStep=(0,C.vPA)(0),this.multiStepSubmit=(0,r.of)([]),this.autoConfirmEnabled$=this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.policyService.policies$(e)),(0,o.T)(e=>{var t,i;return null!==(i=null===(t=e.find(e=>e.type===b.tt.AutoConfirm))||void 0===t?void 0:t.enabled)&&void 0!==i&&i})),this.managePoliciesOnly$=this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.organizationService.organizations$(e)),(0,h.Hc)(this.data.organization.id),(0,o.T)(e=>{var t;return null!==(t=!(null==e?void 0:e.isAdmin)&&(null==e?void 0:e.canManagePolicies))&&void 0!==t&&t})),this.submitPolicy=(0,m.ebz)("step0"),this.openExtension=(0,m.ebz)("step1"),this.submitPolicyTitle=(0,m.ebz)("step0Title"),this.openExtensionTitle=(0,m.ebz)("step1Title"),this.submit=()=>Ft(this,void 0,void 0,function*(){const e=this.typedPolicyComponent;if(!e)throw new Error("PolicyComponent not initialized.");if(0!=(yield e.confirm()))try{const t=yield(0,w._)(this.multiStepSubmit),i=t[this.currentStep()].sideEffect;if(i&&(yield i()),this.currentStep()===t.length-1)return void this.dialogRef.close("saved");this.currentStep.update(e=>e+1),e.setStep(this.currentStep())}catch(t){this.toastService.showToast({variant:"error",message:t.message})}else this.dialogRef.close()}),this.firstTimeDialog.set(null!==(y=e.firstTimeDialog)&&void 0!==y&&y)}ngAfterViewInit(){const e=Object.create(null,{ngAfterViewInit:{get:()=>super.ngAfterViewInit}});return Ft(this,void 0,void 0,function*(){yield e.ngAfterViewInit.call(this);const t=this.typedPolicyComponent;t&&(this.saveDisabled$=(0,s.z)([this.autoConfirmEnabled$,t.enabled.valueChanges.pipe((0,ft.Z)(t.enabled.value))]).pipe((0,o.T)(([e,t])=>!e&&!t))),this.multiStepSubmit=this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.policyService.policies$(e)),(0,o.T)(e=>{var t,i;return null!==(i=null===(t=e.find(e=>e.type===b.tt.SingleOrg))||void 0===t?void 0:t.enabled)&&void 0!==i&&i}),(0,mt.M)(e=>{var t;return null===(t=this.typedPolicyComponent)||void 0===t?void 0:t.setSingleOrgEnabled(e)}),(0,a.n)(e=>this.buildMultiStepSubmit(e)),(0,l.t)({bufferSize:1,refCount:!0}))})}buildMultiStepSubmit(e){return this.managePoliciesOnly$.pipe((0,o.T)(t=>{const i=[{sideEffect:()=>this.handleSubmit(null!=e&&e),footerContent:this.submitPolicy,titleContent:this.submitPolicyTitle}];return t||i.push({sideEffect:()=>this.openBrowserExtension(),footerContent:this.openExtension,titleContent:this.openExtensionTitle}),i}))}handleSubmit(e){return Ft(this,void 0,void 0,function*(){const t=!e;t&&(yield this.setSingleOrgPolicy(!0));try{yield this.submitAutoConfirm()}catch(i){throw t&&(yield this.setSingleOrgPolicy(!1)),i}})}submitAutoConfirm(){return Ft(this,void 0,void 0,function*(){const e=this.typedPolicyComponent;if(!e)throw new Error("PolicyComponent not initialized.");const t=yield e.buildRequest();yield this.policyApiService.putPolicyVNext(this.data.organization.id,this.data.policy.type,{policy:t});const i=yield(0,w._)(this.accountService.activeAccount$.pipe(u.F6)),n=yield(0,w._)(this.autoConfirmService.configuration$(i));yield this.autoConfirmService.upsert(i,Object.assign(Object.assign({},n),{showSetupDialog:!1})),this.toastService.showToast({variant:"success",message:this.i18nService.t("editedPolicyId",this.i18nService.t(this.data.policy.name))}),e.enabled.value||this.dialogRef.close("saved")})}setSingleOrgPolicy(e){return Ft(this,void 0,void 0,function*(){const t={enabled:e,data:null};yield this.policyApiService.putPolicyVNext(this.data.organization.id,b.tt.SingleOrg,{policy:t})})}openBrowserExtension(){return Ft(this,void 0,void 0,function*(){yield this.router.navigate(["/browser-extension-prompt"],{queryParams:{url:"AutoConfirm"}})})}}Ht.open=(e,t)=>e.open(Ht,t),Ht.ɵfac=function(e){return new(e||Ht)(y.rXU(E.Qs),y.rXU(Q.D),y.rXU(k.m),y.rXU(T.W),y.rXU(m.gRc),y.rXU(F.ok),y.rXU(P.ce),y.rXU(R.f),y.rXU(S.Lu),y.rXU(d.PV),y.rXU(te.m),y.rXU(ee.Ix),y.rXU(yt.zh))},Ht.ɵcmp=y.VBU({type:Ht,selectors:[["ng-component"]],viewQuery:function(e,t){1&e&&(y.wEZ(t.submitPolicy,Pt,5),y.wEZ(t.openExtension,Rt,5),y.wEZ(t.submitPolicyTitle,Dt,5),y.wEZ(t.openExtensionTitle,Mt,5)),2&e&&y.NyB(4)},features:[y.Vt3],decls:24,vars:14,consts:[["policyForm",""],["step0Title",""],["step1Title",""],["step0",""],["step1",""],[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],[3,"ngTemplateOutlet"],["bitDialogContent",""],[3,"hidden"],["bitTypography","body1"],["bitDialogFooter",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-flex","tw-flex-col"],["bitBadge","","variant","info",1,"tw-w-[99px]","tw-my-2"],[1,"tw-flex","tw-items-center","tw-gap-2"],[1,"tw-text-muted","tw-font-normal","tw-text-sm"],["bitButton","","buttonType","primary","bitFormButton","","type","submit",3,"disabled"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"],["bitButton","","buttonType","primary","bitFormButton","","type","submit","endIcon","bwi-external-link",3,"disabled"]],template:function(e,t){if(1&e&&(y.j41(0,"form",5)(1,"bit-dialog",6),y.qex(2,7),y.SS7(3),y.nI1(4,"async"),y.nVh(5,xt,1,1,"ng-container",8),y.bVm(),y.qex(6,9),y.nVh(7,Ot,6,7,"div"),y.j41(8,"div",10),y.nVh(9,Gt,3,3,"p",11),y.k0s(),y.DNE(10,Ut,0,0,"ng-template",null,0,y.C5r),y.bVm(),y.qex(12,12),y.SS7(13),y.nI1(14,"async"),y.nVh(15,Vt,1,1,"ng-container",8),y.bVm(),y.k0s()(),y.DNE(16,zt,6,5,"ng-template",null,1,y.C5r)(18,Yt,2,3,"ng-template",null,2,y.C5r)(20,Xt,11,11,"ng-template",null,3,y.C5r)(22,qt,7,9,"ng-template",null,4,y.C5r)),2&e){let e,i;y.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),y.R7$(),y.Y8G("loading",t.loading()),y.R7$(2);const n=y.bH3(null==(e=y.bMT(4,8,t.multiStepSubmit)[t.currentStep()])?null:e.titleContent());y.R7$(2),y.vxM(n?5:-1),y.R7$(2),y.vxM(t.loading()?7:-1),y.R7$(),y.Y8G("hidden",t.loading()),y.R7$(),y.vxM(t.policy.showDescription?9:-1),y.R7$(4);const r=y.bH3(null==(i=y.bMT(14,11,t.multiStepSubmit)[t.currentStep()])?null:i.footerContent());y.R7$(2),y.vxM(r?15:-1)}},dependencies:[f.G,D.T3,F.qT,F.cb,F.j4,M.$,x.L,ne.n,O.Q,G.I,U.m,V.hJ,j.r,D.Jj,N.$],encapsulation:2});var Wt=i(43008),$t=i(84079),Jt=i(75811),Zt=i(60512),_t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ei=["step0"],ti=["step0Title"];function ii(e,t){if(1&e&&y.eu8(0,6),2&e){y.XpG();const e=y.r8f(3);y.Y8G("ngTemplateOutlet",e)}}function ni(e,t){1&e&&(y.j41(0,"div"),y.nrm(1,"i",11),y.nI1(2,"i18n"),y.j41(3,"span",12),y.EFF(4),y.nI1(5,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.Y8G("title",y.mNQ(y.bMT(2,3,"loading"))),y.R7$(3),y.JRh(y.bMT(5,5,"loading")))}function ri(e,t){if(1&e&&(y.j41(0,"p",9),y.EFF(1),y.nI1(2,"i18n"),y.k0s()),2&e){const e=y.XpG();y.R7$(),y.JRh(y.bMT(2,1,e.policy.description))}}function si(e,t){}function oi(e,t){if(1&e&&y.eu8(0,6),2&e){y.XpG();const e=y.r8f(12);y.Y8G("ngTemplateOutlet",e)}}function ai(e,t){if(1&e&&(y.EFF(0),y.nI1(1,"i18n")),2&e){const e=y.XpG();y.SpI(" ",y.bMT(1,1,e.policy.name),"\n")}}function li(e,t){if(1&e&&(y.j41(0,"button",13),y.nI1(1,"async"),y.EFF(2),y.nI1(3,"i18n"),y.k0s(),y.j41(4,"button",14),y.EFF(5),y.nI1(6,"i18n"),y.k0s()),2&e){const e=y.XpG();y.Y8G("disabled",y.bMT(1,3,e.saveDisabled$)),y.R7$(2),y.SpI(" ",y.bMT(3,5,"save")," "),y.R7$(3),y.SpI(" ",y.bMT(6,7,"cancel")," ")}}class ci extends q{get typedPolicyComponent(){const e=this.policyComponent();return e instanceof Ai?e:void 0}constructor(e,t,i,n,s,a,l,c,d){super(e,t,i,n,s,a,l,c,d),this.data=e,this.keyService=d,this.policyType=b.tt,this.centralizeDataOwnershipEnabled$=(0,Wt.v)(()=>(0,$t.H)(this.policyApiService.getPolicy(this.data.organization.id,b.tt.OrganizationDataOwnership)).pipe((0,o.T)(e=>e.enabled),(0,Jt.W)(()=>(0,r.of)(!1)))),this.currentStep=(0,C.vPA)(0),this.multiStepSubmit=(0,C.vPA)([]),this.policyForm=m.ebz.required("step0"),this.policyFormTitle=m.ebz.required("step0Title"),this.submit=()=>_t(this,void 0,void 0,function*(){const e=this.typedPolicyComponent;if(!e)throw new Error("PolicyComponent not initialized.");if(0!=(yield e.confirm()))try{const e=this.multiStepSubmit()[this.currentStep()].sideEffect;if(e&&(yield e()),this.currentStep()===this.multiStepSubmit().length-1)return void this.dialogRef.close("saved");this.currentStep.update(e=>e+1)}catch(t){this.toastService.showToast({variant:"error",message:t.message})}else this.dialogRef.close()})}ngAfterViewInit(){const e=Object.create(null,{ngAfterViewInit:{get:()=>super.ngAfterViewInit}});return _t(this,void 0,void 0,function*(){yield e.ngAfterViewInit.call(this);const t=this.typedPolicyComponent;t&&(this.saveDisabled$=(0,s.z)([this.centralizeDataOwnershipEnabled$,t.enabled.valueChanges.pipe((0,ft.Z)(t.enabled.value))]).pipe((0,o.T)(([e,t])=>!e&&!t))),this.multiStepSubmit.set(this.buildMultiStepSubmit())})}buildMultiStepSubmit(){return[{sideEffect:()=>this.handleSubmit(),footerContent:this.policyForm,titleContent:this.policyFormTitle}]}handleSubmit(){return _t(this,void 0,void 0,function*(){const e=this.typedPolicyComponent;if(!e)throw new Error("PolicyComponent not initialized.");const t=yield(0,w._)(this.accountService.activeAccount$.pipe(u.F6,(0,a.n)(e=>this.keyService.orgKeys$(e))));(0,Zt.x)(t,"Org key not provided");const i=yield e.buildVNextRequest(t[this.data.organization.id]);yield this.policyApiService.putPolicyVNext(this.data.organization.id,this.data.policy.type,i),this.toastService.showToast({variant:"success",message:this.i18nService.t("editedPolicyId",this.i18nService.t(this.data.policy.name))}),e.enabled.value||this.dialogRef.close("saved")})}}ci.open=(e,t)=>e.open(ci,t),ci.ɵfac=function(e){return new(e||ci)(y.rXU(E.Qs),y.rXU(Q.D),y.rXU(k.m),y.rXU(T.W),y.rXU(m.gRc),y.rXU(F.ok),y.rXU(P.ce),y.rXU(R.f),y.rXU(S.Lu))},ci.ɵcmp=y.VBU({type:ci,selectors:[["ng-component"]],viewQuery:function(e,t){1&e&&(y.wEZ(t.policyForm,ei,5),y.wEZ(t.policyFormTitle,ti,5)),2&e&&y.NyB(2)},features:[y.Vt3],decls:18,vars:10,consts:[["policyForm",""],["step0Title",""],["step0",""],[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],[3,"ngTemplateOutlet"],["bitDialogContent",""],[3,"hidden"],["bitTypography","body1"],["bitDialogFooter",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitButton","","buttonType","primary","bitFormButton","","type","submit",3,"disabled"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"]],template:function(e,t){if(1&e&&(y.j41(0,"form",3)(1,"bit-dialog",4),y.qex(2,5),y.SS7(3),y.nVh(4,ii,1,1,"ng-container",6),y.bVm(),y.qex(5,7),y.nVh(6,ni,6,7,"div"),y.j41(7,"div",8),y.nVh(8,ri,3,3,"p",9),y.k0s(),y.DNE(9,si,0,0,"ng-template",null,0,y.C5r),y.bVm(),y.qex(11,10),y.SS7(12),y.nVh(13,oi,1,1,"ng-container",6),y.bVm(),y.k0s()(),y.DNE(14,ai,2,3,"ng-template",null,1,y.C5r)(16,li,7,9,"ng-template",null,2,y.C5r)),2&e){let e,i;y.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),y.R7$(),y.Y8G("loading",t.loading()),y.R7$(2);const n=y.bH3(null==(e=t.multiStepSubmit()[t.currentStep()])?null:e.titleContent());y.R7$(),y.vxM(n?4:-1),y.R7$(2),y.vxM(t.loading()?6:-1),y.R7$(),y.Y8G("hidden",t.loading()),y.R7$(),y.vxM(t.policy.showDescription?8:-1),y.R7$(4);const r=y.bH3(null==(i=t.multiStepSubmit()[t.currentStep()])?null:i.footerContent());y.R7$(),y.vxM(r?13:-1)}},dependencies:[f.G,D.T3,F.qT,F.cb,F.j4,M.$,x.L,O.Q,G.I,U.m,V.hJ,j.r,D.Jj,N.$],encapsulation:2});var di=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ui(e,t){1&e&&(y.j41(0,"bit-callout",5),y.EFF(1),y.nI1(2,"i18n"),y.j41(3,"a",0),y.EFF(4),y.nI1(5,"i18n"),y.k0s()()),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,2,"promptUsersToMoveItemsCallout")," "),y.R7$(3),y.SpI(" ",y.bMT(5,4,"centralizeDataOwnershipWarningLink")," "))}function hi(e,t){if(1&e&&(y.j41(0,"bit-form-control"),y.nrm(1,"input",4),y.j41(2,"bit-label"),y.EFF(3),y.nI1(4,"i18n"),y.k0s()(),y.nVh(5,ui,6,6,"bit-callout",5)),2&e){const e=y.XpG();y.R7$(),y.Y8G("formControl",e.data.controls.enableIndividualItemsTransfer),y.R7$(2),y.JRh(y.bMT(4,3,"promptUsersToMoveItems")),y.R7$(2),y.vxM(e.enableIndividualItemsTransfer()?5:-1)}}class Ai extends be{constructor(e,t,i,r,s){super(),this.i18nService=e,this.encryptService=t,this.formBuilder=i,this.organizationService=r,this.accountService=s,this.useMyItems=(0,C.vPA)(!1),this.data=this.formBuilder.group({enableIndividualItemsTransfer:[{value:!1,disabled:!0}]}),this.enableIndividualItemsTransfer=(0,n.ot)(this.data.controls.enableIndividualItemsTransfer.valueChanges.pipe((0,ft.Z)(!1)),{initialValue:!1}),this.enabled.valueChanges.pipe((0,n.pQ)()).subscribe(e=>{e&&this.useMyItems()?this.data.controls.enableIndividualItemsTransfer.enable():(this.data.controls.enableIndividualItemsTransfer.disable(),this.data.controls.enableIndividualItemsTransfer.setValue(!1))})}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return di(this,void 0,void 0,function*(){var t,i;e.ngOnInit.call(this);const n=null===(t=this.policyResponse)||void 0===t?void 0:t.organizationId;if(n){const e=yield(0,w._)(this.accountService.activeAccount$.pipe(u.F6)),t=yield(0,w._)(this.organizationService.organizations$(e).pipe((0,h.Hc)(n)));this.useMyItems.set(null!==(i=null==t?void 0:t.useMyItems)&&void 0!==i&&i)}this.enabled.value&&this.useMyItems()&&this.data.controls.enableIndividualItemsTransfer.enable()})}loadData(){var e,t;if(!(null===(e=this.policyResponse)||void 0===e?void 0:e.data))return;const i=this.policyResponse.data;this.data.patchValue({enableIndividualItemsTransfer:null!==(t=i.enableIndividualItemsTransfer)&&void 0!==t&&t})}buildRequestData(){var e;const t=this.data.getRawValue();return{enableIndividualItemsTransfer:null!==(e=this.useMyItems()&&t.enableIndividualItemsTransfer)&&void 0!==e&&e}}buildVNextRequest(e){return di(this,void 0,void 0,function*(){var t;if(!this.policy)throw new Error("Policy was not found");const i=yield this.getEncryptedDefaultUserCollectionName(e);return{policy:{enabled:null!==(t=this.enabled.value)&&void 0!==t&&t,data:this.buildRequestData()},metadata:{defaultUserCollectionName:i}}})}getEncryptedDefaultUserCollectionName(e){return di(this,void 0,void 0,function*(){const t=this.i18nService.t("myItems"),i=yield this.encryptService.encryptString(t,e);if(!i.encryptedString)throw new Error("Encryption error");return i.encryptedString})}}Ai.ɵfac=function(e){return new(e||Ai)(y.rXU(T.W),y.rXU(ze.N),y.rXU(F.ok),y.rXU(d.PV),y.rXU(Q.D))},Ai.ɵcmp=y.VBU({type:Ai,selectors:[["vnext-organization-data-ownership-policy-edit"]],features:[y.Vt3],decls:26,vars:23,consts:[["bitLink","","href","https://bitwarden.com/resources/credential-lifecycle-management/","target","_blank","endIcon","bwi-external-link"],[1,"tw-text-left","tw-overflow-hidden","tw-mb-2"],[1,"tw-pl-7","tw-space-y-2","tw-pt-2"],["type","checkbox","bitCheckbox","","id","enabled",1,"tw-mt-4",3,"formControl"],["type","checkbox","bitCheckbox","","id","enableIndividualItemsTransfer",3,"formControl"],["type","info"]],template:function(e,t){1&e&&(y.j41(0,"p"),y.EFF(1),y.nI1(2,"i18n"),y.j41(3,"a",0),y.EFF(4),y.nI1(5,"i18n"),y.k0s()(),y.j41(6,"div",1)(7,"strong"),y.EFF(8),y.nI1(9,"i18n"),y.k0s(),y.j41(10,"ul",2)(11,"li"),y.EFF(12),y.nI1(13,"i18n"),y.k0s(),y.j41(14,"li"),y.EFF(15),y.nI1(16,"i18n"),y.k0s(),y.j41(17,"li"),y.EFF(18),y.nI1(19,"i18n"),y.k0s()()(),y.j41(20,"bit-form-control"),y.nrm(21,"input",3),y.j41(22,"bit-label"),y.EFF(23),y.nI1(24,"i18n"),y.k0s()(),y.nVh(25,hi,6,5)),2&e&&(y.R7$(),y.SpI(" ",y.bMT(2,9,"centralizeDataOwnershipDesc")," "),y.R7$(3),y.SpI(" ",y.bMT(5,11,"centralizeDataOwnershipContentAnchor")," "),y.R7$(4),y.SpI("",y.bMT(9,13,"benefits"),":"),y.R7$(4),y.SpI(" ",y.bMT(13,15,"centralizeDataOwnershipBenefit1")," "),y.R7$(3),y.SpI(" ",y.bMT(16,17,"centralizeDataOwnershipBenefit2")," "),y.R7$(3),y.SpI(" ",y.bMT(19,19,"centralizeDataOwnershipBenefit3")," "),y.R7$(3),y.Y8G("formControl",t.enabled),y.R7$(2),y.JRh(y.bMT(24,21,"turnOn")),y.R7$(2),y.vxM(t.useMyItems()?25:-1))},dependencies:[f.G,F.Zm,F.BC,F.l_,Be.G,Ee.P,Se.f,Qe.j,Ye.g,N.$],encapsulation:2,changeDetection:0});const pi=[new class extends Ie{constructor(){super(...arguments),this.name="twoStepLoginPolicyTitle",this.description="twoStepLoginPolicyDesc",this.type=b.tt.TwoFactorAuthentication,this.category=W,this.priority=40,this.component=ht}},new class extends Ie{constructor(){super(...arguments),this.name="masterPassPolicyTitle",this.description="masterPassPolicyDesc",this.type=b.tt.MasterPassword,this.category=W,this.priority=10,this.component=je}},new class extends Ie{constructor(){super(...arguments),this.name="removeUnlockWithPinPolicyTitle",this.description="removeUnlockWithPinPolicyDesc",this.type=b.tt.RemoveUnlockWithPin,this.category=W,this.priority=80,this.component=nt}},new class extends Ie{constructor(){super(...arguments),this.name="accountRecoveryPolicy",this.description="accountRecoveryPolicyDesc",this.type=b.tt.ResetPassword,this.category=W,this.priority=20,this.component=at}display$(e,t){return(0,r.of)(e.useResetPassword)}},new class extends Ie{constructor(){super(...arguments),this.name="passwordGenerator",this.description="passwordGeneratorPolicyDesc",this.type=b.tt.PasswordGenerator,this.category=$,this.priority=10,this.component=_e}},new class extends Ie{constructor(){super(...arguments),this.name="singleOrg",this.description="singleOrgPolicyDesc",this.type=b.tt.SingleOrg,this.category=H,this.priority=10,this.component=ut}},new class extends Ie{constructor(){super(...arguments),this.name="requireSso",this.description="requireSsoPolicyDesc",this.type=b.tt.RequireSso,this.category=W,this.priority=30,this.component=rt}display$(e,t){return(0,r.of)(e.useSso)}},new class extends Ie{constructor(){super(...arguments),this.name="organizationDataOwnership",this.description="organizationDataOwnershipDesc",this.type=b.tt.OrganizationDataOwnership,this.category=H,this.priority=20,this.component=qe,this.showDescription=!1}display$(e,t){return t.getFeatureFlag$(ye.TO.MigrateMyVaultToMyItems).pipe((0,o.T)(e=>!e))}},new class extends Ie{constructor(){super(...arguments),this.name="centralizeDataOwnership",this.description="centralizeDataOwnershipDesc",this.type=b.tt.OrganizationDataOwnership,this.category=H,this.priority=20,this.component=Ai,this.showDescription=!1,this.editDialogComponent=ci}display$(e,t){return t.getFeatureFlag$(ye.TO.MigrateMyVaultToMyItems)}},new class extends Ie{constructor(){super(...arguments),this.name="disableSend",this.description="disableSendPolicyDesc",this.type=b.tt.DisableSend,this.category=H,this.priority=40,this.component=ke}display$(e,t){return t.getFeatureFlag$(ye.TO.SendControls).pipe((0,o.T)(e=>!e))}},new class extends Ie{constructor(){super(...arguments),this.name="sendOptions",this.description="sendOptionsPolicyDesc",this.type=b.tt.SendOptions,this.category=H,this.priority=30,this.component=ct}display$(e,t){return t.getFeatureFlag$(ye.TO.SendControls).pipe((0,o.T)(e=>!e))}},new class extends Ie{constructor(){super(...arguments),this.name="sendControls",this.description="sendControlsPolicyDesc",this.type=b.tt.SendControls,this.category=H,this.priority=30,this.component=Fe}display$(e,t){return t.getFeatureFlag$(ye.TO.SendControls)}},new class extends Ie{constructor(){super(...arguments),this.name="restrictedItemTypePolicy",this.description="restrictedItemTypePolicyDesc",this.type=b.tt.RestrictedItemTypes,this.category=$,this.priority=50,this.component=lt}},new class extends Ie{constructor(){super(...arguments),this.name="desktopAutotypePolicy",this.description="desktopAutotypePolicyDesc",this.type=b.tt.AutotypeDefaultSetting,this.category=$,this.priority=70,this.component=Pe}display$(e,t){return t.getFeatureFlag$(ye.TO.WindowsDesktopAutotype)}},new class extends Ie{constructor(){super(...arguments),this.name="uriMatchDetectionPolicy",this.description="uriMatchDetectionPolicyDesc",this.type=b.tt.UriMatchDefaults,this.category=$,this.priority=20,this.component=vt}},new kt]},81387(e,t,i){"use strict";i.d(t,{$:()=>r});var n=i(20702);class r extends n.r{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")}}},81441(e,t,i){"use strict";var n;i.d(t,{n:()=>n}),function(e){e[e.None=0]="None",e[e.SsoNewJitProvisionedUser=1]="SsoNewJitProvisionedUser",e[e.TdeUserWithoutPasswordHasPasswordResetPermission=2]="TdeUserWithoutPasswordHasPasswordResetPermission",e[e.TdeOffboarding=3]="TdeOffboarding",e[e.TdeOffboardingUntrustedDevice=4]="TdeOffboardingUntrustedDevice",e[e.AdminForcePasswordReset=5]="AdminForcePasswordReset",e[e.WeakMasterPassword=6]="WeakMasterPassword"}(n||(n={}))},81573(e,t,i){"use strict";i.d(t,{P:()=>l});var n=i(81525),r=i(68016),s=i(66316),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({providers:[s.o3],imports:[n.Ph,r.m,n.Ph]})},81667(e,t,i){"use strict";i.d(t,{Je:()=>s,nK:()=>C,EB:()=>w,dc:()=>b,WW:()=>E});var n=i(33812),r=i(74208);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=n.$C({type:s}),s.ɵinj=r.G2t({});var o=i(50545),a=i(12277),l=i(52237);class c{constructor(){this.collections=[]}static fromResponse(e){const t=Object.assign(new c,e);return t.collections=e.collections.map(e=>new l.sK(e)),t}}class d{static fromResponse(e){return Object.assign(new d,e)}}class u{constructor(){this.collections=[],this.users=[]}}class h{constructor(e){this.ids=null==e?[]:e}}var A=i(73409),p=i(20702);class g extends p.r{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 v extends g{constructor(e){super(e),this.collections=[];const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map(e=>new A.U(e)))}}var f=i(12012),m=i(1601),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e,t){this.apiService=e,this.configService=t}get(e,t){return y(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/groups/"+t+"/details",null,!0,!0);return c.fromResponse(new v(i))})}getAll(e){return y(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/groups",null,!0,!0);return new a.s(t,v).data.map(e=>d.fromResponse(e))})}getAllDetails(e){return y(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/groups/details",null,!0,!0);return new a.s(t,v).data.map(e=>c.fromResponse(e))})}}C.ɵfac=function(e){return new(e||C)(r.KVO(f.G),r.KVO(m.w))},C.ɵprov=r.jDH({token:C,factory:C.ɵfac,providedIn:"root"});class w extends C{constructor(e,t){super(e,t),this.apiService=e,this.configService=t}delete(e,t){return y(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups/"+t,null,!0,!1)})}deleteMany(e,t){return y(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups",new h(t),!0,!0)})}save(e){return y(this,void 0,void 0,function*(){const t=new u;return t.name=e.name,t.users=e.members,t.collections=e.collections.map(e=>new o.I(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 y(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/groups",t,!0,!0);return d.fromResponse(new g(i))})}putGroup(e,t,i){return y(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/groups/"+t,i,!0,!0);return d.fromResponse(new g(n))})}}w.ɵfac=function(e){return new(e||w)(r.KVO(f.G),r.KVO(m.w))},w.ɵprov=r.jDH({token:w,factory:w.ɵfac,providedIn:s});var I=i(23965);class b{constructor(){this.collections=[],this.groups=[]}static fromResponse(e,t){const i=new b;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.ssoExternalId=t.ssoExternalId,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.managedByOrganization=t.managedByOrganization,i}}var B=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E{constructor(e){this.organizationUserApiService=e}get(e,t){return B(this,void 0,void 0,function*(){const i=yield this.organizationUserApiService.getOrganizationUser(e,t,{includeGroups:!0});if(null!=i)return b.fromResponse(e,i)})}save(e){return B(this,void 0,void 0,function*(){const t=new I.$3;t.permissions=e.permissions,t.type=e.type,t.collections=e.collections,t.groups=e.groups,t.accessSecretsManager=e.accessSecretsManager,yield this.organizationUserApiService.putOrganizationUser(e.organizationId,e.id,t)})}invite(e,t){return B(this,void 0,void 0,function*(){const i=new I.JS;i.emails=e,i.permissions=t.permissions,i.type=t.type,i.collections=t.collections,i.groups=t.groups,i.accessSecretsManager=t.accessSecretsManager,yield this.organizationUserApiService.postOrganizationUserInvite(t.organizationId,i)})}}E.ɵfac=function(e){return new(e||E)(r.KVO(I.uB))},E.ɵprov=r.jDH({token:E,factory:E.ɵfac,providedIn:s});i(65551)},81740(e,t,i){"use strict";i.d(t,{P:()=>l});var n=i(24137),r=i(53021),s=i(4581),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({imports:[r.s,s.y,n.f]})},82392(e,t,i){"use strict";i.d(t,{JW:()=>o,Ye:()=>r});class n{constructor(e){this.svg=e}}function r(e){return e instanceof n}class s extends Error{constructor(){super("Dynamic content in icons is not allowed due to risk of user-injected XSS.")}}function o(e,...t){if(t.length>0)throw new s;return new n(e[0])}},82468(e,t,i){"use strict";var n;i.d(t,{TO:()=>n,Y6:()=>o}),function(e){e.AutoConfirm="pm-19934-auto-confirm-organization-users",e.PM27086_UpdateAuthenticationApisForInputPassword="pm-27086-update-authentication-apis-for-input-password",e.SafariAccountSwitching="pm-5594-safari-account-switching",e.PM30811_ChangeEmailNewAuthenticationApis="pm-30811-change-email-new-authentication-apis",e.PM31088_MasterPasswordServiceEmitSalt="pm-31088-master-password-service-emit-salt",e.UseUnlockServiceForPasswordLogin="use-unlock-service-for-password-login",e.PM32413_MultiClientPasswordManagement="pm-32413-multi-client-password-management",e.UseUndeterminedCipherScenarioTriggeringLogic="undetermined-cipher-scenario-logic",e.MacOsNativeCredentialSync="macos-native-credential-sync",e.WindowsDesktopAutotype="windows-desktop-autotype",e.WindowsDesktopAutotypeGA="windows-desktop-autotype-ga",e.SSHAgentV2="ssh-agent-v2",e.PM29108_EnablePersonalDiscounts="pm-29108-enable-personal-discounts",e.TrialPaymentOptional="PM-8163-trial-payment",e.PM24032_NewNavigationPremiumUpgradeButton="pm-24032-new-navigation-premium-upgrade-button",e.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog="pm-23713-premium-badge-opens-new-premium-upgrade-dialog",e.PM26462_Milestone_3="pm-26462-milestone-3",e.PM29594_UpdateIndividualSubscriptionPage="pm-29594-update-individual-subscription-page",e.PM29593_PremiumToOrganizationUpgrade="pm-29593-premium-to-organization-upgrade",e.PrivateKeyRegeneration="pm-12241-private-key-regeneration",e.EnrollAeadOnKeyRotation="enroll-aead-on-key-rotation",e.ForceUpdateKDFSettings="pm-18021-force-update-kdf-settings",e.SdkKeyRotation="pm-30144-sdk-key-rotation",e.LinuxBiometricsV2="pm-26340-linux-biometrics-v2",e.NoLogoutOnKdfChange="pm-23995-no-logout-on-kdf-change",e.PasskeyUnlock="pm-2035-passkey-unlock",e.PM27279_V2RegistrationTdeJit="pm-27279-v2-registration-tde-jit",e.EnableAccountEncryptionV2KeyConnectorRegistration="enable-account-encryption-v2-key-connector-registration",e.EnableAccountEncryptionV2JitPasswordRegistration="enable-account-encryption-v2-jit-password-registration",e.SdkKeyConnectorMigration="use-sdk-for-key-connector-migration",e.UnlockViaSDK="unlock-via-sdk",e.UseSdkPasswordGenerators="pm-19976-use-sdk-password-generators",e.SendUIRefresh="pm-28175-send-ui-refresh",e.SendEmailOTP="pm-19051-send-email-verification",e.SendControls="pm-31885-send-controls",e.EventManagementForDataDogAndCrowdStrike="event-management-for-datadog-and-crowdstrike",e.EventManagementForHuntress="event-management-for-huntress",e.PhishingDetection="phishing-detection",e.Milestone11AppPageImprovements="pm-30538-dirt-milestone-11-app-page-improvements",e.AccessIntelligenceTrendChart="pm-26961-access-intelligence-trend-chart",e.AccessIntelligenceNewArchitecture="pm-31936-access-intelligence-new-architecture",e.PM19941MigrateCipherDomainToSdk="pm-19941-migrate-cipher-domain-to-sdk",e.PM22134SdkCipherListView="pm-22134-sdk-cipher-list-view",e.PM22136_SdkCipherEncryption="pm-22136-sdk-cipher-encryption",e.CipherKeyEncryption="cipher-key-encryption",e.MigrateMyVaultToMyItems="pm-20558-migrate-myvault-to-myitems",e.PM27632_SdkCipherCrudOperations="pm-27632-cipher-crud-operations-to-sdk",e.PM30521_AutofillButtonViewLoginScreen="pm-30521-autofill-button-view-login-screen",e.PM29438_WelcomeDialogWithExtensionPrompt="pm-29438-welcome-dialog-with-extension-prompt",e.PM29438_DialogWithExtensionPromptAccountAge="pm-29438-dialog-with-extension-prompt-account-age",e.PM29437_WelcomeDialog="pm-29437-welcome-dialog-no-ext-prompt",e.PM31039ItemActionInExtension="pm-31039-item-action-in-extension",e.PM32180PremiumUpsellAccountAge="pm-32180-premium-upsell-account-age",e.ContentScriptIpcChannelFramework="content-script-ipc-channel-framework",e.WebAuthnRelatedOrigins="pm-30529-webauthn-related-origins",e.ElectronStorageCache="pm-32783-electron-storage-cache",e.DesktopUiMigrationMilestone3="desktop-ui-migration-milestone-3",e.DesktopUiMigrationMilestone4="desktop-ui-migration-milestone-4"}(n||(n={}));const r=!1,s={[n.AutoConfirm]:r,[n.UseUndeterminedCipherScenarioTriggeringLogic]:r,[n.MacOsNativeCredentialSync]:r,[n.WindowsDesktopAutotype]:r,[n.WindowsDesktopAutotypeGA]:r,[n.SSHAgentV2]:r,[n.PM31039ItemActionInExtension]:r,[n.UseSdkPasswordGenerators]:r,[n.SendUIRefresh]:r,[n.SendEmailOTP]:r,[n.SendControls]:r,[n.EventManagementForDataDogAndCrowdStrike]:r,[n.EventManagementForHuntress]:r,[n.PhishingDetection]:r,[n.Milestone11AppPageImprovements]:r,[n.AccessIntelligenceTrendChart]:r,[n.AccessIntelligenceNewArchitecture]:r,[n.CipherKeyEncryption]:r,[n.PM19941MigrateCipherDomainToSdk]:r,[n.PM22134SdkCipherListView]:r,[n.PM22136_SdkCipherEncryption]:r,[n.PM27632_SdkCipherCrudOperations]:r,[n.MigrateMyVaultToMyItems]:r,[n.PM30521_AutofillButtonViewLoginScreen]:r,[n.PM29438_WelcomeDialogWithExtensionPrompt]:r,[n.PM29438_DialogWithExtensionPromptAccountAge]:5,[n.PM29437_WelcomeDialog]:r,[n.PM32180PremiumUpsellAccountAge]:7,[n.PM27086_UpdateAuthenticationApisForInputPassword]:r,[n.SafariAccountSwitching]:r,[n.PM30811_ChangeEmailNewAuthenticationApis]:r,[n.PM31088_MasterPasswordServiceEmitSalt]:r,[n.UseUnlockServiceForPasswordLogin]:r,[n.PM32413_MultiClientPasswordManagement]:r,[n.PM29108_EnablePersonalDiscounts]:r,[n.TrialPaymentOptional]:r,[n.PM24032_NewNavigationPremiumUpgradeButton]:r,[n.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog]:r,[n.PM26462_Milestone_3]:r,[n.PM29594_UpdateIndividualSubscriptionPage]:r,[n.PM29593_PremiumToOrganizationUpgrade]:r,[n.PrivateKeyRegeneration]:r,[n.EnrollAeadOnKeyRotation]:r,[n.ForceUpdateKDFSettings]:r,[n.SdkKeyRotation]:r,[n.LinuxBiometricsV2]:r,[n.NoLogoutOnKdfChange]:r,[n.PasskeyUnlock]:r,[n.PM27279_V2RegistrationTdeJit]:r,[n.EnableAccountEncryptionV2KeyConnectorRegistration]:r,[n.EnableAccountEncryptionV2JitPasswordRegistration]:r,[n.SdkKeyConnectorMigration]:r,[n.UnlockViaSDK]:r,[n.ContentScriptIpcChannelFramework]:r,[n.WebAuthnRelatedOrigins]:r,[n.ElectronStorageCache]:r,[n.DesktopUiMigrationMilestone3]:r,[n.DesktopUiMigrationMilestone4]:r};function o(e,t){return null==(null==e?void 0:e.featureStates)||null==e.featureStates[t]?s[t]:e.featureStates[t]}},82489(e,t,i){"use strict";i.d(t,{x:()=>s});var n=i(20702),r=i(81387);class s extends n.r{constructor(e){super(e),this.twoFactorProviders=this.getResponseProperty("TwoFactorProviders"),this.twoFactorProviders2=this.getResponseProperty("TwoFactorProviders2"),this.masterPasswordPolicy=new r.$(this.getResponseProperty("MasterPasswordPolicy")),this.ssoEmail2faSessionToken=this.getResponseProperty("SsoEmail2faSessionToken"),this.email=this.getResponseProperty("Email")}}},82696(e,t,i){"use strict";i.d(t,{j:()=>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)}}},83078(e,t,i){"use strict";i.d(t,{B:()=>n});class n{}},83234(e,t,i){"use strict";i.d(t,{T2:()=>c,oO:()=>a});var n=i(3204),r=i(68467),s=i(31857),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a{}const l=new s.Zs(s.dD,"selection",{deserializer:e=>e});class c{constructor(e,t=r.NJ.System){this.globalStateProvider=e,this.defaultTheme=t,this.selectedThemeState=this.globalStateProvider.get(l),this.selectedTheme$=this.selectedThemeState.state$.pipe((0,n.T)(e=>null==e||Object.values(r.NJ).includes(e)?e:null),(0,n.T)(e=>null!=e?e:this.defaultTheme))}setSelectedTheme(e){return o(this,void 0,void 0,function*(){yield this.selectedThemeState.update(()=>e,{shouldUpdate:t=>t!==e})})}}},83516(e,t,i){"use strict";i.d(t,{U:()=>n.D$});var n=i(5819)},83541(e,t,i){"use strict";i.d(t,{L:()=>n,O:()=>r});class n{}class r extends n{}},83586(e,t,i){"use strict";i.d(t,{qi:()=>c,wP:()=>o,aH:()=>s,Dt:()=>a});var n=i(2738),r=i(78991);const s=Object.freeze({file:"file",chromium:"chromium",ipc:"ipc",download:"download"}),o=Object.freeze({unique:"unique",chromium:"chromium"}),a=(0,r.ol)({[s.chromium]:[n.s.Desktop],[s.download]:[n.s.Browser],[s.file]:[n.s.Browser,n.s.Desktop,n.s.Web,n.s.Cli],[s.ipc]:[]}),l=[{id:"bitwardenjson",loaders:[s.file],instructions:o.unique},{id:"chromecsv",loaders:[s.file],instructions:o.chromium},{id:"operacsv",loaders:[s.file],instructions:o.chromium},{id:"vivaldicsv",loaders:[s.file],instructions:o.chromium},{id:"bravecsv",loaders:[s.file],instructions:o.chromium},{id:"edgecsv",loaders:[s.file],instructions:o.chromium}],c=(0,r.ol)(Object.fromEntries(l.map(e=>[e.id,e])))},83632(e,t,i){"use strict";i.d(t,{t:()=>c});var n=i(77468),r=i(94573),s=i(74208),o=i(33812),a=i(50700);function l(e,t){if(1&e&&(o.j41(0,"span",4),o.EFF(1),o.k0s()),2&e){const e=o.XpG();o.R7$(),o.JRh(e.title)}}class c{get classList(){return["tw-inline-block","tw-overflow-hidden","tw-flex","tw-items-center"].concat(this.sizeClass).concat([this.noColor?"":"tw-text-primary-600"])}constructor(e){this.i18nService=e,this.size="large",this.noColor=!1,this.title=this.i18nService.t("loading"),this.sr=!0}get sizeClass(){switch(this.size){case"small":return["tw-h-4"];case"large":return["tw-h-16"];default:return["tw-h-full","tw-w-full"]}}}c.ɵfac=function(e){return new(e||c)(o.rXU(a.W))},c.ɵcmp=o.VBU({type:c,selectors:[["bit-spinner"]],hostVars:2,hostBindings:function(e,t){2&e&&o.HbH(t.classList)},inputs:{size:"size",noColor:[2,"noColor","noColor",r.L39],title:"title",sr:[2,"sr","sr",r.L39]},decls:4,vars:1,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 56 56","fill","none","aria-hidden","true",1,"tw-size-full","tw-animate-spin"],["cx","28","cy","28","r","23","pathLength","4","stroke-width","5","stroke-dasharray","1 3","stroke-linecap","round",1,"tw-stroke-primary-600"],["cx","28","cy","28","r","23","stroke-width","5","opacity","0.4",1,"tw-stroke-primary-600"],["class","tw-sr-only",4,"ngIf"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(s.qSk(),o.j41(0,"svg",0),o.nrm(1,"circle",1)(2,"circle",2),o.k0s(),o.DNE(3,l,2,1,"span",3)),2&e&&(o.R7$(3),o.Y8G("ngIf",t.sr))},dependencies:[n.MD,n.bT],encapsulation:2})},83691(e,t,i){"use strict";i.d(t,{E:()=>o});var n=i(38140),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.X]})},83724(e,t,i){"use strict";i.d(t,{_:()=>c});var n=i(51151),r=i(56962),s=i(83516),o=i(74208),a=i(50700),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c{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=n.bq.FirefoxBrowser:navigator.userAgent.indexOf(" OPR/")>=0?this.browserCache=n.bq.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edg/")?this.browserCache=n.bq.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=n.bq.VivaldiBrowser:-1!==navigator.userAgent.indexOf("Ddg")?this.browserCache=n.bq.DuckDuckGoBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=n.bq.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=n.bq.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=n.bq.IEBrowser:this.browserCache=n.bq.UnknownBrowser),this.browserCache}getDeviceString(){return n.bq[this.getDevice()].toLowerCase().replace("browser","")}getClientType(){return n.sK.Web}isFirefox(){return this.getDevice()===n.bq.FirefoxBrowser}isChrome(){return this.getDevice()===n.bq.ChromeBrowser}isEdge(){return this.getDevice()===n.bq.EdgeBrowser}isOpera(){return this.getDevice()===n.bq.OperaBrowser}isVivaldi(){return this.getDevice()===n.bq.VivaldiBrowser}isSafari(){return this.getDevice()===n.bq.SafariBrowser}isChromium(){return this.isChrome()||this.isEdge()||this.isOpera()||this.isVivaldi()}isWebKit(){return!0}isMacAppStore(){return!1}isPopupOpen(){return Promise.resolve(!1)}isAnyViewFocused(){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("2026.4.1")}getApplicationVersionNumber(){return l(this,void 0,void 0,function*(){return(yield this.getApplicationVersion()).split(RegExp("[+|-]"))[0].trim()})}supportsWebAuthn(e){return"undefined"!=typeof PublicKeyCredential}supportsDuo(){return!0}supportsAutofill(){return!1}supportsFileDownloads(){return!(this.getDevice()===n.bq.SafariBrowser)}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 s=!1;try{s=n.execCommand("copy"),s||this.logService.debug("Copy command unsupported or disabled.")}catch(r){console.warn("Copy to clipboard failed.",r)}finally{i.removeChild(t)}return s}}readFromClipboard(e){throw new Error("Cannot read from clipboard on web.")}supportsSecureStorage(){return!1}getAutofillKeyboardShortcut(){return null}packageType(){return null}}c.ɵfac=function(e){return new(e||c)(o.KVO(a.W),o.KVO(s.U),o.KVO(r.K))},c.ɵprov=o.jDH({token:c,factory:c.ɵfac})},84101(e,t,i){"use strict";i.d(t,{t:()=>n});class n{}},84110(e,t,i){"use strict";var n;i.d(t,{J:()=>n}),function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(n||(n={}))},84175(e,t,i){"use strict";i.d(t,{n:()=>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)}}},84274(e,t,i){"use strict";i.d(t,{v:()=>a});var n=i(39306),r=i(17989),s=i(78078),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends r.A{constructor(e){super(),this.id="",this.name=new n.k(""),this.revisionDate=new Date,null!=e&&(this.id=e.id,this.name=new n.k(e.name),this.revisionDate=new Date(e.revisionDate))}decrypt(e){return this.decryptObj(this,new s.u(this),["name"],e)}decryptWithKey(e,t){return o(this,void 0,void 0,function*(){const i=new s.u;i.id=this.id,i.revisionDate=this.revisionDate;try{i.name=yield t.decryptString(this.name,e)}catch(n){throw console.error("[Folder] Error decrypting folder",n),n}return i})}static fromJSON(e){if(null==e)return null;const t=new a;return t.id=e.id,t.name=n.k.fromJSON(e.name),t.revisionDate=new Date(e.revisionDate),t}}},84431(e,t,i){"use strict";i.d(t,{d:()=>Q});var n=i(51757),r=i(49272),s=i(81525),o=i(50866),a=i(25065),l=i(33812),c=i(69855),d=i(66316),u=i(12012),h=i(50700),A=i(37115),p=i(62166),g=i(23649),v=i(26657),f=i(38620),m=i(56898),y=i(44432),C=i(7730),w=i(68016),I=i(67311),b=i(58806),B=i(7855),E=i(25740),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Q{constructor(e,t,i,r,s,o,a,l,c){this.data=e,this.dialogRef=t,this.apiService=i,this.i18nService=r,this.platformUtilsService=s,this.userVerificationService=o,this.router=a,this.syncService=l,this.toastService=c,this.organizationId=null,this.formGroup=new n.gE({masterPassword:new n.MJ(null)}),this.submit=()=>S(this,void 0,void 0,function*(){const e=this.userVerificationService.buildRequest(this.formGroup.value.masterPassword).then(e=>this.apiService.postPurgeCiphers(e,this.organizationId));yield e,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("vaultPurged")}),yield this.syncService.fullSync(!0),null!=this.organizationId?yield this.router.navigate(["organizations",this.organizationId,"vault"]):yield this.router.navigate(["vault"]),this.dialogRef.close()}),this.organizationId=e&&e.organizationId?e.organizationId:null}static open(e,t){return e.open(Q,t)}}Q.ɵfac=function(e){return new(e||Q)(l.rXU(s.Qs),l.rXU(d.ce),l.rXU(u.G),l.rXU(h.W),l.rXU(A.y),l.rXU(p.i),l.rXU(g.Ix),l.rXU(r.H),l.rXU(c.f))},Q.ɵcmp=l.VBU({type:Q,selectors:[["ng-component"]],decls:18,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","masterPassword"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(l.j41(0,"form",0)(1,"bit-dialog",1),l.nI1(2,"i18n"),l.qex(3,2),l.j41(4,"p",3),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.j41(7,"bit-callout",4),l.EFF(8),l.nI1(9,"i18n"),l.k0s(),l.nrm(10,"app-user-verification",5),l.bVm(),l.qex(11,6),l.j41(12,"button",7),l.EFF(13),l.nI1(14,"i18n"),l.k0s(),l.j41(15,"button",8),l.EFF(16),l.nI1(17,"i18n"),l.k0s(),l.bVm(),l.k0s()()),2&e&&(l.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),l.R7$(),l.Y8G("title",l.bMT(2,7,"purgeVault")),l.R7$(4),l.SpI(" ",l.bMT(6,9,t.organizationId?"purgeOrgVaultDesc":"purgeVaultDesc")," "),l.R7$(3),l.JRh(l.bMT(9,11,"purgeVaultWarning")),l.R7$(5),l.SpI(" ",l.bMT(14,13,"purgeVault")," "),l.R7$(3),l.SpI(" ",l.bMT(17,15,"close")," "))},dependencies:[a.G,n.qT,n.BC,n.cb,n.j4,n.JD,v.$,f.L,m.Q,y.G,C.I,w.m,I.hJ,b.r,o.R6,B.q,E.$],encapsulation:2})},84454(e,t,i){"use strict";i.d(t,{U:()=>c});var n=i(39306),r=i(17989),s=i(24072),o=i(69886),a=i(65918),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c extends r.A{constructor(e){super(),null!=e?(this.credentialId=new n.k(e.credentialId),this.keyType=new n.k(e.keyType),this.keyAlgorithm=new n.k(e.keyAlgorithm),this.keyCurve=new n.k(e.keyCurve),this.keyValue=new n.k(e.keyValue),this.rpId=new n.k(e.rpId),this.counter=new n.k(e.counter),this.discoverable=new n.k(e.discoverable),this.userHandle=(0,s.e)(e.userHandle),this.userName=(0,s.e)(e.userName),this.rpName=(0,s.e)(e.rpName),this.userDisplayName=(0,s.e)(e.userDisplayName),this.creationDate=new Date(e.creationDate)):this.creationDate=new Date}decrypt(e){return l(this,void 0,void 0,function*(){const t=yield this.decryptObj(this,new a.X,["credentialId","keyType","keyAlgorithm","keyCurve","keyValue","rpId","userHandle","userName","rpName","userDisplayName"],e),{counter:i}=yield this.decryptObj(this,{counter:""},["counter"],e);t.counter=parseInt(i);const{discoverable:n}=yield this.decryptObj(this,{discoverable:""},["discoverable"],e);return t.discoverable="true"===n,t.creationDate=this.creationDate,t})}toFido2CredentialData(){const e=new o.w;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;const t=new c;return t.credentialId=n.k.fromJSON(e.credentialId),t.keyType=n.k.fromJSON(e.keyType),t.keyAlgorithm=n.k.fromJSON(e.keyAlgorithm),t.keyCurve=n.k.fromJSON(e.keyCurve),t.keyValue=n.k.fromJSON(e.keyValue),t.rpId=n.k.fromJSON(e.rpId),t.userHandle=(0,s.u)(e.userHandle),t.userName=(0,s.u)(e.userName),t.counter=n.k.fromJSON(e.counter),t.rpName=(0,s.u)(e.rpName),t.userDisplayName=(0,s.u)(e.userDisplayName),t.discoverable=n.k.fromJSON(e.discoverable),t.creationDate=new Date(e.creationDate),t}toSdkFido2Credential(){var e,t,i,n,r,s;return{credentialId:null===(e=this.credentialId)||void 0===e?void 0:e.toSdk(),keyType:this.keyType.toSdk(),keyAlgorithm:this.keyAlgorithm.toSdk(),keyCurve:this.keyCurve.toSdk(),keyValue:this.keyValue.toSdk(),rpId:this.rpId.toSdk(),userHandle:null===(t=this.userHandle)||void 0===t?void 0:t.toSdk(),userName:null===(i=this.userName)||void 0===i?void 0:i.toSdk(),counter:this.counter.toSdk(),rpName:null===(n=this.rpName)||void 0===n?void 0:n.toSdk(),userDisplayName:null===(r=this.userDisplayName)||void 0===r?void 0:r.toSdk(),discoverable:null===(s=this.discoverable)||void 0===s?void 0:s.toSdk(),creationDate:this.creationDate.toISOString()}}static fromSdkFido2Credential(e){if(null==e)return;const t=new c;return t.credentialId=n.k.fromJSON(e.credentialId),t.keyType=n.k.fromJSON(e.keyType),t.keyAlgorithm=n.k.fromJSON(e.keyAlgorithm),t.keyCurve=n.k.fromJSON(e.keyCurve),t.keyValue=n.k.fromJSON(e.keyValue),t.rpId=n.k.fromJSON(e.rpId),t.counter=n.k.fromJSON(e.counter),t.userHandle=(0,s.u)(e.userHandle),t.userName=(0,s.u)(e.userName),t.rpName=(0,s.u)(e.rpName),t.userDisplayName=(0,s.u)(e.userDisplayName),t.discoverable=n.k.fromJSON(e.discoverable),t.creationDate=new Date(e.creationDate),t}}},84488(e,t,i){"use strict";i.d(t,{y:()=>s});var n=i(85776),r=(i(64447),i(43978));class s{constructor(e){var 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.useOrganizationDomains=e.useOrganizationDomains,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.useAutomaticUserConfirmation=e.useAutomaticUserConfirmation,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.organizationUserId=e.organizationUserId,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.productTierType=e.productTierType,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.limitCollectionCreation=e.limitCollectionCreation,this.limitCollectionDeletion=e.limitCollectionDeletion,this.limitItemDeletion=e.limitItemDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.userIsManagedByOrganization=e.userIsManagedByOrganization,this.useAccessIntelligence=e.useAccessIntelligence,this.useAdminSponsoredFamilies=e.useAdminSponsoredFamilies,this.useDisableSMAdsForUsers=null!==(t=e.useDisableSMAdsForUsers)&&void 0!==t&&t,this.isAdminInitiated=e.isAdminInitiated,this.ssoEnabled=e.ssoEnabled,this.ssoMemberDecryptionType=e.ssoMemberDecryptionType,this.usePhishingBlocker=e.usePhishingBlocker,this.useMyItems=e.useMyItems)}get canAccess(){return!!this.isOwner||this.enabled&&this.status===r.Zx.Confirmed}get isAdmin(){return this.type===r.D7.Admin||this.isOwner}get isOwner(){return this.type===r.D7.Owner||this.isProviderUser}get canAccessEventLogs(){return(this.isAdmin||this.permissions.accessEventLogs)&&this.useEvents}get canAccessImport(){return this.isProviderUser||this.type===r.D7.Owner||this.type===r.D7.Admin||this.permissions.accessImportExport}get canAccessExport(){return this.isMember&&(this.type===r.D7.Owner||this.type===r.D7.Admin||this.permissions.accessImportExport)}get canAccessReports(){return this.isAdmin||this.permissions.accessReports}get canCreateNewCollections(){return!this.limitCollectionCreation||this.isAdmin||this.permissions.createNewCollections}get canEditAnyCollection(){return this.isProviderUser||this.type===r.D7.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&this.isAdmin}get canEditUnmanagedCollections(){return this.isAdmin||this.permissions.editAnyCollection}get canEditUnassignedCiphers(){return this.type===r.D7.Admin||this.type===r.D7.Owner||this.permissions.editAnyCollection}get canEditAllCiphers(){return this.type===r.D7.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&(this.type===r.D7.Admin||this.type===r.D7.Owner)}get canDeleteAnyCollection(){return!(!this.isProviderUser&&!this.permissions.deleteAnyCollection)||!!this.allowAdminAccessToAllCollectionItems&&(this.type==r.D7.Owner||this.type==r.D7.Admin)}get canViewAllCollections(){return this.isAdmin||this.permissions.editAnyCollection||this.permissions.deleteAnyCollection}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.useOrganizationDomains}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 canEnableAutoConfirmPolicy(){return(this.canManageUsers||this.canManagePolicies)&&this.useAutomaticUserConfirmation&&!this.isProviderUser}get canManageDeviceApprovals(){return(this.isAdmin||this.permissions.manageResetPassword)&&this.useSso&&this.ssoEnabled&&this.ssoMemberDecryptionType===n.QI.TrustedDeviceEncryption}get isExemptFromPolicies(){return this.canManagePolicies}get canViewSubscription(){return!!this.canEditSubscription||(this.hasBillableProvider?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 hasBillableProvider(){return this.hasProvider&&(this.providerType===r.cp.Msp||this.providerType===r.cp.BusinessUnit)}get hasReseller(){return this.hasProvider&&this.providerType===r.cp.Reseller}get canAccessSecretsManager(){return this.useSecretsManager&&this.accessSecretsManager}get isFreeOrg(){return!this.useTotp}get canManageSponsorships(){return this.familySponsorshipAvailable||null!==this.familySponsorshipFriendlyName}get canManageAutoConfirm(){return this.isMember&&this.canManageUsers&&this.useAutomaticUserConfirmation}static fromJSON(e){return null==e?null:Object.assign(new s,e,{familySponsorshipLastSyncDate:new Date(e.familySponsorshipLastSyncDate),familySponsorshipValidUntil:new Date(e.familySponsorshipValidUntil)})}get canAccessIntegrations(){return!1}get canUseAccessIntelligence(){return!1}}},85037(e,t,i){"use strict";i.d(t,{y:()=>_});var n=i(67553),r=i(39488),s=i(31442),o=i(90118),a=i(62819),l=i(77723),c=i(74208),d=i(33812),u=i(5556),h=i(72331),A=i(66316),p=i(35500),g=i(50700),v=i(51757),f=i(26333),m=i(93103),y=i(47428),C=i(47696),w=i(56898),I=i(44432),b=i(10672),B=i(57178),E=i(30930),S=i(38410),Q=i(32316),k=i(12694),T=i(16496),F=i(75697),P=i(49112),R=i(5884),D=i(16568),M=i(77468),x=i(25740),O=i(55818),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function U(e,t){1&e&&(d.j41(0,"bit-callout",2),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.mNQ(d.bMT(1,3,"goodNews"))),d.R7$(2),d.SpI(" ",d.bMT(3,5,"noExposedPasswords")," "))}function V(e,t){if(1&e&&(d.j41(0,"bit-toggle",14),d.EFF(1),d.nrm(2,"bit-berry",14),d.k0s()),2&e){const e=t.$implicit,i=d.XpG(5);d.Y8G("value",e),d.R7$(),d.SpI(" ",i.getName(e)," "),d.R7$(),d.Y8G("value",i.getCount(e))}}function j(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-toggle-group",13),d.nI1(1,"async"),d.nI1(2,"i18n"),d.bIt("selectedChange",function(t){c.eBV(e);const i=d.XpG(4);return c.Njj(i.filterOrgToggle(t))}),d.Z7z(3,V,3,3,"bit-toggle",14,d.fX1),d.k0s()}if(2&e){const e=d.XpG(4);d.Y8G("selected",d.bMT(1,2,e.filterOrgStatus$)),d.BMQ("aria-label",d.bMT(2,4,"addAccessFilter")),d.R7$(3),d.Dyx(e.filterStatus)}}function N(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-chip-filter",15),d.bIt("ngModelChange",function(t){c.eBV(e);const i=d.XpG(4);return c.Njj(i.filterOrgToggleChipSelect(t))}),d.k0s()}if(2&e){const e=d.XpG(4);d.Y8G("placeholderText",e.chipSelectOptions[0].label)("options",e.chipSelectOptions)("ngModel",e.selectedFilterChip)}}function z(e,t){if(1&e&&d.nVh(0,j,5,6,"bit-toggle-group",11)(1,N,1,3,"bit-chip-filter",12),2&e){const e=d.XpG(3);d.vxM(e.canDisplayToggleGroup()?0:1)}}function Y(e,t){1&e&&(d.j41(0,"th",8),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" ",d.bMT(2,1,"owner")," "))}function L(e,t){if(1&e){const e=d.RV6();d.j41(0,"a",23),d.nI1(1,"i18n"),d.bIt("click",function(){c.eBV(e);const t=d.XpG().$implicit,i=d.XpG(3);return c.Njj(i.selectCipher(t))}),d.EFF(2),d.k0s()}if(2&e){const e=d.XpG().$implicit;d.Y8G("title",d.mNQ(d.i5U(1,3,"editItemWithName",e.name))),d.R7$(2),d.SpI(" ",e.name," ")}}function K(e,t){if(1&e&&(d.j41(0,"span",20),d.EFF(1),d.k0s()),2&e){const e=d.XpG().$implicit;d.Y8G("title",d.mNQ(e.name)),d.R7$(),d.JRh(e.name)}}function X(e,t){1&e&&(d.nrm(0,"i",24),d.nI1(1,"i18n"),d.j41(2,"span",25),d.EFF(3),d.nI1(4,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.mNQ(d.bMT(1,3,"shared"))),d.R7$(3),d.JRh(d.bMT(4,5,"shared")))}function q(e,t){1&e&&(d.nrm(0,"i",26),d.nI1(1,"i18n"),d.j41(2,"span",25),d.EFF(3),d.nI1(4,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.mNQ(d.bMT(1,3,"attachments"))),d.R7$(3),d.JRh(d.bMT(4,5,"attachments")))}function H(e,t){if(1&e&&(d.nrm(0,"app-org-badge",27),d.nI1(1,"async"),d.nI1(2,"orgNameFromId")),2&e){const e=d.XpG(2).$implicit,t=d.XpG(3);d.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",d.i5U(2,5,e.organizationId,d.bMT(1,3,t.organizations$)))}}function W(e,t){if(1&e&&(d.j41(0,"td",16),d.nVh(1,H,3,8,"app-org-badge",27),d.k0s()),2&e){const e=d.XpG(4);d.R7$(),d.vxM(e.organization?-1:1)}}function $(e,t){if(1&e&&(d.j41(0,"td",16),d.nrm(1,"app-vault-icon",17),d.k0s(),d.j41(2,"td",18),d.nVh(3,L,3,6,"a",19)(4,K,2,3,"span",20),d.nVh(5,X,5,7),d.nVh(6,q,5,7),d.nrm(7,"br"),d.j41(8,"small"),d.EFF(9),d.k0s()(),d.nVh(10,W,2,1,"td",16),d.j41(11,"td",21)(12,"span",22),d.EFF(13),d.nI1(14,"number"),d.nI1(15,"i18n"),d.k0s()()),2&e){const e=t.$implicit,i=d.XpG(3);d.R7$(),d.Y8G("cipher",e),d.R7$(2),d.vxM(!i.organization||i.canManageCipher(e)?3:4),d.R7$(2),d.vxM(!i.organization&&e.organizationId?5:-1),d.R7$(),d.vxM(e.hasAttachments?6:-1),d.R7$(3),d.JRh(e.subTitle),d.R7$(),d.vxM(i.isAdminConsoleActive?-1:10),d.R7$(3),d.SpI(" ",d.i5U(15,9,"exposedXTimes",d.bMT(14,7,e.exposedXTimes))," ")}}function J(e,t){if(1&e&&(d.j41(0,"bit-callout",3),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"number"),d.nI1(4,"i18n"),d.k0s(),d.nVh(5,z,2,1),d.j41(6,"bit-table-scroll",4),d.qex(7,5),d.nrm(8,"th",6),d.j41(9,"th",7),d.EFF(10),d.nI1(11,"i18n"),d.k0s(),d.nVh(12,Y,3,3,"th",8),d.j41(13,"th",9),d.EFF(14),d.nI1(15,"i18n"),d.k0s(),d.bVm(),d.DNE(16,$,16,12,"ng-template",10),d.k0s()),2&e){const e=d.XpG(2);d.Y8G("title",d.mNQ(d.bMT(1,9,"exposedPasswordsFound"))),d.R7$(2),d.SpI(" ",d.brH(4,13,"exposedPasswordsFoundReportDesc",d.bMT(3,11,e.ciphers.length),e.vaultMsg)," "),d.R7$(3),d.vxM(e.showFilterToggle&&!e.isAdminConsoleActive?5:-1),d.R7$(),d.Y8G("dataSource",e.dataSource)("rowSize",54),d.R7$(4),d.JRh(d.bMT(11,17,"name")),d.R7$(2),d.vxM(e.isAdminConsoleActive?-1:12),d.R7$(2),d.SpI(" ",d.bMT(15,19,"timesExposed")," ")}}function Z(e,t){if(1&e&&(d.j41(0,"div",1),d.nVh(1,U,4,7,"bit-callout",2)(2,J,17,21),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.vxM(e.ciphers.length?2:1)}}class _ extends l.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,n,s,i,r,o,a,l,c),this.cipherService=e,this.auditService=t,this.organizationService=i,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return G(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return G(this,void 0,void 0,function*(){const e=yield this.getAllCiphers(),t=[],i=[];this.filterStatus=[0],e.forEach(e=>{const{type:n,login:r,isDeleted:o,edit:a,viewPassword:l}=e;if(n!==s.gC.Login||null==r.password||""===r.password||o||!this.organization&&!a||!l)return;const c=this.isPasswordExposed(e).then(e=>{e&&t.push(e)});i.push(c)}),yield Promise.all(i),this.filterCiphersByOrg(t),this.dataSource.sort={column:"exposedXTimes",direction:"desc"}})}isPasswordExposed(e){return G(this,void 0,void 0,function*(){const{login:t}=e;return null==t.password?null:yield this.auditService.passwordLeaked(t.password).then(t=>t>0?Object.assign(Object.assign({},e),{exposedXTimes:t}):null)})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return G(this,void 0,void 0,function*(){return yield this.isPasswordExposed(t)})}}_.ɵfac=function(e){return new(e||_)(d.rXU(u.p),d.rXU(h.d),d.rXU(n.PV),d.rXU(A.o3),d.rXU(p.D),d.rXU(o.qX),d.rXU(g.W),d.rXU(r.H),d.rXU(o.hI),d.rXU(a.l))},_.ɵcmp=d.VBU({type:_,selectors:[["app-exposed-passwords-report"]],standalone:!1,features:[d.Vt3],decls:9,vars:8,consts:[["type","submit","buttonType","primary","bitButton","",3,"click","loading"],[1,"tw-mt-4"],["type","success",3,"title"],["type","danger",3,"title"],["layout","fixed",3,"dataSource","rowSize"],["header",""],["bitCell","",1,"tw-w-12"],["bitCell","","bitSortable","name"],["bitCell","","bitSortable","organizationId",1,"tw-w-1/4"],["bitCell","","bitSortable","exposedXTimes",1,"tw-w-1/4","tw-text-right"],["bitRowDef",""],[3,"selected"],["fullWidth","true",3,"placeholderText","options","ngModel"],[3,"selectedChange","selected"],[3,"value"],["fullWidth","true",3,"ngModelChange","placeholderText","options","ngModel"],["bitCell",""],[3,"cipher"],["bitCell","",1,"tw-truncate","tw-max-w-0"],["bitLink","","href","#","appStopClick","",3,"title"],[3,"title"],["bitCell","",1,"tw-text-right"],["bitBadge","","variant","warning"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared","tw-ml-1",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-1",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(d.nrm(0,"app-header"),d.j41(1,"bit-container")(2,"p"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"button",0),d.bIt("click",function(){return t.load()}),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.nVh(8,Z,3,1,"div",1),d.k0s()),2&e&&(d.R7$(3),d.JRh(d.bMT(4,4,"exposedPasswordsReportDesc")),d.R7$(2),d.Y8G("loading",t.loading),d.R7$(),d.SpI(" ",d.bMT(7,6,"checkExposedPasswords")," "),d.R7$(2),d.vxM(t.hasLoaded?8:-1))},dependencies:[v.BC,v.vS,f.R,m.Y,y.x,C.n,w.Q,I.G,b.H,B.g,E.a,S.Q,Q.O,E.N,k.H,T.a,F.P,P.f,R.W,D.c,M.Jj,M.QX,x.$,O.t],encapsulation:2})},85111(e,t,i){"use strict";i.d(t,{C:()=>Ee});var n=i(33812),r=i(74208),s=i(66046),o=i(72245),a=i(44500),l=i(83892),c=i(14803),d=i(33338),u=i(3204),h=i(34040),A=i(27442),p=i(43978),g=i(685),v=i(3633),f=i(66523),m=i(31442),y=i(66983),C=i(61325),w=i(90118),I=i(27760),b=i(23965),B=i(12058),E=i(67553),S=i(56962),Q=i(49272),k=i(8916),T=i(45151),F=i(88565),P=i(48003),R=i(78781),D=i(76758),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x{constructor(){}static open(e,t,i,n,r,s,a,l,c,d,u,h){return M(this,void 0,void 0,function*(){const A=yield P.GA.open(e,{title:"enrollAccountRecovery",calloutOptions:{text:"resetPasswordEnrollmentWarning",type:"warning"},verificationType:{type:"custom",verificationFn:r=>M(this,void 0,void 0,function*(){const s=(yield(0,o._)(u.activeAccount$)).id,a=R.A.fromB64ToArray((yield h.getKeys(t.organization.id)).publicKey),c=yield l.buildRequest(r),A=D.QY.open(e,{name:t.organization.name,orgId:t.organization.id,publicKey:a});if(!0!==(yield(0,F.s)(A.closed)))throw new Error("Organization not trusted, aborting user key rotation");const p=[a],g=yield(0,o._)(d.userKey$(s));return c.resetPasswordKey=yield i.buildRecoveryKey(t.organization.id,g,p),yield n.putOrganizationUserResetPasswordEnrollment(t.organization.id,t.organization.userId,c),!0})}});if("cancel"!==A.userAction&&A.verificationSuccess)try{c.showToast({variant:"success",title:null,message:r.t("enrollPasswordResetSuccess")}),yield s.fullSync(!0)}catch(p){a.error(p)}})}}var O=i(27197),G=i(49492),U=i(37115),V=i(50700),j=i(12012),N=i(18499),z=i(11224),Y=i(66316),L=i(69855),K=i(62166),X=i(1601),q=i(35500),H=i(86214),W=i(77468),$=i(5771),J=i(13496),Z=i(53997),_=i(78952),ee=i(25740),te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ie(e,t){1&e&&(n.qex(0),n.nrm(1,"i",7),n.nI1(2,"i18n"),n.j41(3,"span",8),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.bVm()),2&e&&(n.R7$(),n.Y8G("title",n.mNQ(n.bMT(2,3,"loading"))),n.R7$(3),n.JRh(n.bMT(5,5,"loading")))}function ne(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.toggleResetPasswordEnrollment(t.organization))}),n.nrm(1,"i",12),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"enrollAccountRecovery")," "))}function re(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.toggleResetPasswordEnrollment(t.organization))}),n.nrm(1,"i",13),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"withdrawAccountRecovery")," "))}function se(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(4);return r.Njj(t.unlinkSso(t.organization))}),n.nrm(1,"i",15),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"unlinkSso")," "))}function oe(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(4);return r.Njj(t.handleLinkSso(t.organization))}),n.nrm(1,"i",16),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"linkSso")," "))}function ae(e,t){if(1&e&&(n.qex(0),n.DNE(1,se,4,3,"button",14)(2,oe,4,3,"ng-template",null,1,n.C5r),n.bVm()),2&e){const e=n.sdS(3),t=n.XpG(3);n.R7$(),n.Y8G("ngIf",t.organization.ssoBound)("ngIfElse",e)}}function le(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.leave(t.organization))}),n.j41(1,"span",17),n.nrm(2,"i",18),n.EFF(3),n.nI1(4,"i18n"),n.k0s()()}2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,1,"leave")," "))}function ce(e,t){if(1&e&&(n.j41(0,"div",9),n.DNE(1,ne,4,3,"button",10)(2,re,4,3,"button",10)(3,ae,4,2,"ng-container",2)(4,le,5,3,"button",10),n.k0s()),2&e){const e=n.XpG(2);n.Y8G("appApiAction",e.actionPromise),n.R7$(),n.Y8G("ngIf",e.allowEnrollmentChanges(e.organization)&&!e.organization.resetPasswordEnrolled),n.R7$(),n.Y8G("ngIf",e.allowEnrollmentChanges(e.organization)&&e.organization.resetPasswordEnrolled),n.R7$(),n.Y8G("ngIf",e.showSsoOptions(e.organization)),n.R7$(),n.Y8G("ngIf",e.showLeaveOrgOption)}}function de(e,t){if(1&e&&(n.qex(0),n.j41(1,"button",3),n.nI1(2,"i18n"),n.nrm(3,"i",4),n.k0s(),n.j41(4,"bit-menu",5,0),n.DNE(6,ie,6,7,"ng-container",2)(7,ce,5,5,"div",6),n.k0s(),n.bVm()),2&e){const e=n.sdS(5),t=n.XpG();n.R7$(),n.Y8G("bitMenuTriggerFor",e),n.BMQ("aria-label",n.bMT(2,4,"organizationOptionsMenu")),n.R7$(5),n.Y8G("ngIf",!t.loaded),n.R7$(),n.Y8G("ngIf",t.loaded)}}class ue{constructor(e,t,i,n,r,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C){this.organization$=e,this.platformUtilsService=t,this.i18nService=i,this.apiService=n,this.syncService=r,this.policyService=o,this.logService=a,this.organizationApiService=l,this.organizationUserApiService=c,this.userDecryptionOptionsService=d,this.dialogService=u,this.resetPasswordService=h,this.userVerificationService=A,this.toastService=p,this.configService=g,this.organizationService=v,this.keyService=f,this.accountService=m,this.linkSsoService=y,this.ssoLoginService=C,this.loaded=!1,this.hideMenu=!1,this.showLeaveOrgOption=!1,this.destroy$=new s.B}ngOnInit(){return te(this,void 0,void 0,function*(){const e=this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>this.policyService.policies$(e)),(0,u.T)(e=>e.filter(e=>e.type==p.tt.ResetPassword))),t=this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>this.organizationService.organizations$(e)),(0,u.T)(e=>e.find(e=>!0===e.userIsManagedByOrganization)));(0,d.z)([this.organization$,e,this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>this.userDecryptionOptionsService.userDecryptionOptionsById$(e))),t]).pipe((0,c.Q)(this.destroy$)).subscribe(([e,t,i,n])=>{this.organization=e,this.resetPasswordPolicy=t.find(t=>t.organizationId===e.id),this.showLeaveOrgOption=(null==n?void 0:n.id)!==e.id&&(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)}handleLinkSso(e){return te(this,void 0,void 0,function*(){try{yield this.linkSsoService.linkSso(e.identifier)}catch(t){this.logService.error(t),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("errorOccurred")})}})}unlinkSso(e){return te(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.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("unlinkedSso")}),yield this.removeEmailFromSsoRequiredCacheIfPresent()}catch(t){this.logService.error(t)}})}leave(e){return te(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.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("leftOrganization")}),yield this.removeEmailFromSsoRequiredCacheIfPresent()}catch(t){this.logService.error(t)}})}removeEmailFromSsoRequiredCacheIfPresent(){return te(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$);e?yield this.ssoLoginService.removeFromSsoRequiredCacheIfPresent(e.email):this.logService.error("Active account not found.")})}toggleResetPasswordEnrollment(e){return te(this,void 0,void 0,function*(){if(this.organization.resetPasswordEnrolled){const e=new b.Wt;e.masterPasswordHash="ignored",e.resetPasswordKey="",this.actionPromise=this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(this.organization.id,this.organization.userId,e);try{yield this.actionPromise,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("withdrawPasswordResetSuccess")}),yield this.syncService.fullSync(!0)}catch(t){this.logService.error(t)}}else yield x.open(this.dialogService,{organization:e},this.resetPasswordService,this.organizationUserApiService,this.i18nService,this.syncService,this.logService,this.userVerificationService,this.toastService,this.keyService,this.accountService,this.organizationApiService)})}}ue.ɵfac=function(e){return new(e||ue)(n.rXU(G.n),n.rXU(U.y),n.rXU(V.W),n.rXU(j.G),n.rXU(Q.H),n.rXU(N.m),n.rXU(S.K),n.rXU(z.X),n.rXU(b.uB),n.rXU(B.Ym),n.rXU(Y.o3),n.rXU(T.w),n.rXU(K.i),n.rXU(L.f),n.rXU(X.w),n.rXU(E.PV),n.rXU(k.Lu),n.rXU(q.D),n.rXU(O.fA),n.rXU(H._))},ue.ɵcmp=n.VBU({type:ue,selectors:[["app-organization-options"]],standalone:!1,decls:1,vars:1,consts:[["optionsMenu",""],["linkSso",""],[4,"ngIf"],["type","button",1,"filter-options-icon",3,"bitMenuTriggerFor"],["aria-hidden","true",1,"bwi","bwi-ellipsis-v"],[1,"filter-organization-options"],["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"],[1,"bwi","bwi-fw","bwi-minus-circle"],[1,"bwi","bwi-fw","bwi-plus-circle"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-out"]],template:function(e,t){1&e&&n.DNE(0,de,8,6,"ng-container",2),2&e&&n.Y8G("ngIf",!t.hideMenu)},dependencies:[W.bT,$.k,J.Z,Z.O,_.S,ee.$],encapsulation:2});var he=i(48180),Ae=i(5556),pe=i(92411),ge=i(43090),ve=i(51757),fe=i(54471),me=i(49519),ye=i(57178),Ce=i(5520),we=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ie(e,t){1&e&&(n.j41(0,"div",3),n.nrm(1,"i",4),n.k0s())}function be(e,t){if(1&e&&(n.qex(0),n.j41(1,"div",12),n.nrm(2,"app-filter-section",13),n.k0s(),n.bVm()),2&e){const e=t.$implicit,i=n.XpG(2);n.R7$(2),n.Y8G("activeFilter",i.activeFilter)("section",e)("isCollectionFilter",e===(null==i.filters?null:i.filters.collectionFilter))}}function Be(e,t){if(1&e){const e=n.RV6();n.j41(0,"div")(1,"div",5),n.EFF(2),n.nI1(3,"i18n"),n.j41(4,"a",6),n.nI1(5,"i18n"),n.nrm(6,"i",7),n.k0s()(),n.j41(7,"div",8)(8,"div",9)(9,"bit-search",10),n.nI1(10,"i18n"),n.mxI("ngModelChange",function(t){r.eBV(e);const i=n.XpG();return n.DH7(i.searchText,t)||(i.searchText=t),r.Njj(t)}),n.bIt("ngModelChange",function(t){r.eBV(e);const i=n.XpG();return r.Njj(i.onSearchTextChanged(t))}),n.k0s()(),n.DNE(11,be,3,3,"ng-container",11),n.k0s()()}if(2&e){const e=n.XpG();n.R7$(2),n.SpI(" ",n.bMT(3,7,"filters")," "),n.R7$(2),n.Y8G("appA11yTitle",n.mNQ(n.bMT(5,9,"learnMoreAboutSearchingYourVault"))),n.R7$(5),n.Y8G("placeholder",n.mNQ(n.bMT(10,11,e.searchPlaceholder))),n.R50("ngModel",e.searchText),n.R7$(2),n.Y8G("ngForOf",e.filtersList)}}class Ee{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.isArchived?"searchArchive":this.activeFilter.cipherType===m.gC.Login?"searchLogin":this.activeFilter.cipherType===m.gC.Card?"searchCard":this.activeFilter.cipherType===m.gC.Identity?"searchIdentity":this.activeFilter.cipherType===m.gC.SecureNote?"searchSecureNote":this.activeFilter.cipherType===m.gC.SshKey?"searchSshKey":(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,a,l,c,d,u,h,A,p,g){this.vaultFilterService=e,this.policyService=t,this.i18nService=i,this.platformUtilsService=a,this.toastService=l,this.billingApiService=c,this.dialogService=d,this.accountService=u,this.restrictedItemTypesService=h,this.cipherService=A,this.cipherArchiveService=p,this.premiumUpgradePromptService=g,this.activeFilter=new w.$5,this.onEditFolder=new n.bkB,this.searchText="",this.searchTextChanged=new n.bkB,this.isLoaded=!1,this.destroy$=new s.B,this.organizationWarningsService=(0,r.WQX)(I.S),this.allTypeFilters=[{id:"favorites",name:this.i18nService.t("favorites"),type:"favorites",icon:"bwi-star"},{id:"login",name:this.i18nService.t("typeLogin"),type:m.gC.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:m.gC.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:m.gC.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("note"),type:m.gC.SecureNote,icon:"bwi-sticky-note"},{id:"sshKey",name:this.i18nService.t("typeSshKey"),type:m.gC.SshKey,icon:"bwi-key"}],this.activeUserId$=this.accountService.activeAccount$.pipe(v.F6),this.applyOrganizationFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;"AllVaults"===(null==e?void 0:e.node.id)?t.resetOrganization():t.selectedOrganizationNode=e,this.vaultFilterService.setOrganizationFilter(e.node);const i=yield(0,o._)(this.activeUserId$);yield this.vaultFilterService.expandOrgFilter(i)}),this.applyTypeFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCipherTypeNode=e}),this.applyFolderFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedFolderNode=e}),this.applyCollectionFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCollectionNode=e}),this.editFolder=e=>we(this,void 0,void 0,function*(){this.onEditFolder.emit(e)})}ngOnInit(){return we(this,void 0,void 0,function*(){var e,t,i;this.filters=yield this.buildAllFilters(),(null===(t=null===(e=this.filters)||void 0===e?void 0:e.typeFilter)||void 0===t?void 0:t.data$)&&(this.activeFilter.selectedCipherTypeNode=yield(0,o._)(null===(i=this.filters)||void 0===i?void 0:i.typeFilter.data$)),this.isLoaded=!0,this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>(0,l.h)(this.policyService.policiesByType$(p.tt.SingleOrg,e).pipe(g.Zc),this.policyService.policiesByType$(p.tt.OrganizationDataOwnership,e).pipe(g.Zc)))).pipe((0,a.n)(()=>this.addOrganizationFilter()),(0,c.Q)(this.destroy$)).subscribe(e=>{this.filters&&(this.filters.organizationFilter=e)})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSearchTextChanged(e){this.searchText=e,this.searchTextChanged.emit(e)}buildAllFilters(){return we(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$.pipe(v.F6)),t={};return t.organizationFilter=yield this.addOrganizationFilter(),t.typeFilter=yield this.addTypeFilter(),t.folderFilter=yield this.addFolderFilter(),t.collectionFilter=yield this.addCollectionFilter(),t.archiveFilter=yield this.addArchiveFilter(e),t.trashFilter=yield this.addTrashFilter(),t})}addOrganizationFilter(){return we(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>this.policyService.policyAppliesToUser$(p.tt.SingleOrg,e)))),t=yield(0,o._)(this.accountService.activeAccount$.pipe(v.F6,(0,a.n)(e=>this.policyService.policyAppliesToUser$(p.tt.OrganizationDataOwnership,e)))),i=e?void 0:{text:"newOrganization",route:"/create-organization"};return{data$:this.vaultFilterService.organizationTree$,header:{showHeader:!(e&&t),isSelectable:!0},action:this.applyOrganizationFilter,options:{component:ue},add:i,divider:!0}})}addTypeFilter(){return we(this,arguments,void 0,function*(e=[],t){const i={id:"AllItems",name:"allItems",type:"all"},n=yield(0,o._)(this.activeUserId$);return{data$:(0,d.z)([this.restrictedItemTypesService.restricted$,this.cipherService.cipherListViews$(n)]).pipe((0,u.T)(([i,n])=>{const r=i.filter(e=>0===e.allowViewOrgIds.length||!(null==n?void 0:n.some(i=>!i.deletedDate&&C.n.getType(i)===e.cipherType&&(!!i.organizationId&&((!t||i.organizationId===t)&&e.allowViewOrgIds.includes((0,f.zw)(i.organizationId))))))).map(e=>e.cipherType),s=[...e,...r];return this.allTypeFilters.filter(e=>!s.includes(e.type))}),(0,a.n)(e=>this.vaultFilterService.buildTypeTree(i,e)),(0,h.F)(),(0,A.t)({bufferSize:1,refCount:!0})),header:{showHeader:!0,isSelectable:!0},action:this.applyTypeFilter}})}addFolderFilter(){return we(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.folderTree$,header:{showHeader:!0,isSelectable:!1},action:this.applyFolderFilter,edit:{filterName:this.i18nService.t("folder"),action:this.editFolder}}})}addCollectionFilter(){return we(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.collectionTree$,header:{showHeader:!0,isSelectable:!0},action:this.applyCollectionFilter}})}addTrashFilter(){return we(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}})}addArchiveFilter(e){return we(this,void 0,void 0,function*(){const[t,i]=yield(0,o._)((0,d.z)([this.cipherArchiveService.archivedCiphers$(e).pipe((0,u.T)(e=>e.length>0)),this.cipherArchiveService.userHasPremium$(e)])),n=!i&&!t;return{data$:this.vaultFilterService.buildTypeTree({id:"headArchive",name:"HeadArchive",type:"archive",icon:"bwi-archive"},[{id:"archive",name:this.i18nService.t("archiveNoun"),type:"archive",icon:"bwi-archive"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyTypeFilter,premiumOptions:{showBadgeForNonPremium:!0,blockFilterAction:n?()=>we(this,void 0,void 0,function*(){return yield this.premiumUpgradePromptService.promptForPremium()}):void 0}}})}}Ee.ɵfac=function(e){return new(e||Ee)(n.rXU(w.cD),n.rXU(N.m),n.rXU(V.W),n.rXU(U.y),n.rXU(L.f),n.rXU(he.P),n.rXU(Y.o3),n.rXU(q.D),n.rXU(y.b),n.rXU(Ae.p),n.rXU(pe.J),n.rXU(ge.l))},Ee.ɵcmp=n.VBU({type:Ee,selectors:[["app-vault-filter"]],inputs:{activeFilter:"activeFilter",searchText:"searchText"},outputs:{onEditFolder:"onEditFolder",searchTextChanged:"searchTextChanged"},standalone:!1,decls:3,vars:2,consts:[["data-testid","filters",1,"tw-border","tw-border-solid","tw-border-secondary-300","tw-rounded"],["class","tw-text-center tw-p-5",4,"ngIf"],[4,"ngIf"],[1,"tw-text-center","tw-p-5"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin"],["data-testid","filters-header",1,"tw-bg-background-alt","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100","tw-rounded-t","tw-px-5","tw-py-2.5","tw-font-medium","tw-uppercase"],["bitLink","","href","https://bitwarden.com/help/searching-vault/","target","_blank","rel","noreferrer",1,"tw-float-right",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["data-testid","filters-body",1,"tw-p-5"],[1,"tw-mb-4"],["id","search","autocomplete","off","appAutofocus","",3,"ngModelChange","placeholder","ngModel"],[4,"ngFor","ngForOf"],[1,"filter"],[3,"activeFilter","section","isCollectionFilter"]],template:function(e,t){1&e&&(n.j41(0,"div",0),n.DNE(1,Ie,2,0,"div",1)(2,Be,12,13,"div",2),n.k0s()),2&e&&(n.R7$(),n.Y8G("ngIf",!t.isLoaded),n.R7$(),n.Y8G("ngIf",t.isLoaded))},dependencies:[W.Sq,W.bT,ve.BC,ve.vS,fe.C,me.B,ye.g,G.H,Ce.S,ee.$],encapsulation:2})},85184(e,t,i){"use strict";i.d(t,{p:()=>s});var n=i(72245),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function s(e,t){return r(this,void 0,void 0,function*(){const i=yield(0,n._)(e);if(null==i)throw new Error(`Failed to get ${t}`);return i})}},85494(e,t,i){"use strict";i.d(t,{G:()=>f});var n=i(2096),r=i(81525),s=i(90118),o=i(25065),a=i(33812),l=i(74208),c=i(66316),d=i(26657),u=i(56898),h=i(7730),A=i(68016),p=i(67311),g=i(25740),v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class f{constructor(e,t){this.params=e,this.dialogRef=t}onCollectionAssign(e){return v(this,void 0,void 0,function*(){this.dialogRef.close(e)})}static open(e,t){return e.open(f,t)}}f.ɵfac=function(e){return new(e||f)(a.rXU(r.Qs),a.rXU(c.ce))},f.ɵcmp=a.VBU({type:f,selectors:[["ng-component"]],decls:19,vars:20,consts:[["assignSubmitButton",""],["dialogSize","large"],["bitDialogTitle",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["bitDialogContent",""],[3,"onCollectionAssign","editableItemCountChange","params","submitBtn"],["bitDialogFooter",""],["form","assign_collections_form","type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){if(1&e){const e=a.RV6();a.j41(0,"bit-dialog",1)(1,"span",2),a.EFF(2),a.nI1(3,"i18n"),a.j41(4,"span",3),a.EFF(5),a.nI1(6,"i18n"),a.nI1(7,"i18n"),a.nI1(8,"pluralize"),a.k0s()(),a.j41(9,"div",4)(10,"assign-collections",5),a.bIt("onCollectionAssign",function(i){return l.eBV(e),l.Njj(t.onCollectionAssign(i))})("editableItemCountChange",function(i){return l.eBV(e),l.Njj(t.editableItemCount=i)}),a.k0s()(),a.qex(11,6),a.j41(12,"button",7,0),a.EFF(14),a.nI1(15,"i18n"),a.k0s(),a.j41(16,"button",8),a.EFF(17),a.nI1(18,"i18n"),a.k0s(),a.bVm(),a.k0s()}if(2&e){const e=a.sdS(13);a.R7$(2),a.SpI(" ",a.bMT(3,6,"assignToCollections")," "),a.R7$(3),a.SpI(" ",a.brH(8,12,t.editableItemCount,a.bMT(6,8,"item"),a.bMT(7,10,"items"))," "),a.R7$(5),a.Y8G("params",t.params)("submitBtn",e),a.R7$(4),a.SpI(" ",a.bMT(15,16,"assign")," "),a.R7$(3),a.SpI(" ",a.bMT(18,18,"cancel")," ")}},dependencies:[o.G,d.$,u.Q,h.I,A.m,p.hJ,s.Gc,g.$,n.n],encapsulation:2})},85523(e,t,i){"use strict";i.d(t,{O6:()=>G,W_:()=>U});var n=i(60409),r=i(33812),s=i(83731),o=i(33338),a=i(93695),l=i(34040),c=i(3204),d=i(12610),u=i(44500),h=i(52237),A=i(11979),p=i(66983),g=i(61325),v=i(55542),f=i(90118),m=i(45980),y=i(74208);function C(e,t){if(1&e&&(r.j41(0,"th",18),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.HbH(e.showExtraColumn?"tw-w-3/5":"tw-w-full"),r.Y8G("fn",e.sortByName),r.R7$(),r.SpI(" ",r.bMT(2,4,"name")," ")}}function w(e,t){if(1&e&&(r.j41(0,"th",19),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.HbH(e.showExtraColumn?"tw-w-3/5":"tw-w-full"),r.R7$(),r.SpI(" ",r.bMT(2,3,"name")," ")}}function I(e,t){1&e&&(r.j41(0,"th",20),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI(" ",r.bMT(2,1,"owner")," "))}function b(e,t){1&e&&(r.j41(0,"th",21),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"collections")))}function B(e,t){if(1&e&&(r.j41(0,"th",22),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.Y8G("fn",e.sortByGroups),r.R7$(),r.SpI(" ",r.bMT(2,2,"groups")," ")}}function E(e,t){if(1&e&&(r.j41(0,"th",23),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.Y8G("fn",e.sortByPermissions),r.R7$(),r.SpI(" ",r.bMT(2,2,"permission")," ")}}function S(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkMoveToFolder())}),r.nrm(1,"i",25),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"addToFolder")," "))}function Q(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkEditCollectionAccess())}),r.nrm(1,"i",26),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"editAccess")," "))}function k(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.assignToCollections())}),r.nrm(1,"i",27),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"assignToCollections")," "))}function T(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkArchive())}),r.nrm(1,"i",28),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"archiveVerb")," "))}function F(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkUnarchive())}),r.nrm(1,"i",29),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"unArchive")," "))}function P(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkRestore())}),r.nrm(1,"i",30),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"restoreSelected")," "))}function R(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",24),r.bIt("click",function(){y.eBV(e);const t=r.XpG();return y.Njj(t.bulkDelete())}),r.j41(1,"span",31),r.nrm(2,"i",32),r.EFF(3),r.nI1(4,"i18n"),r.k0s()()}if(2&e){const e=r.XpG();r.R7$(3),r.SpI(" ",r.bMT(4,1,e.showBulkTrashOptions?"permanentlyDeleteSelected":"delete")," ")}}function D(e,t){if(1&e){const e=r.RV6();r.j41(0,"tr",36),r.bIt("checkedToggled",function(){y.eBV(e);const t=r.XpG().$implicit,i=r.XpG(2);return y.Njj(i.selection.toggle(t))})("onEvent",function(t){y.eBV(e);const i=r.XpG(3);return y.Njj(i.event(t))}),r.k0s()}if(2&e){const e=r.XpG().$implicit,t=r.XpG(2);r.Y8G("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))("canViewCollectionInfo",t.canViewCollectionInfo(e.collection))("checked",t.selection.isSelected(e))}}function M(e,t){if(1&e){const e=r.RV6();r.j41(0,"tr",37),r.nI1(1,"async"),r.nI1(2,"async"),r.nI1(3,"async"),r.bIt("checkedToggled",function(){y.eBV(e);const t=r.XpG().$implicit,i=r.XpG(2);return y.Njj(i.selection.toggle(t))})("onEvent",function(t){y.eBV(e);const i=r.XpG(3);return y.Njj(i.event(t))}),r.k0s()}if(2&e){const e=r.XpG().$implicit,t=r.XpG(2);r.Y8G("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",r.bMT(1,19,t.canClone$(e)))("organizations",t.allOrganizations)("collections",t.allCollections)("checked",t.selection.isSelected(e))("canEditCipher",t.canEditCipher(e.cipher))("canAssignCollections",t.canAssignCollections(e.cipher))("canManageCollection",t.canManageCollection(e.cipher))("canDeleteCipher",r.bMT(2,21,t.cipherAuthorizationService.canDeleteCipher$(e.cipher,t.showAdminActions)))("canRestoreCipher",r.bMT(3,23,t.cipherAuthorizationService.canRestoreCipher$(e.cipher,t.showAdminActions)))("userCanArchive",t.userCanArchive)("enforceOrgDataOwnershipPolicy",t.enforceOrgDataOwnershipPolicy)}}function x(e,t){if(1&e&&(r.qex(0),r.DNE(1,D,1,12,"tr",34)(2,M,4,25,"tr",35),r.bVm()),2&e){const e=t.$implicit,i=r.XpG(2);r.R7$(),r.Y8G("ngIf",e.collection),r.R7$(),r.Y8G("ngIf",e.cipher&&(!i.addAccessToggle||i.addAccessToggle&&1!==i.addAccessStatus))}}function O(e,t){if(1&e&&r.DNE(0,x,3,2,"ng-container",33),2&e){const e=t.$implicit;r.Y8G("cdkVirtualForOf",e)("cdkVirtualForTemplateCacheSize",0)}}const G="tw-h-[75px]";class U{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()}constructor(e,t,i){this.cipherAuthorizationService=e,this.restrictedItemTypesService=t,this.routedVaultFilterService=i,this.RowHeight=75,this.showAdminActions=!1,this.allOrganizations=[],this.allCollections=[],this.allGroups=[],this.showBulkEditCollectionAccess=!1,this.showBulkAddToCollections=!1,this.showPermissionsColumn=!1,this._ciphers=[],this._collections=[],this.onEvent=new r.bkB,this.editableItems=[],this.dataSource=new v.s,this.selection=new n.C(!0,[],!0),this.restrictedTypes=[],this.sortByName=(e,t,i)=>{const n=this.prioritizeCollections(e,t);return 0!==n?n:this.compareNames(e,t)},this.sortByGroups=(e,t,i)=>{if(!(e.collection instanceof h.nb||t.collection instanceof h.nb))return 0;const n=e=>e.groups.length>0?e.groups.map(e=>this.getGroupName(e.id)||"").sort()[0]:null,r=this.prioritizeCollections(e,t);if(0!==r)return r;const s=n(e.collection),o=n(t.collection);return null===s?1:null===o?-1:s.localeCompare(o)},this.sortByPermissions=(e,t,i)=>{const n=e=>{var t;const i=e.collection?this.getCollectionPermission(e.collection):this.getCipherPermission(e.cipher);return null!==(t={[m.aF.Manage]:5,[m.aF.Edit]:4,[m.aF.EditExceptPass]:3,[m.aF.View]:2,[m.aF.ViewExceptPass]:1,NoAccess:0}[i])&&void 0!==t?t:-1},r=this.prioritizeCollections(e,t);if(0!==r)return r;const s=n(e),o=n(t);return s!==o?s-o:this.compareNames(e,t)},this.canDeleteSelected$=this.selection.changed.pipe((0,d.Z)(null),(0,u.n)(()=>{const t=this.selection.selected.filter(e=>e.cipher).map(e=>e.cipher);if(0===this.selection.selected.length)return(0,a.of)(!0);const i=t.map(t=>e.canDeleteCipher$(t,this.showAdminActions)),n=this.selection.selected.filter(e=>e.collection).every(e=>e.collection&&this.canDeleteCollection(e.collection));return(0,o.z)(i).pipe((0,c.T)(e=>e.every(e=>e)&&n))})),this.restrictedItemTypesService.restricted$.pipe((0,s.pQ)()).subscribe(e=>{this.restrictedTypes=e,this.refreshItems()}),this.canRestoreSelected$=this.selection.changed.pipe((0,d.Z)(null),(0,u.n)(()=>{const t=this.selection.selected.filter(e=>e.cipher).map(e=>e.cipher);if(0===this.selection.selected.length)return(0,a.of)(!0);const i=t.map(t=>e.canRestoreCipher$(t,this.showAdminActions));return(0,o.z)(i).pipe((0,c.T)(e=>e.every(e=>e)))}),(0,c.T)(e=>e&&this.showBulkTrashOptions)),this.disableMenu$=this.canDeleteSelected$.pipe((0,c.T)(e=>!(this.bulkMoveAllowed||this.showAssignToCollections()||e||this.showBulkEditCollectionAccess))),this.routedVaultFilterService.filter$.pipe((0,l.F)((e,t)=>e.organizationId===t.organizationId&&e.collectionId===t.collectionId&&e.folderId===t.folderId&&e.type===t.type&&e.organizationIdParamType===t.organizationIdParamType),(0,s.pQ)()).subscribe(()=>{this.clearSelection()})}clearSelection(){this.selection.clear()}get showExtraColumn(){return this.showCollections||this.showGroups||this.showOwner}get isAllSelected(){return this.getSortedEditableItems().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 bulkArchiveAllowed(){const e=this.selection.selected.some(e=>e.collection);return!(0===this.selection.selected.length||!this.userCanArchive||e||this.showBulkTrashOptions)&&(this.userCanArchive&&!this.selection.selected.find(e=>e.cipher&&(e.cipher.organizationId||e.cipher.archivedDate)))}get bulkUnarchiveAllowed(){return 0!==this.selection.selected.length&&!this.showBulkTrashOptions&&!this.selection.selected.find(e=>{var t,i;return!(null===(t=e.cipher)||void 0===t?void 0:t.archivedDate)||(null===(i=e.cipher)||void 0===i?void 0:i.organizationId)})}get showDelete(){if(0===this.selection.selected.length)return!0;const e=this.hasPersonalItems(),t=this.getUniqueOrganizationIds(),i=this.selection.selected.filter(e=>e.cipher).every(({cipher:e})=>this.canManageCollection(e)),n=this.selection.selected.filter(e=>e.collection).every(e=>e.collection&&this.canDeleteCollection(e.collection)),r=i&&n;return!(!r&&(!e||t.size&&!r))}get bulkAssignToCollectionsAllowed(){return this.showBulkAddToCollections&&this.ciphers.length>0&&!this.anySelectedCiphersAreArchived}get anySelectedCiphersAreArchived(){return this.selection.selected.some(e=>e.cipher&&g.n.isArchived(e.cipher))}canEditCollection(e){if(e.id===h.I_)return!1;const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canEdit(t)}canDeleteCollection(e){if(e.id===h.I_)return!1;const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canDelete(t)}canViewCollectionInfo(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canViewCollectionInfo(t)}toggleAll(){if(this.isAllSelected)this.selection.clear();else{const e=this.getSortedEditableItems();this.selection.select(...e.slice(0,500))}}getSortedEditableItems(){const e=this.dataSource.sort,t=[...this.editableItems];if(!e||!e.fn)return t;const i="asc"===e.direction?1:-1;return t.sort((t,n)=>e.fn(t,n,e.direction)*i)}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)})}bulkArchive(){this.event({type:"archive",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}bulkUnarchive(){this.event({type:"unarchive",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){return this.restrictedItemTypesService.restricted$.pipe((0,u.n)(t=>t.some(t=>t.cipherType===g.n.getType(e.cipher))?(0,a.of)(!1):this.cipherAuthorizationService.canCloneCipher$(e.cipher,this.showAdminActions)))}canEditCipher(e){if(null==e.organizationId)return!0;return this.allOrganizations.find(t=>t.id===e.organizationId).canEditAllCiphers&&this.viewingOrgVault||e.edit}canAssignCollections(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId),i=this.allCollections.filter(e=>!e.readOnly);return(null==t?void 0:t.canEditAllCiphers)&&this.viewingOrgVault||g.n.canAssignToCollections(e)&&i.length>0}canManageCollection(e){if(null==e.organizationId)return!0;if(this.showAdminActions){const t=this.allOrganizations.find(t=>t.id===e.organizationId);if(0===e.collectionIds.length)return!0===(null==t?void 0:t.canEditUnmanagedCollections);if((null==t?void 0:t.permissions.editAnyCollection)||(null==t?void 0:t.allowAdminAccessToAllCollectionItems)&&t.isAdmin)return!0}return this.activeCollection?!0===this.activeCollection.manage:this.allCollections.filter(t=>e.collectionIds.includes(t.id)).some(e=>e.manage)}refreshItems(){const e=this.collections.map(e=>({collection:e})),t=this.ciphers.filter(e=>!this.restrictedItemTypesService.isCipherRestricted(e,this.restrictedTypes)).map(e=>({cipher:e})),i=[].concat(e).concat(t);this.editableItems=i.filter(e=>void 0!==e.cipher||void 0!==e.collection&&(this.canEditCollection(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)})}showAssignToCollections(){if(!this.showBulkMove)return!1;if(0===this.allOrganizations.length)return!1;if(0===this.selection.selected.length)return!1;const e=this.hasPersonalItems(),t=this.getUniqueOrganizationIds(),i=this.allCollections.some(e=>!e.readOnly);if(t.size>1)return!1;if(0===t.size&&i)return e;const[n]=t,r=this.allOrganizations.find(e=>e.id===n),s=(null==r?void 0:r.canEditAllCiphers)&&this.viewingOrgVault,o=0===this.selection.selected.filter(e=>e.collection).length;return(s||this.allCiphersHaveEditAccess())&&o&&i}compareNames(e,t){var i,n;const r=e=>{var t,i;return(null===(t=e.collection)||void 0===t?void 0:t.name)||(null===(i=e.cipher)||void 0===i?void 0:i.name)};return null!==(n=null===(i=r(e))||void 0===i?void 0:i.localeCompare(r(t)))&&void 0!==n?n:-1}prioritizeCollections(e,t){return e.collection&&!t.collection?-1:!e.collection&&t.collection?1:0}hasPersonalItems(){return this.selection.selected.some(({cipher:e})=>!(null==e?void 0:e.organizationId))}allCiphersHaveEditAccess(){return this.selection.selected.filter(({cipher:e})=>e).every(({cipher:e})=>(null==e?void 0:e.edit)&&(null==e?void 0:e.viewPassword))}getUniqueOrganizationIds(){return new Set(this.selection.selected.flatMap(e=>{var t,i;return null!==(i=null===(t=e.cipher)||void 0===t?void 0:t.organizationId)&&void 0!==i?i:[]}))}getGroupName(e){var t;return null===(t=this.allGroups.find(t=>t.id===e))||void 0===t?void 0:t.name}getCollectionPermission(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.id==h.I_&&(null==t?void 0:t.canEditUnassignedCiphers)?m.aF.Edit:e.assigned?(0,m.Jh)(e):"NoAccess"}getCipherPermission(e){var t;if(!e.organizationId||0===e.collectionIds.length)return m.aF.Manage;const i=null===(t=this.allCollections)||void 0===t?void 0:t.filter(t=>{if(t.assigned)return e.collectionIds.find(e=>{if(t.id===e)return t})});if(1===(null==i?void 0:i.length))return(0,m.Jh)(i[0]);if((null==i?void 0:i.length)>0){const e=i.map(e=>(0,m.Jh)(e));return[m.aF.Manage,m.aF.Edit,m.aF.EditExceptPass,m.aF.View,m.aF.ViewExceptPass].find(t=>e.includes(t))}return"NoAccess"}}U.ɵfac=function(e){return new(e||U)(r.rXU(A.y),r.rXU(p.b),r.rXU(f.BR))},U.ɵcmp=r.VBU({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",addAccessStatus:"addAccessStatus",addAccessToggle:"addAccessToggle",activeCollection:"activeCollection",userCanArchive:"userCanArchive",enforceOrgDataOwnershipPolicy:"enforceOrgDataOwnershipPolicy",ciphers:"ciphers",collections:"collections"},outputs:{onEvent:"onEvent"},standalone:!1,decls:33,vars:35,consts:[["headerMenu",""],["bitScrollLayout","",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,"change","disabled","checked"],["for","checkAll",1,"tw-mb-0","!tw-font-medium","!tw-text-muted"],["bitCell","","bitSortable","name",3,"fn","class",4,"ngIf"],["bitCell","",3,"class",4,"ngIf"],["bitCell","","class","tw-hidden tw-w-2/5 lg:tw-table-cell",4,"ngIf"],["bitCell","","class","tw-w-2/5",4,"ngIf"],["bitCell","","bitSortable","groups","class","tw-w-2/5",3,"fn",4,"ngIf"],["bitCell","","bitSortable","permissions","default","desc","class","tw-w-2/5",3,"fn",4,"ngIf"],["bitCell","",1,"tw-w-12","tw-text-right"],["bitIconButton","bwi-ellipsis-v","size","small","type","button",3,"disabled","bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem",""],["body",""],["bitCell","","bitSortable","name",3,"fn"],["bitCell",""],["bitCell","",1,"tw-hidden","tw-w-2/5","lg:tw-table-cell"],["bitCell","",1,"tw-w-2/5"],["bitCell","","bitSortable","groups",1,"tw-w-2/5",3,"fn"],["bitCell","","bitSortable","permissions","default","desc",1,"tw-w-2/5",3,"fn"],["type","button","bitMenuItem","",3,"click"],["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-shared"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-archive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-unarchive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],[4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTemplateCacheSize"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","canViewCollectionInfo","checked","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","canEditCipher","canAssignCollections","canManageCollection","canDeleteCipher","canRestoreCipher","userCanArchive","enforceOrgDataOwnershipPolicy","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"checkedToggled","onEvent","disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","canViewCollectionInfo","checked"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"checkedToggled","onEvent","disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","canEditCipher","canAssignCollections","canManageCollection","canDeleteCipher","canRestoreCipher","userCanArchive","enforceOrgDataOwnershipPolicy"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"cdk-virtual-scroll-viewport",1)(1,"bit-table",2),r.qex(2,3),r.j41(3,"tr")(4,"th",4)(5,"input",5),r.bIt("change",function(i){return y.eBV(e),y.Njj(i?t.toggleAll():null)}),r.k0s(),r.j41(6,"label",6),r.EFF(7),r.nI1(8,"i18n"),r.k0s()(),r.DNE(9,C,3,6,"th",7)(10,w,3,5,"th",8)(11,I,3,3,"th",9)(12,b,3,3,"th",10)(13,B,3,4,"th",11)(14,E,3,4,"th",12),r.j41(15,"th",13),r.SS7(16),r.nI1(17,"async"),r.nrm(18,"button",14),r.nI1(19,"i18n"),r.nI1(20,"i18n"),r.j41(21,"bit-menu",null,0),r.DNE(23,S,4,3,"button",15)(24,Q,4,3,"button",15)(25,k,4,3,"button",15),r.nVh(26,T,4,3,"button",16),r.nVh(27,F,4,3,"button",16),r.DNE(28,P,4,3,"button",15),r.nI1(29,"async"),r.DNE(30,R,5,3,"button",15),r.nI1(31,"async"),r.k0s()()(),r.bVm(),r.DNE(32,O,1,2,"ng-template",17),r.k0s()()}if(2&e){const e=r.sdS(22);r.Y8G("itemSize",t.RowHeight),r.R7$(),r.Y8G("dataSource",t.dataSource),r.R7$(4),r.Y8G("disabled",t.disabled||t.isEmpty)("checked",t.selection.hasValue()&&t.isAllSelected),r.R7$(2),r.JRh(r.bMT(8,23,"all")),r.R7$(2),r.Y8G("ngIf",t.showAdminActions),r.R7$(),r.Y8G("ngIf",!t.showAdminActions),r.R7$(),r.Y8G("ngIf",t.showOwner),r.R7$(),r.Y8G("ngIf",t.showCollections),r.R7$(),r.Y8G("ngIf",t.showGroups),r.R7$(),r.Y8G("ngIf",t.showPermissionsColumn);const i=r.bMT(17,25,t.disableMenu$);r.R7$(4),r.Y8G("label",r.mNQ(r.bMT(19,27,"options")))("disabled",t.disabled||t.isEmpty||i)("bitMenuTriggerFor",e),r.BMQ("title",i?r.bMT(20,29,"missingPermissions"):""),r.R7$(5),r.Y8G("ngIf",t.bulkMoveAllowed),r.R7$(),r.Y8G("ngIf",t.showAdminActions&&t.showBulkEditCollectionAccess),r.R7$(),r.Y8G("ngIf",(t.showAdminActions||t.showAssignToCollections())&&t.bulkAssignToCollectionsAllowed),r.R7$(),r.vxM(t.bulkArchiveAllowed?26:-1),r.R7$(),r.vxM(t.bulkUnarchiveAllowed?27:-1),r.R7$(),r.Y8G("ngIf",r.bMT(29,31,t.canRestoreSelected$)),r.R7$(2),r.Y8G("ngIf",r.bMT(31,33,t.canDeleteSelected$))}},encapsulation:2})},85776(e,t,i){"use strict";var n,r,s,o,a,l;i.d(t,{Ah:()=>n,QI:()=>r}),function(e){e[e.None=0]="None",e[e.OpenIdConnect=1]="OpenIdConnect",e[e.Saml2=2]="Saml2"}(n||(n={})),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.KeyConnector=1]="KeyConnector",e[e.TrustedDeviceEncryption=2]="TrustedDeviceEncryption"}(r||(r={})),function(e){e[e.RedirectGet=0]="RedirectGet",e[e.FormPost=1]="FormPost"}(s||(s={})),function(e){e[e.HttpRedirect=1]="HttpRedirect",e[e.HttpPost=2]="HttpPost"}(o||(o={})),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"}(a||(a={})),function(e){e[e.IfIdpWantAuthnRequestsSigned=0]="IfIdpWantAuthnRequestsSigned",e[e.Always=1]="Always",e[e.Never=3]="Never"}(l||(l={}))},85800(e,t,i){"use strict";i.d(t,{r:()=>A});var n=i(60989),r=i(94573),s=i(33812),o=i(36801),a=i(22191),l=i(75583),c=i(74208),d=i(36288),u=i(58806);function h(e,t){if(1&e){const e=s.RV6();s.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),s.EFF(5),s.k0s(),s.j41(6,"button",5),s.nI1(7,"i18n"),s.bIt("click",function(){c.eBV(e);const t=s.XpG();return c.Njj(t.closed.emit())}),s.k0s()(),s.j41(8,"div",6),s.SdG(9),s.k0s()()(),s.nrm(10,"div",7),s.k0s()}if(2&e){const e=s.XpG();s.BMQ("aria-label",e.title()),s.R7$(5),s.SpI(" ",e.title()," "),s.R7$(),s.Y8G("label",s.bMT(7,3,"close"))}}class A{constructor(){this.templateRef=r.ebz.required(s.C4Q),this.title=(0,r.hFB)(""),this.closed=new s.bkB}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=s.VBU({type:A,selectors:[["bit-popover"]],viewQuery:function(e,t){1&e&&s.wEZ(t.templateRef,s.C4Q,5),2&e&&s.NyB()},inputs:{title:[1,"title"]},outputs:{closed:"closed"},exportAs:["popoverComponent"],ngContentSelectors:["*"],decls:1,vars:0,consts:[["cdkTrapFocus","","cdkTrapFocusAutoCapture","","role","dialog","aria-modal","true",1,"tw-relative"],[1,"tw-overflow-hidden","tw-rounded-xl","tw-shadow-lg"],[1,"tw-relative","tw-z-20","tw-w-72","tw-break-words","tw-bg-background","tw-pb-4","tw-pt-2","tw-text-main"],[1,"tw-me-2","tw-flex","tw-items-start","tw-justify-between","tw-gap-4","tw-ps-4"],["bitTypography","h5",1,"tw-font-medium","tw-mt-1"],["type","button","bitIconButton","bwi-close","size","small",3,"click","label"],["bitTypography","body2",1,"tw-px-4"],[1,"bit-popover-arrow"]],template:function(e,t){1&e&&(s.NAR(),s.DNE(0,h,11,5,"ng-template"))},dependencies:[n.Pd,n.kB,a.Q,d.s,l.E,u.r,o.$Z],encapsulation:2})},86157(e,t,i){"use strict";i.d(t,{v:()=>n});class n{}},86214(e,t,i){"use strict";i.d(t,{_:()=>n});class n{}},86226(e,t,i){"use strict";i.d(t,{j:()=>g});var n=i(77468),r=i(94573),s=i(33812),o=i(90246);const a=["*",[["","slot","end"]]],l=e=>({"tw-truncate":e});function c(e,t){1&e&&s.SdG(0,1)}function d(e,t){1&e&&s.eu8(0)}function u(e,t){if(1&e&&s.DNE(0,d,1,0,"ng-container",2),2&e){s.XpG();const e=s.sdS(1);s.Y8G("ngTemplateOutlet",e)}}function h(e,t){1&e&&s.eu8(0)}function A(e,t){if(1&e&&s.DNE(0,h,1,0,"ng-container",2),2&e){s.XpG();const e=s.sdS(1);s.Y8G("ngTemplateOutlet",e)}}let p=0;class g{constructor(e,t){this.elementRef=e,this.parentFormControl=t,this.classList=["tw-inline-flex","tw-gap-1","tw-items-baseline","tw-flex-row","tw-min-w-0"],this.id=(0,r.hFB)("bit-label-"+p++)}get title(){var e,t;return null!==(t=null===(e=this.elementRef.nativeElement.textContent)||void 0===e?void 0:e.trim())&&void 0!==t?t:""}get isInsideFormControl(){return!!this.parentFormControl}}g.ɵfac=function(e){return new(e||g)(s.rXU(s.aKT),s.rXU(o.f,8))},g.ɵcmp=s.VBU({type:g,selectors:[["bit-label"]],hostVars:4,hostBindings:function(e,t){2&e&&(s.Avn("id",t.id())("title",t.title),s.HbH(t.classList))},inputs:{id:[1,"id"]},ngContentSelectors:["*","[slot=end]"],decls:6,vars:5,consts:[["endSlotContent",""],[3,"ngClass"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(s.NAR(a),s.DNE(0,c,1,0,"ng-template",null,0,s.C5r),s.j41(2,"span",1),s.SdG(3),s.nVh(4,u,1,1,"ng-container"),s.k0s(),s.nVh(5,A,1,1,"ng-container")),2&e&&(s.R7$(2),s.Y8G("ngClass",s.eq3(3,l,!t.isInsideFormControl)),s.R7$(2),s.vxM(t.isInsideFormControl?4:-1),s.R7$(),s.vxM(t.isInsideFormControl?-1:5))},dependencies:[n.MD,n.YU,n.T3],encapsulation:2})},86346(e,t,i){"use strict";i.d(t,{Z:()=>s});var n=i(31442),r=i(8583);class s extends r.n{constructor(e){super(),this.type=n.ak.Generic,e&&(this.type=e.type)}get subTitle(){}static fromJSON(e){return Object.assign(new s,e)}static fromSdkSecureNoteView(e){const t=new s;return t.type=e.type,t}toSdkSecureNoteView(){return this}}},86388(e,t,i){"use strict";i.d(t,{v:()=>n});class n{}},86561(e,t,i){"use strict";i.d(t,{K:()=>n.K});var n=i(55393)},86639(e,t,i){"use strict";i.d(t,{z:()=>Fi});var n=i(77468),r=i(74208),s=i(33812),o=i(83731),a=i(51757),l=i(66046),c=i(16878),d=i(72245),u=i(44500),h=i(3633),A=i(31442),p=i(75751),g=i(38620),v=i(37579),f=i(75583),m=i(98403),y=i(26411),C=i(8433);class w{}var I=i(47836);class b{constructor(){this.viewCacheService=(0,r.WQX)(I.Z),this.cipherCache=this.viewCacheService.signal({key:"cipher-form-cache",initialValue:null,deserializer:p.f.fromJSON}),this.initializedWithValue=!!this.cipherCache(),this.initialCacheValue=this.cipherCache()}cacheCipherView(e){this.cipherCache.set(p.f.fromJSON(e))}getCachedCipherView(){return this.initialCacheValue}clearCache(){this.initialCacheValue=null,this.cipherCache.set(null)}}b.ɵfac=function(e){return new(e||b)},b.ɵprov=r.jDH({token:b,factory:b.ɵfac});var B=i(27442),E=i(94735),S=i(58950),Q=i(14318),k=i(47135),T=i(26477),F=i(89591),P=i(34003),R=i(88507),D=i(54931),M=i(6528),x=i(11766),O=i(67036),G=i(14093),U=i(22191),V=i(81525),j=i(81573),N=i(29029),z=i(50700),Y=i(7730),L=i(68016),K=i(67311),X=i(56898),q=i(86226),H=i(93199),W=i(97553),$=i(43759),J=i(33886),Z=i(68923),_=i(36288),ee=i(25740);function te(e,t){if(1&e&&s.nrm(0,"bit-option",12),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function ie(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",10),s.DNE(5,te,1,2,"bit-option",11),s.k0s(),s.j41(6,"bit-hint"),s.EFF(7),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"fieldType")),s.R7$(3),s.Y8G("ngForOf",e.fieldTypeOptions),s.R7$(2),s.SpI(" ",e.getTypeHint()," ")}}function ne(e,t){1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.SpI(" ",s.bMT(2,1,"linkedLabelHelpText")," "))}function re(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",13),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.removeField())}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("label",s.i5U(1,1,"deleteCustomField",e.customFieldForm.value.label))}}class se{constructor(e,t,i){this.data=e,this.formBuilder=t,this.i18nService=i,this.customFieldForm=this.formBuilder.group({type:A.PU.Text,label:["",a.k0.required]}),this.fieldTypeOptions=[{name:this.i18nService.t("cfTypeText"),value:A.PU.Text},{name:this.i18nService.t("cfTypeHidden"),value:A.PU.Hidden},{name:this.i18nService.t("cfTypeCheckbox"),value:A.PU.Boolean},{name:this.i18nService.t("cfTypeLinked"),value:A.PU.Linked}],this.FieldType=A.PU,this.submit=()=>{"add"===this.variant?this.addField():this.updateLabel()},this.variant=e.editLabelConfig?"edit":"add",this.fieldTypeOptions=this.fieldTypeOptions.filter(e=>(!this.data.disallowHiddenField||e.value!==A.PU.Hidden)&&(this.data.cipherType!==A.gC.SecureNote&&this.data.cipherType!==A.gC.SshKey||e.value!==A.PU.Linked)),"edit"===this.variant&&(this.customFieldForm.controls.label.setValue(e.editLabelConfig.label),this.customFieldForm.controls.type.disable())}getTypeHint(){var e;switch(null===(e=this.customFieldForm.get("type"))||void 0===e?void 0:e.value){case A.PU.Text:return this.i18nService.t("textHelpText");case A.PU.Hidden:return this.i18nService.t("hiddenHelpText");case A.PU.Boolean:return this.i18nService.t("checkBoxHelpText");case A.PU.Linked:return this.i18nService.t("linkedHelpText");default:return""}}addField(){if(this.customFieldForm.invalid)return;const{type:e,label:t}=this.customFieldForm.value;this.data.addField(e,t)}updateLabel(){if(this.customFieldForm.invalid)return;const{label:e}=this.customFieldForm.value;this.data.updateLabel(this.data.editLabelConfig.index,e)}removeField(){this.data.removeField(this.data.editLabelConfig.index)}}se.ɵfac=function(e){return new(e||se)(s.rXU(V.Qs),s.rXU(a.ok),s.rXU(z.W))},se.ɵcmp=s.VBU({type:se,selectors:[["vault-add-edit-custom-field-dialog"]],decls:20,vars:18,consts:[["bit-dialog","",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["disableMargin",""],["bitInput","","id","fieldLabel","formControlName","label","type","text"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit",3,"disabled"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"],["type","button","buttonType","dangerGhost","class","tw-ml-auto","bitIconButton","bwi-trash",3,"label","click",4,"ngIf"],["id","fieldType","formControlName","type"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],["type","button","buttonType","dangerGhost","bitIconButton","bwi-trash",1,"tw-ml-auto",3,"click","label"]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"span",1),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"div",2),s.DNE(5,ie,8,5,"bit-form-field",3),s.j41(6,"bit-form-field",4)(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"input",5),s.DNE(11,ne,3,3,"bit-hint",3),s.k0s()(),s.qex(12,6),s.j41(13,"button",7),s.EFF(14),s.nI1(15,"i18n"),s.k0s(),s.j41(16,"button",8),s.EFF(17),s.nI1(18,"i18n"),s.k0s(),s.DNE(19,re,2,4,"button",9),s.bVm(),s.k0s()),2&e&&(s.Y8G("formGroup",t.customFieldForm)("bitSubmit",t.submit),s.R7$(2),s.SpI(" ",s.bMT(3,10,"add"===t.variant?"addField":"editField")," "),s.R7$(3),s.Y8G("ngIf","add"===t.variant),s.R7$(3),s.JRh(s.bMT(9,12,"fieldLabel")),s.R7$(3),s.Y8G("ngIf",t.customFieldForm.value.type===t.FieldType.Linked),s.R7$(2),s.Y8G("disabled",t.customFieldForm.invalid),s.R7$(),s.SpI(" ",s.bMT(15,14,"add"===t.variant?"add":"save")," "),s.R7$(3),s.SpI(" ",s.bMT(18,16,"cancel")," "),s.R7$(2),s.Y8G("ngIf","edit"===t.variant))},dependencies:[n.MD,n.Sq,n.bT,E.p,j.P,Y.I,L.m,K.hJ,N.t,X.Q,y.L,q.j,H.I,W.J,$.h,C.p,J.w,Z.P,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,U.Q,_.s,v.C,g.L,ee.$],encapsulation:2});var oe=i(66316),ae=i(60989),le=i(90246),ce=i(76356),de=i(69896),ue=i(58806),he=i(50352),Ae=i(57178),pe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ge=["customFieldRow"],ve=e=>({"tw-mb-0":e}),fe=e=>({"tw-items-center":e});function me(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.nrm(3,"input",13),s.k0s()),2&e){const e=s.XpG().$implicit;s.R7$(2),s.JRh(e.value.name)}}function ye(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",16),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG(4);return r.Njj(i.logHiddenEvent(t))}),s.k0s()}}function Ce(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.nrm(3,"input",14),s.DNE(4,ye,1,0,"button",15),s.k0s()),2&e){const e=s.XpG(),t=e.$implicit,i=e.index,n=s.XpG(2);s.R7$(2),s.JRh(t.value.name),s.R7$(2),s.Y8G("ngIf",n.canViewPasswords(i))}}function we(e,t){if(1&e&&(s.j41(0,"bit-form-control",12),s.nrm(1,"input",17),s.j41(2,"bit-label"),s.EFF(3),s.k0s()()),2&e){const e=s.XpG().$implicit;s.R7$(3),s.JRh(e.value.name)}}function Ie(e,t){if(1&e&&s.nrm(0,"bit-option",20),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function be(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.j41(3,"bit-select",18),s.DNE(4,Ie,1,2,"bit-option",19),s.k0s()()),2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.R7$(2),s.JRh(e.value.name),s.R7$(2),s.Y8G("ngForOf",t.linkedFieldOptions)}}function Be(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",21),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG(),i=t.$implicit,n=t.index,o=s.XpG(2);return r.Njj(o.openAddEditCustomFieldDialog({index:n,label:i.value.name}))}),s.k0s()}if(2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.Y8G("label",s.i5U(1,2,"editFieldLabel",e.value.name))("disabled",t.parentFormDisabled)}}function Ee(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",22),s.nI1(1,"i18n"),s.bIt("keydown",function(t){r.eBV(e);const i=s.XpG(),n=i.$implicit,o=i.index,a=s.XpG(2);return r.Njj(a.handleKeyDown(t,n.value.name,o))}),s.k0s()}if(2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.Y8G("label",s.i5U(1,2,"reorderToggleButton",e.value.name))("disabled",t.parentFormDisabled)}}function Se(e,t){if(1&e&&(s.j41(0,"div",8,0),s.DNE(2,me,4,1,"bit-form-field",9)(3,Ce,5,2,"bit-form-field",9)(4,we,4,1,"bit-form-control",9)(5,be,5,2,"bit-form-field",9)(6,Be,2,5,"button",10)(7,Ee,2,5,"button",11),s.k0s()),2&e){const e=t.$implicit,i=t.index,n=s.XpG(2);s.Y8G("formGroupName",i)("ngClass",s.eq3(10,fe,e.value.type===n.FieldType.Boolean))("cdkDragDisabled",!n.canEdit(e.value.type)),s.BMQ("data-testid",e.value.name+"-entry"),s.R7$(2),s.Y8G("ngIf",e.value.type===n.FieldType.Text),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Hidden),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Boolean),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Linked),s.R7$(),s.Y8G("ngIf",n.canEdit(e.value.type)),s.R7$(),s.Y8G("ngIf",n.canEdit(e.value.type)&&n.fields.controls.length>1)}}function Qe(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",23),s.bIt("click",function(){r.eBV(e);const t=s.XpG(2);return r.Njj(t.openAddEditCustomFieldDialog())}),s.nrm(1,"i",24),s.EFF(2),s.nI1(3,"i18n"),s.k0s()}2&e&&(s.R7$(2),s.SpI(" ",s.bMT(3,1,"addField")," "))}function ke(e,t){if(1&e){const e=s.RV6();s.j41(0,"section",2)(1,"bit-section-header")(2,"h2",3),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"form",4)(6,"bit-card",5),s.bIt("cdkDropListDropped",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.drop(t))}),s.DNE(7,Se,8,12,"div",6)(8,Qe,4,3,"button",7),s.k0s()()()}if(2&e){const e=s.XpG();s.Y8G("ngClass",s.eq3(7,ve,e.disableSectionMargin)),s.R7$(3),s.JRh(s.bMT(4,5,"customFields")),s.R7$(2),s.Y8G("formGroup",e.customFieldsForm),s.R7$(2),s.Y8G("ngForOf",e.fields.controls),s.R7$(),s.Y8G("ngIf",!e.isPartialEdit&&!e.parentFormDisabled)}}class Te{constructor(e,t,i,n,c,d){this.dialogService=e,this.cipherFormContainer=t,this.formBuilder=i,this.i18nService=n,this.liveAnnouncer=c,this.eventCollectionService=d,this.numberOfFieldsChange=new s.bkB,this.customFieldsForm=this.formBuilder.group({fields:new a.Yp([])}),this.linkedFieldOptions=[],this.hasCustomFields=!1,this.focusOnNewInput$=new l.B,this.parentFormDisabled=!1,this.FieldType=A.PU,this.destroyed$=(0,r.WQX)(r.abz),this.cipherFormContainer.registerChildForm("customFields",this.customFieldsForm),this.customFieldsForm.valueChanges.pipe((0,o.pQ)()).subscribe(()=>{this.updateCipher(this.fields.getRawValue())}),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)()).subscribe(e=>{this.parentFormDisabled="disabled"===e})}get fields(){return this.customFieldsForm.controls.fields}canEdit(e){return!this.isPartialEdit&&(e!==A.PU.Hidden||null===this.cipherFormContainer.originalCipherView||this.cipherFormContainer.originalCipherView.viewPassword)}ngOnInit(){var e,t;const i=this.getLinkedFieldsOptionsForCipher(),n=Array.from(null!==(e=null==i?void 0:i.entries())&&void 0!==e?e:[]);n.sort((e,t)=>e[1].sortPosition-t[1].sortPosition),this.linkedFieldOptions=n.map(([e,t])=>({name:this.i18nService.t(t.i18nKey),value:e}));const r=this.cipherFormContainer.getInitialCipherView();null===(t=null==r?void 0:r.fields)||void 0===t||t.forEach(e=>{var t;let i=e.value;e.type===A.PU.Boolean&&(i="true"===e.value);const n=this.formBuilder.group({type:e.type,name:e.name,value:i,linkedId:e.linkedId,newField:!1});e.type!==A.PU.Hidden||(null===(t=this.cipherFormContainer.originalCipherView)||void 0===t?void 0:t.viewPassword)||n.controls.value.disable(),this.fields.push(n)}),"partial-edit"===this.cipherFormContainer.config.mode&&(this.isPartialEdit=!0,this.customFieldsForm.disable())}ngAfterViewInit(){(0,R.y)(this.focusOnNewInput$,this.customFieldRows.changes).pipe((0,o.pQ)(this.destroyed$)).subscribe(()=>{const e=this.customFieldRows.last.nativeElement,t=e.querySelector("input"),i=e.querySelector("label").textContent.trim();this.liveAnnouncer.announce(this.i18nService.t("fieldAdded",i),"polite").then(()=>{t.focus()})})}openAddEditCustomFieldDialog(e){const{cipherType:t,mode:i,originalCipher:n}=this.cipherFormContainer.config;this.dialogRef=this.dialogService.open(se,{data:{addField:this.addField.bind(this),updateLabel:this.updateLabel.bind(this),removeField:this.removeField.bind(this),cipherType:t,editLabelConfig:e,disallowHiddenField:"edit"===i&&!n.viewPassword}})}canViewPasswords(e){return null===this.cipherFormContainer.originalCipherView||(this.cipherFormContainer.originalCipherView.viewPassword||this.fields.at(e).value.newField)}updateLabel(e,t){var i;this.fields.at(e).patchValue({name:t}),null===(i=this.dialogRef)||void 0===i||i.close()}removeField(e){var t;this.fields.removeAt(e),null===(t=this.dialogRef)||void 0===t||t.close()}addField(e,t){var i;null===(i=this.dialogRef)||void 0===i||i.close();let n=null,r=null;e===A.PU.Boolean&&(n=!1),e===A.PU.Linked&&this.linkedFieldOptions.length>0&&(r=this.linkedFieldOptions[0].value),this.fields.push(this.formBuilder.group({type:e,name:t,value:n,linkedId:r,newField:!0})),this.focusOnNewInput$.next()}drop(e){(0,P.HD)(this.fields.controls,e.previousIndex,e.currentIndex),this.updateCipher(this.fields.controls.map(e=>e.value))}handleKeyDown(e,t,i){return pe(this,void 0,void 0,function*(){if("ArrowUp"===e.key&&0!==i){e.preventDefault();const n=i-1;this.drop({previousIndex:i,currentIndex:n}),yield this.liveAnnouncer.announce(this.i18nService.t("reorderFieldUp",t,n+1,this.fields.length),"assertive"),setTimeout(()=>{e.target.focus()})}if("ArrowDown"===e.key&&i!==this.fields.length-1){e.preventDefault();const n=i+1;this.drop({previousIndex:i,currentIndex:n}),yield this.liveAnnouncer.announce(this.i18nService.t("reorderFieldDown",t,n+1,this.fields.length),"assertive")}})}logHiddenEvent(e){return pe(this,void 0,void 0,function*(){const{mode:t,originalCipher:i}=this.cipherFormContainer.config,n=["edit","partial-edit"].includes(t);e&&n&&(yield this.eventCollectionService.collect(D.Bx.Cipher_ClientToggledHiddenFieldVisible,i.id,!1,i.organizationId))})}getLinkedFieldsOptionsForCipher(){switch(this.cipherFormContainer.config.cipherType){case A.gC.Login:return G.r.prototype.linkedFieldOptions;case A.gC.Card:return M.G.prototype.linkedFieldOptions;case A.gC.Identity:return O.O.prototype.linkedFieldOptions;default:return null}}updateCipher(e){const t=e.map(e=>{var t;let i;i="number"==typeof e.value?`${e.value}`:"boolean"==typeof e.value?e.value?"true":"false":e.value;const n=new x.g;return n.type=e.type,n.name=e.name,n.value=i,n.linkedId=null!==(t=e.linkedId)&&void 0!==t?t:void 0,n});this.hasCustomFields=t.length>0,this.numberOfFieldsChange.emit(t.length),this.cipherFormContainer.patchCipher(e=>(e.fields=t,e))}}Te.ɵfac=function(e){return new(e||Te)(s.rXU(oe.o3),s.rXU(w),s.rXU(a.ok),s.rXU(z.W),s.rXU(ae.Ai),s.rXU(D.c_))},Te.ɵcmp=s.VBU({type:Te,selectors:[["vault-custom-fields"]],viewQuery:function(e,t){if(1&e&&s.GBs(ge,5),2&e){let e;s.mGM(e=s.lsd())&&(t.customFieldRows=e)}},inputs:{disableSectionMargin:"disableSectionMargin"},outputs:{numberOfFieldsChange:"numberOfFieldsChange"},decls:1,vars:1,consts:[["customFieldRow",""],["class","tw-mb-5 bit-compact:tw-mb-4",3,"ngClass",4,"ngIf"],[1,"tw-mb-5","bit-compact:tw-mb-4",3,"ngClass"],["bitTypography","h6"],[3,"formGroup"],["formArrayName","fields","cdkDropList","","data-testid","custom-fields",3,"cdkDropListDropped"],["class","tw-flex tw-p-3 -tw-mx-3 tw-gap-4 tw-bg-background tw-rounded-lg first:-tw-mt-3 last-of-type:tw-mb-0","cdkDrag","",3,"formGroupName","ngClass","cdkDragDisabled",4,"ngFor","ngForOf"],["type","button","bitLink","","linkType","primary","data-testid","add-field-button",3,"click",4,"ngIf"],["cdkDrag","",1,"tw-flex","tw-p-3","-tw-mx-3","tw-gap-4","tw-bg-background","tw-rounded-lg","first:-tw-mt-3","last-of-type:tw-mb-0",3,"formGroupName","ngClass","cdkDragDisabled"],["class","tw-flex-1","disableMargin","",4,"ngIf"],["type","button","bitIconButton","bwi-pencil-square","class","tw-self-center tw-mt-2","data-testid","edit-custom-field-button",3,"label","disabled","click",4,"ngIf"],["type","button","bitIconButton","bwi-drag-and-drop","class","tw-self-center tw-mt-2","cdkDragHandle","","data-testid","reorder-toggle-button",3,"label","disabled","keydown",4,"ngIf"],["disableMargin","",1,"tw-flex-1"],["bitInput","","formControlName","value","data-testid","custom-text-field"],["bitInput","","formControlName","value","type","password","data-testid","custom-hidden-field",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-custom-hidden-field",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-custom-hidden-field",3,"toggledChange"],["bitCheckbox","","formControlName","value","type","checkbox","data-testid","custom-boolean-field"],["formControlName","linkedId","data-testid","custom-linked-field"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],["type","button","bitIconButton","bwi-pencil-square","data-testid","edit-custom-field-button",1,"tw-self-center","tw-mt-2",3,"click","label","disabled"],["type","button","bitIconButton","bwi-drag-and-drop","cdkDragHandle","","data-testid","reorder-toggle-button",1,"tw-self-center","tw-mt-2",3,"keydown","label","disabled"],["type","button","bitLink","","linkType","primary","data-testid","add-field-button",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"]],template:function(e,t){1&e&&s.DNE(0,ke,9,9,"section",1),2&e&&s.Y8G("ngIf",t.hasCustomFields)},dependencies:[E.p,n.MD,n.YU,n.Sq,n.bT,a.YN,a.qT,a.me,a.Zm,a.BC,a.cb,y.L,le.f,q.j,W.J,$.h,ce.e,de.a,a.X1,a.j4,a.JD,a.$R,a.v8,S.U,f.E,ue.r,Q.i,U.Q,_.s,k.q,he.P,C.p,J.w,Z.P,P.ad,P.O7,P.T1,P.Fb,T.V,Ae.g,ee.$],encapsulation:2});var Fe=i(94573);const Pe=e=>({"tw-mb-0":e});function Re(e,t){if(1&e&&(s.j41(0,"bit-form-control",6),s.nrm(1,"input",7),s.j41(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s()()),2&e){const e=s.XpG();s.Y8G("disableMargin",e.hasCustomFields||e.isPartialEdit),s.R7$(3),s.JRh(s.bMT(4,2,"passwordPrompt"))}}function De(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",8),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.addCustomField())}),s.nrm(1,"i",9),s.EFF(2),s.nI1(3,"i18n"),s.k0s()}2&e&&(s.R7$(2),s.SpI(" ",s.bMT(3,1,"addField")," "))}class Me{get allowNewField(){return this.additionalOptionsForm.enabled}constructor(e,t,i,n){this.cipherFormContainer=e,this.formBuilder=t,this.passwordRepromptService=i,this.changeDetectorRef=n,this.additionalOptionsForm=this.formBuilder.group({notes:[null],reprompt:[!1]}),this.passwordRepromptEnabled$=this.passwordRepromptService.enabled$.pipe((0,B.t)({refCount:!1,bufferSize:1})),this.hasCustomFields=!1,this.isPartialEdit=!1,this.cipherFormContainer.registerChildForm("additionalOptions",this.additionalOptionsForm),this.additionalOptionsForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>(t.notes=e.notes,t.reprompt=e.reprompt?A.b1.Password:A.b1.None,t))})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e&&this.additionalOptionsForm.patchValue({notes:e.notes,reprompt:e.reprompt===A.b1.Password}),"partial-edit"===this.cipherFormContainer.config.mode&&(this.additionalOptionsForm.disable(),this.isPartialEdit=!0)}addCustomField(){this.customFieldsComponent.openAddEditCustomFieldDialog()}handleCustomFieldChange(e){this.hasCustomFields=e>0,this.changeDetectorRef.detectChanges()}}Me.ɵfac=function(e){return new(e||Me)(s.rXU(w),s.rXU(a.ok),s.rXU(F.q),s.rXU(Fe.gRc))},Me.ɵcmp=s.VBU({type:Me,selectors:[["vault-additional-options-section"]],viewQuery:function(e,t){if(1&e&&s.GBs(Te,5),2&e){let e;s.mGM(e=s.lsd())&&(t.customFieldsComponent=e.first)}},inputs:{disableSectionMargin:"disableSectionMargin"},decls:15,vars:15,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"ngClass","formGroup"],["bitTypography","h6"],["bitInput","","rows","5","formControlName","notes"],[3,"disableMargin",4,"ngIf"],["bitLink","","type","button","linkType","primary",3,"click",4,"ngIf"],[3,"numberOfFieldsChange","disableSectionMargin"],[3,"disableMargin"],["type","checkbox","bitCheckbox","","formControlName","reprompt"],["bitLink","","type","button","linkType","primary",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"textarea",2),s.k0s(),s.DNE(11,Re,5,4,"bit-form-control",3),s.nI1(12,"async"),s.DNE(13,De,4,3,"button",4),s.k0s()(),s.j41(14,"vault-custom-fields",5),s.bIt("numberOfFieldsChange",function(e){return t.handleCustomFieldChange(e)}),s.k0s()),2&e&&(s.Y8G("ngClass",s.eq3(13,Pe,t.disableSectionMargin&&!t.hasCustomFields))("formGroup",t.additionalOptionsForm),s.R7$(3),s.JRh(s.bMT(4,7,"additionalOptions")),s.R7$(5),s.JRh(s.bMT(9,9,"notes")),s.R7$(3),s.Y8G("ngIf",s.bMT(12,11,t.passwordRepromptEnabled$)),s.R7$(2),s.Y8G("ngIf",!t.hasCustomFields&&!t.isPartialEdit&&t.allowNewField),s.R7$(),s.Y8G("disableSectionMargin",t.disableSectionMargin))},dependencies:[n.MD,n.YU,n.bT,S.U,f.E,ue.r,E.p,Q.i,y.L,le.f,q.j,W.J,$.h,a.X1,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,k.q,he.P,Te,T.V,Ae.g,n.Jj,ee.$],encapsulation:2});var xe=i(39907),Oe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ge(e,t){if(1&e&&s.nrm(0,"bit-option",14),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function Ue(e,t){if(1&e&&s.nrm(0,"bit-option",14),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}class Ve{get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i,n){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.eventCollectionService=n,this.cardDetailsForm=this.formBuilder.group({cardholderName:"",number:"",brand:"",expMonth:"",expYear:"",code:""}),this.cardBrands=[{name:"-- "+this.i18nService.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:this.i18nService.t("other"),value:"Other"}],this.expirationMonths=[{name:"-- "+this.i18nService.t("select")+" --",value:null},{name:"01 - "+this.i18nService.t("january"),value:"1"},{name:"02 - "+this.i18nService.t("february"),value:"2"},{name:"03 - "+this.i18nService.t("march"),value:"3"},{name:"04 - "+this.i18nService.t("april"),value:"4"},{name:"05 - "+this.i18nService.t("may"),value:"5"},{name:"06 - "+this.i18nService.t("june"),value:"6"},{name:"07 - "+this.i18nService.t("july"),value:"7"},{name:"08 - "+this.i18nService.t("august"),value:"8"},{name:"09 - "+this.i18nService.t("september"),value:"9"},{name:"10 - "+this.i18nService.t("october"),value:"10"},{name:"11 - "+this.i18nService.t("november"),value:"11"},{name:"12 - "+this.i18nService.t("december"),value:"12"}],this.EventType=D.Bx,this.cipherFormContainer.registerChildForm("cardDetails",this.cardDetailsForm),this.cardDetailsForm.valueChanges.pipe((0,o.pQ)()).subscribe(({cardholderName:e,number:t,brand:i,expMonth:n,expYear:r,code:s})=>{this.cipherFormContainer.patchCipher(o=>{var a;const l=null!==(a=(0,xe.jd)(r))&&void 0!==a?a:"";return o.card.cardholderName=e,o.card.number=t,o.card.brand=i,o.card.expMonth=n,o.card.expYear=l,o.card.code=s,o})}),this.cardDetailsForm.controls.number.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=M.G.getCardBrandByPatterns(e);t&&this.cardDetailsForm.controls.brand.setValue(t)})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.card):this.initNewCipher(),this.disabled&&this.cardDetailsForm.disable()}initFromExistingCipher(e){var t,i,n,r,s,o,a,l,c,d,u,h;this.cardDetailsForm.patchValue({cardholderName:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.cardholderName)&&void 0!==i?i:e.cardholderName,number:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.number)&&void 0!==r?r:e.number,brand:null!==(o=null===(s=this.initialValues)||void 0===s?void 0:s.brand)&&void 0!==o?o:e.brand,expMonth:null!==(l=null===(a=this.initialValues)||void 0===a?void 0:a.expMonth)&&void 0!==l?l:e.expMonth,expYear:null!==(d=null===(c=this.initialValues)||void 0===c?void 0:c.expYear)&&void 0!==d?d:e.expYear,code:null!==(h=null===(u=this.initialValues)||void 0===u?void 0:u.code)&&void 0!==h?h:e.code})}initNewCipher(){var e,t,i,n,r,s;this.cardDetailsForm.patchValue({cardholderName:(null===(e=this.initialValues)||void 0===e?void 0:e.cardholderName)||"",number:(null===(t=this.initialValues)||void 0===t?void 0:t.number)||"",expMonth:(null===(i=this.initialValues)||void 0===i?void 0:i.expMonth)||"",expYear:(null===(n=this.initialValues)||void 0===n?void 0:n.expYear)||"",code:(null===(r=this.initialValues)||void 0===r?void 0:r.code)||"",brand:M.G.getCardBrandByPatterns(null===(s=this.initialValues)||void 0===s?void 0:s.number)||""})}getSectionHeading(){const{brand:e}=this.cardDetailsForm.value;return e&&"Other"!==e?this.i18nService.t("cardBrandDetails",e):this.i18nService.t("cardDetails")}logCardEvent(e,t){return Oe(this,void 0,void 0,function*(){const{mode:i,originalCipher:n}=this.cipherFormContainer.config,r=["edit","partial-edit"].includes(i);e&&r&&(yield this.eventCollectionService.collect(t,n.id,!1,n.organizationId))})}}function je(e,t){if(1&e&&s.nrm(0,"bit-option",25),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}Ve.ɵfac=function(e){return new(e||Ve)(s.rXU(w),s.rXU(a.ok),s.rXU(z.W),s.rXU(D.c_))},Ve.ɵcmp=s.VBU({type:Ve,selectors:[["vault-card-details-section"]],inputs:{originalCipherView:"originalCipherView",disabled:"disabled"},decls:40,vars:22,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["id","cardholderName","bitInput","","formControlName","cardholderName"],["id","cardNumber","bitInput","","formControlName","number","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-card-number",3,"toggledChange"],["id","cardBrand","formControlName","brand"],[3,"value","label",4,"ngFor","ngForOf"],[1,"tw-flex","tw-flex-wrap","tw-gap-1"],[1,"tw-flex-1"],["id","cardExpMonth","formControlName","expMonth"],["id","cardExpYear","bitInput","","formControlName","expYear","type","number"],["disableMargin",""],["id","cardCode","bitInput","","formControlName","code","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-card-code",3,"toggledChange"],[3,"value","label"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.k0s()(),s.j41(4,"bit-card")(5,"bit-form-field")(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.nrm(9,"input",2),s.k0s(),s.j41(10,"bit-form-field")(11,"bit-label"),s.EFF(12),s.nI1(13,"i18n"),s.k0s(),s.nrm(14,"input",3),s.j41(15,"button",4),s.bIt("toggledChange",function(e){return t.logCardEvent(e,t.EventType.Cipher_ClientToggledCardNumberVisible)}),s.k0s()(),s.j41(16,"bit-form-field")(17,"bit-label"),s.EFF(18),s.nI1(19,"i18n"),s.k0s(),s.j41(20,"bit-select",5),s.DNE(21,Ge,1,2,"bit-option",6),s.k0s()(),s.j41(22,"div",7)(23,"bit-form-field",8)(24,"bit-label"),s.EFF(25),s.nI1(26,"i18n"),s.k0s(),s.j41(27,"bit-select",9),s.DNE(28,Ue,1,2,"bit-option",6),s.k0s()(),s.j41(29,"bit-form-field",8)(30,"bit-label"),s.EFF(31),s.nI1(32,"i18n"),s.k0s(),s.nrm(33,"input",10),s.k0s()(),s.j41(34,"bit-form-field",11)(35,"bit-label"),s.EFF(36),s.nI1(37,"i18n"),s.k0s(),s.nrm(38,"input",12),s.j41(39,"button",13),s.bIt("toggledChange",function(e){return t.logCardEvent(e,t.EventType.Cipher_ClientToggledCardCodeVisible)}),s.k0s()()()()),2&e&&(s.Y8G("formGroup",t.cardDetailsForm),s.R7$(3),s.SpI(" ",t.getSectionHeading()," "),s.R7$(4),s.JRh(s.bMT(8,10,"cardholderName")),s.R7$(5),s.JRh(s.bMT(13,12,"number")),s.R7$(6),s.JRh(s.bMT(19,14,"brand")),s.R7$(3),s.Y8G("ngForOf",t.cardBrands),s.R7$(4),s.JRh(s.bMT(26,16,"expirationMonth")),s.R7$(3),s.Y8G("ngForOf",t.expirationMonths),s.R7$(3),s.JRh(s.bMT(32,18,"expirationYear")),s.R7$(5),s.JRh(s.bMT(37,20,"securityCode")))},dependencies:[Q.i,f.E,ue.r,y.L,q.j,W.J,$.h,ce.e,de.a,a.X1,a.me,a.Q0,a.BC,a.cb,a.j4,a.JD,C.p,J.w,Z.P,S.U,U.Q,_.s,E.p,n.MD,n.Sq,ee.$],encapsulation:2});class Ne{get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.identityTitleOptions=[{name:"-- "+this.i18nService.t("select")+" --",value:null},{name:this.i18nService.t("mr"),value:this.i18nService.t("mr")},{name:this.i18nService.t("mrs"),value:this.i18nService.t("mrs")},{name:this.i18nService.t("ms"),value:this.i18nService.t("ms")},{name:this.i18nService.t("mx"),value:this.i18nService.t("mx")},{name:this.i18nService.t("dr"),value:this.i18nService.t("dr")}],this.identityForm=this.formBuilder.group({title:[null],firstName:[""],middleName:[""],lastName:[""],username:[""],company:[""],ssn:[""],passportNumber:[""],licenseNumber:[""],email:[""],phone:[""],address1:[""],address2:[""],address3:[""],city:[""],state:[""],postalCode:[""],country:[""]}),this.cipherFormContainer.registerChildForm("identityDetails",this.identityForm),this.identityForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=new O.O;t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.username=e.username,t.company=e.company,t.ssn=e.ssn,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t.email=e.email,t.phone=e.phone,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,this.cipherFormContainer.patchCipher(e=>(e.identity=t,e))})}ngOnInit(){var e;this.disabled&&this.identityForm.disable();const t=this.cipherFormContainer.getInitialCipherView();t?(this.initFromExistingCipher(t.identity),this.populateFormData(t)):(this.initNewCipher(),this.identityForm.patchValue({username:(null===(e=this.cipherFormContainer.config.initialValues)||void 0===e?void 0:e.username)||""}))}initFromExistingCipher(e){var t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S,Q,k,T,F,P,R;this.identityForm.patchValue({firstName:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.firstName)&&void 0!==i?i:e.firstName,middleName:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.middleName)&&void 0!==r?r:e.middleName,lastName:null!==(o=null===(s=this.initialValues)||void 0===s?void 0:s.lastName)&&void 0!==o?o:e.lastName,company:null!==(l=null===(a=this.initialValues)||void 0===a?void 0:a.company)&&void 0!==l?l:e.company,ssn:null!==(d=null===(c=this.initialValues)||void 0===c?void 0:c.ssn)&&void 0!==d?d:e.ssn,passportNumber:null!==(h=null===(u=this.initialValues)||void 0===u?void 0:u.passportNumber)&&void 0!==h?h:e.passportNumber,licenseNumber:null!==(p=null===(A=this.initialValues)||void 0===A?void 0:A.licenseNumber)&&void 0!==p?p:e.licenseNumber,email:null!==(v=null===(g=this.initialValues)||void 0===g?void 0:g.email)&&void 0!==v?v:e.email,phone:null!==(m=null===(f=this.initialValues)||void 0===f?void 0:f.phone)&&void 0!==m?m:e.phone,address1:null!==(C=null===(y=this.initialValues)||void 0===y?void 0:y.address1)&&void 0!==C?C:e.address1,address2:null!==(I=null===(w=this.initialValues)||void 0===w?void 0:w.address2)&&void 0!==I?I:e.address2,address3:null!==(B=null===(b=this.initialValues)||void 0===b?void 0:b.address3)&&void 0!==B?B:e.address3,city:null!==(S=null===(E=this.initialValues)||void 0===E?void 0:E.city)&&void 0!==S?S:e.city,state:null!==(k=null===(Q=this.initialValues)||void 0===Q?void 0:Q.state)&&void 0!==k?k:e.state,postalCode:null!==(F=null===(T=this.initialValues)||void 0===T?void 0:T.postalCode)&&void 0!==F?F:e.postalCode,country:null!==(R=null===(P=this.initialValues)||void 0===P?void 0:P.country)&&void 0!==R?R:e.country})}initNewCipher(){var e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g;this.identityForm.patchValue({firstName:(null===(e=this.initialValues)||void 0===e?void 0:e.firstName)||"",middleName:(null===(t=this.initialValues)||void 0===t?void 0:t.middleName)||"",lastName:(null===(i=this.initialValues)||void 0===i?void 0:i.lastName)||"",company:(null===(n=this.initialValues)||void 0===n?void 0:n.company)||"",ssn:(null===(r=this.initialValues)||void 0===r?void 0:r.ssn)||"",passportNumber:(null===(s=this.initialValues)||void 0===s?void 0:s.passportNumber)||"",licenseNumber:(null===(o=this.initialValues)||void 0===o?void 0:o.licenseNumber)||"",email:(null===(a=this.initialValues)||void 0===a?void 0:a.email)||"",phone:(null===(l=this.initialValues)||void 0===l?void 0:l.phone)||"",address1:(null===(c=this.initialValues)||void 0===c?void 0:c.address1)||"",address2:(null===(d=this.initialValues)||void 0===d?void 0:d.address2)||"",address3:(null===(u=this.initialValues)||void 0===u?void 0:u.address3)||"",city:(null===(h=this.initialValues)||void 0===h?void 0:h.city)||"",state:(null===(A=this.initialValues)||void 0===A?void 0:A.state)||"",postalCode:(null===(p=this.initialValues)||void 0===p?void 0:p.postalCode)||"",country:(null===(g=this.initialValues)||void 0===g?void 0:g.country)||""})}populateFormData(e){var t,i;const{identity:n}=e;this.identityForm.patchValue({title:n.title,firstName:n.firstName,middleName:n.middleName,lastName:n.lastName,username:null!==(i=null===(t=this.cipherFormContainer.config.initialValues)||void 0===t?void 0:t.username)&&void 0!==i?i:n.username,company:n.company,ssn:n.ssn,passportNumber:n.passportNumber,licenseNumber:n.licenseNumber,email:n.email,phone:n.phone,address1:n.address1,address2:n.address2,address3:n.address3,city:n.city,state:n.state,postalCode:n.postalCode,country:n.country})}}Ne.ɵfac=function(e){return new(e||Ne)(s.rXU(w),s.rXU(a.ok),s.rXU(z.W))},Ne.ɵcmp=s.VBU({type:Ne,selectors:[["vault-identity-section"]],inputs:{originalCipherView:"originalCipherView",disabled:"disabled"},decls:118,vars:68,consts:[[3,"formGroup"],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["formControlName","title"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","formControlName","firstName"],["bitInput","","formControlName","middleName"],["bitInput","","formControlName","lastName"],["bitInput","","formControlName","username"],["disableMargin",""],["bitInput","","formControlName","company"],["formControlName","ssn","bitInput","","type","password"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-ssn"],["formControlName","passportNumber","bitInput","","type","password"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-passport-number"],["bitInput","","formControlName","licenseNumber"],["bitInput","","formControlName","email"],["bitInput","","formControlName","phone"],["bitInput","","formControlName","address1"],["bitInput","","formControlName","address2"],["bitInput","","formControlName","address3"],["bitInput","","formControlName","city"],["bitInput","","formControlName","state"],["bitInput","","formControlName","postalCode"],["bitInput","","formControlName","country"],[3,"value","label"]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"section",1)(2,"bit-section-header")(3,"h2",2),s.EFF(4),s.nI1(5,"i18n"),s.k0s()(),s.j41(6,"bit-card")(7,"bit-form-field")(8,"bit-label"),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.j41(11,"bit-select",3),s.DNE(12,je,1,2,"bit-option",4),s.k0s()(),s.j41(13,"bit-form-field")(14,"bit-label"),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.nrm(17,"input",5),s.k0s(),s.j41(18,"bit-form-field")(19,"bit-label"),s.EFF(20),s.nI1(21,"i18n"),s.k0s(),s.nrm(22,"input",6),s.k0s(),s.j41(23,"bit-form-field")(24,"bit-label"),s.EFF(25),s.nI1(26,"i18n"),s.k0s(),s.nrm(27,"input",7),s.k0s(),s.j41(28,"bit-form-field")(29,"bit-label"),s.EFF(30),s.nI1(31,"i18n"),s.k0s(),s.nrm(32,"input",8),s.k0s(),s.j41(33,"bit-form-field",9)(34,"bit-label"),s.EFF(35),s.nI1(36,"i18n"),s.k0s(),s.nrm(37,"input",10),s.k0s()()(),s.j41(38,"section",1)(39,"bit-section-header")(40,"h2",2),s.EFF(41),s.nI1(42,"i18n"),s.k0s()(),s.j41(43,"bit-card")(44,"bit-form-field")(45,"bit-label"),s.EFF(46),s.nI1(47,"i18n"),s.k0s(),s.nrm(48,"input",11)(49,"button",12),s.k0s(),s.j41(50,"bit-form-field")(51,"bit-label"),s.EFF(52),s.nI1(53,"i18n"),s.k0s(),s.nrm(54,"input",13)(55,"button",14),s.k0s(),s.j41(56,"bit-form-field",9)(57,"bit-label"),s.EFF(58),s.nI1(59,"i18n"),s.k0s(),s.nrm(60,"input",15),s.k0s()()(),s.j41(61,"section",1)(62,"bit-section-header")(63,"h2",2),s.EFF(64),s.nI1(65,"i18n"),s.k0s()(),s.j41(66,"bit-card")(67,"bit-form-field")(68,"bit-label"),s.EFF(69),s.nI1(70,"i18n"),s.k0s(),s.nrm(71,"input",16),s.k0s(),s.j41(72,"bit-form-field",9)(73,"bit-label"),s.EFF(74),s.nI1(75,"i18n"),s.k0s(),s.nrm(76,"input",17),s.k0s()()(),s.j41(77,"section",1)(78,"bit-section-header")(79,"h2",2),s.EFF(80),s.nI1(81,"i18n"),s.k0s()(),s.j41(82,"bit-card")(83,"bit-form-field")(84,"bit-label"),s.EFF(85),s.nI1(86,"i18n"),s.k0s(),s.nrm(87,"input",18),s.k0s(),s.j41(88,"bit-form-field")(89,"bit-label"),s.EFF(90),s.nI1(91,"i18n"),s.k0s(),s.nrm(92,"input",19),s.k0s(),s.j41(93,"bit-form-field")(94,"bit-label"),s.EFF(95),s.nI1(96,"i18n"),s.k0s(),s.nrm(97,"input",20),s.k0s(),s.j41(98,"bit-form-field")(99,"bit-label"),s.EFF(100),s.nI1(101,"i18n"),s.k0s(),s.nrm(102,"input",21),s.k0s(),s.j41(103,"bit-form-field")(104,"bit-label"),s.EFF(105),s.nI1(106,"i18n"),s.k0s(),s.nrm(107,"input",22),s.k0s(),s.j41(108,"bit-form-field")(109,"bit-label"),s.EFF(110),s.nI1(111,"i18n"),s.k0s(),s.nrm(112,"input",23),s.k0s(),s.j41(113,"bit-form-field",9)(114,"bit-label"),s.EFF(115),s.nI1(116,"i18n"),s.k0s(),s.nrm(117,"input",24),s.k0s()()()()),2&e&&(s.Y8G("formGroup",t.identityForm),s.R7$(4),s.JRh(s.bMT(5,24,"personalDetails")),s.R7$(5),s.SpI(" ",s.bMT(10,26,"title")," "),s.R7$(3),s.Y8G("ngForOf",t.identityTitleOptions),s.R7$(3),s.SpI(" ",s.bMT(16,28,"firstName")," "),s.R7$(5),s.SpI(" ",s.bMT(21,30,"middleName")," "),s.R7$(5),s.SpI(" ",s.bMT(26,32,"lastName")," "),s.R7$(5),s.SpI(" ",s.bMT(31,34,"username")," "),s.R7$(5),s.SpI(" ",s.bMT(36,36,"company")," "),s.R7$(6),s.JRh(s.bMT(42,38,"identification")),s.R7$(5),s.SpI(" ",s.bMT(47,40,"ssn")," "),s.R7$(6),s.SpI(" ",s.bMT(53,42,"passportNumber")," "),s.R7$(6),s.SpI(" ",s.bMT(59,44,"licenseNumber")," "),s.R7$(6),s.JRh(s.bMT(65,46,"contactInfo")),s.R7$(5),s.SpI(" ",s.bMT(70,48,"email")," "),s.R7$(5),s.SpI(" ",s.bMT(75,50,"phone")," "),s.R7$(6),s.JRh(s.bMT(81,52,"address")),s.R7$(5),s.SpI(" ",s.bMT(86,54,"address1")," "),s.R7$(5),s.SpI(" ",s.bMT(91,56,"address2")," "),s.R7$(5),s.SpI(" ",s.bMT(96,58,"address3")," "),s.R7$(5),s.SpI(" ",s.bMT(101,60,"cityTown")," "),s.R7$(5),s.SpI(" ",s.bMT(106,62,"stateProvince")," "),s.R7$(5),s.SpI(" ",s.bMT(111,64,"zipPostalCodeLabel")," "),s.R7$(5),s.SpI(" ",s.bMT(116,66,"country")," "))},dependencies:[n.MD,n.Sq,N.t,E.p,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,S.U,Q.i,y.L,q.j,W.J,$.h,ce.e,de.a,U.Q,_.s,C.p,J.w,Z.P,f.E,ue.r,ee.$],encapsulation:2});var ze=i(33277),Ye=i(3204),Le=i(34040),Ke=i(73276),Xe=i(2738),qe=i(43978),He=i(52237),We=i(78781),$e=i(47696),Je=i(35500),Ze=i(18499),_e=i(37115),et=i(89812),tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function it(e,t){1&e&&(s.j41(0,"span",2),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.SpI(" ",s.bMT(2,1,"archived")," "))}function nt(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",7),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.toggleFavorite())}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("bitIconButton",e.favoriteIcon)("label",s.bMT(1,4,"favorite"))("disabled",e.favoriteButtonDisabled),s.BMQ("aria-checked",e.itemDetailsForm.value.favorite)}}function rt(e,t){if(1&e&&(s.nrm(0,"bit-option",11),s.nI1(1,"async")),2&e){const e=s.XpG(2);s.Y8G("value",null)("label",s.bMT(1,2,e.userEmail$))}}function st(e,t){if(1&e&&s.nrm(0,"bit-option",11),2&e){const e=t.$implicit;s.Y8G("value",e.id)("label",e.name)}}function ot(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",8),s.DNE(5,rt,2,4,"bit-option",9)(6,st,1,2,"bit-option",10),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"owner")),s.R7$(3),s.Y8G("ngIf",e.showPersonalOwnershipOption),s.R7$(),s.Y8G("ngForOf",e.organizations)}}function at(e,t){if(1&e&&(s.j41(0,"bit-hint",15),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e){const e=s.XpG(2);s.R7$(),s.SpI(" ",s.i5U(2,1,"cannotRemoveViewOnlyCollections",e.readOnlyCollectionsNames.join(", "))," ")}}function lt(e,t){if(1&e&&(s.qex(0),s.j41(1,"bit-form-field",12)(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"bit-multi-select",13),s.DNE(6,at,3,4,"bit-hint",14),s.k0s(),s.bVm()),2&e){const e=s.XpG();s.R7$(),s.Y8G("disableMargin",e.config.hideIndividualVaultFields),s.R7$(2),s.JRh(s.bMT(4,4,"collections")),s.R7$(2),s.Y8G("baseItems",e.collectionOptions),s.R7$(),s.Y8G("ngIf",e.readOnlyCollectionsNames.length>0)}}function ct(e,t){if(1&e&&s.nrm(0,"bit-option",11),2&e){const e=t.$implicit;s.Y8G("value",e.id)("label",e.name)}}function dt(e,t){if(1&e&&(s.j41(0,"bit-form-field",16)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",17),s.DNE(5,ct,1,2,"bit-option",10),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,2,"folder")),s.R7$(3),s.Y8G("ngForOf",e.config.folders)}}class ut{get readOnlyCollectionsNames(){return this.readOnlyCollections.map(e=>e.name)}get partialEdit(){return"partial-edit"===this.config.mode}get allowPersonalOwnership(){return this.config.organizationDataOwnershipDisabled}get collections(){return this.config.collections}get initialValues(){return this.config.initialValues}get showPersonalOwnershipOption(){return this.allowPersonalOwnership||this.itemDetailsForm.controls.organizationId.disabled||!this.allowPersonalOwnership&&this.config.originalCipher&&null==this.itemDetailsForm.controls.organizationId.value}constructor(e,t,i,n,r,s,l){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.destroyRef=n,this.accountService=r,this.policyService=s,this.platformUtilsService=l,this.itemDetailsForm=this.formBuilder.group({name:["",[a.k0.required]],organizationId:[null],folderId:[null],collectionIds:new a.MJ([],[a.k0.required]),favorite:[!1]}),this.showArchiveBadge=(0,ze.EW)(()=>{var e;return(null===(e=this.originalCipherView())||void 0===e?void 0:e.isArchived)&&this.platformUtilsService.getClientType()===Xe.s.Desktop}),this.collectionOptions=[],this.readOnlyCollections=[],this.userEmail$=this.accountService.activeAccount$.pipe((0,Ye.T)(e=>e.email)),this.organizations=[],this.favoriteButtonDisabled=!1,this.originalCipherView=(0,Fe.hFB)(),this.cipherFormContainer.registerChildForm("itemDetails",this.itemDetailsForm),this.itemDetailsForm.valueChanges.pipe((0,o.pQ)(),(0,Ye.T)(()=>this.itemDetailsForm.getRawValue())).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return Object.assign(t,{name:e.name,organizationId:e.organizationId,folderId:e.folderId,collectionIds:[...(null===(i=e.collectionIds)||void 0===i?void 0:i.map(e=>e.id))||[],...this.readOnlyCollections.map(e=>e.id)],favorite:e.favorite}),t})})}get favoriteIcon(){return this.itemDetailsForm.controls.favorite.value?"bwi-star-f":"bwi-star"}toggleFavorite(){this.itemDetailsForm.controls.favorite.setValue(!this.itemDetailsForm.controls.favorite.value)}get allowOwnershipChange(){var e;return("edit"!==this.config.mode||null==(null===(e=this.originalCipherView())||void 0===e?void 0:e.organizationId))&&(this.allowPersonalOwnership?this.organizations.length>0:this.organizations.length>1)}get showOwnership(){const e=this.organizations.length>0&&"edit"===this.config.mode,t=this.config.isAdminConsole&&"clone"!==this.config.mode;return this.allowOwnershipChange||e&&!t}get defaultOwner(){return this.allowPersonalOwnership?null:this.organizations[0].id}ngOnInit(){return tt(this,void 0,void 0,function*(){var e,t,i,n,r;if(this.organizations=this.config.organizations.sort(We.A.getSortFunction(this.i18nService,"name")),this.userId=yield(0,d._)(this.accountService.activeAccount$.pipe(h.F6)),!this.allowPersonalOwnership&&0===this.organizations.length)throw new Error("No organizations available for ownership.");const s=this.cipherFormContainer.getInitialCipherView();if(s)yield this.initFromExistingCipher(s);else{const s=null===(e=this.initialValues)||void 0===e?void 0:e.organizationId;this.itemDetailsForm.setValue({name:(null===(t=this.initialValues)||void 0===t?void 0:t.name)||"",organizationId:s||this.defaultOwner,folderId:(null===(i=this.initialValues)||void 0===i?void 0:i.folderId)||null,collectionIds:[],favorite:!1}),yield this.updateCollectionOptions(null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.collectionIds)&&void 0!==r?r:[])}this.setFormState(),this.itemDetailsForm.controls.organizationId.valueChanges.pipe((0,o.pQ)(this.destroyRef),(0,Le.F)(),(0,Ke.H)(()=>tt(this,void 0,void 0,function*(){yield this.updateCollectionOptions(),this.setFormState()}))).subscribe()})}setFormState(){this.config.originalCipher&&!this.allowPersonalOwnership?null==this.itemDetailsForm.controls.organizationId.value?(this.cipherFormContainer.disableFormFields(),this.itemDetailsForm.controls.organizationId.enable(),this.favoriteButtonDisabled=!0):(this.cipherFormContainer.enableFormFields(),this.favoriteButtonDisabled=!1,this.setCollectionControlState()):this.allowOwnershipChange||this.itemDetailsForm.controls.organizationId.disable({emitEvent:!1})}getDefaultCollectionId(e){return tt(this,void 0,void 0,function*(){if(!e||this.allowPersonalOwnership)return;if(!(yield(0,d._)(this.policyService.policiesByType$(qe.tt.OrganizationDataOwnership,this.userId))).find(e=>e.organizationId))return;const t=this.collections.find(t=>t.organizationId===e&&t.type===He.it.DefaultUserCollection);return null==t?void 0:t.id})}initFromExistingCipher(e){return tt(this,void 0,void 0,function*(){var t,i,n,r,s,o,a;const{name:l,folderId:c,collectionIds:d}=e;this.itemDetailsForm.patchValue({name:l||(null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.name)&&void 0!==i?i:""),organizationId:null!==(n=e.organizationId)&&void 0!==n?n:null,folderId:c||(null!==(s=null===(r=this.initialValues)||void 0===r?void 0:r.folderId)&&void 0!==s?s:null),collectionIds:[],favorite:e.favorite});const u=this.itemDetailsForm.controls.organizationId.value,h=this.cipherFormContainer.initializedWithCachedCipher();"clone"===this.config.mode&&(h||this.itemDetailsForm.controls.name.setValue(e.name+" - "+this.i18nService.t("clone")),this.allowPersonalOwnership||null!=e.organizationId||this.itemDetailsForm.controls.organizationId.setValue(this.defaultOwner));const A=(null==d?void 0:d.length)?d:null!==(a=null===(o=this.initialValues)||void 0===o?void 0:o.collectionIds)&&void 0!==a?a:[];yield this.updateCollectionOptions(A),this.setCollectionControlState(),this.partialEdit?(this.itemDetailsForm.disable(),this.itemDetailsForm.controls.favorite.enable(),this.itemDetailsForm.controls.folderId.enable()):"edit"===this.config.mode&&(this.config.isAdminConsole&&this.config.admin||(this.readOnlyCollections=this.collections.filter(e=>e.organizationId===u&&e.readOnly&&this.originalCipherView().collectionIds.includes(e.id))))})}setCollectionControlState(){const e=this.cipherFormContainer.getInitialCipherView(),t=this.itemDetailsForm.controls.organizationId.value,i=this.organizations.find(e=>e.id===t);i&&e&&((i.canEditAllCiphers||e.canAssignToCollections)&&(!i.allowAdminAccessToAllCollectionItems||e.viewPassword&&e.edit)&&(i.type!==qe.D7.Custom||e.viewPassword)||this.itemDetailsForm.controls.collectionIds.disable())}updateCollectionOptions(){return tt(this,arguments,void 0,function*(e=[]){var t,i;const n=this.itemDetailsForm.controls.organizationId.value,r=this.itemDetailsForm.controls.collectionIds;if(null==n)return this.collectionOptions=[],r.reset(),r.disable(),void(this.showCollectionsControl=!1);r.enable(),this.showCollectionsControl=!0;const s=(null!==(i=null===(t=this.originalCipherView())||void 0===t?void 0:t.collectionIds)&&void 0!==i?i:[]).length>0&&this.originalCipherView().collectionIds.every(e=>{var t;return(null===(t=this.collections.find(t=>t.id===e))||void 0===t?void 0:t.type)===He.it.SharedCollection});if(this.collectionOptions=this.collections.filter(e=>e.organizationId===n&&(!!this.partialEdit||(!!this.config.admin||(!s||e.type!==He.it.DefaultUserCollection)&&(e.assigned&&!e.readOnly)))).sort((e,t)=>(e.type===He.it.DefaultUserCollection?-1:0)-(t.type===He.it.DefaultUserCollection?-1:0)).map(e=>({id:e.id,name:e.name,listName:e.name,labelName:e.name})),r.reset(),r.enable(),this.showCollectionsControl=!0,1!==this.collectionOptions.length)if((null==e?void 0:e.filter(Boolean).length)>0)r.setValue(this.collectionOptions.filter(t=>e.includes(t.id)));else{const e=yield this.getDefaultCollectionId(n);e&&r.setValue(this.collectionOptions.filter(t=>t.id===e))}else r.setValue(this.collectionOptions)})}}ut.ɵfac=function(e){return new(e||ut)(s.rXU(w),s.rXU(a.ok),s.rXU(z.W),s.rXU(r.abz),s.rXU(Je.D),s.rXU(Ze.m),s.rXU(_e.y))},ut.ɵcmp=s.VBU({type:ut,selectors:[["vault-item-details-section"]],inputs:{config:"config",originalCipherView:[1,"originalCipherView"]},decls:16,vars:12,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["bitBadge",""],["slot","end","type","button","size","small","role","checkbox",3,"bitIconButton","label","disabled","click",4,"ngIf"],["bitInput","","formControlName","name"],[4,"ngIf"],["disableMargin","",4,"ngIf"],["slot","end","type","button","size","small","role","checkbox",3,"click","bitIconButton","label","disabled"],["formControlName","organizationId"],[3,"value","label",4,"ngIf"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],[1,"tw-w-full",3,"disableMargin"],["formControlName","collectionIds",1,"tw-w-full",3,"baseItems"],["data-testid","view-only-hint",4,"ngIf"],["data-testid","view-only-hint"],["disableMargin",""],["formControlName","folderId"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nVh(5,it,3,3,"span",2),s.DNE(6,nt,2,6,"button",3),s.k0s(),s.j41(7,"bit-card")(8,"bit-form-field")(9,"bit-label"),s.EFF(10),s.nI1(11,"i18n"),s.k0s(),s.nrm(12,"input",4),s.k0s(),s.DNE(13,ot,7,5,"bit-form-field",5)(14,lt,7,6,"ng-container",5)(15,dt,6,4,"bit-form-field",6),s.k0s()()),2&e&&(s.Y8G("formGroup",t.itemDetailsForm),s.R7$(3),s.JRh(s.bMT(4,8,"itemDetails")),s.R7$(2),s.vxM(t.showArchiveBadge()?5:-1),s.R7$(),s.Y8G("ngIf",!t.config.hideIndividualVaultFields),s.R7$(4),s.JRh(s.bMT(11,10,"itemName")),s.R7$(3),s.Y8G("ngIf",t.showOwnership),s.R7$(),s.Y8G("ngIf",t.showCollectionsControl),s.R7$(),s.Y8G("ngIf",!t.config.hideIndividualVaultFields))},dependencies:[Q.i,f.E,ue.r,y.L,q.j,H.I,W.J,et.b,$.h,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,C.p,J.w,Z.P,S.U,U.Q,_.s,E.p,n.MD,n.Sq,n.bT,$e.n,ee.$,n.Jj],encapsulation:2});var ht=i(79783),At=i(69194),pt=i(58363),gt=i(70342),vt=i(60276),ft=i(51151),mt=i(16671),yt=i(39444),Ct=i(59777),wt=i(30623),It=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const bt=["uriInput"],Bt=["matchDetectionSelect"];function Et(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",11),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.removeUri())}),s.k0s()}2&e&&s.Y8G("label",s.bMT(1,1,"deleteWebsite"))}function St(e,t){if(1&e){const e=s.RV6();s.j41(0,"div",12)(1,"button",13),s.nI1(2,"i18n"),s.bIt("keydown",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.handleKeydown(t))}),s.k0s()()}if(2&e){const e=s.XpG();s.R7$(),s.Y8G("label",s.i5U(2,1,"reorderToggleButton",e.uriLabel))}}function Qt(e,t){if(1&e&&s.nrm(0,"bit-option",18),2&e){const e=t.$implicit;s.Y8G("label",e.label)("value",e.value)("disabled",e.disabled)}}function kt(e,t){if(1&e&&(s.qex(0),s.j41(1,"b"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.EFF(4),s.nI1(5,"i18n"),s.bVm()),2&e){const e=s.XpG().ngIf;s.R7$(2),s.SpI("",s.bMT(3,2,"warningCapitalized"),":"),s.R7$(2),s.SpI(" ",s.bMT(5,4,e[1])," ")}}function Tt(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"i18n"),s.DNE(3,kt,6,6,"ng-container",17),s.k0s()),2&e){const e=t.ngIf;s.R7$(),s.SpI(" ",s.bMT(2,2,e[0])," "),s.R7$(2),s.Y8G("ngIf",e.length>1)}}function Ft(e,t){if(1&e&&(s.j41(0,"bit-form-field",14)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",15,1),s.DNE(6,Qt,1,3,"bit-option",16),s.k0s(),s.DNE(7,Tt,4,4,"bit-hint",17),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"matchDetection")),s.R7$(4),s.Y8G("ngForOf",e.uriMatchOptions),s.R7$(),s.Y8G("ngIf",e.getMatchHints())}}class Pt{set defaultMatchDetection(e){var t;null!==e&&(this.uriMatchOptions[0].label=this.i18nService.t("defaultLabelWithValue",null===(t=this.uriMatchOptions.find(t=>t.value===e))||void 0===t?void 0:t.label))}toggleMatchDetection(){this.showMatchDetection=!this.showMatchDetection,this.showMatchDetection&&setTimeout(()=>{var e,t;return null===(t=null===(e=this.matchDetectionSelect)||void 0===e?void 0:e.select())||void 0===t?void 0:t.focus()},0)}get uriLabel(){return 0===this.index?this.i18nService.t("websiteUri"):this.i18nService.t("websiteUriCount",this.index+1)}get toggleTitle(){return this.i18nService.t(this.showMatchDetection?"hideMatchDetectionNoPlaceholder":"showMatchDetectionNoPlaceholder")}handleKeydown(e){this.onKeydown.emit(e)}constructor(e,t,i){this.dialogService=e,this.formBuilder=t,this.i18nService=i,this.uriForm=this.formBuilder.group({uri:[null],matchDetection:[null]}),this.uriMatchOptions=[{label:this.i18nService.t("default"),value:null},{label:this.i18nService.t("baseDomain"),value:Ct.L.Domain},{label:this.i18nService.t("host"),value:Ct.L.Host},{label:this.i18nService.t("exact"),value:Ct.L.Exact},{label:this.i18nService.t("never"),value:Ct.L.Never},{label:this.i18nService.t("uriAdvancedOption"),value:null,disabled:!0},{label:this.i18nService.t("startsWith"),value:Ct.L.StartsWith},{label:this.i18nService.t("regEx"),value:Ct.L.RegularExpression}],this.advancedOptionWarningMap={[Ct.L.StartsWith]:"startsWithAdvancedOptionWarning",[Ct.L.RegularExpression]:"regExAdvancedOptionWarning"},this.onKeydown=new s.bkB,this.remove=new s.bkB,this.showMatchDetection=!1,this.onChange=()=>{},this.onTouched=()=>{},this.uriForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.onChange(e)}),this.uriForm.statusChanges.pipe((0,o.pQ)()).subscribe(()=>{this.onTouched()}),this.uriForm.controls.matchDetection.valueChanges.pipe((0,yt.J)(),(0,Ke.H)(([e,t])=>this.handleAdvancedMatch(e,t)),(0,o.pQ)()).subscribe()}handleAdvancedMatch(e,t){return It(this,void 0,void 0,function*(){const i=e!==t,n=t===Ct.L.StartsWith||t===Ct.L.RegularExpression;i&&n&&wt.r.open(this.dialogService,{contentKey:this.advancedOptionWarningMap[t],onContinue:()=>{this.uriForm.controls.matchDetection.setValue(t)},onCancel:()=>{this.uriForm.controls.matchDetection.setValue(e)}})})}focusInput(){var e;(null===(e=this.inputElement)||void 0===e?void 0:e.nativeElement)&&this.inputElement.nativeElement.focus()}removeUri(){this.remove.emit()}writeValue(e){var t,i;e&&this.uriForm.setValue({uri:null!==(t=e.uri)&&void 0!==t?t:"",matchDetection:null!==(i=e.matchDetection)&&void 0!==i?i:null},{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){e?this.uriForm.disable():this.uriForm.enable()}getMatchHints(){var e;const t=["uriMatchDefaultStrategyHint"],i=null===(e=this.uriForm.get("matchDetection"))||void 0===e?void 0:e.value;return i!==Ct.L.StartsWith&&i!==Ct.L.RegularExpression||t.push(this.advancedOptionWarningMap[i]),t}}Pt.ɵfac=function(e){return new(e||Pt)(s.rXU(oe.o3),s.rXU(a.ok),s.rXU(z.W))},Pt.ɵcmp=s.VBU({type:Pt,selectors:[["vault-autofill-uri-option"]],viewQuery:function(e,t){if(1&e&&(s.GBs(bt,5),s.GBs(Bt,5)),2&e){let e;s.mGM(e=s.lsd())&&(t.inputElement=e.first),s.mGM(e=s.lsd())&&(t.matchDetectionSelect=e.first)}},inputs:{canReorder:"canReorder",canRemove:"canRemove",defaultMatchDetection:"defaultMatchDetection",index:"index"},outputs:{onKeydown:"onKeydown",remove:"remove"},features:[s.Jv_([{provide:a.kq,useExisting:(0,r.Rfq)(()=>Pt),multi:!0}])],decls:12,vars:9,consts:[["uriInput",""],["matchDetectionSelect",""],[3,"formGroup"],[1,"tw-mb-4","tw-pt-1"],[1,"tw-flex","tw-pt-2"],["disableMargin","",1,"tw-flex-1","!tw-pt-0"],["bitInput","","formControlName","uri"],["type","button","bitSuffix","","data-testid","toggle-match-detection-button",3,"click","bitIconButton","label"],["type","button","bitIconButton","bwi-minus-circle","buttonType","dangerGhost","bitSuffix","","data-testid","remove-uri-button",3,"label","click",4,"ngIf"],["class","tw-flex tw-items-center tw-ml-1.5",4,"ngIf"],["class","!tw-mb-5",4,"ngIf"],["type","button","bitIconButton","bwi-minus-circle","buttonType","dangerGhost","bitSuffix","","data-testid","remove-uri-button",3,"click","label"],[1,"tw-flex","tw-items-center","tw-ml-1.5"],["type","button","bitIconButton","bwi-drag-and-drop","cdkDragHandle","","data-testid","reorder-toggle-button",1,"!tw-py-0","!tw-px-1",3,"keydown","label"],[1,"!tw-mb-5"],["formControlName","matchDetection"],[3,"label","value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"label","value","disabled"]],template:function(e,t){if(1&e){const e=s.RV6();s.qex(0,2),s.j41(1,"div",3)(2,"div",4)(3,"bit-form-field",5)(4,"bit-label"),s.EFF(5),s.k0s(),s.nrm(6,"input",6,0),s.j41(8,"button",7),s.bIt("click",function(){return r.eBV(e),r.Njj(t.toggleMatchDetection())}),s.k0s(),s.DNE(9,Et,2,3,"button",8),s.k0s(),s.DNE(10,St,3,4,"div",9),s.k0s(),s.DNE(11,Ft,8,5,"bit-form-field",10),s.k0s(),s.bVm()}2&e&&(s.Y8G("formGroup",t.uriForm),s.R7$(2),s.AVh("!tw-mb-1",t.showMatchDetection),s.R7$(3),s.JRh(t.uriLabel),s.R7$(3),s.Y8G("bitIconButton",t.showMatchDetection?"bwi-cog-f":"bwi-cog")("label",t.toggleTitle),s.R7$(),s.Y8G("ngIf",t.canRemove),s.R7$(),s.Y8G("ngIf",t.canReorder),s.R7$(),s.Y8G("ngIf",t.showMatchDetection))},dependencies:[P.ad,P.Fb,y.L,q.j,H.I,W.J,$.h,de.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,U.Q,_.s,E.p,C.p,J.w,Z.P,n.Sq,n.bT,ee.$],encapsulation:2});var Rt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Dt(e,t){if(1&e){const e=s.RV6();s.j41(0,"vault-autofill-uri-option",7),s.nI1(1,"async"),s.bIt("remove",function(){const t=r.eBV(e).index,i=s.XpG();return r.Njj(i.removeUri(t))})("onKeydown",function(t){const i=r.eBV(e).index,n=s.XpG();return r.Njj(n.onUriItemKeydown(t,i))}),s.k0s()}if(2&e){const e=t.index,i=s.XpG();s.Y8G("cdkDragDisabled",i.uriControls.length<=1||i.autofillOptionsForm.disabled)("formControlName",e)("canReorder",i.uriControls.length>1&&i.autofillOptionsForm.enabled)("canRemove",i.uriControls.length>1&&i.autofillOptionsForm.enabled)("defaultMatchDetection",s.bMT(1,6,i.defaultMatchDetection$))("index",e)}}function Mt(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",8),s.nI1(1,"async"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.addUri({uri:null,matchDetection:null},!0))}),s.nrm(2,"i",9),s.EFF(3),s.nI1(4,"i18n"),s.k0s()}if(2&e){const e=s.XpG();s.AVh("tw-mb-6",s.bMT(1,3,e.autofillOnPageLoadEnabled$)),s.R7$(3),s.SpI(" ",s.bMT(4,5,"addWebsite")," ")}}function xt(e,t){if(1&e&&(s.j41(0,"bit-form-field",10)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.nrm(4,"bit-select",11),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,2,"autoFillOnPageLoad")),s.R7$(2),s.Y8G("items",e.autofillOptions)}}class Ot{get uriControls(){return this.autofillOptionsForm.controls.uris.controls}get isPartialEdit(){return"partial-edit"===this.cipherFormContainer.config.mode}constructor(e,t,i,n,r,s,a){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.liveAnnouncer=n,this.domainSettingsService=r,this.autofillSettingsService=s,this.platformUtilsService=a,this.autofillOptionsForm=this.formBuilder.group({uris:this.formBuilder.array([]),autofillOnPageLoad:[null]}),this.defaultMatchDetection$=this.domainSettingsService.resolvedDefaultUriMatchStrategy$.pipe((0,At.p)(()=>this.platformUtilsService.getClientType()==ft.sK.Browser)),this.autofillOnPageLoadEnabled$=this.autofillSettingsService.autofillOnPageLoad$,this.autofillOptions=[{label:this.i18nService.t("default"),value:null},{label:this.i18nService.t("yes"),value:!0},{label:this.i18nService.t("no"),value:!1}],this.focusOnNewInput$=new l.B,this.cipherFormContainer.registerChildForm("autoFillOptions",this.autofillOptionsForm),this.autofillOptionsForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return t.login.uris=null===(i=e.uris)||void 0===i?void 0:i.map(e=>Object.assign(new mt.z,{uri:e.uri,match:e.matchDetection})),t.login.autofillOnPageLoad=e.autofillOnPageLoad,t})}),this.updateDefaultAutofillLabel(),this.focusOnNewInput$.pipe((0,o.pQ)(),(0,u.n)(()=>this.uriOptions.changes.pipe((0,pt.s)(1))),(0,u.n)(()=>this.liveAnnouncer.announce(this.i18nService.t("websiteAdded"),"polite"))).subscribe(()=>{var e,t;null===(t=null===(e=this.uriOptions)||void 0===e?void 0:e.last)||void 0===t||t.focusInput()}),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)()).subscribe(e=>{"disabled"===e?this.autofillOptionsForm.disable({emitEvent:!1}):this.isPartialEdit||this.autofillOptionsForm.enable({emitEvent:!1})})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.login):this.initNewCipher(),this.isPartialEdit&&this.autofillOptionsForm.disable()}initFromExistingCipher(e){var t,i,n;null===(t=e.uris)||void 0===t||t.forEach(e=>{this.addUri({uri:e.uri,matchDetection:e.match},!1,!1)}),this.autofillOptionsForm.patchValue({autofillOnPageLoad:e.autofillOnPageLoad}),(null===(i=this.cipherFormContainer.config.initialValues)||void 0===i?void 0:i.loginUri)&&!this.cipherFormContainer.initializedWithCachedCipher()&&-1===(null===(n=e.uris)||void 0===n?void 0:n.findIndex(e=>e.uri===this.cipherFormContainer.config.initialValues.loginUri))&&this.addUri({uri:this.cipherFormContainer.config.initialValues.loginUri,matchDetection:null})}initNewCipher(){var e,t;this.addUri({uri:null!==(t=null===(e=this.cipherFormContainer.config.initialValues)||void 0===e?void 0:e.loginUri)&&void 0!==t?t:null,matchDetection:null}),this.autofillOptionsForm.patchValue({autofillOnPageLoad:null})}updateDefaultAutofillLabel(){this.autofillSettingsService.autofillOnPageLoadDefault$.pipe((0,o.pQ)()).subscribe(e=>{const t=this.autofillOptions.find(t=>t.value===e);t&&(this.autofillOptions[0].label=this.i18nService.t("defaultLabelWithValue",t.label),this.autofillOptions=[...this.autofillOptions])})}addUri(e={uri:null,matchDetection:null},t=!1,i=!0){this.autofillOptionsForm.controls.uris.push(this.formBuilder.control(e),{emitEvent:i}),t&&this.focusOnNewInput$.next()}removeUri(e){this.autofillOptionsForm.controls.uris.removeAt(e)}updateUriFields(){this.cipherFormContainer.patchCipher(e=>(e.login.uris=this.uriControls.map(e=>{var t;return Object.assign(new mt.z,{uri:e.value.uri,match:null!==(t=e.value.matchDetection)&&void 0!==t?t:null})}),e))}onUriItemDrop(e){(0,P.HD)(this.uriControls,e.previousIndex,e.currentIndex),this.updateUriFields()}onUriItemKeydown(e,t){return Rt(this,void 0,void 0,function*(){"ArrowUp"===e.key&&0!==t&&(yield this.reorderUriItems(e,t,"Up")),"ArrowDown"===e.key&&t!==this.uriControls.length-1&&(yield this.reorderUriItems(e,t,"Down"))})}reorderUriItems(e,t,i){return Rt(this,void 0,void 0,function*(){const n=t+("Up"===i?-1:1);e.preventDefault(),yield this.liveAnnouncer.announce(this.i18nService.t(`reorderField${i}`,this.i18nService.t("websiteUri"),n+1,this.uriControls.length),"assertive"),(0,P.HD)(this.uriControls,t,n),this.updateUriFields(),requestAnimationFrame(()=>{e.target.focus()})})}}Ot.ɵfac=function(e){return new(e||Ot)(s.rXU(w),s.rXU(a.ok),s.rXU(z.W),s.rXU(ae.Ai),s.rXU(vt.V),s.rXU(gt.h),s.rXU(_e.y))},Ot.ɵcmp=s.VBU({type:Ot,selectors:[["vault-autofill-options"]],viewQuery:function(e,t){if(1&e&&s.GBs(Pt,5),2&e){let e;s.mGM(e=s.lsd())&&(t.uriOptions=e)}},decls:11,vars:9,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["cdkDropList","",3,"cdkDropListDropped"],["formArrayName","uris"],["cdkDrag","",3,"cdkDragDisabled","formControlName","canReorder","canRemove","defaultMatchDetection","index","remove","onKeydown",4,"ngFor","ngForOf"],["type","button","bitLink","","linkType","primary",3,"tw-mb-6","click",4,"ngIf"],["disableMargin","",4,"ngIf"],["cdkDrag","",3,"remove","onKeydown","cdkDragDisabled","formControlName","canReorder","canRemove","defaultMatchDetection","index"],["type","button","bitLink","","linkType","primary",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"],["disableMargin",""],["formControlName","autofillOnPageLoad",3,"items"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card",2),s.bIt("cdkDropListDropped",function(e){return t.onUriItemDrop(e)}),s.qex(6,3),s.DNE(7,Dt,2,8,"vault-autofill-uri-option",4),s.bVm(),s.DNE(8,Mt,5,7,"button",5)(9,xt,5,4,"bit-form-field",6),s.nI1(10,"async"),s.k0s()()),2&e&&(s.Y8G("formGroup",t.autofillOptionsForm),s.R7$(3),s.SpI(" ",s.bMT(4,5,"autofillOptions")," "),s.R7$(4),s.Y8G("ngForOf",t.uriControls),s.R7$(),s.Y8G("ngIf",t.autofillOptionsForm.enabled),s.R7$(),s.Y8G("ngIf",s.bMT(10,7,t.autofillOnPageLoadEnabled$)))},dependencies:[P.ad,P.O7,P.T1,S.U,f.E,ue.r,E.p,Q.i,a.X1,a.BC,a.cb,a.j4,a.JD,a.v8,n.Sq,y.L,q.j,$.h,C.p,J.w,U.Q,Pt,T.V,Ae.g,n.bT,ee.$,n.Jj],encapsulation:2});var Gt=i(86157),Ut=i(72331),Vt=i(69855);class jt{}var Nt=i(54471),zt=i(3892),Yt=i(85800),Lt=i(63581),Kt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Xt(e,t){if(1&e&&(s.nrm(0,"button",18),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"generateUsername"))("bitAction",e.generateUsername)}}function qt(e,t){1&e&&(s.qex(0),s.EFF(1),s.nI1(2,"i18n"),s.bVm()),2&e&&(s.R7$(),s.SpI(" ",s.bMT(2,1,"securePasswordGenerated")," "))}function Ht(e,t){1&e&&(s.qex(0),s.j41(1,"span",19),s.EFF(2),s.nI1(3,"i18n"),s.nI1(4,"i18n"),s.k0s(),s.j41(5,"span",20),s.EFF(6),s.nI1(7,"i18n"),s.nrm(8,"i",21),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.bVm()),2&e&&(s.R7$(2),s.Lme(" ",s.bMT(3,4,"useGeneratorHelpTextPartOne")," ",s.bMT(4,6,"useGeneratorHelpTextPartTwo")," "),s.R7$(4),s.SpI(" ",s.bMT(7,8,"useGeneratorHelpTextPartOne")," "),s.R7$(3),s.SpI(" ",s.bMT(10,10,"useGeneratorHelpTextPartTwo")," "))}function Wt(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.DNE(1,qt,3,3,"ng-container",6)(2,Ht,11,12,"ng-container",6),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.Y8G("ngIf",e.newPasswordGenerated),s.R7$(),s.Y8G("ngIf",!e.newPasswordGenerated)}}function $t(e,t){if(1&e&&(s.nrm(0,"button",22),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"checkPassword"))("bitAction",e.checkPassword)}}function Jt(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",23),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.logVisibleEvent(t,i.EventType.Cipher_ClientToggledPasswordVisible))}),s.k0s()}}function Zt(e,t){if(1&e&&(s.nrm(0,"button",24),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"generatePassword"))("bitAction",e.generatePassword)}}function _t(e,t){if(1&e&&(s.nrm(0,"button",27),s.nI1(1,"i18n")),2&e){const e=s.XpG(2);s.Y8G("bitAction",e.removePasskey)("label",s.bMT(1,2,"removePasskey"))}}function ei(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.nrm(4,"input",25),s.DNE(5,_t,2,4,"button",26),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"typePasskey")),s.R7$(2),s.Y8G("value",e.fido2CredentialCreationDateValue),s.R7$(),s.Y8G("ngIf",e.loginDetailsForm.enabled&&e.viewHiddenFields)}}function ti(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",28),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.logVisibleEvent(t,i.EventType.Cipher_ClientToggledTOTPSeedVisible))}),s.k0s()}}function ii(e,t){if(1&e&&(s.nrm(0,"button",29),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("bitAction",e.captureTotp)("label",s.bMT(1,2,"totpCapture"))}}class ni{get canCaptureTotp(){var e;return!!(null===(e=this.totpCaptureService)||void 0===e?void 0:e.canCaptureTotp(window))&&this.loginDetailsForm.controls.totp.enabled}get hasPasskey(){return null!=this.existingFido2Credentials&&this.existingFido2Credentials.length>0}get fido2CredentialCreationDateValue(){var e,t;return`${this.i18nService.t("dateCreated")} ${this.datePipe.transform(null===(t=null===(e=this.existingFido2Credentials)||void 0===e?void 0:e[0])||void 0===t?void 0:t.creationDate,"short")}`}get viewHiddenFields(){return!this.cipherFormContainer.originalCipherView||this.cipherFormContainer.originalCipherView.viewPassword}get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i,s,a,l,c,d){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.generationService=s,this.auditService=a,this.toastService=l,this.eventCollectionService=c,this.totpCaptureService=d,this.EventType=D.Bx,this.loginDetailsForm=this.formBuilder.group({username:[""],password:[""],totp:[""]}),this.datePipe=(0,r.WQX)(n.vh),this.destroyRef=(0,r.WQX)(r.abz),this.logVisibleEvent=(e,t)=>Kt(this,void 0,void 0,function*(){const{mode:i,originalCipher:n}=this.cipherFormContainer.config,r=["edit","partial-edit"].includes(i);e&&r&&n&&(yield this.eventCollectionService.collect(t,n.id,!1,n.organizationId))}),this.captureTotp=()=>Kt(this,void 0,void 0,function*(){if(this.canCaptureTotp)try{const e=yield this.totpCaptureService.captureTotpSecret();e&&(this.loginDetailsForm.controls.totp.patchValue(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("totpCaptureSuccess")}))}catch(e){this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("totpCaptureError")})}}),this.removePasskey=()=>Kt(this,void 0,void 0,function*(){this.existingFido2Credentials=null,this.cipherFormContainer.patchCipher(e=>(e.login.fido2Credentials=null,e))}),this.generatePassword=()=>Kt(this,void 0,void 0,function*(){const e=yield this.generationService.generatePassword();e&&(this.loginDetailsForm.controls.password.patchValue(e),this.newPasswordGenerated=!0)}),this.generateUsername=()=>Kt(this,void 0,void 0,function*(){const e=yield this.generationService.generateUsername(this.cipherFormContainer.website);e&&this.loginDetailsForm.controls.username.patchValue(e)}),this.checkPassword=()=>Kt(this,void 0,void 0,function*(){const e=this.loginDetailsForm.controls.password.value;if(null==e||""===e)return;const t=yield this.auditService.passwordLeaked(e);t>0?this.toastService.showToast({variant:"warning",title:null,message:this.i18nService.t("passwordExposed",t.toString())}):this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passwordSafe")})}),this.cipherFormContainer.registerChildForm("loginDetails",this.loginDetailsForm),this.loginDetailsForm.valueChanges.pipe((0,o.pQ)(),(0,Ye.T)(()=>this.loginDetailsForm.getRawValue())).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return Object.assign(t.login,{username:e.username,password:e.password,totp:null===(i=e.totp)||void 0===i?void 0:i.trim()}),t})})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.login):this.initNewCipher(),"partial-edit"===this.cipherFormContainer.config.mode&&this.loginDetailsForm.disable(),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{"enabled"===e&&(this.viewHiddenFields||(this.loginDetailsForm.controls.password.disable(),this.loginDetailsForm.controls.totp.disable()))})}initFromExistingCipher(e){var t,i,n,r;this.loginDetailsForm.patchValue({username:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.username)&&void 0!==i?i:e.username,password:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.password)&&void 0!==r?r:e.password,totp:e.totp}),"clone"!=this.cipherFormContainer.config.mode&&(this.existingFido2Credentials=e.fido2Credentials),this.viewHiddenFields||(this.loginDetailsForm.controls.password.disable(),this.loginDetailsForm.controls.totp.disable())}initNewCipher(){var e,t;this.loginDetailsForm.patchValue({username:(null===(e=this.initialValues)||void 0===e?void 0:e.username)||"",password:(null===(t=this.initialValues)||void 0===t?void 0:t.password)||""})}}ni.ɵfac=function(e){return new(e||ni)(s.rXU(w),s.rXU(a.ok),s.rXU(z.W),s.rXU(Gt.v),s.rXU(Ut.d),s.rXU(Vt.f),s.rXU(D.c_),s.rXU(jt,8))},ni.ɵcmp=s.VBU({type:ni,selectors:[["vault-login-details-section"]],decls:39,vars:31,consts:[["totpPopover",""],[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["bitInput","","formControlName","username"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-username-button",3,"label","bitAction",4,"ngIf"],["bitInput","","formControlName","password","type","password",1,"tw-font-mono"],[4,"ngIf"],["type","button","bitIconButton","bwi-check-circle","bitSuffix","","data-testid","check-password-button",3,"label","bitAction",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-password-visibility","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password-button",3,"label","bitAction",4,"ngIf"],["disableMargin",""],["bitLink","","type","button","slot","end",3,"bitPopoverTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[3,"title"],[1,"tw-mb-0"],["bitInput","","formControlName","totp","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-totp-visibility","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","bwi-camera","bitSuffix","","data-testid","capture-totp-button",3,"bitAction","label",4,"ngIf"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-username-button",3,"label","bitAction"],[1,"tw-sr-only"],["aria-hidden","true"],["aria-hidden","true",1,"bwi","bwi-generate"],["type","button","bitIconButton","bwi-check-circle","bitSuffix","","data-testid","check-password-button",3,"label","bitAction"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-password-visibility","bitPasswordInputToggle","",3,"toggledChange"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password-button",3,"label","bitAction"],["bitInput","","disabled","","data-testid","passkey-field",3,"value"],["type","button","bitIconButton","bwi-minus-circle","buttonType","dangerGhost","bitSuffix","","data-testid","remove-passkey-button",3,"bitAction","label",4,"ngIf"],["type","button","bitIconButton","bwi-minus-circle","buttonType","dangerGhost","bitSuffix","","data-testid","remove-passkey-button",3,"bitAction","label"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-totp-visibility","bitPasswordInputToggle","",3,"toggledChange"],["type","button","bitIconButton","bwi-camera","bitSuffix","","data-testid","capture-totp-button",3,"bitAction","label"]],template:function(e,t){if(1&e&&(s.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"input",3),s.DNE(11,Xt,2,4,"button",4),s.k0s(),s.j41(12,"bit-form-field")(13,"bit-label"),s.EFF(14),s.nI1(15,"i18n"),s.k0s(),s.nrm(16,"input",5),s.DNE(17,Wt,3,2,"bit-hint",6)(18,$t,2,4,"button",7)(19,Jt,1,0,"button",8)(20,Zt,2,4,"button",9),s.k0s(),s.DNE(21,ei,6,5,"bit-form-field",6),s.j41(22,"bit-form-field",10)(23,"bit-label"),s.EFF(24),s.nI1(25,"i18n"),s.j41(26,"button",11),s.nI1(27,"i18n"),s.nrm(28,"i",12),s.k0s(),s.j41(29,"bit-popover",13,0),s.nI1(31,"i18n"),s.j41(32,"p",14),s.EFF(33),s.nI1(34,"i18n"),s.k0s()()(),s.nrm(35,"input",15),s.DNE(36,ti,1,0,"button",16)(37,ii,2,4,"button",17),s.k0s()()(),s.nrm(38,"vault-autofill-options")),2&e){const e=s.sdS(30);s.Y8G("formGroup",t.loginDetailsForm),s.R7$(3),s.SpI(" ",s.bMT(4,17,"loginCredentials")," "),s.R7$(5),s.JRh(s.bMT(9,19,"username")),s.R7$(3),s.Y8G("ngIf",t.loginDetailsForm.controls.username.enabled),s.R7$(3),s.JRh(s.bMT(15,21,"password")),s.R7$(3),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled),s.R7$(),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled&&(null==t.loginDetailsForm.controls.password.value?null:t.loginDetailsForm.controls.password.value.length)>0),s.R7$(),s.Y8G("ngIf",t.viewHiddenFields),s.R7$(),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled),s.R7$(),s.Y8G("ngIf",t.hasPasskey),s.R7$(3),s.SpI(" ",s.bMT(25,23,"authenticatorKey")," "),s.R7$(2),s.Y8G("bitPopoverTriggerFor",e)("appA11yTitle",s.bMT(27,25,"learnMoreAboutAuthenticators")),s.R7$(3),s.Y8G("title",s.bMT(31,27,"totpHelperTitle")),s.R7$(4),s.SpI(" ",s.bMT(34,29,t.canCaptureTotp?"totpHelperWithCapture":"totpHelper")," "),s.R7$(3),s.Y8G("ngIf",t.viewHiddenFields),s.R7$(),s.Y8G("ngIf",t.canCaptureTotp)}},dependencies:[a.X1,a.me,a.BC,a.cb,a.j4,a.JD,S.U,f.E,ue.r,E.p,Nt.C,Q.i,y.L,q.j,H.I,W.J,$.h,ce.e,de.a,U.Q,_.s,v.C,zt.p,n.bT,ht.k,Yt.r,Lt.k,Ot,T.V,Ae.g,ee.$],encapsulation:2});var ri=i(33338),si=i(93695),oi=i(406),ai=i(80351),li=i(82781),ci=i(44432),di=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ui(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-callout",1),s.bIt("dismiss",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.dismissNewItemSpotlight())}),s.EFF(1),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("title",e.nudgeTitle)("icon",null),s.R7$(),s.SpI(" ",e.nudgeBody," ")}}class hi{constructor(e,t,i){this.i18nService=e,this.accountService=t,this.nudgesService=i,this.configType=Fe.hFB.required(),this.activeUserId$=this.accountService.activeAccount$.pipe(h.F6),this.showNewItemSpotlight$=(0,ri.z)([this.activeUserId$,(0,o.br)(this.configType).pipe((0,Ye.T)(e=>this.mapToNudgeType(e)))]).pipe((0,u.n)(([e,t])=>this.nudgesService.showNudgeSpotlight$(t,e))),this.nudgeTitle="",this.nudgeBody="",this.dismissalNudgeType=null}mapToNudgeType(e){switch(e){case li.CipherType.Login:{const e=this.i18nService.t("newLoginNudgeBodyOne"),t=this.i18nService.t("newLoginNudgeBodyBold"),i=this.i18nService.t("newLoginNudgeBodyTwo");return this.dismissalNudgeType=oi.mo.NewLoginItemStatus,this.nudgeTitle=this.i18nService.t("newLoginNudgeTitle"),this.nudgeBody=`${e} <strong>${t}</strong> ${i}`,oi.mo.NewLoginItemStatus}case li.CipherType.Card:return this.dismissalNudgeType=oi.mo.NewCardItemStatus,this.nudgeTitle=this.i18nService.t("newCardNudgeTitle"),this.nudgeBody=this.i18nService.t("newCardNudgeBody"),oi.mo.NewCardItemStatus;case li.CipherType.Identity:return this.dismissalNudgeType=oi.mo.NewIdentityItemStatus,this.nudgeTitle=this.i18nService.t("newIdentityNudgeTitle"),this.nudgeBody=this.i18nService.t("newIdentityNudgeBody"),oi.mo.NewIdentityItemStatus;case li.CipherType.SecureNote:return this.dismissalNudgeType=oi.mo.NewNoteItemStatus,this.nudgeTitle=this.i18nService.t("newNoteNudgeTitle"),this.nudgeBody=this.i18nService.t("newNoteNudgeBody"),oi.mo.NewNoteItemStatus;case li.CipherType.SshKey:{const e=this.i18nService.t("newSshNudgeBodyOne"),t=this.i18nService.t("newSshNudgeBodyTwo");return this.dismissalNudgeType=oi.mo.NewSshItemStatus,this.nudgeTitle=this.i18nService.t("newSshNudgeTitle"),this.nudgeBody=`${e} <a href="https://bitwarden.com/help/ssh-agent" class="tw-text-primary-600 tw-font-medium" target="_blank">${t}</a>`,oi.mo.NewSshItemStatus}default:throw new Error("Unsupported cipher type")}}dismissNewItemSpotlight(){return di(this,void 0,void 0,function*(){const e=yield(0,d._)(this.activeUserId$);this.dismissalNudgeType&&e&&(yield this.nudgesService.dismissNudge(this.dismissalNudgeType,e),this.showNewItemSpotlight$=(0,si.of)(!1))})}}hi.ɵfac=function(e){return new(e||hi)(s.rXU(z.W),s.rXU(Je.D),s.rXU(oi.u6))},hi.ɵcmp=s.VBU({type:hi,selectors:[["vault-new-item-nudge"]],inputs:{configType:[1,"configType"]},decls:2,vars:3,consts:[[3,"title","icon"],[3,"dismiss","title","icon"]],template:function(e,t){1&e&&(s.nVh(0,ui,2,3,"bit-callout",0),s.nI1(1,"async")),2&e&&s.vxM(s.bMT(1,1,t.showNewItemSpotlight$)?0:-1)},dependencies:[ai.j,ci.G,n.Jj],encapsulation:2});var Ai=i(66523),pi=i(72142),gi=i(22869),vi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function fi(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",7),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.importSshKeyFromClipboard())}),s.k0s()}2&e&&s.Y8G("label",s.mNQ(s.bMT(1,2,"importSshKeyFromClipboard")))}class mi{constructor(e,t,i,n,s){this.cipherFormContainer=e,this.formBuilder=t,this.sdkService=i,this.sshImportPromptService=n,this.platformUtilsService=s,this.originalCipherView=(0,Fe.hFB)(null),this.disabled=(0,Fe.hFB)(!1),this.sshKeyForm=this.formBuilder.group({privateKey:[""],publicKey:[""],keyFingerprint:[""]}),this.showImport=(0,ze.EW)(()=>{var e;return this.platformUtilsService.getClientType()!==ft.sK.Web&&(null===(e=this.originalCipherView())||void 0===e?void 0:e.edit)}),this.destroyRef=(0,r.WQX)(r.abz),this.cipherFormContainer.registerChildForm("sshKeyDetails",this.sshKeyForm),this.sshKeyForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=new pi.H;t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.keyFingerprint,this.cipherFormContainer.patchCipher(e=>(e.sshKey=t,e))})}ngOnInit(){return vi(this,void 0,void 0,function*(){var e,t;const i=this.cipherFormContainer.getInitialCipherView(),n=null!==(e=null==i?void 0:i.sshKey)&&void 0!==e?e:null===(t=this.originalCipherView())||void 0===t?void 0:t.sshKey;n?this.setInitialValues(n):yield this.generateSshKey(),this.sshKeyForm.disable(),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{"enabled"===e&&this.sshKeyForm.disable()})})}setInitialValues(e){const{privateKey:t,publicKey:i,keyFingerprint:n}=e;this.sshKeyForm.setValue({privateKey:t,publicKey:i,keyFingerprint:n})}importSshKeyFromClipboard(){return vi(this,void 0,void 0,function*(){const e=yield this.sshImportPromptService.importSshKeyFromClipboard();null!=e&&this.sshKeyForm.setValue({privateKey:e.privateKey,publicKey:e.publicKey,keyFingerprint:e.keyFingerprint})})}generateSshKey(){return vi(this,void 0,void 0,function*(){yield(0,d._)(this.sdkService.client$);const e=(0,li.generate_ssh_key)("Ed25519");this.sshKeyForm.setValue({privateKey:e.privateKey,publicKey:e.publicKey,keyFingerprint:e.fingerprint})})}}mi.ɵfac=function(e){return new(e||mi)(s.rXU(w),s.rXU(a.ok),s.rXU(Ai.K5),s.rXU(gi.V),s.rXU(_e.y))},mi.ɵcmp=s.VBU({type:mi,selectors:[["vault-sshkey-section"]],inputs:{originalCipherView:[1,"originalCipherView"],disabled:[1,"disabled"]},decls:23,vars:14,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["id","privateKey","bitInput","","formControlName","privateKey","type","password"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-privateKey-visibility","bitPasswordInputToggle",""],["type","button","bitIconButton","bwi-import","bitSuffix","","data-testid","import-privateKey",3,"label"],["id","publicKey","bitInput","","formControlName","publicKey"],["id","keyFingerprint","bitInput","","formControlName","keyFingerprint"],["type","button","bitIconButton","bwi-import","bitSuffix","","data-testid","import-privateKey",3,"click","label"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"input",2)(11,"button",3),s.nVh(12,fi,2,4,"button",4),s.k0s(),s.j41(13,"bit-form-field")(14,"bit-label"),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.nrm(17,"input",5),s.k0s(),s.j41(18,"bit-form-field")(19,"bit-label"),s.EFF(20),s.nI1(21,"i18n"),s.k0s(),s.nrm(22,"input",6),s.k0s()()()),2&e&&(s.Y8G("formGroup",t.sshKeyForm),s.R7$(3),s.SpI(" ",s.bMT(4,6,"typeSshKey")," "),s.R7$(5),s.JRh(s.bMT(9,8,"sshPrivateKey")),s.R7$(4),s.vxM(t.showImport()?12:-1),s.R7$(3),s.JRh(s.bMT(16,10,"sshPublicKey")),s.R7$(5),s.JRh(s.bMT(21,12,"sshFingerprint")))},dependencies:[Q.i,f.E,ue.r,y.L,q.j,W.J,$.h,ce.e,de.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,C.p,S.U,U.Q,_.s,E.p,n.MD,ee.$],encapsulation:2});var yi=i(69588),Ci=i(92411),wi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ii=[[["","slot","attachment-button"]]];function bi(e,t){if(1&e&&s.nrm(0,"vault-new-item-nudge",3),2&e){const e=s.XpG();s.Y8G("configType",e.config.cipherType)}}function Bi(e,t){1&e&&s.nrm(0,"vault-login-details-section")}function Ei(e,t){if(1&e&&s.nrm(0,"vault-identity-section",8),2&e){const e=s.XpG(2);s.Y8G("disabled","partial-edit"===e.config.mode)("originalCipherView",e.originalCipherView)}}function Si(e,t){if(1&e&&s.nrm(0,"vault-card-details-section",9),2&e){const e=s.XpG(2);s.Y8G("originalCipherView",e.originalCipherView)("disabled","partial-edit"===e.config.mode)}}function Qi(e,t){if(1&e&&s.nrm(0,"vault-sshkey-section",8),2&e){const e=s.XpG(2);s.Y8G("disabled","partial-edit"===e.config.mode)("originalCipherView",e.originalCipherView)}}function ki(e,t){1&e&&(s.qex(0),s.SdG(1),s.bVm())}function Ti(e,t){if(1&e&&(s.qex(0),s.nrm(1,"vault-item-details-section",4),s.DNE(2,Bi,1,0,"vault-login-details-section",2)(3,Ei,1,2,"vault-identity-section",5)(4,Si,1,2,"vault-card-details-section",6)(5,Qi,1,2,"vault-sshkey-section",5),s.nrm(6,"vault-additional-options-section",7),s.DNE(7,ki,2,0,"ng-container",2),s.bVm()),2&e){const e=s.XpG();s.R7$(),s.Y8G("config",e.config)("originalCipherView",e.originalCipherView),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Login),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Identity),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Card),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.SshKey),s.R7$(),s.Y8G("disableSectionMargin","edit"!==e.config.mode),s.R7$(),s.Y8G("ngIf","edit"==e.config.mode)}}class Fi{get website(){var e,t,i,n,r;return null!==(r=null===(n=null===(i=null===(t=null===(e=this.updatedCipherView)||void 0===e?void 0:e.login)||void 0===t?void 0:t.uris)||void 0===i?void 0:i[0])||void 0===n?void 0:n.uri)&&void 0!==r?r:null}ngAfterViewInit(){this.submitBtn&&(this.bitSubmit.loading$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.disabled.set(e)}))}disableFormFields(){this.cipherForm.disable({emitEvent:!1}),this.formStatusChangeSubject.next("disabled")}enableFormFields(){"disabled"===this.formStatusChangeSubject.getValue()&&(this.cipherForm.enable({emitEvent:!1}),this.formStatusChangeSubject.next("enabled"))}registerChildForm(e,t){this.cipherForm.setControl(e,t)}patchCipher(e){this.updatedCipherView=e(this.updatedCipherView),this.cipherFormCacheService.cacheCipherView(this.updatedCipherView)}getInitialCipherView(){const e=this.cipherFormCacheService.getCachedCipherView();return e&&this.initializedWithCachedCipher()?e:this.originalCipherView}initializedWithCachedCipher(){return this.cipherFormCacheService.initializedWithValue}ngOnChanges(){return wi(this,void 0,void 0,function*(){this._firstInitialized&&(yield this.init())})}ngOnInit(){return wi(this,void 0,void 0,function*(){yield this.init(),this._firstInitialized=!0})}init(){return wi(this,void 0,void 0,function*(){if(this.loading=!0,this.changeDetectorRef.detectChanges(),this.updatedCipherView=new p.f,this.originalCipherView=null,this.cipherForm=this.formBuilder.group({}),null!=this.config){if("add"!==this.config.mode){if(null==this.config.originalCipher)throw new Error("Original cipher is required for edit or clone mode");this.originalCipherView=yield this.addEditFormService.decryptCipher(this.config.originalCipher),this.updatedCipherView=yield this.addEditFormService.decryptCipher(this.config.originalCipher),"clone"===this.config.mode&&(this.updatedCipherView.id=null,this.updatedCipherView.key=void 0,this.updatedCipherView.attachments=[],this.updatedCipherView.login&&(this.updatedCipherView.login.fido2Credentials=null))}else this.updatedCipherView.type=this.config.cipherType,this.config.cipherType===A.gC.SecureNote&&(this.updatedCipherView.secureNote.type=A.ak.Generic);this.setInitialCipherFromCache(),this.loading=!1,this.formReadySubject.next()}})}setInitialCipherFromCache(){if(this.config.initialValues&&(void 0!==this.config.initialValues.username||void 0!==this.config.initialValues.password))return void this.cipherFormCacheService.clearCache();const e=this.cipherFormCacheService.getCachedCipherView();if(null===e)return;const t=this.updatedCipherView.id&&this.updatedCipherView.id===e.id,i=!this.updatedCipherView.id&&!e.id&&this.updatedCipherView.type===e.type;(t||i)&&(this.updatedCipherView=e)}constructor(e,t,i,n,o,a,p,g){this.formBuilder=e,this.addEditFormService=t,this.toastService=i,this.i18nService=n,this.changeDetectorRef=o,this.cipherFormCacheService=a,this.cipherArchiveService=p,this.accountService=g,this.destroyRef=(0,r.WQX)(r.abz),this._firstInitialized=!1,this.cipherSaved=new s.bkB,this.formReadySubject=new l.B,this.formReady=this.formReadySubject.asObservable(),this.formStatusChangeSubject=new c.t(null),this.formStatusChange$=this.formStatusChangeSubject.asObservable(),this.cipherForm=this.formBuilder.group({}),this.loading=!0,this.CipherType=A.gC,this.submit=()=>wi(this,void 0,void 0,function*(){let e="editedItem";if(this.cipherForm.invalid){this.cipherForm.markAllAsTouched();const e=this.countInvalidFields(this.cipherForm);return void(e>0&&this.toastService.showToast({variant:"error",title:null,message:1===e?this.i18nService.t("singleFieldNeedsAttention"):this.i18nService.t("multipleFieldsNeedAttention",e)}))}if(this.beforeSubmit){if(!(yield this.beforeSubmit()))return}!(yield(0,d._)(this.accountService.activeAccount$.pipe(h.F6,(0,u.n)(e=>this.cipherArchiveService.userCanArchive$(e)))))&&this.updatedCipherView.archivedDate&&(this.updatedCipherView.archivedDate=null,e="itemRestored");const t=yield this.addEditFormService.saveCipher(this.updatedCipherView,this.config);this.cipherFormCacheService.clearCache(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("edit"===this.config.mode||"partial-edit"===this.config.mode?e:"addedItem")}),this.cipherSaved.emit(t)})}countInvalidFields(e){return Object.values(e.controls).reduce((e,t)=>t instanceof a.gE?e+this.countInvalidFields(t):e+(t.invalid?1:0),0)}}Fi.ɵfac=function(e){return new(e||Fi)(s.rXU(a.ok),s.rXU(yi.L),s.rXU(Vt.f),s.rXU(z.W),s.rXU(Fe.gRc),s.rXU(b),s.rXU(Ci.J),s.rXU(Je.D))},Fi.ɵcmp=s.VBU({type:Fi,selectors:[["vault-cipher-form"]],viewQuery:function(e,t){if(1&e&&s.GBs(g.L,5),2&e){let e;s.mGM(e=s.lsd())&&(t.bitSubmit=e.first)}},inputs:{formId:"formId",config:"config",submitBtn:"submitBtn",beforeSubmit:"beforeSubmit"},outputs:{cipherSaved:"cipherSaved",formReady:"formReady",formStatusChange$:"formStatusChange$"},features:[s.Jv_([{provide:w,useExisting:(0,r.Rfq)(()=>Fi)},{provide:b}]),s.OA$],ngContentSelectors:["[slot=attachment-button]"],decls:3,vars:5,consts:[[3,"configType",4,"ngIf"],[3,"id","formGroup","bitSubmit"],[4,"ngIf"],[3,"configType"],[3,"config","originalCipherView"],[3,"disabled","originalCipherView",4,"ngIf"],[3,"originalCipherView","disabled",4,"ngIf"],[3,"disableSectionMargin"],[3,"disabled","originalCipherView"],[3,"originalCipherView","disabled"]],template:function(e,t){1&e&&(s.NAR(Ii),s.DNE(0,bi,1,1,"vault-new-item-nudge",0),s.j41(1,"form",1),s.DNE(2,Ti,8,8,"ng-container",2),s.k0s()),2&e&&(s.Y8G("ngIf",!t.loading),s.R7$(),s.Y8G("id",t.formId)("formGroup",t.cipherForm)("bitSubmit",t.submit),s.R7$(),s.Y8G("ngIf",!t.loading))},dependencies:[v.C,g.L,f.E,m.k,y.L,a.X1,a.qT,a.cb,a.j4,C.p,ut,Ve,Ne,mi,n.bT,Me,ni,hi],encapsulation:2})},86973(){},87895(e,t,i){"use strict";i.d(t,{R:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 3.33 76.49 75.83">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 8.334a5 5 0 0 1 5-5H35a5 5 0 0 1 5 5v56.667a5 5 0 0 1-5 5H8.333a5 5 0 0 1-5-5V8.334Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35 5H8.333A3.333 3.333 0 0 0 5 8.335v56.667a3.333 3.333 0 0 0 3.333 3.333H35a3.333 3.333 0 0 0 3.333-3.333V8.334A3.333 3.333 0 0 0 35 5.001ZM8.333 3.335a5 5 0 0 0-5 5v56.667a5 5 0 0 0 5 5H35a5 5 0 0 0 5-5V8.334a5 5 0 0 0-5-5H8.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M18.333 9.167c0-.46.373-.833.834-.833h5a.833.833 0 0 1 0 1.667h-5a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M36.667 38.333c0 10.126-6.716 18.334-15 18.334-8.285 0-15-8.208-15-18.334 0-10.125 6.715-18.333 15-18.333 8.284 0 15 8.208 15 18.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M21.667 55C28.733 55 35 47.866 35 38.333c0-9.533-6.267-16.666-13.333-16.666-7.067 0-13.334 7.133-13.334 16.666C8.333 47.866 14.6 55 21.667 55Zm0 1.667c8.284 0 15-8.208 15-18.334 0-10.125-6.716-18.333-15-18.333-8.285 0-15 8.208-15 18.333 0 10.126 6.715 18.334 15 18.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.444-5.223 11.667-11.666 11.667C50.223 46.667 45 41.444 45 35.001c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45c5.523 0 10-4.477 10-10 0-5.522-4.477-10-10-10s-10 4.478-10 10c0 5.523 4.477 10 10 10Zm0 1.667c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.334 45 28.557 45 35.001c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M78.255 59.98a22.918 22.918 0 0 1 1.559 5.854H41.667v-8.333h-4.549a22.916 22.916 0 0 1 41.137 2.48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M43.333 55.834v8.333h34.5a21.238 21.238 0 0 0-5.724-10.442 21.25 21.25 0 0 0-31.9 2.109h3.124Zm-5.18 0c-.368.54-.714 1.096-1.035 1.667h4.549v8.333h38.147a22.875 22.875 0 0 0-1.558-5.853 22.915 22.915 0 0 0-40.102-4.147Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M39.167 79.167c5.272 0 9.829-3.06 11.993-7.5h5.65c.442 0 .866-.176 1.178-.489L60 69.168l1.91 1.91a.833.833 0 0 0 1.18 0l.66-.66.66.66a.833.833 0 0 0 1.18 0l1.91-1.91 2.012 2.011c.312.313.736.489 1.178.489h2.786c.442 0 .866-.176 1.179-.489l5.05-5.05a.417.417 0 0 0 0-.59l-5.05-5.05A1.667 1.667 0 0 0 73.476 60H51.16c-2.164-4.44-6.721-7.5-11.993-7.5-7.364 0-13.334 5.97-13.334 13.333 0 7.364 5.97 13.334 13.334 13.334Zm-5-10.834a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.118 70h6.692L60 66.81l2.5 2.5 1.25-1.25L65 69.31l2.5-2.5L70.69 70h2.786l4.167-4.167-4.167-4.166H50.118l-.457-.937a11.667 11.667 0 0 0-10.494-6.563c-6.444 0-11.667 5.223-11.667 11.666 0 6.444 5.223 11.667 11.667 11.667 4.61 0 8.6-2.674 10.494-6.563l.457-.937Zm29.587-3.872a.417.417 0 0 0 0-.59l-5.05-5.05A1.667 1.667 0 0 0 73.476 60H51.16c-2.164-4.44-6.721-7.5-11.993-7.5-7.364 0-13.334 5.97-13.334 13.333 0 7.364 5.97 13.334 13.334 13.334 5.272 0 9.829-3.06 11.993-7.5h5.65c.442 0 .866-.176 1.178-.489L60 69.168l1.91 1.91a.833.833 0 0 0 1.179.001l.661-.661.66.66.002.001a.833.833 0 0 0 1.177 0l1.911-1.911 2.012 2.011c.312.313.736.489 1.178.489h2.786c.442 0 .866-.176 1.179-.489l5.05-5.05Zm-41.372-.295a4.167 4.167 0 1 1-8.333 0 4.167 4.167 0 0 1 8.333 0Zm-1.666 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM16.126 28.497a15.793 15.793 0 0 1 5.542-.996c1.95 0 3.818.352 5.541.996a.833.833 0 0 0 .584-1.56 17.462 17.462 0 0 0-6.125-1.103c-2.154 0-4.218.39-6.125 1.102a.833.833 0 1 0 .583 1.561Zm5.542 2.337a11.648 11.648 0 0 0-9.335 4.667.833.833 0 1 1-1.332-1 13.314 13.314 0 0 1 10.667-5.334c4.331 0 7.947 1.77 10.59 4.41a.833.833 0 1 1-1.179 1.18c-2.36-2.36-5.564-3.923-9.411-3.923Zm-.117 1.667c-5.377 0-9.63 4.555-9.26 9.92l.075 1.081c.097 1.4.428 2.772.98 4.061l.47 1.099a.833.833 0 1 0 1.532-.656l-.47-1.1a10.835 10.835 0 0 1-.85-3.519l-.074-1.08a7.615 7.615 0 1 1 15.212-.524v.718a.833.833 0 0 1-1.666 0v-.834a5.848 5.848 0 0 0-1.522-3.927c-1.054-1.146-2.637-1.906-4.728-1.906-2.173 0-3.575.99-4.397 2.254-.79 1.216-1.02 2.639-1.02 3.58 0 2.326.209 4.02.794 5.424.593 1.425 1.54 2.465 2.84 3.549a.833.833 0 1 0 1.067-1.28c-1.2-1-1.921-1.835-2.369-2.91-.457-1.097-.665-2.527-.665-4.784 0-.726.187-1.803.75-2.67.533-.82 1.423-1.496 3-1.496 1.659 0 2.785.589 3.501 1.368a4.181 4.181 0 0 1 1.082 2.798v.834a2.5 2.5 0 0 0 5 0v-.718a9.282 9.282 0 0 0-9.282-9.282Zm-.754 9.116c0-.42.347-.783.823-.783a.88.88 0 0 1 .88.88v1.364a4.68 4.68 0 0 0 1.872 3.743l.684.513a5 5 0 0 0 3 1h.277a.833.833 0 0 0 0-1.667h-.277a3.334 3.334 0 0 1-2-.666l-.684-.513a3.013 3.013 0 0 1-1.205-2.41v-1.364a2.547 2.547 0 0 0-2.547-2.547c-1.342 0-2.492 1.056-2.49 2.453.001.82.033 1.85.148 2.804.125 1.035.627 1.848 1.163 2.526.244.31.509.608.757.887l.066.074c.274.308.526.597.752.895.553.729.7 1.326.544 1.719a.833.833 0 0 0 1.547.619c.504-1.26-.137-2.52-.763-3.345-.27-.356-.562-.688-.834-.994l-.06-.069a18.78 18.78 0 0 1-.701-.819c-.456-.577-.745-1.1-.817-1.693a23.012 23.012 0 0 1-.135-2.607Z" clip-rule="evenodd"/>
  </svg>
`},87916(e,t,i){"use strict";i.d(t,{V:()=>c});var n=i(60989),r=i(6056),s=i(24137),o=i(25065),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[o.G,n.Pd,r.iI,s.f]})},88516(e,t,i){"use strict";i.d(t,{W:()=>b});var n=i(58716),r=i(54539),s=i(77468),o=i(74208),a=i(94573),l=i(33812),c=i(33277),d=i(40443),u=i(17386),h=i(39200),A=i(37831);function p(e,t){}class g{get hidden(){return!this.active()||null}constructor(){this._firstRender=!1,this.content=(0,a.hFB)(),this.preserveContent=(0,a.hFB)(!1),this.active=(0,a.hFB)(),(0,c.QZ)(()=>{this.active()&&(this._firstRender=!0)})}get tabContent(){return this.active()||this.preserveContent()&&this._firstRender?this.content():null}}g.ɵfac=function(e){return new(e||g)},g.ɵcmp=l.VBU({type:g,selectors:[["bit-tab-body"]],hostVars:1,hostBindings:function(e,t){2&e&&l.BMQ("hidden",t.hidden)},inputs:{content:[1,"content"],preserveContent:[1,"preserveContent"],active:[1,"active"]},decls:1,vars:1,consts:[[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&l.DNE(0,p,0,0,"ng-template",0),2&e&&l.Y8G("cdkPortalOutlet",t.tabContent)},dependencies:[A.I3],encapsulation:2});var v=i(49608);function f(e,t){if(1&e&&l.eu8(0,6),2&e){const e=l.XpG(2).$implicit;l.Y8G("ngTemplateOutlet",e.templateLabel.templateRef)}}function m(e,t){if(1&e&&l.EFF(0),2&e){const e=l.XpG(2).$implicit;l.SpI(" ",e.textLabel()," ")}}function y(e,t){if(1&e&&l.nVh(0,f,1,1,"ng-container",6)(1,m,1,1),2&e){const e=l.XpG().$implicit;l.vxM(e.templateLabel?0:1)}}function C(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",5),l.bIt("click",function(){const t=o.eBV(e).$index,i=l.XpG();return o.Njj(i.selectTab(t))}),l.eu8(1,6),l.DNE(2,y,2,1,"ng-template",null,0,l.C5r),l.k0s()}if(2&e){const e=t.$implicit,i=t.$index,n=l.sdS(3),r=l.XpG();l.Y8G("id",r.getTabLabelId(i))("active",e.isActive)("disabled",e.disabled()),l.BMQ("aria-selected",r.selectedIndex===i)("tabindex",r.selectedIndex===i?0:-1),l.R7$(),l.Y8G("ngTemplateOutlet",n)}}function w(e,t){if(1&e&&l.nrm(0,"bit-tab-body",4),2&e){const e=t.$implicit,i=t.$index,n=l.XpG();l.Y8G("id",n.getTabContentId(i))("active",e.isActive)("content",e.content)("preserveContent",n.preserveContent()),l.BMQ("tabindex",e.contentTabIndex())("labeledby",n.getTabLabelId(i))}}let I=0;class b{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this._indexToSelect=(0,r.OE)(e,null)}constructor(){this.destroyRef=(0,o.WQX)(o.abz),this._indexToSelect=0,this.label=(0,a.hFB)(""),this.preserveContent=(0,a.hFB)(!1),this._tab=a.sbv.required(v.j),this.tabs=(0,a.tEk)(v.j),this.tabLabels=(0,a.dtW)(h.y),this._selectedIndex=null,this.selectedIndexChange=new l.bkB,this.selectedTabChange=new l.bkB,this._groupId=I++,(0,c.QZ)(()=>{var e;const t=this._clampTabIndex(null!==(e=this._indexToSelect)&&void 0!==e?e:0);if(t===this._selectedIndex){const e=this.tabs();let i;for(let t=0;t<e.length;t++)if(e[t].isActive){this._indexToSelect=this._selectedIndex=t,i=e[t];break}!i&&e[t]&&(e[t].isActive=!0,this.selectedTabChange.emit({index:t,tab:e[t]}))}})}getTabContentId(e){return`bit-tab-content-${this._groupId}-${e}`}getTabLabelId(e){return`bit-tab-label-${this._groupId}-${e}`}selectTab(e){this.selectedIndex=e}ngAfterContentChecked(){var e,t;const i=this._indexToSelect=this._clampTabIndex(null!==(e=this._indexToSelect)&&void 0!==e?e:0);if(this._selectedIndex!=i){const e=null==this._selectedIndex;e||this.selectedTabChange.emit({index:i,tab:this.tabs()[i]}),Promise.resolve().then(()=>{this.tabs().forEach((e,t)=>e.isActive=t===i),e||this.selectedIndexChange.emit(i)}),this._selectedIndex=i,null===(t=this.keyManager)||void 0===t||t.setActiveItem(i)}}ngAfterViewInit(){this.keyManager=new n.B(this.tabLabels()).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}_clampTabIndex(e){return Math.min(this.tabs().length-1,Math.max(e||0,0))}}b.ɵfac=function(e){return new(e||b)},b.ɵcmp=l.VBU({type:b,selectors:[["bit-tab-group"]],contentQueries:function(e,t,i){1&e&&(l.C6U(i,t._tab,v.j,5),l.C6U(i,t.tabs,v.j,4)),2&e&&l.NyB(2)},viewQuery:function(e,t){1&e&&l.wEZ(t.tabLabels,h.y,5),2&e&&l.NyB()},inputs:{label:[1,"label"],preserveContent:[1,"preserveContent"],selectedIndex:"selectedIndex"},outputs:{selectedIndexChange:"selectedIndexChange",selectedTabChange:"selectedTabChange"},decls:7,vars:1,consts:[["content",""],["bitTabListContainer","","role","tablist",3,"keydown"],["bitTabListItem","","type","button","role","tab",3,"id","active","disabled"],[1,"tw-px-6","tw-pt-5"],["role","tabpanel",3,"id","active","content","preserveContent"],["bitTabListItem","","type","button","role","tab",3,"click","id","active","disabled"],[3,"ngTemplateOutlet"]],template:function(e,t){1&e&&(l.j41(0,"bit-tab-header")(1,"div",1),l.bIt("keydown",function(e){return t.keyManager.onKeydown(e)}),l.Z7z(2,C,4,6,"button",2,l.fX1),l.k0s()(),l.j41(4,"div",3),l.Z7z(5,w,1,6,"bit-tab-body",4,l.fX1),l.k0s()),2&e&&(l.R7$(),l.BMQ("aria-label",t.label()),l.R7$(),l.Dyx(t.tabs()),l.R7$(3),l.Dyx(t.tabs()))},dependencies:[s.T3,d.g,u.k,h.y,g],encapsulation:2})},88547(e,t,i){"use strict";i.d(t,{D:()=>a});var n=i(94573),r=i(33812);function s(e,t){1&e&&r.Hgh(0,"i",1),2&e&&r.HbH(t)}function o(e,t){if(1&e&&(r.nVh(0,s,1,2,"i",0),r.SdG(1)),2&e){let e;const t=r.XpG();r.vxM((e=t.icon())?0:-1,e)}}class a{constructor(){this.icon=(0,n.hFB)(),this.route=(0,n.hFB)(),this.queryParams=(0,n.hFB)({}),this.queryParamsHandling=(0,n.hFB)(),this.click=(0,n.CGW)(),this.content=(0,n.ebz)(r.C4Q)}onClick(e){this.click.emit(e)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=r.VBU({type:a,selectors:[["bit-breadcrumb"]],viewQuery:function(e,t){1&e&&r.wEZ(t.content,r.C4Q,5),2&e&&r.NyB()},inputs:{icon:[1,"icon"],route:[1,"route"],queryParams:[1,"queryParams"],queryParamsHandling:[1,"queryParamsHandling"]},outputs:{click:"click"},ngContentSelectors:["*"],decls:1,vars:0,consts:[["aria-hidden","true",1,"bwi","!tw-me-2",3,"class"],["aria-hidden","true",1,"bwi","!tw-me-2"]],template:function(e,t){1&e&&(r.NAR(),r.PeT(0,o,2,1,"ng-template"))},encapsulation:2,changeDetection:0})},88832(e,t,i){"use strict";i.d(t,{n:()=>l});var n=i(93161),r=i(77468),s=i(94573),o=i(33812);const a=e=>({"tw-mb-5 bit-compact:tw-mb-4 [&:not(bit-dialog_*):not(popup-page_*)]:md:tw-mb-12":e});class l{constructor(){this.disableMargin=(0,s.hFB)(!1,{transform:n.he})}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-section"]],inputs:{disableMargin:[1,"disableMargin"]},ngContentSelectors:["*"],decls:2,vars:3,consts:[[3,"ngClass"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"section",0),o.SdG(1),o.k0s()),2&e&&o.Y8G("ngClass",o.eq3(1,a,!t.disableMargin()))},dependencies:[r.MD,r.YU],encapsulation:2})},89033(e,t,i){"use strict";i.d(t,{c:()=>o});var n=i(86226),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.j]})},89097(e,t,i){"use strict";i.d(t,{l:()=>r});var n=i(31857);class r{constructor(e,t,i,n,r,s){this.stateDefinition=e,this.key=t,this.classifier=i,this.options=n,this.deconstruct=r,this.reconstruct=s}toEncryptedStateKey(){return new n.Ok(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))}}},89105(e,t,i){"use strict";i.d(t,{N:()=>n});class n{}},89177(e,t,i){"use strict";i.d(t,{T:()=>r});var n=i(75174);class r extends n.O{constructor(e){super(e),this.id=e.id||null}}},89222(e,t,i){"use strict";i.d(t,{p:()=>R});var n=i(48479),r=i(72737),s=i(16878),o=i(34040),a=i(27442),l=i(75811),c=i(99969),d=i(36359),u=i(3204),h=i(44500),A=i(80909),p=i(14803),g=i(12916),v=i(56986),f=i(8131),m=i(45505),y=i(69194),C=i(14928),w=i(21588),I=i(62179),b=i(73276),B=i(39306),E=i(20377);function S(e){return!!e&&"id"in e&&"secret"in e&&"disclosed"in e&&"string"==typeof e.secret&&"object"==typeof e.disclosed}var Q=i(59303),k=i(31857);function T(e){return e&&"calibrate"in e}var F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const P="$^$ALWAYS_UPDATE_KLUDGE_PROPERTY$^$";class R extends n.c{constructor(e,t,i){var n,m,y;super(),this.key=e,this.providers=t,this.context=i,this.input=new r.m(1),this.output=new r.m(1),this.counter=0,!function(e){return"object"===e.target&&"format"in e&&"classifier"in e}(this.key)?(this.objectKey=null,this.stateKey=this.key):(this.objectKey=this.key,this.stateKey=function(e){if("plain"===e.format)return new k.Ok(e.state,e.key,e.options);if("classified"===e.format)return new k.Ok(e.state,e.key,{cleanupDelayMs:e.options.cleanupDelayMs,deserializer:e=>e,clearOn:e.options.clearOn});if("secret-state"===e.format)return new k.Ok(e.state,e.key,{cleanupDelayMs:e.options.cleanupDelayMs,deserializer:e=>e,clearOn:e.options.clearOn});throw new Error(`unknown format: ${e.format}`)}(this.key)),this.log=this.providers.log({contextId:this.contextId,type:"UserStateSubject",storage:{state:this.stateKey.stateDefinition.name,key:this.stateKey.key}});const C=(null!==(n=this.context.when$)&&void 0!==n?n:new s.t(!0)).pipe((0,o.F)()),w=i.account$.pipe((0,E.y_)({name:()=>`${this.contextId} { account$ }`,distinct:(e,t)=>e.id===t.id}),(0,a.t)({refCount:!0,bufferSize:1})),I=this.encryptor(w),b=(null!==(m=this.context.constraints$)&&void 0!==m?m:(0,Q.k)()).pipe((0,l.W)(e=>(this.log.error(e,"constraints$ dependency failed; using last-known constraints"),c.w)),(0,a.t)({refCount:!0,bufferSize:1})),B=(null!==(y=this.context.dependencies$)&&void 0!==y?y:new s.t(null)).pipe((0,a.t)({refCount:!0,bufferSize:1})),S=w.pipe((0,d.M)(e=>this.log.debug({accountId:e.id},"loading user state")),(0,u.T)(e=>this.providers.state.getUser(e.id,this.stateKey)),(0,a.t)({refCount:!0,bufferSize:1}));this.outputSubscription=S.pipe((0,h.n)(e=>e.state$),(0,u.T)(e=>(e&&"object"==typeof e&&P in e&&delete e[P],e)),this.declassify(I),this.adjust((0,A.v)(b)),(0,p.Q)((0,E.E)(w))).subscribe(this.output);const T=new r.m(1);this.output.pipe((0,g.H)(),(0,u.T)(e=>e.state)).subscribe(T);const F=(0,v.x)(this.input.pipe(this.when(C),this.adjust((0,E.bt)(b)),this.prepareUpdate(this,B)),T.pipe(this.fix(b),this.prepareUpdate(T,B)));this.inputSubscription=F.pipe(this.classify(I),(0,f.E)(S),(0,p.Q)((0,E.E)([C,this.input,I]))).subscribe({next:([e,t])=>this.onNext(e,t),error:e=>this.onError(e),complete:()=>this.onComplete()})}get contextId(){return`UserStateSubject(${this.stateKey.stateDefinition.name}, ${this.stateKey.key})`}encryptor(e){var t,i;const n=e.pipe((0,u.T)(e=>e.id)),r=null!==(i=null===(t=this.objectKey)||void 0===t?void 0:t.frame)&&void 0!==i?i:32;return this.providers.encryptor.userEncryptor$(r,{singleUserId$:n}).pipe((0,d.M)(()=>this.log.debug("encryptor constructed")),(0,u.T)(({encryptor:e})=>e),(0,a.t)({refCount:!0,bufferSize:1}))}when(e){return(0,m.F)((0,A.v)(e.pipe((0,o.F)())),(0,d.M)(([e,t])=>this.log.debug({when:t},"when status")),(0,y.p)(([e,t])=>!!t),(0,u.T)(([e])=>e))}prepareUpdate(e,t){return i=>(0,v.x)(e.pipe((0,C.$)(),(0,u.T)(e=>[e,null])),i.pipe((0,u.T)(e=>e.state),(0,f.E)(t))).pipe((0,w.S)(([e],[t,i])=>{var n,r,s,o,a,l;if(null===(s=null===(r=(n=this.context).shouldUpdate)||void 0===r?void 0:r.call(n,e,t,i))||void 0===s||s){return[null!==(l=null===(a=(o=this.context).nextValue)||void 0===a?void 0:a.call(o,e,t,i))&&void 0!==l?l:t,i]}return this.log.debug("shouldUpdate prevented write"),[e,null]}),(0,I.i)(1),(0,u.T)(([e])=>e),(0,o.F)())}adjust(e){return(0,m.F)(e,(0,u.T)(([e,t])=>{var i;if(!e&&!(null===(i=this.objectKey)||void 0===i?void 0:i.initial))return this.log.debug("no value; bypassing adjustment"),{constraints:{},state:null};this.log.debug("adjusting");const n=null!=e?e:structuredClone(this.objectKey.initial),r=T(t)?t.calibrate(n):t,s=r.adjust(n);return this.log.debug("adjusted"),{constraints:r.constraints,state:s}}))}fix(e){return(0,m.F)((0,A.v)(e),(0,u.T)(([e,t])=>{this.log.debug("fixing");const i=T(t)?t.calibrate(e):t,n=i.fix(e);return this.log.debug("fixed"),{constraints:i.constraints,state:n}}))}declassify(e){return this.objectKey&&"plain"!==this.objectKey.format?(0,m.F)(this.mapToClassifiedFormat(),(0,A.v)(e),(0,b.H)(e=>F(this,[e],void 0,function*([e,t]){if(null==e)return this.log.debug("no value; bypassing declassification"),null;this.log.debug("declassifying");const{secret:i,disclosed:n}=e,r=B.k.fromJSON(i),s=yield t.decrypt(r),o=this.objectKey.classifier.declassify(n,s),a=this.objectKey.options.deserializer(o);return this.log.debug("declassified"),a}))):(this.log.debug("key uses plain format; bypassing declassification"),e=>e)}mapToClassifiedFormat(){return this.objectKey&&"classified"===this.objectKey.format?(0,u.T)(e=>S(e)?e:(this.log.warn("classified data must be in classified format; dropping"),null)):this.objectKey&&"secret-state"===this.objectKey.format?(0,u.T)(e=>{if(!Array.isArray(e))return this.log.warn("secret-state requires array formatting; dropping"),null;const[t]=e;return S(t)?t:(this.log.warn("unwrapped secret-state must be in classified format; dropping"),null)}):void this.log.panic({format:this.objectKey.format},"unsupported serialization format")}classify(e){return this.objectKey&&"plain"!==this.objectKey.format?(0,m.F)((0,E.bt)(e),(0,b.H)(e=>F(this,[e],void 0,function*([e,t]){if(null==e)return this.log.debug("no value; bypassing classification"),null;this.log.debug("classifying");const i=JSON.parse(JSON.stringify(e)),n=this.objectKey.classifier.classify(i),r=yield t.encrypt(n.secret),s={id:null,secret:JSON.parse(JSON.stringify(r)),disclosed:n.disclosed};return this.log.debug("classified"),s})),this.mapToStorageFormat()):(this.log.debug("key uses plain format; bypassing classification"),(0,m.F)((0,E.Gc)(e),(0,u.T)(e=>e)))}mapToStorageFormat(){return this.objectKey&&"classified"===this.objectKey.format?(0,u.T)(e=>e):this.objectKey&&"secret-state"===this.objectKey.format?(0,u.T)(e=>[e]):void this.log.panic({format:this.objectKey.format},"unsupported serialization format")}next(e){var t;null===(t=this.input)||void 0===t||t.next(e)}error(e){var t;null===(t=this.input)||void 0===t||t.error(e)}complete(){var e;null===(e=this.input)||void 0===e||e.complete()}subscribe(e){return this.output.pipe((0,u.T)(e=>e.state),(0,o.F)()).subscribe(e)}get withConstraints$(){return this.output.asObservable()}onNext(e,t){t.update(()=>{if(this.log.debug("updating"),"object"==typeof e){const t=this.counter++;t>Number.MAX_SAFE_INTEGER&&(this.counter=0);Object.assign({},e)[P]=t}return this.log.debug("updated"),e}).catch(e=>{this.log.error(e,"updating failed"),this.onError(e)})}onError(e){this.isDisposed||(this.log.debug(e,"forwarding error to subscribers"),this.output.error(e)),this.dispose()}onComplete(){this.isDisposed||this.output.complete(),this.dispose()}get isDisposed(){return null===this.input}dispose(){var e,t;this.isDisposed||(this.log.debug("disposing"),null===(e=this.inputSubscription)||void 0===e||e.unsubscribe(),null===(t=this.outputSubscription)||void 0===t||t.unsubscribe(),this.inputSubscription=null,this.outputSubscription=null,this.input=null,this.log.debug("disposed"))}}},89294(e,t,i){"use strict";i.d(t,{g:()=>p});var n=i(33812),r=i(71804),s=i(16888),o=i(37380),a=i(56962),l=i(50700),c=i(37115),d=i(62166),u=i(69855),h=i(66316),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{constructor(e,t,i,s,o,a,l){this.twoFactorService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=s,this.userVerificationService=o,this.dialogService=a,this.toastService=l,this.onUpdated=new n.bkB,this.organizationId=null,this.twoFactorProviderType=r.R,this.enabled=!1,this.authed=!1,this.componentName=""}auth(e){this.secret=e.secret,this.verificationType=e.verificationType,this.authed=!0}disableMethod(){return A(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"disable"},content:{key:"twoStepDisableDesc"},type:"warning"})))return;const e=yield this.buildRequestModel(s.G);if(void 0===this.type)throw new Error("Two-factor provider type is required");e.type=this.type,null!=this.organizationId?yield this.twoFactorService.putTwoFactorOrganizationDisable(this.organizationId,e):yield this.twoFactorService.putTwoFactorDisable(e),this.enabled=!1,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepDisabled")}),this.onUpdated.emit(!1)})}buildRequestModel(e){return A(this,void 0,void 0,function*(){if(void 0===this.secret||void 0===this.verificationType)throw new Error("User verification data is missing");return this.userVerificationService.buildRequest({secret:this.secret,type:this.verificationType},e,!0)})}}p.ɵfac=function(e){return new(e||p)(n.rXU(o.fz),n.rXU(l.W),n.rXU(c.y),n.rXU(a.K),n.rXU(d.i),n.rXU(h.o3),n.rXU(u.f))},p.ɵdir=n.FsC({type:p,outputs:{onUpdated:"onUpdated"}})},89479(e,t,i){"use strict";i.d(t,{x:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},89491(e,t,i){"use strict";var n=i(38450),r=i(94573),s=i(34003),o=i(45795),a=i(51757),l=i(71458),c=i(83731),d=i(66046),u=i(72245),h=i(69194),A=i(22485),p=i(3204),g=i(23965),v=i(12058),f=i(67553),m=i(84110),y=i(3633),C=i(54931),w=i(21879),I=i(31857),b=i(8916),B=i(33812),E=i(74208),S=i(52396),Q=i(74526),k=i(5556),T=i(68455),F=i(23649),P=i(69855),R=i(66316),D=i(62179),M=i(36359),x=i(49519),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class G{constructor(){this.router=(0,E.WQX)(F.Ix),this.ngZone=(0,E.WQX)(B.SKi),this.start$=this.router.events.pipe((0,c.pQ)(),(0,h.p)(e=>e instanceof F.wF),(0,D.i)(1),(0,p.T)(()=>{var e,t;const i=null===(e=this.router.currentNavigation())||void 0===e?void 0:e.extras;return null===(t=null==i?void 0:i.state)||void 0===t?void 0:t.focusAfterNav}),(0,h.p)(e=>!1!==e),(0,M.M)(e=>O(this,void 0,void 0,function*(){let t="main";"string"==typeof e&&e.length>0&&(t=e),this.ngZone.isStable||(yield(0,u._)(this.ngZone.onStable)),this.focusTargetEl(t)})))}focusTargetEl(e){const t=document.querySelector(e),i=document.querySelector("main");i&&(0,x.U)(i).length>0||(t?t.focus():console.warn(`RouterFocusManager: Could not find element with selector "${e}"`))}}G.ɵfac=function(e){return new(e||G)},G.ɵprov=E.jDH({token:G,factory:G.ɵfac,providedIn:"root"});var U=i(50700),V=i(37115),j=i(54351);class N{}var z=i(1601),Y=i(35500);class L{}class K{}class X{constructor(e,t){this.document=e,this.i18nService=t}start(){return this.i18nService.locale$.subscribe(e=>{this.document.documentElement.lang=e})}}var q=i(83078),H=i(77468),W=i(82630);class ${constructor(e){this.toastrService=e,this.toastContainer=(0,r.ebz)(W.kZ)}ngOnInit(){this.toastrService.overlayContainer=this.toastContainer()}}$.ɵfac=function(e){return new(e||$)(B.rXU(W.tw))},$.ɵcmp=B.VBU({type:$,selectors:[["bit-toast-container"]],viewQuery:function(e,t){1&e&&B.wEZ(t.toastContainer,W.kZ,5),2&e&&B.NyB()},decls:1,vars:0,consts:[["role","status","aria-live","polite","aria-atomic","true","toastContainer",""]],template:function(e,t){1&e&&B.nrm(0,"div",0)},dependencies:[W.kZ],encapsulation:2});var J=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Z(e,t){1&e&&(B.j41(0,"div",2)(1,"div",3),B.nrm(2,"img",4),B.k0s(),B.j41(3,"div",5),B.nrm(4,"i",6),B.k0s(),B.j41(5,"div",7)(6,"div",8),E.qSk(),B.j41(7,"svg",9)(8,"g",10),B.nrm(9,"path",11)(10,"path",12)(11,"path",13)(12,"path",14)(13,"path",15)(14,"path",16)(15,"path",17)(16,"path",18)(17,"path",19)(18,"path",20)(19,"path",21)(20,"path",22)(21,"path",23)(22,"path",24)(23,"path",25)(24,"path",26)(25,"path",27)(26,"path",28),B.k0s(),B.j41(27,"defs")(28,"clipPath",29),B.nrm(29,"path",30),B.k0s()()(),B.EFF(30," `; "),B.k0s(),E.joV(),B.j41(31,"div",31),E.qSk(),B.j41(32,"svg",32)(33,"g",33),B.nrm(34,"path",34)(35,"path",35)(36,"path",36)(37,"circle",37)(38,"circle",38)(39,"path",39)(40,"path",40)(41,"path",41)(42,"path",42)(43,"path",43)(44,"path",44)(45,"path",45)(46,"path",46)(47,"path",47)(48,"path",48),B.k0s(),B.j41(49,"defs")(50,"clipPath",49),B.nrm(51,"path",50),B.k0s()()()()()())}function _(e,t){1&e&&(B.qex(0),B.nrm(1,"router-outlet"),B.bVm())}const ee="AppComponent";class te{constructor(e,t,i,n,r,s,o,a,l,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S,Q,k,T){this.broadcasterService=e,this.folderService=t,this.cipherService=i,this.authService=n,this.router=r,this.toastService=s,this.i18nService=o,this.platformUtilsService=a,this.ngZone=l,this.keyService=u,this.lockService=h,this.collectionService=A,this.searchService=p,this.serverNotificationsService=g,this.stateService=v,this.eventUploadService=f,this.configService=m,this.dialogService=y,this.biometricStateService=C,this.stateEventRunnerService=w,this.organizationService=I,this.accountService=b,this.processReloadService=B,this.deviceTrustToastService=E,this.destroy=S,this.documentLangSetter=Q,this.tokenService=k,this.routerFocusManager=T,this.lastActivity=null,this.idleTimer=null,this.isIdle=!1,this.destroy$=new d.B,this.loading=!1,this.deviceTrustToastService.setupListeners$.pipe((0,c.pQ)()).subscribe();const F=this.documentLangSetter.start();this.routerFocusManager.start$.pipe((0,c.pQ)()).subscribe(),this.destroy.onDestroy(()=>{F.unsubscribe()})}ngOnInit(){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(ee,e=>J(this,void 0,void 0,function*(){this.ngZone.run(()=>J(this,void 0,void 0,function*(){switch(e.command){case"authBlocked":this.router.navigate(["/"]);break;case"logout":yield this.logOut(e.redirect);break;case"lockVault":{const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.lockService.lock(e);break}case"locked":yield this.processReloadService.startProcessReload();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"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":this.toastService._showToast(e);break;case"convertAccountToKeyConnector":this.router.navigate(["/remove-password"]);break;case"syncOrganizationStatusChanged":{const{organizationId:t,enabled:i}=e,n=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),r=(yield(0,u._)(this.organizationService.organizations$(n))).find(e=>e.id===t);if(r){const e=Object.assign(Object.assign({},r),{enabled:i});yield this.organizationService.upsert(e,n)}break}case"syncOrganizationCollectionSettingChanged":{const{organizationId:t,limitCollectionCreation:i,limitCollectionDeletion:n}=e,r=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),s=(yield(0,u._)(this.organizationService.organizations$(r))).find(e=>e.id===t);s&&(yield this.organizationService.upsert(Object.assign(Object.assign({},s),{limitCollectionCreation:i,limitCollectionDeletion:n}),r));break}}}))}))}ngOnDestroy(){this.broadcasterService.unsubscribe(ee),this.destroy$.next(),this.destroy$.complete()}logOut(){return J(this,arguments,void 0,function*(e=!0){this.ngZone.run(()=>{this.loading=!0,document.body.classList.add("layout_frontend")}),yield this.eventUploadService.uploadEvents();const t=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),i=(0,u._)(this.authService.authStatusFor$(t).pipe((0,h.p)(e=>e===m.J.LoggedOut),(0,A.w)({first:5e3,with:()=>{throw new Error("The logout process did not complete in a reasonable amount of time.")}})));yield Promise.all([this.keyService.clearKeys(t),this.cipherService.clear(t),this.folderService.clear(t),this.biometricStateService.logout(t)]),yield this.stateEventRunnerService.handleEvent("logout",t),yield this.searchService.clearIndex(t),this.authService.logOut(()=>J(this,void 0,void 0,function*(){yield this.stateService.clean({userId:t}),yield this.tokenService.clearAccessToken(t),yield this.accountService.clean(t),yield this.accountService.switchAccount(null),yield i,e&&(yield this.router.navigate(["/"])),yield this.processReloadService.startProcessReload()}),t)})}recordActivity(){return J(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(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.serverNotificationsService.disconnectFromInactivity():this.serverNotificationsService.reconnectFromActivity()}}te.ɵfac=function(e){return new(e||te)(B.rXU(S.y),B.rXU(Q.Z),B.rXU(k.p),B.rXU(T.u),B.rXU(F.Ix),B.rXU(P.f),B.rXU(U.W),B.rXU(V.y),B.rXU(B.SKi),B.rXU(b.Lu),B.rXU(v.FQ),B.rXU(g.YD),B.rXU(j.S),B.rXU(N),B.rXU(w.dw),B.rXU(C.fH),B.rXU(z.w),B.rXU(R.o3),B.rXU(b.vB),B.rXU(I.lR),B.rXU(f.k4),B.rXU(Y.D),B.rXU(L),B.rXU(K),B.rXU(E.abz),B.rXU(X),B.rXU(q.B),B.rXU(G))},te.ɵcmp=B.VBU({type:te,selectors:[["app-root"]],standalone:!1,decls:4,vars:2,consts:[["loadingState",""],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-flex-col","tw-min-h-[100vh]"],[1,"tw-pt-5","tw-px-5","tw-fixed"],["alt","Vaultwarden",1,"new-logo-themed","!tw-w-[200px]"],[1,"spinner-container","tw-justify-center"],["title","Loading","aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted"],[1,"tw-relative","tw-grow"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","[&_svg]:tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-start-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 501 226"],["clip-path","url(#left-a)"],["d","M-71.691 6.821a4 4 0 0 1 4-4h296.5a4 4 0 0 1 4 4v188a4 4 0 0 1-4 4h-296.5a4 4 0 0 1-4-4v-188Z",1,"tw-fill-illustration-bg-primary"],["d","M-48.941 25.821a2 2 0 0 1 2-2h127.5v154h-127.5a2 2 0 0 1-2-2v-150Z",1,"tw-fill-illustration-bg-primary"],["d","M80.559 25.82a2 2 0 0 1 2-2h125.5a2 2 0 0 1 2 2v150.001a2 2 0 0 1-2 2h-125.5a2 2 0 0 1-2-2v-150ZM45.871 89.854c0 17.155-13.96 31.062-31.182 31.062-17.221 0-31.182-13.907-31.182-31.062s13.96-31.062 31.182-31.062c17.221 0 31.182 13.907 31.182 31.062Z",1,"tw-fill-illustration-bg-tertiary"],["d","M72.396 153.443a57.243 57.243 0 0 1 4.663 22.604v1.222a2 2 0 0 1-2 2h-118.5a2 2 0 0 1-2-2v-1.222a57.243 57.243 0 0 1 4.662-22.604c3.078-7.167 7.59-13.678 13.277-19.163 5.688-5.485 12.44-9.836 19.871-12.805a63.228 63.228 0 0 1 23.44-4.496 63.227 63.227 0 0 1 23.439 4.496c7.431 2.969 14.183 7.32 19.87 12.805 5.688 5.485 10.2 11.996 13.278 19.163Z",1,"tw-fill-illustration-bg-tertiary"],["d","M161.629 57.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625 0-9.181 7.579-16.625 16.928-16.625 9.348 0 16.927 7.444 16.927 16.625Z",1,"tw-fill-illustration-bg-secondary"],["d","M176.028 89.071a29.33 29.33 0 0 1 2.531 11.894c0 .937-.759 1.696-1.696 1.696h-63.109a1.695 1.695 0 0 1-1.695-1.696c0-4.081.86-8.123 2.531-11.894 1.671-3.77 4.12-7.197 7.207-10.083 3.088-2.886 6.753-5.176 10.787-6.738a35.275 35.275 0 0 1 12.725-2.366c4.366 0 8.69.804 12.724 2.366 4.034 1.562 7.699 3.852 10.787 6.738 3.087 2.886 5.537 6.312 7.208 10.083ZM161.629 134.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625s7.579-16.625 16.928-16.625c9.348 0 16.927 7.443 16.927 16.625Z",1,"tw-fill-illustration-bg-secondary"],["d","M176.028 165.953a28.993 28.993 0 0 1 2.531 11.821c0 .93-.755 1.684-1.685 1.684h-63.131c-.93 0-1.684-.754-1.684-1.684 0-4.057.86-8.074 2.531-11.821 1.671-3.748 4.12-7.153 7.207-10.021 3.088-2.869 6.753-5.144 10.787-6.696a35.456 35.456 0 0 1 12.725-2.352c4.366 0 8.69.799 12.724 2.352 4.034 1.552 7.699 3.827 10.787 6.696 3.087 2.868 5.537 6.273 7.208 10.021ZM-87.441 199.521h332.5v14.5c0 5.523-4.478 10-10 10h-312.5c-5.523 0-10-4.477-10-10v-14.5Z",1,"tw-fill-illustration-bg-secondary"],["fill-rule","evenodd","d","M208.059 21.82a4 4 0 0 1 4 4v150.001a4 4 0 0 1-4 4l-255 .001a4 4 0 0 1-4-4v-150a4 4 0 0 1 4-4l255-.001Zm-255 154.002h1.5a57.23 57.23 0 0 1 4.378-21.706l.284-.673c2.982-6.943 7.31-13.27 12.748-18.646l.529-.517c5.688-5.485 12.44-9.836 19.871-12.805a62.937 62.937 0 0 1 10.036-3.065c-11.113-4.751-18.897-15.747-18.897-28.556 0-17.155 13.96-31.061 31.182-31.062 17.22 0 31.18 13.907 31.181 31.062 0 12.537-7.457 23.338-18.192 28.245a62.952 62.952 0 0 1 11.569 3.376c7.431 2.969 14.184 7.32 19.871 12.805 5.688 5.485 10.2 11.996 13.278 19.163a57.251 57.251 0 0 1 4.66 22.379h1.502v-150h-125.5v150Zm129.5-.001h29.568a29.02 29.02 0 0 1 2.159-9.161l.304-.706c1.671-3.748 4.12-7.154 7.207-10.022 2.894-2.689 6.297-4.857 10.035-6.396l.752-.299c.996-.383 2.01-.721 3.037-1.012-4.602-2.879-7.693-7.881-7.841-13.602l-.006-.429c0-9.182 7.579-16.625 16.928-16.625l.437.006c9.146.227 16.49 7.581 16.49 16.619l-.006.429c-.144 5.571-3.08 10.461-7.484 13.372 1.321.338 2.622.752 3.894 1.242 4.034 1.552 7.7 3.827 10.787 6.695 3.088 2.868 5.536 6.274 7.207 10.022a29.066 29.066 0 0 1 2.462 9.867h29.57v-73h-125.5v73Zm62.75-24.936c-3.881 0-7.718.71-11.288 2.084-3.571 1.374-6.797 3.382-9.501 5.894-2.704 2.511-4.831 5.478-6.277 8.72a25.125 25.125 0 0 0-2.074 7.876h58.279a25.125 25.125 0 0 0-2.074-7.876c-1.445-3.242-3.573-6.209-6.276-8.72-2.705-2.512-5.931-4.52-9.501-5.894a31.473 31.473 0 0 0-11.288-2.084Zm-129.5-29.906a59.215 59.215 0 0 0-21.955 4.211c-6.957 2.779-13.269 6.848-18.579 11.969-5.31 5.12-9.513 11.191-12.378 17.862a53.266 53.266 0 0 0-4.332 20.248H73.053a53.266 53.266 0 0 0-4.332-20.248c-2.866-6.671-7.07-12.742-12.38-17.862-5.31-5.121-11.621-9.19-18.577-11.969a59.215 59.215 0 0 0-21.955-4.211Zm128.893.59c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625ZM14.69 62.792c-15.027 0-27.182 12.13-27.182 27.062 0 14.931 12.155 27.062 27.181 27.063 15.027-.001 27.182-12.132 27.182-27.063S29.716 62.793 14.69 62.792Zm67.869 36.029h29.579c.229-3.094.952-6.141 2.148-9.04l.304-.71a30.936 30.936 0 0 1 6.636-9.536l.571-.547a33.416 33.416 0 0 1 10.035-6.437l.752-.3a34.78 34.78 0 0 1 3.047-1.021c-4.607-2.878-7.703-7.883-7.851-13.607l-.006-.43c0-9.18 7.579-16.624 16.928-16.624l.437.006c9.146.227 16.49 7.58 16.49 16.619l-.006.429c-.144 5.574-3.082 10.465-7.49 13.376 1.324.34 2.626.758 3.9 1.252 4.034 1.561 7.7 3.85 10.787 6.737 3.088 2.886 5.536 6.312 7.207 10.083a29.407 29.407 0 0 1 2.451 9.75h29.581v-73h-125.5v73Zm62.75-24.937c-3.878 0-7.712.714-11.281 2.096-3.568 1.382-6.795 3.401-9.5 5.93-2.704 2.528-4.833 5.515-6.281 8.782a25.432 25.432 0 0 0-2.08 7.969h58.283a25.432 25.432 0 0 0-2.08-7.97c-1.447-3.266-3.577-6.253-6.281-8.781-2.705-2.529-5.931-4.548-9.5-5.93a31.275 31.275 0 0 0-11.28-2.096Zm-.607-29.315c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["fill-rule","evenodd","d","M228.809.822a6 6 0 0 1 6 6v188a5.97 5.97 0 0 1-.643 2.699h12.893v16.5c0 6.627-5.373 12-12 12h-312.5c-6.628 0-12-5.373-12-12v-16.5h16.391a5.966 5.966 0 0 1-.634-2.391l-.007-.308v-188a6 6 0 0 1 6-6h296.5ZM-85.441 214.02a8 8 0 0 0 8 8h312.5a8 8 0 0 0 8-8v-12.5h-328.5v12.5Zm17.75-209.2a2 2 0 0 0-2 2v188.001l.01.204a2 2 0 0 0 1.99 1.796h296.5a2.001 2.001 0 0 0 2-2v-188a2 2 0 0 0-2-2h-296.5Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M378.821 114.003a1.997 1.997 0 0 0-.675 1.497v8.396c0 .583.254 1.136.697 1.515l11.455 9.825a2 2 0 0 1 .543 2.286l-4.203 10.056a1.998 1.998 0 0 1-1.936 1.224l-15.288-.717a1.997 1.997 0 0 0-1.501.579l-6.014 5.979a1.995 1.995 0 0 0-.583 1.569l1.145 14.942a1.997 1.997 0 0 1-1.22 1.995l-9.958 4.169a1.997 1.997 0 0 1-2.252-.503l-10.221-11.309a1.998 1.998 0 0 0-1.482-.658h-8.474c-.579 0-1.129.252-1.508.689l-9.889 11.4a1.998 1.998 0 0 1-2.28.534l-9.969-4.174a1.998 1.998 0 0 1-1.224-1.937l.721-15.182a2 2 0 0 0-.587-1.51l-6.014-5.98a1.996 1.996 0 0 0-1.559-.575l-15.049 1.14a1.997 1.997 0 0 1-1.993-1.221l-4.198-10.045a1.997 1.997 0 0 1 .512-2.258l11.363-10.155c.424-.379.666-.92.666-1.489v-8.403c0-.583-.254-1.136-.696-1.516l-11.456-9.824a1.997 1.997 0 0 1-.542-2.286L279.354 92a1.998 1.998 0 0 1 1.936-1.224l15.288.717a1.998 1.998 0 0 0 1.502-.579l6.007-5.974c.418-.415.631-.995.582-1.582l-1.292-15.419a1.995 1.995 0 0 1 1.218-2.008l9.942-4.163a1.996 1.996 0 0 1 2.258.51l10.552 11.786c.379.423.92.665 1.488.665h8.469c.579 0 1.129-.25 1.508-.688l9.889-11.4a1.996 1.996 0 0 1 2.279-.534l9.97 4.174a1.999 1.999 0 0 1 1.224 1.937l-.721 15.181a2 2 0 0 0 .587 1.51l6.014 5.98c.411.41.98.62 1.558.576l15.049-1.14a1.996 1.996 0 0 1 1.993 1.22l4.195 10.036c.33.79.12 1.702-.521 2.268l-11.507 10.154Z",1,"tw-fill-illustration-bg-primary"],["fill-rule","evenodd","d","M313.765 59.926a3.994 3.994 0 0 1 4.518 1.02l10.552 11.786h8.469l9.888-11.4a3.994 3.994 0 0 1 4.559-1.067l9.97 4.174a3.994 3.994 0 0 1 2.447 3.873l-.72 15.182 6.013 5.98 15.049-1.14a3.995 3.995 0 0 1 3.987 2.442l4.194 10.035a3.992 3.992 0 0 1-1.042 4.534L380.142 115.5v8.396l11.456 9.824a3.995 3.995 0 0 1 1.085 4.571l-4.203 10.056a3.993 3.993 0 0 1-3.872 2.449l-15.288-.717-6.013 5.98 1.145 14.943a3.994 3.994 0 0 1-2.44 3.988l-9.958 4.169a3.992 3.992 0 0 1-4.505-1.005l-10.221-11.309h-8.474l-9.889 11.4a3.993 3.993 0 0 1-4.559 1.067l-9.97-4.174a3.993 3.993 0 0 1-2.446-3.873l.72-15.181-6.014-5.98-15.049 1.14a3.993 3.993 0 0 1-3.986-2.442l-4.198-10.045a3.993 3.993 0 0 1 1.023-4.517l11.363-10.155v-8.403l-11.455-9.825a3.992 3.992 0 0 1-1.085-4.571l4.203-10.056a3.993 3.993 0 0 1 3.872-2.45l15.287.718 6.008-5.974-1.292-15.418a3.992 3.992 0 0 1 2.437-4.017l9.941-4.163Zm1.543 3.684-9.942 4.162 1.292 15.419a3.992 3.992 0 0 1-1.163 3.165l-6.008 5.974a3.994 3.994 0 0 1-3.003 1.157l-15.288-.717-4.202 10.056 11.455 9.824a3.993 3.993 0 0 1 1.394 3.032v8.403c0 1.137-.485 2.22-1.332 2.978l-11.364 10.154 4.198 10.045 15.049-1.14a3.994 3.994 0 0 1 3.118 1.15l6.014 5.98a3.996 3.996 0 0 1 1.173 3.021l-.72 15.181 9.969 4.175 9.889-11.401a3.994 3.994 0 0 1 3.017-1.377h8.474c1.129 0 2.206.478 2.963 1.316l10.221 11.309 9.958-4.169-1.145-14.943a3.996 3.996 0 0 1 1.166-3.137l6.013-5.979a3.997 3.997 0 0 1 3.003-1.158l15.288.717 4.203-10.056-11.456-9.824a3.995 3.995 0 0 1-1.393-3.031V115.5c0-1.146.492-2.236 1.351-2.994l11.506-10.155-4.194-10.035-15.049 1.14a3.991 3.991 0 0 1-3.117-1.15l-6.014-5.98a3.99 3.99 0 0 1-1.173-3.022l.72-15.181-9.97-4.174-9.889 11.4a3.992 3.992 0 0 1-3.016 1.377h-8.469a3.992 3.992 0 0 1-2.975-1.33L315.308 63.61Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M353.438 119.624c0 11.289-9.152 20.441-20.442 20.441-11.289 0-20.441-9.152-20.441-20.441 0-11.29 9.152-20.442 20.441-20.442 11.29 0 20.442 9.152 20.442 20.442Z",1,"tw-fill-illustration-logo"],["fill-rule","evenodd","d","M332.996 101.179c-10.186 0-18.444 8.258-18.444 18.444 0 10.187 8.258 18.445 18.444 18.445 10.187 0 18.445-8.258 18.445-18.445 0-10.186-8.258-18.444-18.445-18.444Zm-22.438 18.444c0-12.392 10.046-22.438 22.438-22.438 12.393 0 22.439 10.046 22.439 22.438 0 12.393-10.046 22.439-22.439 22.439-12.392 0-22.438-10.046-22.438-22.439Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","m497.152 164.106-7.588-7.587a3.004 3.004 0 0 0-4.245-.003l-4.055 4.047 11.83 11.83 4.055-4.047a2.996 2.996 0 0 0 .003-4.24Z",1,"tw-fill-illustration-bg-tertiary"],["d","M500.922 194.274c0 22.644-18.356 41-41 41s-41-18.356-41-41 18.356-41 41-41 41 18.356 41 41Z",1,"tw-fill-illustration-bg-secondary"],["d","M459.03 177.416a2 2 0 1 1 4 0v18.469c0 .613-.282 1.192-.763 1.571l-12.032 9.48a2.001 2.001 0 0 1-2.809-.333 2.002 2.002 0 0 1 .334-2.809l11.27-8.881v-17.497Z",1,"tw-fill-illustration-outline"],["d","M450.936 144.041a2 2 0 0 1 2-2h13.972a2 2 0 0 1 2 2v3.863a2 2 0 0 1-2 2h-13.972a2 2 0 0 1-2-2v-3.863Z",1,"tw-fill-illustration-bg-tertiary"],["fill-rule","evenodd","d","M467.114 140.046a4 4 0 0 1 3.794 3.995v3.863a3.999 3.999 0 0 1-3.931 3.998v1.978a40.72 40.72 0 0 1 13.484 4.903l3.69-3.68a5.008 5.008 0 0 1 7.076.003l7.587 7.588.177.186a4.994 4.994 0 0 1-.181 6.881l-3.615 3.606a40.801 40.801 0 0 1 5.727 20.907c0 22.644-18.357 41-41 41-22.644 0-41-18.356-41-41 0-20.434 14.949-37.375 34.507-40.487v-1.883h-.493a4 4 0 0 1-4-4v-3.863a4 4 0 0 1 4-4h13.972l.206.005Zm-7.192 17.228c-20.435 0-37 16.566-37 37 0 20.435 16.565 37 37 37 20.434 0 37-16.565 37-37 0-20.434-16.566-37-37-37Zm28.473.658a1.002 1.002 0 0 0-1.416-.001l-2.638 2.633 9.001 9.002 2.639-2.633a1 1 0 0 0 .07-1.338l-.069-.075-7.587-7.588Zm-30.966-6.028v1.447a41.171 41.171 0 0 1 5.548.036v-1.483h-5.548Zm-4.493-4h13.972v-3.863h-13.972v3.863Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["id","left-a"],["d","M0 0h501v226H0z",1,"tw-fill-illustration-bg-tertiary"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-end-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 506 297"],["clip-path","url(#right-a)"],["d","M45.673 294.742v-29.124l22.323 16.198-15.395 15.75a4.04 4.04 0 0 1-6.928-2.824Z",1,"tw-fill-illustration-bg-primary"],["d","m4.978 240.865 95.568-44.738c3.52-1.648 7.492 1.175 7.093 5.041l-9.608 93.173c-.395 3.823-4.774 5.79-7.893 3.547l-43.43-31.233-41.47-16.621c-4.06-1.627-4.221-7.315-.26-9.169Z",1,"tw-fill-illustration-bg-tertiary"],["d","M99.698 194.315c4.929-2.306 10.489 1.645 9.931 7.058l-9.608 93.174c-.552 5.351-6.683 8.105-11.05 4.965l-20.832-14.983-14.107 14.435a6.04 6.04 0 0 1-10.359-4.222v-27.151l-39.178-15.7c-5.684-2.278-5.91-10.242-.364-12.838l95.567-44.738Zm5.953 6.648c.239-2.32-2.144-4.013-4.256-3.025L5.827 242.676c-2.376 1.112-2.28 4.525.156 5.502l40.159 16.093 26.703-30.327a2.001 2.001 0 0 1 3.002 2.644l-26.178 29.731 41.637 29.945c1.872 1.346 4.5.165 4.736-2.128l9.609-93.173Zm-57.978 93.779a2.04 2.04 0 0 0 3.498 1.426l13.684-14.001-17.182-12.357v24.932Z",1,"tw-fill-illustration-outline"],["cx","86.719","cy","86.719","r","84.719","stroke","#020F66","stroke-linecap","round","stroke-linejoin","round","stroke-width","4","transform","scale(-1 1) rotate(45.035 -184.565 -565.488)",1,"tw-fill-illustration-bg-tertiary"],["cx","69.752","cy","69.752","r","69.752","transform","scale(-1 1) rotate(45.035 -213.255 -553.709)",1,"tw-fill-illustration-bg-secondary"],["d","m445.838 353.214 2.95-180.467 12.372-.007 3.078 180.465a4.64 4.64 0 0 1-4.637 4.72l-9.12.005a4.64 4.64 0 0 1-4.643-4.716ZM453.82 52.947a2 2 0 0 1 1.998-2.001l35.638-.023a2 2 0 0 1 2.001 2.015l-.268 35.637a2 2 0 1 1-4-.03l.252-33.62-33.62.02a1.999 1.999 0 0 1-2.001-1.998ZM415.689 86.49a2 2 0 0 1 4.001.03l-.254 33.62 33.622-.021a2 2 0 0 1 .003 4l-35.637.022a2 2 0 0 1-2.001-2.015l.266-35.636Zm25.457-19.997a2 2 0 0 1 3.461-2.006l23.124 39.885a2 2 0 0 1-3.461 2.006l-23.124-39.885Z",1,"tw-fill-illustration-outline"],["d","M259.264 277.271c21.107-4.293 34.791-24.62 30.565-45.402-4.227-20.782-24.764-34.15-45.871-29.857-21.107 4.293-34.791 24.62-30.565 45.402 4.227 20.783 24.764 34.15 45.871 29.857ZM299.993 173.472c7.793-1.585 12.826-9.188 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.187-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-primary"],["d","M329.869 242.094c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.188-12.826-16.981-11.241-7.794 1.585-12.827 9.188-11.241 16.981 1.585 7.794 9.187 12.827 16.981 11.241Z",1,"tw-fill-illustration-bg-secondary"],["d","M330.088 309.401c7.794-1.585 12.826-9.188 11.241-16.981-1.585-7.794-9.187-12.827-16.981-11.242-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.827 16.981 11.242Z",1,"tw-fill-illustration-bg-tertiary"],["d","M234.598 327.597c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-primary"],["d","M176.919 248.71c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.794-9.188-12.827-16.982-11.242-7.793 1.586-12.826 9.188-11.241 16.982 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-secondary"],["d","M206.836 185.071c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.793-9.188-12.826-16.982-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-tertiary"],["fill-rule","evenodd","d","M200.699 154.89c8.875-1.805 17.533 3.927 19.339 12.803 1.165 5.732-.814 11.372-4.752 15.135.131.223.29.502.489.845l14.805 21.386a41.483 41.483 0 0 1 12.979-5.007c9.276-1.886 18.455-.523 26.321 3.303.038-.221.111-.441.227-.648l17.035-30.333a16.337 16.337 0 0 1-6.09-9.744c-1.805-8.876 3.928-17.535 12.803-19.34 8.876-1.805 17.534 3.928 19.339 12.803 1.805 8.876-3.926 17.534-12.802 19.339-3.427.697-6.822.27-9.803-1.028l-16.994 30.262a1.98 1.98 0 0 1-.397.497c8.774 5.316 15.487 13.883 18.16 24.43l19.238-1.61c-.007-7.642 5.356-14.488 13.135-16.07 8.875-1.805 17.534 3.927 19.339 12.803 1.805 8.875-3.927 17.533-12.802 19.339-8.639 1.757-17.072-3.627-19.18-12.099l-18.935 1.585c1.474 9.839-.81 19.465-5.834 27.387l29.108 22.962a16.324 16.324 0 0 1 8.523-4.671c8.876-1.804 17.534 3.928 19.339 12.803 1.805 8.876-3.927 17.534-12.802 19.339-8.875 1.805-17.534-3.926-19.34-12.802a16.338 16.338 0 0 1 1.872-11.474l-29.007-22.882c-5.828 7.464-14.29 12.983-24.349 15.028a41.442 41.442 0 0 1-14.045.441l-6.224 19.317a16.365 16.365 0 0 1 8.405 11.229c1.805 8.876-3.927 17.534-12.802 19.339-8.876 1.805-17.535-3.926-19.34-12.802-1.805-8.875 3.927-17.534 12.803-19.34 2.461-.5 4.906-.42 7.192.145l6.007-18.641c-14.851-3.594-27.011-15.301-30.225-31.105a40.043 40.043 0 0 1-.808-8.184l-20.473-1.442c-.032-.002-.064-.008-.096-.011-1.37 6.114-6.201 11.162-12.739 12.492-8.875 1.805-17.534-3.926-19.339-12.802-1.805-8.875 3.927-17.534 12.802-19.34 8.876-1.804 17.534 3.928 19.339 12.803.196.962.302 1.921.327 2.869l20.401 1.436c1.206-11.333 7.247-21.627 16.399-28.363l-14.76-21.321a20.41 20.41 0 0 0-.435-.719 16.428 16.428 0 0 1-4.816 1.8c-8.876 1.805-17.535-3.927-19.34-12.802-1.805-8.876 3.927-17.535 12.803-19.34Zm124.048 128.249c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.364-6.71-7.911-11.044-14.622-9.68Zm-95.49 18.196c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.621-1.365-6.711-7.911-11.045-14.622-9.681Zm15.1-97.363c-20.054 4.079-33.004 23.373-29.004 43.044 4.001 19.672 23.459 32.374 43.513 28.296 9.593-1.951 17.558-7.386 22.822-14.676a1.986 1.986 0 0 1 .612-.873c5.306-7.813 7.58-17.606 5.569-27.495-4.001-19.671-23.459-32.374-43.512-28.296Zm80.171 11.861c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.365-6.711-7.911-11.045-14.622-9.68Zm-152.949 6.614c-6.711 1.365-11.045 7.912-9.681 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.621-1.365-6.711-7.912-11.045-14.622-9.681Zm123.073-75.237c-6.71 1.365-11.044 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.622-1.365-6.71-7.912-11.045-14.623-9.68Zm-93.156 11.6c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.622 9.679 6.711-1.365 11.044-7.912 9.68-14.622-1.365-6.711-7.911-11.045-14.622-9.68Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M272.266 232.544a1.998 1.998 0 0 0-.353 1.589l.554 2.725a2.002 2.002 0 0 0 1.002 1.357l4.786 2.611a2 2 0 0 1 1.003 2.15l-.667 3.313a1.998 1.998 0 0 1-1.647 1.58l-5.641.896a1.998 1.998 0 0 0-1.352.867l-1.524 2.291a2 2 0 0 0-.252 1.678l1.555 5.227a2 2 0 0 1-.794 2.224l-2.799 1.902a2 2 0 0 1-2.309-.043l-4.524-3.327a2 2 0 0 0-1.583-.348l-2.754.56a1.997 1.997 0 0 0-1.352.994l-2.638 4.785a2 2 0 0 1-2.14.996l-3.339-.661a2 2 0 0 1-1.587-1.649l-.886-5.597a2.003 2.003 0 0 0-.875-1.358l-2.298-1.514a2 2 0 0 0-1.669-.247l-5.272 1.563a2 2 0 0 1-2.22-.788l-1.897-2.774a2.001 2.001 0 0 1 .045-2.321l3.339-4.498a2.004 2.004 0 0 0 .354-1.591l-.557-2.736a2.001 2.001 0 0 0-.983-1.347l-4.848-2.715a2 2 0 0 1-.983-2.14l.669-3.329a2.001 2.001 0 0 1 1.648-1.581l5.641-.895a1.999 1.999 0 0 0 1.352-.868l1.526-2.293c.327-.493.42-1.105.253-1.673l-1.608-5.457a2 2 0 0 1 .794-2.22l2.793-1.897a2 2 0 0 1 2.322.053l4.676 3.5a1.999 1.999 0 0 0 1.597.359l2.744-.558a2.002 2.002 0 0 0 1.353-.995l2.637-4.784a1.997 1.997 0 0 1 2.14-.996l3.339.661a2 2 0 0 1 1.587 1.649l.886 5.597c.088.555.406 1.048.875 1.357l2.298 1.514a2.002 2.002 0 0 0 1.669.248l5.272-1.564a2 2 0 0 1 2.22.789l1.898 2.775a2 2 0 0 1-.044 2.319l-3.432 4.635Zm-24.977-.064c-4.049 2.702-5.078 8.076-2.395 11.991 2.705 4.028 8.1 5.044 12.035 2.365 3.936-2.678 5.078-8.076 2.395-11.991-2.592-4.051-7.986-5.067-12.035-2.365Z",1,"tw-fill-illustration-logo"],["d","m270.507 237.256-.554-2.724a4.004 4.004 0 0 1 .705-3.178l3.433-4.636-1.897-2.775-5.273 1.564a4 4 0 0 1-3.337-.494l-2.298-1.515a4 4 0 0 1-1.751-2.714l-.886-5.597-3.339-.661-2.637 4.784a4.001 4.001 0 0 1-2.706 1.989l-2.744.558a4 4 0 0 1-3.194-.718l-4.676-3.5-2.792 1.898 1.608 5.457a3.998 3.998 0 0 1-.507 3.345l-1.525 2.294c-.62.931-1.6 1.56-2.704 1.736l-5.642.895-.669 3.329 4.848 2.715a4 4 0 0 1 1.965 2.693l.557 2.737a3.999 3.999 0 0 1-.708 3.18l-3.338 4.499 1.897 2.774 5.272-1.563a3.998 3.998 0 0 1 3.338.494l2.298 1.514a4.001 4.001 0 0 1 1.75 2.715l.886 5.597 3.339.661 2.638-4.785a4 4 0 0 1 2.706-1.988l2.753-.56a4 4 0 0 1 3.166.697l4.524 3.327 2.8-1.902-1.555-5.227a4.002 4.002 0 0 1 .504-3.355l1.524-2.291a3.998 3.998 0 0 1 2.703-1.736l5.642-.895.667-3.313-4.787-2.611a4.004 4.004 0 0 1-2.004-2.714Zm-24.328-6.439c4.915-3.28 11.556-2.099 14.795 2.898h.001v.001l.034.051h-.001c3.294 4.868 1.835 11.464-2.953 14.723-4.855 3.304-11.499 2.043-14.821-2.903l.001-.001c-3.308-4.845-2.013-11.461 2.944-14.769Zm11.461 5.106c-1.959-3.06-6.075-3.891-9.24-1.779-3.036 2.026-3.85 5.957-2.039 8.913l.183.284.01.015c2.089 3.109 6.234 3.879 9.25 1.827 3.066-2.087 3.897-6.25 1.871-9.207a.97.97 0 0 1-.035-.053Zm16.787.536 4.787 2.611a4 4 0 0 1 2.005 4.3l-.666 3.313a4.001 4.001 0 0 1-3.295 3.161l-5.641.896-1.525 2.291 1.555 5.227a4.002 4.002 0 0 1-1.586 4.449l-2.8 1.901a4 4 0 0 1-4.618-.086l-4.523-3.326-2.753.56-2.638 4.784a4 4 0 0 1-4.279 1.993l-3.34-.661a4.002 4.002 0 0 1-3.174-3.298l-.886-5.598-2.298-1.514-5.273 1.564a3.999 3.999 0 0 1-4.438-1.577l-1.897-2.774a3.998 3.998 0 0 1 .09-4.641l3.338-4.499-.557-2.737-4.848-2.715a3.998 3.998 0 0 1-1.966-4.279l.669-3.329a4.002 4.002 0 0 1 3.294-3.162l5.642-.895 1.526-2.294-1.609-5.457a4.001 4.001 0 0 1 1.59-4.439l2.792-1.897a4 4 0 0 1 4.645.106l4.676 3.5 2.744-.558 2.636-4.785a4 4 0 0 1 4.281-1.992l3.339.661a4 4 0 0 1 3.174 3.298l.886 5.597 2.298 1.514 5.272-1.563a4 4 0 0 1 4.439 1.576l1.898 2.775a4.001 4.001 0 0 1-.087 4.639l-3.433 4.636.554 2.724Z",1,"tw-fill-illustration-outline"],["id","right-a"],["d","M0 0h506v297H0z",1,"tw-fill-illustration-bg-tertiary"]],template:function(e,t){if(1&e&&(B.DNE(0,Z,52,0,"ng-template",null,0,B.C5r)(2,_,2,0,"ng-container",1),B.nrm(3,"bit-toast-container")),2&e){const e=B.sdS(1);B.R7$(2),B.Y8G("ngIf",!t.loading)("ngIfElse",e)}},dependencies:[H.bT,F.n3,$],encapsulation:2});class ie{}var ne=i(347),re=i(21001),se=i(71613),oe=i(21495),ae=i(2073),le=i(48003),ce=i(52892),de=i(12012),ue=i(72331),he=i(11224),Ae=i(4717);class pe{}class ge extends pe{}var ve=i(35631),fe=i(27866),me=i(18499),ye=i(62316),Ce=i(13417),we=i(84488),Ie=i(52136);const be=I.Ok.record(I.nr,"organizations",{deserializer:e=>Ie.o.fromJSON(e),clearOn:["logout"]});var Be=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ee(){return(0,p.T)(e=>e.length>0)}var Se=i(20702);class Qe extends Se.r{constructor(e){super(e),this.apiKey=this.getResponseProperty("ApiKey"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}var ke=i(85776);class Te extends Se.r{static fromView(e,t=new Te){return t.configType=e.configType,t.memberDecryptionType=e.memberDecryptionType,t.keyConnectorUrl=e.keyConnectorUrl,t.configType===ke.Ah.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===ke.Ah.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 Fe extends Se.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.identifier=this.getResponseProperty("Identifier"),this.data=null!=this.getResponseProperty("Data")?new Te(this.getResponseProperty("Data")):null,this.urls=new Pe(this.getResponseProperty("Urls"))}}class Pe extends Se.r{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 Re extends Se.r{constructor(e){super(e),this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource");this.paymentSource=null==t?null:new De(t)}}class De extends Se.r{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 Me extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),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 xe extends Se.r{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 Oe extends Se.r{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 xe(e))),null!=i&&(this.invoices=i.map(e=>new Me(e)))}get hasNoHistory(){return 0==this.invoices.length&&0==this.transactions.length}}var Ge=i(69138),Ue=i(16969);class Ve extends Se.r{constructor(e){super(e);const t=this.getResponseProperty("UserProfile");null!=t&&(this.userProfile=new Ue.l(t)),this.paymentIntentClientSecret=this.getResponseProperty("PaymentIntentClientSecret"),this.success=this.getResponseProperty("Success")}}var je=i(12277);class Ne extends Se.r{constructor(e){super(e),this.keyType=this.getResponseProperty("KeyType")}}class ze extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.resetPasswordEnabled=this.getResponseProperty("ResetPasswordEnabled")}}class Ye extends Se.r{constructor(e){super(e),this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey")}}class Le extends Ye{constructor(e){super(e)}}var Ke=i(77788),Xe=i(72868),qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class He extends Se.r{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 We extends Se.r{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 extends Se.r{constructor(e){super(e),this.organizationName=this.getResponseProperty("organizationName"),this.organizationIdentifier=this.getResponseProperty("organizationIdentifier"),this.domainName=this.getResponseProperty("domainName")}}class Je{constructor(e){this.email=e}}var Ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var _e=i(16878);var et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const tt=(it="autoConfirmFingerPrints",new I.Ok(I.ll,it,{deserializer:e=>e,clearOn:["logout"]}));var it;var nt=i(685),rt=i(44500),st=i(51151),ot=i(7861),at=i(78781),lt=i(54967),ct=i(38449),dt=i(25607),ut=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ht extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.plan=this.getResponseProperty("plan"),this.name=this.getResponseProperty("name"),this.seats=this.getResponseProperty("seats"),this.disabled=this.getResponseProperty("disabled")}}class At extends Se.r{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.occupiedSeats=this.getResponseProperty("OccupiedSeats"),this.remainingSeats=this.getResponseProperty("RemainingSeats"),this.plan=this.getResponseProperty("Plan")}}class pt extends At{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}class gt extends Se.r{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 vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ft=i(15639),mt=i(43978);class yt{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,this.providerType=e.providerType)}get canAccess(){return!!this.isProviderAdmin||this.enabled&&this.status===mt.PN.Confirmed}get canCreateOrganizations(){return this.enabled&&this.isProviderAdmin}get canManageUsers(){return this.isProviderAdmin}get canAccessEventLogs(){return this.isProviderAdmin}get isProviderAdmin(){return this.type===mt.pP.ProviderAdmin}}var Ct=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wt=I.Ok.record(I.L_,"providers",{deserializer:e=>e,clearOn:["logout"]});var It=i(46357),bt=i(29744);class Bt{}var Et=i(86388);class St{}var Qt=i(40271);class kt{}var Tt=i(45891),Ft=i(86214);class Pt{}var Rt=i(62166);class Dt{}var Mt=i(25279);class xt{}var Ot=i(38190);class Gt{}class Ut{constructor(e,t){this.token=e,this.expiresAt=t}isExpired(e=5e3){return Date.now()>=this.expiresAt-e}timeUntilExpirySeconds(){return Math.max(0,Math.floor((this.expiresAt-Date.now())/1e3))}static fromJson(e){return new Ut(e.token,e.expiresAt)}static fromSendAccessTokenResponse(e){return new Ut(e.token,e.expiresAt)}}var Vt=i(43008),jt=i(84079);const Nt=w.Zs.record(w.Mc,"accessTokenDict",{deserializer:e=>Ut.fromJson(e)});var zt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Yt=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};var Lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Kt=i(6367),Xt=i(28621),qt=i(54124);class Ht{constructor(e){this.id=e.id,this.priority=e.priority,this.title=e.title,this.body=e.body,this.date=e.date,this.taskId=e.taskId,this.readDate=e.readDate,this.deletedDate=e.deletedDate}}class Wt{constructor(e){this.id=e.id,this.priority=e.priority,this.title=e.title,this.body=e.body,this.date=e.date,this.taskId=e.taskId,this.readDate=e.readDate,this.deletedDate=e.deletedDate}static fromJSON(e){return Object.assign(new Wt({}),e,{id:e.id,priority:e.priority,title:e.title,body:e.body,date:new Date(e.date),taskId:e.taskId,readDate:e.readDate?new Date(e.readDate):null,deletedDate:e.deletedDate?new Date(e.deletedDate):null})}}class $t extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.priority=this.getResponseProperty("Priority"),this.title=this.getResponseProperty("Title"),this.body=this.getResponseProperty("Body"),this.date=this.getResponseProperty("Date"),this.taskId=this.getResponseProperty("TaskId"),this.readDate=this.getResponseProperty("ReadDate"),this.deletedDate=this.getResponseProperty("DeletedDate")}}class Jt extends Se.r{constructor(e){super(e),this.contextId=this.getResponseProperty("ContextId"),this.type=this.getResponseProperty("Type");let t=this.getResponseProperty("Payload");if("string"==typeof t)try{t=JSON.parse(t)}catch(i){}switch(this.type){case st._n.SyncCipherCreate:case st._n.SyncCipherDelete:case st._n.SyncCipherUpdate:case st._n.SyncLoginDelete:this.payload=new Zt(t);break;case st._n.SyncFolderCreate:case st._n.SyncFolderDelete:case st._n.SyncFolderUpdate:this.payload=new _t(t);break;case st._n.SyncVault:case st._n.SyncCiphers:case st._n.SyncOrganizations:case st._n.SyncOrgKeys:case st._n.SyncSettings:this.payload=new ei(t);break;case st._n.LogOut:this.payload=new li(t);break;case st._n.SyncSendCreate:case st._n.SyncSendUpdate:case st._n.SyncSendDelete:this.payload=new ti(t);break;case st._n.AuthRequest:case st._n.AuthRequestResponse:this.payload=new ii(t);break;case st._n.SyncOrganizationStatusChanged:this.payload=new ni(t);break;case st._n.SyncOrganizationCollectionSettingChanged:this.payload=new ri(t);break;case st._n.Notification:case st._n.NotificationStatus:this.payload=new $t(t);break;case st._n.OrganizationBankAccountVerified:this.payload=new si(t);break;case st._n.ProviderBankAccountVerified:this.payload=new oi(t);break;case st._n.SyncPolicy:this.payload=new ai(t);break;case st._n.AutoConfirmMember:this.payload=new ci(t)}}}class Zt extends Se.r{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 _t extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class ei extends Se.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.date=new Date(this.getResponseProperty("Date"))}}class ti extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class ii extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId")}}class ni extends Se.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId"),this.enabled=this.getResponseProperty("Enabled")}}class ri extends Se.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId"),this.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion")}}class si extends Se.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId")}}class oi extends Se.r{constructor(e){super(e),this.providerId=this.getResponseProperty("ProviderId"),this.adminId=this.getResponseProperty("AdminId")}}class ai extends Se.r{constructor(e){super(e),this.policy=this.getResponseProperty("Policy")}}class li extends Se.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.reason=this.getResponseProperty("Reason")}}class ci extends Se.r{constructor(e){super(e),this.targetOrganizationUserId=this.getResponseProperty("TargetOrganizationUserId"),this.targetUserId=this.getResponseProperty("TargetUserId"),this.userId=this.getResponseProperty("UserId"),this.organizationId=this.getResponseProperty("OrganizationId")}}class di extends Error{constructor(e){super(void 0===e?"Insecure URL not allowed. All URLs must use HTTPS.":`Insecure URL not allowed: ${e}. All URLs must use HTTPS.`)}}var ui=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var hi=i(34040),Ai=i(58363),pi=i(14803),gi=i(12610),vi=i(39444),fi=i(81441),mi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var yi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ci=I.Zs.array(I.dn,"pendingAuthRequests",{deserializer:e=>e});class wi{constructor(e){this.stateProvider=e,this.state=this.stateProvider.getGlobal(Ci)}getAll$(){return this.state.state$}add(e){return yi(this,void 0,void 0,function*(){const t=Date.now();yield this.stateProvider.getGlobal(Ci).update(i=>[...(null!=i?i:[]).filter(t=>t.userId!==e),{userId:e,receivedAtMs:t}])})}pruneOlderThan(e){return yi(this,void 0,void 0,function*(){const t=Date.now()-e;yield this.stateProvider.getGlobal(Ci).update(e=>(null!=e?e:[]).filter(e=>e.receivedAtMs>=t))})}clear(e){return yi(this,void 0,void 0,function*(){yield this.stateProvider.getGlobal(Ci).update(t=>(null!=t?t:[]).filter(t=>t.userId!==e))})}}var Ii=i(93695),bi=i(33338),Bi=i(27442),Ei=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Si{constructor(e){this.avatarColor=e}}var Qi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ki=new I.Ok(I.wt,"avatarColor",{deserializer:e=>e,clearOn:[]});class Ti{constructor(e){Object.assign(this,e),this.response=e}}var Fi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Pi extends Se.r{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"),this.isTrusted=this.getResponseProperty("IsTrusted"),this.encryptedUserKey=this.getResponseProperty("EncryptedUserKey"),this.encryptedPublicKey=this.getResponseProperty("EncryptedPublicKey"),this.devicePendingAuthRequest=this.getResponseProperty("DevicePendingAuthRequest")}}class Ri{constructor(e){this.devices=e}}var Di=i(39306),Mi=i(67529);class xi extends Se.r{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 Di.k(this.getResponseProperty("encryptedUserKey"))),e.encryptedPublicKey&&(this.encryptedPublicKey=new Di.k(this.getResponseProperty("encryptedPublicKey")))}getRotateableKeyset(){return new Mi.B(this.encryptedUserKey,this.encryptedPublicKey)}isTrusted(){return null!=this.encryptedUserKey&&null!=this.encryptedPublicKey}}class Oi{constructor(e,t,i){this.encryptedUserKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}var Gi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ui=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Vi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ji=i(52717),Ni=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var zi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yi=new I.Zs(I.iy,"ssoCodeVerifier",{deserializer:e=>e}),Li=new I.Zs(I.iy,"ssoState",{deserializer:e=>e}),Ki=new I.Ok(I.iy,"organizationSsoIdentifier",{deserializer:e=>e,clearOn:["logout"]}),Xi=new I.Zs(I.iy,"organizationSsoIdentifier",{deserializer:e=>e}),qi=new I.Zs(I.iy,"ssoEmail",{deserializer:e=>e}),Hi=new I.Zs(I.aC,"ssoRequiredCache",{deserializer:e=>e});var Wi=i(16184),$i=i(68467),Ji=i(43890);class Zi{constructor(e,t,i){this.accessToken=e,this.refreshToken=t,this.clientIdSecretPair=i}}const _i=new I.Ok(I.uv,"accessToken",{deserializer:e=>e,clearOn:[]}),en=new I.Ok(I.oR,"accessToken",{deserializer:e=>e,clearOn:[]}),tn=new I.Ok(I.uv,"refreshToken",{deserializer:e=>e,clearOn:[]}),nn=new I.Ok(I.oR,"refreshToken",{deserializer:e=>e,clearOn:[]}),rn=I.Zs.record(I.MC,"emailTwoFactorTokenRecord",{deserializer:e=>e}),sn=new I.Ok(I.uv,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),on=new I.Ok(I.oR,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),an=new I.Ok(I.uv,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),ln=new I.Ok(I.oR,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),cn=new I.Ok(I.oR,"securityStamp",{deserializer:e=>e,clearOn:["logout"]});var dn,un=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e.Disk="disk",e.SecureStorage="secureStorage",e.Memory="memory"}(dn||(dn={}));var hn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var An=i(68333),pn=i(7248);class gn{constructor(e){this.OTP=e}}var vn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var fn=i(93824),mn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Cn=i(12117);class wn{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i}}var In=i(97883),bn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Bn=i(37380),En=i(70342),Sn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qn=new I.Ok(I.O2,"enableBadgeCounter",{deserializer:e=>null==e||e,clearOn:[]});var kn=i(60276),Tn=i(58605),Fn=i(48180),Pn=i(2922),Rn=i(58329),Dn=i(41445),Mn=i(49247),xn=i(304),On=i(3160),Gn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Un=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Vn=new w.Ok(w.Cg,"accountProfile",{deserializer:e=>e,clearOn:["logout"]});class jn extends Se.r{constructor(e){super(e);const t=this.getResponseProperty("Seat");if(!t||"object"!=typeof t)throw new Error("PremiumPlanResponse: Missing or invalid 'Seat' property");this.seat=new Nn(t);const i=this.getResponseProperty("Storage");if(!i||"object"!=typeof i)throw new Error("PremiumPlanResponse: Missing or invalid 'Storage' property");this.storage=new Nn(i)}}class Nn extends Se.r{constructor(e){if(super(e),this.stripePriceId=this.getResponseProperty("StripePriceId"),!this.stripePriceId||"string"!=typeof this.stripePriceId)throw new Error("PurchasableResponse: Missing or invalid 'StripePriceId' property");if(this.price=this.getResponseProperty("Price"),"number"!=typeof this.price||isNaN(this.price))throw new Error("PurchasableResponse: Missing or invalid 'Price' property");if(this.provided=this.getResponseProperty("Provided"),"number"!=typeof this.provided||isNaN(this.provided))throw new Error("PurchasableResponse: Missing or invalid 'Provided' property")}}class zn extends Se.r{constructor(e){super(e),this.invoices=[];const t=this.getResponseProperty("Invoices");t&&t.length&&(this.invoices=t.map(e=>new Yn(e)))}}class Yn extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.date=this.getResponseProperty("Date"),this.number=this.getResponseProperty("Number"),this.total=this.getResponseProperty("Total"),this.status=this.getResponseProperty("Status"),this.dueDate=this.getResponseProperty("DueDate"),this.url=this.getResponseProperty("Url")}}class Ln extends Se.r{constructor(e){super(e),this.isOnSecretsManagerStandalone=this.getResponseProperty("IsOnSecretsManagerStandalone"),this.organizationOccupiedSeats=this.getResponseProperty("OrganizationOccupiedSeats")}}var Kn=i(69580);class Xn extends Se.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.description=this.getResponseProperty("Description"),this.needsVerification=this.getResponseProperty("NeedsVerification")}}class qn extends Se.r{constructor(e){super(e),this.suspensionDate=this.getResponseProperty("suspensionDate"),this.unpaidPeriodEndDate=this.getResponseProperty("unpaidPeriodEndDate"),this.gracePeriod=this.getResponseProperty("gracePeriod")}}class Hn extends Se.r{constructor(e){super(e),this.taxId=this.getResponseProperty("TaxIdNumber"),this.taxId||(this.taxId=this.getResponseProperty("TaxId")),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")}}class Wn extends Se.r{constructor(e){super(e),this.plans=[],this.status=this.getResponseProperty("status"),this.currentPeriodEndDate=this.getResponseProperty("currentPeriodEndDate"),this.discountPercentage=this.getResponseProperty("discountPercentage"),this.collectionMethod=this.getResponseProperty("collectionMethod");const t=this.getResponseProperty("plans");null!=t&&(this.plans=t.map(e=>new $n(e))),this.accountCredit=this.getResponseProperty("accountCredit");const i=this.getResponseProperty("taxInformation");null!=i&&(this.taxInformation=new Hn(i)),this.cancelAt=this.getResponseProperty("cancelAt");const n=this.getResponseProperty("suspension");null!=n&&(this.suspension=new qn(n)),this.providerType=this.getResponseProperty("providerType");const r=this.getResponseProperty("paymentSource");null!=r&&(this.paymentSource=new Xn(r))}}class $n extends Se.r{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"),this.type=this.getResponseProperty("Type"),this.productTier=this.getResponseProperty("ProductTier")}}var Jn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Zn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var _n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var er=i(20246),tr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ir=i(77665),nr=i(56953),rr=i(64447),sr=i(55459),or=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ar=i(37567),lr=i(80909),cr=i(75811),dr=i(82468),ur=i(58412);var hr=i(88507),Ar=i(75751),pr=i(45977),gr=i(51886),vr=i(64503),fr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var mr=i(77867);class yr{}var Cr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class wr extends Se.r{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")}}var Ir=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class br{constructor(e){this.apiService=e}getHibpBreach(e){return Ir(this,void 0,void 0,function*(){const t=encodeURIComponent(e);return(yield this.apiService.send("GET","/hibp/breach?username="+t,null,!0,!0)).map(e=>new wr(e))})}}var Br=i(35770),Er=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Sr=new w.Ok(w.Gg,"accountCryptographicState",{deserializer:e=>e,clearOn:["logout"]});var Qr=i(8943),kr=i(45872),Tr=i(89105),Fr=i(62870),Pr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Rr=16;class Dr{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 $i.Qd.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 $i.Qd.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 fromParts(e,t,i,n){if(null==e||null==t||null==i)throw new Error("encryptionType, iv, and data must be provided");switch(e){case $i.Qd.AesCbc256_B64:case $i.Qd.AesCbc256_HmacSha256_B64:Dr.validateIvLength(t),Dr.validateMacLength(e,n);break;default:throw new Error(`Unknown EncryptionType ${e} for EncArrayBuffer.fromParts`)}let r=0;null!=n&&(r=n.length);const s=new Uint8Array(1+t.byteLength+r+i.byteLength);return s.set([e],0),s.set(t,1),null!=n&&s.set(n,1+t.byteLength),s.set(i,1+t.byteLength+r),new Dr(s)}static fromResponse(e){return Pr(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 Dr(new Uint8Array(t))})}static fromB64(e){const t=at.A.fromB64ToArray(e);return new Dr(t)}static validateIvLength(e){if(null==e||e.length!==Rr)throw new Error("Invalid IV length")}static validateMacLength(e,t){switch(e){case $i.Qd.AesCbc256_B64:if(null!=t)throw new Error("mac must not be provided for AesCbc256_B64");break;case $i.Qd.AesCbc256_HmacSha256_B64:if(null==t||32!==t.length)throw new Error("Invalid MAC length");break;default:throw new Error("Invalid encryption type and mac combination")}}}var Mr=i(82781),xr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Or=i(55367),Gr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ur=i(39935);class Vr extends pn.V{}class jr{}class Nr extends jr{}var zr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yr=new I.Ok(I.eP,"deviceKey",{deserializer:e=>e?Ji.e.fromJSON(e):null,clearOn:[],cleanupDelayMs:0,debug:{enableRetrievalLogging:!0,enableUpdateLogging:!0}}),Lr=new I.Ok(I.eP,"shouldTrustDevice",{deserializer:e=>e,clearOn:[]});var Kr=i(60512),Xr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qr{constructor(e,t,i,n,r){this.kdfConfigService=e,this.changeKdfService=t,this.logService=i,this.configService=n,this.masterPasswordService=r}runMigrations(e,t){return Xr(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId"),(0,Kr.x)(t,"masterPassword"),this.logService.info(`[MinimumKdfMigration] Updating user ${e} to minimum PBKDF2 iteration count ${b.n1.ITERATIONS.defaultValue}`),yield this.changeKdfService.updateUserKdfParams(t,new b.n1(b.n1.ITERATIONS.defaultValue),e),yield this.kdfConfigService.setKdfConfig(e,new b.n1(b.n1.ITERATIONS.defaultValue))})}needsMigration(e){return Xr(this,void 0,void 0,function*(){if((0,Kr.x)(e,"userId"),!(yield this.masterPasswordService.userHasMasterPassword(e)))return"noMigrationNeeded";const t=yield this.kdfConfigService.getKdfConfig(e);return t.kdfType!==b.ao.PBKDF2_SHA256||t.iterations>=b.n1.ITERATIONS.min?"noMigrationNeeded":(yield this.configService.getFeatureFlag(dr.TO.ForceUpdateKDFSettings))?"needsMigrationWithMasterPassword":"noMigrationNeeded"})}}var Hr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Wr=i(27650),$r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Jr{}var Zr=i(22397);class _r extends Zr.T{constructor(e,t){super(),this.newMasterPasswordHash=e.masterPasswordAuthenticationHash,this.key=t.masterKeyWrappedUserKey,this.authenticationData=e,this.unlockData=t}}var es=i(10459),ts=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},is=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},ns=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});class rs{constructor(e,t,i,n){this.changeKdfApiService=e,this.sdkService=t,this.keyService=i,this.masterPasswordService=n}updateUserKdfParams(e,t,i){return ts(this,void 0,void 0,function*(){(0,Kr.x)(e,"masterPassword"),(0,Kr.x)(t,"kdf"),(0,Kr.x)(i,"userId");const n=yield(0,u._)(this.sdkService.userClient$(i).pipe((0,p.T)(i=>{const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");const r=is(n,i.take(),!1);return r.value.crypto().make_update_kdf(e,t.toSdkConfig())}catch(r){n.error=r,n.hasError=!0}finally{ns(n)}}))),r=(0,es.P)(n.masterPasswordAuthenticationData),s=es.k.fromSdk(n.masterPasswordUnlockData),o=(0,es.P)(n.oldMasterPasswordAuthenticationData),a=new _r(r,s);a.authenticateWith(o),yield this.changeKdfApiService.updateUserKdfParams(a);const l=yield this.keyService.makeMasterKey(e,s.salt,s.kdf),c=yield this.keyService.hashMasterKey(e,l,$i.VK.LocalAuthorization);yield this.masterPasswordService.setMasterKeyHash(c,i),yield this.masterPasswordService.setMasterKey(l,i)})}}class ss{}var os=i(31944),as=i(52057);class ls extends Se.r{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}var cs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ds=i(31925);var us=i(66827);class hs{constructor(e){if("object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKey"in e&&e.publicKey instanceof Uint8Array))throw new TypeError("Response must contain a valid publicKey");if(this.publicKey=e.publicKey,"verifyingKey"in e&&"string"==typeof e.verifyingKey?this.verifyingKey=e.verifyingKey:this.verifyingKey=null,"signedPublicKey"in e&&"string"==typeof e.signedPublicKey?this.signedPublicKey=e.signedPublicKey:this.signedPublicKey=null,null!==this.signedPublicKey&&null===this.verifyingKey||null===this.signedPublicKey&&null!==this.verifyingKey)throw new TypeError("Both signedPublicKey and verifyingKey must be present or absent together")}}var As=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ps=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var gs=i(17898),vs=i(83541),fs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ms=i(35014);class ys{}const Cs=new I.Ok(I.EF,"pinProtectedUserKeyEnvelopePersistent",{deserializer:e=>e,clearOn:["logout"]}),ws=I.Ok.record(I.aL,"pinProtectedUserKeyEnvelopeEphemeral",{deserializer:e=>e,clearOn:["logout"],cleanupDelayMs:0}),Is=new I.Ok(I.EF,"userKeyEncryptedPin",{deserializer:e=>e,clearOn:["logout"]});var bs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Bs="";var Es=i(84101),Ss=i(85184),Qs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},ks=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},Ts=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var Fs=i(75633);class Ps{}const Rs=1e5;var Ds=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ms=i(69554),xs=i(91059);class Os{}var Gs=i(29377);class Us{}var Vs=i(56962),js=i(83516),Ns=i(33413);class zs{}var Ys=i(66523),Ls=i(21551);class Ks{}var Xs=i(2471);class qs{}class Hs{openPopup(){throw new Error("Open Popup unsupported.")}}var Ws=i(48479),$s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Js{get client(){if(!this._client)throw new Error("IpcService not initialized. Call init() first.");return this._client}get messages$(){if(!this._messages$)throw new Error("IpcService not initialized. Call init() first.");return this._messages$}initWithClient(e){return $s(this,void 0,void 0,function*(){this._client=e,yield this._client.start(),this._messages$=new Ws.c(e=>{let t=!0;return(()=>{$s(this,void 0,void 0,function*(){const i=yield this.client.subscribe();for(;t;)try{const t=yield i.receive();e.next(t)}catch(n){e.error(n);break}})})(),()=>{t=!1}}).pipe((0,Bi.t)({bufferSize:0,refCount:!0}))})}send(e){return $s(this,void 0,void 0,function*(){yield this.client.send(e)})}}var Zs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const _s=I.Zs.record(I.hs,"ipcSessions",{deserializer:e=>e});class eo{constructor(e){this.stateProvider=e,this.states=this.stateProvider.getGlobal(_s)}get(e){return(0,u._)(this.states.state$.pipe((0,p.T)(t=>null==t?void 0:t[to(e)])))}save(e,t){return Zs(this,void 0,void 0,function*(){yield this.states.update(i=>Object.assign(Object.assign({},i),{[to(e)]:t}))})}remove(e){return Zs(this,void 0,void 0,function*(){yield this.states.update(t=>{const i=Object.assign({},t);return delete i[to(e)],i})})}}function to(e){return"object"==typeof e&&"Web"in e?`Web(${e.Web.id})`:e}var io=i(5819),no=i(47523);i(97948);new I.Zs(I.g4,"subUsers",{deserializer:e=>{if(null==e)return{};const t={};for(const[i,n]of Object.entries(e))t[i]=Array.isArray(n)?n:[];return t}});var ro=i(91566),so=i(63108),oo=i(1472);const ao=12e4;class lo{constructor(e){this.logService=e}redactMessage(e){const t="access_token=",i=e.indexOf(t);return-1!==i?e.substring(0,i+13)+"[REDACTED]":e}log(e,t){const i=`[SignalR] ${this.redactMessage(t)}`;switch(e){case ro.$.Critical:case ro.$.Error:this.logService.error(i);break;case ro.$.Warning:this.logService.warning(i);break;case ro.$.Information:this.logService.info(i);break;case ro.$.Debug:this.logService.debug(i)}}}class co{constructor(e,t,i,n=()=>new Kt.$,r=globalThis){this.apiService=e,this.logService=t,this.platformUtilsService=i,this.hubConnectionBuilderFactory=n,this.timeoutManager=r}connect$(e,t){if(!t.startsWith("https://")&&!this.platformUtilsService.isDev())throw new di;return new Ws.c(i=>{const n=this.hubConnectionBuilderFactory().withUrl(t+"/hub",{accessTokenFactory:()=>this.apiService.getActiveBearerToken(e),skipNegotiation:!0,transport:Xt.w.WebSockets}).withHubProtocol(new qt.E).configureLogging(new lo(this.logService)).build();n.on("ReceiveMessage",e=>{i.next({type:"ReceiveMessage",message:new Jt(e)})}),n.on("Heartbeat",()=>{i.next({type:"Heartbeat"})});let r=null;const s=()=>{if(null==n||n.state!==so.j.Disconnected||null!=r&&!r.closed)return;if(i.closed)return;const e=this.randomReconnectTime(),t=this.timeoutManager.setTimeout(()=>{n.start().then(()=>{r=null}).catch(()=>{s()})},e);r=new oo.yU(()=>this.timeoutManager.clearTimeout(t))};return n.onclose(e=>{s()}),n.start().catch(()=>{s()}),()=>{null==r||r.unsubscribe(),null==n||n.stop().catch(e=>{this.logService.error("Error while stopping SignalR connection",e)})}})}randomReconnectTime(){return Math.floor(180001*Math.random())+ao}}var uo=i(3097),ho=i(99969),Ao=i(55159);var po=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const go=new Set([st._n.AuthRequest,st._n.AutoConfirmMember]);class vo{supportStatus$(e){return(0,Ii.of)({type:"not-supported",reason:"client-not-supported"})}}class fo{}class mo{static from(e){var t,i;const n=new mo;return n.endpoint=e.endpoint,n.p256dh=null===(t=e.keys)||void 0===t?void 0:t.p256dh,n.auth=null===(i=e.keys)||void 0===i?void 0:i.auth,n}}var yo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Co{constructor(e,t){this.apiService=e,this.appIdService=t}putSubscription(e,t){return yo(this,void 0,void 0,function*(){const i=mo.from(e);yield this.apiService.send("POST",`/devices/identifier/${yield this.appIdService.getAppId()}/web-push-auth`,i,t,!1)})}}var wo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Io{constructor(e,t){this.storageService=e,this.logService=t}getAppId(){return wo(this,void 0,void 0,function*(){return this.logService.info("Retrieving application id"),yield this.getEnsuredValue("global_applicationId_appId")})}getAnonymousAppId(){return wo(this,void 0,void 0,function*(){return yield this.getEnsuredValue("global_applicationId_appId")})}getEnsuredValue(e){return wo(this,void 0,void 0,function*(){let t=yield this.storageService.get(e);return null==t&&(t=at.A.newGuid(),yield this.storageService.save(e,t)),t})}}var bo=i(39364);class Bo extends Se.r{constructor(e){super(e),this.featureStates={},null!=e&&(this.version=this.getResponseProperty("Version"),this.gitHash=this.getResponseProperty("GitHash"),this.server=new Qo(this.getResponseProperty("Server")),this.environment=new So(this.getResponseProperty("Environment")),this.featureStates=this.getResponseProperty("FeatureStates"),this.push=new Eo(this.getResponseProperty("Push")),this.settings=new bo.f(this.getResponseProperty("Settings")),this.communication=new ko(this.getResponseProperty("Communication")))}}class Eo extends Se.r{constructor(e=null){super(e),null!=e&&(this.pushTechnology=this.getResponseProperty("PushTechnology"),this.vapidPublicKey=this.getResponseProperty("VapidPublicKey"))}}class So extends Se.r{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 Qo extends Se.r{constructor(e=null){super(e),null!=e&&(this.name=this.getResponseProperty("Name"),this.url=this.getResponseProperty("Url"))}}class ko extends Se.r{constructor(e=null){super(e),null!=e&&(this.bootstrap=new To(this.getResponseProperty("Bootstrap")))}}class To extends Se.r{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"),this.idpLoginUrl=this.getResponseProperty("IdpLoginUrl"),this.cookieName=this.getResponseProperty("CookieName"),this.cookieDomain=this.getResponseProperty("CookieDomain"))}}var Fo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Po=i(2334),Ro=i(62627);var Do=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mo{static fromJSON(e){return Object.assign(new Mo,e)}}const xo=new I.Zs(I.ww,"environment",{deserializer:Mo.fromJSON}),Oo=new I.Ok(I.ww,"environment",{deserializer:Mo.fromJSON,clearOn:["logout"]}),Go=new I.Zs(I.Wm,"cloudRegion",{deserializer:e=>e}),Uo=new I.Ok(I.Wm,"cloudRegion",{deserializer:e=>e,clearOn:["logout"]}),Vo=[{key:Gs.T.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:Gs.T.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"}}],jo=Gs.T.US,No=Vo.find(e=>e.key===jo);class zo{constructor(e,t,i=[]){this.stateProvider=e,this.accountService=t,this.additionalRegionConfigs=i,this.activeAccountId$=this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)),this.globalState=this.stateProvider.getGlobal(xo),this.globalCloudRegionState=this.stateProvider.getGlobal(Go);const n=this.activeAccountId$.pipe((0,hi.F)((e,t)=>e==t));this.globalEnvironment$=this.stateProvider.getGlobal(xo).state$.pipe((0,p.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls)));const r=this.stateProvider.getGlobal(xo).state$;this.environment$=n.pipe((0,rt.n)(e=>e?this.stateProvider.getUser(e,Oo).state$.pipe((0,rt.n)(e=>null!=e?(0,Ii.of)(e):r)):r),(0,p.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls)));const s=this.stateProvider.getGlobal(Go).state$;this.cloudWebVaultUrl$=n.pipe((0,rt.n)(e=>e?this.stateProvider.getUser(e,Uo).state$.pipe((0,rt.n)(e=>null!=e?(0,Ii.of)(e):s)):s),(0,p.T)(e=>{if(null!=e){const t=this.getRegionConfig(e);if(null!=t)return t.urls.webVault}return No.urls.webVault}))}availableRegions(){return Vo.concat(this.additionalRegionConfigs)}getRegionConfig(e){return this.availableRegions().find(t=>t.key===e)}setEnvironment(e,t){return Do(this,void 0,void 0,function*(){return null==this.getRegionConfig(e)&&(e=Gs.T.SelfHosted),e==Gs.T.SelfHosted&&Lo(t)&&(e=jo),e!=Gs.T.SelfHosted?(yield this.globalState.update(()=>({region:e,urls:null})),null):(t.base=Yo(t.base),t.webVault=Yo(t.webVault),t.api=Yo(t.api),t.identity=Yo(t.identity),t.icons=Yo(t.icons),t.notifications=Yo(t.notifications),t.events=Yo(t.events),t.keyConnector=Yo(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=Gs.T.SelfHosted),e==Gs.T.SelfHosted&&Lo(t)&&(e=jo),e!=Gs.T.SelfHosted){const t=this.getRegionConfig(e);if(null!=t)return new Xo(t)}return new qo(t)}setCloudRegion(e,t){return Do(this,void 0,void 0,function*(){null==e?yield this.globalCloudRegionState.update(()=>t):yield this.stateProvider.getUser(e,Uo).update(()=>t)})}getEnvironment$(e){return this.stateProvider.getUser(e,Oo).state$.pipe((0,p.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls)))}getEnvironment(e){return Do(this,void 0,void 0,function*(){const t=null!=e?e:yield(0,u._)(this.activeAccountId$);return(0,u._)(this.getEnvironment$(t))})}seedUserEnvironment(e){return Do(this,void 0,void 0,function*(){const t=yield(0,u._)(this.globalState.state$);yield this.stateProvider.getUser(e,Oo).update(()=>t)})}}function Yo(e){return null==e||""===e?null:((e=e.replace(/\/+$/g,"")).startsWith("http://")||e.startsWith("https://")||(e="https://"+e),e.trim())}function Lo(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 Ko{constructor(e,t){this.region=e,this.urls=t,e==Gs.T.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!==Gs.T.SelfHosted}getUrl(e,t){return null!=this.urls[e]?this.urls[e]:this.urls.base?this.urls.base+t:No.urls[e]}}class Xo extends Ko{constructor(e){super(e.key,e.urls),this.config=e}getHostname(){return this.config.domain}}class qo extends Ko{constructor(e){super(Gs.T.SelfHosted,e)}getHostname(){return at.A.getHost(this.getWebVaultUrl())}}var Ho=i(62602),Wo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class $o{constructor(e,t){this.logService=e,this.apiService=t}upload(e,t,i){return Wo(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 Wo(this,void 0,void 0,function*(){const i=at.A.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"}),r=new Request(e,{body:t.buffer,cache:"no-store",method:"PUT",headers:n}),s=yield this.apiService.nativeFetch(r);if(201!==s.status)throw new Error(`Failed to create Azure blob: ${s.status}`)})}azureUploadBlocks(e,t,i){return Wo(this,void 0,void 0,function*(){const n=at.A.getUrl(e),r=this.getMaxBlockSize(n.searchParams.get("sv"));let s=0;const o=Math.ceil(t.buffer.byteLength/r),a=[];if(o>5e4)throw new Error("Cannot upload file, exceeds maximum size of "+5e4*r);try{for(;s<o;){e=yield this.renewUrlIfNecessary(e,i);const n=at.A.getUrl(e),o=this.encodedBlockId(s);n.searchParams.append("comp","block"),n.searchParams.append("blockid",o);const l=s*r,c=t.buffer.slice(l,l+r),d=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":n.searchParams.get("sv"),"Content-Length":c.byteLength.toString()}),u=new Request(n.toString(),{body:c,cache:"no-store",method:"PUT",headers:d}),h=yield this.apiService.nativeFetch(u);if(201!==h.status){const e=`Unsuccessful block PUT. Received status ${h.status}`;throw this.logService.error(e+"\n"+(yield h.json())),new Error(e)}a.push(o),s++}e=yield this.renewUrlIfNecessary(e,i);const n=at.A.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()}),d=new Request(n.toString(),{body:l,cache:"no-store",method:"PUT",headers:c}),u=yield this.apiService.nativeFetch(d);if(201!==u.status){const e=`Unsuccessful block list PUT. Received status ${u.status}`;throw this.logService.error(e+"\n"+(yield u.json())),new Error(e)}}catch(l){throw l}})}renewUrlIfNecessary(e,t){return Wo(this,void 0,void 0,function*(){var i;const n=at.A.getUrl(e),r=new Date(null!==(i=n.searchParams.get("se"))&&void 0!==i?i:"");return isNaN(r.getTime())&&r.setTime(Date.now()+36e5),r.getTime()<Date.now()+1e3?yield t():e})}encodedBlockId(e){const t=("000000000000000000000000000000000000000000000000"+e.toString()).slice(-48);return at.A.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 Jo.compare(e,"2019-12-12")>=0?4194304e3:Jo.compare(e,"2016-05-31")>=0?104857600:4194304}}class Jo{static compare(e,t){return"string"==typeof e&&(e=new Jo(e)),"string"==typeof t&&(t=new Jo(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 Jo.compare(this,e)}}var Zo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _o{upload(e,t,i){return Zo(this,void 0,void 0,function*(){const n=new FormData;if(at.A.isBrowser){const i=new Blob([t.buffer],{type:"application/octet-stream"});n.append("data",i,e)}else{if(!at.A.isNode)throw new Error("Unsupported environment");n.append("data",Buffer.from(t.buffer),{filename:e,contentType:"application/octet-stream"})}yield i(n)})}}var ea=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ta{build(){var e;return null!==(e=this.migrationBuilderCache)&&void 0!==e?e:this.migrationBuilderCache=(0,w.yT)()}}var ia=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class na{constructor(e,t,i,n){this.diskStorage=e,this.logService=t,this.migrationBuilderService=i,this.clientType=n}run(){return ia(this,void 0,void 0,function*(){const e=new w.Nb(yield(0,w.YO)(this.diskStorage,this.logService),this.diskStorage,this.logService,"general",this.clientType);if(e.currentVersion<0)return void(yield this.diskStorage.save("stateVersion",w.V_));const t=this.migrationBuilderService.build();yield t.migrate(e)})}waitForCompletion(){return ia(this,void 0,void 0,function*(){yield(0,w.GR)(this.diskStorage,this.logService)})}}var ra=i(73276),sa=i(30082),oa=i(50572),aa=i(72737),la=i(8029),ca=i(90586);class da{constructor(e){this.markedForDisposal=!1,this.refCount=0,this.value=e}take(){if(this.markedForDisposal)throw new Error("Cannot take a reference to a value marked for disposal");return this.refCount++,new ua(()=>this.release(),this.value)}markForDisposal(){this.markedForDisposal=!0,this.freeIfPossible()}release(){this.refCount--,this.freeIfPossible()}freeIfPossible(){0===this.refCount&&this.markedForDisposal&&this.value.free()}}class ua{constructor(e,t){this.release=e,this.value=t}[Symbol.dispose](){this.release()}}var ha=i(50451);const Aa=I.Ok.record(I.fn,"ciphers",{deserializer:e=>ha.A.fromJSON(e),clearOn:["logout"]}),pa=I.Ok.record(I.Xk,"decryptedCiphers",{deserializer:e=>Ar.f.fromJSON(e),clearOn:["logout","lock"]}),ga=I.Ok.array(I.Xk,"failedDecryptedCiphers",{deserializer:e=>Ar.f.fromJSON(e),clearOn:["logout","lock"]}),va=new I.Ok(I.HR,"localData",{deserializer:e=>e,clearOn:["logout"]}),fa=new I.Ok(I.Xk,"addEditCipherInfo",{deserializer:e=>{if(null==e)return null;return{cipher:null!=(null==e?void 0:e.cipher.toJSON)?e.cipher:Ar.f.fromJSON(null==e?void 0:e.cipher),collectionIds:e.collectionIds}},clearOn:["logout","lock"]});var ma=i(23293);class ya{userKeyDefinition(){return Aa}toSdk(e){return new ma.o(e).toSdkCipher()}fromSdk(e){return ma.o.fromSdkCipher(e).toCipherData()}}class Ca{userKeyDefinition(){return ws}toSdk(e){return e}fromSdk(e){return e}}const wa=I.Ok.record(I.Gg,"localUserDataKey",{deserializer:e=>e,clearOn:["logout"],cleanupDelayMs:0});class Ia{userKeyDefinition(){return wa}toSdk(e){return{wrapped_key:e}}fromSdk(e){return e.wrapped_key}}var ba=i(71464);class Ba{userKeyDefinition(){return ba.y}toSdk(e){return{decrypted_user_key:e.toBase64()}}fromSdk(e){return Ji.e.fromString(e.decrypted_user_key)}}var Ea=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Sa=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};function Qa(e,t,i){return Ea(this,void 0,void 0,function*(){t.register_client_managed_repositories({cipher:new ka(e,i,new ya),folder:null,user_key_state:new ka(e,i,new Ba),local_user_data_key_state:new ka(e,i,new Ia),ephemeral_pin_envelope_state:new ka(e,i,new Ca)})})}class ka{constructor(e,t,i){this.userId=e,this.stateProvider=t,this.mapper=i}get(e){return Ea(this,void 0,void 0,function*(){const t=(yield this.getRecord())[e];return t?this.mapper.toSdk(t):null})}list(){return Ea(this,void 0,void 0,function*(){const e=yield this.getRecord();return Object.values(e).map(e=>this.mapper.toSdk(e))})}set(e,t){return Ea(this,void 0,void 0,function*(){yield this.getUserState().update(i=>Object.assign(Object.assign({},null!=i?i:{}),{[e]:this.mapper.fromSdk(t)}))})}setBulk(e){return Ea(this,void 0,void 0,function*(){const t=Object.fromEntries(e.map(([e,t])=>[e,this.mapper.fromSdk(t)]));yield this.getUserState().update(e=>Object.assign(Object.assign({},null!=e?e:{}),t))})}remove(e){return Ea(this,void 0,void 0,function*(){yield this.getUserState().update(t=>{if(!t||!(e in t))return t;const i=t,n=e;i[n];return Sa(i,["symbol"==typeof n?n:n+""])})})}removeBulk(e){return Ea(this,void 0,void 0,function*(){yield this.getUserState().update(t=>{if(!t||!e.some(e=>e in t))return t;const i=new Set(e);return Object.fromEntries(Object.entries(t).filter(([e])=>!i.has(e)))})})}removeAll(){return Ea(this,void 0,void 0,function*(){yield this.getUserState().update(()=>({}))})}getUserState(){return this.stateProvider.getUser(this.userId,this.mapper.userKeyDefinition())}getRecord(){return Ea(this,void 0,void 0,function*(){return yield(0,u._)(this.getUserState().state$.pipe((0,p.T)(e=>null!=e?e:{})))})}}var Ta=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fa=Symbol("UnsetClient");class Pa{constructor(e,t){this.apiService=e,this.userId=t}get_access_token(){return Ta(this,void 0,void 0,function*(){if(null!=this.userId)return yield this.apiService.getActiveBearerToken(this.userId)})}}var Ra=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Da=Symbol("UnsetClient");class Ma{constructor(e,t){this.apiService=e,this.userId=t}get_access_token(){return Ra(this,void 0,void 0,function*(){if(null!=this.userId)return yield this.apiService.getActiveBearerToken(this.userId)})}}var xa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Oa{constructor(e){this.keyService=e}setUserKeyInMemoryIfAutoUserKeySet(e){return xa(this,void 0,void 0,function*(){if(null==e)return!1;const t=yield this.keyService.getUserKeyFromStorage($i.hq.Auto,e);return null!=t&&(yield this.keyService.setUserKey(t,e),!0)})}}var Ga=i(49272),Ua=i(52237);class Va{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,this.providerType=e.providerType}}const ja=Object.freeze({Text:0,File:1});class Na{constructor(e){null!=e&&(this.id=e.id,this.fileName=e.fileName,this.size=e.size,this.sizeName=e.sizeName)}}class za{constructor(e){null!=e&&(this.text=e.text,this.hidden=e.hidden)}}class Ya{constructor(e){if(null!=e)switch(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.authType=e.authType,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.emails=e.emails,this.disabled=e.disable,this.hideEmail=e.hideEmail,this.authType=e.authType,this.type){case ja.Text:this.text=new za(e.text);break;case ja.File:this.file=new Na(e.file)}}}class La{constructor(e){var t,i,n;this.name=null!==(t=e.name)&&void 0!==t?t:"",this.id=null!==(i=e.id)&&void 0!==i?i:"",this.revisionDate=null!==(n=e.revisionDate)&&void 0!==n?n:(new Date).toISOString()}static fromJSON(e){return null==e?null:new La({id:e.id,name:e.name,revisionDate:e.revisionDate})}}var Ka=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xa=new I.Ok(I.W$,"lastSync",{deserializer:e=>null!=e?new Date(e):null,clearOn:["logout"]});class qa{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){this.tokenService=e,this.folderService=t,this.folderApiService=i,this.messageSender=n,this.logService=r,this.cipherService=s,this.collectionService=o,this.apiService=a,this.accountService=l,this.authService=c,this.sendService=d,this.sendApiService=u,this.stateProvider=h,this.syncInProgress=!1}getLastSync(){return Ka(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));return null==e?null:yield(0,u._)(this.lastSync$(e))})}lastSync$(e){return this.stateProvider.getUser(e,Xa).state$}activeUserLastSync$(){return this.accountService.activeAccount$.pipe((0,rt.n)(e=>null==e?(0,Ii.of)(null):this.lastSync$(e.id)))}setLastSync(e,t){return Ka(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,Xa).update(()=>e)})}syncUpsertFolder(e,t,i){return Ka(this,void 0,void 0,function*(){this.syncStarted();if((yield(0,u._)(this.authService.authStatusFor$(i)))>=m.J.Locked)try{const n=yield this.folderService.get(e.id,i);if(!t&&null==n||t&&null!=n&&n.revisionDate<e.revisionDate){const t=yield this.folderApiService.get(e.id);if(null!=t)return yield this.folderService.upsert(new La(t),i),this.messageSender.send("syncedUpsertedFolder",{folderId:e.id}),this.syncCompleted(!0,i)}}catch(n){this.logService.error(n)}return this.syncCompleted(!1,i)})}syncDeleteFolder(e,t){return Ka(this,void 0,void 0,function*(){this.syncStarted();return(yield(0,u._)(this.authService.authStatusFor$(t)))>=m.J.Locked?(yield this.folderService.delete(e.id,t),this.messageSender.send("syncedDeletedFolder",{folderId:e.id}),this.syncCompleted(!0,t),!0):this.syncCompleted(!1,t)})}syncUpsertCipher(e,t,i){return Ka(this,void 0,void 0,function*(){this.syncStarted();if((yield(0,u._)(this.authService.authStatusFor$(i)))>=m.J.Locked)try{let n=!0;const r=yield this.cipherService.get(e.id,i);null!=r&&r.revisionDate>=e.revisionDate&&(n=!1);let s=!1;if(n&&(t?(n=null!=r,s=!0):null==e.collectionIds||null==e.organizationId?n=null==r:(n=!1,s=!0)),!n&&s&&null!=e.organizationId&&null!=e.collectionIds&&e.collectionIds.length>0){const t=yield(0,u._)(this.collectionService.encryptedCollections$(i).pipe((0,p.T)(e=>null!=e?e:[])));if(null!=t)for(let i=0;i<t.length;i++)if(e.collectionIds.indexOf(t[i].id)>-1){n=!0;break}}if(n){const t=yield this.apiService.getFullCipherDetails(e.id);if(null!=t)return yield this.cipherService.upsert(new ha.A(t)),this.messageSender.send("syncedUpsertedCipher",{cipherId:e.id}),this.syncCompleted(!0,i)}}catch(n){if(null!=n&&404===n.statusCode&&t)return yield this.cipherService.delete(e.id,i),this.messageSender.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0,i)}return this.syncCompleted(!1,i)})}syncDeleteCipher(e,t){return Ka(this,void 0,void 0,function*(){this.syncStarted();return(yield(0,u._)(this.authService.authStatusFor$(t)))>=m.J.Locked?(yield this.cipherService.delete(e.id,t),this.messageSender.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0,t)):this.syncCompleted(!1,t)})}syncUpsertSend(e,t){return Ka(this,void 0,void 0,function*(){this.syncStarted();const[i,n]=yield(0,u._)(this.accountService.activeAccount$.pipe((0,rt.n)(e=>(null==e&&(0,Ii.of)([null,m.J.LoggedOut]),this.authService.authStatusFor$(e.id).pipe((0,p.T)(t=>[e.id,t]))))));if(i===e.userId&&n!==m.J.LoggedOut)try{const n=yield(0,u._)(this.sendService.get$(e.id));if(!t&&null==n||t&&null!=n&&n.revisionDate<e.revisionDate){const t=yield this.sendApiService.getSend(e.id);if(null!=t)return yield this.sendService.upsert(new Ya(t)),this.messageSender.send("syncedUpsertedSend",{sendId:e.id}),this.syncCompleted(!0,i)}}catch(r){this.logService.error(r)}return this.syncCompleted(!1,void 0)})}syncDeleteSend(e){return Ka(this,void 0,void 0,function*(){this.syncStarted();const t=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));return null!=t&&(yield(0,u._)(this.tokenService.hasAccessToken$(t)))?(yield this.sendService.delete(e.id),this.messageSender.send("syncedDeletedSend",{sendId:e.id}),this.syncCompleted(!0,void 0),!0):this.syncCompleted(!1,void 0)})}syncStarted(){this.syncInProgress=!0,this.messageSender.send("syncStarted")}syncCompleted(e,t){return this.syncInProgress=!1,this.messageSender.send("syncCompleted",{successfully:e,userId:t}),e}}var Ha=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};Object.freeze({FirstOptionalButton:0,SecondOptionalButton:1,NotificationButton:2});var Wa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var $a=i(83234);class Ja{constructor(e){this.ids=null==e?[]:e}}class Za extends Se.r{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)}}class _a extends Se.r{constructor(e){super(e);const t=this.getResponseProperty("LastSyncDate");t&&(this.lastSyncDate=new Date(t))}}class el extends Se.r{constructor(e){super(e),this.isTokenValid=this.getResponseProperty("IsTokenValid"),this.isFreeFamilyPolicyEnabled=this.getResponseProperty("IsFreeFamilyPolicyEnabled")}}class tl extends g.IZ{}class il extends Se.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}var nl=i(95919);class rl extends Se.r{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 nl.n(this.getResponseProperty("Permissions"))}}class sl extends rl{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email")}}var ol=i(73409),al=i(9997),ll=i(68881),cl=i(65485),dl=i(1086),ul=i(78107),hl=i(27790),Al=i(62780),pl=i(82489);class gl extends Se.r{constructor(e){super(e),this.key=this.getResponseProperty("Key")}}class vl extends Se.r{constructor(e){super(e),this.token=this.getResponseProperty("Token")}}var fl=i(53674),ml=i(65791);class yl extends Se.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.publicKey=this.getResponseProperty("PublicKey")}}var Cl=i(42700);class wl extends Se.r{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 Cl.N(t),this.cipherMiniResponse=null==i?null:new Cl.N(i),this.url=this.getResponseProperty("Url")}}var Il=i(74865);class bl extends Se.r{constructor(e){super(e),this.cipher=new Cl.N(this.getResponseProperty("Cipher"))}}class Bl extends Se.r{constructor(e){super(e),this.unavailable=this.getResponseProperty("Unavailable"),this.cipher=new Cl.N(this.getResponseProperty("Cipher"))}}var El=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Sl{constructor(e,t,i,n,r,s,o,a,l,c,d=null){this.tokenService=e,this.platformUtilsService=t,this.environmentService=i,this.appIdService=n,this.refreshAccessTokenErrorCallback=r,this.logService=s,this.logoutCallback=o,this.vaultTimeoutSettingsService=a,this.accountService=l,this.httpOperations=c,this.customUserAgent=d,this.refreshTokenPromise={},this.middlewares=[],this.device=t.getDevice(),this.deviceType=this.device.toString()}postIdentityToken(e){return El(this,void 0,void 0,function*(){var t;const i=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&i.set("User-Agent",this.customUserAgent);const n=e instanceof cl.i?e.toIdentityToken():e.toIdentityToken(this.platformUtilsService.getClientType()),r=yield(0,u._)(this.environmentService.environment$),s=yield this.fetch(this.httpOperations.createRequest(r.getIdentityUrl()+"/connect/token",{body:this.qsStringify(n),credentials:yield this.getCredentials(r),cache:"no-store",headers:i,method:"POST"}));let o=null;if(this.isJsonResponse(s)&&(o=yield s.json()),null!=o){if(200===s.status)return new Al.L(o);if(400===s.status&&o.TwoFactorProviders2&&Object.keys(o.TwoFactorProviders2).length)return new pl.x(o);if(400===s.status&&(null===(t=null==o?void 0:o.ErrorModel)||void 0===t?void 0:t.Message)===Sl.NEW_DEVICE_VERIFICATION_REQUIRED_MESSAGE)return new ul.H(o);if(400===s.status&&(null==o?void 0:o.SsoOrganizationIdentifier))return new hl.u(o)}return Promise.reject(new ot._(o,s.status,!0))})}refreshIdentityToken(){return El(this,arguments,void 0,function*(e=null){const t=null!=e?e:e=yield this.getActiveUser();if(null==t)throw new Error("No user provided and no active user, cannot refresh the identity token.");try{yield this.refreshToken(t)}catch(i){throw this.logService.error("Error refreshing access token: ",i),i}})}getAuthRequest(e){return El(this,void 0,void 0,function*(){const t=`/auth-requests/${e}`,i=yield this.send("GET",t,null,!0,!0);return new dl.B(i)})}putAuthRequest(e,t){return El(this,void 0,void 0,function*(){const i=`/auth-requests/${e}`,n=yield this.send("PUT",i,t,!0,!0);return new dl.B(n)})}getAuthRequests(){return El(this,void 0,void 0,function*(){const e=yield this.send("GET","/auth-requests/",null,!0,!0);return new je.s(e,dl.B)})}getLastAuthRequest(){return El(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 El(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/profile",null,!0,!0);return new Ue.l(e)})}getUserSubscription(){return El(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/subscription",null,!0,!0);return new fl.X8(e)})}putProfile(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/accounts/profile",e,!0,!0);return new Ue.l(t)})}putAvatar(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/accounts/avatar",e,!0,!0);return new Ue.l(t)})}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 El(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)}postPremium(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/accounts/premium",e,!0,!0);return new Ve(t)})}postReinstatePremium(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)}postAccountStorage(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/accounts/storage",e,!0,!0);return new Ve(t)})}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)}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 El(this,void 0,void 0,function*(){return this.send("DELETE","/accounts/sso/"+e,null,!0,!1)})}getSsoUserIdentifier(){return El(this,void 0,void 0,function*(){return this.send("GET","/accounts/sso/user-identifier",null,!0,!0)})}postUserApiKey(e,t){return El(this,void 0,void 0,function*(){const e=yield this.send("POST","/accounts/api-key",t,!0,!0);return new Qe(e)})}postUserRotateApiKey(e,t){return El(this,void 0,void 0,function*(){const e=yield this.send("POST","/accounts/rotate-api-key",t,!0,!0);return new Qe(e)})}postConvertToKeyConnector(){return this.send("POST","/accounts/convert-to-key-connector",null,!0,!1)}getUserBillingHistory(){return El(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/billing/history",null,!0,!0);return new Oe(e)})}getCipher(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e,null,!0,!0);return new Cl.N(t)})}getFullCipherDetails(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e+"/details",null,!0,!0);return new Cl.N(t)})}getCipherAdmin(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e+"/admin",null,!0,!0);return new Cl.N(t)})}getCiphersOrganization(e,t){return El(this,void 0,void 0,function*(){let i="/ciphers/organization-details?organizationId="+e;t&&(i+=`&includeMemberItems=${t}`);const n=yield this.send("GET",i,null,!0,!0);return new je.s(n,Cl.N)})}postCipher(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers",e,!0,!0);return new Cl.N(t)})}postCipherCreate(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers/create",e,!0,!0);return new Cl.N(t)})}postCipherAdmin(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers/admin",e,!0,!0);return new Cl.N(t)})}putCipher(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e,t,!0,!0);return new Cl.N(i)})}putPartialCipher(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/partial",t,!0,!0);return new Cl.N(i)})}putCipherAdmin(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/admin",t,!0,!0);return new Cl.N(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 El(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/share",t,!0,!0);return new Cl.N(i)})}putShareCiphers(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/share",e,!0,!0);return new je.s(t,Cl.N)})}putCipherCollections(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/collections_v2",t,!0,!0);return new Bl(i)})}putCipherCollectionsAdmin(e,t){return this.send("PUT","/ciphers/"+e+"/collections-admin",t,!0,!0)}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 El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore",null,!0,!0);return new Cl.N(t)})}putRestoreCipherAdmin(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore-admin",null,!0,!0);return new Cl.N(t)})}putRestoreManyCiphers(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/restore",e,!0,!0);return new je.s(t,Cl.N)})}putRestoreManyCiphersAdmin(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/restore-admin",e,!0,!0);return new je.s(t,Cl.N)})}getAttachmentData(e,t,i){return El(this,void 0,void 0,function*(){const n=(null!=i?"/emergency-access/"+i+"/":"/ciphers/")+e+"/attachment/"+t,r=yield this.send("GET",n,null,!0,!0);return new Il.l(r)})}getAttachmentDataAdmin(e,t){return El(this,void 0,void 0,function*(){const i="/ciphers/"+e+"/attachment/"+t+"/admin",n=yield this.send("GET",i,null,!0,!0);return new Il.l(n)})}postCipherAttachment(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment/v2",t,!0,!0);return new wl(i)})}deleteCipherAttachment(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("DELETE","/ciphers/"+e+"/attachment/"+t,null,!0,!0);return new bl(i)})}deleteCipherAttachmentAdmin(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("DELETE","/ciphers/"+e+"/attachment/"+t+"/admin",null,!0,!0);return new bl(i)})}postShareCipherAttachment(e,t,i,n){return this.send("POST","/ciphers/"+e+"/attachment/"+t+"/share?organizationId="+n,i,!0,!1)}renewAttachmentUploadUrl(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("GET","/ciphers/"+e+"/attachment/"+t+"/renew",null,!0,!0);return new wl(i)})}postAttachmentFile(e,t,i){return this.send("POST","/ciphers/"+e+"/attachment/"+t,i,!0,!1)}getCollectionAccessDetails(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("GET","/organizations/"+e+"/collections/"+t+"/details",null,!0,!0);return new Ua.MH(i)})}getUserCollections(){return El(this,void 0,void 0,function*(){const e=yield this.send("GET","/collections",null,!0,!0);return new je.s(e,Ua.uF)})}getCollections(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/organizations/"+e+"/collections",null,!0,!0);return new je.s(t,Ua.uF)})}getManyCollectionsWithAccessDetails(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/organizations/"+e+"/collections/details",null,!0,!0);return new je.s(t,Ua.MH)})}getCollectionUsers(e,t){return El(this,void 0,void 0,function*(){return(yield this.send("GET","/organizations/"+e+"/collections/"+t+"/users",null,!0,!0)).map(e=>new ol.U(e))})}postCollection(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("POST","/organizations/"+e+"/collections",t,!0,!0);return new Ua.MH(i)})}putCollection(e,t,i){return El(this,void 0,void 0,function*(){const n=yield this.send("PUT","/organizations/"+e+"/collections/"+t,i,!0,!0);return new Ua.MH(n)})}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 Ja(t),!0,!1)}getGroupUsers(e,t){return El(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 El(this,void 0,void 0,function*(){const e=yield this.send("GET","/plans",null,!1,!0);return new je.s(e,Kn.tQ)})}getSettingsDomains(){return El(this,void 0,void 0,function*(){const e=yield this.send("GET","/settings/domains",null,!0,!0);return new ml.X(e)})}putSettingsDomains(e){return El(this,void 0,void 0,function*(){const t=yield this.send("PUT","/settings/domains",e,!0,!0);return new ml.X(t)})}getSync(){return El(this,void 0,void 0,function*(){const e=this.platformUtilsService.supportsAutofill()?"/sync":"/sync?excludeDomains=true",t=yield this.send("GET",e,null,!0,!0);return new Ga.f(t)})}getCloudCommunicationsEnabled(){return El(this,void 0,void 0,function*(){return yield this.send("GET","/organizations/connections/enabled",null,!0,!0)})}getOrganizationConnection(e,t,i){return El(this,void 0,void 0,function*(){const n=yield this.send("GET",`/organizations/connections/${e}/${t}`,null,!0,!0);return new Za(n,i)})}createOrganizationConnection(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("POST","/organizations/connections/",e,!0,!0);return new Za(i,t)})}updateOrganizationConnection(e,t,i){return El(this,void 0,void 0,function*(){const n=yield this.send("PUT","/organizations/connections/"+i,e,!0,!0);return new Za(n,t)})}deleteOrganizationConnection(e){return El(this,void 0,void 0,function*(){return this.send("DELETE","/organizations/connections/"+e,null,!0,!1)})}getProviderUsers(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/providers/"+e+"/users",null,!0,!0);return new je.s(t,sl)})}getProviderUser(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("GET","/providers/"+e+"/users/"+t,null,!0,!0);return new rl(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 El(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/reinvite",t,!0,!0);return new je.s(i,il)})}postProviderUserBulkConfirm(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/confirm",t,!0,!0);return new je.s(i,il)})}deleteManyProviderUsers(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("DELETE","/providers/"+e+"/users",t,!0,!0);return new je.s(i,il)})}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 El(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/public-keys",t,!0,!0);return new je.s(i,tl)})}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 El(this,void 0,void 0,function*(){const t=yield this.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new je.s(t,pt)})}postProviderAddOrganization(e,t){return this.send("POST","/providers/"+e+"/organizations/add",t,!0,!1)}postProviderCreateOrganization(e,t){return El(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/organizations",t,!0,!0);return new At(i)})}deleteProviderOrganization(e,t){return this.send("DELETE","/providers/"+e+"/organizations/"+t,null,!0,!1)}getEvents(e,t,i){return El(this,void 0,void 0,function*(){const n=yield this.send("GET",this.addEventParameters("/events",e,t,i),null,!0,!0);return new je.s(n,C.mm)})}getEventsCipher(e,t,i,n){return El(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/ciphers/"+e+"/events",t,i,n),null,!0,!0);return new je.s(r,C.mm)})}getEventsSecret(e,t,i,n,r){return El(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/secrets/"+t+"/events",i,n,r),null,!0,!0);return new je.s(s,C.mm)})}getEventsServiceAccount(e,t,i,n,r){return El(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/service-account/"+t+"/events",i,n,r),null,!0,!0);return new je.s(s,C.mm)})}getEventsProject(e,t,i,n,r){return El(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/projects/"+t+"/events",i,n,r),null,!0,!0);return new je.s(s,C.mm)})}getEventsOrganization(e,t,i,n){return El(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/events",t,i,n),null,!0,!0);return new je.s(r,C.mm)})}getEventsOrganizationUser(e,t,i,n,r){return El(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/users/"+t+"/events",i,n,r),null,!0,!0);return new je.s(s,C.mm)})}getEventsProvider(e,t,i,n){return El(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/providers/"+e+"/events",t,i,n),null,!0,!0);return new je.s(r,C.mm)})}getEventsProviderUser(e,t,i,n,r){return El(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/providers/"+e+"/users/"+t+"/events",i,n,r),null,!0,!0);return new je.s(s,C.mm)})}postEventsCollect(e,t){return El(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 r=yield(0,u._)(null==t?this.environmentService.environment$:this.environmentService.getEnvironment$(t));if(200!==(yield this.fetch(this.httpOperations.createRequest(r.getEventsUrl()+"/collect",{cache:"no-store",credentials:yield this.getCredentials(r),method:"POST",body:JSON.stringify(e),headers:n}))).status)return Promise.reject("Event post failed.")})}getUserPublicKey(e){return El(this,void 0,void 0,function*(){const t=yield this.send("GET","/users/"+e+"/public-key",null,!0,!0);return new yl(t)})}postBitPayInvoice(e){return El(this,void 0,void 0,function*(){return yield this.send("POST","/bitpay-invoice",e,!0,!0)})}postSetupPayment(){return El(this,void 0,void 0,function*(){return yield this.send("POST","/setup-payment",null,!0,!0)})}getMasterKeyFromKeyConnector(e){return El(this,void 0,void 0,function*(){const t=yield this.getActiveUser();if(null==t)throw new Error("No active user, cannot get master key from key connector.");const i=yield this.getActiveBearerToken(t),n=yield this.fetch(this.httpOperations.createRequest(e+"/user-keys",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+i})}));if(n.status!==st.kG.Ok){const e=yield this.handleApiRequestError(n,!0);return Promise.reject(e)}return new gl(yield n.json())})}postUserKeyToKeyConnector(e,t){return El(this,void 0,void 0,function*(){const i=yield this.getActiveUser();if(null==i)throw new Error("No active user, cannot post key to key connector.");const n=yield this.getActiveBearerToken(i),r=yield this.fetch(this.httpOperations.createRequest(e+"/user-keys",{cache:"no-store",method:"POST",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+n,"Content-Type":"application/json; charset=utf-8"}),body:JSON.stringify(t)}));if(r.status!==st.kG.Ok){const e=yield this.handleApiRequestError(r,!0);return Promise.reject(e)}})}getKeyConnectorAlive(e){return El(this,void 0,void 0,function*(){const t=yield this.fetch(this.httpOperations.createRequest(e+"/alive",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json","Content-Type":"application/json; charset=utf-8"})}));if(t.status!==st.kG.Ok){const e=yield this.handleApiRequestError(t,!0);return Promise.reject(e)}})}getActiveBearerToken(e){return El(this,void 0,void 0,function*(){let t=yield this.tokenService.getAccessToken(e);return(yield this.tokenService.tokenNeedsRefresh(e))&&(t=yield this.refreshToken(e)),t})}addMiddleware(e){this.middlewares.push(e)}fetch(e){return El(this,void 0,void 0,function*(){if(!e.url.startsWith("https://")&&!this.platformUtilsService.isDev())throw new di;"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());const t=yield this.platformUtilsService.packageType();null!=t&&e.headers.set("Bitwarden-Package-Type",t);const i=(n=this.middlewares,r=e=>this.nativeFetch(e),n.reduceRight((e,t)=>i=>t(i,e),r));var n,r;return i(e)})}nativeFetch(e){return fetch(e)}preValidateSso(e){return El(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,u._)(this.environmentService.environment$),n=`/sso/prevalidate?domainHint=${encodeURIComponent(e)}`,r=yield this.fetch(this.httpOperations.createRequest(i.getIdentityUrl()+n,{cache:"no-store",credentials:yield this.getCredentials(i),headers:t,method:"GET"}));if(200===r.status){const e=yield r.json();return new vl(e)}{const e=yield this.handleApiRequestError(r,!1);return Promise.reject(e)}})}postCreateSponsorship(e,t){return El(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 El(this,void 0,void 0,function*(){const t=yield this.send("GET","/organization/sponsorship/"+e+"/sync-status",null,!0,!0);return new _a(t)})}deleteRemoveSponsorship(e){return El(this,void 0,void 0,function*(){return yield this.send("DELETE","/organization/sponsorship/sponsored/"+e,null,!0,!1)})}postPreValidateSponsorshipToken(e){return El(this,void 0,void 0,function*(){const t=yield this.send("POST","/organization/sponsorship/validate-token?sponsorshipToken="+encodeURIComponent(e),null,!0,!0);return new el(t)})}postRedeemSponsorship(e,t){return El(this,void 0,void 0,function*(){return yield this.send("POST","/organization/sponsorship/redeem?sponsorshipToken="+encodeURIComponent(e),t,!0,!1)})}refreshToken(e){return void 0===this.refreshTokenPromise[e]&&(this.refreshTokenPromise[e]=this.internalRefreshToken(e),this.refreshTokenPromise[e].finally(()=>{delete this.refreshTokenPromise[e]})),this.refreshTokenPromise[e]}internalRefreshToken(e){return El(this,void 0,void 0,function*(){const t=yield this.tokenService.getRefreshToken(e);if(null!=t&&""!==t)return yield this.refreshAccessToken(e);const i=yield this.tokenService.getClientId(e),n=yield this.tokenService.getClientSecret(e);if(!at.A.isNullOrWhitespace(i)&&!at.A.isNullOrWhitespace(n))return yield this.refreshApiToken(e);throw this.refreshAccessTokenErrorCallback(),new Error("Cannot refresh access token, no refresh token or api keys are stored.")})}refreshAccessToken(e){return El(this,void 0,void 0,function*(){const t=yield this.tokenService.getRefreshToken(e);if(null==t||""===t)throw new Error;const i=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&i.set("User-Agent",this.customUserAgent);const n=yield(0,u._)(this.environmentService.getEnvironment$(e)),r=yield this.tokenService.decodeAccessToken(e),s=yield this.fetch(this.httpOperations.createRequest(n.getIdentityUrl()+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:r.client_id,refresh_token:t}),cache:"no-store",credentials:yield this.getCredentials(n),headers:i,method:"POST"}));if(200===s.status){const e=yield s.json(),t=new Al.L(e),i=(yield this.tokenService.decodeAccessToken(t.accessToken)).sub,n=yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(i)),r=yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(i));return(yield this.tokenService.setTokens(t.accessToken,n,r,t.refreshToken)).accessToken}{const e=yield this.handleTokenRefreshRequestError(s);return Promise.reject(e)}})}refreshApiToken(e){return El(this,void 0,void 0,function*(){const t=yield this.tokenService.getClientId(e),i=yield this.tokenService.getClientSecret(e),n=yield this.appIdService.getAppId(),r=new al.C(n,this.platformUtilsService),s=new cl.i(t,i,new ll.i,r),o=yield this.postIdentityToken(s);if(!(o instanceof Al.L))throw new Error("Invalid response received when refreshing api token");const a=yield this.tokenService.decodeAccessToken(o.accessToken);if(a.sub!==e)throw new Error(`Token was supposed to be refreshed for ${e} but the token we got back was for ${a.sub}`);const l=yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(e)),c=yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(e));return yield this.tokenService.setAccessToken(o.accessToken,l,c)})}send(e,t,i,n,r,s,o){return El(this,void 0,void 0,function*(){const a=yield this.getUserIdMakingRequest(n),l=yield(0,u._)(null==a?this.environmentService.environment$:this.environmentService.getEnvironment$(a));s=at.A.isNullOrWhitespace(s)?l.getApiUrl():s;const c=yield this.buildSafeApiRequestUrl(s,t);let d=yield this.buildRequest(e,a,l,r,i,o),h=yield this.fetch(this.httpOperations.createRequest(c,d));r&&null!=a&&h.status===st.kG.Unauthorized&&(this.logService.warning("Unauthorized response received for request to "+t+". Attempting request again."),d=yield this.buildRequest(e,a,l,r,i,o),h=yield this.fetch(this.httpOperations.createRequest(c,d)));const A=h.headers.get("content-type"),p=null!=A&&-1!==A.indexOf("application/json"),g=null!=A&&-1!==A.indexOf("text/csv");if(r&&h.status===st.kG.Ok&&p){return yield h.json()}if(r&&h.status===st.kG.Ok&&g)return yield h.text();if(h.status!==st.kG.Ok&&h.status!==st.kG.NoContent){const e=yield this.handleApiRequestError(h,null!=a);return Promise.reject(e)}})}buildSafeApiRequestUrl(e,t){const i=t.split("?"),n=e+i[0]+(i.length>1?`?${i[1]}`:"");if(at.A.containsTraversalIndicators(n))throw new Error("The request URL contains unexpected patterns.");return e+at.A.normalizePath(i[0])+(i.length>1?`?${i[1]}`:"")}getUserIdMakingRequest(e){return El(this,void 0,void 0,function*(){if(null==e)throw new Error("A user id was given but it was null, cannot complete API request.");let t=null;return"boolean"==typeof e&&e?t=yield this.getActiveUser():"string"==typeof e&&(t=e),t})}buildRequest(e,t,i,n,r,s){return El(this,void 0,void 0,function*(){const[o,a]=yield this.buildHeadersAndBody(t,n,r,s),l={cache:"no-store",credentials:yield this.getCredentials(i),method:e};return l.headers=o,l.body=a,l})}buildHeadersAndBody(e,t,i,n){return El(this,void 0,void 0,function*(){let r=null;const s=new Headers({"Device-Type":this.deviceType});if((0,no.U5)("prereleaseBuild")&&s.set("Is-Prerelease","1"),null!=this.customUserAgent&&s.set("User-Agent",this.customUserAgent),t&&s.set("Accept","application/json"),null!=n&&n(s),null!=e){const t=yield this.getActiveBearerToken(e);s.set("Authorization","Bearer "+t)}else{const e=yield this.appIdService.getAppId();s.set("Device-Identifier",e)}return null!=i&&("string"==typeof i?(r=i,s.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof i&&(i instanceof FormData?r=i:(s.set("Content-Type","application/json; charset=utf-8"),r=JSON.stringify(i)))),[s,r]})}handleApiRequestError(e,t){return El(this,void 0,void 0,function*(){!t||e.status!==st.kG.Unauthorized&&e.status!==st.kG.Forbidden||(yield this.logoutCallback("invalidAccessToken"));const i=yield this.getJsonResponse(e);return new ot._(i,e.status)})}handleTokenRefreshRequestError(e){return El(this,void 0,void 0,function*(){const t=yield this.getJsonResponse(e);return e.status===st.kG.BadRequest&&"invalid_grant"===(null==t?void 0:t.error)&&(yield this.logoutCallback("sessionExpired")),new ot._(t,e.status,!0)})}getJsonResponse(e){return El(this,void 0,void 0,function*(){let t=null;return this.isJsonResponse(e)?t=yield e.json():this.isTextPlainResponse(e)&&(t={Message:yield e.text()}),t})}qsStringify(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}getActiveUser(){return El(this,void 0,void 0,function*(){return yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)))})}getCredentials(e){return El(this,void 0,void 0,function*(){if(this.platformUtilsService.getClientType()!==st.sK.Web||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}isTextPlainResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("text/plain")>-1}}Sl.NEW_DEVICE_VERIFICATION_REQUIRED_MESSAGE="new device verification required";var Ql=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var kl=i(63457),Tl=i(17989);class Fl{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 Fl,e)}}class Pl{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 Pl,e)}}class Rl{constructor(e){this.id=null,this.accessId=null,this.name=null,this.notes=null,this.type=null,this.text=new Pl,this.file=new Fl,this.maxAccessCount=null,this.accessCount=0,this.revisionDate=null,this.deletionDate=null,this.expirationDate=null,this.password=null,this.emails=[],this.disabled=!1,this.hideEmail=!1,this.authType=null,e&&(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.authType=e.authType,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,this.authType=e.authType)}get urlB64Key(){return at.A.fromArrayToUrlB64(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 at.A.merge(Object.assign({},this),{key:at.A.fromBufferToB64(this.key)})}static fromJSON(e){return null==e?null:Object.assign(new Rl,e,{key:at.A.fromB64ToArray(e.key),cryptoKey:Ji.e.fromJSON(e.cryptoKey),text:Pl.fromJSON(e.text),file:Fl.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)})}}var Dl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ml extends Tl.A{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,sizeName:null,fileName:null},["id","sizeName"]))}decrypt(e){return Dl(this,void 0,void 0,function*(){return yield this.decryptObj(this,new Fl(this),["fileName"],e)})}static fromJSON(e){return null==e?null:Object.assign(new Ml,e,{fileName:Di.k.fromJSON(e.fileName)})}}class xl extends Tl.A{constructor(e){super(),null!=e&&(this.hidden=e.hidden,this.buildDomainModel(this,e,{text:null},[]))}decrypt(e){return this.decryptObj(this,new Pl(this),["text"],e)}static fromJSON(e){return null==e?null:Object.assign(new xl,e,{text:Di.k.fromJSON(e.text)})}}var Ol=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Gl extends Tl.A{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.authType=e.authType,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.authType=e.authType,this.emails=e.emails,this.type){case ja.Text:this.text=new xl(e.text);break;case ja.File:this.file=new Ml(e.file)}}decrypt(e){return Ol(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");const t=new Rl(this),i=at.A.getContainerService().getKeyService(),n=at.A.getContainerService().getEncryptService(),r=yield(0,u._)(i.userKey$(e));switch(t.key=yield n.decryptBytes(this.key,r),t.cryptoKey=yield i.makeSendKey(t.key),t.name=null!=this.name?yield n.decryptString(this.name,t.cryptoKey):null,t.notes=null!=this.notes?yield n.decryptString(this.notes,t.cryptoKey):null,null!=this.emails?t.emails=this.emails?this.emails.split(",").map(e=>e.trim()):[]:t.emails=[],this.type){case ja.File:t.file=yield this.file.decrypt(t.cryptoKey);break;case ja.Text:t.text=yield this.text.decrypt(t.cryptoKey)}return t})}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 Gl,e,{key:Di.k.fromJSON(e.key),name:Di.k.fromJSON(e.name),notes:Di.k.fromJSON(e.notes),emails:e.emails,text:xl.fromJSON(e.text),file:Ml.fromJSON(e.file),revisionDate:t,expirationDate:i,deletionDate:n})}}var Ul=i(41347),Vl=i(62046);class jl{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.emails=e.emails,this.disabled=e.disabled,this.hideEmail=e.hideEmail,this.authTYpe=e.authType,this.type){case ja.Text:this.text=new Vl.Y,this.text.text=null!=e.text.text?e.text.text.encryptedString:null,this.text.hidden=e.text.hidden;break;case ja.File:this.file=new Ul.h,this.file.fileName=null!=e.file.fileName?e.file.fileName.encryptedString:null}}}class Nl extends Se.r{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 Vl.Y(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new Ul.h(i)),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.creatorIdentifier=this.getResponseProperty("CreatorIdentifier")}}class zl extends Se.r{constructor(e){super(e),this.id=null,this.url=null,this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url")}}var Yl=i(54306);class Ll extends Se.r{constructor(e){super(e),this.url=null,this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("SendResponse");this.sendResponse=null==t?null:new Yl.o(t),this.url=this.getResponseProperty("Url")}}var Kl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Xl{}const ql=I.Ok.record(I.bj,"sendUserEncrypted",{deserializer:e=>e,clearOn:["logout"]}),Hl=new I.Ok(I.$g,"sendUserDecrypted",{deserializer:e=>e,clearOn:["lock"]});var Wl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class $l{}class Jl extends jl{constructor(e){super(e),this.id=e.id}}var Zl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _l{}class ec extends _l{}var tc=i(92411);class ic{}var nc=i(97212);class rc{}class sc{}var oc=i(41103),ac=i(63098),lc=i(4532);var cc=i(97432);const dc=I.Ok.array(I.i9,"notifications",{deserializer:e=>Wt.fromJSON(e),clearOn:["logout","lock"]});var uc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const hc=(0,p.T)(e=>Object.entries(null!=e?e:{}).filter(([,e])=>e>=m.J.Locked).map(([e])=>e));var Ac=i(11979),pc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},gc=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},vc=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var fc=i(62329),mc=i(31442),yc=i(7919),Cc=i(5571),wc=i(19488),Ic=i(84454),bc=i(77720),Bc=i(32072),Ec=i(21925),Sc=i(73386),Qc=i(50751),kc=i(47328);class Tc{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 Fc(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 Fc{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 Pc=i(67756);class Rc{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}class Dc{constructor(e,t){this.ids=null==e?[]:e,this.folderId=t}}class Mc{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}var xc=i(45113);class Oc extends xc.P{constructor({cipher:e,encryptedFor:t}){super({cipher:e,encryptedFor:t}),this.id=e.id}}class Gc{constructor(e,t,i){this.encryptedFor=i,null!=e&&(this.ciphers=[],e.forEach(e=>{this.ciphers.push(new Oc({cipher:e,encryptedFor:i}))})),this.collectionIds=t}}class Uc{constructor(e,t,i,n=!1){this.organizationId=e,this.cipherIds=t,this.collectionIds=i,this.removeCollections=n}}class Vc{constructor(e){this.collectionIds=null==e?[]:e}}class jc{constructor({cipher:e,encryptedFor:t}){this.cipher=new xc.P({cipher:e,encryptedFor:t}),this.collectionIds=e.collectionIds}}class Nc{constructor(e){this.folderId=e.folderId,this.favorite=e.favorite}}class zc{constructor({cipher:e,encryptedFor:t}){this.cipher=new xc.P({cipher:e,encryptedFor:t}),this.collectionIds=e.collectionIds}}var Yc=i(12022),Lc=i(61325),Kc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xc=new fc.SemVer("2024.2.0");class qc{constructor(e,t,i,n,r,s,o,a,l,c,u,A,g,v,f){this.keyService=e,this.domainSettingsService=t,this.apiService=i,this.i18nService=n,this.searchService=r,this.autofillSettingsService=s,this.encryptService=o,this.cipherFileUploadService=a,this.configService=l,this.stateProvider=c,this.accountService=u,this.logService=A,this.cipherEncryptionService=g,this.messageSender=v,this.cipherSdkService=f,this.sortedCiphersCache=new Tc(this.sortCiphersByLastUsed),this.clearCipherViewsForUser$=new d.B,this.sdkCipherCrudEnabled$=this.configService.getFeatureFlag$(dr.TO.PM27632_SdkCipherCrudOperations),this.cipherListViews$=(0,cc.j)(e=>{let t;return this.configService.getFeatureFlag$(dr.TO.PM22134SdkCipherListView).pipe((0,rt.n)(i=>i?(0,bi.z)([this.encryptedCiphersState(e).state$,this.localData$(e),this.keyService.cipherDecryptionKeys$(e,!0)]).pipe((0,h.p)(([e,t,i])=>null!=e&&null!=i),(0,p.T)(([e,t])=>Object.values(e).map(e=>new ma.o(e,null==t?void 0:t[e.id]))),(0,M.M)(()=>{t=performance.now()}),(0,rt.n)(t=>Kc(this,void 0,void 0,function*(){return yield this.decryptCiphersWithSdk(t,e,!1)})),(0,M.M)(([i,n])=>{Promise.all([this.setFailedDecryptedCiphers(n,e),this.searchService.indexCiphers(e,i)]),this.logService.measure(t,"Vault","CipherService","listView decrypt complete",[["Items",i.length]])}),(0,p.T)(([e])=>e)):this.cipherViews$(e)))},this.clearCipherViewsForUser$),this.cipherViews$=(0,cc.j)(e=>(0,bi.z)([this.encryptedCiphersState(e).state$,this.localData$(e),this.keyService.cipherDecryptionKeys$(e)]).pipe((0,h.p)(([e,t,i])=>null!=e&&null!=i),(0,rt.n)(()=>this.getAllDecrypted(e)),(0,M.M)(()=>{this.messageSender.send("updateOverlayCiphers")})),this.clearCipherViewsForUser$),this.failedToDecryptCiphers$=(0,cc.j)(e=>this.failedToDecryptCiphersState(e).state$.pipe((0,h.p)(e=>null!=e)),this.clearCipherViewsForUser$)}localData$(e){return this.localDataState(e).state$.pipe((0,p.T)(e=>null!=e?e:{}))}ciphers$(e){return this.encryptedCiphersState(e).state$.pipe((0,p.T)(e=>null!=e?e:{}))}addEditCipherInfo$(e){return this.addEditCipherInfoState(e).state$}setDecryptedCipherCache(e,t){return Kc(this,void 0,void 0,function*(){null!=e&&0===e.length||(yield this.setDecryptedCiphers(e,t)),null!=this.searchService&&(null==e?yield this.searchService.clearIndex(t):this.searchService.indexCiphers(t,e))})}setFailedDecryptedCiphers(e,t){return Kc(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(ga,e,t)})}setDecryptedCiphers(e,t){return Kc(this,void 0,void 0,function*(){const i={};null==e||e.forEach(e=>{i[e.id]=e}),yield this.stateProvider.setUserState(pa,i,t)})}clearCache(e){return Kc(this,void 0,void 0,function*(){const t=yield(0,u._)(this.stateProvider.activeUserId$);null!=e||(e=t),yield this.clearDecryptedCiphersState(e),this.clearCipherViewsForUser$.next(e)})}adjustCipherHistory(e,t,i){return Kc(this,void 0,void 0,function*(){null!=e.id&&(null==i&&(i=yield this.get(e.id,t)),null!=i&&(yield this.updateModelfromExistingCipher(e,i,t)),this.adjustPasswordHistoryLength(e))})}encrypt(e,t,i,n){return Kc(this,arguments,void 0,function*(e,t,i,n,r=null){var s;yield this.adjustCipherHistory(e,t,r);if((yield this.configService.getFeatureFlag(dr.TO.PM22136_SdkCipherEncryption))&&null==i&&null==n)return yield this.cipherEncryptionService.encrypt(e,t);const o=new ma.o;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.creationDate=e.creationDate,o.revisionDate=e.revisionDate,o.archivedDate=e.archivedDate,o.reprompt=e.reprompt,o.edit=e.edit,o.viewPassword=e.viewPassword,e.viewPassword&&(yield this.getCipherKeyEncryptionEnabled())||(null==r?void 0:r.key)){o.key=null!==(s=null==r?void 0:r.key)&&void 0!==s?s:null;const a=yield this.getKeyForCipherKeyDecryption(o,t);return i||(i=a),n||(n=a),{cipher:yield this.encryptCipherWithCipherKey(e,o,i,n),encryptedFor:t}}return i||(i=yield this.getKeyForCipherKeyDecryption(o,t)),o.key=null,{cipher:yield this.encryptCipher(e,o,i),encryptedFor:t}})}encryptMany(e,t){return Kc(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(dr.TO.PM22136_SdkCipherEncryption))return yield this.cipherEncryptionService.encryptMany(e,t);const i=[];for(const n of e){const e=yield this.encrypt(n,t);i.push(e)}return i})}encryptAttachments(e,t){return Kc(this,void 0,void 0,function*(){if(null==e||0===e.length)return null;const i=[],n=[];return e.forEach(e=>Kc(this,void 0,void 0,function*(){const r=new Cc.o;r.id=e.id,r.size=e.size,r.sizeName=e.sizeName,r.url=e.url;const s=this.encryptObjProperty(e,r,{fileName:null},t).then(()=>Kc(this,void 0,void 0,function*(){null!=e.key&&(r.key=yield this.encryptService.wrapSymmetricKey(e.key,t)),n.push(r)}));i.push(s)})),yield Promise.all(i),n})}encryptFields(e,t){return Kc(this,void 0,void 0,function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce((e,r)=>Kc(this,void 0,void 0,function*(){yield e;const s=yield i.encryptField(r,t);n.push(s)}),Promise.resolve()),n})}encryptField(e,t){return Kc(this,void 0,void 0,function*(){const i=new bc.D;return i.type=e.type,i.linkedId=e.linkedId,e.type===mc.PU.Boolean&&"true"!==e.value&&(e.value="false"),yield this.encryptObjProperty(e,i,{name:null,value:null},t),i})}encryptPasswordHistories(e,t){return Kc(this,void 0,void 0,function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce((e,r)=>Kc(this,void 0,void 0,function*(){yield e;const s=yield i.encryptPasswordHistory(r,t);n.push(s)}),Promise.resolve()),n})}encryptPasswordHistory(e,t){return Kc(this,void 0,void 0,function*(){const i=new Qc._;return i.lastUsedDate=e.lastUsedDate,yield this.encryptObjProperty(e,i,{password:null},t),i})}get(e,t){return Kc(this,void 0,void 0,function*(){const i=yield(0,u._)(this.ciphers$(t));if(null==i||!i.hasOwnProperty(e))return null;const n=yield(0,u._)(this.localData$(t)),r=e;return new ma.o(i[r],n?n[r]:null)})}getAll(e){return Kc(this,void 0,void 0,function*(){const t=yield(0,u._)(this.localData$(e)),i=yield(0,u._)(this.ciphers$(e)),n=[];for(const e in i)if(i.hasOwnProperty(e)){const r=e;n.push(new ma.o(i[r],t?t[r]:null))}return n})}getAllDecrypted(e){return Kc(this,void 0,void 0,function*(){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return this.getAllDecryptedUsingSdk(e);const t=yield this.getDecryptedCiphers(e);if(null!=t&&0!==t.length)return yield this.reindexCiphers(e),t;const i=yield this.decryptCiphers(yield this.getAll(e),e);if(null==i)return[];const[n,r]=i;return yield this.setDecryptedCipherCache(n,e),yield this.setFailedDecryptedCiphers(r,e),n})}getAllDecryptedUsingSdk(e){return Kc(this,void 0,void 0,function*(){try{const t=yield this.cipherSdkService.getAllDecrypted(e);return yield this.setDecryptedCipherCache(t.successes,e),yield this.setFailedDecryptedCiphers(t.failures,e),t.successes}catch(t){return[]}})}getDecryptedCiphers(e){return Kc(this,void 0,void 0,function*(){return Object.values(yield(0,u._)(this.decryptedCiphersState(e).state$.pipe((0,p.T)(e=>null!=e?e:{}))))})}decryptCiphers(e,t){return Kc(this,void 0,void 0,function*(){if(0===e.length)return[[],[]];if(yield this.configService.getFeatureFlag(dr.TO.PM19941MigrateCipherDomainToSdk)){const i=performance.now(),n=yield this.decryptCiphersWithSdk(e,t,!0);return this.logService.measure(i,"Vault","CipherService","decrypt complete",[["Items",e.length]]),n}const i=yield(0,u._)(this.keyService.cipherDecryptionKeys$(t));if(null==i||null==i.userKey&&0===Object.keys(i.orgKeys).length)return null;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},{}),r=performance.now(),s=(yield Promise.all(Object.entries(n).map(e=>Kc(this,[e],void 0,function*([e,t]){var n;const r=null!==(n=i.orgKeys[e])&&void 0!==n?n:i.userKey;return yield Promise.all(t.map(e=>Kc(this,void 0,void 0,function*(){return yield e.decrypt(r)})))})))).flat().sort(this.getLocaleSortingFunction());return this.logService.measure(r,"Vault","CipherService","decrypt complete",[["Items",e.length]]),s.reduce((e,t)=>(t.decryptionFailure?e[1].push(t):e[0].push(t),e),[[],[]])})}decrypt(e,t){return Kc(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(dr.TO.PM19941MigrateCipherDomainToSdk))return yield this.cipherEncryptionService.decrypt(e,t);{const i=yield this.getKeyForCipherKeyDecryption(e,t);return yield e.decrypt(i)}})}reindexCiphers(e){return Kc(this,void 0,void 0,function*(){var t;null!=this.searchService&&(null!==(t=yield(0,u._)(this.searchService.indexedEntityId$(e)))&&void 0!==t?t:e)!==e&&(yield this.searchService.indexCiphers(e,yield this.getDecryptedCiphers(e),e))})}getAllDecryptedForGrouping(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!0){return(yield this.getAllDecrypted(t)).filter(t=>!t.isDeleted&&(!(!i||t.folderId!==e)||!i&&null!=t.collectionIds&&t.collectionIds.indexOf(e)>-1))})}getAllDecryptedForUrl(e,t,i){return Kc(this,arguments,void 0,function*(e,t,i,n=null,r){return yield(0,u._)(this.cipherViews$(t).pipe((0,h.p)(e=>null!=e),(0,rt.n)(t=>Kc(this,void 0,void 0,function*(){return yield this.filterCiphersForUrl(t,e,i,n,r)}))))})}getAllDecryptedForIds(e,t){return Kc(this,void 0,void 0,function*(){return(0,u._)(this.cipherViews$(e).pipe((0,h.p)(e=>null!=e),(0,p.T)(e=>e.filter(e=>t.includes(e.id)))))})}filterCiphersForUrl(e,t,i){return Kc(this,arguments,void 0,function*(e,t,i,n=null,r){if(null==t&&null==i)return[];const s=yield(0,u._)(this.domainSettingsService.getUrlEquivalentDomains(t));return null!=n||(n=yield(0,u._)(this.domainSettingsService.resolvedDefaultUriMatchStrategy$)),e.filter(e=>{const o=Lc.n.getType(e),a=null!==Lc.n.getLogin(e);return!Lc.n.isDeleted(e)&&(!Lc.n.isArchived(e)&&(!(!Array.isArray(i)||!i.includes(o)||a)||!!a&&Lc.n.matchesUri(e,t,s,n,r)))})})}getAllDecryptedCiphersOfType(e,t){return Kc(this,void 0,void 0,function*(){return(yield this.getAllDecrypted(t)).filter(t=>null==t.deletedDate&&!t.isArchived&&e.includes(t.type)).sort((e,t)=>this.sortCiphersByLastUsedThenName(e,t))})}getAllFromApiForOrganization(e,t){return Kc(this,void 0,void 0,function*(){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return this.getAllFromApiForOrganizationUsingSdk(e,null!=t&&t);const i=yield this.apiService.getCiphersOrganization(e,t);return yield this.decryptOrganizationCiphersResponse(i,e)})}getAllFromApiForOrganizationUsingSdk(e,t){return Kc(this,void 0,void 0,function*(){const i=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));if(!i)throw new Error("User ID is required");try{const[n]=yield this.cipherSdkService.getAllFromApiForOrganization(e,i,t),[r]=yield this.cipherEncryptionService.decryptManyLegacy(n,i);return r.sort(this.getLocaleSortingFunction()),r}catch(n){return[]}})}getManyFromApiForOrganization(e){return Kc(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/ciphers/organization-details/assigned?organizationId="+e,null,!0,!0),i=new je.s(t,Cl.N);return this.decryptOrganizationCiphersResponse(i,e)})}decryptOrganizationCiphersResponse(e,t){return Kc(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 ma.o(new ha.A(e))),n=yield this.keyService.getOrgKey(t),r=yield Promise.all(i.map(e=>Kc(this,void 0,void 0,function*(){return yield e.decrypt(n)})));return r.sort(this.getLocaleSortingFunction()),r})}getLastUsedForUrl(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1){return this.getCipherForUrl(e,t,!0,!1,i)})}getLastLaunchedForUrl(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1){return this.getCipherForUrl(e,t,!1,!0,i)})}getNextCipherForUrl(e,t){return Kc(this,void 0,void 0,function*(){return this.getCipherForUrl(e,t,!1,!1,!1)})}getNextCardCipher(e){return Kc(this,void 0,void 0,function*(){const t="cardCiphers";if(!this.sortedCiphersCache.isCached(t)){const i=yield this.getAllDecryptedCiphersOfType([yc.gC.Card],e);if(!(null==i?void 0:i.length))return null;this.sortedCiphersCache.addCiphers(t,i)}return this.sortedCiphersCache.getNext(t)})}getNextIdentityCipher(e){return Kc(this,void 0,void 0,function*(){const t="identityCiphers";if(!this.sortedCiphersCache.isCached(t)){const i=yield this.getAllDecryptedCiphersOfType([yc.gC.Identity],e);if(!(null==i?void 0:i.length))return null;this.sortedCiphersCache.addCiphers(t,i)}return this.sortedCiphersCache.getNext(t)})}updateLastUsedIndexForUrl(e){this.sortedCiphersCache.updateLastUsedIndex(e)}updateLastUsedDate(e,t){return Kc(this,void 0,void 0,function*(){let i=yield(0,u._)(this.localData$(t));i||(i={});const n=e;i[n]?i[n].lastUsedDate=(new Date).getTime():i[n]={lastUsedDate:(new Date).getTime()},yield this.localDataState(t).update(()=>i);const r=yield this.getDecryptedCiphers(t);if(r){for(let t=0;t<r.length;t++){const n=r[t];if(n.id===e){n.localData=i[e];break}}yield this.setDecryptedCiphers(r,t)}})}updateLastLaunchedDate(e,t){return Kc(this,void 0,void 0,function*(){let i=yield(0,u._)(this.localData$(t));i||(i={});const n=(new Date).getTime();i[e]={lastLaunched:n,lastUsedDate:n},yield this.localDataState(t).update(()=>i);const r=yield this.getDecryptedCiphers(t);if(r){for(let t=0;t<r.length;t++){const n=r[t];if(n.id===e){n.localData=i[e];break}}yield this.setDecryptedCiphers(r,t)}})}saveNeverDomain(e){return Kc(this,void 0,void 0,function*(){if(null==e)return;let t=yield(0,u._)(this.domainSettingsService.neverDomains$);t||(t={}),t[e]=null,yield this.domainSettingsService.setNeverDomains(t)})}createWithServer(e,t,i){return Kc(this,void 0,void 0,function*(){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return(yield this.createWithServerUsingSdk(e,t,i))||new Ar.f;const n=yield this.encrypt(e,t),r=yield this.createWithServerLegacy(n,i);return yield this.decrypt(r,t)})}createWithServerUsingSdk(e,t,i){return Kc(this,void 0,void 0,function*(){yield this.clearCache(t);return yield this.cipherSdkService.createWithServer(e,t,i)})}createWithServerLegacy(e,t){return Kc(this,arguments,void 0,function*({cipher:e,encryptedFor:t},i){let n;if(i&&null!=e.organizationId){const i=new jc({cipher:e,encryptedFor:t});n=yield this.apiService.postCipherAdmin(i);const r=new ha.A(n,e.collectionIds);return new ma.o(r)}if(null!=e.collectionIds&&e.collectionIds.length>0){const i=new jc({cipher:e,encryptedFor:t});n=yield this.apiService.postCipherCreate(i)}else{const i=new xc.P({cipher:e,encryptedFor:t});n=yield this.apiService.postCipher(i)}e.id=n.id;const r=new ha.A(n,e.collectionIds),s=yield this.upsert(r);return new ma.o(s[e.id])})}updateWithServer(e,t,i,n){return Kc(this,void 0,void 0,function*(){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.updateWithServerUsingSdk(e,t,i,n);const r=yield this.encrypt(e,t),s=yield this.updateWithServerLegacy(r,n);return yield this.decrypt(s,t)})}updateWithServerUsingSdk(e,t,i,n){return Kc(this,void 0,void 0,function*(){yield this.clearCache(t);return yield this.cipherSdkService.updateWithServer(e,t,i,n)})}updateWithServerLegacy(e,t){return Kc(this,arguments,void 0,function*({cipher:e,encryptedFor:t},i){let n;if(i){const i=new xc.P({cipher:e,encryptedFor:t});n=yield this.apiService.putCipherAdmin(e.id,i);const r=new ha.A(n,e.collectionIds);return new ma.o(r,e.localData)}if(e.edit){const i=new xc.P({cipher:e,encryptedFor:t});n=yield this.apiService.putCipher(e.id,i)}else{const t=new Nc(e);n=yield this.apiService.putPartialCipher(e.id,t)}const r=new ha.A(n,e.collectionIds),s=yield this.upsert(r);return new ma.o(s[e.id],e.localData)})}shareWithServer(e,t,i,n,r){return Kc(this,void 0,void 0,function*(){const s=yield this.configService.getFeatureFlag(dr.TO.PM22136_SdkCipherEncryption);let o;if(yield this.adjustCipherHistory(e,n,r),s){if(null!=e.organizationId)throw new Error("Cipher is already associated with an organization.");o=yield this.cipherEncryptionService.moveToOrganization(e,t,n),o.cipher.collectionIds=i}else{const r=[];null!=e.attachments&&e.attachments.forEach(i=>{null==i.key&&r.push(this.shareAttachmentWithServer(i,e.id,t,e.revisionDate))}),yield Promise.all(r),e.organizationId=t,e.collectionIds=i,o=yield this.encryptSharedCipher(e,n)}const a=new zc(o),l=yield this.apiService.putShareCipher(e.id,a),c=new ha.A(l,i);return yield this.upsert(c),new ma.o(c,e.localData)})}shareManyWithServer(e,t,i,n){return Kc(this,void 0,void 0,function*(){const r=yield this.configService.getFeatureFlag(dr.TO.PM22136_SdkCipherEncryption),s=[],o=[];for(const c of e)if(r){if(null!=c.organizationId)throw new Error("Cipher is already associated with an organization.");s.push(this.cipherEncryptionService.moveToOrganization(c,t,n).then(e=>{e.cipher.collectionIds=i,o.push(e.cipher)}))}else c.organizationId=t,c.collectionIds=i,s.push(this.encryptSharedCipher(c,n).then(e=>{o.push(e.cipher)}));yield Promise.all(s);const a=new Gc(o,i,n);try{const e=yield this.apiService.putShareCiphers(a),t=new Map(e.data.map(e=>[e.id,e]));o.forEach(e=>{const i=t.get(e.id);i&&(e.revisionDate=new Date(i.revisionDate))}),yield this.upsert(o.map(e=>e.toCipherData()))}catch(l){for(const t of e)t.organizationId=null,t.collectionIds=null;throw l}})}saveAttachmentWithServer(e,t,i,n=!1){return new Promise((r,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>Kc(this,void 0,void 0,function*(){try{const s=yield this.saveAttachmentRawWithServer(e,t.name,o.target.result,i,n);r(s)}catch(a){s(a)}}),o.onerror=()=>{s("Error reading file.")}})}saveAttachmentRawWithServer(e,t,i,n){return Kc(this,arguments,void 0,function*(e,t,i,n,r=!1){const s=yield this.getKeyForCipherKeyDecryption(e,n),o=null!=e.key?yield this.encryptService.unwrapSymmetricKey(e.key,s):s,a=yield this.encryptService.encryptString(t,o),l=yield this.keyService.makeDataEncKey(o),c=yield this.encryptService.encryptFileData(new Uint8Array(i),l[0]),d=yield this.cipherFileUploadService.upload(e,a,c,r,l),u=new ha.A(d,e.collectionIds);return r||(yield this.upsert(u)),new ma.o(u)})}saveCollectionsWithServer(e,t){return Kc(this,void 0,void 0,function*(){const i=new Vc(e.collectionIds),n=yield this.apiService.putCipherCollections(e.id,i);if(n.unavailable)return void(yield this.delete(e.id,t));const r=new ha.A(n.cipher),s=yield this.upsert(r);return new ma.o(s[e.id],e.localData)})}saveCollectionsWithServerAdmin(e){return Kc(this,void 0,void 0,function*(){const t=new Vc(e.collectionIds),i=yield this.apiService.putCipherCollectionsAdmin(e.id,t),n=new Cl.N(i);n.edit=!0,n.viewPassword=!0,n.favorite=!1;const r=new ha.A(n);return new ma.o(r)})}bulkUpdateCollectionsWithServer(e,t,i,n){return Kc(this,arguments,void 0,function*(e,t,i,n,r=!1){var s,o;const a=new Uc(e,i,n,r);yield this.apiService.send("POST","/ciphers/bulk-collections",a,!0,!1);const l=yield(0,u._)(this.ciphers$(t));for(const c of i){const e=l[c];e&&(e.collectionIds=r?null===(s=e.collectionIds)||void 0===s?void 0:s.filter(e=>!n.includes(e)):[...new Set([...null!==(o=e.collectionIds)&&void 0!==o?o:[],...n])])}yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>l)})}upsert(e,t){return Kc(this,void 0,void 0,function*(){const i=e instanceof ha.A?[e]:e,n=yield this.updateEncryptedCipherState(e=>(i.forEach(t=>e[t.id]=t),e),t);return yield new Promise(e=>setTimeout(e,0)),n})}replace(e,t){return Kc(this,void 0,void 0,function*(){var i;const n=null!==(i=yield(0,u._)(this.encryptedCiphersState(t).state$))&&void 0!==i?i:{};Object.keys(n).length>0&&JSON.stringify(n)===JSON.stringify(e)||(yield this.updateEncryptedCipherState(()=>e,t))})}updateEncryptedCipherState(e){return Kc(this,arguments,void 0,function*(e,t=null){t||(t=yield(0,u._)(this.stateProvider.activeUserId$)),yield this.clearCache(t);const i=yield this.stateProvider.getUser(t,Aa).update(t=>e(null!=t?t:{}));return yield new Promise(e=>setTimeout(e,0)),i})}clear(e){return Kc(this,void 0,void 0,function*(){null!=e||(e=yield(0,u._)(this.stateProvider.activeUserId$)),yield this.clearEncryptedCiphersState(e),yield this.clearCache(e)})}moveManyWithServer(e,t,i){return Kc(this,void 0,void 0,function*(){yield this.apiService.putMoveCiphers(new Dc(e,t));let n=yield(0,u._)(this.ciphers$(i));null==n&&(n={}),e.forEach(e=>{n.hasOwnProperty(e)&&(n[e].folderId=t)}),yield this.clearCache(),yield this.encryptedCiphersState(i).update(()=>n)})}delete(e,t){return Kc(this,void 0,void 0,function*(){const i=yield(0,u._)(this.ciphers$(t));if(null!=i){if("string"==typeof e){const t=e;if(null==i[t])return;delete i[t]}else e.forEach(e=>{delete i[e]});yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>i)}})}deleteWithServer(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.deleteWithServer(e,t,i));i?yield this.apiService.deleteCipherAdmin(e):yield this.apiService.deleteCipher(e),yield this.delete(e,t)})}deleteManyWithServer(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1,n){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.deleteManyWithServer(e,t,i,n));const r=new Rc(e,n);i?yield this.apiService.deleteManyCiphersAdmin(r):yield this.apiService.deleteManyCiphers(r),yield this.delete(e,t)})}deleteAttachment(e,t,i,n){return Kc(this,void 0,void 0,function*(){let r=yield(0,u._)(this.ciphers$(n));const s=e;if(null!=r&&r.hasOwnProperty(e)&&null!=r[s].attachments){for(let e=0;e<r[s].attachments.length;e++)r[s].attachments[e].id===i&&r[s].attachments.splice(e,1);return r[s].revisionDate=t,yield this.clearCache(),yield this.encryptedCiphersState(n).update(()=>(null==r&&(r={}),r)),r[s]}})}deleteAttachmentWithServer(e,t,i){return Kc(this,arguments,void 0,function*(e,t,i,n=!1){let r;try{r=n?yield this.apiService.deleteCipherAttachmentAdmin(e,t):yield this.apiService.deleteCipherAttachment(e,t)}catch(o){return Promise.reject(o.getSingleMessage())}const s=new ha.A(r.cipher);return yield this.deleteAttachment(e,s.revisionDate,t,i)})}sortCiphersByLastUsed(e,t){const i=e.localData&&e.localData.lastUsedDate?e.localData.lastUsedDate:null,n=t.localData&&t.localData.lastUsedDate?t.localData.lastUsedDate:null,r=null!=i&&null!=n;return r&&i<n?1:null!=i&&null==n||r&&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 r=this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n),s=Lc.n.getType(e),o=Lc.n.getType(t);if(0!==r||s!==yc.gC.Login||o!==yc.gC.Login)return r;const a=Lc.n.getLogin(e),l=Lc.n.getLogin(t);return null!=a.username&&(i+=a.username),null!=l.username&&(n+=l.username),this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n)}}softDelete(e,t){return Kc(this,void 0,void 0,function*(){let i=yield(0,u._)(this.ciphers$(t));if(null==i)return;const n=e=>{null!=i[e]&&(i[e].deletedDate=(new Date).toISOString())};"string"==typeof e?n(e):e.forEach(n),yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>(null==i&&(i={}),i))})}softDeleteWithServer(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.softDeleteWithServer(e,t,i));i?yield this.apiService.putDeleteCipherAdmin(e):yield this.apiService.putDeleteCipher(e),yield this.softDelete(e,t)})}softDeleteManyWithServer(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1,n){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.softDeleteManyWithServer(e,t,i,n));const r=new Rc(e,n);i?yield this.apiService.putDeleteManyCiphersAdmin(r):yield this.apiService.putDeleteManyCiphers(r),yield this.softDelete(e,t)})}restore(e,t){return Kc(this,void 0,void 0,function*(){let i=yield(0,u._)(this.ciphers$(t));if(null==i)return;const n=e=>{const t=e.id;null!=i[t]&&(i[t].deletedDate=null,i[t].revisionDate=e.revisionDate)};e.constructor.name===Array.name?e.forEach(n):n(e),yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>(null==i&&(i={}),i))})}restoreWithServer(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!1){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.restoreWithServer(e,t,i));let n;n=i?yield this.apiService.putRestoreCipherAdmin(e):yield this.apiService.putRestoreCipher(e),yield this.restore({id:e,revisionDate:n.revisionDate},t)})}restoreManyWithServer(e,t,i){return Kc(this,void 0,void 0,function*(){if(yield(0,u._)(this.sdkCipherCrudEnabled$))return yield this.clearCache(t),void(yield this.cipherSdkService.restoreManyWithServer(e,t,i));let n;if(i){const t=new Mc(e,i);n=yield this.apiService.putRestoreManyCiphersAdmin(t)}else{const t=new Mc(e);n=yield this.apiService.putRestoreManyCiphers(t)}const r=[];for(const e of n.data)r.push({id:e.id,revisionDate:e.revisionDate});yield this.restore(r,t)})}getKeyForCipherKeyDecryption(e,t){return Kc(this,void 0,void 0,function*(){return null==e.organizationId?yield(0,u._)(this.keyService.userKey$(t)):yield(0,u._)(this.keyService.orgKeys$(t).pipe((0,p.T)(t=>t[e.organizationId])))})}setAddEditCipherInfo(e,t){return Kc(this,void 0,void 0,function*(){yield this.addEditCipherInfoState(t).update(()=>e,{shouldUpdate:t=>!(null==t&&null==e)})})}getRotatedData(e,t,i){return Kc(this,void 0,void 0,function*(){if(null==e)throw new Error("Original user key is required to rotate ciphers");if(null==t)throw new Error("New user key is required to rotate ciphers");let n=[];const r=yield(0,u._)(this.cipherViews$(i)),s=yield(0,u._)(this.failedToDecryptCiphers$(i));if(!r)return n;if(s.length>0)throw new Error("Cannot rotate ciphers when decryption failures are present");const o=r.filter(e=>null==e.organizationId);if(0===o.length)return n;const a=yield this.configService.getFeatureFlag(dr.TO.PM22136_SdkCipherEncryption);return n=yield Promise.all(o.map(n=>Kc(this,void 0,void 0,function*(){const r=a?yield this.cipherEncryptionService.encryptCipherForRotation(n,i,t):yield this.encrypt(n,i,t,e);return new Oc(r)}))),n})}getDecryptedAttachmentBuffer(e,t,i,n,r){return Kc(this,void 0,void 0,function*(){const s=yield this.configService.getFeatureFlag(dr.TO.PM19941MigrateCipherDomainToSdk),o=yield(0,u._)(this.ciphers$(n).pipe((0,p.T)(t=>new ma.o(t[e]))));if(s&&!r){const e=yield i.arrayBuffer();return this.cipherEncryptionService.decryptAttachmentContent(o,t,new Uint8Array(e),n)}const a=yield Dr.fromResponse(i),l=null!=t.key?t.key:o.organizationId?yield(0,u._)(this.keyService.orgKeys$(n).pipe((0,cc.w)(),(0,p.T)(e=>e[o.organizationId]))):yield(0,u._)(this.keyService.userKey$(n).pipe((0,cc.w)()));return yield this.encryptService.decryptFileData(a,l)})}localDataState(e){return this.stateProvider.getUser(e,va)}encryptedCiphersState(e){return this.stateProvider.getUser(e,Aa)}decryptedCiphersState(e){return this.stateProvider.getUser(e,pa)}addEditCipherInfoState(e){return this.stateProvider.getUser(e,fa)}failedToDecryptCiphersState(e){return this.stateProvider.getUser(e,ga)}encryptSharedCipher(e,t){return Kc(this,void 0,void 0,function*(){const i=yield this.keyService.getUserKey(t);return yield this.encrypt(e,t,null,i)})}updateModelfromExistingCipher(e,t,i){return Kc(this,void 0,void 0,function*(){const n=yield this.decrypt(t,i);if(e.passwordHistory=n.passwordHistory||[],e.type===yc.gC.Login&&n.type===yc.gC.Login)if(null!=n.login.password&&""!==n.login.password&&n.login.password!==e.login.password){const t=new Yc.j;t.password=n.login.password,t.lastUsedDate=e.login.passwordRevisionDate=new Date,e.passwordHistory.splice(0,0,t)}else e.login.passwordRevisionDate=n.login.passwordRevisionDate;if(n.hasFields){const t=n.fields.filter(e=>e.type===mc.PU.Hidden&&null!=e.name&&""!==e.name&&null!=e.value&&""!==e.value),i=null==e.fields?[]:e.fields.filter(e=>e.type===mc.PU.Hidden&&null!=e.name&&""!==e.name);t.forEach(t=>{const n=i.find(e=>e.name===t.name);if(null==n||n.value!==t.value){const i=new Yc.j;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,n){return Kc(this,void 0,void 0,function*(){const r=yield(0,u._)(this.accountService.activeAccount$),s=yield this.apiService.nativeFetch(new Request(e.url,{cache:"no-store"}));if(200!==s.status)throw Error("Failed to download attachment: "+s.status.toString());const o=yield Dr.fromResponse(s),a=yield this.keyService.getUserKey(r.id),l=yield this.encryptService.decryptFileData(o,a);let c;c=yield this.keyService.getOrgKey(i),c||(c=yield this.keyService.getUserKey());const d=yield this.keyService.makeDataEncKey(c),h=yield this.encryptService.encryptString(e.fileName,c),A=yield this.encryptService.encryptFileData(new Uint8Array(l),d[0]),p=new FormData;try{const e=new Blob([A.buffer],{type:"application/octet-stream"});p.append("key",d[1].encryptedString),p.append("data",e,h.encryptedString),p.append("lastKnownRevisionDate",n.toISOString())}catch(g){if(!at.A.isNode||at.A.isBrowser)throw g;p.append("key",d[1].encryptedString),p.append("lastKnownRevisionDate",n.toISOString()),p.append("data",Buffer.from(A.buffer),{filepath:h.encryptedString,contentType:"application/octet-stream"})}try{yield this.apiService.postShareCipherAttachment(t,e.id,p,i)}catch(g){throw new Error(g.getSingleMessage())}})}upgradeOldCipherAttachments(e,t,i){return Kc(this,void 0,void 0,function*(){if(!e.hasOldAttachments)return e;let n=yield this.get(e.id,t);for(const s of e.attachments)if(null==s.key&&(null==i||s.id===i))try{const i=yield this.getAttachmentDownloadUrl(e.id,s),r=yield this.apiService.nativeFetch(new Request(i,{cache:"no-store"}));if(200!==r.status)throw new Error(`Failed to download attachment. Status: ${r.status}`);const o=yield this.getDecryptedAttachmentBuffer(e.id,s,r,t);n=yield this.saveAttachmentRawWithServer(n,s.fileName,o,t);const a=yield this.deleteAttachmentWithServer(e.id,s.id,t);n=new ma.o(a)}catch(r){throw this.logService.error(`Failed to upgrade attachment ${s.id}`,r),r}return yield this.decrypt(n,t)})}getAttachmentDownloadUrl(e,t){return Kc(this,void 0,void 0,function*(){try{return(yield this.apiService.getAttachmentData(e,t.id)).url}catch(i){if(i instanceof ot._&&404===i.statusCode&&t.url)return t.url;throw new Error(`Failed to get download URL for attachment ${t.id}`)}})}encryptObjProperty(e,t,i,n){return Kc(this,void 0,void 0,function*(){const r=[],s=this;for(const o in i)i.hasOwnProperty(o)&&function(t,o){const a=Promise.resolve().then(()=>{const r=e[i[t]||t];return r&&""!==r?s.encryptService.encryptString(r,n):null}).then(e=>{o[t]=e});r.push(a)}(o,t);yield Promise.all(r)})}encryptCipherData(e,t,i){return Kc(this,void 0,void 0,function*(){switch(e.type){case yc.gC.Login:if(e.login=new Ec.a,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&&""!==e.uri);for(let n=0;n<t.login.uris.length;n++){const r=new Sc.m;r.match=t.login.uris[n].match,yield this.encryptObjProperty(t.login.uris[n],r,{uri:null},i);const s=yield this.encryptService.hash(t.login.uris[n].uri,"sha256");r.uriChecksum=yield this.encryptService.encryptString(s,i),e.login.uris.push(r)}}return void(null!=t.login.fido2Credentials&&(e.login.fido2Credentials=yield Promise.all(t.login.fido2Credentials.map(e=>Kc(this,void 0,void 0,function*(){const t=new Ic.U;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.encryptService.encryptString(String(e.counter),i),t.discoverable=yield this.encryptService.encryptString(String(e.discoverable),i),t.creationDate=e.creationDate,t})))));case yc.gC.SecureNote:return e.secureNote=new kc.S,void(e.secureNote.type=t.secureNote.type);case yc.gC.Card:return e.card=new wc.Z,void(yield this.encryptObjProperty(t.card,e.card,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},i));case yc.gC.Identity:return e.identity=new Bc.l,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));case yc.gC.SshKey:return e.sshKey=new Pc.M,void(yield this.encryptObjProperty(t.sshKey,e.sshKey,{privateKey:null,publicKey:null,keyFingerprint:null},i));default:throw new Error("Unknown cipher type.")}})}getAutofillOnPageLoadDefault(){return Kc(this,void 0,void 0,function*(){return yield(0,u._)(this.autofillSettingsService.autofillOnPageLoadDefault$)})}getCipherForUrl(e,t,i,n,r){return Kc(this,void 0,void 0,function*(){const s=r?"autofillOnPageLoad-"+e:e;if(!this.sortedCiphersCache.isCached(s)){let i=yield this.getAllDecryptedForUrl(e,t);if(!(null==i?void 0:i.length))return null;const n=yield(0,u._)(this.localData$(t));if(n)for(const e of i){const t=n[e.id];t&&(e.localData=t)}if(r){const e=yield this.getAutofillOnPageLoadDefault();if(i=i.filter(t=>t.login.autofillOnPageLoad||null==t.login.autofillOnPageLoad&&!1!==e),0===i.length)return null}this.sortedCiphersCache.addCiphers(s,i)}return n?this.sortedCiphersCache.getLastLaunched(s):i?this.sortedCiphersCache.getLastUsed(s):this.sortedCiphersCache.getNext(s)})}clearEncryptedCiphersState(e){return Kc(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Aa,null,e)})}clearDecryptedCiphersState(e){return Kc(this,void 0,void 0,function*(){yield this.setDecryptedCiphers(null,e),yield this.setFailedDecryptedCiphers(null,e),this.clearSortedCiphers()})}clearSortedCiphers(){this.sortedCiphersCache.clear()}encryptCipher(e,t,i){return Kc(this,void 0,void 0,function*(){if(null==i)throw new Error("Key to encrypt cipher must not be null. Use the org key, user key or cipher key.");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 Kc(this,void 0,void 0,function*(){let r;return r=null==t.key?yield this.keyService.makeCipherKey():yield this.encryptService.unwrapSymmetricKey(t.key,n),t.key=yield this.encryptService.wrapSymmetricKey(r,i),this.encryptCipher(e,t,r)})}getCipherKeyEncryptionEnabled(){return Kc(this,void 0,void 0,function*(){const e=yield this.configService.getFeatureFlag(dr.TO.CipherKeyEncryption),t=yield(0,u._)(this.configService.checkServerMeetsVersionRequirement$(Xc));return e&&t})}decryptCiphersWithSdk(e,t){return Kc(this,arguments,void 0,function*(e,t,i=!0){if(0===e.length)return[[],[]];if(i){const[i,n]=yield this.cipherEncryptionService.decryptManyLegacy(e,t);return[i.sort(this.getLocaleSortingFunction()),n]}const[n,r]=yield this.cipherEncryptionService.decryptManyWithFailures(e,t),s=r.map(e=>{const t=new Ar.f(e);return t.name="[error: cannot decrypt]",t.decryptionFailure=!0,t});return[n.sort(this.getLocaleSortingFunction()),s]})}getFullCipherView(e){return Kc(this,void 0,void 0,function*(){if(Lc.n.isCipherListView(e)){const t=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id))),i=yield this.get((0,Ys.zw)(e.id),t);return this.decrypt(i,t)}return Promise.resolve(e)})}}class Hc{constructor(e){this.ids=null==e?[]:e}}class Wc{constructor(e){this.ids=null==e?[]:e}}var $c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Jc=i(65918),Zc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},_c=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},ed=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var td=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},id=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},nd=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var rd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var sd=i(75174),od=i(98850),ad=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ld=i(83892),cd=i(84274),dd=i(78078),ud=i(89177);const hd=I.Ok.record(I.Rv,"folders",{deserializer:e=>La.fromJSON(e),clearOn:["logout"]}),Ad=new I.Ok(I.jx,"decryptedFolders",{deserializer:e=>{var t;return null!==(t=null==e?void 0:e.map(e=>dd.u.fromJSON(e)))&&void 0!==t?t:[]},clearOn:["logout","lock"]});var pd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var gd=i(66983),vd=i(38871),fd=i(59777),md=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const yd=new I.Ok(I.s2,"searchIndex",{deserializer:e=>e,clearOn:["lock","logout"]}),Cd=new I.Ok(I.s2,"searchIndexedEntityId",{deserializer:e=>e,clearOn:["lock","logout"]}),wd=new I.Ok(I.s2,"isIndexing",{deserializer:e=>e,clearOn:["lock","logout"]});class Id{constructor(e,t,i){this.logService=e,this.i18nService=t,this.stateProvider=i,this.immediateSearchLocales=["zh-CN","zh-TW","ja","ko","vi"],this.defaultSearchableMinLength=2,this.searchableMinLength=this.defaultSearchableMinLength,this._isCipherSearching$=new _e.t(!1),this.isCipherSearching$=this._isCipherSearching$.asObservable(),this._isSendSearching$=new _e.t(!1),this.isSendSearching$=this._isSendSearching$.asObservable(),this.index$=(0,cc.j)(e=>this.searchIndexState(e).state$.pipe((0,p.T)(e=>{let t=null;if(e){const i=performance.now();t=vd.Index.load(e),this.logService.measure(i,"Vault","SearchService","index load")}return t}))),this.i18nService.locale$.subscribe(e=>{-1!==this.immediateSearchLocales.indexOf(e)?this.searchableMinLength=1:this.searchableMinLength=this.defaultSearchableMinLength}),Id.registeredPipeline||(Id.registeredPipeline=!0,vd.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction,"normalizeAccents"))}searchIndexState(e){return this.stateProvider.getUser(e,yd)}searchIndexEntityIdState(e){return this.stateProvider.getUser(e,Cd)}indexedEntityId$(e){return this.searchIndexEntityIdState(e).state$.pipe((0,p.T)(e=>e))}searchIsIndexingState(e){return this.stateProvider.getUser(e,wd)}searchIsIndexing$(e){return this.searchIsIndexingState(e).state$.pipe((0,p.T)(e=>null!=e&&e))}clearIndex(e){return md(this,void 0,void 0,function*(){yield this.searchIndexEntityIdState(e).update(()=>null),yield this.searchIndexState(e).update(()=>null),yield this.searchIsIndexingState(e).update(()=>null)})}isSearchable(e,t){return md(this,void 0,void 0,function*(){if(null==(t=Id.normalizeSearchQuery(t))||""===t)return!1;return 0===t.indexOf(">")?null!=(yield this.getIndexForSearch(e)):t.length>=this.searchableMinLength})}indexCiphers(e,t,i){return md(this,void 0,void 0,function*(){if(yield this.getIsIndexing(e))return;const n=performance.now();yield this.setIsIndexing(e,!0),yield this.setIndexedEntityIdForSearch(e,i);const r=new vd.Builder;r.pipeline.add(this.normalizeAccentsPipelineFunction),r.ref("id"),r.field("shortid",{boost:100,extractor:e=>(0,Ys.zw)(e.id).substr(0,8)}),r.field("name",{boost:10}),r.field("subtitle",{boost:5,extractor:e=>{const t=Lc.n.subtitle(e);return null!=t&&Lc.n.getType(e)===yc.gC.Card?t.replace(/\*/g,""):t}}),r.field("notes",{extractor:e=>Lc.n.getNotes(e)}),r.field("login.username",{extractor:e=>{var t;const i=Lc.n.getLogin(e);return null!==(t=null==i?void 0:i.username)&&void 0!==t?t:null}}),r.field("login.uris",{boost:2,extractor:e=>this.uriExtractor(e)}),r.field("fields",{extractor:e=>this.fieldExtractor(e,!1)}),r.field("fields_joined",{extractor:e=>this.fieldExtractor(e,!0)}),r.field("attachments",{extractor:e=>this.attachmentExtractor(e,!1)}),r.field("attachments_joined",{extractor:e=>this.attachmentExtractor(e,!0)}),r.field("organizationid",{extractor:e=>e.organizationId}),(t=t||[]).forEach(e=>r.add(e));const s=r.build();yield this.setIndexForSearch(e,s.toJSON()),yield this.setIsIndexing(e,!1),this.logService.measure(n,"Vault","SearchService","index complete",[["Items",t.length]])})}searchCiphers(e,t){return md(this,arguments,void 0,function*(e,t,i=null,n){this._isCipherSearching$.next(!0);const r=[],s=performance.now();if(null!=t&&(t=Id.normalizeSearchQuery(t.trim().toLowerCase())),""===t&&(t=null),null==n&&(n=[]),null!=i&&Array.isArray(i)&&i.length>0?n=n.filter(e=>i.every(t=>null==t||t(e))):null!=i&&(n=n.filter(i)),!(yield this.isSearchable(e,t)))return this._isCipherSearching$.next(!1),n;(yield this.getIsIndexing(e))&&(yield new Promise(e=>setTimeout(e,250)),(yield this.getIsIndexing(e))&&(yield new Promise(e=>setTimeout(e,500))));const o=yield this.getIndexForSearch(e);if(null==o){const e=this.searchCiphersBasic(n,t);return this.logService.measure(s,"Vault","SearchService","basic search complete"),this._isCipherSearching$.next(!1),e}const a=new Map;n.forEach(e=>a.set((0,Ys.zw)(e.id),e));let l=null;if(null!=t&&t.length>1&&0===t.indexOf(">"))try{l=o.search(t.substr(1).trim())}catch(c){this.logService.error(c)}else{const e=vd.Query.wildcard.LEADING|vd.Query.wildcard.TRAILING;l=o.query(i=>{vd.tokenizer(t).forEach(t=>{const n=t.toString();i.term(n,{fields:["name"],wildcard:e}),i.term(n,{fields:["subtitle"],wildcard:e}),i.term(n,{fields:["login.uris"],wildcard:e}),i.term(n,{})})})}return null!=l&&l.forEach(e=>{a.has(e.ref)&&r.push(a.get(e.ref))}),this.logService.measure(s,"Vault","SearchService","search complete"),this._isCipherSearching$.next(!1),r})}searchCiphersBasic(e,t,i=!1,n=!1){return t=Id.normalizeSearchQuery(t.trim().toLowerCase()),e.filter(e=>{var r,s;if(i!==Lc.n.isDeleted(e))return!1;if(n!==Lc.n.isArchived(e))return!1;if(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1)return!0;if(t.length>=8&&(0,Ys.zw)(e.id).startsWith(t))return!0;const o=Lc.n.subtitle(e);if(null!=o&&o.toLowerCase().indexOf(t)>-1)return!0;const a=Lc.n.getLogin(e);return!!(a&&(null===(r=a.uris)||void 0===r?void 0:r.length)&&(null===(s=a.uris)||void 0===s?void 0:s.some(e=>(null==e?void 0:e.uri)&&e.uri.toLowerCase().indexOf(t)>-1)))})}searchSends(e,t){if(this._isSendSearching$.next(!0),null===(t=Id.normalizeSearchQuery(t.trim().toLocaleLowerCase())))return this._isSendSearching$.next(!1),e;const i=[],n=[];return e.forEach(e=>{var r,s,o;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===(r=e.file)||void 0===r?void 0:r.id)&&e.file.id.startsWith(t))||null!=e.notes&&e.notes.toLowerCase().indexOf(t)>-1||null!=(null===(s=e.text)||void 0===s?void 0:s.text)&&e.text.text.toLowerCase().indexOf(t)>-1||null!=(null===(o=e.file)||void 0===o?void 0:o.fileName)&&e.file.fileName.toLowerCase().indexOf(t)>-1)&&n.push(e)}),this._isSendSearching$.next(!1),i.concat(n)}getIndexForSearch(e){return md(this,void 0,void 0,function*(){return yield(0,u._)(this.index$(e))})}setIndexForSearch(e,t){return md(this,void 0,void 0,function*(){yield this.searchIndexState(e).update(()=>t)})}setIndexedEntityIdForSearch(e,t){return md(this,void 0,void 0,function*(){yield this.searchIndexEntityIdState(e).update(()=>t)})}setIsIndexing(e,t){return md(this,void 0,void 0,function*(){yield this.searchIsIndexingState(e).update(()=>t)})}getIsIndexing(e){return md(this,void 0,void 0,function*(){return yield(0,u._)(this.searchIsIndexing$(e))})}fieldExtractor(e,t){const i=Lc.n.getFields(e);if(!i||0===i.length)return null;let n=[];return i.forEach(e=>{if(null!=e.name&&n.push(e.name),null!=e.value){const t=e.type;void 0!==t&&t!==mc.PU.Text||n.push(e.value)}}),n=n.filter(e=>""!==e.trim()),0===n.length?null:t?n.join(" "):n}attachmentExtractor(e,t){const i=Lc.n.getAttachmentNames(e);if(!i||0===i.length)return null;let n=[];return i.forEach(e=>{null!=e&&(t&&e.indexOf(".")>-1?n.push(e.substring(0,e.lastIndexOf("."))):n.push(e))}),n=n.filter(e=>""!==e.trim()),0===n.length?null:t?n.join(" "):n}uriExtractor(e){var t;if(Lc.n.getType(e)!==yc.gC.Login)return null;const i=Lc.n.getLogin(e);if(!(null===(t=null==i?void 0:i.uris)||void 0===t?void 0:t.length))return null;const n=[];return i.uris.forEach(e=>{if(null==e.uri||""===e.uri)return;const t=e.uri.match(/:(\d+)(?:[/?#]|$)/),i=null==t?void 0:t[1],r=Lc.n.getUriHostname(e);void 0!==r&&(n.push(r),i&&(n.push(`${r}:${i}`),n.push(i)));let s=e.uri;if(e.match!==fd.L.RegularExpression){const e=s.indexOf("://");e>-1&&(s=s.substring(e+3));const t=s.search(/\?|&|#/);t>-1&&(s=s.substring(0,t))}n.push(s)}),n.length>0?n:null}normalizeAccentsPipelineFunction(e){const t=["name","login.username","subtitle","notes"];return e.metadata.fields.every(e=>t.includes(e))?Id.normalizeSearchQuery(e.toString()):e}static normalizeSearchQuery(e){return null==e?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}}Id.registeredPipeline=!1;const bd=new I.Zs(I.Jb,"enablePasskeys",{deserializer:e=>e}),Bd=new I.Ok(I.Jb,"showCardsCurrentTab",{deserializer:e=>e,clearOn:[]}),Ed=new I.Ok(I.Jb,"showIdentitiesCurrentTab",{deserializer:e=>e,clearOn:[]}),Sd=new I.Ok(I.Jb,"clickItemsToAutofillOnVaultView",{deserializer:e=>e,clearOn:[]}),Qd=new I.Ok(I.Jb,"showAtRiskPasswordNotifications",{deserializer:e=>e,clearOn:[]});var kd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Td=i(69650),Fd=i(1221);var Pd=i(192),Rd=i(71373),Dd=i(93173),Md=i(92027),xd=i(90118),Od=i(67253),Gd=i(35185);var Ud=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Vd{getPremiumInterest(e){return Ud(this,void 0,void 0,function*(){return null})}setPremiumInterest(e,t){return Ud(this,void 0,void 0,function*(){})}clearPremiumInterest(e){return Ud(this,void 0,void 0,function*(){})}}Vd.ɵfac=function(e){return new(e||Vd)},Vd.ɵprov=E.jDH({token:Vd,factory:Vd.ɵfac});var jd=i(94735),Nd=i(81573),zd=i(26477),Yd=i(29029),Ld=i(22191),Kd=i(37579),Xd=i(26411),qd=i(7730),Hd=i(68016),Wd=i(67311),$d=i(57178),Jd=i(56898),Zd=i(36288),_d=i(26657),eu=i(38620),tu=i(86226),iu=i(93199),nu=i(97553),ru=i(43759),su=i(76356),ou=i(69896),au=i(25740),lu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class cu{constructor(){this.dialogRef=(0,E.WQX)(R.ce),this.formBuilder=(0,E.WQX)(a.ok),this.masterPasswordUnlockService=(0,E.WQX)(gs.b),this.accountService=(0,E.WQX)(Y.D),this.toastService=(0,E.WQX)(P.f),this.i18nService=(0,E.WQX)(U.W),this.migrationPasswordForm=this.formBuilder.group({masterPassword:["",[a.k0.required]]}),this.submit=()=>lu(this,void 0,void 0,function*(){const e=this.migrationPasswordForm.controls.masterPassword;if(!e.value||e.invalid)return;const{userId:t}=yield(0,u._)(this.accountService.activeAccount$.pipe((0,h.p)(e=>null!=e),(0,p.T)(e=>({userId:e.id}))));(yield this.masterPasswordUnlockService.proofOfDecryption(e.value,t))?this.dialogRef.close(e.value):this.toastService.showToast({variant:"error",message:this.i18nService.t("incorrectPassword")})})}static open(e){return e.open(cu)}}cu.ɵfac=function(e){return new(e||cu)},cu.ɵcmp=B.VBU({type:cu,selectors:[["ng-component"]],decls:33,vars:33,consts:[[3,"bitSubmit","formGroup"],["bitDialogTitle","",1,"tw-font-semibold"],["bitDialogContent",""],["bitLink","","href","https://bitwarden.com/help/kdf-algorithms/","target","_blank","rel","noreferrer","aria-label","external link"],["aria-hidden","true",1,"bwi","bwi-external-link"],["bitInput","","type","password","formControlName","masterPassword",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog")(2,"div",1),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"div",2)(6,"p"),B.EFF(7),B.nI1(8,"i18n"),B.j41(9,"a",3),B.EFF(10),B.nI1(11,"i18n"),B.nrm(12,"i",4),B.k0s()(),B.j41(13,"bit-form-field")(14,"bit-label"),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.j41(17,"bit-hint"),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.nrm(20,"input",5),B.nI1(21,"i18n"),B.nrm(22,"button",6),B.nI1(23,"i18n"),B.nI1(24,"i18n"),B.k0s()(),B.qex(25,7),B.j41(26,"button",8)(27,"span"),B.EFF(28),B.nI1(29,"i18n"),B.k0s()(),B.j41(30,"button",9),B.EFF(31),B.nI1(32,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("bitSubmit",t.submit)("formGroup",t.migrationPasswordForm),B.R7$(3),B.SpI(" ",B.bMT(4,13,"updateEncryptionSettingsTitle")," "),B.R7$(4),B.SpI(" ",B.bMT(8,15,"updateEncryptionSettingsDesc")," "),B.R7$(3),B.SpI(" ",B.bMT(11,17,"learnMore")," "),B.R7$(5),B.JRh(B.bMT(16,19,"masterPass")),B.R7$(3),B.JRh(B.bMT(19,21,"confirmIdentityToContinue")),B.R7$(2),B.BMQ("title",B.bMT(21,23,"masterPass")),B.R7$(2),B.BMQ("title",B.bMT(23,25,"toggleVisibility"))("aria-label",B.bMT(24,27,"toggleVisibility")),B.R7$(4),B.Y8G("disabled",t.migrationPasswordForm.invalid),B.R7$(2),B.JRh(B.bMT(29,29,"updateSettings")),B.R7$(3),B.SpI(" ",B.bMT(32,31,"later")," "))},dependencies:[Nd.P,qd.I,Hd.m,Wd.hJ,zd.V,$d.g,H.MD,jd.p,Yd.t,Jd.Q,Ld.Q,Zd.s,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,Kd.C,_d.$,eu.L,Xd.L,tu.j,iu.I,nu.J,ru.h,su.e,ou.a,au.$],encapsulation:2,changeDetection:0});var du=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const uu=new I.Ok(I.K8,"encryptedMigrationDismissed",{deserializer:e=>null!=e?new Date(e):null,clearOn:[]}),hu=["/new-vault","/vault","/tabs/vault","/tabs/current"];class Au{}class pu extends E.zcH{constructor(){super(...arguments),this.injector=(0,E.WQX)(E.zZn)}handleError(e){try{this.injector.get(Vs.K,null).error("Unhandled error in angular",e)}catch(t){super.handleError(e)}}}pu.ɵfac=(()=>{let e;return function(t){return(e||(e=B.xGo(pu)))(t||pu)}})(),pu.ɵprov=E.jDH({token:pu,factory:pu.ɵfac});var gu=i(31436);class vu{static createSystemThemeFromWindow(e){return(0,ld.h)((0,Ii.of)(vu.getSystemThemeFromWindow(e)),(0,gu.R)(e.matchMedia("(prefers-color-scheme: dark)"),"change").pipe((0,p.T)(e=>e.matches?$i.NJ.Dark:$i.NJ.Light)))}static getSystemThemeFromWindow(e){return e.matchMedia("(prefers-color-scheme: dark)").matches?$i.NJ.Dark:$i.NJ.Light}constructor(e,t){this.themeStateService=e,this.systemTheme$=t,this.theme$=this.themeStateService.selectedTheme$.pipe((0,rt.n)(e=>e===$i.NJ.System?this.systemTheme$:(0,Ii.of)(e)))}applyThemeChangesTo(e){return this.theme$.subscribe(t=>{e.documentElement.classList.remove("theme_"+$i.NJ.Light,"theme_"+$i.NJ.Dark),e.documentElement.classList.add("theme_"+t)})}}vu.ɵfac=function(e){return new(e||vu)(E.KVO($a.oO),E.KVO(ae.eL))},vu.ɵprov=E.jDH({token:vu,factory:vu.ɵfac});class fu{}var mu=i(47836);class yu{signal(e){return(0,E.vPA)(e.initialValue)}formGroup(e){return e.control}}yu.ɵfac=function(e){return new(e||yu)},yu.ɵprov=E.jDH({token:yu,factory:yu.ɵfac,providedIn:"root"});var Cu=i(14928),wu=i(63609);class Iu{constructor(){this._onCreated=new d.B,this._onClose=new d.B,this._onClosed=new d.B,this._onShow=new d.B,this._onShown=new d.B,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,Cu.$)()).toPromise()}}const bu=["modalContent"];function Bu(e,t){}class Eu{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()}}Eu.ɵfac=function(e){return new(e||Eu)(B.rXU(r.gRc),B.rXU(B.aKT),B.rXU(wu.Fp),B.rXU(Iu))},Eu.ɵcmp=B.VBU({type:Eu,selectors:[["app-modal"]],viewQuery:function(e,t){if(1&e&&B.GBs(bu,7,B.c1b),2&e){let e;B.mGM(e=B.lsd())&&(t.modalContentRef=e.first)}},standalone:!1,decls:2,vars:0,consts:[["modalContent",""]],template:function(e,t){1&e&&B.DNE(0,Bu,0,0,"ng-template",null,0,B.C5r)},encapsulation:2});class Su{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 Qu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ku{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){return Qu(this,arguments,void 0,function*(e,t,i=null){const[n,r]=this.openInternal(t,e);return r.instance.setComponentParameters=i,t.insert(r.hostView),yield n.onCreated.pipe((0,Cu.$)()).toPromise(),[n,r.instance.componentRef.instance]})}closeAll(){this.modalList.forEach(e=>e.instance.close())}openInternal(e,t){const[i,n]=this.createModalComponent(e);return n.instance.childComponentType=t,i.onClosed.pipe((0,Cu.$)()).subscribe(()=>{n.destroy(),this.modalList.pop(),this.modalCount>0&&this.topModal.instance.getFocus()}),this.setupHandlers(i),this.modalList.push(n),[i,n]}setupHandlers(e){let t=null;e.onCreated.pipe((0,Cu.$)()).subscribe(i=>{document.body.classList.add("modal-open");const n=i.querySelector(".modal"),r=n.querySelector(".modal-dialog");t=document.createElement("div"),t.className="modal-backdrop fade",t.style.zIndex=`${this.modalCount}040`,n.prepend(t),r.addEventListener("click",e=>{e.stopPropagation()}),r.style.zIndex=`${this.modalCount}050`;const s=Array.from(i.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]'));for(const t of s)t.addEventListener("click",()=>{e.close()})}),e.onClose.pipe((0,Cu.$)()).subscribe(()=>{e.closed(),0===this.modalCount&&document.body.classList.remove("modal-open")})}createModalComponent(e){const t=new Iu,i=new WeakMap;i.set(Iu,t);const n=new Su(this.injector,i);return[t,e.createComponent(Eu,{injector:n})]}}ku.ɵfac=function(e){return new(e||ku)(E.KVO(E.zZn))},ku.ɵprov=E.jDH({token:ku,factory:ku.ɵfac});var Tu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fu=[(0,oe.F)(ku),(0,oe.F)(xd.qX),(0,oe.F)({provide:ae.jf,useValue:window}),(0,oe.F)({provide:ae.qQ,useValue:document}),(0,oe.F)({provide:B.xe9,useFactory:e=>e.translationLocale,deps:[U.W]}),(0,oe.F)({provide:ae.Vc,useFactory:e=>e.supportsSecureStorage(),deps:[V.y]}),(0,oe.F)({provide:ae.U1,useValue:"./locales"}),(0,oe.F)({provide:ae.Xk,useFactory:e=>e.navigator.language,deps:[ae.jf]}),(0,oe.F)({provide:ae.dZ,useFactory:e=>(t,i)=>Tu(void 0,void 0,void 0,function*(){return Promise.resolve(e.send("logout",{logoutReason:t,userId:i}))}),deps:[js.U]}),(0,oe.F)({provide:ae.Pn,useValue:!0}),(0,oe.F)({provide:ae.eL,useFactory:e=>vu.createSystemThemeFromWindow(e),deps:[ae.jf]}),(0,oe.F)({provide:$a.oO,useClass:$a.T2,deps:[w.Y2]}),(0,oe.F)({provide:fu,useClass:vu,deps:[$a.oO,ae.eL]}),(0,oe.F)({provide:xs.Y,useClass:Io,deps:[ae.ml,Vs.K]}),(0,oe.F)({provide:ue.d,useClass:class{constructor(e,t,i,n=100){this.cryptoFunctionService=e,this.apiService=t,this.hibpApiService=i,this.maxConcurrent=n,this.passwordLeakedSubject=new d.B,this.maxConcurrent=n,this.passwordLeakedSubject.pipe((0,Ao.Z)(e=>Ql(this,void 0,void 0,function*(){try{const t=yield this.fetchLeakedPasswordCount(e.password);e.resolve(t)}catch(t){e.reject(t)}}),this.maxConcurrent)).subscribe()}passwordLeaked(e){return Ql(this,void 0,void 0,function*(){return new Promise((t,i)=>{this.passwordLeakedSubject.next({password:e,resolve:t,reject:i})})})}fetchLeakedPasswordCount(e){return Ql(this,void 0,void 0,function*(){const t=yield this.cryptoFunctionService.hash(e,"sha1"),i=at.A.fromArrayToHex(t).toUpperCase(),n=i.substr(0,5),r=i.substr(5),s=yield this.apiService.nativeFetch(new Request("https://api.pwnedpasswords.com/range/"+n)),o=(yield s.text()).split(/\r?\n/).find(e=>e.split(":")[0]===r);return null!=o?parseInt(o.split(":")[1],10):0})}breachedAccounts(e){return Ql(this,void 0,void 0,function*(){return this.hibpApiService.getHibpBreach(e)})}},deps:[kr.R,de.G,br]}),(0,oe.F)({provide:br,useClass:br,deps:[de.G]}),(0,oe.F)({provide:T.u,useClass:class{constructor(e,t,i,n,r,s){this.accountService=e,this.messageSender=t,this.keyService=i,this.apiService=n,this.stateService=r,this.tokenService=s,this.activeAccountStatus$=this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id),(0,rt.n)(e=>this.authStatusFor$(e))),this.authStatuses$=this.accountService.accounts$.pipe((0,p.T)(e=>Object.keys(e)),(0,rt.n)(e=>0===e.length?(0,Ii.of)([]):(0,bi.z)(e.map(e=>this.authStatusFor$(e).pipe((0,p.T)(t=>({userId:e,status:t})))))),(0,p.T)(e=>e.reduce((e,{userId:t,status:i})=>(e[t]=i,e),{})))}authStatusFor$(e){return at.A.isGuid(e)?(0,bi.z)([this.keyService.getInMemoryUserKeyFor$(e),this.tokenService.hasAccessToken$(e)]).pipe((0,p.T)(([e,t])=>t?e?m.J.Unlocked:m.J.Locked:m.J.LoggedOut),(0,hi.F)(),(0,Bi.t)({bufferSize:1,refCount:!1})):(0,Ii.of)(m.J.LoggedOut)}getAuthStatus(e){return Ei(this,void 0,void 0,function*(){return null!=e||(e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)))),yield(0,u._)(this.authStatusFor$(e))})}logOut(e,t){e(),this.messageSender.send("loggedOut",{userId:t})}},deps:[Y.D,js.U,b.Lu,de.G,w.dw,q.B]}),(0,oe.F)({provide:ss,useClass:rs,deps:[Jr,Ys.K5,b.Lu,vs.O]}),(0,oe.F)({provide:Wr.G,useClass:class{constructor(e,t,i,n,r,s){this.kdfConfigService=e,this.changeKdfService=t,this.logService=i,this.configService=n,this.masterPasswordService=r,this.syncService=s,this.migrations=[],this.isRunningMigration=!1,this.migrations.push({name:"Minimum PBKDF2 Iteration Count Migration",migration:new qr(e,t,i,n,r)})}runMigrations(e,t){return Hr(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId");const i=yield this.needsMigrations(e);if("noMigrationNeeded"!==i&&("needsMigrationWithMasterPassword"!==i||null!=t))try{if(this.isRunningMigration)return;this.isRunningMigration=!0,this.logService.mark("[Encrypted Migrator] Start"),this.logService.info(`[Encrypted Migrator] Starting migrations for user: ${e}`);let i=!1;for(const{name:n,migration:r}of this.migrations)if("noMigrationNeeded"!==(yield r.needsMigration(e))){this.logService.info(`[Encrypted Migrator] Running migration: ${n}`);const s=performance.now();yield r.runMigrations(e,t),this.logService.measure(s,"[Encrypted Migrator]",n,"ExecutionTime"),i=!0}this.logService.mark("[Encrypted Migrator] Finish"),this.logService.info(`[Encrypted Migrator] Completed migrations for user: ${e}`),i&&(yield this.syncService.fullSync(!0))}catch(n){throw this.logService.error(`[Encrypted Migrator] Error running migrations for user: ${e}`,n),n}finally{this.isRunningMigration=!1}})}needsMigrations(e){return Hr(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId");const t=yield Promise.all(this.migrations.map(t=>Hr(this,[t],void 0,function*({migration:t}){return t.needsMigration(e)})));return t.includes("needsMigrationWithMasterPassword")?"needsMigrationWithMasterPassword":t.includes("needsMigration")?"needsMigration":"noMigrationNeeded"})}isRunningMigrations(){return this.isRunningMigration}},deps:[b.zZ,ss,Vs.K,z.w,vs.L,Ga.H]}),(0,oe.F)({provide:v.sg,useClass:v.CL,deps:[Y.D,vs.O,Md.M,b.Lu,de.G,q.B,xs.Y,V.y,js.U,Vs.K,as.K,Gs.v,w.dw,Bn.fz,U.W,Tr.N,kl.Q,me.m,Ur.M,v.XF,v.bj,w.Y2,Rn.Q,Wi.ep,b.zZ,mr.Cc,z.w,Br.h,Ot.Ld]}),(0,oe.F)({provide:Us,useClass:class{constructor(e,t){this.logService=e,this.azureFileUploadService=new $o(e,t),this.bitwardenFileUploadService=new _o}upload(e,t,i,n){return ea(this,void 0,void 0,function*(){try{switch(e.fileUploadType){case $i.K9.Direct:yield this.bitwardenFileUploadService.upload(t.encryptedString,i,e=>n.postDirect(e));break;case $i.K9.Azure:yield this.azureFileUploadService.upload(e.url,i,n.renewFileUploadUrl);break;default:throw new Error("Unknown file upload type")}}catch(r){throw yield n.rollback(),r}})}},deps:[Vs.K,de.G]}),(0,oe.F)({provide:sc,useClass:class{constructor(e,t){this.apiService=e,this.fileUploadService=t}upload(e,t,i,n,r){return rd(this,void 0,void 0,function*(){const s={key:r[1].encryptedString,fileName:t.encryptedString,fileSize:i.buffer.byteLength,adminRequest:n,lastKnownRevisionDate:e.revisionDate};let o;try{const r=yield this.apiService.postCipherAttachment(e.id,s);o=n?r.cipherMiniResponse:r.cipherResponse,yield this.fileUploadService.upload(r,t,i,this.generateMethods(r,o,s.adminRequest))}catch(a){throw a instanceof ot._?new Error(a.getSingleMessage()):a}return o})}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()=>rd(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()=>rd(this,void 0,void 0,function*(){i?yield this.apiService.deleteCipherAttachmentAdmin(e.id,t.attachmentId):yield this.apiService.deleteCipherAttachment(e.id,t.attachmentId)})}},deps:[de.G,Us]}),(0,oe.F)({provide:kn.V,useClass:kn.G,deps:[w.v2,me.m,Y.D]}),(0,oe.F)({provide:rc,useClass:class{constructor(e,t){this.sdkService=e,this.logService=t}createWithServer(e,t,i){return pc(this,void 0,void 0,function*(){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1).value.vault().ciphers(),s=e.toSdkCreateCipherRequest(r);let o;return o=i?yield r.admin().create(s):yield r.create(s),Ar.f.fromSdkCipherView(o,r)}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to create cipher: ${e}`),e})))})}updateWithServer(e,t,i,n){return pc(this,void 0,void 0,function*(){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const r={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const s=gc(r,t.take(),!1).value.vault().ciphers(),o=e.toSdkUpdateCipherRequest(s);let a;return a=n?yield s.admin().edit(o,(null==i?void 0:i.toSdkCipherView())||(new Ar.f).toSdkCipherView()):yield s.edit(o),Ar.f.fromSdkCipherView(a,s)}catch(s){r.error=s,r.hasError=!0}finally{vc(r)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to update cipher: ${e}`),e})))})}deleteWithServer(e,t){return pc(this,arguments,void 0,function*(e,t,i=!1){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1);i?yield r.value.vault().ciphers().admin().delete((0,Ys.WD)(e)):yield r.value.vault().ciphers().delete((0,Ys.WD)(e))}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to delete cipher: ${e}`),e})))})}deleteManyWithServer(e,t){return pc(this,arguments,void 0,function*(e,t,i=!1,n){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const r={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const s=gc(r,t.take(),!1);if(i){if(null==n)throw new Error("Organization ID is required for admin delete.");yield s.value.vault().ciphers().admin().delete_many(e.map(e=>(0,Ys.WD)(e)),(0,Ys.WD)(n))}else yield s.value.vault().ciphers().delete_many(e.map(e=>(0,Ys.WD)(e)))}catch(s){r.error=s,r.hasError=!0}finally{vc(r)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to delete multiple ciphers: ${e}`),e})))})}softDeleteWithServer(e,t){return pc(this,arguments,void 0,function*(e,t,i=!1){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1);i?yield r.value.vault().ciphers().admin().soft_delete((0,Ys.WD)(e)):yield r.value.vault().ciphers().soft_delete((0,Ys.WD)(e))}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to soft delete cipher: ${e}`),e})))})}softDeleteManyWithServer(e,t){return pc(this,arguments,void 0,function*(e,t,i=!1,n){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const r={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const s=gc(r,t.take(),!1);if(i){if(null==n)throw new Error("Organization ID is required for admin soft delete.");yield s.value.vault().ciphers().admin().soft_delete_many(e.map(e=>(0,Ys.WD)(e)),(0,Ys.WD)(n))}else yield s.value.vault().ciphers().soft_delete_many(e.map(e=>(0,Ys.WD)(e)))}catch(s){r.error=s,r.hasError=!0}finally{vc(r)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to soft delete multiple ciphers: ${e}`),e})))})}restoreWithServer(e,t){return pc(this,arguments,void 0,function*(e,t,i=!1){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1);i?yield r.value.vault().ciphers().admin().restore((0,Ys.WD)(e)):yield r.value.vault().ciphers().restore((0,Ys.WD)(e))}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to restore cipher: ${e}`),e})))})}restoreManyWithServer(e,t,i){return pc(this,void 0,void 0,function*(){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1);i?yield r.value.vault().ciphers().admin().restore_many(e.map(e=>(0,Ys.WD)(e)),(0,Ys.WD)(i)):yield r.value.vault().ciphers().restore_many(e.map(e=>(0,Ys.WD)(e)))}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to restore multiple ciphers: ${e}`),e})))})}getAllDecrypted(e){return pc(this,void 0,void 0,function*(){return yield(0,u._)(this.sdkService.userClient$(e).pipe((0,rt.n)(e=>pc(this,void 0,void 0,function*(){var t,i;const n={stack:[],error:void 0,hasError:!1};try{if(!e)throw new Error("SDK not available");const r=gc(n,e.take(),!1),s=yield r.value.vault().ciphers().get_all(),o=[...null!==(t=s.successes)&&void 0!==t?t:[]].map(e=>Ar.f.fromSdkCipherView(e)).filter(e=>void 0!==e);return{successes:o,failures:[...null!==(i=s.failures)&&void 0!==i?i:[]].map(e=>{const t=new Ar.f(ma.o.fromSdkCipher(e));return t.name=Di.h,t.decryptionFailure=!0,t})}}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to list and decrypt ciphers: ${e}`),e})))})}getAllFromApiForOrganization(e,t,i){return pc(this,void 0,void 0,function*(){return yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(t=>pc(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=gc(n,t.take(),!1),s=yield r.value.vault().ciphers().admin().list_org_ciphers((0,Ys.WD)(e),i);return[s.ciphers.map(e=>ma.o.fromSdkCipher(e)).filter(e=>void 0!==e),s.listViews]}catch(r){n.error=r,n.hasError=!0}finally{vc(n)}})),(0,cr.W)(e=>{throw this.logService.error(`Failed to list organization ciphers: ${e}`),e})))})}},deps:[Ys.K5,Vs.K]}),(0,oe.F)({provide:k.p,useFactory:(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p)=>new qc(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p),deps:[b.Lu,kn.V,de.G,U.W,j.S,En.h,Tr.N,sc,z.w,w.v2,Y.D,Vs.K,ic,js.U,rc]}),(0,oe.F)({provide:nc.A,useClass:class{constructor(e,t){this.sdkService=e,this.cipherService=t}computeRiskForCiphers(e,t,i){return td(this,void 0,void 0,function*(){const n=this.mapToLoginDetails(e);return 0===n.length?[]:yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(e=>td(this,void 0,void 0,function*(){const t={stack:[],error:void 0,hasError:!1};try{const r=id(t,e.take(),!1).value.vault().cipher_risk();return yield r.compute_risk(n,null!=i?i:{checkExposed:!1})}catch(r){t.error=r,t.hasError=!0}finally{nd(t)}}))))})}computeCipherRiskForUser(e,t){return td(this,arguments,void 0,function*(e,t,i=!0){const n=yield(0,u._)(this.cipherService.cipherViews$(t).pipe((0,cc.w)())),r=null==n?void 0:n.find(t=>(0,Ys.WD)(t.id)===e);if(!r)throw new Error(`Cipher with id ${e} not found`);const s=yield this.buildPasswordReuseMap(n,t);return(yield this.computeRiskForCiphers([r],t,{passwordMap:s,checkExposed:i}))[0]})}buildPasswordReuseMap(e,t){return td(this,void 0,void 0,function*(){const i=this.mapToLoginDetails(e);return 0===i.length?{}:yield(0,u._)(this.sdkService.userClient$(t).pipe((0,rt.n)(e=>td(this,void 0,void 0,function*(){const t={stack:[],error:void 0,hasError:!1};try{const n=id(t,e.take(),!1);return n.value.vault().cipher_risk().password_reuse_map(i)}catch(n){t.error=n,t.hasError=!0}finally{nd(t)}}))))})}mapToLoginDetails(e){return e.filter(e=>{var t;return e.type===yc.gC.Login&&null!=(null===(t=e.login)||void 0===t?void 0:t.password)&&""!==e.login.password&&!e.isDeleted}).map(e=>({id:(0,Ys.WD)(e.id),password:e.login.password,username:e.login.username}))}},deps:[Ys.K5,k.p]}),(0,oe.F)({provide:Q.Z,useClass:class{constructor(e,t,i,n,r){this.keyService=e,this.encryptService=t,this.i18nService=i,this.cipherService=n,this.stateProvider=r,this.folderViewCache=new Map,this.forceFolderViews={}}folders$(e){return this.encryptedFoldersState(e).state$.pipe((0,p.T)(e=>null==e?[]:Object.values(e).map(e=>new cd.v(e))))}folderViews$(e){if(!this.folderViewCache.has(e)){this.forceFolderViews[e]||(this.forceFolderViews[e]=new d.B);const t=(0,ld.h)(this.forceFolderViews[e],(0,bi.z)([this.encryptedFoldersState(e).state$,this.keyService.userKey$(e)]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,rt.n)(([t,i])=>this.decryptFolders(e,t)))).pipe((0,Bi.t)({refCount:!1,bufferSize:1}));this.folderViewCache.set(e,t)}return this.folderViewCache.get(e)}encrypt(e,t){return pd(this,void 0,void 0,function*(){const i=new cd.v;return i.id=e.id,i.name=yield this.encryptService.encryptString(e.name,t),i})}get(e,t){return pd(this,void 0,void 0,function*(){return(yield(0,u._)(this.folders$(t))).find(t=>t.id===e)})}getDecrypted$(e,t){return this.folderViews$(t).pipe((0,p.T)(t=>t.find(t=>t.id===e)),(0,Bi.t)({refCount:!0,bufferSize:1}))}getAllFromState(e){return pd(this,void 0,void 0,function*(){return yield(0,u._)(this.folders$(e))})}getFromState(e,t){return pd(this,void 0,void 0,function*(){const i=yield this.get(e,t);return i||null})}getAllDecryptedFromState(e){return pd(this,void 0,void 0,function*(){return yield(0,u._)(this.folderViews$(e))})}upsert(e,t){return pd(this,void 0,void 0,function*(){yield this.clearDecryptedFolderState(t),yield this.encryptedFoldersState(t).update(t=>{if(null==t&&(t={}),e instanceof La){const i=e;t[i.id]=i}else e.forEach(e=>{t[e.id]=e});return t})})}replace(e,t){return pd(this,void 0,void 0,function*(){e&&(yield this.clearDecryptedFolderState(t),yield this.stateProvider.getUser(t,hd).update(()=>Object.assign({},e)))})}clearDecryptedFolderState(e){return pd(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.setDecryptedFolders([],e)})}clear(e){return pd(this,void 0,void 0,function*(){var t;null===(t=this.forceFolderViews[e])||void 0===t||t.next([]),yield this.encryptedFoldersState(e).update(()=>({})),yield this.clearDecryptedFolderState(e)})}delete(e,t){return pd(this,void 0,void 0,function*(){yield this.clearDecryptedFolderState(t),yield this.encryptedFoldersState(t).update(t=>{if(null==t)return;return(Array.isArray(e)?e:[e]).forEach(e=>{null!=t[e]&&delete t[e]}),t});const i=yield this.cipherService.getAll(t);if(null!=i){const t=[];for(const n in i)i[n].folderId===e&&(i[n].folderId=null,t.push(i[n]));t.length>0&&(yield this.cipherService.upsert(t.map(e=>e.toCipherData())))}})}getRotatedData(e,t,i){return pd(this,void 0,void 0,function*(){if(null==t)throw new Error("New user key is required for rotation.");let e=[];const n=yield(0,u._)(this.folderViews$(i));return n?(e=yield Promise.all(n.map(e=>pd(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t);return new ud.T(i)}))),e):e})}decryptFolders(e,t){return pd(this,void 0,void 0,function*(){const i=yield(0,u._)(this.stateProvider.getUser(e,Ad).state$);if(null==i?void 0:i.length)return i;if(null==t)return[];const n=Object.values(t).map(e=>new cd.v(e)),r=yield(0,u._)(this.keyService.userKey$(e));if(!r)return[];const s=n.map(e=>pd(this,void 0,void 0,function*(){try{return yield e.decryptWithKey(r,this.encryptService)}catch(t){return null}})),o=(yield Promise.all(s)).filter(e=>null!==e).sort(at.A.getSortFunction(this.i18nService,"name")),a=new dd.u;return a.name=this.i18nService.t("noneFolder"),o.push(a),yield this.setDecryptedFolders(o,e),o})}encryptedFoldersState(e){return this.stateProvider.getUser(e,hd)}setDecryptedFolders(e,t){return pd(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Ad,e,t)})}},deps:[b.Lu,Tr.N,U.W,k.p,w.v2]}),(0,oe.F)({provide:Q.k,useExisting:Q.Z}),(0,oe.F)({provide:oc.w,useClass:class{constructor(e,t){this.folderService=e,this.apiService=t}save(e,t){return ad(this,void 0,void 0,function*(){const i=new sd.O(e);let n;e.id?n=yield this.putFolder(e.id,i):(n=yield this.postFolder(i),e.id=n.id);const r=new La(n);return yield this.folderService.upsert(r,t),r})}delete(e,t){return ad(this,void 0,void 0,function*(){yield this.deleteFolder(e),yield this.folderService.delete(e,t)})}deleteAll(e){return ad(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/folders/all",null,!0,!1),yield this.folderService.clear(e)})}get(e){return ad(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/folders/"+e,null,!0,!0);return new od.s(t)})}postFolder(e){return ad(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/folders",e,!0,!0);return new od.s(t)})}putFolder(e,t){return ad(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/folders/"+e,t,!0,!0);return new od.s(i)})}deleteFolder(e){return this.apiService.send("DELETE","/folders/"+e,null,!0,!1)}},deps:[Q.Z,de.G]}),(0,oe.F)({provide:It.T,useClass:class{constructor(e,t,i,n,r){this.apiService=e,this.userVerificationService=t,this.logService=i,this.accountService=n,this.environmentService=r}deleteAccount(e){return Lt(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}})}registerSendVerificationEmail(e){return Lt(this,void 0,void 0,function*(){const t=yield(0,u._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/send-verification-email",e,!1,!0,t.getIdentityUrl())}catch(i){if(i instanceof ot._&&204===i.statusCode)return null;throw this.logService.error(i),i}})}registerVerificationEmailClicked(e){return Lt(this,void 0,void 0,function*(){const t=yield(0,u._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/verification-email-clicked",e,!1,!1,t.getIdentityUrl())}catch(i){throw this.logService.error(i),i}})}registerFinish(e){return Lt(this,void 0,void 0,function*(){const t=yield(0,u._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/finish",e,!1,!0,t.getIdentityUrl())}catch(i){throw this.logService.error(i),i}})}setVerifyDevices(e){return Lt(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/verify-devices",e,!0,!0)}catch(t){throw this.logService.error(t),t}})}},deps:[de.G,Rt.i,Vs.K,Y.A,Gs.v]}),(0,oe.F)({provide:Y.A,useClass:y.xy,deps:[js.U,Vs.K,w.Y2,w.Ys]}),(0,oe.F)({provide:Y.D,useExisting:Y.A}),(0,oe.F)({provide:Et.v,useClass:class{constructor(e,t){this.apiService=e,this.stateProvider=t,this.avatarColor$=this.stateProvider.getActive(ki).state$}setAvatarColor(e){return Qi(this,void 0,void 0,function*(){const{avatarColor:t}=yield this.apiService.putAvatar(new Si(e));yield this.stateProvider.setUserState(ki,t)})}setSyncAvatarColor(e,t){return Qi(this,void 0,void 0,function*(){yield this.stateProvider.getUser(e,ki).update(()=>t)})}getUserAvatarColor$(e){return this.stateProvider.getUser(e,ki).state$}},deps:[de.G,w.v2]}),(0,oe.F)({provide:Vs.K,useFactory:()=>new Ro.V(!1),deps:[]}),(0,oe.F)({provide:g.YD,useClass:g.dw,deps:[b.Lu,Tr.N,U.W,w.v2]}),(0,oe.F)({provide:ae.oq,useValue:[]}),(0,oe.F)({provide:Gs.v,useClass:zo,deps:[w.v2,Y.D,ae.oq]}),(0,oe.F)({provide:v.bj,useClass:v.GX,deps:[w.Ys]}),(0,oe.F)({provide:v.Ym,useExisting:v.bj}),(0,oe.F)({provide:ac.R,useClass:class{constructor(e){this.sdkService=e}getCode$(e){return(0,la.O)(0,1e3).pipe((0,rt.n)(()=>this.sdkService.client$.pipe((0,p.T)(t=>t.vault().totp().generate_totp(e)))),(0,Bi.t)({refCount:!0,bufferSize:1}))}},deps:[Ys.K5]}),(0,oe.F)({provide:q.B,useClass:class{constructor(e,t,i,n,r,s,o,a){this.singleUserStateProvider=e,this.globalStateProvider=t,this.platformSupportsSecureStorage=i,this.secureStorageService=n,this.keyGenerationService=r,this.encryptService=s,this.logService=o,this.logoutCallback=a,this.accessTokenKeySecureStorageKey="_accessTokenKey",this.refreshTokenSecureStorageKey="_refreshToken",this.initializeState()}hasAccessToken$(e){return(0,bi.z)([this.singleUserStateProvider.get(e,_i).state$,this.singleUserStateProvider.get(e,en).state$]).pipe((0,p.T)(([e,t])=>Boolean(e||t)))}initializeState(){this.emailTwoFactorTokenRecordGlobalState=this.globalStateProvider.get(rn),this.activeUserIdGlobalState=this.globalStateProvider.get(y.xU)}setTokens(e,t,i,n,r){return un(this,void 0,void 0,function*(){if(!e)throw new Error("Access token is required.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const s=yield this.getUserIdFromAccessToken(e);if(!s)throw new Error("User id not found. Cannot set tokens.");const o=yield this._setAccessToken(e,t,i,s),a=new Zi(o);if(n&&(a.refreshToken=yield this.setRefreshToken(n,t,i,s)),null!=r){const e=yield this.setClientId(r[0],t,i,s),n=yield this.setClientSecret(r[1],t,i,s);a.clientIdSecretPair=[e,n]}return a})}getAccessTokenKey(e){return un(this,void 0,void 0,function*(){const t=yield this.secureStorageService.get(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e));if(!t)return null;return Ji.e.fromJSON(t)})}createAndSaveAccessTokenKey(e){return un(this,void 0,void 0,function*(){const t=yield this.keyGenerationService.createKey(512);yield this.secureStorageService.save(`${e}${this.accessTokenKeySecureStorageKey}`,t,this.getSecureStorageOptions(e));if(!(yield this.getAccessTokenKey(e)))throw new Error("New Access token key unable to be retrieved from secure storage.");return t})}clearAccessTokenKey(e){return un(this,void 0,void 0,function*(){yield this.secureStorageService.remove(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e))})}getOrCreateAccessTokenKey(e){return un(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 un(this,void 0,void 0,function*(){const i=yield this.getOrCreateAccessTokenKey(t);return yield this.encryptService.encryptString(e,i)})}decryptAccessToken(e,t){return un(this,void 0,void 0,function*(){if(!e)throw new Error("decryptAccessToken: Access token key required. Cannot decrypt access token.");try{return yield this.encryptService.decryptString(t,e)}catch(i){throw this.logService.error("[TokenService] Error decrypting access token",i),i}})}_setAccessToken(e,t,i,n){return un(this,void 0,void 0,function*(){switch(yield this.determineStorageLocation(t,i,!0)){case dn.SecureStorage:{let t=null;try{const i=yield this.encryptAccessToken(e,n);yield this.singleUserStateProvider.get(n,_i).update(e=>i.encryptedString,{shouldUpdate:e=>e!==i.encryptedString}),t=e,yield this.singleUserStateProvider.get(n,en).update(e=>null)}catch(r){this.logService.error("SetAccessToken: storing encrypted access token in secure storage failed. Falling back to disk storage.",r),t=yield this.singleUserStateProvider.get(n,_i).update(t=>e,{shouldUpdate:t=>t!==e})}return t}case dn.Disk:return yield this.singleUserStateProvider.get(n,_i).update(t=>e,{shouldUpdate:t=>t!==e});case dn.Memory:return yield this.singleUserStateProvider.get(n,en).update(t=>e)}})}setAccessToken(e,t,i){return un(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.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");return yield this._setAccessToken(e,t,i,n)})}clearAccessToken(e){return un(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,u._)(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,_i).update(e=>null,{shouldUpdate:e=>null!==e}),yield this.singleUserStateProvider.get(e,en).update(e=>null)})}getAccessToken(e){return un(this,void 0,void 0,function*(){if(!e)return null;const t=yield this.getStateValueByUserIdAndKeyDef(e,en);if(null!=t)return t;const i=yield this.getStateValueByUserIdAndKeyDef(e,_i);if(!i)return null;if(this.platformSupportsSecureStorage){let t;try{t=yield this.getAccessTokenKey(e)}catch(n){return Di.k.isSerializedEncString(i)?(this.logService.error("Access token key retrieval failed. Unable to decrypt encrypted access token. Logging user out.",n),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null):i}if(!t)return Di.k.isSerializedEncString(i)?(this.logService.error("Access token key not found to decrypt encrypted access token. Logging user out."),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null):i;try{const e=new Di.k(i);return yield this.decryptAccessToken(t,e)}catch(n){return this.logService.error("Failed to decrypt access token",n),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null}}return i})}setRefreshToken(e,t,i,n){return un(this,void 0,void 0,function*(){if(!n)throw new Error("User id not found. Cannot save refresh token.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");switch(yield this.determineStorageLocation(t,i,!0)){case dn.SecureStorage:{let t=null;try{yield this.saveStringToSecureStorage(n,this.refreshTokenSecureStorageKey,e);const i=yield this.getStringFromSecureStorage(n,this.refreshTokenSecureStorageKey);if(null!==e&&!i)throw new Error("Refresh token failed to save to secure storage.");t=e,yield this.singleUserStateProvider.get(n,tn).update(e=>null,{shouldUpdate:e=>null!==e}),yield this.singleUserStateProvider.get(n,nn).update(e=>null)}catch(r){this.logService.error("SetRefreshToken: storing refresh token in secure storage failed. Falling back to disk storage.",r),t=yield this.singleUserStateProvider.get(n,tn).update(t=>e,{shouldUpdate:t=>t!==e})}return t}case dn.Disk:return yield this.singleUserStateProvider.get(n,tn).update(t=>e,{shouldUpdate:t=>t!==e});case dn.Memory:return yield this.singleUserStateProvider.get(n,nn).update(t=>e)}})}getRefreshToken(e){return un(this,void 0,void 0,function*(){if(!e)return null;const t=yield this.getStateValueByUserIdAndKeyDef(e,nn);if(null!=t)return t;const i=yield this.getStateValueByUserIdAndKeyDef(e,tn);if(null!=i)return i;if(this.platformSupportsSecureStorage)try{const t=yield this.getStringFromSecureStorage(e,this.refreshTokenSecureStorageKey);if(null!=t)return t;this.logService.error("Refresh token not found in secure storage. Access token will fail to refresh upon expiration or manual refresh.")}catch(n){this.logService.error("Failed to retrieve refresh token from secure storage",n),yield this.logoutCallback("refreshTokenSecureStorageRetrievalFailure",e)}return null})}clearRefreshToken(e){return un(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,nn).update(e=>null),yield this.singleUserStateProvider.get(e,tn).update(e=>null,{shouldUpdate:e=>null!==e})})}setClientId(e,t,i,n){return un(this,void 0,void 0,function*(){if(null!=n||(n=yield(0,u._)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client id.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const r=yield this.determineStorageLocation(t,i,!1);return r===dn.Disk?yield this.singleUserStateProvider.get(n,sn).update(t=>e):r===dn.Memory?yield this.singleUserStateProvider.get(n,on).update(t=>e):void 0})}getClientId(e){return un(this,void 0,void 0,function*(){if(!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,on);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,sn)})}clearClientId(e){return un(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,u._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client id.");yield this.singleUserStateProvider.get(e,on).update(e=>null),yield this.singleUserStateProvider.get(e,sn).update(e=>null)})}setClientSecret(e,t,i,n){return un(this,void 0,void 0,function*(){if(null!=n||(n=yield(0,u._)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client secret.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const r=yield this.determineStorageLocation(t,i,!1);return r===dn.Disk?yield this.singleUserStateProvider.get(n,an).update(t=>e):r===dn.Memory?yield this.singleUserStateProvider.get(n,ln).update(t=>e):void 0})}getClientSecret(e){return un(this,void 0,void 0,function*(){if(!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,ln);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,an)})}clearClientSecret(e){return un(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,u._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client secret.");yield this.singleUserStateProvider.get(e,ln).update(e=>null),yield this.singleUserStateProvider.get(e,an).update(e=>null)})}setTwoFactorToken(e,t){return un(this,void 0,void 0,function*(){yield this.emailTwoFactorTokenRecordGlobalState.update(i=>(null!=i||(i={}),i[e]=t,i))})}getTwoFactorToken(e){return un(this,void 0,void 0,function*(){const t=yield(0,u._)(this.emailTwoFactorTokenRecordGlobalState.state$);return t?t[e]:null})}clearTwoFactorToken(e){return un(this,void 0,void 0,function*(){yield this.emailTwoFactorTokenRecordGlobalState.update(t=>(null!=t||(t={}),delete t[e],t))})}clearTokens(e){return un(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,u._)(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 un(this,void 0,void 0,function*(){let t=e;if(at.A.isGuid(e)?t=yield this.getAccessToken(e):null!=t||(t=yield this.getAccessToken(yield(0,u._)(this.activeUserIdGlobalState.state$))),null==t)throw new Error("Access token not found.");return(0,v.iD)(t)})}getTokenExpirationDate(e){return un(this,void 0,void 0,function*(){let t;try{t=yield this.decodeAccessToken(e)}catch(n){throw new Error("Failed to decode access token: "+n.message)}if(!t||"number"!=typeof t.exp)return null;const i=new Date(0);return i.setUTCSeconds(t.exp),i})}tokenSecondsRemaining(e){return un(this,arguments,void 0,function*(e,t=0){const i=yield this.getTokenExpirationDate(e);if(null==i)return 0;const n=i.valueOf()-((new Date).valueOf()+1e3*t);return Math.round(n/1e3)})}tokenNeedsRefresh(e){return un(this,arguments,void 0,function*(e,t=5){return(yield this.tokenSecondsRemaining(e))<60*t})}getUserId(){return un(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 un(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 un(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 un(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 un(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 un(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(e){return un(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)}return Array.isArray(t.amr)&&t.amr.includes("external")})}getSecurityStamp(e){return un(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,u._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot get security stamp.");return yield this.getStateValueByUserIdAndKeyDef(e,cn)})}setSecurityStamp(e,t){return un(this,void 0,void 0,function*(){if(null!=t||(t=yield(0,u._)(this.activeUserIdGlobalState.state$)),!t)throw new Error("User id not found. Cannot set security stamp.");yield this.singleUserStateProvider.get(t,cn).update(t=>e)})}getStateValueByUserIdAndKeyDef(e,t){return un(this,void 0,void 0,function*(){return yield(0,u._)(this.singleUserStateProvider.get(e,t).state$)})}determineStorageLocation(e,t,i){return un(this,void 0,void 0,function*(){if(null==e)throw new Error("TokenService - determineStorageLocation: We expect the vault timeout action to always exist at this point.");if(null==t)throw new Error("TokenService - determineStorageLocation: We expect the vault timeout to always exist at this point.");return e===Wi.W4.LogOut&&t!==Wi.Lw.Never?dn.Memory:i&&this.platformSupportsSecureStorage?dn.SecureStorage:dn.Disk})}saveStringToSecureStorage(e,t,i){return un(this,void 0,void 0,function*(){yield this.secureStorageService.save(`${e}${t}`,i,this.getSecureStorageOptions(e))})}getStringFromSecureStorage(e,t){return un(this,void 0,void 0,function*(){return yield this.secureStorageService.get(`${e}${t}`,this.getSecureStorageOptions(e))})}getSecureStorageOptions(e){return{storageLocation:$i.$B.Disk,useSecureStorage:!0,userId:e}}},deps:[w.Ys,w.Y2,ae.Vc,ae.G$,Qr.$9,Tr.N,Vs.K,ae.dZ]}),(0,oe.F)({provide:Qr.$9,useClass:Qr.Gn,deps:[kr.R]}),(0,oe.F)({provide:b.Lu,useClass:b.gX,deps:[vs.O,Qr.$9,kr.R,Tr.N,V.y,Vs.K,w.dw,Y.D,w.v2,b.zZ,Br.h]}),(0,oe.F)({provide:Fs.p,useClass:class{constructor(e){this.accountCryptographicStateService=e}accountSecurityState$(e){return this.accountCryptographicStateService.accountCryptographicState$(e).pipe((0,p.T)(e=>null==e?null:"V2"in e?e.V2.security_state:null))}},deps:[Br.h]}),(0,oe.F)({provide:gd.b,useClass:gd.b,deps:[Y.D,f.PV,me.m]}),(0,oe.F)({provide:kl.Q,useClass:kl.y,deps:[]}),(0,oe.F)({provide:Rd.JJ,useFactory:Rd.Im,deps:[Tr.N,b.Lu,me.m,Y.D,w.v2]}),(0,oe.F)({provide:Pd.ZS,useClass:Pd.Kt,deps:[Tr.N,b.Lu,w.v2]}),(0,oe.F)({provide:Rd.GL,useFactory:Rd.pV,deps:[de.G,U.W,b.Lu,Tr.N,me.m,Y.D,w.v2]}),(0,oe.F)({provide:ae.Ug,useFactory:(e,t)=>()=>{e.showToast({variant:"error",title:t.t("errorRefreshingAccessToken"),message:t.t("errorRefreshingAccessTokenDesc")})},deps:[P.f,U.W]}),(0,oe.F)({provide:ae.Kk,useValue:{createRequest:(e,t)=>new Request(e,t)}}),(0,oe.F)({provide:de.G,useClass:Sl,deps:[q.B,V.y,Gs.v,xs.Y,ae.Ug,Vs.K,ae.dZ,Wi.ep,Y.D,ae.Kk]}),(0,oe.F)({provide:_l,useExisting:ec}),(0,oe.F)({provide:ec,useClass:class{constructor(e,t,i,n,r,s,o){this.accountService=e,this.keyService=t,this.i18nService=i,this.keyGenerationService=n,this.stateProvider=r,this.encryptService=s,this.configService=o,this.sendKeySalt="bitwarden-send",this.sendKeyPurpose="send",this.sends$=this.stateProvider.encryptedState$.pipe((0,p.T)(([,e])=>Object.values(e||{}).map(e=>new Gl(e)))),this.sendViews$=this.stateProvider.encryptedState$.pipe((0,ra.H)(([e,t])=>this.decryptSends(Object.values(t||{}).map(e=>new Gl(e)),e)))}encrypt(e,t,i,n){return Zl(this,void 0,void 0,function*(){var r,s;let o=null;const a=new Gl;if(a.id=e.id,a.type=e.type,a.disabled=e.disabled,a.hideEmail=e.hideEmail,a.maxAccessCount=e.maxAccessCount,a.deletionDate=e.deletionDate,a.expirationDate=e.expirationDate,null==e.key){const t=yield this.keyGenerationService.createKeyWithPurpose(128,this.sendKeyPurpose,this.sendKeySalt);e.key=t.material,e.cryptoKey=t.derivedKey}const l=yield this.configService.getFeatureFlag(dr.TO.SendEmailOTP),c=(null!==(s=null===(r=e.emails)||void 0===r?void 0:r.length)&&void 0!==s?s:0)>0;if(l&&c)a.emails=e.emails.map(e=>e.trim()).join(",").toLocaleLowerCase(),a.password=null;else if(a.emails=null,null!=i){const t=yield this.keyGenerationService.deriveKeyFromPassword(i,e.key,new b.n1(Rs));a.password=t.keyB64}const d=(yield(0,u._)(this.accountService.activeAccount$)).id;if(null==n&&(n=yield(0,u._)(this.keyService.userKey$(d))),a.key=yield this.encryptService.encryptBytes(e.key,n),a.name=null!=e.name?yield this.encryptService.encryptString(e.name,e.cryptoKey):null,a.notes=null!=e.notes?yield this.encryptService.encryptString(e.notes,e.cryptoKey):null,a.type===ja.Text)a.text=new xl,a.text.text=yield this.encryptService.encryptString(e.text.text,e.cryptoKey),a.text.hidden=e.text.hidden;else if(a.type===ja.File&&(a.file=new Ml,null!=t))if(t instanceof ArrayBuffer){const[i,n]=yield this.encryptFileData(e.file.fileName,t,e.cryptoKey,d);a.file.fileName=i,o=n}else o=yield this.parseFile(a,t,e.cryptoKey,d);return a.authType=e.authType,[a,o]})}get$(e){return this.sends$.pipe((0,hi.F)((t,i)=>{const n=t.find(t=>t.id===e),r=i.find(t=>t.id===e);if(!n||!r)return!1;const s=Object.keys(r).every(e=>{if(null!=n[e]&&null===r[e]||null===n[e]&&null!=r[e])return!1;switch(e){case"name":case"notes":case"key":return null===n[e]&&null===r[e]||n[e].encryptedString===r[e].encryptedString;case"text":return null==n[e].text&&null==r[e].text||!(null!=n[e].text&&null==r[e].text||null==n[e].text&&null!=r[e].text)&&n[e].text.encryptedString===r[e].text.encryptedString;case"file":return!0;case"revisionDate":case"expirationDate":case"deletionDate":return null===n[e]&&null===r[e]||n[e].getTime()===r[e].getTime();default:return n[e]===r[e]}});return s}),(0,p.T)(t=>t.find(t=>t.id===e)))}getFromState(e){return Zl(this,void 0,void 0,function*(){const[,t]=yield this.stateProvider.getEncryptedSends();return null!=t&&t.hasOwnProperty(e)?new Gl(t[e]):null})}getAll(){return Zl(this,void 0,void 0,function*(){const[,e]=yield this.stateProvider.getEncryptedSends(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new Gl(e[i]));return t})}getAllDecryptedFromState(e){return Zl(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");let t=yield this.stateProvider.getDecryptedSends();if(null!=t)return t;t=[];if(!(yield this.keyService.hasUserKey(e)))throw new Error("No user key found.");const i=[];return(yield this.getAll()).forEach(n=>{i.push(n.decrypt(e).then(e=>t.push(e)))}),yield Promise.all(i),t.sort(at.A.getSortFunction(this.i18nService,"name")),yield this.stateProvider.setDecryptedSends(t),t})}upsert(e){return Zl(this,void 0,void 0,function*(){const[t,i]=yield this.stateProvider.getEncryptedSends();let n=i;if(null==n&&(n={}),e instanceof Ya){const t=e;n[t.id]=t}else e.forEach(e=>{n[e.id]=e});yield this.replace(n,t)})}delete(e){return Zl(this,void 0,void 0,function*(){const[t,i]=yield this.stateProvider.getEncryptedSends();if(null!=i){if("string"==typeof e){if(null==i[e])return;delete i[e]}else e.forEach(e=>{delete i[e]});yield this.replace(i,t)}})}replace(e,t){return Zl(this,void 0,void 0,function*(){yield this.stateProvider.setEncryptedSends(e,t)})}getRotatedData(e,t,i){return Zl(this,void 0,void 0,function*(){if(null==t)throw new Error("New user key is required for rotation.");if(null==e)throw new Error("Original user key is required for rotation.");return yield(0,u._)(this.sends$.pipe((0,ra.H)(i=>Zl(this,void 0,void 0,function*(){return this.toRotatedKeyRequestMap(i,e,t)}))))})}toRotatedKeyRequestMap(e,t,i){return Zl(this,void 0,void 0,function*(){return yield Promise.all(e.map(e=>Zl(this,void 0,void 0,function*(){const n=yield this.encryptService.decryptBytes(e.key,t);return e.key=yield this.encryptService.encryptBytes(n,i),new Jl(e)})))})}parseFile(e,t,i,n){return new Promise((r,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>Zl(this,void 0,void 0,function*(){try{const[s,a]=yield this.encryptFileData(t.name,o.target.result,i,n);e.file.fileName=s,r(a)}catch(a){s(a)}}),o.onerror=()=>{s("Error reading file.")}})}encryptFileData(e,t,i,n){return Zl(this,void 0,void 0,function*(){null==i&&(i=yield(0,u._)(this.keyService.userKey$(n)));return[yield this.encryptService.encryptString(e,i),yield this.encryptService.encryptFileData(new Uint8Array(t),i)]})}decryptSends(e,t){return Zl(this,void 0,void 0,function*(){const i=e.map(e=>e.decrypt(t)),n=yield Promise.all(i);return n.sort(at.A.getSortFunction(this.i18nService,"name")),n})}},deps:[Y.D,b.Lu,U.W,Qr.$9,$l,Tr.N,z.w]}),(0,oe.F)({provide:$l,useClass:class{constructor(e){this.stateProvider=e,this.activeUserEncryptedState=this.stateProvider.getActive(ql),this.encryptedState$=this.activeUserEncryptedState.combinedState$,this.activeUserDecryptedState=this.stateProvider.getActive(Hl),this.decryptedState$=this.activeUserDecryptedState.state$}getEncryptedSends(){return Wl(this,void 0,void 0,function*(){return yield(0,u._)(this.encryptedState$)})}setEncryptedSends(e,t){return Wl(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,ql).update(()=>e)})}getDecryptedSends(){return Wl(this,void 0,void 0,function*(){return yield(0,u._)(this.decryptedState$)})}setDecryptedSends(e){return Wl(this,void 0,void 0,function*(){yield this.activeUserDecryptedState.update(()=>e)})}},deps:[w.v2]}),(0,oe.F)({provide:Xl,useClass:class{constructor(e,t,i){this.apiService=e,this.fileUploadService=t,this.sendService=i}getSend(e){return Kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/sends/"+e,null,!0,!0);return new Yl.o(t)})}postSendAccess(e,t,i){return Kl(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 Nl(n)})}postSendAccessV2(e,t){return Kl(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/sends/access",null,!1,!0,t,t=>{t.set("Authorization","Bearer "+e.token)});return new Nl(i)})}getSendFileDownloadData(e,t,i){return Kl(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 zl(n)})}getSendFileDownloadDataV2(e,t,i){return Kl(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST","/sends/access/file/"+e.file.id,null,!1,!0,i,e=>{e.set("Authorization","Bearer "+t.token)});return new zl(n)})}getSends(){return Kl(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/sends",null,!0,!0);return new je.s(e,Yl.o)})}postSend(e){return Kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/sends",e,!0,!0);return new Yl.o(t)})}postFileTypeSend(e){return Kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/sends/file/v2",e,!0,!0);return new Ll(t)})}renewSendFileUploadUrl(e,t){return Kl(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/sends/"+e+"/file/"+t,null,!0,!0);return new Ll(i)})}postSendFile(e,t,i){return this.apiService.send("POST","/sends/"+e+"/file/"+t,i,!0,!1)}putSend(e,t){return Kl(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/sends/"+e,t,!0,!0);return new Yl.o(i)})}putSendRemovePassword(e){return Kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/sends/"+e+"/remove-password",null,!0,!0);return new Yl.o(t)})}deleteSend(e){return this.apiService.send("DELETE","/sends/"+e,null,!0,!1)}save(e){return Kl(this,void 0,void 0,function*(){const t=yield this.upload(e),i=new Ya(t);return yield this.sendService.upsert(i),new Gl(i)})}delete(e){return Kl(this,void 0,void 0,function*(){yield this.deleteSend(e),yield this.sendService.delete(e)})}removePassword(e){return Kl(this,void 0,void 0,function*(){const t=yield this.putSendRemovePassword(e),i=new Ya(t);yield this.sendService.upsert(i)})}upload(e){return Kl(this,void 0,void 0,function*(){var t;const i=new jl(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===ja.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(r){throw r instanceof ot._?new Error(r.getSingleMessage()):r}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()=>Kl(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)}},deps:[de.G,Us,ec]}),(0,oe.F)({provide:class{},useClass:class{constructor(e){this.apiService=e}getUserPublicKeys(e){return As(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/users/"+e+"/keys",null,!0,!0);return new hs(t)})}},deps:[de.G]}),(0,oe.F)({provide:Ga.H,useClass:class extends qa{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,I,b,B,E,S){super(w,r,p,l,u,s,a,i,t,I,d,v,b),this.masterPasswordService=e,this.domainSettingsService=n,this.keyService=o,this.policyService=c,this.keyConnectorService=h,this.providerService=A,this.organizationService=g,this.userDecryptionOptionsService=f,this.avatarService=m,this.logoutCallback=y,this.billingAccountProfileStateService=C,this.securityStateService=B,this.kdfConfigService=E,this.accountCryptographicStateService=S,this.syncInProgress=!1,this.inFlightApiCalls={refreshToken:null,sync:null}}fullSync(e,t){return Ha(this,void 0,void 0,function*(){const{allowThrowOnError:i=!1,skipTokenRefresh:n=!1}="boolean"==typeof t?{allowThrowOnError:t}:null!=t?t:{},r=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));this.syncStarted();if((yield(0,u._)(this.authService.authStatusFor$(r)))===m.J.LoggedOut)return this.syncCompleted(!1,r);const s=new Date;let o=!1,a=!0;try{o=yield this.needsSyncing(e)}catch(l){if(a=!1,i)throw this.syncCompleted(!1,r),l}if(!o)return a&&(yield this.setLastSync(s,r)),this.syncCompleted(!1,r);try{n||(null===this.inFlightApiCalls.refreshToken&&(this.inFlightApiCalls.refreshToken=this.apiService.refreshIdentityToken()),yield this.inFlightApiCalls.refreshToken),null===this.inFlightApiCalls.sync?this.inFlightApiCalls.sync=this.apiService.getSync():this.logService.debug("Sync: Sync network call already in progress, returning existing promise");const e=yield this.inFlightApiCalls.sync;return yield this.cipherService.clear(e.profile.id),yield this.syncUserDecryption(e.profile.id,e.userDecryption),yield this.syncProfile(e.profile),yield this.syncFolders(e.folders,e.profile.id),yield this.syncCollections(e.collections,e.profile.id),yield this.syncCiphers(e.ciphers,e.profile.id),yield this.syncSends(e.sends,e.profile.id),yield this.syncSettings(e.domains,e.profile.id),yield this.syncPolicies(e.policies,e.profile.id),yield this.setLastSync(s,r),this.syncCompleted(!0,r)}catch(l){if(i)throw this.syncCompleted(!1,r),l;return this.syncCompleted(!1,r)}finally{this.inFlightApiCalls.refreshToken=null,this.inFlightApiCalls.sync=null}})}needsSyncing(e){return Ha(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 i<0&&this.logoutCallback&&(yield this.logoutCallback("accountDeleted")),!(new Date(i)<=t)})}syncProfile(e){return Ha(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("invalidSecurityStamp")),new Error("Stamp has changed");(null==e?void 0:e.key)&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,e.id)),null!=e.accountKeys?yield this.accountCryptographicStateService.setAccountCryptographicState(e.accountKeys.toWrappedAccountCryptographicState(),e.id):yield this.accountCryptographicStateService.setAccountCryptographicState({V1:{private_key:e.privateKey}},e.id),yield this.keyService.setProviderKeys(e.providers,e.id),yield this.keyService.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.accountService.setAccountCreationDate(e.id,new Date(e.creationDate)),yield this.accountService.setAccountVerifyNewDeviceLogin(e.id,e.verifyDevices),yield this.billingAccountProfileStateService.setHasPremium(e.premiumPersonally,e.premiumFromOrganization,e.id),yield this.keyConnectorService.setUsesKeyConnector(e.usesKeyConnector,e.id),yield this.setForceSetPasswordReasonIfNeeded(e);const i={};e.providers.forEach(e=>{i[e.id]=new Va(e)}),yield this.providerService.save(i,e.id),yield this.syncProfileOrganizations(e,e.id),(yield(0,u._)(this.keyConnectorService.convertAccountRequired$))&&this.messageSender.send("convertAccountToKeyConnector")})}setForceSetPasswordReasonIfNeeded(e){return Ha(this,void 0,void 0,function*(){var t;e.forcePasswordReset&&(yield this.masterPasswordService.setForceSetPasswordReason(fi.n.AdminForcePasswordReset,e.id));const i=yield(0,u._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e.id));null==i&&this.logService.error("Sync: Account decryption options are null or undefined.");let n=!1;for(const r of e.organizations){const e=r.type===mt.D7.Admin,t=r.type===mt.D7.Owner;if(e||t||r.permissions&&r.permissions.manageResetPassword){n=!0;break}}if(void 0!==i.trustedDeviceOption&&!i.hasMasterPassword&&n){const e=null===(t=yield(0,u._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.masterPasswordService.setForceSetPasswordReason(fi.n.TdeUserWithoutPasswordHasPasswordResetPermission,e)}})}syncProfileOrganizations(e,t){return Ha(this,void 0,void 0,function*(){const i={};e.organizations.forEach(e=>{i[e.id]=new Ie.o(e,{isMember:!0,isProviderUser:!1})}),e.providerOrganizations.forEach(e=>{null==i[e.id]?i[e.id]=new Ie.o(e,{isMember:!1,isProviderUser:!0}):i[e.id].isProviderUser=!0}),yield this.organizationService.replace(i,t)})}syncFolders(e,t){return Ha(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new La(e)}),yield this.folderService.replace(i,t)})}syncCollections(e,t){return Ha(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new Ua.Fw(e)}),yield this.collectionService.replace(i,t)})}syncCiphers(e,t){return Ha(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new ha.A(e)}),yield this.cipherService.replace(i,t)})}syncSends(e,t){return Ha(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new Ya(e)}),yield this.sendService.replace(i,t)})}syncSettings(e,t){return Ha(this,void 0,void 0,function*(){let i=[];return null!=e&&null!=e.equivalentDomains&&(i=i.concat(e.equivalentDomains)),null!=e&&null!=e.globalEquivalentDomains&&e.globalEquivalentDomains.forEach(e=>{e.domains.length>0&&i.push(e.domains)}),this.domainSettingsService.setEquivalentDomains(i,t)})}syncPolicies(e,t){return Ha(this,void 0,void 0,function*(){const i={};return null!=e&&e.forEach(e=>{i[e.id]=new lt.L(e)}),yield this.policyService.replace(i,t)})}syncUserDecryption(e,t){return Ha(this,void 0,void 0,function*(){if(null!=t){if(null!=t.masterPasswordUnlock){const i=t.masterPasswordUnlock.toMasterPasswordUnlockData();yield this.masterPasswordService.setMasterPasswordUnlockData(i,e),yield this.kdfConfigService.setKdfConfig(e,i.kdf)}if(null!=t.webAuthnPrfOptions&&t.webAuthnPrfOptions.length>0)try{const i=yield(0,u._)(this.accountService.activeAccount$);if((null==i?void 0:i.id)!==e)return;const n=yield(0,u._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e)).catch(()=>null);if(null!=n){const e=Object.assign(new v.Xc,n);e.webAuthnPrfOptions=t.webAuthnPrfOptions.map(e=>v._p.fromResponse(e)).filter(e=>void 0!==e),yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(i.id,e)}}catch(i){this.logService.error("[Sync] Failed to update WebAuthn PRF options:",i)}}})}},deps:[vs.O,Y.D,de.G,kn.V,Q.Z,k.p,b.Lu,g.YD,js.U,me.N,ec,Vs.K,as.K,Ce.$,oc.w,f.k4,Xl,v.bj,Et.v,ae.dZ,Rn.Q,q.B,T.u,w.v2,Fs.p,b.zZ,Br.h]}),(0,oe.F)({provide:Br.h,useClass:class{constructor(e){this.stateProvider=e}accountCryptographicState$(e){return this.stateProvider.getUserState$(Sr,e)}setAccountCryptographicState(e,t){return Er(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Sr,e,t)})}clearAccountCryptographicState(e){return Er(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Sr,null,e)})}},deps:[w.v2]}),(0,oe.F)({provide:Md.M,useClass:Md.J,deps:[Ns.vW,Br.h,ys,b.zZ,Y.D,vs.O,kr.R,w.v2,Vs.K,b.Zm]}),(0,oe.F)({provide:S.y,useClass:class{constructor(e){this.messageListener=e,this.subscriptions=new Map}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:[io.qk]}),(0,oe.F)({provide:Wi.ep,useClass:Wi.rq,deps:[Y.D,ys,v.Ym,b.Lu,q.B,me.m,b.vB,w.v2,Vs.K,ae.de,Ms.T]}),(0,oe.F)({provide:Wi.a6,useClass:Wi.a6,deps:[Y.D,V.y,T.u,Wi.ep,mr.Cc,Vs.K,v.FQ,v.k4]}),(0,oe.F)({provide:Wi.nv,useExisting:Wi.a6}),(0,oe.F)({provide:Ft._,useClass:class{constructor(e,t,i){this.stateProvider=e,this.logService=t,this.policyService=i,this.codeVerifierState=this.stateProvider.getGlobal(Yi),this.ssoState=this.stateProvider.getGlobal(Li),this.orgSsoIdentifierState=this.stateProvider.getGlobal(Xi),this.ssoEmailState=this.stateProvider.getGlobal(qi),this.ssoRequiredCacheState=this.stateProvider.getGlobal(Hi),this.ssoRequiredCache$=this.ssoRequiredCacheState.state$.pipe((0,p.T)(e=>new Set(e)))}getCodeVerifier(){return(0,u._)(this.codeVerifierState.state$)}setCodeVerifier(e){return zi(this,void 0,void 0,function*(){yield this.codeVerifierState.update(t=>e)})}getSsoState(){return(0,u._)(this.ssoState.state$)}setSsoState(e){return zi(this,void 0,void 0,function*(){yield this.ssoState.update(t=>e)})}getOrganizationSsoIdentifier(){return(0,u._)(this.orgSsoIdentifierState.state$)}setOrganizationSsoIdentifier(e){return zi(this,void 0,void 0,function*(){yield this.orgSsoIdentifierState.update(t=>e)})}getSsoEmail(){return(0,u._)(this.ssoEmailState.state$)}setSsoEmail(e){return zi(this,void 0,void 0,function*(){yield this.ssoEmailState.update(t=>e)})}clearSsoEmail(){return zi(this,void 0,void 0,function*(){yield this.ssoEmailState.update(e=>null)})}getActiveUserOrganizationSsoIdentifier(e){return(0,u._)(this.userOrgSsoIdentifierState(e).state$)}setActiveUserOrganizationSsoIdentifier(e,t){return zi(this,void 0,void 0,function*(){void 0!==t?yield this.userOrgSsoIdentifierState(t).update(t=>e):this.logService.error("Tried to set a user organization sso identifier with an undefined user id.")})}userOrgSsoIdentifierState(e){return this.stateProvider.getUser(e,Ki)}addToSsoRequiredCache(e){return zi(this,void 0,void 0,function*(){yield this.ssoRequiredCacheState.update(t=>null==t?[e]:[...t,e],{shouldUpdate:t=>null==t||!t.includes(e)})})}removeFromSsoRequiredCacheIfPresent(e){return zi(this,void 0,void 0,function*(){yield this.ssoRequiredCacheState.update(t=>{var i;return null!==(i=null==t?void 0:t.filter(t=>t!==e))&&void 0!==i?i:t},{shouldUpdate:t=>null!=t&&t.includes(e)})})}updateSsoRequiredCache(e,t){return zi(this,void 0,void 0,function*(){(yield(0,u._)(this.policyService.policyAppliesToUser$(mt.tt.RequireSso,t)))?yield this.addToSsoRequiredCache(e.toLowerCase()):yield this.removeFromSsoRequiredCacheIfPresent(e.toLowerCase())})}},deps:[w.v2,Vs.K,me.m]}),(0,oe.F)({provide:w.dw,useClass:Dd.mH,deps:[Ls.zq,ae.G$,Dd.Bz]}),(0,oe.F)({provide:Od.DX,useClass:Od.n_,deps:[Q.k,k.p,Qr.$9,b.Lu,Tr.N,kr.R,b.zZ,de.G,gd.b]}),(0,oe.F)({provide:Od.SF,useClass:Od.Rf,deps:[de.G]}),(0,oe.F)({provide:Od.to,useClass:Od.zo,deps:[k.p,Od.SF,Qr.$9,b.Lu,Tr.N,kr.R,g.YD,b.zZ,gd.b]}),(0,oe.F)({provide:Od.Os,useClass:Od.C8,deps:[Od.DX,Od.to,Y.D]}),(0,oe.F)({provide:j.S,useClass:Id,deps:[Vs.K,U.W,w.v2]}),(0,oe.F)({provide:Co,useClass:Co,deps:[de.G,xs.Y]}),(0,oe.F)({provide:co,useClass:co,deps:[de.G,Vs.K,V.y]}),(0,oe.F)({provide:fo,useClass:vo,deps:[]}),(0,oe.F)({provide:qs,useClass:Hs,deps:[]}),(0,oe.F)({provide:qs,useClass:Hs,deps:[]}),(0,oe.F)({provide:class{},useClass:class{constructor(){this.notificationClicked$=(0,ar.$)(()=>new Error("Notification clicked is not supported."))}create(e){return Wa(this,void 0,void 0,function*(){throw new Error("Create OS Notification unsupported.")})}clear(e){throw new Error("Clear OS Notification unsupported.")}isSupported(){return!1}},deps:[]}),(0,oe.F)({provide:wi,useClass:wi,deps:[w.v2]}),(0,oe.F)({provide:Bt,useClass:class{constructor(e,t,i,n,r){this.accountService=e,this.authService=t,this.masterPasswordService=i,this.messagingService=n,this.pendingAuthRequestsState=r}activeUserMeetsConditionsToShowApprovalDialog(e){return mi(this,void 0,void 0,function*(){if((yield(0,u._)(this.accountService.activeAccount$.pipe(y.bB)))!==e)return!1;if((yield(0,u._)(this.authService.activeAccountStatus$))!==m.J.Unlocked)return!1;return(yield(0,u._)(this.masterPasswordService.forceSetPasswordReason$(e)))===fi.n.None})}setupUnlockListenersForProcessingAuthRequests(e){this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id),(0,hi.F)(),(0,h.p)(e=>null!=e),(0,rt.n)(e=>this.authService.authStatusFor$(e).pipe((0,Ai.s)(1))),(0,h.p)(e=>e===m.J.Unlocked),(0,M.M)(()=>{this.processPendingAuthRequests()}),(0,pi.Q)(e)).subscribe(),this.authService.activeAccountStatus$.pipe((0,gi.Z)(null),(0,vi.J)(),(0,h.p)(([e,t])=>e!==m.J.Unlocked&&t===m.J.Unlocked),(0,pi.Q)(e)).subscribe(()=>{this.processPendingAuthRequests()})}processPendingAuthRequests(){return mi(this,void 0,void 0,function*(){var e;const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));if((yield(0,u._)(this.masterPasswordService.forceSetPasswordReason$(t)))!==fi.n.None)return;yield this.pendingAuthRequestsState.pruneOlderThan(9e5);const i=null!==(e=yield(0,u._)(this.pendingAuthRequestsState.getAll$()))&&void 0!==e?e:[];if(i.length>0){i.some(e=>e.userId===t)&&this.messagingService.send("openLoginApproval")}})}handleAuthRequestNotificationClicked(e){return mi(this,void 0,void 0,function*(){throw new Error("handleAuthRequestNotificationClicked() not implemented for this client")})}},deps:[Y.D,T.u,vs.L,js.U,wi]}),(0,oe.F)({provide:ce.zh,useClass:ce.wG,deps:[z.w,de.G,g.Ki,w.v2,f.k4,g.uB,me.N]}),(0,oe.F)({provide:N,useClass:(0,no.fE)("noopNotifications")?class{constructor(e){this.logService=e,this.notifications$=new d.B}startListening(){return this.logService.info("Initializing no-op notification service, no push server notifications will be received"),oo.yU.EMPTY}reconnectFromActivity(){this.logService.info("Reconnecting notification service from activity")}disconnectFromInactivity(){this.logService.info("Disconnecting notification service from inactivity")}}:class{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A){this.logService=e,this.syncService=t,this.appIdService=i,this.environmentService=n,this.logoutCallback=r,this.messagingService=s,this.accountService=o,this.signalRConnectionService=a,this.authService=l,this.webPushConnectionService=c,this.authRequestAnsweringService=d,this.configService=u,this.policyService=h,this.autoConfirmService=A,this.activitySubject=new _e.t("active"),this.notifications$=this.accountService.accounts$.pipe((0,p.T)(e=>{const t=Object.entries(e).filter(([e,t])=>""!==t.email||t.emailVerified).map(([e,t])=>e);return new Set(t)}),(0,ft.pn)(e=>this.userNotifications$(e).pipe((0,p.T)(t=>[t,e]))),(0,uo.u)())}userNotifications$(e){return this.environmentService.getEnvironment$(e).pipe((0,p.T)(e=>e.getNotificationsUrl()),(0,hi.F)(),(0,rt.n)(t=>"http://-"===t?ho.w:this.userNotificationsHelper$(e,t)))}userNotificationsHelper$(e,t){return this.hasAccessToken$(e).pipe((0,rt.n)(e=>e?this.activitySubject:ho.w),(0,rt.n)(t=>"inactive"===t?ho.w:this.webPushConnectionService.supportStatus$(e)),(i={supported:i=>(this.logService.info("Using WebPush for server notifications"),i.notifications$.pipe((0,cr.W)(i=>(this.logService.warning("Issue with web push, falling back to SignalR",i),this.connectSignalR$(e,t))))),notSupported:()=>(this.logService.info("Using SignalR for server notifications"),this.connectSignalR$(e,t))},(0,rt.n)((e,t)=>"supported"===e.type?i.supported(e.service,t):i.notSupported(e.reason,t))));var i}connectSignalR$(e,t){return this.signalRConnectionService.connect$(e,t).pipe((0,h.p)(e=>"ReceiveMessage"===e.type),(0,p.T)(e=>e.message))}hasAccessToken$(e){return this.authService.authStatusFor$(e).pipe((0,p.T)(e=>e===m.J.Locked||e===m.J.Unlocked),(0,hi.F)())}processNotification(e,t){return po(this,void 0,void 0,function*(){var i,n;const r=yield this.appIdService.getAppId();if(null==e||e.contextId===r)return;const s=(null===(i=e.payload)||void 0===i?void 0:i.userId)||(null===(n=e.payload)||void 0===n?void 0:n.UserId);if(null!=s&&s!==t)return;if((yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id))))===t||go.has(e.type))switch(e.type){case st._n.SyncCipherCreate:case st._n.SyncCipherUpdate:yield this.syncService.syncUpsertCipher(e.payload,e.type===st._n.SyncCipherUpdate,t);break;case st._n.SyncCipherDelete:case st._n.SyncLoginDelete:yield this.syncService.syncDeleteCipher(e.payload,t);break;case st._n.SyncFolderCreate:case st._n.SyncFolderUpdate:yield this.syncService.syncUpsertFolder(e.payload,e.type===st._n.SyncFolderUpdate,t);break;case st._n.SyncFolderDelete:yield this.syncService.syncDeleteFolder(e.payload,t);break;case st._n.SyncVault:case st._n.SyncCiphers:case st._n.SyncSettings:yield this.syncService.fullSync(!1);break;case st._n.SyncOrganizations:yield this.syncService.fullSync(!0);break;case st._n.SyncOrgKeys:yield this.syncService.fullSync(!0),this.activitySubject.next("inactive"),this.activitySubject.next("active");break;case st._n.LogOut:{this.logService.info("[Notifications Service] Received logout notification");const i=e.payload;(yield(0,u._)(this.configService.getFeatureFlag$(dr.TO.NoLogoutOnKdfChange)))&&i.reason===st.Oc.KdfChange?this.logService.info("[Notifications Service] Skipping logout due to no logout KDF change"):yield this.logoutCallback("logoutNotification",t);break}case st._n.SyncSendCreate:case st._n.SyncSendUpdate:yield this.syncService.syncUpsertSend(e.payload,e.type===st._n.SyncSendUpdate);break;case st._n.SyncSendDelete:yield this.syncService.syncDeleteSend(e.payload);break;case st._n.AuthRequest:if(this.authRequestAnsweringService.receivedPendingAuthRequest)try{yield this.authRequestAnsweringService.receivedPendingAuthRequest(e.payload.userId,e.payload.id)}catch(o){this.logService.error(`Failed to process auth request notification: ${o}`)}else this.messagingService.send("openLoginApproval",{notificationId:e.payload.id});break;case st._n.SyncOrganizationStatusChanged:case st._n.SyncOrganizationCollectionSettingChanged:yield this.syncService.fullSync(!0);break;case st._n.OrganizationBankAccountVerified:this.messagingService.send("organizationBankAccountVerified",{organizationId:e.payload.organizationId});break;case st._n.ProviderBankAccountVerified:this.messagingService.send("providerBankAccountVerified",{providerId:e.payload.providerId,adminId:e.payload.adminId});break;case st._n.SyncPolicy:yield this.policyService.syncPolicy(lt.L.fromPolicy(e.payload.policy));break;case st._n.AutoConfirmMember:yield this.autoConfirmService.autoConfirmUser(e.payload.userId,e.payload.targetUserId,e.payload.targetOrganizationUserId,e.payload.organizationId)}})}startListening(){return this.notifications$.pipe((0,Ao.Z)(e=>po(this,[e],void 0,function*([e,t]){try{yield this.processNotification(e,t)}catch(i){this.logService.error(`Problem processing notification of type ${e.type}`,i)}}))).subscribe({error:e=>this.logService.error("Fatal error in server notifications$ observable, notifications won't be recieved anymore.",e)})}reconnectFromActivity(){this.activitySubject.next("active")}disconnectFromInactivity(){this.activitySubject.next("inactive")}},deps:[Vs.K,Ga.H,xs.Y,Gs.v,ae.dZ,js.U,Y.D,co,T.u,fo,Bt,z.w,me.N,ce.zh]}),(0,oe.F)({provide:kr.R,useClass:class{constructor(e){var t;if(null==(null===(t=null==e?void 0:e.crypto)||void 0===t?void 0:t.subtle)){const e=document.createElement("div");e.setAttribute("role","alert"),e.appendChild(document.createTextNode("You are not using a secure context which is required for the Subtle Crypto API to work. "));const t=document.createElement("a");t.appendChild(document.createTextNode("You need to enable HTTPS!")),t.href="https://github.com/dani-garcia/vaultwarden/wiki/Enabling-HTTPS",e.appendChild(t);const i=document.getElementsByClassName("spinner-container")[0];throw i.setAttribute("class","toast-center-center tw-fixed tw-w-full tw-max-w-md tw-mx-auto tw-p-2 tw-ps-4 tw-text-main tw-bg-warning-100 tw-border-solid tw-border-2 tw-border-warning-700 tw-rounded-2xl"),i.replaceChild(e,i.firstChild),new Error("Could not instantiate WebCryptoFunctionService. Could not locate Subtle crypto.")}this.crypto=e.crypto,this.subtle=this.crypto.subtle}pbkdf2(e,t,i,n){return Gr(this,void 0,void 0,function*(){const r="sha256"===i?256:512,s=this.toBuf(e),o={name:"PBKDF2",salt:this.toBuf(t),iterations:n,hash:{name:this.toWebCryptoAlgorithm(i)}},a=yield this.subtle.importKey("raw",s,{name:"PBKDF2"},!1,["deriveBits"]),l=yield this.subtle.deriveBits(o,a,r);return new Uint8Array(l)})}hkdf(e,t,i,n,r){return Gr(this,void 0,void 0,function*(){const s={name:"HKDF",salt:this.toBuf(t),info:this.toBuf(i),hash:{name:this.toWebCryptoAlgorithm(r)}},o=yield this.subtle.importKey("raw",this.toBuf(e),{name:"HKDF"},!1,["deriveBits"]),a=yield this.subtle.deriveBits(s,o,8*n);return new Uint8Array(a)})}hkdfExpand(e,t,i,n){return Gr(this,void 0,void 0,function*(){const r="sha256"===n?32:64;if(i>255*r)throw new Error("outputByteSize is too large.");if(new Uint8Array(e).length<r)throw new Error("prk is too small.");const s=this.toBuf(t),o=new Uint8Array(s);let a=0,l=new Uint8Array(0);const c=Math.ceil(i/r),d=new Uint8Array(c*r);for(let t=0;t<c;t++){const r=new Uint8Array(l.length+o.length+1);if(r.set(l),r.set(o,l.length),r.set([t+1],r.length-1),l=new Uint8Array(yield this.hmac(r,e,n)),d.set(l,a),a+=l.length,a>=i)break}return d.slice(0,i)})}hash(e,t){return Gr(this,void 0,void 0,function*(){if("md5"===t){const t=Or.md.md5.create(),i=this.toByteString(e);return t.update(i,"raw"),at.A.fromByteStringToArray(t.digest().data)}const i=this.toBuf(e),n=yield this.subtle.digest({name:this.toWebCryptoAlgorithm(t)},i);return new Uint8Array(n)})}rsaEncrypt(e,t,i){return Gr(this,void 0,void 0,function*(){return yield Fr.B.Ready,Mr.PureCrypto.rsa_encrypt_data(e,t)})}rsaDecrypt(e,t,i){return Gr(this,void 0,void 0,function*(){return yield Fr.B.Ready,Mr.PureCrypto.rsa_decrypt_data(e,t)})}rsaExtractPublicKey(e){return Gr(this,void 0,void 0,function*(){return yield Fr.B.Ready,Mr.PureCrypto.rsa_extract_public_key(e)})}rsaGenerateKeyPair(e){return Gr(this,void 0,void 0,function*(){yield Fr.B.Ready;const e=Mr.PureCrypto.rsa_generate_keypair();return[yield this.rsaExtractPublicKey(e),e]})}aesGenerateKey(){return Gr(this,arguments,void 0,function*(e=960){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)})}randomBytes(e){const t=new Uint8Array(e);return this.crypto.getRandomValues(t),Promise.resolve(t)}toBuf(e){let t;return t="string"==typeof e?at.A.fromUtf8ToArray(e):e,t}toByteString(e){let t;return t="string"==typeof e?Or.util.encodeUtf8(e):at.A.fromArrayToByteString(this.toBuf(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"}hmac(e,t,i){return Gr(this,void 0,void 0,function*(){const n={name:"HMAC",hash:{name:this.toWebCryptoAlgorithm(i)}},r=yield this.subtle.importKey("raw",this.toBuf(t),n,!1,["sign"]),s=yield this.subtle.sign(n,r,this.toBuf(e));return new Uint8Array(s)})}},deps:[ae.jf]}),(0,oe.F)({provide:Tr.N,useClass:class{constructor(e,t,i){this.cryptoFunctionService=e,this.logService=t,this.logMacFailures=i}encryptString(e,t){return xr(this,void 0,void 0,function*(){return null==e?(this.logService.warning("[EncryptService] WARNING: encryptString called with null value. Returning null, but this behavior is deprecated and will be removed."),null):(yield Fr.B.Ready,new Di.k(Mr.PureCrypto.symmetric_encrypt_string(e,t.toEncoded())))})}encryptBytes(e,t){return xr(this,void 0,void 0,function*(){return yield Fr.B.Ready,new Di.k(Mr.PureCrypto.symmetric_encrypt_bytes(e,t.toEncoded()))})}encryptFileData(e,t){return xr(this,void 0,void 0,function*(){return yield Fr.B.Ready,new Dr(Mr.PureCrypto.symmetric_encrypt_filedata(e,t.toEncoded()))})}decryptString(e,t){return xr(this,void 0,void 0,function*(){if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,Mr.PureCrypto.symmetric_decrypt_string(e.encryptedString,t.toEncoded())})}decryptBytes(e,t){return xr(this,void 0,void 0,function*(){if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,Mr.PureCrypto.symmetric_decrypt_bytes(e.encryptedString,t.toEncoded())})}decryptFileData(e,t){return xr(this,void 0,void 0,function*(){if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,Mr.PureCrypto.symmetric_decrypt_filedata(e.buffer,t.toEncoded())})}wrapDecapsulationKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No decapsulation key provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield Fr.B.Ready,new Di.k(Mr.PureCrypto.wrap_decapsulation_key(e,t.toEncoded()))})}wrapEncapsulationKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No encapsulation key provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield Fr.B.Ready,new Di.k(Mr.PureCrypto.wrap_encapsulation_key(e,t.toEncoded()))})}wrapSymmetricKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No keyToBeWrapped provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield Fr.B.Ready,new Di.k(Mr.PureCrypto.wrap_symmetric_key(e.toEncoded(),t.toEncoded()))})}unwrapDecapsulationKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No wrappedDecapsulationKey provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,Mr.PureCrypto.unwrap_decapsulation_key(e.encryptedString,t.toEncoded())})}unwrapEncapsulationKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No wrappedEncapsulationKey provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,Mr.PureCrypto.unwrap_encapsulation_key(e.encryptedString,t.toEncoded())})}unwrapSymmetricKey(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No keyToBeUnwrapped provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(e.encryptionType===$i.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield Fr.B.Ready,new Ji.e(Mr.PureCrypto.unwrap_symmetric_key(e.encryptedString,t.toEncoded()))})}hash(e,t){return xr(this,void 0,void 0,function*(){const i=yield this.cryptoFunctionService.hash(e,t);return at.A.fromBufferToB64(i)})}encapsulateKeyUnsigned(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No sharedKey provided for encapsulation");if(null==t)throw new Error("No encapsulationKey provided for encapsulation");return yield Fr.B.Ready,new Di.k(Mr.PureCrypto.encapsulate_key_unsigned(e.toEncoded(),t))})}decapsulateKeyUnsigned(e,t){return xr(this,void 0,void 0,function*(){if(null==e)throw new Error("No encryptedSharedKey provided for decapsulation");if(null==t)throw new Error("No decapsulationKey provided for decapsulation");yield Fr.B.Ready;const i=Mr.PureCrypto.decapsulate_key_unsigned(e.encryptedString,t);return new Ji.e(i)})}},deps:[kr.R,Vs.K,ae.Pn]}),(0,oe.F)({provide:C.fH,useClass:class{constructor(e,t,i,n,r){this.apiService=e,this.stateProvider=t,this.logService=i,this.authService=n,this.taskSchedulerService=r,this.inited=!1}init(e){this.inited||(this.inited=!0,this.taskSchedulerService.registerTaskHandler(mr.fq.eventUploadsInterval,()=>this.uploadEvents()),e&&(this.uploadEvents(),this.taskSchedulerService.setInterval(mr.fq.eventUploadsInterval,6e4)))}uploadEvents(e){return Cr(this,void 0,void 0,function*(){if(e||(e=yield(0,u._)(this.stateProvider.activeUserId$)),!e)return;if(!(yield(0,u._)(this.authService.authStatusFor$(e).pipe((0,p.T)(e=>e===m.J.Unlocked)))))return;const t=yield this.takeEvents(e);if(null==t||0===t.length)return;const i=t.map(e=>{const t=new yr;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(vr.k,t,e)}})}takeEvents(e){return Cr(this,void 0,void 0,function*(){let t=null;return yield this.stateProvider.getUser(e,vr.k).update(e=>(t=null!=e?e:[],[])),t})}},deps:[de.G,w.v2,Vs.K,T.u,mr.Cc]}),(0,oe.F)({provide:C.c_,useClass:class{constructor(e,t,i,n,r,s){this.cipherService=e,this.stateProvider=t,this.organizationService=i,this.eventUploadService=n,this.authService=r,this.accountService=s,this.getOrgIds=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:[]}}collectMany(e,t){return fr(this,arguments,void 0,function*(e,t,i=!1){const n=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),r=this.stateProvider.getUser(n,vr.k);if(!(yield this.shouldUpdate(n,null,e,t)))return;const s=this.organizationService.organizations$(n).pipe((0,p.T)(e=>this.getOrgIds(e)),(0,p.T)(i=>t.filter(e=>i.includes(e.organizationId)).map(t=>({type:e,cipherId:t.id,date:(new Date).toISOString(),organizationId:t.organizationId}))));yield r.update((e,t)=>[...null!=e?e:[],...t],{combineLatestWith:s}),i&&(yield this.eventUploadService.uploadEvents())})}collect(e){return fr(this,arguments,void 0,function*(e,t=null,i=!1,n=null){const r=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),s=this.stateProvider.getUser(r,vr.k);if(!(yield this.shouldUpdate(r,n,e,void 0,t)))return;const o=new gr.R;o.type=e,o.cipherId=t,o.date=(new Date).toISOString(),o.organizationId=n,yield s.update(e=>((e=null!=e?e:[]).push(o),e)),i&&(yield this.eventUploadService.uploadEvents())})}shouldUpdate(e){return fr(this,arguments,void 0,function*(e,t=null,i=null,n=[],r){const s=(0,jt.H)(this.cipherService.get(r,e)),o=this.organizationService.organizations$(e).pipe((0,p.T)(e=>this.getOrgIds(e))),[a,l,c]=yield(0,u._)((0,hr.y)(this.authService.activeAccountStatus$,o,s));if(a!=m.J.Unlocked)return!1;if(null==l||0==l.length)return!1;if(i==pr.B.User_ClientExportedVault)return!0;if(null!=c&&n.push(new Ar.f(c)),(null==n||0==n.length)&&null==t)return!1;if(null!=n&&n.length>0){return n.filter(e=>l.includes(e.organizationId)).length>0}return!(null!=t&&!l.includes(t))})}},deps:[k.p,w.v2,f.PV,C.fH,T.u,Y.D]}),(0,oe.F)({provide:me.N,useClass:nt.XS,deps:[w.v2,f.PV,Y.D]}),(0,oe.F)({provide:me.m,useExisting:me.N}),(0,oe.F)({provide:fe.m,useClass:class{constructor(e,t,i){this.policyService=e,this.apiService=t,this.accountService=i}getPolicy(e,t){return ut(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/policies/"+t,null,!0,!0);return new dt.i(i)})}getPolicies(e){return ut(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies",null,!0,!0);return new je.s(t,dt.i)})}getPoliciesByToken(e,t,i,n){return ut(this,void 0,void 0,function*(){const r=yield this.apiService.send("GET","/organizations/"+e+"/policies/token?token="+encodeURIComponent(t)+"&email="+at.A.encodeRFC3986URIComponent(i)+"&organizationUserId="+n,null,!1,!0);return ct.P.fromListResponse(new je.s(r,dt.i))})}getMasterPasswordPolicyResponseForOrgUser(e){return ut(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies/master-password",null,!0,!0);return new dt.i(t)})}getMasterPasswordPolicyOptsForOrgUser(e){return ut(this,void 0,void 0,function*(){try{const t=yield this.getMasterPasswordPolicyResponseForOrgUser(e),i=ct.P.fromResponse(t);return i?(0,u._)(this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.masterPasswordPolicyOptions$(e,[i])),(0,p.T)(e=>null!=e?e:null))):null}catch(t){if(t instanceof ot._&&t.statusCode===st.kG.NotFound)return null;throw t}})}putPolicy(e,t,i){return ut(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/policies/"+t,i,!0,!0);yield this.handleResponse(n)})}putPolicyVNext(e,t,i){return ut(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT",`/organizations/${e}/policies/${t}/vnext`,i,!0,!0);yield this.handleResponse(n)})}handleResponse(e){return ut(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),i=new dt.i(e),n=new lt.L(i);yield this.policyService.upsert(n,t)})}},deps:[me.N,de.G,Y.D]}),(0,oe.F)({provide:vs.O,useClass:ms.xg,deps:[w.v2,Qr.$9,Vs.K,kr.R,Y.D]}),(0,oe.F)({provide:vs.L,useExisting:vs.O}),(0,oe.F)({provide:gs.b,useClass:class{constructor(e,t,i){this.masterPasswordService=e,this.keyService=t,this.logService=i}unlockWithMasterPassword(e,t){return fs(this,void 0,void 0,function*(){this.validateInput(e,t);const i=yield(0,u._)(this.masterPasswordService.masterPasswordUnlockData$(t));if(null==i)throw new Error("Master password unlock data was not found for the user "+t);const n=yield this.masterPasswordService.unwrapUserKeyFromMasterPasswordUnlockData(e,i);return yield this.setLegacyState(e,i,t),n})}proofOfDecryption(e,t){return fs(this,void 0,void 0,function*(){this.validateInput(e,t);try{const i=yield(0,u._)(this.masterPasswordService.masterPasswordUnlockData$(t));if(null==i)return this.logService.warning(`[DefaultMasterPasswordUnlockService] No master password unlock data found for user ${t} returning false.`),!1;return null!=(yield this.masterPasswordService.unwrapUserKeyFromMasterPasswordUnlockData(e,i))}catch(i){return(0,Mr.isCryptoError)(i)&&"InvalidKey"===i.variant?this.logService.debug(`[DefaultMasterPasswordUnlockService] Error during proof of decryption for user ${t} returning false: ${i}`):this.logService.error(`[DefaultMasterPasswordUnlockService] Unexpected error during proof of decryption for user ${t} returning false: ${i}`),!1}})}validateInput(e,t){if(null==e||""===e)throw new Error("Master password is required");if(null==t)throw new Error("User ID is required")}setLegacyState(e,t,i){return fs(this,void 0,void 0,function*(){const n=yield this.keyService.makeMasterKey(e,t.salt,t.kdf);if(!n)throw new Error("Master key could not be created to set legacy master password state.");const r=yield this.keyService.hashMasterKey(e,n,$i.VK.LocalAuthorization);yield this.masterPasswordService.setMasterKeyHash(r,i),yield this.masterPasswordService.setMasterKey(n,i)})}},deps:[vs.O,b.Lu,Vs.K]}),(0,oe.F)({provide:as.K,useClass:ds.Kl,deps:[Y.D,vs.O,b.Lu,de.G,q.B,Vs.K,f.PV,Qr.$9,ae.dZ,w.v2,z.w,Ns.vW,Br.h,Ys.K5,v.bj]}),(0,oe.F)({provide:Rt.i,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c){this.keyService=e,this.accountService=t,this.masterPasswordService=i,this.i18nService=n,this.userVerificationApiService=r,this.userDecryptionOptionsService=s,this.pinService=o,this.kdfConfigService=a,this.biometricsService=l,this.masterPasswordUnlockService=c}getAvailableVerificationOptions(e){return vn(this,void 0,void 0,function*(){var t;const i=null===(t=yield(0,u._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;if("client"===e){const[e,t,n]=yield Promise.all([this.hasMasterPasswordAndMasterKeyHash(i),this.pinService.isPinDecryptionAvailable(i),this.biometricsService.getBiometricsStatus()]);return{client:{masterPassword:e,pin:t,biometrics:n===b.cR.Available},server:{masterPassword:!1,otp:!1}}}{const e=yield this.hasMasterPassword(i);return{client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:e,otp:!e}}}})}buildRequest(e,t){return vn(this,void 0,void 0,function*(){this.validateSecretInput(e);const i=null!=t?new t:new pn.V;if(e.type===An.k.OTP)i.otp=e.secret;else{const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),n=yield this.kdfConfigService.getKdfConfig(t),r=yield(0,u._)(this.masterPasswordService.saltForUser$(t)),s=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e.secret,n,r);i.authenticateWith(s)}return i})}verifyUser(e){return vn(this,void 0,void 0,function*(){if(null==e)throw new Error("Verification is required.");const[t,i]=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>[null==e?void 0:e.id,null==e?void 0:e.email])));switch(function(e){return"secret"in e}(e)&&this.validateSecretInput(e),e.type){case An.k.OTP:return this.verifyUserByOTP(e);case An.k.MasterPassword:return yield this.verifyUserByMasterPassword(e,t,i),!0;case An.k.PIN:return this.verifyUserByPIN(e,t);case An.k.Biometrics:return this.verifyUserByBiometrics();default:return e}})}verifyUserByOTP(e){return vn(this,void 0,void 0,function*(){const t=new gn(e.secret);try{yield this.userVerificationApiService.postAccountVerifyOTP(t)}catch(i){throw new Error(this.i18nService.t("invalidVerificationCode"))}return!0})}verifyUserByMasterPassword(e,t,i){return vn(this,void 0,void 0,function*(){if(!e.secret)throw new Error("Master Password is required. Cannot verify user without a master password.");if(!t)throw new Error("User ID is required. Cannot verify user by master password.");if(!i)throw new Error("Email is required. Cannot verify user by master password.");const n=yield this.kdfConfigService.getKdfConfig(t);if(!n)throw new Error("KDF config is required. Cannot verify user by master password.");let r,s=yield(0,u._)(this.masterPasswordService.masterKey$(t));if(s||(s=yield this.keyService.makeMasterKey(e.secret,i,n)),!s)throw new Error("Master key could not be created to verify the master password.");if(yield this.hasMasterPasswordAndMasterKeyHash(t)){if(!(yield this.masterPasswordUnlockService.proofOfDecryption(e.secret,t)))throw new Error(this.i18nService.t("invalidMasterPassword"));r=null}else{const i=new pn.V,s=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e.secret,n,yield(0,u._)(this.masterPasswordService.saltForUser$(t)));i.authenticateWith(s);try{r=yield this.userVerificationApiService.postAccountVerifyPassword(i)}catch(a){throw new Error(this.i18nService.t("invalidMasterPassword"))}}const o=yield this.keyService.hashMasterKey(e.secret,s,$i.VK.LocalAuthorization);return yield this.masterPasswordService.setMasterKeyHash(o,t),yield this.masterPasswordService.setMasterKey(s,t),{policyOptions:r,masterKey:s,email:i}})}verifyUserByPIN(e,t){return vn(this,void 0,void 0,function*(){if(!t)throw new Error("User ID is required. Cannot verify user by PIN.");return null!=(yield this.pinService.decryptUserKeyWithPin(e.secret,t))})}verifyUserByBiometrics(){return vn(this,void 0,void 0,function*(){return this.biometricsService.authenticateWithBiometrics()})}requestOTP(){return vn(this,void 0,void 0,function*(){yield this.userVerificationApiService.postAccountRequestOTP()})}hasMasterPassword(e){return vn(this,void 0,void 0,function*(){var t;const i=null!=e?e:null===(t=yield(0,u._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;return!!i&&(yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(i)))})}hasMasterPasswordAndMasterKeyHash(e){return vn(this,void 0,void 0,function*(){var t;return null!=e||(e=null===(t=yield(0,u._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id),(yield this.hasMasterPassword(e))&&null!=(yield(0,u._)(this.masterPasswordService.masterKeyHash$(e)))})}validateSecretInput(e){if(null==(null==e?void 0:e.secret)||""===e.secret)switch(e.type){case An.k.OTP:throw new Error(this.i18nService.t("verificationCodeRequired"));case An.k.MasterPassword:throw new Error(this.i18nService.t("masterPasswordRequired"));case An.k.PIN:throw new Error(this.i18nService.t("pinRequired"))}}},deps:[b.Lu,Y.D,vs.O,U.W,Pt,v.Ym,Es.t,b.zZ,b.Zm,gs.b]}),(0,oe.F)({provide:f.k4,useClass:class{memberOrganizations$(e){return this.organizations$(e).pipe((0,p.T)(e=>e.filter(e=>e.isMember)))}constructor(e){this.stateProvider=e}canManageSponsorships$(e){return this.organizations$(e).pipe((0,p.T)(e=>e.filter(e=>e.canManageSponsorships)),Ee())}familySponsorshipAvailable$(e){return this.organizations$(e).pipe((0,p.T)(e=>e.some(e=>e.familySponsorshipAvailable)))}hasOrganizations(e){return this.organizations$(e).pipe(Ee())}upsert(e,t){return Be(this,void 0,void 0,function*(){yield this.organizationState(t).update(t=>{const i=null!=t?t:{};return i[e.id]=e,i})})}replace(e,t){return Be(this,void 0,void 0,function*(){yield this.organizationState(t).update(()=>e)})}organizations$(e){return this.organizationState(e).state$.pipe(this.mapOrganizationRecordToArray())}organizationState(e){return this.stateProvider.getUser(e,be)}mapOrganizationRecordToArray(){return(0,p.T)(e=>{var t;return null===(t=Object.values(null!=e?e:{}))||void 0===t?void 0:t.map(e=>new we.y(e))})}},deps:[w.v2]}),(0,oe.F)({provide:g.Ki,useClass:g.tc,deps:[b.Lu,Tr.N,g.uB,Y.D,U.W]}),(0,oe.F)({provide:f.PV,useExisting:f.k4}),(0,oe.F)({provide:g.uB,useClass:g.Lf,deps:[de.G]}),(0,oe.F)({provide:Tt._,useClass:class{constructor(e,t,i,n,r,s){this.organizationApiService=e,this.accountService=t,this.keyService=i,this.encryptService=n,this.organizationUserApiService=r,this.i18nService=s}enrollIfRequired(e){return Ni(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 Ni(this,void 0,void 0,function*(){const n=yield this.organizationApiService.getKeys(e);if(null==n)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const r=at.A.fromB64ToArray(n.publicKey);if(null==(t=null!=t?t:yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6))))throw new Error("User ID is required");i=null!=i?i:yield(0,u._)(this.keyService.userKey$(t));const s=yield this.encryptService.encapsulateKeyUnsigned(i,r),o=new g.Wt;o.resetPasswordKey=s.encryptedString,yield this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(e,t,o)})}},deps:[he.X,Y.D,b.Lu,Tr.N,g.uB,U.W]}),(0,oe.F)({provide:Ce.$,useClass:class{constructor(e){this.stateProvider=e}providers$(e){return this.stateProvider.getUser(e,wt).state$.pipe(this.mapProviderRecordToArray())}mapProviderRecordToArray(){return(0,p.T)(e=>Object.values(null!=e?e:{}).map(e=>new yt(e)))}get$(e,t){return this.providers$(t).pipe((0,ft.Hc)(e))}save(e,t){return Ct(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(wt,e,t)})}},deps:[w.v2]}),(0,oe.F)({provide:Bn.fz,useClass:Bn.q9,deps:[U.W,V.y,w.Y2,Bn.tE]}),(0,oe.F)({provide:class{},useClass:class{getFormValidationErrors(e){let t=[];return Object.keys(e).forEach(i=>{const n=e[i];n instanceof a.J3&&(t=t.concat(this.getFormValidationErrors(n.controls)));const r=e[i].errors;null!==r&&Object.keys(r).forEach(e=>{t.push({controlName:i,errorName:e})})}),t}},deps:[]}),(0,oe.F)({provide:Pt,useClass:class{constructor(e){this.apiService=e}postAccountVerifyOTP(e){return this.apiService.send("POST","/accounts/verify-otp",e,!0,!1)}postAccountRequestOTP(){return hn(this,void 0,void 0,function*(){return this.apiService.send("POST","/accounts/request-otp",null,!0,!1)})}postAccountVerifyPassword(e){return this.apiService.send("POST","/accounts/verify-password",e,!0,!0)}},deps:[de.G]}),(0,oe.F)({provide:he.X,useClass:class{constructor(e,t){this.apiService=e,this.syncService=t}get(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e,null,!0,!0);return new Ke.t(t)})}getBilling(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing",null,!0,!0);return new Re(t)})}getBillingHistory(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/history",null,!0,!0);return new Oe(t)})}getSubscription(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/subscription",null,!0,!0);return new Ge._(t)})}getLicense(e,t){return qe(this,void 0,void 0,function*(){return this.apiService.send("GET","/organizations/"+e+"/license?installationId="+t,null,!0,!0)})}getAutoEnrollStatus(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/auto-enroll-status",null,!0,!0);return new ze(t)})}create(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations",e,!0,!0);return yield this.syncService.fullSync(!0),new Ke.t(t)})}createWithoutPayment(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/create-without-payment",e,!0,!0);return yield this.syncService.fullSync(!0),new Ke.t(t)})}createLicense(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/licenses/self-hosted",e,!0,!0);return new Ke.t(t)})}save(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e,t,!0,!0),n=new Ke.t(i);return yield this.syncService.fullSync(!0),n})}upgrade(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/upgrade",t,!0,!0);return new Ve(i)})}updatePasswordManagerSeats(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/subscription",t,!0,!0);return new Xe.C(i)})}updateSecretsManagerSubscription(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sm-subscription",t,!0,!0);return new Xe.C(i)})}updateSeats(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/seat",t,!0,!0);return new Ve(i)})}updateStorage(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/storage",t,!0,!0);return new Ve(i)})}reinstate(e){return qe(this,void 0,void 0,function*(){return this.apiService.send("POST","/organizations/"+e+"/reinstate",null,!0,!1)})}leave(e){return qe(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 qe(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e,t,!0,!1),yield this.syncService.fullSync(!0)})}deleteUsingToken(e,t){return this.apiService.send("POST","/organizations/"+e+"/delete-recover-token",t,!1,!1)}updateLicense(e,t){return qe(this,void 0,void 0,function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e,t,!0,!1)})}importDirectory(e,t){return qe(this,void 0,void 0,function*(){return this.apiService.send("POST","/organizations/"+e+"/import",t,!0,!1)})}getOrCreateApiKey(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/api-key",t,!0,!0);return new Qe(i)})}getApiKeyInformation(e){return qe(this,arguments,void 0,function*(e,t=null){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 je.s(n,Ne)})}rotateApiKey(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/rotate-api-key",t,!0,!0);return new Qe(i)})}getKeys(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/keys",null,!0,!0);return new Le(t)})}updateKeys(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/keys",t,!0,!0);return new Le(i)})}getSso(e){return qe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/sso",null,!0,!0);return new Fe(t)})}updateSso(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sso",t,!0,!0);return new Fe(i)})}selfHostedSyncLicense(e){return qe(this,void 0,void 0,function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e+"/sync/",null,!0,!1)})}subscribeToSecretsManager(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/subscribe-secrets-manager",t,!0,!0);return new Xe.C(i)})}updateCollectionManagement(e,t){return qe(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/collection-management",t,!0,!0),n=new Ke.t(i);return yield this.syncService.fullSync(!0),n})}},deps:[de.G,Ga.H]}),(0,oe.F)({provide:xn.l,useClass:class{constructor(e,t){this.apiService=e,this.platformUtilsService=t}getOrganizationSponsorship(e){return tr(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e+"/sponsored",null,!0,!0);return new je.s(t,er.B)})}postResendSponsorshipOffer(e,t){return tr(this,void 0,void 0,function*(){let i="/organization/sponsorship/"+e+"/families-for-enterprise/resend";return t&&(i+=`?sponsoredFriendlyName=${encodeURIComponent(t)}`),yield this.apiService.send("POST",i,null,!0,!1)})}deleteRevokeSponsorship(e){return tr(this,arguments,void 0,function*(e,t=!1){const i=this.platformUtilsService.isSelfHost()?"self-hosted/":"";return yield this.apiService.send("DELETE","/organization/sponsorship/"+i+e,null,!0,!1)})}deleteAdminInitiatedRevokeSponsorship(e,t){return tr(this,void 0,void 0,function*(){const i=this.platformUtilsService.isSelfHost()?"self-hosted/":"";return yield this.apiService.send("DELETE","/organization/sponsorship/"+i+e+"/"+encodeURIComponent(t)+"/revoke",null,!0,!1)})}},deps:[de.G,V.y]}),(0,oe.F)({provide:Mn.C,useClass:class{constructor(e){this.apiService=e}getBillingInvoices(e,t,i){return Zn(this,void 0,void 0,function*(){const n=new URLSearchParams;t&&n.append("status",t),i&&n.append("startAfter",i);const r=`?${n.toString()}`,s=yield this.apiService.send("GET",`/organizations/${e}/billing/invoices${r}`,null,!0,!0);return(null==s?void 0:s.map(e=>new Me(e)))||[]})}getBillingTransactions(e,t){return Zn(this,void 0,void 0,function*(){const i=t?`?startAfter=${t}`:"",n=yield this.apiService.send("GET",`/organizations/${e}/billing/transactions${i}`,null,!0,!0);return(null==n?void 0:n.map(e=>new xe(e)))||[]})}setupBusinessUnit(e,t){return Zn(this,void 0,void 0,function*(){return yield this.apiService.send("POST",`/organizations/${e}/billing/setup-business-unit`,t,!0,!0)})}changeSubscriptionFrequency(e,t){return Zn(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/organizations/"+e+"/billing/change-frequency",t,!0,!1)})}},deps:[de.G]}),(0,oe.F)({provide:Pn.k,useClass:class{constructor(e){this.apiService=e}getBillingInvoices(e,t){return Gn(this,void 0,void 0,function*(){const i=new URLSearchParams;e&&i.append("status",e),t&&i.append("startAfter",t);const n=`?${i.toString()}`,r=yield this.apiService.send("GET",`/accounts/billing/invoices${n}`,null,!0,!0);return(null==r?void 0:r.map(e=>new Me(e)))||[]})}getBillingTransactions(e){return Gn(this,void 0,void 0,function*(){const t=e?`?startAfter=${e}`:"",i=yield this.apiService.send("GET",`/accounts/billing/transactions${t}`,null,!0,!0);return(null==i?void 0:i.map(e=>new xe(e)))||[]})}},deps:[de.G]}),(0,oe.F)({provide:Po.vQ,useClass:Po.vQ,deps:[Os,Gs.v,Vs.K,w.v2,T.u]}),(0,oe.F)({provide:z.w,useExisting:Po.vQ}),(0,oe.F)({provide:Os,useClass:class{constructor(e){this.apiService=e}get(e){return Fo(this,void 0,void 0,function*(){let t;return t=null==e?yield this.apiService.send("GET","/config",null,!1,!0):yield this.apiService.send("GET","/config",null,e,!0),new Bo(t)})}},deps:[de.G]}),(0,oe.F)({provide:bt.k,useClass:class{constructor(e,t,i){this.environmentService=e,this.authRequestService=t,this.platformUtilsService=i}createHubConnection(e){return ui(this,void 0,void 0,function*(){if(this.url=(yield(0,u._)(this.environmentService.environment$)).getNotificationsUrl(),!this.url.startsWith("https://")&&!this.platformUtilsService.isDev())throw new di;this.anonHubConnection=(new Kt.$).withUrl(this.url+"/anonymous-hub?Token="+e,{skipNegotiation:!0,transport:Xt.w.WebSockets}).withHubProtocol(new qt.E).build(),yield this.anonHubConnection.start(),this.anonHubConnection.on("AuthRequestResponseRecieved",e=>{this.ProcessNotification(new Jt(e))})})}stopHubConnection(){return ui(this,void 0,void 0,function*(){this.anonHubConnection&&(yield this.anonHubConnection.stop())})}ProcessNotification(e){if(e.type===st._n.AuthRequestResponse)this.authRequestService.sendAuthRequestPushNotification(e.payload)}},deps:[Gs.v,v.XF,V.y]}),(0,oe.F)({provide:Xs.B,useClass:class{constructor(e,t){this.i18nService=e,this.platformUtilsService=t}showError(e){const t=this.i18nService.t("unexpectedError");let i=[];if(null!=e&&"string"==typeof e)i.push(e);else if(null==e||"object"!=typeof e)i.push(t);else if(null!=e.validationErrors)i=i.concat(e.getAllMessages());else{const n=this.extractErrorMessagesFromMessage(e.message);n.length>0?i=i.concat(n):i.push(e.message?e.message:t)}return 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}extractErrorMessagesFromMessage(e){if(!e)return[];const t=e.indexOf("{");if(-1===t)return[];try{const i=JSON.parse(e.substring(t)),n=new ot._(i,0);if(null!=n.validationErrors)return n.getAllMessages();if(n.message)return[n.message]}catch(i){}return[]}},deps:[U.W,V.y]}),(0,oe.F)({provide:v.DS,useClass:v.pi,deps:[Y.D,T.u,w.v2]}),(0,oe.F)({provide:ge,useClass:class{constructor(e,t){this.platformUtilsService=e,this.i18nService=t,this._orgDomains$=new _e.t([]),this.orgDomains$=this._orgDomains$.asObservable()}get(e){return this._orgDomains$.getValue().find(t=>t.id===e)}copyDnsTxt(e){this.platformUtilsService.copyToClipboard(e)}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:[V.y,U.W]}),(0,oe.F)({provide:pe,useExisting:ge}),(0,oe.F)({provide:Ae.o,useClass:class{constructor(e,t){this.orgDomainService=e,this.apiService=t}getAllByOrgId(e){return Ze(this,void 0,void 0,function*(){const t=(yield this.apiService.send("GET",`/organizations/${e}/domain`,null,!0,!0)).data.map(e=>new We(e));return this.orgDomainService.replace(t),t})}getByOrgIdAndOrgDomainId(e,t){return Ze(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET",`/organizations/${e}/domain/${t}`,null,!0,!0),n=new We(i);return this.orgDomainService.upsert([n]),n})}post(e,t){return Ze(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain`,t,!0,!0),n=new We(i);return this.orgDomainService.upsert([n]),n})}verify(e,t){return Ze(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain/${t}/verify`,null,!0,!0),n=new We(i);return this.orgDomainService.upsert([n]),n})}delete(e,t){return Ze(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 Ze(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/domain/sso/details",new Je(e),!1,!0);return new He(t)})}getVerifiedOrgDomainsByEmail(e){return Ze(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/domain/sso/verified",new Je(e),!1,!0);return new je.s(t,$e)})}},deps:[ge,de.G]}),(0,oe.F)({provide:Qt.T,useClass:class{constructor(e){this.apiService=e}getKnownDevice(e,t){return Gi(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",at.A.fromUtf8ToUrlB64(e))})})}getDeviceByIdentifier(e){return Gi(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/devices/identifier/${e}`,null,!0,!0);return new Pi(t)})}getDevices(){return Gi(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/devices",null,!0,!0,null);return new je.s(e,Pi)})}updateTrustedDeviceKeys(e,t,i,n){return Gi(this,void 0,void 0,function*(){const r=new Oi(t,i,n),s=yield this.apiService.send("PUT",`/devices/${e}/keys`,r,!0,!0);return new Pi(s)})}updateTrust(e,t){return Gi(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){return Gi(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST",`/devices/${e}/retrieve-keys`,null,!0,!0);return new xi(t)})}postDeviceTrustLoss(e){return Gi(this,void 0,void 0,function*(){yield this.apiService.send("POST","/devices/lost-trust",null,!0,!1,null,t=>{t.set("Device-Identifier",e)})})}deactivateDevice(e){return Gi(this,void 0,void 0,function*(){yield this.apiService.send("POST",`/devices/${e}/deactivate`,null,!0,!1)})}untrustDevices(e){return Gi(this,void 0,void 0,function*(){yield this.apiService.send("POST","/devices/untrust",new Ri(e),!0,!1)})}},deps:[de.G]}),(0,oe.F)({provide:St,useClass:class{constructor(e,t,i){this.appIdService=e,this.devicesApiService=t,this.i18nService=i}getDevices$(){return(0,Vt.v)(()=>this.devicesApiService.getDevices()).pipe((0,p.T)(e=>e.data.map(e=>new Ti(e))))}getDeviceByIdentifier$(e){return(0,Vt.v)(()=>this.devicesApiService.getDeviceByIdentifier(e)).pipe((0,p.T)(e=>new Ti(e)))}isDeviceKnownForUser$(e,t){return(0,Vt.v)(()=>this.devicesApiService.getKnownDevice(e,t))}updateTrustedDeviceKeys$(e,t,i,n){return(0,Vt.v)(()=>this.devicesApiService.updateTrustedDeviceKeys(e,t,i,n)).pipe((0,p.T)(e=>new Ti(e)))}deactivateDevice$(e){return(0,Vt.v)(()=>this.devicesApiService.deactivateDevice(e))}getCurrentDevice$(){return(0,Vt.v)(()=>Fi(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();return this.devicesApiService.getDeviceByIdentifier(e)}))}getReadableDeviceTypeName(e){if(void 0===e)return this.i18nService.t("unknownDevice");const t=st.mz[e];if(!t)return this.i18nService.t("unknownDevice");const i="Unknown"===t.platform?this.i18nService.t("unknown"):t.platform,n=this.i18nService.t(t.category);return i?`${n} - ${i}`:n}},deps:[xs.Y,Qt.T,U.W]}),(0,oe.F)({provide:v.d8,useClass:v._l,deps:[de.G,Vs.K]}),(0,oe.F)({provide:Ur.M,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c,u,h,A,g){this.keyGenerationService=e,this.cryptoFunctionService=t,this.keyService=i,this.encryptService=n,this.appIdService=r,this.devicesApiService=s,this.i18nService=o,this.platformUtilsService=a,this.stateProvider=l,this.secureStorageService=c,this.userDecryptionOptionsService=u,this.logService=h,this.configService=A,this.accountService=g,this.platformSupportsSecureStorage=this.platformUtilsService.supportsSecureStorage(),this.deviceKeySecureStorageKey="_deviceKey",this.deviceTrustedSubject=new d.B,this.deviceTrusted$=this.deviceTrustedSubject.asObservable(),this.supportsDeviceTrust$=this.accountService.activeAccount$.pipe((0,rt.n)(e=>null==e?[!1]:this.userDecryptionOptionsService.userDecryptionOptionsById$(e.id).pipe((0,p.T)(e=>null!=(null==e?void 0:e.trustedDeviceOption)))))}supportsDeviceTrustByUserId$(e){return this.userDecryptionOptionsService.userDecryptionOptionsById$(e).pipe((0,p.T)(e=>null!=(null==e?void 0:e.trustedDeviceOption)))}getShouldTrustDevice(e){return zr(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot get should trust device.");return yield(0,u._)(this.stateProvider.getUserState$(Lr,e))})}setShouldTrustDevice(e,t){return zr(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot set should trust device.");yield this.stateProvider.setUserState(Lr,t,e)})}trustDeviceIfRequired(e){return zr(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,null))})}trustDevice(e){return zr(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot trust device.");const t=yield(0,u._)(this.keyService.userKey$(e));if(!t)throw new Error("User symmetric key not found");const i=yield this.makeDeviceKey(),[n,r]=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048),[s,o,a]=yield Promise.all([this.encryptService.encapsulateKeyUnsigned(t,n),this.encryptService.wrapEncapsulationKey(n,t),this.encryptService.wrapDecapsulationKey(r,i)]),l=yield this.appIdService.getAppId(),c=yield this.devicesApiService.updateTrustedDeviceKeys(l,s.encryptedString,o.encryptedString,a.encryptedString);return yield this.setDeviceKey(e,i),this.deviceTrustedSubject.next(),c})}getRotatedData(e,t,i){return zr(this,void 0,void 0,function*(){if(!i)throw new Error("UserId is required. Cannot get rotated data.");if(!e)throw new Error("Old user key is required. Cannot get rotated data.");if(!t)throw new Error("New user key is required. Cannot get rotated data.");const n=yield this.devicesApiService.getDevices(),r=[],s=yield Promise.all(n.data.filter(e=>e.isTrusted).map(i=>zr(this,void 0,void 0,function*(){const n=yield this.encryptService.unwrapEncapsulationKey(new Di.k(i.encryptedPublicKey),e);if(!n)return r.push(i.id),null;const s=yield this.encryptService.wrapEncapsulationKey(n,t),o=yield this.encryptService.encapsulateKeyUnsigned(t,n),a=new Mi.B(o,s),l=new Nr;return l.encryptedPublicKey=a.encryptedPublicKey.encryptedString,l.encryptedUserKey=a.encapsulatedDownstreamKey.encryptedString,l.deviceId=i.id,l})).filter(e=>null!=e));return s.length>0&&(this.logService.info("[Device trust rotation] Distrusting devices that failed to decrypt."),yield this.devicesApiService.untrustDevices(r)),s})}rotateDevicesTrust(e,t,i){return zr(this,void 0,void 0,function*(){if(this.logService.info("[Device trust rotation] Rotating device trust..."),!e)throw new Error("UserId is required. Cannot rotate device's trust.");if(null==(yield this.getDeviceKey(e)))return void this.logService.info("[Device trust rotation] No device key available to rotate trust!");const n=yield(0,u._)(this.keyService.userKey$(e));n==t&&this.logService.info("[Device trust rotation] Old user key is the same as the new user key.");const r=yield this.appIdService.getAppId();(new pn.V).masterPasswordHash=i;const s=yield this.devicesApiService.getDeviceKeys(r),o=yield this.encryptService.unwrapEncapsulationKey(s.encryptedPublicKey,n),a=yield this.encryptService.encapsulateKeyUnsigned(t,o),l=yield this.encryptService.wrapEncapsulationKey(o,t),c=new jr;c.encryptedUserKey=a.encryptedString,c.encryptedPublicKey=l.encryptedString;const d=new Vr;d.masterPasswordHash=i,d.currentDevice=c,d.otherDevices=[],this.logService.info("[Device trust rotation] Posting device trust update with current device:",r),yield this.devicesApiService.updateTrust(d,r),this.logService.info("[Device trust rotation] Device trust update posted successfully.")})}getDeviceKey(e){return zr(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 Ji.e.fromJSON(t)}return yield(0,u._)(this.stateProvider.getUserState$(Yr,e))}catch(t){this.logService.error("Failed to get device key",t)}})}setDeviceKey(e,t){return zr(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(Yr,null==t?void 0:t.toJSON(),e)}catch(i){this.logService.error("Failed to set device key",i)}})}makeDeviceKey(){return zr(this,void 0,void 0,function*(){return yield this.keyGenerationService.createKey(512)})}decryptUserKeyWithDeviceKey(e,t,i,n){return zr(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot decrypt user key with device key.");if(!t)throw new Error("Encrypted device private key is required. Cannot decrypt user key with device key.");if(!i)throw new Error("Encrypted user key is required. Cannot decrypt user key with device key.");if(!n)return null;try{const e=yield this.encryptService.unwrapDecapsulationKey(t,n);return yield this.encryptService.decapsulateKeyUnsigned(new Di.k(i.encryptedString),e)}catch(r){return this.logService.error("Failed to decrypt using device key. Removing device key."),yield this.setDeviceKey(e,null),null}})}recordDeviceTrustLoss(){return zr(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();yield this.devicesApiService.postDeviceTrustLoss(e)})}getSecureStorageOptions(e){return{storageLocation:$i.$B.Disk,useSecureStorage:!0,userId:e}}},deps:[Qr.$9,kr.R,b.Lu,Tr.N,xs.Y,Qt.T,U.W,V.y,w.v2,ae.G$,v.Ym,Vs.K,z.w,Y.D]}),(0,oe.F)({provide:Jr,useClass:class{constructor(e){this.apiService=e}updateUserKdfParams(e){return $r(this,void 0,void 0,function*(){return this.apiService.send("POST","/accounts/kdf",e,!0,!1)})}},deps:[de.G]}),(0,oe.F)({provide:ss,useClass:rs,deps:[Jr,Ys.K5,b.Lu,vs.O]}),(0,oe.F)({provide:v.XF,useClass:v.H8,deps:[xs.Y,vs.O,b.Lu,Tr.N,de.G,w.v2,v.d8,Y.D]}),(0,oe.F)({provide:ys,useClass:class{constructor(e){this.stateProvider=e}userKeyEncryptedPin$(e){return(0,Kr.x)(e,"userId"),this.stateProvider.getUserState$(Is,e).pipe((0,p.T)(e=>e?new Di.k(e):null))}pinSet$(e){return(0,Kr.x)(e,"userId"),this.pinLockType$(e).pipe((0,p.T)(e=>"DISABLED"!==e))}pinLockType$(e){return(0,Kr.x)(e,"userId"),(0,bi.z)([this.pinProtectedUserKeyEnvelope$(e,"PERSISTENT").pipe((0,p.T)(e=>null!=e)),this.stateProvider.getUserState$(Is,e).pipe((0,p.T)(e=>null!=e))]).pipe((0,p.T)(([e,t])=>e?"PERSISTENT":t?"EPHEMERAL":"DISABLED"))}getPinLockType(e){return bs(this,void 0,void 0,function*(){return(0,Kr.x)(e,"userId"),yield(0,u._)(this.pinLockType$(e))})}getPinProtectedUserKeyEnvelope(e,t){return bs(this,void 0,void 0,function*(){return(0,Kr.x)(e,"userId"),yield(0,u._)(this.pinProtectedUserKeyEnvelope$(e,t))})}setPinState(e,t,i,n){return bs(this,void 0,void 0,function*(){if((0,Kr.x)(e,"userId"),(0,Kr.x)(t,"pinProtectedUserKeyEnvelope"),(0,Kr.x)(n,"pinLockType"),"EPHEMERAL"===n)yield this.stateProvider.setUserState(ws,{[Bs]:{pin_envelope:t}},e);else{if("PERSISTENT"!==n)throw new Error(`Cannot set up PIN with pin lock type ${n}`);yield this.stateProvider.setUserState(Cs,t,e)}yield this.stateProvider.setUserState(Is,i,e)})}clearPinState(e){return bs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId"),yield this.stateProvider.setUserState(Is,null,e),yield this.stateProvider.setUserState(ws,null,e),yield this.stateProvider.setUserState(Cs,null,e)})}clearEphemeralPinState(e){return bs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId"),yield this.stateProvider.setUserState(ws,null,e)})}pinProtectedUserKeyEnvelope$(e,t){if((0,Kr.x)(e,"userId"),"EPHEMERAL"===t)return this.stateProvider.getUserState$(ws,e).pipe((0,p.T)(e=>{var t,i;return null!==(i=null===(t=null==e?void 0:e[""])||void 0===t?void 0:t.pin_envelope)&&void 0!==i?i:null}));if("PERSISTENT"===t)return this.stateProvider.getUserState$(Cs,e);throw new Error(`Unsupported PinLockType: ${t}`)}},deps:[w.v2]}),(0,oe.F)({provide:Es.t,useClass:class{constructor(e,t,i,n,r){this.encryptService=e,this.logService=t,this.keyService=i,this.sdkService=n,this.pinStateService=r}getPinLockType(e){return(0,Kr.x)(e,"userId"),this.pinStateService.getPinLockType(e)}isPinSet(e){return Qs(this,void 0,void 0,function*(){return(0,Kr.x)(e,"userId"),"DISABLED"!==(yield this.pinStateService.getPinLockType(e))})}logout(e){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId"),yield this.pinStateService.clearPinState(e)})}userUnlocked(e){return Qs(this,void 0,void 0,function*(){if("EPHEMERAL"===(yield this.pinStateService.getPinLockType(e))&&!(yield this.isPinDecryptionAvailable(e))){this.logService.info("[Pin Service] On first unlock: Setting up ephemeral PIN");const t=yield this.getPin(e);yield this.setPin(t,"EPHEMERAL",e)}})}getPin(e){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId");const t=yield(0,Ss.p)(this.keyService.userKey$(e),"userKey"),i=yield(0,Ss.p)(this.pinStateService.userKeyEncryptedPin$(e),"userKeyEncryptedPin");return this.encryptService.decryptString(i,t)})}setPin(e,t,i){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"pin"),(0,Kr.x)(t,"pinLockType"),(0,Kr.x)(i,"userId");const{pinProtectedUserKeyEnvelope:n,userKeyEncryptedPin:r}=yield(0,u._)(this.sdkService.userClient$(i).pipe((0,p.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{return ks(i,t.take(),!1).value.crypto().enroll_pin(e)}catch(n){i.error=n,i.hasError=!0}finally{Ts(i)}})));yield this.pinStateService.setPinState(i,n,r,t)})}unsetPin(e){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId"),yield this.pinStateService.clearPinState(e)})}isPinDecryptionAvailable(e){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"userId");const t=yield this.pinStateService.getPinLockType(e);switch(t){case"DISABLED":return!1;case"PERSISTENT":return!0;case"EPHEMERAL":return null!=(yield this.pinStateService.getPinProtectedUserKeyEnvelope(e,"EPHEMERAL"));default:throw new Error(`Unexpected pinLockType: ${t}`)}})}decryptUserKeyWithPin(e,t){return Qs(this,void 0,void 0,function*(){(0,Kr.x)(e,"pin"),(0,Kr.x)(t,"userId"),this.logService.info("[Pin Service] Pin-unlock via PinProtectedUserKeyEnvelope");const i=yield this.pinStateService.getPinLockType(t),n=yield this.pinStateService.getPinProtectedUserKeyEnvelope(t,i);try{const t=performance.now(),i=yield(0,u._)(this.sdkService.client$.pipe((0,p.T)(t=>{if(!t)throw new Error("SDK not available");return t.crypto().unseal_password_protected_key_envelope(e,n)})));return this.logService.measure(t,"Crypto","PinService","UnsealPinEnvelope"),new Ji.e(i)}catch(r){return this.logService.error(`Failed to unseal pin: ${r}`),null}})}},deps:[Tr.N,Vs.K,b.Lu,Ys.K5,ys]}),(0,oe.F)({provide:Mt.u,useClass:class{constructor(e){this.cryptoFunctionService=e}getLoginWithPrfSalt(){return yn(this,void 0,void 0,function*(){return yield this.cryptoFunctionService.hash("passwordless-login","sha256")})}createSymmetricKeyFromPrf(e){return yn(this,void 0,void 0,function*(){return yield this.stretchKey(new Uint8Array(e))})}stretchKey(e){return yn(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 Ji.e(t)})}},deps:[kr.R]}),(0,oe.F)({provide:Dt,useClass:class{constructor(e,t){this.apiService=e,this.environmentService=t}getCredentialAssertionOptions(){return mn(this,void 0,void 0,function*(){const e=yield(0,u._)(this.environmentService.environment$),t=yield this.apiService.send("GET","/accounts/webauthn/assertion-options",null,!1,!0,e.getIdentityUrl());return new fn.x(t)})}},deps:[de.G,Gs.v]}),(0,oe.F)({provide:xt,useClass:class{constructor(e,t,i,n,r){this.webAuthnLoginApiService=e,this.loginStrategyService=t,this.webAuthnLoginPrfKeyService=i,this.window=n,this.logService=r,this.navigatorCredentials=this.window.navigator.credentials}getCredentialAssertionOptions(){return bn(this,void 0,void 0,function*(){const e=yield this.webAuthnLoginApiService.getCredentialAssertionOptions();return new Cn.E(e.options,e.token)})}assertCredential(e){return bn(this,void 0,void 0,function*(){var t,i,n;const r={publicKey:e.options};r.publicKey.extensions={prf:{eval:{first:yield this.webAuthnLoginPrfKeyService.getLoginWithPrfSalt()}}};try{const n=yield this.navigatorCredentials.get(r);if(!(n instanceof PublicKeyCredential))return;const s=null===(i=null===(t=n.getClientExtensionResults().prf)||void 0===t?void 0:t.results)||void 0===i?void 0:i.first;let o;null!=s&&(o=yield this.webAuthnLoginPrfKeyService.createSymmetricKeyFromPrf(s));const a=new In.c(n);if("prf"in a.extensions)throw new Error("PRF information is not allowed to be sent to the server.");return new wn(e.token,a,o)}catch(s){return void(null===(n=this.logService)||void 0===n||n.error(s))}})}logIn(e){return bn(this,void 0,void 0,function*(){const t=new v.Gz(e.token,e.deviceResponse,e.prfKey);return yield this.loginStrategyService.logIn(t)})}},deps:[Dt,v.sg,Mt.u,ae.jf,Vs.K]}),(0,oe.F)({provide:Ls.wH,useClass:Ls.wH,deps:[ae.ml,ae.ye]}),(0,oe.F)({provide:w.iO,useClass:Dd.df,deps:[w.Y2,Ls.wH]}),(0,oe.F)({provide:w.lR,useClass:Dd.ep,deps:[w.Y2,Ls.wH]}),(0,oe.F)({provide:w.Y2,useClass:Dd.dR,deps:[Ls.wH,Vs.K]}),(0,oe.F)({provide:Dd.Bz,useClass:class{constructor(e){this.accountService=e,this.activeUserId$=this.accountService.activeAccount$.pipe((0,p.T)(e=>null!=e?e.id:null))}},deps:[Y.D]}),(0,oe.F)({provide:w.Md,useClass:Dd.$5,deps:[Dd.Bz,w.Ys]}),(0,oe.F)({provide:w.Ys,useClass:Dd.Bh,deps:[Ls.wH,w.iO,Vs.K]}),(0,oe.F)({provide:w.w8,useClass:Dd.jx,deps:[]}),(0,oe.F)({provide:w.v2,useClass:Dd.Cp,deps:[w.Md,w.Ys,w.Y2,w.w8]}),(0,oe.F)({provide:Tn.Y,useClass:class{constructor(e,t,i,n,r,s,o){this.apiService=e,this.billingApiService=t,this.keyService=i,this.encryptService=n,this.i18nService=r,this.organizationApiService=s,this.syncService=o}purchaseSubscription(e,t){return or(this,void 0,void 0,function*(){var i;const n=new ir.L,r=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(n,r),this.setOrganizationInformation(n,e.organization),this.setPlanInformation(n,e.plan),this.setPaymentInformation(n,e.payment),(null===(i=e.coupons)||void 0===i?void 0:i.length)&&(n.coupons=e.coupons);const s=yield this.organizationApiService.create(n);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),s})}purchaseSubscriptionNoPaymentMethod(e,t){return or(this,void 0,void 0,function*(){const i=new sr.J,n=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(i,n),this.setOrganizationInformation(i,e.organization),this.setPlanInformation(i,e.plan);const r=yield this.organizationApiService.createWithoutPayment(i);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),r})}startFree(e,t){return or(this,void 0,void 0,function*(){const i=new ir.L,n=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(i,n),this.setOrganizationInformation(i,e.organization),this.setPlanInformation(i,e.plan);const r=yield this.organizationApiService.create(i);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),r})}makeOrganizationKeys(e){return or(this,void 0,void 0,function*(){const[t,i]=yield this.keyService.makeOrgKey(e),[n,r]=yield this.keyService.makeKeyPair(i);return{encryptedKey:t,publicKey:n,encryptedPrivateKey:r,encryptedCollectionName:yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),i)}})}prohibitsAdditionalSeats(e){switch(e){case rr.OL.Free:case rr.OL.FamiliesAnnually:case rr.OL.FamiliesAnnually2019:case rr.OL.FamiliesAnnually2025:case rr.OL.TeamsStarter2023:case rr.OL.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 nr.B(t.publicKey,t.encryptedPrivateKey.encryptedString),e.collectionName=t.encryptedCollectionName.encryptedString}setPaymentInformation(e,t){const[i,n]=t.paymentMethod;e.paymentToken=i,e.paymentMethodType=n,e.skipTrial=t.skipTrial;const r=t.billing;e.billingAddressPostalCode=r.postalCode,e.billingAddressCountry=r.country,r.taxId&&(e.taxIdNumber=r.taxId,e.billingAddressLine1=r.addressLine1,e.billingAddressLine2=r.addressLine2,e.billingAddressCity=r.city,e.billingAddressState=r.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)}restartSubscription(e,t,i){return or(this,void 0,void 0,function*(){const n=new ir.L,r=yield this.makeOrganizationKeys(i);this.setOrganizationKeys(n,r),this.setOrganizationInformation(n,t.organization),this.setPlanInformation(n,t.plan),this.setPaymentInformation(n,t.payment),yield this.billingApiService.restartSubscription(e,n)})}},deps:[de.G,Fn.P,b.Lu,Tr.N,U.W,he.X,Ga.H]}),(0,oe.F)({provide:En.h,useClass:En.N,deps:[w.v2,me.m,Y.D,gd.b]}),(0,oe.F)({provide:class{},useClass:class{constructor(e){this.stateProvider=e,this.enableBadgeCounterState=this.stateProvider.getActive(Qn),this.enableBadgeCounter$=this.enableBadgeCounterState.state$.pipe((0,p.T)(e=>null==e||e))}setEnableBadgeCounter(e){return Sn(this,void 0,void 0,function*(){yield this.enableBadgeCounterState.update(()=>e)})}},deps:[w.v2]}),(0,oe.F)({provide:b.vB,useClass:b.QH,deps:[w.v2]}),(0,oe.F)({provide:lc.d,useClass:class{constructor(e,t){this.stateProvider=e,this.restrictedItemTypesService=t,this.enablePasskeysState=this.stateProvider.getGlobal(bd),this.enablePasskeys$=this.enablePasskeysState.state$.pipe((0,p.T)(e=>null==e||e)),this.showCardsCurrentTabState=this.stateProvider.getActive(Bd),this.showCardsCurrentTab$=(0,bi.z)([this.showCardsCurrentTabState.state$.pipe((0,p.T)(e=>null==e||e)),this.restrictedItemTypesService.restricted$]).pipe((0,p.T)(([e,t])=>e&&!t.some(e=>e.cipherType===mc.gC.Card))),this.showIdentitiesCurrentTabState=this.stateProvider.getActive(Ed),this.showIdentitiesCurrentTab$=this.showIdentitiesCurrentTabState.state$.pipe((0,p.T)(e=>null==e||e)),this.clickItemsToAutofillVaultViewState=this.stateProvider.getActive(Sd),this.clickItemsToAutofillVaultView$=this.clickItemsToAutofillVaultViewState.state$.pipe((0,p.T)(e=>null!=e&&e),(0,Bi.t)({bufferSize:1,refCount:!1})),this.showAtRiskPasswordNotificationsState=this.stateProvider.getActive(Qd),this.showAtRiskPasswordNotifications$=this.showAtRiskPasswordNotificationsState.state$.pipe((0,p.T)(e=>null==e||e))}setShowCardsCurrentTab(e){return kd(this,void 0,void 0,function*(){yield this.showCardsCurrentTabState.update(()=>e)})}setShowIdentitiesCurrentTab(e){return kd(this,void 0,void 0,function*(){yield this.showIdentitiesCurrentTabState.update(()=>e)})}setClickItemsToAutofillVaultView(e){return kd(this,void 0,void 0,function*(){yield this.clickItemsToAutofillVaultViewState.update(()=>e)})}setEnablePasskeys(e){return kd(this,void 0,void 0,function*(){yield this.enablePasskeysState.update(()=>e)})}setShowAtRiskPasswordNotifications(e){return kd(this,void 0,void 0,function*(){yield this.showAtRiskPasswordNotificationsState.update(()=>e)})}},deps:[w.v2,gd.b]}),(0,oe.F)({provide:na,useClass:na,deps:[Ls.zq,Vs.K,ta,ae.Hq]}),(0,oe.F)({provide:ta,useClass:ta,deps:[]}),(0,oe.F)({provide:Fn.P,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)}getOrganizationBillingMetadata(e){return Jn(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/vnext/metadata",null,!0,!0);return new Ln(t)})}getOrganizationBillingMetadataSelfHost(e){return Jn(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/vnext/self-host/metadata",null,!0,!0);return new Ln(t)})}getPlans(){return Jn(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/plans",null,!0,!0);return new je.s(e,Kn.tQ)})}getPremiumPlan(){return Jn(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/plans/premium",null,!0,!0);return new jn(e)})}getProviderClientInvoiceReport(e,t){return Jn(this,void 0,void 0,function*(){return yield this.apiService.send("GET","/providers/"+e+"/billing/invoices/"+t,null,!0,!0)})}getProviderInvoices(e){return Jn(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/billing/invoices",null,!0,!0);return new zn(t)})}getProviderSubscription(e){return Jn(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/billing/subscription",null,!0,!0);return new Wn(t)})}restartSubscription(e,t){return Jn(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/organizations/"+e+"/billing/restart-subscription",t,!0,!1)})}},deps:[de.G]}),(0,oe.F)({provide:Dn.Q,useClass:class{constructor(e,t){this.billingApiService=e,this.platformUtilsService=t,this.metadataCache=new Map,this.refreshMetadataTrigger=new _e.t(void 0),this.refreshMetadataCache=()=>{this.metadataCache.clear(),this.refreshMetadataTrigger.next()}}getOrganizationMetadata$(e){return this.refreshMetadataTrigger.pipe((0,rt.n)(()=>{const t=this.metadataCache.get(e);if(t)return t;const i=(0,jt.H)(this.fetchMetadata(e)).pipe((0,Bi.t)({bufferSize:1,refCount:!1}));return this.metadataCache.set(e,i),i}))}fetchMetadata(e){return _n(this,void 0,void 0,function*(){return this.platformUtilsService.isSelfHost()?yield this.billingApiService.getOrganizationBillingMetadataSelfHost(e):yield this.billingApiService.getOrganizationBillingMetadata(e)})}},deps:[Fn.P,V.y]}),(0,oe.F)({provide:Rn.Q,useClass:class{constructor(e){this.stateProvider=e}hasPremiumFromAnyOrganization$(e){return this.stateProvider.getUser(e,Vn).state$.pipe((0,p.T)(e=>!!(null==e?void 0:e.hasPremiumFromAnyOrganization)))}hasPremiumPersonally$(e){return this.stateProvider.getUser(e,Vn).state$.pipe((0,p.T)(e=>!!(null==e?void 0:e.hasPremiumPersonally)))}hasPremiumFromAnySource$(e){return this.stateProvider.getUser(e,Vn).state$.pipe((0,p.T)(e=>!0===(null==e?void 0:e.hasPremiumFromAnyOrganization)||!0===(null==e?void 0:e.hasPremiumPersonally)))}setHasPremium(e,t,i){return Un(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,Vn).update(i=>({hasPremiumPersonally:e,hasPremiumFromAnyOrganization:t}),{shouldUpdate:i=>null==i||i.hasPremiumFromAnyOrganization!==t||i.hasPremiumPersonally!==e})})}},deps:[w.v2]}),(0,oe.F)({provide:On.z,useClass:class{constructor(e,t,i,n,r){this.billingApiService=e,this.configService=t,this.i18nService=i,this.logService=n,this.environmentService=r,this.getPersonalSubscriptionPricingTiers$=()=>(0,bi.z)([this.premium$,this.families$]).pipe((0,cr.W)(e=>(this.logService.error("Failed to load personal subscription pricing tiers",e),(0,ar.$)(()=>e)))),this.getBusinessSubscriptionPricingTiers$=()=>(0,bi.z)([this.teams$,this.enterprise$,this.custom$]).pipe((0,cr.W)(e=>(this.logService.error("Failed to load business subscription pricing tiers",e),(0,ar.$)(()=>e)))),this.getDeveloperSubscriptionPricingTiers$=()=>(0,bi.z)([this.free$,this.teams$,this.enterprise$]).pipe((0,cr.W)(e=>(this.logService.error("Failed to load developer subscription pricing tiers",e),(0,ar.$)(()=>e)))),this.organizationPlansResponse$=this.environmentService.environment$.pipe((0,Ai.s)(1),(0,rt.n)(e=>e.isCloud()?(0,jt.H)(this.billingApiService.getPlans()):(0,Ii.of)({data:[]})),(0,Bi.t)({bufferSize:1,refCount:!1})),this.premiumPlanResponse$=this.environmentService.environment$.pipe((0,Ai.s)(1),(0,rt.n)(e=>e.isCloud()?(0,jt.H)(this.billingApiService.getPremiumPlan()).pipe((0,cr.W)(e=>(this.logService.error("Failed to fetch premium plan from API",e),(0,ar.$)(()=>e)))):(0,Ii.of)({seat:void 0,storage:void 0})),(0,Bi.t)({bufferSize:1,refCount:!1})),this.premium$=this.premiumPlanResponse$.pipe((0,p.T)(e=>{var t,i,n;return{id:ur.OU.Premium,name:this.i18nService.t("premium"),description:this.i18nService.t("advancedOnlineSecurity"),availableCadences:[ur.fQ.Annually],passwordManager:{type:"standalone",annualPrice:null===(t=e.seat)||void 0===t?void 0:t.price,annualPricePerAdditionalStorageGB:null===(i=e.storage)||void 0===i?void 0:i.price,providedStorageGB:null===(n=e.storage)||void 0===n?void 0:n.provided,features:[this.featureTranslations.builtInAuthenticator(),this.featureTranslations.secureFileStorage(),this.featureTranslations.emergencyAccess(),this.featureTranslations.breachMonitoring(),this.featureTranslations.andMoreFeatures()]}}})),this.families$=this.organizationPlansResponse$.pipe((0,lr.v)(this.configService.getFeatureFlag$(dr.TO.PM26462_Milestone_3)),(0,p.T)(([e,t])=>{var i,n,r,s;const o=e.data.find(e=>e.type===(t?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025));return{id:ur.OU.Families,name:this.i18nService.t("planNameFamilies"),description:this.i18nService.t("planDescFamiliesV2"),availableCadences:[ur.fQ.Annually],passwordManager:{type:"packaged",users:null===(i=null==o?void 0:o.PasswordManager)||void 0===i?void 0:i.baseSeats,annualPrice:null===(n=null==o?void 0:o.PasswordManager)||void 0===n?void 0:n.basePrice,annualPricePerAdditionalStorageGB:null===(r=null==o?void 0:o.PasswordManager)||void 0===r?void 0:r.additionalStoragePricePerGb,providedStorageGB:null===(s=null==o?void 0:o.PasswordManager)||void 0===s?void 0:s.baseStorageGb,features:[this.featureTranslations.premiumAccounts(),this.featureTranslations.familiesUnlimitedSharing(),this.featureTranslations.familiesUnlimitedCollections(),this.featureTranslations.familiesSharedStorage()]}}})),this.free$=this.organizationPlansResponse$.pipe((0,p.T)(e=>{var t,i,n;const r=e.data.find(e=>e.type===rr.OL.Free);return{id:ur.ql.Free,name:this.i18nService.t("planNameFree"),description:this.i18nService.t("planDescFreeV2","1"),availableCadences:[],passwordManager:{type:"free",features:[this.featureTranslations.limitedUsersV2(null===(t=null==r?void 0:r.PasswordManager)||void 0===t?void 0:t.maxSeats),this.featureTranslations.limitedCollectionsV2(null===(i=null==r?void 0:r.PasswordManager)||void 0===i?void 0:i.maxCollections),this.featureTranslations.alwaysFree()]},secretsManager:{type:"free",features:[this.featureTranslations.twoSecretsIncluded(),this.featureTranslations.projectsIncludedV2(null===(n=null==r?void 0:r.SecretsManager)||void 0===n?void 0:n.maxProjects)]}}})),this.teams$=this.organizationPlansResponse$.pipe((0,p.T)(e=>{var t,i,n,r,s,o;const a=e.data.find(e=>e.type===rr.OL.TeamsAnnually);return{id:ur.ql.Teams,name:this.i18nService.t("planNameTeams"),description:this.i18nService.t("teamsPlanUpgradeMessage"),availableCadences:[ur.fQ.Annually,ur.fQ.Monthly],passwordManager:{type:"scalable",annualPricePerUser:null===(t=null==a?void 0:a.PasswordManager)||void 0===t?void 0:t.seatPrice,annualPricePerAdditionalStorageGB:null===(i=null==a?void 0:a.PasswordManager)||void 0===i?void 0:i.additionalStoragePricePerGb,providedStorageGB:null===(n=null==a?void 0:a.PasswordManager)||void 0===n?void 0:n.baseStorageGb,features:[this.featureTranslations.secureItemSharing(),this.featureTranslations.eventLogMonitoring(),this.featureTranslations.directoryIntegration(),this.featureTranslations.scimSupport()]},secretsManager:{type:"scalable",annualPricePerUser:null===(r=null==a?void 0:a.SecretsManager)||void 0===r?void 0:r.seatPrice,annualPricePerAdditionalServiceAccount:null===(s=null==a?void 0:a.SecretsManager)||void 0===s?void 0:s.additionalPricePerServiceAccount,features:[this.featureTranslations.unlimitedSecretsAndProjects(),this.featureTranslations.includedMachineAccountsV2(null===(o=null==a?void 0:a.SecretsManager)||void 0===o?void 0:o.baseServiceAccount)]}}})),this.enterprise$=this.organizationPlansResponse$.pipe((0,p.T)(e=>{var t,i,n,r,s,o;const a=e.data.find(e=>e.type===rr.OL.EnterpriseAnnually);return{id:ur.ql.Enterprise,name:this.i18nService.t("planNameEnterprise"),description:this.i18nService.t("planDescEnterpriseV2"),availableCadences:[ur.fQ.Annually,ur.fQ.Monthly],passwordManager:{type:"scalable",annualPricePerUser:null===(t=null==a?void 0:a.PasswordManager)||void 0===t?void 0:t.seatPrice,annualPricePerAdditionalStorageGB:null===(i=null==a?void 0:a.PasswordManager)||void 0===i?void 0:i.additionalStoragePricePerGb,providedStorageGB:null===(n=null==a?void 0:a.PasswordManager)||void 0===n?void 0:n.baseStorageGb,features:[this.featureTranslations.enterpriseSecurityPolicies(),this.featureTranslations.passwordLessSso(),this.featureTranslations.accountRecovery(),this.featureTranslations.selfHostOption(),this.featureTranslations.complimentaryFamiliesPlan()]},secretsManager:{type:"scalable",annualPricePerUser:null===(r=null==a?void 0:a.SecretsManager)||void 0===r?void 0:r.seatPrice,annualPricePerAdditionalServiceAccount:null===(s=null==a?void 0:a.SecretsManager)||void 0===s?void 0:s.additionalPricePerServiceAccount,features:[this.featureTranslations.unlimitedUsers(),this.featureTranslations.includedMachineAccountsV2(null===(o=null==a?void 0:a.SecretsManager)||void 0===o?void 0:o.baseServiceAccount)]}}})),this.custom$=this.organizationPlansResponse$.pipe((0,p.T)(()=>({id:ur.ql.Custom,name:this.i18nService.t("planNameCustom"),description:this.i18nService.t("planDescCustom"),availableCadences:[],passwordManager:{type:"custom",features:[this.featureTranslations.strengthenCybersecurity(),this.featureTranslations.boostProductivity(),this.featureTranslations.seamlessIntegration()]}}))),this.featureTranslations={builtInAuthenticator:()=>({key:"builtInAuthenticator",value:this.i18nService.t("builtInAuthenticator")}),emergencyAccess:()=>({key:"emergencyAccess",value:this.i18nService.t("emergencyAccess")}),breachMonitoring:()=>({key:"breachMonitoring",value:this.i18nService.t("breachMonitoring")}),andMoreFeatures:()=>({key:"andMoreFeatures",value:this.i18nService.t("andMoreFeatures")}),premiumAccounts:()=>({key:"premiumAccounts",value:this.i18nService.t("premiumAccounts")}),secureFileStorage:()=>({key:"secureFileStorage",value:this.i18nService.t("secureFileStorage")}),familiesUnlimitedSharing:()=>({key:"familiesUnlimitedSharing",value:this.i18nService.t("familiesUnlimitedSharing")}),familiesUnlimitedCollections:()=>({key:"familiesUnlimitedCollections",value:this.i18nService.t("familiesUnlimitedCollections")}),familiesSharedStorage:()=>({key:"familiesSharedStorage",value:this.i18nService.t("familiesSharedStorage")}),limitedUsersV2:e=>({key:"limitedUsersV2",value:this.i18nService.t("limitedUsersV2",e)}),limitedCollectionsV2:e=>({key:"limitedCollectionsV2",value:this.i18nService.t("limitedCollectionsV2",e)}),alwaysFree:()=>({key:"alwaysFree",value:this.i18nService.t("alwaysFree")}),twoSecretsIncluded:()=>({key:"twoSecretsIncluded",value:this.i18nService.t("twoSecretsIncluded")}),projectsIncludedV2:e=>({key:"projectsIncludedV2",value:this.i18nService.t("projectsIncludedV2",e)}),secureItemSharing:()=>({key:"secureItemSharing",value:this.i18nService.t("secureItemSharing")}),eventLogMonitoring:()=>({key:"eventLogMonitoring",value:this.i18nService.t("eventLogMonitoring")}),directoryIntegration:()=>({key:"directoryIntegration",value:this.i18nService.t("directoryIntegration")}),scimSupport:()=>({key:"scimSupport",value:this.i18nService.t("scimSupport")}),unlimitedSecretsAndProjects:()=>({key:"unlimitedSecretsAndProjects",value:this.i18nService.t("unlimitedSecretsAndProjects")}),includedMachineAccountsV2:e=>({key:"includedMachineAccountsV2",value:this.i18nService.t("includedMachineAccountsV2",e)}),enterpriseSecurityPolicies:()=>({key:"enterpriseSecurityPolicies",value:this.i18nService.t("enterpriseSecurityPolicies")}),passwordLessSso:()=>({key:"passwordLessSso",value:this.i18nService.t("passwordLessSso")}),accountRecovery:()=>({key:"accountRecovery",value:this.i18nService.t("accountRecovery")}),selfHostOption:()=>({key:"selfHostOption",value:this.i18nService.t("selfHostOption")}),complimentaryFamiliesPlan:()=>({key:"complimentaryFamiliesPlan",value:this.i18nService.t("complimentaryFamiliesPlan")}),unlimitedUsers:()=>({key:"unlimitedUsers",value:this.i18nService.t("unlimitedUsers")}),strengthenCybersecurity:()=>({key:"strengthenCybersecurity",value:this.i18nService.t("strengthenCybersecurity")}),boostProductivity:()=>({key:"boostProductivity",value:this.i18nService.t("boostProductivity")}),seamlessIntegration:()=>({key:"seamlessIntegration",value:this.i18nService.t("seamlessIntegration")})}}},deps:[Fn.P,z.w,U.W,Vs.K,Gs.v]}),(0,oe.F)({provide:ve.y,useClass:class{constructor(e){this.stateProvider=e,this.autoConfirmFingerPrints=this.buildOrganizationManagementPreference(tt,!1)}buildOrganizationManagementPreference(e,t){return new ve.i(this.getKeyFromState(e).state$.pipe((0,p.T)(e=>null!=e?e:t)),this.setKeyInStateFn(e))}getKeyFromState(e){return this.stateProvider.getActive(e)}setKeyInStateFn(e){return t=>et(this,void 0,void 0,function*(){yield this.getKeyFromState(e).update(()=>t)})}},deps:[w.v2]}),(0,oe.F)({provide:Oa,useClass:Oa,deps:[b.Lu]}),(0,oe.F)({provide:E.zcH,useClass:pu,deps:[]}),(0,oe.F)({provide:ae.mq,useFactory:()=>new d.B,deps:[]}),(0,oe.F)({provide:io.qk,useFactory:e=>new io.qk(e.asObservable()),deps:[ae.mq]}),(0,oe.F)({provide:io.D$,useFactory:e=>new io.fg(e),deps:[ae.mq]}),(0,oe.F)({provide:mr.Cc,useClass:mr.P8,deps:[Vs.K]}),(0,oe.F)({provide:ye.J,useClass:class{constructor(e){this.apiService=e}postProviderSetup(e,t){return vt(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/providers/"+e+"/setup",t,!0,!0);return new gt(i)})}getProvider(e){return vt(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e,null,!0,!0);return new gt(t)})}putProvider(e,t){return vt(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/providers/"+e,t,!0,!0);return new gt(i)})}providerRecoverDeleteToken(e,t){return this.apiService.send("POST","/providers/"+e+"/delete-recover-token",t,!1,!1)}deleteProvider(e){return vt(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/providers/"+e,null,!0,!1)})}getProviderOrganizations(e){return vt(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new je.s(t,pt)})}getProviderAddableOrganizations(e){return vt(this,void 0,void 0,function*(){return(yield this.apiService.send("GET","/providers/"+e+"/clients/addable",null,!0,!0)).map(e=>new ht(e))})}addOrganizationToProvider(e,t){return this.apiService.send("POST","/providers/"+e+"/clients/existing",t,!0,!1)}updateProviderOrganization(e,t,i){return vt(this,void 0,void 0,function*(){return yield this.apiService.send("PUT","/providers/"+e+"/clients/"+t,i,!0,!1)})}createProviderOrganization(e,t){return this.apiService.send("POST","/providers/"+e+"/clients",t,!0,!1)}},deps:[de.G]}),(0,oe.F)({provide:b.zZ,useClass:b.aT,deps:[w.v2]}),(0,oe.F)({provide:ji.i,useClass:class{getOrganizationInvite(){return Vi(this,void 0,void 0,function*(){return null})}setOrganizationInvitation(e){return Vi(this,void 0,void 0,function*(){})}clearOrganizationInvitation(){return Vi(this,void 0,void 0,function*(){})}},deps:[]}),(0,oe.F)({provide:re.HQ,useClass:Gd.K,deps:[de.G,Tr.N,U.W,b.zZ,b.Lu,kt,vs.O,he.X,g.uB,v.bj,Br.h,Ns.vW]}),(0,oe.F)({provide:Ho.t,useClass:Ho.t,deps:[z.w]}),(0,oe.F)({provide:Fd.f,useClass:class{constructor(){this.anonLayoutWrapperDataSubject=new d.B}setAnonLayoutWrapperData(e){this.anonLayoutWrapperDataSubject.next(e)}anonLayoutWrapperData$(){return this.anonLayoutWrapperDataSubject.asObservable()}},deps:[]}),(0,oe.F)({provide:le.mZ,useClass:le.v2,deps:[b.Lu,It.T,vs.L,z.w]}),(0,oe.F)({provide:le.yX,useClass:le.NH,deps:[]}),(0,oe.F)({provide:le.ag,useClass:le.jr,deps:[]}),(0,oe.F)({provide:Bn.tE,useClass:Bn.Ap,deps:[de.G]}),(0,oe.F)({provide:mu.Z,useExisting:yu,deps:[]}),(0,oe.F)({provide:le.qG,useClass:le.nF,deps:[kr.R,Gs.v,Rd.JJ,V.y,Ft._]}),(0,oe.F)({provide:Ns.vW,useClass:class{constructor(e,t,i,n,r,s,o,a=null){this.sdkClientFactory=e,this.environmentService=t,this.platformUtilsService=i,this.accountService=n,this.apiService=r,this.stateProvider=s,this.configService=o,this.userAgent=a,this.sdkClientOverrides=new _e.t({}),this.sdkClientCache=new Map,this.client$=this.environmentService.environment$.pipe((0,ra.H)(e=>Ra(this,void 0,void 0,function*(){yield Fr.B.Ready;const t=yield this.toSettings(e),i=yield this.sdkClientFactory.createSdkClient(new Ma(this.apiService),t);return yield this.loadFeatureFlags(i),i})),(0,Bi.t)({refCount:!0,bufferSize:1}))}registerClient$(e){return this.sdkClientOverrides.pipe((0,sa.v)(t=>t[e]!==Da,!1),(0,p.T)(t=>{if(t[e]===Da)throw new Error("Encountered UnsetClient even though it should have been filtered out");return t[e]}),(0,hi.F)(),(0,rt.n)(t=>t?(0,Ii.of)(t):this.internalClient$(e)),(0,sa.v)(e=>void 0!==e,!1),(0,oa.v)(()=>new Ys.m8(e)))}internalClient$(e){const t=this.sdkClientCache.get(e);if(void 0!==t)return t;const i=this.accountService.accounts$.pipe((0,p.T)(t=>t[e]),(0,hi.F)()),n=(0,bi.z)([this.environmentService.getEnvironment$(e),i,Fr.B.Ready]).pipe((0,rt.n)(([t,i])=>new Ws.c(n=>{let r;return(()=>Ra(this,void 0,void 0,function*(){if(null==t||null==i)return;const n=yield this.toSettings(t),r=yield this.sdkClientFactory.createSdkClient(new Ma(this.apiService,e),n);return yield Qa(e,r.platform().state(),this.stateProvider),yield this.loadFeatureFlags(r),r}))().then(e=>{r=void 0===e?void 0:new da(e),n.next(r)}).catch(e=>{n.error(e)}),()=>null==r?void 0:r.markForDisposal()})),(0,M.M)({finalize:()=>this.sdkClientCache.delete(e)}),(0,Bi.t)({refCount:!0,bufferSize:1}));return this.sdkClientCache.set(e,n),n}loadFeatureFlags(e){return Ra(this,void 0,void 0,function*(){var t;const i=yield(0,u._)(this.configService.serverConfig$),n=new Map(Object.entries(null!==(t=null==i?void 0:i.featureStates)&&void 0!==t?t:{}).filter(([,e])=>"boolean"==typeof e).map(([e,t])=>[e,t]));e.platform().load_flags(n)})}toSettings(e){return Ra(this,void 0,void 0,function*(){var t;return{apiUrl:e.getApiUrl(),identityUrl:e.getIdentityUrl(),deviceType:(0,Ys.yL)(this.platformUtilsService.getDevice()),userAgent:null!==(t=this.userAgent)&&void 0!==t?t:navigator.userAgent,bitwardenClientVersion:yield this.platformUtilsService.getApplicationVersionNumber()}})}},deps:[zs,Gs.v,V.y,Y.D,de.G,w.v2,z.w]}),(0,oe.F)({provide:Ys.K5,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c,d=null){this.sdkClientFactory=e,this.environmentService=t,this.platformUtilsService=i,this.accountService=n,this.kdfConfigService=r,this.keyService=s,this.accountCryptographyStateService=o,this.apiService=a,this.stateProvider=l,this.configService=c,this.userAgent=d,this.sdkClientOverrides=new _e.t({}),this.sdkClientCache=new Map,this.client$=this.environmentService.environment$.pipe((0,ra.H)(e=>Ta(this,void 0,void 0,function*(){yield Fr.B.Ready;const t=yield this.toSettings(e),i=yield this.sdkClientFactory.createSdkClient(new Pa(this.apiService),t);return yield this.loadFeatureFlags(i),i})),(0,Bi.t)({refCount:!0,bufferSize:1})),this.version$=this.client$.pipe((0,p.T)(e=>e.version()),(0,cr.W)(()=>"Unsupported"))}userClient$(e){return this.sdkClientOverrides.pipe((0,sa.v)(t=>t[e]!==Fa,!1),(0,p.T)(t=>{if(t[e]===Fa)throw new Error("Encountered UnsetClient even though it should have been filtered out");return t[e]}),(0,hi.F)(),(0,rt.n)(t=>t?(0,Ii.of)(t):this.internalClient$(e)),(0,sa.v)(e=>void 0!==e,!1),(0,oa.v)(()=>new Ys.m8(e)))}setClient(e,t){const i=this.sdkClientOverrides.value[e];this.sdkClientOverrides.next(Object.assign(Object.assign({},this.sdkClientOverrides.value),{[e]:t?new da(t):Fa})),i!==Fa&&void 0!==i&&i.markForDisposal()}internalClient$(e){const t=this.sdkClientCache.get(e);if(void 0!==t)return t;const i=this.accountService.accounts$.pipe((0,p.T)(t=>t[e]),(0,hi.F)()),n=this.kdfConfigService.getKdfConfig$(e).pipe((0,hi.F)()),r=this.accountCryptographyStateService.accountCryptographicState$(e).pipe((0,hi.F)()),s=this.keyService.userKey$(e).pipe((0,hi.F)()),o=this.keyService.encryptedOrgKeys$(e).pipe((0,hi.F)(ca.c)),a=(0,bi.z)([this.environmentService.getEnvironment$(e),i,n,r,s,o,Fr.B.Ready]).pipe((0,rt.n)(([t,i,n,r,s,o])=>new Ws.c(a=>{let l;return(()=>Ta(this,void 0,void 0,function*(){if(null==t||null==n||null==r||null==s)return;const a=yield this.toSettings(t),l=yield this.sdkClientFactory.createSdkClient(new Pa(this.apiService,e),a);return yield this.initializeClient(e,l,i,n.toSdkConfig(),s,r,o),l}))().then(e=>{l=void 0===e?void 0:new da(e),a.next(l)}).catch(e=>{a.error(e)}),()=>null==l?void 0:l.markForDisposal()})),(0,M.M)({finalize:()=>this.sdkClientCache.delete(e)}),(0,uo.u)({connector:()=>new aa.m(1),resetOnRefCountZero:()=>(0,la.O)(1e3)}));return this.sdkClientCache.set(e,a),a}initializeClient(e,t,i,n,r,s,o){return Ta(this,void 0,void 0,function*(){yield Qa(e,t.platform().state(),this.stateProvider),yield this.loadFeatureFlags(t),(yield this.configService.getFeatureFlag(dr.TO.UnlockViaSDK))?yield t.crypto().initialize_user_crypto({userId:(0,Ys.WD)(e),email:i.email,method:{clientManagedState:{}},kdfParams:n,accountCryptographicState:s}):yield t.crypto().initialize_user_crypto({userId:(0,Ys.WD)(e),email:i.email,method:{decryptedKey:{decrypted_user_key:r.toBase64()}},kdfParams:n,accountCryptographicState:s}),yield t.crypto().initialize_org_crypto({organizationKeys:new Map(Object.entries(o).map(([e,t])=>[(0,Ys.WD)(e),t.toJSON()]))})})}loadFeatureFlags(e){return Ta(this,void 0,void 0,function*(){var t;const i=yield(0,u._)(this.configService.serverConfig$),n=new Map(Object.entries(null!==(t=null==i?void 0:i.featureStates)&&void 0!==t?t:{}).filter(([,e])=>"boolean"==typeof e).map(([e,t])=>[e,t]));e.platform().load_flags(n)})}toSettings(e){return Ta(this,void 0,void 0,function*(){var t;return{apiUrl:e.getApiUrl(),identityUrl:e.getIdentityUrl(),deviceType:(0,Ys.yL)(this.platformUtilsService.getDevice()),bitwardenClientVersion:yield this.platformUtilsService.getApplicationVersionNumber(),userAgent:null!==(t=this.userAgent)&&void 0!==t?t:navigator.userAgent}})}},deps:[zs,Gs.v,V.y,Y.D,b.zZ,b.Lu,Br.h,de.G,w.v2,z.w]}),(0,oe.F)({provide:Ac.y,useClass:Ac.H,deps:[g.YD,f.PV,Y.D]}),(0,oe.F)({provide:Ps,useClass:class{constructor(e){this.cryptoFunctionService=e}hashPassword(e,t){return Ds(this,void 0,void 0,function*(){if(!e||!t)throw new Error("Password and key material are required.");return yield this.cryptoFunctionService.pbkdf2(e,t,"sha256",Rs)})}},deps:[kr.R]}),(0,oe.F)({provide:le.Ak,useClass:le.dl,deps:[js.U]}),(0,oe.F)({provide:b.ox,useClass:b.PA,deps:[de.G]}),(0,oe.F)({provide:b.wM,useClass:b.xP,deps:[b.Lu,k.p,b.ox,Vs.K,Ys.K5,de.G,z.w,Br.h]}),(0,oe.F)({provide:v.aJ,useClass:v.L7,deps:[z.w,v.pi,Ft._,Ga.H,b.wM,Wr.G,Vs.K]}),(0,oe.F)({provide:Td.RB,useClass:Td.Sb,deps:[w.v2,de.G,f.PV,T.u,N,io.qk]}),(0,oe.F)({provide:Gt,useClass:class{constructor(e,t,i){this.globalStateProvider=e,this.sdkService=t,this.sendPasswordService=i,this.initializeState()}initializeState(){this.sendAccessTokenDictGlobalState=this.globalStateProvider.get(Nt)}tryGetSendAccessToken$(e){return(0,Vt.v)(()=>(0,jt.H)(this._tryGetSendAccessToken(e)))}_tryGetSendAccessToken(e){return zt(this,void 0,void 0,function*(){this.validateSendId(e);const t=yield this.getSendAccessTokenFromStorage(e);if(null!=t)return t.isExpired()?(yield this.clearSendAccessTokenFromStorage(e),{kind:"expired"}):t;const i={sendId:e},n=yield(0,u._)(this.sdkService.client$);try{const t=yield n.auth().send_access().request_send_access_token(i),r=Ut.fromSendAccessTokenResponse(t);return yield this.setSendAccessTokenInStorage(e,r),r}catch(r){return this.normalizeSendAccessTokenError(r)}})}getSendAccessToken$(e,t){return(0,Vt.v)(()=>(0,jt.H)(this._getSendAccessToken(e,t)))}_getSendAccessToken(e,t){return zt(this,void 0,void 0,function*(){this.validateCredentialsRequest(e,t);const i={sendId:e,sendAccessCredentials:this.convertDomainCredentialsToSdkCredentials(t)},n=yield(0,u._)(this.sdkService.client$);try{const t=yield n.auth().send_access().request_send_access_token(i),r=Ut.fromSendAccessTokenResponse(t);return yield this.setSendAccessTokenInStorage(e,r),r}catch(r){return this.normalizeSendAccessTokenError(r)}})}invalidateSendAccessToken(e){return zt(this,void 0,void 0,function*(){yield this.clearSendAccessTokenFromStorage(e)})}hashSendPassword(e,t){return zt(this,void 0,void 0,function*(){if(null==e||""===e.trim())throw new Error("Password must be provided.");if(null==t||""===t.trim())throw new Error("KeyMaterialUrlB64 must be provided.");const i=at.A.fromUrlB64ToArray(t),n=yield this.sendPasswordService.hashPassword(e,i);return at.A.fromBufferToB64(n)})}getSendAccessTokenFromStorage(e){return zt(this,void 0,void 0,function*(){if(null!=this.sendAccessTokenDictGlobalState){const t=yield(0,u._)(this.sendAccessTokenDictGlobalState.state$);return null==t?void 0:t[e]}})}setSendAccessTokenInStorage(e,t){return zt(this,void 0,void 0,function*(){null!=this.sendAccessTokenDictGlobalState&&(yield this.sendAccessTokenDictGlobalState.update(i=>(null!=i||(i={}),i[e]=t,i),{shouldUpdate:i=>{const n=null==i?void 0:i[e];return(null==n?void 0:n.token)!==t.token||(null==n?void 0:n.expiresAt)!==t.expiresAt}}))})}clearSendAccessTokenFromStorage(e){return zt(this,void 0,void 0,function*(){null!=this.sendAccessTokenDictGlobalState&&(yield this.sendAccessTokenDictGlobalState.update(t=>{if(!t)return t;if(null==t[e])return t;const i=t,n=e;i[n];return Yt(i,["symbol"==typeof n?n:n+""])},{shouldUpdate:t=>null!=(null==t?void 0:t[e])}))})}normalizeSendAccessTokenError(e){if(this.isSendAccessTokenError(e))return"unexpected"===e.kind?{kind:"unexpected_server",error:e.data}:{kind:"expected_server",error:e.data};if(e instanceof Error)return{kind:"unknown",error:e.message};try{return{kind:"unknown",error:JSON.stringify(e)}}catch(t){return{kind:"unknown",error:"error cannot be stringified"}}}isSendAccessTokenError(e){return"object"==typeof e&&null!==e&&"kind"in e&&("expected"===e.kind||"unexpected"===e.kind)}validateSendId(e){if(null==e||""===e.trim())throw new Error("sendId must be provided.")}validateCredentialsRequest(e,t){if(this.validateSendId(e),null==t)throw new Error("sendAccessCredentials must be provided.");if("password"===t.kind&&!t.passwordHashB64)throw new Error("passwordHashB64 must be provided for password credentials.");if("email"===t.kind&&!t.email)throw new Error("email must be provided for email credentials.");if(!("email_otp"!==t.kind||t.email&&t.otp))throw new Error("email and otp must be provided for email_otp credentials.")}convertDomainCredentialsToSdkCredentials(e){switch(e.kind){case"password":return{passwordHashB64:e.passwordHashB64};case"email":return{email:e.email};case"email_otp":return{email:e.email,otp:e.otp}}}},deps:[w.Y2,Ys.K5,Ps]}),(0,oe.F)({provide:class{},useClass:class{constructor(e,t,i,n,r){this.stateProvider=e,this.apiService=t,this.notificationService=i,this.authService=n,this.logService=r,this.notifications$=(0,cc.j)(e=>this.notificationState(e).state$.pipe((0,rt.n)(t=>uc(this,void 0,void 0,function*(){return null==t?(yield this.fetchNotificationsFromApi(e),null):t})),(0,cc.w)(),(0,p.T)(e=>e.map(e=>new Ht(e))))),this.unreadNotifications$=(0,cc.j)(e=>this.notifications$(e).pipe((0,p.T)(e=>e.filter(e=>null==e.readDate))))}markAsRead(e,t){return uc(this,void 0,void 0,function*(){yield this.apiService.send("PATCH",`/notifications/${e}/read`,null,!0,!1),yield this.notificationState(t).update(t=>{const i=null==t?void 0:t.find(t=>t.id===e);return i&&(i.readDate=new Date),t})})}markAsDeleted(e,t){return uc(this,void 0,void 0,function*(){yield this.apiService.send("DELETE",`/notifications/${e}/delete`,null,!0,!1),yield this.notificationState(t).update(t=>{const i=null==t?void 0:t.find(t=>t.id===e);return i&&(i.deletedDate=new Date),t})})}clearState(e){return uc(this,void 0,void 0,function*(){yield this.replaceNotificationState(e,[])})}refreshNotifications(e){return uc(this,void 0,void 0,function*(){yield this.fetchNotificationsFromApi(e)})}filteredEndUserNotifications$(e){return 0==e.length?ho.w:this.notificationService.notifications$.pipe((0,h.p)(([{type:t},i])=>(t===st._n.Notification||t===st._n.NotificationStatus)&&e.includes(i)))}listenForEndUserNotifications(){return this.authService.authStatuses$.pipe(hc,(0,rt.n)(e=>this.filteredEndUserNotifications$(e)),(0,ra.H)(([e,t])=>this.upsertNotification(t,new Wt(e.payload)))).subscribe()}fetchNotificationsFromApi(e){return uc(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/notifications?pageSize=50",null,!0,!0),i=new je.s(t,$t);null!=i.continuationToken&&this.logService.warning("More notifications available, but not fetched. Consider increasing the page size from 50");const n=i.data.map(e=>new Wt(e));yield this.replaceNotificationState(e,n)})}replaceNotificationState(e,t){return this.notificationState(e).update(()=>t)}upsertNotification(e,t){return uc(this,void 0,void 0,function*(){return this.notificationState(e).update(e=>{null!=e||(e=[]);const i=e.findIndex(e=>e.id===t.id);return-1===i?e.push(t):e[i]=t,e})})}notificationState(e){return this.stateProvider.getUser(e,dc)}},deps:[w.v2,de.G,N,T.u,Vs.K]}),(0,oe.F)({provide:K,useClass:class{constructor(e,t,i,n){this.authRequestService=e,this.deviceTrustService=t,this.i18nService=i,this.toastService=n,this.adminLoginApproved$=this.authRequestService.adminLoginApproved$.pipe((0,M.M)(()=>{this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("loginApproved")})})),this.deviceTrusted$=this.deviceTrustService.deviceTrusted$.pipe((0,M.M)(()=>{this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deviceTrusted")})})),this.setupListeners$=(0,ld.h)(this.adminLoginApproved$,this.deviceTrusted$)}},deps:[v.XF,Ur.M,U.W,P.f]}),(0,oe.F)({provide:kt,useClass:class{constructor(e,t){this.apiService=e,this.logService=t}setPassword(e){return Ui(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/set-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}postPassword(e){return Ui(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}putUpdateTempPassword(e){return Ui(this,void 0,void 0,function*(){try{return yield this.apiService.send("PUT","/accounts/update-temp-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}putUpdateTdeOffboardingPassword(e){return Ui(this,void 0,void 0,function*(){try{return yield this.apiService.send("PUT","/accounts/update-tde-offboarding-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}},deps:[de.G,Vs.K]}),(0,oe.F)({provide:v.k4,useClass:v.$c,deps:[js.U]}),(0,oe.F)({provide:X,useClass:X,deps:[ae.qQ,U.W]}),(0,oe.F)({provide:ic,useClass:class{constructor(e,t){this.sdkService=e,this.logService=t}encrypt(e,t){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const n=_c(i,t.take(),!1),r=e.toSdkCipherView(n.value.vault().ciphers()),s=n.value.vault().ciphers().encrypt(r);return{cipher:ma.o.fromSdkCipher(s.cipher),encryptedFor:(0,Ys.zw)(s.encryptedFor)}}catch(n){i.error=n,i.hasError=!0}finally{ed(i)}}),(0,cr.W)(e=>(this.logService.error(`Failed to encrypt cipher: ${e}`),ho.w))))})}encryptMany(e,t){return Zc(this,void 0,void 0,function*(){return e&&0!==e.length?(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const n=_c(i,t.take(),!1);return n.value.vault().ciphers().encrypt_list(e.map(e=>e.toSdkCipherView(n.value.vault().ciphers()))).map(e=>({cipher:ma.o.fromSdkCipher(e.cipher),encryptedFor:(0,Ys.zw)(e.encryptedFor)}))}catch(n){i.error=n,i.hasError=!0}finally{ed(i)}}),(0,cr.W)(e=>(this.logService.error(`Failed to encrypt ciphers in batch: ${e}`),ho.w)))):[]})}moveToOrganization(e,t,i){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(i).pipe((0,p.T)(i=>{const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");const r=_c(n,i.take(),!1),s=e.toSdkCipherView(r.value.vault().ciphers()),o=r.value.vault().ciphers().move_to_organization(s,(0,Ys.WD)(t)),a=r.value.vault().ciphers().encrypt(o);return{cipher:ma.o.fromSdkCipher(a.cipher),encryptedFor:(0,Ys.zw)(a.encryptedFor)}}catch(r){n.error=r,n.hasError=!0}finally{ed(n)}}),(0,cr.W)(e=>(this.logService.error(`Failed to move cipher to organization: ${e}`),ho.w))))})}encryptCipherForRotation(e,t,i){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=_c(n,t.take(),!1),s=e.toSdkCipherView(r.value.vault().ciphers()),o=r.value.vault().ciphers().encrypt_cipher_for_rotation(s,i.toBase64());return{cipher:ma.o.fromSdkCipher(o.cipher),encryptedFor:(0,Ys.zw)(o.encryptedFor)}}catch(r){n.error=r,n.hasError=!0}finally{ed(n)}}),(0,cr.W)(e=>(this.logService.error(`Failed to rotate cipher data: ${e}`),ho.w))))})}decrypt(e,t){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{var i,n;const r={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const s=_c(r,t.take(),!1),o=s.value.vault().ciphers().decrypt(e.toSdkCipher()),a=Ar.f.fromSdkCipherView(o);if(a.type===mc.gC.Login&&(null===(n=null===(i=o.login)||void 0===i?void 0:i.fido2Credentials)||void 0===n?void 0:n.length)){const e=s.value.vault().ciphers().decrypt_fido2_credentials(o),t=s.value.vault().ciphers().decrypt_fido2_private_key(o);a.login.fido2Credentials=e.map(e=>{const i=Jc.X.fromSdkFido2CredentialView(e);return i.keyValue=t,i}).filter(e=>void 0!==e)}return a}catch(s){r.error=s,r.hasError=!0}finally{ed(r)}}),(0,cr.W)(e=>(this.logService.error(`Failed to decrypt cipher ${e}`),ho.w))))})}decryptManyLegacy(e,t){return(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const n=_c(i,t.take(),!1),r=[],s=[];return e.forEach(e=>{var t,i;try{const s=n.value.vault().ciphers().decrypt(e.toSdkCipher()),o=Ar.f.fromSdkCipherView(s);if(o.type===mc.gC.Login&&(null===(i=null===(t=s.login)||void 0===t?void 0:t.fido2Credentials)||void 0===i?void 0:i.length)){const e=n.value.vault().ciphers().decrypt_fido2_credentials(s),t=n.value.vault().ciphers().decrypt_fido2_private_key(s);o.login.fido2Credentials=e.map(e=>{const i=Jc.X.fromSdkFido2CredentialView(e);return i.keyValue=t,i}).filter(e=>void 0!==e)}r.push(o)}catch(o){this.logService.error(`Failed to decrypt cipher ${e.id}: ${o}`);const t=new Ar.f(e);t.name="[error: cannot decrypt]",t.decryptionFailure=!0,s.push(t)}}),[r,s]}catch(n){i.error=n,i.hasError=!0}finally{ed(i)}}),(0,cr.W)(e=>(this.logService.error(`Failed to decrypt ciphers: ${e}`),ho.w))))}decryptManyWithFailures(e,t){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(t).pipe((0,p.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK is undefined");const n=_c(i,t.take(),!1).value.vault().ciphers().decrypt_list_with_failures(e.map(e=>e.toSdkCipher())),r=n.successes;return[r,n.failures.map(e=>ma.o.fromSdkCipher(e)).filter(e=>void 0!==e)]}catch(n){i.error=n,i.hasError=!0}finally{ed(i)}})))})}decryptAttachmentContent(e,t,i,n){return Zc(this,void 0,void 0,function*(){return(0,u._)(this.sdkService.userClient$(n).pipe((0,p.T)(n=>{const r={stack:[],error:void 0,hasError:!1};try{if(!n)throw new Error("SDK is undefined");return _c(r,n.take(),!1).value.vault().attachments().decrypt_buffer(e.toSdkCipher(),t.toSdkAttachmentView(),i)}catch(s){r.error=s,r.hasError=!0}finally{ed(r)}}),(0,cr.W)(e=>(this.logService.error(`Failed to decrypt cipher buffer: ${e}`),ho.w))))})}},deps:[Ys.K5,Vs.K]}),(0,oe.F)({provide:ne.Fx,useClass:ne.kg,deps:[b.Lu,kt,vs.O,gs.b]}),(0,oe.F)({provide:Ot.vP,useClass:Ot.vP,deps:[de.G,Gs.v]}),(0,oe.F)({provide:Ot.Ld,useClass:Ot.Sw,deps:[Ot.vP]}),(0,oe.F)({provide:Au,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c){this.syncService=e,this.accountService=t,this.stateProvider=i,this.encryptedMigrator=n,this.authService=r,this.logService=s,this.dialogService=o,this.toastService=a,this.i18nService=l,this.router=c,this.isMigrating=!1,this.url$=this.router.events.pipe((0,h.p)(e=>e instanceof F.wF),(0,p.T)(e=>e.url)),this.accountService.accounts$.pipe((0,rt.n)(e=>{const t=Object.keys(e);return 0===t.length?(0,Ii.of)([]):(0,bi.z)(t.map(e=>(0,bi.z)([this.authService.authStatusFor$(e),this.syncService.lastSync$(e).pipe((0,h.p)(e=>null!=e)),this.url$]).pipe((0,h.p)(([e,t,i])=>e===m.J.Unlocked&&hu.includes(i)),(0,ra.H)(()=>this.runMigrationsIfNeeded(e)))))})).subscribe()}runMigrationsIfNeeded(e){return du(this,void 0,void 0,function*(){if((yield(0,u._)(this.authService.authStatusFor$(e)))===m.J.Unlocked)if(this.isMigrating||this.encryptedMigrator.isRunningMigrations())this.logService.info(`[EncryptedMigrationsScheduler] Skipping migration check for user ${e} because migrations are already in progress`);else{switch(this.isMigrating=!0,yield this.encryptedMigrator.needsMigrations(e)){case"noMigrationNeeded":this.logService.info(`[EncryptedMigrationsScheduler] No migrations needed for user ${e}`);break;case"needsMigrationWithMasterPassword":this.logService.info(`[EncryptedMigrationsScheduler] User ${e} needs migrations with master password`),yield this.runMigrationsWithInteraction(e);break;case"needsMigration":this.logService.info(`[EncryptedMigrationsScheduler] User ${e} needs migrations with master password`),yield this.runMigrationsWithoutInteraction(e)}this.isMigrating=!1}})}runMigrationsWithoutInteraction(e){return du(this,void 0,void 0,function*(){try{yield this.encryptedMigrator.runMigrations(e,null)}catch(t){this.logService.error("[EncryptedMigrationsScheduler] Error during migration without interaction",t)}})}runMigrationsWithInteraction(e){return du(this,void 0,void 0,function*(){const t=yield(0,u._)(this.stateProvider.getUser(e,uu).state$);if(null!=t){if(((new Date).getTime()-t.getTime())/36e5<24)return void this.logService.info("[EncryptedMigrationsScheduler] Migration prompt dismissed recently, skipping for now.")}try{const t=cu.open(this.dialogService),i=yield(0,u._)(t.closed);at.A.isNullOrWhitespace(i)?yield this.stateProvider.setUserState(uu,new Date,e):yield this.encryptedMigrator.runMigrations(e,void 0===i?null:i)}catch(i){this.logService.error("[EncryptedMigrationsScheduler] Error during migration prompt",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("migrationsFailed")})}})}},deps:[Ga.H,Y.D,w.v2,Wr.G,T.u,Vs.K,R.o3,P.f,U.W,F.Ix]}),(0,oe.F)({provide:B.hnV,useFactory:e=>()=>{},deps:[Au],multi:!0}),(0,oe.F)({provide:v.FQ,useClass:v.uU,deps:[Y.D,b.Zm,Wi.ep,v.k4,js.U,j.S,Q.k,vs.O,w.lR,k.p,T.u,Ks,L,Vs.K,b.Lu]}),(0,oe.F)({provide:tc.J,useClass:class{constructor(e,t,i){this.cipherService=e,this.apiService=t,this.billingAccountProfileStateService=i}archivedCiphers$(e){return this.cipherService.cipherListViews$(e).pipe((0,h.p)(e=>null!=e),(0,p.T)(e=>e.filter(e=>Lc.n.isArchived(e)&&!Lc.n.isDeleted(e))))}userCanArchive$(e){return this.billingAccountProfileStateService.hasPremiumFromAnySource$(e).pipe((0,Bi.t)({refCount:!0,bufferSize:1}))}userHasPremium$(e){return this.billingAccountProfileStateService.hasPremiumFromAnySource$(e).pipe((0,Bi.t)({refCount:!0,bufferSize:1}))}showSubscriptionEndedMessaging$(e){return(0,bi.z)([this.archivedCiphers$(e),this.userHasPremium$(e)]).pipe((0,p.T)(([e,t])=>e.length>0&&!t),(0,Bi.t)({refCount:!0,bufferSize:1}))}archiveWithServer(e,t){return $c(this,void 0,void 0,function*(){const i=new Hc(Array.isArray(e)?e:[e]),n=yield this.apiService.send("PUT","/ciphers/archive",i,!0,!0),r=new je.s(n,Cl.N),s=yield(0,u._)(this.cipherService.ciphers$(t)),o=r.data.map(e=>{var t;return new ha.A(e,null===(t=s[e.id])||void 0===t?void 0:t.collectionIds)});return yield this.cipherService.upsert(o,t),r.data[0]})}unarchiveWithServer(e,t){return $c(this,void 0,void 0,function*(){const i=new Wc(Array.isArray(e)?e:[e]),n=yield this.apiService.send("PUT","/ciphers/unarchive",i,!0,!0),r=new je.s(n,Cl.N),s=yield(0,u._)(this.cipherService.ciphers$(t)),o=r.data.map(e=>{var t;return new ha.A(e,null===(t=s[e.id])||void 0===t?void 0:t.collectionIds)});return yield this.cipherService.upsert(o,t),r.data[0]})}},deps:[k.p,de.G,Rn.Q]}),(0,oe.F)({provide:us.y,useClass:class{constructor(e,t){this.keyService=e,this.encryptService=t}createKeySet(e,t){return ps(this,void 0,void 0,function*(){if(!e)throw new Error("failed to create key set: upstreamKey is required");if(!t)throw new Error("failed to create key set: downstreamKey is required");const[i,n]=yield this.keyService.makeKeyPair(e),r=at.A.fromB64ToArray(i),s=yield this.encryptService.encapsulateKeyUnsigned(t,r),o=yield this.encryptService.wrapEncapsulationKey(r,t);return new Mi.B(s,o,n)})}rotateKeySet(e,t,i){return ps(this,void 0,void 0,function*(){if(!e)throw new Error("failed to rotate key set: keySet is required");if(!t)throw new Error("failed to rotate key set: oldDownstreamKey is required");if(!i)throw new Error("failed to rotate key set: newDownstreamKey is required");const n=yield this.encryptService.unwrapEncapsulationKey(e.encryptedPublicKey,t);if(null==n)throw new Error("failed to rotate key set: could not decrypt public key");const r=yield this.encryptService.wrapEncapsulationKey(n,i),s=yield this.encryptService.encapsulateKeyUnsigned(i,n);return new Mi.B(s,r,e.encryptedPrivateKey)})}},deps:[b.Lu,Tr.N]}),(0,oe.F)({provide:le.o,useClass:le.$w,deps:[]}),(0,oe.F)({provide:eo,useClass:eo,deps:[w.v2]}),(0,oe.F)({provide:os.E,useClass:class{constructor(e){this.apiService=e}getConfirmationDetails(e){return cs(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/accounts/key-connector/confirmation-details/"+encodeURIComponent(e),null,!0,!0);return new ls(t)})}},deps:[de.G]}),(0,oe.F)({provide:se.a,useClass:Vd,deps:[]})];class Pu{}Pu.ɵfac=function(e){return new(e||Pu)},Pu.ɵmod=B.$C({type:Pu}),Pu.ɵinj=E.G2t({providers:Fu});var Ru=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Du{}class Mu extends pn.V{static forNewEmail(e,t){const i=new Mu;return i.newEmail=t,i.authenticateWith(e),i}}class xu extends Mu{static newConstructor(e,t){const i=new xu;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i}}var Ou=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Gu=i(53127),Uu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Vu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ju extends Fr.B{load(){return Vu(this,void 0,void 0,function*(){throw new Error("SDK not available in this environment")})}}var Nu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class zu{constructor(e){this.storage=e,this.updatesSubject=new d.B,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 Nu(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 Yu=i(11009),Lu=i(43090),Ku=i(27545),Xu=i(76758),qu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Hu=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},Wu=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});class $u{}var Ju=i(90107),Zu=i(36801);class _u{}_u.ɵfac=function(e){return new(e||_u)},_u.ɵmod=B.$C({type:_u}),_u.ɵinj=E.G2t({providers:[(0,Zu.F)({provide:$u,useClass:class{constructor(e,t,i){this.sdkService=e,this.logService=t,this.dialogService=i}changePasswordAndRotateUserKey(e,t,i,n){return qu(this,void 0,void 0,function*(){const{wasTrustDenied:r,trustedOrganizationPublicKeys:s,trustedEmergencyAccessUserPublicKeys:o}=yield this.verifyTrust(n);if(!r)return(0,u._)(this.sdkService.userClient$(n).pipe((0,p.T)(n=>qu(this,void 0,void 0,function*(){const r={stack:[],error:void 0,hasError:!1};try{if(!n)throw new Error("SDK not available");const a=Hu(r,n.take(),!1);this.logService.info("[UserKey Rotation] Re-encrypting user data with new user key..."),yield a.value.user_crypto_management().rotate_user_keys({master_key_unlock_method:{Password:{old_password:e,password:t,hint:i}},trusted_emergency_access_public_keys:o,trusted_organization_public_keys:s})}catch(a){r.error=a,r.hasError=!0}finally{Wu(r)}})),(0,cr.W)(e=>(this.logService.error(`Failed to rotate user keys: ${e}`),ho.w))));this.logService.info("[Userkey rotation] Trust was denied by user. Aborting!")})}verifyTrust(e){return qu(this,void 0,void 0,function*(){this.logService.info("[Userkey rotation] Verifying trust...");const[t,i]=yield(0,u._)(this.sdkService.userClient$(e).pipe((0,p.T)(e=>qu(this,void 0,void 0,function*(){const t={stack:[],error:void 0,hasError:!1};try{if(!e)throw new Error("SDK not available");const i=Hu(t,e.take(),!1),n=yield i.value.user_crypto_management().get_untrusted_emergency_access_public_keys();return[n,yield i.value.user_crypto_management().get_untrusted_organization_public_keys()]}catch(i){t.error=i,t.hasError=!0}finally{Wu(t)}}))));if(this.logService.info("result",{emergencyAccessV1Memberships:t,organizationV1Memberships:i}),i.length>0||t.length>0){this.logService.info("[Userkey rotation] Showing trust info dialog...");const e=Xu.Fh.open(this.dialogService,{numberOfEmergencyAccessUsers:t.length,orgName:i.length>0?i[0].name:void 0});if(!(yield(0,u._)(e.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of i){const t=Xu.QY.open(this.dialogService,{name:e.name,orgId:e.organization_id,publicKey:at.A.fromB64ToArray(e.public_key)});if(!(yield(0,u._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of t){const t=Xu.$t.open(this.dialogService,{name:e.name,userId:e.id,publicKey:at.A.fromB64ToArray(e.public_key)});if(!(yield(0,u._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}return this.logService.info("[Userkey rotation] Trust verified for all organizations and emergency access users"),{wasTrustDenied:!1,trustedOrganizationPublicKeys:i.map(e=>e.public_key),trustedEmergencyAccessUserPublicKeys:t.map(e=>e.public_key)}})}},deps:[Ys.K5,Ju.Kc,R.o3]})]});class eh{static fromJSON(e){return null==e?null:Object.assign(new eh,e)}}const th=new I.Zs(I.fK,"organizationInvite",{deserializer:e=>e?eh.fromJSON(e):null});var ih=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var nh=i(39960);function rh(e){return(0,no.U5)(e)}var sh=i(81289),oh=i(25065),ah=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class lh{constructor(e,t,i,n,r,s,o,a,l,c,d,u){this.apiService=e,this.authService=t,this.keyService=i,this.encryptService=n,this.policyApiService=r,this.policyService=s,this.logService=o,this.organizationApiService=a,this.organizationUserApiService=l,this.i18nService=c,this.organizationInviteService=d,this.accountService=u,this.orgNameSubject=new _e.t(null),this.orgName$=this.orgNameSubject.pipe((0,p.T)(e=>e.replace(/\+/g," ")))}validateAndAcceptInvite(e,t){return ah(this,void 0,void 0,function*(){if(null==e)throw new Error("Invite cannot be null.");return e.initOrganization?(yield this.acceptAndInitOrganization(e,t),!0):(yield this.masterPasswordPolicyCheckRequired(e))?(yield this.organizationInviteService.setOrganizationInvitation(e),this.authService.logOut(()=>{}),!1):(yield this.accept(e),!0)})}acceptAndInitOrganization(e,t){return ah(this,void 0,void 0,function*(){yield this.prepareAcceptAndInitRequest(e,t).then(t=>this.organizationUserApiService.postOrganizationUserAcceptInit(e.organizationId,e.organizationUserId,t)),yield this.apiService.refreshIdentityToken(),yield this.organizationInviteService.clearOrganizationInvitation()})}prepareAcceptAndInitRequest(e,t){return ah(this,void 0,void 0,function*(){const i=new g.i0;i.token=e.token;const[n,r]=yield this.keyService.makeOrgKey(t),[s,o]=yield this.keyService.makeKeyPair(r),a=yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),r);return i.key=n.encryptedString,i.keys=new nr.B(s,o.encryptedString),i.collectionName=a.encryptedString,i})}accept(e){return ah(this,void 0,void 0,function*(){yield this.prepareAcceptRequest(e).then(t=>this.organizationUserApiService.postOrganizationUserAccept(e.organizationId,e.organizationUserId,t)),yield this.apiService.refreshIdentityToken(),yield this.organizationInviteService.clearOrganizationInvitation()})}prepareAcceptRequest(e){return ah(this,void 0,void 0,function*(){const t=new g.I;if(t.token=e.token,yield this.resetPasswordEnrollRequired(e)){const i=yield this.organizationApiService.getKeys(e.organizationId);if(null==i)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const n=at.A.fromB64ToArray(i.publicKey),r=(yield(0,u._)(this.accountService.activeAccount$)).id,s=yield(0,u._)(this.keyService.userKey$(r)),o=yield this.encryptService.encapsulateKeyUnsigned(s,n);t.resetPasswordKey=o.encryptedString}return t})}resetPasswordEnrollRequired(e){return ah(this,void 0,void 0,function*(){const t=yield this.getPolicies(e);if(null==t||0===t.length)return!1;const i=this.policyService.getResetPasswordPolicyOptions(t,e.organizationId);return i[1]&&i[0].autoEnrollEnabled})}masterPasswordPolicyCheckRequired(e){return ah(this,void 0,void 0,function*(){const t=yield this.getPolicies(e);if(null==t||0===t.length)return!1;const i=t.some(e=>e.type===mt.tt.MasterPassword&&e.enabled);let n=yield this.organizationInviteService.getOrganizationInvite();(null==n?void 0:n.email)!==e.email&&(yield this.organizationInviteService.clearOrganizationInvitation(),n=null);return i&&null==n})}getPolicies(e){return ah(this,void 0,void 0,function*(){if(null==this.policyCache)try{this.policyCache=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(t){this.logService.error(t)}return this.policyCache})}}lh.ɵfac=function(e){return new(e||lh)(E.KVO(de.G),E.KVO(T.u),E.KVO(b.Lu),E.KVO(Tr.N),E.KVO(fe.m),E.KVO(me.m),E.KVO(Vs.K),E.KVO(he.X),E.KVO(g.uB),E.KVO(U.W),E.KVO(ji.i),E.KVO(Y.D))},lh.ɵprov=E.jDH({token:lh,factory:lh.ɵfac});class ch{}ch.ɵfac=function(e){return new(e||ch)},ch.ɵmod=B.$C({type:ch}),ch.ɵinj=E.G2t({providers:[lh],imports:[oh.G]});class dh{constructor(){this.apiService=(0,E.WQX)(de.G)}postUserKeyUpdate(e){return this.apiService.send("POST","/accounts/key-management/rotate-user-account-keys",e,!0,!1)}}dh.ɵfac=function(e){return new(e||dh)},dh.ɵprov=E.jDH({token:dh,factory:dh.ɵfac});var uh=i(39488),hh=i(45151),Ah=i(27197),ph=i(9413),gh=i(80755);class vh{constructor(e,t){this.securityState=e,this.securityVersion=t}}class fh{constructor(e,t,i){this.wrappedPrivateKey=e,this.publicKey=at.A.fromBufferToB64(t),this.signedPublicKey=i}}class mh{constructor(e,t,i){this.signatureAlgorithm=i,this.wrappedSigningKey=e,this.verifyingKey=t}}var yh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ch{constructor(){this.userKeyEncryptedAccountPrivateKey=null,this.accountPublicKey=null,this.publicKeyEncryptionKeyPair=null,this.signatureKeyPair=null,this.securityState=null}static fromV1CryptographicState(e){const t=new Ch;return t.userKeyEncryptedAccountPrivateKey=e.publicKeyEncryptionKeyPair.wrappedPrivateKey,t.accountPublicKey=at.A.fromBufferToB64(e.publicKeyEncryptionKeyPair.publicKey),t.publicKeyEncryptionKeyPair=new fh(e.publicKeyEncryptionKeyPair.wrappedPrivateKey,e.publicKeyEncryptionKeyPair.publicKey,null),t}static fromV2CryptographicState(e){return yh(this,void 0,void 0,function*(){yield Fr.B.Ready;const t=new Ch;return t.userKeyEncryptedAccountPrivateKey=e.publicKeyEncryptionKeyPair.wrappedPrivateKey,t.accountPublicKey=at.A.fromBufferToB64(e.publicKeyEncryptionKeyPair.publicKey),t.publicKeyEncryptionKeyPair=new fh(e.publicKeyEncryptionKeyPair.wrappedPrivateKey,e.publicKeyEncryptionKeyPair.publicKey,e.publicKeyEncryptionKeyPair.signedPublicKey),t.signatureKeyPair=new mh(e.signatureKeyPair.wrappedSigningKey,e.signatureKeyPair.verifyingKey,Mr.PureCrypto.key_algorithm_for_verifying_key(at.A.fromB64ToArray(e.signatureKeyPair.verifyingKey))),t.securityState=new vh(e.securityState.securityState,e.securityState.securityStateVersion),t})}}class wh{constructor(e,t,i,n,r){this.kdfType=b.ao.PBKDF2_SHA256,this.kdfIterations=0,this.kdfType=e.kdfType,this.kdfIterations=e.iterations,e.kdfType===b.ao.Argon2id&&(this.kdfMemory=e.memory,this.kdfParallelism=e.parallelism),this.email=t,this.masterKeyAuthenticationHash=i,this.masterKeyEncryptedUserKey=n,this.masterPasswordHint=r}}class Ih{constructor(e,t,i,n){this.accountUnlockData=e,this.accountKeys=t,this.accountData=i,this.oldMasterKeyAuthenticationHash=n}}class bh{constructor(e,t,i,n,r){this.masterPasswordUnlockData=e,this.emergencyAccessUnlockData=t,this.organizationAccountRecoveryUnlockData=i,this.passkeyUnlockData=n,this.deviceKeyUnlockData=r}}class Bh{constructor(e,t,i){this.ciphers=e,this.folders=t,this.sends=i}}function Eh(e){return{userKey:Ji.e.fromString(e.userKey),publicKeyEncryptionKeyPair:{wrappedPrivateKey:e.privateKey,publicKey:at.A.fromB64ToArray(e.publicKey),signedPublicKey:e.signedPublicKey},signatureKeyPair:{wrappedSigningKey:e.signingKey,verifyingKey:e.verifyingKey},securityState:{securityState:e.securityState,securityStateVersion:e.securityVersion}}}var Sh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Qh{constructor(){}get_access_token(){return Sh(this,void 0,void 0,function*(){})}}class kh{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y,C,w,I){this.apiService=e,this.cipherService=t,this.folderService=i,this.sendService=n,this.emergencyAccessService=r,this.resetPasswordService=s,this.deviceTrustService=o,this.keyService=a,this.encryptService=l,this.syncService=c,this.webauthnLoginAdminService=d,this.logService=u,this.logoutService=h,this.toastService=A,this.i18nService=p,this.dialogService=g,this.configService=v,this.cryptoFunctionService=f,this.kdfConfigService=m,this.sdkClientFactory=y,this.securityStateService=C,this.masterPasswordService=w,this.sdkUserKeyRotationService=I}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return Sh(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(dr.TO.SdkKeyRotation))return this.logService.info("[UserKey Rotation] Using SDK-based key rotation service from user-crypto-management"),yield this.sdkUserKeyRotationService.changePasswordAndRotateUserKey(e,t,n,(0,Ys.WD)(i.id)),this.toastService.showToast({variant:"success",title:this.i18nService.t("rotationCompletedTitle"),message:this.i18nService.t("rotationCompletedDesc"),timeout:15e3}),void(yield this.logoutService.logout(i.id));yield Fr.B.Ready;const r=yield this.configService.getFeatureFlag(dr.TO.EnrollAeadOnKeyRotation);this.logService.info("[UserKey Rotation] Starting user key rotation..."),yield this.ensureIsAllowedToRotateUserKey();const{wasTrustDenied:s,trustedOrganizationPublicKeys:o,trustedEmergencyAccessUserPublicKeys:a}=yield this.verifyTrust(i);if(s)return void this.logService.info("[Userkey rotation] Trust was denied by user. Aborting!");const{masterKeyKdfConfig:l,masterKeySalt:c,cryptographicStateParameters:d}=yield this.getCryptographicStateForUser(i),{userKey:u,accountKeysRequest:h}=yield this.getRotatedAccountKeysFlagged(i.id,l,c,d,r),A=new Ih(yield this.getAccountUnlockDataRequest(i.id,d.userKey,u,{masterPassword:t,masterKeyKdfConfig:l,masterKeySalt:c,masterPasswordHint:n},a,o),h,yield this.getAccountDataRequest(d.userKey,u,i),yield this.makeServerMasterKeyAuthenticationHash(e,l,c));this.logService.info("[Userkey rotation] Posting user key rotation request to server"),yield this.apiService.postUserKeyUpdate(A),this.logService.info("[Userkey rotation] Userkey rotation request posted to server"),this.toastService.showToast({variant:"success",title:this.i18nService.t("rotationCompletedTitle"),message:this.i18nService.t("rotationCompletedDesc"),timeout:15e3}),yield this.logoutService.logout(i.id)})}ensureIsAllowedToRotateUserKey(){return Sh(this,void 0,void 0,function*(){if(null===(yield this.syncService.getLastSync()))throw this.logService.info("[Userkey rotation] Client was never synced. Aborting!"),new Error("The local vault is de-synced and the keys cannot be rotated. Please log out and log back in to resolve this issue.")})}getRotatedAccountKeysFlagged(e,t,i,n,r){return Sh(this,void 0,void 0,function*(){if(r||2===n.version){const r=yield this.getNewAccountKeysV2(e,t,i,n);return{userKey:r.userKey,accountKeysRequest:yield Ch.fromV2CryptographicState(r)}}{const e=yield this.getNewAccountKeysV1(n);return{userKey:e.userKey,accountKeysRequest:Ch.fromV1CryptographicState(e)}}})}getNewAccountKeysV1(e){return Sh(this,void 0,void 0,function*(){const t=new Ji.e(Mr.PureCrypto.make_user_key_aes256_cbc_hmac()),i=yield this.encryptService.unwrapDecapsulationKey(new Di.k(e.publicKeyEncryptionKeyPair.wrappedPrivateKey),e.userKey);return{userKey:t,publicKeyEncryptionKeyPair:{wrappedPrivateKey:(yield this.encryptService.wrapDecapsulationKey(i,t)).encryptedString,publicKey:yield this.cryptoFunctionService.rsaExtractPublicKey(i)}}})}getNewAccountKeysV2(e,t,i,n){return Sh(this,void 0,void 0,function*(){return 1===n.version?this.upgradeV1UserToV2UserAccountKeys(e,t,i,n):this.rotateV2UserAccountKeys(e,t,i,n)})}upgradeV1UserToV2UserAccountKeys(e,t,i,n){return Sh(this,void 0,void 0,function*(){const r=yield this.sdkClientFactory.createSdkClient(new Qh);return yield r.crypto().initialize_user_crypto({userId:(0,Ys.WD)(e),kdfParams:t.toSdkConfig(),email:i,accountCryptographicState:{V1:{private_key:n.publicKeyEncryptionKeyPair.wrappedPrivateKey}},method:{decryptedKey:{decrypted_user_key:n.userKey.toBase64()}}}),Eh(r.crypto().make_keys_for_user_crypto_v2())})}rotateV2UserAccountKeys(e,t,i,n){return Sh(this,void 0,void 0,function*(){const r=yield this.sdkClientFactory.createSdkClient(new Qh);return yield r.crypto().initialize_user_crypto({userId:(0,Ys.WD)(e),kdfParams:t.toSdkConfig(),email:i,accountCryptographicState:{V2:{private_key:n.publicKeyEncryptionKeyPair.wrappedPrivateKey,signing_key:n.signingKey,security_state:n.securityState,signed_public_key:n.publicKeyEncryptionKeyPair.signedPublicKey}},method:{decryptedKey:{decrypted_user_key:n.userKey.toBase64()}}}),Eh(r.crypto().get_v2_rotated_account_keys())})}createMasterPasswordUnlockDataRequest(e,t){return Sh(this,void 0,void 0,function*(){const i=new Di.k(Mr.PureCrypto.encrypt_user_key_with_master_password(e.toEncoded(),t.masterPassword,t.masterKeySalt,t.masterKeyKdfConfig.toSdkConfig())),n=yield this.makeServerMasterKeyAuthenticationHash(t.masterPassword,t.masterKeyKdfConfig,t.masterKeySalt);return new wh(t.masterKeyKdfConfig,t.masterKeySalt,n,i.encryptedString,t.masterPasswordHint)})}getAccountUnlockDataRequest(e,t,i,n,r,s){return Sh(this,void 0,void 0,function*(){let o;this.isUserWithMasterPassword(e)&&(o=yield this.createMasterPasswordUnlockDataRequest(i,n));const a=yield this.webauthnLoginAdminService.getRotatedData(t,i,e),l=yield this.deviceTrustService.getRotatedData(t,i,e),c=yield this.emergencyAccessService.getRotatedData(i,r,e),d=yield this.resetPasswordService.getRotatedData(i,s,e);return new bh(o,c,d,a,l)})}verifyTrust(e){return Sh(this,void 0,void 0,function*(){this.logService.info("[Userkey rotation] Verifying trust...");const t=yield this.emergencyAccessService.getPublicKeys(),i=yield this.resetPasswordService.getPublicKeys(e.id);if(i.length>0||t.length>0){const e=Xu.Fh.open(this.dialogService,{numberOfEmergencyAccessUsers:t.length,orgName:i.length>0?i[0].orgName:void 0});if(!(yield(0,u._)(e.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of i){const t=Xu.QY.open(this.dialogService,{name:e.orgName,orgId:e.orgId,publicKey:e.publicKey});if(!(yield(0,u._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of t){const t=Xu.$t.open(this.dialogService,{name:e.name,userId:e.granteeId,publicKey:e.publicKey});if(!(yield(0,u._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}return this.logService.info("[Userkey rotation] Trust verified for all organizations and emergency access users"),{wasTrustDenied:!1,trustedOrganizationPublicKeys:i.map(e=>e.publicKey),trustedEmergencyAccessUserPublicKeys:t.map(e=>e.publicKey)}})}getAccountDataRequest(e,t,i){return Sh(this,void 0,void 0,function*(){const n=yield this.cipherService.getRotatedData(e,t,i.id),r=yield this.folderService.getRotatedData(e,t,i.id),s=yield this.sendService.getRotatedData(e,t,i.id);if(null==n||null==r||null==s)throw this.logService.info("[Userkey rotation] ciphers, folders, or sends are null. Aborting!"),new Error("ciphers, folders, or sends are null");return new Bh(n,r,s)})}isV1User(e){return e.inner().type===$i.Qd.AesCbc256_HmacSha256_B64}isUserWithMasterPassword(e){return!0}makeServerMasterKeyAuthenticationHash(e,t,i){return Sh(this,void 0,void 0,function*(){const n=yield this.keyService.makeMasterKey(e,i,t);return this.keyService.hashMasterKey(e,n,$i.VK.ServerAuthorization)})}getCryptographicStateForUser(e){return Sh(this,void 0,void 0,function*(){const t=yield this.firstValueFromOrThrow(this.kdfConfigService.getKdfConfig$(e.id),"KDF config"),i=yield this.firstValueFromOrThrow(this.masterPasswordService.saltForUser$(e.id),"Master key salt"),n=yield this.firstValueFromOrThrow(this.keyService.userKey$(e.id),"User key"),r=new Di.k(yield this.firstValueFromOrThrow(this.keyService.userEncryptedPrivateKey$(e.id),"Private key")).encryptedString,s=yield this.cryptoFunctionService.rsaExtractPublicKey(yield this.encryptService.unwrapDecapsulationKey(new Di.k(r),n));if(this.isV1User(n))return{masterKeyKdfConfig:t,masterKeySalt:i,cryptographicStateParameters:{version:1,userKey:n,publicKeyEncryptionKeyPair:{wrappedPrivateKey:r,publicKey:s}}};if(n.inner().type===$i.Qd.CoseEncrypt0){const o=yield this.firstValueFromOrThrow(this.keyService.userSigningKey$(e.id),"User signing key"),a=yield this.firstValueFromOrThrow(this.securityStateService.accountSecurityState$(e.id),"User security state");return{masterKeyKdfConfig:t,masterKeySalt:i,cryptographicStateParameters:{version:2,userKey:n,publicKeyEncryptionKeyPair:{wrappedPrivateKey:r,publicKey:s,signedPublicKey:yield this.firstValueFromOrThrow(this.keyService.userSignedPublicKey$(e.id),"User signed public key")},signingKey:o,securityState:a}}}throw new Error(`Unsupported user key type: ${n.inner().type}. Expected AesCbc256_HmacSha256_B64 or XChaCha20_Poly1305_B64.`)})}firstValueFromOrThrow(e,t){return Sh(this,void 0,void 0,function*(){const i=yield(0,u._)(e);if(null==i)throw new Error(`Failed to get ${t}`);return i})}}kh.ɵfac=function(e){return new(e||kh)(E.KVO(dh),E.KVO(k.p),E.KVO(Q.k),E.KVO(_l),E.KVO(gh.p),E.KVO(hh.w),E.KVO(Ur.M),E.KVO(b.Lu),E.KVO(Tr.N),E.KVO(uh.H),E.KVO(Ah.yB),E.KVO(Vs.K),E.KVO(v.k4),E.KVO(P.f),E.KVO(U.W),E.KVO(R.o3),E.KVO(z.w),E.KVO(kr.R),E.KVO(b.zZ),E.KVO(zs),E.KVO(Fs.p),E.KVO(vs.L),E.KVO($u))},kh.ɵprov=E.jDH({token:kh,factory:kh.ɵfac,providedIn:"root"});class Th{}Th.ɵfac=function(e){return new(e||Th)},Th.ɵmod=B.$C({type:Th}),Th.ɵinj=E.G2t({providers:[kh,dh]});var Fh=i(47135),Ph=i(62963),Rh=i(50866);class Dh{}Dh.ɵfac=function(e){return new(e||Dh)},Dh.ɵmod=B.$C({type:Dh}),Dh.ɵinj=E.G2t({imports:[Ph.G,a.YN,a.X1,Rh.R6,Fh.q]});class Mh{}Mh.ɵfac=function(e){return new(e||Mh)},Mh.ɵmod=B.$C({type:Mh}),Mh.ɵinj=E.G2t({imports:[oh.G,Dh,ph.S,le.Rz,Th]});class xh{}xh.ɵfac=function(e){return new(e||xh)},xh.ɵmod=B.$C({type:xh}),xh.ɵinj=E.G2t({imports:[Mh,ch,Mh]});class Oh extends le.FX{constructor(e){super(),this.i18nService=e}setDocumentCookies(){document.cookie=`ssoHandOffMessage=${this.i18nService.t("ssoHandOff")};SameSite=strict`}}Oh.ɵfac=function(e){return new(e||Oh)(E.KVO(U.W))},Oh.ɵprov=E.jDH({token:Oh,factory:Oh.ɵfac});var Gh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Uh=new w.Ok(w.g,"premiumInterest",{deserializer:e=>e,clearOn:["lock","logout"]});class Vh{constructor(e){this.stateProvider=e}getPremiumInterest(e){return Gh(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot get 'premiumInterest'.");return yield(0,u._)(this.stateProvider.getUserState$(Uh,e))})}setPremiumInterest(e,t){return Gh(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot set 'premiumInterest'.");yield this.stateProvider.setUserState(Uh,t,e)})}clearPremiumInterest(e){return Gh(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot clear 'premiumInterest'.");yield this.stateProvider.setUserState(Uh,null,e)})}}Vh.ɵfac=function(e){return new(e||Vh)(E.KVO(w.v2))},Vh.ɵprov=E.jDH({token:Vh,factory:Vh.ɵfac});var jh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Nh{get defaultOptions(){return{htmlStorageLocation:$i.EO.Session}}get valuesRequireDeserialization(){return!0}constructor(){this.updatesSubject=new d.B,this.updates$=this.updatesSubject.asObservable()}get(e,t=this.defaultOptions){let i=null;switch(t.htmlStorageLocation){case $i.EO.Local:i=window.localStorage.getItem(e);break;case $i.EO.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){return jh(this,arguments,void 0,function*(e,t=this.defaultOptions){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 $i.EO.Local:window.localStorage.setItem(e,n);break;case $i.EO.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 $i.EO.Local:window.localStorage.removeItem(e);break;case $i.EO.Session:default:window.sessionStorage.removeItem(e)}return this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}}Nh.ɵfac=function(e){return new(e||Nh)},Nh.ɵprov=E.jDH({token:Nh,factory:Nh.ɵfac});var zh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Yh{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"],["ta","தமிழ்"],["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 zh(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 r;return r=this.localeMessages.hasOwnProperty(e)&&this.localeMessages[e]?this.localeMessages[e]:this.defaultMessages.hasOwnProperty(e)&&this.defaultMessages[e]?this.defaultMessages[e]:"",""!==r&&(null!=t&&(r=r.split("__$1__").join(t.toString())),null!=i&&(r=r.split("__$2__").join(i.toString())),null!=n&&(r=r.split("__$3__").join(n.toString()))),r}loadMessages(e,t){return zh(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 r="\\$"+i.toUpperCase()+"\\$";let s=n[e].placeholders[i].content;"$1"!==s&&"$2"!==s&&"$3"!==s||(s="__$"+s+"__"),t[e]=t[e].replace(new RegExp(r,"g"),s)}})}}var Lh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Kh=new I.Zs(I.Ud,"locale",{deserializer:e=>e});class Xh extends Yh{constructor(e,t,i,n){super(e,t,i),this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this.translationLocaleState=n.get(Kh),this.userSetLocale$=this.translationLocaleState.state$,this.locale$=this.userSetLocale$.pipe((0,p.T)(e=>null!=e?e:this.translationLocale))}setLocale(e){return Lh(this,void 0,void 0,function*(){yield this.translationLocaleState.update(()=>e)})}init(){const e=Object.create(null,{init:{get:()=>super.init}});return Lh(this,void 0,void 0,function*(){const t=yield(0,u._)(this.translationLocaleState.state$);yield e.init.call(this,t)})}}const qh=["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","ta","te","th","tr","uk","vi","zh-CN","zh-TW"];var Hh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Wh{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 $h{constructor(e){this.platformUtilsService=e}download(e){const t=new Wh(e),i=window.document.createElement("a");this.platformUtilsService.supportsFileDownloads()||(i.rel="noreferrer",i.target="_blank"),i.href=URL.createObjectURL(t.blob),i.download=e.fileName,window.document.body.appendChild(i),i.click(),window.document.body.removeChild(i)}}$h.ɵfac=function(e){return new(e||$h)(E.KVO(V.y))},$h.ɵprov=E.jDH({token:$h,factory:$h.ɵfac});var Jh=i(17594),Zh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var _h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var eA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var tA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class iA extends b.Zm{authenticateWithBiometrics(){return tA(this,void 0,void 0,function*(){return!1})}getBiometricsStatus(){return tA(this,void 0,void 0,function*(){return b.cR.PlatformUnsupported})}unlockWithBiometricsForUser(e){return tA(this,void 0,void 0,function*(){return null})}getBiometricsStatusForUser(e){return tA(this,void 0,void 0,function*(){return b.cR.PlatformUnsupported})}getShouldAutopromptNow(){return tA(this,void 0,void 0,function*(){return!1})}setShouldAutopromptNow(e){return tA(this,void 0,void 0,function*(){})}canEnableBiometricUnlock(){return tA(this,void 0,void 0,function*(){return!1})}}var nA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var rA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class sA extends Xo{constructor(e,t){super(e),this.urls=t}}var oA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class aA extends w.Nb{constructor(e,t,i){super(e,t,i,"web-disk-local",st.sK.Web),this.diskLocalStorageService=t}getAccounts(){return oA(this,void 0,void 0,function*(){const e=this.diskLocalStorageService.getKeys(),t=[];for(const i of e){if(!at.A.isGuid(i))continue;const e=yield this.diskLocalStorageService.get(i);null!=e&&("object"==typeof e&&t.push({userId:i,account:e}))}return t})}}var lA=i(73442),cA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const dA=(()=>{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})();class uA extends Fr.B{load(){return cA(this,void 0,void 0,function*(){let e;e=dA?yield i.e(502).then(i.bind(i,71502)):yield i.e(981).then(i.bind(i,95981)),lA.TsN(e)})}}class hA extends Ls.wH{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)}}var AA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pA{constructor(e,t){this.keyService=e,this.encryptService=t}attachToGlobal(e){e.bitwardenContainerService||(e.bitwardenContainerService=this)}getKeyService(){if(null==this.keyService)throw new Error("ContainerService.keyService not initialized.");return this.keyService}getEncryptService(){if(null==this.encryptService)throw new Error("ContainerService.encryptService not initialized.");return this.encryptService}}var gA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vA{constructor(e,t){this.platformUtilsService=e,this.sdkService=t}applyVersionToWindow(){window.__version=()=>gA(this,void 0,void 0,function*(){return{client:yield this.platformUtilsService.getApplicationVersion(),sdk:yield(0,u._)(this.sdkService.client$.pipe((0,p.T)(e=>e.version()),(0,cr.W)(()=>"Unsupported")))}})}}vA.ɵfac=function(e){return new(e||vA)(E.KVO(V.y),E.KVO(Ys.K5))},vA.ɵprov=E.jDH({token:vA,factory:vA.ɵfac,providedIn:"root"});var fA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class mA{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v){this.win=e,this.serverNotificationsService=t,this.vaultTimeoutService=i,this.i18nService=n,this.eventUploadService=r,this.twoFactorService=s,this.keyService=o,this.themingService=a,this.encryptService=l,this.userAutoUnlockKeyService=c,this.accountService=d,this.versionService=u,this.ipcService=h,this.sdkLoadService=A,this.taskService=p,this.migrationRunner=g,this.document=v}init(){return()=>fA(this,void 0,void 0,function*(){yield this.sdkLoadService.loadAndInit(),yield this.migrationRunner.run();const e=yield(0,u._)(this.accountService.activeAccount$);e&&(yield this.userAutoUnlockKeyService.setUserKeyInMemoryIfAutoUserKeySet(e.id)),this.serverNotificationsService.startListening(),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),this.versionService.applyVersionToWindow(),this.ipcService.init(),this.taskService.listenForTaskNotifications();new pA(this.keyService,this.encryptService).attachToGlobal(this.win)})}}mA.ɵfac=function(e){return new(e||mA)(E.KVO(ae.jf),E.KVO(N),E.KVO(Wi.a6),E.KVO(U.W),E.KVO(C.fH),E.KVO(Bn.fz),E.KVO(b.Lu),E.KVO(fu),E.KVO(Tr.N),E.KVO(Oa),E.KVO(Y.D),E.KVO(vA),E.KVO(Js),E.KVO(Fr.B),E.KVO(Td.RB),E.KVO(na),E.KVO(E.qQL))},mA.ɵprov=E.jDH({token:mA,factory:mA.ɵfac});const yA=new ae.aZ("ENV_URLS");var CA=i(51971),wA=i(83724);const IA=[(0,oe.F)(mA),(0,oe.F)(CA.H),(0,oe.F)(Jh.US),(0,oe.F)({provide:sh.WM,useValue:sh.bS}),(0,oe.F)({provide:ae.de,deps:[V.y],useFactory:e=>e.isDev()?Wi.Lw.Never:15}),(0,oe.F)({provide:B.hnV,useFactory:e=>e.init(),deps:[mA],multi:!0}),(0,oe.F)({provide:U.W,useClass:class extends Xh{constructor(e,t,i){super(e||"en-US",t,e=>Hh(this,void 0,void 0,function*(){const t=this.localesDirectory+"/"+e+"/messages.json?cache=zqcxrhd",i=yield fetch(t);return yield i.json()}),i),this.supportedTranslationLocales=qh}},deps:[ae.Xk,ae.U1,I.Y2]}),(0,oe.F)({provide:Ls.zq,useClass:Nh,deps:[]}),(0,oe.F)({provide:ae.G$,useClass:Ls.g2,deps:[]}),(0,oe.F)({provide:ae.A5,useClass:Ls.g2,deps:[]}),(0,oe.F)({provide:ae.ye,useClass:Ls.Cc,deps:[]}),(0,oe.F)({provide:ae.ml,useFactory:()=>new zu(window.sessionStorage),deps:[]}),(0,oe.F)({provide:V.y,useClass:wA._,useAngularDecorators:!0}),(0,oe.F)({provide:Gu.y,useClass:$h,useAngularDecorators:!0}),(0,oe.F)({provide:zu,useFactory:()=>new zu(window.localStorage),deps:[]}),(0,oe.F)({provide:ae.e$,useExisting:zu}),(0,oe.F)({provide:Ls.wH,useClass:hA,deps:[ae.ml,ae.ye,ae.e$]}),(0,oe.F)({provide:na,useClass:class extends na{constructor(e,t,i,n){super(e,t,i,st.sK.Web),this.diskLocalStorage=n}run(){const e=Object.create(null,{run:{get:()=>super.run}});return oA(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 aA(i,this.diskLocalStorage,this.logService);yield t.migrate(n)})}},deps:[Ls.zq,Vs.K,ta,zu]}),(0,oe.F)({provide:yA,useValue:{}}),(0,oe.F)({provide:Gs.v,useClass:class extends zo{constructor(e,t,i,n=[],r,s){var o;super(t,i,n),this.win=e,this.router=r,this.envUrls=s;let a=this.win.location.href;a=a.replace(/(\/+|\/*#.*|\/*\?.*)$/,""),null!==(o=s.base)&&void 0!==o||(s.base=a);const l=new URL(this.win.location.href).hostname,c=this.availableRegions().find(e=>new URL(e.urls.webVault).hostname===l);let d;d=c?new sA(c,s):new qo(s);const u=new aa.m(1);u.next(d),this._environmentSubject=u,this.environment$=u.asObservable(),this.globalEnvironment$=u.asObservable()}setEnvironment(e,t){return rA(this,void 0,void 0,function*(){if(e===Gs.T.SelfHosted)throw new Error("setEnvironment does not work in web for self-hosted.");const t=new URL(this.win.location.href).hostname;if(this.availableRegions().find(e=>new URL(e.urls.webVault).hostname===t).key===e){return(yield(0,u._)(this.environment$)).getUrls()}const i=this.availableRegions().find(t=>t.key===e);if(null==i)throw new Error("The selected region is not known as an available region.");const n=`/#${this.router.url}`;return this.win.location.href=i.urls.webVault+n,i.urls})}getEnvironment$(e){return this._environmentSubject.asObservable()}},deps:[ae.jf,I.v2,Y.D,ae.oq,F.Ix,yA]}),(0,oe.F)({provide:b.Zm,useClass:iA,deps:[]}),(0,oe.F)({provide:$a.oO,useClass:$a.T2,deps:[I.Y2]}),(0,oe.F)({provide:ae.Hq,useValue:st.sK.Web}),(0,oe.F)({provide:ji.i,useClass:class{constructor(e){this.globalStateProvider=e,this.organizationInvitationState=this.globalStateProvider.get(th)}getOrganizationInvite(){return ih(this,void 0,void 0,function*(){return yield(0,u._)(this.organizationInvitationState.state$)})}setOrganizationInvitation(e){return ih(this,void 0,void 0,function*(){if(null==e)throw new Error("Invite cannot be null. Use clearOrganizationInvitation instead.");yield this.organizationInvitationState.update(()=>e)})}clearOrganizationInvitation(){return ih(this,void 0,void 0,function*(){yield this.organizationInvitationState.update(()=>null)})}},deps:[I.Y2]}),(0,oe.F)({provide:le.mZ,useClass:Ah.Ew,deps:[b.Lu,It.T,vs.L,z.w,ji.i,fe.m,Vs.K,me.m]}),(0,oe.F)({provide:fo,useClass:vo,deps:[]}),(0,oe.F)({provide:Xu.qi,useClass:class{constructor(){this.userDecryptionOptionsService=(0,E.WQX)(v.Ym),this.webAuthnPrfUnlockService=(0,E.WQX)(Xu.QP)}getBiometricsError(e){throw new Error("Biometric unlock is not supported in the web app. See getAvailableUnlockOptions$")}getPreviousUrl(){return null}popOutBrowserExtension(){throw new Error("Method not supported on this platform.")}closeBrowserExtensionPopout(){throw new Error("Method not supported on this platform.")}isWindowVisible(){return Zh(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}getBiometricsUnlockBtnText(){throw new Error("Biometric unlock is not supported in the web app. See getAvailableUnlockOptions$")}getAvailableUnlockOptions$(e){return(0,bi.z)([this.userDecryptionOptionsService.userDecryptionOptionsById$(e),(0,Vt.v)(()=>Zh(this,void 0,void 0,function*(){return{available:yield this.webAuthnPrfUnlockService.isPrfUnlockAvailable(e)}}))]).pipe((0,p.T)(([e,t])=>({masterPassword:{enabled:e.hasMasterPassword},pin:{enabled:!1},biometrics:{enabled:!1,biometricsStatus:b.cR.PlatformUnsupported},prf:{enabled:t.available}})))}},deps:[]}),(0,oe.F)({provide:re.HQ,useClass:Ah.hV,deps:[de.G,Tr.N,U.W,b.zZ,b.Lu,kt,vs.O,he.X,g.uB,v.bj,ji.i,CA.H,Br.h,Ns.vW]}),(0,oe.F)({provide:xs.Y,useClass:Io,deps:[ae.e$,Vs.K]}),(0,oe.F)({provide:le.qG,useClass:Ah.aI,deps:[ji.i,Vs.K,fe.m,me.N,CA.H,kr.R,Gs.v,Rd.JJ,V.y,Ft._,F.Ix,Y.D,z.w]}),(0,oe.F)({provide:g.vE,useClass:g.Qd,deps:[de.G,b.Lu,Tr.N,g.YD,f.PV]}),(0,oe.F)({provide:g.Ki,useClass:g.tc,deps:[b.Lu,Tr.N,g.uB,Y.D,U.W]}),(0,oe.F)({provide:Fr.B,useClass:rh("sdk")?uA:ju,deps:[]}),(0,oe.F)({provide:zs,useClass:rh("sdk")?class{createSdkClient(...e){return Uu(this,void 0,void 0,function*(){return Promise.resolve(new Mr.PasswordManagerClient(...e))})}}:class{createSdkClient(...e){return Promise.reject(new Error("SDK not available"))}},deps:[]}),(0,oe.F)({provide:L,useClass:class{constructor(e){this.window=e}startProcessReload(){return _h(this,void 0,void 0,function*(){this.window.location.reload()})}cancelProcessReload(){}},deps:[ae.jf]}),(0,oe.F)({provide:v.pi,useClass:v.pi,deps:[Y.D,T.u,I.v2]}),(0,oe.F)({provide:le.C5,useClass:Oh,deps:[U.W]}),(0,oe.F)({provide:Ah.fA,useClass:Ah.fA,deps:[Ft._,de.G,kr.R,Gs.v,Rd.JJ,V.y]}),(0,oe.F)({provide:le.Ms,useClass:Ah.u3,deps:[V.y]}),(0,oe.F)({provide:le.Ak,useClass:Ah.oE,deps:[js.U,CA.H,ji.i]}),(0,oe.F)({provide:Js,useClass:class extends Js{constructor(){super(...arguments),this.logService=(0,E.WQX)(Vs.K),this.platformUtilsService=(0,E.WQX)(V.y),this.sessionRepository=(0,E.WQX)(eo)}init(){const e=Object.create(null,{initWithClient:{get:()=>super.initWithClient}});return nA(this,void 0,void 0,function*(){try{yield Fr.B.Ready,this.communicationBackend=new Mr.IpcCommunicationBackend({send(e){return nA(this,void 0,void 0,function*(){if("BrowserBackground"!==e.destination)throw new Error(`Destination not supported: ${e.destination}`);window.postMessage({type:"bitwarden-ipc-message",message:{destination:e.destination,payload:[...e.payload],topic:e.topic}},window.location.origin)})}}),window.addEventListener("message",e=>nA(this,void 0,void 0,function*(){var t;if(e.origin!==window.origin)return;const i=e.data;(function(e){return"bitwarden-ipc-message"===e.type})(i)&&"object"==typeof i.message.destination&&null!=i.message.destination.Web&&(null===(t=this.communicationBackend)||void 0===t||t.receive(new Mr.IncomingMessage(new Uint8Array(i.message.payload),i.message.destination,"BrowserBackground",i.message.topic)))})),yield e.initWithClient.call(this,Mr.IpcClient.newWithClientManagedSessions(this.communicationBackend,this.sessionRepository)),this.platformUtilsService.isDev()&&(yield(0,Mr.ipcRegisterDiscoverHandler)(this.client,{version:yield this.platformUtilsService.getApplicationVersion()}))}catch(t){this.logService.error("[IPC] Initialization failed",t)}})}},deps:[]}),(0,oe.F)({provide:xd.Vi,useClass:xd.cM,deps:[R.o3,P.f,V.y,U.W]}),(0,oe.F)({provide:ne.Fx,useClass:Ah.L0,deps:[b.Lu,kt,vs.O,gs.b,Yu.H,kh,CA.H]}),(0,oe.F)({provide:ie,useClass:class{showHeaderInformation(){return!0}},deps:[]}),(0,oe.F)({provide:Lu.l,useClass:nh.x,deps:[R.o3,z.w,Y.D,de.G,Yu.H,Rn.Q,V.y,F.Ix]}),(0,oe.F)({provide:se.a,useClass:Vh,deps:[I.v2]}),(0,oe.F)({provide:Ks,useClass:class extends Ks{clearClipboard(e,t){return AA(this,void 0,void 0,function*(){})}clearPendingClipboard(){return AA(this,void 0,void 0,function*(){})}},deps:[]}),(0,oe.F)({provide:Ms.T,useClass:class{constructor(e){this.platformUtilsService=e}isAvailable(e){return eA(this,void 0,void 0,function*(){switch(e){case Wi.BF.Immediately:return!1;case Wi.Lw.OnRestart:case Wi.Lw.Custom:return!0;case Wi.Lw.Never:return this.platformUtilsService.isDev();default:if((0,Wi.ft)(e))return!0}return!1})}getOrPromoteToAvailable(e){return eA(this,void 0,void 0,function*(){return(yield this.isAvailable(e))?e:e===Wi.BF.Immediately?Wi.BF.OnMinute:Wi.Lw.OnRestart})}},deps:[V.y]}),(0,oe.F)({provide:Xu.TP,useClass:Xu.TP,deps:[U.W,Ms.T,me.m]}),(0,oe.F)({provide:Bt,useClass:class{activeUserMeetsConditionsToShowApprovalDialog(e){return Ru(this,void 0,void 0,function*(){throw new Error("activeUserMeetsConditionsToShowApprovalDialog() not implemented for this client")})}setupUnlockListenersForProcessingAuthRequests(){throw new Error("setupUnlockListenersForProcessingAuthRequests() not implemented for this client")}handleAuthRequestNotificationClicked(e){return Ru(this,void 0,void 0,function*(){throw new Error("handleAuthRequestNotificationClicked() not implemented for this client")})}},deps:[]}),(0,oe.F)({provide:Xu.QP,useClass:Xu.r2,deps:[Mt.u,b.Lu,v.bj,Tr.N,Gs.v,V.y,ae.jf,Vs.K,z.w]}),(0,oe.F)({provide:Du,useClass:class{constructor(e,t,i,n,r){this.configService=e,this.masterPasswordService=t,this.kdfConfigService=i,this.apiService=n,this.keyService=r}requestEmailToken(e,t,i){return Ou(this,void 0,void 0,function*(){let n;if(yield this.configService.getFeatureFlag(dr.TO.PM30811_ChangeEmailNewAuthenticationApis)){const r=yield(0,u._)(this.masterPasswordService.saltForUser$(i));(0,Kr.x)(r,"salt");const s=yield(0,u._)(this.kdfConfigService.getKdfConfig$(i));(0,Kr.x)(s,"kdf");const o=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e,s,r);n=Mu.forNewEmail(o,t)}else n=new Mu,n.newEmail=t,n.masterPasswordHash=yield this.keyService.hashMasterKey(e,yield this.keyService.getOrDeriveMasterKey(e,i));yield this.apiService.send("POST","/accounts/email-token",n,i,!1)})}confirmEmailChange(e,t,i,n){return Ou(this,void 0,void 0,function*(){var r;let s,o=null;if(yield this.configService.getFeatureFlag(dr.TO.PM30811_ChangeEmailNewAuthenticationApis)){const r=yield(0,u._)(this.kdfConfigService.getKdfConfig$(n));(0,Kr.x)(r,"kdf");const a=yield(0,u._)(this.keyService.userKey$(n));(0,Kr.x)(a,"userKey");const l=yield(0,u._)(this.masterPasswordService.saltForUser$(n));(0,Kr.x)(l,"salt");const c=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e,r,l),d=this.masterPasswordService.emailToSalt(t),h=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e,r,d),A=yield this.masterPasswordService.makeMasterPasswordUnlockData(e,r,d,a);s=xu.newConstructor(h,A),s.newEmail=t,s.token=i,s.authenticateWith(c),o=A}else{s=new xu,s.token=i,s.newEmail=t,s.masterPasswordHash=yield this.keyService.hashMasterKey(e,yield this.keyService.getOrDeriveMasterKey(e,n));const o=yield(0,u._)(this.kdfConfigService.getKdfConfig$(n));if(null==o)throw new Error("Missing kdf config");const a=yield this.keyService.makeMasterKey(e,t,o);s.newMasterPasswordHash=yield this.keyService.hashMasterKey(e,a);const l=yield(0,u._)(this.keyService.userKey$(n));if(null==l)throw new Error("Can't find UserKey");const c=null===(r=(yield this.keyService.encryptUserKeyWithMasterKey(a,l))[1])||void 0===r?void 0:r.encryptedString;if(null==c)throw new Error("Missing Encrypted User Key");s.key=c}yield this.apiService.send("POST","/accounts/email",s,n,!1),null!=o&&(yield this.masterPasswordService.setLegacyMasterKeyFromUnlockData(e,o,n))})}},deps:[z.w,vs.O,b.zZ,de.G,b.Lu]})];class bA{constructor(e){if(e)throw new Error("CoreModule is already loaded. Import it in the AppModule only")}}bA.ɵfac=function(e){return new(e||bA)(E.KVO(bA,12))},bA.ɵmod=B.$C({type:bA}),bA.ɵinj=E.G2t({providers:IA,imports:[H.MD,Pu,_u,Ku._h]});var BA=i(6056),EA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function SA(e){return()=>EA(this,void 0,void 0,function*(){const t=(0,E.WQX)(F.Ix),i=(0,E.WQX)(P.f),n=(0,E.WQX)(U.W),r=(0,E.WQX)(Y.D),s=(0,E.WQX)(me.m),o=(0,E.WQX)(z.w),a=(0,E.WQX)(Ga.H);null==(yield(0,u._)(r.activeAccount$.pipe(y.F6,(0,rt.n)(e=>a.lastSync$(e)))))&&(yield a.fullSync(!1));const l=yield(0,u._)(r.activeAccount$.pipe(y.F6,(0,rt.n)(t=>e(t,o,s)),(0,M.M)(e=>{if("boolean"!=typeof e)throw new Error("Feature callback must return a boolean.")})));return l||(i.showToast({variant:"error",message:n.t("noPageAccess")}),t.createUrlTree(["/"]))})}class QA{}QA.ɵfac=function(e){return new(e||QA)},QA.ɵcmp=B.VBU({type:QA,selectors:[["app-authentication-timeout"]],decls:6,vars:6,consts:[[1,"tw-text-center"],["routerLink","/login","bitButton","","block","","buttonType","primary"]],template:function(e,t){1&e&&(B.j41(0,"p",0),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.j41(3,"a",1),B.EFF(4),B.nI1(5,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,2,"authenticationSessionTimedOut")," "),B.R7$(3),B.SpI(" ",B.bMT(5,4,"logIn")," "))},dependencies:[H.MD,jd.p,Yd.t,Jd.Q,BA.iI,BA.Wk,au.$],encapsulation:2});const kA=Object.freeze({SignUp:"signup",FinishSignUp:"finish-signup",Login:"login",LoginWithDevice:"login-with-device",AdminApprovalRequested:"admin-approval-requested",PasswordHint:"hint",LoginInitiated:"login-initiated",SetInitialPassword:"set-initial-password",ChangePassword:"change-password",Sso:"sso",TwoFactor:"2fa",AuthenticationTimeout:"authentication-timeout",NewDeviceVerification:"device-verification",LoginWithPasskey:"login-with-passkey"});var TA=i(31539),FA=i(26061),PA=i(90005),RA=i(45383),DA=i(75583),MA=i(58806),xA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function OA(e,t){1&e&&(B.qex(0),B.j41(1,"p",4),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"button",5),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,3,"readingPasskeyLoading")),B.R7$(2),B.Y8G("loading",!0),B.R7$(),B.SpI(" ",B.bMT(6,5,"loading")," "))}function GA(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"p",4),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"button",6),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.retry())}),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.bVm()}2&e&&(B.R7$(2),B.JRh(B.bMT(3,2,"passkeyAuthenticationFailed")),B.R7$(3),B.SpI(" ",B.bMT(6,4,"tryAgain")," "))}class UA{get successRoute(){const e=this.platformUtilsService.getClientType();return this.successRoutes[e]||"/vault"}constructor(e,t,i,n,r,s,o,a,l,c,d){this.webAuthnLoginService=e,this.router=t,this.route=i,this.logService=n,this.validationService=r,this.i18nService=s,this.loginSuccessHandlerService=o,this.keyService=a,this.platformUtilsService=l,this.anonLayoutWrapperDataService=c,this.messagingService=d,this.currentState="assert",this.shouldAutoClosePopout=!1,this.Icons={TwoFactorAuthSecurityKeyIcon:FA.s,TwoFactorAuthSecurityKeyFailedIcon:PA.f},this.successRoutes={[st.sK.Web]:"/vault",[st.sK.Browser]:"/tabs/vault",[st.sK.Desktop]:"/vault",[st.sK.Cli]:"/vault"}}ngOnInit(){this.shouldAutoClosePopout="true"===this.route.snapshot.queryParamMap.get("autoClosePopout"),this.authenticate()}retry(){this.currentState="assert",this.setDefaultIcon(),this.authenticate()}authenticate(){return xA(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),this.currentState="assertFailed",void this.setFailureIcon()}try{const t=yield this.webAuthnLoginService.logIn(e);if(t.requiresTwoFactor)return this.validationService.showError(this.i18nService.t("twoFactorForPasskeysNotSupportedOnClientUpdateToLogIn")),this.currentState="assertFailed",void this.setFailureIcon();if((yield(0,u._)(this.keyService.userKey$(t.userId)))&&(yield this.loginSuccessHandlerService.run(t.userId,null)),this.shouldAutoClosePopout&&this.platformUtilsService.getClientType()===st.sK.Browser)return this.messagingService.send("openPopup"),void window.close();yield this.router.navigate([this.successRoute])}catch(t){t instanceof ot._&&this.validationService.showError(this.i18nService.t("invalidPasskeyPleaseTryAgain")),this.logService.error(t),this.currentState="assertFailed",this.setFailureIcon()}})}setDefaultIcon(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:this.Icons.TwoFactorAuthSecurityKeyIcon})}setFailureIcon(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:this.Icons.TwoFactorAuthSecurityKeyFailedIcon})}}UA.ɵfac=function(e){return new(e||UA)(B.rXU(xt),B.rXU(F.Ix),B.rXU(F.nX),B.rXU(Vs.K),B.rXU(Xs.B),B.rXU(U.W),B.rXU(v.aJ),B.rXU(b.Lu),B.rXU(V.y),B.rXU(Fd.f),B.rXU(js.U))},UA.ɵcmp=B.VBU({type:UA,selectors:[["app-login-via-webauthn"]],decls:10,vars:8,consts:[[1,"tw-flex","tw-flex-col","tw-items-center"],[4,"ngIf"],["bitTypography","body1",1,"tw-mb-0","tw-text-center"],["bitLink","","routerLink","/login"],["bitTypography","body1",1,"tw-text-center"],["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&&(B.j41(0,"div",0),B.DNE(1,OA,7,7,"ng-container",1)(2,GA,7,6,"ng-container",1),B.j41(3,"p",2),B.EFF(4),B.nI1(5,"i18n"),B.nrm(6,"br"),B.j41(7,"a",3),B.EFF(8),B.nI1(9,"i18n"),B.k0s()()()),2&e&&(B.R7$(),B.Y8G("ngIf","assert"===t.currentState),B.R7$(),B.Y8G("ngIf","assertFailed"===t.currentState),B.R7$(2),B.SpI(" ",B.bMT(5,4,"troubleLoggingIn")),B.R7$(4),B.JRh(B.bMT(9,6,"useADifferentLogInMethod")))},dependencies:[H.MD,H.bT,BA.iI,BA.Wk,jd.p,Yd.t,Jd.Q,RA.Z,zd.V,$d.g,DA.E,MA.r,au.$],encapsulation:2});var VA=i(82392);const jA=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 0.5 90.32 96">
    <path class="tw-fill-illustration-bg-secondary" d="M54 8.5a8 8 0 0 1 8-8h8a8 8 0 0 1 8 8v4H54v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 2.5h-8a6 6 0 0 0-6 6v2h20v-2a6 6 0 0 0-6-6Zm-8-2a8 8 0 0 0-8 8v4h24v-4a8 8 0 0 0-8-8h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M47 16.5a8 8 0 0 1 8-8h22a8 8 0 0 1 8 8v6H47v-6Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M77 10.5H55a6 6 0 0 0-6 6v4h34v-4a6 6 0 0 0-6-6Zm-22-2a8 8 0 0 0-8 8v6h38v-6a8 8 0 0 0-8-8H55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M40 26.5a8 8 0 0 1 8-8h36a8 8 0 0 1 8 8v66H40v-66Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84 20.5H48a6 6 0 0 0-6 6v64h48v-64a6 6 0 0 0-6-6Zm-36-2a8 8 0 0 0-8 8v66h52v-66a8 8 0 0 0-8-8H48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M4 44.5a8 8 0 0 1 8-8h38a8 8 0 0 1 8 8v48H4v-48Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50 38.5H12a6 6 0 0 0-6 6v46h50v-46a6 6 0 0 0-6-6Zm-38-2a8 8 0 0 0-8 8v48h54v-48a8 8 0 0 0-8-8H12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M68.677 60.935c1.928-3.316 6.718-3.316 8.645 0l16.31 28.052c1.938 3.334-.467 7.513-4.323 7.513H56.691c-3.856 0-6.26-4.18-4.323-7.513l16.31-28.052Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M91.903 89.993 75.593 61.94c-1.156-1.99-4.03-1.99-5.187 0L54.097 89.993c-1.163 2 .28 4.507 2.594 4.507h32.618c2.314 0 3.757-2.507 2.594-4.507Zm-14.58-29.058c-1.928-3.316-6.718-3.316-8.645 0l-16.31 28.052c-1.938 3.334.467 7.513 4.323 7.513h32.618c3.856 0 6.26-4.18 4.323-7.513l-16.31-28.052Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M75 88.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM70.06 71.053a.5.5 0 0 1 .496-.553h4.887a.5.5 0 0 1 .498.553l-1.393 13a.5.5 0 0 1-.498.447h-2.1a.5.5 0 0 1-.498-.447l-1.393-13Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M21 80.5a8 8 0 0 1 8-8h4a8 8 0 0 1 8 8v12H21v-12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33 74.5h-4a6 6 0 0 0-6 6v10h16v-10a6 6 0 0 0-6-6Zm-4-2a8 8 0 0 0-8 8v12h20v-12a8 8 0 0 0-8-8h-4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M13 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M13 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M26 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M26 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M39 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M39 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8ZM47 27.5a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm11-1a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm9 1a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm10 0a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-10-18a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm-9-19a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-11 1a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm11 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z" clip-rule="evenodd"/>
  </svg>
`;var NA=i(33331),zA=i(44432),YA=i(55807),LA=i(58384),KA=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const XA=e=>({key:e}),qA=()=>({key:"logOut"});function HA(e,t){1&e&&(B.j41(0,"div",0),B.nrm(1,"bit-icon",1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function WA(e,t){if(1&e){const e=B.RV6();B.nrm(0,"div",2),B.j41(1,"bit-callout",3),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"button",4),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.logout())}),B.EFF(5),B.nI1(6,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,2,"loginOnTrustedDeviceOrAskAdminToAssignPassword")," "),B.R7$(3),B.SpI(" ",B.bMT(6,4,"logOut")," "))}function $A(e,t){1&e&&(B.j41(0,"bit-callout",7),B.nI1(1,"i18n"),B.EFF(2),B.nI1(3,"i18n"),B.k0s()),2&e&&(B.Y8G("title",B.mNQ(B.bMT(1,3,"resetPasswordPolicyAutoEnroll"))),B.R7$(2),B.SpI(" ",B.bMT(3,5,"resetPasswordAutoEnrollInviteWarning")," "))}function JA(e,t){if(1&e){const e=B.RV6();B.DNE(0,$A,4,7,"bit-callout",5),B.j41(1,"auth-input-password",6),B.bIt("onPasswordFormSubmit",function(t){E.eBV(e);const i=B.XpG(2);return E.Njj(i.handlePasswordFormSubmit(t))})("onSecondaryButtonClick",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.logout())}),B.k0s()}if(2&e){const e=B.XpG(2);B.Y8G("ngIf",e.resetPasswordAutoEnroll),B.R7$(),B.Y8G("flow",e.inputPasswordFlow)("email",e.email)("userId",e.userId)("loading",e.submitting)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("primaryButtonText",B.eq3(8,XA,e.userType===e.SetInitialPasswordUserType.OFFBOARDED_TDE_ORG_USER?"setPassword":"createAccount"))("secondaryButtonText",B.lJ4(10,qA))}}function ZA(e,t){if(1&e&&B.nVh(0,WA,7,6)(1,JA,2,11),2&e){const e=B.XpG();B.vxM(e.userType===e.SetInitialPasswordUserType.OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE?0:1)}}class _A{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,A,p,g,v,f,m,y){this.accountService=e,this.activatedRoute=t,this.anonLayoutWrapperDataService=i,this.dialogService=n,this.i18nService=r,this.keyService=s,this.logoutService=o,this.logService=a,this.masterPasswordService=l,this.messagingService=c,this.organizationApiService=d,this.policyApiService=u,this.policyService=h,this.router=A,this.setInitialPasswordService=p,this.ssoLoginService=g,this.syncService=v,this.toastService=f,this.validationService=m,this.configService=y,this.inputPasswordFlow=le.m5.SetInitialPasswordAuthedUser,this.initializing=!0,this.masterPasswordPolicyOptions=null,this.submitting=!1,this.SetInitialPasswordUserType=re.bg}ngOnInit(){return KA(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0);const e=yield(0,u._)(this.accountService.activeAccount$);this.userId=null==e?void 0:e.id,this.email=null==e?void 0:e.email,yield this.establishUserType(),yield this.getOrgInfo(),this.initializing=!1})}handlePasswordFormSubmit(e){return KA(this,void 0,void 0,function*(){switch(this.submitting=!0,this.userType){case re.bg.JIT_PROVISIONED_MP_ORG_USER:if(yield this.configService.getFeatureFlag(dr.TO.EnableAccountEncryptionV2JitPasswordRegistration))return void(yield this.setInitialPasswordJitMPUserV2Encryption(e));if(e.newApisWithInputPasswordFlagEnabled){const t="Could not set initial password.";(0,NA.B)(e.newPassword,"newPassword",t),(0,Kr.x)(e.kdfConfig,"kdfConfig",t),(0,NA.B)(this.email,"email",t);const i=yield this.keyService.makeMasterKey(e.newPassword,this.email.trim().toLowerCase(),e.kdfConfig),n=yield this.keyService.hashMasterKey(e.newPassword,i,$i.VK.ServerAuthorization),r=yield this.keyService.hashMasterKey(e.newPassword,i,$i.VK.LocalAuthorization);return e.newMasterKey=i,e.newServerMasterKeyHash=n,e.newLocalMasterKeyHash=r,void(yield this.setInitialPassword(e))}yield this.setInitialPassword(e);break;case re.bg.TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP:if(e.newApisWithInputPasswordFlagEnabled)return void(yield this.setInitialPasswordTdeUserWithPermission(e));yield this.setInitialPassword(e);break;case re.bg.OFFBOARDED_TDE_ORG_USER:if(e.newApisWithInputPasswordFlagEnabled)return void(yield this.setInitialPasswordTdeOffboarding(e));yield this.setInitialPasswordTdeOffboardingOld(e);break;default:this.logService.error(`Unexpected user type: ${this.userType}. Could not set initial password.`),this.validationService.showError("Unexpected user type. Could not set initial password.")}})}logout(){return KA(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")})}establishUserType(){return KA(this,void 0,void 0,function*(){if(!this.userId)throw new Error("userId not found. Could not determine user type.");this.forceSetPasswordReason=yield(0,u._)(this.masterPasswordService.forceSetPasswordReason$(this.userId)),this.forceSetPasswordReason===fi.n.TdeOffboardingUntrustedDevice&&(this.userType=re.bg.OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"unableToCompleteLogin"},pageIcon:jA})),this.forceSetPasswordReason===fi.n.SsoNewJitProvisionedUser&&(this.userType=re.bg.JIT_PROVISIONED_MP_ORG_USER,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"joinOrganization"},pageSubtitle:{key:"finishJoiningThisOrganizationBySettingAMasterPassword"}})),this.forceSetPasswordReason===fi.n.TdeUserWithoutPasswordHasPasswordResetPermission&&(this.userType=re.bg.TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setMasterPassword"},pageSubtitle:{key:"orgPermissionsUpdatedMustSetPassword"}})),this.forceSetPasswordReason===fi.n.TdeOffboarding&&(this.userType=re.bg.OFFBOARDED_TDE_ORG_USER,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setMasterPassword"},pageSubtitle:{key:"tdeDisabledMasterPasswordRequired"}})),this.forceSetPasswordReason===fi.n.None&&(yield this.router.navigate(["/"]))})}getOrgInfo(){return KA(this,void 0,void 0,function*(){var e,t;if(!this.userId)throw new Error("userId not found. Could not handle query params.");if(this.userType===re.bg.OFFBOARDED_TDE_ORG_USER)return void(this.masterPasswordPolicyOptions=null!==(e=yield(0,u._)(this.policyService.masterPasswordPolicyOptions$(this.userId)))&&void 0!==e?e:null);const i=yield(0,u._)(this.activatedRoute.queryParams);if(this.orgSsoIdentifier=null!==(t=i.identifier)&&void 0!==t?t:yield this.ssoLoginService.getActiveUserOrganizationSsoIdentifier(this.userId),null!=this.orgSsoIdentifier)try{const e=yield this.organizationApiService.getAutoEnrollStatus(this.orgSsoIdentifier);this.orgId=e.id,this.resetPasswordAutoEnroll=e.resetPasswordEnabled,this.masterPasswordPolicyOptions=yield this.policyApiService.getMasterPasswordPolicyOptsForOrgUser(this.orgId)}catch(n){this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("errorOccurred")})}})}setInitialPasswordJitMPUserV2Encryption(e){return KA(this,void 0,void 0,function*(){const t="Could not set initial password for SSO JIT master password encryption user.";(0,NA.B)(e.newPassword,"newPassword",t),(0,NA.B)(e.salt,"salt",t),(0,NA.B)(this.orgSsoIdentifier,"orgSsoIdentifier",t),(0,NA.B)(this.orgId,"orgId",t),(0,NA.B)(this.userId,"userId",t),(0,Kr.x)(e.newPasswordHint,"newPasswordHint",t),(0,Kr.x)(this.resetPasswordAutoEnroll,"resetPasswordAutoEnroll",t);try{const t={newPasswordHint:e.newPasswordHint,orgSsoIdentifier:this.orgSsoIdentifier,orgId:this.orgId,resetPasswordAutoEnroll:this.resetPasswordAutoEnroll,newPassword:e.newPassword,salt:e.salt};yield this.setInitialPasswordService.initializePasswordJitPasswordUserV2Encryption(t,this.userId),this.showSuccessToastByUserType(),this.submitting=!1,yield this.router.navigate(["vault"])}catch(i){this.logService.error("Error setting initial password",i),this.validationService.showError(i),this.submitting=!1}})}setInitialPassword(e){return KA(this,void 0,void 0,function*(){const t="Could not set initial password.";(0,NA.B)(e.newMasterKey,"newMasterKey",t),(0,NA.B)(e.newServerMasterKeyHash,"newServerMasterKeyHash",t),(0,NA.B)(e.newLocalMasterKeyHash,"newLocalMasterKeyHash",t),(0,NA.B)(e.kdfConfig,"kdfConfig",t),(0,NA.B)(e.newPassword,"newPassword",t),(0,NA.B)(e.salt,"salt",t),(0,NA.B)(this.orgSsoIdentifier,"orgSsoIdentifier",t),(0,NA.B)(this.orgId,"orgId",t),(0,NA.B)(this.userType,"userType",t),(0,NA.B)(this.userId,"userId",t),(0,Kr.x)(e.newPasswordHint,"newPasswordHint",t),(0,Kr.x)(this.resetPasswordAutoEnroll,"resetPasswordAutoEnroll",t);try{const t={newMasterKey:e.newMasterKey,newServerMasterKeyHash:e.newServerMasterKeyHash,newLocalMasterKeyHash:e.newLocalMasterKeyHash,newPasswordHint:e.newPasswordHint,kdfConfig:e.kdfConfig,orgSsoIdentifier:this.orgSsoIdentifier,orgId:this.orgId,resetPasswordAutoEnroll:this.resetPasswordAutoEnroll,newPassword:e.newPassword,salt:e.salt};yield this.setInitialPasswordService.setInitialPassword(t,this.userType,this.userId),this.showSuccessToastByUserType(),this.submitting=!1,yield this.router.navigate(["vault"])}catch(i){this.logService.error("Error setting initial password",i),this.validationService.showError(i),this.submitting=!1}})}setInitialPasswordTdeUserWithPermission(e){return KA(this,void 0,void 0,function*(){const t="Could not set initial password for TDE user with Manage Account Recovery permission.";(0,NA.B)(e.newPassword,"newPassword",t),(0,NA.B)(e.salt,"salt",t),(0,Kr.x)(e.kdfConfig,"kdfConfig",t),(0,Kr.x)(e.newPasswordHint,"newPasswordHint",t),(0,NA.B)(this.orgSsoIdentifier,"orgSsoIdentifier",t),(0,NA.B)(this.orgId,"orgId",t),(0,Kr.x)(this.resetPasswordAutoEnroll,"resetPasswordAutoEnroll",t),(0,NA.B)(this.userId,"userId",t);try{const t={newPassword:e.newPassword,salt:e.salt,kdfConfig:e.kdfConfig,newPasswordHint:e.newPasswordHint,orgSsoIdentifier:this.orgSsoIdentifier,orgId:this.orgId,resetPasswordAutoEnroll:this.resetPasswordAutoEnroll};yield this.setInitialPasswordService.setInitialPasswordTdeUserWithPermission(t,this.userId),this.showSuccessToastByUserType(),this.submitting=!1,yield this.router.navigate(["vault"])}catch(i){this.logService.error("Error setting initial password",i),this.validationService.showError(i),this.submitting=!1}})}setInitialPasswordTdeOffboarding(e){return KA(this,void 0,void 0,function*(){const t="Could not set initial password.";(0,NA.B)(e.newPassword,"newPassword",t),(0,NA.B)(e.salt,"salt",t),(0,Kr.x)(e.kdfConfig,"kdfConfig",t),(0,Kr.x)(e.newPasswordHint,"newPasswordHint",t),(0,NA.B)(this.userId,"userId",t);try{const t={newPassword:e.newPassword,salt:e.salt,kdfConfig:e.kdfConfig,newPasswordHint:e.newPasswordHint};yield this.setInitialPasswordService.setInitialPasswordTdeOffboarding(t,this.userId),this.showSuccessToastByUserType(),yield this.logoutService.logout(this.userId),yield this.router.navigate(["/"])}catch(i){this.logService.error("Error setting initial password during TDE offboarding",i),this.validationService.showError(i)}finally{this.submitting=!1}})}setInitialPasswordTdeOffboardingOld(e){return KA(this,void 0,void 0,function*(){const t="Could not set initial password.";(0,NA.B)(e.newMasterKey,"newMasterKey",t),(0,NA.B)(e.newServerMasterKeyHash,"newServerMasterKeyHash",t),(0,NA.B)(this.userId,"userId",t),(0,Kr.x)(e.newPasswordHint,"newPasswordHint",t);try{const t={newMasterKey:e.newMasterKey,newServerMasterKeyHash:e.newServerMasterKeyHash,newPasswordHint:e.newPasswordHint};yield this.setInitialPasswordService.setInitialPasswordTdeOffboardingOld(t,this.userId),this.showSuccessToastByUserType(),yield this.logoutService.logout(this.userId),yield this.router.navigate(["/"])}catch(i){this.logService.error("Error setting initial password during TDE offboarding",i),this.validationService.showError(i)}finally{this.submitting=!1}})}showSuccessToastByUserType(){this.userType===re.bg.JIT_PROVISIONED_MP_ORG_USER?(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("accountSuccessfullyCreated")}),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("inviteAccepted")})):this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("masterPasswordSuccessfullySet")})}}_A.ɵfac=function(e){return new(e||_A)(B.rXU(Y.D),B.rXU(F.nX),B.rXU(Fd.f),B.rXU(R.o3),B.rXU(U.W),B.rXU(b.Lu),B.rXU(v.k4),B.rXU(Vs.K),B.rXU(vs.O),B.rXU(js.U),B.rXU(he.X),B.rXU(fe.m),B.rXU(me.m),B.rXU(F.Ix),B.rXU(re.HQ),B.rXU(Ft._),B.rXU(Ga.H),B.rXU(P.f),B.rXU(Xs.B),B.rXU(z.w))},_A.ɵcmp=B.VBU({type:_A,selectors:[["ng-component"]],decls:2,vars:1,consts:[[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],[1,"tw-mt-4"],["type","warning"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"],["type","warning",3,"title",4,"ngIf"],[3,"onPasswordFormSubmit","onSecondaryButtonClick","flow","email","userId","loading","masterPasswordPolicyOptions","primaryButtonText","secondaryButtonText"],["type","warning",3,"title"]],template:function(e,t){1&e&&B.nVh(0,HA,3,3,"div",0)(1,ZA,2,1),2&e&&B.vxM(t.initializing?0:1)},dependencies:[Yd.t,Jd.Q,zA.G,H.MD,H.bT,YA.o,LA.R,le.tu,Zu.$Z],encapsulation:2});var ep=i(24558),tp=i(274),ip=i(9045);const np=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M7.5 15a5 5 0 0 1 5-5h55a5 5 0 0 1 5 5v35a5 5 0 0 1-5 5h-55a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67.5 11.667h-55A3.333 3.333 0 0 0 9.167 15v35a3.333 3.333 0 0 0 3.333 3.333h55A3.333 3.333 0 0 0 70.833 50V15a3.333 3.333 0 0 0-3.333-3.333ZM12.5 10a5 5 0 0 0-5 5v35a5 5 0 0 0 5 5h55a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5h-55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M7.5 15h65v35h-65V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70.833 16.667H9.167v31.666h61.666V16.667ZM7.5 15v35h65V15h-65Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M32.5 54.167h15v15h-15v-15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M31.667 53.334h16.666v15H55a.833.833 0 0 1 0 1.667H25a.833.833 0 0 1 0-1.667h6.667v-15Zm1.666 15h13.334V55.001H33.333v13.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M0 40a3.333 3.333 0 0 1 3.333-3.333h15A3.333 3.333 0 0 1 21.667 40v26.667A3.333 3.333 0 0 1 18.333 70h-15A3.333 3.333 0 0 1 0 66.667V40Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M18.333 38.334h-15c-.92 0-1.666.746-1.666 1.666v26.667c0 .92.746 1.667 1.666 1.667h15c.92 0 1.667-.746 1.667-1.667V40c0-.92-.746-1.666-1.667-1.666Zm-15-1.667A3.333 3.333 0 0 0 0 40v26.667A3.333 3.333 0 0 0 3.333 70h15a3.333 3.333 0 0 0 3.334-3.333V40a3.333 3.333 0 0 0-3.334-3.333h-15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.333 40.833c0-.46.373-.833.834-.833H12.5a.833.833 0 0 1 0 1.667H9.167a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" fill-rule="evenodd" d="M40 45.834c7.364 0 13.333-5.97 13.333-13.334 0-7.363-5.97-13.333-13.333-13.333-7.364 0-13.333 5.97-13.333 13.333 0 7.364 5.97 13.334 13.333 13.334ZM34.167 27.5a2.5 2.5 0 0 0-2.5 2.5v8.334a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H34.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M31.667 30a2.5 2.5 0 0 1 2.5-2.5h11.666a2.5 2.5 0 0 1 2.5 2.5v8.333a2.5 2.5 0 0 1-2.5 2.5H34.167a2.5 2.5 0 0 1-2.5-2.5V30Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M45.833 29.167H34.167a.833.833 0 0 0-.834.833v8.333c0 .46.373.834.834.834h11.666c.46 0 .834-.373.834-.834V30a.833.833 0 0 0-.834-.833ZM34.167 27.5a2.5 2.5 0 0 0-2.5 2.5v8.333a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H34.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M39.167 32.5a.833.833 0 0 1 1.666 0v3.334a.833.833 0 0 1-1.666 0V32.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.833 26.667a4.167 4.167 0 0 1 8.334 0v.833H42.5v-.833a2.5 2.5 0 0 0-5 0v.833h-1.667v-.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M50 33.333A3.333 3.333 0 0 1 53.333 30h23.334A3.333 3.333 0 0 1 80 33.333v33.334A3.333 3.333 0 0 1 76.667 70H53.333A3.333 3.333 0 0 1 50 66.667V33.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M76.667 31.667H53.333c-.92 0-1.666.746-1.666 1.666v33.334c0 .92.746 1.666 1.666 1.666h23.334c.92 0 1.666-.746 1.666-1.666V33.333c0-.92-.746-1.666-1.666-1.666ZM53.333 30A3.333 3.333 0 0 0 50 33.333v33.334A3.333 3.333 0 0 0 53.333 70h23.334A3.333 3.333 0 0 0 80 66.667V33.333A3.333 3.333 0 0 0 76.667 30H53.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M67.5 63.334a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 64.167a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666Zm0 1.667a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M33.333 55h13.334v5H33.333v-5Z"/>
  </svg>
`;var rp=i(54006);const sp=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5 4 87 87">
    <path class="tw-fill-illustration-bg-primary" d="M90 48c0 23.196-18.804 42-42 42S6 71.196 6 48 24.804 6 48 6s42 18.804 42 42Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48 7C25.356 7 7 25.356 7 48s18.356 41 41 41 41-18.356 41-41S70.644 7 48 7ZM5 48C5 24.252 24.252 5 48 5s43 19.252 43 43-19.252 43-43 43S5 71.748 5 48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M11 72a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H14a3 3 0 0 1-3-3V72Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 71H14a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V72a1 1 0 0 0-1-1Zm-14-2a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V72a3 3 0 0 0-3-3H14Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M20 75a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16 68a5 5 0 0 1 10 0v1h-2v-1a3 3 0 1 0-6 0v1h-2v-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M92 16c0 6.627-5.373 12-12 12s-12-5.373-12-12S73.373 4 80 4s12 5.373 12 12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80 26c5.523 0 10-4.477 10-10S85.523 6 80 6s-10 4.477-10 10 4.477 10 10 10Zm0 2c6.627 0 12-5.373 12-12S86.627 4 80 4 68 9.373 68 16s5.373 12 12 12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M85.707 12.293a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 1.414-1.414L78 18.586l6.293-6.293a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M43 60.883V52l7 4-5.052 5.63A1.117 1.117 0 0 1 43 60.882Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m42 50.276 9.571 5.47-5.878 6.55A2.117 2.117 0 0 1 42 60.884V50.276Zm2 3.447v7.16a.117.117 0 0 0 .204.078l4.225-4.708L44 53.723Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M31.186 44.957 58.6 32.123a1.5 1.5 0 0 1 2.128 1.513l-2.763 26.793a1.5 1.5 0 0 1-2.366 1.066L42.3 51.965l-11.018-4.25c-1.233-.476-1.293-2.198-.096-2.758Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.733 33.533a.5.5 0 0 0-.709-.504L31.61 45.862a.5.5 0 0 0 .032.92l10.42 4.02 8.341-8.106a1 1 0 1 1 1.394 1.434l-7.942 7.719 12.327 8.833a.5.5 0 0 0 .788-.356l2.764-26.793Zm-17.912 19.32-10.899-4.206c-2.054-.793-2.154-3.663-.16-4.596l27.414-12.834c1.76-.824 3.746.588 3.547 2.521L58.96 60.532c-.197 1.909-2.383 2.893-3.943 1.775l-13.196-9.455Z" clip-rule="evenodd"/>
  </svg>
`;var op=i(32415);const ap=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 12.12 96 76">
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M77 43.121h2c9.389 0 17 7.611 17 17s-7.611 17-17 17H21v-.086C9.234 76.022 0 66.15 0 54.121c0-10.663 7.256-19.63 17.099-22.236C21.599 20.32 32.842 12.121 46 12.121c17.12 0 31 13.88 31 31Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" fill-rule="evenodd" d="M56 53.121c2.903 0 5.707-.427 8.352-1.22 3.427 4.966 9.157 8.22 15.648 8.22 5.856 0 11.094-2.65 14.579-6.815C91.952 47.31 85.965 43.121 79 43.121h-2c0-17.12-13.88-31-31-31a30.861 30.861 0 0 0-18.387 6.039A29.12 29.12 0 0 0 27 24.121c0 16.016 12.984 29 29 29Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 45.121v-2c0-16.016-12.984-29-29-29-12.306 0-22.826 7.666-27.037 18.49l-.369.947-.983.26C8.623 36.199 2 44.389 2 54.121c0 10.982 8.43 19.997 19.172 20.922l.91.078H79c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15h-4ZM21 77.035C9.234 76.022 0 66.15 0 54.121c0-10.663 7.256-19.63 17.099-22.236C21.599 20.32 32.842 12.121 46 12.121c17.12 0 31 13.88 31 31h2c9.389 0 17 7.611 17 17s-7.611 17-17 17H21v-.086Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M31 88.121c6.326 0 11.795-3.671 14.392-9h7.002a2 2 0 0 0 1.11-.336L56 77.121l1.895 1.516a1 1 0 0 0 1.225.02l1.38-1.036 1.38 1.035a1 1 0 0 0 1.225-.019L65 77.121l3.578 1.789a2 2 0 0 0 .894.211h3.608a2 2 0 0 0 1.519-.698l4.843-5.651a1 1 0 0 0 0-1.302L74.6 65.82a2 2 0 0 0-1.519-.699H45.392c-2.597-5.328-8.066-9-14.392-9-8.837 0-16 7.163-16 16s7.163 16 16 16Zm-6-13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M44.141 77.121h8.253l3.713-2.475 2.432 1.945 1.961-1.47 1.96 1.47 2.29-1.831 4.722 2.361h3.608l4.286-5-4.286-5H44.141l-.547-1.124C41.319 61.33 36.532 58.121 31 58.121c-7.732 0-14 6.268-14 14s6.268 14 14 14c5.532 0 10.32-3.209 12.594-7.876l.547-1.124Zm33.783-4.35h-.001Zm-.002-1.3h.002-.002ZM74.6 65.82a2 2 0 0 0-1.519-.699H45.392c-2.597-5.328-8.066-9-14.392-9-8.837 0-16 7.163-16 16s7.163 16 16 16c6.326 0 11.795-3.671 14.392-9h7.002a2 2 0 0 0 1.11-.336L56 77.121l1.895 1.516a1 1 0 0 0 1.225.02l1.38-1.036 1.38 1.035a1 1 0 0 0 1.225-.019L65 77.121l3.578 1.789a2 2 0 0 0 .894.211h3.608a2 2 0 0 0 1.519-.698l4.843-5.651a1 1 0 0 0 0-1.302L74.6 65.82ZM30 72.12a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-2 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" clip-rule="evenodd"/>
  </svg>
`;var lp=i(20266),cp=i(36951);const dp=VA.JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 12.75 96 72">
  <path class="tw-fill-illustration-bg-primary" d="M0 18.512a5.76 5.76 0 0 1 5.76-5.76h54.48a5.76 5.76 0 0 1 5.76 5.76v38.48a5.76 5.76 0 0 1-5.76 5.76H5.76A5.76 5.76 0 0 1 0 56.992v-38.48Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.24 14.672H5.76a3.84 3.84 0 0 0-3.84 3.84v38.48a3.84 3.84 0 0 0 3.84 3.84h54.48a3.84 3.84 0 0 0 3.84-3.84v-38.48a3.84 3.84 0 0 0-3.84-3.84Zm-54.48-1.92A5.76 5.76 0 0 0 0 18.512v38.48a5.76 5.76 0 0 0 5.76 5.76h54.48a5.76 5.76 0 0 0 5.76-5.76v-38.48a5.76 5.76 0 0 0-5.76-5.76H5.76Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 24.712H1v-1.92h64v1.92Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" d="M62 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM56 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM50 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/>
  <path class="tw-fill-illustration-tertiary" d="M21.099 48.635c1.515-2.606 5.28-2.606 6.795 0l10.053 17.29c1.523 2.62-.367 5.906-3.398 5.906H14.444c-3.03 0-4.92-3.285-3.398-5.905L21.1 48.636Z"/>
  <path class="tw-fill-illustration-outline" d="M20.373 48.213c1.839-3.163 6.408-3.163 8.247 0l10.053 17.29c1.849 3.18-.446 7.168-4.124 7.168H14.444c-3.678 0-5.973-3.987-4.124-7.167l10.053-17.29Zm6.795.844c-1.192-2.049-4.152-2.049-5.343 0L11.773 66.349c-1.198 2.06.288 4.643 2.671 4.643h20.105c2.383 0 3.869-2.583 2.671-4.643l-10.052-17.29Z"/>
  <circle class="tw-fill-illustration-outline" cx="24.496" cy="66.428" r="1.351" />
  <path class="tw-fill-illustration-outline" d="M22.517 54.707a.393.393 0 0 1 .39-.434h3.178c.234 0 .416.202.391.434l-.929 8.67a.393.393 0 0 1-.39.35h-1.32c-.201 0-.37-.151-.391-.35L22.977 59l-.46-4.293Z"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M82 42.752c0 7.732-6.268 14-14 14s-14-6.268-14-14 6.268-14 14-14 14 6.268 14 14Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M68 54.832c6.671 0 12.08-5.408 12.08-12.08S74.67 30.672 68 30.672c-6.672 0-12.08 5.408-12.08 12.08s5.408 12.08 12.08 12.08Zm0 1.92c7.732 0 14-6.268 14-14s-6.268-14-14-14-14 6.268-14 14 6.268 14 14 14Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M93.907 72.728A27.5 27.5 0 0 1 96 83.252a1.5 1.5 0 0 1-1.5 1.5h-52a1.5 1.5 0 0 1-1.5-1.5 27.5 27.5 0 0 1 52.907-10.524Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M94.076 82.832a25.58 25.58 0 0 0-51.153 0h51.153Zm1.924.42a27.5 27.5 0 1 0-55 0 1.5 1.5 0 0 0 1.5 1.5h52a1.5 1.5 0 0 0 1.5-1.5Z" clip-rule="evenodd"/>
</svg>
`,up=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.52 0.12 120 120">
    <path class="tw-fill-illustration-bg-primary" d="M120.518 60.121c0 33.137-26.863 60-60 60s-60-26.863-60-60 26.863-60 60-60 60 26.863 60 60Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.518 117.621c31.756 0 57.5-25.743 57.5-57.5 0-31.756-25.744-57.5-57.5-57.5s-57.5 25.744-57.5 57.5 25.744 57.5 57.5 57.5Zm0 2.5c33.137 0 60-26.863 60-60s-26.863-60-60-60-60 26.863-60 60 26.863 60 60 60Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M51.088.858c12.675 9.633 22.026 23.414 26.03 39.32 16.502.649 31.563 6.91 43.326 16.93.049.998.074 2.003.074 3.014l-.001.38c-11.422-10.39-26.357-16.986-42.813-17.796a71.535 71.535 0 0 1 1.564 14.916c0 16.114-5.35 30.978-14.37 42.915a68.918 68.918 0 0 0 16.87 2.085 68.566 68.566 0 0 0 25.496-4.883 60.441 60.441 0 0 1-3.429 3.9 71.193 71.193 0 0 1-22.067 3.483 71.36 71.36 0 0 1-18.555-2.44A71.615 71.615 0 0 1 45.5 118.227a59.379 59.379 0 0 1-3.288-.949 69.075 69.075 0 0 0 18.38-15.355C43.27 96.538 28.78 84.721 19.918 69.265A68.568 68.568 0 0 0 8.75 90.475a59.868 59.868 0 0 1-1.636-2.974 71.13 71.13 0 0 1 11.496-20.618c-5.17-9.868-8.093-21.098-8.093-33.011 0-2.536.132-5.041.39-7.509a60.255 60.255 0 0 1 3.093-4.141 69.204 69.204 0 0 0-.983 11.65c0 11.122 2.641 21.627 7.33 30.923 13.065-15.111 32.376-24.673 53.92-24.673h.253C70.367 24.294 60.712 10.694 47.723 1.49a59.73 59.73 0 0 1 3.365-.63Zm25.68 56.764c0-5.15-.566-10.168-1.64-14.995a70.333 70.333 0 0 0-.86-.005c-21.139 0-40.05 9.54-52.661 24.55 8.663 15.617 23.23 27.506 40.687 32.653 9.071-11.65 14.474-26.295 14.474-42.203Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M84.268 40.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M76.768 45.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M70.518 100.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M63.018 105.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M28.018 65.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.518 70.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
  </svg>
`,hp=VA.JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4.17 0.75 91.67 95.83">
  <path class="tw-fill-illustration-bg-secondary" d="M56.25 9.085A8.333 8.333 0 0 1 64.583.752h8.334a8.333 8.333 0 0 1 8.333 8.333v4.167h-25V9.085Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M72.917 2.835h-8.334a6.25 6.25 0 0 0-6.25 6.25v2.084h20.834V9.085a6.25 6.25 0 0 0-6.25-6.25ZM64.583.752a8.333 8.333 0 0 0-8.333 8.333v4.167h25V9.085A8.333 8.333 0 0 0 72.917.752h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M48.959 17.418a8.333 8.333 0 0 1 8.333-8.333h22.916a8.333 8.333 0 0 1 8.334 8.333v6.25H48.958v-6.25Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80.209 11.168H57.291a6.25 6.25 0 0 0-6.25 6.25v4.167h35.416v-4.167a6.25 6.25 0 0 0-6.25-6.25ZM57.291 9.085a8.333 8.333 0 0 0-8.334 8.333v6.25h39.584v-6.25a8.333 8.333 0 0 0-8.334-8.333H57.293Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M41.666 27.835A8.333 8.333 0 0 1 50 19.502h37.5a8.333 8.333 0 0 1 8.333 8.333v66.667c0 1.15-.933 2.083-2.083 2.083H41.666v-68.75Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M87.5 21.585H50a6.25 6.25 0 0 0-6.25 6.25v66.667h50V27.835a6.25 6.25 0 0 0-6.25-6.25ZM50 19.502a8.333 8.333 0 0 0-8.334 8.333v68.75H93.75c1.15 0 2.083-.932 2.083-2.083V27.835a8.333 8.333 0 0 0-8.333-8.333H50Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-primary"" d="M4.167 46.585a8.333 8.333 0 0 1 8.333-8.333h39.583a8.333 8.333 0 0 1 8.334 8.333v47.917c0 1.15-.933 2.083-2.084 2.083H6.25a2.083 2.083 0 0 1-2.083-2.083V46.585Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M52.083 40.335H12.5a6.25 6.25 0 0 0-6.25 6.25v47.917h52.083V46.585a6.25 6.25 0 0 0-6.25-6.25ZM12.5 38.252a8.333 8.333 0 0 0-8.334 8.333v47.917c0 1.15.933 2.083 2.084 2.083h52.083c1.15 0 2.084-.932 2.084-2.083V46.585a8.333 8.333 0 0 0-8.334-8.333H12.5Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-tertiary" d="M21.875 84.085a8.333 8.333 0 0 1 8.333-8.333h4.167a8.333 8.333 0 0 1 8.333 8.333v12.5H21.875v-12.5Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.375 77.835h-4.167a6.25 6.25 0 0 0-6.25 6.25v10.417h16.667V84.085a6.25 6.25 0 0 0-6.25-6.25Zm-4.167-2.083a8.333 8.333 0 0 0-8.333 8.333v12.5h20.833v-12.5a8.333 8.333 0 0 0-8.333-8.333h-4.167Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M23.959 85.127a8.333 8.333 0 0 0-8.334-8.333h-1.041c-.576 0-1.042.466-1.042 1.042v18.75h10.417V85.127Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 94.502V78.877a6.25 6.25 0 0 1 6.25 6.25v9.375h-6.25Zm0-17.708a8.333 8.333 0 0 1 8.334 8.333v11.459H13.542v-18.75c0-.576.466-1.042 1.042-1.042h1.041Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 85.127a8.333 8.333 0 0 1 8.333-8.333H50c.575 0 1.042.466 1.042 1.042v18.75H40.625V85.127Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48.958 94.502V78.877a6.25 6.25 0 0 0-6.25 6.25v9.375h6.25Zm0-17.708a8.333 8.333 0 0 0-8.333 8.333v11.459h10.417v-18.75c0-.576-.467-1.042-1.042-1.042h-1.042Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M13.541 48.669c0-.576.467-1.042 1.042-1.042h8.333c.576 0 1.042.466 1.042 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.042-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 49.71v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.042.466-1.042 1.042v8.333c0 .575.467 1.042 1.042 1.042h8.333c.576 0 1.042-.467 1.042-1.042v-8.333c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M13.541 62.21c0-.575.467-1.041 1.042-1.041h8.333c.576 0 1.042.466 1.042 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.042-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 63.252v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.042.466-1.042 1.042v8.333c0 .575.467 1.042 1.042 1.042h8.333c.576 0 1.042-.467 1.042-1.042V62.21c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M27.084 48.669c0-.576.466-1.042 1.041-1.042h8.334c.575 0 1.041.466 1.041 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.041-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 49.71v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.041.466-1.041 1.042v8.333c0 .575.466 1.042 1.041 1.042h8.334c.575 0 1.041-.467 1.041-1.042v-8.333c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M27.084 62.21c0-.575.466-1.041 1.041-1.041h8.334c.575 0 1.041.466 1.041 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.041-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 63.252v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.041.466-1.041 1.042v8.333c0 .575.466 1.042 1.041 1.042h8.334c.575 0 1.041-.467 1.041-1.042V62.21c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 48.669c0-.576.466-1.042 1.042-1.042H50c.575 0 1.042.466 1.042 1.042v8.333c0 .575-.467 1.042-1.042 1.042h-8.333a1.042 1.042 0 0 1-1.042-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.708 49.71v6.25h6.25v-6.25h-6.25Zm-1.041-2.083c-.576 0-1.042.466-1.042 1.042v8.333c0 .575.466 1.042 1.042 1.042H50c.575 0 1.042-.467 1.042-1.042v-8.333c0-.576-.467-1.042-1.042-1.042h-8.333ZM48.959 28.877c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083H50a1.042 1.042 0 0 1-1.041-1.041Zm11.458-1.042a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm9.375 1.042c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm10.416 0c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm0 6.25c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.042 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.041 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.041 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-10.416-18.75a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.042 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.041 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.041 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm-9.375-19.792a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-11.459 1.042c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083H50a1.042 1.042 0 0 1-1.041-1.041Zm11.459 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.042 7.292c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.042-1.041Zm1.042 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 62.21c0-.575.466-1.041 1.042-1.041H50c.575 0 1.042.466 1.042 1.042v8.333c0 .575-.467 1.042-1.042 1.042h-8.333a1.042 1.042 0 0 1-1.042-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.708 63.252v6.25h6.25v-6.25h-6.25Zm-1.041-2.083c-.576 0-1.042.466-1.042 1.042v8.333c0 .575.466 1.042 1.042 1.042H50c.575 0 1.042-.467 1.042-1.042V62.21c0-.576-.467-1.042-1.042-1.042h-8.333Z" clip-rule="evenodd"/>
</svg>
`,Ap=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 14.58 100 75">
    <path class="tw-fill-illustration-bg-secondary" d="M0 20.833a6.25 6.25 0 0 1 6.25-6.25h87.5a6.25 6.25 0 0 1 6.25 6.25v62.5a6.25 6.25 0 0 1-6.25 6.25H6.25A6.25 6.25 0 0 1 0 83.333v-62.5Z"/>
    <path class="tw-fill-illustration-tertiary" d="M14.583 52.084a4.167 4.167 0 0 1 4.167-4.167h65.625a4.167 4.167 0 0 1 4.166 4.167v6.25a4.167 4.167 0 0 1-4.166 4.166H18.75a4.167 4.167 0 0 1-4.167-4.166v-6.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84.375 50H18.75c-1.15 0-2.084.933-2.084 2.084v6.25c0 1.15.933 2.083 2.084 2.083h65.625c1.15 0 2.083-.933 2.083-2.083v-6.25c0-1.15-.933-2.084-2.083-2.084ZM18.75 47.917a4.167 4.167 0 0 0-4.167 4.167v6.25A4.167 4.167 0 0 0 18.75 62.5h65.625a4.167 4.167 0 0 0 4.166-4.166v-6.25a4.167 4.167 0 0 0-4.166-4.167H18.75Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.339 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.696 1.211l-.843-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.042-1.041ZM22.922 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.042-1.041ZM54.172 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.041-1.041ZM43.755 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.041-1.041Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M0 20.833a6.25 6.25 0 0 1 6.25-6.25h87.5a6.25 6.25 0 0 1 6.25 6.25v62.5a6.25 6.25 0 0 1-6.25 6.25H6.25A6.25 6.25 0 0 1 0 83.333v-62.5Zm6.25-4.167h87.5a4.167 4.167 0 0 1 4.167 4.167v2.083H2.083v-2.083a4.167 4.167 0 0 1 4.167-4.167ZM2.083 25v58.333A4.167 4.167 0 0 0 6.25 87.5h87.5a4.167 4.167 0 0 0 4.167-4.167V25H2.083Z" clip-rule="evenodd"/>
    <circle class="tw-fill-illustration-outline" cx="6.771" cy="19.885" r="1.563"/>
    <circle class="tw-fill-illustration-outline" cx="11.423" cy="19.885" r="1.563"/>
    <circle class="tw-fill-illustration-outline" cx="16.145" cy="19.885" r="1.563"/>
    <path class="tw-fill-illustration-bg-primary" d="M62.108 33.334a4.167 4.167 0 0 1 4.167-4.167h23.282a4.167 4.167 0 0 1 4.166 4.167v39.583a4.167 4.167 0 0 1-4.166 4.167H66.275a4.167 4.167 0 0 1-4.167-4.167V33.334Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M88.942 44.86c0 .575-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.084H87.9c.575 0 1.042.467 1.042 1.042ZM88.942 51.062c0 .576-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.083H87.9c.575 0 1.042.466 1.042 1.041ZM87.9 58.306a1.042 1.042 0 0 0 0-2.083H67.872a1.042 1.042 0 0 0 0 2.083H87.9ZM88.942 63.542c0 .576-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.083H87.9c.575 0 1.042.466 1.042 1.041ZM87.9 70.975a1.042 1.042 0 1 0 0-2.083H67.872a1.042 1.042 0 0 0 0 2.083H87.9Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M62.135 33.334a4.167 4.167 0 0 1 4.166-4.167h23.282a4.167 4.167 0 0 1 4.167 4.167v2.083H62.135v-2.083Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M66.275 27.084a6.25 6.25 0 0 0-6.25 6.25v39.583a6.25 6.25 0 0 0 6.25 6.25h23.282a6.25 6.25 0 0 0 6.25-6.25V37.501h.026v-4.167a6.25 6.25 0 0 0-6.25-6.25H66.275ZM62.11 37.501v35.416a4.167 4.167 0 0 0 4.166 4.167h23.282a4.167 4.167 0 0 0 4.167-4.167V37.501H62.109Zm27.448-8.334a4.167 4.167 0 0 1 4.167 4.167v2.083h-31.59v-2.083a4.167 4.167 0 0 1 4.167-4.167h23.256Z" clip-rule="evenodd"/>
  </svg>
`,pp=VA.JW`
<svg version="1.1" viewBox="0 0 290 60" xmlns="http://www.w3.org/2000/svg">
  <title>Vaultwarden</title>
  <path class="tw-fill-marketing-logo" d="m166 46-4.2-13q-.4-1.2-1.5-5.6h-.17q-.83 3.6-1.5 5.6l-4.3 13h-4l-6.2-23h3.6q2.2 8.6 3.3 13 1.2 4.5 1.3 6.1h.17q.23-1.2.73-3.1.52-1.9.89-3l4.2-13h3.7l4.1 13q1.2 3.6 1.6 6h.17q.083-.75.44-2.3.37-1.6 4.3-17h3.6l-6.3 23zm29 0-.69-3.2h-.17q-1.7 2.1-3.4 2.9-1.7.75-4.2.75-3.4 0-5.3-1.7-1.9-1.7-1.9-5 0-6.9 11-7.2l3.9-.12v-1.4q0-2.7-1.2-4-1.1-1.3-3.7-1.3-2.8 0-6.4 1.7l-1.1-2.6q1.7-.92 3.7-1.4 2-.52 4-.52 4.1 0 6 1.8 2 1.8 2 5.8v16zm-7.8-2.4q3.2 0 5.1-1.8 1.9-1.8 1.9-4.9v-2.1l-3.5.15q-4.1.15-5.9 1.3-1.8 1.1-1.8 3.5 0 1.9 1.1 2.8 1.1.98 3.2.98zm28-21q1.5 0 2.7.25l-.48 3.2q-1.4-.31-2.5-.31-2.8 0-4.7 2.2-2 2.2-2 5.6v12h-3.5v-23h2.8l.4 4.2h.17q1.3-2.2 3.1-3.4 1.8-1.2 3.9-1.2zm22 20h-.19q-2.4 3.5-7.2 3.5-4.5 0-7-3.1-2.5-3.1-2.5-8.7 0-5.6 2.5-8.8 2.5-3.1 6.9-3.1 4.6 0 7.1 3.4h.27l-.15-1.6-.083-1.6v-9.3h3.5v32h-2.8zm-6.9.58q3.5 0 5.1-1.9 1.6-1.9 1.6-6.2v-.73q0-4.8-1.6-6.9-1.6-2.1-5.1-2.1-3 0-4.7 2.4-1.6 2.3-1.6 6.7 0 4.4 1.6 6.6 1.6 2.2 4.7 2.2zm27 2.9q-5.1 0-8-3.1-2.9-3.1-2.9-8.5 0-5.5 2.7-8.8 2.7-3.2 7.3-3.2 4.3 0 6.8 2.8 2.5 2.8 2.5 7.4v2.2h-16q.1 4 2 6.1 1.9 2.1 5.4 2.1 3.7 0 7.3-1.5v3.1q-1.8.79-3.5 1.1-1.6.35-3.9.35zm-.94-21q-2.7 0-4.4 1.8-1.6 1.8-1.9 4.9h12q0-3.3-1.5-5-1.5-1.7-4.2-1.7zm31 20v-15q0-2.8-1.3-4.2-1.3-1.4-4-1.4-3.6 0-5.2 1.9-1.7 1.9-1.7 6.4v12h-3.5v-23h2.8l.56 3.1h.17q1.1-1.7 3-2.6 1.9-.94 4.3-.94 4.1 0 6.2 2 2.1 2 2.1 6.3v15z"/>
  <path class="tw-fill-marketing-logo" d="m77 46-1.2-3.2h-.17q-1.6 2-3.3 2.8-1.7.77-4.4.77-3.3 0-5.3-1.9-1.9-1.9-1.9-5.4 0-3.7 2.6-5.4 2.6-1.8 7.8-2l4-.12v-1q0-3.5-3.6-3.5-2.8 0-6.6 1.7l-2.1-4.3q4-2.1 8.9-2.1 4.7 0 7.2 2 2.5 2 2.5 6.2v15zm-1.9-11-2.5.083q-2.8.083-4.1 1-1.4.92-1.4 2.8 0 2.7 3.1 2.7 2.2 0 3.5-1.3 1.3-1.3 1.3-3.4zm29 11-.85-3h-.33q-1 1.6-2.9 2.5-1.9.87-4.3.87-4.1 0-6.2-2.2-2.1-2.2-2.1-6.3v-15h6.3v14q0 2.5.89 3.8.89 1.2 2.8 1.2 2.7 0 3.8-1.8 1.2-1.8 1.2-5.9v-11h6.3v23zm18 0h-6.3v-32h6.3zm16-4.6q1.7 0 4-.73v4.7q-2.4 1.1-5.8 1.1-3.8 0-5.6-1.9-1.7-1.9-1.7-5.8v-11h-3v-2.7l3.5-2.1 1.8-4.9h4.1v4.9h6.5v4.8h-6.5v11q0 1.4.75 2 .77.64 2 .64z"/>
  <path class="tw-fill-marketing-logo" d="m18 11-5.6.00073 15 42h5.3l15-42h-5.6l-9.5 27c-.63 1.7-1.2 3.4-1.6 4.9-.43 1.5-.79 2.9-1.1 4.3-.28-1.4-.63-2.8-1.1-4.4-.43-1.5-.97-3.2-1.6-5l-9.5-27z"/>
  <path class="tw-fill-marketing-logo" d="m30 .05a.85.85 0 00-.44.37l-1.5 2.5c-.27.022-.53.046-.8.076l-2-2.2a.85.85 0 00-1.4.29l-1 2.8c-.26.074-.51.15-.77.23l-2.4-1.8a.85.85 0 00-1.4.56l-.44 2.9c-.23.12-.47.24-.7.37l-2.7-1.3a.85.85 0 00-1.2.81l.14 3c-.2.16-.4.33-.6.49l-2.9-.72a.85.85 0 00-1 1l.72 2.9c-.17.2-.33.4-.49.6l-3-.14a.85.85 0 00-.81 1.2l1.3 2.7c-.13.23-.25.46-.37.7l-2.9.44a.85.85 0 00-.56 1.4l1.8 2.4c-.081.25-.16.51-.23.77l-2.8 1a.85.85 0 00-.29 1.4l2.2 2c-.03.26-.054.53-.076.8l-2.5 1.5a.85.85 0 000 1.5l2.5 1.5c.022.27.046.53.076.8l-2.2 2a.85.85 0 00.29 1.4l2.8 1c.074.26.15.51.23.77l-1.8 2.4a.85.85 0 00.56 1.4l2.9.44c.12.23.24.47.37.7l-1.3 2.7a.85.85 0 00.81 1.2l3-.14c.16.2.33.4.49.6l-.72 2.9a.85.85 0 001 1l2.9-.72c.2.17.4.33.6.49l-.14 3a.85.85 0 001.2.81l2.7-1.3c.23.13.46.25.7.37l.44 2.9a.85.85 0 001.4.56l2.4-1.8c.25.081.51.16.77.23l1 2.8a.85.85 0 001.4.29l2-2.2c.26.03.53.054.8.076l1.5 2.5a.85.85 0 001.5 0l1.5-2.5c.27-.022.53-.046.8-.076l2 2.2a.85.85 0 001.4-.29l1-2.8c.26-.074.51-.15.77-.23l2.4 1.8a.85.85 0 001.4-.56l.44-2.9c.23-.12.47-.24.7-.37l2.7 1.3a.85.85 0 001.2-.81l-.14-3c.2-.16.4-.33.6-.49l2.9.72a.85.85 0 001-1l-.72-2.9c.17-.2.33-.4.49-.6l3 .14a.85.85 0 00.81-1.2l-1.3-2.7c.13-.23.25-.46.37-.7l2.9-.44a.85.85 0 00.56-1.4l-1.8-2.4c.081-.25.16-.51.23-.77l2.8-1a.85.85 0 00.29-1.4l-2.2-2c.03-.26.054-.53.076-.8l2.5-1.5a.85.85 0 000-1.5l-2.5-1.5c-.022-.27-.046-.53-.076-.8l2.2-2a.85.85 0 00-.29-1.4l-2.8-1c-.074-.26-.15-.51-.23-.77l1.8-2.4a.85.85 0 00-.56-1.4l-2.9-.44c-.12-.23-.24-.47-.37-.7l1.3-2.7a.85.85 0 00-.81-1.2l-3 .14c-.16-.2-.33-.4-.49-.6l.72-2.9a.85.85 0 00-1-1l-2.9.72c-.2-.17-.4-.33-.6-.49l.14-3a.85.85 0 00-1.2-.81l-2.7 1.3c-.23-.13-.46-.25-.7-.37l-.44-2.9a.85.85 0 00-1.4-.56l-2.4 1.8c-.25-.081-.51-.16-.77-.23l-1-2.8a.85.85 0 00-1.4-.29l-2 2.2c-.26-.03-.53-.054-.8-.076l-1.5-2.5a.85.85 0 00-1-.37zm.29 5.4a1.7 1.7 0 011.7 1.7 1.7 1.7 0 01-1.7 1.7 1.7 1.7 0 01-1.7-1.7 1.7 1.7 0 011.7-1.7zm-4 2.9 2.8 2.8a1.7 1.7 0 002.4 0l2.8-2.8c6.6 1.2 12 5.4 15 11l-1.8 3.6a1.7 1.7 0 00.75 2.3l3.6 1.8c.12.92.18 1.9.18 2.8 0 5.8-2.3 11-6 15l-4-.63a1.7 1.7 0 00-2 1.4l-.63 4c-2.8 1.3-6 2.1-9.4 2.1-3.4 0-6.5-.76-9.4-2.1l-.63-4a1.7 1.7 0 00-2-1.4l-4 .63c-3.7-3.9-6-9.2-6-15 0-.96.064-1.9.18-2.8l3.6-1.8a1.7 1.7 0 00.75-2.3l-1.8-3.6c3.1-5.7 8.6-9.8 15-11zm-18 13a1.7 1.7 0 01.48.083 1.7 1.7 0 011.1 2.2 1.7 1.7 0 01-2.2 1.1 1.7 1.7 0 01-1.1-2.2 1.7 1.7 0 011.7-1.2zm43 0a1.7 1.7 0 011.7 1.2 1.7 1.7 0 01-1.1 2.2 1.7 1.7 0 01-2.2-1.1 1.7 1.7 0 011.1-2.2 1.7 1.7 0 01.48-.083zm-35 25a1.7 1.7 0 01.91.32 1.7 1.7 0 01.38 2.4 1.7 1.7 0 01-2.4.38 1.7 1.7 0 01-.38-2.4 1.7 1.7 0 011.5-.7zm27 0a1.7 1.7 0 011.5.7 1.7 1.7 0 01-.38 2.4 1.7 1.7 0 01-2.4-.38 1.7 1.7 0 01.38-2.4 1.7 1.7 0 01.91-.32z"/>
</svg>
`;var gp=i(8168);const vp=()=>["/"];function fp(e,t){if(1&e&&(B.j41(0,"a",1),B.nrm(1,"bit-svg",3),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("routerLink",B.lJ4(5,vp)),B.R7$(),B.Y8G("content",e.logo)("ariaLabel",B.bMT(2,3,"appLogoLabel"))}}class mp{constructor(){this.hideLogo=(0,r.hFB)(!1),this.logo=pp}}mp.ɵfac=function(e){return new(e||mp)},mp.ɵcmp=B.VBU({type:mp,selectors:[["bit-landing-header"]],inputs:{hideLogo:[1,"hideLogo"]},ngContentSelectors:["*"],decls:4,vars:1,consts:[[1,"tw-flex","tw-w-full","tw-bg-background-alt","tw-px-5"],[1,"tw-w-32","tw-py-5","sm:tw-w-[200px]","tw-self-center","sm:tw-self-start","tw-block","[&>*]:tw-align-top",3,"routerLink"],[1,"[&:has(*)]:tw-ms-auto","[&:has(*)]:tw-py-5"],[3,"content","ariaLabel"]],template:function(e,t){1&e&&(B.NAR(),B.j41(0,"header",0),B.nVh(1,fp,3,6,"a",1),B.j41(2,"div",2),B.SdG(3),B.k0s()()),2&e&&(B.R7$(),B.vxM(t.hideLogo()?-1:1))},dependencies:[BA.iI,BA.Wk,RA.Z,gp.k,Zu.$Z],encapsulation:2,changeDetection:0});class yp{}yp.ɵfac=function(e){return new(e||yp)},yp.ɵmod=B.$C({type:yp}),yp.ɵinj=E.G2t({imports:[mp]});const Cp=VA.JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 501 226"><g clip-path="url(#left-bg-illustration-clip)"><path class="tw-fill-illustration-bg-primary" d="M-71.691 6.821a4 4 0 0 1 4-4h296.5a4 4 0 0 1 4 4v188a4 4 0 0 1-4 4h-296.5a4 4 0 0 1-4-4v-188Z"/><path class="tw-fill-illustration-bg-primary" d="M-48.941 25.821a2 2 0 0 1 2-2h127.5v154h-127.5a2 2 0 0 1-2-2v-150Z"/><path class="tw-fill-illustration-bg-tertiary" d="M80.559 25.82a2 2 0 0 1 2-2h125.5a2 2 0 0 1 2 2v150.001a2 2 0 0 1-2 2h-125.5a2 2 0 0 1-2-2v-150ZM45.871 89.854c0 17.155-13.96 31.062-31.182 31.062-17.221 0-31.182-13.907-31.182-31.062s13.96-31.062 31.182-31.062c17.221 0 31.182 13.907 31.182 31.062Z"/><path class="tw-fill-illustration-bg-tertiary" d="M72.396 153.443a57.243 57.243 0 0 1 4.663 22.604v1.222a2 2 0 0 1-2 2h-118.5a2 2 0 0 1-2-2v-1.222a57.243 57.243 0 0 1 4.662-22.604c3.078-7.167 7.59-13.678 13.277-19.163 5.688-5.485 12.44-9.836 19.871-12.805a63.228 63.228 0 0 1 23.44-4.496 63.227 63.227 0 0 1 23.439 4.496c7.431 2.969 14.183 7.32 19.87 12.805 5.688 5.485 10.2 11.996 13.278 19.163Z"/><path class="tw-fill-illustration-bg-secondary" d="M161.629 57.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625 0-9.181 7.579-16.625 16.928-16.625 9.348 0 16.927 7.444 16.927 16.625Z"/><path class="tw-fill-illustration-bg-secondary" d="M176.028 89.071a29.33 29.33 0 0 1 2.531 11.894c0 .937-.759 1.696-1.696 1.696h-63.109a1.695 1.695 0 0 1-1.695-1.696c0-4.081.86-8.123 2.531-11.894 1.671-3.77 4.12-7.197 7.207-10.083 3.088-2.886 6.753-5.176 10.787-6.738a35.275 35.275 0 0 1 12.725-2.366c4.366 0 8.69.804 12.724 2.366 4.034 1.562 7.699 3.852 10.787 6.738 3.087 2.886 5.537 6.312 7.208 10.083ZM161.629 134.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625s7.579-16.625 16.928-16.625c9.348 0 16.927 7.443 16.927 16.625Z"/><path class="tw-fill-illustration-bg-secondary" d="M176.028 165.953a28.993 28.993 0 0 1 2.531 11.821c0 .93-.755 1.684-1.685 1.684h-63.131c-.93 0-1.684-.754-1.684-1.684 0-4.057.86-8.074 2.531-11.821 1.671-3.748 4.12-7.153 7.207-10.021 3.088-2.869 6.753-5.144 10.787-6.696a35.456 35.456 0 0 1 12.725-2.352c4.366 0 8.69.799 12.724 2.352 4.034 1.552 7.699 3.827 10.787 6.696 3.087 2.868 5.537 6.273 7.208 10.021ZM-87.441 199.521h332.5v14.5c0 5.523-4.478 10-10 10h-312.5c-5.523 0-10-4.477-10-10v-14.5Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M208.059 21.82a4 4 0 0 1 4 4v150.001a4 4 0 0 1-4 4l-255 .001a4 4 0 0 1-4-4v-150a4 4 0 0 1 4-4l255-.001Zm-255 154.002h1.5a57.23 57.23 0 0 1 4.378-21.706l.284-.673c2.982-6.943 7.31-13.27 12.748-18.646l.529-.517c5.688-5.485 12.44-9.836 19.871-12.805a62.937 62.937 0 0 1 10.036-3.065c-11.113-4.751-18.897-15.747-18.897-28.556 0-17.155 13.96-31.061 31.182-31.062 17.22 0 31.18 13.907 31.181 31.062 0 12.537-7.457 23.338-18.192 28.245a62.952 62.952 0 0 1 11.569 3.376c7.431 2.969 14.184 7.32 19.871 12.805 5.688 5.485 10.2 11.996 13.278 19.163a57.251 57.251 0 0 1 4.66 22.379h1.502v-150h-125.5v150Zm129.5-.001h29.568a29.02 29.02 0 0 1 2.159-9.161l.304-.706c1.671-3.748 4.12-7.154 7.207-10.022 2.894-2.689 6.297-4.857 10.035-6.396l.752-.299c.996-.383 2.01-.721 3.037-1.012-4.602-2.879-7.693-7.881-7.841-13.602l-.006-.429c0-9.182 7.579-16.625 16.928-16.625l.437.006c9.146.227 16.49 7.581 16.49 16.619l-.006.429c-.144 5.571-3.08 10.461-7.484 13.372 1.321.338 2.622.752 3.894 1.242 4.034 1.552 7.7 3.827 10.787 6.695 3.088 2.868 5.536 6.274 7.207 10.022a29.066 29.066 0 0 1 2.462 9.867h29.57v-73h-125.5v73Zm62.75-24.936c-3.881 0-7.718.71-11.288 2.084-3.571 1.374-6.797 3.382-9.501 5.894-2.704 2.511-4.831 5.478-6.277 8.72a25.125 25.125 0 0 0-2.074 7.876h58.279a25.125 25.125 0 0 0-2.074-7.876c-1.445-3.242-3.573-6.209-6.276-8.72-2.705-2.512-5.931-4.52-9.501-5.894a31.473 31.473 0 0 0-11.288-2.084Zm-129.5-29.906a59.215 59.215 0 0 0-21.955 4.211c-6.957 2.779-13.269 6.848-18.579 11.969-5.31 5.12-9.513 11.191-12.378 17.862a53.266 53.266 0 0 0-4.332 20.248H73.053a53.266 53.266 0 0 0-4.332-20.248c-2.866-6.671-7.07-12.742-12.38-17.862-5.31-5.121-11.621-9.19-18.577-11.969a59.215 59.215 0 0 0-21.955-4.211Zm128.893.59c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625ZM14.69 62.792c-15.027 0-27.182 12.13-27.182 27.062 0 14.931 12.155 27.062 27.181 27.063 15.027-.001 27.182-12.132 27.182-27.063S29.716 62.793 14.69 62.792Zm67.869 36.029h29.579c.229-3.094.952-6.141 2.148-9.04l.304-.71a30.936 30.936 0 0 1 6.636-9.536l.571-.547a33.416 33.416 0 0 1 10.035-6.437l.752-.3a34.78 34.78 0 0 1 3.047-1.021c-4.607-2.878-7.703-7.883-7.851-13.607l-.006-.43c0-9.18 7.579-16.624 16.928-16.624l.437.006c9.146.227 16.49 7.58 16.49 16.619l-.006.429c-.144 5.574-3.082 10.465-7.49 13.376 1.324.34 2.626.758 3.9 1.252 4.034 1.561 7.7 3.85 10.787 6.737 3.088 2.886 5.536 6.312 7.207 10.083a29.407 29.407 0 0 1 2.451 9.75h29.581v-73h-125.5v73Zm62.75-24.937c-3.878 0-7.712.714-11.281 2.096-3.568 1.382-6.795 3.401-9.5 5.93-2.704 2.528-4.833 5.515-6.281 8.782a25.432 25.432 0 0 0-2.08 7.969h58.283a25.432 25.432 0 0 0-2.08-7.97c-1.447-3.266-3.577-6.253-6.281-8.781-2.705-2.529-5.931-4.548-9.5-5.93a31.275 31.275 0 0 0-11.28-2.096Zm-.607-29.315c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625Z" clip-rule="evenodd"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M228.809.822a6 6 0 0 1 6 6v188a5.97 5.97 0 0 1-.643 2.699h12.893v16.5c0 6.627-5.373 12-12 12h-312.5c-6.628 0-12-5.373-12-12v-16.5h16.391a5.966 5.966 0 0 1-.634-2.391l-.007-.308v-188a6 6 0 0 1 6-6h296.5ZM-85.441 214.02a8 8 0 0 0 8 8h312.5a8 8 0 0 0 8-8v-12.5h-328.5v12.5Zm17.75-209.2a2 2 0 0 0-2 2v188.001l.01.204a2 2 0 0 0 1.99 1.796h296.5a2.001 2.001 0 0 0 2-2v-188a2 2 0 0 0-2-2h-296.5Z" clip-rule="evenodd"/><path class="tw-fill-illustration-bg-primary" d="M378.821 114.003a1.997 1.997 0 0 0-.675 1.497v8.396c0 .583.254 1.136.697 1.515l11.455 9.825a2 2 0 0 1 .543 2.286l-4.203 10.056a1.998 1.998 0 0 1-1.936 1.224l-15.288-.717a1.997 1.997 0 0 0-1.501.579l-6.014 5.979a1.995 1.995 0 0 0-.583 1.569l1.145 14.942a1.997 1.997 0 0 1-1.22 1.995l-9.958 4.169a1.997 1.997 0 0 1-2.252-.503l-10.221-11.309a1.998 1.998 0 0 0-1.482-.658h-8.474c-.579 0-1.129.252-1.508.689l-9.889 11.4a1.998 1.998 0 0 1-2.28.534l-9.969-4.174a1.998 1.998 0 0 1-1.224-1.937l.721-15.182a2 2 0 0 0-.587-1.51l-6.014-5.98a1.996 1.996 0 0 0-1.559-.575l-15.049 1.14a1.997 1.997 0 0 1-1.993-1.221l-4.198-10.045a1.997 1.997 0 0 1 .512-2.258l11.363-10.155c.424-.379.666-.92.666-1.489v-8.403c0-.583-.254-1.136-.696-1.516l-11.456-9.824a1.997 1.997 0 0 1-.542-2.286L279.354 92a1.998 1.998 0 0 1 1.936-1.224l15.288.717a1.998 1.998 0 0 0 1.502-.579l6.007-5.974c.418-.415.631-.995.582-1.582l-1.292-15.419a1.995 1.995 0 0 1 1.218-2.008l9.942-4.163a1.996 1.996 0 0 1 2.258.51l10.552 11.786c.379.423.92.665 1.488.665h8.469c.579 0 1.129-.25 1.508-.688l9.889-11.4a1.996 1.996 0 0 1 2.279-.534l9.97 4.174a1.999 1.999 0 0 1 1.224 1.937l-.721 15.181a2 2 0 0 0 .587 1.51l6.014 5.98c.411.41.98.62 1.558.576l15.049-1.14a1.996 1.996 0 0 1 1.993 1.22l4.195 10.036c.33.79.12 1.702-.521 2.268l-11.507 10.154Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M313.765 59.926a3.994 3.994 0 0 1 4.518 1.02l10.552 11.786h8.469l9.888-11.4a3.994 3.994 0 0 1 4.559-1.067l9.97 4.174a3.994 3.994 0 0 1 2.447 3.873l-.72 15.182 6.013 5.98 15.049-1.14a3.995 3.995 0 0 1 3.987 2.442l4.194 10.035a3.992 3.992 0 0 1-1.042 4.534L380.142 115.5v8.396l11.456 9.824a3.995 3.995 0 0 1 1.085 4.571l-4.203 10.056a3.993 3.993 0 0 1-3.872 2.449l-15.288-.717-6.013 5.98 1.145 14.943a3.994 3.994 0 0 1-2.44 3.988l-9.958 4.169a3.992 3.992 0 0 1-4.505-1.005l-10.221-11.309h-8.474l-9.889 11.4a3.993 3.993 0 0 1-4.559 1.067l-9.97-4.174a3.993 3.993 0 0 1-2.446-3.873l.72-15.181-6.014-5.98-15.049 1.14a3.993 3.993 0 0 1-3.986-2.442l-4.198-10.045a3.993 3.993 0 0 1 1.023-4.517l11.363-10.155v-8.403l-11.455-9.825a3.992 3.992 0 0 1-1.085-4.571l4.203-10.056a3.993 3.993 0 0 1 3.872-2.45l15.287.718 6.008-5.974-1.292-15.418a3.992 3.992 0 0 1 2.437-4.017l9.941-4.163Zm1.543 3.684-9.942 4.162 1.292 15.419a3.992 3.992 0 0 1-1.163 3.165l-6.008 5.974a3.994 3.994 0 0 1-3.003 1.157l-15.288-.717-4.202 10.056 11.455 9.824a3.993 3.993 0 0 1 1.394 3.032v8.403c0 1.137-.485 2.22-1.332 2.978l-11.364 10.154 4.198 10.045 15.049-1.14a3.994 3.994 0 0 1 3.118 1.15l6.014 5.98a3.996 3.996 0 0 1 1.173 3.021l-.72 15.181 9.969 4.175 9.889-11.401a3.994 3.994 0 0 1 3.017-1.377h8.474c1.129 0 2.206.478 2.963 1.316l10.221 11.309 9.958-4.169-1.145-14.943a3.996 3.996 0 0 1 1.166-3.137l6.013-5.979a3.997 3.997 0 0 1 3.003-1.158l15.288.717 4.203-10.056-11.456-9.824a3.995 3.995 0 0 1-1.393-3.031V115.5c0-1.146.492-2.236 1.351-2.994l11.506-10.155-4.194-10.035-15.049 1.14a3.991 3.991 0 0 1-3.117-1.15l-6.014-5.98a3.99 3.99 0 0 1-1.173-3.022l.72-15.181-9.97-4.174-9.889 11.4a3.992 3.992 0 0 1-3.016 1.377h-8.469a3.992 3.992 0 0 1-2.975-1.33L315.308 63.61Z" clip-rule="evenodd"/><path class="tw-fill-illustration-logo" d="M353.438 119.624c0 11.289-9.152 20.441-20.442 20.441-11.289 0-20.441-9.152-20.441-20.441 0-11.29 9.152-20.442 20.441-20.442 11.29 0 20.442 9.152 20.442 20.442Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M332.996 101.179c-10.186 0-18.444 8.258-18.444 18.444 0 10.187 8.258 18.445 18.444 18.445 10.187 0 18.445-8.258 18.445-18.445 0-10.186-8.258-18.444-18.445-18.444Zm-22.438 18.444c0-12.392 10.046-22.438 22.438-22.438 12.393 0 22.439 10.046 22.439 22.438 0 12.393-10.046 22.439-22.439 22.439-12.392 0-22.438-10.046-22.438-22.439Z" clip-rule="evenodd"/><path class="tw-fill-illustration-bg-tertiary" d="m497.152 164.106-7.588-7.587a3.004 3.004 0 0 0-4.245-.003l-4.055 4.047 11.83 11.83 4.055-4.047a2.996 2.996 0 0 0 .003-4.24Z"/><path class="tw-fill-illustration-bg-secondary" d="M500.922 194.274c0 22.644-18.356 41-41 41s-41-18.356-41-41 18.356-41 41-41 41 18.356 41 41Z"/><path class="tw-fill-illustration-outline" d="M459.03 177.416a2 2 0 1 1 4 0v18.469c0 .613-.282 1.192-.763 1.571l-12.032 9.48a2.001 2.001 0 0 1-2.809-.333 2.002 2.002 0 0 1 .334-2.809l11.27-8.881v-17.497Z"/><path class="tw-fill-illustration-bg-tertiary" d="M450.936 144.041a2 2 0 0 1 2-2h13.972a2 2 0 0 1 2 2v3.863a2 2 0 0 1-2 2h-13.972a2 2 0 0 1-2-2v-3.863Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M467.114 140.046a4 4 0 0 1 3.794 3.995v3.863a3.999 3.999 0 0 1-3.931 3.998v1.978a40.72 40.72 0 0 1 13.484 4.903l3.69-3.68a5.008 5.008 0 0 1 7.076.003l7.587 7.588.177.186a4.994 4.994 0 0 1-.181 6.881l-3.615 3.606a40.801 40.801 0 0 1 5.727 20.907c0 22.644-18.357 41-41 41-22.644 0-41-18.356-41-41 0-20.434 14.949-37.375 34.507-40.487v-1.883h-.493a4 4 0 0 1-4-4v-3.863a4 4 0 0 1 4-4h13.972l.206.005Zm-7.192 17.228c-20.435 0-37 16.566-37 37 0 20.435 16.565 37 37 37 20.434 0 37-16.565 37-37 0-20.434-16.566-37-37-37Zm28.473.658a1.002 1.002 0 0 0-1.416-.001l-2.638 2.633 9.001 9.002 2.639-2.633a1 1 0 0 0 .07-1.338l-.069-.075-7.587-7.588Zm-30.966-6.028v1.447a41.171 41.171 0 0 1 5.548.036v-1.483h-5.548Zm-4.493-4h13.972v-3.863h-13.972v3.863Z" clip-rule="evenodd"/></g><defs><clipPath id="left-bg-illustration-clip"><path class="tw-fill-illustration-bg-tertiary" d="M0 0h501v226H0z"/></clipPath></defs></svg>
`,wp=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 506 297">
    <g clip-path="url(#right-bg-illustration-clip)">
      <path class="tw-fill-illustration-bg-primary" d="M45.673 294.742v-29.124l22.323 16.198-15.395 15.75a4.04 4.04 0 0 1-6.928-2.824Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="m4.978 240.865 95.568-44.738c3.52-1.648 7.492 1.175 7.093 5.041l-9.608 93.173c-.395 3.823-4.774 5.79-7.893 3.547l-43.43-31.233-41.47-16.621c-4.06-1.627-4.221-7.315-.26-9.169Z"/>
      <path class="tw-fill-illustration-outline" d="M99.698 194.315c4.929-2.306 10.489 1.645 9.931 7.058l-9.608 93.174c-.552 5.351-6.683 8.105-11.05 4.965l-20.832-14.983-14.107 14.435a6.04 6.04 0 0 1-10.359-4.222v-27.151l-39.178-15.7c-5.684-2.278-5.91-10.242-.364-12.838l95.567-44.738Zm5.953 6.648c.239-2.32-2.144-4.013-4.256-3.025L5.827 242.676c-2.376 1.112-2.28 4.525.156 5.502l40.159 16.093 26.703-30.327a2.001 2.001 0 0 1 3.002 2.644l-26.178 29.731 41.637 29.945c1.872 1.346 4.5.165 4.736-2.128l9.609-93.173Zm-57.978 93.779a2.04 2.04 0 0 0 3.498 1.426l13.684-14.001-17.182-12.357v24.932Z"/>
      <circle cx="86.719" cy="86.719" r="84.719" class="tw-fill-illustration-bg-tertiary tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" transform="scale(-1 1) rotate(45.035 -184.565 -565.488)"/>
      <circle cx="69.752" cy="69.752" r="69.752" class="tw-fill-illustration-bg-secondary" transform="scale(-1 1) rotate(45.035 -213.255 -553.709)"/>
      <path class="tw-fill-illustration-outline" d="m445.838 353.214 2.95-180.467 12.372-.007 3.078 180.465a4.64 4.64 0 0 1-4.637 4.72l-9.12.005a4.64 4.64 0 0 1-4.643-4.716ZM453.82 52.947a2 2 0 0 1 1.998-2.001l35.638-.023a2 2 0 0 1 2.001 2.015l-.268 35.637a2 2 0 1 1-4-.03l.252-33.62-33.62.02a1.999 1.999 0 0 1-2.001-1.998ZM415.689 86.49a2 2 0 0 1 4.001.03l-.254 33.62 33.622-.021a2 2 0 0 1 .003 4l-35.637.022a2 2 0 0 1-2.001-2.015l.266-35.636Zm25.457-19.997a2 2 0 0 1 3.461-2.006l23.124 39.885a2 2 0 0 1-3.461 2.006l-23.124-39.885Z"/>
      <path class="tw-fill-illustration-bg-primary" d="M259.264 277.271c21.107-4.293 34.791-24.62 30.565-45.402-4.227-20.782-24.764-34.15-45.871-29.857-21.107 4.293-34.791 24.62-30.565 45.402 4.227 20.783 24.764 34.15 45.871 29.857ZM299.993 173.472c7.793-1.585 12.826-9.188 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.187-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-secondary" d="M329.869 242.094c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.188-12.826-16.981-11.241-7.794 1.585-12.827 9.188-11.241 16.981 1.585 7.794 9.187 12.827 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="M330.088 309.401c7.794-1.585 12.826-9.188 11.241-16.981-1.585-7.794-9.187-12.827-16.981-11.242-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.827 16.981 11.242Z"/>
      <path class="tw-fill-illustration-bg-primary" d="M234.598 327.597c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-secondary" d="M176.919 248.71c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.794-9.188-12.827-16.982-11.242-7.793 1.586-12.826 9.188-11.241 16.982 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="M206.836 185.071c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.793-9.188-12.826-16.982-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M200.699 154.89c8.875-1.805 17.533 3.927 19.339 12.803 1.165 5.732-.814 11.372-4.752 15.135.131.223.29.502.489.845l14.805 21.386a41.483 41.483 0 0 1 12.979-5.007c9.276-1.886 18.455-.523 26.321 3.303.038-.221.111-.441.227-.648l17.035-30.333a16.337 16.337 0 0 1-6.09-9.744c-1.805-8.876 3.928-17.535 12.803-19.34 8.876-1.805 17.534 3.928 19.339 12.803 1.805 8.876-3.926 17.534-12.802 19.339-3.427.697-6.822.27-9.803-1.028l-16.994 30.262a1.98 1.98 0 0 1-.397.497c8.774 5.316 15.487 13.883 18.16 24.43l19.238-1.61c-.007-7.642 5.356-14.488 13.135-16.07 8.875-1.805 17.534 3.927 19.339 12.803 1.805 8.875-3.927 17.533-12.802 19.339-8.639 1.757-17.072-3.627-19.18-12.099l-18.935 1.585c1.474 9.839-.81 19.465-5.834 27.387l29.108 22.962a16.324 16.324 0 0 1 8.523-4.671c8.876-1.804 17.534 3.928 19.339 12.803 1.805 8.876-3.927 17.534-12.802 19.339-8.875 1.805-17.534-3.926-19.34-12.802a16.338 16.338 0 0 1 1.872-11.474l-29.007-22.882c-5.828 7.464-14.29 12.983-24.349 15.028a41.442 41.442 0 0 1-14.045.441l-6.224 19.317a16.365 16.365 0 0 1 8.405 11.229c1.805 8.876-3.927 17.534-12.802 19.339-8.876 1.805-17.535-3.926-19.34-12.802-1.805-8.875 3.927-17.534 12.803-19.34 2.461-.5 4.906-.42 7.192.145l6.007-18.641c-14.851-3.594-27.011-15.301-30.225-31.105a40.043 40.043 0 0 1-.808-8.184l-20.473-1.442c-.032-.002-.064-.008-.096-.011-1.37 6.114-6.201 11.162-12.739 12.492-8.875 1.805-17.534-3.926-19.339-12.802-1.805-8.875 3.927-17.534 12.802-19.34 8.876-1.804 17.534 3.928 19.339 12.803.196.962.302 1.921.327 2.869l20.401 1.436c1.206-11.333 7.247-21.627 16.399-28.363l-14.76-21.321a20.41 20.41 0 0 0-.435-.719 16.428 16.428 0 0 1-4.816 1.8c-8.876 1.805-17.535-3.927-19.34-12.802-1.805-8.876 3.927-17.535 12.803-19.34Zm124.048 128.249c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.364-6.71-7.911-11.044-14.622-9.68Zm-95.49 18.196c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.621-1.365-6.711-7.911-11.045-14.622-9.681Zm15.1-97.363c-20.054 4.079-33.004 23.373-29.004 43.044 4.001 19.672 23.459 32.374 43.513 28.296 9.593-1.951 17.558-7.386 22.822-14.676a1.986 1.986 0 0 1 .612-.873c5.306-7.813 7.58-17.606 5.569-27.495-4.001-19.671-23.459-32.374-43.512-28.296Zm80.171 11.861c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.365-6.711-7.911-11.045-14.622-9.68Zm-152.949 6.614c-6.711 1.365-11.045 7.912-9.681 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.621-1.365-6.711-7.912-11.045-14.622-9.681Zm123.073-75.237c-6.71 1.365-11.044 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.622-1.365-6.71-7.912-11.045-14.623-9.68Zm-93.156 11.6c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.622 9.679 6.711-1.365 11.044-7.912 9.68-14.622-1.365-6.711-7.911-11.045-14.622-9.68Z" clip-rule="evenodd"/>
      <path class="tw-fill-illustration-logo" d="M272.266 232.544a1.998 1.998 0 0 0-.353 1.589l.554 2.725a2.002 2.002 0 0 0 1.002 1.357l4.786 2.611a2 2 0 0 1 1.003 2.15l-.667 3.313a1.998 1.998 0 0 1-1.647 1.58l-5.641.896a1.998 1.998 0 0 0-1.352.867l-1.524 2.291a2 2 0 0 0-.252 1.678l1.555 5.227a2 2 0 0 1-.794 2.224l-2.799 1.902a2 2 0 0 1-2.309-.043l-4.524-3.327a2 2 0 0 0-1.583-.348l-2.754.56a1.997 1.997 0 0 0-1.352.994l-2.638 4.785a2 2 0 0 1-2.14.996l-3.339-.661a2 2 0 0 1-1.587-1.649l-.886-5.597a2.003 2.003 0 0 0-.875-1.358l-2.298-1.514a2 2 0 0 0-1.669-.247l-5.272 1.563a2 2 0 0 1-2.22-.788l-1.897-2.774a2.001 2.001 0 0 1 .045-2.321l3.339-4.498a2.004 2.004 0 0 0 .354-1.591l-.557-2.736a2.001 2.001 0 0 0-.983-1.347l-4.848-2.715a2 2 0 0 1-.983-2.14l.669-3.329a2.001 2.001 0 0 1 1.648-1.581l5.641-.895a1.999 1.999 0 0 0 1.352-.868l1.526-2.293c.327-.493.42-1.105.253-1.673l-1.608-5.457a2 2 0 0 1 .794-2.22l2.793-1.897a2 2 0 0 1 2.322.053l4.676 3.5a1.999 1.999 0 0 0 1.597.359l2.744-.558a2.002 2.002 0 0 0 1.353-.995l2.637-4.784a1.997 1.997 0 0 1 2.14-.996l3.339.661a2 2 0 0 1 1.587 1.649l.886 5.597c.088.555.406 1.048.875 1.357l2.298 1.514a2.002 2.002 0 0 0 1.669.248l5.272-1.564a2 2 0 0 1 2.22.789l1.898 2.775a2 2 0 0 1-.044 2.319l-3.432 4.635Zm-24.977-.064c-4.049 2.702-5.078 8.076-2.395 11.991 2.705 4.028 8.1 5.044 12.035 2.365 3.936-2.678 5.078-8.076 2.395-11.991-2.592-4.051-7.986-5.067-12.035-2.365Z"/>
      <path class="tw-fill-illustration-outline" d="m270.507 237.256-.554-2.724a4.004 4.004 0 0 1 .705-3.178l3.433-4.636-1.897-2.775-5.273 1.564a4 4 0 0 1-3.337-.494l-2.298-1.515a4 4 0 0 1-1.751-2.714l-.886-5.597-3.339-.661-2.637 4.784a4.001 4.001 0 0 1-2.706 1.989l-2.744.558a4 4 0 0 1-3.194-.718l-4.676-3.5-2.792 1.898 1.608 5.457a3.998 3.998 0 0 1-.507 3.345l-1.525 2.294c-.62.931-1.6 1.56-2.704 1.736l-5.642.895-.669 3.329 4.848 2.715a4 4 0 0 1 1.965 2.693l.557 2.737a3.999 3.999 0 0 1-.708 3.18l-3.338 4.499 1.897 2.774 5.272-1.563a3.998 3.998 0 0 1 3.338.494l2.298 1.514a4.001 4.001 0 0 1 1.75 2.715l.886 5.597 3.339.661 2.638-4.785a4 4 0 0 1 2.706-1.988l2.753-.56a4 4 0 0 1 3.166.697l4.524 3.327 2.8-1.902-1.555-5.227a4.002 4.002 0 0 1 .504-3.355l1.524-2.291a3.998 3.998 0 0 1 2.703-1.736l5.642-.895.667-3.313-4.787-2.611a4.004 4.004 0 0 1-2.004-2.714Zm-24.328-6.439c4.915-3.28 11.556-2.099 14.795 2.898h.001v.001l.034.051h-.001c3.294 4.868 1.835 11.464-2.953 14.723-4.855 3.304-11.499 2.043-14.821-2.903l.001-.001c-3.308-4.845-2.013-11.461 2.944-14.769Zm11.461 5.106c-1.959-3.06-6.075-3.891-9.24-1.779-3.036 2.026-3.85 5.957-2.039 8.913l.183.284.01.015c2.089 3.109 6.234 3.879 9.25 1.827 3.066-2.087 3.897-6.25 1.871-9.207a.97.97 0 0 1-.035-.053Zm16.787.536 4.787 2.611a4 4 0 0 1 2.005 4.3l-.666 3.313a4.001 4.001 0 0 1-3.295 3.161l-5.641.896-1.525 2.291 1.555 5.227a4.002 4.002 0 0 1-1.586 4.449l-2.8 1.901a4 4 0 0 1-4.618-.086l-4.523-3.326-2.753.56-2.638 4.784a4 4 0 0 1-4.279 1.993l-3.34-.661a4.002 4.002 0 0 1-3.174-3.298l-.886-5.598-2.298-1.514-5.273 1.564a3.999 3.999 0 0 1-4.438-1.577l-1.897-2.774a3.998 3.998 0 0 1 .09-4.641l3.338-4.499-.557-2.737-4.848-2.715a3.998 3.998 0 0 1-1.966-4.279l.669-3.329a4.002 4.002 0 0 1 3.294-3.162l5.642-.895 1.526-2.294-1.609-5.457a4.001 4.001 0 0 1 1.59-4.439l2.792-1.897a4 4 0 0 1 4.645.106l4.676 3.5 2.744-.558 2.636-4.785a4 4 0 0 1 4.281-1.992l3.339.661a4 4 0 0 1 3.174 3.298l.886 5.597 2.298 1.514 5.272-1.563a4 4 0 0 1 4.439 1.576l1.898 2.775a4.001 4.001 0 0 1-.087 4.639l-3.433 4.636.554 2.724Z"/>
    </g>
    <defs>
      <clipPath id="right-bg-illustration-clip">
        <path class="tw-fill-illustration-bg-tertiary" d="M0 0h506v297H0z"/>
      </clipPath>
    </defs>
  </svg>
`,Ip=[[["bit-landing-header"]],"*",[["bit-landing-footer"]]],bp=(e,t)=>({"tw-min-h-screen":e,"tw-min-h-full":t});function Bp(e,t){if(1&e&&(B.j41(0,"div",2),B.nrm(1,"bit-svg",3),B.k0s(),B.j41(2,"div",4),B.nrm(3,"bit-svg",3),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.Y8G("content",e.leftIllustration),B.R7$(2),B.Y8G("content",e.rightIllustration)}}class Ep{constructor(){this.hideBackgroundIllustration=(0,r.hFB)(!1),this.leftIllustration=Cp,this.rightIllustration=wp,this.platformUtilsService=(0,E.WQX)(V.y),this.clientType=this.platformUtilsService.getClientType()}}function Sp(e,t){if(1&e&&(B.j41(0,"div",1),B.nrm(1,"bit-svg",3),B.k0s()),2&e){const e=B.XpG(2);B.R7$(),B.Y8G("content",e.icon())}}function Qp(e,t){if(1&e&&(B.j41(0,"h1",4),B.EFF(1),B.k0s(),B.j41(2,"h1",5),B.EFF(3),B.k0s()),2&e){const e=B.XpG(2);B.R7$(),B.SpI(" ",e.title()," "),B.R7$(2),B.SpI(" ",e.title()," ")}}function kp(e,t){if(1&e&&(B.j41(0,"div",2),B.EFF(1),B.k0s()),2&e){const e=B.XpG(2);B.R7$(),B.JRh(e.subtitle())}}function Tp(e,t){if(1&e&&(B.j41(0,"div",0),B.nVh(1,Sp,2,1,"div",1),B.nVh(2,Qp,4,2),B.nVh(3,kp,2,1,"div",2),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.vxM(e.icon()?1:-1),B.R7$(),B.vxM(e.title()?2:-1),B.R7$(),B.vxM(e.subtitle()?3:-1)}}Ep.ɵfac=function(e){return new(e||Ep)},Ep.ɵcmp=B.VBU({type:Ep,selectors:[["bit-landing-layout"]],inputs:{hideBackgroundIllustration:[1,"hideBackgroundIllustration"]},ngContentSelectors:["bit-landing-header","*","bit-landing-footer"],decls:6,vars:6,consts:[[1,"tw-relative","tw-flex","tw-size-full","tw-mx-auto","tw-flex-col"],[1,"tw-relative","tw-flex","tw-flex-1","tw-size-full","tw-mx-auto","tw-flex-col"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-start-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],[3,"content"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-end-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"]],template:function(e,t){1&e&&(B.NAR(Ip),B.j41(0,"div",0),B.SdG(1),B.j41(2,"main",1),B.SdG(3,1),B.k0s(),B.nVh(4,Bp,4,2),B.SdG(5,2),B.k0s()),2&e&&(B.HbH(B.l_i(3,bp,"web"===t.clientType,"browser"===t.clientType||"desktop"===t.clientType)),B.R7$(4),B.vxM(t.hideBackgroundIllustration()?-1:4))},dependencies:[RA.Z,gp.k],encapsulation:2,changeDetection:0});class Fp{constructor(){this.icon=(0,r.hFB)(null),this.title=(0,r.hFB)(),this.subtitle=(0,r.hFB)()}}Fp.ɵfac=function(e){return new(e||Fp)},Fp.ɵcmp=B.VBU({type:Fp,selectors:[["bit-landing-hero"]],inputs:{icon:[1,"icon"],title:[1,"title"],subtitle:[1,"subtitle"]},decls:1,vars:1,consts:[[1,"tw-text-center","tw-mb-4","sm:tw-mb-6","tw-mx-auto"],[1,"tw-size-20","sm:tw-size-24","[&_svg]:tw-w-full","[&_svg]:tw-max-w-24","tw-mx-auto","tw-content-center"],[1,"tw-text-sm","sm:tw-text-base"],[3,"content"],["bitTypography","h2",1,"tw-mt-2","sm:tw-hidden"],["bitTypography","h1",1,"tw-mt-2","tw-hidden","sm:tw-block"]],template:function(e,t){1&e&&B.nVh(0,Tp,4,3,"div",0),2&e&&B.vxM(t.icon()||t.title()||t.subtitle()?0:-1)},dependencies:[RA.Z,gp.k,DA.E,MA.r],encapsulation:2,changeDetection:0});class Pp{}Pp.ɵfac=function(e){return new(e||Pp)},Pp.ɵcmp=B.VBU({type:Pp,selectors:[["bit-landing-footer"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-bg-background-alt","tw-text-center","tw-p-5","tw-pt-4","sm:tw-pt-6"]],template:function(e,t){1&e&&(B.NAR(),B.rj2(0,"footer",0),B.SdG(1),B.eux())},encapsulation:2,changeDetection:0});var Rp=i(33277);const Dp=[[["bit-landing-hero"]],"*"];class Mp{constructor(){this.maxWidth=(0,r.hFB)("md"),this.maxWidthClassMap={md:"tw-max-w-md",lg:"tw-max-w-lg",xl:"tw-max-w-xl","2xl":"tw-max-w-2xl","3xl":"tw-max-w-3xl","4xl":"tw-max-w-4xl"},this.maxWidthClasses=(0,Rp.EW)(()=>`tw-flex tw-flex-col tw-w-full ${this.maxWidthClassMap[this.maxWidth()]}`)}}Mp.ɵfac=function(e){return new(e||Mp)},Mp.ɵcmp=B.VBU({type:Mp,selectors:[["bit-landing-content"]],hostAttrs:[1,"tw-grow","tw-flex","tw-flex-col"],inputs:{maxWidth:[1,"maxWidth"]},ngContentSelectors:["bit-landing-hero","*"],decls:4,vars:2,consts:[[1,"tw-flex","tw-flex-col","tw-flex-1","tw-items-center","tw-bg-background-alt","tw-p-5","tw-pt-12","tw-text-main"]],template:function(e,t){1&e&&(B.NAR(Dp),B.rj2(0,"div",0)(1,"div"),B.SdG(2),B.SdG(3,1),B.eux()()),2&e&&(B.R7$(),B.HbH(t.maxWidthClasses()))},encapsulation:2,changeDetection:0});var xp=i(67379);class Op{}Op.ɵfac=function(e){return new(e||Op)},Op.ɵcmp=B.VBU({type:Op,selectors:[["bit-landing-card"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-z-[2]","tw-relative","!tw-rounded-2xl","tw-mb-6","sm:tw-mb-10","tw-mx-auto","tw-w-full","tw-bg-transparent","tw-border-none","tw-shadow-none","sm:tw-bg-background","sm:tw-border","sm:tw-border-solid","sm:tw-border-secondary-100","sm:tw-shadow","sm:tw-p-8"]],template:function(e,t){1&e&&(B.NAR(),B.j41(0,"bit-base-card",0),B.SdG(1),B.k0s())},dependencies:[xp.f],encapsulation:2,changeDetection:0});var Gp=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Up=[[["","slot","header-actions"]],[["","slot","secondary"]],[["","slot","environment-selector"]],"*"];function Vp(e,t){1&e&&B.eu8(0)}function jp(e,t){if(1&e&&(B.j41(0,"div",5),B.DNE(1,Vp,1,0,"ng-container",7),B.k0s()),2&e){B.XpG();const e=B.sdS(11);B.R7$(),B.Y8G("ngTemplateOutlet",e)}}function Np(e,t){1&e&&B.eu8(0)}function zp(e,t){if(1&e&&(B.j41(0,"bit-landing-card"),B.DNE(1,Np,1,0,"ng-container",7),B.k0s()),2&e){B.XpG();const e=B.sdS(11);B.R7$(),B.Y8G("ngTemplateOutlet",e)}}function Yp(e,t){if(1&e&&(B.j41(0,"div",8),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG(2);B.R7$(),B.Lme("",B.bMT(2,2,"accessing")," ",e.hostname)}}function Lp(e,t){1&e&&B.SdG(0,2)}function Kp(e,t){if(1&e&&(B.j41(0,"div",8),B.EFF(1,"Vaultwarden Web"),B.k0s(),B.j41(2,"div",8),B.EFF(3),B.k0s(),B.nrm(4,"br"),B.j41(5,"div",9),B.EFF(6," A modified version of the Bitwarden® Web Vault for Vaultwarden (an unofficial rewrite of the Bitwarden® server)."),B.nrm(7,"br"),B.EFF(8," Vaultwarden is not associated with the Bitwarden® project nor Bitwarden Inc. "),B.k0s()),2&e){const e=B.XpG(2);B.R7$(3),B.JRh(e.version)}}function Xp(e,t){if(1&e&&(B.j41(0,"bit-landing-footer"),B.nVh(1,Yp,3,4,"div",8)(2,Lp,1,0),B.nVh(3,Kp,9,1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.vxM(e.showReadonlyHostname()?1:2),B.R7$(2),B.vxM(e.hideYearAndVersion?-1:3)}}function qp(e,t){1&e&&B.SdG(0,3)}class Hp{get classList(){return["tw-h-full"]}constructor(e,t){this.environmentService=e,this.platformUtilsService=t,this.title=(0,r.hFB)(),this.subtitle=(0,r.hFB)(),this.icon=r.geq.required(),this.showReadonlyHostname=(0,r.hFB)(!1),this.hideLogo=(0,r.hFB)(!1),this.hideFooter=(0,r.hFB)(!1),this.hideCardWrapper=(0,r.hFB)(!1),this.hideBackgroundIllustration=(0,r.hFB)(!1),this.maxWidth=(0,r.geq)("md"),this.logo=pp,this.hideYearAndVersion=!1,this.year=(new Date).getFullYear().toString(),this.clientType=this.platformUtilsService.getClientType(),this.hideYearAndVersion=this.clientType!==st.sK.Web}ngOnInit(){return Gp(this,void 0,void 0,function*(){var e;this.maxWidth.set(null!==(e=this.maxWidth())&&void 0!==e?e:"md"),this.hostname=(yield(0,u._)(this.environmentService.environment$)).getHostname(),this.version=yield this.platformUtilsService.getApplicationVersion()})}ngOnChanges(e){return Gp(this,void 0,void 0,function*(){var t;e.maxWidth&&this.maxWidth.set(null!==(t=e.maxWidth.currentValue)&&void 0!==t?t:"md")})}}Hp.ɵfac=function(e){return new(e||Hp)(B.rXU(Gs.v),B.rXU(V.y))},Hp.ɵcmp=B.VBU({type:Hp,selectors:[["auth-anon-layout"]],hostVars:2,hostBindings:function(e,t){2&e&&B.HbH(t.classList)},inputs:{title:[1,"title"],subtitle:[1,"subtitle"],icon:[1,"icon"],showReadonlyHostname:[1,"showReadonlyHostname"],hideLogo:[1,"hideLogo"],hideFooter:[1,"hideFooter"],hideCardWrapper:[1,"hideCardWrapper"],hideBackgroundIllustration:[1,"hideBackgroundIllustration"],maxWidth:[1,"maxWidth"]},outputs:{icon:"iconChange",maxWidth:"maxWidthChange"},features:[B.OA$],ngContentSelectors:["[slot=header-actions]","[slot=secondary]","[slot=environment-selector]","*"],decls:12,vars:8,consts:[["defaultContent",""],[3,"hideBackgroundIllustration"],[3,"hideLogo"],[3,"maxWidth"],[3,"icon","title","subtitle"],[1,"tw-mb-6","sm:tw-mb-10"],[1,"tw-flex","tw-flex-col","tw-items-center"],[4,"ngTemplateOutlet"],["bitTypography","body2"],["bitTypography","helper","id","vw-disclaimer"]],template:function(e,t){1&e&&(B.NAR(Up),B.j41(0,"bit-landing-layout",1)(1,"bit-landing-header",2),B.SdG(2),B.k0s(),B.j41(3,"bit-landing-content",3),B.nrm(4,"bit-landing-hero",4),B.nVh(5,jp,2,1,"div",5)(6,zp,2,1,"bit-landing-card"),B.j41(7,"div",6),B.SdG(8,1),B.k0s()(),B.nVh(9,Xp,4,2,"bit-landing-footer"),B.k0s(),B.DNE(10,qp,1,0,"ng-template",null,0,B.C5r)),2&e&&(B.Y8G("hideBackgroundIllustration",t.hideBackgroundIllustration()),B.R7$(),B.Y8G("hideLogo",t.hideLogo()),B.R7$(2),B.Y8G("maxWidth",t.maxWidth()),B.R7$(),B.Y8G("icon",t.icon())("title",t.title())("subtitle",t.subtitle()),B.R7$(),B.vxM(t.hideCardWrapper()?5:6),B.R7$(4),B.vxM(t.hideFooter()?-1:9))},dependencies:[H.MD,H.T3,RA.Z,DA.E,MA.r,BA.iI,yp,Ep,mp,Fp,Pp,Mp,Op,Zu.$Z],encapsulation:2});class Wp{constructor(e,t,i,n,r){this.router=e,this.route=t,this.i18nService=i,this.anonLayoutWrapperDataService=n,this.changeDetectorRef=r,this.destroy$=new d.B,this.pageIcon=null,this.destroyRef=(0,E.WQX)(E.abz)}ngOnInit(){var e;this.setAnonLayoutWrapperDataFromRouteData(null===(e=this.route.snapshot.firstChild)||void 0===e?void 0:e.data),this.listenForPageDataChanges(),this.listenForServiceDataChanges()}listenForPageDataChanges(){this.router.events.pipe((0,h.p)(e=>e instanceof F.wF),(0,M.M)(()=>this.resetPageData()),(0,rt.n)(()=>{var e;return(null===(e=this.route.firstChild)||void 0===e?void 0:e.data)||(0,Ii.of)(null)}),(0,c.pQ)(this.destroyRef)).subscribe(e=>{this.setAnonLayoutWrapperDataFromRouteData(e)})}setAnonLayoutWrapperDataFromRouteData(e){e&&(void 0!==e.pageTitle&&(this.pageTitle=this.handleStringOrTranslation(e.pageTitle)),void 0!==e.pageSubtitle&&(this.pageSubtitle=this.handleStringOrTranslation(e.pageSubtitle)),void 0!==e.pageIcon&&(this.pageIcon=e.pageIcon),this.showReadonlyHostname=Boolean(e.showReadonlyHostname),this.maxWidth=e.maxWidth,this.hideCardWrapper=Boolean(e.hideCardWrapper),this.hideBackgroundIllustration=Boolean(e.hideBackgroundIllustration))}listenForServiceDataChanges(){this.anonLayoutWrapperDataService.anonLayoutWrapperData$().pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.setAnonLayoutWrapperData(e)})}setAnonLayoutWrapperData(e){e&&(void 0!==e.pageTitle&&(this.pageTitle=null!==e.pageTitle?this.handleStringOrTranslation(e.pageTitle):null),void 0!==e.pageSubtitle&&(this.pageSubtitle=null!==e.pageSubtitle?this.handleStringOrTranslation(e.pageSubtitle):null),void 0!==e.pageIcon&&(this.pageIcon=null!==e.pageIcon?e.pageIcon:null),void 0!==e.showReadonlyHostname&&(this.showReadonlyHostname=e.showReadonlyHostname),void 0!==e.hideCardWrapper&&(this.hideCardWrapper=e.hideCardWrapper),void 0!==e.hideBackgroundIllustration&&(this.hideBackgroundIllustration=e.hideBackgroundIllustration),void 0!==e.maxWidth&&(this.maxWidth=e.maxWidth),this.changeDetectorRef.detectChanges())}handleStringOrTranslation(e){var t;return"string"==typeof e?e:this.i18nService.t(e.key,...null!==(t=e.placeholders)&&void 0!==t?t:[])}resetPageData(){this.pageTitle=null,this.pageSubtitle=null,this.pageIcon=null,this.showReadonlyHostname=null,this.maxWidth=null,this.hideCardWrapper=null,this.hideBackgroundIllustration=null}}Wp.ɵfac=function(e){return new(e||Wp)(B.rXU(F.Ix),B.rXU(F.nX),B.rXU(U.W),B.rXU(Fd.f),B.rXU(r.gRc))},Wp.ɵcmp=B.VBU({type:Wp,selectors:[["ng-component"]],decls:5,vars:7,consts:[[3,"title","subtitle","icon","showReadonlyHostname","maxWidth","hideCardWrapper","hideBackgroundIllustration"],["slot","header-actions","name","header-actions"],["slot","secondary","name","secondary"],["slot","environment-selector","name","environment-selector"]],template:function(e,t){1&e&&(B.j41(0,"auth-anon-layout",0),B.nrm(1,"router-outlet",1)(2,"router-outlet")(3,"router-outlet",2)(4,"router-outlet",3),B.k0s()),2&e&&B.Y8G("title",t.pageTitle)("subtitle",t.pageSubtitle)("icon",t.pageIcon)("showReadonlyHostname",t.showReadonlyHostname)("maxWidth",t.maxWidth)("hideCardWrapper",t.hideCardWrapper)("hideBackgroundIllustration",t.hideBackgroundIllustration)},dependencies:[Hp,BA.iI,F.n3],encapsulation:2});var $p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Jp{constructor(e){this.token=e}}var Zp=i(3892),_p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class eg{constructor(e,t,i,n,r,s){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.route=r,this.toastService=s,this.loading=!0,this.submit=()=>_p(this,void 0,void 0,function*(){const e=new Jp(this.token);yield this.apiService.deleteUsingToken(this.orgId,e),this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationDeleted"),message:this.i18nService.t("organizationDeletedDesc")}),yield this.router.navigate(["/"])})}ngOnInit(){return _p(this,void 0,void 0,function*(){const e=yield(0,u._)(this.route.queryParams);null!=e.orgId&&null!=e.token&&null!=e.name?(this.orgId=e.orgId,this.token=e.token,this.name=e.name,this.loading=!1):yield this.router.navigate(["/"])})}}eg.ɵfac=function(e){return new(e||eg)(B.rXU(F.Ix),B.rXU(he.X),B.rXU(V.y),B.rXU(U.W),B.rXU(F.nX),B.rXU(P.f))},eg.ɵcmp=B.VBU({type:eg,selectors:[["ng-component"]],decls:27,vars:24,consts:[[1,"tw-flex","tw-flex-row","tw-justify-center","tw-mt-5"],[1,"tw-w-1/4"],[1,"tw-text-xl","tw-text-center","tw-mb-4"],[1,"tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background"],[1,"tw-p-5"],["type","warning"],[1,"tw-text-center"],[1,"tw-flex"],["type","button","bitButton","","buttonType","danger",3,"bitAction","disabled","block"],["routerLink","/login","bitButton","","buttonType","secondary",1,"tw-ml-2","tw-mt-0",3,"block"]],template:function(e,t){1&e&&(B.j41(0,"div",0)(1,"div",1)(2,"p",2),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"div",3)(6,"div",4)(7,"bit-callout",5),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"p",6)(11,"strong"),B.EFF(12),B.k0s()(),B.j41(13,"p"),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.j41(16,"p"),B.EFF(17),B.nI1(18,"i18n"),B.k0s(),B.nrm(19,"hr"),B.j41(20,"div",7)(21,"button",8),B.EFF(22),B.nI1(23,"i18n"),B.k0s(),B.j41(24,"a",9),B.EFF(25),B.nI1(26,"i18n"),B.k0s()()()()()()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,11,"deleteOrganization")),B.R7$(5),B.SpI(" ",B.i5U(9,13,"deletingOrganizationIsPermanentWarning",t.name)," "),B.R7$(4),B.JRh(t.name),B.R7$(2),B.JRh(B.bMT(15,16,"deleteRecoverOrgConfirmDesc")),B.R7$(3),B.JRh(B.bMT(18,18,"deletingOrganizationActiveUserAccountsWarning")),B.R7$(4),B.Y8G("bitAction",t.submit)("disabled",t.loading)("block",!0),B.R7$(),B.SpI(" ",B.bMT(23,20,"deleteOrganization")," "),B.R7$(2),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(26,22,"cancel")," "))},dependencies:[Ph.G,BA.Wk,Zp.p,Jd.Q,zA.G,au.$],encapsulation:2});var tg=i(80885),ig=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ng(e,t){if(1&e&&(B.j41(0,"div",1)(1,"div"),B.nrm(2,"bit-svg",2),B.nI1(3,"i18n"),B.j41(4,"div",3),B.nrm(5,"i",4),B.nI1(6,"i18n"),B.j41(7,"span",5),B.EFF(8),B.nI1(9,"i18n"),B.k0s()()()()),2&e){const e=B.XpG();B.R7$(2),B.Y8G("content",e.logo)("ariaLabel",B.bMT(3,5,"appLogoLabel")),B.R7$(3),B.Y8G("title",B.mNQ(B.bMT(6,7,"loading"))),B.R7$(3),B.JRh(B.bMT(9,9,"loading"))}}class rg extends tg.X{constructor(){super(...arguments),this.logo=pp,this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.requiredParameters=["email","token"],this.policyApiService=(0,E.WQX)(fe.m),this.configService=(0,E.WQX)(z.w),this.toastService=(0,E.WQX)(P.f)}authedHandler(e){return ig(this,void 0,void 0,function*(){yield this.router.navigate(["/setup/families-for-enterprise"],{queryParams:e})})}unauthedHandler(e){return ig(this,void 0,void 0,function*(){e.register?yield this.router.navigate(["/finish-signup"],{queryParams:{email:e.email,orgSponsoredFreeFamilyPlanToken:e.token}}):yield this.router.navigate(["/login"],{queryParams:{email:e.email}})})}}rg.ɵfac=(()=>{let e;return function(t){return(e||(e=B.xGo(rg)))(t||rg)}})(),rg.ɵcmp=B.VBU({type:rg,selectors:[["ng-component"]],features:[B.Vt3],decls:1,vars:1,consts:[["class","tw-mt-10 tw-flex tw-justify-center",4,"ngIf"],[1,"tw-mt-10","tw-flex","tw-justify-center"],[1,"tw-w-72","tw-block","tw-mb-4",3,"content","ariaLabel"],[1,"tw-flex","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&B.DNE(0,ng,10,11,"div",0),2&e&&B.Y8G("ngIf",t.loading)},dependencies:[H.MD,H.bT,RA.Z,gp.k,Zu.$Z],encapsulation:2});var sg=i(88565);class og{}var ag=i(67372),lg=i(71901),cg=i(33886),dg=i(68923),ug=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function hg(e,t){1&e&&(B.j41(0,"div",4),B.nrm(1,"i",5),B.nI1(2,"i18n"),B.j41(3,"span",6),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function Ag(e,t){1&e&&(B.j41(0,"div",4)(1,"span"),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"badToken")))}function pg(e,t){if(1&e&&B.nrm(0,"bit-option",16),2&e){const e=t.$implicit;B.Y8G("label",e.name)("value",e.id)}}function gg(e,t){if(1&e){const e=B.RV6();B.j41(0,"div")(1,"app-organization-plans",17),B.bIt("onSuccess",function(t){E.eBV(e);const i=B.XpG(2);return E.Njj(i.onOrganizationCreateSuccess(t))}),B.k0s()()}if(2&e){const e=B.XpG(2);B.R7$(),B.Y8G("initialPlan",e.familyPlan)("initialProductTier",e.familyProductTier)("acceptingSponsorship",!0)("planSponsorshipType",e.planSponsorshipType)}}function vg(e,t){1&e&&(B.j41(0,"div",9)(1,"button",18),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"acceptOffer")," "))}function fg(e,t){if(1&e&&(B.j41(0,"form",7)(1,"p",8),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-form-field",9)(5,"bit-label"),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"bit-select",10),B.nrm(9,"bit-option",11),B.nI1(10,"i18n"),B.nrm(11,"bit-option",12),B.nI1(12,"i18n"),B.DNE(13,pg,1,2,"bit-option",13),B.nI1(14,"async"),B.k0s()(),B.DNE(15,gg,2,4,"div",14)(16,vg,4,3,"div",15),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitSubmit",e.submit)("formGroup",e.formGroup),B.R7$(2),B.JRh(B.bMT(3,11,"acceptBitwardenFamiliesHelp")),B.R7$(4),B.JRh(B.bMT(7,13,"sponsoredFamiliesSelectOffer")),B.R7$(3),B.Y8G("label",B.VkB("-- ",B.bMT(10,15,"select")," --")),B.R7$(2),B.Y8G("label",B.mNQ(B.bMT(12,17,"newFamiliesOrganization"))),B.R7$(2),B.Y8G("ngForOf",B.bMT(14,19,e.existingFamilyOrganizations$)),B.R7$(2),B.Y8G("ngIf",e.showNewOrganization),B.R7$(),B.Y8G("ngIf",!e.showNewOrganization)}}class mg{constructor(e,t,i,n,r,s,o,l,c,u,h,A){this.router=e,this.configService=t,this.i18nService=i,this.route=n,this.apiService=r,this.syncService=s,this.validationService=o,this.organizationService=l,this.accountService=c,this.dialogService=u,this.formBuilder=h,this.toastService=A,this.loading=!0,this.badToken=!1,this.showNewOrganization=!1,this._selectedFamilyOrganizationId="",this._destroy=new d.B,this.familyProductTier=rr.K_.Families,this.planSponsorshipType=rr.MM.FamiliesForEnterprise,this.formGroup=this.formBuilder.group({selectedFamilyOrganizationId:["",a.k0.required]}),this.submit=()=>ug(this,void 0,void 0,function*(){yield this.doSubmit(this._selectedFamilyOrganizationId)})}ngOnInit(){return ug(this,void 0,void 0,function*(){document.body.classList.remove("layout_frontend"),this.route.queryParams.pipe((0,Cu.$)()).subscribe(e=>ug(this,void 0,void 0,function*(){if(null==e.token)return this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("sponsoredFamiliesAcceptFailed"),timeout:1e4}),void this.router.navigate(["/"]);if(this.token=e.token,yield this.syncService.fullSync(!0),this.preValidateSponsorshipResponse=yield this.apiService.postPreValidateSponsorshipToken(this.token),this.preValidateSponsorshipResponse.isFreeFamilyPolicyEnabled)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccured"),message:this.i18nService.t("offerNoLongerValid")}),void(yield this.router.navigate(["/"]));this.badToken=!this.preValidateSponsorshipResponse.isTokenValid;const t=yield this.configService.getFeatureFlag(dr.TO.PM26462_Milestone_3);this.familyPlan=t?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025,this.loading=!1}));const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.existingFamilyOrganizations$=this.organizationService.organizations$(e).pipe((0,p.T)(e=>e.filter(e=>e.productTierType===rr.K_.Families&&e.type===mt.D7.Owner))),this.existingFamilyOrganizations$.pipe((0,pi.Q)(this._destroy)).subscribe(e=>{0===e.length&&(this.selectedFamilyOrganizationId="createNew")}),this.formGroup.valueChanges.pipe((0,pi.Q)(this._destroy)).subscribe(e=>{this.selectedFamilyOrganizationId=e.selectedFamilyOrganizationId})})}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}get selectedFamilyOrganizationId(){return this._selectedFamilyOrganizationId}set selectedFamilyOrganizationId(e){this._selectedFamilyOrganizationId=e,this.showNewOrganization="createNew"===e}doSubmit(e){return ug(this,void 0,void 0,function*(){try{const t=new og;t.planSponsorshipType=rr.MM.FamiliesForEnterprise,t.sponsoredOrganizationId=e,yield this.apiService.postRedeemSponsorship(this.token,t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("sponsoredFamiliesOfferRedeemed")}),yield this.syncService.fullSync(!0),this.router.navigate(["/"])}catch(t){if(this.showNewOrganization){const t=(0,lg.f$)(this.dialogService,{data:{organizationId:e,requestType:"InvalidFamiliesForEnterprise"}});(yield(0,sg.s)(t.closed))===lg.ay.Deleted&&this.router.navigate(["/"])}this.validationService.showError(this.i18nService.t("sponsorshipTokenHasExpired"))}})}onOrganizationCreateSuccess(e){return ug(this,void 0,void 0,function*(){yield this.doSubmit(e.organizationId)})}}mg.ɵfac=function(e){return new(e||mg)(B.rXU(F.Ix),B.rXU(z.w),B.rXU(U.W),B.rXU(F.nX),B.rXU(de.G),B.rXU(uh.H),B.rXU(Xs.B),B.rXU(f.PV),B.rXU(Y.D),B.rXU(R.o3),B.rXU(a.ok),B.rXU(P.f))},mg.ɵcmp=B.VBU({type:mg,selectors:[["ng-component"]],decls:7,vars:6,consts:[[1,"tw-container"],["bitTypography","h1"],["class","tw-mt-5 tw-flex tw-justify-center",4,"ngIf"],[3,"bitSubmit","formGroup",4,"ngIf"],[1,"tw-mt-5","tw-flex","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"bitSubmit","formGroup"],["bitTypography","body1"],[1,"tw-w-1/2"],["formControlName","selectedFamilyOrganizationId"],["value","","disabled","",3,"label"],["value","createNew",3,"label"],[3,"label","value",4,"ngFor","ngForOf"],[4,"ngIf"],["class","tw-w-1/2",4,"ngIf"],[3,"label","value"],[3,"onSuccess","initialPlan","initialProductTier","acceptingSponsorship","planSponsorshipType"],["bitButton","","buttonType","primary","bitFormButton","","type","submit"]],template:function(e,t){1&e&&(B.j41(0,"div",0)(1,"h1",1),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.DNE(4,hg,6,7,"div",2)(5,Ag,4,3,"div",2)(6,fg,17,21,"form",3),B.k0s()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,4,"sponsoredFamiliesOffer")),B.R7$(2),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",!t.loading&&t.badToken),B.R7$(),B.Y8G("ngIf",!t.loading&&!t.badToken))},dependencies:[oh.G,H.Sq,H.bT,a.qT,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,tu.j,ru.h,cg.w,dg.P,MA.r,ag.v,H.Jj,au.$],encapsulation:2});var yg=i(72932),Cg=i(10672),wg=i(49112),Ig=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class bg{constructor(e,t){this.route=e,this.configService=t,this.secretsManager=!1,this.plan=rr.OL.Free,this.productTier=rr.K_.Free,this.destroy$=new d.B}ngOnInit(){return Ig(this,void 0,void 0,function*(){const e=(yield this.configService.getFeatureFlag(dr.TO.PM26462_Milestone_3))?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025;this.route.queryParams.pipe((0,Cu.$)(),(0,pi.Q)(this.destroy$)).subscribe(t=>{"families"===t.plan||t.productTier==rr.K_.Families?(this.plan=e,this.productTier=rr.K_.Families):"teams"===t.plan||t.productTier==rr.K_.Teams?(this.plan=rr.OL.TeamsAnnually,this.productTier=rr.K_.Teams):"teamsStarter"===t.plan||t.productTier==rr.K_.TeamsStarter?(this.plan=rr.OL.TeamsStarter,this.productTier=rr.K_.TeamsStarter):"enterprise"!==t.plan&&t.productTier!=rr.K_.Enterprise||(this.plan=rr.OL.EnterpriseAnnually,this.productTier=rr.K_.Enterprise),this.secretsManager=t.product==rr.ch.SecretsManager})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}bg.ɵfac=function(e){return new(e||bg)(B.rXU(F.nX),B.rXU(z.w))},bg.ɵcmp=B.VBU({type:bg,selectors:[["ng-component"]],decls:6,vars:6,consts:[[3,"enableSecretsManagerByDefault","initialPlan","initialProductTier"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container")(2,"p"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.nrm(5,"app-organization-plans",0),B.k0s()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,4,"newOrganizationDesc")),B.R7$(2),B.Y8G("enableSecretsManagerByDefault",t.secretsManager)("initialPlan",t.plan)("initialProductTier",t.productTier))},dependencies:[oh.G,Cg.H,ag.v,yg.G,wg.f,au.$],encapsulation:2});const Bg=Object.freeze({Account:"account",EmergencyAccess:"emergency-access",Password:"password",TwoFactor:"two-factor",SecurityKeys:"security-keys",DeviceManagement:"device-management"}),Eg=Object.freeze({SignUpLinkExpired:"signup-link-expired",RecoverTwoFactor:"recover-2fa",AcceptEmergencyAccessInvite:"accept-emergency",RecoverDeleteAccount:"recover-delete",VerifyRecoverDeleteAccount:"verify-recover-delete",AcceptOrganizationInvite:"accept-organization",AccountSettings:`settings/${Bg.Account}`,EmergencyAccessSettings:`settings/${Bg.EmergencyAccess}`,PasswordSettings:`settings/security/${Bg.Password}`,TwoFactorSettings:`settings/security/${Bg.TwoFactor}`,SecurityKeysSettings:`settings/security/${Bg.SecurityKeys}`,DeviceManagement:`settings/security/${Bg.DeviceManagement}`});var Sg=i(63629),Qg=i(5076),kg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Tg extends tg.X{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r),this.router=e,this.platformUtilsService=t,this.i18nService=i,this.route=n,this.authService=r,this.acceptOrganizationInviteService=s,this.organizationInviteService=o,this.accountService=a,this.toastService=l,this.orgName$=this.acceptOrganizationInviteService.orgName$,this.requiredParameters=["organizationId","organizationUserId","token"]}authedHandler(e){return kg(this,void 0,void 0,function*(){const t=this.fromParams(e);if(null===t)return yield this.handleInvalidInvite();const i=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));(yield this.acceptOrganizationInviteService.validateAndAcceptInvite(t,i))&&(this.toastService.showToast({message:t.initOrganization?this.i18nService.t("inviteInitAcceptedDesc"):this.i18nService.t("invitationAcceptedDesc"),variant:"success",timeout:1e4}),yield this.router.navigate(["/"]))})}unauthedHandler(e){return kg(this,void 0,void 0,function*(){const t=this.fromParams(e);if(null===t)return yield this.handleInvalidInvite();yield this.organizationInviteService.setOrganizationInvitation(t),yield this.navigateInviteAcceptance(t)})}getErrorMessage(e){return"Expired token."===e?this.i18nService.t(this.failedMessage):super.getErrorMessage(e)}navigateInviteAcceptance(e){return kg(this,void 0,void 0,function*(){e.orgUserHasExistingUser?yield this.router.navigate(["/login"],{queryParams:{email:e.email}}):e.orgSsoIdentifier?yield this.router.navigate(["/sso"],{queryParams:{email:e.email,identifier:e.orgSsoIdentifier}}):yield this.router.navigate(["/finish-signup"],{queryParams:{email:e.email}})})}fromParams(e){var t,i;return null==e?null:(0,Qg.e)(e.organizationId)&&(0,Qg.e)(e.organizationUserId)?Object.assign(new eh,{email:e.email,initOrganization:"true"===(null===(t=e.initOrganization)||void 0===t?void 0:t.toLocaleLowerCase()),orgSsoIdentifier:e.orgSsoIdentifier,orgUserHasExistingUser:"true"===(null===(i=e.orgUserHasExistingUser)||void 0===i?void 0:i.toLocaleLowerCase()),organizationId:e.organizationId,organizationName:e.organizationName,organizationUserId:e.organizationUserId,token:e.token}):null}handleInvalidInvite(){return kg(this,void 0,void 0,function*(){this.toastService.showToast({message:this.i18nService.t(this.failedMessage),variant:"error",timeout:1e4}),yield this.router.navigate(["/"])})}}Tg.ɵfac=function(e){return new(e||Tg)(B.rXU(F.Ix),B.rXU(V.y),B.rXU(U.W),B.rXU(F.nX),B.rXU(T.u),B.rXU(lh),B.rXU(ji.i),B.rXU(Y.D),B.rXU(P.f))},Tg.ɵcmp=B.VBU({type:Tg,selectors:[["ng-component"]],standalone:!1,features:[B.Vt3],decls:6,vars:3,consts:[[1,"tw-mt-5","tw-flex","tw-justify-center"],["src","../../images/logo-dark@2x.png","alt","Bitwarden",1,"logo"],[1,"tw-text-center","tw-my-4"],["name","bwi-spinner",1,"bwi-spin","bwi-2x","tw-text-muted",3,"ariaLabel"]],template:function(e,t){1&e&&(B.j41(0,"div",0)(1,"div"),B.nrm(2,"img",1),B.j41(3,"p",2),B.nrm(4,"bit-icon",3),B.nI1(5,"i18n"),B.k0s()()()),2&e&&(B.R7$(4),B.Y8G("ariaLabel",B.bMT(5,1,"loading")))},dependencies:[LA.R,au.$],encapsulation:2});class Fg{}var Pg=i(57083),Rg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Dg{get email(){return this.recoverDeleteForm.controls.email}constructor(e,t,i,n){this.router=e,this.apiService=t,this.i18nService=i,this.toastService=n,this.recoverDeleteForm=new a.gE({email:new a.MJ("",[a.k0.required])}),this.submit=()=>Rg(this,void 0,void 0,function*(){if(this.recoverDeleteForm.invalid)return;const e=new Fg;e.email=this.email.value.trim().toLowerCase(),yield this.apiService.postAccountRecoverDelete(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deleteRecoverEmailSent")}),yield this.router.navigate(["/"])})}}Dg.ɵfac=function(e){return new(e||Dg)(B.rXU(F.Ix),B.rXU(de.G),B.rXU(U.W),B.rXU(P.f))},Dg.ɵcmp=B.VBU({type:Dg,selectors:[["app-recover-delete"]],decls:17,vars:16,consts:[[3,"formGroup","bitSubmit"],["bitTypography","body1"],["bitInput","","appAutofocus","","appInputVerbatim","false","type","email","formControlName","email"],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"p",1),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-form-field")(5,"bit-label"),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.nrm(8,"input",2),B.k0s(),B.nrm(9,"hr"),B.j41(10,"div",3)(11,"button",4),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"a",5),B.EFF(15),B.nI1(16,"i18n"),B.k0s()()()),2&e&&(B.Y8G("formGroup",t.recoverDeleteForm)("bitSubmit",t.submit),B.R7$(2),B.JRh(B.bMT(3,8,"deleteRecoverDesc")),B.R7$(4),B.JRh(B.bMT(7,10,"emailAddress")),B.R7$(5),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(13,12,"submit")," "),B.R7$(2),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(16,14,"cancel")," "))},dependencies:[a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,BA.Wk,jd.p,x.B,Pg.q,Kd.C,_d.$,eu.L,Yd.t,Jd.Q,Xd.L,tu.j,nu.J,ru.h,DA.E,MA.r,au.$],encapsulation:2});var Mg=i(71804),xg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Og{constructor(e,t,i,n,r,s,o,l){this.destroyRef=e,this.router=t,this.i18nService=i,this.loginStrategyService=n,this.toastService=r,this.loginSuccessHandlerService=s,this.logService=o,this.validationService=l,this.formGroup=new a.gE({email:new a.MJ("",[a.k0.required]),masterPassword:new a.MJ("",[a.k0.required]),recoveryCode:new a.MJ("",[a.k0.required])}),this.recoveryCodeMessage="",this.submit=()=>xg(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.email.trim().toLowerCase(),t=this.recoveryCode.replace(/\s/g,"").toLowerCase();yield this.loginWithRecoveryCode(e,t)})}ngOnInit(){return xg(this,void 0,void 0,function*(){this.recoveryCodeMessage=this.i18nService.t("logInBelowUsingYourSingleUseRecoveryCode"),this.formGroup.valueChanges.pipe((0,c.pQ)(this.destroyRef)).subscribe(()=>{var e;null===(e=this.formGroup.get("recoveryCode"))||void 0===e||e.setErrors(null)})})}get email(){var e,t;return null!==(t=null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}get masterPassword(){var e,t;return null!==(t=null===(e=this.formGroup.get("masterPassword"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}get recoveryCode(){var e,t;return null!==(t=null===(e=this.formGroup.get("recoveryCode"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}loginWithRecoveryCode(e,t){return xg(this,void 0,void 0,function*(){var i;const n={provider:Mg.R.RecoveryCode,token:t,remember:!1},r=new v.F2(e,this.masterPassword,n);try{const e=yield this.loginStrategyService.logIn(r);this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("youHaveBeenLoggedIn")}),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepRecoverDisabled")}),yield this.loginSuccessHandlerService.run(e.userId,this.masterPassword),yield this.router.navigate(["/settings/security/two-factor"])}catch(s){s instanceof ot._?s.message.includes("Two-factor recovery has been performed. SSO authentication is required.")?(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepRecoverDisabled")}),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("ssoLoginIsRequired")}),yield this.router.navigate(["/login"])):(this.logService.error("Error logging in automatically: ",s.message),s.message.includes("Two-step token is invalid")?null===(i=this.formGroup.get("recoveryCode"))||void 0===i||i.setErrors({invalidRecoveryCode:{message:this.i18nService.t("invalidRecoveryCode")}}):this.validationService.showError(s.message)):(this.logService.error("Error logging in automatically: ",s),this.validationService.showError(s))}})}}Og.ɵfac=function(e){return new(e||Og)(B.rXU(E.abz),B.rXU(F.Ix),B.rXU(U.W),B.rXU(v.sg),B.rXU(P.f),B.rXU(v.aJ),B.rXU(Vs.K),B.rXU(Xs.B))},Og.ɵcmp=B.VBU({type:Og,selectors:[["app-recover-two-factor"]],decls:28,vars:23,consts:[[3,"formGroup","bitSubmit"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/lost-two-step-device/","target","_blank","rel","noreferrer"],["bitInput","","type","text","formControlName","email","appAutofocus","","inputmode","email","appInputVerbatim","false"],["bitInput","","type","password","formControlName","masterPassword","appInputVerbatim",""],["bitInput","","type","text","formControlName","recoveryCode","appInputVerbatim",""],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"p",1),B.EFF(2),B.j41(3,"a",2),B.EFF(4),B.nI1(5,"i18n"),B.k0s()(),B.j41(6,"bit-form-field")(7,"bit-label"),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.nrm(10,"input",3),B.k0s(),B.j41(11,"bit-form-field")(12,"bit-label"),B.EFF(13),B.nI1(14,"i18n"),B.k0s(),B.nrm(15,"input",4),B.k0s(),B.j41(16,"bit-form-field")(17,"bit-label"),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.nrm(20,"input",5),B.k0s(),B.j41(21,"div",6)(22,"button",7),B.EFF(23),B.nI1(24,"i18n"),B.k0s(),B.j41(25,"a",8),B.EFF(26),B.nI1(27,"i18n"),B.k0s()()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(2),B.SpI(" ",t.recoveryCodeMessage," "),B.R7$(2),B.JRh(B.bMT(5,11,"learnMore")),B.R7$(4),B.JRh(B.bMT(9,13,"emailAddress")),B.R7$(5),B.JRh(B.bMT(14,15,"masterPass")),B.R7$(5),B.JRh(B.bMT(19,17,"recoveryCodeTitle")),B.R7$(4),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(24,19,"submit")," "),B.R7$(2),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(27,21,"cancel")," "))},dependencies:[a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,BA.Wk,jd.p,x.B,Pg.q,Kd.C,_d.$,eu.L,Yd.t,Jd.Q,Xd.L,tu.j,nu.J,ru.h,zd.V,$d.g,DA.E,MA.r,au.$],encapsulation:2});var Gg=i(84431),Ug=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Vg(e,t){1&e&&(B.j41(0,"bit-callout",10),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"changeEmailTwoFactorWarning")," "))}function jg(e,t){if(1&e&&(B.qex(0),B.nrm(1,"hr"),B.j41(2,"p"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"bit-callout",10),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"div",11)(9,"bit-form-field")(10,"bit-label"),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.nrm(13,"input",12),B.k0s()(),B.bVm()),2&e){const e=B.XpG();B.R7$(3),B.JRh(B.i5U(4,3,"changeEmailDesc",e.formGroup.controls.step1.value.newEmail)),B.R7$(3),B.JRh(B.bMT(7,6,"loggedOutWarning")),B.R7$(5),B.JRh(B.bMT(12,8,"code"))}}function Ng(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",13),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.reset())}),B.EFF(1),B.nI1(2,"i18n"),B.k0s()}2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"cancel")," "))}class zg{constructor(e,t,i,n,r,s,o){this.accountService=e,this.twoFactorService=t,this.i18nService=i,this.messagingService=n,this.formBuilder=r,this.toastService=s,this.changeEmailService=o,this.tokenSent=!1,this.showTwoFactorEmailWarning=!1,this.formGroup=this.formBuilder.group({step1:this.formBuilder.group({masterPassword:["",[a.k0.required]],newEmail:["",[a.k0.required,a.k0.email]]}),token:[{value:"",disabled:!0},[a.k0.required]]}),this.submit=()=>Ug(this,void 0,void 0,function*(){var e;if(null==this.userId)throw new Error("Can't find user");if(this.formGroup.controls.step1.markAllAsTouched(),this.tokenSent&&this.formGroup.controls.token.markAllAsTouched(),this.formGroup.invalid)return;const t=this.formGroup.controls.step1.value,i=null===(e=t.newEmail)||void 0===e?void 0:e.trim().toLowerCase(),n=t.masterPassword,r="Could not update email.";if((0,Kr.x)(i,"email",r),(0,Kr.x)(n,"password",r),this.tokenSent){const e=this.formGroup.value.token;if(null==e)throw new Error("Missing token");yield this.changeEmailService.confirmEmailChange(n,i,e,this.userId),this.reset(),this.toastService.showToast({variant:"success",title:this.i18nService.t("emailChanged"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")}else yield this.changeEmailService.requestEmailToken(n,i,this.userId),this.activateStep2()})}ngOnInit(){return Ug(this,void 0,void 0,function*(){this.userId=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));const e=yield this.twoFactorService.getEnabledTwoFactorProviders();this.showTwoFactorEmailWarning=e.data.some(e=>e.type===Mg.R.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}}zg.ɵfac=function(e){return new(e||zg)(B.rXU(Y.D),B.rXU(Bn.fz),B.rXU(U.W),B.rXU(js.U),B.rXU(a.ok),B.rXU(P.f),B.rXU(Du))},zg.ɵcmp=B.VBU({type:zg,selectors:[["app-change-email"]],decls:20,vars:14,consts:[[3,"formGroup","bitSubmit"],["type","warning",4,"ngIf"],["formGroupName","step1",1,"@3xl: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"],[1,"tw-flex","tw-gap-2"],["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&&(B.j41(0,"form",0),B.DNE(1,Vg,3,3,"bit-callout",1),B.j41(2,"div",2)(3,"bit-form-field")(4,"bit-label"),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.nrm(7,"input",3)(8,"button",4),B.k0s(),B.j41(9,"bit-form-field")(10,"bit-label"),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.nrm(13,"input",5),B.k0s()(),B.DNE(14,jg,14,10,"ng-container",6),B.j41(15,"div",7)(16,"button",8),B.EFF(17),B.nI1(18,"i18n"),B.k0s(),B.DNE(19,Ng,3,3,"button",9),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(),B.Y8G("ngIf",t.showTwoFactorEmailWarning),B.R7$(4),B.JRh(B.bMT(6,8,"masterPass")),B.R7$(6),B.JRh(B.bMT(12,10,"newEmail")),B.R7$(3),B.Y8G("ngIf",t.tokenSent),B.R7$(3),B.SpI(" ",B.bMT(18,12,t.tokenSent?"changeEmail":"continue")," "),B.R7$(2),B.Y8G("ngIf",t.tokenSent))},dependencies:[oh.G,H.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,a.$R,_d.$,eu.L,Jd.Q,zA.G,tu.j,nu.J,ru.h,su.e,ou.a,Zd.s,au.$],encapsulation:2});var Yg=i(46131),Lg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Kg{constructor(e,t,i,n,r,s,o){this.apiService=e,this.i18nService=t,this.formBuilder=i,this.userVerificationService=n,this.messagingService=r,this.logService=s,this.toastService=o,this.deauthForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>Lg(this,void 0,void 0,function*(){try{const e=this.deauthForm.value.verification,t=yield this.userVerificationService.buildRequest(e);yield this.apiService.postSecurityStamp(t),this.toastService.showToast({variant:"success",title:this.i18nService.t("sessionsDeauthorized"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")}catch(e){this.logService.error(e)}})}static open(e){return e.open(Kg)}}Kg.ɵfac=function(e){return new(e||Kg)(B.rXU(de.G),B.rXU(U.W),B.rXU(a.ok),B.rXU(Rt.i),B.rXU(js.U),B.rXU(Vs.K),B.rXU(P.f))},Kg.ɵcmp=B.VBU({type:Kg,selectors:[["ng-component"]],decls:18,vars:18,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"i18n"),B.qex(3,2),B.j41(4,"p",3),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-callout",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"app-user-verification-form-input",5),B.mxI("invalidSecretChange",function(e){return B.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),B.k0s(),B.bVm(),B.qex(11,6),B.j41(12,"button",7),B.EFF(13),B.nI1(14,"i18n"),B.k0s(),B.j41(15,"button",8),B.EFF(16),B.nI1(17,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.deauthForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("title",B.bMT(2,8,"deauthorizeSessions")),B.R7$(4),B.JRh(B.bMT(6,10,"deauthorizeSessionsDesc")),B.R7$(3),B.JRh(B.bMT(9,12,"deauthorizeSessionsWarning")),B.R7$(2),B.R50("invalidSecret",t.invalidSecret),B.R7$(3),B.SpI(" ",B.bMT(14,14,"deauthorizeSessions")," "),B.R7$(3),B.SpI(" ",B.bMT(17,16,"close")," "))},dependencies:[oh.G,a.qT,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,zA.G,qd.I,Hd.m,Wd.hJ,MA.r,le.wV,au.$],encapsulation:2});var Xg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qg{constructor(e,t,i,n,r){this.i18nService=e,this.formBuilder=t,this.accountApiService=i,this.dialogRef=n,this.toastService=r,this.deleteForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>Xg(this,void 0,void 0,function*(){try{const e=this.deleteForm.get("verification").value;yield this.accountApiService.deleteAccount(e),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:this.i18nService.t("accountDeleted"),message:this.i18nService.t("accountDeletedDesc")})}catch(e){throw e instanceof ot._&&400===e.statusCode&&(this.invalidSecret=!0),e}})}static open(e){return e.open(qg)}}qg.ɵfac=function(e){return new(e||qg)(B.rXU(U.W),B.rXU(a.ok),B.rXU(It.T),B.rXU(R.ce),B.rXU(P.f))},qg.ɵcmp=B.VBU({type:qg,selectors:[["ng-component"]],decls:18,vars:18,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"i18n"),B.qex(3,2),B.j41(4,"p",3),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-callout",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"app-user-verification-form-input",5),B.mxI("invalidSecretChange",function(e){return B.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),B.k0s(),B.bVm(),B.qex(11,6),B.j41(12,"button",7),B.EFF(13),B.nI1(14,"i18n"),B.k0s(),B.j41(15,"button",8),B.EFF(16),B.nI1(17,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.deleteForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("title",B.bMT(2,8,"deleteAccount")),B.R7$(4),B.JRh(B.bMT(6,10,"deleteAccountDesc")),B.R7$(3),B.JRh(B.bMT(9,12,"deleteAccountWarning")),B.R7$(2),B.R50("invalidSecret",t.invalidSecret),B.R7$(3),B.SpI(" ",B.bMT(14,14,"deleteAccount")," "),B.R7$(3),B.SpI(" ",B.bMT(17,16,"close")," "))},dependencies:[oh.G,a.qT,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,zA.G,qd.I,Hd.m,Wd.hJ,MA.r,le.wV,au.$],encapsulation:2});class Hg{constructor(e){this.culture="en-US",this.name=e}}var Wg=i(23490),$g=i(77243),Jg=i(36006),Zg=i(57144),_g=i(81525),ev=i(79703);class tv{constructor(){this.selected=!1,this.select=new B.bkB}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"])}}tv.ɵfac=function(e){return new(e||tv)},tv.ɵcmp=B.VBU({type:tv,selectors:[["selectable-avatar"]],inputs:{id:"id",text:"text",title:"title",color:"color",selected:"selected"},outputs:{select:"select"},decls:2,vars:7,consts:[["tabindex","0",3,"click","keyup.enter","title","ngClass"],["appStopClick","","size","2xl",3,"text","color","id","title"]],template:function(e,t){1&e&&(B.j41(0,"span",0),B.bIt("click",function(){return t.onFire()})("keyup.enter",function(){return t.onFire()}),B.nrm(1,"bit-avatar",1),B.k0s()),2&e&&(B.Y8G("title",t.title)("ngClass",t.classList),B.R7$(),B.Y8G("text",t.text)("text",t.text)("color",t.color)("id",t.id)("title",t.title))},dependencies:[H.YU,ev.m,Zg.fw],encapsulation:2});var iv=i(93103),nv=i(90171),rv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const sv=["colorPicker"],ov=e=>({"!tw-outline-[3px] tw-outline-primary-600 hover:tw-outline-[3px] hover:tw-outline-primary-600":e});function av(e,t){1&e&&(B.j41(0,"div",13),B.nrm(1,"bit-icon",14),B.nI1(2,"i18n"),B.EFF(3),B.nI1(4,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,2,"loading")),B.R7$(2),B.SpI(" ",B.bMT(4,4,"loading")," "))}function lv(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"selectable-avatar",15),B.nI1(2,"userName"),B.bIt("select",function(){const t=E.eBV(e).$implicit,i=B.XpG();return E.Njj(i.setSelection(t.color))}),B.k0s(),B.bVm()}if(2&e){const e=t.$implicit,i=B.XpG();B.R7$(),B.Y8G("text",B.mNQ(B.bMT(2,5,i.profile)))("selected",e.selected)("title",e.name)("color",e.color)}}class cv{constructor(e,t,i,n,r,s){this.data=e,this.i18nService=t,this.platformUtilsService=i,this.avatarService=n,this.dialogRef=r,this.toastService=s,this.loading=!1,this.defaultColorPalette=Zg.ls.map(e=>({color:Zg.BF[e],name:this.i18nService.t("brand"===e?"blue":e)})),this.customColorSelected=!1,this.customColor$=new _e.t(null),this.customTextColor$=new _e.t("#000000"),this.destroy$=new d.B,this.submit=()=>rv(this,void 0,void 0,function*(){const e=at.A.validateHexColor(this.currentSelection);null==this.currentSelection||e?(yield this.avatarService.setAvatarColor(this.currentSelection),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("avatarUpdated")})):this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})}),this.profile=e.profile}ngOnInit(){return rv(this,void 0,void 0,function*(){this.customColor$.pipe((0,Jg.B)(200),(0,pi.Q)(this.destroy$)).subscribe(e=>{null!=e&&(this.customTextColor$.next(at.A.pickTextColorBasedOnBgColor(e)),this.customColorSelected=!0,this.currentSelection=e)}),yield this.setSelection(yield(0,u._)(this.avatarService.avatarColor$))})}showCustomPicker(){return rv(this,void 0,void 0,function*(){this.customColorSelected=!0,this.colorPickerElement.nativeElement.click(),this.setSelection(this.customColor$.value)})}ngOnDestroy(){return rv(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}setSelection(e){return rv(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)}})}static open(e,t){return e.open(cv,t)}}cv.ɵfac=function(e){return new(e||cv)(B.rXU(_g.Qs),B.rXU(U.W),B.rXU(V.y),B.rXU(Et.v),B.rXU(R.ce),B.rXU(P.f))},cv.ɵcmp=B.VBU({type:cv,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&B.GBs(sv,5),2&e){let e;B.mGM(e=B.lsd())&&(t.colorPickerElement=e.first)}},decls:25,vars:35,consts:[["colorPicker",""],["dialogSize","large",3,"title"],["bitDialogContent",""],["class","tw-text-center",4,"ngIf"],[1,"tw-text-lg"],[1,"tw-flex","tw-flex-wrap","tw-justify-center","tw-gap-8"],[4,"ngFor","ngForOf"],[1,"tw-relative","tw-flex","tw-size-16","tw-cursor-pointer","tw-place-content-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,"keyup.enter","click","tabIndex","title","ngClass"],["name","bwi-pencil",1,"!tw-text-muted","tw-m-auto","tw-text-3xl"],["tabindex","-1","type","color",1,"tw-absolute","tw-bottom-0","tw-right-0","tw-size-px","tw-border-none","tw-bg-transparent","tw-opacity-0",3,"ngModelChange","ngModel"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary",3,"disabled","bitAction"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],[1,"tw-text-center"],["name","bwi-spinner",1,"bwi-spin",3,"ariaLabel"],["appStopClick","",3,"select","selected","title","text","color"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-dialog",1),B.nI1(1,"i18n"),B.qex(2,2),B.DNE(3,av,5,6,"div",3),B.j41(4,"p",4),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"div",5),B.DNE(8,lv,3,7,"ng-container",6),B.j41(9,"span")(10,"span",7),B.nI1(11,"async"),B.nI1(12,"i18n"),B.bIt("keyup.enter",function(){return E.eBV(e),E.Njj(t.showCustomPicker())})("click",function(){return E.eBV(e),E.Njj(t.showCustomPicker())}),B.nrm(13,"bit-icon",8),B.nI1(14,"async"),B.j41(15,"input",9,0),B.nI1(17,"async"),B.bIt("ngModelChange",function(i){return E.eBV(e),E.Njj(t.customColor$.next(i))}),B.k0s()()()(),B.bVm(),B.qex(18,10),B.j41(19,"button",11),B.EFF(20),B.nI1(21,"i18n"),B.k0s(),B.j41(22,"button",12),B.EFF(23),B.nI1(24,"i18n"),B.k0s(),B.bVm(),B.k0s()}2&e&&(B.Y8G("title",B.bMT(1,17,"customizeAvatar")),B.R7$(3),B.Y8G("ngIf",t.loading),B.R7$(2),B.JRh(B.bMT(6,19,"pickAnAvatarColor")),B.R7$(3),B.Y8G("ngForOf",t.defaultColorPalette),B.R7$(2),B.xc7("background-color",B.bMT(11,21,t.customColor$)),B.Y8G("title",B.mNQ(B.bMT(12,23,"customColor")))("tabIndex",0)("ngClass",B.eq3(33,ov,t.customColorSelected)),B.R7$(3),B.xc7("color",B.bMT(14,25,t.customTextColor$)),B.R7$(2),B.Y8G("ngModel",B.bMT(17,27,t.customColor$)),B.R7$(4),B.Y8G("disabled",t.loading)("bitAction",t.submit),B.R7$(),B.SpI(" ",B.bMT(21,29,"save")," "),B.R7$(3),B.SpI(" ",B.bMT(24,31,"close")," "))},dependencies:[oh.G,H.YU,H.Sq,H.bT,a.me,a.BC,a.vS,iv.Y,Zp.p,Jd.Q,qd.I,Hd.m,Wd.hJ,LA.R,tv,H.Jj,au.$,nv.b],encapsulation:2});var dv=i(47428),uv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function hv(e,t){1&e&&(B.j41(0,"div"),B.nrm(1,"bit-icon",2),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function Av(e,t){if(1&e&&(B.j41(0,"div"),B.EFF(1),B.nI1(2,"i18n"),B.j41(3,"a",15),B.nrm(4,"bit-icon",16),B.k0s()()),2&e){const e=t.ngIf;B.R7$(),B.SpI(" ",B.i5U(2,1,"accountIsOwnedMessage",null==e?null:e.name)," ")}}function pv(e,t){if(1&e&&(B.nrm(0,"app-account-fingerprint",13),B.nI1(1,"i18n")),2&e){const e=B.XpG(2);B.Y8G("fingerprintLabel",B.mNQ(B.bMT(1,4,"yourAccountsFingerprint")))("fingerprintMaterial",e.fingerprintMaterial)("publicKeyBuffer",e.userPublicKey)}}function gv(e,t){if(1&e&&(B.j41(0,"form",3)(1,"div",4)(2,"div",5)(3,"bit-form-field")(4,"bit-label"),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.nrm(7,"input",6),B.k0s(),B.j41(8,"bit-form-field")(9,"bit-label"),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.nrm(12,"input",7),B.k0s()(),B.j41(13,"div",8)(14,"div",9),B.nrm(15,"dynamic-avatar",10),B.nI1(16,"userName"),B.j41(17,"button",11),B.nrm(18,"bit-icon",12),B.EFF(19),B.nI1(20,"i18n"),B.k0s()(),B.DNE(21,Av,5,4,"div",0),B.nI1(22,"async"),B.nVh(23,pv,2,6,"app-account-fingerprint",13),B.k0s()(),B.j41(24,"button",14),B.EFF(25),B.nI1(26,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),B.R7$(5),B.JRh(B.bMT(6,12,"name")),B.R7$(5),B.JRh(B.bMT(11,14,"email")),B.R7$(5),B.Y8G("text",B.mNQ(B.bMT(16,16,e.profile)))("id",e.profile.id),B.R7$(2),B.Y8G("bitAction",e.openChangeAvatar),B.R7$(2),B.SpI(" ",B.bMT(20,18,"customize")," "),B.R7$(2),B.Y8G("ngIf",B.bMT(22,20,e.managingOrganization$)),B.R7$(2),B.vxM(e.fingerprintMaterial&&e.userPublicKey?23:-1),B.R7$(2),B.JRh(B.bMT(26,22,"save"))}}class vv{constructor(e,t,i,n,r,s,o,l){this.apiService=e,this.i18nService=t,this.accountService=i,this.dialogService=n,this.toastService=r,this.organizationService=s,this.keyService=o,this.logService=l,this.loading=!0,this.destroy$=new d.B,this.formGroup=new a.gE({name:new a.MJ(null),email:new a.MJ(null)}),this.openChangeAvatar=()=>uv(this,void 0,void 0,function*(){cv.open(this.dialogService,{data:{profile:this.profile}})}),this.submit=()=>uv(this,void 0,void 0,function*(){const e=new Hg(this.formGroup.get("name").value);yield this.apiService.putProfile(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("accountUpdated")})})}ngOnInit(){return uv(this,void 0,void 0,function*(){this.profile=yield this.apiService.getProfile();const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.fingerprintMaterial=e;const t=yield(0,u._)(this.keyService.userPublicKey$(e));null==t?this.logService.error("[ProfileComponent] No public key available for the user: "+e+" fingerprint can't be displayed."):this.userPublicKey=t,this.managingOrganization$=this.organizationService.organizations$(e).pipe((0,p.T)(e=>e.find(e=>!0===e.userIsManagedByOrganization))),this.formGroup.get("name").setValue(this.profile.name),this.formGroup.get("email").setValue(this.profile.email),this.formGroup.get("name").valueChanges.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.profile.name=e}),this.loading=!1})}ngOnDestroy(){return uv(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}}vv.ɵfac=function(e){return new(e||vv)(B.rXU(de.G),B.rXU(U.W),B.rXU(Y.D),B.rXU(R.o3),B.rXU(P.f),B.rXU(f.PV),B.rXU(b.Lu),B.rXU(Vs.K))},vv.ɵcmp=B.VBU({type:vv,selectors:[["app-profile"]],decls:2,vars:2,consts:[[4,"ngIf"],[3,"formGroup","bitSubmit",4,"ngIf"],["name","bwi-spinner",1,"bwi-spin","tw-text-muted",3,"ariaLabel"],[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-6"],[1,"tw-col-span-12","@3xl:tw-col-span-6"],["bitInput","","formControlName","name"],["bitInput","","formControlName","email","readonly",""],[1,"tw-col-span-12","@3xl:tw-col-span-6","tw-row-start-1","@3xl:tw-row-start-auto"],[1,"tw-mb-3","tw-flex","tw-align-middle","tw-items-center"],["size","2xl",3,"text","id"],["type","button","buttonType","secondary","bitButton","","bitFormButton","","appStopClick","","appStopProp","",1,"tw-ml-3",3,"bitAction"],["name","bwi-pencil-square",1,"bwi-lg"],[3,"fingerprintMaterial","publicKeyBuffer","fingerprintLabel"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["target","_blank","rel","noopener noreferrer","href","https://bitwarden.com/help/claimed-accounts"],["name","bwi-question-circle"]],template:function(e,t){1&e&&B.DNE(0,hv,3,3,"div",0)(1,gv,27,24,"form",1),2&e&&(B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",t.profile&&!t.loading))},dependencies:[oh.G,H.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,iv.Y,dv.x,Zp.p,_d.$,eu.L,Jd.Q,tu.j,nu.J,ru.h,LA.R,Wg.O,$g.l,H.Jj,au.$,nv.b],encapsulation:2});class fv extends pn.V{}var mv=i(8433),yv=i(80351),Cv=i(8297),wv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Iv(e,t){1&e&&(B.j41(0,"p",10),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"turnOffNewDeviceLoginProtectionModalDesc")," "))}function bv(e,t){1&e&&(B.j41(0,"p",10),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"turnOnNewDeviceLoginProtectionModalDesc")," "))}function Bv(e,t){1&e&&(B.j41(0,"bit-callout",11),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"turnOffNewDeviceLoginProtectionWarning")))}function Ev(e,t){1&e&&(B.j41(0,"button",12),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"disable")," "))}function Sv(e,t){1&e&&(B.j41(0,"button",13),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"enable")," "))}class Qv{constructor(e,t,i,n,r,s,o,a){this.i18nService=e,this.formBuilder=t,this.accountApiService=i,this.accountService=n,this.userVerificationService=r,this.dialogRef=s,this.toastService=o,this.twoFactorService=a,this.destroy$=new d.B,this.verifyNewDeviceLogin=!0,this.has2faConfigured=!1,this.setVerifyDevicesForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>wv(this,void 0,void 0,function*(){try{const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,pi.Q)(this.destroy$))),t=this.setVerifyDevicesForm.value.verification,i=yield this.userVerificationService.buildRequest(t,fv);i.verifyDevices=!this.verifyNewDeviceLogin,yield this.accountApiService.setVerifyDevices(i),yield this.accountService.setAccountVerifyNewDeviceLogin(e.id,i.verifyDevices),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("accountNewDeviceLoginProtectionSaved")})}catch(e){throw e instanceof ot._&&400===e.statusCode&&(this.invalidSecret=!0),e}}),this.accountService.accountVerifyNewDeviceLogin$.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.verifyNewDeviceLogin=e})}ngOnInit(){return wv(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getEnabledTwoFactorProviders();this.has2faConfigured=e.data.length>0})}static open(e){return e.open(Qv)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Qv.ɵfac=function(e){return new(e||Qv)(B.rXU(U.W),B.rXU(a.ok),B.rXU(It.T),B.rXU(Y.D),B.rXU(Rt.i),B.rXU(R.ce),B.rXU(P.f),B.rXU(Bn.fz))},Qv.ɵcmp=B.VBU({type:Qv,selectors:[["ng-component"]],decls:14,vars:14,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1",4,"ngIf"],["type","warning",4,"ngIf"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger",4,"ngIf"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["bitTypography","body1"],["type","warning"],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"i18n"),B.qex(3,2),B.DNE(4,Iv,3,3,"p",3)(5,bv,3,3,"p",3)(6,Bv,3,3,"bit-callout",4),B.j41(7,"app-user-verification-form-input",5),B.mxI("invalidSecretChange",function(e){return B.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),B.k0s(),B.bVm(),B.qex(8,6),B.DNE(9,Ev,3,3,"button",7)(10,Sv,3,3,"button",8),B.j41(11,"button",9),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.setVerifyDevicesForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("title",B.bMT(2,10,"newDeviceLoginProtection")),B.R7$(3),B.Y8G("ngIf",t.verifyNewDeviceLogin),B.R7$(),B.Y8G("ngIf",!t.verifyNewDeviceLogin),B.R7$(),B.Y8G("ngIf",t.verifyNewDeviceLogin&&!t.has2faConfigured),B.R7$(),B.R50("invalidSecret",t.invalidSecret),B.R7$(2),B.Y8G("ngIf",t.verifyNewDeviceLogin),B.R7$(),B.Y8G("ngIf",!t.verifyNewDeviceLogin),B.R7$(2),B.SpI(" ",B.bMT(13,12,"close")," "))},dependencies:[H.MD,H.bT,a.X1,a.qT,a.BC,a.cb,a.j4,a.JD,jd.p,Xd.L,Kd.C,_d.$,eu.L,Yd.t,Jd.Q,Ld.Q,mv.p,yv.j,zA.G,Cv.K,Nd.P,qd.I,Hd.m,Wd.hJ,le.wV,au.$],encapsulation:2});var kv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Tv(e,t){1&e&&(B.j41(0,"div",4)(1,"h1",5),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"app-change-email"),B.k0s()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"changeEmail")))}function Fv(e,t){if(1&e&&(B.j41(0,"button",6),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitAction",e.setNewDeviceLoginProtection),B.R7$(),B.SpI(" ",B.bMT(2,2,"turnOffNewDeviceLoginProtection")," ")}}function Pv(e,t){if(1&e&&(B.j41(0,"button",7),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitAction",e.setNewDeviceLoginProtection),B.R7$(),B.SpI(" ",B.bMT(2,2,"turnOnNewDeviceLoginProtection")," ")}}function Rv(e,t){if(1&e&&(B.j41(0,"button",6),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitAction",e.purgeVault),B.R7$(),B.SpI(" ",B.bMT(2,2,"purgeVault")," ")}}function Dv(e,t){if(1&e&&(B.j41(0,"button",6),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitAction",e.deleteAccount),B.R7$(),B.SpI(" ",B.bMT(2,2,"deleteAccount")," ")}}class Mv{constructor(e,t,i,n){this.accountService=e,this.dialogService=t,this.userDecryptionOptionsService=i,this.organizationService=n,this.destroy$=new d.B,this.showChangeEmail$=new Ws.c,this.showPurgeVault$=new Ws.c,this.showDeleteAccount$=new Ws.c,this.verifyNewDeviceLogin=!0,this.deauthorizeSessions=()=>kv(this,void 0,void 0,function*(){const e=Kg.open(this.dialogService);yield(0,sg.s)(e.closed)}),this.purgeVault=()=>kv(this,void 0,void 0,function*(){const e=Gg.d.open(this.dialogService);yield(0,sg.s)(e.closed)}),this.deleteAccount=()=>kv(this,void 0,void 0,function*(){const e=qg.open(this.dialogService);yield(0,sg.s)(e.closed)}),this.setNewDeviceLoginProtection=()=>kv(this,void 0,void 0,function*(){const e=Qv.open(this.dialogService);yield(0,sg.s)(e.closed)})}ngOnInit(){return kv(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),t=this.organizationService.organizations$(e).pipe((0,p.T)(e=>e.some(e=>!0===e.userIsManagedByOrganization))),i=this.userDecryptionOptionsService.hasMasterPasswordById$(e);this.showChangeEmail$=i,this.showPurgeVault$=t.pipe((0,p.T)(e=>!e)),this.showDeleteAccount$=t.pipe((0,p.T)(e=>!e)),this.accountService.accountVerifyNewDeviceLogin$.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.verifyNewDeviceLogin=e})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Mv.ɵfac=function(e){return new(e||Mv)(B.rXU(Y.D),B.rXU(R.o3),B.rXU(v.Ym),B.rXU(f.PV))},Mv.ɵcmp=B.VBU({type:Mv,selectors:[["ng-component"]],decls:16,vars:14,consts:[["class","tw-mt-16",4,"ngIf"],["type","button","bitButton","","buttonType","danger",3,"bitAction",4,"ngIf"],["type","button","bitButton","","buttonType","secondary",3,"bitAction",4,"ngIf"],["type","button","bitButton","","buttonType","danger",3,"click"],[1,"tw-mt-16"],["bitTypography","h1"],["type","button","bitButton","","buttonType","danger",3,"bitAction"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container"),B.nrm(2,"app-profile"),B.DNE(3,Tv,5,3,"div",0),B.nI1(4,"async"),B.j41(5,"app-danger-zone"),B.qex(6),B.DNE(7,Fv,3,4,"button",1)(8,Pv,3,4,"button",2),B.bVm(),B.j41(9,"button",3),B.bIt("click",function(){return t.deauthorizeSessions()}),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.DNE(12,Rv,3,4,"button",1),B.nI1(13,"async"),B.DNE(14,Dv,3,4,"button",1),B.nI1(15,"async"),B.k0s()()),2&e&&(B.R7$(3),B.Y8G("ngIf",B.bMT(4,6,t.showChangeEmail$)),B.R7$(4),B.Y8G("ngIf",t.verifyNewDeviceLogin),B.R7$(),B.Y8G("ngIf",!t.verifyNewDeviceLogin),B.R7$(2),B.SpI(" ",B.bMT(11,8,"deauthorizeSessions")," "),B.R7$(2),B.Y8G("ngIf",B.bMT(13,10,t.showPurgeVault$)),B.R7$(2),B.Y8G("ngIf",B.bMT(15,12,t.showDeleteAccount$)))},dependencies:[oh.G,H.bT,Zp.p,Jd.Q,Cg.H,MA.r,yg.G,wg.f,vv,zg,Yg.t,H.Jj,au.$],encapsulation:2});var xv,Ov=i(30675),Gv=i(15740);!function(e){e[e.View=0]="View",e[e.Takeover=1]="Takeover"}(xv||(xv={}));var Uv,Vv=i(57396),jv=i(50352),Nv=i(90246),zv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e.Confirmed="confirmed"}(Uv||(Uv={}));class Yv{constructor(e,t,i,n,r,s){this.params=e,this.formBuilder=t,this.keyService=i,this.organizationManagementPreferencesService=n,this.logService=r,this.dialogRef=s,this.loading=!0,this.confirmForm=this.formBuilder.group({dontAskAgain:[!1]}),this.submit=()=>zv(this,void 0,void 0,function*(){if(!this.loading){this.confirmForm.get("dontAskAgain").value&&(yield this.organizationManagementPreferencesService.autoConfirmFingerPrints.set(!0));try{this.dialogRef.close(Uv.Confirmed)}catch(e){this.logService.error(e)}}})}ngOnInit(){return zv(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.userId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}static open(e,t){return e.open(Yv,t)}}Yv.ɵfac=function(e){return new(e||Yv)(B.rXU(_g.Qs),B.rXU(a.ok),B.rXU(b.Lu),B.rXU(ve.y),B.rXU(Vs.K),B.rXU(R.ce))},Yv.ɵcmp=B.VBU({type:Yv,selectors:[["ng-component"]],decls:30,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&&(B.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),B.EFF(3),B.nI1(4,"i18n"),B.j41(5,"small",3),B.EFF(6),B.k0s()(),B.j41(7,"div",4)(8,"p",5),B.EFF(9),B.nI1(10,"i18n"),B.j41(11,"a",6),B.EFF(12),B.nI1(13,"i18n"),B.k0s()(),B.j41(14,"p",5)(15,"code"),B.EFF(16),B.k0s()(),B.j41(17,"bit-form-control"),B.nrm(18,"input",7),B.j41(19,"bit-label"),B.EFF(20),B.nI1(21,"i18n"),B.k0s()()(),B.qex(22,8),B.j41(23,"button",9)(24,"span"),B.EFF(25),B.nI1(26,"i18n"),B.k0s()(),B.j41(27,"button",10),B.EFF(28),B.nI1(29,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.confirmForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("loading",t.loading),B.R7$(2),B.SpI(" ",B.bMT(4,11,"confirmUser")," "),B.R7$(3),B.JRh(t.params.name),B.R7$(3),B.SpI(" ",B.bMT(10,13,"fingerprintEnsureIntegrityVerify")," "),B.R7$(3),B.SpI(" ",B.bMT(13,15,"learnMore")),B.R7$(4),B.JRh(t.fingerprint),B.R7$(4),B.SpI(" ",B.bMT(21,17,"dontAskFingerprintAgain")),B.R7$(5),B.JRh(B.bMT(26,19,"confirm")),B.R7$(3),B.SpI(" ",B.bMT(29,21,"cancel")," "))},dependencies:[oh.G,a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,jv.P,qd.I,Hd.m,Wd.hJ,Nv.f,tu.j,$d.g,MA.r,au.$],encapsulation:2});var Lv,Kv=i(54471),Xv=i(24374),qv=i(17721),Hv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Wv(e,t){1&e&&B.nrm(0,"app-premium-badge")}function $v(e,t){if(1&e&&(B.j41(0,"small",19),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.JRh(e.params.name)}}function Jv(e,t){1&e&&(B.qex(0),B.j41(1,"p",20),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-form-field")(5,"bit-label"),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.nrm(8,"input",21),B.k0s(),B.bVm()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,2,"inviteEmergencyContactDesc")),B.R7$(4),B.JRh(B.bMT(7,4,"email")))}function Zv(e,t){if(1&e&&B.nrm(0,"bit-option",22),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}function _v(e,t){if(1&e&&(B.nrm(0,"button",23),B.nI1(1,"i18n")),2&e){const e=B.XpG();B.Y8G("label",B.mNQ(B.bMT(1,3,"delete")))("bitAction",e.delete)}}!function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted"}(Lv||(Lv={}));class ef{constructor(e,t,i,n,r,s,o){this.params=e,this.formBuilder=t,this.emergencyAccessService=i,this.i18nService=n,this.logService=r,this.dialogRef=s,this.toastService=o,this.loading=!0,this.readOnly=!1,this.editMode=!1,this.type=xv.View,this.emergencyAccessType=xv,this.addEditForm=this.formBuilder.group({email:["",[a.k0.email,a.k0.required]],emergencyAccessType:[this.emergencyAccessType.View],waitTime:[{value:null,disabled:this.readOnly},[a.k0.required]]}),this.submit=()=>Hv(this,void 0,void 0,function*(){this.addEditForm.invalid?this.addEditForm.markAllAsTouched():(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.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.params.name)}),this.dialogRef.close(Lv.Saved))}),this.delete=()=>Hv(this,void 0,void 0,function*(){this.dialogRef.close(Lv.Deleted)})}ngOnInit(){return Hv(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})}}ef.open=(e,t)=>e.open(ef,t),ef.ɵfac=function(e){return new(e||ef)(B.rXU(_g.Qs),B.rXU(a.ok),B.rXU(gh.p),B.rXU(U.W),B.rXU(Vs.K),B.rXU(R.ce),B.rXU(P.f))},ef.ɵcmp=B.VBU({type:ef,selectors:[["ng-component"]],decls:46,vars:44,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","slot","end",3,"appA11yTitle"],["name","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","dangerGhost",3,"bitAction","label",4,"ngIf"],[1,"tw-text-muted"],["bitTypography","body1"],["bitInput","","formControlName","email"],[3,"value","label"],["type","button","bitFormButton","","bitIconButton","bwi-trash","buttonType","dangerGhost",1,"tw-ml-auto",3,"bitAction","label"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),B.DNE(3,Wv,1,0,"app-premium-badge",3),B.EFF(4),B.DNE(5,$v,2,1,"small",4),B.k0s(),B.qex(6,5),B.DNE(7,Jv,9,6,"ng-container",3),B.j41(8,"bit-radio-group",6)(9,"bit-label"),B.EFF(10),B.nI1(11,"i18n"),B.j41(12,"a",7),B.nI1(13,"i18n"),B.nrm(14,"bit-icon",8),B.k0s()(),B.j41(15,"bit-radio-button",9)(16,"bit-label"),B.EFF(17),B.nI1(18,"i18n"),B.k0s(),B.j41(19,"bit-hint"),B.EFF(20),B.nI1(21,"i18n"),B.k0s()(),B.j41(22,"bit-radio-button",10)(23,"bit-label"),B.EFF(24),B.nI1(25,"i18n"),B.k0s(),B.j41(26,"bit-hint"),B.EFF(27),B.nI1(28,"i18n"),B.k0s()()(),B.j41(29,"bit-form-field",11)(30,"bit-label"),B.EFF(31),B.nI1(32,"i18n"),B.k0s(),B.j41(33,"bit-select",12),B.DNE(34,Zv,1,2,"bit-option",13),B.k0s(),B.j41(35,"bit-hint",14),B.EFF(36),B.nI1(37,"i18n"),B.k0s()(),B.bVm(),B.qex(38,15),B.j41(39,"button",16),B.EFF(40),B.nI1(41,"i18n"),B.k0s(),B.j41(42,"button",17),B.EFF(43),B.nI1(44,"i18n"),B.k0s(),B.DNE(45,_v,2,5,"button",18),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.addEditForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("loading",t.loading),B.R7$(2),B.Y8G("ngIf",t.readOnly),B.R7$(),B.SpI(" ",t.title," "),B.R7$(),B.Y8G("ngIf",t.params.name),B.R7$(2),B.Y8G("ngIf",!t.editMode),B.R7$(),B.Y8G("block",!0),B.R7$(2),B.SpI(" ",B.bMT(11,24,"userAccess")," "),B.R7$(2),B.Y8G("appA11yTitle",B.mNQ(B.bMT(13,26,"learnMoreAboutUserAccess"))),B.R7$(3),B.Y8G("value",t.emergencyAccessType.View),B.R7$(2),B.JRh(B.bMT(18,28,"view")),B.R7$(3),B.JRh(B.bMT(21,30,"viewDesc")),B.R7$(2),B.Y8G("value",t.emergencyAccessType.Takeover),B.R7$(2),B.JRh(B.bMT(25,32,"takeover")),B.R7$(3),B.JRh(B.bMT(28,34,"takeoverDesc")),B.R7$(4),B.JRh(B.bMT(32,36,"waitTime")),B.R7$(3),B.Y8G("ngForOf",t.waitTimes),B.R7$(2),B.JRh(B.bMT(37,38,"waitTimeDesc")),B.R7$(3),B.Y8G("disabled",t.readOnly),B.R7$(),B.SpI(" ",B.bMT(41,40,"save")," "),B.R7$(3),B.SpI(" ",B.bMT(44,42,"cancel")," "),B.R7$(2),B.Y8G("ngIf",t.editMode))},dependencies:[Ph.G,H.Sq,H.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,Kv.C,Zp.p,_d.$,eu.L,Jd.Q,qd.I,Hd.m,Wd.hJ,tu.j,iu.I,nu.J,ru.h,Zd.s,LA.R,$d.g,Xv.d,qv.Y,cg.w,dg.P,MA.r,Ov.a,au.$],encapsulation:2});var tf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function nf(e,t){if(1&e&&(B.j41(0,"small",8),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.JRh(e.dialogData.grantorName)}}function rf(e,t){1&e&&(B.j41(0,"div",3),B.nrm(1,"bit-icon",9),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function sf(e,t){if(1&e){const e=B.RV6();B.j41(0,"auth-input-password",10),B.bIt("onPasswordFormSubmit",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.handlePasswordFormSubmit(t))})("isSubmitting",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.handleIsSubmittingChange(t))}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("flow",e.inputPasswordFlow)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)}}const of="done";class af{constructor(e,t,i,n,r,s,o,a){this.dialogData=e,this.accountService=t,this.dialogRef=i,this.emergencyAccessService=n,this.i18nService=r,this.logService=s,this.policyService=o,this.toastService=a,this.inputPasswordComponent=void 0,this.parentSubmittingBehaviorSubject=new _e.t(!1),this.parentSubmitting$=this.parentSubmittingBehaviorSubject.asObservable(),this.childSubmittingBehaviorSubject=new _e.t(!1),this.childSubmitting$=this.childSubmittingBehaviorSubject.asObservable(),this.submitting$=(0,bi.z)([this.parentSubmitting$,this.childSubmitting$]).pipe((0,p.T)(([e,t])=>e||t)),this.initializing=!0,this.inputPasswordFlow=le.m5.ChangePasswordDelegation,this.handlePrimaryButtonClick=()=>tf(this,void 0,void 0,function*(){if(!this.inputPasswordComponent)throw new Error("InputPasswordComponent is not initialized");yield this.inputPasswordComponent.submit()})}ngOnInit(){return tf(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),t=yield this.emergencyAccessService.getGrantorPolicies(this.dialogData.emergencyAccessId);this.masterPasswordPolicyOptions=yield(0,u._)(this.policyService.masterPasswordPolicyOptions$(e,t)),this.initializing=!1})}handlePasswordFormSubmit(e){return tf(this,void 0,void 0,function*(){this.parentSubmittingBehaviorSubject.next(!0);try{const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.emergencyAccessService.takeover(this.dialogData.emergencyAccessId,e.newPassword,this.dialogData.grantorEmail,t)}catch(t){this.logService.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("unexpectedError")})}finally{this.parentSubmittingBehaviorSubject.next(!1)}this.dialogRef.close(of)})}handleIsSubmittingChange(e){this.childSubmittingBehaviorSubject.next(e)}}af.open=(e,t)=>e.open(af,t),af.ɵfac=function(e){return new(e||af)(B.rXU(_g.Qs),B.rXU(Y.D),B.rXU(R.ce),B.rXU(gh.p),B.rXU(U.W),B.rXU(Vs.K),B.rXU(me.m),B.rXU(P.f))},af.ɵcmp=B.VBU({type:af,selectors:[["auth-emergency-access-takeover-dialog"]],viewQuery:function(e,t){if(1&e&&B.GBs(le.tu,5),2&e){let e;B.mGM(e=B.lsd())&&(t.inputPasswordComponent=e.first)}},decls:16,vars:14,consts:[["bitDialogTitle",""],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],[1,"tw-flex","tw-items-center","tw-justify-center"],[3,"flow","masterPasswordPolicyOptions"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary",3,"click","disabled"],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-muted"],["name","bwi-spinner",1,"bwi-spin","bwi-2x","tw-text-muted",3,"ariaLabel"],[3,"onPasswordFormSubmit","isSubmitting","flow","masterPasswordPolicyOptions"]],template:function(e,t){1&e&&(B.j41(0,"bit-dialog")(1,"span",0),B.EFF(2),B.nI1(3,"i18n"),B.DNE(4,nf,2,1,"small",1),B.k0s(),B.j41(5,"div",2),B.nVh(6,rf,3,3,"div",3)(7,sf,1,2,"auth-input-password",4),B.k0s(),B.qex(8,5),B.j41(9,"button",6),B.nI1(10,"async"),B.bIt("click",function(){return t.handlePrimaryButtonClick()}),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"button",7),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.bVm(),B.k0s()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,6,"takeover")," "),B.R7$(2),B.Y8G("ngIf",t.dialogData.grantorName),B.R7$(2),B.vxM(t.initializing?6:7),B.R7$(3),B.Y8G("disabled",B.bMT(10,8,t.submitting$)),B.R7$(2),B.SpI(" ",B.bMT(12,10,"save")," "),B.R7$(3),B.SpI(" ",B.bMT(15,12,"cancel")," "))},dependencies:[Yd.t,Jd.Q,yv.j,H.MD,H.bT,Nd.P,qd.I,Hd.m,Wd.hJ,YA.o,LA.R,le.tu,H.Jj,Zu.$Z],encapsulation:2});var lf=i(47696),cf=i(13496),df=i(53997),uf=i(78952),hf=i(88832),Af=i(38410),pf=i(22466),gf=i(36572),vf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ff(e,t){1&e&&(B.j41(0,"bit-callout",13),B.nI1(1,"i18n"),B.EFF(2),B.nI1(3,"i18n"),B.k0s()),2&e&&(B.Y8G("title",B.mNQ(B.bMT(1,3,"warning"))),B.R7$(2),B.JRh(B.bMT(3,5,"emergencyAccessOwnerWarning")))}function mf(e,t){1&e&&(B.j41(0,"span",32),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"invited")))}function yf(e,t){1&e&&(B.j41(0,"span",33),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"needsConfirmation")))}function Cf(e,t){1&e&&(B.j41(0,"span",33),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"emergencyAccessRecoveryInitiated")))}function wf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"emergencyAccessRecoveryApproved")))}function If(e,t){if(1&e&&(B.j41(0,"small",35),B.EFF(1),B.k0s()),2&e){const e=B.XpG().$implicit;B.R7$(),B.JRh(e.name)}}function bf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"view")))}function Bf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"takeover")))}function Ef(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.reinvite(t))}),B.nrm(1,"bit-icon",36),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"resendInvitation")," "))}function Sf(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.confirm(t))}),B.nrm(1,"bit-icon",37),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"confirm")," "))}function Qf(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.approve(t))}),B.nrm(1,"bit-icon",37),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"approve")," "))}function kf(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.reject(t))}),B.nrm(1,"bit-icon",31),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"reject")," "))}function Tf(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr",19)(1,"td",20),B.nrm(2,"bit-avatar",21),B.nI1(3,"userName"),B.j41(4,"span",22)(5,"a",23),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(3);return E.Njj(i.edit(t))}),B.EFF(6),B.k0s(),B.DNE(7,mf,3,3,"span",24)(8,yf,3,3,"span",25)(9,Cf,3,3,"span",25)(10,wf,3,3,"span",26)(11,If,2,1,"small",27),B.k0s()(),B.j41(12,"td",15),B.DNE(13,bf,3,3,"span",26)(14,Bf,3,3,"span",26),B.k0s(),B.j41(15,"td",16),B.nrm(16,"button",28),B.nI1(17,"i18n"),B.j41(18,"bit-menu",null,0),B.DNE(20,Ef,4,3,"button",29)(21,Sf,4,3,"button",29)(22,Qf,4,3,"button",29)(23,kf,4,3,"button",29),B.j41(24,"button",30),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(3);return E.Njj(i.remove(t))}),B.nrm(25,"bit-icon",31),B.EFF(26),B.nI1(27,"i18n"),B.k0s()()()()}if(2&e){const e=t.$implicit,i=B.sdS(19),n=B.XpG(3);B.R7$(2),B.Y8G("text",B.bMT(3,19,e))("id",e.granteeId)("color",e.avatarColor),B.R7$(4),B.JRh(e.email),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),B.R7$(),B.Y8G("ngIf",e.name),B.R7$(2),B.Y8G("ngIf",e.type===n.emergencyAccessType.View),B.R7$(),B.Y8G("ngIf",e.type===n.emergencyAccessType.Takeover),B.R7$(2),B.Y8G("label",B.mNQ(B.bMT(17,21,"options")))("bitMenuTriggerFor",i),B.R7$(4),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated||e.status===n.emergencyAccessStatusType.RecoveryApproved),B.R7$(3),B.SpI(" ",B.bMT(27,23,"remove")," ")}}function Ff(e,t){if(1&e&&B.DNE(0,Tf,28,25,"tr",18),2&e){const e=B.XpG(2);B.Y8G("ngForOf",e.trustedContacts)}}function Pf(e,t){1&e&&(B.j41(0,"bit-table"),B.qex(1,14),B.j41(2,"tr")(3,"th",15),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"th",15),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"th",16),B.EFF(10),B.nI1(11,"i18n"),B.k0s()(),B.bVm(),B.DNE(12,Ff,1,1,"ng-template",17),B.k0s()),2&e&&(B.R7$(4),B.JRh(B.bMT(5,3,"name")),B.R7$(3),B.JRh(B.bMT(8,5,"accessLevel")),B.R7$(3),B.JRh(B.bMT(11,7,"options")))}function Rf(e,t){1&e&&(B.j41(0,"p",39),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"noTrustedContacts")))}function Df(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",40),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function Mf(e,t){if(1&e&&(B.qex(0),B.DNE(1,Rf,3,3,"p",38)(2,Df,3,3,"ng-container",11),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.loaded),B.R7$(),B.Y8G("ngIf",!e.loaded)}}function xf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"invited")))}function Of(e,t){1&e&&(B.j41(0,"span",33),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"needsConfirmation")))}function Gf(e,t){1&e&&(B.j41(0,"span",33),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"emergencyAccessRecoveryInitiated")))}function Uf(e,t){1&e&&(B.j41(0,"span",43),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"emergencyAccessRecoveryApproved")))}function Vf(e,t){if(1&e&&(B.j41(0,"small",35),B.EFF(1),B.k0s()),2&e){const e=B.XpG().$implicit;B.R7$(),B.JRh(e.name)}}function jf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"view")))}function Nf(e,t){1&e&&(B.j41(0,"span",34),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"takeover")))}function zf(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.requestAccess(t))}),B.nrm(1,"bit-icon",36),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"requestAccess")," "))}function Yf(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",30),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.takeover(t))}),B.nrm(1,"bit-icon",44),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"takeover")," "))}function Lf(e,t){if(1&e&&(B.j41(0,"button",45),B.nrm(1,"bit-icon",46),B.EFF(2),B.nI1(3,"i18n"),B.k0s()),2&e){const e=B.XpG().$implicit;B.Y8G("routerLink",e.id),B.R7$(2),B.SpI(" ",B.bMT(3,2,"view")," ")}}function Kf(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr",19)(1,"td",20),B.nrm(2,"bit-avatar",21),B.nI1(3,"userName"),B.j41(4,"span",22)(5,"span"),B.EFF(6),B.k0s(),B.DNE(7,xf,3,3,"span",26)(8,Of,3,3,"span",25)(9,Gf,3,3,"span",25)(10,Uf,3,3,"span",41)(11,Vf,2,1,"small",27),B.k0s()(),B.j41(12,"td",15),B.DNE(13,jf,3,3,"span",26)(14,Nf,3,3,"span",26),B.k0s(),B.j41(15,"td",16),B.nrm(16,"button",28),B.nI1(17,"i18n"),B.j41(18,"bit-menu",null,1),B.DNE(20,zf,4,3,"button",29)(21,Yf,4,3,"button",29)(22,Lf,4,4,"button",42),B.j41(23,"button",30),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(3);return E.Njj(i.remove(t))}),B.nrm(24,"bit-icon",31),B.EFF(25),B.nI1(26,"i18n"),B.k0s()()()()}if(2&e){const e=t.$implicit,i=B.sdS(19),n=B.XpG(3);B.R7$(2),B.Y8G("text",B.bMT(3,18,e))("id",e.grantorId)("color",e.avatarColor),B.R7$(4),B.JRh(e.email),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),B.R7$(),B.Y8G("ngIf",e.name),B.R7$(2),B.Y8G("ngIf",e.type===n.emergencyAccessType.View),B.R7$(),B.Y8G("ngIf",e.type===n.emergencyAccessType.Takeover),B.R7$(2),B.Y8G("label",B.mNQ(B.bMT(17,20,"options")))("bitMenuTriggerFor",i),B.R7$(4),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Confirmed),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.Takeover),B.R7$(),B.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.View),B.R7$(3),B.SpI(" ",B.bMT(26,22,"remove")," ")}}function Xf(e,t){if(1&e&&B.DNE(0,Kf,27,24,"tr",18),2&e){const e=B.XpG(2);B.Y8G("ngForOf",e.grantedContacts)}}function qf(e,t){1&e&&(B.j41(0,"bit-table"),B.qex(1,14),B.j41(2,"tr")(3,"th",15),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"th",15),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"th",16),B.EFF(10),B.nI1(11,"i18n"),B.k0s()(),B.bVm(),B.DNE(12,Xf,1,1,"ng-template",17),B.k0s()),2&e&&(B.R7$(4),B.JRh(B.bMT(5,3,"name")),B.R7$(3),B.JRh(B.bMT(8,5,"accessLevel")),B.R7$(3),B.JRh(B.bMT(11,7,"options")))}function Hf(e,t){1&e&&(B.j41(0,"p",2),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"noGrantedAccess")))}function Wf(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",40),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function $f(e,t){if(1&e&&(B.qex(0),B.DNE(1,Hf,3,3,"p",47)(2,Wf,3,3,"ng-container",11),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.loaded),B.R7$(),B.Y8G("ngIf",!e.loaded)}}class Jf{constructor(e,t,i,n,r,s,o,a,l,c,d,h,A,p){this.emergencyAccessService=e,this.i18nService=t,this.platformUtilsService=i,this.messagingService=n,this.userNamePipe=r,this.logService=s,this.stateService=o,this.organizationService=a,this.dialogService=l,this.organizationManagementPreferencesService=d,this.toastService=h,this.apiService=A,this.accountService=p,this.loaded=!1,this.emergencyAccessType=xv,this.emergencyAccessStatusType=Gv.c,this.edit=e=>vf(this,void 0,void 0,function*(){const t=yield(0,u._)(this.canAccessPremium$),i=ef.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:null==e?void 0:e.id,readOnly:!t}}),n=yield(0,sg.s)(i.closed);n===Lv.Saved?yield this.load():n===Lv.Deleted&&(yield this.remove(e))}),this.invite=()=>vf(this,void 0,void 0,function*(){yield this.edit(null)}),this.takeover=e=>vf(this,void 0,void 0,function*(){if(!e||!e.email||!e.id)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("grantorDetailsNotFound")}),void this.logService.error("Grantor details not found when attempting emergency access takeover");const t=this.userNamePipe.transform(e),i=af.open(this.dialogService,{data:{grantorName:t,grantorEmail:e.email,emergencyAccessId:e.id}});(yield(0,sg.s)(i.closed))===of&&this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("passwordResetFor",t)})}),this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,rt.n)(e=>c.hasPremiumFromAnySource$(e.id)))}ngOnInit(){return vf(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),t=yield(0,u._)(this.organizationService.organizations$(e));this.isOrganizationOwner=t.some(e=>e.isOwner),this.load()})}load(){return vf(this,void 0,void 0,function*(){this.trustedContacts=yield this.emergencyAccessService.getEmergencyAccessTrusted(),this.grantedContacts=yield this.emergencyAccessService.getEmergencyAccessGranted(),this.loaded=!0})}reinvite(e){return vf(this,void 0,void 0,function*(){null==this.actionPromise&&(this.actionPromise=this.emergencyAccessService.reinvite(e.id),yield this.actionPromise,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenReinvited",e.email)}),this.actionPromise=null)})}confirm(e){return vf(this,void 0,void 0,function*(){function t(){e.status=Gv.c.Confirmed}if(null!=this.actionPromise)return;const i=yield this.apiService.getUserPublicKey(e.granteeId),n=at.A.fromB64ToArray(i.publicKey),r=yield(0,u._)(this.organizationManagementPreferencesService.autoConfirmFingerPrints.state$);if(null==r||!r){const i=Yv.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:e.id,userId:null==e?void 0:e.granteeId,publicKey:n}});if((yield(0,sg.s)(i.closed))===Uv.Confirmed){const i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.emergencyAccessService.confirm(e.id,e.granteeId,n,i),t(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))})}return}const s=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));this.actionPromise=this.emergencyAccessService.confirm(e.id,e.granteeId,n,s),yield this.actionPromise,t(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))}),this.actionPromise=null})}remove(e){return vf(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.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedUserId",this.userNamePipe.transform(e))}),e instanceof Vv.cY?this.removeGrantee(e):this.removeGrantor(e)}catch(t){this.logService.error(t)}})}requestAccess(e){return vf(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=Gv.c.RecoveryInitiated,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("requestSent",this.userNamePipe.transform(e))})})}approve(e){return vf(this,void 0,void 0,function*(){const t=this.i18nService.t(e.type===xv.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=Gv.c.RecoveryApproved,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emergencyApproved",this.userNamePipe.transform(e))})})}reject(e){return vf(this,void 0,void 0,function*(){yield this.emergencyAccessService.reject(e.id),e.status=Gv.c.Confirmed,this.toastService.showToast({variant:"success",title:null,message: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)}}Jf.ɵfac=function(e){return new(e||Jf)(B.rXU(gh.p),B.rXU(U.W),B.rXU(V.y),B.rXU(js.U),B.rXU(nv.b),B.rXU(Vs.K),B.rXU(w.dw),B.rXU(f.PV),B.rXU(R.o3),B.rXU(Rn.Q),B.rXU(ve.y),B.rXU(P.f),B.rXU(de.G),B.rXU(Y.D))},Jf.ɵcmp=B.VBU({type:Jf,selectors:[["ng-component"]],decls:31,vars:24,consts:[["trustedContactOptions",""],["grantedContactOptions",""],["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"],["name","bwi-plus",1,"bwi-fw"],[4,"ngIf"],["bitTypography","h2"],["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"],[3,"text","id","color"],[1,"tw-inline-flex","tw-gap-2"],["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","primaryGhost",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["name","bwi-close",1,"bwi-fw"],["bitBadge","","variant","secondary"],["bitBadge","","variant","warning"],["bitBadge",""],[1,"tw-text-muted","tw-block"],["name","bwi-envelope",1,"bwi-fw"],["name","bwi-check",1,"bwi-fw"],["bitTypography","body1","class","tw-mt-2",4,"ngIf"],["bitTypography","body1",1,"tw-mt-2"],["name","bwi-spinner",1,"bwi-spin","tw-text-muted",3,"ariaLabel"],["bitBadge","","variant","success",4,"ngIf"],["type","button","bitMenuItem","",3,"routerLink",4,"ngIf"],["bitBadge","","variant","success"],["name","bwi-key",1,"bwi-fw"],["type","button","bitMenuItem","",3,"routerLink"],["name","bwi-eye",1,"bwi-fw"],["bitTypography","body1",4,"ngIf"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container")(2,"bit-section")(3,"p",2)(4,"span",3),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"a",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s()(),B.DNE(10,ff,4,7,"bit-callout",5),B.k0s(),B.j41(11,"bit-section")(12,"div",6)(13,"h2",7),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.nrm(16,"app-premium-badge"),B.j41(17,"div",8)(18,"button",9),B.nI1(19,"async"),B.nrm(20,"bit-icon",10),B.EFF(21),B.nI1(22,"i18n"),B.k0s()()(),B.DNE(23,Pf,13,9,"bit-table",11)(24,Mf,3,2,"ng-container",11),B.k0s(),B.j41(25,"bit-section")(26,"h2",12),B.EFF(27),B.nI1(28,"i18n"),B.k0s(),B.DNE(29,qf,13,9,"bit-table",11)(30,$f,3,2,"ng-container",11),B.k0s()()),2&e&&(B.R7$(5),B.JRh(B.bMT(6,12,"emergencyAccessDesc")),B.R7$(3),B.SpI(" ",B.bMT(9,14,"learnMoreAboutEmergencyAccess")," "),B.R7$(2),B.Y8G("ngIf",t.isOrganizationOwner),B.R7$(4),B.SpI(" ",B.bMT(15,16,"trustedEmergencyContacts")," "),B.R7$(4),B.Y8G("bitAction",t.invite)("disabled",!B.bMT(19,18,t.canAccessPremium$)),B.R7$(3),B.SpI(" ",B.bMT(22,20,"addEmergencyContact")," "),B.R7$(2),B.Y8G("ngIf",t.trustedContacts&&t.trustedContacts.length),B.R7$(),B.Y8G("ngIf",!t.trustedContacts||!t.trustedContacts.length),B.R7$(3),B.JRh(B.bMT(28,22,"designatedEmergencyContacts")),B.R7$(2),B.Y8G("ngIf",t.grantedContacts&&t.grantedContacts.length),B.R7$(),B.Y8G("ngIf",!t.grantedContacts||!t.grantedContacts.length))},dependencies:[Ph.G,H.Sq,H.bT,BA.Wk,iv.Y,Zp.p,Zg.fw,lf.n,Jd.Q,zA.G,Cg.H,Zd.s,LA.R,$d.g,cf.Z,df.O,uf.S,hf.n,Af.Q,pf.Y,gf._,gf.O,MA.r,yg.G,wg.f,Ov.a,H.Jj,au.$,nv.b],encapsulation:2});var Zf=i(50790),_f=i(75421),em=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class tm{constructor(e,t,i){this.params=e,this.dialogRef=t,this.i18nService=i,this.title="",this.cancel=()=>{this.dialogRef.close()},this.updateTitle()}get cipher(){return this.params.cipher}get emergencyAccessId(){return this.params.emergencyAccessId}updateTitle(){switch(this.cipher.type){case mc.gC.Login:this.title=this.i18nService.t("viewItemHeaderLogin");break;case mc.gC.Card:this.title=this.i18nService.t("viewItemHeaderCard");break;case mc.gC.Identity:this.title=this.i18nService.t("viewItemHeaderIdentity");break;case mc.gC.SecureNote:this.title=this.i18nService.t("viewItemHeaderNote");break;case mc.gC.SshKey:this.title=this.i18nService.t("viewItemHeaderSshKey")}}static open(e,t){return e.open(tm,{data:t})}}tm.ɵfac=function(e){return new(e||tm)(B.rXU(_g.Qs),B.rXU(R.ce),B.rXU(U.W))},tm.ɵcmp=B.VBU({type:tm,selectors:[["app-emergency-view-dialog"]],features:[B.Jv_([{provide:_f.Q,useClass:Zf.I},{provide:Lu.l,useClass:class{promptForPremium(){return em(this,void 0,void 0,function*(){return Promise.resolve()})}}},{provide:xd.e3,useClass:xd.bj}])],decls:11,vars:6,consts:[["dialog",""],["dialogContent",""],["dialogSize","large","background","alt"],["bitDialogTitle","","aria-live","polite"],["bitDialogContent",""],[3,"emergencyAccessId","cipher"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","secondary",3,"click"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-dialog",2,0)(2,"span",3),B.EFF(3),B.k0s(),B.j41(4,"div",4,1),B.nrm(6,"app-cipher-view",5),B.k0s(),B.qex(7,6),B.j41(8,"button",7),B.bIt("click",function(){return E.eBV(e),E.Njj(t.cancel())}),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.bVm(),B.k0s()}2&e&&(B.R7$(3),B.SpI(" ",t.title," "),B.R7$(3),B.Y8G("emergencyAccessId",t.emergencyAccessId)("cipher",t.cipher),B.R7$(3),B.SpI(" ",B.bMT(10,4,"cancel")," "))},dependencies:[Yd.t,Jd.Q,xd.k,Nd.P,Hd.m,Wd.hJ,H.MD,jd.p,au.$],encapsulation:2});var im=i(26333),nm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function rm(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",11),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"shared")))}function sm(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",12),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"attachments")))}function om(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr",5)(1,"td",6),B.nrm(2,"app-vault-icon",7),B.k0s(),B.j41(3,"td",8)(4,"a",9),B.nI1(5,"i18n"),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(3);return E.Njj(i.selectCipher(t))}),B.EFF(6),B.k0s(),B.DNE(7,rm,3,3,"ng-container",2)(8,sm,3,3,"ng-container",2),B.nrm(9,"br"),B.j41(10,"small",10),B.EFF(11),B.k0s()()()}if(2&e){const e=t.$implicit;B.R7$(2),B.Y8G("cipher",e),B.R7$(2),B.Y8G("title",B.mNQ(B.bMT(5,7,"editItem"))),B.R7$(2),B.JRh(e.name),B.R7$(),B.Y8G("ngIf",e.organizationId),B.R7$(),B.Y8G("ngIf",e.hasAttachments),B.R7$(3),B.JRh(e.subTitle)}}function am(e,t){if(1&e&&B.DNE(0,om,12,9,"tr",4),2&e){const e=B.XpG(2);B.Y8G("ngForOf",e.ciphers)}}function lm(e,t){1&e&&(B.qex(0),B.j41(1,"bit-table"),B.DNE(2,am,1,1,"ng-template",3),B.k0s(),B.bVm())}function cm(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",13),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}class dm{constructor(e,t,i,n,r){this.router=e,this.route=t,this.emergencyAccessService=i,this.dialogService=n,this.accountService=r,this.id=null,this.ciphers=[],this.loaded=!1}ngOnInit(){return nm(this,void 0,void 0,function*(){const e=yield(0,u._)(this.route.params);if(null==e.id)return void(yield this.router.navigate(["settings/emergency-access"]));this.id=e.id;const t=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.ciphers=yield this.emergencyAccessService.getViewOnlyCiphers(e.id,t),this.loaded=!0})}selectCipher(e){return nm(this,void 0,void 0,function*(){tm.open(this.dialogService,{cipher:e,emergencyAccessId:this.id})})}}dm.ɵfac=function(e){return new(e||dm)(B.rXU(F.Ix),B.rXU(F.nX),B.rXU(gh.p),B.rXU(R.o3),B.rXU(Y.D))},dm.ɵcmp=B.VBU({type:dm,selectors:[["ng-component"]],features:[B.Jv_([{provide:xd.hI,useClass:xd.Ws}])],decls:6,vars:5,consts:[["bitTypography","h1"],[1,"tw-mt-6"],[4,"ngIf"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell",""],[3,"cipher"],["bitCell","",1,"tw-w-full"],["bitLink","","href","#","appStopClick","",3,"click","title"],[1,"tw-text-xs"],["name","bwi-collection-shared","appStopProp","",1,"tw-ml-1",3,"ariaLabel"],["name","bwi-paperclip","appStopProp","",1,"tw-ml-1",3,"ariaLabel"],["name","bwi-spinner",1,"bwi-spin","tw-text-muted",3,"ariaLabel"]],template:function(e,t){1&e&&(B.j41(0,"h1",0),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.j41(3,"div",1),B.DNE(4,lm,3,0,"ng-container",2)(5,cm,3,3,"ng-container",2),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,3,"vault")),B.R7$(3),B.Y8G("ngIf",t.ciphers.length),B.R7$(),B.Y8G("ngIf",!t.loaded))},dependencies:[Ph.G,H.Sq,H.bT,im.R,iv.Y,dv.x,LA.R,$d.g,Af.Q,pf.Y,gf._,gf.O,MA.r,au.$],encapsulation:2});var um=i(79783),hm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Am(e,t){1&e&&(B.j41(0,"div",7),B.nrm(1,"bit-icon",8),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function pm(e,t){if(1&e&&(B.qex(0),B.DNE(1,Am,3,3,"div",6),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.loading)}}function gm(e,t){if(1&e&&(B.qex(0),B.j41(1,"p"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"div")(5,"span",9),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"p",10),B.EFF(9),B.k0s()(),B.j41(10,"div")(11,"span",9),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"p"),B.EFF(15),B.k0s()(),B.j41(16,"div")(17,"span",9),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.j41(20,"p")(21,"span",11),B.EFF(22),B.k0s(),B.EFF(23),B.k0s()(),B.j41(24,"div")(25,"span",9),B.EFF(26),B.nI1(27,"i18n"),B.k0s(),B.j41(28,"p"),B.EFF(29),B.k0s()(),B.bVm()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.i5U(3,10,"accessAttemptBy",e.email)),B.R7$(4),B.JRh(B.bMT(7,13,"fingerprintPhraseHeader")),B.R7$(3),B.JRh(e.fingerprintPhrase),B.R7$(3),B.JRh(B.bMT(13,15,"deviceType")),B.R7$(3),B.JRh(e.readableDeviceTypeName),B.R7$(3),B.JRh(B.bMT(19,17,"location")),B.R7$(4),B.SpI("",null==e.authRequestResponse?null:e.authRequestResponse.requestCountryName," "),B.R7$(),B.SpI(" (",null==e.authRequestResponse?null:e.authRequestResponse.requestIpAddress,") "),B.R7$(3),B.JRh(B.bMT(27,19,"time")),B.R7$(3),B.JRh(e.requestTimeText)}}const vm=3e5;class fm{constructor(e,t,i,n,r,s,o,a,l,c){this.params=e,this.accountService=t,this.apiService=i,this.authRequestService=n,this.devicesService=r,this.dialogRef=s,this.i18nService=o,this.logService=a,this.toastService=l,this.validationService=c,this.loading=!0,this.denyLogin=()=>hm(this,void 0,void 0,function*(){yield this.retrieveAuthRequestAndRespond(!1)}),this.approveLogin=()=>hm(this,void 0,void 0,function*(){yield this.retrieveAuthRequestAndRespond(!0)}),this.authRequestId=e.notificationId}ngOnDestroy(){return hm(this,void 0,void 0,function*(){clearInterval(this.interval)})}ngOnInit(){return hm(this,void 0,void 0,function*(){if(null==this.authRequestId)return void this.logService.error("LoginApprovalDialogComponent: authRequestId is null");try{this.authRequestResponse=yield this.apiService.getAuthRequest(this.authRequestId)}catch(t){this.validationService.showError(t),this.logService.error("LoginApprovalDialogComponent: getAuthRequest error",t)}if(null==this.authRequestResponse)return void this.logService.error("LoginApprovalDialogComponent: authRequestResponse not found");const e=at.A.fromB64ToArray(this.authRequestResponse.publicKey);this.email=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.email))),this.email?(this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,e),this.readableDeviceTypeName=this.devicesService.getReadableDeviceTypeName(this.authRequestResponse.requestDeviceTypeValue),this.updateTimeText(),this.interval=setInterval(()=>{this.updateTimeText()},vm),this.loading=!1):this.logService.error("LoginApprovalDialogComponent: email not found")})}static open(e,t){return e.open(fm,{data:t})}retrieveAuthRequestAndRespond(e){return hm(this,void 0,void 0,function*(){if(this.authRequestResponse=yield this.apiService.getAuthRequest(this.authRequestId),this.authRequestResponse.requestApproved||null!=this.authRequestResponse.responseDate)this.toastService.showToast({variant:"info",message:this.i18nService.t("thisRequestIsNoLongerValid")});else{const t=yield this.authRequestService.approveOrDenyAuthRequest(e,this.authRequestResponse);this.showResultToast(t)}this.dialogRef.close(e)})}showResultToast(e){e.requestApproved?this.toastService.showToast({variant:"success",message:this.i18nService.t("loginRequestApprovedForEmailOnDevice",this.email,this.devicesService.getReadableDeviceTypeName(e.requestDeviceTypeValue))}):this.toastService.showToast({variant:"info",message:this.i18nService.t("youDeniedLoginAttemptFromAnotherDevice")})}updateTimeText(){if(null==this.authRequestResponse)return void this.logService.error("LoginApprovalDialogComponent: authRequestResponse not found");const e=new Date(this.authRequestResponse.creationDate),t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),i=new Date(Date.now()),n=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds())-t;n<=vm?this.requestTimeText=this.i18nService.t("justNow"):n<9e5?this.requestTimeText=this.i18nService.t("requestedXMinutesAgo",(n/6e4).toFixed()):(clearInterval(this.interval),this.dialogRef.close(),this.toastService.showToast({variant:"info",message:this.i18nService.t("loginRequestHasAlreadyExpired")}))}}fm.ɵfac=function(e){return new(e||fm)(B.rXU(_g.Qs),B.rXU(Y.D),B.rXU(de.G),B.rXU(v.XF),B.rXU(St),B.rXU(R.ce),B.rXU(U.W),B.rXU(Ju.Kc),B.rXU(P.f),B.rXU(Xs.B))},fm.ɵcmp=B.VBU({type:fm,selectors:[["ng-component"]],decls:14,vars:15,consts:[["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"bitAction","disabled"],["bitButton","","type","button","buttonType","secondary",3,"bitAction","disabled"],["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x",3,"ariaLabel"],[1,"tw-font-medium"],[1,"tw-text-code"],[1,"tw-capitalize"]],template:function(e,t){1&e&&(B.j41(0,"bit-dialog")(1,"span",0),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.qex(4,1),B.DNE(5,pm,2,1,"ng-container",2)(6,gm,30,21,"ng-container",2),B.bVm(),B.qex(7,3),B.j41(8,"button",4),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.j41(11,"button",5),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.bVm(),B.k0s()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,9,"loginRequest")),B.R7$(3),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",!t.loading),B.R7$(2),B.Y8G("bitAction",t.approveLogin)("disabled",t.loading),B.R7$(),B.SpI(" ",B.bMT(10,11,"confirmAccess")," "),B.R7$(2),B.Y8G("bitAction",t.denyLogin)("disabled",t.loading),B.R7$(),B.SpI(" ",B.bMT(13,13,"denyAccess")," "))},dependencies:[Kd.C,Zp.p,Yd.t,Jd.Q,H.MD,H.bT,Nd.P,Hd.m,Wd.hJ,YA.o,LA.R,jd.p,au.$],encapsulation:2});var mm=i(639),ym=i(98403),Cm=i(75556),wm=i(90300),Im=i(91962);function bm(e,t){1&e&&(B.j41(0,"span"),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"trusted")))}function Bm(e,t){1&e&&B.nrm(0,"br")}function Em(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",3),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG();return E.Njj(i.answerAuthRequest(t.pendingAuthRequest))}),B.j41(1,"span",4),B.EFF(2),B.k0s(),B.j41(3,"span",5)(4,"span",6),B.EFF(5),B.nI1(6,"i18n"),B.k0s()(),B.j41(7,"span",7),B.nVh(8,bm,3,3,"span")(9,Bm,1,0,"br"),B.j41(10,"div")(11,"span",8),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"span"),B.EFF(15),B.nI1(16,"date"),B.k0s()()()()}if(2&e){const e=B.XpG().$implicit;B.BMQ("tabindex",null!=e.pendingAuthRequest?0:null),B.R7$(2),B.JRh(e.displayName),B.R7$(3),B.SpI(" ",B.bMT(6,6,"requestPending")," "),B.R7$(3),B.vxM(e.isTrusted?8:9),B.R7$(4),B.SpI(" ",B.bMT(13,8,"firstLogin"),": "),B.R7$(3),B.JRh(B.i5U(16,10,e.firstLogin,"medium"))}}function Sm(e,t){1&e&&(B.j41(0,"div",5)(1,"span",10),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"currentSession")," "))}function Qm(e,t){1&e&&(B.j41(0,"span"),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"trusted")))}function km(e,t){1&e&&B.nrm(0,"br")}function Tm(e,t){if(1&e&&(B.j41(0,"bit-item-content",2)(1,"span",4),B.EFF(2),B.k0s(),B.DNE(3,Sm,4,3,"div",9),B.j41(4,"div",7),B.nVh(5,Qm,3,3,"span")(6,km,1,0,"br"),B.j41(7,"div")(8,"span",8),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.j41(11,"span"),B.EFF(12),B.nI1(13,"date"),B.k0s()()()()),2&e){const e=B.XpG().$implicit;B.R7$(2),B.JRh(e.displayName),B.R7$(),B.Y8G("ngIf",e.isCurrentDevice),B.R7$(2),B.vxM(e.isTrusted?5:6),B.R7$(4),B.SpI("",B.bMT(10,5,"firstLogin"),": "),B.R7$(3),B.JRh(B.i5U(13,7,e.firstLogin,"medium"))}}function Fm(e,t){if(1&e&&(B.j41(0,"bit-item"),B.nVh(1,Em,17,13,"button",1)(2,Tm,14,10,"bit-item-content",2),B.k0s()),2&e){const e=t.$implicit;B.R7$(),B.vxM(e.pendingAuthRequest?1:2)}}class Pm{constructor(){this.devices=[],this.onAuthRequestAnswered=new B.bkB}answerAuthRequest(e){null!=e&&this.onAuthRequestAnswered.emit(e)}}Pm.ɵfac=function(e){return new(e||Pm)},Pm.ɵcmp=B.VBU({type:Pm,selectors:[["auth-device-management-item-group"]],inputs:{devices:"devices"},outputs:{onAuthRequestAnswered:"onAuthRequestAnswered"},decls:2,vars:1,consts:[[4,"ngFor","ngForOf"],["bit-item-content","","type","button",1,"tw-relative"],["ngClass","tw-relative"],["bit-item-content","","type","button",1,"tw-relative",3,"click"],[1,"tw-text-base"],["slot","default-trailing",1,"tw-absolute","tw-top-[6px]","tw-right-3"],["bitBadge","","variant","warning"],["slot","secondary",1,"tw-text-sm"],[1,"tw-font-medium"],["class","tw-absolute tw-top-[6px] tw-right-3","slot","default-trailing",4,"ngIf"],["bitBadge","","variant","primary"]],template:function(e,t){1&e&&(B.j41(0,"bit-item-group"),B.DNE(1,Fm,3,1,"bit-item",0),B.k0s()),2&e&&(B.R7$(),B.Y8G("ngForOf",t.devices))},dependencies:[mm.E,lf.n,H.MD,H.YU,H.Sq,H.bT,ym.k,Cm.J,wm.g,Im._,H.vh,Zu.$Z],encapsulation:2});var Rm=i(55542),Dm=i(47659),Mm=i(30930),xm=i(32316);function Om(e,t){if(1&e&&(B.j41(0,"th",4),B.EFF(1),B.k0s()),2&e){const e=t.$implicit;B.HbH(e.headerClass),B.Y8G("bitSortable",e.sortable?e.name:""),B.R7$(),B.SpI(" ",e.title," ")}}function Gm(e,t){1&e&&(B.j41(0,"div",14),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"trusted")," "))}function Um(e,t){if(1&e){const e=B.RV6();B.j41(0,"a",12),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG();return E.Njj(i.answerAuthRequest(t.pendingAuthRequest))}),B.EFF(1),B.k0s(),B.DNE(2,Gm,3,3,"div",13)}if(2&e){const e=B.XpG().$implicit;B.R7$(),B.SpI(" ",e.displayName," "),B.R7$(),B.Y8G("ngIf",e.isTrusted)}}function Vm(e,t){1&e&&(B.j41(0,"div",14),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"trusted")," "))}function jm(e,t){if(1&e&&(B.j41(0,"span"),B.EFF(1),B.k0s(),B.DNE(2,Vm,3,3,"div",13)),2&e){const e=B.XpG().$implicit;B.R7$(),B.JRh(e.displayName),B.R7$(),B.Y8G("ngIf",e.isTrusted)}}function Nm(e,t){1&e&&(B.j41(0,"span",15),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"currentSession")," "))}function zm(e,t){1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"requestPending")," "))}function Ym(e,t){if(1&e&&(B.j41(0,"td",5)(1,"div",6),B.nrm(2,"bit-icon",7),B.k0s(),B.j41(3,"div"),B.nVh(4,Um,3,2)(5,jm,3,2),B.k0s()(),B.j41(6,"td",8)(7,"div",9),B.DNE(8,Nm,3,3,"span",10)(9,zm,3,3,"span",11),B.k0s()(),B.j41(10,"td",8),B.EFF(11),B.nI1(12,"date"),B.k0s()),2&e){const e=t.$implicit;B.R7$(2),B.Y8G("name",e.icon),B.R7$(2),B.vxM(e.pendingAuthRequest?4:5),B.R7$(4),B.Y8G("ngIf",e.isCurrentDevice),B.R7$(),B.Y8G("ngIf",e.pendingAuthRequest),B.R7$(2),B.JRh(B.i5U(12,5,e.firstLogin,"medium"))}}class Lm{constructor(e){this.i18nService=e,this.devices=[],this.onAuthRequestAnswered=new B.bkB,this.tableDataSource=new Rm.s,this.columnConfig=[{name:"displayName",title:this.i18nService.t("device"),headerClass:"tw-w-1/3",sortable:!0},{name:"loginStatus",title:this.i18nService.t("loginStatus"),headerClass:"tw-w-1/3",sortable:!0},{name:"firstLogin",title:this.i18nService.t("firstLogin"),headerClass:"tw-w-1/3",sortable:!0}]}ngOnChanges(e){e.devices&&(this.tableDataSource.data=this.devices)}answerAuthRequest(e){null!=e&&this.onAuthRequestAnswered.emit(e)}}function Km(e,t){return e.pendingAuthRequest?-1:t.pendingAuthRequest?1:e.isCurrentDevice?-1:t.isCurrentDevice?1:e.creationDate>t.creationDate?-1:e.creationDate<t.creationDate?1:0}Lm.ɵfac=function(e){return new(e||Lm)(B.rXU(U.W))},Lm.ɵcmp=B.VBU({type:Lm,selectors:[["auth-device-management-table"]],inputs:{devices:"devices"},outputs:{onAuthRequestAnswered:"onAuthRequestAnswered"},features:[B.OA$],decls:4,vars:3,consts:[[3,"dataSource","rowSize"],["header",""],["bitCell","","scope","col","role","columnheader",3,"class","bitSortable",4,"ngFor","ngForOf"],["bitRowDef",""],["bitCell","","scope","col","role","columnheader",3,"bitSortable"],["bitCell","",1,"tw-flex","tw-gap-2","tw-items-center","tw-h-16"],[1,"tw-flex","tw-items-center","tw-justify-center","tw-w-10"],[1,"bwi-lg",3,"name"],["bitCell",""],[1,"tw-flex","tw-gap-1"],["bitBadge","","variant","primary",4,"ngIf"],["bitBadge","","variant","warning",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click"],["class","tw-text-sm tw-text-muted",4,"ngIf"],[1,"tw-text-sm","tw-text-muted"],["bitBadge","","variant","primary"],["bitBadge","","variant","warning"]],template:function(e,t){1&e&&(B.j41(0,"bit-table-scroll",0),B.qex(1,1),B.DNE(2,Om,2,4,"th",2),B.bVm(),B.DNE(3,Ym,13,8,"ng-template",3),B.k0s()),2&e&&(B.Y8G("dataSource",t.tableDataSource)("rowSize",64),B.R7$(2),B.Y8G("ngForOf",t.columnConfig))},dependencies:[mm.E,lf.n,Yd.t,H.MD,H.Sq,H.bT,YA.o,LA.R,jd.p,iv.Y,zd.V,$d.g,Dm.b,Mm.a,Af.Q,xm.O,Mm.N,H.vh,au.$],encapsulation:2});var Xm=i(85800),qm=i(63581),Hm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Wm(e,t){if(1&e&&(B.j41(0,"div",3)(1,"div",4)(2,"h1",5),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"button",6),B.nrm(6,"bit-icon",7),B.k0s(),B.j41(7,"bit-popover",8,0),B.nI1(9,"i18n"),B.j41(10,"p",9),B.EFF(11),B.nI1(12,"i18n"),B.k0s()()(),B.j41(13,"p"),B.EFF(14),B.nI1(15,"i18n"),B.k0s()()),2&e){const e=B.sdS(8);B.R7$(3),B.JRh(B.bMT(4,5,"devices")),B.R7$(2),B.Y8G("bitPopoverTriggerFor",e),B.R7$(2),B.Y8G("title",B.bMT(9,7,"whatIsADevice")),B.R7$(4),B.JRh(B.bMT(12,9,"aDeviceIs")),B.R7$(3),B.SpI(" ",B.bMT(15,11,"deviceListDescriptionTemp")," ")}}function $m(e,t){1&e&&(B.j41(0,"div",2),B.nrm(1,"bit-icon",10),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function Jm(e,t){if(1&e){const e=B.RV6();B.j41(0,"auth-device-management-table",11),B.bIt("onAuthRequestAnswered",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.handleAuthRequestAnswered(t))}),B.k0s(),B.j41(1,"auth-device-management-item-group",12),B.bIt("onAuthRequestAnswered",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.handleAuthRequestAnswered(t))}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("devices",e.devices),B.R7$(),B.Y8G("devices",e.devices)}}class Zm{constructor(e,t,i,n,r,s,o,a,l,c){this.accountService=e,this.authRequestApiService=t,this.destroyRef=i,this.deviceManagementComponentService=n,this.devicesService=r,this.dialogService=s,this.i18nService=o,this.messageListener=a,this.pendingAuthRequestStateService=l,this.validationService=c,this.devices=[],this.initializing=!0,this.showHeaderInfo=!1,this.showHeaderInfo=this.deviceManagementComponentService.showHeaderInformation()}ngOnInit(){return Hm(this,void 0,void 0,function*(){yield this.loadDevices(),this.messageListener.allMessages$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{"openLoginApproval"===e.command&&e.notificationId&&"string"==typeof e.notificationId&&this.upsertDeviceWithPendingAuthRequest(e.notificationId)})})}loadDevices(){return Hm(this,void 0,void 0,function*(){try{const e=yield(0,u._)(this.devicesService.getDevices$()),t=yield(0,u._)(this.devicesService.getCurrentDevice$());if(!e||!t)return;this.devices=this.mapDevicesToDisplayData(e,t)}catch(e){this.validationService.showError(e)}finally{this.initializing=!1}})}mapDevicesToDisplayData(e,t){return e.map(e=>{var i,n,r,s,o;return e.id?null==e.type?(this.validationService.showError(new Error(this.i18nService.t("deviceTypeMissing"))),null):e.creationDate?{creationDate:e.creationDate,displayName:this.devicesService.getReadableDeviceTypeName(e.type),firstLogin:e.creationDate?new Date(e.creationDate):new Date,icon:this.getDeviceIcon(e.type),id:e.id||"",identifier:null!==(i=e.identifier)&&void 0!==i?i:"",isCurrentDevice:this.isCurrentDevice(e,t),isTrusted:null!==(r=null===(n=e.response)||void 0===n?void 0:n.isTrusted)&&void 0!==r&&r,loginStatus:this.getLoginStatus(e,t),pendingAuthRequest:null!==(o=null===(s=e.response)||void 0===s?void 0:s.devicePendingAuthRequest)&&void 0!==o?o:null}:(this.validationService.showError(new Error(this.i18nService.t("deviceCreationDateMissing"))),null):(this.validationService.showError(new Error(this.i18nService.t("deviceIdMissing"))),null)}).filter(e=>null!==e).sort(Km)}upsertDeviceWithPendingAuthRequest(e){return Hm(this,void 0,void 0,function*(){var t,i;const n=yield this.authRequestApiService.getAuthRequest(e);if(!n)return;const r={creationDate:"",displayName:this.devicesService.getReadableDeviceTypeName(n.requestDeviceTypeValue),firstLogin:new Date(n.creationDate),icon:this.getDeviceIcon(n.requestDeviceTypeValue),id:"",identifier:n.requestDeviceIdentifier,isCurrentDevice:!1,isTrusted:!1,loginStatus:this.i18nService.t("requestPending"),pendingAuthRequest:{id:n.id,creationDate:n.creationDate}};if(n.requestDeviceIdentifier){const e=yield(0,u._)(this.devicesService.getDeviceByIdentifier$(n.requestDeviceIdentifier));(null==e?void 0:e.id)&&e.creationDate&&(r.creationDate=e.creationDate,r.firstLogin=new Date(e.creationDate),r.id=e.id,r.isTrusted=null!==(i=null===(t=e.response)||void 0===t?void 0:t.isTrusted)&&void 0!==i&&i)}const s=this.devices.findIndex(e=>e.identifier===r.identifier);s>=0?(this.devices[s]=r,this.devices=[...this.devices].sort(Km)):this.devices=[r,...this.devices].sort(Km)})}getLoginStatus(e,t){return this.isCurrentDevice(e,t)?this.i18nService.t("currentSession"):this.hasPendingAuthRequest(e)?this.i18nService.t("requestPending"):""}isCurrentDevice(e,t){return e.id===t.id}hasPendingAuthRequest(e){var t;return null!=(null===(t=e.response)||void 0===t?void 0:t.devicePendingAuthRequest)}getDeviceIcon(e){var t;const i="bwi-desktop",n=st.mz[e];return n&&null!==(t={webApp:"bwi-browser",desktop:"bwi-desktop",mobile:"bwi-mobile",cli:"bwi-cli",extension:"bwi-puzzle",sdk:"bwi-desktop"}[n.category])&&void 0!==t?t:i}handleAuthRequestAnswered(e){return Hm(this,void 0,void 0,function*(){const t=fm.open(this.dialogService,{notificationId:e.id}),i=yield(0,u._)(t.closed);void 0!==i&&"boolean"==typeof i&&(this.devices=function(e,t){return e.map(e=>{var i;return(null===(i=e.pendingAuthRequest)||void 0===i?void 0:i.id)===t.id&&(e.pendingAuthRequest=null,e.loginStatus=""),e}).sort(Km)}(this.devices,e),yield this.pendingAuthRequestStateService.clear(yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6))))})}}Zm.ɵfac=function(e){return new(e||Zm)(B.rXU(Y.D),B.rXU(v.d8),B.rXU(E.abz),B.rXU(ie),B.rXU(St),B.rXU(R.o3),B.rXU(U.W),B.rXU(io.qk),B.rXU(wi),B.rXU(Xs.B))},Zm.ɵcmp=B.VBU({type:Zm,selectors:[["auth-device-management"]],decls:3,vars:2,consts:[["infoPopover",""],["class","tw-mt-6 tw-mb-2 tw-pb-2.5",4,"ngIf"],[1,"tw-flex","tw-justify-center","tw-items-center","tw-p-4"],[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-5"],[1,"tw-m-0"],["type","button","position","right-start",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-flex","tw-items-center","tw-size-4",3,"bitPopoverTriggerFor"],["name","bwi-question-circle"],[3,"title"],[1,"tw-mb-0"],["name","bwi-spinner",1,"bwi-spin","tw-text-2xl",3,"ariaLabel"],["ngClass","tw-hidden md:tw-block",3,"onAuthRequestAnswered","devices"],["ngClass","md:tw-hidden",3,"onAuthRequestAnswered","devices"]],template:function(e,t){1&e&&(B.DNE(0,Wm,16,13,"div",1),B.nVh(1,$m,3,3,"div",2)(2,Jm,2,2)),2&e&&(B.Y8G("ngIf",t.showHeaderInfo),B.R7$(),B.vxM(t.initializing?1:2))},dependencies:[Yd.t,H.MD,H.YU,H.bT,Pm,Lm,YA.o,LA.R,um.k,Xm.r,qm.k,Zu.$Z],encapsulation:2});class _m{}_m.ɵfac=function(e){return new(e||_m)},_m.ɵcmp=B.VBU({type:_m,selectors:[["ng-component"]],decls:5,vars:3,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg"]],template:function(e,t){1&e&&(B.j41(0,"h2",0),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.j41(3,"div",1),B.nrm(4,"bit-session-timeout-settings"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"sessionTimeoutHeader")))},dependencies:[Xu.C7,jd.p,au.$],encapsulation:2,changeDetection:0});var ey,ty=i(43600),iy=i(40640),ny=i(7855),ry=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function sy(e,t){if(1&e){const e=B.RV6();B.qex(0)(1,11),B.j41(2,"app-user-verification",12),B.mxI("invalidSecretChange",function(t){E.eBV(e);const i=B.XpG();return B.DH7(i.invalidSecret,t)||(i.invalidSecret=t),E.Njj(t)}),B.k0s(),B.bVm()()}if(2&e){const e=B.XpG();B.R7$(2),B.R50("invalidSecret",e.invalidSecret)}}function oy(e,t){if(1&e&&(B.j41(0,"div",13)(1,"div",14),B.nrm(2,"bit-svg",15),B.k0s(),B.j41(3,"h3",16),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"p",17),B.EFF(7),B.nI1(8,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.Y8G("content",e.Icons.TwoFactorAuthSecurityKeyIcon),B.R7$(2),B.JRh(B.bMT(5,3,"creatingPasskeyLoading")),B.R7$(3),B.JRh(B.bMT(8,5,"creatingPasskeyLoadingInfo"))}}function ay(e,t){if(1&e&&(B.j41(0,"div",13)(1,"div",14),B.nrm(2,"bit-svg",15),B.k0s(),B.j41(3,"h3",16),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"p",17),B.EFF(7),B.nI1(8,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.Y8G("content",e.Icons.TwoFactorAuthSecurityKeyFailedIcon),B.R7$(2),B.JRh(B.bMT(5,3,"errorCreatingPasskey")),B.R7$(3),B.JRh(B.bMT(8,5,"errorCreatingPasskeyInfo"))}}function ly(e,t){1&e&&(B.j41(0,"bit-form-control",22),B.nrm(1,"input",23),B.j41(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"bit-hint"),B.EFF(6),B.nI1(7,"i18n"),B.k0s()()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,2,"useForVaultEncryption")),B.R7$(3),B.JRh(B.bMT(7,4,"useForVaultEncryptionInfo")))}function cy(e,t){if(1&e&&(B.j41(0,"div",18)(1,"h3",16),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"p",17),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-form-field",19)(8,"bit-label"),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.nrm(11,"input",20),B.j41(12,"bit-hint"),B.EFF(13),B.nI1(14,"i18n"),B.k0s()(),B.DNE(15,ly,8,6,"bit-form-control",21),B.k0s()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,5,"passkeySuccessfullyCreated")),B.R7$(3),B.SpI(" ",B.bMT(6,7,"customPasskeyNameInfo")," "),B.R7$(4),B.JRh(B.bMT(10,9,"name")),B.R7$(4),B.JRh(B.brH(14,11,"charactersCurrentAndMaximum",e.formGroup.value.credentialNaming.name.length,e.NameMaxCharacters)),B.R7$(2),B.Y8G("ngIf",null==e.pendingCredential?null:e.pendingCredential.supportsPrf)}}function dy(e,t){1&e&&(B.qex(0),B.EFF(1),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"continue")," "))}function uy(e,t){1&e&&(B.qex(0),B.EFF(1),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"continue")," "))}function hy(e,t){1&e&&(B.qex(0),B.EFF(1),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"tryAgain")," "))}function Ay(e,t){if(1&e&&(B.qex(0),B.EFF(1),B.nI1(2,"async"),B.nI1(3,"i18n"),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.SpI(" ",B.bMT(3,3,B.bMT(2,1,e.hasPasskeys$)?"save":"enable")," ")}}!function(e){e[e.Success=0]="Success"}(ey||(ey={}));class py{constructor(e,t,i,n,r,s,o){this.formBuilder=e,this.dialogRef=t,this.webauthnService=i,this.i18nService=n,this.logService=r,this.toastService=s,this.accountService=o,this.NameMaxCharacters=50,this.CreateCredentialDialogResult=ey,this.Icons={TwoFactorAuthSecurityKeyIcon:FA.s,TwoFactorAuthSecurityKeyFailedIcon:PA.f},this.currentStep="userVerification",this.invalidSecret=!1,this.formGroup=this.formBuilder.group({userVerification:this.formBuilder.group({secret:[null,a.k0.required]}),credentialNaming:this.formBuilder.group({name:["",a.k0.maxLength(50)],useForEncryption:[!0]})}),this.loading$=this.webauthnService.loading$,this.submit=()=>ry(this,void 0,void 0,function*(){this.dialogRef.disableClose=!0;try{switch(this.currentStep){case"userVerification":return yield this.submitUserVerification();case"credentialCreationFailed":return yield this.submitCredentialCreationFailed();case"credentialCreation":return yield this.submitCredentialCreation();case"credentialNaming":return yield this.submitCredentialNaming()}}finally{this.dialogRef.disableClose=!1}})}ngOnInit(){this.hasPasskeys$=this.webauthnService.getCredentials$().pipe((0,p.T)(e=>e.length>0))}submitUserVerification(){return ry(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.userVerification.markAllAsTouched(),!this.formGroup.controls.userVerification.invalid){try{this.credentialOptions=yield this.webauthnService.getCredentialAttestationOptions(this.formGroup.value.userVerification.secret)}catch(t){return void(t instanceof ot._&&400===t.statusCode?this.invalidSecret=!0:(null===(e=this.logService)||void 0===e||e.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("unexpectedError"),message:t.message})))}this.currentStep="credentialCreation",yield this.submitCredentialCreation()}})}submitCredentialCreation(){return ry(this,void 0,void 0,function*(){this.pendingCredential=yield this.webauthnService.createCredential(this.credentialOptions),void 0!==this.pendingCredential?this.currentStep="credentialNaming":this.currentStep="credentialCreationFailed"})}submitCredentialCreationFailed(){return ry(this,void 0,void 0,function*(){this.currentStep="credentialCreation",yield this.submitCredentialCreation()})}submitCredentialNaming(){return ry(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.credentialNaming.markAllAsTouched(),this.formGroup.controls.credentialNaming.controls.name.invalid)return;const t=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));let i;if(this.pendingCredential.supportsPrf&&this.formGroup.value.credentialNaming.useForEncryption&&(i=yield this.webauthnService.createKeySet(this.pendingCredential,t),void 0===i))return void(null===(e=this.formGroup.controls.credentialNaming.controls.useForEncryption)||void 0===e||e.setErrors({error:{message:this.i18nService.t("useForVaultEncryptionErrorReadingPasskey")}}));const n=this.formGroup.value.credentialNaming.name;yield this.webauthnService.saveCredential(this.formGroup.value.credentialNaming.name,this.pendingCredential,i),(yield(0,u._)(this.hasPasskeys$))?this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passkeySaved",n)}):this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("loginWithPasskeyEnabled")}),this.dialogRef.close(ey.Success)})}}py.ɵfac=function(e){return new(e||py)(B.rXU(a.ok),B.rXU(R.ce),B.rXU(Ah.yB),B.rXU(U.W),B.rXU(Vs.K),B.rXU(P.f),B.rXU(Y.D))},py.ɵcmp=B.VBU({type:py,selectors:[["ng-component"]],standalone:!1,decls:23,vars:22,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["bitDialogContent",""],[4,"ngIf"],["class","tw-flex tw-flex-col tw-items-center",4,"ngIf"],["formGroupName","credentialNaming",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],["formGroupName","userVerification"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-24","tw-content-center","tw-mb-6"],[3,"content"],["bitTypography","h3"],["bitTypography","body1"],["formGroupName","credentialNaming"],[1,"!tw-mb-0"],["type","text","bitInput","","formControlName","name","appAutofocus",""],["class","!tw-mb-0 tw-mt-6",4,"ngIf"],[1,"!tw-mb-0","tw-mt-6"],["type","checkbox","bitCheckbox","","formControlName","useForEncryption"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"async"),B.j41(3,"span",2),B.EFF(4),B.nI1(5,"i18n"),B.j41(6,"span",3),B.EFF(7),B.nI1(8,"i18n"),B.k0s()(),B.qex(9,4),B.DNE(10,sy,3,1,"ng-container",5)(11,oy,9,7,"div",6)(12,ay,9,7,"div",6)(13,cy,16,15,"div",7),B.bVm(),B.qex(14,8),B.j41(15,"button",9),B.DNE(16,dy,3,3,"ng-container",5)(17,uy,3,3,"ng-container",5)(18,hy,3,3,"ng-container",5)(19,Ay,4,5,"ng-container",5),B.k0s(),B.j41(20,"button",10),B.EFF(21),B.nI1(22,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(),B.Y8G("loading",B.bMT(2,14,t.loading$)),B.R7$(3),B.SpI("",B.bMT(5,16,"logInWithPasskey")," "),B.R7$(3),B.JRh(B.bMT(8,18,"newPasskey")),B.R7$(3),B.Y8G("ngIf","userVerification"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialCreation"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialCreationFailed"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialNaming"===t.currentStep),B.R7$(3),B.Y8G("ngIf","userVerification"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialCreation"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialCreationFailed"===t.currentStep),B.R7$(),B.Y8G("ngIf","credentialNaming"===t.currentStep),B.R7$(2),B.SpI(" ",B.bMT(22,20,"cancel")," "))},dependencies:[H.bT,a.qT,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,a.$R,x.B,_d.$,eu.L,Jd.Q,jv.P,qd.I,Hd.m,Wd.hJ,Nv.f,tu.j,iu.I,nu.J,ru.h,gp.k,MA.r,ny.q,H.Jj,au.$],encapsulation:2});var gy=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function vy(e,t){if(1&e&&(B.j41(0,"span",9),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.JRh(e.credential.name)}}function fy(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",10),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function my(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"p",11),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"app-user-verification",12),B.mxI("invalidSecretChange",function(t){E.eBV(e);const i=B.XpG();return B.DH7(i.invalidSecret,t)||(i.invalidSecret=t),E.Njj(t)}),B.k0s(),B.bVm()}if(2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,2,"removePasskeyInfo")),B.R7$(2),B.R50("invalidSecret",e.invalidSecret)}}class yy{constructor(e,t,i,n,r,s,o,a){this.params=e,this.formBuilder=t,this.dialogRef=i,this.webauthnService=n,this.platformUtilsService=r,this.i18nService=s,this.logService=o,this.toastService=a,this.destroy$=new d.B,this.invalidSecret=!1,this.formGroup=this.formBuilder.group({secret:null}),this.loading$=this.webauthnService.loading$,this.submit=()=>gy(this,void 0,void 0,function*(){var e;if(void 0!==this.credential){this.dialogRef.disableClose=!0;try{yield this.webauthnService.deleteCredential(this.credential.id,this.formGroup.value.secret),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passkeyRemoved")})}catch(t){return t instanceof ot._&&400===t.statusCode?this.invalidSecret=!0:(null===(e=this.logService)||void 0===e||e.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("unexpectedError"),message:t.message})),!1}finally{this.dialogRef.disableClose=!1}this.dialogRef.close()}})}ngOnInit(){this.webauthnService.getCredential$(this.params.credentialId).pipe((0,pi.Q)(this.destroy$)).subscribe(e=>this.credential=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}yy.ɵfac=function(e){return new(e||yy)(B.rXU(_g.Qs),B.rXU(a.ok),B.rXU(R.ce),B.rXU(Ah.yB),B.rXU(V.y),B.rXU(U.W),B.rXU(Vs.K),B.rXU(P.f))},yy.ɵcmp=B.VBU({type:yy,selectors:[["ng-component"]],standalone:!1,decls:17,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","danger"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["name","bwi-spinner",1,"bwi-spin","tw-ml-1",3,"ariaLabel"],["bitTypography","body1"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"async"),B.j41(3,"span",2),B.EFF(4),B.nI1(5,"i18n"),B.DNE(6,vy,2,1,"span",3),B.k0s(),B.qex(7,4),B.DNE(8,fy,3,3,"ng-container",5)(9,my,5,4,"ng-container",5),B.bVm(),B.qex(10,6),B.j41(11,"button",7),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"button",8),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(),B.Y8G("loading",B.bMT(2,9,t.loading$)),B.R7$(3),B.SpI("",B.bMT(5,11,"removePasskey")," "),B.R7$(2),B.Y8G("ngIf",t.credential),B.R7$(2),B.Y8G("ngIf",!t.credential),B.R7$(),B.Y8G("ngIf",t.credential),B.R7$(3),B.SpI(" ",B.bMT(13,13,"remove")," "),B.R7$(3),B.SpI(" ",B.bMT(16,15,"cancel")," "))},dependencies:[H.bT,a.qT,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,qd.I,Hd.m,Wd.hJ,LA.R,MA.r,ny.q,H.Jj,au.$],encapsulation:2});var Cy=i(29096),wy=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Iy(e,t){if(1&e&&(B.j41(0,"span",9),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.JRh(e.credential.name)}}function by(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",10),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function By(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"p",11),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.qex(4,12),B.j41(5,"app-user-verification",13),B.mxI("invalidSecretChange",function(t){E.eBV(e);const i=B.XpG();return B.DH7(i.invalidSecret,t)||(i.invalidSecret=t),E.Njj(t)}),B.k0s(),B.bVm()()}if(2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,2,"useForVaultEncryptionInfo")),B.R7$(3),B.R50("invalidSecret",e.invalidSecret)}}class Ey{constructor(e,t,i,n,r,s){this.params=e,this.formBuilder=t,this.dialogRef=i,this.webauthnService=n,this.webauthnLoginService=r,this.accountService=s,this.destroy$=new d.B,this.invalidSecret=!1,this.formGroup=this.formBuilder.group({userVerification:this.formBuilder.group({secret:[null,a.k0.required]})}),this.loading$=this.webauthnService.loading$,this.submit=()=>wy(this,void 0,void 0,function*(){if(void 0===this.credential)return;const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.dialogRef.disableClose=!0;try{this.credentialOptions=yield this.webauthnService.getCredentialAssertOptions(this.formGroup.value.userVerification.secret),yield this.webauthnService.enableCredentialEncryption(yield this.webauthnLoginService.assertCredential(this.credentialOptions),e)}catch(t){throw t instanceof ot._&&400===t.statusCode&&(this.invalidSecret=!0),t}this.dialogRef.close()})}ngOnInit(){this.webauthnService.getCredential$(this.params.credentialId).pipe((0,pi.Q)(this.destroy$)).subscribe(e=>this.credential=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Ey.ɵfac=function(e){return new(e||Ey)(B.rXU(_g.Qs),B.rXU(a.ok),B.rXU(R.ce),B.rXU(Cy.y),B.rXU(xt),B.rXU(Y.D))},Ey.ɵcmp=B.VBU({type:Ey,selectors:[["ng-component"]],standalone:!1,decls:17,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["name","bwi-spinner",1,"bwi-spin","tw-ml-1",3,"ariaLabel"],["bitTypography","body1"],["formGroupName","userVerification"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1),B.nI1(2,"async"),B.j41(3,"span",2),B.EFF(4),B.nI1(5,"i18n"),B.DNE(6,Iy,2,1,"span",3),B.k0s(),B.qex(7,4),B.DNE(8,by,3,3,"ng-container",5)(9,By,6,4,"ng-container",5),B.bVm(),B.qex(10,6),B.j41(11,"button",7),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"button",8),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(),B.Y8G("loading",B.bMT(2,9,t.loading$)),B.R7$(3),B.SpI("",B.bMT(5,11,"enablePasskeyEncryption")," "),B.R7$(2),B.Y8G("ngIf",t.credential),B.R7$(2),B.Y8G("ngIf",!t.credential),B.R7$(),B.Y8G("ngIf",t.credential),B.R7$(3),B.SpI(" ",B.bMT(13,13,"submit")," "),B.R7$(3),B.SpI(" ",B.bMT(16,15,"cancel")," "))},dependencies:[H.bT,a.qT,a.BC,a.cb,a.j4,a.JD,a.$R,_d.$,eu.L,Jd.Q,qd.I,Hd.m,Wd.hJ,LA.R,MA.r,ny.q,H.Jj,au.$],encapsulation:2});function Sy(e,t){1&e&&(B.j41(0,"span",8),B.EFF(1),B.nI1(2,"i18n"),B.nI1(3,"i18n"),B.k0s()),2&e&&(B.R7$(),B.Lme(" ",B.bMT(2,2,"off")," - ",B.bMT(3,4,"ssoLoginIsRequired")," "))}function Qy(e,t){1&e&&(B.j41(0,"span",11),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"on")," "))}function ky(e,t){1&e&&(B.j41(0,"span",12),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"off")," "))}function Ty(e,t){if(1&e&&(B.qex(0),B.DNE(1,Qy,3,3,"span",9)(2,ky,3,3,"span",10),B.bVm()),2&e){const e=B.XpG(2);B.R7$(),B.Y8G("ngIf",e.hasCredentials),B.R7$(),B.Y8G("ngIf",!e.hasCredentials)}}function Fy(e,t){if(1&e&&(B.qex(0),B.DNE(1,Sy,4,6,"span",7)(2,Ty,3,2,"ng-container",2),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.requireSsoPolicyEnabled),B.R7$(),B.Y8G("ngIf",!e.requireSsoPolicyEnabled)}}function Py(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",13),B.nI1(2,"i18n"),B.bVm()),2&e&&(B.R7$(),B.Y8G("ariaLabel",B.bMT(2,1,"loading")))}function Ry(e,t){1&e&&(B.qex(0),B.nrm(1,"bit-icon",21),B.j41(2,"span",22),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,1,"usedForEncryption")))}function Dy(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"button",20),B.nI1(2,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(2);return E.Njj(i.enableEncryption(t.id))}),B.nrm(3,"bit-icon",21),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.bVm()}if(2&e){const e=B.XpG().$implicit,t=B.XpG(2);B.R7$(),B.Y8G("disabled",t.loading),B.BMQ("aria-label",B.bMT(2,3,"enablePasskeyEncryption")+" "+e.name),B.R7$(3),B.SpI(" ",B.bMT(5,5,"enablePasskeyEncryption")," ")}}function My(e,t){1&e&&(B.j41(0,"span",22),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"encryptionNotSupported")," "))}function xy(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr")(1,"td",16),B.EFF(2),B.k0s(),B.j41(3,"td",17),B.DNE(4,Ry,5,3,"ng-container",2)(5,Dy,6,7,"ng-container",2)(6,My,3,3,"span",18),B.k0s(),B.j41(7,"td",19)(8,"button",20),B.nI1(9,"i18n"),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.deleteCredential(t.id))}),B.EFF(10),B.nI1(11,"i18n"),B.k0s()()()}if(2&e){const e=t.$implicit,i=B.XpG(2);B.R7$(2),B.JRh(e.name),B.R7$(2),B.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Enabled),B.R7$(),B.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Supported),B.R7$(),B.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Unsupported),B.R7$(2),B.Y8G("disabled",i.loading),B.BMQ("aria-label",B.bMT(9,7,"remove")+" "+e.name),B.R7$(2),B.SpI(" ",B.bMT(11,9,"remove")," ")}}function Oy(e,t){if(1&e&&(B.j41(0,"table",14),B.DNE(1,xy,12,11,"tr",15),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngForOf",e.credentials)}}function Gy(e,t){1&e&&(B.j41(0,"p",23),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"passkeyLimitReachedInfo")))}function Uy(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",25),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.createCredential())}),B.EFF(1),B.nI1(2,"i18n"),B.k0s()}if(2&e){const e=B.XpG(2);B.Y8G("disabled",e.loading),B.R7$(),B.SpI(" ",B.bMT(2,2,"newPasskey")," ")}}function Vy(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",25),B.nI1(1,"i18n"),B.nI1(2,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.createCredential())}),B.EFF(3),B.nI1(4,"i18n"),B.k0s()}if(2&e){const e=B.XpG(2);B.Y8G("disabled",e.loading),B.BMQ("aria-label",B.bMT(1,3,"enable")+" "+B.bMT(2,5,"logInWithPasskey")),B.R7$(3),B.SpI(" ",B.bMT(4,7,"enable")," ")}}function jy(e,t){if(1&e&&(B.qex(0),B.DNE(1,Uy,3,4,"button",24)(2,Vy,5,9,"button",24),B.bVm()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.hasCredentials),B.R7$(),B.Y8G("ngIf",!e.hasCredentials)}}class Ny{constructor(e,t,i,n){this.webauthnService=e,this.dialogService=t,this.policyService=i,this.accountService=n,this.destroy$=new d.B,this.MaxCredentialCount=Ah.yB.MaxCredentialCount,this.WebauthnLoginCredentialPrfStatus=iy.j,this.loading=!0,this.requireSsoPolicyEnabled=!1}ngOnInit(){this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.policyAppliesToUser$(mt.tt.RequireSso,e)),(0,pi.Q)(this.destroy$)).subscribe(e=>{this.requireSsoPolicyEnabled=e}),this.webauthnService.getCredentials$().pipe((0,pi.Q)(this.destroy$)).subscribe(e=>this.credentials=e),this.webauthnService.loading$.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>this.loading=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get ariaBusy(){return this.loading?"true":"false"}get hasCredentials(){var e,t;return(null!==(t=null===(e=this.credentials)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0}get hasData(){return void 0!==this.credentials}get limitReached(){var e,t;return(null!==(t=null===(e=this.credentials)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>=this.MaxCredentialCount}createCredential(){var e,t;e=this.dialogService,t={},e.open(py,t)}deleteCredential(e){var t,i;t=this.dialogService,i={data:{credentialId:e}},t.open(yy,i)}enableEncryption(e){var t,i;t=this.dialogService,i={data:{credentialId:e}},t.open(Ey,i)}}Ny.ɵfac=function(e){return new(e||Ny)(B.rXU(Ah.yB),B.rXU(R.o3),B.rXU(me.m),B.rXU(Y.D))},Ny.ɵcmp=B.VBU({type:Ny,selectors:[["app-webauthn-login-settings"]],hostAttrs:["aria-live","polite"],hostVars:1,hostBindings:function(e,t){2&e&&B.BMQ("aria-busy",t.ariaBusy)},standalone:!1,decls:15,vars:14,consts:[["bitTypography","h2"],[1,"tw-inline-flex","tw-gap-1","tw-align-middle"],[4,"ngIf"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/login-with-passkeys"],["class","tw-mb-5",4,"ngIf"],["bitTypography","body2",4,"ngIf"],["bitBadge","","variant","secondary","class","tw-max-w-full !tw-align-middle",4,"ngIf"],["bitBadge","","variant","secondary",1,"tw-max-w-full","!tw-align-middle"],["bitBadge","","variant","success","class","!tw-align-middle",4,"ngIf"],["bitBadge","","variant","secondary","class","!tw-align-middle",4,"ngIf"],["bitBadge","","variant","success",1,"!tw-align-middle"],["bitBadge","","variant","secondary",1,"!tw-align-middle"],["name","bwi-spinner",1,"bwi-spin","tw-ml-1",3,"ariaLabel"],[1,"tw-mb-5"],[4,"ngFor","ngForOf"],[1,"tw-p-2","tw-pl-0","tw-font-medium"],[1,"tw-p-2","tw-pr-10","tw-text-left"],["bitTypography","body1","class","tw-text-muted",4,"ngIf"],[1,"tw-py-2"],["type","button","bitLink","",3,"click","disabled"],["name","bwi-lock-encrypted"],["bitTypography","body1",1,"tw-text-muted"],["bitTypography","body2"],["type","button","bitButton","",3,"disabled","click",4,"ngIf"],["type","button","bitButton","",3,"click","disabled"]],template:function(e,t){1&e&&(B.j41(0,"h2",0),B.EFF(1),B.nI1(2,"i18n"),B.j41(3,"span",1),B.DNE(4,Fy,3,2,"ng-container",2),B.k0s(),B.DNE(5,Py,3,3,"ng-container",2),B.k0s(),B.j41(6,"p",3),B.EFF(7),B.nI1(8,"i18n"),B.j41(9,"a",4),B.EFF(10),B.nI1(11,"i18n"),B.k0s()(),B.DNE(12,Oy,2,1,"table",5)(13,Gy,3,3,"p",6)(14,jy,3,2,"ng-container",2)),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,8,"logInWithPasskey")," "),B.R7$(3),B.Y8G("ngIf",t.hasData),B.R7$(),B.Y8G("ngIf",t.loading),B.R7$(2),B.SpI(" ",B.bMT(8,10,"loginWithPasskeyInfo")," "),B.R7$(3),B.JRh(B.bMT(11,12,"learnMoreAboutPasswordless")),B.R7$(2),B.Y8G("ngIf",t.hasCredentials),B.R7$(),B.Y8G("ngIf",t.limitReached),B.R7$(),B.Y8G("ngIf",t.hasData&&!t.limitReached&&!t.requireSsoPolicyEnabled))},dependencies:[H.Sq,H.bT,lf.n,Jd.Q,LA.R,$d.g,MA.r,au.$],encapsulation:2});var zy=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Yy{constructor(e,t,i){this.router=e,this.userDecryptionOptionsService=t,this.accountService=i,this.inputPasswordFlow=le.m5.ChangePasswordWithOptionalUserKeyRotation,this.changePasswordFeatureFlag=!1}ngOnInit(){return zy(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));(yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e)))||(yield this.router.navigate(["/settings/security/two-factor"]))})}}Yy.ɵfac=function(e){return new(e||Yy)(B.rXU(F.Ix),B.rXU(v.Ym),B.rXU(Y.D))},Yy.ɵcmp=B.VBU({type:Yy,selectors:[["app-password-settings"]],decls:6,vars:4,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg","tw-mb-12"],[3,"inputPasswordFlow"]],template:function(e,t){1&e&&(B.j41(0,"h1",0),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.j41(3,"div",1),B.nrm(4,"auth-change-password",2),B.k0s(),B.nrm(5,"app-webauthn-login-settings")),2&e&&(B.R7$(),B.JRh(B.bMT(2,2,"changeMasterPassword")),B.R7$(3),B.Y8G("inputPasswordFlow",t.inputPasswordFlow))},dependencies:[yv.j,ne.h5,Dh,Ny,Zu.$Z],encapsulation:2});class Ly{}Ly.ɵfac=function(e){return new(e||Ly)},Ly.ɵmod=B.$C({type:Ly}),Ly.ɵinj=E.G2t({imports:[H.MD,oh.G,um.k]});var Ky=i(50342),Xy=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function qy(e,t){1&e&&(B.j41(0,"bit-callout",3),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"kdfSettingsChangeLogoutWarning")))}class Hy{constructor(e,t,i,n,r,s,o,l){this.i18nService=e,this.messagingService=t,this.accountService=n,this.toastService=r,this.changeKdfService=s,this.dialogRef=o,this.form=new a.gE({masterPassword:new a.MJ(null,a.k0.required)}),this.showPassword=!1,this.loading=!1,this.submit=()=>Xy(this,void 0,void 0,function*(){this.form.invalid||(this.loading=!0,yield this.makeKeyAndSave(),(yield(0,u._)(this.noLogoutOnKdfChangeFeatureFlag$))?(this.toastService.showToast({variant:"success",message:this.i18nService.t("encKeySettingsChanged")}),this.dialogRef.close()):(this.toastService.showToast({variant:"success",title:this.i18nService.t("encKeySettingsChanged"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")),this.loading=!1)}),this.kdfConfig=i.kdfConfig,this.noLogoutOnKdfChangeFeatureFlag$=l.getFeatureFlag$(dr.TO.NoLogoutOnKdfChange)}makeKeyAndSave(){return Xy(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),t=this.form.value.masterPassword;this.kdfConfig.validateKdfConfigForSetting(),yield this.changeKdfService.updateUserKdfParams(t,this.kdfConfig,e)})}}Hy.ɵfac=function(e){return new(e||Hy)(B.rXU(U.W),B.rXU(js.U),B.rXU(_g.Qs),B.rXU(Y.D),B.rXU(P.f),B.rXU(ss),B.rXU(R.ce),B.rXU(z.w))},Hy.ɵcmp=B.VBU({type:Hy,selectors:[["app-change-kdf-confirmation"]],standalone:!1,decls:25,vars:21,consts:[["autocomplete","off",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["disableMargin",""],["bitInput","","type","password","formControlName","masterPassword","appAutofocus",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","buttonType","secondary","type","button","bitFormButton","","bitDialogClose",""]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"span",2),B.nVh(6,qy,3,3,"bit-callout",3),B.nI1(7,"async"),B.j41(8,"bit-form-field",4)(9,"bit-label"),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.nrm(12,"input",5),B.j41(13,"button",6),B.mxI("toggledChange",function(e){return B.DH7(t.showPassword,e)||(t.showPassword=e),e}),B.k0s(),B.j41(14,"bit-hint"),B.EFF(15),B.nI1(16,"i18n"),B.k0s()()(),B.qex(17,7),B.j41(18,"button",8)(19,"span"),B.EFF(20),B.nI1(21,"i18n"),B.k0s()(),B.j41(22,"button",9),B.EFF(23),B.nI1(24,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.form)("bitSubmit",t.submit),B.R7$(3),B.SpI(" ",B.bMT(4,9,"updateYourEncryptionSettings")," "),B.R7$(3),B.vxM(B.bMT(7,11,t.noLogoutOnKdfChangeFeatureFlag$)?-1:6),B.R7$(4),B.JRh(B.bMT(11,13,"masterPass")),B.R7$(3),B.R50("toggled",t.showPassword),B.R7$(2),B.SpI(" ",B.bMT(16,15,"confirmIdentity")," "),B.R7$(5),B.JRh(B.bMT(21,17,"updateSettings")),B.R7$(3),B.SpI(" ",B.bMT(24,19,"cancel")," "))},dependencies:[a.qT,a.me,a.BC,a.cb,a.j4,a.JD,x.B,_d.$,eu.L,Jd.Q,zA.G,qd.I,Hd.m,Wd.hJ,tu.j,iu.I,nu.J,ru.h,su.e,ou.a,Zd.s,H.Jj,au.$],encapsulation:2});var Wy=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function $y(e,t){1&e&&(B.j41(0,"bit-callout",2),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"kdfSettingsChangeLogoutWarning")))}function Jy(e,t){if(1&e&&B.nrm(0,"bit-option",20),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}function Zy(e,t){if(1&e&&(B.j41(0,"bit-form-field",12)(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",21),B.j41(5,"bit-hint"),B.EFF(6),B.nI1(7,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.SpI(" ",B.bMT(3,4,"kdfIterations")," "),B.R7$(2),B.Y8G("min",e.PBKDF2_ITERATIONS.min)("max",e.PBKDF2_ITERATIONS.max),B.R7$(2),B.JRh(B.bMT(7,6,"kdfIterationRecommends"))}}function _y(e,t){if(1&e&&(B.j41(0,"bit-form-field",12)(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",22),B.k0s()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,3,"kdfMemory")),B.R7$(2),B.Y8G("min",e.ARGON2_MEMORY.min)("max",e.ARGON2_MEMORY.max)}}function eC(e,t){if(1&e&&(B.j41(0,"div",7)(1,"bit-form-field",12)(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.nrm(5,"input",21),B.k0s()(),B.j41(6,"div",7)(7,"bit-form-field",12)(8,"bit-label"),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.nrm(11,"input",23),B.k0s()()),2&e){const e=B.XpG();B.R7$(3),B.SpI(" ",B.bMT(4,6,"kdfIterations")," "),B.R7$(2),B.Y8G("min",e.ARGON2_ITERATIONS.min)("max",e.ARGON2_ITERATIONS.max),B.R7$(4),B.SpI(" ",B.bMT(10,8,"kdfParallelism")," "),B.R7$(2),B.Y8G("min",e.ARGON2_PARALLELISM.min)("max",e.ARGON2_PARALLELISM.max)}}class tC{constructor(e,t,i,n,r){this.dialogService=e,this.kdfConfigService=t,this.accountService=i,this.formBuilder=n,this.kdfConfig=b.fX,this.kdfOptions=[],this.destroy$=new d.B,this.formGroup=this.formBuilder.group({kdf:new a.MJ(b.ao.PBKDF2_SHA256,[a.k0.required]),kdfConfig:this.formBuilder.group({iterations:new a.MJ(null),memory:new a.MJ(null),parallelism:new a.MJ(null)})}),this.PBKDF2_ITERATIONS=b.n1.ITERATIONS,this.ARGON2_ITERATIONS=b.hU.ITERATIONS,this.ARGON2_MEMORY=b.hU.MEMORY,this.ARGON2_PARALLELISM=b.hU.PARALLELISM,this.kdfOptions=[{name:"PBKDF2 SHA-256",value:b.ao.PBKDF2_SHA256},{name:"Argon2id",value:b.ao.Argon2id}],this.noLogoutOnKdfChangeFeatureFlag$=r.getFeatureFlag$(dr.TO.NoLogoutOnKdfChange)}ngOnInit(){return Wy(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.kdfConfig=yield this.kdfConfigService.getKdfConfig(e),this.formGroup.controls.kdf.setValue(this.kdfConfig.kdfType),this.setFormControlValues(this.kdfConfig),this.setFormValidators(this.kdfConfig.kdfType),this.formGroup.controls.kdf.valueChanges.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.updateKdfConfig(e)})})}updateKdfConfig(e){let t;switch(e){case b.ao.PBKDF2_SHA256:t=new b.n1;break;case b.ao.Argon2id:t=new b.hU;break;default:throw new Error("Unknown KDF type.")}this.kdfConfig=t,this.setFormValidators(e),this.setFormControlValues(this.kdfConfig)}setFormValidators(e){const t=this.formGroup.controls.kdfConfig;switch(e){case b.ao.PBKDF2_SHA256:t.controls.iterations.setValidators([a.k0.required,a.k0.min(b.n1.ITERATIONS.min),a.k0.max(b.n1.ITERATIONS.max)]),t.controls.memory.setValidators([]),t.controls.parallelism.setValidators([]);break;case b.ao.Argon2id:t.controls.iterations.setValidators([a.k0.required,a.k0.min(b.hU.ITERATIONS.min),a.k0.max(b.hU.ITERATIONS.max)]),t.controls.memory.setValidators([a.k0.required,a.k0.min(b.hU.MEMORY.min),a.k0.max(b.hU.MEMORY.max)]),t.controls.parallelism.setValidators([a.k0.required,a.k0.min(b.hU.PARALLELISM.min),a.k0.max(b.hU.PARALLELISM.max)]);break;default:throw new Error("Unknown KDF type.")}t.controls.iterations.updateValueAndValidity(),t.controls.memory.updateValueAndValidity(),t.controls.parallelism.updateValueAndValidity()}setFormControlValues(e){const t=this.formGroup.controls.kdfConfig;t.reset(),e.kdfType===b.ao.PBKDF2_SHA256?t.controls.iterations.setValue(e.iterations):e.kdfType===b.ao.Argon2id&&(t.controls.iterations.setValue(e.iterations),t.controls.memory.setValue(e.memory),t.controls.parallelism.setValue(e.parallelism))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}isPBKDF2(e){return e instanceof b.n1}isArgon2(e){return e instanceof b.hU}openConfirmationModal(){return Wy(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.formGroup.controls.kdfConfig;this.kdfConfig.kdfType===b.ao.PBKDF2_SHA256?this.kdfConfig.iterations=e.controls.iterations.value:this.kdfConfig.kdfType===b.ao.Argon2id&&(this.kdfConfig.iterations=e.controls.iterations.value,this.kdfConfig.memory=e.controls.memory.value,this.kdfConfig.parallelism=e.controls.parallelism.value),this.dialogService.open(Hy,{data:{kdfConfig:this.kdfConfig}})})}}tC.ɵfac=function(e){return new(e||tC)(B.rXU(R.o3),B.rXU(b.zZ),B.rXU(Y.D),B.rXU(a.ok),B.rXU(z.w))},tC.ɵcmp=B.VBU({type:tC,selectors:[["app-change-kdf"]],standalone:!1,decls:46,vars:43,consts:[["algorithmPopover",""],["bitTypography","h2",1,"tw-mt-6"],["type","warning"],["bitTypography","body1",1,"tw-mt-4"],["bitTypography","body1"],["autocomplete","off",3,"formGroup"],[1,"tw-grid","tw-grid-cols-12","tw-gap-x-4"],[1,"tw-col-span-6"],["type","button","bitLink","",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-p-0",3,"bitPopoverTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["formControlName","kdf"],[3,"value","label",4,"ngFor","ngForOf"],["formGroupName","kdfConfig"],["type","button","buttonType","primary","bitButton","","bitFormButton","",1,"tw-mt-2",3,"click"],[3,"title"],[1,"tw-mt-2","tw-mb-0","tw-ps-4"],[1,"tw-mb-2"],[1,"tw-mt-4","tw-mb-1"],["href","https://bitwarden.com/help/kdf-algorithms/","bitLink","","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"],[3,"value","label"],["bitInput","","type","number","formControlName","iterations",3,"min","max"],["bitInput","","formControlName","memory","type","number",3,"min","max"],["bitInput","","type","number","formControlName","parallelism",3,"min","max"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"h2",1),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.nVh(3,$y,3,3,"bit-callout",2),B.nI1(4,"async"),B.j41(5,"p",3),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"p",4),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.j41(11,"form",5)(12,"div",6)(13,"div",7)(14,"bit-form-field")(15,"bit-label"),B.EFF(16),B.nI1(17,"i18n"),B.j41(18,"button",8),B.nI1(19,"i18n"),B.nrm(20,"i",9),B.k0s()(),B.j41(21,"bit-select",10),B.DNE(22,Jy,1,2,"bit-option",11),B.k0s()()(),B.j41(23,"div",7),B.nVh(24,Zy,8,8,"bit-form-field",12)(25,_y,5,5,"bit-form-field",12),B.k0s(),B.nVh(26,eC,12,10),B.k0s(),B.j41(27,"button",13),B.bIt("click",function(){return E.eBV(e),E.Njj(t.openConfirmationModal())}),B.EFF(28),B.nI1(29,"i18n"),B.k0s()(),B.j41(30,"bit-popover",14,0),B.nI1(32,"i18n"),B.j41(33,"ul",15)(34,"li",16),B.EFF(35),B.nI1(36,"i18n"),B.k0s(),B.j41(37,"li"),B.EFF(38),B.nI1(39,"i18n"),B.k0s()(),B.j41(40,"div",17)(41,"a",18),B.nI1(42,"i18n"),B.EFF(43),B.nI1(44,"i18n"),B.nrm(45,"i",19),B.k0s()()()}if(2&e){const e=B.sdS(31);B.R7$(),B.SpI(" ",B.bMT(2,19,"encKeySettings"),"\n"),B.R7$(2),B.vxM(B.bMT(4,21,t.noLogoutOnKdfChangeFeatureFlag$)?-1:3),B.R7$(3),B.SpI(" ",B.bMT(7,23,"encryptionKeySettingsHowShouldWeEncryptYourData"),"\n"),B.R7$(3),B.SpI(" ",B.bMT(10,25,"encryptionKeySettingsIncreaseImproveSecurity"),"\n"),B.R7$(2),B.Y8G("formGroup",t.formGroup),B.R7$(5),B.SpI(" ",B.bMT(17,27,"algorithm")," "),B.R7$(2),B.Y8G("appA11yTitle",B.mNQ(B.bMT(19,29,"encryptionKeySettingsAlgorithmPopoverTitle")))("bitPopoverTriggerFor",e),B.R7$(4),B.Y8G("ngForOf",t.kdfOptions),B.R7$(2),B.vxM(t.isPBKDF2(t.kdfConfig)?24:t.isArgon2(t.kdfConfig)?25:-1),B.R7$(2),B.vxM(t.isArgon2(t.kdfConfig)?26:-1),B.R7$(2),B.SpI(" ",B.bMT(29,31,"updateEncryptionSettings")," "),B.R7$(2),B.Y8G("title",B.bMT(32,33,"encryptionKeySettingsAlgorithmPopoverTitle")),B.R7$(5),B.JRh(B.bMT(36,35,"encryptionKeySettingsAlgorithmPopoverPBKDF2")),B.R7$(3),B.JRh(B.bMT(39,37,"encryptionKeySettingsAlgorithmPopoverArgon2Id")),B.R7$(3),B.Y8G("appA11yTitle",B.mNQ(B.bMT(42,39,"learnMoreAboutEncryptionAlgorithms"))),B.R7$(2),B.SpI(" ",B.bMT(44,41,"learnMore")," ")}},dependencies:[H.Sq,a.qT,a.me,a.Q0,a.BC,a.cb,a.VZ,a.zX,a.j4,a.JD,a.$R,Kv.C,_d.$,Jd.Q,zA.G,tu.j,iu.I,nu.J,ru.h,$d.g,cg.w,dg.P,MA.r,Xm.r,qm.k,H.Jj,au.$],encapsulation:2});var iC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nC=(e,t)=>({"tw-mt-6":e,"tw-mt-16":t});function rC(e,t){1&e&&B.nrm(0,"app-change-kdf")}class sC{constructor(e,t,i,n){this.userDecryptionOptionsService=e,this.accountService=t,this.apiService=i,this.dialogService=n,this.showChangeKdf=!0}ngOnInit(){return iC(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));this.showChangeKdf=yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e))})}viewUserApiKey(){return iC(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));if(!e)throw new Error("Active account not found");yield Ky.V.open(this.dialogService,{data:{keyType:"user",entityId:e,postKey:this.apiService.postUserApiKey.bind(this.apiService),scope:"api",grantType:"client_credentials",apiKeyTitle:"apiKey",apiKeyWarning:"userApiKeyWarning",apiKeyDescription:"userApiKeyDesc"}})})}rotateUserApiKey(){return iC(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)));if(!e)throw new Error("Active account not found");yield Ky.V.open(this.dialogService,{data:{keyType:"user",isRotation:!0,entityId:e,postKey:this.apiService.postUserRotateApiKey.bind(this.apiService),scope:"api",grantType:"client_credentials",apiKeyTitle:"apiKey",apiKeyWarning:"userApiKeyWarning",apiKeyDescription:"apiKeyRotateDesc"}})})}}sC.ɵfac=function(e){return new(e||sC)(B.rXU(v.Ym),B.rXU(Y.D),B.rXU(de.G),B.rXU(R.o3))},sC.ɵcmp=B.VBU({type:sC,selectors:[["ng-component"]],decls:15,vars:17,consts:[[4,"ngIf"],[1,"tw-border-0","tw-mb-0","tw-pb-2.5",3,"ngClass"],["bitTypography","h2"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["type","button","bitButton","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(B.DNE(0,rC,1,0,"app-change-kdf",0),B.j41(1,"div",1)(2,"h2",2),B.EFF(3),B.nI1(4,"i18n"),B.k0s()(),B.j41(5,"p",3),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"div",4)(9,"button",5),B.bIt("click",function(){return t.viewUserApiKey()}),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.j41(12,"button",5),B.bIt("click",function(){return t.rotateUserApiKey()}),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()),2&e&&(B.Y8G("ngIf",t.showChangeKdf),B.R7$(),B.Y8G("ngClass",B.l_i(14,nC,!t.showChangeKdf,t.showChangeKdf)),B.R7$(2),B.JRh(B.bMT(4,6,"apiKey")),B.R7$(3),B.SpI(" ",B.bMT(7,8,"userApiKeyDesc"),"\n"),B.R7$(4),B.SpI(" ",B.bMT(11,10,"viewApiKey")," "),B.R7$(3),B.SpI(" ",B.bMT(14,12,"rotateApiKey")," "))},dependencies:[oh.G,H.YU,H.bT,Jd.Q,MA.r,Ly,tC,au.$],encapsulation:2});var oC=i(39805),aC=i(97560),lC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function cC(e,t){if(1&e&&(B.j41(0,"bit-tab-link",2),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("route",e.changePasswordRoute),B.R7$(),B.JRh(B.bMT(2,2,"masterPassword"))}}class dC{constructor(e,t){this.userDecryptionOptionsService=e,this.accountService=t,this.showChangePassword=!0,this.changePasswordRoute="password"}ngOnInit(){return lC(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));this.showChangePassword=!!e&&(yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e)))})}}dC.ɵfac=function(e){return new(e||dC)(B.rXU(v.Ym),B.rXU(Y.D))},dC.ɵcmp=B.VBU({type:dC,selectors:[["ng-component"]],decls:17,vars:13,consts:[["slot","tabs"],["route","session-timeout"],[3,"route"],["route","two-factor"],["route","device-management"],["route","security-keys"]],template:function(e,t){1&e&&(B.j41(0,"app-header")(1,"bit-tab-nav-bar",0)(2,"bit-tab-link",1),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.nVh(5,cC,3,4,"bit-tab-link",2),B.j41(6,"bit-tab-link",3),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"bit-tab-link",4),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.j41(12,"bit-tab-link",5),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()(),B.j41(15,"bit-container"),B.nrm(16,"router-outlet"),B.k0s()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,5,"sessionTimeoutHeader")),B.R7$(2),B.vxM(t.showChangePassword?5:-1),B.R7$(2),B.JRh(B.bMT(8,7,"twoStepLogin")),B.R7$(3),B.JRh(B.bMT(11,9,"devices")),B.R7$(3),B.JRh(B.bMT(14,11,"keys")))},dependencies:[oh.G,F.n3,Cg.H,oC.J,aC.T,yg.G,wg.f,au.$],encapsulation:2});const uC=[{path:"",component:dC,data:{titleId:"security"},children:[{path:"",pathMatch:"full",redirectTo:"session-timeout"},{path:"session-timeout",component:_m,data:{titleId:"sessionTimeoutHeader"}},{path:"password",component:Yy,data:{titleId:"masterPassword"}},{path:"two-factor",component:ty.q,data:{titleId:"twoStepLogin"}},{path:"security-keys",component:sC,data:{titleId:"keys"}},{path:"device-management",component:Zm,data:{titleId:"devices"}}]}];class hC{}hC.ɵfac=function(e){return new(e||hC)},hC.ɵmod=B.$C({type:hC}),hC.ɵinj=E.G2t({imports:[BA.iI.forChild(uC),BA.iI]});class AC{constructor(e,t){this.userId=e,this.token=t}}var pC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class gC{constructor(e,t,i,n,r,s,o){this.router=e,this.i18nService=t,this.route=i,this.apiService=n,this.logService=r,this.tokenService=s,this.toastService=o}ngOnInit(){this.route.queryParams.pipe((0,Cu.$)()).subscribe(e=>pC(this,void 0,void 0,function*(){if(null!=e.userId&&null!=e.token)try{return yield this.apiService.postAccountVerifyEmailToken(new AC(e.userId,e.token)),(yield(0,u._)(this.tokenService.hasAccessToken$(e.userId)))&&(yield this.apiService.refreshIdentityToken()),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailVerified")}),void this.router.navigate(["/"])}catch(t){this.logService.error(t)}this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("emailVerifiedFailed")}),this.router.navigate(["/"])}))}}gC.ɵfac=function(e){return new(e||gC)(B.rXU(F.Ix),B.rXU(U.W),B.rXU(F.nX),B.rXU(de.G),B.rXU(Vs.K),B.rXU(q.B),B.rXU(P.f))},gC.ɵcmp=B.VBU({type:gC,selectors:[["app-verify-email-token"]],decls:5,vars:3,consts:[[1,"tw-p-8","tw-flex"],["alt","Bitwarden",1,"new-logo-themed"],[1,"spinner-container","tw-justify-center"],["name","bwi-spinner",1,"bwi-spin","bwi-3x","tw-text-muted",3,"ariaLabel"]],template:function(e,t){1&e&&(B.j41(0,"div",0),B.nrm(1,"img",1),B.j41(2,"div",2),B.nrm(3,"bit-icon",3),B.nI1(4,"i18n"),B.k0s()()),2&e&&(B.R7$(3),B.Y8G("ariaLabel",B.bMT(4,1,"loading")))},dependencies:[Ph.G,LA.R,au.$],encapsulation:2});class vC{constructor(e,t){this.userId=e,this.token=t}}var fC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class mC{constructor(e,t,i,n,r){this.router=e,this.apiService=t,this.i18nService=i,this.route=n,this.toastService=r,this.formGroup=new a.gE({}),this.submit=()=>fC(this,void 0,void 0,function*(){const e=new vC(this.userId,this.token);yield this.apiService.postAccountRecoverDeleteToken(e),this.toastService.showToast({variant:"success",title:this.i18nService.t("accountDeleted"),message:this.i18nService.t("accountDeletedDesc")}),yield this.router.navigate(["/"])})}ngOnInit(){this.route.queryParams.pipe((0,Cu.$)()).subscribe(e=>fC(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):yield this.router.navigate(["/"])}))}}mC.ɵfac=function(e){return new(e||mC)(B.rXU(F.Ix),B.rXU(de.G),B.rXU(U.W),B.rXU(F.nX),B.rXU(P.f))},mC.ɵcmp=B.VBU({type:mC,selectors:[["app-verify-recover-delete"]],decls:18,vars:17,consts:[[3,"bitSubmit","formGroup"],["type","warning"],["bitTypography","body1",1,"tw-text-center"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","danger",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-callout",1),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"p",2)(5,"strong"),B.EFF(6),B.k0s()(),B.j41(7,"p",3),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.nrm(10,"hr"),B.j41(11,"div",4)(12,"button",5),B.EFF(13),B.nI1(14,"i18n"),B.k0s(),B.j41(15,"a",6),B.EFF(16),B.nI1(17,"i18n"),B.k0s()()()),2&e&&(B.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),B.R7$(2),B.JRh(B.bMT(3,9,"deleteAccountWarning")),B.R7$(4),B.JRh(t.email),B.R7$(2),B.JRh(B.bMT(9,11,"deleteRecoverConfirmDesc")),B.R7$(4),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(14,13,"deleteAccount")," "),B.R7$(2),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(17,15,"cancel")," "))},dependencies:[a.X1,a.qT,a.cb,a.j4,BA.Wk,jd.p,Kd.C,_d.$,eu.L,Yd.t,Jd.Q,zA.G,DA.E,MA.r,au.$],encapsulation:2});var yC=i(33189),CC=i(90647),wC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function IC(e,t){if(1&e&&(B.nrm(0,"button",7),B.nI1(1,"i18n")),2&e){B.XpG();const e=B.sdS(10);B.Y8G("label",B.mNQ(B.bMT(1,3,"options")))("bitMenuTriggerFor",e)}}function bC(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",5),B.nI1(1,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.resendEmail())}),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}if(2&e){const e=B.XpG();B.BMQ("aria-label",B.i5U(1,2,"resendEmailLabel",e.sponsoringOrg.familySponsorshipFriendlyName)),B.R7$(2),B.SpI(" ",B.bMT(3,5,"resendEmail")," ")}}class BC{constructor(e,t,i,n,r,s,o,a){this.apiService=e,this.i18nService=t,this.logService=i,this.dialogService=n,this.toastService=r,this.policyService=s,this.accountService=o,this.organizationSponsorshipApiService=a,this.sponsoringOrg=null,this.isSelfHosted=!1,this.sponsorshipRemoved=new B.bkB,this.statusMessage="loading",this.statusClass="tw-text-success",this.locale=""}ngOnInit(){return wC(this,void 0,void 0,function*(){this.locale=yield(0,u._)(this.i18nService.locale$),this.setStatus(this.isSelfHosted,this.sponsoringOrg.familySponsorshipToDelete,this.sponsoringOrg.familySponsorshipValidUntil,this.sponsoringOrg.familySponsorshipLastSyncDate),this.isFreeFamilyPolicyEnabled$=this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.policiesByType$(mt.tt.FreeFamiliesSponsorshipPolicy,e)),(0,p.T)(e=>Array.isArray(e)&&e.some(e=>e.organizationId===this.sponsoringOrg.id&&e.enabled)))})}revokeSponsorship(){return wC(this,void 0,void 0,function*(){try{yield this.doRevokeSponsorship()}catch(e){this.logService.error(e)}})}resendEmail(){return wC(this,void 0,void 0,function*(){yield this.organizationSponsorshipApiService.postResendSponsorshipOffer(this.sponsoringOrg.id,this.sponsoringOrg.familySponsorshipFriendlyName),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailSent")})})}doRevokeSponsorship(){return wC(this,void 0,void 0,function*(){const e=this.sponsoringOrg.familySponsorshipValidUntil?this.i18nService.t("updatedRevokeSponsorshipConfirmationForAcceptedSponsorship",this.sponsoringOrg.familySponsorshipFriendlyName,(0,H.Yq)(this.sponsoringOrg.familySponsorshipValidUntil,"MM/dd/yyyy",this.locale)):this.i18nService.t("updatedRevokeSponsorshipConfirmationForSentSponsorship",this.sponsoringOrg.familySponsorshipFriendlyName);(yield this.dialogService.openSimpleDialog({title:`${this.i18nService.t("removeSponsorship")}?`,content:e,acceptButtonText:{key:"remove"},type:"warning"}))&&(yield this.organizationSponsorshipApiService.deleteRevokeSponsorship(this.sponsoringOrg.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("reclaimedFreePlan")}),this.sponsorshipRemoved.emit())})}setStatus(e,t,i,n){t&&i?(this.statusMessage=this.i18nService.t("revokeWhenExpired",(0,H.Yq)(i,"MM/dd/yyyy",this.locale)),this.statusClass="tw-text-danger"):t?(this.statusMessage=this.i18nService.t("requestRemoved"),this.statusClass="tw-text-danger"):i?(this.statusMessage=this.i18nService.t("active"),this.statusClass="tw-text-success"):e&&n?(this.statusMessage=this.i18nService.t("sent"),this.statusClass="tw-text-success"):e?(this.statusMessage=this.i18nService.t("requested"),this.statusClass="tw-text-success"):(this.statusMessage=this.i18nService.t("sent"),this.statusClass="tw-text-success")}}BC.ɵfac=function(e){return new(e||BC)(B.rXU(de.G),B.rXU(U.W),B.rXU(Vs.K),B.rXU(R.o3),B.rXU(P.f),B.rXU(me.m),B.rXU(Y.D),B.rXU(xn.l))},BC.ɵcmp=B.VBU({type:BC,selectors:[["","sponsoring-org-row",""]],inputs:{sponsoringOrg:"sponsoringOrg",isSelfHosted:"isSelfHosted"},outputs:{sponsorshipRemoved:"sponsorshipRemoved"},attrs:["sponsoring-org-row",""],decls:18,vars:15,consts:[["appListDropdown",""],["bitCell",""],[3,"ngClass"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","primaryGhost",3,"bitMenuTriggerFor","label",4,"ngIf"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],[1,"tw-text-danger"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","primaryGhost",3,"bitMenuTriggerFor","label"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"td",1),B.EFF(1),B.k0s(),B.j41(2,"td",1),B.EFF(3),B.k0s(),B.j41(4,"td",1)(5,"span",2),B.EFF(6),B.k0s()(),B.j41(7,"td",1),B.DNE(8,IC,2,5,"button",3),B.j41(9,"bit-menu",null,0),B.DNE(11,bC,4,7,"button",4),B.nI1(12,"async"),B.j41(13,"button",5),B.nI1(14,"i18n"),B.bIt("click",function(){return E.eBV(e),E.Njj(t.revokeSponsorship())}),B.j41(15,"span",6),B.EFF(16),B.nI1(17,"i18n"),B.k0s()()()()}2&e&&(B.R7$(),B.SpI(" ",t.sponsoringOrg.familySponsorshipFriendlyName,"\n"),B.R7$(2),B.JRh(t.sponsoringOrg.name),B.R7$(2),B.Y8G("ngClass",t.statusClass),B.R7$(),B.JRh(t.statusMessage),B.R7$(2),B.Y8G("ngIf",!t.sponsoringOrg.familySponsorshipToDelete),B.R7$(3),B.Y8G("ngIf",!t.isSelfHosted&&!t.sponsoringOrg.familySponsorshipValidUntil&&!B.bMT(12,8,t.isFreeFamilyPolicyEnabled$)),B.R7$(2),B.BMQ("aria-label",B.i5U(14,10,"revokeAccountMessage",t.sponsoringOrg.familySponsorshipFriendlyName)),B.R7$(3),B.JRh(B.bMT(17,13,"remove")))},dependencies:[H.MD,H.YU,H.bT,Dm.b,Af.Q,Ld.Q,Zd.s,CC.M,cf.Z,df.O,uf.S,H.Jj,Zu.$Z],encapsulation:2});var EC=i(65963),SC=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function QC(e,t){1&e&&(B.qex(0),B.nrm(1,"i",1),B.nI1(2,"i18n"),B.j41(3,"span",2),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function kC(e,t){if(1&e&&B.nrm(0,"bit-option",14),2&e){const e=t.$implicit;B.Y8G("value",e.id)("label",e.name)}}function TC(e,t){if(1&e&&(B.j41(0,"form",6)(1,"div",7)(2,"div",8)(3,"bit-form-field")(4,"bit-label"),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-select",9),B.nrm(8,"bit-option",10),B.nI1(9,"i18n"),B.DNE(10,kC,1,2,"bit-option",11),B.nI1(11,"async"),B.k0s()()(),B.j41(12,"div",8)(13,"bit-form-field")(14,"bit-label"),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.nrm(17,"input",12),B.k0s()(),B.j41(18,"div",8)(19,"button",13),B.EFF(20),B.nI1(21,"i18n"),B.k0s()()()()),2&e){const e=B.XpG(2);B.Y8G("formGroup",e.sponsorshipForm)("bitSubmit",e.submit),B.R7$(5),B.JRh(B.bMT(6,10,"familiesSponsoringOrgSelect")),B.R7$(3),B.Y8G("disabled",!0)("value",null)("label","--"+B.bMT(9,12,"select")+"--"),B.R7$(2),B.Y8G("ngForOf",B.bMT(11,14,e.availableSponsorshipOrgs$)),B.R7$(5),B.SpI("",B.bMT(16,16,"sponsoredFamiliesEmail"),":"),B.R7$(2),B.BMQ("aria-invalid",e.sponsorshipEmailControl.invalid),B.R7$(3),B.SpI(" ",B.bMT(21,18,"redeem")," ")}}function FC(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"tr",20),B.bIt("sponsorshipRemoved",function(){E.eBV(e);const t=B.XpG(4);return E.Njj(t.forceReload())}),B.nrm(2,"hr"),B.k0s(),B.bVm()}if(2&e){const e=t.$implicit,i=B.XpG(4);B.R7$(),B.Y8G("sponsoringOrg",e)("isSelfHosted",i.isSelfHosted)}}function PC(e,t){if(1&e&&(B.DNE(0,FC,3,2,"ng-container",19),B.nI1(1,"async")),2&e){const e=B.XpG(3);B.Y8G("ngForOf",B.bMT(1,1,e.activeSponsorshipOrgs$))}}function RC(e,t){1&e&&(B.qex(0),B.j41(1,"bit-table"),B.qex(2,15),B.j41(3,"tr")(4,"th",16),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"th",16),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"th",16),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.nrm(13,"th",16),B.k0s(),B.bVm(),B.DNE(14,PC,2,3,"ng-template",17),B.k0s(),B.nrm(15,"hr"),B.j41(16,"p",18),B.EFF(17),B.nI1(18,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(5),B.JRh(B.bMT(6,4,"recipient")),B.R7$(3),B.JRh(B.bMT(9,6,"sponsoringOrg")),B.R7$(3),B.JRh(B.bMT(12,8,"status")),B.R7$(6),B.JRh(B.bMT(18,10,"sponsoredFamiliesLeaveCopy")))}function DC(e,t){if(1&e&&(B.qex(0),B.j41(1,"p",3),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"div",3),B.EFF(5),B.nI1(6,"i18n"),B.j41(7,"ul",4)(8,"li"),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.j41(11,"li"),B.EFF(12),B.nI1(13,"i18n"),B.k0s()()(),B.DNE(14,TC,22,20,"form",5),B.nI1(15,"async"),B.DNE(16,RC,19,12,"ng-container",0),B.nI1(17,"async"),B.bVm()),2&e){const e=B.XpG();B.R7$(2),B.SpI(" ",B.bMT(3,6,"sponsoredFamiliesEligible")," "),B.R7$(3),B.SpI(" ",B.bMT(6,8,"sponsoredFamiliesIncludeMessage"),": "),B.R7$(4),B.JRh(B.bMT(10,10,"sponsoredFamiliesPremiumAccess")),B.R7$(3),B.JRh(B.bMT(13,12,"sponsoredFamiliesSharedCollectionsForFamilyMembers")),B.R7$(2),B.Y8G("ngIf",B.bMT(15,14,e.anyOrgsAvailable$)),B.R7$(2),B.Y8G("ngIf",B.bMT(17,16,e.anyActiveSponsorships$))}}class MC{constructor(e,t,i,n,r,s,o,l,c,h,A){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.syncService=n,this.organizationService=r,this.formBuilder=s,this.accountService=o,this.toastService=l,this.policyService=c,this.freeFamiliesPolicyService=h,this.router=A,this.loading=!1,this._destroy=new d.B,this.submit=()=>SC(this,void 0,void 0,function*(){this.formPromise=this.apiService.postCreateSponsorship(this.sponsorshipForm.value.selectedSponsorshipOrgId,{sponsoredEmail:this.sponsorshipForm.value.sponsorshipEmail,planSponsorshipType:rr.MM.FamiliesForEnterprise,friendlyName:this.sponsorshipForm.value.sponsorshipEmail}),yield this.formPromise,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("sponsorshipCreated")}),this.formPromise=null,this.resetForm(),yield this.forceReload()}),this.sponsorshipForm=this.formBuilder.group({selectedSponsorshipOrgId:new a.MJ("",{validators:[a.k0.required]}),sponsorshipEmail:new a.MJ("",{validators:[a.k0.email,a.k0.required],asyncValidators:[this.notAllowedValueAsync(()=>(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.email))),!0)],updateOn:"change"})})}ngOnInit(){return SC(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));yield this.preventAccessToFreeFamiliesPage(),this.availableSponsorshipOrgs$=(0,bi.z)([this.organizationService.organizations$(e),this.policyService.policiesByType$(mt.tt.FreeFamiliesSponsorshipPolicy,e)]).pipe((0,p.T)(([e,t])=>e.filter(e=>e.familySponsorshipAvailable).map(e=>({organization:e,isPolicyEnabled:t.some(t=>t.organizationId===e.id&&t.enabled)})).filter(({isPolicyEnabled:e})=>!e).map(({organization:e})=>e))),this.availableSponsorshipOrgs$.pipe((0,pi.Q)(this._destroy)).subscribe(e=>{1===e.length&&this.sponsorshipForm.patchValue({selectedSponsorshipOrgId:e[0].id})}),this.anyOrgsAvailable$=this.availableSponsorshipOrgs$.pipe((0,p.T)(e=>e.length>0)),this.activeSponsorshipOrgs$=this.organizationService.organizations$(e).pipe((0,p.T)(e=>e.filter(e=>null!==e.familySponsorshipFriendlyName&&!e.isAdminInitiated))),this.anyActiveSponsorships$=this.activeSponsorshipOrgs$.pipe((0,p.T)(e=>e.length>0)),this.loading=!1,this.sponsorshipForm.get("sponsorshipEmail").valueChanges.pipe((0,pi.Q)(this._destroy)).subscribe(e=>{this.sponsorshipEmailControl.hasError("email")&&this.sponsorshipEmailControl.setErrors([{message:this.i18nService.t("invalidEmail")}])})})}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}preventAccessToFreeFamiliesPage(){return SC(this,void 0,void 0,function*(){(yield(0,u._)(this.freeFamiliesPolicyService.showFreeFamilies$))||(yield this.router.navigate(["/"]))})}forceReload(){return SC(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 SC(this,void 0,void 0,function*(){this.sponsorshipForm.reset()})}get isSelfHosted(){return this.platformUtilsService.isSelfHost()}notAllowedValueAsync(e,t=!1){return i=>SC(this,void 0,void 0,function*(){let n=yield e(),r=i.value;if(t&&(n=n.toLowerCase(),r=r.toLowerCase()),r===n)return{errors:{message:this.i18nService.t("cannotSponsorSelf")}}})}}MC.ɵfac=function(e){return new(e||MC)(B.rXU(de.G),B.rXU(U.W),B.rXU(V.y),B.rXU(uh.H),B.rXU(f.PV),B.rXU(a.ok),B.rXU(Y.D),B.rXU(P.f),B.rXU(me.m),B.rXU(yC.A),B.rXU(F.Ix))},MC.ɵcmp=B.VBU({type:MC,selectors:[["app-sponsored-families"]],decls:4,vars:2,consts:[[4,"ngIf"],[1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitTypography","body1"],[1,"tw-list-outside"],[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-7"],["id","availableSponsorshipOrg","name","Available Sponsorship Organization","formControlName","selectedSponsorshipOrgId"],[3,"disabled","value","label"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","inputmode","email","formControlName","sponsorshipEmail","appInputStripSpaces",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],[3,"value","label"],["header",""],["bitCell",""],["body","","alignContent","middle"],["bitTypography","body2"],[4,"ngFor","ngForOf"],["bitRow","","sponsoring-org-row","",3,"sponsorshipRemoved","sponsoringOrg","isSelfHosted"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container"),B.DNE(2,QC,6,7,"ng-container",0)(3,DC,18,18,"ng-container",0),B.k0s()),2&e&&(B.R7$(2),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",!t.loading))},dependencies:[jd.p,EC.J,Kd.C,_d.$,eu.L,Yd.t,Jd.Q,H.MD,H.Sq,H.bT,Cg.H,Xd.L,tu.j,nu.J,ru.h,yg.G,wg.f,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,mv.p,cg.w,dg.P,BC,Dm.b,Af.Q,pf.Y,gf._,gf.O,DA.E,MA.r,au.$,H.Jj],encapsulation:2});var xC=i(30556);const OC=(e,t)=>({"tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300":e,"tw-pt-6":t});function GC(e,t){if(1&e&&(B.j41(0,"div",0),B.SdG(1),B.k0s()),2&e){const e=B.XpG();B.Y8G("ngClass",B.l_i(1,OC,e.applyBorder,e.addSubLabelSpacing))}}class UC extends xC.VI{constructor(){super(...arguments),this.subLabel="",this.applyBorder=!0,this.addSubLabelSpacing=!1}}UC.ɵfac=(()=>{let e;return function(t){return(e||(e=B.xGo(UC)))(t||UC)}})(),UC.ɵcmp=B.VBU({type:UC,selectors:[["app-vertical-step"]],inputs:{subLabel:"subLabel",applyBorder:"applyBorder",addSubLabelSpacing:"addSubLabelSpacing"},standalone:!1,features:[B.Jv_([{provide:xC.VI,useExisting:UC}]),B.Vt3],ngContentSelectors:["*"],decls:1,vars:0,consts:[[1,"tw-inline-block","tw-w-11/12","tw-pl-7",3,"ngClass"]],template:function(e,t){1&e&&(B.NAR(),B.DNE(0,GC,2,4,"ng-template"))},dependencies:[H.YU],encapsulation:2});const VC=e=>({"hover:tw-bg-secondary-100":e}),jC=e=>({"tw-font-medium":e}),NC=e=>({"tw-mt-1":e}),zC=(e,t,i)=>({"tw-bg-primary-600 tw-text-contrast":e,"tw-bg-secondary-300 tw-text-main":t,"tw-bg-transparent tw-text-muted":i});function YC(e,t){if(1&e&&(B.j41(0,"span",7),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.Y8G("ngClass",B.sMw(2,zC,e.selected,!e.selected&&!e.disabled&&e.step.editable,e.disabled)),B.R7$(),B.SpI(" ",e.stepNumber," ")}}function LC(e,t){1&e&&(B.j41(0,"span",8),B.nrm(1,"i",9),B.k0s())}class KC{constructor(){this.onSelectStep=new B.bkB,this.disabled=!1,this.selected=!1}selectStep(){this.onSelectStep.emit()}}function XC(e,t){if(1&e&&B.nrm(0,"div",5),2&e){const e=B.XpG(2);B.Y8G("ngTemplateOutlet",e.selected?e.selected.content:null)}}function qC(e,t){1&e&&B.nrm(0,"div",6)}function HC(e,t){if(1&e){const e=B.RV6();B.j41(0,"li")(1,"app-vertical-step-content",2),B.bIt("onSelectStep",function(){const t=E.eBV(e).index,i=B.XpG();return E.Njj(i.selectStepByIndex(t))}),B.k0s(),B.DNE(2,XC,1,1,"div",3)(3,qC,1,0,"div",4),B.k0s()}if(2&e){const e=t.$implicit,i=t.index,n=t.last,r=B.XpG();B.R7$(),B.Y8G("disabled",r.isStepDisabled(i))("selected",r.selectedIndex===i)("step",e)("stepNumber",i+1),B.R7$(),B.Y8G("ngIf",r.selectedIndex===i),B.R7$(),B.Y8G("ngIf",!(n||r.selectedIndex===i))}}KC.ɵfac=function(e){return new(e||KC)},KC.ɵcmp=B.VBU({type:KC,selectors:[["app-vertical-step-content"]],inputs:{disabled:"disabled",selected:"selected",step:"step",stepNumber:"stepNumber"},outputs:{onSelectStep:"onSelectStep"},standalone:!1,decls:9,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,"click","disabled","ngClass"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-font-medium tw-leading-9",3,"ngClass",4,"ngIf"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-bg-primary-600 tw-font-medium 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-medium","tw-leading-9",3,"ngClass"],[1,"tw-mr-3.5","tw-w-9","tw-rounded-full","tw-bg-primary-600","tw-font-medium","tw-leading-9","tw-text-contrast"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check","tw-p-1"]],template:function(e,t){1&e&&(B.j41(0,"div",0)(1,"button",1),B.bIt("click",function(){return t.selectStep()}),B.DNE(2,YC,2,6,"span",2)(3,LC,2,0,"span",3),B.j41(4,"div",4)(5,"p",5),B.EFF(6),B.k0s(),B.j41(7,"p",6),B.EFF(8),B.k0s()()()()),2&e&&(B.R7$(),B.Y8G("disabled",t.disabled)("ngClass",B.eq3(9,VC,!t.disabled&&t.step.editable)),B.BMQ("aria-expanded",t.selected),B.R7$(),B.Y8G("ngIf",!t.step.completed),B.R7$(),B.Y8G("ngIf",t.step.completed),B.R7$(),B.Y8G("ngClass",B.eq3(11,jC,t.selected)),B.R7$(),B.Y8G("ngClass",B.eq3(13,NC,!t.step.subLabel)),B.R7$(),B.SpI(" ",t.step.label," "),B.R7$(2),B.JRh(t.step.subLabel))},dependencies:[H.YU,H.bT],encapsulation:2});class WC extends xC.Up{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}}WC.ɵfac=(()=>{let e;return function(t){return(e||(e=B.xGo(WC)))(t||WC)}})(),WC.ɵcmp=B.VBU({type:WC,selectors:[["app-vertical-stepper"]],inputs:{activeClass:"activeClass"},standalone:!1,features:[B.Jv_([{provide:xC.Up,useExisting:WC}]),B.Vt3],decls:3,vars:1,consts:[[1,"tw-flex","tw-list-none","tw-flex-col","tw-flex-wrap","tw-p-5"],[4,"ngFor","ngForOf"],[3,"onSelectStep","disabled","selected","step","stepNumber"],["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&&(B.j41(0,"div")(1,"ul",0),B.DNE(2,HC,4,6,"li",1),B.k0s()()),2&e&&(B.R7$(2),B.Y8G("ngForOf",t.steps))},dependencies:[H.Sq,H.bT,H.T3,KC],encapsulation:2});var $C=i(58688),JC=i(32706),ZC=i(65731),_C=i(9753),ew=i(69022),tw=i(9327),iw=i(14055),nw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const rw="annually",sw="monthly";class ow{constructor(e,t,i,n,r){this.accountService=e,this.apiService=t,this.organizationBillingService=i,this.previewInvoiceClient=n,this.configService=r,this.plans$=(0,jt.H)(this.apiService.getPlans()).pipe((0,Bi.t)({bufferSize:1,refCount:!0})),this.getPrices$=(e,t)=>this.plans$.pipe((0,lr.v)(this.configService.getFeatureFlag$(dr.TO.PM26462_Milestone_3)),(0,p.T)(([i,n])=>{switch(t){case"families":return{annually:i.data.find(e=>e.type===(n?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025)).PasswordManager.basePrice};case"teams":case"enterprise":{const n=i.data.find(e=>e.type===("teams"===t?rr.OL.TeamsAnnually:rr.OL.EnterpriseAnnually)),r=i.data.find(e=>e.type===("teams"===t?rr.OL.TeamsMonthly:rr.OL.EnterpriseMonthly));switch(e){case"passwordManager":return{annually:n.PasswordManager.seatPrice,monthly:r.PasswordManager.seatPrice};case"secretsManager":return{annually:n.SecretsManager.seatPrice,monthly:r.SecretsManager.seatPrice}}}}})),this.getCosts=(e,t,i,n,r)=>nw(this,void 0,void 0,function*(){const s=(0,_C.kx)(n);return yield this.previewInvoiceClient.previewTaxForOrganizationSubscriptionPurchase({tier:t,cadence:i,passwordManager:{seats:1,additionalStorage:0,sponsored:!1},secretsManager:"secretsManager"===e?{seats:1,additionalServiceAccounts:0,standalone:!0}:void 0},s,r)}),this.startTrial=(e,t,i,n,r)=>nw(this,void 0,void 0,function*(){var s;const o=[n.token,(0,iw.x$)(n.type)],a=yield((e,t)=>nw(this,void 0,void 0,function*(){const i=yield(0,u._)(this.plans$),n=(yield this.configService.getFeatureFlag(dr.TO.PM26462_Milestone_3))?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025;switch(e){case"families":return i.data.find(e=>e.type===n).type;case"teams":return i.data.find(e=>e.type===("annually"===t?rr.OL.TeamsAnnually:rr.OL.TeamsMonthly)).type;case"enterprise":return i.data.find(e=>e.type===("annually"===t?rr.OL.EnterpriseAnnually:rr.OL.EnterpriseMonthly)).type}}))(e.tier,t),l=Object.assign({organization:{name:e.organization.name,billingEmail:e.organization.email,initiationPath:"passwordManager"===e.product?"Password Manager trial from marketing website":"Secrets Manager trial from marketing website"},plan:"passwordManager"===e.product?{type:a,passwordManagerSeats:1}:{type:a,passwordManagerSeats:1,subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0,secretsManagerSeats:1},payment:{paymentMethod:o,billing:{country:i.country,postalCode:i.postalCode,taxId:null!==(s=i.taxId)&&void 0!==s?s:void 0},skipTrial:0===e.length}},(null==r?void 0:r.length)?{coupons:r}:{}),c=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));return yield this.organizationBillingService.purchaseSubscription(l,c)})}}ow.ɵfac=function(e){return new(e||ow)(E.KVO(Y.D),E.KVO(de.G),E.KVO(Tn.Y),E.KVO(tw.dA),E.KVO(z.w))},ow.ɵprov=E.jDH({token:ow,factory:ow.ɵfac,providedIn:"root"});var aw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const lw=e=>({type:"checkout",supportsTaxId:e});function cw(e,t){1&e&&B.eu8(0)}function dw(e,t){if(1&e&&B.DNE(0,cw,1,0,"ng-container",2),2&e){B.XpG();const e=B.sdS(4);B.Y8G("ngTemplateOutlet",e)}}function uw(e,t){if(1&e&&B.nrm(0,"billing-discount-badge",8),2&e){const e=t.$implicit;B.Y8G("discount",e)}}function hw(e,t){if(1&e&&(B.j41(0,"div",10)(1,"bit-radio-button",20)(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.nI1(5,"currency"),B.nI1(6,"i18n"),B.k0s()()()),2&e){B.XpG();const e=B.r8f(0);B.R7$(),B.Y8G("value","monthly"),B.R7$(2),B.E5c(" ",B.bMT(4,4,"monthly")," - ",B.i5U(5,6,e.monthly,"$")," /",B.bMT(6,9,"monthAbbr")," ")}}function Aw(e,t){if(1&e&&(B.j41(0,"div",16),B.SS7(1),B.nI1(2,"async"),B.j41(3,"div",21),B.EFF(4),B.nI1(5,"i18n"),B.nI1(6,"async"),B.nI1(7,"currency"),B.j41(8,"div"),B.EFF(9),B.nI1(10,"i18n"),B.nI1(11,"currency"),B.k0s()(),B.nrm(12,"hr",22),B.j41(13,"p",23)(14,"strong"),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.EFF(17),B.nI1(18,"currency"),B.nI1(19,"i18n"),B.k0s()()),2&e){const e=B.XpG(2),t="passwordManager"===e.trial().product?"passwordManagerPlanPrice":"secretsManagerPlanPrice",i=B.bMT(2,7,e.selectionCosts$);B.R7$(4),B.Lme(" ",B.bMT(5,9,t),": ",B.i5U(7,13,B.bMT(6,11,e.selectionPrice$),"USD $")," "),B.R7$(5),B.Lme(" ",B.bMT(10,16,"estimatedTax"),": ",B.i5U(11,18,i.tax,"USD $")," "),B.R7$(6),B.SpI("",B.bMT(16,21,"total"),": ");const n="annually"===e.formGroup.value.cadence?"year":"month";B.R7$(2),B.Lme(" ",B.i5U(18,23,i.total,"USD $"),"/",B.bMT(19,26,n)," ")}}function pw(e,t){if(1&e){const e=B.RV6();B.SS7(0),B.nI1(1,"async"),B.j41(2,"form",1)(3,"div",3)(4,"div",4)(5,"div",5)(6,"h2",6),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"div",7),B.Z7z(10,uw,1,1,"billing-discount-badge",8,B.fX1),B.k0s()(),B.j41(12,"bit-radio-group",9)(13,"div",10)(14,"bit-radio-button",11)(15,"bit-label"),B.EFF(16),B.nI1(17,"i18n"),B.nI1(18,"currency"),B.nI1(19,"i18n"),B.k0s()()(),B.nVh(20,hw,7,11,"div",10),B.k0s()(),B.j41(21,"div",12)(22,"h2",13),B.EFF(23),B.nI1(24,"i18n"),B.k0s(),B.nrm(25,"app-enter-payment-method",14)(26,"app-enter-billing-address",15),B.nVh(27,Aw,20,28,"div",16),B.k0s(),B.j41(28,"div",17)(29,"button",18),B.EFF(30),B.nI1(31,"i18n"),B.k0s(),B.j41(32,"button",19),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.stepBack())}),B.EFF(33),B.nI1(34,"i18n"),B.k0s()()()()}if(2&e){const e=B.XpG(),t=B.bH3(B.bMT(1,16,e.prices$));B.R7$(2),B.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),B.R7$(5),B.JRh(B.bMT(8,19,"billingPlanLabel")),B.R7$(3),B.Dyx(e.cartDiscounts()),B.R7$(2),B.Y8G("formControl",e.formGroup.controls.cadence),B.R7$(2),B.Y8G("value","annually"),B.R7$(2),B.E5c(" ",B.bMT(17,21,"annual")," - ",B.i5U(18,23,t.annually,"$")," /",B.bMT(19,26,"yr")," "),B.R7$(4),B.vxM(t.monthly?20:-1),B.R7$(3),B.JRh(B.bMT(24,28,"paymentType")),B.R7$(2),B.Y8G("group",e.formGroup.controls.paymentMethod),B.R7$(),B.Y8G("group",e.formGroup.controls.billingAddress)("scenario",B.eq3(34,lw,"families"!==e.trial().tier)),B.R7$(),B.vxM(0===e.trial().length?27:-1),B.R7$(3),B.SpI(" ",B.bMT(31,30,e.trial().length>0?"startTrial":"submit")," "),B.R7$(3),B.SpI(" ",B.bMT(34,32,"back")," ")}}function gw(e,t){1&e&&(B.nrm(0,"i",24),B.nI1(1,"i18n"),B.j41(2,"span",25),B.EFF(3),B.nI1(4,"i18n"),B.k0s()),2&e&&(B.Y8G("title",B.mNQ(B.bMT(1,3,"loading"))),B.R7$(3),B.JRh(B.bMT(4,5,"loading")))}class vw{constructor(e,t,i,n){this.i18nService=e,this.toastService=t,this.trialBillingStepService=i,this.subscriptionDiscountService=n,this.trial=r.hFB.required(),this.steppedBack=(0,r.CGW)(),this.organizationCreated=(0,r.CGW)(),this.destroy$=new d.B,this.formGroup=new a.gE({cadence:new a.MJ(rw,{nonNullable:!0}),paymentMethod:_C.Pu.getFormGroup(),billingAddress:_C.vU.getFormGroup()}),this.discountTierType=(0,Rp.EW)(()=>"families"===this.trial().tier?JC.A.Families:null),this.eligibleDiscounts=(0,c.ot)((0,c.br)(this.discountTierType).pipe((0,rt.n)(e=>e?this.subscriptionDiscountService.getEligibleDiscountsForTier$(e).pipe((0,cr.W)(()=>(0,Ii.of)([]))):(0,Ii.of)([]))),{initialValue:[]}),this.cartDiscounts=(0,Rp.EW)(()=>this.eligibleDiscounts().map(e=>this.subscriptionDiscountService.mapToCartDiscount(e)).filter(e=>null!==e)),this.eligibleCouponIds=(0,Rp.EW)(()=>this.eligibleDiscounts().map(e=>e.stripeCouponId)),this.eligibleDiscounts$=(0,c.br)(this.eligibleDiscounts),this.submit=()=>aw(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t=this.formGroup.controls.billingAddress.getRawValue();try{const i=yield this.trialBillingStepService.startTrial(this.trial(),this.formGroup.value.cadence,t,e,this.eligibleCouponIds());this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")}),this.organizationCreated.emit({organizationId:i.id,planDescription:yield(0,u._)(this.selectionDescription$)})}catch(i){if(!this.subscriptionDiscountService.isDiscountExpiredError(i))throw i;this.subscriptionDiscountService.refresh(),this.toastService.showToast({variant:"warning",title:"",message:this.i18nService.t("discountExpiredOnPurchase")})}}),this.stepBack=()=>this.steppedBack.emit()}ngOnInit(){return aw(this,void 0,void 0,function*(){const{product:e,tier:t}=this.trial();this.prices$=this.trialBillingStepService.getPrices$(e,t);const i=this.formGroup.controls.cadence.valueChanges.pipe((0,gi.Z)(rw));this.selectionPrice$=(0,bi.z)([this.prices$,i]).pipe((0,p.T)(([e,t])=>e[t]),(0,h.p)(e=>!!e)),this.selectionCosts$=(0,bi.z)([i,this.formGroup.controls.billingAddress.valueChanges.pipe((0,gi.Z)(this.formGroup.controls.billingAddress.value),(0,h.p)(e=>!!e.country&&!!e.postalCode)),this.eligibleDiscounts$]).pipe((0,Jg.B)(500),(0,rt.n)(([i,n])=>this.trialBillingStepService.getCosts(e,t,i,n,this.eligibleCouponIds())),(0,gi.Z)({tax:0,total:0}),(0,Bi.t)({bufferSize:1,refCount:!0})),this.selectionDescription$=(0,bi.z)([this.selectionPrice$,i]).pipe((0,p.T)(([e,t])=>{switch(t){case rw:return`${this.i18nService.t("annual")} ($${e}/${this.i18nService.t("yr")})`;case sw:return`${this.i18nService.t("monthly")} ($${e}/${this.i18nService.t("monthAbbr")})`}}))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}vw.ɵfac=function(e){return new(e||vw)(B.rXU(U.W),B.rXU(P.f),B.rXU(ow),B.rXU(ew.s))},vw.ɵcmp=B.VBU({type:vw,selectors:[["app-trial-billing-step"]],viewQuery:function(e,t){if(1&e&&B.GBs(_C.Pu,5),2&e){let e;B.mGM(e=B.lsd())&&(t.enterPaymentMethodComponent=e.first)}},inputs:{trial:[1,"trial"]},outputs:{steppedBack:"steppedBack",organizationCreated:"organizationCreated"},decls:5,vars:3,consts:[["loadingSpinner",""],[3,"formGroup","bitSubmit"],[4,"ngTemplateOutlet"],[1,"tw-container","tw-mb-3"],[1,"tw-mb-6"],[1,"tw-mb-3","tw-flex","tw-items-center"],[1,"!tw-m-0","tw-text-base","tw-font-medium"],[1,"tw-flex","tw-gap-1","tw-ml-2"],[3,"discount"],[3,"formControl"],[1,"tw-mb-1","tw-items-center"],["id","annual-cadence-button",3,"value"],[1,"tw-mb-4"],[1,"tw-mb-3","tw-text-base","tw-font-medium"],[3,"group"],[3,"group","scenario"],["id","price",1,"tw-my-4"],[1,"tw-flex","tw-space-x-2"],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","type","button","buttonType","secondary",3,"click"],["id","monthly-cadence-button",3,"value"],[1,"tw-text-muted","tw-text-base"],[1,"tw-my-1","tw-grid","tw-grid-cols-3","tw-ml-0"],[1,"tw-text-lg"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(B.nVh(0,dw,1,1,"ng-container"),B.nI1(1,"async"),B.vZN(2,pw,35,36,"form",1),B.DNE(3,gw,5,7,"ng-template",null,0,B.C5r)),2&e&&B.vxM(B.bMT(1,1,t.prices$)?2:0)},dependencies:[_C.Pu,_C.vU,oh.G,H.T3,a.qT,a.BC,a.cb,a.l_,a.j4,_d.$,eu.L,Jd.Q,tu.j,Xv.d,qv.Y,ZC.UJ,H.Jj,H.oe,au.$],encapsulation:2});var fw=i(54873);function mw(e,t){if(1&e&&(B.j41(0,"p",5),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.SpI(" ",B.i5U(2,1,"trialThankYou",e.orgLabel)," ")}}function yw(e,t){1&e&&(B.j41(0,"p",5),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,1,"smFreeTrialThankYou")," "))}function Cw(e,t){if(1&e&&(B.j41(0,"li")(1,"p"),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.SpI(" ",B.i5U(3,1,"trialPaidInfoMessage",e.orgLabel)," ")}}class ww{constructor(){this.product=rr.ch.PasswordManager,this.Product=rr.ch}}ww.ɵfac=function(e){return new(e||ww)},ww.ɵcmp=B.VBU({type:ww,selectors:[["app-trial-confirmation-details"]],inputs:{email:"email",orgLabel:"orgLabel",product:"product",trialLength:"trialLength"},standalone:!1,decls:12,vars:7,consts:[[1,"tw-pb-6","tw-pl-6"],["class","tw-text-xl",4,"ngIf"],[1,"tw-list-disc"],[1,"tw-font-medium"],[4,"ngIf"],[1,"tw-text-xl"]],template:function(e,t){1&e&&(B.j41(0,"div",0),B.DNE(1,mw,3,4,"p",1)(2,yw,3,3,"p",1),B.j41(3,"ul",2)(4,"li")(5,"p"),B.EFF(6),B.nI1(7,"i18n"),B.j41(8,"span",3),B.EFF(9),B.k0s(),B.EFF(10,". "),B.k0s()(),B.DNE(11,Cw,4,4,"li",4),B.k0s()()),2&e&&(B.R7$(),B.Y8G("ngIf",t.product===t.Product.PasswordManager),B.R7$(),B.Y8G("ngIf",t.product===t.Product.SecretsManager),B.R7$(4),B.SpI(" ",B.bMT(7,5,"trialConfirmationEmail")," "),B.R7$(3),B.JRh(t.email),B.R7$(2),B.Y8G("ngIf",t.trialLength>0))},dependencies:[H.bT,au.$],encapsulation:2});var Iw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const bw=["stepper"],Bw=()=>({key:"createAccount"}),Ew=e=>["/sm",e],Sw=e=>["/organizations",e,"vault"],Qw=e=>["/organizations",e,"members"];function kw(e,t){1&e&&(B.j41(0,"div",1),B.nrm(1,"i",2),B.nI1(2,"i18n"),B.j41(3,"span",3),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function Tw(e,t){if(1&e){const e=B.RV6();B.j41(0,"div")(1,"auth-input-password",5),B.bIt("onPasswordFormSubmit",function(t){E.eBV(e);const i=B.XpG(2);return E.Njj(i.handlePasswordSubmit(t))}),B.k0s()()}if(2&e){const e=B.XpG(2);B.R7$(),B.Y8G("flow",e.inputPasswordFlow)("email",e.email)("loading",e.submitting)("masterPasswordPolicyOptions",e.enforcedPolicyOptions)("primaryButtonText",B.lJ4(5,Bw))}}function Fw(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-trial-billing-step",19),B.bIt("steppedBack",function(){E.eBV(e);const t=B.XpG(4);return E.Njj(t.previousStep())})("organizationCreated",function(t){E.eBV(e);const i=B.XpG(4);return E.Njj(i.createdOrganization(t))}),B.k0s()}if(2&e){const e=B.XpG(4);B.Y8G("trial",e.trial)}}function Pw(e,t){if(1&e&&(B.j41(0,"app-vertical-step",17),B.DNE(1,Fw,1,1,"app-trial-billing-step",18),B.k0s()),2&e){B.XpG();const e=B.sdS(2),t=B.XpG(2);B.Y8G("subLabel",t.billingSubLabel),B.R7$(),B.Y8G("ngIf",2===e.selectedIndex)}}function Rw(e,t){if(1&e){const e=B.RV6();B.j41(0,"div")(1,"app-vertical-stepper",6,0),B.bIt("selectionChange",function(t){E.eBV(e);const i=B.XpG(2);return E.Njj(i.verticalStepChange(t))}),B.j41(3,"app-vertical-step",7)(4,"auth-input-password",5),B.bIt("onPasswordFormSubmit",function(t){E.eBV(e);const i=B.XpG(2);return E.Njj(i.handlePasswordSubmit(t))}),B.k0s()(),B.j41(5,"app-vertical-step",8),B.nrm(6,"app-org-info",9),B.j41(7,"button",10),B.nI1(8,"async"),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.orgNameEntrySubmit())}),B.EFF(9),B.nI1(10,"async"),B.nI1(11,"i18n"),B.nI1(12,"i18n"),B.k0s()(),B.DNE(13,Pw,2,2,"app-vertical-step",11),B.nI1(14,"async"),B.j41(15,"app-vertical-step",12),B.nrm(16,"app-trial-confirmation-details",13),B.j41(17,"div",14)(18,"a",15),B.EFF(19),B.nI1(20,"i18n"),B.nI1(21,"titlecase"),B.k0s(),B.j41(22,"a",16),B.EFF(23),B.nI1(24,"i18n"),B.k0s()()()()()}if(2&e){const e=B.XpG(2);B.R7$(3),B.Y8G("editable",!1)("subLabel",e.email),B.R7$(),B.Y8G("flow",e.inputPasswordFlow)("email",e.email)("loading",e.submitting)("masterPasswordPolicyOptions",e.enforcedPolicyOptions)("primaryButtonText",B.lJ4(39,Bw)),B.R7$(),B.Y8G("subLabel",e.orgInfoSubLabel),B.R7$(),B.Y8G("nameOnly",!0)("formGroup",e.orgInfoFormGroup),B.R7$(),B.Y8G("disabled",e.orgInfoFormGroup.controls.name.invalid)("loading",e.loading&&B.bMT(8,23,e.trialPaymentOptional$)),B.R7$(2),B.SpI(" ",B.bMT(10,25,e.trialPaymentOptional$)&&e.trialLength>0?B.bMT(11,27,"startTrial"):B.bMT(12,29,"next")," "),B.R7$(4),B.Y8G("ngIf",B.bMT(14,31,e.showBillingStep$)),B.R7$(2),B.Y8G("applyBorder",!1),B.R7$(),B.Y8G("email",e.email)("orgLabel",e.orgLabel)("product",e.product)("trialLength",e.trialLength),B.R7$(2),B.Y8G("routerLink",e.product===e.ProductType.SecretsManager?B.eq3(40,Ew,e.orgId):B.eq3(42,Sw,e.orgId)),B.R7$(),B.SpI(" ",B.bMT(21,35,B.bMT(20,33,"getStarted"))," "),B.R7$(3),B.Y8G("routerLink",B.eq3(44,Qw,e.orgId)),B.R7$(),B.SpI(" ",B.bMT(24,37,"inviteUsers")," ")}}function Dw(e,t){if(1&e&&B.DNE(0,Tw,2,6,"div",4)(1,Rw,25,46,"div",4),2&e){const e=B.XpG();B.Y8G("ngIf",!e.useTrialStepper),B.R7$(),B.Y8G("ngIf",e.useTrialStepper)}}class Mw{constructor(e,t,i,n,r,s,o,l,c,u,h,A,g,v,f,m){this.router=e,this.route=t,this.formBuilder=i,this.logService=n,this.policyApiService=r,this.policyService=s,this.i18nService=o,this.routerService=l,this.organizationBillingService=c,this.organizationInviteService=u,this.toastService=h,this.registrationFinishService=A,this.validationService=g,this.loginStrategyService=v,this.configService=f,this.accountService=m,this.inputPasswordFlow=le.m5.SetInitialPasswordAccountRegistration,this.initializing=!0,this.stepperProductTypes=[rr.K_.Teams,rr.K_.Enterprise,rr.K_.Families],this.useTrialStepper=!1,this.submitting=!1,this.validProducts=[rr.ch.PasswordManager,rr.ch.SecretsManager],this.orgInfoSubLabel="",this.orgId="",this.orgLabel="",this.billingSubLabel="",this.email="",this.loading=!1,this.orgInfoFormGroup=this.formBuilder.group({name:["",{validators:[a.k0.required,a.k0.maxLength(50)],updateOn:"change"}],billingEmail:[""]}),this.destroy$=new d.B,this.ProductType=rr.ch,this.trialPaymentOptional$=this.configService.getFeatureFlag$(dr.TO.TrialPaymentOptional),this.showBillingStep$=this.trialPaymentOptional$.pipe((0,p.T)(e=>!e&&!this.isSecretsManagerFree||e&&0===this.trialLength))}ngOnInit(){return Iw(this,void 0,void 0,function*(){this.route.queryParams.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{null!=e.email&&e.email.indexOf("@")>-1&&(this.email=e.email,this.orgInfoFormGroup.controls.billingEmail.setValue(e.email)),e.fromEmail&&"true"===e.fromEmail&&this.toastService.showToast({title:"",message:this.i18nService.t("emailVerifiedV2"),variant:"success"}),null!=e.token&&(this.emailVerificationToken=e.token);const t=parseInt(e.product);this.product=this.validProducts.includes(t)?t:rr.ch.PasswordManager;const i=parseInt(e.productTier);this.productTierValue=i;const n=this.stepperProductTypes.includes(i),r=this.product===rr.ch.SecretsManager;!n&&!r||isNaN(i)||(this.productTier=i,this.orgLabel=this.planTypeDisplay,this.useTrialStepper=!0),this.trialLength=e.trialLength?parseInt(e.trialLength):7,this.setupFamilySponsorship(e.sponsorshipToken)});const e=yield this.organizationInviteService.getOrganizationInvite();let t=null;if(null!=e&&e.organizationId&&e.token&&e.email&&e.organizationUserId)try{t=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(i){this.logService.error(i)}null!==t&&this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.masterPasswordPolicyOptions$(e,t)),(0,pi.Q)(this.destroy$)).subscribe(e=>{this.enforcedPolicyOptions=e}),this.orgInfoFormGroup.controls.name.valueChanges.pipe((0,pi.Q)(this.destroy$)).subscribe(()=>{this.orgInfoFormGroup.controls.name.markAsTouched()}),this.initializing=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}verticalStepChange(e){1===e.selectedIndex&&""===this.orgInfoFormGroup.controls.name.value?this.orgInfoSubLabel=this.planInfoLabel:1===e.previouslySelectedIndex&&(this.orgInfoSubLabel=this.orgInfoFormGroup.controls.name.value)}orgNameEntrySubmit(){return Iw(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));(yield(0,u._)(this.trialPaymentOptional$))&&this.trialLength>0?yield this.createOrganizationOnTrial(e):yield this.conditionallyCreateOrganization(e)})}createdOrganization(e){this.orgId=e.organizationId,this.billingSubLabel=e.planDescription,this.verticalStepper.next()}createOrganizationOnTrial(e){return Iw(this,void 0,void 0,function*(){this.loading=!0;let t="Password Manager trial from marketing website",i={type:yield this.getPlanType(),passwordManagerSeats:1};this.product===rr.ch.SecretsManager&&(t="Secrets Manager trial from marketing website",i=Object.assign(Object.assign({},i),{subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0,secretsManagerSeats:1}));const n={name:null==this.orgInfoFormGroup.value.name?"":this.orgInfoFormGroup.value.name,billingEmail:null==this.orgInfoFormGroup.value.billingEmail?"":this.orgInfoFormGroup.value.billingEmail,initiationPath:t},r=yield this.organizationBillingService.purchaseSubscriptionNoPaymentMethod({organization:n,plan:i},e);this.orgId=null==r?void 0:r.id,this.billingSubLabel=r.name.toString(),this.loading=!1,this.verticalStepper.next()})}previousStep(){this.verticalStepper.previous()}getPlanType(){return Iw(this,void 0,void 0,function*(){const e=(yield this.configService.getFeatureFlag(dr.TO.PM26462_Milestone_3))?rr.OL.FamiliesAnnually:rr.OL.FamiliesAnnually2025;switch(this.productTier){case rr.K_.Teams:return rr.OL.TeamsAnnually;case rr.K_.Enterprise:return rr.OL.EnterpriseAnnually;case rr.K_.Families:return e;case rr.K_.Free:return rr.OL.Free;default:return rr.OL.EnterpriseAnnually}})}get isSecretsManagerFree(){return this.product===rr.ch.SecretsManager&&this.productTier===rr.K_.Free}get planTypeDisplay(){switch(this.productTier){case rr.K_.Teams:return"Teams";case rr.K_.Enterprise:return"Enterprise";case rr.K_.Families:return"Families";default:return""}}get planInfoLabel(){switch(this.productTier){case rr.K_.Teams:return this.i18nService.t("enterTeamsOrgInfo");case rr.K_.Enterprise:return this.i18nService.t("enterEnterpriseOrgInfo");case rr.K_.Families:return this.i18nService.t("enterFamiliesOrgInfo");default:return""}}conditionallyCreateOrganization(e){return Iw(this,void 0,void 0,function*(){if(!this.isSecretsManagerFree)return void this.verticalStepper.next();const t=yield this.organizationBillingService.startFree({organization:{name:null==this.orgInfoFormGroup.value.name?"":this.orgInfoFormGroup.value.name,billingEmail:null==this.orgInfoFormGroup.value.billingEmail?"":this.orgInfoFormGroup.value.billingEmail,initiationPath:"Password Manager trial from marketing website"},plan:{type:0,subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0}},e);this.orgId=t.id,this.verticalStepper.next()})}handlePasswordSubmit(e){return Iw(this,void 0,void 0,function*(){if(!this.useTrialStepper)return yield this.finishRegistration(e),this.submitting=!1,void(yield this.router.navigate(["/login"],{queryParams:{email:this.email}}));yield this.finishRegistration(e),yield this.logIn(e.newPassword),this.submitting=!1,this.verticalStepper.next()})}setupFamilySponsorship(e){if(null!=e){const t=this.router.createUrlTree(["setup/families-for-enterprise"],{queryParams:{plan:e}});this.routerService.setPreviousUrl(t.toString())}}logIn(e){return Iw(this,void 0,void 0,function*(){const t=new v.F2(this.email,e);yield this.loginStrategyService.logIn(t)})}finishRegistration(e){return Iw(this,void 0,void 0,function*(){return this.submitting=!0,this.registrationFinishService.finishRegistration(this.email,e,this.emailVerificationToken).catch(e=>(this.validationService.showError(e),this.submitting=!1,null))})}get trial(){const e=this.product===rr.ch.PasswordManager?"passwordManager":"secretsManager",t=this.productTier===rr.K_.Families?"families":this.productTier===rr.K_.Teams?"teams":"enterprise";return{organization:{name:this.orgInfoFormGroup.value.name,email:this.orgInfoFormGroup.value.billingEmail},product:e,tier:t,length:this.trialLength}}}Mw.ɵfac=function(e){return new(e||Mw)(B.rXU(F.Ix),B.rXU(F.nX),B.rXU(a.ok),B.rXU(Vs.K),B.rXU(fe.m),B.rXU(me.m),B.rXU(U.W),B.rXU(CA.H),B.rXU(Tn.Y),B.rXU(ji.i),B.rXU(P.f),B.rXU(le.mZ),B.rXU(Xs.B),B.rXU(v.sg),B.rXU(z.w),B.rXU(Y.D))},Mw.ɵcmp=B.VBU({type:Mw,selectors:[["app-complete-trial-initiation"]],viewQuery:function(e,t){if(1&e&&B.GBs(bw,5),2&e){let e;B.mGM(e=B.lsd())&&(t.verticalStepper=e.first)}},standalone:!1,decls:2,vars:1,consts:[["stepper",""],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[4,"ngIf"],[3,"onPasswordFormSubmit","flow","email","loading","masterPasswordPolicyOptions","primaryButtonText"],["linear","",3,"selectionChange"],["label","Create Account",3,"editable","subLabel"],["label","Organization Information",3,"subLabel"],[3,"nameOnly","formGroup"],["type","button","bitButton","","buttonType","primary",3,"click","disabled","loading"],["label","Billing",3,"subLabel",4,"ngIf"],["label","Confirmation Details",3,"applyBorder"],[3,"email","orgLabel","product","trialLength"],[1,"tw-mb-3","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"routerLink"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-3","tw-inline-flex","tw-items-center","tw-px-3",3,"routerLink"],["label","Billing",3,"subLabel"],[3,"trial","steppedBack","organizationCreated",4,"ngIf"],[3,"steppedBack","organizationCreated","trial"]],template:function(e,t){1&e&&B.nVh(0,kw,6,7,"div",1)(1,Dw,2,2),2&e&&B.vxM(t.initializing?0:1)},dependencies:[H.bT,a.cb,a.j4,BA.Wk,Jd.Q,WC,UC,$C.T,vw,fw.t,ww,H.Jj,H.PV,au.$],encapsulation:2});const xw=e=>{const{product:t}=e.queryParams,i=(null!=t?t:"").split(",").map(e=>parseInt(e)),n=e.queryParams.trialLength?parseInt(e.queryParams.trialLength):7,r=1===i.length&&i[0]===rr.ch.PasswordManager,s=1===i.length&&i[0]===rr.ch.SecretsManager;switch(!0){case r:return{key:n>0?"continueSettingUpFreeTrialPasswordManager":"continueSettingUpPasswordManager"};case s:return{key:n>0?"continueSettingUpFreeTrialSecretsManager":"continueSettingUpSecretsManager"};default:return{key:n>0?"continueSettingUpFreeTrial":"continueSettingUp"}}};var Ow=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gw=()=>[];function Uw(e,t){if(1&e&&(B.j41(0,"a",8),B.nrm(1,"bit-icon",9),B.EFF(2),B.k0s()),2&e){const e=t.$implicit,i=B.XpG(2);B.BMQ("href",e==i.currentRegion?"javascript:void(0)":e.urls.webVault+i.routeAndParams,B.B4B),B.R7$(),B.xc7("visibility",e==i.currentRegion?"visible":"hidden"),B.R7$(),B.SpI(" ",e.domain," ")}}function Vw(e,t){if(1&e&&(B.j41(0,"div",2)(1,"bit-menu",null,0),B.DNE(3,Uw,3,4,"a",3),B.k0s(),B.j41(4,"div",4),B.EFF(5),B.nI1(6,"i18n"),B.j41(7,"a",5)(8,"b",6),B.EFF(9),B.k0s(),B.nrm(10,"bit-icon",7),B.k0s()()()),2&e){const e=B.sdS(2),t=B.XpG();B.R7$(3),B.Y8G("ngForOf",t.availableRegions),B.R7$(2),B.SpI(" ",B.bMT(6,5,"accessing"),": "),B.R7$(2),B.Y8G("routerLink",B.lJ4(7,Gw))("bitMenuTriggerFor",e),B.R7$(2),B.JRh(null==t.currentRegion?null:t.currentRegion.domain)}}class jw{constructor(e,t,i){this.platformUtilsService=e,this.environmentService=t,this.router=i,this.availableRegions=this.environmentService.availableRegions(),this.showRegionSelector=!1}ngOnInit(){return Ow(this,void 0,void 0,function*(){this.showRegionSelector=!this.platformUtilsService.isSelfHost(),this.routeAndParams=`/#${this.router.url}`;const e=at.A.getHost(window.location.href);this.currentRegion=this.availableRegions.find(t=>at.A.getHost(t.urls.webVault)===e)})}}jw.ɵfac=function(e){return new(e||jw)(B.rXU(V.y),B.rXU(Gs.v),B.rXU(F.Ix))},jw.ɵcmp=B.VBU({type:jw,selectors:[["environment-selector"]],decls:1,vars:1,consts:[["environmentOptions",""],["class","tw-mb-1",4,"ngIf"],[1,"tw-mb-1"],["bitMenuItem","",4,"ngFor","ngForOf"],["bitTypography","body2"],[3,"routerLink","bitMenuTriggerFor"],[1,"tw-text-primary-600","tw-font-medium"],["name","bwi-angle-down",1,"bwi-fw","bwi-sm"],["bitMenuItem",""],["name","bwi-check",1,"bwi-fw","bwi-sm"]],template:function(e,t){1&e&&B.DNE(0,Vw,11,8,"div",1),2&e&&B.Y8G("ngIf",t.showRegionSelector)},dependencies:[oh.G,H.Sq,H.bT,BA.Wk,LA.R,cf.Z,df.O,uf.S,MA.r,au.$],encapsulation:2});var Nw=i(80504);class zw{constructor(e){this.logService=e,this.logs=[]}record(e){this.logs.push(e),this.logService.info(`[DataRecovery] ${e}`)}getLogs(){return[...this.logs]}}var Yw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Lw{constructor(e){this.apiService=e,this.title="recoveryStepSyncTitle"}runDiagnostics(e,t){return Yw(this,void 0,void 0,function*(){var i,n,r,s,o,a;const l=yield this.apiService.getSync();return e.ciphers=l.ciphers.map(e=>new ma.o(new ha.A(e))),t.record(`Fetched ${e.ciphers.length} ciphers from server`),e.folders=l.folders.map(e=>new cd.v(new La(e))),t.record(`Fetched ${e.folders.length} folders from server`),e.encryptedPrivateKey=null!==(s=null===(r=null===(n=null===(i=l.profile)||void 0===i?void 0:i.accountKeys)||void 0===n?void 0:n.publicKeyEncryptionKeyPair)||void 0===r?void 0:r.wrappedPrivateKey)&&void 0!==s?s:null,t.record(`Fetched encrypted private key of length ${null!==(a=null===(o=e.encryptedPrivateKey)||void 0===o?void 0:o.length)&&void 0!==a?a:0} from server`),!0})}canRecover(e){return!1}runRecovery(e,t){return Promise.resolve()}}var Kw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Xw{constructor(e,t){this.accountService=e,this.keyService=t,this.title="recoveryStepUserInfoTitle"}runDiagnostics(e,t){return Kw(this,void 0,void 0,function*(){const i=yield(0,u._)(this.accountService.activeAccount$);if(!i)return t.record("No active account found"),!1;const n=i.id;e.userId=n,t.record(`User ID: ${n}`);const r=yield(0,u._)(this.keyService.userKey$(n));return r?(e.userKey=r,t.record("User encryption type: "+(r.inner().type===$i.Qd.AesCbc256_HmacSha256_B64?"V1":r.inner().type===$i.Qd.CoseEncrypt0?"Cose":"Unknown")),!0):(t.record("No user key found"),!1)})}canRecover(e){return!1}runRecovery(e,t){return Promise.resolve()}}var qw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Hw{constructor(e,t,i){this.privateKeyRegenerationService=e,this.dialogService=t,this.cryptoFunctionService=i,this.title="recoveryStepPrivateKeyTitle"}runDiagnostics(e,t){return qw(this,void 0,void 0,function*(){if(!e.userId||!e.userKey)return t.record("Missing user ID or user key"),!1;const i=e.encryptedPrivateKey;if(!i)return t.record("No encrypted private key found"),!1;let n;t.record("Private key length: "+i.length);try{yield Fr.B.Ready,n=Mr.PureCrypto.unwrap_decapsulation_key(i,e.userKey.toEncoded())}catch(r){return t.record("Private key was un-decryptable"),e.isPrivateKeyCorrupt=!0,!1}try{const e=yield this.cryptoFunctionService.rsaExtractPublicKey(n);t.record("Public key length: "+e.length)}catch(s){return t.record("Public key could not be derived; private key is corrupt"),e.isPrivateKeyCorrupt=!0,!1}return!0})}canRecover(e){return e.isPrivateKeyCorrupt&&null!==e.userKey&&e.userKey.inner().type===$i.Qd.AesCbc256_HmacSha256_B64}runRecovery(e,t){return qw(this,void 0,void 0,function*(){t.record("Showing confirmation dialog for private key replacement");if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryReplacePrivateKeyTitle"},content:{key:"recoveryReplacePrivateKeyDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled private key replacement"),new Error("Private key recovery cancelled by user");t.record("Replacing private key");(yield this.privateKeyRegenerationService.regenerateUserPublicKeyEncryptionKeyPair(e.userId))?t.record("Private key replacement replaced successfully"):t.record("Private key replacement could not be performed")})}}var Ww=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class $w{constructor(e,t){this.folderService=e,this.dialogService=t,this.title="recoveryStepFoldersTitle",this.undecryptableFolderIds=[],this.decryptableFolderIds=[]}runDiagnostics(e,t){return Ww(this,void 0,void 0,function*(){var i;if(!e.userKey)return t.record("Missing user key"),!1;this.undecryptableFolderIds=[],this.decryptableFolderIds=[];for(const r of e.folders)if(null===(i=r.name)||void 0===i?void 0:i.encryptedString)try{yield Fr.B.Ready,Mr.PureCrypto.symmetric_decrypt_string(r.name.encryptedString,e.userKey.toEncoded()),this.decryptableFolderIds.push(r.id)}catch(n){t.record(`Folder name for folder ID ${r.id} was undecryptable`),this.undecryptableFolderIds.push(r.id)}else t.record(`Folder ID ${r.id} has no name`),this.undecryptableFolderIds.push(r.id);return t.record(`Found ${this.undecryptableFolderIds.length} undecryptable folders`),t.record(`Found ${this.decryptableFolderIds.length} decryptable folders`),0==this.undecryptableFolderIds.length})}canRecover(e){return this.undecryptableFolderIds.length>0&&this.decryptableFolderIds.length>0}runRecovery(e,t){return Ww(this,void 0,void 0,function*(){if(0===this.undecryptableFolderIds.length)return void t.record("No undecryptable folders to recover");if(!e.userId)throw t.record("Missing user ID"),new Error("Missing user ID");t.record(`Showing confirmation dialog for ${this.undecryptableFolderIds.length} folders`);if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryDeleteFoldersTitle"},content:{key:"recoveryDeleteFoldersDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled folder deletion"),new Error("Folder recovery cancelled by user");t.record(`Deleting ${this.undecryptableFolderIds.length} folders`);for(const n of this.undecryptableFolderIds)try{yield this.folderService.delete(n,e.userId),t.record(`Deleted folder ${n}`)}catch(i){t.record(`Failed to delete folder ${n}: ${i}`)}t.record(`Successfully deleted ${this.undecryptableFolderIds.length} folders`)})}getUndecryptableFolderIds(){return this.undecryptableFolderIds}}var Jw=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Zw{constructor(e,t,i){this.apiService=e,this.cipherService=t,this.dialogService=i,this.title="recoveryStepCipherTitle",this.undecryptableCipherIds=[],this.decryptableCipherIds=[]}runDiagnostics(e,t){return Jw(this,void 0,void 0,function*(){if(!e.userId)return t.record("Missing user ID"),!1;this.undecryptableCipherIds=[],this.decryptableCipherIds=[];const i=e.ciphers.filter(e=>null==e.organizationId);for(const r of i)try{yield this.cipherService.decrypt(r,e.userId),this.decryptableCipherIds.push(r.id)}catch(n){t.record(`Cipher ID ${r.id} was undecryptable`),this.undecryptableCipherIds.push(r.id)}return t.record(`Found ${this.undecryptableCipherIds.length} undecryptable ciphers`),t.record(`Found ${this.decryptableCipherIds.length} decryptable ciphers`),0==this.undecryptableCipherIds.length})}canRecover(e){return this.undecryptableCipherIds.length>0&&this.decryptableCipherIds.length>0}runRecovery(e,t){return Jw(this,void 0,void 0,function*(){if(0===this.undecryptableCipherIds.length)return void t.record("No undecryptable ciphers to recover");t.record(`Showing confirmation dialog for ${this.undecryptableCipherIds.length} ciphers`);if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryDeleteCiphersTitle"},content:{key:"recoveryDeleteCiphersDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled cipher deletion"),new Error("Cipher recovery cancelled by user");t.record(`Deleting ${this.undecryptableCipherIds.length} ciphers`);for(const i of this.undecryptableCipherIds)try{yield this.apiService.deleteCipher(i),t.record(`Deleted cipher ${i}`)}catch(e){const n=e instanceof Error?e.message:String(e);throw t.record(`Failed to delete cipher ${i}: ${n}`),e}t.record(`Successfully deleted ${this.undecryptableCipherIds.length} ciphers`)})}}var _w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function eI(e,t){if(1&e&&(B.j41(0,"button",3),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.Y8G("bitAction",e.runDiagnostics),B.R7$(),B.SpI(" ",B.bMT(2,2,"runDiagnostics")," ")}}function tI(e,t){1&e&&B.nrm(0,"i",8)}function iI(e,t){1&e&&B.nrm(0,"i",9)}function nI(e,t){1&e&&B.nrm(0,"i",10)}function rI(e,t){1&e&&B.nrm(0,"i",11)}function sI(e,t){if(1&e&&(B.j41(0,"div",6)(1,"div",7),B.nVh(2,tI,1,0,"i",8)(3,iI,1,0,"i",9)(4,nI,1,0,"i",10)(5,rI,1,0,"i",11),B.k0s(),B.j41(6,"div")(7,"span"),B.EFF(8),B.k0s()()()),2&e){const e=B.XpG().$implicit,t=B.XpG();B.R7$(2),B.vxM(e.status===t.StepStatus.Failed?2:e.status===t.StepStatus.Completed?3:e.status===t.StepStatus.InProgress?4:5),B.R7$(5),B.AVh("tw-text-danger",e.status===t.StepStatus.Failed)("tw-text-success",e.status===t.StepStatus.Completed)("tw-text-primary-600",e.status===t.StepStatus.InProgress)("tw-font-semibold",e.status===t.StepStatus.InProgress)("tw-text-secondary-500",e.status===t.StepStatus.NotStarted),B.R7$(),B.SpI(" ",e.title," ")}}function oI(e,t){if(1&e&&B.nVh(0,sI,9,12,"div",6),2&e){const e=t.$index,i=B.XpG();B.vxM(0===e&&i.hasStarted()||e>0&&(i.steps()[e-1].status===i.StepStatus.Completed||i.steps()[e-1].status===i.StepStatus.Failed)?0:-1)}}function aI(e,t){if(1&e&&(B.j41(0,"button",12),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG(2);B.Y8G("disabled",e.status()===e.StepStatus.InProgress)("bitAction",e.runRecovery),B.R7$(),B.SpI(" ",B.bMT(2,3,"repairIssues")," ")}}function lI(e,t){if(1&e&&(B.j41(0,"div",5),B.nVh(1,aI,3,5,"button",12),B.j41(2,"button",13),B.nrm(3,"i",14),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(),B.vxM(e.hasIssues()&&!e.recoveryCompleted()?1:-1),B.R7$(),B.Y8G("bitAction",e.saveDiagnosticLogs),B.R7$(2),B.SpI(" ",B.bMT(5,3,"saveDiagnosticLogs")," ")}}const cI=Object.freeze({NotStarted:0,InProgress:1,Completed:2,Failed:3});class dI{constructor(){this.StepStatus=cI,this.i18nService=(0,E.WQX)(U.W),this.apiService=(0,E.WQX)(de.G),this.accountService=(0,E.WQX)(Y.D),this.keyService=(0,E.WQX)(b.Lu),this.folderApiService=(0,E.WQX)(oc.w),this.cipherEncryptService=(0,E.WQX)(ic),this.dialogService=(0,E.WQX)(R.o3),this.privateKeyRegenerationService=(0,E.WQX)(b.wM),this.cryptoFunctionService=(0,E.WQX)(kr.R),this.logService=(0,E.WQX)(Ju.Kc),this.fileDownloadService=(0,E.WQX)(Gu.y),this.logger=new zw(this.logService),this.recoverySteps=[new Xw(this.accountService,this.keyService),new Lw(this.apiService),new Hw(this.privateKeyRegenerationService,this.dialogService,this.cryptoFunctionService),new $w(this.folderApiService,this.dialogService),new Zw(this.apiService,this.cipherEncryptService,this.dialogService)],this.workingData=null,this.status=(0,E.vPA)(cI.NotStarted),this.hasStarted=(0,E.vPA)(!1),this.diagnosticsCompleted=(0,E.vPA)(!1),this.recoveryCompleted=(0,E.vPA)(!1),this.steps=(0,E.vPA)(this.recoverySteps.map(e=>({title:this.i18nService.t(e.title),status:cI.NotStarted}))),this.hasIssues=(0,E.vPA)(!1),this.runDiagnostics=()=>_w(this,void 0,void 0,function*(){this.status()!==cI.InProgress&&(this.hasStarted.set(!0),this.status.set(cI.InProgress),this.diagnosticsCompleted.set(!1),this.logger.record("Starting diagnostics..."),this.workingData={userId:null,userKey:null,isPrivateKeyCorrupt:!1,encryptedPrivateKey:null,ciphers:[],folders:[]},yield this.runDiagnosticsInternal(),this.status.set(cI.Completed),this.diagnosticsCompleted.set(!0))}),this.runRecovery=()=>_w(this,void 0,void 0,function*(){if(this.status()!==cI.InProgress&&this.workingData){this.status.set(cI.InProgress),this.recoveryCompleted.set(!1),this.logger.record("Starting recovery process...");try{for(let e=0;e<this.recoverySteps.length;e++){const t=this.recoverySteps[e];t.canRecover(this.workingData)&&(this.logger.record(`Running recovery for step: ${t.title}`),yield t.runRecovery(this.workingData,this.logger))}this.logger.record("Recovery process completed"),this.recoveryCompleted.set(!0),this.logger.record("Re-running diagnostics to verify recovery..."),yield this.runDiagnosticsInternal(),this.status.set(cI.Completed)}catch(e){this.logger.record(`Recovery process cancelled or failed: ${e.message}`),this.status.set(cI.Failed)}}}),this.saveDiagnosticLogs=()=>{const e=this.logger.getLogs(),t=`data-recovery-logs-${(new Date).toISOString().replace(/[:.]/g,"-")}.txt`,i=e.join("\n");this.fileDownloadService.download({fileName:t,blobData:i,blobOptions:{type:"text/plain"}}),this.logger.record("Diagnostic logs saved")}}runDiagnosticsInternal(){return _w(this,void 0,void 0,function*(){if(!this.workingData)return void this.logger.record("No working data available");const e=this.steps();let t=!1;for(let r=0;r<this.recoverySteps.length;r++){const i=this.recoverySteps[r];e[r].status=cI.InProgress,this.steps.set([...e]),this.logger.record(`Running diagnostics for step: ${i.title}`);try{const n=yield i.runDiagnostics(this.workingData,this.logger);e[r].status=n?cI.Completed:cI.Failed,n||(t=!0),this.steps.set([...e]),this.logger.record(`Diagnostics completed for step: ${i.title}`)}catch(n){e[r].status=cI.Failed,e[r].message=n.message,this.steps.set([...e]),this.logger.record(`Diagnostics failed for step: ${i.title} with error: ${n.message}`),t=!0}}t?this.logger.record("Diagnostics completed with errors"):this.logger.record("Diagnostics completed successfully");const i=this.recoverySteps.some(e=>e.canRecover(this.workingData));this.hasIssues.set(i)})}}dI.ɵfac=function(e){return new(e||dI)},dI.ɵcmp=B.VBU({type:dI,selectors:[["app-data-recovery"]],decls:12,vars:8,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg"],["bitTypography","body1",1,"tw-mb-4"],["type","button","bitButton","","buttonType","primary",1,"tw-mb-6",3,"bitAction"],[1,"tw-space-y-3","tw-mb-6"],[1,"tw-flex","tw-gap-3"],[1,"tw-flex","tw-items-start","tw-gap-3"],[1,"tw-mt-1"],["aria-hidden","true",1,"bwi","bwi-close","tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-primary-600"],["aria-hidden","true",1,"bwi","bwi-circle","tw-text-secondary-300"],["type","button","bitButton","","buttonType","primary",3,"disabled","bitAction"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],["aria-hidden","true",1,"bwi","bwi-download"]],template:function(e,t){1&e&&(B.j41(0,"h2",0),B.EFF(1),B.nI1(2,"i18n"),B.k0s(),B.j41(3,"div",1)(4,"p",2),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.nVh(7,eI,3,4,"button",3),B.j41(8,"div",4),B.Z7z(9,oI,1,1,null,null,B.Vm6),B.k0s(),B.nVh(11,lI,6,5,"div",5),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,4,"dataRecoveryTitle")),B.R7$(4),B.SpI(" ",B.bMT(6,6,"dataRecoveryDescription")," "),B.R7$(2),B.vxM(t.diagnosticsCompleted()||t.recoveryCompleted()?-1:7),B.R7$(2),B.Dyx(t.steps()),B.R7$(2),B.vxM(t.diagnosticsCompleted()?11:-1))},dependencies:[jd.p,Yd.t,Jd.Q,H.MD,oh.G,Zp.p,MA.r,au.$],encapsulation:2,changeDetection:0});var uI=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class hI{constructor(e){this.routerService=e,this.onBeforeNavigation=()=>uI(this,void 0,void 0,function*(){yield this.routerService.getAndClearLoginRedirectUrl()})}}hI.ɵfac=function(e){return new(e||hI)(B.rXU(CA.H))},hI.ɵcmp=B.VBU({type:hI,selectors:[["app-confirm-key-connector-domain"]],decls:1,vars:1,consts:[[3,"onBeforeNavigation"]],template:function(e,t){1&e&&B.nrm(0,"confirm-key-connector-domain",0),2&e&&B.Y8G("onBeforeNavigation",t.onBeforeNavigation)},dependencies:[Xu.O0],encapsulation:2});var AI=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pI{constructor(e){this.platformUtilsService=e,this.year="2015"}ngOnInit(){return AI(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")}}pI.ɵfac=function(e){return new(e||pI)(B.rXU(V.y))},pI.ɵcmp=B.VBU({type:pI,selectors:[["app-frontend-layout"]],decls:12,vars:1,consts:[[1,"tw-text-center","tw-my-12"],["bitTypography","body2"],["bitTypography","helper","id","vw-disclaimer"]],template:function(e,t){1&e&&(B.nrm(0,"router-outlet"),B.j41(1,"footer",0),B.nrm(2,"environment-selector"),B.j41(3,"div",1),B.EFF(4,"Vaultwarden Web"),B.k0s(),B.j41(5,"div",1),B.EFF(6),B.k0s(),B.nrm(7,"br"),B.j41(8,"div",2),B.EFF(9," A modified version of the Bitwarden® Web Vault for Vaultwarden (an unofficial rewrite of the Bitwarden® server)."),B.nrm(10,"br"),B.EFF(11," Vaultwarden is not associated with the Bitwarden® project nor Bitwarden Inc. "),B.k0s()()),2&e&&(B.R7$(6),B.JRh(t.version))},dependencies:[oh.G,F.n3,MA.r,jw],encapsulation:2});const gI=VA.JW`
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
<g class="tw-fill-fg-nav" clip-path="url(#password-manager-logo-clip)">
 <path 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 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 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 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 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"/>
</g>
<defs>
  <clipPath id="password-manager-logo-clip">
    <path class="tw-fill-fg-nav" d="M0 0h800v200H0z"/>
  </clipPath>
</defs>
</svg>
`;class vI{}const fI=Object.freeze({Email:0,Password:1,None:2});var mI=i(58950),yI=i(14318),CI=i(73638);function wI(e,t){if(1&e&&(B.j41(0,"bit-hint"),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.SpI(" ",B.i5U(2,1,"limitSendViewsCount",e.viewsLeft))}}function II(e,t){if(1&e&&(B.j41(0,"bit-form-control"),B.nrm(1,"input",5),B.j41(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(),B.Y8G("disabled",e.disableHideEmail&&!e.sendOptionsForm.get("hideEmail").value),B.R7$(2),B.JRh(B.bMT(4,2,"hideYourEmail"))}}class bI{get shouldShowCount(){return"edit"===this.config.mode&&null!==this.sendOptionsForm.value.maxAccessCount}get viewsLeft(){return String(this.sendOptionsForm.value.maxAccessCount?this.sendOptionsForm.value.maxAccessCount-this.sendOptionsForm.value.accessCount:0)}constructor(e,t){this.sendFormContainer=e,this.formBuilder=t,this.disableHideEmail=!1,this.sendOptionsForm=this.formBuilder.group({maxAccessCount:[null],accessCount:[null],notes:[null],hideEmail:[!1]}),this.sendPolicyService=(0,E.WQX)(ob),this.sendFormContainer.registerChildForm("sendOptionsForm",this.sendOptionsForm),this.sendPolicyService.disableHideEmail$.pipe((0,c.pQ)()).subscribe(e=>{this.disableHideEmail=e}),this.sendOptionsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>(Object.assign(t,{maxAccessCount:e.maxAccessCount,accessCount:e.accessCount,hideEmail:e.hideEmail,notes:e.notes}),t))})}ngOnInit(){this.sendFormContainer.originalSendView&&this.sendOptionsForm.patchValue({maxAccessCount:this.sendFormContainer.originalSendView.maxAccessCount,accessCount:this.sendFormContainer.originalSendView.accessCount,hideEmail:this.sendFormContainer.originalSendView.hideEmail,notes:this.sendFormContainer.originalSendView.notes}),this.config.areSendsAllowed||this.sendOptionsForm.disable()}}function BI(e,t){if(1&e&&(B.j41(0,"div")(1,"div",3),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"div",4),B.EFF(5),B.k0s(),B.j41(6,"div",5),B.EFF(7),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,3,"file")),B.R7$(3),B.SpI(" ",e.originalSendView().file.fileName," "),B.R7$(2),B.JRh(e.originalSendView().file.sizeName)}}function EI(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-form-field")(1,"bit-label",6),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"div",7)(5,"button",8),B.bIt("click",function(){E.eBV(e);const t=B.sdS(12);return E.Njj(t.click())}),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"span",9),B.EFF(9),B.nI1(10,"i18n"),B.k0s()(),B.j41(11,"input",10,0),B.bIt("change",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onFileSelected(t))}),B.k0s(),B.j41(13,"bit-hint"),B.EFF(14),B.nI1(15,"i18n"),B.k0s()()}if(2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,5,"fileToShare")),B.R7$(4),B.SpI(" ",B.bMT(7,7,"chooseFile")," "),B.R7$(2),B.Y8G("ngClass",e.fileName?"tw-text-main":"tw-text-muted"),B.R7$(),B.SpI(" ",e.fileName||B.bMT(10,9,"noFileChosen")),B.R7$(5),B.SpI(" ",B.bMT(15,11,"maxFileSize")," ")}}bI.ɵfac=function(e){return new(e||bI)(B.rXU(vI),B.rXU(a.ok))},bI.ɵcmp=B.VBU({type:bI,selectors:[["tools-send-options"]],inputs:{config:"config",originalSendView:"originalSendView"},decls:21,vars:15,consts:[["disableMargin","",3,"formGroup"],["bitTypography","h6",1,"tw-mt-4"],["bitInput","","type","number","formControlName","maxAccessCount","min","1"],["disableMargin",""],["bitInput","","rows","3","formControlName","notes"],["bitCheckbox","","type","checkbox","formControlName","hideEmail",3,"disabled"]],template:function(e,t){1&e&&(B.j41(0,"bit-section",0)(1,"bit-section-header")(2,"h2",1),B.EFF(3),B.nI1(4,"i18n"),B.k0s()(),B.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.nrm(10,"input",2),B.j41(11,"bit-hint"),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.nVh(14,wI,3,4,"bit-hint"),B.k0s(),B.nVh(15,II,5,4,"bit-form-control"),B.j41(16,"bit-form-field",3)(17,"bit-label"),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.nrm(20,"textarea",4),B.k0s()()()),2&e&&(B.Y8G("formGroup",t.sendOptionsForm),B.R7$(3),B.JRh(B.bMT(4,7,"additionalOptions")),B.R7$(5),B.JRh(B.bMT(9,9,"limitSendViews")),B.R7$(4),B.JRh(B.bMT(13,11,"limitSendViewsHint")),B.R7$(2),B.vxM(t.shouldShowCount?14:-1),B.R7$(),B.vxM(!t.disableHideEmail||null!=t.originalSendView&&t.originalSendView.hideEmail?15:-1),B.R7$(3),B.JRh(B.bMT(19,13,"privateNote")))},dependencies:[Kd.C,Yd.t,yI.i,Fh.q,jv.P,H.MD,Xd.L,Nv.f,tu.j,iu.I,nu.J,ru.h,Ld.Q,jd.p,a.X1,a.me,a.Q0,a.Zm,a.BC,a.cb,a.VZ,a.j4,a.JD,hf.n,mI.U,mv.p,DA.E,MA.r,au.$],encapsulation:2});class SI{constructor(e,t){this.formBuilder=e,this.sendFormContainer=t,this.config=r.hFB.required(),this.originalSendView=(0,r.hFB)(),this.sendFileDetailsForm=this.formBuilder.group({file:this.formBuilder.control(null,a.k0.required)}),this.FileSendType=ja.File,this.fileName="",this.onFileSelected=e=>{var t;const i=null===(t=e.target.files)||void 0===t?void 0:t[0];i&&(this.fileName=i.name,this.sendFormContainer.onFileSelected(i))},this.sendFormContainer.registerChildForm("sendFileDetailsForm",this.sendFileDetailsForm),this.sendFileDetailsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{file:e.file}))})}ngOnInit(){var e;this.originalSendView()&&this.sendFileDetailsForm.patchValue({file:null===(e=this.originalSendView())||void 0===e?void 0:e.file}),this.config().areSendsAllowed||this.sendFileDetailsForm.disable()}}SI.ɵfac=function(e){return new(e||SI)(B.rXU(a.ok),B.rXU(vI))},SI.ɵcmp=B.VBU({type:SI,selectors:[["tools-send-file-details"]],inputs:{config:[1,"config"],originalSendView:[1,"originalSendView"]},decls:3,vars:3,consts:[["fileSelector",""],[3,"formGroup"],[4,"ngIf"],["bitTypography","body2",1,"tw-text-muted"],["data-testid","file-name",1,"tw-text-wrap","tw-break-all"],["data-testid","file-size",1,"tw-text-muted"],["for","file"],[1,"tw-flex","tw-mt-2","tw-mb-1"],["bitButton","","type","button","buttonType","secondary",3,"click"],[1,"tw-flex","tw-items-center","tw-pl-3",3,"ngClass"],["bitInput","","type","file","formControlName","file","hidden","",3,"change"]],template:function(e,t){1&e&&(B.j41(0,"bit-section",1),B.DNE(1,BI,8,5,"div",2)(2,EI,16,13,"bit-form-field",2),B.k0s()),2&e&&(B.Y8G("formGroup",t.sendFileDetailsForm),B.R7$(),B.Y8G("ngIf","edit"===t.config().mode),B.R7$(),B.Y8G("ngIf","edit"!==t.config().mode))},dependencies:[Yd.t,Jd.Q,H.MD,H.YU,H.bT,jd.p,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,Xd.L,tu.j,iu.I,nu.J,ru.h,hf.n,a.YN,DA.E,MA.r,au.$],encapsulation:2});var QI=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class kI{constructor(e,t){this.formBuilder=e,this.sendFormContainer=t,this.config=r.hFB.required(),this.originalSendView=(0,r.hFB)(),this.sendTextDetailsForm=this.formBuilder.group({text:new a.MJ("",a.k0.required),hidden:new a.MJ(!1)}),this.sendFormContainer.registerChildForm("sendTextDetailsForm",this.sendTextDetailsForm),this.sendTextDetailsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{text:{text:e.text,hidden:e.hidden}}))})}ngOnInit(){return QI(this,void 0,void 0,function*(){var e,t,i,n;this.sendTextDetailsForm.patchValue({text:(null===(t=null===(e=this.originalSendView())||void 0===e?void 0:e.text)||void 0===t?void 0:t.text)||"",hidden:(null===(n=null===(i=this.originalSendView())||void 0===i?void 0:i.text)||void 0===n?void 0:n.hidden)||!1}),this.config().areSendsAllowed||this.sendTextDetailsForm.disable()})}}kI.ɵfac=function(e){return new(e||kI)(B.rXU(a.ok),B.rXU(vI))},kI.ɵcmp=B.VBU({type:kI,selectors:[["tools-send-text-details"]],inputs:{config:[1,"config"],originalSendView:[1,"originalSendView"]},decls:11,vars:7,consts:[["disableMargin","",3,"formGroup"],["bitInput","","id","text","rows","3","formControlName","text"],["bitCheckbox","","type","checkbox","formControlName","hidden"]],template:function(e,t){1&e&&(B.j41(0,"bit-section",0)(1,"bit-form-field")(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.nrm(5,"textarea",1),B.k0s(),B.j41(6,"bit-form-control"),B.nrm(7,"input",2),B.j41(8,"bit-label"),B.EFF(9),B.nI1(10,"i18n"),B.k0s()()()),2&e&&(B.Y8G("formGroup",t.sendTextDetailsForm),B.R7$(3),B.JRh(B.bMT(4,3,"sendTypeTextToShare")),B.R7$(6),B.JRh(B.bMT(10,5,"hideTextByDefault")))},dependencies:[Fh.q,jv.P,H.MD,jd.p,a.X1,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,Xd.L,Nv.f,tu.j,nu.J,ru.h,hf.n,au.$],encapsulation:2});var TI=i(25024),FI=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const PI=(e,t)=>t.value;function RI(e,t){if(1&e&&B.nrm(0,"tools-send-text-details",13),2&e){const e=B.XpG();B.Y8G("config",e.config)("originalSendView",e.originalSendView)}}function DI(e,t){if(1&e&&B.nrm(0,"tools-send-file-details",13),2&e){const e=B.XpG();B.Y8G("config",e.config)("originalSendView",e.originalSendView)}}function MI(e,t){if(1&e&&B.nrm(0,"bit-option",9),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}function xI(e,t){if(1&e&&B.nrm(0,"bit-option",9),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}function OI(e,t){1&e&&(B.j41(0,"bit-hint",1),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"emailVerificationDesc")))}function GI(e,t){1&e&&(B.j41(0,"bit-hint",1),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(B.bMT(2,1,"sendPasswordHelperText")))}function UI(e,t){if(1&e){const e=B.RV6();B.nrm(0,"button",17),B.j41(1,"button",18),B.nI1(2,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.generatePassword())}),B.k0s(),B.nrm(3,"button",19),B.nI1(4,"i18n"),B.nI1(5,"i18n")}if(2&e){const e=B.XpG(2);B.R7$(),B.Y8G("label",B.bMT(2,6,"generatePassword"))("disabled",!e.config.areSendsAllowed),B.R7$(2),B.Y8G("label",B.bMT(4,8,"copyPassword"))("disabled",!e.config.areSendsAllowed||!e.sendDetailsForm.get("password").value)("valueLabel",B.bMT(5,10,"password"))("appCopyClick",e.sendDetailsForm.get("password").value)}}function VI(e,t){if(1&e&&(B.nrm(0,"button",16),B.nI1(1,"i18n")),2&e){const e=B.XpG(2);B.Y8G("label",B.bMT(1,2,"removePassword"))("bitAction",e.removePassword)}}function jI(e,t){if(1&e&&(B.j41(0,"bit-form-field",10)(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",14),B.j41(5,"div",15),B.nVh(6,UI,6,12)(7,VI,2,4,"button",16),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,2,e.passwordRemoved?"newPassword":"password")),B.R7$(4),B.vxM(e.hasPassword?7:6)}}function NI(e,t){1&e&&(B.j41(0,"bit-form-field",11)(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"textarea",20),B.nI1(5,"i18n"),B.j41(6,"bit-hint"),B.EFF(7),B.nI1(8,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,3,"emails")),B.R7$(2),B.Y8G("placeholder",B.bMT(5,5,"emailPlaceholder")),B.R7$(3),B.JRh(B.bMT(8,7,"enterMultipleEmailsSeparatedByComma")))}function zI(e,t){if(1&e&&(B.j41(0,"bit-form-field",21)(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",22)(5,"button",23),B.nI1(6,"i18n"),B.nI1(7,"i18n"),B.k0s()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,5,"sendLink")),B.R7$(2),B.Y8G("value",e.sendLink),B.R7$(),B.Y8G("appCopyClick",e.sendLink)("valueLabel",B.bMT(6,7,"sendLink"))("label",B.bMT(7,9,"copySendLink"))}}const YI=Object.freeze({OneHour:1,OneDay:24,TwoDays:48,ThreeDays:72,SevenDays:168,FourteenDays:336,ThirtyDays:720}),LI=new Map(Object.entries(YI).map(([e,t])=>[t,e]));function KI(e){return LI.has(e)}class XI{get hasPassword(){var e;return null!=(null===(e=this.originalSendView)||void 0===e?void 0:e.password)}constructor(e,t,i,n,s,o,l,d,u,h,A,g,v){this.sendFormContainer=e,this.formBuilder=t,this.i18nService=i,this.datePipe=n,this.environmentService=s,this.configService=o,this.accountService=l,this.billingAccountProfileStateService=d,this.generatorService=u,this.sendApiService=h,this.dialogService=A,this.toastService=g,this.sendFormGenerationService=v,this.openPasswordGenerator=(0,r.CGW)(),this.FileSendType=ja.File,this.TextSendType=ja.Text,this.AuthType=fI,this.sendLink=null,this.customDeletionDateOption=null,this.datePresetOptions=[],this.passwordRemoved=!1,this.emailVerificationFeatureFlag$=this.configService.getFeatureFlag$(dr.TO.SendEmailOTP),this.hasPremium$=this.accountService.activeAccount$.pipe((0,rt.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id))),this.authTypes=[{name:this.i18nService.t("noAuth"),value:fI.None},{name:this.i18nService.t("specificPeople"),value:fI.Email},{name:this.i18nService.t("anyOneWithPassword"),value:fI.Password}],this.availableAuthTypes$=(0,bi.z)([this.emailVerificationFeatureFlag$,this.hasPremium$]).pipe((0,p.T)(([e,t])=>e&&t?this.authTypes:this.authTypes.filter(e=>e.value!==fI.Email))),this.sendDetailsForm=this.formBuilder.group({name:new a.MJ("",a.k0.required),selectedDeletionDatePreset:new a.MJ(YI.SevenDays||"",a.k0.required),authType:[fI.None],password:[null],emails:[null]}),this.generatePassword=()=>{this.openPasswordGenerator.emit()},this.removePassword=()=>FI(this,void 0,void 0,function*(){var e,t;if(!(null===(e=this.originalSendView)||void 0===e?void 0:e.password))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"removePassword"},content:{key:"removePasswordConfirmation"},type:"warning"})))return!1;this.passwordRemoved=!0,yield this.sendApiService.removePassword(this.originalSendView.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedPassword")}),this.originalSendView.password=null,this.sendDetailsForm.patchValue({password:null}),null===(t=this.sendDetailsForm.get("password"))||void 0===t||t.enable()}),this.sendDetailsForm.valueChanges.pipe((0,M.M)(e=>{at.A.isNullOrWhitespace(e.password)&&(e.password=null)}),(0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{name:e.name,deletionDate:new Date(this.formattedDeletionDate),expirationDate:new Date(this.formattedDeletionDate),password:e.password,authType:e.authType,emails:e.emails?e.emails.split(",").map(e=>e.trim()).filter(e=>e.length>0):null}))}),this.sendDetailsForm.get("authType").valueChanges.pipe((0,c.pQ)()).subscribe(e=>{const t=this.sendDetailsForm.get("emails"),i=this.sendDetailsForm.get("password");e===fI.Password?(t.setValue(null),t.clearValidators(),i.setValidators([a.k0.required])):e===fI.Email?(i.setValue(null),i.clearValidators(),t.setValidators([a.k0.required,this.emailListValidator()])):(t.setValue(null),t.clearValidators(),i.setValue(null),i.clearValidators()),t.updateValueAndValidity(),i.updateValueAndValidity()}),this.sendFormContainer.registerChildForm("sendDetailsForm",this.sendDetailsForm)}ngOnInit(){return FI(this,void 0,void 0,function*(){var e,t,i;if(this.setupDeletionDatePresets(),this.originalSendView){this.sendDetailsForm.patchValue({name:this.originalSendView.name,selectedDeletionDatePreset:this.originalSendView.deletionDate.toString(),password:this.hasPassword?"************":null,authType:this.originalSendView.authType,emails:null!==(t=null===(e=this.originalSendView.emails)||void 0===e?void 0:e.join(", "))&&void 0!==t?t:null}),this.hasPassword&&(null===(i=this.sendDetailsForm.get("password"))||void 0===i||i.disable()),this.originalSendView.deletionDate&&(this.customDeletionDateOption={name:this.datePipe.transform(this.originalSendView.deletionDate,"short"),value:this.originalSendView.deletionDate.toString()},this.datePresetOptions.unshift(this.customDeletionDateOption));const n=yield(0,u._)(this.environmentService.environment$);this.sendLink=n.getSendUrl()+this.originalSendView.accessId+"/"+this.originalSendView.urlB64Key}this.config.areSendsAllowed||this.sendDetailsForm.disable()})}setupDeletionDatePresets(){const e=[{name:this.i18nService.t("oneHour"),value:YI.OneHour},{name:this.i18nService.t("oneDay"),value:YI.OneDay},{name:this.i18nService.t("days","2"),value:YI.TwoDays},{name:this.i18nService.t("days","3"),value:YI.ThreeDays},{name:this.i18nService.t("days","7"),value:YI.SevenDays},{name:this.i18nService.t("days","14"),value:YI.FourteenDays},{name:this.i18nService.t("days","30"),value:YI.ThirtyDays}];this.datePresetOptions=e}get formattedDeletionDate(){const e=new Date,t=this.sendDetailsForm.controls.selectedDeletionDatePreset.value;if("string"==typeof t)return t;const i=KI(n=t)?n:void 0;var n;if(!KI(i))return new Date(e).toString();const r=e.setTime(e.getTime()+60*i*60*1e3);return new Date(r).toString()}emailListValidator(){return e=>{if(!e.value)return null;const t=e.value.split(",").map(e=>e.trim()).filter(e=>e.length>0);if(0===t.length)return{required:!0};const i=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.filter(e=>!i.test(e)).length>0?{multipleEmails:!0}:null}}setGeneratedPassword(e){this.sendDetailsForm.patchValue({password:e})}}XI.ɵfac=function(e){return new(e||XI)(B.rXU(vI),B.rXU(a.ok),B.rXU(U.W),B.rXU(H.vh),B.rXU(Gs.v),B.rXU(z.w),B.rXU(Y.D),B.rXU(Rn.Q),B.rXU(CI.iE),B.rXU(Xl),B.rXU(R.o3),B.rXU(P.f),B.rXU(JI))},XI.ɵcmp=B.VBU({type:XI,selectors:[["tools-send-details"]],inputs:{config:"config",originalSendView:"originalSendView"},outputs:{openPasswordGenerator:"openPasswordGenerator"},decls:36,vars:29,consts:[["disableMargin","",3,"formGroup"],[1,"tw-mt-2"],["bitTypography","h6"],["bitInput","","type","text","formControlName","name"],[3,"config","originalSendView",4,"ngIf"],["id","deletionDate","name","SelectedDeletionDatePreset","formControlName","selectedDeletionDatePreset"],[3,"value","label",4,"ngFor","ngForOf"],[3,"disableMargin"],["formControlName","authType"],[3,"value","label"],["disableMargin",""],["disableMargin","",1,"tw-mt-4"],["class","tw-mt-4",4,"ngIf"],[3,"config","originalSendView"],["bitInput","","type","password","formControlName","password"],["bitSuffix","","ngProjectAs","[bitSuffix]",5,["","bitSuffix",""],1,"tw-flex","tw-items-center"],["type","button","buttonType","dangerGhost","bitIconButton","bwi-minus-circle","size","small","showToast","",1,"tw-border-l-0","last:tw-rounded-r","focus-visible:tw-border-l","focus-visible:tw-ml-[-1px]",3,"label","bitAction"],["data-testid","toggle-visibility-for-password","type","button","bitIconButton","","size","small","bitPasswordInputToggle",""],["type","button","bitIconButton","bwi-generate","size","small","data-testid","generate-password",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","size","small","showToast","",3,"label","disabled","valueLabel","appCopyClick"],["bitInput","","formControlName","emails","rows","3",3,"placeholder"],[1,"tw-mt-4"],["data-testid","send-link","bitInput","","type","text","disabled","",3,"value"],["type","button","bitSuffix","","showToast","","bitIconButton","bwi-clone",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(B.j41(0,"bit-section",0)(1,"bit-section-header",1)(2,"h2",2),B.EFF(3),B.nI1(4,"i18n"),B.k0s()(),B.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.nrm(10,"input",3),B.k0s(),B.DNE(11,RI,1,2,"tools-send-text-details",4)(12,DI,1,2,"tools-send-file-details",4),B.j41(13,"bit-form-field")(14,"bit-label"),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.j41(17,"bit-select",5),B.DNE(18,MI,1,2,"bit-option",6),B.k0s(),B.j41(19,"bit-hint"),B.EFF(20),B.nI1(21,"i18n"),B.k0s()(),B.j41(22,"bit-form-field",7)(23,"bit-label"),B.EFF(24),B.nI1(25,"i18n"),B.k0s(),B.j41(26,"bit-select",8),B.Z7z(27,xI,1,2,"bit-option",9,PI),B.nI1(29,"async"),B.k0s(),B.nVh(30,OI,3,3,"bit-hint",1),B.nVh(31,GI,3,3,"bit-hint",1),B.k0s(),B.nVh(32,jI,8,4,"bit-form-field",10),B.nVh(33,NI,9,9,"bit-form-field",11),B.DNE(34,zI,8,11,"bit-form-field",12),B.k0s(),B.nrm(35,"tools-send-options",13),B.k0s()),2&e&&(B.Y8G("formGroup",t.sendDetailsForm),B.R7$(3),B.JRh(B.bMT(4,17,"sendDetails")),B.R7$(5),B.JRh(B.bMT(9,19,"name")),B.R7$(3),B.Y8G("ngIf",t.config.sendType===t.TextSendType),B.R7$(),B.Y8G("ngIf",t.config.sendType===t.FileSendType),B.R7$(3),B.JRh(B.bMT(16,21,"deletionDate")),B.R7$(3),B.Y8G("ngForOf",t.datePresetOptions),B.R7$(2),B.JRh(B.bMT(21,23,"deletionDateDescV2")),B.R7$(2),B.Y8G("disableMargin",!t.sendDetailsForm.get("authType").value),B.R7$(2),B.JRh(B.bMT(25,25,"whoCanView")),B.R7$(3),B.Dyx(B.bMT(29,27,t.availableAuthTypes$)),B.R7$(3),B.vxM(t.sendDetailsForm.get("authType").value===t.AuthType.Email?30:-1),B.R7$(),B.vxM(t.sendDetailsForm.get("authType").value===t.AuthType.Password?31:-1),B.R7$(),B.vxM(t.sendDetailsForm.get("authType").value===t.AuthType.Password?32:-1),B.R7$(),B.vxM(t.sendDetailsForm.get("authType").value===t.AuthType.Email?33:-1),B.R7$(),B.Y8G("ngIf",t.sendLink),B.R7$(),B.Y8G("config",t.config)("originalSendView",t.originalSendView))},dependencies:[hf.n,mI.U,DA.E,MA.r,jd.p,TI.D,yI.i,Xd.L,tu.j,iu.I,nu.J,ru.h,su.e,ou.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,kI,SI,bI,Ld.Q,Zd.s,Fh.q,H.MD,H.Sq,H.bT,mv.p,cg.w,dg.P,Kd.C,Zp.p,Yd.t,au.$,H.Jj],encapsulation:2});class qI{}var HI=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function WI(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"tools-send-details",2),B.bIt("openPasswordGenerator",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.openPasswordGenerator.emit())}),B.k0s(),B.bVm()}if(2&e){const e=B.XpG();B.R7$(),B.Y8G("config",e.config)("originalSendView",e.originalSendView)}}class $I{ngAfterViewInit(){this.submitBtn&&(this.bitSubmit.loading$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.disabled.set(e)}))}registerChildForm(e,t){this.sendForm.setControl(e,t)}patchSend(e){this.updatedSendView=e(this.updatedSendView)}ngOnChanges(){return HI(this,void 0,void 0,function*(){this._firstInitialized&&(yield this.init())})}ngOnInit(){return HI(this,void 0,void 0,function*(){yield this.init(),this._firstInitialized=!0})}init(){return HI(this,void 0,void 0,function*(){if(this.loading=!0,this.updatedSendView=new Rl,this.originalSendView=null,this.sendForm.reset(),null!=this.config){if("add"!==this.config.mode){if(null==this.config.originalSend)throw new Error("Original send is required for edit or clone mode");this.originalSendView=yield this.addEditFormService.decryptSend(this.config.originalSend),this.updatedSendView=Object.assign(this.updatedSendView,this.originalSendView)}else this.updatedSendView.type=this.config.sendType;this.loading=!1}})}constructor(e,t,i,n){this.formBuilder=e,this.addEditFormService=t,this.toastService=i,this.i18nService=n,this.destroyRef=(0,E.WQX)(E.abz),this._firstInitialized=!1,this.file=null,this.onSendCreated=new B.bkB,this.onSendUpdated=new B.bkB,this.openPasswordGenerator=(0,r.CGW)(),this.sendDetailsComponent=(0,r.ebz)(XI),this.sendForm=this.formBuilder.group({}),this.loading=!0,this.SendType=ja,this.submit=()=>HI(this,void 0,void 0,function*(){if(this.sendForm.invalid)return void this.sendForm.markAllAsTouched();const e=yield this.addEditFormService.saveSend(this.updatedSendView,this.file,this.config);"add"!==this.config.mode?(this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("editedItem")}),this.onSendUpdated.emit(this.updatedSendView)):this.onSendCreated.emit(e)})}onFileSelected(e){this.file=e}}$I.ɵfac=function(e){return new(e||$I)(B.rXU(a.ok),B.rXU(qI),B.rXU(P.f),B.rXU(U.W))},$I.ɵcmp=B.VBU({type:$I,selectors:[["tools-send-form"]],viewQuery:function(e,t){if(1&e&&(B.wEZ(t.sendDetailsComponent,XI,5),B.GBs(eu.L,5)),2&e){let e;B.NyB(),B.mGM(e=B.lsd())&&(t.bitSubmit=e.first)}},inputs:{formId:"formId",config:"config",submitBtn:"submitBtn"},outputs:{onSendCreated:"onSendCreated",onSendUpdated:"onSendUpdated",openPasswordGenerator:"openPasswordGenerator"},features:[B.Jv_([{provide:vI,useExisting:(0,E.Rfq)(()=>$I)}]),B.OA$],decls:2,vars:4,consts:[[3,"id","formGroup","bitSubmit"],[4,"ngIf"],[3,"openPasswordGenerator","config","originalSendView"]],template:function(e,t){1&e&&(B.j41(0,"form",0),B.DNE(1,WI,2,2,"ng-container",1),B.k0s()),2&e&&(B.Y8G("id",t.formId)("formGroup",t.sendForm)("bitSubmit",t.submit),B.R7$(),B.Y8G("ngIf",!t.loading))},dependencies:[Kd.C,eu.L,DA.E,ym.k,Xd.L,a.X1,a.qT,a.cb,a.j4,mv.p,H.bT,XI],encapsulation:2});class JI{}const ZI="selected",_I="canceled";class eb{get isPassword(){return"password"===this.params.type}constructor(e,t,i){this.params=e,this.dialogRef=t,this.i18nService=i,this.titleKey=this.isPassword?"passwordGenerator":"usernameGenerator",this.buttonLabel=(0,E.vPA)(void 0),this.generatedValue=(0,E.vPA)(""),this.close=()=>{this.dialogRef.close({action:_I})},this.selectValue=()=>{this.dialogRef.close({action:ZI,generatedValue:this.generatedValue()})},this.onValueGenerated=e=>{this.generatedValue.set(e)},this.onAlgorithmSelected=e=>{e?this.buttonLabel.set(e.useGeneratedValue):this.buttonLabel.set(this.i18nService.t("useThisEmail")),this.generatedValue.set("")},this.uri=e.uri}}eb.ɵfac=function(e){return new(e||eb)(B.rXU(_g.Qs),B.rXU(R.ce),B.rXU(U.W))},eb.ɵcmp=B.VBU({type:eb,selectors:[["tools-send-generator-dialog"]],decls:9,vars:7,consts:[["dialogSize","default","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin","",3,"valueGenerated","algorithmSelected","type","uri"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary","data-testid","select-button",3,"click","disabled"]],template:function(e,t){1&e&&(B.j41(0,"bit-dialog",0)(1,"span",1),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.qex(4,2),B.j41(5,"vault-cipher-form-generator",3),B.bIt("valueGenerated",function(e){return t.onValueGenerated(e)})("algorithmSelected",function(e){return t.onAlgorithmSelected(e)}),B.k0s(),B.bVm(),B.qex(6,4),B.j41(7,"button",5),B.bIt("click",function(){return t.selectValue()}),B.EFF(8),B.k0s(),B.bVm(),B.k0s()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,5,t.titleKey)," "),B.R7$(3),B.Y8G("type",t.params.type)("uri",t.uri),B.R7$(2),B.Y8G("disabled",!(t.buttonLabel()&&t.generatedValue())),B.R7$(),B.SpI(" ",t.buttonLabel()," "))},dependencies:[H.MD,xd.Wg,Yd.t,Jd.Q,Nd.P,Hd.m,Wd.hJ,Zu.$Z],encapsulation:2,changeDetection:0});var tb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ib{constructor(e){this.dialogService=e}generatePassword(){return tb(this,void 0,void 0,function*(){const e=this.dialogService.open(eb,{data:{type:"password"}}),t=yield(0,u._)(e.closed);return t&&"selected"===t.action&&t.generatedValue?t.generatedValue:null})}}ib.ɵfac=function(e){return new(e||ib)(E.KVO(R.o3))},ib.ɵprov=E.jDH({token:ib,factory:ib.ɵfac});var nb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class rb{constructor(){this.accountService=(0,E.WQX)(Y.D),this.sendApiService=(0,E.WQX)(Xl),this.sendService=(0,E.WQX)(_l)}decryptSend(e){return nb(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));return yield e.decrypt(t)})}saveSend(e,t,i){return nb(this,void 0,void 0,function*(){const i=yield this.sendService.encrypt(e,t,e.password,null),n=yield this.sendApiService.save(i);return yield this.decryptSend(n)})}}rb.ɵfac=function(e){return new(e||rb)},rb.ɵprov=E.jDH({token:rb,factory:rb.ɵfac});class sb{}sb.ɵfac=function(e){return new(e||sb)},sb.ɵmod=B.$C({type:sb}),sb.ɵinj=E.G2t({providers:[{provide:qI,useClass:rb},{provide:JI,useClass:ib}],imports:[$I,Ku._h]});class ob{constructor(){this.policyService=(0,E.WQX)(me.m),this.accountService=(0,E.WQX)(Y.D),this.configService=(0,E.WQX)(z.w),this.flagAndUser$=(0,bi.z)([this.configService.getFeatureFlag$(dr.TO.SendControls),this.accountService.activeAccount$.pipe(y.F6)]),this.disableSend$=this.flagAndUser$.pipe((0,rt.n)(([e,t])=>e?(0,bi.z)([this.policyService.policiesByType$(mt.tt.SendControls,t).pipe((0,p.T)(e=>{var t;return null!==(t=null==e?void 0:e.some(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.disableSend)}))&&void 0!==t&&t})),this.policyService.policyAppliesToUser$(mt.tt.DisableSend,t)]).pipe((0,p.T)(([e,t])=>e||t)):this.policyService.policyAppliesToUser$(mt.tt.DisableSend,t)),(0,Bi.t)({bufferSize:1,refCount:!0})),this.disableHideEmail$=this.flagAndUser$.pipe((0,rt.n)(([e,t])=>e?(0,bi.z)([this.policyService.policiesByType$(mt.tt.SendControls,t).pipe((0,p.T)(e=>{var t;return null!==(t=null==e?void 0:e.some(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.disableHideEmail)}))&&void 0!==t&&t})),this.policyService.policiesByType$(mt.tt.SendOptions,t).pipe((0,p.T)(e=>{var t;return null!==(t=null==e?void 0:e.some(e=>{var t;return null===(t=e.data)||void 0===t?void 0:t.disableHideEmail}))&&void 0!==t&&t}))]).pipe((0,p.T)(([e,t])=>e||t)):this.policyService.policiesByType$(mt.tt.SendOptions,t).pipe((0,p.T)(e=>{var t;return null!==(t=null==e?void 0:e.some(e=>{var t;return null===(t=e.data)||void 0===t?void 0:t.disableHideEmail}))&&void 0!==t&&t}))),(0,Bi.t)({bufferSize:1,refCount:!0}))}}ob.ɵfac=function(e){return new(e||ob)},ob.ɵprov=E.jDH({token:ob,factory:ob.ɵfac,providedIn:"root"});var ab=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class lb{constructor(){this.sendService=(0,E.WQX)(_l),this.sendPolicyService=(0,E.WQX)(ob),this.areSendsEnabled$=this.sendPolicyService.disableSend$.pipe((0,p.T)(e=>!e))}buildConfig(e,t,i){return ab(this,void 0,void 0,function*(){var n,r;const[s,o]=yield(0,u._)((0,bi.z)([this.areSendsEnabled$,this.getSend(t)]));return{mode:e,sendType:null!==(r=null!==(n=null==o?void 0:o.type)&&void 0!==n?n:i)&&void 0!==r?r:ja.Text,areSendsAllowed:s,originalSend:o}})}getSend(e){return null==e?Promise.resolve(null):this.sendService.get$(e)}}lb.ɵfac=function(e){return new(e||lb)},lb.ɵprov=E.jDH({token:lb,factory:lb.ɵfac});var cb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function db(e,t){1&e&&B.nrm(0,"i",10)}class ub{constructor(e,t,i,n){this.billingAccountProfileStateService=e,this.accountService=t,this.router=i,this.premiumUpgradePromptService=n,this.hideIcon=!1,this.buttonType="primary",this.sendType=ja,this.hasNoPremium=!1}ngOnInit(){return cb(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);this.hasNoPremium=!e||!(yield(0,u._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)))})}buildRouterLink(){return"/add-send"}buildQueryParams(e){return{type:e,isNew:!0}}sendFileClick(){return cb(this,void 0,void 0,function*(){this.hasNoPremium?yield this.premiumUpgradePromptService.promptForPremium():yield this.router.navigate([this.buildRouterLink()],{queryParams:this.buildQueryParams(ja.File)})})}}ub.ɵfac=function(e){return new(e||ub)(B.rXU(Rn.Q),B.rXU(Y.D),B.rXU(F.Ix),B.rXU(Lu.l))},ub.ɵcmp=B.VBU({type:ub,selectors:[["tools-new-send-dropdown"]],inputs:{hideIcon:"hideIcon",buttonType:"buttonType"},decls:21,vars:20,consts:[["itemOptions",""],["bitButton","","type","button",3,"bitMenuTriggerFor","buttonType"],["class","bwi bwi-plus tw-me-2","aria-hidden","true",4,"ngIf"],["bitMenuItem","",3,"routerLink","queryParams"],["slot","start","aria-hidden","true",1,"bwi","bwi-file-text"],["bitMenuItem","",3,"click","title"],[1,"tw-flex","tw-items-center","tw-gap-2"],["slot","start","aria-hidden","true",1,"bwi","bwi-file"],[1,"tw-sr-only"],["slot","end","aria-hidden","true",1,"bwi","bwi-popout","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-plus","tw-me-2"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",1),B.DNE(1,db,1,0,"i",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-menu",null,0)(6,"a",3),B.nrm(7,"i",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"a",5),B.nI1(11,"i18n"),B.bIt("click",function(){return E.eBV(e),E.Njj(t.sendFileClick())}),B.j41(12,"div",6),B.nrm(13,"i",7),B.EFF(14),B.nI1(15,"i18n"),B.nrm(16,"app-premium-badge"),B.k0s(),B.j41(17,"span",8),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.nrm(20,"i",9),B.k0s()()}if(2&e){const e=B.sdS(5);B.Y8G("bitMenuTriggerFor",e)("buttonType",t.buttonType),B.R7$(),B.Y8G("ngIf",!t.hideIcon),B.R7$(),B.SpI(" ",B.bMT(3,10,t.hideIcon?"createSend":"new"),"\n"),B.R7$(4),B.Y8G("routerLink",t.buildRouterLink())("queryParams",t.buildQueryParams(t.sendType.Text)),B.R7$(2),B.SpI(" ",B.bMT(9,12,"sendTypeText")," "),B.R7$(2),B.Y8G("title",B.bMT(11,14,"popOutNewWindow")),B.R7$(4),B.SpI(" ",B.bMT(15,16,"sendTypeFile")," "),B.R7$(4),B.JRh(B.bMT(19,18,"popOutNewWindow"))}},dependencies:[jd.p,H.MD,H.bT,Yd.t,Jd.Q,BA.Wk,CC.M,cf.Z,df.O,uf.S,Ov.a,au.$],encapsulation:2});var hb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ab(e,t){1&e&&B.nrm(0,"i",2)}class pb{constructor(){this.hideIcon=(0,r.hFB)(!1),this.buttonType=(0,r.hFB)("primary"),this.addSend=(0,r.CGW)(),this.sendType=ja,this.billingAccountProfileStateService=(0,E.WQX)(Rn.Q),this.accountService=(0,E.WQX)(Y.D),this.premiumUpgradePromptService=(0,E.WQX)(Lu.l),this.hasNoPremium=(0,c.ot)(this.accountService.activeAccount$.pipe((0,rt.n)(e=>e?this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id).pipe((0,p.T)(e=>!e)):(0,Ii.of)(!0))),{initialValue:!0})}onTextSendClick(){this.addSend.emit(ja.Text)}onFileSendClick(){return hb(this,void 0,void 0,function*(){this.hasNoPremium()?yield this.premiumUpgradePromptService.promptForPremium():this.addSend.emit(ja.File)})}}pb.ɵfac=function(e){return new(e||pb)},pb.ɵcmp=B.VBU({type:pb,selectors:[["tools-new-send-dropdown-v2"]],inputs:{hideIcon:[1,"hideIcon"],buttonType:[1,"buttonType"]},outputs:{addSend:"addSend"},decls:16,vars:12,consts:[["itemOptions",""],["bitButton","","type","button",3,"bitMenuTriggerFor","buttonType"],["aria-hidden","true",1,"bwi","bwi-plus","tw-me-2"],["bitMenuItem","","type","button",3,"click"],["slot","start","aria-hidden","true",1,"bwi","bwi-file-text"],[1,"tw-flex","tw-items-center","tw-gap-2"],["slot","start","aria-hidden","true",1,"bwi","bwi-file"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",1),B.nVh(1,Ab,1,0,"i",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-menu",null,0)(6,"button",3),B.bIt("click",function(){return E.eBV(e),E.Njj(t.onTextSendClick())}),B.nrm(7,"i",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"button",3),B.bIt("click",function(){return E.eBV(e),E.Njj(t.onFileSendClick())}),B.j41(11,"div",5),B.nrm(12,"i",6),B.EFF(13),B.nI1(14,"i18n"),B.nrm(15,"app-premium-badge"),B.k0s()()()}if(2&e){const e=B.sdS(5);B.Y8G("bitMenuTriggerFor",e)("buttonType",t.buttonType()),B.R7$(),B.vxM(t.hideIcon()?-1:1),B.R7$(),B.SpI(" ",B.bMT(3,6,t.hideIcon()?"createSend":"new"),"\n"),B.R7$(6),B.SpI(" ",B.bMT(9,8,"sendTypeText")," "),B.R7$(5),B.SpI(" ",B.bMT(14,10,"sendTypeFile")," ")}},dependencies:[jd.p,Yd.t,Jd.Q,CC.M,cf.Z,df.O,uf.S,Ov.a,au.$],encapsulation:2,changeDetection:0});var gb=i(60893),vb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function fb(e,t){1&e&&(B.EFF(0),B.nI1(1,"i18n")),2&e&&B.SpI(" ",B.bMT(1,1,"passwordGenerator")," ")}function mb(e,t){if(1&e&&B.EFF(0),2&e){const e=B.XpG();B.SpI(" ",e.headerText," ")}}function yb(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",15),B.nI1(1,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.closeGenerator())}),B.k0s()}2&e&&B.Y8G("label",B.bMT(1,1,"close"))}function Cb(e,t){if(1&e){const e=B.RV6();B.j41(0,"vault-cipher-form-generator",16),B.bIt("valueGenerated",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onValueGenerated(t))})("algorithmSelected",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onAlgorithmSelected(t))}),B.k0s()}}function wb(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",17),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.useGeneratedPassword())}),B.EFF(1),B.k0s(),B.j41(2,"button",18),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.closeGenerator())}),B.EFF(3),B.nI1(4,"i18n"),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("disabled",!(e.generatorButtonLabel()&&e.generatedValue())),B.R7$(),B.SpI(" ",e.generatorButtonLabel()," "),B.R7$(2),B.SpI(" ",B.bMT(4,3,"cancel")," ")}}function Ib(e,t){if(1&e&&(B.nrm(0,"button",19),B.nI1(1,"i18n")),2&e){const e=B.XpG();B.Y8G("label",B.mNQ(B.bMT(1,3,"delete")))("bitAction",e.deleteSend)}}const bb=Object.freeze({Saved:"saved",Deleted:"deleted"});class Bb{constructor(e,t,i,n,s,o){this.params=e,this.dialogRef=t,this.i18nService=i,this.sendApiService=n,this.toastService=s,this.dialogService=o,this.sendFormComponent=(0,r.ebz)($I),this.showGenerator=(0,E.vPA)(!1),this.generatedValue=(0,E.vPA)(""),this.generatorButtonLabel=(0,E.vPA)(void 0),this.deleteSend=()=>vb(this,void 0,void 0,function*(){var e;if(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendPermanentConfirmation"},type:"warning"})){try{yield this.sendApiService.delete(null===(e=this.config.originalSend)||void 0===e?void 0:e.id)}catch(t){return void this.toastService.showToast({variant:"error",title:null,message:t.message})}yield this.onSendDeleted()}}),this.config=e.formConfig,this.headerText=this.getHeaderText(this.config.mode,this.config.sendType)}openGenerator(){this.showGenerator.set(!0),this.dialogRef.disableClose=!0}useGeneratedPassword(){var e,t;const i=this.generatedValue();i&&(null===(t=null===(e=this.sendFormComponent())||void 0===e?void 0:e.sendDetailsComponent())||void 0===t||t.setGeneratedPassword(i)),this.showGenerator.set(!1),this.generatedValue.set(""),this.dialogRef.disableClose=!1}closeGenerator(){this.showGenerator.set(!1),this.generatedValue.set(""),this.dialogRef.disableClose=!1}onValueGenerated(e){this.generatedValue.set(e)}onAlgorithmSelected(e){e?this.generatorButtonLabel.set(e.useGeneratedValue):this.generatorButtonLabel.set(this.i18nService.t("useThisPassword")),this.generatedValue.set("")}onSendCreated(e){return vb(this,void 0,void 0,function*(){this.dialogRef.close({result:bb.Saved,send:e})})}onSendUpdated(e){return vb(this,void 0,void 0,function*(){this.dialogRef.close({result:bb.Saved})})}onSendDeleted(){return vb(this,void 0,void 0,function*(){this.dialogRef.close({result:bb.Deleted}),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")})})}getHeaderText(e,t){const i="edit"===e||"partial-edit"===e,n={[ja.Text]:i?"editItemHeaderTextSend":"newItemHeaderTextSend",[ja.File]:i?"editItemHeaderFileSend":"newItemHeaderFileSend"};return this.i18nService.t(n[t])}static open(e,t){return e.open(Bb,{data:t})}static openDrawer(e,t){return e.openDrawer(Bb,{data:t})}}Bb.ɵfac=function(e){return new(e||Bb)(B.rXU(_g.Qs),B.rXU(R.ce),B.rXU(U.W),B.rXU(Xl),B.rXU(P.f),B.rXU(R.o3))},Bb.ɵcmp=B.VBU({type:Bb,selectors:[["ng-component"]],viewQuery:function(e,t){1&e&&B.wEZ(t.sendFormComponent,$I,5),2&e&&B.NyB()},decls:22,vars:15,consts:[["dialog",""],["submitBtn",""],["dialogSize","large","background","alt"],["bitDialogTitle",""],["bitDialogHeaderEnd","","type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","default",3,"label"],["bitDialogContent",""],[3,"hidden"],["formId","sendForm",3,"onSendCreated","onSendUpdated","openPasswordGenerator","config","submitBtn"],["type","password","disableMargin",""],["bitDialogFooter",""],[1,"tw-flex","tw-flex-row","tw-items-center","tw-gap-2","tw-flex-1",3,"hidden"],["bitButton","","type","submit","form","sendForm","buttonType","primary"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],[1,"tw-ml-auto"],["type","button","buttonType","dangerGhost","slot","end","bitIconButton","bwi-trash",3,"bitAction","label",4,"ngIf"],["bitDialogHeaderEnd","","type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","default",3,"click","label"],["type","password","disableMargin","",3,"valueGenerated","algorithmSelected"],["type","button","bitButton","","buttonType","primary",3,"click","disabled"],["bitButton","","type","button","buttonType","secondary",3,"click"],["type","button","buttonType","dangerGhost","slot","end","bitIconButton","bwi-trash",3,"bitAction","label"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-dialog",2,0)(2,"span",3),B.nVh(3,fb,2,3)(4,mb,1,1),B.k0s(),B.nVh(5,yb,2,3,"button",4),B.j41(6,"span",5)(7,"div",6)(8,"tools-send-form",7),B.bIt("onSendCreated",function(i){return E.eBV(e),E.Njj(t.onSendCreated(i))})("onSendUpdated",function(i){return E.eBV(e),E.Njj(t.onSendUpdated(i))})("openPasswordGenerator",function(){return E.eBV(e),E.Njj(t.openGenerator())}),B.k0s()(),B.nVh(9,Cb,1,0,"vault-cipher-form-generator",8),B.k0s(),B.qex(10,9),B.nVh(11,wb,5,5),B.j41(12,"div",10)(13,"button",11,1),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.j41(17,"button",12),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.j41(20,"div",13),B.DNE(21,Ib,2,5,"button",14),B.k0s()(),B.bVm(),B.k0s()}if(2&e){const e=B.sdS(14);B.R7$(3),B.vxM(t.showGenerator()?3:4),B.R7$(2),B.vxM(t.showGenerator()?5:-1),B.R7$(2),B.Y8G("hidden",t.showGenerator()),B.R7$(),B.Y8G("config",t.config)("submitBtn",e),B.R7$(),B.vxM(t.showGenerator()?9:-1),B.R7$(2),B.vxM(t.showGenerator()?11:-1),B.R7$(),B.Y8G("hidden",t.showGenerator()),B.R7$(3),B.SpI(" ",B.bMT(16,11,"save")," "),B.R7$(3),B.SpI(" ",B.bMT(19,13,"cancel")," "),B.R7$(3),B.Y8G("ngIf","add"!==(null==t.config?null:t.config.mode))}},dependencies:[H.MD,H.bT,gb.t,jd.p,a.YN,Yd.t,Jd.Q,Ld.Q,Zd.s,sb,$I,Kd.C,Zp.p,Nd.P,qd.I,Hd.m,Wd.hJ,xd.Wg,au.$],encapsulation:2});var Eb=i(4017),Sb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qb=(e,t)=>({sendId:e,type:t});function kb(e,t){1&e&&B.nrm(0,"i",14)}function Tb(e,t){1&e&&B.nrm(0,"i",15)}function Fb(e,t){if(1&e&&(B.nrm(0,"i",16),B.nI1(1,"i18n"),B.j41(2,"span",17),B.EFF(3),B.nI1(4,"i18n"),B.k0s()),2&e){const e=B.XpG().$implicit.authType===B.XpG(2).authType.Email?"emailProtected":"passwordProtected";B.Y8G("appA11yTitle",B.mNQ(B.bMT(1,3,e))),B.R7$(3),B.JRh(B.bMT(4,5,e))}}function Pb(e,t){1&e&&(B.nrm(0,"i",18),B.nI1(1,"i18n"),B.j41(2,"span",17),B.EFF(3),B.nI1(4,"i18n"),B.k0s()),2&e&&(B.Y8G("appA11yTitle",B.mNQ(B.bMT(1,3,"maxAccessCountReached"))),B.R7$(3),B.JRh(B.bMT(4,5,"maxAccessCountReached")))}function Rb(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-item")(1,"button",5),B.nI1(2,"i18n"),B.j41(3,"div",6),B.DNE(4,kb,1,0,"i",7)(5,Tb,1,0,"i",8),B.k0s(),B.EFF(6),B.j41(7,"div",9),B.nVh(8,Fb,5,7),B.nVh(9,Pb,5,7),B.k0s(),B.j41(10,"span",10),B.EFF(11),B.nI1(12,"i18n"),B.nI1(13,"date"),B.k0s()(),B.qex(14,11),B.j41(15,"bit-item-action")(16,"button",12),B.nI1(17,"i18n"),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.copySendLink(t))}),B.k0s()(),B.j41(18,"bit-item-action")(19,"button",13),B.nI1(20,"i18n"),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.deleteSend(t))}),B.k0s()(),B.bVm(),B.k0s()}if(2&e){const e=t.$implicit,i=B.XpG(2);B.R7$(),B.Y8G("appA11yTitle",B.ai1("",B.bMT(2,17,"edit")," - ",e.name))("queryParams",B.l_i(28,Qb,e.id,e.type)),B.R7$(3),B.Y8G("ngIf",e.type===i.sendType.Text),B.R7$(),B.Y8G("ngIf",e.type===i.sendType.File),B.R7$(),B.SpI(" ",e.name," "),B.R7$(2),B.vxM(e.authType!==i.authType.None?8:-1),B.R7$(),B.vxM(e.maxAccessCountReached?9:-1),B.R7$(2),B.Lme(" ",B.bMT(12,19,"deletionDate"),": ",B.i5U(13,21,e.deletionDate,"mediumDate")," "),B.R7$(5),B.Y8G("label",B.ai1("",B.bMT(17,24,"copyLink")," - ",e.name)),B.R7$(3),B.Y8G("label",B.ai1("",B.bMT(20,26,"delete")," - ",e.name))}}function Db(e,t){if(1&e&&(B.j41(0,"bit-section",1)(1,"bit-section-header")(2,"h2",2),B.EFF(3),B.k0s(),B.j41(4,"span",3),B.EFF(5),B.k0s()(),B.j41(6,"bit-item-group"),B.DNE(7,Rb,21,31,"bit-item",4),B.k0s()()),2&e){const e=B.XpG();B.R7$(3),B.SpI(" ",e.headerText," "),B.R7$(2),B.JRh(e.sends.length),B.R7$(2),B.Y8G("ngForOf",e.sends)}}class Mb{constructor(e,t,i,n,r,s,o){this.dialogService=e,this.environmentService=t,this.i18nService=i,this.logService=n,this.platformUtilsService=r,this.sendApiService=s,this.toastService=o,this.sendType=ja,this.authType=fI,this.sends=[]}deleteSend(e){return Sb(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendPermanentConfirmation"},type:"warning"})))return!1;yield this.sendApiService.delete(e.id);try{this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")})}catch(t){this.logService.error(t)}})}copySendLink(e){return Sb(this,void 0,void 0,function*(){const t=(yield(0,u._)(this.environmentService.environment$)).getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t("sendLink"))})})}}Mb.ɵfac=function(e){return new(e||Mb)(B.rXU(R.o3),B.rXU(Gs.v),B.rXU(U.W),B.rXU(Vs.K),B.rXU(V.y),B.rXU(Xl),B.rXU(P.f))},Mb.ɵcmp=B.VBU({type:Mb,selectors:[["app-send-list-items-container"]],inputs:{sends:"sends",headerText:"headerText"},decls:1,vars:1,consts:[["disableMargin","",4,"ngIf"],["disableMargin",""],["bitTypography","h6",1,"tw-font-medium"],["bitTypography","body1","slot","end"],[4,"ngFor","ngForOf"],["bit-item-content","","routerLink","/edit-send","appStopClick","","type","button",3,"appA11yTitle","queryParams"],["slot","start",1,"tw-justify-start"],["class","bwi bwi-lg bwi-file-text tw-text-muted tw-w-6",4,"ngIf"],["class","bwi bwi-lg bwi-file tw-text-muted tw-w-6",4,"ngIf"],["slot","default-trailing",1,"tw-flex","tw-gap-2","tw-relative","tw-z-10"],["slot","secondary"],["slot","end"],["bitIconButton","bwi-clone","size","small","type","button",1,"tw-p-1",3,"click","label"],["bitIconButton","bwi-trash","size","small","type","button",3,"click","label"],[1,"bwi","bwi-lg","bwi-file-text","tw-text-muted","tw-w-6"],[1,"bwi","bwi-lg","bwi-file","tw-text-muted","tw-w-6"],["aria-hidden","true",1,"bwi","bwi-lock",3,"appA11yTitle"],[1,"tw-sr-only"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"appA11yTitle"]],template:function(e,t){1&e&&B.DNE(0,Db,8,3,"bit-section",0),2&e&&B.Y8G("ngIf",(null==t.sends?null:t.sends.length)>0)},dependencies:[H.MD,H.Sq,H.bT,ym.k,Cm.J,wm.g,Eb.D,Im._,Yd.t,mm.E,Ld.Q,Zd.s,hf.n,DA.E,MA.r,jd.p,Kv.C,iv.Y,mI.U,BA.Wk,H.vh,au.$],encapsulation:2});const xb={sendType:null};class Ob{constructor(e,t){this.i18nService=e,this.formBuilder=t,this.filterForm=this.formBuilder.group(xb),this.filters$=this.filterForm.valueChanges.pipe((0,gi.Z)(xb)),this.filterFunction$=this.filters$.pipe((0,p.T)(e=>t=>t.filter(t=>null===e.sendType||t.type===e.sendType))),this.sendTypes=[{value:ja.File,label:this.i18nService.t("sendTypeFile"),icon:"bwi-file"},{value:ja.Text,label:this.i18nService.t("sendTypeText"),icon:"bwi-file-text"}]}resetFilterForm(){this.filterForm.reset(xb)}convertToChipFilterOption(e,t){return{value:e.node,label:e.node.name,icon:t,children:e.children?e.children.map(e=>this.convertToChipFilterOption(e,t)):void 0}}}Ob.ɵfac=function(e){return new(e||Ob)(E.KVO(U.W),E.KVO(a.ok))},Ob.ɵprov=E.jDH({token:Ob,factory:Ob.ɵfac,providedIn:"root"});class Gb{constructor(e,t,i,n){this.sendService=e,this.sendListFiltersService=t,this.searchService=i,this.accountService=n,this._searchText$=new _e.t(""),this._sendsLoading$=new d.B,this.latestSearchText$=this._searchText$.asObservable(),this._sendList$=this.sendService.sendViews$,this.filteredAndSortedSends$=(0,bi.z)([this._sendList$,this._searchText$,this.sendListFiltersService.filterFunction$]).pipe((0,M.M)(()=>{this._sendsLoading$.next()}),(0,p.T)(([e,t,i])=>[i(e),t]),(0,p.T)(([e,t])=>this.searchService.searchSends(e,t)),(0,p.T)(e=>e.sort((e,t)=>e.name.localeCompare(t.name))),(0,Bi.t)({refCount:!0,bufferSize:1})),this.loading$=(0,ld.h)(this._sendsLoading$.pipe((0,p.T)(()=>!0)),this.filteredAndSortedSends$.pipe((0,p.T)(()=>!1))).pipe((0,gi.Z)(!0),(0,hi.F)(),(0,Bi.t)({refCount:!1,bufferSize:1})),this.hasFilterApplied$=(0,bi.z)([this._searchText$,this.sendListFiltersService.filters$,(0,y.F6)(this.accountService.activeAccount$)]).pipe((0,rt.n)(([e,t,i])=>(0,jt.H)(this.searchService.isSearchable(i,e)).pipe((0,p.T)(e=>e||Object.values(t).some(e=>null!==e))))),this.emptyList$=this._sendList$.pipe((0,p.T)(e=>!e.length)),this.noFilteredResults$=this.filteredAndSortedSends$.pipe((0,p.T)(e=>!e.length))}applyFilter(e){this._searchText$.next(e)}}Gb.ɵfac=function(e){return new(e||Gb)(E.KVO(_l),E.KVO(Ob),E.KVO(j.S),E.KVO(Y.D))},Gb.ɵprov=E.jDH({token:Gb,factory:Gb.ɵfac,providedIn:"root"});var Ub=i(5520);class Vb{constructor(){this.sendListItemService=(0,E.WQX)(Gb),this.searchText=(0,r.geq)(""),this.subscribeToLatestSearchText(),this.subscribeToApplyFilter()}subscribeToLatestSearchText(){this.sendListItemService.latestSearchText$.pipe((0,c.pQ)(),(0,h.p)(e=>!!e)).subscribe(e=>{this.searchText.set(e)})}subscribeToApplyFilter(){(0,c.br)(this.searchText).pipe((0,Jg.B)(200),(0,c.pQ)()).subscribe(e=>{this.sendListItemService.applyFilter(e)})}}Vb.ɵfac=function(e){return new(e||Vb)},Vb.ɵcmp=B.VBU({type:Vb,selectors:[["tools-send-search"]],inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:4,consts:[["appAutofocus","",3,"ngModelChange","placeholder","ngModel"]],template:function(e,t){1&e&&(B.j41(0,"bit-search",0),B.nI1(1,"i18n"),B.mxI("ngModelChange",function(e){return B.DH7(t.searchText,e)||(t.searchText=e),e}),B.k0s()),2&e&&(B.Y8G("placeholder",B.bMT(1,2,"search")),B.R50("ngModel",t.searchText))},dependencies:[a.YN,a.BC,a.vS,gb.t,Ub.S,Zu.$Z],encapsulation:2,changeDetection:0});var jb=i(5884);function Nb(e,t){if(1&e&&(B.j41(0,"div",1),B.nI1(1,"i18n"),B.j41(2,"form",2),B.nrm(3,"bit-chip-filter",3),B.nI1(4,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.BMQ("aria-label",B.bMT(1,4,"filters")),B.R7$(2),B.Y8G("formGroup",e.filterForm),B.R7$(),B.Y8G("placeholderText",B.bMT(4,6,"type"))("options",e.sendTypes)}}class zb{constructor(e,t,i){this.sendListFiltersService=e,this.filterForm=this.sendListFiltersService.filterForm,this.sendTypes=this.sendListFiltersService.sendTypes,this.canAccessPremium$=i.activeAccount$.pipe((0,rt.n)(e=>e?t.hasPremiumFromAnySource$(e.id):(0,Ii.of)(!1)))}ngOnDestroy(){this.sendListFiltersService.resetFilterForm()}}function Yb(e,t){1&e&&B.nrm(0,"i",13)}function Lb(e,t){1&e&&B.nrm(0,"i",14)}function Kb(e,t){1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(", ",B.bMT(2,1,"disabled")))}function Xb(e,t){if(1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG().$implicit.authType===B.XpG(2).authType.Email?"emailProtected":"passwordProtected";B.R7$(),B.SpI(", ",B.bMT(2,1,e))}}function qb(e,t){1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(", ",B.bMT(2,1,"maxAccessCountReached")))}function Hb(e,t){1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(", ",B.bMT(2,1,"expired")))}function Wb(e,t){1&e&&(B.j41(0,"span",16),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(", ",B.bMT(2,1,"pendingDeletion")))}function $b(e,t){1&e&&(B.nrm(0,"i",17),B.nI1(1,"i18n")),2&e&&B.Y8G("title",B.mNQ(B.bMT(1,2,"disabled")))}function Jb(e,t){if(1&e&&(B.nrm(0,"i",18),B.nI1(1,"i18n")),2&e){const e=B.XpG().$implicit.authType===B.XpG(2).authType.Email?"emailProtected":"passwordProtected";B.Y8G("title",B.mNQ(B.bMT(1,2,e)))}}function Zb(e,t){1&e&&(B.nrm(0,"i",17),B.nI1(1,"i18n")),2&e&&B.Y8G("title",B.mNQ(B.bMT(1,2,"maxAccessCountReached")))}function _b(e,t){1&e&&(B.nrm(0,"i",19),B.nI1(1,"i18n")),2&e&&B.Y8G("title",B.mNQ(B.bMT(1,2,"expired")))}function eB(e,t){1&e&&(B.nrm(0,"i",20),B.nI1(1,"i18n")),2&e&&B.Y8G("title",B.mNQ(B.bMT(1,2,"pendingDeletion")))}function tB(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",25),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(2);return E.Njj(i.onRemovePassword(t))}),B.nrm(1,"i",30),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"removePassword")," "))}function iB(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr",9)(1,"td",10),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.onEditSend(t))}),B.j41(2,"div",11)(3,"span",12),B.nVh(4,Yb,1,0,"i",13),B.nVh(5,Lb,1,0,"i",14),B.k0s(),B.j41(6,"button",15),B.EFF(7),B.nVh(8,Kb,3,3,"span",16),B.nVh(9,Xb,3,3,"span",16),B.nVh(10,qb,3,3,"span",16),B.nVh(11,Hb,3,3,"span",16),B.nVh(12,Wb,3,3,"span",16),B.k0s(),B.nVh(13,$b,2,4,"i",17),B.nVh(14,Jb,2,4,"i",18),B.nVh(15,Zb,2,4,"i",17),B.nVh(16,_b,2,4,"i",19),B.nVh(17,eB,2,4,"i",20),B.k0s()(),B.j41(18,"td",21),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.onEditSend(t))}),B.j41(19,"small",22),B.EFF(20),B.nI1(21,"date"),B.k0s()(),B.j41(22,"td",23),B.nrm(23,"button",24),B.nI1(24,"i18n"),B.j41(25,"bit-menu",null,0)(27,"button",25),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.onCopy(t))}),B.nrm(28,"i",26),B.EFF(29),B.nI1(30,"i18n"),B.k0s(),B.nVh(31,tB,4,3,"button",27),B.j41(32,"button",25),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(2);return E.Njj(i.onDelete(t))}),B.j41(33,"span",28),B.nrm(34,"i",29),B.EFF(35),B.nI1(36,"i18n"),B.k0s()()()()()}if(2&e){const e=t.$implicit,i=B.sdS(26),n=B.XpG(2);B.R7$(4),B.vxM(e.type==n.sendType.File?4:-1),B.R7$(),B.vxM(e.type==n.sendType.Text?5:-1),B.R7$(2),B.SpI(" ",e.name," "),B.R7$(),B.vxM(e.disabled?8:-1),B.R7$(),B.vxM(e.authType!==n.authType.None?9:-1),B.R7$(),B.vxM(e.maxAccessCountReached?10:-1),B.R7$(),B.vxM(e.expired?11:-1),B.R7$(),B.vxM(e.pendingDelete?12:-1),B.R7$(),B.vxM(e.disabled?13:-1),B.R7$(),B.vxM(e.authType!==n.authType.None?14:-1),B.R7$(),B.vxM(e.maxAccessCountReached?15:-1),B.R7$(),B.vxM(e.expired?16:-1),B.R7$(),B.vxM(e.pendingDelete?17:-1),B.R7$(3),B.SpI(" ",B.i5U(21,20,e.deletionDate,"medium")," "),B.R7$(3),B.Y8G("label",B.mNQ(B.bMT(24,23,"options")))("bitMenuTriggerFor",i),B.R7$(6),B.SpI(" ",B.bMT(30,25,"copySendLink")," "),B.R7$(2),B.vxM(e.password&&!n.disableSend()?31:-1),B.R7$(4),B.SpI(" ",B.bMT(36,27,"delete")," ")}}function nB(e,t){if(1&e&&(B.DNE(0,iB,37,29,"tr",8),B.nI1(1,"async")),2&e){const e=t.$implicit;B.Y8G("ngForOf",B.bMT(1,1,e))}}zb.ɵfac=function(e){return new(e||zb)(B.rXU(Ob),B.rXU(Rn.Q),B.rXU(Y.D))},zb.ɵcmp=B.VBU({type:zb,selectors:[["app-send-list-filters"]],decls:2,vars:3,consts:[["role","toolbar",4,"ngIf"],["role","toolbar"],[1,"tw-flex","tw-flex-wrap","tw-gap-2","tw-mt-2",3,"formGroup"],["formControlName","sendType","placeholderIcon","bwi-list",3,"placeholderText","options"]],template:function(e,t){1&e&&(B.DNE(0,Nb,5,8,"div",0),B.nI1(1,"async")),2&e&&B.Y8G("ngIf",B.bMT(1,1,t.canAccessPremium$))},dependencies:[H.MD,H.bT,jd.p,jb.W,a.X1,a.qT,a.BC,a.cb,a.j4,a.JD,H.Jj,au.$],encapsulation:2});class rB{constructor(){this.sendType=ja,this.authType=fI,this.dataSource=(0,r.hFB)(),this.disableSend=(0,r.hFB)(!1),this.editSend=(0,r.CGW)(),this.copySend=(0,r.CGW)(),this.removePassword=(0,r.CGW)(),this.deleteSend=(0,r.CGW)()}onEditSend(e){this.editSend.emit(e)}onCopy(e){this.copySend.emit(e)}onRemovePassword(e){this.removePassword.emit(e)}onDelete(e){this.deleteSend.emit(e)}}rB.ɵfac=function(e){return new(e||rB)},rB.ɵcmp=B.VBU({type:rB,selectors:[["tools-send-table"]],inputs:{dataSource:[1,"dataSource"],disableSend:[1,"disableSend"]},outputs:{editSend:"editSend",copySend:"copySend",removePassword:"removePassword",deleteSend:"deleteSend"},decls:14,vars:10,consts:[["sendOptions",""],[1,"tw-@container/send-table"],[3,"dataSource"],["header",""],["bitCell","","bitSortable","name","default",""],["bitCell","","bitSortable","deletionDate",1,"@lg/send-table:tw-table-cell","tw-hidden"],["bitCell",""],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-cursor-pointer",3,"click"],[1,"tw-flex","tw-gap-2","tw-items-center"],["aria-hidden","true"],[1,"bwi","bwi-fw","bwi-lg","bwi-file","tw-text-muted"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text","tw-text-muted"],["type","button","bitLink",""],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-lock",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-clock",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-trash",3,"title"],["bitCell","",1,"tw-text-muted","tw-cursor-pointer","@lg/send-table:tw-table-cell","tw-hidden",3,"click"],["bitTypography","body2","appStopProp",""],["bitCell","",1,"tw-w-0","tw-text-right"],["type","button","size","small","bitIconButton","bwi-ellipsis-v",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["type","button","bitMenuItem",""],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"]],template:function(e,t){1&e&&(B.j41(0,"div",1)(1,"bit-table",2),B.qex(2,3),B.j41(3,"tr")(4,"th",4),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"th",5),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"th",6),B.EFF(11),B.nI1(12,"i18n"),B.k0s()(),B.bVm(),B.DNE(13,nB,2,3,"ng-template",7),B.k0s()()),2&e&&(B.R7$(),B.Y8G("dataSource",t.dataSource()),B.R7$(4),B.JRh(B.bMT(6,4,"name")),B.R7$(3),B.SpI(" ",B.bMT(9,6,"deletionDate")," "),B.R7$(3),B.JRh(B.bMT(12,8,"options")))},dependencies:[H.MD,H.Sq,jd.p,dv.x,Dm.b,Af.Q,pf.Y,xm.O,gf._,gf.O,Yd.t,zd.V,$d.g,Ld.Q,Zd.s,CC.M,cf.Z,df.O,uf.S,mm.E,DA.E,MA.r,H.Jj,H.vh,au.$],encapsulation:2,changeDetection:0});const sB=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="9 4 83.89 91">
    <path class="tw-fill-illustration-bg-secondary" d="M67 12a2 2 0 0 1 2 2v76a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V14a2 2 0 0 1 2-2h56Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67 90V14H11v76h56Zm2-76a2 2 0 0 0-2-2H11a2 2 0 0 0-2 2v76a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2V14Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M77 82V6a2 2 0 0 0-2-2H32.328c-.53 0-1.034.206-1.41.581L17.585 17.916A1.993 1.993 0 0 0 17 19.328V82a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 82V6H32.328L19 19.328V82h56ZM32.333 5.995ZM77 6v76a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V19.328c0-.53.209-1.037.584-1.412L30.919 4.581c.375-.375.879-.581 1.41-.581H75a2 2 0 0 1 2 2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33 5a1 1 0 0 1 1 1v15H19a1 1 0 1 1 0-2h13V6a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M37 35a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H40a3 3 0 0 1-3-3V35Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M54 34H40a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V35a1 1 0 0 0-1-1Zm-14-2a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V35a3 3 0 0 0-3-3H40Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M46 38a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42 31a5 5 0 0 1 10 0v1h-2v-1a3 3 0 1 0-6 0v1h-2v-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M62 92.058V78l12 6.4-8.658 9.004A1.942 1.942 0 0 1 62 92.058Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m61 76.333 14.637 7.807-9.574 9.957A2.942 2.942 0 0 1 61 92.057V76.333Zm2 3.333v12.391a.942.942 0 0 0 1.621.653l7.742-8.05L63 79.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M42.55 65.971 88.334 44.54c1.76-.824 3.746.587 3.546 2.52l-4.604 44.648c-.197 1.91-2.386 2.895-3.946 1.773L62.5 78.5l-19.82-7.944c-2.03-.813-2.11-3.657-.13-4.585Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M90.886 46.957a1.5 1.5 0 0 0-2.128-1.512L42.974 66.878c-1.188.556-1.14 2.262.078 2.75l19.164 7.681 12.867-14.613a1 1 0 1 1 1.501 1.321L63.98 78.333l19.934 14.336a1.5 1.5 0 0 0 2.367-1.064l4.605-44.648ZM62.015 79.383l-19.707-7.898c-2.842-1.139-2.955-5.12-.182-6.419L87.91 43.634c2.464-1.154 5.244.822 4.965 3.529L88.271 91.81c-.276 2.675-3.341 4.053-5.525 2.482L62.015 79.383Z" clip-rule="evenodd"/>
  </svg>
  `;var oB=i(78510),aB=i(59525),lB=i(83632),cB=i(22690);const dB=[[["","slot","filters"]],[["","slot","empty-button"]]];function uB(e,t){1&e&&B.nrm(0,"bit-spinner")}function hB(e,t){1&e&&B.nrm(0,"tools-send-search")}function AB(e,t){if(1&e&&(B.j41(0,"bit-no-items",1),B.qex(1,2),B.EFF(2),B.nI1(3,"i18n"),B.bVm(),B.qex(4,3),B.EFF(5),B.nI1(6,"i18n"),B.bVm(),B.k0s()),2&e){const e=B.XpG(2);B.Y8G("icon",e.noItemIcon),B.R7$(2),B.JRh(B.bMT(3,3,"sendsTitleNoSearchResults")),B.R7$(3),B.JRh(B.bMT(6,5,"sendsBodyNoSearchResults"))}}function pB(e,t){if(1&e&&(B.j41(0,"bit-no-items",1),B.qex(1,2),B.EFF(2),B.nI1(3,"i18n"),B.bVm(),B.qex(4,3),B.EFF(5),B.nI1(6,"i18n"),B.bVm(),B.SdG(7,1,["slot","button"]),B.k0s()),2&e){const e=B.XpG(2);B.Y8G("icon",e.noItemIcon),B.R7$(2),B.JRh(B.bMT(3,3,"sendsTitleNoItems")),B.R7$(3),B.JRh(B.bMT(6,5,"sendsBodyNoItems"))}}function gB(e,t){if(1&e){const e=B.RV6();B.nVh(0,hB,1,0,"tools-send-search"),B.SdG(1),B.j41(2,"tools-send-table",0),B.bIt("editSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onEditSend(t))})("copySend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onCopySend(t))})("removePassword",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onRemovePassword(t))})("deleteSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onDeleteSend(t))}),B.k0s(),B.nVh(3,AB,7,7,"bit-no-items",1)(4,pB,8,7,"bit-no-items",1)}if(2&e){const e=B.XpG();B.vxM(e.showSearchBar()?0:-1),B.R7$(2),B.Y8G("dataSource",e.dataSource)("disableSend",e.disableSend()),B.R7$(),B.vxM(e.noSearchResults()?3:e.listState()===e.sendListState.NoResults||e.listState()===e.sendListState.Empty?4:-1)}}const vB=Object.freeze({Empty:"Empty",NoResults:"NoResults"});class fB{constructor(){this.noItemIcon=sB,this.noResultsIcon=oB.a,this.sendListState=vB,this.sends=r.hFB.required(),this.loading=(0,r.hFB)(!1),this.disableSend=(0,r.hFB)(!1),this.listState=(0,r.hFB)(null),this.searchText=(0,r.hFB)(""),this.hideSearchBar=(0,r.hFB)(!1),this.showSearchBar=(0,Rp.EW)(()=>(this.sends().length>0||this.searchText().length>0)&&!this.hideSearchBar()),this.noSearchResults=(0,Rp.EW)(()=>this.showSearchBar()&&0===this.sends().length),this.dataSource=new Rm.s,this.editSend=(0,r.CGW)(),this.copySend=(0,r.CGW)(),this.removePassword=(0,r.CGW)(),this.deleteSend=(0,r.CGW)(),(0,Rp.QZ)(()=>{this.dataSource.data=this.sends()})}onEditSend(e){this.editSend.emit(e)}onCopySend(e){this.copySend.emit(e)}onRemovePassword(e){this.removePassword.emit(e)}onDeleteSend(e){this.deleteSend.emit(e)}}fB.ɵfac=function(e){return new(e||fB)},fB.ɵcmp=B.VBU({type:fB,selectors:[["tools-send-list"]],inputs:{sends:[1,"sends"],loading:[1,"loading"],disableSend:[1,"disableSend"],listState:[1,"listState"],searchText:[1,"searchText"],hideSearchBar:[1,"hideSearchBar"]},outputs:{editSend:"editSend",copySend:"copySend",removePassword:"removePassword",deleteSend:"deleteSend"},ngContentSelectors:["[slot='filters']","[slot='empty-button']"],decls:2,vars:1,consts:[[3,"editSend","copySend","removePassword","deleteSend","dataSource","disableSend"],[3,"icon"],["slot","title"],["slot","description"]],template:function(e,t){1&e&&(B.NAR(dB),B.nVh(0,uB,1,0,"bit-spinner")(1,gB,5,4)),2&e&&B.vxM(t.loading()?0:1)},dependencies:[H.MD,jd.p,Yd.t,aB.s,cB.D,lB.t,Vb,rB,au.$],encapsulation:2,changeDetection:0});class mB{constructor(e,t,i,n,r){this.accountService=e,this.billingAccountProfileStateService=t,this.logService=i,this.platformUtilsService=n,this.accountBillingClient=r}getSubscriptionRoute$(){return null}ifAccountExistsCheck(e){return this.accountService.activeAccount$.pipe((0,rt.n)(t=>t?e(t.id):(0,Ii.of)(!1)))}}mB.ɵfac=function(e){return new(e||mB)(E.KVO(Y.D),E.KVO(Rn.Q),E.KVO(Vs.K),E.KVO(V.y),E.KVO(tw.cH))},mB.ɵprov=E.jDH({token:mB,factory:mB.ɵfac,providedIn:"root"});var yB=i(24137),CB=i(37806),wB=i(65067);function IB(e,t){1&e&&(B.nrm(0,"bit-nav-item",1),B.nI1(1,"i18n")),2&e&&B.Y8G("text",B.bMT(1,1,"sponsoredFamilies"))}class bB{constructor(e){this.freeFamiliesPolicyService=e,this.showFreeFamilies$=this.freeFamiliesPolicyService.showFreeFamilies$}}bB.ɵfac=function(e){return new(e||bB)(B.rXU(yC.A))},bB.ɵcmp=B.VBU({type:bB,selectors:[["billing-free-families-nav-item"]],decls:2,vars:3,consts:[["route","settings/sponsored-families",3,"text",4,"ngIf"],["route","settings/sponsored-families",3,"text"]],template:function(e,t){1&e&&(B.DNE(0,IB,2,3,"bit-nav-item",0),B.nI1(1,"async")),2&e&&B.Y8G("ngIf",B.bMT(1,1,t.showFreeFamilies$))},dependencies:[yB.f,wB.u,CB.r,H.bT,H.Jj,au.$],encapsulation:2});var BB=i(15661),EB=i(81740),SB=i(44087),QB=i(59557),kB=i(53021),TB=i(4581),FB=i(38411),PB=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function RB(e,t){1&e&&(B.nrm(0,"bit-nav-item",4),B.nI1(1,"i18n")),2&e&&B.Y8G("text",B.bMT(1,1,"send"))}function DB(e,t){if(1&e&&(B.nrm(0,"bit-nav-item",16),B.nI1(1,"i18n")),2&e){B.XpG();const e=B.r8f(30);B.Y8G("text",B.bMT(1,2,"subscription"))("route",e)}}function MB(e,t){1&e&&(B.nrm(0,"bit-nav-item",18),B.nI1(1,"i18n")),2&e&&B.Y8G("text",B.bMT(1,1,"emergencyAccess"))}class xB{constructor(e,t,i,n,r,s){this.syncService=e,this.accountService=t,this.policyService=i,this.configService=n,this.sendPolicyService=r,this.premiumSubscriptionRoutingService=s,this.logo=gI,this.sendEnabled$=this.sendPolicyService.disableSend$.pipe((0,p.T)(e=>!e)),this.coachmarkService=(0,E.WQX)(BB.Tu),this.importCoachmarkOpen=(0,Rp.EW)(()=>"importData"===this.coachmarkService.activeStepId()),this.reportsCoachmarkOpen=(0,Rp.EW)(()=>"monitorSecurity"===this.coachmarkService.activeStepId()),this.toolsNavGroupOpen=(0,Rp.EW)(()=>"importData"===this.coachmarkService.activeStepId()),this.showEmergencyAccess=(0,c.ot)(this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>(0,f.KP)(e,this.configService,this.policyService)))),this.subscriptionRoute$=this.premiumSubscriptionRoutingService.getSubscriptionRoute$()}ngOnInit(){return PB(this,void 0,void 0,function*(){document.body.classList.remove("layout_frontend"),yield this.syncService.fullSync(!1)})}}xB.ɵfac=function(e){return new(e||xB)(B.rXU(Ga.H),B.rXU(Y.D),B.rXU(me.m),B.rXU(z.w),B.rXU(ob),B.rXU(mB))},xB.ɵcmp=B.VBU({type:xB,selectors:[["app-user-layout"]],decls:38,vars:56,consts:[["importCoachmark",""],["reportsCoachmark",""],["route",".",3,"openIcon","label"],["icon","bwi-vault","route","vault",3,"text"],["icon","bwi-send","route","sends",3,"text"],["icon","bwi-wrench","route","tools",3,"text","open"],["route","tools/generator",3,"text"],["route","tools/import",3,"text","bitPopoverAnchorFor","popoverOpen","position","closeOnBackdropClick","spotlight"],["stepId","importData"],["route","tools/export",3,"text"],["icon","bwi-sliders","route","reports",3,"text","bitPopoverAnchorFor","popoverOpen","position","closeOnBackdropClick","spotlight"],["stepId","monitorSecurity"],["icon","bwi-cog","route","settings",3,"text"],["route","settings/account",3,"text"],["route","settings/security",3,"text"],["route","settings/appearance",3,"text"],[3,"text","route"],["route","settings/domain-rules",3,"text"],["route","settings/emergency-access",3,"text"]],template:function(e,t){if(1&e&&(B.j41(0,"app-layout")(1,"app-side-nav"),B.nrm(2,"bit-nav-logo",2),B.nI1(3,"i18n"),B.nrm(4,"bit-nav-item",3),B.nI1(5,"i18n"),B.nVh(6,RB,2,3,"bit-nav-item",4),B.nI1(7,"async"),B.j41(8,"bit-nav-group",5),B.nI1(9,"i18n"),B.nrm(10,"bit-nav-item",6),B.nI1(11,"i18n"),B.nrm(12,"bit-nav-item",7),B.nI1(13,"i18n"),B.nrm(14,"app-coachmark",8,0)(16,"bit-nav-item",9),B.nI1(17,"i18n"),B.k0s(),B.nrm(18,"bit-nav-item",10),B.nI1(19,"i18n"),B.nrm(20,"app-coachmark",11,1),B.j41(22,"bit-nav-group",12),B.nI1(23,"i18n"),B.nrm(24,"bit-nav-item",13),B.nI1(25,"i18n"),B.nrm(26,"bit-nav-item",14),B.nI1(27,"i18n"),B.nrm(28,"bit-nav-item",15),B.nI1(29,"i18n"),B.SS7(30),B.nI1(31,"async"),B.nVh(32,DB,2,4,"bit-nav-item",16),B.nrm(33,"bit-nav-item",17),B.nI1(34,"i18n"),B.nVh(35,MB,2,3,"bit-nav-item",18),B.nrm(36,"billing-free-families-nav-item"),B.k0s()(),B.nrm(37,"router-outlet"),B.k0s()),2&e){const e=B.sdS(15),i=B.sdS(21);B.R7$(2),B.Y8G("openIcon",t.logo)("label",B.bMT(3,27,"passwordManager")),B.R7$(2),B.Y8G("text",B.bMT(5,29,"vaults")),B.R7$(2),B.vxM(B.bMT(7,31,t.sendEnabled$)?6:-1),B.R7$(2),B.Y8G("text",B.bMT(9,33,"tools"))("open",t.toolsNavGroupOpen()),B.R7$(2),B.Y8G("text",B.bMT(11,35,"generator")),B.R7$(2),B.Y8G("text",B.bMT(13,37,"importNoun"))("bitPopoverAnchorFor",e.popover())("popoverOpen",t.importCoachmarkOpen())("position",t.coachmarkService.getStepPosition("importData"))("closeOnBackdropClick",!1)("spotlight",!0),B.R7$(4),B.Y8G("text",B.bMT(17,39,"exportNoun")),B.R7$(2),B.Y8G("text",B.bMT(19,41,"reports"))("bitPopoverAnchorFor",i.popover())("popoverOpen",t.reportsCoachmarkOpen())("position",t.coachmarkService.getStepPosition("monitorSecurity"))("closeOnBackdropClick",!1)("spotlight",!0),B.R7$(4),B.Y8G("text",B.bMT(23,43,"settings")),B.R7$(2),B.Y8G("text",B.bMT(25,45,"myAccount")),B.R7$(2),B.Y8G("text",B.bMT(27,47,"security")),B.R7$(2),B.Y8G("text",B.bMT(29,49,"appearance")),B.R7$(2);const n=B.bH3(B.bMT(31,51,t.subscriptionRoute$));B.R7$(2),B.vxM(n?32:-1),B.R7$(),B.Y8G("text",B.bMT(34,54,"domainRules")),B.R7$(2),B.vxM(t.showEmergencyAccess()?35:-1)}},dependencies:[H.MD,BA.iI,F.n3,jd.p,EB.P,SB.O,wB.u,QB.K,kB.s,TB.y,RA.Z,bB,um.k,FB.d,BB.nk,H.Jj,au.$],encapsulation:2});var OB=i(32501);class GB{}GB.ɵfac=function(e){return new(e||GB)},GB.ɵmod=B.$C({type:GB}),GB.ɵinj=E.G2t({imports:[oh.G]});class UB{}UB.ɵfac=function(e){return new(e||UB)},UB.ɵmod=B.$C({type:UB}),UB.ɵinj=E.G2t({providers:[H.PV],imports:[oh.G,xC.uY,GB,Xd.L,OB.Y,vw,le.tu]});class VB{}function jB(e,t){if(1&e&&(B.j41(0,"bit-form-field")(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",0),B.k0s(),B.j41(5,"div",1)(6,"button",2)(7,"span"),B.EFF(8),B.nI1(9,"i18n"),B.k0s()()()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,6,"email")),B.R7$(2),B.Y8G("formControl",e.email),B.R7$(2),B.Y8G("loading",e.loading())("disabled",!e.validateEmail())("block",!0),B.R7$(2),B.SpI("",B.bMT(9,8,"sendCode")," ")}}function NB(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-form-field")(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",3),B.j41(5,"bit-hint"),B.EFF(6),B.nI1(7,"i18n"),B.j41(8,"a",4),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onResendCode())}),B.EFF(9),B.nI1(10,"i18n"),B.nI1(11,"lowercase"),B.k0s()()(),B.j41(12,"button",5)(13,"span"),B.EFF(14),B.nI1(15,"i18n"),B.k0s()(),B.j41(16,"button",6),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onBackClick())}),B.j41(17,"span"),B.EFF(18),B.nI1(19,"i18n"),B.k0s()()}if(2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,9,"verificationCode")),B.R7$(2),B.Y8G("formControl",e.otp),B.R7$(2),B.SpI(" ",B.bMT(7,11,"didNotReceiveCodeContactSenderOr")),B.R7$(3),B.JRh(B.bMT(11,15,B.bMT(10,13,"resendCode"))),B.R7$(3),B.Y8G("loading",e.loading())("block",!0),B.R7$(2),B.SpI("",B.bMT(15,17,"viewSend")," "),B.R7$(2),B.Y8G("block",!0),B.R7$(2),B.JRh(B.bMT(19,19,"back"))}}class zB{constructor(){this.formGroup=r.hFB.required(),this.enterOtp=r.hFB.required(),this.resendCode=(0,r.CGW)(),this.loading=r.hFB.required(),this.backToEmail=(0,r.CGW)()}ngOnInit(){this.email=new a.MJ("",[a.k0.required,a.k0.email]),this.otp=new a.MJ(""),this.formGroup().addControl("email",this.email),this.formGroup().addControl("otp",this.otp),(0,Rp.QZ)(()=>{this.enterOtp()?this.email.clearValidators():this.email.setValidators([a.k0.required,a.k0.email]),this.email.updateValueAndValidity()})}ngOnDestroy(){this.formGroup().removeControl("email"),this.formGroup().removeControl("otp")}onResendCode(){this.resendCode.emit()}onBackClick(){this.backToEmail.emit(),this.otp&&(this.otp.setValue(""),this.otp.setErrors(null),this.otp.markAsUntouched(),this.otp.markAsPristine())}validateEmail(){var e,t;const i=null!==(t=null===(e=this.email.value)||void 0===e?void 0:e.trim())&&void 0!==t?t:"";if(!i||i.length>254)return!1;const[n,...r]=i.split("@");return!(1!==r.length||n.length>64)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$/.test(i)}}zB.ɵfac=function(e){return new(e||zB)},zB.ɵcmp=B.VBU({type:zB,selectors:[["app-send-access-email"]],inputs:{formGroup:[1,"formGroup"],enterOtp:[1,"enterOtp"],loading:[1,"loading"]},outputs:{resendCode:"resendCode",backToEmail:"backToEmail"},decls:2,vars:1,consts:[["bitInput","","type","text","required","","appInputVerbatim","","appAutofocus","",3,"formControl"],[1,"tw-flex"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"loading","disabled","block"],["bitInput","","type","text","appInputVerbatim","","appAutofocus","",3,"formControl"],["bitLink","","type","button",3,"click"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",1,"tw-mb-3",3,"loading","block"],["bitButton","","type","button","buttonType","secondary",3,"click","block"]],template:function(e,t){1&e&&B.nVh(0,jB,10,10)(1,NB,20,21),2&e&&B.vxM(t.enterOtp()?1:0)},dependencies:[oh.G,a.me,a.BC,a.YS,a.l_,x.B,Pg.q,_d.$,Jd.Q,tu.j,iu.I,nu.J,ru.h,$d.g,H.GH,au.$],encapsulation:2,changeDetection:0});class YB{constructor(){this.formGroup=r.hFB.required(),this.loading=r.hFB.required()}ngOnInit(){this.password=new a.MJ("",a.k0.required),this.formGroup().addControl("password",this.password)}ngOnDestroy(){this.formGroup().removeControl("password")}}YB.ɵfac=function(e){return new(e||YB)},YB.ɵcmp=B.VBU({type:YB,selectors:[["app-send-access-password"]],inputs:{formGroup:[1,"formGroup"],loading:[1,"loading"]},decls:15,vars:12,consts:[["bitInput","","type","password","required","","appInputVerbatim","","appAutofocus","",3,"formControl"],["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&&(B.j41(0,"bit-form-field")(1,"bit-label"),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.nrm(4,"input",0),B.j41(5,"bit-hint"),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.nrm(8,"button",1),B.k0s(),B.j41(9,"div",2)(10,"button",3)(11,"span"),B.nrm(12,"i",4),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,6,"password")),B.R7$(2),B.Y8G("formControl",t.password),B.R7$(2),B.JRh(B.bMT(7,8,"sendProtectedPasswordDontKnow")),B.R7$(4),B.Y8G("loading",t.loading())("block",!0),B.R7$(3),B.SpI(" ",B.bMT(14,10,"continue")," "))},dependencies:[oh.G,a.me,a.BC,a.YS,a.l_,x.B,Pg.q,_d.$,Jd.Q,tu.j,iu.I,nu.J,ru.h,su.e,ou.a,Zd.s,au.$],encapsulation:2,changeDetection:0});var LB=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function KB(e,t){1&e&&(B.j41(0,"div",1)(1,"p",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"unexpectedErrorSend")))}function XB(e,t){1&e&&(B.j41(0,"div",1)(1,"p",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"sendAccessUnavailable")))}function qB(e,t){if(1&e&&B.nrm(0,"app-send-access-password",3),2&e){const e=B.XpG(2);B.Y8G("loading",e.loading())("formGroup",e.sendAccessForm)}}function HB(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-send-access-email",5),B.bIt("resendCode",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.onResendCode())})("backToEmail",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.onBackToEmail())}),B.k0s()}if(2&e){const e=B.XpG(2);B.Y8G("formGroup",e.sendAccessForm)("enterOtp",e.enterOtp())("loading",e.loading())}}function WB(e,t){if(1&e&&B.nVh(0,qB,1,2,"app-send-access-password",3)(1,HB,1,3,"app-send-access-email",4),2&e){let e;const t=B.XpG();B.vxM((e=t.sendAuthType())===t.authType.Password?0:e===t.authType.Email?1:-1)}}class $B{constructor(e,t,i,n,s,o,a,l){this.cryptoFunctionService=e,this.sendApiService=t,this.toastService=i,this.i18nService=n,this.formBuilder=s,this.configService=o,this.sendTokenService=a,this.anonLayoutWrapperDataService=l,this.id=r.hFB.required(),this.key=r.hFB.required(),this.accessGranted=(0,r.CGW)(),this.authType=fI,this.expiredAuthAttempts=0,this.otpSubmitted=!1,this.loading=(0,E.vPA)(!1),this.error=(0,E.vPA)(!1),this.unavailable=(0,E.vPA)(!1),this.sendAuthType=(0,E.vPA)(fI.None),this.enterOtp=(0,E.vPA)(!1),this.sendAccessForm=this.formBuilder.group({})}ngOnInit(){this.onSubmit()}onSubmit(){return LB(this,void 0,void 0,function*(){this.loading.set(!0),this.unavailable.set(!1),this.error.set(!1);try{(yield this.configService.getFeatureFlag(dr.TO.SendEmailOTP))?yield this.attemptV2Access():yield this.attemptV1Access()}finally{this.loading.set(!1)}})}onBackToEmail(){this.enterOtp.set(!1),this.otpSubmitted=!1,this.updatePageTitle()}attemptV1Access(){return LB(this,void 0,void 0,function*(){try{const e=new VB;if(this.sendAuthType()===fI.Password){const t=this.sendAccessForm.value.password;if(null==t)return;e.password=yield this.getPasswordHashB64(t,this.key())}const t=yield this.sendApiService.postSendAccess(this.id(),e);this.accessGranted.emit({request:e,response:t})}catch(e){if(e instanceof ot._)if(401===e.statusCode){if(this.sendAuthType()===fI.Password){const e=this.sendAccessForm.get("password");e&&(e.setErrors({invalidPassword:{message:this.i18nService.t("sendPasswordInvalidAskOwner")}}),e.markAsTouched())}this.sendAuthType.set(fI.Password)}else if(400===e.statusCode&&this.sendAuthType()===fI.Password){const e=this.sendAccessForm.get("password");e&&(e.setErrors({invalidPassword:{message:this.i18nService.t("sendPasswordInvalidAskOwner")}}),e.markAsTouched())}else 404===e.statusCode?this.unavailable.set(!0):(this.error.set(!0),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:e.message}));else this.error.set(!0)}})}attemptV2Access(){return LB(this,void 0,void 0,function*(){const e=this.sendAuthType();e!==fI.None?e===fI.Email?yield this.handleEmailOtpAuth():e===fI.Password&&(yield this.handlePasswordAuth()):yield this.getTokenWithRetry(null)})}getTokenWithRetry(e){return LB(this,void 0,void 0,function*(){var t,i,n;const r=e?yield(0,u._)(this.sendTokenService.getSendAccessToken$(this.id(),e)):yield(0,u._)(this.sendTokenService.tryGetSendAccessToken$(this.id()));if(r instanceof Ut)this.expiredAuthAttempts=0,this.accessGranted.emit({accessToken:r});else if("expired"===r.kind){if(this.expiredAuthAttempts>2)return;this.expiredAuthAttempts++,yield this.getTokenWithRetry(e)}else"expected_server"===r.kind?(this.expiredAuthAttempts=0,"invalid_request"===(s=r.error).error&&"email_required"===s.send_access_error_type?(this.sendAuthType.set(fI.Email),this.updatePageTitle()):!function(e){return"invalid_request"===e.error&&"email_and_otp_required"===e.send_access_error_type}(r.error)?!function(e){return"invalid_request"===e.error&&"password_hash_b64_required"===e.send_access_error_type}(r.error)?!function(e){return"invalid_grant"===e.error&&"password_hash_b64_invalid"===e.send_access_error_type}(r.error)?!function(e){return"invalid_grant"===e.error&&"send_id_invalid"===e.send_access_error_type}(r.error)?(this.error.set(!0),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:null!==(n=r.error.error_description)&&void 0!==n?n:""})):this.unavailable.set(!0):(null===(t=this.sendAccessForm.controls.password)||void 0===t||t.setErrors({invalidPassword:{message:this.i18nService.t("sendPasswordInvalidAskOwner")}}),null===(i=this.sendAccessForm.controls.password)||void 0===i||i.markAsTouched()):(this.sendAuthType.set(fI.Password),this.updatePageTitle()):(e&&"email"===e.kind&&this.enterOtp()?this.toastService.showToast({variant:"success",title:void 0,message:this.i18nService.t("codeResent")}):(this.otpSubmitted&&this.toastService.showToast({variant:"error",title:void 0,message:this.i18nService.t("invalidVerificationCode")}),this.otpSubmitted=!0),this.enterOtp.set(!0),this.updatePageTitle())):(this.expiredAuthAttempts=0,this.error.set(!0),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:r.error}));var s})}handleEmailOtpAuth(){return LB(this,void 0,void 0,function*(){const e=this.sendAccessForm.value.email;if(null==e)return;let t;if(this.enterOtp()){const i=this.sendAccessForm.value.otp;if(null==i||""===i.trim())return void this.toastService.showToast({variant:"error",title:void 0,message:this.i18nService.t("invalidVerificationCode")});t={kind:"email_otp",email:e,otp:i}}else t={kind:"email",email:e};yield this.getTokenWithRetry(t)})}handlePasswordAuth(){return LB(this,void 0,void 0,function*(){const e=this.sendAccessForm.value.password;if(null==e)return;const t={kind:"password",passwordHashB64:yield this.getPasswordHashB64(e,this.key())};yield this.getTokenWithRetry(t)})}onResendCode(){return LB(this,void 0,void 0,function*(){this.unavailable.set(!1),this.error.set(!1);const e=this.sendAccessForm.value.email;if(null==e)return;const t={kind:"email",email:e};yield this.getTokenWithRetry(t)})}getPasswordHashB64(e,t){return LB(this,void 0,void 0,function*(){const i=at.A.fromUrlB64ToArray(t),n=yield this.cryptoFunctionService.pbkdf2(e,i,"sha256",Rs);return at.A.fromBufferToB64(n)})}updatePageTitle(){var e;const t=this.sendAuthType();t===fI.Email?this.enterOtp()?this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"enterTheCodeSentToYourEmail"},pageSubtitle:null!==(e=this.sendAccessForm.value.email)&&void 0!==e?e:null}):this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"verifyYourEmailToViewThisSend"},pageSubtitle:null}):t===fI.Password&&this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"sendAccessPasswordTitle"}})}}$B.ɵfac=function(e){return new(e||$B)(B.rXU(kr.R),B.rXU(Xl),B.rXU(P.f),B.rXU(U.W),B.rXU(a.ok),B.rXU(z.w),B.rXU(Gt),B.rXU(Fd.f))},$B.ɵcmp=B.VBU({type:$B,selectors:[["app-send-auth"]],inputs:{id:[1,"id"],key:[1,"key"]},outputs:{accessGranted:"accessGranted"},decls:4,vars:3,consts:[[3,"ngSubmit","formGroup"],[1,"tw-text-main","tw-text-center"],["bitTypography","body1"],[3,"loading","formGroup"],[3,"formGroup","enterOtp","loading"],[3,"resendCode","backToEmail","formGroup","enterOtp","loading"]],template:function(e,t){1&e&&(B.j41(0,"form",0),B.bIt("ngSubmit",function(){return t.onSubmit()}),B.nVh(1,KB,4,3,"div",1),B.nVh(2,XB,4,3,"div",1)(3,WB,2,1),B.k0s()),2&e&&(B.Y8G("formGroup",t.sendAccessForm),B.R7$(),B.vxM(t.error()?1:-1),B.R7$(),B.vxM(t.unavailable()?2:3))},dependencies:[YB,zB,oh.G,a.qT,a.cb,a.j4,MA.r,au.$],encapsulation:2,changeDetection:0});class JB{constructor(e){this.id=null,this.name=null,this.type=null,this.text=new Pl,this.file=new Fl,this.expirationDate=null,this.creatorIdentifier=null,e&&(this.id=e.id,this.type=e.type,this.expirationDate=e.expirationDate,this.creatorIdentifier=e.creatorIdentifier)}}var ZB=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _B extends Tl.A{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 ja.Text:this.text=new xl(e.text);break;case ja.File:this.file=new Ml(e.file)}}decrypt(e){return ZB(this,void 0,void 0,function*(){const t=new JB(this);switch(yield this.decryptObj(this,t,["name"],e),this.type){case ja.File:t.file=yield this.file.decrypt(e);break;case ja.Text:t.text=yield this.text.decrypt(e)}return t})}}var eE=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class tE{constructor(e,t,i,n,s,o){this.i18nService=e,this.toastService=t,this.encryptService=i,this.fileDownloadService=n,this.sendApiService=s,this.configService=o,this.send=(0,r.hFB)(null),this.decKey=(0,r.hFB)(null),this.accessRequest=(0,r.hFB)(null),this.accessToken=(0,r.hFB)(null),this.download=()=>eE(this,void 0,void 0,function*(){const e=yield this.configService.getFeatureFlag(dr.TO.SendEmailOTP),t=this.accessToken(),i=this.accessRequest(),n=e&&!t||!e&&!i;if(null==this.send()||null==this.decKey()||n)return;const r=e?yield this.sendApiService.getSendFileDownloadDataV2(this.send(),t):yield this.sendApiService.getSendFileDownloadData(this.send(),i);if(at.A.isNullOrWhitespace(r.url))return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("missingSendFile")});const s=yield fetch(new Request(r.url,{cache:"no-store"}));if(200===s.status)try{const e=yield Dr.fromResponse(s),t=yield this.encryptService.decryptFileData(e,this.decKey());this.fileDownloadService.download({fileName:this.send().file.fileName,blobData:t,downloadMethod:"save"})}catch(o){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})})}}function iE(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",5),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.toggleText())}),B.nrm(1,"bit-icon",6),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("block",!0),B.R7$(),B.Y8G("name",e.showText?"bwi-eye":"bwi-eye-slash"),B.R7$(),B.SpI(" ",B.bMT(3,3,"toggleVisibility")," ")}}tE.ɵfac=function(e){return new(e||tE)(B.rXU(U.W),B.rXU(P.f),B.rXU(Tr.N),B.rXU(Gu.y),B.rXU(Xl),B.rXU(z.w))},tE.ɵcmp=B.VBU({type:tE,selectors:[["app-send-access-file"]],inputs:{send:[1,"send"],decKey:[1,"decKey"],accessRequest:[1,"accessRequest"],accessToken:[1,"accessToken"]},decls:6,vars:7,consts:[[1,"tw-text-wrap","tw-break-all"],["bitButton","","type","button","buttonType","primary",3,"bitAction","block"],["aria-hidden","true",1,"bwi","bwi-download"]],template:function(e,t){1&e&&(B.j41(0,"p",0),B.EFF(1),B.k0s(),B.j41(2,"button",1),B.nrm(3,"i",2),B.EFF(4),B.nI1(5,"i18n"),B.k0s()),2&e&&(B.R7$(),B.JRh(t.send().file.fileName),B.R7$(),B.Y8G("bitAction",t.download)("block",!0),B.R7$(2),B.Lme(" ",B.bMT(5,5,"downloadAttachments")," (",t.send().file.sizeName,")\n"))},dependencies:[oh.G,Zp.p,Jd.Q,au.$],encapsulation:2,changeDetection:0});class nE{constructor(e,t,i,n){this.i18nService=e,this.platformUtilsService=t,this.formBuilder=i,this.toastService=n,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.toastService.showToast({variant:"success",title:null,message: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)}}nE.ɵfac=function(e){return new(e||nE)(B.rXU(U.W),B.rXU(V.y),B.rXU(a.ok),B.rXU(P.f))},nE.ɵcmp=B.VBU({type:nE,selectors:[["app-send-access-text"]],inputs:{send:"send"},decls:8,vars:6,consts:[[3,"formGroup"],["id","text","bitInput","","rows","8","name","Text","formControlName","sendText","readonly",""],[1,"tw-mb-3"],["bitButton","","type","button","buttonType","secondary",3,"block"],["bitButton","","type","button","buttonType","primary","startIcon","bwi-clone",3,"click","block"],["bitButton","","type","button","buttonType","secondary",3,"click","block"],[1,"bwi-lg",3,"name"]],template:function(e,t){1&e&&(B.j41(0,"bit-form-field",0),B.nrm(1,"textarea",1),B.k0s(),B.j41(2,"div",2),B.nVh(3,iE,4,5,"button",3),B.k0s(),B.j41(4,"div",2)(5,"button",4),B.bIt("click",function(){return t.copyText()}),B.EFF(6),B.nI1(7,"i18n"),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup),B.R7$(3),B.vxM(t.send.text.hidden?3:-1),B.R7$(2),B.Y8G("block",!0),B.R7$(),B.SpI(" ",B.bMT(7,4,"copyValue")," "))},dependencies:[oh.G,a.me,a.BC,a.cb,a.j4,a.JD,Jd.Q,nu.J,ru.h,LA.R,YA.o,au.$],encapsulation:2});var rE=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function sE(e,t){1&e&&(B.j41(0,"bit-callout",0),B.nI1(1,"i18n"),B.EFF(2),B.nI1(3,"i18n"),B.j41(4,"a",2),B.EFF(5),B.nI1(6,"i18n"),B.k0s()()),2&e&&(B.Y8G("title",B.mNQ(B.bMT(1,4,"warning"))),B.R7$(2),B.SpI(" ",B.bMT(3,6,"viewSendHiddenEmailWarning")," "),B.R7$(3),B.JRh(B.bMT(6,8,"learnMore")))}function oE(e,t){1&e&&(B.j41(0,"div",1),B.nrm(1,"bit-spinner"),B.k0s())}function aE(e,t){1&e&&(B.j41(0,"div",3)(1,"p",4),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"sendAccessUnavailable")))}function lE(e,t){1&e&&(B.j41(0,"div",3)(1,"p",4),B.EFF(2),B.nI1(3,"i18n"),B.k0s()()),2&e&&(B.R7$(2),B.JRh(B.bMT(3,1,"unexpectedErrorSend")))}function cE(e,t){if(1&e&&B.nrm(0,"app-send-access-text",5),2&e){const e=B.XpG(3);B.Y8G("send",e.send())}}function dE(e,t){if(1&e&&B.nrm(0,"app-send-access-file",6),2&e){const e=B.XpG(3);B.Y8G("send",e.send())("decKey",e.decKey)("accessRequest",e.accessRequest())("accessToken",e.accessToken())}}function uE(e,t){if(1&e&&(B.SS7(0),B.nI1(1,"date"),B.SS7(2),B.nI1(3,"date"),B.j41(4,"p",7),B.EFF(5),B.nI1(6,"i18n"),B.k0s()),2&e){const e=B.XpG(3),t=B.i5U(1,1,e.expirationDate(),"shortTime"),i=B.i5U(3,4,e.expirationDate(),"mediumDate");B.R7$(5),B.SpI(" ",B.brH(6,7,"sendExpiresOn",t,i)," ")}}function hE(e,t){if(1&e&&(B.j41(0,"div")(1,"p",1)(2,"b"),B.EFF(3),B.k0s()(),B.nrm(4,"hr"),B.nVh(5,cE,1,1,"app-send-access-text",5)(6,dE,1,4,"app-send-access-file",6),B.nVh(7,uE,7,11,"p",7),B.k0s()),2&e){let e;const t=B.XpG(2);B.R7$(3),B.JRh(t.send().name),B.R7$(2),B.vxM((e=t.send().type)===t.sendType.Text?5:e===t.sendType.File?6:-1),B.R7$(2),B.vxM(t.expirationDate()?7:-1)}}function AE(e,t){if(1&e&&(B.nVh(0,aE,4,3,"div",3),B.nVh(1,lE,4,3,"div",3),B.nVh(2,hE,8,3,"div")),2&e){const e=B.XpG();B.vxM(e.unavailable()?0:-1),B.R7$(),B.vxM(e.error()?1:-1),B.R7$(),B.vxM(e.send()?2:-1)}}class pE{constructor(e,t,i,n,s,o){this.keyService=e,this.sendApiService=t,this.toastService=i,this.i18nService=n,this.layoutWrapperDataService=s,this.configService=o,this.id=r.hFB.required(),this.key=r.hFB.required(),this.accessToken=(0,r.hFB)(null),this.sendResponse=(0,r.hFB)(null),this.accessRequest=(0,r.hFB)(new VB),this.authRequired=(0,r.CGW)(),this.send=(0,E.vPA)(null),this.expirationDate=(0,Rp.EW)(()=>{var e,t;return null!==(t=null===(e=this.send())||void 0===e?void 0:e.expirationDate)&&void 0!==t?t:null}),this.creatorIdentifier=(0,Rp.EW)(()=>{var e,t;return null!==(t=null===(e=this.send())||void 0===e?void 0:e.creatorIdentifier)&&void 0!==t?t:null}),this.hideEmail=(0,Rp.EW)(()=>null!=this.send()&&null==this.creatorIdentifier()),this.loading=(0,E.vPA)(!1),this.unavailable=(0,E.vPA)(!1),this.error=(0,E.vPA)(!1),this.sendType=ja}ngOnInit(){this.layoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"sendAccessContentTitle"}}),this.load()}load(){return rE(this,void 0,void 0,function*(){this.loading.set(!0),this.unavailable.set(!1),this.error.set(!1);try{let e;if(yield this.configService.getFeatureFlag(dr.TO.SendEmailOTP)){const t=this.accessToken();if(!t)return void this.authRequired.emit();e=yield this.sendApiService.postSendAccessV2(t)}else{const t=this.sendResponse();if(!t)return void this.authRequired.emit();e=t}const t=at.A.fromUrlB64ToArray(this.key()),i=new _B(e);this.decKey=yield this.keyService.makeSendKey(t);const n=yield i.decrypt(this.decKey);this.send.set(n)}catch(t){this.send.set(null),t instanceof ot._?401===t.statusCode?this.authRequired.emit():404===t.statusCode?this.unavailable.set(!0):400===t.statusCode?this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:t.message}):this.error.set(!0):this.error.set(!0)}finally{this.loading.set(!1)}const e=this.creatorIdentifier();null!=e&&this.layoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:{key:"sendAccessCreatorIdentifier",placeholders:[e]}})})}}function gE(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-send-auth",2),B.bIt("accessGranted",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onAccessGranted(t))}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("id",e.id)("key",e.key)}}function vE(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-send-view",3),B.bIt("authRequired",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onAuthRequired())}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("id",e.id)("key",e.key)("accessToken",e.sendAccessToken)("sendResponse",e.sendAccessResponse)("accessRequest",e.sendAccessRequest)}}pE.ɵfac=function(e){return new(e||pE)(B.rXU(b.Lu),B.rXU(Xl),B.rXU(P.f),B.rXU(U.W),B.rXU(Fd.f),B.rXU(z.w))},pE.ɵcmp=B.VBU({type:pE,selectors:[["app-send-view"]],inputs:{id:[1,"id"],key:[1,"key"],accessToken:[1,"accessToken"],sendResponse:[1,"sendResponse"],accessRequest:[1,"accessRequest"]},outputs:{authRequired:"authRequired"},decls:3,vars:2,consts:[["type","warning",3,"title"],[1,"tw-text-center"],["bitLink","","href","https://bitwarden.com/help/receive-send/","target","_blank","rel","noreferrer"],[1,"tw-text-main","tw-text-center"],["bitTypography","body1"],[3,"send"],[3,"send","decKey","accessRequest","accessToken"],[1,"tw-text-center","tw-text-muted","tw-text-sm"]],template:function(e,t){1&e&&(B.nVh(0,sE,7,10,"bit-callout",0),B.nVh(1,oE,2,0,"div",1)(2,AE,3,3)),2&e&&(B.vxM(t.hideEmail()?0:-1),B.R7$(),B.vxM(t.loading()?1:2))},dependencies:[tE,nE,oh.G,zA.G,$d.g,MA.r,lB.t,H.vh,au.$],encapsulation:2,changeDetection:0});const fE=Object.freeze({View:"view",Auth:"auth"});class mE{constructor(e,t){this.route=e,this.destroyRef=t,this.viewState=(0,E.vPA)(fE.Auth),this.sendAccessToken=null,this.sendAccessResponse=null,this.sendAccessRequest=new VB}ngOnInit(){this.route.params.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.id=e.sendId,this.key=e.key,this.sendAccessResponse=null,this.sendAccessToken=null,this.sendAccessRequest=new VB,this.viewState.set(null),setTimeout(()=>this.viewState.set(fE.Auth))})}onAuthRequired(){this.viewState.set(fE.Auth)}onAccessGranted(e){this.sendAccessResponse=e.response,this.sendAccessRequest=e.request,this.sendAccessToken=e.accessToken,this.viewState.set(fE.View)}}mE.ɵfac=function(e){return new(e||mE)(B.rXU(F.nX),B.rXU(E.abz))},mE.ɵcmp=B.VBU({type:mE,selectors:[["app-send-access"]],decls:2,vars:1,consts:[[3,"id","key"],[3,"id","key","accessToken","sendResponse","accessRequest"],[3,"accessGranted","id","key"],[3,"authRequired","id","key","accessToken","sendResponse","accessRequest"]],template:function(e,t){if(1&e&&B.nVh(0,gE,1,2,"app-send-auth",0)(1,vE,1,5,"app-send-view",1),2&e){let e;B.vxM("auth"===(e=t.viewState())?0:"view"===e?1:-1)}},dependencies:[$B,pE,oh.G],encapsulation:2,changeDetection:0});var yE=i(14092),CE=i(18990);class wE{}wE.ɵfac=function(e){return new(e||wE)},wE.ɵmod=B.$C({type:wE}),wE.ɵinj=E.G2t({providers:[{provide:xd.cD,useClass:xd.ug}],imports:[CE.m,gb.t]});var IE=i(52981),bE=i(57516),BE=i(67819),EE=i(91267),SE=i(32661),QE=i(34067),kE=i(45524),TE=i(46215),FE=i(51728),PE=i(2570),RE=i(85096),DE=i(53011),ME=i(34423),xE=i(56773),OE=i(26293),GE=i(62263),UE=i(92348),VE=i(64008),jE=i(60573),NE=i(11006),zE=i(25367),YE=i(90973),LE=i(56693),KE=i(63757),XE=i(39140),qE=i(99911),HE=i(32435),WE=i(19711),$E=i(98330),JE=i(18371),ZE=i(83049),_E=i(97369),eS=i(6433),tS=i(11128),iS=i(85884),nS=i(92837),rS=i(62118),sS=i(87970),oS=i(15069),aS=i(9799),lS=i(77058),cS=i(79516),dS=i(11625),uS=i(58146),hS=i(85528),AS=i(74341),pS=i(70860),gS=i(17476),vS=i(41829),fS=i(93323),mS=i(5205),yS=i(89672),CS=i(65906),wS=i(21819),IS=i(50121),bS=i(82437),BS=i(52611),ES=i(95175),SS=i(64068),QS=i(12854),kS=i(28416),TS=i(97413),FS=i(37447),PS=i(60294);(0,IE.EO)(bE.A,"af"),(0,IE.EO)(BE.A,"ar"),(0,IE.EO)(EE.A,"az"),(0,IE.EO)(SE.A,"be"),(0,IE.EO)(QE.A,"bg"),(0,IE.EO)(kE.A,"bn"),(0,IE.EO)(TE.A,"bs"),(0,IE.EO)(FE.A,"ca"),(0,IE.EO)(PE.A,"cs"),(0,IE.EO)(RE.A,"cy"),(0,IE.EO)(DE.A,"da"),(0,IE.EO)(ME.A,"de"),(0,IE.EO)(xE.A,"el"),(0,IE.EO)(OE.A,"en-GB"),(0,IE.EO)(GE.A,"en-IN"),(0,IE.EO)(UE.A,"eo"),(0,IE.EO)(VE.A,"es"),(0,IE.EO)(jE.A,"et"),(0,IE.EO)(NE.A,"eu"),(0,IE.EO)(YE.A,"fa"),(0,IE.EO)(LE.A,"fi"),(0,IE.EO)(KE.A,"fil"),(0,IE.EO)(XE.A,"fr"),(0,IE.EO)(qE.A,"gl"),(0,IE.EO)(HE.A,"he"),(0,IE.EO)(WE.A,"hi"),(0,IE.EO)($E.A,"hr"),(0,IE.EO)(JE.A,"hu"),(0,IE.EO)(ZE.A,"id"),(0,IE.EO)(_E.A,"it"),(0,IE.EO)(eS.A,"ja"),(0,IE.EO)(tS.A,"ka"),(0,IE.EO)(iS.A,"km"),(0,IE.EO)(nS.A,"kn"),(0,IE.EO)(rS.A,"ko"),(0,IE.EO)(sS.A,"lv"),(0,IE.EO)(oS.A,"ml"),(0,IE.EO)(aS.A,"mr"),(0,IE.EO)(lS.A,"my"),(0,IE.EO)(cS.A,"nb"),(0,IE.EO)(dS.A,"ne"),(0,IE.EO)(uS.A,"nl"),(0,IE.EO)(hS.A,"nn"),(0,IE.EO)(AS.A,"or"),(0,IE.EO)(pS.A,"pl"),(0,IE.EO)(gS.A,"pt-BR"),(0,IE.EO)(vS.A,"pt-PT"),(0,IE.EO)(fS.A,"ro"),(0,IE.EO)(mS.A,"ru"),(0,IE.EO)(yS.A,"si"),(0,IE.EO)(CS.A,"sk"),(0,IE.EO)(wS.A,"sl"),(0,IE.EO)(IS.A,"sr"),(0,IE.EO)(bS.A,"sv"),(0,IE.EO)(BS.A,"ta"),(0,IE.EO)(ES.A,"te"),(0,IE.EO)(SS.A,"th"),(0,IE.EO)(QS.A,"tr"),(0,IE.EO)(kS.A,"uk"),(0,IE.EO)(TS.A,"vi"),(0,IE.EO)(FS.A,"zh-CN"),(0,IE.EO)(PS.A,"zh-TW",zE.A);class RS{}RS.ɵfac=function(e){return new(e||RS)},RS.ɵmod=B.$C({type:RS}),RS.ɵinj=E.G2t({imports:[oh.G,yg.G,UB,wE,yE.t,xh,mE,oh.G,yg.G,UB,wE,yE.t]});class DS{}var MS=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class xS{constructor(e){this.apiService=e}requestSMAccessFromAdmins(e){return MS(this,void 0,void 0,function*(){yield this.apiService.send("POST","/request-access/request-sm-access",e,!0,!1)})}}xS.ɵfac=function(e){return new(e||xS)(E.KVO(de.G))},xS.ɵprov=E.jDH({token:xS,factory:xS.ɵfac,providedIn:"root"});var OS=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function GS(e,t){if(1&e&&B.nrm(0,"bit-option",10),2&e){const e=t.$implicit;B.Y8G("value",e)("label",e.name)}}class US{constructor(e,t,i,n,r,s){this.router=e,this.i18nService=t,this.organizationService=i,this.smLandingApiService=n,this.toastService=r,this.accountService=s,this.requestAccessForm=new a.gE({requestAccessEmailContents:new a.MJ(this.i18nService.t("requestAccessSMDefaultEmailContent"),[a.k0.required]),selectedOrganization:new a.MJ(null,[a.k0.required])}),this.organizations=[],this.submit=()=>OS(this,void 0,void 0,function*(){if(this.requestAccessForm.markAllAsTouched(),this.requestAccessForm.invalid)return;const e=this.requestAccessForm.value,t=new DS;t.OrganizationId=e.selectedOrganization.id,t.EmailContent=e.requestAccessEmailContents,yield this.smLandingApiService.requestSMAccessFromAdmins(t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("smAccessRequestEmailSent")}),yield this.router.navigate(["/"])})}ngOnInit(){return OS(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$));this.organizations=(yield(0,u._)(this.organizationService.organizations$(e))).filter(e=>e.enabled).sort((e,t)=>e.name.localeCompare(t.name)),(null===this.organizations||this.organizations.length<1)&&(yield this.navigateToCreateOrganizationPage())})}navigateToCreateOrganizationPage(){return OS(this,void 0,void 0,function*(){yield this.router.navigate(["/create-organization"])})}}US.ɵfac=function(e){return new(e||US)(B.rXU(F.Ix),B.rXU(U.W),B.rXU(f.PV),B.rXU(xS),B.rXU(P.f),B.rXU(Y.D))},US.ɵcmp=B.VBU({type:US,selectors:[["app-request-sm-access"]],decls:26,vars:19,consts:[[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-9"],["bitTypography","body1"],["rows","20","id","request_access_textarea","bitInput","","formControlName","requestAccessEmailContents"],["formControlName","selectedOrganization"],["required","",3,"value","label",4,"ngFor","ngForOf"],[1,"tw-flex","tw-gap-x-4","tw-mt-4"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["type","button","bitButton","","buttonType","secondary",3,"routerLink"],["required","",3,"value","label"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container")(2,"form",0)(3,"div",1)(4,"div",2)(5,"p",3),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.j41(8,"bit-form-field")(9,"bit-label"),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.nrm(12,"textarea",4),B.k0s(),B.j41(13,"bit-form-field")(14,"bit-label"),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.j41(17,"bit-select",5),B.DNE(18,GS,1,2,"bit-option",6),B.k0s()(),B.j41(19,"div",7)(20,"button",8),B.EFF(21),B.nI1(22,"i18n"),B.k0s(),B.j41(23,"button",9),B.EFF(24),B.nI1(25,"i18n"),B.k0s()()()()()()),2&e&&(B.R7$(2),B.Y8G("formGroup",t.requestAccessForm)("bitSubmit",t.submit),B.R7$(4),B.JRh(B.bMT(7,9,"youNeedApprovalFromYourAdminToTrySecretsManager")),B.R7$(4),B.JRh(B.bMT(11,11,"addANote")),B.R7$(5),B.JRh(B.bMT(16,13,"organization")),B.R7$(3),B.Y8G("ngForOf",t.organizations),B.R7$(3),B.SpI(" ",B.bMT(22,15,"sendRequest")," "),B.R7$(2),B.Y8G("routerLink","/sm-landing"),B.R7$(),B.SpI(" ",B.bMT(25,17,"cancel")," "))},dependencies:[Ph.G,H.Sq,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,BA.Wk,_d.$,eu.L,Jd.Q,Cg.H,tu.j,nu.J,ru.h,cg.w,dg.P,MA.r,gb.t,aB.s,yg.G,wg.f,RS,au.$],encapsulation:2});var VS=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function jS(e,t){1&e&&(B.j41(0,"bit-container")(1,"p",8),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"ul",9)(5,"li",10)(6,"b"),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.j41(11,"li",10)(12,"b"),B.EFF(13),B.nI1(14,"i18n"),B.k0s(),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.j41(17,"li",10)(18,"b"),B.EFF(19),B.nI1(20,"i18n"),B.k0s(),B.EFF(21),B.nI1(22,"i18n"),B.k0s(),B.j41(23,"li",10)(24,"b"),B.EFF(25),B.nI1(26,"i18n"),B.k0s(),B.EFF(27),B.nI1(28,"i18n"),B.k0s()()()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,9,"developmentDevOpsAndITTeamsChooseBWSecret")," "),B.R7$(5),B.JRh(B.bMT(8,11,"centralizeSecretsManagement")),B.R7$(2),B.SpI(" ",B.bMT(10,13,"centralizeSecretsManagementDescription")," "),B.R7$(4),B.JRh(B.bMT(14,15,"preventSecretLeaks")),B.R7$(2),B.SpI(" ",B.bMT(16,17,"preventSecretLeaksDescription")," "),B.R7$(4),B.JRh(B.bMT(20,19,"enhanceDeveloperProductivity")),B.R7$(2),B.SpI(" ",B.bMT(22,21,"enhanceDeveloperProductivityDescription")," "),B.R7$(4),B.JRh(B.bMT(26,23,"strengthenBusinessSecurity")),B.R7$(2),B.SpI(" ",B.bMT(28,25,"strengthenBusinessSecurityDescription")," "))}function NS(e,t){1&e&&(B.j41(0,"bit-container")(1,"p",8),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"ul",9)(5,"li",10),B.EFF(6),B.nI1(7,"i18n"),B.j41(8,"b"),B.EFF(9),B.nI1(10,"i18n"),B.k0s(),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"li",10),B.EFF(14),B.nI1(15,"i18n"),B.j41(16,"b"),B.EFF(17),B.nI1(18,"i18n"),B.k0s(),B.EFF(19),B.nI1(20,"i18n"),B.k0s()()()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,7,"giveMembersAccess")," "),B.R7$(4),B.SpI(" ",B.bMT(7,9,"openYourOrganizations")," "),B.R7$(3),B.JRh(B.bMT(10,11,"members")),B.R7$(2),B.SpI(" ",B.bMT(12,13,"viewAndSelectTheMembers")," "),B.R7$(3),B.SpI(" ",B.bMT(15,15,"usingTheMenuSelect")," "),B.R7$(3),B.JRh(B.bMT(18,17,"activateSecretsManager")),B.R7$(2),B.SpI(" ",B.bMT(20,19,"toGrantAccessToSelectedMembers")," "))}class zS{constructor(e,t){this.organizationService=e,this.accountService=t,this.learnMoreUrl="https://bitwarden.com/help/secrets-manager-overview/",this.imageSrc="../images/sm.webp",this.showSecretsManagerInformation=!0,this.showGiveMembersAccessInstructions=!1}ngOnInit(){return VS(this,void 0,void 0,function*(){const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),t=(yield(0,u._)(this.organizationService.organizations$(e))).filter(e=>e.enabled);t.length>0?this.handleEnabledOrganizations(t):this.tryItNowUrl="/create-organization"})}handleEnabledOrganizations(e){const t=e.find(e=>e.isAdmin&&e.useSecretsManager),i=e.find(e=>e.isOwner&&!e.useSecretsManager);null!=t?this.showHowToEnableSMForMembers(t.id):this.tryItNowUrl=null!=i?`/organizations/${i.id}/billing/subscription`:"/request-sm-access"}showHowToEnableSMForMembers(e){this.showGiveMembersAccessInstructions=!0,this.showSecretsManagerInformation=!1,this.learnMoreUrl="https://bitwarden.com/help/secrets-manager-quick-start/#give-members-access",this.imageSrc="../images/sm-give-access.png",this.tryItNowUrl=`/organizations/${e}/members`}}zS.ɵfac=function(e){return new(e||zS)(B.rXU(f.PV),B.rXU(Y.D))},zS.ɵcmp=B.VBU({type:zS,selectors:[["app-sm-landing"]],decls:16,vars:14,consts:[[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],["alt","Bitwarden","aria-hidden","true",1,"tw-max-w-full",3,"src"],[1,"tw-col-span-6","tw-mx-4"],["bitTypography","h1"],[4,"ngIf"],["type","button","bitButton","","buttonType","primary",3,"routerLink"],["bitLink","","linkType","primary","target","_blank",1,"tw-m-5",3,"href"],["bitTypography","body1"],[1,"tw-list-outside"],["bitTypography","body1",1,"tw-mb-2"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"div",0)(2,"div",1),B.nrm(3,"img",2),B.k0s(),B.j41(4,"div",3)(5,"h1",4),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.DNE(8,jS,29,27,"bit-container",5)(9,NS,21,21,"bit-container",5),B.j41(10,"button",6),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"a",7),B.EFF(14),B.nI1(15,"i18n"),B.k0s()()()),2&e&&(B.R7$(3),B.Y8G("src",t.imageSrc,B.B4B),B.R7$(3),B.JRh(B.bMT(7,8,"bitwardenSecretsManager")),B.R7$(2),B.Y8G("ngIf",t.showSecretsManagerInformation),B.R7$(),B.Y8G("ngIf",t.showGiveMembersAccessInstructions),B.R7$(),B.Y8G("routerLink",t.tryItNowUrl),B.R7$(),B.SpI(" ",B.bMT(12,10,"tryItNow")," "),B.R7$(2),B.Y8G("href",t.learnMoreUrl,B.B4B),B.R7$(),B.SpI(" ",B.bMT(15,12,"learnMore")," "))},dependencies:[Ph.G,H.bT,BA.Wk,Jd.Q,Cg.H,$d.g,MA.r,gb.t,aB.s,yg.G,wg.f,au.$],encapsulation:2});var YS=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const LS=(e,t)=>t.value;function KS(e,t){if(1&e&&B.nrm(0,"bit-option",2),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}function XS(e,t){if(1&e&&B.nrm(0,"bit-option",2),2&e){const e=t.$implicit;B.Y8G("value",e.value)("label",e.name)}}class qS{constructor(e,t,i,n,r){this.formBuilder=e,this.i18nService=t,this.themeStateService=i,this.domainSettingsService=n,this.destroyRef=r,this.form=this.formBuilder.group({enableFavicons:!0,theme:[$i.NJ.Light],locale:[null]});const s=[];t.supportedTranslationLocales.forEach(e=>{let i=e;t.localeNames.has(e)&&(i+=" - "+t.localeNames.get(e)),s.push({name:i,value:e})}),s.sort(at.A.getSortFunction(t,"name")),s.splice(0,0,{name:t.t("default"),value:null}),this.localeOptions=s,this.themeOptions=[{name:t.t("themeLight"),value:$i.NJ.Light},{name:t.t("themeDark"),value:$i.NJ.Dark},{name:t.t("themeSystem"),value:$i.NJ.System}]}ngOnInit(){return YS(this,void 0,void 0,function*(){var e;this.form.setValue({enableFavicons:yield(0,u._)(this.domainSettingsService.showFavicons$),theme:yield(0,u._)(this.themeStateService.selectedTheme$),locale:null!==(e=yield(0,u._)(this.i18nService.userSetLocale$))&&void 0!==e?e:null},{emitEvent:!1}),this.form.controls.enableFavicons.valueChanges.pipe((0,h.p)(e=>null!=e),(0,rt.n)(e=>YS(this,void 0,void 0,function*(){yield this.domainSettingsService.setShowFavicons(e)})),(0,c.pQ)(this.destroyRef)).subscribe(),this.form.controls.theme.valueChanges.pipe((0,h.p)(e=>null!=e),(0,rt.n)(e=>YS(this,void 0,void 0,function*(){yield this.themeStateService.setSelectedTheme(e)})),(0,c.pQ)(this.destroyRef)).subscribe(),this.form.controls.locale.valueChanges.pipe((0,rt.n)(e=>YS(this,void 0,void 0,function*(){yield this.i18nService.setLocale(e),window.location.reload()})),(0,c.pQ)(this.destroyRef)).subscribe()})}}qS.ɵfac=function(e){return new(e||qS)(B.rXU(a.ok),B.rXU(U.W),B.rXU($a.oO),B.rXU(kn.V),B.rXU(E.abz))},qS.ɵcmp=B.VBU({type:qS,selectors:[["app-appearance"]],decls:33,vars:20,consts:[[1,"tw-w-full","tw-max-w-md",3,"formGroup"],["formControlName","theme","id","theme"],[3,"value","label"],["bitLink","","href","https://bitwarden.com/help/localization/","target","_blank","rel","noreferrer","slot","end","startIcon","bwi-question-circle",1,"tw-float-right",3,"appA11yTitle"],["formControlName","locale","id","locale"],[1,"tw-flex","tw-items-start","tw-gap-1.5"],["type","checkbox","bitCheckbox","","formControlName","enableFavicons"],[1,"-tw-mt-0.5"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container")(2,"form",0)(3,"bit-form-field")(4,"bit-label"),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-select",1),B.Z7z(8,KS,1,2,"bit-option",2,LS),B.k0s(),B.j41(10,"bit-hint"),B.EFF(11),B.nI1(12,"i18n"),B.k0s()(),B.j41(13,"bit-form-field")(14,"bit-label"),B.EFF(15),B.nI1(16,"i18n"),B.nrm(17,"a",3),B.nI1(18,"i18n"),B.k0s(),B.j41(19,"bit-select",4),B.Z7z(20,XS,1,2,"bit-option",2,LS),B.k0s(),B.j41(22,"bit-hint"),B.EFF(23),B.nI1(24,"i18n"),B.k0s()(),B.j41(25,"div",5)(26,"bit-form-control"),B.nrm(27,"input",6),B.j41(28,"bit-label"),B.EFF(29),B.nI1(30,"i18n"),B.k0s()(),B.j41(31,"div",7),B.nrm(32,"vault-permit-cipher-details-popover"),B.k0s()()()()),2&e&&(B.R7$(2),B.Y8G("formGroup",t.form),B.R7$(3),B.JRh(B.bMT(6,8,"theme")),B.R7$(3),B.Dyx(t.themeOptions),B.R7$(3),B.JRh(B.bMT(12,10,"themeDesc")),B.R7$(4),B.SpI(" ",B.bMT(16,12,"language")," "),B.R7$(2),B.Y8G("appA11yTitle",B.mNQ(B.bMT(18,14,"learnMoreAboutLocalization"))),B.R7$(3),B.Dyx(t.localeOptions),B.R7$(3),B.JRh(B.bMT(24,16,"languageDesc")),B.R7$(6),B.SpI(" ",B.bMT(30,18,"showIconsChangePasswordUrls")," "))},dependencies:[oh.G,a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,Kv.C,jv.P,Cg.H,Nv.f,tu.j,iu.I,ru.h,$d.g,cg.w,dg.P,yg.G,wg.f,xd.tW,au.$],encapsulation:2,changeDetection:0});class HS{}var WS=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $S=e=>({"table-list-strike":e});function JS(e,t){1&e&&(B.j41(0,"p",1),B.nrm(1,"i",10),B.nI1(2,"i18n"),B.j41(3,"span",11),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function ZS(e,t){if(1&e){const e=B.RV6();B.j41(0,"div",16)(1,"bit-form-field",17)(2,"bit-label"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.nrm(5,"textarea",18),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"button",19),B.nI1(8,"i18n"),B.bIt("click",function(){const t=E.eBV(e).index,i=B.XpG(2);return E.Njj(i.remove(t))}),B.k0s()()}if(2&e){const e=t.$implicit,i=t.index;B.R7$(),B.Y8G("formGroupName",B.mNQ(i)),B.R7$(2),B.SpI("",B.i5U(4,8,"customDomainX",i+1)," "),B.R7$(2),B.Y8G("placeholder",B.VkB("",B.bMT(6,11,"ex")," google.com, gmail.com"))("value",e),B.R7$(2),B.Y8G("label",B.mNQ(B.bMT(8,13,"remove")))}}function _S(e,t){if(1&e){const e=B.RV6();B.qex(0,12),B.DNE(1,ZS,9,15,"div",13),B.j41(2,"button",14),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.add())}),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"small",15),B.EFF(6),B.nI1(7,"i18n"),B.k0s(),B.bVm()}if(2&e){const e=B.XpG();B.R7$(),B.Y8G("ngForOf",e.custom)("ngForTrackBy",e.indexTrackBy),B.R7$(2),B.SpI(" ",B.bMT(4,4,"newCustomDomain")," "),B.R7$(3),B.JRh(B.bMT(7,6,"newCustomDomainDesc"))}}function eQ(e,t){1&e&&(B.j41(0,"p",1),B.nrm(1,"i",10),B.nI1(2,"i18n"),B.j41(3,"span",11),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function tQ(e,t){if(1&e){const e=B.RV6();B.j41(0,"a",27),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.toggleExcluded(t))}),B.nrm(1,"i",29),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"exclude")," "))}function iQ(e,t){if(1&e){const e=B.RV6();B.j41(0,"a",27),B.bIt("click",function(){E.eBV(e);const t=B.XpG().$implicit,i=B.XpG(3);return E.Njj(i.toggleExcluded(t))}),B.nrm(1,"i",30),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"include")," "))}function nQ(e,t){if(1&e){const e=B.RV6();B.j41(0,"tr",22)(1,"td",23),B.EFF(2),B.k0s(),B.j41(3,"td",24),B.nrm(4,"button",25),B.nI1(5,"i18n"),B.j41(6,"bit-menu",null,0),B.DNE(8,tQ,4,3,"a",26)(9,iQ,4,3,"a",26),B.j41(10,"a",27),B.bIt("click",function(){const t=E.eBV(e).$implicit,i=B.XpG(3);return E.Njj(i.customize(t))}),B.nrm(11,"i",28),B.EFF(12),B.nI1(13,"i18n"),B.k0s()()()()}if(2&e){const e=t.$implicit,i=B.sdS(7);B.R7$(),B.Y8G("ngClass",B.eq3(11,$S,e.excluded)),B.R7$(),B.JRh(e.domains),B.R7$(2),B.Y8G("bitMenuTriggerFor",i)("label",B.bMT(5,7,"editDomain")),B.R7$(4),B.Y8G("ngIf",!e.excluded),B.R7$(),B.Y8G("ngIf",e.excluded),B.R7$(3),B.SpI(" ",B.bMT(13,9,"customize")," ")}}function rQ(e,t){if(1&e&&B.DNE(0,nQ,14,13,"tr",21),2&e){const e=B.XpG(2);B.Y8G("ngForOf",e.global)}}function sQ(e,t){1&e&&(B.j41(0,"bit-table"),B.DNE(1,rQ,1,1,"ng-template",20),B.k0s())}class oQ{constructor(e,t,i,n,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=n,this.formBuilder=r,this.loading=!0,this.custom=[],this.global=[],this.formGroup=this.formBuilder.group({customDomain:this.formBuilder.array([])}),this.submit=()=>WS(this,void 0,void 0,function*(){const e=this.formGroup.get("customDomain").value;this.custom=e.map(e=>e.domain);const t=new HS;t.excludedGlobalEquivalentDomains=this.global.filter(e=>e.excluded).map(e=>e.key),0===t.excludedGlobalEquivalentDomains.length&&(t.excludedGlobalEquivalentDomains=null),t.equivalentDomains=this.custom.filter(e=>null!=e&&""!==e.trim()).map(e=>e.split(",").map(e=>e.trim())),0===t.equivalentDomains.length&&(t.equivalentDomains=null),yield this.apiService.putSettingsDomains(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("domainsUpdated"))})}ngOnInit(){return WS(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}))),this.patch()})}patch(){const e=this.formGroup.get("customDomain");e.clear(),this.custom.forEach((t,i)=>{e.insert(i,this.patchValues(t))}),this.formGroup.updateValueAndValidity()}patchValues(e){return this.formBuilder.group({domain:[e]})}toggleExcluded(e){e.excluded=!e.excluded}customize(e){e.excluded=!0,this.custom.push(e.domains),this.patch()}remove(e){this.custom.splice(e,1),this.patch()}add(){this.custom.push(""),this.patch()}indexTrackBy(e,t){return e}}oQ.ɵfac=function(e){return new(e||oQ)(B.rXU(de.G),B.rXU(U.W),B.rXU(V.y),B.rXU(Vs.K),B.rXU(a.ok))},oQ.ɵcmp=B.VBU({type:oQ,selectors:[["app-domain-rules"]],decls:22,vars:21,consts:[["appListDropdown",""],["bitTypography","body1"],[3,"formGroup","bitSubmit"],["bitTypography","h2"],["bitTypography","body1",4,"ngIf"],["formArrayName","customDomain",4,"ngIf"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["bitTypography","h2",1,"tw-mt-16"],[4,"ngIf"],["type","submit","bitButton","","buttonType","primary"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["formArrayName","customDomain"],["class","tw-flex tw-items-center tw-gap-2 tw-mb-6",4,"ngFor","ngForOf","ngForTrackBy"],["bitButton","","type","button","buttonType","secondary","startIcon","bwi-plus",1,"tw-mb-2",3,"click"],[1,"tw-text-muted","tw-block","tw-mb-3"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-6"],[1,"tw-flex-1","!tw-mb-0",3,"formGroupName"],["rows","2","bitInput","","formControlName","domain",3,"value","placeholder"],["bitIconButton","bwi-minus-circle","type","button","buttonType","dangerGhost",3,"click","label"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",3,"ngClass"],["bitCell",""],["type","button","bitIconButton","bwi-ellipsis-v",1,"tw-border-0","tw-bg-transparent","tw-p-0",3,"bitMenuTriggerFor","label"],["href","#","bitMenuItem","","appStopClick","",3,"click",4,"ngIf"],["href","#","bitMenuItem","","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-minus-circle"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-plus-circle"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container")(2,"p",1),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"form",2)(6,"h2",3),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.DNE(9,JS,6,7,"p",4)(10,_S,8,8,"ng-container",5),B.j41(11,"button",6),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"h2",7),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.DNE(17,eQ,6,7,"p",4)(18,sQ,2,0,"bit-table",8),B.j41(19,"button",9),B.EFF(20),B.nI1(21,"i18n"),B.k0s()()()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,11,"domainRulesDesc")),B.R7$(2),B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(2),B.JRh(B.bMT(8,13,"customEqDomains")),B.R7$(2),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",!t.loading),B.R7$(2),B.SpI(" ",B.bMT(13,15,"save")," "),B.R7$(3),B.JRh(B.bMT(16,17,"globalEqDomains")),B.R7$(2),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf",!t.loading&&t.global.length>0),B.R7$(2),B.SpI(" ",B.bMT(21,19,"save")," "))},dependencies:[oh.G,H.YU,H.Sq,H.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,a.$R,a.v8,iv.Y,_d.$,eu.L,Jd.Q,Cg.H,tu.j,nu.J,ru.h,Zd.s,cf.Z,df.O,uf.S,Af.Q,pf.Y,gf._,gf.O,MA.r,yg.G,wg.f,au.$],encapsulation:2});var aQ=i(286);class lQ{constructor(e){this.dialogService=e,this.openHistoryDialog=()=>{this.dialogService.open(Ku.gA)}}}lQ.ɵfac=function(e){return new(e||lQ)(B.rXU(R.o3))},lQ.ɵcmp=B.VBU({type:lQ,selectors:[["credential-generator"]],decls:6,vars:3,consts:[["bitLink","","type","button","linkType","primary","aria-haspopup","dialog",3,"click"]],template:function(e,t){1&e&&(B.nrm(0,"app-header"),B.j41(1,"bit-container"),B.nrm(2,"tools-credential-generator"),B.j41(3,"button",0),B.bIt("click",function(){return t.openHistoryDialog()}),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(4),B.SpI(" ",B.bMT(5,1,"generatorHistory")," "))},dependencies:[oh.G,Cg.H,$d.g,yg.G,wg.f,Ku.Im,aQ.y,Yd.t,zd.V,au.$],encapsulation:2});class cQ{constructor(){}}cQ.ɵfac=function(e){return new(e||cQ)},cQ.ɵcmp=B.VBU({type:cQ,selectors:[["app-send-access-explainer"]],decls:2,vars:0,consts:[[1,"tw-text-center","tw-text-muted"],["bitTypography","body2",1,"tw-mb-0"]],template:function(e,t){1&e&&(B.j41(0,"div",0),B.nrm(1,"p",1),B.k0s())},dependencies:[oh.G,MA.r],encapsulation:2});const dQ=Object.freeze({All:"all",Text:"text",File:"file"});var uQ=i(92697),hQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class AQ{get dialogTitle(){return this.send.type===ja.Text?"newTextSend":"newFileSend"}constructor(e,t,i,n,r){this.send=e,this.environmentService=t,this.i18nService=i,this.platformUtilsService=n,this.toastService=r,this.AuthType=fI,this.sendLink=(0,E.vPA)(""),this.activeSendIcon=sp,this.initLink()}initLink(){return hQ(this,void 0,void 0,function*(){const e=yield(0,u._)(this.environmentService.environment$);this.sendLink.set(e.getSendUrl()+this.send.accessId+"/"+this.send.urlB64Key)})}get formattedExpirationTime(){if(!this.send.deletionDate)return"";const e=this.getHoursAvailable(this.send);if(e<24)return 1===e?this.i18nService.t("oneHour").toLowerCase():this.i18nService.t("durationTimeHours",String(e)).toLowerCase();const t=Math.ceil(e/24);return 1===t?this.i18nService.t("oneDay").toLowerCase():this.i18nService.t("days",String(t)).toLowerCase()}getHoursAvailable(e){const t=(new Date).getTime(),i=new Date(e.deletionDate).getTime();return Math.max(0,Math.ceil((i-t)/36e5))}copyLink(){const e=this.sendLink();e&&(this.platformUtilsService.copyToClipboard(e),this.toastService.showToast({variant:"success",message:this.i18nService.t("valueCopied",this.i18nService.t("sendLink"))}))}}AQ.ɵfac=function(e){return new(e||AQ)(B.rXU(_g.Qs),B.rXU(Gs.v),B.rXU(U.W),B.rXU(V.y),B.rXU(P.f))},AQ.ɵcmp=B.VBU({type:AQ,selectors:[["ng-component"]],decls:30,vars:24,consts:[["dialogSize","large","disablePadding","false","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-text-center","tw-h-full","tw-px-4","tw-pt-20"],[1,"tw-mb-6","tw-mt-8"],[1,"tw-size-[95px]","tw-content-center"],[3,"content"],["bitTypography","h3",1,"tw-mb-2","tw-font-bold"],["bitTypography","body1",1,"tw-mb-6","tw-max-w-sm"],[1,"tw-w-full","tw-max-w-sm","tw-mb-4"],["bitInput","","disabled","","type","text",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","",3,"click","label"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary",3,"click"],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-dialog",0),B.qex(1,1),B.j41(2,"span"),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.bVm(),B.qex(5,2),B.j41(6,"div",3)(7,"div",4)(8,"div",5),B.nrm(9,"bit-svg",6),B.k0s()(),B.j41(10,"h3",7),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"p",8),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.j41(16,"bit-form-field",9)(17,"bit-label"),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.nrm(20,"input",10),B.j41(21,"button",11),B.nI1(22,"i18n"),B.bIt("click",function(){return E.eBV(e),E.Njj(t.copyLink())}),B.k0s()()(),B.bVm(),B.qex(23,12),B.j41(24,"button",13),B.bIt("click",function(){return E.eBV(e),E.Njj(t.copyLink())}),B.EFF(25),B.nI1(26,"i18n"),B.k0s(),B.j41(27,"button",14),B.EFF(28),B.nI1(29,"i18n"),B.k0s(),B.bVm(),B.k0s()}if(2&e){B.R7$(3),B.JRh(B.bMT(4,9,t.dialogTitle)),B.R7$(6),B.Y8G("content",t.activeSendIcon),B.R7$(2),B.SpI(" ",B.bMT(12,11,"sendCreatedSuccessfully")," ");const e=t.send.authType===t.AuthType.Email?"sendCreatedDescriptionEmail":t.send.authType===t.AuthType.Password?"sendCreatedDescriptionPassword":"sendCreatedDescriptionV2";B.R7$(3),B.SpI(" ",B.i5U(15,13,e,t.formattedExpirationTime)," "),B.R7$(4),B.JRh(B.bMT(19,16,"sendLink")),B.R7$(2),B.Y8G("value",t.sendLink()),B.R7$(),B.Y8G("label",B.bMT(22,18,"copyLink")),B.R7$(4),B.SpI(" ",B.bMT(26,20,"copyLink")," "),B.R7$(3),B.SpI(" ",B.bMT(29,22,"close")," ")}},dependencies:[oh.G,Jd.Q,qd.I,Hd.m,Wd.hJ,tu.j,nu.J,ru.h,ou.a,Zd.s,gp.k,MA.r,Nd.P,DA.E,au.$],encapsulation:2,changeDetection:0});var pQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function gQ(e,t){1&e&&B.nrm(0,"bit-icon",2)}class vQ{constructor(e,t,i,n,r){this.billingAccountProfileStateService=e,this.accountService=t,this.dialogService=i,this.addEditFormConfigService=n,this.configService=r,this.hideIcon=!1,this.sendType=ja,this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,rt.n)(e=>e?this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id):(0,Ii.of)(!1)))}createSend(e){return pQ(this,void 0,void 0,function*(){if(!(yield(0,u._)(this.canAccessPremium$))&&e===ja.File)return;const t=yield this.addEditFormConfigService.buildConfig("add",void 0,e);if(yield this.configService.getFeatureFlag(dr.TO.SendUIRefresh)){const e=Bb.openDrawer(this.dialogService,{formConfig:t});if(e){const t=yield(0,sg.s)(e.closed);(null==t?void 0:t.result)===bb.Saved&&(null==t?void 0:t.send)&&this.dialogService.openDrawer(AQ,{data:t.send})}}else Bb.open(this.dialogService,{formConfig:t})})}}vQ.ɵfac=function(e){return new(e||vQ)(B.rXU(Rn.Q),B.rXU(Y.D),B.rXU(R.o3),B.rXU(lb),B.rXU(z.w))},vQ.ɵcmp=B.VBU({type:vQ,selectors:[["tools-new-send-dropdown"]],inputs:{hideIcon:"hideIcon"},features:[B.Jv_([lb])],decls:16,vars:11,consts:[["itemOptions",""],["bitButton","","buttonType","primary","type","button",3,"bitMenuTriggerFor"],["name","bwi-plus","slot","start",1,"tw-me-2"],["type","button","bitMenuItem","",3,"click"],["name","bwi-file-text","slot","start"],["name","bwi-file","slot","start"],[1,"tw-flex","tw-items-center","tw-gap-2"]],template:function(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",1),B.nVh(1,gQ,1,0,"bit-icon",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"bit-menu",null,0)(6,"button",3),B.bIt("click",function(){return E.eBV(e),E.Njj(t.createSend(t.sendType.Text))}),B.nrm(7,"bit-icon",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"button",3),B.bIt("click",function(){return E.eBV(e),E.Njj(t.createSend(t.sendType.File))}),B.nrm(11,"bit-icon",5),B.j41(12,"div",6),B.EFF(13),B.nI1(14,"i18n"),B.nrm(15,"app-premium-badge"),B.k0s()()()}if(2&e){const e=B.sdS(5);B.Y8G("bitMenuTriggerFor",e),B.R7$(),B.vxM(t.hideIcon?-1:1),B.R7$(),B.SpI(" ",B.bMT(3,5,t.hideIcon?"createSend":"new"),"\n"),B.R7$(6),B.SpI(" ",B.bMT(9,7,"sendTypeText")," "),B.R7$(5),B.SpI(" ",B.bMT(14,9,"sendTypeFile")," ")}},dependencies:[jd.p,Yd.t,Jd.Q,CC.M,cf.Z,df.O,uf.S,Ov.a,LA.R,au.$],encapsulation:2});var fQ=i(12694),mQ=i(16496),yQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function CQ(e,t){1&e&&B.nrm(0,"tools-new-send-dropdown")}function wQ(e,t){1&e&&(B.j41(0,"bit-callout",0),B.nI1(1,"i18n"),B.EFF(2),B.nI1(3,"i18n"),B.k0s()),2&e&&(B.Y8G("title",B.mNQ(B.bMT(1,3,"sendDisabled"))),B.R7$(2),B.SpI(" ",B.bMT(3,5,"sendDisabledWarning")," "))}function IQ(e,t){1&e&&B.nrm(0,"tools-new-send-dropdown",6),2&e&&B.Y8G("hideIcon",!0)}function bQ(e,t){if(1&e){const e=B.RV6();B.j41(0,"div")(1,"tools-send-list",2),B.bIt("editSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.editSend(t))})("copySend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onCopySend(t))})("deleteSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.deleteSend(t))})("removePassword",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onRemovePassword(t))}),B.j41(2,"div",3)(3,"bit-toggle-group",4),B.bIt("selectedChange",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onToggleChange(t))}),B.j41(4,"bit-toggle",5),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"bit-toggle",5),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"bit-toggle",5),B.EFF(11),B.nI1(12,"i18n"),B.k0s()()(),B.nVh(13,IQ,1,1,"tools-new-send-dropdown",6),B.k0s()()}if(2&e){const e=B.XpG();B.R7$(),B.Y8G("sends",e.filteredSends())("loading",e.loading())("disableSend",e.disableSend())("listState",e.listState())("searchText",e.currentSearchText()),B.R7$(2),B.Y8G("selected",e.selectedToggleValue),B.R7$(),B.Y8G("value","all"),B.R7$(),B.JRh(B.bMT(6,13,"allSends")),B.R7$(2),B.Y8G("value","text"),B.R7$(),B.JRh(B.bMT(9,15,"sendTypeText")),B.R7$(2),B.Y8G("value","file"),B.R7$(),B.JRh(B.bMT(12,17,"sendTypeFile")),B.R7$(2),B.vxM(e.disableSend()?-1:13)}}function BQ(e,t){1&e&&B.nrm(0,"tools-new-send-dropdown",6),2&e&&B.Y8G("hideIcon",!0)}function EQ(e,t){if(1&e){const e=B.RV6();B.j41(0,"div",1)(1,"div",7)(2,"div",8)(3,"div",9),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"div",10)(7,"div",11)(8,"bit-search",12),B.nI1(9,"i18n"),B.bIt("ngModelChange",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.searchTextChanged(t))}),B.k0s()(),B.j41(10,"div",13)(11,"ul",14)(12,"li",15)(13,"span",16)(14,"button",17),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onToggleChange(t.SendFilterType.All))}),B.nrm(15,"bit-icon",18),B.EFF(16),B.nI1(17,"i18n"),B.k0s()()()()(),B.j41(18,"div",13)(19,"div",19)(20,"h3"),B.EFF(21),B.nI1(22,"i18n"),B.k0s()(),B.j41(23,"ul",14)(24,"li",15)(25,"span",16)(26,"button",17),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onToggleChange(t.SendFilterType.Text))}),B.nrm(27,"bit-icon",20),B.EFF(28),B.nI1(29,"i18n"),B.k0s()()(),B.j41(30,"li",15)(31,"span",16)(32,"button",17),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onToggleChange(t.SendFilterType.File))}),B.nrm(33,"bit-icon",21),B.EFF(34),B.nI1(35,"i18n"),B.k0s()()()()()()()(),B.j41(36,"div",22)(37,"tools-send-list",23),B.bIt("editSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.editSend(t))})("copySend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onCopySend(t))})("deleteSend",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.deleteSend(t))})("removePassword",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.onRemovePassword(t))}),B.nVh(38,BQ,1,1,"tools-new-send-dropdown",6),B.k0s()()()}if(2&e){const e=B.XpG();B.R7$(4),B.SpI(" ",B.bMT(5,20,"filters")," "),B.R7$(4),B.Y8G("ngModel",e.currentSearchText())("placeholder",B.bMT(9,22,"searchSends")),B.R7$(4),B.AVh("active",e.selectedToggleValue===e.SendFilterType.All),B.R7$(4),B.SpI("",B.bMT(17,24,"allSends")," "),B.R7$(5),B.JRh(B.bMT(22,26,"types")),B.R7$(3),B.AVh("active",e.selectedToggleValue===e.SendFilterType.Text),B.R7$(4),B.SpI("",B.bMT(29,28,"sendTypeText")," "),B.R7$(2),B.AVh("active",e.selectedToggleValue===e.SendFilterType.File),B.R7$(4),B.SpI("",B.bMT(35,30,"sendTypeFile")," "),B.R7$(3),B.Y8G("sends",e.filteredSends())("loading",e.loading())("disableSend",e.disableSend())("listState",e.listState())("searchText",e.currentSearchText())("hideSearchBar",!0),B.R7$(),B.vxM(e.disableSend()?-1:38)}}class SQ{constructor(e,t,i,n,r,s,o,a,l,d,u,h,A,g,v,f){this.i18nService=e,this.platformUtilsService=t,this.environmentService=i,this.policyService=n,this.logService=r,this.sendApiService=s,this.dialogService=o,this.toastService=a,this.addEditFormConfigService=l,this.accountService=d,this.route=u,this.router=h,this.configService=A,this.sendItemsService=g,this.sendItemsFiltersService=v,this.validationService=f,this.filteredSends=(0,c.ot)(this.sendItemsService.filteredAndSortedSends$,{initialValue:[]}),this.disableSend=(0,c.ot)(this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.policyAppliesToUser$(mt.tt.DisableSend,e))),{initialValue:!1}),this.loading=(0,c.ot)(this.sendItemsService.loading$,{initialValue:!0}),this.listState=(0,c.ot)((0,bi.z)([this.sendItemsService.emptyList$,this.sendItemsService.noFilteredResults$]).pipe((0,p.T)(([e,t])=>e?vB.Empty:t?vB.NoResults:null)),{initialValue:null}),this.currentSearchText=(0,c.ot)(this.sendItemsService.latestSearchText$,{initialValue:""}),this.SendFilterType=dQ,this.SendType=ja,this.SendUIRefresh$=this.configService.getFeatureFlag$(dr.TO.SendUIRefresh),this.route.queryParamMap.pipe((0,c.pQ)()).subscribe(e=>{const t=e.get("type");let i=dQ.All,n=null;t===dQ.Text&&(i=dQ.Text,n=ja.Text),t===dQ.File&&(i=dQ.File,n=ja.File),this.selectedToggleValue=i,this.sendItemsFiltersService.filterForm.patchValue({sendType:n})})}ngOnDestroy(){this.dialogService.closeAll(),this.dialogService.closeDrawer()}addSend(){return yQ(this,void 0,void 0,function*(){if(this.disableSend())return;const e=yield this.addEditFormConfigService.buildConfig("add",null,ja.Text);yield this.openSendItemDialog(e)})}editSend(e){return yQ(this,void 0,void 0,function*(){const t=yield this.addEditFormConfigService.buildConfig(null==e?"add":"edit",null==e?null:e.id,e.type);yield this.openSendItemDialog(t)})}openSendItemDialog(e){return yQ(this,void 0,void 0,function*(){const t=yield this.configService.getFeatureFlag(dr.TO.SendUIRefresh);if(this.sendItemDialogRef&&!t)return;this.sendItemDialogRef=t?Bb.openDrawer(this.dialogService,{formConfig:e}):Bb.open(this.dialogService,{formConfig:e});const i=yield(0,sg.s)(this.sendItemDialogRef.closed);this.sendItemDialogRef=void 0,(null==i?void 0:i.result)===bb.Saved&&(null==i?void 0:i.send)&&(yield this.configService.getFeatureFlag(dr.TO.SendUIRefresh))&&this.dialogService.openDrawer(AQ,{data:i.send})})}onToggleChange(e){const t=e===dQ.All?{type:null}:{type:e};this.router.navigate([],{relativeTo:this.route,queryParams:t,queryParamsHandling:"merge"}).catch(e=>{this.logService.error("Failed to update route query params:",e)})}deleteSend(e){return yQ(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendConfirmation"},type:"warning"})))return!1;try{yield this.sendApiService.delete(e.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")})}catch(t){return this.validationService.showError(t),this.logService.error(t),!1}return!0})}onRemovePassword(e){return yQ(this,void 0,void 0,function*(){if(this.disableSend())return;if(yield this.dialogService.openSimpleDialog({title:{key:"removePassword"},content:{key:"removePasswordConfirmation"},type:"warning"}))try{yield this.sendApiService.removePassword(e.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedPassword")})}catch(t){this.validationService.showError(t),this.logService.error(t)}})}onCopySend(e){return yQ(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id))),i=(yield(0,u._)(this.environmentService.getEnvironment$(t))).getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(i),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t("sendLink"))})})}searchTextChanged(e){this.sendItemsService.applyFilter(e)}}SQ.ɵfac=function(e){return new(e||SQ)(B.rXU(U.W),B.rXU(V.y),B.rXU(Gs.v),B.rXU(me.m),B.rXU(Vs.K),B.rXU(Xl),B.rXU(R.o3),B.rXU(P.f),B.rXU(lb),B.rXU(Y.D),B.rXU(F.nX),B.rXU(F.Ix),B.rXU(z.w),B.rXU(Gb),B.rXU(Ob),B.rXU(Xs.B))},SQ.ɵcmp=B.VBU({type:SQ,selectors:[["app-send"]],features:[B.Jv_([lb])],decls:6,vars:5,consts:[["type","warning",3,"title"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[3,"editSend","copySend","deleteSend","removePassword","sends","loading","disableSend","listState","searchText"],["slot","filters",1,"tw-mt-4"],[3,"selectedChange","selected"],[3,"value"],["slot","empty-button",3,"hideIcon"],[1,"tw-col-span-3"],["data-testid","filters",1,"tw-border","tw-border-solid","tw-border-secondary-300","tw-rounded"],["data-testid","filters-header",1,"tw-bg-background-alt","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100","tw-rounded-t","tw-px-5","tw-py-2.5","tw-font-medium","tw-uppercase"],["data-testid","filters-body",1,"tw-p-5"],[1,"tw-mb-4"],["appAutofocus","",3,"ngModelChange","ngModel","placeholder"],[1,"filter"],[1,"filter-options"],[1,"filter-option"],[1,"filter-buttons"],["type","button","appStopClick","",1,"filter-button",3,"click"],["name","bwi-grid","fixedWidth",""],[1,"filter-heading"],["name","bwi-file-text","fixedWidth",""],["name","bwi-file","fixedWidth",""],[1,"tw-col-span-9"],[3,"editSend","copySend","deleteSend","removePassword","sends","loading","disableSend","listState","searchText","hideSearchBar"]],template:function(e,t){1&e&&(B.j41(0,"app-header"),B.nVh(1,CQ,1,0,"tools-new-send-dropdown"),B.k0s(),B.nVh(2,wQ,4,7,"bit-callout",0),B.nVh(3,bQ,14,19,"div"),B.nI1(4,"async"),B.vZN(5,EQ,39,32,"div",1)),2&e&&(B.R7$(),B.vxM(t.disableSend()?-1:1),B.R7$(),B.vxM(t.disableSend()?2:-1),B.R7$(),B.vxM(B.bMT(4,3,t.SendUIRefresh$)?3:5))},dependencies:[a.YN,a.BC,a.vS,gb.t,Ub.S,aB.s,yg.G,wg.f,vQ,uQ.E,fQ.H,mQ.a,fB,zA.G,LA.R,H.Jj,Zu.$Z],encapsulation:2});const QQ={HasBwInstalled:"hasBwInstalled",checkBwInstalled:"checkIfBWExtensionInstalled",OpenAtRiskPasswords:"openAtRiskPasswords",OpenBrowserExtensionToUrl:"openBrowserExtensionToUrl",PopupOpened:"popupOpened"};var kQ=i(56986),TQ=i(25479),FQ=i(61687);class PQ{constructor(){this.destroyRef=(0,E.WQX)(E.abz),this.messages$=(0,gu.R)(window,"message").pipe((0,c.pQ)(this.destroyRef)),this.extensionInstalled$=this.checkForExtension().pipe((0,rt.n)(e=>e?(0,Ii.of)(!0):(0,kQ.x)((0,Ii.of)(!1),(0,TQ.Y)(2500).pipe((0,rt.n)(()=>this.checkForExtension()),(0,sa.v)(e=>!e,!0),(0,h.p)(e=>e)))),(0,Bi.t)({bufferSize:1,refCount:!0})),this.openExtension=e=>new Promise((t,i)=>{(0,FQ.O)(this.messages$.pipe((0,h.p)(e=>e.data.command===QQ.PopupOpened),(0,p.T)(()=>!0)),(0,la.O)(2e3).pipe((0,p.T)(()=>!1))).pipe((0,Ai.s)(1)).subscribe(e=>{if(!e)return i("Failed to open the extension");t()}),window.postMessage({command:QQ.OpenBrowserExtensionToUrl,url:e})})}checkForExtension(){return(0,FQ.O)(this.messages$.pipe((0,h.p)(e=>e.data.command===QQ.HasBwInstalled),(0,p.T)(()=>!0)),(0,la.O)(25).pipe((0,p.T)(()=>!1))).pipe((0,M.M)({subscribe:()=>{window.postMessage({command:QQ.checkBwInstalled})}}),(0,Ai.s)(1))}}PQ.ɵfac=function(e){return new(e||PQ)},PQ.ɵprov=E.jDH({token:PQ,factory:PQ.ɵfac,providedIn:"root"});var RQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const DQ={Loading:"loading",Error:"error",Success:"success",ManualOpen:"manualOpen",MobileBrowser:"mobileBrowser"};class MQ{constructor(e,t,i){this.anonLayoutWrapperDataService=e,this.destroyRef=t,this.webBrowserInteractionService=i,this._pageState$=new _e.t(DQ.Loading),this.pageState$=this._pageState$.asObservable()}start(){at.A.isMobileBrowser&&this.setMobileState()}registerPopupUrl(e){this.checkForBrowserExtension(e)}openExtension(e){return RQ(this,arguments,void 0,function*(e,t=!1){e==QQ.OpenAtRiskPasswords?window.postMessage({command:e}):yield this.webBrowserInteractionService.openExtension(mc.XS[e]),t&&(this.clearExtensionCheckTimeout(),this.extensionCheckTimeout=window.setTimeout(()=>{this.setErrorState(DQ.ManualOpen)},1500))})}checkForBrowserExtension(e){(0,gu.R)(window,"message").pipe((0,c.pQ)(this.destroyRef)).subscribe(t=>{this.getMessages(t,e)}),window.postMessage({command:QQ.checkBwInstalled}),this.extensionCheckTimeout=window.setTimeout(()=>{this.setErrorState()},1e3)}getMessages(e,t){return RQ(this,void 0,void 0,function*(){e.data.command===QQ.HasBwInstalled&&(yield this.openExtension(t)),e.data.command===QQ.PopupOpened&&this.setSuccessState()})}setMobileState(){this.clearExtensionCheckTimeout(),this._pageState$.next(DQ.MobileBrowser),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"desktopRequired"}})}setSuccessState(){this.clearExtensionCheckTimeout(),this._pageState$.next(DQ.Success),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"openedExtension"}})}setErrorState(e){this.clearExtensionCheckTimeout(),this._pageState$.next(null!=e?e:DQ.Error),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"somethingWentWrong"}})}clearExtensionCheckTimeout(){window.clearTimeout(this.extensionCheckTimeout),this.extensionCheckTimeout=void 0}}function xQ(e,t){if(1&e&&(B.j41(0,"div",1)(1,"p",2),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"a",3),B.EFF(5),B.nI1(6,"i18n"),B.k0s()()),2&e){const e=B.XpG();B.R7$(2),B.JRh(B.bMT(3,3,"doNotHaveExtension")),B.R7$(2),B.Y8G("href",e.webStoreUrl,B.B4B),B.R7$(),B.SpI(" ",B.bMT(6,5,"installExtension")," ")}}MQ.ɵfac=function(e){return new(e||MQ)(E.KVO(Fd.f),E.KVO(E.abz),E.KVO(PQ))},MQ.ɵprov=E.jDH({token:MQ,factory:MQ.ɵfac,providedIn:"root"});const OQ={[st.bq.ChromeBrowser]:"https://chrome.google.com/webstore/detail/bitwarden-password-manage/nngceckbapebfimnlniiiahkandclblb",[st.bq.FirefoxBrowser]:"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/",[st.bq.SafariBrowser]:"https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12",[st.bq.OperaBrowser]:"https://addons.opera.com/extensions/details/bitwarden-free-password-manager/",[st.bq.EdgeBrowser]:"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh"};class GQ{constructor(e,t){this.browserExtensionPromptService=e,this.platformService=t,this.shouldShow$=this.browserExtensionPromptService.pageState$.pipe((0,p.T)(e=>e===DQ.Error||e===DQ.ManualOpen)),this.BrowserPromptState=DQ,this.webStoreUrl="https://bitwarden.com/download/#downloads-web-browser"}ngOnInit(){this.setBrowserStoreLink()}setBrowserStoreLink(){const e=this.platformService.getDevice(),t=OQ[e];t&&(this.webStoreUrl=t)}}GQ.ɵfac=function(e){return new(e||GQ)(B.rXU(MQ),B.rXU(V.y))},GQ.ɵcmp=B.VBU({type:GQ,selectors:[["vault-browser-extension-prompt-install"]],decls:2,vars:3,consts:[["class","tw-text-center",4,"ngIf"],[1,"tw-text-center"],[1,"tw-mb-0"],["bitLink","","target","_blank","rel","noreferrer",3,"href"]],template:function(e,t){1&e&&(B.DNE(0,xQ,7,7,"div",0),B.nI1(1,"async")),2&e&&B.Y8G("ngIf",B.bMT(1,1,t.shouldShow$))},dependencies:[H.MD,H.bT,zd.V,$d.g,H.Jj,Zu.$Z],encapsulation:2});const UQ=VA.JW`
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g clip-path="url(#clip0_11934_25684)">
    <path d="M17.3333 0H2.66667C1.19391 0 0 1.19391 0 2.66667V17.3333C0 18.8061 1.19391 20 2.66667 20H17.3333C18.8061 20 20 18.8061 20 17.3333V2.66667C20 1.19391 18.8061 0 17.3333 0Z" class="tw-fill-bw-blue" />
      <mask id="mask0_11934_25684" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="3" width="14" height="14">
      <path d="M17 3H3V17H17V3Z" class="tw-fill-text-alt2"/>
    </mask>
    <g mask="url(#mask0_11934_25684)">
      <path d="M15.6599 3.17501C15.607 3.11944 15.5435 3.07526 15.4731 3.04507C15.4027 3.01489 15.327 2.99958 15.2504 3.00001H4.75052C4.67396 2.99958 4.59784 3.01489 4.5274 3.04507C4.45696 3.07526 4.39352 3.11944 4.34102 3.17501C4.28546 3.22751 4.24127 3.29138 4.21109 3.36182C4.1809 3.43226 4.16559 3.50794 4.16602 3.58451V10.5844C4.16821 11.1173 4.27146 11.6449 4.47052 12.1393C4.65996 12.6271 4.91458 13.0874 5.22739 13.5069C5.54895 13.9274 5.90901 14.3163 6.30276 14.6698C6.66807 15.0049 7.05306 15.3186 7.4551 15.6086C7.8051 15.8571 8.1726 16.0925 8.5576 16.3148C8.9426 16.537 9.21431 16.6871 9.3731 16.7654C9.53322 16.8441 9.66272 16.9063 9.75897 16.9474C9.83422 16.9837 9.91694 17.0016 10.0005 16.9999C10.0827 17.0012 10.1641 16.982 10.2376 16.9448C10.3356 16.9019 10.4633 16.8415 10.6252 16.7628C10.7871 16.684 11.0627 16.5335 11.4407 16.3121C11.8187 16.0908 12.1906 15.8545 12.5432 15.606C12.9457 15.3155 13.3311 15.0023 13.6973 14.6671C14.0915 14.3141 14.4515 13.9247 14.7727 13.5043C15.085 13.0843 15.3397 12.6245 15.5295 12.1367C15.729 11.6423 15.8323 11.1147 15.834 10.5818V3.58188C15.8345 3.50576 15.8192 3.43051 15.789 3.36051C15.7588 3.29051 15.715 3.22751 15.6599 3.17501ZM14.3063 10.6483C14.3063 13.1858 10.0005 15.3654 10.0005 15.3654V4.49975H14.3063V10.6483Z" class="tw-fill-text-alt2"/>
    </g>
  </g>
  <defs>
    <clipPath id="clip0_11934_25684">
      <rect width="20" height="20" class="tw-fill-text-alt2"/>
    </clipPath>
  </defs>
</svg>
`;class VQ{constructor(){this.BitwardenIcon=UQ}}VQ.ɵfac=function(e){return new(e||VQ)},VQ.ɵcmp=B.VBU({type:VQ,selectors:[["vault-manually-open-extension"]],decls:6,vars:7,consts:[["bitTypography","body1",1,"tw-mb-0"],[1,"!tw-inline-block","[&>svg]:tw-align-baseline","[&>svg]:-tw-mb-[0.25rem]",3,"content"]],template:function(e,t){1&e&&(B.j41(0,"p",0),B.EFF(1),B.nI1(2,"i18n"),B.nrm(3,"bit-svg",1),B.EFF(4),B.nI1(5,"i18n"),B.k0s()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,3,"openExtensionFromToolbarPart1")," "),B.R7$(2),B.Y8G("content",t.BitwardenIcon),B.R7$(),B.SpI(" ",B.bMT(5,5,"openExtensionFromToolbarPart2"),"\n"))},dependencies:[RA.Z,gp.k,Zu.$Z],encapsulation:2,changeDetection:0});var jQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function NQ(e,t){1&e&&(B.qex(0),B.nrm(1,"i",3),B.j41(2,"p",4),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(3),B.JRh(B.bMT(4,1,"openingExtension")))}function zQ(e,t){if(1&e){const e=B.RV6();B.qex(0),B.j41(1,"p",5),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"button",6),B.bIt("click",function(){E.eBV(e),B.XpG();const t=B.r8f(2),i=B.XpG();return E.Njj(i.openExtension(t))}),B.EFF(5),B.nI1(6,"i18n"),B.nrm(7,"i",7),B.k0s(),B.bVm()}2&e&&(B.R7$(2),B.JRh(B.bMT(3,2,"openingExtensionError")),B.R7$(3),B.SpI(" ",B.bMT(6,4,"openExtension")," "))}function YQ(e,t){if(1&e&&(B.qex(0),B.nrm(1,"i",8),B.j41(2,"p",5),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.bVm()),2&e){B.XpG();const e=B.r8f(2),t=B.XpG();B.R7$(3),B.SpI(" ",B.bMT(4,1,t.pageToI18nKeyMap[e])," ")}}function LQ(e,t){1&e&&(B.qex(0),B.nrm(1,"vault-manually-open-extension"),B.bVm())}function KQ(e,t){1&e&&(B.qex(0),B.j41(1,"p",9),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.bVm()),2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"reopenLinkOnDesktop")," "))}function XQ(e,t){if(1&e&&(B.j41(0,"div",1),B.DNE(1,NQ,5,3,"ng-container",2),B.SS7(2),B.nI1(3,"async"),B.DNE(4,zQ,8,6,"ng-container",2)(5,YQ,5,3,"ng-container",2)(6,LQ,2,0,"ng-container",2)(7,KQ,4,3,"ng-container",2),B.k0s()),2&e){const e=t.ngIf,i=B.XpG();B.R7$(),B.Y8G("ngIf",e===i.BrowserPromptState.Loading),B.R7$(),B.bH3(B.bMT(3,5,i.extensionPage$)),B.R7$(2),B.Y8G("ngIf",e===i.BrowserPromptState.Error),B.R7$(),B.Y8G("ngIf",e===i.BrowserPromptState.Success),B.R7$(),B.Y8G("ngIf",e===i.BrowserPromptState.ManualOpen),B.R7$(),B.Y8G("ngIf",e===i.BrowserPromptState.MobileBrowser)}}class qQ{constructor(e,t,i){this.browserExtensionPromptService=e,this.route=t,this.document=i,this.VaultMessages=QQ,this.pageState$=this.browserExtensionPromptService.pageState$,this.BrowserPromptState=DQ,this.viewportContent=null,this.pageToI18nKeyMap={[QQ.OpenAtRiskPasswords]:"openedExtensionViewAtRiskPasswords",AutoConfirm:"autoConfirmExtensionOpened"},this.extensionPage$=(0,Ii.of)(QQ.OpenAtRiskPasswords),this.extensionPage$=this.route.queryParamMap.pipe((0,p.T)(e=>{var t;return null!==(t=e.get("url"))&&void 0!==t?t:QQ.OpenAtRiskPasswords})),this.extensionPage$.pipe((0,M.M)(e=>this.browserExtensionPromptService.registerPopupUrl(e)),(0,c.pQ)()).subscribe()}ngOnInit(){var e;this.browserExtensionPromptService.start(),this.document.body.style.minWidth="auto";const t=this.document.querySelector('meta[name="viewport"]');this.viewportContent=null!==(e=null==t?void 0:t.getAttribute("content"))&&void 0!==e?e:null,null==t||t.setAttribute("content","width=device-width, initial-scale=1.0")}ngOnDestroy(){var e;this.document.body.style.minWidth="",null!==this.viewportContent&&(null===(e=this.document.querySelector('meta[name="viewport"]'))||void 0===e||e.setAttribute("content",this.viewportContent))}openExtension(e){return jQ(this,void 0,void 0,function*(){yield this.browserExtensionPromptService.openExtension(e,!0)})}}qQ.ɵfac=function(e){return new(e||qQ)(B.rXU(MQ),B.rXU(F.nX),B.rXU(E.qQL))},qQ.ɵcmp=B.VBU({type:qQ,selectors:[["vault-browser-extension-prompt"]],decls:2,vars:3,consts:[["class","tw-text-center",4,"ngIf"],[1,"tw-text-center"],[4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-primary-600"],["bitTypography","body1",1,"tw-mb-0","tw-mt-2"],["bitTypography","body1",1,"tw-mb-4","tw-text-xl"],["bitButton","","buttonType","primary","type","button","id","bw-extension-prompt-button",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-2"],["aria-hidden","true",1,"bwi","tw-text-2xl","bwi-check-circle","tw-text-success-700"],["bitTypography","body1",1,"tw-mb-0","tw-text-xl"]],template:function(e,t){1&e&&(B.DNE(0,XQ,8,8,"div",0),B.nI1(1,"async")),2&e&&B.Y8G("ngIf",B.bMT(1,1,t.pageState$))},dependencies:[H.MD,H.bT,Jd.Q,RA.Z,VQ,H.Jj,Zu.$Z],encapsulation:2,changeDetection:0});const HQ=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.76 4 88.24 88.24">
    <path class="tw-fill-illustration-tertiary" d="M61.342 69.774 10.61 90.912a4.223 4.223 0 0 1-5.523-5.523l21.138-50.73a8 8 0 0 1 9.683-4.586l1.43.428a42 42 0 0 1 28.16 28.16l.428 1.43a8 8 0 0 1-4.585 9.683Z"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M29.603 82.999a87.777 87.777 0 0 1-8.85-7.751A87.763 87.763 0 0 1 13 66.397l.893-2.143a85.302 85.302 0 0 0 8.273 9.58c3.099 3.099 6.32 5.863 9.579 8.272l-2.143.893Zm-8.438 3.516a104.44 104.44 0 0 1-6.07-5.61 104.496 104.496 0 0 1-5.61-6.07l-.86 2.066a106.756 106.756 0 0 0 5.056 5.418 106.754 106.754 0 0 0 5.418 5.056l2.066-.86Zm19.768-8.237c-4.415-2.637-8.845-6.073-12.991-10.22-4.147-4.147-7.583-8.576-10.22-12.991l.967-2.321c2.625 4.678 6.212 9.443 10.667 13.898s9.22 8.042 13.898 10.667l-2.32.967Zm-17.882-36c1.659 6.049 5.736 12.863 11.772 18.899 6.036 6.036 12.85 10.113 18.9 11.772l3.242-1.351a23.334 23.334 0 0 1-3.26-.734c-5.523-1.644-11.815-5.448-17.468-11.101-5.653-5.654-9.458-11.945-11.101-17.469a23.344 23.344 0 0 1-.734-3.259l-1.351 3.243Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M52.657 43.343c8.2 8.201 12.316 17.382 9.192 20.506-3.124 3.124-12.305-.991-20.506-9.192-8.2-8.201-12.316-17.382-9.192-20.506 3.124-3.124 12.305.991 20.506 9.192Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.675 56.318c-1.54-3.437-4.459-7.587-8.432-11.56-3.974-3.974-8.124-6.892-11.561-8.433-1.726-.773-3.171-1.155-4.267-1.212-1.096-.057-1.61.212-1.85.452-.24.24-.51.754-.452 1.85.057 1.096.439 2.541 1.212 4.267 1.54 3.437 4.459 7.587 8.432 11.56 3.974 3.974 8.124 6.892 11.561 8.433 1.726.773 3.171 1.155 4.267 1.212 1.096.057 1.61-.212 1.85-.452.24-.24.51-.754.452-1.85-.057-1.096-.439-2.541-1.212-4.267Zm2.174 7.531c3.124-3.124-.991-12.305-9.192-20.506-8.201-8.2-17.382-12.316-20.506-9.192-3.124 3.124.991 12.305 9.192 20.506 8.201 8.2 17.382 12.316 20.506 9.192Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.622 31.03a7 7 0 0 0-8.473 4.013L6.01 85.773a3.223 3.223 0 0 0 4.215 4.216l50.731-21.138a7 7 0 0 0 4.012-8.473l-.428-1.429a41 41 0 0 0-27.49-27.49l-1.43-.428Zm-10.32 3.244a9 9 0 0 1 10.894-5.16l1.43.43a43 43 0 0 1 28.83 28.83l.43 1.43a9 9 0 0 1-5.16 10.894l-50.73 21.137a5.224 5.224 0 0 1-6.831-6.83l21.138-50.731Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M47.264 4.584a.756.756 0 0 1 1.472 0l.038.16a6 6 0 0 0 4.481 4.482l.16.038a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.482 4.482l-.037.16a.756.756 0 0 1-1.472 0l-.038-.16a6 6 0 0 0-4.481-4.482l-.16-.037a.756.756 0 0 1 0-1.472l.16-.038a6 6 0 0 0 4.482-4.481l.037-.16ZM85.264 19.584a.756.756 0 0 1 1.472 0l.037.16a6 6 0 0 0 4.482 4.483l.16.037a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.481 4.482l-.038.16a.756.756 0 0 1-1.472 0l-.037-.16a6 6 0 0 0-4.482-4.482l-.16-.037a.756.756 0 0 1 0-1.472l.16-.037a6 6 0 0 0 4.481-4.482l.038-.16ZM72.264 80.584a.756.756 0 0 1 1.472 0l.037.16a6 6 0 0 0 4.482 4.483l.16.037a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.481 4.482l-.038.16a.756.756 0 0 1-1.472 0l-.037-.16a6 6 0 0 0-4.482-4.481l-.16-.038a.756.756 0 0 1 0-1.472l.16-.037a6 6 0 0 0 4.481-4.482l.038-.16Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80.607 52.364a7 7 0 0 0-9.9 0 1 1 0 0 1-1.414-1.414 9 9 0 0 1 12.728 0 1 1 0 0 1-1.414 1.414ZM85.125 42.317c-5.693-3.286-12.972-1.336-16.259 4.357a1 1 0 1 1-1.732-1c3.839-6.65 12.342-8.928 18.991-5.089a1 1 0 1 1-1 1.732ZM24 18a7 7 0 0 1 7 7 1 1 0 1 0 2 0 9 9 0 0 0-9-9 1 1 0 1 0 0 2ZM29.445 9.937a7 7 0 0 1 4.114 9.004 1 1 0 1 0 1.874.699 9 9 0 0 0-5.29-11.577 1 1 0 0 0-.698 1.874Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M65 21a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M61 23a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 2a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M71 33a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M68 34a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 2a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M60 82a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M57 83a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 2a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M88 64a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M83 67a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 2a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M55 27.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M51.5 29a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 2a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M84 11a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M77 16a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z" clip-rule="evenodd"/>
  </svg>
`,WQ=e=>{switch(e){case st.bq.ChromeBrowser:return"https://chromewebstore.google.com/detail/bitwarden-password-manage/nngceckbapebfimnlniiiahkandclblb";case st.bq.FirefoxBrowser:return"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/";case st.bq.SafariBrowser:return"https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12";case st.bq.OperaBrowser:return"https://addons.opera.com/extensions/details/bitwarden-free-password-manager/";case st.bq.EdgeBrowser:return"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh";default:return"https://bitwarden.com/download/#downloads-web-browser"}};var $Q=i(11451),JQ=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ZQ=new I.Ok(I.q9,"setupExtensionDismissed",{deserializer:e=>e,clearOn:[]});var _Q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ek{constructor(){this.platformUtilsService=(0,E.WQX)(V.y),this.data=(0,E.WQX)(_g.Qs),this.webStoreUrl=""}ngOnInit(){this.webStoreUrl=WQ(this.platformUtilsService.getDevice())}dismissExtensionPage(){return _Q(this,void 0,void 0,function*(){this.data.onDismiss()})}}ek.ɵfac=function(e){return new(e||ek)},ek.ɵcmp=B.VBU({type:ek,selectors:[["vault-add-extension-later-dialog"]],decls:17,vars:13,consts:[["bitDialogIcon",""],["aria-hidden","true",1,"bwi","bwi-info-circle","bwi-2x","tw-text-info"],["bitDialogContent",""],["bitTypography","h3"],["bitTypography","body1"],["bitDialogFooter",""],["bitButton","","buttonType","primary","target","_blank","rel","noopener noreferrer",3,"href"],["bitButton","","buttonType","secondary","routerLink","/vault","bitDialogClose","",3,"click"]],template:function(e,t){1&e&&(B.j41(0,"bit-simple-dialog")(1,"div",0),B.nrm(2,"i",1),B.k0s(),B.qex(3,2),B.j41(4,"div",3),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"div",4),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.bVm(),B.qex(10,5),B.j41(11,"a",6),B.EFF(12),B.nI1(13,"i18n"),B.k0s(),B.j41(14,"a",7),B.bIt("click",function(){return t.dismissExtensionPage()}),B.EFF(15),B.nI1(16,"i18n"),B.k0s(),B.bVm(),B.k0s()),2&e&&(B.R7$(5),B.SpI(" ",B.bMT(6,5,"cannotAutofillPasswordsWithoutExtensionTitle")," "),B.R7$(3),B.JRh(B.bMT(9,7,"cannotAutofillPasswordsWithoutExtensionDesc")),B.R7$(3),B.Y8G("href",t.webStoreUrl,B.B4B),B.R7$(),B.SpI(" ",B.bMT(13,9,"getTheExtension")," "),B.R7$(3),B.SpI(" ",B.bMT(16,11,"skipToWebApp")," "))},dependencies:[Nd.P,qd.I,Wd.LJ,Wd.hJ,Wd.o_,jd.p,DA.E,MA.r,Jd.Q,BA.iI,BA.Wk,au.$],encapsulation:2});var tk=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ik=["video"],nk=e=>({"tw-opacity-0":e});function rk(e,t){if(1&e){const e=B.RV6();B.j41(0,"video",9,3),B.bIt("loadeddata",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onVideoLoad())}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("ngClass",B.eq3(2,nk,!e.allVideosLoaded)),B.BMQ("aria-hidden",!e.allVideosLoaded)}}function sk(e,t){if(1&e){const e=B.RV6();B.j41(0,"video",10,3),B.bIt("loadeddata",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onVideoLoad())}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("ngClass",B.eq3(2,nk,!e.allVideosLoaded)),B.BMQ("aria-hidden",!e.allVideosLoaded)}}function ok(e,t){if(1&e){const e=B.RV6();B.j41(0,"video",11,3),B.bIt("loadeddata",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.onVideoLoad())}),B.k0s()}if(2&e){const e=B.XpG();B.Y8G("ngClass",B.eq3(2,nk,!e.allVideosLoaded)),B.BMQ("aria-hidden",!e.allVideosLoaded)}}function ak(e,t){1&e&&B.nrm(0,"div",12)}function lk(e,t){1&e&&B.eu8(0)}function ck(e,t){1&e&&B.nrm(0,"div",12)}function dk(e,t){1&e&&B.eu8(0)}function uk(e,t){1&e&&B.nrm(0,"div",12)}function hk(e,t){1&e&&B.eu8(0)}class Ak{get allVideosLoaded(){return this.numberOfLoadedVideos>=3}constructor(){this.document=(0,E.WQX)(E.qQL),this.cssOverlayVariable="--overlay-opacity",this.cssBorderVariable="--border-opacity",this.variant="desktop",this.numberOfLoadedVideos=0,this.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.videoContainerClass=["tw-absolute tw-left-0 tw-top-0 tw-w-[15rem] tw-opacity-0 md:tw-opacity-100 md:tw-relative lg:tw-w-[17rem] tw-max-w-full tw-aspect-[0.807]","[--overlay-opacity:0.7] after:tw-absolute after:tw-top-0 after:tw-left-0 after:tw-size-full after:tw-bg-primary-100 after:tw-content-[''] after:tw-rounded-lg after:tw-opacity-[--overlay-opacity]","[--border-opacity:0] before:tw-absolute before:tw-top-0 before:tw-left-0 before:tw-w-full before:tw-h-2 before:tw-bg-primary-600 before:tw-content-[''] before:tw-rounded-t-lg before:tw-opacity-[--border-opacity]","after:tw-transition-opacity after:tw-duration-400 after:tw-ease-linear","before:tw-transition-opacity before:tw-duration-400 before:tw-ease-linear"].join(" "),(0,gu.R)(window,"resize").pipe((0,c.pQ)(),(0,Jg.B)(25)).subscribe(()=>this.onResize())}onResize(){const e=this.variant;this.variant=this.document.documentElement.clientWidth<768?"mobile":"desktop",this.variant!==e&&"mobile"===this.variant&&this.videoElements.forEach(e=>{e.nativeElement.paused?this.hideElement(e.nativeElement.parentElement):this.showElement(e.nativeElement.parentElement)}),this.variant!==e&&"desktop"===this.variant&&this.videoElements.forEach(e=>{this.showElement(e.nativeElement.parentElement)})}onVideoLoad(){this.numberOfLoadedVideos=this.numberOfLoadedVideos+1,this.allVideosLoaded&&this.startVideoSequence(0)}startVideoSequence(e){return tk(this,void 0,void 0,function*(){let t=e;const i=t>=this.videoElements.length;if(i&&this.prefersReducedMotion)return;i&&(this.videoElements.forEach(e=>{e.nativeElement.currentTime=0}),t=0);const n=this.videoElements.toArray()[t].nativeElement;n.onended=()=>{this.startVideoSequence(t+1),this.addPausedStyles(n)},this.mobileTransitionIn(t),n.muted=!0,this.addPlayingStyles(n),yield n.play()})}mobileTransitionIn(e){if(this.isAboveTabletBreakpoint())return;const t=this.videoElements.toArray()[e].nativeElement.parentElement,i=0===e?this.videoElements.length-1:e-1,n=this.videoElements.toArray()[i].nativeElement.parentElement;this.hideElement(n,!0),this.showElement(t,!0)}isAboveTabletBreakpoint(){return this.document.documentElement.clientWidth>=768}hideElement(e,t=!1){e.style.transition=t?"opacity 0.5s linear":"",e.style.opacity="0"}showElement(e,t=!1){e.style.transition=t?"opacity 0.5s linear":"",e.style.opacity="1"}addPausedStyles(e){const t=e.parentElement;t&&(t.style.setProperty(this.cssBorderVariable,"0"),t.style.setProperty(this.cssOverlayVariable,"0.7"))}addPlayingStyles(e){const t=e.parentElement;t&&(t.style.setProperty(this.cssBorderVariable,"1"),t.style.setProperty(this.cssOverlayVariable,"0"))}}Ak.ɵfac=function(e){return new(e||Ak)},Ak.ɵcmp=B.VBU({type:Ak,selectors:[["vault-add-extension-videos"]],viewQuery:function(e,t){if(1&e&&B.GBs(ik,5,B.aKT),2&e){let e;B.mGM(e=B.lsd())&&(t.videoElements=e)}},decls:17,vars:12,consts:[["newLoginItem",""],["browserExtensionEasyAccess",""],["onboardingAutofill",""],["video",""],[1,"tw-mx-auto","tw-w-[15rem]","tw-mb-8","tw-relative","md:tw-grid","md:tw-gap-10","md:tw-w-auto","md:tw-grid-rows-1","md:tw-grid-cols-3","md:tw-justify-center","md:tw-justify-items-center","xl:tw-gap-12"],[3,"ngClass"],["class","tw-animate-pulse tw-bg-secondary-300 tw-size-full tw-absolute tw-left-0 tw-top-0 tw-rounded-lg","data-testid","video-pulse",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"tw-relative",3,"ngClass"],["muted","","src","videos/new-login-item.mp4","appDarkImgSrc","videos/new-login-item-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["muted","","src","videos/browser-extension-easy-access.mp4","appDarkImgSrc","videos/browser-extension-easy-access-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["muted","","src","videos/onboarding-autofill.mp4","appDarkImgSrc","videos/onboarding-autofill-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["data-testid","video-pulse",1,"tw-animate-pulse","tw-bg-secondary-300","tw-size-full","tw-absolute","tw-left-0","tw-top-0","tw-rounded-lg"]],template:function(e,t){if(1&e&&(B.DNE(0,rk,2,4,"ng-template",null,0,B.C5r)(2,sk,2,4,"ng-template",null,1,B.C5r)(4,ok,2,4,"ng-template",null,2,B.C5r),B.j41(6,"div",4),B.nI1(7,"i18n"),B.j41(8,"div",5),B.DNE(9,ak,1,0,"div",6)(10,lk,1,0,"ng-container",7),B.k0s(),B.j41(11,"div",8),B.DNE(12,ck,1,0,"div",6)(13,dk,1,0,"ng-container",7),B.k0s(),B.j41(14,"div",5),B.DNE(15,uk,1,0,"div",6)(16,hk,1,0,"ng-container",7),B.k0s()()),2&e){const e=B.sdS(1),i=B.sdS(3),n=B.sdS(5);B.R7$(6),B.BMQ("aria-label",B.bMT(7,10,"setupExtensionContentAlt")),B.R7$(2),B.Y8G("ngClass",t.videoContainerClass),B.R7$(),B.Y8G("ngIf",!t.allVideosLoaded),B.R7$(),B.Y8G("ngTemplateOutlet",e),B.R7$(),B.Y8G("ngClass",t.videoContainerClass),B.R7$(),B.Y8G("ngIf",!t.allVideosLoaded),B.R7$(),B.Y8G("ngTemplateOutlet",i),B.R7$(),B.Y8G("ngClass",t.videoContainerClass),B.R7$(),B.Y8G("ngIf",!t.allVideosLoaded),B.R7$(),B.Y8G("ngTemplateOutlet",n)}},dependencies:[H.MD,H.YU,H.bT,H.T3,jd.p,xd.Mr,au.$],encapsulation:2});var pk=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function gk(e,t){1&e&&(B.nrm(0,"i",3),B.nI1(1,"i18n")),2&e&&B.Y8G("appA11yTitle",B.bMT(1,1,"loading"))}function vk(e,t){if(1&e){const e=B.RV6();B.j41(0,"section",4)(1,"h1",5),B.EFF(2),B.nI1(3,"i18n"),B.k0s(),B.j41(4,"h2",6),B.EFF(5),B.nI1(6,"i18n"),B.k0s(),B.nrm(7,"vault-add-extension-videos"),B.j41(8,"div",7)(9,"a",8),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.j41(12,"button",9),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.addItLater())}),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()()}if(2&e){const e=B.XpG();B.R7$(2),B.SpI(" ",B.bMT(3,5,"setupExtensionPageTitle")," "),B.R7$(3),B.SpI(" ",B.bMT(6,7,"setupExtensionPageDescription")," "),B.R7$(4),B.Y8G("href",e.webStoreUrl,B.B4B),B.R7$(),B.SpI(" ",B.bMT(11,9,"getTheExtension")," "),B.R7$(3),B.SpI(" ",B.bMT(14,11,"addItLater")," ")}}function fk(e,t){1&e&&(B.j41(0,"div",21),B.nrm(1,"vault-manually-open-extension"),B.k0s())}function mk(e,t){if(1&e){const e=B.RV6();B.j41(0,"section",10)(1,"div",11),B.nrm(2,"bit-svg",12),B.k0s(),B.j41(3,"h1",13),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"div",14)(7,"p"),B.EFF(8),B.nI1(9,"i18n"),B.k0s(),B.j41(10,"button",15),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.openExtension())}),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"a",16),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.DNE(16,fk,2,0,"div",17),B.k0s(),B.j41(17,"p",18),B.EFF(18),B.nI1(19,"i18n"),B.j41(20,"a",19),B.EFF(21),B.nI1(22,"i18n"),B.k0s(),B.EFF(23),B.nI1(24,"i18n"),B.j41(25,"a",20),B.EFF(26),B.nI1(27,"i18n"),B.k0s()()()}if(2&e){const e=B.XpG();B.R7$(2),B.Y8G("content",e.PartyIcon),B.R7$(2),B.SpI(" ",B.bMT(5,10,e.state===e.SetupExtensionState.Success?"bitwardenExtensionInstalled":"bitwardenExtensionIsInstalled")," "),B.R7$(4),B.SpI(" ",B.bMT(9,12,"openExtensionToAutofill")," "),B.R7$(3),B.SpI(" ",B.bMT(12,14,"openBitwardenExtension")," "),B.R7$(3),B.SpI(" ",B.bMT(15,16,"skipToWebApp")," "),B.R7$(2),B.Y8G("ngIf",e.state===e.SetupExtensionState.ManualOpen),B.R7$(2),B.SpI(" ",B.bMT(19,18,"gettingStartedWithBitwardenPart1")," "),B.R7$(3),B.SpI(" ",B.bMT(22,20,"gettingStartedWithBitwardenPart2")," "),B.R7$(2),B.SpI(" ",B.bMT(24,22,"and")," "),B.R7$(3),B.SpI(" ",B.bMT(27,24,"gettingStartedWithBitwardenPart3")," ")}}const yk={Loading:"loading",NeedsExtension:"needs-extension",Success:"success",AlreadyInstalled:"already-installed",ManualOpen:"manual-open"};class Ck{constructor(){this.webBrowserExtensionInteractionService=(0,E.WQX)(PQ),this.router=(0,E.WQX)(F.Ix),this.destroyRef=(0,E.WQX)(E.abz),this.platformUtilsService=(0,E.WQX)(V.y),this.dialogService=(0,E.WQX)(R.o3),this.stateProvider=(0,E.WQX)(I.v2),this.accountService=(0,E.WQX)(Y.D),this.document=(0,E.WQX)(E.qQL),this.SetupExtensionState=yk,this.PartyIcon=HQ,this.state=yk.Loading,this.webStoreUrl="",this.dialogRef=null,this.viewportContent=null}ngOnInit(){return pk(this,void 0,void 0,function*(){var e;this.document.body.style.minWidth="auto";const t=this.document.querySelector('meta[name="viewport"]');this.viewportContent=null!==(e=null==t?void 0:t.getAttribute("content"))&&void 0!==e?e:null,null==t||t.setAttribute("content","width=device-width, initial-scale=1.0"),yield this.conditionallyRedirectUser(),this.webStoreUrl=WQ(this.platformUtilsService.getDevice()),this.webBrowserExtensionInteractionService.extensionInstalled$.pipe((0,c.pQ)(this.destroyRef),(0,gi.Z)(null),(0,vi.J)()).subscribe(([e,t])=>{var i;null===e&&t&&(this.dismissExtensionPage(),this.state=yk.AlreadyInstalled),!1===e&&t&&(null===(i=this.dialogRef)||void 0===i||i.close(),this.dismissExtensionPage(),this.state=yk.Success),!1===t&&(this.state=yk.NeedsExtension)})})}ngOnDestroy(){var e;this.document.body.style.minWidth="",null!==this.viewportContent&&(null===(e=this.document.querySelector('meta[name="viewport"]'))||void 0===e||e.setAttribute("content",this.viewportContent))}conditionallyRedirectUser(){return pk(this,void 0,void 0,function*(){at.A.isMobileBrowser&&(yield this.dismissExtensionPage(),yield this.router.navigate(["/vault"]))})}get showSuccessUI(){return[yk.Success,yk.AlreadyInstalled,yk.ManualOpen].includes(this.state)}addItLater(){this.dialogRef=this.dialogService.open(ek,{data:{onDismiss:this.dismissExtensionPage.bind(this)},positionStrategy:new R.u3})}openExtension(){return pk(this,void 0,void 0,function*(){yield this.webBrowserExtensionInteractionService.openExtension().catch(()=>{this.state=yk.ManualOpen})})}dismissExtensionPage(){return pk(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));this.stateProvider.getUser(e,ZQ).update(()=>!0)})}}Ck.ɵfac=function(e){return new(e||Ck)},Ck.ɵcmp=B.VBU({type:Ck,selectors:[["vault-setup-extension"]],decls:3,vars:3,consts:[["class","bwi bwi-spinner bwi-spin bwi-3x tw-text-muted","aria-hidden","true",3,"appA11yTitle",4,"ngIf"],["class","tw-text-center tw-mt-4",4,"ngIf"],["class","tw-flex tw-flex-col tw-items-center",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted",3,"appA11yTitle"],[1,"tw-text-center","tw-mt-4"],[1,"tw-text-xl","tw-font-medium","tw-text-main","sm:tw-text-2xl"],[1,"tw-text-sm","tw-text-main","tw-mb-6","tw-font-normal","sm:tw-text-base"],[1,"tw-flex","tw-flex-col","tw-gap-4","tw-items-center"],["bitButton","","buttonType","primary","target","_blank","rel","noopener noreferrer",3,"href"],["type","button","bitLink","",3,"click"],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-[90px]"],[3,"content"],["bitTypography","h2",1,"tw-mb-6","tw-mt-4","tw-text-center"],[1,"tw-flex","tw-flex-col","tw-rounded-2xl","tw-bg-background","tw-border","tw-border-solid","tw-border-secondary-300","tw-p-8","tw-max-w-md","md:tw-w-[28rem]","tw-text-center"],["type","button","bitButton","","buttonType","primary",1,"tw-mb-2",3,"click"],["bitButton","","buttonType","secondary","routerLink","/vault"],["aria-live","polite","class","tw-text-center tw-mt-4",4,"ngIf"],[1,"tw-mt-4","tw-max-w-96","tw-text-center"],["target","_blank","bitLink","","href","https://bitwarden.com/help/learning-center/"],["target","_blank","bitLink","","href","https://bitwarden.com/help"],["aria-live","polite",1,"tw-text-center","tw-mt-4"]],template:function(e,t){1&e&&B.DNE(0,gk,2,3,"i",0)(1,vk,15,13,"section",1)(2,mk,28,26,"section",2),2&e&&(B.Y8G("ngIf",t.state===t.SetupExtensionState.Loading),B.R7$(),B.Y8G("ngIf",t.state===t.SetupExtensionState.NeedsExtension),B.R7$(),B.Y8G("ngIf",t.showSuccessUI))},dependencies:[H.bT,jd.p,Kv.C,Jd.Q,zd.V,$d.g,RA.Z,gp.k,BA.iI,BA.Wk,Ak,VQ,au.$],encapsulation:2});var wk=i(20798),Ik=i(79303),bk=i(2195);class Bk{}Bk.ɵfac=function(e){return new(e||Bk)},Bk.ɵmod=B.$C({type:Bk}),Bk.ɵinj=E.G2t({imports:[oh.G]});var Ek=i(10840),Sk=i(34530);const Qk=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.22 7 95.71 88">
    <path class="tw-fill-illustration-bg-primary" d="M.232 9.21A2 2 0 0 1 2.222 7h67.556a2 2 0 0 1 1.99 2.21l-7.014 66.627A8 8 0 0 1 56.798 83H15.202a8 8 0 0 1-7.956-7.162L.232 9.209Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M60.283 80.99C63.59 80.76 61.313 77 58 77H14c-3.314 0-5.59 3.759-2.284 3.99.094.007.189.01.284.01h48c.095 0 .19-.003.283-.01Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M69.778 9H2.221l7.014 66.628A6 6 0 0 0 15.202 81h41.596a6 6 0 0 0 5.967-5.372L69.778 9ZM2.221 7A2 2 0 0 0 .232 9.21l7.014 66.627A8 8 0 0 0 15.202 83h41.596a8 8 0 0 0 7.956-7.162l7.013-66.629A2 2 0 0 0 69.778 7H2.221Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M36 25a1 1 0 0 1 1 1v38a1 1 0 1 1-2 0V26a1 1 0 0 1 1-1ZM27.079 64.997a1 1 0 0 1-1.076-.918l-3-38a1 1 0 1 1 1.994-.158l3 38a1 1 0 0 1-.918 1.076ZM44.921 64.997a1 1 0 0 0 1.076-.918l3-38a1 1 0 1 0-1.994-.158l-3 38a1 1 0 0 0 .918 1.076ZM80.91 29.443a1 1 0 0 0 .688 1.236l5.522 1.573a3 3 0 0 1 2.09 2.168l4.63 18.795a3 3 0 0 1-.844 2.891l-4.159 3.958a1 1 0 1 0 1.379 1.449l4.158-3.958a5 5 0 0 0 1.408-4.818l-4.63-18.795a5 5 0 0 0-3.484-3.613l-5.522-1.573a1 1 0 0 0-1.235.687Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M73.248 10.117c-1.526-.79-3.272.586-2.861 2.254l17.026 69.12c.411 1.668 2.596 2.075 3.581.667l1.486-2.124a8 8 0 0 0 1.213-6.5L79.643 16.5a8 8 0 0 0-4.093-5.192l-2.302-1.191Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M89.355 81.012 72.33 11.893l2.303 1.191a6 6 0 0 1 3.07 3.894L91.75 74.013a6 6 0 0 1-.91 4.875l-1.486 2.124Zm-18.968-68.64c-.411-1.669 1.335-3.045 2.86-2.255l2.303 1.19a8 8 0 0 1 4.093 5.193l14.05 57.035a8 8 0 0 1-1.213 6.5l-1.486 2.123c-.985 1.408-3.17 1-3.58-.668L70.386 12.372Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M48 83c0 6.627-5.373 12-12 12s-12-5.373-12-12 5.373-12 12-12 12 5.373 12 12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M36 93c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10Zm0 2c6.627 0 12-5.373 12-12s-5.373-12-12-12-12 5.373-12 12 5.373 12 12 12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.707 79.293a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 1.414-1.414L34 85.586l6.293-6.293a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/>
  </svg>
`,kk=VA.JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5.29 4.98 86.89 90.19">
<g clip-path="url(#clip0_2211_2391)">
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-primary" d="M45.7322 7.73645C46.8425 5.06767 50.6228 5.06767 51.7332 7.73645L60.8269 29.5929C61.511 31.2373 63.0575 32.3607 64.8328 32.5031L88.4343 34.3947C91.316 34.6257 92.4843 38.2221 90.2888 40.1027L72.3083 55.5001C70.9554 56.6589 70.3647 58.4773 70.7781 60.2101L76.2712 83.2335C76.9419 86.0452 73.8838 88.2672 71.4167 86.7609L51.2078 74.422C49.688 73.4941 47.7773 73.4941 46.2576 74.422L26.0486 86.7609C23.5815 88.2672 20.5234 86.0452 21.1941 83.2335L26.6873 60.2101C27.1007 58.4773 26.51 56.6589 25.157 55.5001L7.17651 40.1027C4.98107 38.2221 6.14942 34.6258 9.03101 34.3947L32.6326 32.5031C34.4079 32.3607 35.9543 31.2373 36.6384 29.5929L45.7322 7.73645Z" stroke-width="1.5"/>
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-tertiary" d="M86.5363 75.5456L67.0229 86.8083L64.3035 82.0996C63.2768 82.3932 60.0282 82.2577 55.7085 78.0915C51.1997 73.7429 53.1 69.4322 54.8897 67.3528L51.1991 60.9624C51.1991 60.9624 49.0085 57.1701 47.5085 54.572C46.5871 52.9761 46.8445 50.4707 48.594 49.461C50.3435 48.4512 52.9064 49.1601 53.9008 50.8825C56.3862 55.1873 60.6993 62.6543 60.6993 62.6543L60.3136 61.9865C59.0344 59.7715 57.8733 56.6618 60.0887 55.3831C60.1803 55.3302 60.2715 55.2816 60.3624 55.2371C62.6556 54.1121 64.7529 56.4687 66.0303 58.6805C65.81 57.9107 65.7395 56.1576 67.2199 55.3032C69.5661 53.949 71.7744 56.9755 73.1292 59.3214L72.6308 58.4584C72.1365 57.4731 71.6772 55.4212 73.4319 54.4084C75.2982 53.3313 76.7992 54.9314 77.3409 55.7398C78.3682 57.3892 80.6222 61.1108 81.42 62.8029C82.2178 64.495 82.7029 67.7429 82.8457 69.1553L86.5363 75.5456Z"/>
<path class="tw-stroke-illustration-outline" d="M66.0303 58.6805C65.81 57.9107 65.7395 56.1576 67.2199 55.3032V55.3032C69.5661 53.949 71.7744 56.9755 73.1292 59.3214L73.9905 60.8128L72.6308 58.4584C72.1365 57.4731 71.6772 55.4212 73.4319 54.4084C75.2982 53.3313 76.7992 54.9314 77.3409 55.7398C78.3682 57.3892 80.6222 61.1108 81.42 62.8029C82.2178 64.495 82.7029 67.7429 82.8457 69.1553L86.5363 75.5456L67.0229 86.8083L64.3035 82.0996C63.2768 82.3932 60.0282 82.2577 55.7085 78.0915C51.1997 73.7429 53.1 69.4322 54.8897 67.3528M66.0303 58.6805L67.9727 62.0439M66.0303 58.6805V58.6805C64.7529 56.4687 62.6556 54.1121 60.3624 55.2371C60.2715 55.2816 60.1803 55.3302 60.0887 55.3831V55.3831C57.8733 56.6618 59.0344 59.7715 60.3136 61.9865L60.6993 62.6543C60.6993 62.6543 56.3862 55.1873 53.9008 50.8825C52.9064 49.1601 50.3435 48.4512 48.594 49.461C46.8445 50.4707 46.5871 52.9761 47.5085 54.572C49.0085 57.1701 51.1991 60.9624 51.1991 60.9624L54.8897 67.3528M57.6091 72.0616L54.8897 67.3528" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-secondary" d="M70.9905 93.6786L67.5232 87.6748C67.247 87.1965 67.4108 86.585 67.8892 86.309L85.6704 76.046C86.1487 75.7699 86.7604 75.9338 87.0366 76.4121L90.5039 82.4159C90.7802 82.8942 90.6163 83.5057 90.138 83.7818L72.3567 94.0447C71.8784 94.3208 71.2667 94.1569 70.9905 93.6786Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<g clip-path="url(#clip1_2211_2391)">
<path class="tw-stroke-illustration-tertiary" d="M41.5571 37.1704L45.0496 43.2177" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M54.9774 35.4178L53.187 42.1557" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M65.7288 43.6858L59.6986 47.1663" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M35.1155 61.3549L41.1457 57.8744" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M33.329 47.9126L40.0662 49.7286" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
</g>
</g>
<defs>
<clipPath id="clip0_2211_2391">
<rect width="96" height="96" class="tw-fill-bg-tertiary" transform="translate(0.5 0.400024)"/>
</clipPath>
<clipPath id="clip1_2211_2391">
<rect width="37.6674" height="20.0537" class="tw-fill-bg-tertiary" transform="matrix(0.86609 -0.499888 0.500112 0.86596 25.2179 45.5771)"/>
</clipPath>
</defs>
</svg>`,Tk=VA.JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 18.75 150 112.5">
    <path class="tw-fill-illustration-bg-secondary" d="M0 28.125a9.375 9.375 0 0 1 9.375-9.375h50a9.375 9.375 0 0 1 9.375 9.375v31.25a9.375 9.375 0 0 1-9.375 9.375h-50A9.375 9.375 0 0 1 0 59.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.375 21.875h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125A9.375 9.375 0 0 0 0 28.125v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 90.625a9.375 9.375 0 0 1 9.375-9.375h50a9.375 9.375 0 0 1 9.375 9.375v31.25a9.375 9.375 0 0 1-9.375 9.375h-50A9.375 9.375 0 0 1 0 121.875v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.375 84.375h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125A9.375 9.375 0 0 0 0 90.625v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M81.25 28.125a9.375 9.375 0 0 1 9.375-9.375h50A9.375 9.375 0 0 1 150 28.125v31.25a9.375 9.375 0 0 1-9.375 9.375h-50a9.375 9.375 0 0 1-9.375-9.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M140.625 21.875h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125a9.375 9.375 0 0 0-9.375 9.375v31.25a9.375 9.375 0 0 0 9.375 9.375h50A9.375 9.375 0 0 0 150 59.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M81.25 90.625a9.375 9.375 0 0 1 9.375-9.375h50A9.375 9.375 0 0 1 150 90.625v31.25a9.375 9.375 0 0 1-9.375 9.375h-50a9.375 9.375 0 0 1-9.375-9.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M140.625 84.375h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125a9.375 9.375 0 0 0-9.375 9.375v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M84.375 31.25h62.5v6.25h-62.5v-6.25ZM90.625 54.688c0-.863.7-1.563 1.563-1.563h9.374a1.563 1.563 0 1 1 0 3.125h-9.374c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-outline" d="M92.188 95.313c0-.863.7-1.563 1.562-1.563h43.75a1.562 1.562 0 0 1 0 3.125H93.75c-.863 0-1.563-.7-1.563-1.563ZM92.188 106.25c0-.863.7-1.562 1.562-1.562h43.75a1.562 1.562 0 1 1 0 3.124H93.75a1.562 1.562 0 0 1-1.563-1.562ZM92.188 117.188c0-.863.7-1.563 1.562-1.563h20.312a1.563 1.563 0 0 1 0 3.125H93.75c-.863 0-1.563-.7-1.563-1.562ZM39.063 95.313c0-.863.7-1.563 1.562-1.563h18.75a1.563 1.563 0 0 1 0 3.125h-18.75c-.863 0-1.563-.7-1.563-1.563ZM39.063 101.562c0-.862.7-1.562 1.562-1.562h7.813a1.563 1.563 0 0 1 0 3.125h-7.813c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M107.812 54.688c0-.863.7-1.563 1.563-1.563h14.063a1.563 1.563 0 0 1 0 3.125h-14.063c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M32.813 97.656a8.594 8.594 0 1 1-17.189 0 8.594 8.594 0 0 1 17.188 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.219 103.125a5.468 5.468 0 1 0 0-10.937 5.468 5.468 0 0 0 0 10.937Zm0 3.125a8.594 8.594 0 1 0 0-17.188 8.594 8.594 0 0 0 0 17.188Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M40.82 115.663c.903 2.158 1.367 3.877 1.367 6.212 0 .863-.7 1.563-1.562 1.563H7.812c-.862 0-1.562-.7-1.562-1.563 0-2.335.465-4.054 1.368-6.212a17.77 17.77 0 0 1 3.895-5.768 17.974 17.974 0 0 1 5.83-3.854 18.125 18.125 0 0 1 6.876-1.353c2.36 0 4.696.459 6.876 1.353 2.18.893 4.161 2.203 5.83 3.854a17.77 17.77 0 0 1 3.895 5.768Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.964 120.312c-.15-1.105-.478-2.131-1.027-3.442a14.634 14.634 0 0 0-3.21-4.753 14.865 14.865 0 0 0-4.817-3.185 15.012 15.012 0 0 0-11.382 0 14.865 14.865 0 0 0-4.817 3.185 14.634 14.634 0 0 0-3.21 4.753c-.55 1.311-.877 2.337-1.027 3.442h29.49Zm3.224 1.563c0-2.335-.465-4.054-1.368-6.212a17.77 17.77 0 0 0-3.895-5.768 17.974 17.974 0 0 0-5.83-3.854 18.125 18.125 0 0 0-6.876-1.353c-2.36 0-4.697.459-6.877 1.353a17.974 17.974 0 0 0-5.83 3.854 17.77 17.77 0 0 0-3.894 5.768c-.903 2.158-1.368 3.877-1.368 6.212 0 .863.7 1.563 1.563 1.563h32.812c.863 0 1.563-.7 1.563-1.563Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M21.875 59.375c5.784 0 10.833-3.142 13.535-7.813h2.358c.829 0 1.624-.329 2.21-.915l2.21-2.21 2.93 2.345c.57.456 1.381.456 1.952 0L50 48.438l2.21 2.21c.586.585 1.38.914 2.21.914h1.89c.95 0 1.848-.431 2.44-1.172l4.532-5.664a1.562 1.562 0 0 0 0-1.952L58.75 37.11a3.125 3.125 0 0 0-2.44-1.172H35.41c-2.702-4.67-7.751-7.813-13.535-7.813-8.63 0-15.625 6.996-15.625 15.625 0 8.63 6.996 15.625 15.625 15.625Zm-3.125-12.5a3.125 3.125 0 1 0 0-6.25 3.125 3.125 0 0 0 0 6.25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.607 48.438h4.161l4.188-4.188 4.138 3.31 4.138-3.31 4.187 4.188h1.892l3.75-4.688-3.75-4.688H33.606l-.902-1.56a12.494 12.494 0 0 0-10.83-6.252c-6.904 0-12.5 5.596-12.5 12.5s5.596 12.5 12.5 12.5c4.623 0 8.664-2.508 10.83-6.252l.902-1.56Zm27.234-5.664-.001.002.001-.002ZM25 43.75a6.25 6.25 0 1 1-12.5 0 6.25 6.25 0 0 1 12.5 0Zm10.41 7.813c-2.702 4.67-7.751 7.812-13.535 7.812-8.63 0-15.625-6.996-15.625-15.625 0-8.63 6.996-15.625 15.625-15.625 5.784 0 10.833 3.142 13.535 7.813h20.9c.95 0 1.848.431 2.44 1.172l4.532 5.664c.456.57.456 1.381 0 1.952L58.75 50.39a3.125 3.125 0 0 1-2.44 1.172h-1.892c-.828 0-1.623-.329-2.21-.915L50 48.437l-2.93 2.345a1.562 1.562 0 0 1-1.952 0l-2.93-2.344-2.21 2.21a3.125 3.125 0 0 1-2.21.914H35.41ZM21.875 43.75a3.125 3.125 0 1 1-6.25 0 3.125 3.125 0 0 1 6.25 0Z" clip-rule="evenodd"/>
  </svg>
`;var Fk=i(91461),Pk=i(36501),Rk=i(23567),Dk=i(27760),Mk=i(85494),xk=i(24593),Ok=i(85523),Gk=i(93817),Uk=i(406),Vk=i(27485),jk=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nk=new w.Ok(w.Cg,"premiumModalDismissed",{deserializer:e=>e,clearOn:[]});class zk{constructor(e,t,i,n,r,s,o,a){this.accountService=e,this.syncService=t,this.dialogService=i,this.organizationService=n,this.platformUtilsService=r,this.stateProvider=s,this.logService=o,this.premiumUpsellService=a,this.unifiedUpgradeDialogRef=null,this.shouldShowPrompt$=this.accountService.activeAccount$.pipe((0,rt.n)(e=>this.platformUtilsService.isSelfHost()?(0,Ii.of)(!1):e?(0,bi.z)([this.hasDismissedModal$(e.id),this.hasOrganizations(e.id),(0,Ii.of)(this.premiumUpsellService.showUpsell())]).pipe((0,p.T)(([e,t,i])=>!e&&!t&&i)):(0,Ii.of)(!1)),(0,Ai.s)(1))}displayUpgradePromptConditionally(){return jk(this,void 0,void 0,function*(){return(yield(0,u._)(this.shouldShowPrompt$))?this.launchUpgradeDialog():null})}launchUpgradeDialog(){return jk(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);if(!e)return null;this.unifiedUpgradeDialogRef=Vk.gY.open(this.dialogService,{data:{account:e}});const t=yield(0,u._)(this.unifiedUpgradeDialogRef.closed);if(this.unifiedUpgradeDialogRef=null,(null==t?void 0:t.status)===Vk.PD.Closed)try{yield this.stateProvider.setUserState(Nk,!0,e.id)}catch(i){this.logService.error("Failed to save premium modal dismissal state:",i)}return t||null})}hasOrganizations(e){return jk(this,void 0,void 0,function*(){yield this.syncService.fullSync(!1),yield(0,u._)(this.syncService.lastSync$(e).pipe((0,h.p)(e=>null!==e),(0,Ai.s)(1),(0,A.w)(3e4)));return(yield(0,u._)(this.organizationService.memberOrganizations$(e))).length>0})}hasDismissedModal$(e){return this.stateProvider.getUserState$(Nk,e).pipe((0,p.T)(e=>null!=e&&e))}}zk.ɵfac=function(e){return new(e||zk)(E.KVO(Y.D),E.KVO(Yu.H),E.KVO(R.o3),E.KVO(f.PV),E.KVO(V.y),E.KVO(w.v2),E.KVO(Vs.K),E.KVO(Uk.aX))},zk.ɵprov=E.jDH({token:zk,factory:zk.ɵfac,providedIn:"root"});const Yk=VA.JW`<svg
    width="684"
    height="291"
    viewBox="0 0 684 291"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
  >
    <rect width="684" height="291" fill="#175DDC" />
    <g clip-path="url(#clip0_4955_16369)">
      <path
        d="M85 28C85 23.5817 88.5817 20 93 20H591C595.418 20 599 23.5817 599 28V291H85V28Z"
        fill="white"
      />
      <path
        d="M85 28C85 23.5817 88.5817 20 93 20H591C595.418 20 599 23.5817 599 28V36H85V28Z"
        fill="#D8E2EB"
        fill-opacity="0.75"
      />
      <path d="M85 36H599V52H85V36Z" fill="#F3F6F9" />
      <circle cx="95" cy="28" r="3" fill="#FF6550" />
      <circle cx="104" cy="28" r="3" fill="#FDC700" />
      <circle cx="113" cy="28" r="3" fill="#7BF1A8" />
      <rect x="98" y="40" width="395" height="8" rx="4" fill="#D8E2EB" />
      <g filter="url(#filter0_d_4955_16369)">
        <path
          d="M499 42.25C499 41.0074 500.007 40 501.25 40H505C506.243 40 507.25 41.0074 507.25 42.25V46C507.25 47.2426 506.243 48.25 505 48.25H501.25C500.007 48.25 499 47.2426 499 46V42.25Z"
          fill="#175DDC"
        />
        <g clip-path="url(#clip1_4955_16369)">
          <g clip-path="url(#clip2_4955_16369)">
            <path
              d="M505.451 41.2834C505.403 41.2354 505.347 41.2107 505.283 41.2107H500.967C500.902 41.2107 500.847 41.2354 500.799 41.2834C500.752 41.3315 500.728 41.3873 500.728 41.4536V44.3678C500.728 44.5847 500.77 44.8016 500.853 45.0146C500.937 45.2289 501.04 45.4185 501.165 45.5834C501.288 45.7497 501.435 45.9107 501.607 46.0665C501.778 46.2237 501.937 46.3536 502.081 46.4574C502.226 46.5613 502.378 46.6587 502.535 46.751C502.693 46.8432 502.804 46.9055 502.871 46.9393C502.938 46.9717 502.99 46.9977 503.03 47.0146C503.06 47.0302 503.093 47.038 503.128 47.038C503.162 47.038 503.195 47.0302 503.225 47.0146C503.265 46.9964 503.319 46.9717 503.384 46.9393C503.451 46.9068 503.562 46.8432 503.72 46.751C503.878 46.6587 504.029 46.56 504.174 46.4574C504.319 46.3536 504.476 46.2237 504.648 46.0665C504.819 45.9094 504.966 45.7484 505.09 45.5834C505.213 45.4172 505.317 45.2276 505.401 45.0146C505.484 44.8003 505.526 44.5847 505.526 44.3678V41.4536C505.522 41.3873 505.498 41.3315 505.451 41.2834ZM504.894 44.3951C504.894 45.4497 503.125 46.3587 503.125 46.3587V41.8341H504.894C504.894 41.8341 504.894 43.3406 504.894 44.3951Z"
              fill="white"
            />
          </g>
        </g>
      </g>
      <g filter="url(#filter1_d_4955_16369)">
        <path
          d="M511 42.25C511 41.0074 512.007 40 513.25 40H517C518.243 40 519.25 41.0074 519.25 42.25V46C519.25 47.2426 518.243 48.25 517 48.25H513.25C512.007 48.25 511 47.2426 511 46V42.25Z"
          fill="#DBE5F6"
        />
      </g>
      <g filter="url(#filter2_d_4955_16369)">
        <path
          d="M522 42.25C522 41.0074 523.007 40 524.25 40H528C529.243 40 530.25 41.0074 530.25 42.25V46C530.25 47.2426 529.243 48.25 528 48.25H524.25C523.007 48.25 522 47.2426 522 46V42.25Z"
          fill="#DBE5F6"
        />
      </g>
      <mask
        id="mask0_4955_16369"
        style="mask-type: luminance"
        maskUnits="userSpaceOnUse"
        x="77"
        y="-1"
        width="523"
        height="327"
      >
        <path
          d="M586.925 -1H90.075C82.8539 -1 77 4.85388 77 12.075V312.8C77 320.021 82.8539 325.875 90.075 325.875H586.925C594.146 325.875 600 320.021 600 312.8V12.075C600 4.85388 594.146 -1 586.925 -1Z"
          fill="white"
        />
      </mask>
      <g mask="url(#mask0_4955_16369)">
        <g opacity="0.68">
          <path
            opacity="0.1"
            d="M586.925 57.8375H90.0752V110.138H586.925V57.8375Z"
            fill="#175DDC"
          />
          <path
            opacity="0.4"
            d="M201.213 77.4501H116.225C112.614 77.4501 109.688 80.377 109.688 83.9876C109.688 87.5981 112.614 90.5251 116.225 90.5251H201.213C204.823 90.5251 207.75 87.5981 207.75 83.9876C207.75 80.377 204.823 77.4501 201.213 77.4501Z"
            fill="#175DDC"
          />
          <path
            opacity="0.3"
            d="M292.738 77.4501H227.363C223.752 77.4501 220.825 80.377 220.825 83.9876C220.825 87.5981 223.752 90.5251 227.363 90.5251H292.738C296.348 90.5251 299.275 87.5981 299.275 83.9876C299.275 80.377 296.348 77.4501 292.738 77.4501Z"
            fill="#175DDC"
          />
          <path
            opacity="0.3"
            d="M397.338 77.4501H318.888C315.278 77.4501 312.351 80.377 312.351 83.9876C312.351 87.5981 315.278 90.5251 318.888 90.5251H397.338C400.949 90.5251 403.876 87.5981 403.876 83.9876C403.876 80.377 400.949 77.4501 397.338 77.4501Z"
            fill="#175DDC"
          />
          <path
            opacity="0.15"
            d="M286.2 136.287H116.225C109.004 136.287 103.15 142.141 103.15 149.362V253.962C103.15 261.184 109.004 267.037 116.225 267.037H286.2C293.422 267.037 299.275 261.184 299.275 253.962V149.362C299.275 142.141 293.422 136.287 286.2 136.287Z"
            fill="#3B82F6"
          />
          <path
            opacity="0.3"
            d="M181.6 155.9H129.3C125.69 155.9 122.763 158.827 122.763 162.438C122.763 166.048 125.69 168.975 129.3 168.975H181.6C185.211 168.975 188.138 166.048 188.138 162.438C188.138 158.827 185.211 155.9 181.6 155.9Z"
            fill="#175DDC"
          />
          <path
            opacity="0.3"
            d="M274.76 182.05H127.666C124.958 182.05 122.763 184.245 122.763 186.953C122.763 189.661 124.958 191.856 127.666 191.856H274.76C277.467 191.856 279.663 189.661 279.663 186.953C279.663 184.245 277.467 182.05 274.76 182.05Z"
            fill="#6B7280"
          />
          <path
            opacity="0.25"
            d="M261.685 201.663H127.666C124.958 201.663 122.763 203.858 122.763 206.566C122.763 209.274 124.958 211.469 127.666 211.469H261.685C264.392 211.469 266.588 209.274 266.588 206.566C266.588 203.858 264.392 201.663 261.685 201.663Z"
            fill="#6B7280"
          />
          <path
            opacity="0.25"
            d="M235.535 221.275H127.666C124.958 221.275 122.763 223.47 122.763 226.178C122.763 228.886 124.958 231.081 127.666 231.081H235.535C238.243 231.081 240.438 228.886 240.438 226.178C240.438 223.47 238.243 221.275 235.535 221.275Z"
            fill="#6B7280"
          />
          <path
            d="M560.775 136.287H338.5C331.279 136.287 325.425 142.141 325.425 149.362V293.187C325.425 300.409 331.279 306.262 338.5 306.262H560.775C567.996 306.262 573.85 300.409 573.85 293.187V149.362C573.85 142.141 567.996 136.287 560.775 136.287Z"
            fill="#F3F4F6"
          />
          <path
            opacity="0.25"
            d="M547.701 155.9H351.576C347.965 155.9 345.038 158.827 345.038 162.438C345.038 166.048 347.965 168.975 351.576 168.975H547.701C551.311 168.975 554.238 166.048 554.238 162.438C554.238 158.827 551.311 155.9 547.701 155.9Z"
            fill="#175DDC"
          />
          <path
            opacity="0.2"
            d="M521.551 188.588H351.576C347.965 188.588 345.038 191.514 345.038 195.125C345.038 198.736 347.965 201.663 351.576 201.663H521.551C525.161 201.663 528.088 198.736 528.088 195.125C528.088 191.514 525.161 188.588 521.551 188.588Z"
            fill="#6B7280"
          />
          <path
            opacity="0.2"
            d="M534.626 221.275H351.576C347.965 221.275 345.038 224.202 345.038 227.813C345.038 231.423 347.965 234.35 351.576 234.35H534.626C538.236 234.35 541.163 231.423 541.163 227.813C541.163 224.202 538.236 221.275 534.626 221.275Z"
            fill="#6B7280"
          />
          <path
            opacity="0.2"
            d="M508.476 253.963H351.576C347.965 253.963 345.038 256.889 345.038 260.5C345.038 264.111 347.965 267.038 351.576 267.038H508.476C512.086 267.038 515.013 264.111 515.013 260.5C515.013 256.889 512.086 253.963 508.476 253.963Z"
            fill="#6B7280"
          />
        </g>
      </g>
      <g filter="url(#filter3_d_4955_16369)">
        <g clip-path="url(#clip3_4955_16369)">
          <rect width="168" height="230" transform="translate(339 52)" fill="#F3F6F9" />
          <mask id="path-27-inside-1_4955_16369" fill="white">
            <path d="M339 52H506.833V76.7333H339V52Z" />
          </mask>
          <path d="M339 52H506.833V76.7333H339V52Z" fill="white" />
          <path
            d="M506.833 76.7333V76.2917H339V76.7333V77.175H506.833V76.7333Z"
            fill="#D5DDE8"
            mask="url(#path-27-inside-1_4955_16369)"
          />
          <path
            d="M347.207 61.0849L348.816 65.7939H348.881L350.49 61.0849H351.433L349.353 66.8667H348.345L346.264 61.0849H347.207ZM353.035 66.9627C352.761 66.9627 352.512 66.9119 352.29 66.8102C352.068 66.7067 351.892 66.5571 351.762 66.3614C351.634 66.1656 351.57 65.9256 351.57 65.6415C351.57 65.3968 351.617 65.1954 351.711 65.0373C351.805 64.8792 351.932 64.754 352.092 64.6618C352.252 64.5696 352.431 64.5 352.629 64.4529C352.826 64.4059 353.028 64.3701 353.233 64.3456C353.493 64.3155 353.704 64.291 353.865 64.2722C354.027 64.2515 354.145 64.2186 354.218 64.1734C354.292 64.1282 354.328 64.0548 354.328 63.9532V63.9334C354.328 63.6869 354.259 63.4959 354.119 63.3603C353.982 63.2248 353.777 63.1571 353.504 63.1571C353.22 63.1571 352.996 63.2201 352.832 63.3462C352.67 63.4704 352.558 63.6088 352.496 63.7612L351.703 63.5805C351.797 63.3171 351.934 63.1044 352.115 62.9425C352.298 62.7788 352.507 62.6602 352.745 62.5868C352.982 62.5115 353.231 62.4739 353.493 62.4739C353.666 62.4739 353.849 62.4946 354.043 62.536C354.239 62.5755 354.422 62.6489 354.591 62.7562C354.762 62.8635 354.902 63.0169 355.012 63.2164C355.121 63.414 355.175 63.6709 355.175 63.9871V66.8667H354.351V66.2738H354.317C354.262 66.383 354.181 66.4903 354.071 66.5957C353.962 66.7011 353.822 66.7886 353.651 66.8582C353.48 66.9279 353.274 66.9627 353.035 66.9627ZM353.219 66.2851C353.452 66.2851 353.652 66.239 353.817 66.1468C353.985 66.0546 354.112 65.9341 354.198 65.7854C354.287 65.6349 354.331 65.4739 354.331 65.3027V64.7437C354.301 64.7738 354.243 64.802 354.156 64.8284C354.071 64.8528 353.975 64.8745 353.865 64.8933C353.756 64.9103 353.65 64.9263 353.546 64.9413C353.443 64.9545 353.356 64.9658 353.287 64.9752C353.123 64.9959 352.973 65.0307 352.838 65.0796C352.704 65.1286 352.597 65.1992 352.516 65.2914C352.437 65.3817 352.397 65.5022 352.397 65.6527C352.397 65.8617 352.474 66.0198 352.629 66.127C352.783 66.2324 352.98 66.2851 353.219 66.2851ZM359.047 65.0684V62.5303H359.894V66.8667H359.063V66.1157H359.018C358.919 66.3472 358.759 66.5402 358.538 66.6945C358.32 66.8469 358.048 66.9232 357.723 66.9232C357.444 66.9232 357.197 66.862 356.983 66.7397C356.77 66.6154 356.603 66.4319 356.48 66.1891C356.36 65.9464 356.3 65.6462 356.3 65.2886V62.5303H357.144V65.1869C357.144 65.4824 357.226 65.7177 357.389 65.8927C357.553 66.0677 357.766 66.1553 358.027 66.1553C358.185 66.1553 358.343 66.1157 358.499 66.0367C358.657 65.9576 358.788 65.8381 358.891 65.6782C358.997 65.5182 359.048 65.3149 359.047 65.0684ZM361.872 61.0849V66.8667H361.028V61.0849H361.872ZM365.032 62.5303V63.2079H362.663V62.5303H365.032ZM363.298 61.4914H364.142V65.5935C364.142 65.7572 364.167 65.8805 364.216 65.9633C364.265 66.0442 364.328 66.0997 364.405 66.1299C364.484 66.1581 364.57 66.1722 364.662 66.1722C364.73 66.1722 364.789 66.1675 364.84 66.1581C364.89 66.1487 364.93 66.1411 364.958 66.1355L365.111 66.8328C365.062 66.8516 364.992 66.8705 364.902 66.8893C364.811 66.91 364.699 66.9213 364.563 66.9232C364.341 66.9269 364.134 66.8874 363.942 66.8046C363.75 66.7218 363.595 66.5938 363.476 66.4206C363.358 66.2475 363.298 66.0301 363.298 65.7685V61.4914Z"
            fill="#0F172B"
          />
          <g filter="url(#filter4_d_4955_16369)">
            <path
              d="M432.116 62.1334C432.116 59.2063 434.489 56.8334 437.416 56.8334H459.133C462.06 56.8334 464.433 59.2063 464.433 62.1334V66.6C464.433 69.5272 462.06 71.9 459.133 71.9H437.416C434.489 71.9 432.116 69.5271 432.116 66.6V62.1334Z"
              fill="#175DDC"
            />
            <path
              d="M440.507 66.6855C440.434 66.6855 440.373 66.6608 440.324 66.6114C440.274 66.562 440.25 66.5008 440.25 66.4278V64.6244H438.446C438.373 64.6244 438.312 64.5997 438.263 64.5503C438.213 64.5009 438.188 64.4397 438.188 64.3667C438.188 64.2937 438.213 64.2325 438.263 64.1832C438.312 64.1338 438.373 64.1091 438.446 64.1091H440.25V62.3056C440.25 62.2326 440.274 62.1714 440.324 62.122C440.373 62.0727 440.434 62.048 440.507 62.048C440.58 62.048 440.641 62.0727 440.691 62.122C440.74 62.1714 440.765 62.2326 440.765 62.3056V64.1091H442.568C442.641 64.1091 442.703 64.1338 442.752 64.1832C442.801 64.2325 442.826 64.2937 442.826 64.3667C442.826 64.4397 442.801 64.5009 442.752 64.5503C442.703 64.5997 442.641 64.6244 442.568 64.6244H440.765V66.4278C440.765 66.5008 440.74 66.562 440.691 66.6114C440.641 66.6608 440.58 66.6855 440.507 66.6855Z"
              fill="white"
            />
            <path
              d="M450.667 61.5122V65.3667H450.133L448.174 62.5398H448.138V65.3667H447.556V61.5122H448.095L450.056 64.3428H450.091V61.5122H450.667ZM452.717 65.425C452.432 65.425 452.186 65.3642 451.981 65.2425C451.776 65.1195 451.618 64.947 451.506 64.7249C451.396 64.5016 451.341 64.2399 451.341 63.9401C451.341 63.6439 451.396 63.383 451.506 63.1571C451.618 62.9313 451.774 62.755 451.973 62.6282C452.174 62.5015 452.409 62.4381 452.677 62.4381C452.84 62.4381 452.998 62.4651 453.151 62.5191C453.304 62.573 453.442 62.6577 453.563 62.7732C453.685 62.8886 453.781 63.0385 453.851 63.223C453.922 63.4062 453.957 63.6289 453.957 63.8911V64.0906H451.659V63.669H453.405C453.405 63.521 453.375 63.3899 453.315 63.2757C453.255 63.1602 453.17 63.0693 453.061 63.0028C452.953 62.9363 452.826 62.903 452.681 62.903C452.523 62.903 452.385 62.9419 452.267 63.0197C452.15 63.0963 452.06 63.1966 451.996 63.3209C451.933 63.4438 451.902 63.5774 451.902 63.7217V64.0511C451.902 64.2443 451.935 64.4087 452.003 64.5442C452.072 64.6797 452.168 64.7832 452.291 64.8548C452.414 64.925 452.558 64.9602 452.722 64.9602C452.829 64.9602 452.926 64.9451 453.014 64.915C453.102 64.8836 453.178 64.8372 453.242 64.7757C453.306 64.7142 453.355 64.6383 453.388 64.548L453.921 64.644C453.878 64.8008 453.802 64.9382 453.691 65.0562C453.582 65.1728 453.445 65.2638 453.279 65.3291C453.115 65.393 452.927 65.425 452.717 65.425ZM455.203 65.3667L454.352 62.4758H454.934L455.5 64.5988H455.528L456.097 62.4758H456.678L457.243 64.5894H457.271L457.834 62.4758H458.416L457.567 65.3667H456.993L456.405 63.2794H456.362L455.775 65.3667H455.203Z"
              fill="white"
            />
          </g>
          <path
            d="M474.223 67.6792C474.021 67.6792 473.848 67.6071 473.704 67.463C473.559 67.3188 473.487 67.1455 473.487 66.9431V61.7903C473.487 61.5879 473.559 61.4146 473.704 61.2704C473.848 61.1263 474.021 61.0542 474.223 61.0542H476.064C476.168 61.0542 476.255 61.0895 476.326 61.16C476.396 61.2306 476.432 61.318 476.432 61.4223C476.432 61.5265 476.396 61.614 476.326 61.6845C476.255 61.755 476.168 61.7903 476.064 61.7903H474.223V66.9431H479.376V65.1028C479.376 64.9985 479.411 64.9111 479.482 64.8406C479.553 64.77 479.64 64.7348 479.744 64.7348C479.849 64.7348 479.936 64.77 480.006 64.8406C480.077 64.9111 480.112 64.9985 480.112 65.1028V66.9431C480.112 67.1455 480.04 67.3188 479.896 67.463C479.752 67.6071 479.579 67.6792 479.376 67.6792H474.223ZM478.272 62.8945H477.536C477.432 62.8945 477.344 62.8592 477.274 62.7887C477.203 62.7181 477.168 62.6307 477.168 62.5264C477.168 62.4221 477.203 62.3347 477.274 62.2642C477.344 62.1936 477.432 62.1584 477.536 62.1584H478.272V61.4223C478.272 61.318 478.307 61.2306 478.378 61.16C478.448 61.0895 478.536 61.0542 478.64 61.0542C478.744 61.0542 478.832 61.0895 478.902 61.16C478.973 61.2306 479.008 61.318 479.008 61.4223V62.1584H479.744C479.849 62.1584 479.936 62.1936 480.006 62.2642C480.077 62.3347 480.112 62.4221 480.112 62.5264C480.112 62.6307 480.077 62.7181 480.006 62.7887C479.936 62.8592 479.849 62.8945 479.744 62.8945H479.008V63.6306C479.008 63.7349 478.973 63.8223 478.902 63.8928C478.832 63.9634 478.744 63.9986 478.64 63.9986C478.536 63.9986 478.448 63.9634 478.378 63.8928C478.307 63.8223 478.272 63.7349 478.272 63.6306V62.8945Z"
            fill="#0F172B"
          />
          <rect x="489.166" y="59.0667" width="10.6" height="10.6" rx="5.3" fill="#007C95" />
          <path
            d="M491.26 65.3667L490.535 62.797H491.035L491.498 64.6854H491.522L492.017 62.797H492.472L492.968 64.6866H492.99L493.453 62.797H493.954L493.229 65.3667H492.77L492.255 63.5636H492.235L491.719 65.3667H491.26ZM494.818 65.3667L494.092 62.797H494.593L495.056 64.6854H495.08L495.574 62.797H496.03L496.525 64.6866H496.548L497.011 62.797H497.511L496.786 65.3667H496.327L495.813 63.5636H495.792L495.277 65.3667H494.818Z"
            fill="white"
          />
          <path
            d="M346.94 131.35H346.22L347.838 126.853H348.622L350.241 131.35H349.52L348.249 127.67H348.214L346.94 131.35ZM347.061 129.589H349.397V130.16H347.061V129.589ZM352.974 129.951V127.977H353.633V131.35H352.987V130.766H352.952C352.874 130.946 352.75 131.096 352.579 131.216C352.409 131.335 352.197 131.394 351.944 131.394C351.727 131.394 351.536 131.346 351.369 131.251C351.203 131.155 351.073 131.012 350.978 130.823C350.884 130.634 350.837 130.401 350.837 130.123V127.977H351.494V130.043C351.494 130.273 351.558 130.456 351.685 130.592C351.812 130.729 351.978 130.797 352.181 130.797C352.304 130.797 352.426 130.766 352.548 130.704C352.671 130.643 352.773 130.55 352.853 130.426C352.935 130.301 352.975 130.143 352.974 129.951ZM356.089 127.977V128.504H354.247V127.977H356.089ZM354.741 127.169H355.397V130.36C355.397 130.487 355.416 130.583 355.454 130.647C355.493 130.71 355.542 130.753 355.602 130.777C355.663 130.799 355.73 130.81 355.801 130.81C355.854 130.81 355.9 130.806 355.94 130.799C355.979 130.792 356.01 130.786 356.032 130.781L356.151 131.324C356.112 131.338 356.058 131.353 355.988 131.368C355.918 131.384 355.83 131.392 355.725 131.394C355.552 131.397 355.391 131.366 355.241 131.302C355.092 131.237 354.971 131.138 354.879 131.003C354.787 130.868 354.741 130.699 354.741 130.496V127.169ZM358.2 131.418C357.884 131.418 357.608 131.346 357.372 131.201C357.136 131.056 356.953 130.853 356.823 130.592C356.693 130.332 356.628 130.027 356.628 129.679C356.628 129.329 356.693 129.023 356.823 128.761C356.953 128.499 357.136 128.296 357.372 128.151C357.608 128.006 357.884 127.933 358.2 127.933C358.516 127.933 358.792 128.006 359.028 128.151C359.263 128.296 359.446 128.499 359.577 128.761C359.707 129.023 359.772 129.329 359.772 129.679C359.772 130.027 359.707 130.332 359.577 130.592C359.446 130.853 359.263 131.056 359.028 131.201C358.792 131.346 358.516 131.418 358.2 131.418ZM358.202 130.867C358.407 130.867 358.577 130.813 358.711 130.704C358.846 130.596 358.946 130.452 359.01 130.272C359.076 130.092 359.109 129.893 359.109 129.677C359.109 129.462 359.076 129.264 359.01 129.084C358.946 128.902 358.846 128.757 358.711 128.647C358.577 128.537 358.407 128.482 358.202 128.482C357.996 128.482 357.824 128.537 357.688 128.647C357.553 128.757 357.453 128.902 357.387 129.084C357.323 129.264 357.291 129.462 357.291 129.677C357.291 129.893 357.323 130.092 357.387 130.272C357.453 130.452 357.553 130.596 357.688 130.704C357.824 130.813 357.996 130.867 358.202 130.867ZM362.11 127.977V128.504H360.204V127.977H362.11ZM360.727 131.35V127.586C360.727 127.376 360.773 127.201 360.865 127.062C360.957 126.921 361.079 126.816 361.232 126.748C361.384 126.677 361.549 126.642 361.728 126.642C361.86 126.642 361.972 126.653 362.066 126.675C362.16 126.696 362.229 126.715 362.275 126.732L362.121 127.264C362.09 127.255 362.051 127.245 362.002 127.233C361.954 127.22 361.895 127.213 361.827 127.213C361.667 127.213 361.553 127.253 361.484 127.332C361.417 127.411 361.383 127.525 361.383 127.674V131.35H360.727ZM362.787 131.35V127.977H363.444V131.35H362.787ZM363.119 127.457C363.005 127.457 362.907 127.419 362.825 127.343C362.744 127.265 362.704 127.173 362.704 127.066C362.704 126.958 362.744 126.865 362.825 126.789C362.907 126.712 363.005 126.673 363.119 126.673C363.233 126.673 363.33 126.712 363.411 126.789C363.493 126.865 363.534 126.958 363.534 127.066C363.534 127.173 363.493 127.265 363.411 127.343C363.33 127.419 363.233 127.457 363.119 127.457ZM364.984 126.853V131.35H364.327V126.853H364.984ZM366.523 126.853V131.35H365.867V126.853H366.523ZM371.57 128.801L370.975 128.906C370.951 128.83 370.911 128.757 370.857 128.689C370.804 128.62 370.732 128.564 370.642 128.52C370.551 128.476 370.437 128.454 370.301 128.454C370.115 128.454 369.96 128.495 369.836 128.579C369.711 128.661 369.649 128.767 369.649 128.897C369.649 129.01 369.691 129.101 369.774 129.17C369.858 129.238 369.992 129.295 370.178 129.339L370.714 129.462C371.024 129.533 371.256 129.644 371.408 129.793C371.56 129.942 371.636 130.136 371.636 130.375C371.636 130.577 371.578 130.757 371.461 130.915C371.345 131.072 371.183 131.195 370.975 131.284C370.769 131.373 370.53 131.418 370.257 131.418C369.88 131.418 369.572 131.338 369.333 131.177C369.094 131.014 368.948 130.783 368.894 130.485L369.528 130.388C369.568 130.554 369.649 130.679 369.772 130.764C369.895 130.847 370.055 130.889 370.253 130.889C370.468 130.889 370.64 130.844 370.769 130.755C370.898 130.664 370.962 130.554 370.962 130.423C370.962 130.318 370.923 130.229 370.844 130.158C370.766 130.086 370.647 130.032 370.486 129.995L369.915 129.87C369.6 129.798 369.367 129.684 369.217 129.527C369.067 129.371 368.993 129.172 368.993 128.932C368.993 128.733 369.048 128.559 369.159 128.41C369.271 128.261 369.424 128.144 369.621 128.061C369.817 127.976 370.041 127.933 370.295 127.933C370.659 127.933 370.946 128.012 371.155 128.17C371.365 128.327 371.503 128.537 371.57 128.801ZM374.495 129.951V127.977H375.153V131.35H374.508V130.766H374.473C374.395 130.946 374.271 131.096 374.099 131.216C373.93 131.335 373.718 131.394 373.465 131.394C373.248 131.394 373.056 131.346 372.89 131.251C372.724 131.155 372.594 131.012 372.499 130.823C372.405 130.634 372.358 130.401 372.358 130.123V127.977H373.015V130.043C373.015 130.273 373.078 130.456 373.206 130.592C373.333 130.729 373.499 130.797 373.702 130.797C373.825 130.797 373.947 130.766 374.069 130.704C374.192 130.643 374.293 130.55 374.374 130.426C374.456 130.301 374.496 130.143 374.495 129.951ZM377.45 132.685C377.182 132.685 376.951 132.65 376.758 132.58C376.566 132.509 376.41 132.416 376.288 132.301C376.167 132.185 376.076 132.058 376.016 131.921L376.58 131.688C376.62 131.753 376.672 131.821 376.738 131.892C376.806 131.966 376.896 132.028 377.011 132.079C377.126 132.13 377.275 132.156 377.456 132.156C377.705 132.156 377.911 132.095 378.073 131.974C378.236 131.854 378.317 131.662 378.317 131.398V130.735H378.275C378.236 130.807 378.179 130.887 378.104 130.974C378.031 131.062 377.93 131.138 377.801 131.203C377.672 131.267 377.505 131.299 377.298 131.299C377.032 131.299 376.792 131.237 376.578 131.113C376.366 130.987 376.197 130.802 376.073 130.557C375.95 130.311 375.888 130.009 375.888 129.65C375.888 129.292 375.949 128.984 376.071 128.728C376.194 128.472 376.362 128.276 376.576 128.14C376.789 128.002 377.032 127.933 377.303 127.933C377.512 127.933 377.681 127.968 377.81 128.039C377.939 128.108 378.039 128.188 378.111 128.28C378.184 128.372 378.24 128.454 378.28 128.524H378.328V127.977H378.971V131.425C378.971 131.714 378.904 131.952 378.769 132.138C378.635 132.324 378.452 132.462 378.223 132.551C377.994 132.64 377.737 132.685 377.45 132.685ZM377.443 130.755C377.632 130.755 377.791 130.711 377.922 130.623C378.054 130.534 378.153 130.407 378.22 130.241C378.289 130.074 378.324 129.874 378.324 129.642C378.324 129.415 378.29 129.215 378.223 129.042C378.155 128.869 378.056 128.735 377.926 128.638C377.796 128.54 377.635 128.491 377.443 128.491C377.245 128.491 377.081 128.542 376.949 128.645C376.817 128.746 376.718 128.883 376.65 129.058C376.585 129.232 376.552 129.426 376.552 129.642C376.552 129.863 376.585 130.057 376.653 130.224C376.72 130.39 376.819 130.521 376.951 130.614C377.084 130.708 377.248 130.755 377.443 130.755ZM381.266 132.685C380.998 132.685 380.768 132.65 380.574 132.58C380.383 132.509 380.226 132.416 380.104 132.301C379.983 132.185 379.892 132.058 379.832 131.921L380.396 131.688C380.436 131.753 380.489 131.821 380.555 131.892C380.622 131.966 380.713 132.028 380.827 132.079C380.942 132.13 381.091 132.156 381.273 132.156C381.521 132.156 381.727 132.095 381.89 131.974C382.052 131.854 382.133 131.662 382.133 131.398V130.735H382.092C382.052 130.807 381.995 130.887 381.92 130.974C381.847 131.062 381.746 131.138 381.617 131.203C381.488 131.267 381.321 131.299 381.114 131.299C380.848 131.299 380.608 131.237 380.394 131.113C380.182 130.987 380.014 130.802 379.889 130.557C379.766 130.311 379.705 130.009 379.705 129.65C379.705 129.292 379.766 128.984 379.887 128.728C380.01 128.472 380.178 128.276 380.392 128.14C380.606 128.002 380.848 127.933 381.119 127.933C381.328 127.933 381.497 127.968 381.626 128.039C381.755 128.108 381.855 128.188 381.927 128.28C382 128.372 382.056 128.454 382.096 128.524H382.144V127.977H382.788V131.425C382.788 131.714 382.72 131.952 382.586 132.138C382.451 132.324 382.269 132.462 382.039 132.551C381.811 132.64 381.553 132.685 381.266 132.685ZM381.259 130.755C381.448 130.755 381.608 130.711 381.738 130.623C381.87 130.534 381.969 130.407 382.037 130.241C382.105 130.074 382.14 129.874 382.14 129.642C382.14 129.415 382.106 129.215 382.039 129.042C381.972 128.869 381.873 128.735 381.742 128.638C381.612 128.54 381.451 128.491 381.259 128.491C381.062 128.491 380.897 128.542 380.765 128.645C380.634 128.746 380.534 128.883 380.467 129.058C380.401 129.232 380.368 129.426 380.368 129.642C380.368 129.863 380.402 130.057 380.469 130.224C380.536 130.39 380.636 130.521 380.768 130.614C380.901 130.708 381.065 130.755 381.259 130.755ZM385.122 131.418C384.789 131.418 384.503 131.347 384.263 131.205C384.025 131.062 383.84 130.86 383.71 130.601C383.581 130.341 383.517 130.035 383.517 129.686C383.517 129.34 383.581 129.036 383.71 128.772C383.84 128.509 384.022 128.303 384.254 128.155C384.489 128.007 384.762 127.933 385.076 127.933C385.266 127.933 385.45 127.965 385.629 128.028C385.808 128.091 385.968 128.19 386.11 128.324C386.252 128.459 386.364 128.634 386.446 128.849C386.528 129.063 386.569 129.323 386.569 129.628V129.861H383.888V129.369H385.925C385.925 129.197 385.89 129.044 385.82 128.91C385.75 128.776 385.651 128.67 385.524 128.592C385.398 128.514 385.25 128.476 385.08 128.476C384.896 128.476 384.735 128.521 384.597 128.612C384.461 128.701 384.355 128.818 384.281 128.963C384.208 129.107 384.171 129.263 384.171 129.431V129.815C384.171 130.041 384.211 130.232 384.29 130.39C384.37 130.549 384.482 130.669 384.626 130.753C384.769 130.835 384.937 130.876 385.128 130.876C385.253 130.876 385.366 130.858 385.469 130.823C385.571 130.786 385.66 130.732 385.734 130.66C385.809 130.589 385.866 130.5 385.906 130.395L386.527 130.507C386.477 130.69 386.388 130.85 386.259 130.988C386.132 131.124 385.972 131.23 385.778 131.306C385.587 131.381 385.368 131.418 385.122 131.418ZM389.825 128.801L389.23 128.906C389.205 128.83 389.165 128.757 389.111 128.689C389.058 128.62 388.987 128.564 388.896 128.52C388.805 128.476 388.692 128.454 388.555 128.454C388.37 128.454 388.214 128.495 388.09 128.579C387.965 128.661 387.903 128.767 387.903 128.897C387.903 129.01 387.945 129.101 388.028 129.17C388.112 129.238 388.247 129.295 388.432 129.339L388.968 129.462C389.279 129.533 389.51 129.644 389.662 129.793C389.814 129.942 389.89 130.136 389.89 130.375C389.89 130.577 389.832 130.757 389.715 130.915C389.599 131.072 389.437 131.195 389.23 131.284C389.023 131.373 388.784 131.418 388.511 131.418C388.134 131.418 387.826 131.338 387.587 131.177C387.348 131.014 387.202 130.783 387.148 130.485L387.782 130.388C387.822 130.554 387.903 130.679 388.026 130.764C388.149 130.847 388.309 130.889 388.507 130.889C388.722 130.889 388.894 130.844 389.023 130.755C389.152 130.664 389.216 130.554 389.216 130.423C389.216 130.318 389.177 130.229 389.098 130.158C389.02 130.086 388.901 130.032 388.74 129.995L388.169 129.87C387.854 129.798 387.621 129.684 387.471 129.527C387.321 129.371 387.247 129.172 387.247 128.932C387.247 128.733 387.302 128.559 387.414 128.41C387.525 128.261 387.679 128.144 387.875 128.061C388.071 127.976 388.296 127.933 388.549 127.933C388.913 127.933 389.2 128.012 389.41 128.17C389.619 128.327 389.757 128.537 389.825 128.801ZM392.187 127.977V128.504H390.344V127.977H392.187ZM390.838 127.169H391.495V130.36C391.495 130.487 391.514 130.583 391.552 130.647C391.59 130.71 391.639 130.753 391.699 130.777C391.761 130.799 391.827 130.81 391.899 130.81C391.952 130.81 391.998 130.806 392.037 130.799C392.077 130.792 392.108 130.786 392.13 130.781L392.248 131.324C392.21 131.338 392.156 131.353 392.086 131.368C392.015 131.384 391.928 131.392 391.822 131.394C391.649 131.397 391.488 131.366 391.339 131.302C391.19 131.237 391.069 131.138 390.977 131.003C390.885 130.868 390.838 130.699 390.838 130.496V127.169ZM392.913 131.35V127.977H393.569V131.35H392.913ZM393.245 127.457C393.13 127.457 393.032 127.419 392.95 127.343C392.87 127.265 392.83 127.173 392.83 127.066C392.83 126.958 392.87 126.865 392.95 126.789C393.032 126.712 393.13 126.673 393.245 126.673C393.359 126.673 393.456 126.712 393.537 126.789C393.619 126.865 393.66 126.958 393.66 127.066C393.66 127.173 393.619 127.265 393.537 127.343C393.456 127.419 393.359 127.457 393.245 127.457ZM395.873 131.418C395.557 131.418 395.281 131.346 395.046 131.201C394.81 131.056 394.627 130.853 394.497 130.592C394.366 130.332 394.301 130.027 394.301 129.679C394.301 129.329 394.366 129.023 394.497 128.761C394.627 128.499 394.81 128.296 395.046 128.151C395.281 128.006 395.557 127.933 395.873 127.933C396.19 127.933 396.466 128.006 396.701 128.151C396.937 128.296 397.12 128.499 397.25 128.761C397.38 129.023 397.446 129.329 397.446 129.679C397.446 130.027 397.38 130.332 397.25 130.592C397.12 130.853 396.937 131.056 396.701 131.201C396.466 131.346 396.19 131.418 395.873 131.418ZM395.876 130.867C396.081 130.867 396.25 130.813 396.385 130.704C396.52 130.596 396.619 130.452 396.684 130.272C396.75 130.092 396.782 129.893 396.782 129.677C396.782 129.462 396.75 129.264 396.684 129.084C396.619 128.902 396.52 128.757 396.385 128.647C396.25 128.537 396.081 128.482 395.876 128.482C395.669 128.482 395.498 128.537 395.362 128.647C395.227 128.757 395.127 128.902 395.061 129.084C394.997 129.264 394.964 129.462 394.964 129.677C394.964 129.893 394.997 130.092 395.061 130.272C395.127 130.452 395.227 130.596 395.362 130.704C395.498 130.813 395.669 130.867 395.876 130.867ZM398.835 129.347V131.35H398.178V127.977H398.809V128.526H398.85C398.928 128.348 399.049 128.204 399.215 128.096C399.382 127.987 399.592 127.933 399.845 127.933C400.075 127.933 400.276 127.982 400.449 128.078C400.622 128.173 400.756 128.315 400.851 128.504C400.946 128.693 400.993 128.927 400.993 129.205V131.35H400.337V129.284C400.337 129.039 400.273 128.848 400.146 128.711C400.019 128.572 399.844 128.502 399.621 128.502C399.469 128.502 399.333 128.535 399.215 128.601C399.098 128.667 399.005 128.763 398.936 128.891C398.869 129.017 398.835 129.169 398.835 129.347ZM404.401 128.801L403.806 128.906C403.781 128.83 403.742 128.757 403.688 128.689C403.635 128.62 403.563 128.564 403.472 128.52C403.382 128.476 403.268 128.454 403.132 128.454C402.946 128.454 402.791 128.495 402.667 128.579C402.542 128.661 402.48 128.767 402.48 128.897C402.48 129.01 402.522 129.101 402.605 129.17C402.689 129.238 402.823 129.295 403.009 129.339L403.545 129.462C403.855 129.533 404.087 129.644 404.239 129.793C404.391 129.942 404.467 130.136 404.467 130.375C404.467 130.577 404.409 130.757 404.292 130.915C404.176 131.072 404.014 131.195 403.806 131.284C403.6 131.373 403.361 131.418 403.088 131.418C402.711 131.418 402.402 131.338 402.164 131.177C401.925 131.014 401.779 130.783 401.725 130.485L402.359 130.388C402.399 130.554 402.48 130.679 402.603 130.764C402.726 130.847 402.886 130.889 403.084 130.889C403.299 130.889 403.471 130.844 403.6 130.755C403.729 130.664 403.793 130.554 403.793 130.423C403.793 130.318 403.754 130.229 403.674 130.158C403.597 130.086 403.478 130.032 403.317 129.995L402.746 129.87C402.431 129.798 402.198 129.684 402.047 129.527C401.898 129.371 401.823 129.172 401.823 128.932C401.823 128.733 401.879 128.559 401.99 128.41C402.102 128.261 402.255 128.144 402.451 128.061C402.648 127.976 402.872 127.933 403.126 127.933C403.49 127.933 403.777 128.012 403.986 128.17C404.196 128.327 404.334 128.537 404.401 128.801Z"
            fill="#1B2029"
          />
          <path
            d="M492.955 131.35V130.955L494.439 129.33C494.614 129.14 494.757 128.974 494.87 128.834C494.983 128.692 495.066 128.558 495.12 128.434C495.176 128.308 495.204 128.176 495.204 128.039C495.204 127.881 495.166 127.744 495.089 127.628C495.015 127.512 494.912 127.423 494.782 127.36C494.652 127.297 494.505 127.266 494.343 127.266C494.17 127.266 494.019 127.302 493.89 127.373C493.763 127.444 493.664 127.542 493.594 127.67C493.525 127.797 493.491 127.947 493.491 128.118H492.973C492.973 127.854 493.033 127.623 493.155 127.424C493.276 127.225 493.442 127.07 493.651 126.958C493.862 126.847 494.098 126.792 494.36 126.792C494.624 126.792 494.857 126.847 495.061 126.958C495.264 127.07 495.424 127.22 495.54 127.409C495.655 127.597 495.713 127.807 495.713 128.039C495.713 128.204 495.683 128.366 495.623 128.524C495.564 128.681 495.462 128.856 495.316 129.049C495.171 129.241 494.969 129.475 494.712 129.751L493.702 130.832V130.867H495.792V131.35H492.955Z"
            fill="#5A6D91"
          />
          <mask id="path-39-inside-2_4955_16369" fill="white">
            <path
              d="M344.3 138.567C344.3 136.615 345.882 135.033 347.833 135.033H494.466C496.418 135.033 498 136.615 498 138.567V155.567C498 157.518 496.418 159.1 494.466 159.1H347.833C345.882 159.1 344.3 157.518 344.3 155.567V138.567Z"
            />
          </mask>
          <path
            d="M344.3 138.567C344.3 136.615 345.882 135.033 347.833 135.033H494.466C496.418 135.033 498 136.615 498 138.567V155.567C498 157.518 496.418 159.1 494.466 159.1H347.833C345.882 159.1 344.3 157.518 344.3 155.567V138.567Z"
            fill="white"
          />
          <path
            d="M344.3 135.033H498H344.3M498 155.567C498 157.64 496.319 159.321 494.246 159.321H348.054C345.981 159.321 344.3 157.64 344.3 155.567V155.567C344.3 157.396 345.882 158.879 347.833 158.879H494.466C496.418 158.879 498 157.396 498 155.567V155.567ZM498 155.567M344.3 159.1V135.033V159.1M344.3 159.1M498 135.033V159.1V135.033"
            fill="#A8B3C8"
            mask="url(#path-39-inside-2_4955_16369)"
          />
          <g clip-path="url(#clip4_4955_16369)">
            <rect
              x="345.478"
              y="141.767"
              width="18.8445"
              height="10.6"
              fill="url(#pattern0_4955_16369)"
            />
          </g>
          <path
            d="M365.108 145.567L363.861 141.07H364.574L365.451 144.552H365.492L366.403 141.07H367.111L368.022 144.554H368.063L368.937 141.07H369.653L368.404 145.567H367.721L366.775 142.198H366.739L365.793 145.567H365.108ZM371.308 145.635C370.992 145.635 370.716 145.562 370.48 145.417C370.244 145.272 370.061 145.07 369.931 144.809C369.801 144.549 369.736 144.244 369.736 143.896C369.736 143.546 369.801 143.24 369.931 142.978C370.061 142.716 370.244 142.512 370.48 142.367C370.716 142.222 370.992 142.15 371.308 142.15C371.624 142.15 371.9 142.222 372.136 142.367C372.371 142.512 372.554 142.716 372.685 142.978C372.815 143.24 372.88 143.546 372.88 143.896C372.88 144.244 372.815 144.549 372.685 144.809C372.554 145.07 372.371 145.272 372.136 145.417C371.9 145.562 371.624 145.635 371.308 145.635ZM371.31 145.084C371.515 145.084 371.685 145.029 371.819 144.921C371.954 144.813 372.054 144.669 372.118 144.489C372.184 144.308 372.217 144.11 372.217 143.893C372.217 143.678 372.184 143.481 372.118 143.301C372.054 143.119 371.954 142.973 371.819 142.864C371.685 142.754 371.515 142.699 371.31 142.699C371.104 142.699 370.932 142.754 370.796 142.864C370.661 142.973 370.561 143.119 370.495 143.301C370.431 143.481 370.399 143.678 370.399 143.893C370.399 144.11 370.431 144.308 370.495 144.489C370.561 144.669 370.661 144.813 370.796 144.921C370.932 145.029 371.104 145.084 371.31 145.084ZM373.613 145.567V142.194H374.247V142.73H374.283C374.344 142.548 374.452 142.405 374.607 142.302C374.764 142.196 374.941 142.143 375.139 142.143C375.18 142.143 375.228 142.145 375.284 142.148C375.341 142.151 375.386 142.154 375.418 142.159V142.787C375.391 142.779 375.345 142.771 375.277 142.763C375.21 142.752 375.143 142.747 375.075 142.747C374.92 142.747 374.782 142.78 374.66 142.846C374.54 142.91 374.445 143.001 374.375 143.116C374.304 143.23 374.269 143.361 374.269 143.507V145.567H373.613ZM376.59 144.423L376.585 143.621H376.7L378.043 142.194H378.829L377.297 143.819H377.194L376.59 144.423ZM375.986 145.567V141.07H376.642V145.567H375.986ZM378.116 145.567L376.908 143.964L377.36 143.505L378.922 145.567H378.116ZM384.16 142.49C384.118 142.357 384.061 142.238 383.989 142.132C383.919 142.026 383.835 141.935 383.736 141.86C383.638 141.784 383.526 141.726 383.401 141.687C383.276 141.647 383.139 141.627 382.99 141.627C382.737 141.627 382.508 141.693 382.305 141.823C382.101 141.953 381.94 142.144 381.822 142.396C381.705 142.646 381.646 142.953 381.646 143.316C381.646 143.68 381.705 143.989 381.824 144.24C381.943 144.492 382.105 144.683 382.311 144.813C382.518 144.944 382.753 145.009 383.016 145.009C383.261 145.009 383.474 144.959 383.655 144.86C383.838 144.76 383.979 144.62 384.079 144.438C384.18 144.255 384.231 144.04 384.231 143.792L384.406 143.825H383.119V143.265H384.887V143.777C384.887 144.155 384.807 144.483 384.646 144.761C384.486 145.037 384.265 145.251 383.982 145.402C383.701 145.553 383.379 145.628 383.016 145.628C382.609 145.628 382.252 145.534 381.945 145.347C381.639 145.16 381.4 144.894 381.229 144.55C381.058 144.205 380.972 143.795 380.972 143.32C380.972 142.962 381.022 142.64 381.121 142.354C381.221 142.069 381.361 141.826 381.541 141.627C381.722 141.427 381.935 141.274 382.18 141.168C382.426 141.062 382.694 141.008 382.986 141.008C383.229 141.008 383.455 141.044 383.664 141.116C383.875 141.188 384.062 141.289 384.226 141.421C384.392 141.553 384.528 141.709 384.637 141.891C384.745 142.071 384.818 142.271 384.856 142.49H384.16ZM385.696 145.567V142.194H386.326V142.743H386.368C386.438 142.557 386.553 142.412 386.712 142.308C386.872 142.203 387.063 142.15 387.285 142.15C387.511 142.15 387.7 142.203 387.852 142.308C388.006 142.414 388.119 142.558 388.192 142.743H388.227C388.308 142.563 388.436 142.419 388.612 142.312C388.787 142.204 388.997 142.15 389.24 142.15C389.546 142.15 389.795 142.246 389.988 142.438C390.183 142.629 390.28 142.919 390.28 143.305V145.567H389.624V143.366C389.624 143.138 389.562 142.973 389.437 142.87C389.313 142.768 389.164 142.717 388.992 142.717C388.778 142.717 388.612 142.782 388.493 142.914C388.375 143.044 388.315 143.212 388.315 143.417V145.567H387.661V143.325C387.661 143.142 387.604 142.995 387.49 142.883C387.375 142.772 387.227 142.717 387.044 142.717C386.919 142.717 386.805 142.749 386.699 142.815C386.595 142.88 386.511 142.97 386.447 143.085C386.384 143.201 386.352 143.335 386.352 143.487V145.567H385.696ZM392.142 145.641C391.928 145.641 391.735 145.602 391.562 145.523C391.39 145.442 391.253 145.326 391.152 145.174C391.052 145.021 391.002 144.835 391.002 144.614C391.002 144.423 391.039 144.267 391.112 144.144C391.185 144.021 391.284 143.923 391.409 143.852C391.533 143.78 391.672 143.726 391.826 143.689C391.979 143.653 392.136 143.625 392.296 143.606C392.498 143.582 392.662 143.563 392.787 143.549C392.913 143.533 393.005 143.507 393.062 143.472C393.119 143.437 393.148 143.38 393.148 143.301V143.285C393.148 143.093 393.093 142.945 392.985 142.839C392.878 142.734 392.719 142.681 392.506 142.681C392.285 142.681 392.111 142.73 391.984 142.829C391.858 142.925 391.771 143.033 391.723 143.151L391.106 143.011C391.179 142.806 391.286 142.64 391.426 142.515C391.568 142.387 391.731 142.295 391.916 142.238C392.1 142.179 392.294 142.15 392.498 142.15C392.632 142.15 392.775 142.166 392.926 142.198C393.078 142.229 393.22 142.286 393.352 142.37C393.485 142.453 393.594 142.572 393.679 142.727C393.764 142.881 393.806 143.081 393.806 143.327V145.567H393.165V145.106H393.139C393.096 145.19 393.033 145.274 392.948 145.356C392.863 145.438 392.754 145.506 392.621 145.56C392.487 145.614 392.328 145.641 392.142 145.641ZM392.285 145.114C392.466 145.114 392.621 145.078 392.75 145.007C392.88 144.935 392.979 144.841 393.047 144.726C393.115 144.609 393.15 144.483 393.15 144.35V143.915C393.126 143.939 393.081 143.961 393.014 143.981C392.948 144 392.872 144.017 392.787 144.032C392.703 144.045 392.62 144.057 392.539 144.069C392.459 144.079 392.392 144.088 392.337 144.095C392.21 144.112 392.094 144.139 391.988 144.177C391.884 144.215 391.801 144.27 391.738 144.341C391.676 144.412 391.646 144.505 391.646 144.622C391.646 144.785 391.706 144.908 391.826 144.991C391.946 145.073 392.099 145.114 392.285 145.114ZM394.681 145.567V142.194H395.337V145.567H394.681ZM395.012 141.674C394.898 141.674 394.8 141.635 394.718 141.559C394.638 141.482 394.597 141.39 394.597 141.283C394.597 141.174 394.638 141.082 394.718 141.006C394.8 140.928 394.898 140.89 395.012 140.89C395.127 140.89 395.224 140.928 395.304 141.006C395.386 141.082 395.427 141.174 395.427 141.283C395.427 141.39 395.386 141.482 395.304 141.559C395.224 141.635 395.127 141.674 395.012 141.674ZM396.877 141.07V145.567H396.221V141.07H396.877Z"
            fill="#1B2029"
          />
          <path
            d="M366.73 148.712H367.196V151.264C367.196 151.528 367.134 151.763 367.01 151.97C366.887 152.176 366.713 152.338 366.489 152.457C366.264 152.575 366.001 152.634 365.698 152.634C365.396 152.634 365.132 152.575 364.908 152.457C364.683 152.338 364.509 152.176 364.385 151.97C364.262 151.763 364.2 151.528 364.2 151.264V148.712H364.667V151.227C364.667 151.415 364.708 151.582 364.791 151.729C364.874 151.875 364.992 151.989 365.145 152.074C365.299 152.156 365.484 152.198 365.698 152.198C365.913 152.198 366.097 152.156 366.252 152.074C366.406 151.989 366.524 151.875 366.605 151.729C366.688 151.582 366.73 151.415 366.73 151.227V148.712ZM370.116 150.323L369.717 150.436C369.692 150.37 369.655 150.305 369.606 150.242C369.558 150.178 369.493 150.126 369.41 150.084C369.327 150.043 369.221 150.022 369.092 150.022C368.915 150.022 368.768 150.063 368.65 150.144C368.533 150.225 368.475 150.327 368.475 150.451C368.475 150.562 368.515 150.649 368.595 150.713C368.676 150.777 368.801 150.83 368.972 150.873L369.401 150.978C369.659 151.041 369.852 151.137 369.979 151.266C370.105 151.394 370.169 151.559 370.169 151.761C370.169 151.927 370.121 152.075 370.026 152.205C369.932 152.336 369.8 152.439 369.63 152.514C369.461 152.589 369.264 152.627 369.04 152.627C368.745 152.627 368.501 152.563 368.307 152.435C368.114 152.307 367.992 152.12 367.94 151.874L368.362 151.769C368.402 151.924 368.478 152.041 368.59 152.119C368.703 152.197 368.85 152.235 369.032 152.235C369.239 152.235 369.403 152.191 369.525 152.104C369.648 152.015 369.71 151.908 369.71 151.784C369.71 151.683 369.674 151.599 369.604 151.531C369.534 151.462 369.426 151.411 369.28 151.377L368.799 151.264C368.534 151.201 368.339 151.104 368.215 150.973C368.092 150.84 368.031 150.673 368.031 150.474C368.031 150.311 368.077 150.166 368.168 150.041C368.261 149.915 368.387 149.817 368.546 149.745C368.707 149.674 368.889 149.638 369.092 149.638C369.378 149.638 369.603 149.701 369.766 149.826C369.93 149.952 370.047 150.117 370.116 150.323ZM372.049 152.627C371.771 152.627 371.531 152.565 371.329 152.442C371.128 152.318 370.973 152.145 370.864 151.923C370.756 151.7 370.702 151.44 370.702 151.144C370.702 150.848 370.756 150.587 370.864 150.361C370.973 150.134 371.125 149.957 371.319 149.83C371.515 149.702 371.743 149.638 372.004 149.638C372.155 149.638 372.304 149.663 372.45 149.713C372.597 149.764 372.731 149.845 372.851 149.958C372.972 150.07 373.068 150.218 373.139 150.402C373.211 150.587 373.246 150.814 373.246 151.084V151.272H371.018V150.888H372.795C372.795 150.725 372.762 150.579 372.697 150.451C372.633 150.323 372.541 150.222 372.422 150.148C372.304 150.074 372.165 150.037 372.004 150.037C371.827 150.037 371.674 150.081 371.545 150.169C371.417 150.255 371.319 150.368 371.25 150.508C371.181 150.647 371.146 150.796 371.146 150.956V151.212C371.146 151.43 371.184 151.615 371.259 151.767C371.336 151.917 371.442 152.032 371.577 152.111C371.713 152.189 371.87 152.228 372.049 152.228C372.166 152.228 372.272 152.212 372.366 152.179C372.461 152.145 372.543 152.095 372.612 152.028C372.681 151.961 372.735 151.877 372.772 151.776L373.201 151.897C373.156 152.042 373.08 152.17 372.974 152.281C372.867 152.39 372.735 152.475 372.578 152.537C372.421 152.597 372.245 152.627 372.049 152.627ZM373.922 152.567V149.676H374.351V150.112H374.381C374.434 149.969 374.529 149.853 374.667 149.764C374.805 149.675 374.961 149.631 375.134 149.631C375.167 149.631 375.208 149.631 375.257 149.632C375.306 149.634 375.343 149.636 375.368 149.638V150.09C375.353 150.086 375.318 150.08 375.264 150.073C375.211 150.064 375.156 150.06 375.097 150.06C374.956 150.06 374.831 150.089 374.72 150.148C374.611 150.206 374.524 150.286 374.46 150.389C374.398 150.491 374.366 150.607 374.366 150.737V152.567H373.922ZM376.338 150.828V152.567H375.894V149.676H376.323V150.127H376.361C376.429 149.981 376.532 149.863 376.67 149.774C376.808 149.683 376.986 149.638 377.204 149.638C377.4 149.638 377.571 149.678 377.718 149.759C377.865 149.838 377.979 149.958 378.06 150.12C378.142 150.281 378.183 150.484 378.183 150.73V152.567H377.739V150.76C377.739 150.533 377.68 150.356 377.562 150.229C377.444 150.101 377.282 150.037 377.076 150.037C376.934 150.037 376.808 150.068 376.696 150.129C376.585 150.191 376.498 150.281 376.434 150.398C376.37 150.516 376.338 150.659 376.338 150.828ZM379.845 152.634C379.662 152.634 379.496 152.6 379.346 152.531C379.197 152.461 379.078 152.36 378.991 152.228C378.903 152.095 378.859 151.934 378.859 151.746C378.859 151.58 378.892 151.446 378.957 151.343C379.022 151.239 379.109 151.158 379.218 151.099C379.328 151.04 379.448 150.996 379.58 150.967C379.713 150.937 379.846 150.913 379.981 150.895C380.156 150.873 380.299 150.856 380.408 150.845C380.518 150.832 380.599 150.811 380.649 150.782C380.7 150.754 380.726 150.703 380.726 150.632V150.617C380.726 150.431 380.675 150.287 380.574 150.184C380.473 150.081 380.321 150.03 380.116 150.03C379.904 150.03 379.738 150.076 379.617 150.169C379.497 150.262 379.412 150.361 379.363 150.466L378.942 150.316C379.017 150.14 379.117 150.003 379.243 149.905C379.37 149.806 379.508 149.737 379.657 149.698C379.807 149.658 379.956 149.638 380.101 149.638C380.194 149.638 380.301 149.649 380.421 149.672C380.543 149.693 380.66 149.738 380.773 149.806C380.887 149.873 380.982 149.976 381.057 150.112C381.132 150.249 381.17 150.432 381.17 150.662V152.567H380.726V152.175H380.703C380.673 152.238 380.623 152.305 380.553 152.377C380.483 152.448 380.389 152.509 380.272 152.559C380.156 152.609 380.013 152.634 379.845 152.634ZM379.913 152.235C380.089 152.235 380.237 152.201 380.357 152.132C380.479 152.063 380.57 151.974 380.632 151.865C380.695 151.755 380.726 151.641 380.726 151.52V151.114C380.707 151.136 380.666 151.157 380.602 151.176C380.539 151.193 380.466 151.209 380.383 151.223C380.302 151.235 380.222 151.247 380.144 151.257C380.068 151.265 380.006 151.273 379.958 151.279C379.843 151.294 379.735 151.319 379.634 151.353C379.535 151.385 379.455 151.435 379.393 151.501C379.333 151.567 379.303 151.656 379.303 151.769C379.303 151.923 379.36 152.04 379.474 152.119C379.59 152.197 379.736 152.235 379.913 152.235ZM381.981 152.567V149.676H382.41V150.127H382.448C382.508 149.973 382.605 149.853 382.739 149.768C382.874 149.681 383.035 149.638 383.223 149.638C383.414 149.638 383.572 149.681 383.699 149.768C383.827 149.853 383.927 149.973 383.998 150.127H384.029C384.103 149.978 384.214 149.86 384.362 149.772C384.51 149.683 384.687 149.638 384.894 149.638C385.153 149.638 385.364 149.719 385.529 149.881C385.693 150.041 385.775 150.292 385.775 150.632V152.567H385.331V150.632C385.331 150.419 385.273 150.266 385.156 150.174C385.039 150.083 384.902 150.037 384.744 150.037C384.541 150.037 384.383 150.099 384.271 150.222C384.16 150.343 384.104 150.498 384.104 150.685V152.567H383.652V150.587C383.652 150.422 383.599 150.29 383.492 150.19C383.386 150.088 383.248 150.037 383.08 150.037C382.965 150.037 382.857 150.068 382.756 150.129C382.657 150.191 382.577 150.276 382.515 150.385C382.455 150.493 382.425 150.618 382.425 150.76V152.567H381.981ZM387.799 152.627C387.521 152.627 387.281 152.565 387.079 152.442C386.878 152.318 386.723 152.145 386.614 151.923C386.506 151.7 386.452 151.44 386.452 151.144C386.452 150.848 386.506 150.587 386.614 150.361C386.723 150.134 386.875 149.957 387.069 149.83C387.265 149.702 387.493 149.638 387.754 149.638C387.905 149.638 388.053 149.663 388.2 149.713C388.347 149.764 388.481 149.845 388.601 149.958C388.722 150.07 388.818 150.218 388.889 150.402C388.961 150.587 388.996 150.814 388.996 151.084V151.272H386.768V150.888H388.545C388.545 150.725 388.512 150.579 388.447 150.451C388.383 150.323 388.291 150.222 388.172 150.148C388.054 150.074 387.915 150.037 387.754 150.037C387.577 150.037 387.424 150.081 387.295 150.169C387.167 150.255 387.068 150.368 386.999 150.508C386.93 150.647 386.896 150.796 386.896 150.956V151.212C386.896 151.43 386.934 151.615 387.009 151.767C387.085 151.917 387.191 152.032 387.327 152.111C387.462 152.189 387.62 152.228 387.799 152.228C387.916 152.228 388.021 152.212 388.116 152.179C388.211 152.145 388.293 152.095 388.362 152.028C388.431 151.961 388.484 151.877 388.522 151.776L388.951 151.897C388.906 152.042 388.83 152.17 388.723 152.281C388.617 152.39 388.485 152.475 388.328 152.537C388.171 152.597 387.995 152.627 387.799 152.627Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip5_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M473.708 144.858C473.708 144.37 474.104 143.975 474.591 143.975H477.241C477.729 143.975 478.125 144.37 478.125 144.858V147.508C478.125 147.996 477.729 148.392 477.241 148.392H476.358V149.275C476.358 149.763 475.963 150.158 475.475 150.158H472.825C472.337 150.158 471.941 149.763 471.941 149.275V146.625C471.941 146.137 472.337 145.742 472.825 145.742H473.708V144.858ZM474.591 144.637H477.241C477.363 144.637 477.462 144.736 477.462 144.858V147.508C477.462 147.63 477.363 147.729 477.241 147.729H474.591C474.469 147.729 474.371 147.63 474.371 147.508V144.858C474.371 144.736 474.469 144.637 474.591 144.637ZM473.708 146.404H472.825C472.703 146.404 472.604 146.503 472.604 146.625V149.275C472.604 149.397 472.703 149.496 472.825 149.496H475.475C475.597 149.496 475.696 149.397 475.696 149.275V148.392H474.591C474.104 148.392 473.708 147.996 473.708 147.508V146.404Z"
              fill="#1B2029"
            />
          </g>
          <path
            d="M488.284 144.417C488.284 144.905 488.68 145.3 489.168 145.3C489.655 145.3 490.051 144.905 490.051 144.417C490.051 143.929 489.655 143.533 489.168 143.533C488.68 143.533 488.284 143.929 488.284 144.417Z"
            fill="#1B2029"
          />
          <path
            d="M489.168 147.95C488.68 147.95 488.284 147.555 488.284 147.067C488.284 146.579 488.68 146.183 489.168 146.183C489.655 146.183 490.051 146.579 490.051 147.067C490.051 147.555 489.655 147.95 489.168 147.95Z"
            fill="#1B2029"
          />
          <path
            d="M489.168 150.6C488.68 150.6 488.284 150.205 488.284 149.717C488.284 149.229 488.68 148.833 489.168 148.833C489.655 148.833 490.051 149.229 490.051 149.717C490.051 150.205 489.655 150.6 489.168 150.6Z"
            fill="#1B2029"
          />
          <mask id="path-50-inside-3_4955_16369" fill="white">
            <path
              d="M344.3 165.283C344.3 163.332 345.882 161.75 347.833 161.75H494.466C496.418 161.75 498 163.332 498 165.283V182.283C498 184.235 496.418 185.817 494.466 185.817H347.833C345.882 185.817 344.3 184.235 344.3 182.283V165.283Z"
            />
          </mask>
          <path
            d="M344.3 165.283C344.3 163.332 345.882 161.75 347.833 161.75H494.466C496.418 161.75 498 163.332 498 165.283V182.283C498 184.235 496.418 185.817 494.466 185.817H347.833C345.882 185.817 344.3 184.235 344.3 182.283V165.283Z"
            fill="white"
          />
          <path
            d="M344.3 161.75H498H344.3M498 182.283C498 184.357 496.319 186.037 494.246 186.037H348.054C345.981 186.037 344.3 184.357 344.3 182.283V182.283C344.3 184.113 345.882 185.596 347.833 185.596H494.466C496.418 185.596 498 184.113 498 182.283V182.283ZM498 182.283M344.3 185.817V161.75V185.817M344.3 185.817M498 161.75V185.817V161.75"
            fill="#A8B3C8"
            mask="url(#path-50-inside-3_4955_16369)"
          />
          <g clip-path="url(#clip6_4955_16369)">
            <rect
              x="345.478"
              y="168.483"
              width="18.8445"
              height="10.6"
              fill="url(#pattern1_4955_16369)"
            />
          </g>
          <path
            d="M364.227 172.283V167.786H365.83C366.18 167.786 366.47 167.85 366.7 167.977C366.93 168.105 367.102 168.279 367.216 168.5C367.33 168.72 367.387 168.967 367.387 169.242C367.387 169.519 367.329 169.768 367.214 169.989C367.1 170.208 366.927 170.383 366.696 170.511C366.466 170.639 366.177 170.702 365.828 170.702H364.726V170.127H365.767C365.988 170.127 366.167 170.089 366.305 170.013C366.442 169.935 366.543 169.83 366.608 169.697C366.672 169.563 366.704 169.412 366.704 169.242C366.704 169.072 366.672 168.922 366.608 168.79C366.543 168.658 366.442 168.555 366.302 168.48C366.165 168.406 365.983 168.368 365.758 168.368H364.906V172.283H364.227ZM369.541 172.351C369.209 172.351 368.923 172.28 368.683 172.138C368.444 171.995 368.26 171.794 368.129 171.535C368.001 171.274 367.936 170.969 367.936 170.619C367.936 170.273 368.001 169.969 368.129 169.705C368.26 169.442 368.441 169.236 368.674 169.088C368.908 168.941 369.182 168.867 369.495 168.867C369.685 168.867 369.87 168.898 370.048 168.961C370.227 169.024 370.387 169.123 370.529 169.258C370.671 169.392 370.783 169.567 370.865 169.782C370.947 169.996 370.988 170.256 370.988 170.562V170.795H368.307V170.303H370.345C370.345 170.13 370.31 169.977 370.24 169.844C370.169 169.709 370.07 169.603 369.943 169.525C369.817 169.448 369.669 169.409 369.5 169.409C369.315 169.409 369.154 169.454 369.016 169.545C368.88 169.634 368.775 169.752 368.7 169.897C368.627 170.04 368.59 170.196 368.59 170.364V170.748C368.59 170.974 368.63 171.166 368.709 171.324C368.79 171.482 368.902 171.603 369.045 171.686C369.188 171.768 369.356 171.809 369.548 171.809C369.672 171.809 369.786 171.791 369.888 171.756C369.991 171.72 370.079 171.666 370.154 171.594C370.229 171.522 370.286 171.434 370.325 171.328L370.947 171.44C370.897 171.623 370.807 171.783 370.679 171.921C370.551 172.057 370.391 172.163 370.198 172.239C370.006 172.314 369.787 172.351 369.541 172.351ZM371.717 172.283V168.911H372.351V169.446H372.386C372.448 169.265 372.556 169.122 372.711 169.018C372.868 168.913 373.045 168.86 373.243 168.86C373.284 168.86 373.332 168.862 373.388 168.864C373.445 168.867 373.489 168.871 373.522 168.875V169.503C373.495 169.496 373.448 169.488 373.381 169.479C373.314 169.469 373.246 169.464 373.179 169.464C373.024 169.464 372.886 169.497 372.764 169.563C372.644 169.627 372.549 169.717 372.479 169.833C372.408 169.947 372.373 170.077 372.373 170.224V172.283H371.717ZM376.617 169.734L376.022 169.839C375.997 169.763 375.958 169.691 375.904 169.622C375.851 169.553 375.779 169.497 375.688 169.453C375.598 169.409 375.484 169.387 375.348 169.387C375.162 169.387 375.007 169.429 374.883 169.512C374.758 169.594 374.696 169.7 374.696 169.831C374.696 169.943 374.738 170.034 374.821 170.103C374.904 170.172 375.039 170.228 375.225 170.272L375.761 170.395C376.071 170.467 376.302 170.577 376.455 170.727C376.607 170.876 376.683 171.07 376.683 171.308C376.683 171.51 376.624 171.69 376.507 171.849C376.392 172.005 376.23 172.128 376.022 172.217C375.816 172.307 375.576 172.351 375.304 172.351C374.926 172.351 374.618 172.271 374.38 172.11C374.141 171.947 373.995 171.717 373.941 171.418L374.575 171.322C374.615 171.487 374.696 171.612 374.819 171.697C374.942 171.78 375.102 171.822 375.3 171.822C375.515 171.822 375.687 171.778 375.816 171.688C375.945 171.598 376.009 171.487 376.009 171.357C376.009 171.251 375.969 171.163 375.89 171.091C375.813 171.019 375.693 170.965 375.532 170.929L374.962 170.803C374.647 170.732 374.414 170.617 374.263 170.461C374.114 170.304 374.039 170.106 374.039 169.866C374.039 169.667 374.095 169.492 374.206 169.343C374.317 169.194 374.471 169.077 374.667 168.994C374.863 168.909 375.088 168.867 375.341 168.867C375.706 168.867 375.993 168.946 376.202 169.104C376.412 169.26 376.55 169.471 376.617 169.734ZM378.826 172.351C378.509 172.351 378.233 172.279 377.998 172.134C377.762 171.989 377.579 171.786 377.449 171.526C377.319 171.265 377.253 170.961 377.253 170.612C377.253 170.262 377.319 169.957 377.449 169.694C377.579 169.432 377.762 169.229 377.998 169.084C378.233 168.939 378.509 168.867 378.826 168.867C379.142 168.867 379.418 168.939 379.653 169.084C379.889 169.229 380.072 169.432 380.202 169.694C380.333 169.957 380.398 170.262 380.398 170.612C380.398 170.961 380.333 171.265 380.202 171.526C380.072 171.786 379.889 171.989 379.653 172.134C379.418 172.279 379.142 172.351 378.826 172.351ZM378.828 171.8C379.033 171.8 379.203 171.746 379.337 171.638C379.472 171.529 379.571 171.385 379.636 171.205C379.702 171.025 379.735 170.827 379.735 170.61C379.735 170.395 379.702 170.197 379.636 170.017C379.571 169.836 379.472 169.69 379.337 169.58C379.203 169.471 379.033 169.416 378.828 169.416C378.621 169.416 378.45 169.471 378.314 169.58C378.179 169.69 378.079 169.836 378.013 170.017C377.949 170.197 377.917 170.395 377.917 170.61C377.917 170.827 377.949 171.025 378.013 171.205C378.079 171.385 378.179 171.529 378.314 171.638C378.45 171.746 378.621 171.8 378.828 171.8ZM381.787 170.281V172.283H381.131V168.911H381.761V169.46H381.803C381.88 169.281 382.002 169.137 382.167 169.029C382.334 168.921 382.544 168.867 382.797 168.867C383.027 168.867 383.228 168.915 383.401 169.012C383.574 169.107 383.708 169.249 383.803 169.438C383.898 169.626 383.946 169.86 383.946 170.138V172.283H383.289V170.217C383.289 169.973 383.225 169.782 383.098 169.644C382.971 169.505 382.796 169.435 382.573 169.435C382.421 169.435 382.286 169.468 382.167 169.534C382.05 169.6 381.957 169.697 381.888 169.824C381.821 169.95 381.787 170.102 381.787 170.281ZM385.808 172.358C385.594 172.358 385.401 172.318 385.228 172.239C385.055 172.159 384.918 172.043 384.817 171.89C384.718 171.738 384.668 171.551 384.668 171.33C384.668 171.14 384.705 170.983 384.778 170.86C384.851 170.737 384.95 170.64 385.074 170.568C385.199 170.497 385.338 170.443 385.491 170.406C385.645 170.369 385.802 170.342 385.961 170.322C386.163 170.299 386.327 170.28 386.453 170.265C386.579 170.249 386.671 170.224 386.728 170.189C386.785 170.153 386.813 170.096 386.813 170.017V170.002C386.813 169.81 386.759 169.662 386.651 169.556C386.544 169.451 386.384 169.398 386.172 169.398C385.951 169.398 385.777 169.447 385.65 169.545C385.524 169.642 385.437 169.749 385.388 169.868L384.771 169.727C384.844 169.522 384.951 169.357 385.092 169.231C385.234 169.104 385.397 169.012 385.581 168.955C385.766 168.896 385.96 168.867 386.163 168.867C386.298 168.867 386.441 168.883 386.592 168.915C386.744 168.946 386.886 169.003 387.018 169.086C387.151 169.17 387.26 169.289 387.345 169.444C387.43 169.598 387.472 169.798 387.472 170.044V172.283H386.831V171.822H386.805C386.762 171.907 386.698 171.991 386.613 172.073C386.529 172.155 386.42 172.223 386.286 172.277C386.153 172.331 385.994 172.358 385.808 172.358ZM385.95 171.831C386.132 171.831 386.287 171.795 386.416 171.723C386.546 171.652 386.645 171.558 386.712 171.442C386.781 171.325 386.816 171.2 386.816 171.067V170.632C386.792 170.656 386.747 170.677 386.679 170.698C386.613 170.717 386.538 170.734 386.453 170.748C386.368 170.762 386.286 170.774 386.205 170.786C386.125 170.796 386.057 170.805 386.003 170.812C385.876 170.828 385.759 170.855 385.654 170.893C385.55 170.931 385.467 170.986 385.404 171.058C385.342 171.128 385.311 171.222 385.311 171.339C385.311 171.502 385.371 171.625 385.491 171.708C385.611 171.79 385.764 171.831 385.95 171.831ZM389.003 167.786V172.283H388.347V167.786H389.003ZM394.619 169.207C394.576 169.074 394.519 168.955 394.448 168.849C394.377 168.742 394.293 168.651 394.195 168.577C394.097 168.501 393.985 168.443 393.859 168.403C393.735 168.364 393.598 168.344 393.448 168.344C393.195 168.344 392.967 168.409 392.763 168.54C392.56 168.67 392.399 168.861 392.28 169.113C392.163 169.363 392.105 169.67 392.105 170.033C392.105 170.397 392.164 170.705 392.282 170.957C392.401 171.209 392.564 171.4 392.77 171.53C392.976 171.66 393.211 171.726 393.475 171.726C393.719 171.726 393.932 171.676 394.114 171.576C394.297 171.477 394.438 171.336 394.538 171.155C394.639 170.972 394.689 170.757 394.689 170.509L394.865 170.542H393.578V169.982H395.346V170.494C395.346 170.871 395.265 171.199 395.104 171.477C394.944 171.754 394.723 171.968 394.441 172.119C394.16 172.269 393.838 172.345 393.475 172.345C393.068 172.345 392.711 172.251 392.403 172.064C392.097 171.876 391.859 171.611 391.687 171.267C391.516 170.921 391.43 170.511 391.43 170.037C391.43 169.678 391.48 169.356 391.58 169.071C391.679 168.785 391.819 168.543 391.999 168.344C392.181 168.144 392.394 167.991 392.638 167.885C392.884 167.778 393.153 167.725 393.444 167.725C393.687 167.725 393.913 167.761 394.123 167.832C394.333 167.904 394.521 168.006 394.685 168.138C394.85 168.269 394.987 168.426 395.095 168.608C395.204 168.788 395.277 168.987 395.315 169.207H394.619ZM396.154 172.283V168.911H396.784V169.46H396.826C396.896 169.274 397.011 169.129 397.171 169.025C397.33 168.919 397.521 168.867 397.744 168.867C397.969 168.867 398.158 168.919 398.31 169.025C398.464 169.13 398.578 169.275 398.651 169.46H398.686C398.766 169.279 398.895 169.136 399.07 169.029C399.246 168.921 399.455 168.867 399.698 168.867C400.004 168.867 400.254 168.963 400.447 169.154C400.642 169.346 400.739 169.635 400.739 170.022V172.283H400.082V170.083C400.082 169.855 400.02 169.689 399.896 169.587C399.771 169.484 399.623 169.433 399.45 169.433C399.236 169.433 399.07 169.499 398.952 169.631C398.833 169.761 398.774 169.929 398.774 170.134V172.283H398.119V170.041C398.119 169.858 398.062 169.711 397.948 169.6C397.834 169.489 397.685 169.433 397.502 169.433C397.378 169.433 397.263 169.466 397.158 169.532C397.054 169.596 396.97 169.686 396.905 169.802C396.842 169.918 396.811 170.052 396.811 170.204V172.283H396.154ZM402.6 172.358C402.387 172.358 402.194 172.318 402.021 172.239C401.848 172.159 401.711 172.043 401.61 171.89C401.511 171.738 401.461 171.551 401.461 171.33C401.461 171.14 401.497 170.983 401.571 170.86C401.644 170.737 401.743 170.64 401.867 170.568C401.991 170.497 402.131 170.443 402.284 170.406C402.438 170.369 402.595 170.342 402.754 170.322C402.956 170.299 403.12 170.28 403.246 170.265C403.372 170.249 403.463 170.224 403.52 170.189C403.578 170.153 403.606 170.096 403.606 170.017V170.002C403.606 169.81 403.552 169.662 403.444 169.556C403.337 169.451 403.177 169.398 402.965 169.398C402.744 169.398 402.57 169.447 402.442 169.545C402.316 169.642 402.229 169.749 402.181 169.868L401.564 169.727C401.637 169.522 401.744 169.357 401.885 169.231C402.027 169.104 402.19 169.012 402.374 168.955C402.559 168.896 402.753 168.867 402.956 168.867C403.091 168.867 403.234 168.883 403.384 168.915C403.537 168.946 403.679 169.003 403.81 169.086C403.944 169.17 404.053 169.289 404.138 169.444C404.222 169.598 404.265 169.798 404.265 170.044V172.283H403.624V171.822H403.597C403.555 171.907 403.491 171.991 403.406 172.073C403.321 172.155 403.212 172.223 403.079 172.277C402.946 172.331 402.786 172.358 402.6 172.358ZM402.743 171.831C402.925 171.831 403.08 171.795 403.209 171.723C403.339 171.652 403.438 171.558 403.505 171.442C403.574 171.325 403.608 171.2 403.608 171.067V170.632C403.585 170.656 403.54 170.677 403.472 170.698C403.406 170.717 403.331 170.734 403.246 170.748C403.161 170.762 403.078 170.774 402.998 170.786C402.917 170.796 402.85 170.805 402.796 170.812C402.669 170.828 402.552 170.855 402.447 170.893C402.343 170.931 402.259 170.986 402.196 171.058C402.135 171.128 402.104 171.222 402.104 171.339C402.104 171.502 402.164 171.625 402.284 171.708C402.404 171.79 402.557 171.831 402.743 171.831ZM405.139 172.283V168.911H405.796V172.283H405.139ZM405.471 168.39C405.357 168.39 405.259 168.352 405.177 168.276C405.096 168.198 405.056 168.106 405.056 167.999C405.056 167.891 405.096 167.799 405.177 167.723C405.259 167.645 405.357 167.606 405.471 167.606C405.585 167.606 405.682 167.645 405.763 167.723C405.845 167.799 405.886 167.891 405.886 167.999C405.886 168.106 405.845 168.198 405.763 168.276C405.682 168.352 405.585 168.39 405.471 168.39ZM407.336 167.786V172.283H406.679V167.786H407.336Z"
            fill="#1B2029"
          />
          <path
            d="M366.73 175.429H367.196V177.981C367.196 178.244 367.134 178.48 367.01 178.687C366.887 178.892 366.713 179.055 366.489 179.174C366.264 179.292 366.001 179.351 365.698 179.351C365.396 179.351 365.132 179.292 364.908 179.174C364.683 179.055 364.509 178.892 364.385 178.687C364.262 178.48 364.2 178.244 364.2 177.981V175.429H364.667V177.943C364.667 178.131 364.708 178.299 364.791 178.446C364.874 178.591 364.992 178.706 365.145 178.79C365.299 178.873 365.484 178.914 365.698 178.914C365.913 178.914 366.097 178.873 366.252 178.79C366.406 178.706 366.524 178.591 366.605 178.446C366.688 178.299 366.73 178.131 366.73 177.943V175.429ZM370.116 177.04L369.717 177.153C369.692 177.086 369.655 177.022 369.606 176.959C369.558 176.895 369.493 176.842 369.41 176.801C369.327 176.759 369.221 176.739 369.092 176.739C368.915 176.739 368.768 176.78 368.65 176.861C368.533 176.941 368.475 177.044 368.475 177.168C368.475 177.278 368.515 177.365 368.595 177.429C368.676 177.493 368.801 177.547 368.972 177.589L369.401 177.695C369.659 177.758 369.852 177.854 369.979 177.983C370.105 178.111 370.169 178.276 370.169 178.478C370.169 178.643 370.121 178.791 370.026 178.922C369.932 179.052 369.8 179.155 369.63 179.231C369.461 179.306 369.264 179.344 369.04 179.344C368.745 179.344 368.501 179.28 368.307 179.152C368.114 179.024 367.992 178.837 367.94 178.591L368.362 178.485C368.402 178.641 368.478 178.758 368.59 178.835C368.703 178.913 368.85 178.952 369.032 178.952C369.239 178.952 369.403 178.908 369.525 178.82C369.648 178.731 369.71 178.625 369.71 178.5C369.71 178.4 369.674 178.316 369.604 178.248C369.534 178.179 369.426 178.128 369.28 178.094L368.799 177.981C368.534 177.918 368.339 177.821 368.215 177.689C368.092 177.556 368.031 177.39 368.031 177.19C368.031 177.027 368.077 176.883 368.168 176.758C368.261 176.632 368.387 176.534 368.546 176.462C368.707 176.391 368.889 176.355 369.092 176.355C369.378 176.355 369.603 176.418 369.766 176.543C369.93 176.668 370.047 176.834 370.116 177.04ZM372.049 179.344C371.771 179.344 371.531 179.282 371.329 179.159C371.128 179.035 370.973 178.862 370.864 178.64C370.756 178.416 370.702 178.157 370.702 177.86C370.702 177.564 370.756 177.303 370.864 177.078C370.973 176.85 371.125 176.673 371.319 176.547C371.515 176.419 371.743 176.355 372.004 176.355C372.155 176.355 372.304 176.38 372.45 176.43C372.597 176.48 372.731 176.562 372.851 176.675C372.972 176.786 373.068 176.934 373.139 177.119C373.211 177.303 373.246 177.53 373.246 177.8V177.988H371.018V177.604H372.795C372.795 177.441 372.762 177.296 372.697 177.168C372.633 177.04 372.541 176.939 372.422 176.865C372.304 176.791 372.165 176.754 372.004 176.754C371.827 176.754 371.674 176.798 371.545 176.886C371.417 176.972 371.319 177.085 371.25 177.224C371.181 177.364 371.146 177.513 371.146 177.672V177.928C371.146 178.147 371.184 178.332 371.259 178.483C371.336 178.634 371.442 178.749 371.577 178.828C371.713 178.906 371.87 178.945 372.049 178.945C372.166 178.945 372.272 178.928 372.366 178.896C372.461 178.862 372.543 178.812 372.612 178.745C372.681 178.677 372.735 178.593 372.772 178.493L373.201 178.613C373.156 178.759 373.08 178.887 372.974 178.997C372.867 179.106 372.735 179.192 372.578 179.253C372.421 179.313 372.245 179.344 372.049 179.344ZM373.922 179.283V176.392H374.351V176.829H374.381C374.434 176.686 374.529 176.57 374.667 176.481C374.805 176.392 374.961 176.347 375.134 176.347C375.167 176.347 375.208 176.348 375.257 176.349C375.306 176.35 375.343 176.352 375.368 176.355V176.806C375.353 176.803 375.318 176.797 375.264 176.79C375.211 176.781 375.156 176.776 375.097 176.776C374.956 176.776 374.831 176.806 374.72 176.865C374.611 176.923 374.524 177.003 374.46 177.106C374.398 177.207 374.366 177.323 374.366 177.454V179.283H373.922ZM376.338 177.544V179.283H375.894V176.392H376.323V176.844H376.361C376.429 176.697 376.532 176.579 376.67 176.49C376.808 176.4 376.986 176.355 377.204 176.355C377.4 176.355 377.571 176.395 377.718 176.475C377.865 176.554 377.979 176.675 378.06 176.837C378.142 176.997 378.183 177.2 378.183 177.446V179.283H377.739V177.477C377.739 177.249 377.68 177.072 377.562 176.946C377.444 176.818 377.282 176.754 377.076 176.754C376.934 176.754 376.808 176.785 376.696 176.846C376.585 176.907 376.498 176.997 376.434 177.115C376.37 177.233 376.338 177.376 376.338 177.544ZM379.845 179.351C379.662 179.351 379.496 179.317 379.346 179.248C379.197 179.177 379.078 179.076 378.991 178.945C378.903 178.812 378.859 178.651 378.859 178.463C378.859 178.297 378.892 178.163 378.957 178.06C379.022 177.956 379.109 177.874 379.218 177.815C379.328 177.756 379.448 177.712 379.58 177.684C379.713 177.653 379.846 177.63 379.981 177.612C380.156 177.589 380.299 177.572 380.408 177.561C380.518 177.549 380.599 177.528 380.649 177.499C380.7 177.47 380.726 177.42 380.726 177.349V177.333C380.726 177.148 380.675 177.003 380.574 176.901C380.473 176.798 380.321 176.746 380.116 176.746C379.904 176.746 379.738 176.793 379.617 176.886C379.497 176.978 379.412 177.078 379.363 177.183L378.942 177.032C379.017 176.857 379.117 176.72 379.243 176.622C379.37 176.523 379.508 176.454 379.657 176.415C379.807 176.375 379.956 176.355 380.101 176.355C380.194 176.355 380.301 176.366 380.421 176.389C380.543 176.41 380.66 176.455 380.773 176.522C380.887 176.59 380.982 176.692 381.057 176.829C381.132 176.966 381.17 177.149 381.17 177.379V179.283H380.726V178.892H380.703C380.673 178.955 380.623 179.022 380.553 179.093C380.483 179.165 380.389 179.226 380.272 179.276C380.156 179.326 380.013 179.351 379.845 179.351ZM379.913 178.952C380.089 178.952 380.237 178.918 380.357 178.849C380.479 178.78 380.57 178.69 380.632 178.581C380.695 178.472 380.726 178.357 380.726 178.237V177.83C380.707 177.853 380.666 177.874 380.602 177.892C380.539 177.91 380.466 177.926 380.383 177.94C380.302 177.952 380.222 177.963 380.144 177.973C380.068 177.982 380.006 177.99 379.958 177.996C379.843 178.011 379.735 178.035 379.634 178.069C379.535 178.102 379.455 178.152 379.393 178.218C379.333 178.283 379.303 178.372 379.303 178.485C379.303 178.64 379.36 178.756 379.474 178.835C379.59 178.913 379.736 178.952 379.913 178.952ZM381.981 179.283V176.392H382.41V176.844H382.448C382.508 176.69 382.605 176.57 382.739 176.485C382.874 176.398 383.035 176.355 383.223 176.355C383.414 176.355 383.572 176.398 383.699 176.485C383.827 176.57 383.927 176.69 383.998 176.844H384.029C384.103 176.695 384.214 176.576 384.362 176.488C384.51 176.399 384.687 176.355 384.894 176.355C385.153 176.355 385.364 176.436 385.529 176.598C385.693 176.758 385.775 177.008 385.775 177.349V179.283H385.331V177.349C385.331 177.135 385.273 176.983 385.156 176.891C385.039 176.8 384.902 176.754 384.744 176.754C384.541 176.754 384.383 176.815 384.271 176.938C384.16 177.06 384.104 177.214 384.104 177.401V179.283H383.652V177.303C383.652 177.139 383.599 177.007 383.492 176.906C383.386 176.805 383.248 176.754 383.08 176.754C382.965 176.754 382.857 176.785 382.756 176.846C382.657 176.907 382.577 176.993 382.515 177.102C382.455 177.21 382.425 177.335 382.425 177.477V179.283H381.981ZM387.799 179.344C387.521 179.344 387.281 179.282 387.079 179.159C386.878 179.035 386.723 178.862 386.614 178.64C386.506 178.416 386.452 178.157 386.452 177.86C386.452 177.564 386.506 177.303 386.614 177.078C386.723 176.85 386.875 176.673 387.069 176.547C387.265 176.419 387.493 176.355 387.754 176.355C387.905 176.355 388.053 176.38 388.2 176.43C388.347 176.48 388.481 176.562 388.601 176.675C388.722 176.786 388.818 176.934 388.889 177.119C388.961 177.303 388.996 177.53 388.996 177.8V177.988H386.768V177.604H388.545C388.545 177.441 388.512 177.296 388.447 177.168C388.383 177.04 388.291 176.939 388.172 176.865C388.054 176.791 387.915 176.754 387.754 176.754C387.577 176.754 387.424 176.798 387.295 176.886C387.167 176.972 387.068 177.085 386.999 177.224C386.93 177.364 386.896 177.513 386.896 177.672V177.928C386.896 178.147 386.934 178.332 387.009 178.483C387.085 178.634 387.191 178.749 387.327 178.828C387.462 178.906 387.62 178.945 387.799 178.945C387.916 178.945 388.021 178.928 388.116 178.896C388.211 178.862 388.293 178.812 388.362 178.745C388.431 178.677 388.484 178.593 388.522 178.493L388.951 178.613C388.906 178.759 388.83 178.887 388.723 178.997C388.617 179.106 388.485 179.192 388.328 179.253C388.171 179.313 387.995 179.344 387.799 179.344Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip7_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M473.708 171.575C473.708 171.087 474.104 170.692 474.591 170.692H477.241C477.729 170.692 478.125 171.087 478.125 171.575V174.225C478.125 174.713 477.729 175.108 477.241 175.108H476.358V175.992C476.358 176.48 475.963 176.875 475.475 176.875H472.825C472.337 176.875 471.941 176.48 471.941 175.992V173.342C471.941 172.854 472.337 172.458 472.825 172.458H473.708V171.575ZM474.591 171.354H477.241C477.363 171.354 477.462 171.453 477.462 171.575V174.225C477.462 174.347 477.363 174.446 477.241 174.446H474.591C474.469 174.446 474.371 174.347 474.371 174.225V171.575C474.371 171.453 474.469 171.354 474.591 171.354ZM473.708 173.121H472.825C472.703 173.121 472.604 173.22 472.604 173.342V175.992C472.604 176.114 472.703 176.212 472.825 176.212H475.475C475.597 176.212 475.696 176.114 475.696 175.992V175.108H474.591C474.104 175.108 473.708 174.713 473.708 174.225V173.121Z"
              fill="#1B2029"
            />
          </g>
          <path
            d="M488.284 171.133C488.284 171.621 488.68 172.017 489.168 172.017C489.655 172.017 490.051 171.621 490.051 171.133C490.051 170.645 489.655 170.25 489.168 170.25C488.68 170.25 488.284 170.645 488.284 171.133Z"
            fill="#1B2029"
          />
          <path
            d="M489.168 174.667C488.68 174.667 488.284 174.271 488.284 173.783C488.284 173.295 488.68 172.9 489.168 172.9C489.655 172.9 490.051 173.295 490.051 173.783C490.051 174.271 489.655 174.667 489.168 174.667Z"
            fill="#1B2029"
          />
          <path
            d="M489.168 177.317C488.68 177.317 488.284 176.921 488.284 176.433C488.284 175.945 488.68 175.55 489.168 175.55C489.655 175.55 490.051 175.945 490.051 176.433C490.051 176.921 489.655 177.317 489.168 177.317Z"
            fill="#1B2029"
          />
          <path
            d="M346.56 201.567V197.07H349.349V197.654H347.239V199.024H349.149V199.606H347.239V201.567H346.56ZM351.1 201.641C350.887 201.641 350.693 201.602 350.521 201.523C350.348 201.442 350.211 201.326 350.11 201.174C350.01 201.021 349.961 200.835 349.961 200.614C349.961 200.423 349.997 200.267 350.07 200.144C350.144 200.021 350.242 199.923 350.367 199.852C350.491 199.78 350.63 199.726 350.784 199.689C350.938 199.653 351.094 199.625 351.254 199.606C351.456 199.582 351.62 199.563 351.746 199.549C351.872 199.533 351.963 199.507 352.02 199.472C352.077 199.437 352.106 199.38 352.106 199.301V199.285C352.106 199.093 352.052 198.945 351.943 198.839C351.837 198.734 351.677 198.681 351.465 198.681C351.244 198.681 351.07 198.73 350.942 198.829C350.816 198.925 350.729 199.033 350.681 199.151L350.064 199.011C350.137 198.806 350.244 198.64 350.384 198.515C350.526 198.387 350.69 198.295 350.874 198.238C351.059 198.179 351.252 198.15 351.456 198.15C351.591 198.15 351.733 198.166 351.884 198.198C352.036 198.229 352.178 198.286 352.31 198.37C352.443 198.453 352.552 198.572 352.637 198.727C352.722 198.881 352.765 199.081 352.765 199.327V201.567H352.123V201.106H352.097C352.055 201.19 351.991 201.274 351.906 201.356C351.821 201.438 351.712 201.506 351.579 201.56C351.446 201.614 351.286 201.641 351.1 201.641ZM351.243 201.114C351.424 201.114 351.58 201.078 351.708 201.007C351.839 200.935 351.938 200.841 352.005 200.726C352.074 200.609 352.108 200.483 352.108 200.35V199.915C352.085 199.939 352.039 199.961 351.972 199.981C351.906 200 351.831 200.017 351.746 200.032C351.661 200.045 351.578 200.057 351.498 200.069C351.417 200.079 351.35 200.088 351.296 200.095C351.168 200.112 351.052 200.139 350.947 200.177C350.843 200.215 350.759 200.27 350.696 200.341C350.635 200.412 350.604 200.505 350.604 200.622C350.604 200.785 350.664 200.908 350.784 200.991C350.904 201.073 351.057 201.114 351.243 201.114ZM356.404 198.194L355.181 201.567H354.478L353.253 198.194H353.958L354.812 200.789H354.847L355.699 198.194H356.404ZM358.327 201.635C358.01 201.635 357.734 201.562 357.499 201.417C357.263 201.272 357.08 201.07 356.95 200.809C356.82 200.549 356.754 200.244 356.754 199.896C356.754 199.546 356.82 199.24 356.95 198.978C357.08 198.716 357.263 198.512 357.499 198.367C357.734 198.222 358.01 198.15 358.327 198.15C358.643 198.15 358.919 198.222 359.154 198.367C359.39 198.512 359.573 198.716 359.703 198.978C359.834 199.24 359.899 199.546 359.899 199.896C359.899 200.244 359.834 200.549 359.703 200.809C359.573 201.07 359.39 201.272 359.154 201.417C358.919 201.562 358.643 201.635 358.327 201.635ZM358.329 201.084C358.534 201.084 358.704 201.029 358.838 200.921C358.973 200.813 359.072 200.669 359.137 200.489C359.203 200.308 359.236 200.11 359.236 199.893C359.236 199.678 359.203 199.481 359.137 199.301C359.072 199.119 358.973 198.973 358.838 198.864C358.704 198.754 358.534 198.699 358.329 198.699C358.122 198.699 357.951 198.754 357.815 198.864C357.68 198.973 357.58 199.119 357.514 199.301C357.45 199.481 357.418 199.678 357.418 199.893C357.418 200.11 357.45 200.308 357.514 200.489C357.58 200.669 357.68 200.813 357.815 200.921C357.951 201.029 358.122 201.084 358.329 201.084ZM360.632 201.567V198.194H361.266V198.73H361.301C361.363 198.548 361.471 198.405 361.626 198.302C361.783 198.196 361.96 198.143 362.158 198.143C362.199 198.143 362.247 198.145 362.303 198.148C362.36 198.151 362.404 198.154 362.437 198.159V198.787C362.41 198.779 362.363 198.771 362.296 198.763C362.229 198.752 362.161 198.747 362.094 198.747C361.939 198.747 361.8 198.78 361.679 198.846C361.559 198.91 361.464 199.001 361.394 199.116C361.323 199.23 361.288 199.361 361.288 199.507V201.567H360.632ZM363.005 201.567V198.194H363.661V201.567H363.005ZM363.336 197.674C363.222 197.674 363.124 197.635 363.042 197.559C362.962 197.482 362.921 197.39 362.921 197.283C362.921 197.174 362.962 197.082 363.042 197.006C363.124 196.928 363.222 196.89 363.336 196.89C363.45 196.89 363.548 196.928 363.628 197.006C363.71 197.082 363.751 197.174 363.751 197.283C363.751 197.39 363.71 197.482 363.628 197.559C363.548 197.635 363.45 197.674 363.336 197.674ZM366.119 198.194V198.721H364.277V198.194H366.119ZM364.771 197.386H365.427V200.576C365.427 200.704 365.446 200.8 365.484 200.864C365.522 200.927 365.571 200.97 365.631 200.994C365.693 201.016 365.759 201.026 365.831 201.026C365.884 201.026 365.93 201.023 365.97 201.016C366.009 201.008 366.04 201.002 366.062 200.998L366.18 201.54C366.142 201.555 366.088 201.57 366.018 201.584C365.948 201.6 365.86 201.609 365.754 201.611C365.582 201.613 365.421 201.583 365.271 201.518C365.122 201.454 365.001 201.354 364.909 201.22C364.817 201.085 364.771 200.916 364.771 200.712V197.386ZM368.263 201.635C367.93 201.635 367.644 201.564 367.404 201.422C367.165 201.278 366.981 201.077 366.851 200.818C366.722 200.557 366.657 200.252 366.657 199.902C366.657 199.557 366.722 199.252 366.851 198.989C366.981 198.725 367.162 198.52 367.395 198.372C367.629 198.224 367.903 198.15 368.216 198.15C368.407 198.15 368.591 198.181 368.77 198.244C368.948 198.307 369.109 198.406 369.251 198.541C369.393 198.676 369.505 198.85 369.587 199.066C369.669 199.279 369.71 199.539 369.71 199.845V200.078H367.028V199.586H369.066C369.066 199.413 369.031 199.26 368.961 199.127C368.891 198.992 368.792 198.886 368.664 198.809C368.538 198.731 368.391 198.692 368.221 198.692C368.036 198.692 367.875 198.738 367.738 198.829C367.602 198.918 367.496 199.035 367.422 199.18C367.348 199.323 367.312 199.479 367.312 199.648V200.032C367.312 200.257 367.351 200.449 367.43 200.607C367.511 200.765 367.623 200.886 367.766 200.969C367.91 201.051 368.077 201.092 368.269 201.092C368.394 201.092 368.507 201.075 368.609 201.04C368.712 201.003 368.8 200.949 368.875 200.877C368.95 200.805 369.007 200.717 369.046 200.611L369.668 200.723C369.618 200.906 369.529 201.067 369.4 201.204C369.273 201.34 369.112 201.447 368.919 201.523C368.727 201.597 368.508 201.635 368.263 201.635ZM372.965 199.017L372.37 199.123C372.345 199.047 372.306 198.974 372.252 198.905C372.199 198.837 372.127 198.78 372.037 198.736C371.946 198.692 371.832 198.67 371.696 198.67C371.51 198.67 371.355 198.712 371.231 198.796C371.106 198.878 371.044 198.984 371.044 199.114C371.044 199.227 371.086 199.317 371.169 199.386C371.253 199.455 371.387 199.511 371.573 199.555L372.109 199.678C372.419 199.75 372.651 199.861 372.803 200.01C372.955 200.159 373.031 200.353 373.031 200.592C373.031 200.794 372.973 200.974 372.856 201.132C372.74 201.289 372.578 201.411 372.37 201.501C372.164 201.59 371.925 201.635 371.652 201.635C371.275 201.635 370.966 201.554 370.728 201.393C370.489 201.231 370.343 201 370.289 200.702L370.923 200.605C370.963 200.77 371.044 200.895 371.167 200.98C371.29 201.064 371.45 201.106 371.648 201.106C371.863 201.106 372.035 201.061 372.164 200.972C372.293 200.881 372.357 200.77 372.357 200.64C372.357 200.535 372.318 200.446 372.239 200.374C372.161 200.303 372.042 200.248 371.881 200.212L371.31 200.087C370.995 200.015 370.762 199.901 370.611 199.744C370.462 199.588 370.387 199.389 370.387 199.149C370.387 198.95 370.443 198.776 370.554 198.626C370.666 198.477 370.819 198.361 371.015 198.277C371.212 198.192 371.436 198.15 371.69 198.15C372.054 198.15 372.341 198.229 372.55 198.387C372.76 198.544 372.898 198.754 372.965 199.017Z"
            fill="#1B2029"
          />
          <path
            d="M492.955 201.567V201.171L494.439 199.547C494.614 199.356 494.757 199.191 494.87 199.05C494.983 198.908 495.066 198.775 495.12 198.651C495.176 198.525 495.204 198.393 495.204 198.255C495.204 198.097 495.166 197.96 495.089 197.845C495.015 197.729 494.912 197.64 494.782 197.577C494.652 197.514 494.505 197.482 494.343 197.482C494.17 197.482 494.019 197.518 493.89 197.59C493.763 197.66 493.664 197.759 493.594 197.887C493.525 198.014 493.491 198.163 493.491 198.334H492.973C492.973 198.071 493.033 197.84 493.155 197.641C493.276 197.442 493.442 197.286 493.651 197.175C493.862 197.064 494.098 197.008 494.36 197.008C494.624 197.008 494.857 197.064 495.061 197.175C495.264 197.286 495.424 197.436 495.54 197.625C495.655 197.814 495.713 198.024 495.713 198.255C495.713 198.421 495.683 198.583 495.623 198.741C495.564 198.897 495.462 199.072 495.316 199.265C495.171 199.457 494.969 199.691 494.712 199.968L493.702 201.048V201.084H495.792V201.567H492.955Z"
            fill="#5A6D91"
          />
          <mask id="path-63-inside-4_4955_16369" fill="white">
            <path
              d="M344.3 208.783C344.3 206.832 345.882 205.25 347.833 205.25H494.466C496.418 205.25 498 206.832 498 208.783V225.783C498 227.735 496.418 229.317 494.466 229.317H347.833C345.882 229.317 344.3 227.735 344.3 225.783V208.783Z"
            />
          </mask>
          <path
            d="M344.3 208.783C344.3 206.832 345.882 205.25 347.833 205.25H494.466C496.418 205.25 498 206.832 498 208.783V225.783C498 227.735 496.418 229.317 494.466 229.317H347.833C345.882 229.317 344.3 227.735 344.3 225.783V208.783Z"
            fill="white"
          />
          <path
            d="M344.3 205.25H498H344.3M498 225.783C498 227.857 496.319 229.537 494.246 229.537H348.054C345.981 229.537 344.3 227.857 344.3 225.783V225.783C344.3 227.613 345.882 229.096 347.833 229.096H494.466C496.418 229.096 498 227.613 498 225.783V225.783ZM498 225.783M344.3 229.317V205.25V229.317M344.3 229.317M498 205.25V229.317V205.25"
            fill="#A8B3C8"
            mask="url(#path-63-inside-4_4955_16369)"
          />
          <rect
            x="350.706"
            y="213.081"
            width="7.94004"
            height="7.95729"
            rx="0.883333"
            fill="url(#pattern2_4955_16369)"
          />
          <path
            d="M364.607 215.783H363.887L365.505 211.286H366.289L367.908 215.783H367.187L365.916 212.103H365.881L364.607 215.783ZM364.728 214.022H367.064V214.593H364.728V214.022ZM368.504 215.783V212.411H369.134V212.96H369.176C369.246 212.774 369.361 212.629 369.521 212.525C369.681 212.419 369.872 212.367 370.094 212.367C370.319 212.367 370.508 212.419 370.661 212.525C370.814 212.63 370.928 212.775 371.001 212.96H371.036C371.117 212.779 371.245 212.636 371.42 212.529C371.596 212.421 371.805 212.367 372.048 212.367C372.354 212.367 372.604 212.463 372.797 212.654C372.992 212.846 373.089 213.135 373.089 213.522V215.783H372.433V213.583C372.433 213.355 372.37 213.189 372.246 213.087C372.121 212.984 371.973 212.933 371.8 212.933C371.586 212.933 371.42 212.999 371.302 213.131C371.183 213.261 371.124 213.429 371.124 213.634V215.783H370.47V213.541C370.47 213.358 370.412 213.211 370.298 213.1C370.184 212.989 370.035 212.933 369.853 212.933C369.728 212.933 369.613 212.966 369.508 213.032C369.404 213.096 369.32 213.186 369.255 213.302C369.192 213.418 369.161 213.552 369.161 213.704V215.783H368.504ZM374.951 215.858C374.737 215.858 374.544 215.818 374.371 215.739C374.198 215.659 374.061 215.543 373.96 215.39C373.861 215.238 373.811 215.051 373.811 214.83C373.811 214.64 373.848 214.483 373.921 214.36C373.994 214.237 374.093 214.14 374.217 214.068C374.342 213.997 374.481 213.943 374.634 213.906C374.788 213.869 374.945 213.842 375.104 213.822C375.306 213.799 375.47 213.78 375.596 213.765C375.722 213.749 375.814 213.724 375.871 213.689C375.928 213.653 375.956 213.596 375.956 213.517V213.502C375.956 213.31 375.902 213.162 375.794 213.056C375.687 212.951 375.527 212.898 375.315 212.898C375.094 212.898 374.92 212.947 374.792 213.045C374.667 213.142 374.579 213.249 374.531 213.368L373.914 213.227C373.987 213.022 374.094 212.857 374.235 212.731C374.377 212.604 374.54 212.512 374.724 212.455C374.909 212.396 375.103 212.367 375.306 212.367C375.441 212.367 375.584 212.383 375.734 212.415C375.887 212.446 376.029 212.503 376.16 212.586C376.294 212.67 376.403 212.789 376.488 212.944C376.573 213.098 376.615 213.298 376.615 213.544V215.783H375.974V215.322H375.947C375.905 215.407 375.841 215.491 375.756 215.573C375.672 215.655 375.562 215.723 375.429 215.777C375.296 215.831 375.136 215.858 374.951 215.858ZM375.093 215.331C375.275 215.331 375.43 215.295 375.559 215.223C375.689 215.152 375.788 215.058 375.855 214.942C375.924 214.825 375.958 214.7 375.958 214.567V214.132C375.935 214.156 375.89 214.177 375.822 214.198C375.756 214.217 375.681 214.234 375.596 214.248C375.511 214.262 375.429 214.274 375.348 214.286C375.267 214.296 375.2 214.305 375.146 214.312C375.019 214.328 374.902 214.355 374.797 214.393C374.693 214.431 374.609 214.486 374.547 214.558C374.485 214.628 374.454 214.722 374.454 214.839C374.454 215.002 374.514 215.125 374.634 215.208C374.754 215.29 374.907 215.331 375.093 215.331ZM377.419 215.783V215.333L379.246 213.012V212.982H377.478V212.411H380.065V212.889L378.308 215.182V215.212H380.127V215.783H377.419ZM382.225 215.851C381.909 215.851 381.633 215.779 381.397 215.634C381.162 215.489 380.979 215.286 380.848 215.026C380.718 214.765 380.653 214.461 380.653 214.112C380.653 213.762 380.718 213.457 380.848 213.194C380.979 212.932 381.162 212.729 381.397 212.584C381.633 212.439 381.909 212.367 382.225 212.367C382.541 212.367 382.817 212.439 383.053 212.584C383.289 212.729 383.472 212.932 383.602 213.194C383.732 213.457 383.797 213.762 383.797 214.112C383.797 214.461 383.732 214.765 383.602 215.026C383.472 215.286 383.289 215.489 383.053 215.634C382.817 215.779 382.541 215.851 382.225 215.851ZM382.227 215.3C382.432 215.3 382.602 215.246 382.737 215.138C382.872 215.029 382.971 214.885 383.035 214.705C383.101 214.525 383.134 214.327 383.134 214.11C383.134 213.895 383.101 213.697 383.035 213.517C382.971 213.336 382.872 213.19 382.737 213.08C382.602 212.971 382.432 212.916 382.227 212.916C382.021 212.916 381.85 212.971 381.714 213.08C381.579 213.19 381.479 213.336 381.413 213.517C381.348 213.697 381.316 213.895 381.316 214.11C381.316 214.327 381.348 214.525 381.413 214.705C381.479 214.885 381.579 215.029 381.714 215.138C381.85 215.246 382.021 215.3 382.227 215.3ZM385.187 213.781V215.783H384.53V212.411H385.16V212.96H385.202C385.28 212.781 385.401 212.637 385.567 212.529C385.734 212.421 385.944 212.367 386.197 212.367C386.427 212.367 386.628 212.415 386.801 212.512C386.973 212.607 387.107 212.749 387.203 212.938C387.298 213.126 387.345 213.36 387.345 213.638V215.783H386.689V213.717C386.689 213.473 386.625 213.282 386.498 213.144C386.37 213.005 386.195 212.935 385.973 212.935C385.821 212.935 385.685 212.968 385.567 213.034C385.45 213.1 385.357 213.197 385.288 213.324C385.22 213.45 385.187 213.602 385.187 213.781Z"
            fill="#1B2029"
          />
          <path
            d="M366.73 218.929H367.196V221.481C367.196 221.744 367.134 221.98 367.01 222.187C366.887 222.392 366.713 222.555 366.489 222.674C366.264 222.792 366.001 222.851 365.698 222.851C365.396 222.851 365.132 222.792 364.908 222.674C364.683 222.555 364.509 222.392 364.385 222.187C364.262 221.98 364.2 221.744 364.2 221.481V218.929H364.667V221.443C364.667 221.631 364.708 221.799 364.791 221.946C364.874 222.091 364.992 222.206 365.145 222.29C365.299 222.373 365.484 222.414 365.698 222.414C365.913 222.414 366.097 222.373 366.252 222.29C366.406 222.206 366.524 222.091 366.605 221.946C366.688 221.799 366.73 221.631 366.73 221.443V218.929ZM370.116 220.54L369.717 220.653C369.692 220.586 369.655 220.522 369.606 220.459C369.558 220.395 369.493 220.342 369.41 220.301C369.327 220.259 369.221 220.239 369.092 220.239C368.915 220.239 368.768 220.28 368.65 220.361C368.533 220.441 368.475 220.544 368.475 220.668C368.475 220.778 368.515 220.865 368.595 220.929C368.676 220.993 368.801 221.047 368.972 221.089L369.401 221.195C369.659 221.258 369.852 221.354 369.979 221.483C370.105 221.611 370.169 221.776 370.169 221.978C370.169 222.143 370.121 222.291 370.026 222.422C369.932 222.552 369.8 222.655 369.63 222.731C369.461 222.806 369.264 222.844 369.04 222.844C368.745 222.844 368.501 222.78 368.307 222.652C368.114 222.524 367.992 222.337 367.94 222.091L368.362 221.985C368.402 222.141 368.478 222.258 368.59 222.335C368.703 222.413 368.85 222.452 369.032 222.452C369.239 222.452 369.403 222.408 369.525 222.32C369.648 222.231 369.71 222.125 369.71 222C369.71 221.9 369.674 221.816 369.604 221.748C369.534 221.679 369.426 221.628 369.28 221.594L368.799 221.481C368.534 221.418 368.339 221.321 368.215 221.189C368.092 221.056 368.031 220.89 368.031 220.69C368.031 220.527 368.077 220.383 368.168 220.258C368.261 220.132 368.387 220.034 368.546 219.962C368.707 219.891 368.889 219.855 369.092 219.855C369.378 219.855 369.603 219.918 369.766 220.043C369.93 220.168 370.047 220.334 370.116 220.54ZM372.049 222.844C371.771 222.844 371.531 222.782 371.329 222.659C371.128 222.535 370.973 222.362 370.864 222.14C370.756 221.916 370.702 221.657 370.702 221.36C370.702 221.064 370.756 220.803 370.864 220.578C370.973 220.35 371.125 220.173 371.319 220.047C371.515 219.919 371.743 219.855 372.004 219.855C372.155 219.855 372.304 219.88 372.45 219.93C372.597 219.98 372.731 220.062 372.851 220.175C372.972 220.286 373.068 220.434 373.139 220.619C373.211 220.803 373.246 221.03 373.246 221.3V221.488H371.018V221.104H372.795C372.795 220.941 372.762 220.796 372.697 220.668C372.633 220.54 372.541 220.439 372.422 220.365C372.304 220.291 372.165 220.254 372.004 220.254C371.827 220.254 371.674 220.298 371.545 220.386C371.417 220.472 371.319 220.585 371.25 220.724C371.181 220.864 371.146 221.013 371.146 221.172V221.428C371.146 221.647 371.184 221.832 371.259 221.983C371.336 222.134 371.442 222.249 371.577 222.328C371.713 222.406 371.87 222.445 372.049 222.445C372.166 222.445 372.272 222.428 372.366 222.396C372.461 222.362 372.543 222.312 372.612 222.245C372.681 222.177 372.735 222.093 372.772 221.993L373.201 222.113C373.156 222.259 373.08 222.387 372.974 222.497C372.867 222.606 372.735 222.692 372.578 222.753C372.421 222.813 372.245 222.844 372.049 222.844ZM373.922 222.783V219.892H374.351V220.329H374.381C374.434 220.186 374.529 220.07 374.667 219.981C374.805 219.892 374.961 219.847 375.134 219.847C375.167 219.847 375.208 219.848 375.257 219.849C375.306 219.85 375.343 219.852 375.368 219.855V220.306C375.353 220.303 375.318 220.297 375.264 220.29C375.211 220.281 375.156 220.276 375.097 220.276C374.956 220.276 374.831 220.306 374.72 220.365C374.611 220.423 374.524 220.503 374.46 220.606C374.398 220.707 374.366 220.823 374.366 220.954V222.783H373.922ZM376.338 221.044V222.783H375.894V219.892H376.323V220.344H376.361C376.429 220.197 376.532 220.079 376.67 219.99C376.808 219.9 376.986 219.855 377.204 219.855C377.4 219.855 377.571 219.895 377.718 219.975C377.865 220.054 377.979 220.175 378.06 220.337C378.142 220.497 378.183 220.7 378.183 220.946V222.783H377.739V220.977C377.739 220.749 377.68 220.572 377.562 220.446C377.444 220.318 377.282 220.254 377.076 220.254C376.934 220.254 376.808 220.285 376.696 220.346C376.585 220.407 376.498 220.497 376.434 220.615C376.37 220.733 376.338 220.876 376.338 221.044ZM379.845 222.851C379.662 222.851 379.496 222.817 379.346 222.748C379.197 222.677 379.078 222.576 378.991 222.445C378.903 222.312 378.859 222.151 378.859 221.963C378.859 221.797 378.892 221.663 378.957 221.56C379.022 221.456 379.109 221.374 379.218 221.315C379.328 221.256 379.448 221.212 379.58 221.184C379.713 221.153 379.846 221.13 379.981 221.112C380.156 221.089 380.299 221.072 380.408 221.061C380.518 221.049 380.599 221.028 380.649 220.999C380.7 220.97 380.726 220.92 380.726 220.849V220.833C380.726 220.648 380.675 220.503 380.574 220.401C380.473 220.298 380.321 220.246 380.116 220.246C379.904 220.246 379.738 220.293 379.617 220.386C379.497 220.478 379.412 220.578 379.363 220.683L378.942 220.532C379.017 220.357 379.117 220.22 379.243 220.122C379.37 220.023 379.508 219.954 379.657 219.915C379.807 219.875 379.956 219.855 380.101 219.855C380.194 219.855 380.301 219.866 380.421 219.889C380.543 219.91 380.66 219.955 380.773 220.022C380.887 220.09 380.982 220.192 381.057 220.329C381.132 220.466 381.17 220.649 381.17 220.879V222.783H380.726V222.392H380.703C380.673 222.455 380.623 222.522 380.553 222.593C380.483 222.665 380.389 222.726 380.272 222.776C380.156 222.826 380.013 222.851 379.845 222.851ZM379.913 222.452C380.089 222.452 380.237 222.418 380.357 222.349C380.479 222.28 380.57 222.19 380.632 222.081C380.695 221.972 380.726 221.857 380.726 221.737V221.33C380.707 221.353 380.666 221.374 380.602 221.392C380.539 221.41 380.466 221.426 380.383 221.44C380.302 221.452 380.222 221.463 380.144 221.473C380.068 221.482 380.006 221.49 379.958 221.496C379.843 221.511 379.735 221.535 379.634 221.569C379.535 221.602 379.455 221.652 379.393 221.718C379.333 221.783 379.303 221.872 379.303 221.985C379.303 222.14 379.36 222.256 379.474 222.335C379.59 222.413 379.736 222.452 379.913 222.452ZM381.981 222.783V219.892H382.41V220.344H382.448C382.508 220.19 382.605 220.07 382.739 219.985C382.874 219.898 383.035 219.855 383.223 219.855C383.414 219.855 383.572 219.898 383.699 219.985C383.827 220.07 383.927 220.19 383.998 220.344H384.029C384.103 220.195 384.214 220.076 384.362 219.988C384.51 219.899 384.687 219.855 384.894 219.855C385.153 219.855 385.364 219.936 385.529 220.098C385.693 220.258 385.775 220.508 385.775 220.849V222.783H385.331V220.849C385.331 220.635 385.273 220.483 385.156 220.391C385.039 220.3 384.902 220.254 384.744 220.254C384.541 220.254 384.383 220.315 384.271 220.438C384.16 220.56 384.104 220.714 384.104 220.901V222.783H383.652V220.803C383.652 220.639 383.599 220.507 383.492 220.406C383.386 220.305 383.248 220.254 383.08 220.254C382.965 220.254 382.857 220.285 382.756 220.346C382.657 220.407 382.577 220.493 382.515 220.602C382.455 220.71 382.425 220.835 382.425 220.977V222.783H381.981ZM387.799 222.844C387.521 222.844 387.281 222.782 387.079 222.659C386.878 222.535 386.723 222.362 386.614 222.14C386.506 221.916 386.452 221.657 386.452 221.36C386.452 221.064 386.506 220.803 386.614 220.578C386.723 220.35 386.875 220.173 387.069 220.047C387.265 219.919 387.493 219.855 387.754 219.855C387.905 219.855 388.053 219.88 388.2 219.93C388.347 219.98 388.481 220.062 388.601 220.175C388.722 220.286 388.818 220.434 388.889 220.619C388.961 220.803 388.996 221.03 388.996 221.3V221.488H386.768V221.104H388.545C388.545 220.941 388.512 220.796 388.447 220.668C388.383 220.54 388.291 220.439 388.172 220.365C388.054 220.291 387.915 220.254 387.754 220.254C387.577 220.254 387.424 220.298 387.295 220.386C387.167 220.472 387.068 220.585 386.999 220.724C386.93 220.864 386.896 221.013 386.896 221.172V221.428C386.896 221.647 386.934 221.832 387.009 221.983C387.085 222.134 387.191 222.249 387.327 222.328C387.462 222.406 387.62 222.445 387.799 222.445C387.916 222.445 388.021 222.428 388.116 222.396C388.211 222.362 388.293 222.312 388.362 222.245C388.431 222.177 388.484 222.093 388.522 221.993L388.951 222.113C388.906 222.259 388.83 222.387 388.723 222.497C388.617 222.606 388.485 222.692 388.328 222.753C388.171 222.813 387.995 222.844 387.799 222.844Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip8_4955_16369)">
            <path
              d="M458.47 215.406C458.47 215.101 458.717 214.854 459.022 214.854H460.568C460.751 214.854 460.899 214.706 460.899 214.523C460.899 214.34 460.751 214.192 460.568 214.192H459.022C458.351 214.192 457.808 214.735 457.808 215.406V219.16C457.808 219.831 458.351 220.375 459.022 220.375H462.776C463.447 220.375 463.991 219.831 463.991 219.16V217.615C463.991 217.432 463.843 217.283 463.66 217.283C463.477 217.283 463.328 217.432 463.328 217.615V219.16C463.328 219.465 463.081 219.712 462.776 219.712H459.022C458.717 219.712 458.47 219.465 458.47 219.16V215.406Z"
              fill="#1B2029"
            />
            <path
              d="M462.114 214.192C461.931 214.192 461.783 214.34 461.783 214.523C461.783 214.706 461.931 214.854 462.114 214.854H462.86L460.996 216.718C460.867 216.847 460.867 217.057 460.996 217.186C461.126 217.316 461.335 217.316 461.465 217.186L463.328 215.323V216.069C463.328 216.252 463.477 216.4 463.66 216.4C463.843 216.4 463.991 216.252 463.991 216.069V214.523C463.991 214.34 463.843 214.192 463.66 214.192H462.114Z"
              fill="#1B2029"
            />
          </g>
          <g clip-path="url(#clip9_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M473.708 215.075C473.708 214.587 474.104 214.192 474.591 214.192H477.241C477.729 214.192 478.125 214.587 478.125 215.075V217.725C478.125 218.213 477.729 218.608 477.241 218.608H476.358V219.492C476.358 219.98 475.963 220.375 475.475 220.375H472.825C472.337 220.375 471.941 219.98 471.941 219.492V216.842C471.941 216.354 472.337 215.958 472.825 215.958H473.708V215.075ZM474.591 214.854H477.241C477.363 214.854 477.462 214.953 477.462 215.075V217.725C477.462 217.847 477.363 217.946 477.241 217.946H474.591C474.469 217.946 474.371 217.847 474.371 217.725V215.075C474.371 214.953 474.469 214.854 474.591 214.854ZM473.708 216.621H472.825C472.703 216.621 472.604 216.72 472.604 216.842V219.492C472.604 219.614 472.703 219.712 472.825 219.712H475.475C475.597 219.712 475.696 219.614 475.696 219.492V218.608H474.591C474.104 218.608 473.708 218.213 473.708 217.725V216.621Z"
              fill="#1B2029"
            />
          </g>
          <path
            d="M488.283 214.633C488.283 215.121 488.679 215.517 489.167 215.517C489.654 215.517 490.05 215.121 490.05 214.633C490.05 214.145 489.654 213.75 489.167 213.75C488.679 213.75 488.283 214.145 488.283 214.633Z"
            fill="#1B2029"
          />
          <path
            d="M489.167 218.167C488.679 218.167 488.283 217.771 488.283 217.283C488.283 216.795 488.679 216.4 489.167 216.4C489.654 216.4 490.05 216.795 490.05 217.283C490.05 217.771 489.654 218.167 489.167 218.167Z"
            fill="#1B2029"
          />
          <path
            d="M489.167 220.817C488.679 220.817 488.283 220.421 488.283 219.933C488.283 219.445 488.679 219.05 489.167 219.05C489.654 219.05 490.05 219.445 490.05 219.933C490.05 220.421 489.654 220.817 489.167 220.817Z"
            fill="#1B2029"
          />
          <mask id="path-77-inside-5_4955_16369" fill="white">
            <path
              d="M344.3 235.5C344.3 233.549 345.882 231.967 347.833 231.967H494.466C496.418 231.967 498 233.549 498 235.5V252.5C498 254.451 496.418 256.033 494.466 256.033H347.833C345.882 256.033 344.3 254.451 344.3 252.5V235.5Z"
            />
          </mask>
          <path
            d="M344.3 235.5C344.3 233.549 345.882 231.967 347.833 231.967H494.466C496.418 231.967 498 233.549 498 235.5V252.5C498 254.451 496.418 256.033 494.466 256.033H347.833C345.882 256.033 344.3 254.451 344.3 252.5V235.5Z"
            fill="white"
          />
          <path
            d="M344.3 231.967H498H344.3M498 252.5C498 254.573 496.319 256.254 494.246 256.254H348.054C345.981 256.254 344.3 254.573 344.3 252.5V252.5C344.3 254.329 345.882 255.813 347.833 255.813H494.466C496.418 255.813 498 254.329 498 252.5V252.5ZM498 252.5M344.3 256.033V231.967V256.033M344.3 256.033M498 231.967V256.033V231.967"
            fill="#A8B3C8"
            mask="url(#path-77-inside-5_4955_16369)"
          />
          <g clip-path="url(#clip10_4955_16369)">
            <rect
              x="349.772"
              y="238.844"
              width="10.1893"
              height="10.2093"
              rx="5.09464"
              fill="url(#pattern3_4955_16369)"
            />
          </g>
          <path
            d="M364.906 238.003V242.5H364.227V238.003H364.906ZM366.498 240.497V242.5H365.841V239.127H366.472V239.676H366.513C366.591 239.498 366.712 239.354 366.878 239.246C367.045 239.138 367.255 239.083 367.508 239.083C367.738 239.083 367.939 239.132 368.112 239.228C368.285 239.323 368.418 239.465 368.514 239.654C368.609 239.843 368.656 240.077 368.656 240.355V242.5H368V240.434C368 240.189 367.936 239.998 367.809 239.861C367.681 239.722 367.506 239.652 367.284 239.652C367.132 239.652 366.996 239.685 366.878 239.751C366.761 239.817 366.668 239.913 366.599 240.041C366.532 240.167 366.498 240.319 366.498 240.497ZM372.064 239.951L371.469 240.056C371.444 239.98 371.405 239.908 371.351 239.839C371.298 239.77 371.226 239.714 371.135 239.67C371.045 239.626 370.931 239.604 370.795 239.604C370.609 239.604 370.454 239.645 370.33 239.729C370.205 239.811 370.143 239.917 370.143 240.047C370.143 240.16 370.185 240.251 370.268 240.32C370.351 240.388 370.486 240.445 370.672 240.489L371.208 240.612C371.518 240.683 371.749 240.794 371.902 240.943C372.054 241.093 372.13 241.286 372.13 241.525C372.13 241.727 372.072 241.907 371.954 242.065C371.839 242.222 371.677 242.345 371.469 242.434C371.263 242.523 371.023 242.568 370.751 242.568C370.373 242.568 370.065 242.488 369.827 242.327C369.588 242.164 369.442 241.933 369.388 241.635L370.022 241.538C370.062 241.704 370.143 241.829 370.266 241.914C370.389 241.997 370.549 242.039 370.747 242.039C370.962 242.039 371.134 241.994 371.263 241.905C371.392 241.814 371.456 241.704 371.456 241.573C371.456 241.468 371.416 241.379 371.337 241.308C371.26 241.236 371.141 241.182 370.979 241.145L370.409 241.02C370.094 240.948 369.861 240.834 369.71 240.677C369.561 240.521 369.486 240.323 369.486 240.082C369.486 239.883 369.542 239.709 369.653 239.56C369.764 239.411 369.918 239.294 370.114 239.211C370.311 239.126 370.535 239.083 370.788 239.083C371.153 239.083 371.44 239.162 371.649 239.321C371.859 239.477 371.997 239.687 372.064 239.951ZM374.426 239.127V239.654H372.584V239.127H374.426ZM373.078 238.319H373.735V241.51C373.735 241.637 373.754 241.733 373.792 241.797C373.83 241.86 373.879 241.903 373.939 241.927C374 241.949 374.067 241.96 374.139 241.96C374.191 241.96 374.237 241.956 374.277 241.949C374.317 241.942 374.347 241.936 374.369 241.931L374.488 242.474C374.45 242.488 374.396 242.503 374.325 242.518C374.255 242.534 374.167 242.542 374.062 242.544C373.889 242.547 373.728 242.516 373.579 242.452C373.429 242.387 373.309 242.288 373.216 242.153C373.124 242.018 373.078 241.849 373.078 241.646V238.319ZM376.134 242.575C375.92 242.575 375.727 242.535 375.554 242.456C375.382 242.376 375.245 242.259 375.144 242.107C375.044 241.955 374.994 241.768 374.994 241.547C374.994 241.357 375.031 241.2 375.104 241.077C375.177 240.954 375.276 240.857 375.401 240.785C375.525 240.713 375.664 240.659 375.818 240.623C375.972 240.586 376.128 240.558 376.288 240.539C376.49 240.516 376.654 240.497 376.78 240.482C376.906 240.466 376.997 240.44 377.054 240.405C377.111 240.37 377.14 240.313 377.14 240.234V240.219C377.14 240.027 377.086 239.878 376.977 239.773C376.87 239.667 376.711 239.615 376.499 239.615C376.278 239.615 376.103 239.664 375.976 239.762C375.85 239.858 375.763 239.966 375.715 240.085L375.098 239.944C375.171 239.739 375.278 239.574 375.418 239.448C375.56 239.321 375.723 239.228 375.908 239.171C376.092 239.113 376.286 239.083 376.49 239.083C376.624 239.083 376.767 239.099 376.918 239.132C377.07 239.162 377.212 239.219 377.344 239.303C377.477 239.386 377.586 239.506 377.671 239.661C377.756 239.815 377.799 240.014 377.799 240.26V242.5H377.157V242.039H377.131C377.089 242.124 377.025 242.207 376.94 242.289C376.855 242.371 376.746 242.439 376.613 242.493C376.48 242.548 376.32 242.575 376.134 242.575ZM376.277 242.048C376.458 242.048 376.614 242.012 376.742 241.94C376.873 241.868 376.971 241.775 377.039 241.659C377.108 241.542 377.142 241.417 377.142 241.284V240.849C377.119 240.872 377.073 240.894 377.006 240.915C376.94 240.934 376.865 240.951 376.78 240.965C376.695 240.978 376.612 240.991 376.532 241.002C376.451 241.013 376.384 241.022 376.33 241.029C376.202 241.045 376.086 241.072 375.98 241.11C375.876 241.148 375.793 241.203 375.73 241.275C375.669 241.345 375.638 241.439 375.638 241.556C375.638 241.718 375.698 241.841 375.818 241.925C375.938 242.007 376.091 242.048 376.277 242.048ZM380.087 243.835C379.819 243.835 379.589 243.8 379.395 243.73C379.204 243.659 379.047 243.566 378.925 243.451C378.804 243.335 378.713 243.209 378.653 243.071L379.218 242.838C379.257 242.903 379.31 242.971 379.376 243.042C379.443 243.116 379.534 243.178 379.648 243.229C379.764 243.28 379.912 243.306 380.094 243.306C380.343 243.306 380.548 243.245 380.711 243.124C380.873 243.004 380.954 242.812 380.954 242.548V241.885H380.913C380.873 241.957 380.816 242.037 380.741 242.125C380.668 242.212 380.567 242.288 380.438 242.353C380.31 242.417 380.142 242.449 379.936 242.449C379.669 242.449 379.429 242.387 379.215 242.263C379.003 242.137 378.835 241.952 378.71 241.707C378.587 241.461 378.526 241.159 378.526 240.8C378.526 240.442 378.587 240.134 378.708 239.878C378.831 239.622 378.999 239.426 379.213 239.29C379.427 239.152 379.669 239.083 379.94 239.083C380.149 239.083 380.318 239.118 380.447 239.189C380.576 239.258 380.676 239.338 380.748 239.43C380.821 239.523 380.878 239.604 380.917 239.674H380.965V239.127H381.609V242.575C381.609 242.865 381.541 243.102 381.407 243.288C381.272 243.474 381.09 243.612 380.86 243.701C380.632 243.79 380.374 243.835 380.087 243.835ZM380.08 241.905C380.269 241.905 380.429 241.861 380.559 241.773C380.691 241.684 380.79 241.557 380.858 241.391C380.927 241.224 380.961 241.024 380.961 240.792C380.961 240.565 380.927 240.365 380.86 240.192C380.793 240.019 380.694 239.885 380.564 239.788C380.433 239.69 380.272 239.641 380.08 239.641C379.883 239.641 379.718 239.692 379.586 239.795C379.455 239.896 379.355 240.033 379.288 240.208C379.222 240.382 379.189 240.576 379.189 240.792C379.189 241.013 379.223 241.207 379.29 241.374C379.357 241.54 379.457 241.671 379.589 241.764C379.722 241.858 379.886 241.905 380.08 241.905ZM382.489 242.5V239.127H383.124V239.663H383.159C383.22 239.482 383.329 239.339 383.484 239.235C383.641 239.129 383.818 239.077 384.015 239.077C384.056 239.077 384.105 239.078 384.16 239.081C384.217 239.084 384.262 239.088 384.294 239.092V239.72C384.268 239.713 384.221 239.705 384.154 239.696C384.086 239.686 384.019 239.681 383.952 239.681C383.796 239.681 383.658 239.714 383.537 239.779C383.417 239.844 383.321 239.934 383.251 240.05C383.181 240.164 383.146 240.294 383.146 240.44V242.5H382.489ZM385.814 242.575C385.6 242.575 385.407 242.535 385.234 242.456C385.061 242.376 384.924 242.259 384.823 242.107C384.724 241.955 384.674 241.768 384.674 241.547C384.674 241.357 384.711 241.2 384.784 241.077C384.857 240.954 384.956 240.857 385.08 240.785C385.205 240.713 385.344 240.659 385.497 240.623C385.651 240.586 385.808 240.558 385.967 240.539C386.169 240.516 386.333 240.497 386.459 240.482C386.585 240.466 386.677 240.44 386.734 240.405C386.791 240.37 386.819 240.313 386.819 240.234V240.219C386.819 240.027 386.765 239.878 386.657 239.773C386.55 239.667 386.39 239.615 386.178 239.615C385.957 239.615 385.783 239.664 385.656 239.762C385.53 239.858 385.443 239.966 385.394 240.085L384.777 239.944C384.85 239.739 384.957 239.574 385.098 239.448C385.24 239.321 385.403 239.228 385.588 239.171C385.772 239.113 385.966 239.083 386.169 239.083C386.304 239.083 386.447 239.099 386.598 239.132C386.75 239.162 386.892 239.219 387.024 239.303C387.157 239.386 387.266 239.506 387.351 239.661C387.436 239.815 387.478 240.014 387.478 240.26V242.5H386.837V242.039H386.811C386.768 242.124 386.704 242.207 386.62 242.289C386.535 242.371 386.426 242.439 386.292 242.493C386.159 242.548 386 242.575 385.814 242.575ZM385.956 242.048C386.138 242.048 386.293 242.012 386.422 241.94C386.552 241.868 386.651 241.775 386.718 241.659C386.787 241.542 386.822 241.417 386.822 241.284V240.849C386.798 240.872 386.753 240.894 386.685 240.915C386.62 240.934 386.544 240.951 386.459 240.965C386.374 240.978 386.292 240.991 386.211 241.002C386.131 241.013 386.063 241.022 386.009 241.029C385.882 241.045 385.765 241.072 385.66 241.11C385.556 241.148 385.473 241.203 385.41 241.275C385.348 241.345 385.317 241.439 385.317 241.556C385.317 241.718 385.377 241.841 385.497 241.925C385.618 242.007 385.77 242.048 385.956 242.048ZM388.353 242.5V239.127H388.983V239.676H389.024C389.095 239.49 389.21 239.345 389.369 239.241C389.529 239.136 389.72 239.083 389.942 239.083C390.168 239.083 390.357 239.136 390.509 239.241C390.663 239.347 390.776 239.492 390.849 239.676H390.884C390.965 239.496 391.093 239.353 391.269 239.246C391.444 239.138 391.654 239.083 391.897 239.083C392.202 239.083 392.452 239.179 392.645 239.371C392.84 239.563 392.937 239.852 392.937 240.238V242.5H392.281V240.3C392.281 240.071 392.219 239.906 392.094 239.804C391.97 239.701 391.821 239.65 391.648 239.65C391.435 239.65 391.269 239.716 391.15 239.847C391.031 239.978 390.972 240.145 390.972 240.35V242.5H390.318V240.258C390.318 240.075 390.261 239.928 390.147 239.817C390.032 239.705 389.884 239.65 389.701 239.65C389.576 239.65 389.461 239.683 389.356 239.749C389.252 239.813 389.168 239.903 389.104 240.019C389.041 240.134 389.009 240.268 389.009 240.421V242.5H388.353Z"
            fill="#1B2029"
          />
          <path
            d="M366.73 245.645H367.196V248.198C367.196 248.461 367.134 248.696 367.01 248.903C366.887 249.109 366.713 249.272 366.489 249.391C366.264 249.509 366.001 249.568 365.698 249.568C365.396 249.568 365.132 249.509 364.908 249.391C364.683 249.272 364.509 249.109 364.385 248.903C364.262 248.696 364.2 248.461 364.2 248.198V245.645H364.667V248.16C364.667 248.348 364.708 248.516 364.791 248.662C364.874 248.808 364.992 248.923 365.145 249.007C365.299 249.09 365.484 249.131 365.698 249.131C365.913 249.131 366.097 249.09 366.252 249.007C366.406 248.923 366.524 248.808 366.605 248.662C366.688 248.516 366.73 248.348 366.73 248.16V245.645ZM370.116 247.257L369.717 247.369C369.692 247.303 369.655 247.238 369.606 247.176C369.558 247.112 369.493 247.059 369.41 247.018C369.327 246.976 369.221 246.955 369.092 246.955C368.915 246.955 368.768 246.996 368.65 247.078C368.533 247.158 368.475 247.26 368.475 247.385C368.475 247.495 368.515 247.582 368.595 247.646C368.676 247.71 368.801 247.763 368.972 247.806L369.401 247.912C369.659 247.974 369.852 248.07 369.979 248.199C370.105 248.327 370.169 248.492 370.169 248.694C370.169 248.86 370.121 249.008 370.026 249.139C369.932 249.269 369.8 249.372 369.63 249.447C369.461 249.523 369.264 249.56 369.04 249.56C368.745 249.56 368.501 249.496 368.307 249.368C368.114 249.24 367.992 249.053 367.94 248.807L368.362 248.702C368.402 248.858 368.478 248.974 368.59 249.052C368.703 249.13 368.85 249.169 369.032 249.169C369.239 249.169 369.403 249.125 369.525 249.037C369.648 248.948 369.71 248.841 369.71 248.717C369.71 248.617 369.674 248.533 369.604 248.465C369.534 248.396 369.426 248.344 369.28 248.311L368.799 248.198C368.534 248.135 368.339 248.038 368.215 247.906C368.092 247.773 368.031 247.607 368.031 247.407C368.031 247.244 368.077 247.1 368.168 246.974C368.261 246.849 368.387 246.75 368.546 246.679C368.707 246.607 368.889 246.571 369.092 246.571C369.378 246.571 369.603 246.634 369.766 246.76C369.93 246.885 370.047 247.051 370.116 247.257ZM372.049 249.56C371.771 249.56 371.531 249.499 371.329 249.376C371.128 249.252 370.973 249.078 370.864 248.856C370.756 248.633 370.702 248.373 370.702 248.077C370.702 247.781 370.756 247.52 370.864 247.294C370.973 247.067 371.125 246.89 371.319 246.763C371.515 246.635 371.743 246.571 372.004 246.571C372.155 246.571 372.304 246.597 372.45 246.647C372.597 246.697 372.731 246.778 372.851 246.891C372.972 247.003 373.068 247.151 373.139 247.336C373.211 247.52 373.246 247.747 373.246 248.017V248.205H371.018V247.821H372.795C372.795 247.658 372.762 247.512 372.697 247.385C372.633 247.257 372.541 247.156 372.422 247.081C372.304 247.007 372.165 246.97 372.004 246.97C371.827 246.97 371.674 247.014 371.545 247.102C371.417 247.189 371.319 247.302 371.25 247.441C371.181 247.58 371.146 247.73 371.146 247.889V248.145C371.146 248.363 371.184 248.548 371.259 248.7C371.336 248.851 371.442 248.965 371.577 249.045C371.713 249.122 371.87 249.161 372.049 249.161C372.166 249.161 372.272 249.145 372.366 249.112C372.461 249.078 372.543 249.028 372.612 248.962C372.681 248.894 372.735 248.81 372.772 248.71L373.201 248.83C373.156 248.976 373.08 249.104 372.974 249.214C372.867 249.323 372.735 249.408 372.578 249.47C372.421 249.53 372.245 249.56 372.049 249.56ZM373.922 249.5V246.609H374.351V247.046H374.381C374.434 246.903 374.529 246.787 374.667 246.698C374.805 246.608 374.961 246.564 375.134 246.564C375.167 246.564 375.208 246.565 375.257 246.566C375.306 246.567 375.343 246.569 375.368 246.571V247.023C375.353 247.019 375.318 247.014 375.264 247.006C375.211 246.997 375.156 246.993 375.097 246.993C374.956 246.993 374.831 247.023 374.72 247.081C374.611 247.139 374.524 247.22 374.46 247.322C374.398 247.424 374.366 247.54 374.366 247.671V249.5H373.922ZM376.338 247.761V249.5H375.894V246.609H376.323V247.061H376.361C376.429 246.914 376.532 246.796 376.67 246.707C376.808 246.617 376.986 246.571 377.204 246.571C377.4 246.571 377.571 246.612 377.718 246.692C377.865 246.771 377.979 246.891 378.06 247.053C378.142 247.214 378.183 247.417 378.183 247.663V249.5H377.739V247.693C377.739 247.466 377.68 247.289 377.562 247.162C377.444 247.034 377.282 246.97 377.076 246.97C376.934 246.97 376.808 247.001 376.696 247.063C376.585 247.124 376.498 247.214 376.434 247.332C376.37 247.45 376.338 247.593 376.338 247.761ZM379.845 249.568C379.662 249.568 379.496 249.533 379.346 249.464C379.197 249.394 379.078 249.293 378.991 249.161C378.903 249.028 378.859 248.868 378.859 248.679C378.859 248.514 378.892 248.38 378.957 248.277C379.022 248.172 379.109 248.091 379.218 248.032C379.328 247.973 379.448 247.929 379.58 247.9C379.713 247.87 379.846 247.846 379.981 247.829C380.156 247.806 380.299 247.789 380.408 247.778C380.518 247.765 380.599 247.745 380.649 247.716C380.7 247.687 380.726 247.637 380.726 247.565V247.55C380.726 247.364 380.675 247.22 380.574 247.117C380.473 247.014 380.321 246.963 380.116 246.963C379.904 246.963 379.738 247.009 379.617 247.102C379.497 247.195 379.412 247.294 379.363 247.4L378.942 247.249C379.017 247.073 379.117 246.937 379.243 246.839C379.37 246.74 379.508 246.671 379.657 246.632C379.807 246.592 379.956 246.571 380.101 246.571C380.194 246.571 380.301 246.583 380.421 246.605C380.543 246.627 380.66 246.671 380.773 246.739C380.887 246.807 380.982 246.909 381.057 247.046C381.132 247.183 381.17 247.366 381.17 247.595V249.5H380.726V249.109H380.703C380.673 249.171 380.623 249.238 380.553 249.31C380.483 249.381 380.389 249.442 380.272 249.492C380.156 249.543 380.013 249.568 379.845 249.568ZM379.913 249.169C380.089 249.169 380.237 249.134 380.357 249.065C380.479 248.996 380.57 248.907 380.632 248.798C380.695 248.689 380.726 248.574 380.726 248.454V248.047C380.707 248.07 380.666 248.09 380.602 248.109C380.539 248.127 380.466 248.142 380.383 248.156C380.302 248.169 380.222 248.18 380.144 248.19C380.068 248.199 380.006 248.206 379.958 248.213C379.843 248.228 379.735 248.252 379.634 248.286C379.535 248.319 379.455 248.368 379.393 248.435C379.333 248.5 379.303 248.589 379.303 248.702C379.303 248.856 379.36 248.973 379.474 249.052C379.59 249.13 379.736 249.169 379.913 249.169ZM381.981 249.5V246.609H382.41V247.061H382.448C382.508 246.906 382.605 246.787 382.739 246.701C382.874 246.615 383.035 246.571 383.223 246.571C383.414 246.571 383.572 246.615 383.699 246.701C383.827 246.787 383.927 246.906 383.998 247.061H384.029C384.103 246.911 384.214 246.793 384.362 246.705C384.51 246.616 384.687 246.571 384.894 246.571C385.153 246.571 385.364 246.652 385.529 246.814C385.693 246.975 385.775 247.225 385.775 247.565V249.5H385.331V247.565C385.331 247.352 385.273 247.199 385.156 247.108C385.039 247.016 384.902 246.97 384.744 246.97C384.541 246.97 384.383 247.032 384.271 247.155C384.16 247.277 384.104 247.431 384.104 247.618V249.5H383.652V247.52C383.652 247.356 383.599 247.223 383.492 247.123C383.386 247.021 383.248 246.97 383.08 246.97C382.965 246.97 382.857 247.001 382.756 247.063C382.657 247.124 382.577 247.209 382.515 247.319C382.455 247.427 382.425 247.551 382.425 247.693V249.5H381.981ZM387.799 249.56C387.521 249.56 387.281 249.499 387.079 249.376C386.878 249.252 386.723 249.078 386.614 248.856C386.506 248.633 386.452 248.373 386.452 248.077C386.452 247.781 386.506 247.52 386.614 247.294C386.723 247.067 386.875 246.89 387.069 246.763C387.265 246.635 387.493 246.571 387.754 246.571C387.905 246.571 388.053 246.597 388.2 246.647C388.347 246.697 388.481 246.778 388.601 246.891C388.722 247.003 388.818 247.151 388.889 247.336C388.961 247.52 388.996 247.747 388.996 248.017V248.205H386.768V247.821H388.545C388.545 247.658 388.512 247.512 388.447 247.385C388.383 247.257 388.291 247.156 388.172 247.081C388.054 247.007 387.915 246.97 387.754 246.97C387.577 246.97 387.424 247.014 387.295 247.102C387.167 247.189 387.068 247.302 386.999 247.441C386.93 247.58 386.896 247.73 386.896 247.889V248.145C386.896 248.363 386.934 248.548 387.009 248.7C387.085 248.851 387.191 248.965 387.327 249.045C387.462 249.122 387.62 249.161 387.799 249.161C387.916 249.161 388.021 249.145 388.116 249.112C388.211 249.078 388.293 249.028 388.362 248.962C388.431 248.894 388.484 248.81 388.522 248.71L388.951 248.83C388.906 248.976 388.83 249.104 388.723 249.214C388.617 249.323 388.485 249.408 388.328 249.47C388.171 249.53 387.995 249.56 387.799 249.56Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip11_4955_16369)">
            <path
              d="M458.47 242.123C458.47 241.818 458.717 241.571 459.022 241.571H460.568C460.751 241.571 460.899 241.423 460.899 241.24C460.899 241.057 460.751 240.908 460.568 240.908H459.022C458.351 240.908 457.808 241.452 457.808 242.123V245.877C457.808 246.548 458.351 247.092 459.022 247.092H462.776C463.447 247.092 463.991 246.548 463.991 245.877V244.331C463.991 244.148 463.843 244 463.66 244C463.477 244 463.328 244.148 463.328 244.331V245.877C463.328 246.182 463.081 246.429 462.776 246.429H459.022C458.717 246.429 458.47 246.182 458.47 245.877V242.123Z"
              fill="#1B2029"
            />
            <path
              d="M462.114 240.908C461.931 240.908 461.783 241.057 461.783 241.24C461.783 241.423 461.931 241.571 462.114 241.571H462.86L460.996 243.435C460.867 243.564 460.867 243.774 460.996 243.903C461.126 244.032 461.335 244.032 461.465 243.903L463.328 242.039V242.785C463.328 242.968 463.477 243.117 463.66 243.117C463.843 243.117 463.991 242.968 463.991 242.785V241.24C463.991 241.057 463.843 240.908 463.66 240.908H462.114Z"
              fill="#1B2029"
            />
          </g>
          <g clip-path="url(#clip12_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M473.708 241.792C473.708 241.304 474.104 240.908 474.591 240.908H477.241C477.729 240.908 478.125 241.304 478.125 241.792V244.442C478.125 244.93 477.729 245.325 477.241 245.325H476.358V246.208C476.358 246.696 475.963 247.092 475.475 247.092H472.825C472.337 247.092 471.941 246.696 471.941 246.208V243.558C471.941 243.07 472.337 242.675 472.825 242.675H473.708V241.792ZM474.591 241.571H477.241C477.363 241.571 477.462 241.67 477.462 241.792V244.442C477.462 244.564 477.363 244.662 477.241 244.662H474.591C474.469 244.662 474.371 244.564 474.371 244.442V241.792C474.371 241.67 474.469 241.571 474.591 241.571ZM473.708 243.337H472.825C472.703 243.337 472.604 243.436 472.604 243.558V246.208C472.604 246.33 472.703 246.429 472.825 246.429H475.475C475.597 246.429 475.696 246.33 475.696 246.208V245.325H474.591C474.104 245.325 473.708 244.93 473.708 244.442V243.337Z"
              fill="#1B2029"
            />
          </g>
          <path
            d="M488.283 241.35C488.283 241.838 488.679 242.233 489.167 242.233C489.654 242.233 490.05 241.838 490.05 241.35C490.05 240.862 489.654 240.467 489.167 240.467C488.679 240.467 488.283 240.862 488.283 241.35Z"
            fill="#1B2029"
          />
          <path
            d="M489.167 244.883C488.679 244.883 488.283 244.488 488.283 244C488.283 243.512 488.679 243.117 489.167 243.117C489.654 243.117 490.05 243.512 490.05 244C490.05 244.488 489.654 244.883 489.167 244.883Z"
            fill="#1B2029"
          />
          <path
            d="M489.167 247.533C488.679 247.533 488.283 247.138 488.283 246.65C488.283 246.162 488.679 245.767 489.167 245.767C489.654 245.767 490.05 246.162 490.05 246.65C490.05 247.138 489.654 247.533 489.167 247.533Z"
            fill="#1B2029"
          />
          <path
            d="M346.94 271.783H346.22L347.838 267.286H348.622L350.241 271.783H349.52L348.249 268.103H348.214L346.94 271.783ZM347.061 270.022H349.397V270.593H347.061V270.022ZM351.494 267.286V271.783H350.837V267.286H351.494ZM353.034 267.286V271.783H352.377V267.286H353.034ZM355.553 271.783V268.411H356.21V271.783H355.553ZM355.885 267.89C355.771 267.89 355.673 267.852 355.591 267.776C355.51 267.698 355.47 267.606 355.47 267.499C355.47 267.391 355.51 267.299 355.591 267.223C355.673 267.145 355.771 267.106 355.885 267.106C355.999 267.106 356.096 267.145 356.177 267.223C356.259 267.299 356.3 267.391 356.3 267.499C356.3 267.606 356.259 267.698 356.177 267.776C356.096 267.852 355.999 267.89 355.885 267.89ZM358.667 268.411V268.938H356.825V268.411H358.667ZM357.319 267.603H357.976V270.793C357.976 270.92 357.995 271.016 358.033 271.081C358.071 271.144 358.12 271.187 358.18 271.21C358.241 271.232 358.308 271.243 358.38 271.243C358.433 271.243 358.479 271.24 358.518 271.232C358.558 271.225 358.588 271.219 358.61 271.215L358.729 271.757C358.691 271.772 358.637 271.786 358.566 271.801C358.496 271.817 358.408 271.826 358.303 271.827C358.13 271.83 357.969 271.799 357.82 271.735C357.671 271.671 357.55 271.571 357.458 271.436C357.365 271.302 357.319 271.133 357.319 270.929V267.603ZM360.811 271.851C360.479 271.851 360.193 271.78 359.953 271.638C359.714 271.495 359.53 271.294 359.399 271.035C359.27 270.774 359.206 270.469 359.206 270.119C359.206 269.773 359.27 269.469 359.399 269.205C359.53 268.942 359.711 268.736 359.944 268.588C360.178 268.441 360.452 268.367 360.765 268.367C360.955 268.367 361.14 268.398 361.318 268.461C361.497 268.524 361.657 268.623 361.799 268.758C361.941 268.892 362.053 269.067 362.135 269.282C362.217 269.496 362.258 269.756 362.258 270.062V270.295H359.577V269.803H361.615C361.615 269.63 361.58 269.477 361.509 269.344C361.439 269.209 361.34 269.103 361.213 269.025C361.087 268.948 360.939 268.909 360.769 268.909C360.585 268.909 360.424 268.954 360.286 269.045C360.15 269.134 360.045 269.252 359.97 269.397C359.897 269.54 359.86 269.696 359.86 269.864V270.248C359.86 270.474 359.9 270.666 359.979 270.824C360.059 270.982 360.171 271.103 360.315 271.186C360.458 271.268 360.626 271.309 360.818 271.309C360.942 271.309 361.056 271.291 361.158 271.256C361.261 271.22 361.349 271.166 361.424 271.094C361.498 271.022 361.555 270.934 361.595 270.828L362.216 270.94C362.167 271.123 362.077 271.283 361.949 271.421C361.821 271.557 361.661 271.663 361.468 271.739C361.276 271.814 361.057 271.851 360.811 271.851ZM362.987 271.783V268.411H363.617V268.96H363.658C363.729 268.774 363.844 268.629 364.003 268.525C364.163 268.419 364.354 268.367 364.576 268.367C364.802 268.367 364.991 268.419 365.143 268.525C365.297 268.63 365.41 268.775 365.483 268.96H365.518C365.599 268.779 365.727 268.636 365.903 268.529C366.078 268.421 366.288 268.367 366.531 268.367C366.837 268.367 367.086 268.463 367.279 268.654C367.474 268.846 367.571 269.135 367.571 269.522V271.783H366.915V269.583C366.915 269.355 366.853 269.189 366.728 269.087C366.604 268.984 366.455 268.933 366.282 268.933C366.069 268.933 365.903 268.999 365.784 269.131C365.665 269.261 365.606 269.429 365.606 269.634V271.783H364.952V269.541C364.952 269.358 364.895 269.211 364.781 269.1C364.666 268.989 364.518 268.933 364.335 268.933C364.21 268.933 364.095 268.966 363.99 269.032C363.886 269.096 363.802 269.186 363.738 269.302C363.675 269.418 363.643 269.552 363.643 269.704V271.783H362.987ZM370.979 269.234L370.384 269.339C370.359 269.263 370.319 269.191 370.265 269.122C370.212 269.053 370.141 268.997 370.05 268.953C369.959 268.909 369.846 268.887 369.71 268.887C369.524 268.887 369.368 268.929 369.244 269.012C369.12 269.094 369.057 269.2 369.057 269.331C369.057 269.443 369.099 269.534 369.183 269.603C369.266 269.672 369.401 269.728 369.587 269.772L370.122 269.895C370.433 269.967 370.664 270.077 370.816 270.227C370.968 270.376 371.045 270.57 371.045 270.808C371.045 271.01 370.986 271.19 370.869 271.349C370.753 271.505 370.592 271.628 370.384 271.717C370.177 271.807 369.938 271.851 369.666 271.851C369.288 271.851 368.98 271.771 368.741 271.61C368.503 271.447 368.356 271.217 368.302 270.918L368.937 270.822C368.976 270.987 369.057 271.112 369.18 271.197C369.303 271.28 369.464 271.322 369.661 271.322C369.876 271.322 370.048 271.278 370.177 271.188C370.306 271.098 370.37 270.987 370.37 270.857C370.37 270.751 370.331 270.663 370.252 270.591C370.174 270.519 370.055 270.465 369.894 270.429L369.323 270.303C369.008 270.232 368.776 270.117 368.625 269.961C368.476 269.804 368.401 269.606 368.401 269.366C368.401 269.167 368.456 268.992 368.568 268.843C368.679 268.694 368.833 268.577 369.029 268.494C369.225 268.409 369.45 268.367 369.703 268.367C370.067 268.367 370.354 268.446 370.564 268.604C370.773 268.76 370.911 268.971 370.979 269.234Z"
            fill="#1B2029"
          />
          <path
            d="M494.333 271.845C494.149 271.842 493.965 271.807 493.78 271.739C493.596 271.672 493.427 271.559 493.275 271.399C493.123 271.238 493.001 271.021 492.908 270.747C492.816 270.472 492.77 270.126 492.77 269.711C492.77 269.312 492.807 268.96 492.882 268.652C492.957 268.343 493.065 268.083 493.207 267.873C493.349 267.66 493.52 267.499 493.721 267.39C493.923 267.28 494.151 267.225 494.404 267.225C494.656 267.225 494.88 267.275 495.076 267.376C495.273 267.476 495.434 267.615 495.559 267.794C495.683 267.972 495.764 268.178 495.8 268.411H495.265C495.215 268.209 495.118 268.041 494.975 267.908C494.831 267.775 494.641 267.708 494.404 267.708C494.055 267.708 493.781 267.859 493.58 268.162C493.381 268.465 493.281 268.891 493.28 269.438H493.315C493.397 269.314 493.494 269.208 493.607 269.12C493.721 269.031 493.847 268.962 493.984 268.913C494.122 268.865 494.268 268.841 494.421 268.841C494.679 268.841 494.915 268.905 495.128 269.034C495.342 269.162 495.513 269.338 495.642 269.563C495.771 269.787 495.835 270.044 495.835 270.334C495.835 270.612 495.773 270.867 495.649 271.098C495.524 271.328 495.349 271.511 495.124 271.647C494.9 271.782 494.637 271.848 494.333 271.845ZM494.333 271.362C494.518 271.362 494.683 271.316 494.83 271.223C494.978 271.131 495.094 271.007 495.179 270.852C495.265 270.697 495.308 270.524 495.308 270.334C495.308 270.148 495.267 269.979 495.183 269.827C495.101 269.673 494.988 269.551 494.843 269.46C494.699 269.369 494.536 269.324 494.351 269.324C494.212 269.324 494.082 269.352 493.962 269.407C493.842 269.462 493.737 269.536 493.646 269.631C493.557 269.727 493.487 269.836 493.435 269.959C493.384 270.08 493.359 270.208 493.359 270.343C493.359 270.521 493.4 270.688 493.484 270.844C493.569 270.999 493.684 271.124 493.831 271.219C493.979 271.314 494.146 271.362 494.333 271.362Z"
            fill="#5A6D91"
          />
          <mask id="path-93-inside-6_4955_16369" fill="white">
            <path
              d="M344.3 279C344.3 277.049 345.882 275.467 347.833 275.467H494.466C496.418 275.467 498 277.049 498 279V296C498 297.951 496.418 299.533 494.466 299.533H347.833C345.882 299.533 344.3 297.951 344.3 296V279Z"
            />
          </mask>
          <path
            d="M344.3 279C344.3 277.049 345.882 275.467 347.833 275.467H494.466C496.418 275.467 498 277.049 498 279V296C498 297.951 496.418 299.533 494.466 299.533H347.833C345.882 299.533 344.3 297.951 344.3 296V279Z"
            fill="white"
          />
          <path
            d="M344.3 275.467H498H344.3M498 296C498 298.073 496.319 299.754 494.246 299.754H348.054C345.981 299.754 344.3 298.073 344.3 296V296C344.3 297.829 345.882 299.313 347.833 299.313H494.466C496.418 299.313 498 297.829 498 296V296ZM498 296M344.3 299.533V275.467V299.533M344.3 299.533M498 275.467V299.533V275.467"
            fill="#A8B3C8"
            mask="url(#path-93-inside-6_4955_16369)"
          />
          <path
            d="M364.227 286V281.503H367.016V282.087H364.906V283.457H366.816V284.039H364.906V286H364.227ZM368.767 286.075C368.554 286.075 368.36 286.035 368.188 285.956C368.015 285.876 367.878 285.759 367.777 285.607C367.677 285.455 367.628 285.268 367.628 285.047C367.628 284.857 367.664 284.7 367.737 284.577C367.811 284.454 367.909 284.357 368.034 284.285C368.158 284.213 368.297 284.159 368.451 284.123C368.605 284.086 368.761 284.058 368.921 284.039C369.123 284.016 369.287 283.997 369.413 283.982C369.539 283.966 369.63 283.94 369.687 283.905C369.744 283.87 369.773 283.813 369.773 283.734V283.719C369.773 283.527 369.719 283.378 369.61 283.273C369.504 283.167 369.344 283.115 369.132 283.115C368.911 283.115 368.736 283.164 368.609 283.262C368.483 283.358 368.396 283.466 368.348 283.585L367.731 283.444C367.804 283.239 367.911 283.074 368.051 282.948C368.193 282.821 368.357 282.728 368.541 282.671C368.726 282.613 368.919 282.583 369.123 282.583C369.258 282.583 369.4 282.599 369.551 282.632C369.703 282.662 369.845 282.719 369.977 282.803C370.11 282.886 370.219 283.006 370.304 283.161C370.389 283.315 370.432 283.514 370.432 283.76V286H369.79V285.539H369.764C369.722 285.624 369.658 285.707 369.573 285.789C369.488 285.871 369.379 285.939 369.246 285.993C369.113 286.048 368.953 286.075 368.767 286.075ZM368.91 285.548C369.091 285.548 369.247 285.512 369.375 285.44C369.506 285.368 369.605 285.275 369.672 285.159C369.741 285.042 369.775 284.917 369.775 284.784V284.349C369.752 284.372 369.706 284.394 369.639 284.415C369.573 284.434 369.498 284.451 369.413 284.465C369.328 284.478 369.245 284.491 369.165 284.502C369.084 284.513 369.017 284.522 368.963 284.529C368.835 284.545 368.719 284.572 368.614 284.61C368.51 284.648 368.426 284.703 368.363 284.775C368.302 284.845 368.271 284.939 368.271 285.056C368.271 285.218 368.331 285.341 368.451 285.425C368.571 285.507 368.724 285.548 368.91 285.548ZM372.727 286.068C372.4 286.068 372.119 285.994 371.884 285.846C371.649 285.697 371.469 285.491 371.343 285.229C371.218 284.967 371.155 284.667 371.155 284.329C371.155 283.986 371.219 283.684 371.348 283.422C371.477 283.159 371.658 282.953 371.892 282.805C372.127 282.657 372.403 282.583 372.72 282.583C372.976 282.583 373.205 282.631 373.405 282.726C373.606 282.82 373.768 282.952 373.891 283.121C374.015 283.291 374.089 283.489 374.112 283.716H373.473C373.438 283.558 373.358 283.422 373.232 283.308C373.107 283.194 372.941 283.137 372.731 283.137C372.548 283.137 372.388 283.185 372.25 283.282C372.114 283.377 372.008 283.513 371.932 283.69C371.856 283.866 371.818 284.074 371.818 284.314C371.818 284.56 371.855 284.772 371.93 284.95C372.004 285.129 372.11 285.267 372.246 285.365C372.384 285.463 372.545 285.513 372.731 285.513C372.856 285.513 372.968 285.49 373.069 285.444C373.172 285.398 373.257 285.331 373.326 285.245C373.397 285.158 373.446 285.054 373.473 284.933H374.112C374.089 285.151 374.018 285.346 373.899 285.517C373.781 285.688 373.622 285.823 373.423 285.921C373.225 286.019 372.993 286.068 372.727 286.068ZM376.268 286.068C375.936 286.068 375.65 285.997 375.409 285.855C375.171 285.712 374.986 285.51 374.856 285.251C374.727 284.991 374.663 284.685 374.663 284.336C374.663 283.99 374.727 283.686 374.856 283.422C374.986 283.159 375.168 282.953 375.401 282.805C375.635 282.657 375.909 282.583 376.222 282.583C376.412 282.583 376.597 282.615 376.775 282.678C376.954 282.741 377.114 282.84 377.256 282.974C377.398 283.109 377.51 283.284 377.592 283.499C377.674 283.713 377.715 283.973 377.715 284.279V284.511H375.034V284.019H377.072C377.072 283.847 377.037 283.694 376.966 283.56C376.896 283.426 376.797 283.32 376.67 283.242C376.544 283.165 376.396 283.126 376.226 283.126C376.042 283.126 375.881 283.171 375.743 283.262C375.607 283.351 375.502 283.468 375.427 283.613C375.354 283.757 375.317 283.913 375.317 284.081V284.465C375.317 284.691 375.357 284.882 375.436 285.04C375.516 285.199 375.628 285.319 375.772 285.403C375.915 285.485 376.083 285.526 376.275 285.526C376.399 285.526 376.513 285.508 376.615 285.473C376.717 285.436 376.806 285.382 376.881 285.311C376.955 285.239 377.012 285.15 377.052 285.045L377.673 285.157C377.624 285.34 377.534 285.5 377.405 285.638C377.278 285.774 377.118 285.88 376.925 285.956C376.733 286.031 376.514 286.068 376.268 286.068ZM378.496 286V281.503H379.153V283.174H379.192C379.23 283.104 379.285 283.023 379.357 282.93C379.429 282.838 379.528 282.758 379.656 282.689C379.783 282.618 379.951 282.583 380.161 282.583C380.433 282.583 380.676 282.652 380.89 282.79C381.103 282.927 381.271 283.126 381.392 283.385C381.515 283.644 381.577 283.956 381.577 284.32C381.577 284.685 381.516 284.997 381.395 285.258C381.273 285.517 381.106 285.717 380.894 285.857C380.682 285.996 380.439 286.066 380.167 286.066C379.962 286.066 379.795 286.031 379.664 285.963C379.536 285.894 379.435 285.813 379.361 285.721C379.288 285.629 379.232 285.547 379.192 285.475H379.137V286H378.496ZM379.14 284.314C379.14 284.551 379.174 284.759 379.243 284.937C379.312 285.116 379.411 285.256 379.541 285.357C379.672 285.456 379.831 285.506 380.02 285.506C380.216 285.506 380.38 285.454 380.512 285.35C380.644 285.245 380.743 285.102 380.811 284.922C380.879 284.742 380.914 284.539 380.914 284.314C380.914 284.091 380.88 283.891 380.813 283.714C380.747 283.537 380.647 283.397 380.514 283.295C380.382 283.192 380.218 283.141 380.02 283.141C379.83 283.141 379.669 283.19 379.537 283.288C379.407 283.386 379.308 283.523 379.241 283.699C379.173 283.874 379.14 284.079 379.14 284.314ZM383.735 286.068C383.419 286.068 383.143 285.996 382.907 285.851C382.671 285.706 382.488 285.503 382.358 285.242C382.228 284.982 382.163 284.677 382.163 284.329C382.163 283.979 382.228 283.673 382.358 283.411C382.488 283.149 382.671 282.946 382.907 282.801C383.143 282.656 383.419 282.583 383.735 282.583C384.051 282.583 384.327 282.656 384.563 282.801C384.798 282.946 384.981 283.149 385.112 283.411C385.242 283.673 385.307 283.979 385.307 284.329C385.307 284.677 385.242 284.982 385.112 285.242C384.981 285.503 384.798 285.706 384.563 285.851C384.327 285.996 384.051 286.068 383.735 286.068ZM383.737 285.517C383.942 285.517 384.112 285.463 384.246 285.354C384.381 285.246 384.481 285.102 384.545 284.922C384.611 284.742 384.644 284.543 384.644 284.327C384.644 284.112 384.611 283.914 384.545 283.734C384.481 283.552 384.381 283.407 384.246 283.297C384.112 283.187 383.942 283.132 383.737 283.132C383.531 283.132 383.359 283.187 383.223 283.297C383.089 283.407 382.988 283.552 382.922 283.734C382.858 283.914 382.826 284.112 382.826 284.327C382.826 284.543 382.858 284.742 382.922 284.922C382.988 285.102 383.089 285.246 383.223 285.354C383.359 285.463 383.531 285.517 383.737 285.517ZM387.461 286.068C387.144 286.068 386.868 285.996 386.633 285.851C386.397 285.706 386.214 285.503 386.084 285.242C385.953 284.982 385.888 284.677 385.888 284.329C385.888 283.979 385.953 283.673 386.084 283.411C386.214 283.149 386.397 282.946 386.633 282.801C386.868 282.656 387.144 282.583 387.461 282.583C387.777 282.583 388.053 282.656 388.288 282.801C388.524 282.946 388.707 283.149 388.837 283.411C388.968 283.673 389.033 283.979 389.033 284.329C389.033 284.677 388.968 284.982 388.837 285.242C388.707 285.503 388.524 285.706 388.288 285.851C388.053 285.996 387.777 286.068 387.461 286.068ZM387.463 285.517C387.668 285.517 387.837 285.463 387.972 285.354C388.107 285.246 388.206 285.102 388.271 284.922C388.337 284.742 388.37 284.543 388.37 284.327C388.37 284.112 388.337 283.914 388.271 283.734C388.206 283.552 388.107 283.407 387.972 283.297C387.837 283.187 387.668 283.132 387.463 283.132C387.256 283.132 387.085 283.187 386.949 283.297C386.814 283.407 386.714 283.552 386.648 283.734C386.584 283.914 386.551 284.112 386.551 284.327C386.551 284.543 386.584 284.742 386.648 284.922C386.714 285.102 386.814 285.246 386.949 285.354C387.085 285.463 387.256 285.517 387.463 285.517ZM390.369 284.856L390.365 284.055H390.479L391.823 282.627H392.609L391.076 284.252H390.973L390.369 284.856ZM389.766 286V281.503H390.422V286H389.766ZM391.895 286L390.688 284.397L391.14 283.938L392.701 286H391.895Z"
            fill="#1B2029"
          />
          <rect
            x="503.3"
            y="119.133"
            width="3.53333"
            height="78.6167"
            rx="1.76667"
            fill="#5A6D91"
          />
          <mask
            id="path-97-outside-7_4955_16369"
            maskUnits="userSpaceOnUse"
            x="339"
            y="251.85"
            width="168"
            height="31"
            fill="black"
          >
            <rect fill="white" x="339" y="251.85" width="168" height="31" />
            <path d="M339 252.85H506.833V282.167H339V252.85Z" />
          </mask>
          <path d="M339 252.85H506.833V282.167H339V252.85Z" fill="white" />
          <path
            d="M339 252.85V253.292H506.833V252.85V252.408H339V252.85Z"
            fill="#A8B3C8"
            mask="url(#path-97-outside-7_4955_16369)"
          />
          <path
            d="M363.318 265.008H355.81L358.537 263.163C358.841 263.12 359.022 262.962 359.107 262.78L363.318 259.709V265.008Z"
            fill="#DBE5F6"
          />
          <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M357.425 263.345C357.609 263.555 357.852 263.709 358.127 263.78V264.159C358.127 264.342 358.275 264.49 358.458 264.49C358.641 264.49 358.789 264.342 358.789 264.159V263.784C359.068 263.716 359.315 263.563 359.502 263.352L359.845 263.55C360.004 263.642 360.206 263.587 360.298 263.429C360.389 263.271 360.335 263.068 360.177 262.977L359.818 262.77C359.853 262.643 359.872 262.509 359.872 262.371C359.872 262.23 359.853 262.094 359.816 261.966L360.177 261.758C360.336 261.666 360.39 261.464 360.299 261.305C360.207 261.147 360.004 261.093 359.846 261.184L359.498 261.385C359.311 261.176 359.066 261.025 358.789 260.958V260.575C358.789 260.392 358.641 260.244 358.458 260.244C358.275 260.244 358.127 260.392 358.127 260.575V260.962C357.854 261.032 357.613 261.184 357.429 261.392L357.069 261.184C356.911 261.093 356.708 261.147 356.617 261.305C356.525 261.464 356.579 261.666 356.738 261.758L357.114 261.975C357.08 262.101 357.061 262.233 357.061 262.371C357.061 262.506 357.079 262.637 357.113 262.761L356.738 262.977C356.58 263.068 356.526 263.271 356.617 263.429C356.709 263.587 356.912 263.642 357.07 263.55L357.425 263.345ZM357.724 262.371C357.724 262.827 358.076 263.16 358.467 263.16C358.857 263.16 359.209 262.827 359.209 262.371C359.209 261.914 358.857 261.582 358.467 261.582C358.076 261.582 357.724 261.914 357.724 262.371Z"
            fill="#175DDC"
          />
          <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M363.405 259.058C363.722 259.058 363.979 259.315 363.979 259.633V265.102C363.979 265.419 363.722 265.676 363.405 265.676H362.791V265.814C362.791 265.997 362.643 266.145 362.46 266.145C362.277 266.145 362.128 265.997 362.128 265.814V265.676H356.994V265.814C356.994 265.997 356.846 266.145 356.663 266.145C356.48 266.145 356.332 265.997 356.332 265.814V265.676H355.72C355.403 265.676 355.146 265.419 355.146 265.102V259.633C355.146 259.315 355.403 259.058 355.72 259.058H363.405ZM363.316 263.939V265.014H355.808V259.721H363.316V260.795H362.737C362.554 260.795 362.405 260.943 362.405 261.126C362.405 261.309 362.554 261.457 362.737 261.457H363.316V263.277H362.737C362.554 263.277 362.405 263.425 362.405 263.608C362.405 263.791 362.554 263.939 362.737 263.939H363.316Z"
            fill="#175DDC"
          />
          <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M357.425 263.345C357.609 263.555 357.852 263.709 358.127 263.78V264.159C358.127 264.342 358.275 264.49 358.458 264.49C358.641 264.49 358.789 264.342 358.789 264.159V263.784C359.068 263.716 359.315 263.563 359.502 263.352L359.845 263.55C360.004 263.642 360.206 263.587 360.298 263.429C360.389 263.271 360.335 263.068 360.177 262.977L359.818 262.77C359.853 262.643 359.872 262.509 359.872 262.371C359.872 262.23 359.853 262.094 359.816 261.966L360.177 261.758C360.336 261.666 360.39 261.464 360.299 261.305C360.207 261.147 360.004 261.093 359.846 261.184L359.498 261.385C359.311 261.176 359.066 261.025 358.789 260.958V260.575C358.789 260.392 358.641 260.244 358.458 260.244C358.275 260.244 358.127 260.392 358.127 260.575V260.962C357.854 261.032 357.613 261.184 357.429 261.392L357.069 261.184C356.911 261.093 356.708 261.147 356.617 261.305C356.525 261.464 356.579 261.666 356.738 261.758L357.114 261.975C357.08 262.101 357.061 262.233 357.061 262.371C357.061 262.506 357.079 262.637 357.113 262.761L356.738 262.977C356.58 263.068 356.526 263.271 356.617 263.429C356.709 263.587 356.912 263.642 357.07 263.55L357.425 263.345ZM357.724 262.371C357.724 262.827 358.076 263.16 358.467 263.16C358.857 263.16 359.209 262.827 359.209 262.371C359.209 261.914 358.857 261.582 358.467 261.582C358.076 261.582 357.724 261.914 357.724 262.371Z"
            stroke="#175DDC"
          />
          <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M363.405 259.058C363.722 259.058 363.979 259.315 363.979 259.633V265.102C363.979 265.419 363.722 265.676 363.405 265.676H362.791V265.814C362.791 265.997 362.643 266.145 362.46 266.145C362.277 266.145 362.128 265.997 362.128 265.814V265.676H356.994V265.814C356.994 265.997 356.846 266.145 356.663 266.145C356.48 266.145 356.332 265.997 356.332 265.814V265.676H355.72C355.403 265.676 355.146 265.419 355.146 265.102V259.633C355.146 259.315 355.403 259.058 355.72 259.058H363.405ZM363.316 263.939V265.014H355.808V259.721H363.316V260.795H362.737C362.554 260.795 362.405 260.943 362.405 261.126C362.405 261.309 362.554 261.457 362.737 261.457H363.316V263.277H362.737C362.554 263.277 362.405 263.425 362.405 263.608C362.405 263.791 362.554 263.939 362.737 263.939H363.316Z"
            stroke="#175DDC"
          />
          <path
            d="M353.025 270.37L354.195 273.909H354.241L355.409 270.37H356.305L354.72 274.867H353.714L352.131 270.37H353.025ZM357.483 274.935C357.269 274.935 357.076 274.897 356.905 274.821C356.735 274.743 356.601 274.629 356.501 274.478C356.403 274.327 356.354 274.141 356.354 273.92C356.354 273.73 356.389 273.573 356.459 273.448C356.53 273.324 356.626 273.224 356.747 273.15C356.869 273.075 357.005 273.019 357.158 272.981C357.311 272.941 357.47 272.912 357.634 272.895C357.832 272.874 357.992 272.856 358.115 272.84C358.238 272.822 358.327 272.796 358.383 272.761C358.44 272.724 358.469 272.668 358.469 272.592V272.579C358.469 272.413 358.42 272.285 358.321 272.194C358.223 272.104 358.082 272.058 357.898 272.058C357.703 272.058 357.549 272.101 357.434 272.186C357.322 272.271 357.246 272.371 357.206 272.486L356.464 272.381C356.522 272.176 356.619 272.005 356.754 271.867C356.888 271.728 357.053 271.624 357.248 271.555C357.442 271.485 357.658 271.45 357.893 271.45C358.056 271.45 358.218 271.469 358.379 271.507C358.54 271.545 358.687 271.608 358.82 271.696C358.953 271.782 359.06 271.9 359.14 272.05C359.222 272.199 359.263 272.385 359.263 272.609V274.867H358.499V274.403H358.473C358.425 274.497 358.357 274.585 358.269 274.667C358.182 274.747 358.073 274.813 357.942 274.862C357.811 274.911 357.658 274.935 357.483 274.935ZM357.689 274.351C357.849 274.351 357.987 274.319 358.104 274.256C358.221 274.192 358.311 274.107 358.374 274.002C358.439 273.896 358.471 273.781 358.471 273.657V273.259C358.446 273.28 358.403 273.299 358.343 273.316C358.285 273.334 358.219 273.349 358.146 273.363C358.073 273.376 358 273.387 357.928 273.398C357.857 273.408 357.794 273.417 357.742 273.424C357.623 273.44 357.517 273.467 357.423 273.503C357.33 273.54 357.256 273.591 357.202 273.657C357.147 273.721 357.12 273.805 357.12 273.907C357.12 274.054 357.174 274.164 357.281 274.239C357.388 274.313 357.524 274.351 357.689 274.351ZM362.212 273.448V271.494H363.007V274.867H362.237V274.267H362.201C362.125 274.456 362 274.611 361.826 274.731C361.653 274.851 361.44 274.911 361.187 274.911C360.966 274.911 360.771 274.862 360.601 274.763C360.432 274.664 360.301 274.52 360.205 274.331C360.11 274.141 360.063 273.911 360.063 273.641V271.494H360.858V273.518C360.858 273.732 360.916 273.902 361.033 274.028C361.15 274.154 361.304 274.217 361.494 274.217C361.611 274.217 361.725 274.188 361.835 274.131C361.945 274.074 362.035 273.989 362.105 273.876C362.177 273.762 362.212 273.619 362.212 273.448ZM364.62 270.37V274.867H363.825V270.37H364.62ZM367.121 271.494V272.109H365.182V271.494H367.121ZM365.661 270.686H366.456V273.852C366.456 273.959 366.472 274.041 366.504 274.098C366.538 274.154 366.582 274.192 366.636 274.212C366.69 274.233 366.75 274.243 366.816 274.243C366.866 274.243 366.911 274.239 366.952 274.232C366.994 274.225 367.027 274.218 367.049 274.212L367.183 274.834C367.14 274.848 367.079 274.865 367 274.882C366.923 274.9 366.828 274.91 366.715 274.913C366.516 274.919 366.336 274.889 366.177 274.823C366.017 274.755 365.891 274.652 365.797 274.511C365.705 274.37 365.659 274.195 365.661 273.984V270.686Z"
            fill="#175DDC"
          />
          <g clip-path="url(#clip13_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M405.176 262.323C405.358 262.342 405.489 262.506 405.47 262.688C405.259 264.624 403.591 266.123 401.574 266.123C400.143 266.123 398.89 265.368 398.206 264.238V265.29C398.206 265.473 398.058 265.621 397.875 265.621C397.692 265.621 397.544 265.473 397.544 265.29V263.532C397.544 263.349 397.692 263.201 397.875 263.201H399.634C399.817 263.201 399.965 263.349 399.965 263.532C399.965 263.714 399.816 263.863 399.634 263.863H398.754C399.315 264.816 400.366 265.461 401.574 265.461C403.259 265.461 404.637 264.21 404.811 262.616C404.83 262.434 404.994 262.303 405.176 262.323ZM401.521 260.687C401.704 260.687 401.852 260.835 401.853 261.018V261.721L402.513 261.505C402.686 261.448 402.874 261.543 402.931 261.717C402.987 261.891 402.893 262.078 402.72 262.135L402.053 262.353L402.469 262.936C402.575 263.085 402.54 263.291 402.392 263.398C402.243 263.504 402.036 263.47 401.93 263.321L401.521 262.748L401.112 263.321C401.006 263.469 400.799 263.504 400.65 263.398C400.502 263.292 400.467 263.085 400.573 262.936L400.989 262.353L400.322 262.135C400.149 262.078 400.055 261.891 400.111 261.717C400.168 261.543 400.355 261.448 400.529 261.505L401.189 261.721V261.018C401.19 260.835 401.339 260.687 401.521 260.687ZM401.463 258.174C402.896 258.174 404.15 258.931 404.833 260.063V259.007C404.833 258.824 404.981 258.676 405.164 258.676C405.347 258.676 405.495 258.824 405.495 259.007V260.766C405.495 260.949 405.347 261.097 405.164 261.097H403.405C403.222 261.097 403.074 260.949 403.074 260.766C403.074 260.583 403.222 260.435 403.405 260.435H404.283C403.722 259.481 402.671 258.836 401.463 258.836C399.778 258.836 398.4 260.088 398.227 261.682C398.206 261.863 398.043 261.995 397.861 261.975C397.68 261.955 397.548 261.791 397.567 261.61C397.778 259.673 399.447 258.174 401.463 258.174Z"
              fill="#5A6D91"
            />
          </g>
          <path
            d="M390.556 271.775C390.508 271.627 390.444 271.495 390.365 271.378C390.288 271.259 390.195 271.158 390.086 271.075C389.979 270.991 389.858 270.927 389.722 270.884C389.586 270.84 389.436 270.818 389.274 270.818C389.007 270.818 388.765 270.886 388.547 271.024C388.329 271.162 388.155 271.364 388.027 271.632C387.898 271.9 387.833 272.229 387.833 272.618C387.833 273.008 387.899 273.336 388.029 273.604C388.159 273.872 388.335 274.075 388.558 274.212C388.78 274.35 389.031 274.419 389.309 274.419C389.567 274.419 389.793 274.364 389.99 274.254C390.187 274.143 390.341 273.986 390.451 273.784C390.562 273.581 390.618 273.341 390.618 273.066L390.785 273.101H389.432V272.618H391.145V273.101C391.145 273.472 391.066 273.794 390.907 274.067C390.751 274.341 390.534 274.553 390.258 274.704C389.982 274.854 389.666 274.928 389.309 274.928C388.911 274.928 388.561 274.834 388.259 274.647C387.959 274.46 387.725 274.193 387.557 273.848C387.39 273.502 387.306 273.093 387.306 272.618C387.306 272.262 387.354 271.943 387.449 271.659C387.546 271.373 387.682 271.13 387.858 270.93C388.033 270.729 388.241 270.575 388.481 270.469C388.721 270.362 388.985 270.308 389.274 270.308C389.511 270.308 389.732 270.344 389.937 270.416C390.143 270.486 390.327 270.586 390.488 270.717C390.651 270.845 390.786 271 390.894 271.18C391.003 271.359 391.077 271.557 391.118 271.775H390.556ZM393.421 274.937C393.096 274.937 392.816 274.865 392.58 274.722C392.346 274.577 392.165 274.375 392.038 274.116C391.912 273.855 391.849 273.552 391.849 273.207C391.849 272.861 391.912 272.557 392.038 272.293C392.165 272.028 392.342 271.822 392.569 271.674C392.798 271.525 393.064 271.45 393.368 271.45C393.544 271.45 393.718 271.479 393.889 271.538C394.06 271.596 394.216 271.692 394.357 271.823C394.497 271.954 394.609 272.126 394.692 272.342C394.776 272.557 394.818 272.822 394.818 273.136V273.356H392.218V272.908H394.291C394.291 272.718 394.253 272.548 394.176 272.399C394.102 272.249 393.995 272.131 393.856 272.045C393.718 271.959 393.556 271.916 393.368 271.916C393.162 271.916 392.983 271.967 392.833 272.069C392.683 272.17 392.568 272.302 392.488 272.465C392.407 272.627 392.367 272.801 392.367 272.987V273.286C392.367 273.54 392.411 273.756 392.499 273.933C392.588 274.109 392.712 274.243 392.87 274.335C393.028 274.426 393.212 274.471 393.421 274.471C393.557 274.471 393.68 274.452 393.79 274.414C393.901 274.375 393.997 274.316 394.078 274.239C394.158 274.16 394.22 274.062 394.264 273.944L394.765 274.085C394.712 274.255 394.624 274.404 394.499 274.533C394.375 274.66 394.221 274.76 394.038 274.832C393.855 274.902 393.649 274.937 393.421 274.937ZM396.124 272.838V274.867H395.606V271.494H396.107V272.021H396.15C396.23 271.85 396.35 271.712 396.511 271.608C396.672 271.503 396.879 271.45 397.134 271.45C397.363 271.45 397.562 271.497 397.734 271.591C397.905 271.683 398.038 271.823 398.133 272.012C398.228 272.2 398.276 272.437 398.276 272.724V274.867H397.758V272.759C397.758 272.494 397.689 272.287 397.551 272.14C397.414 271.99 397.225 271.916 396.985 271.916C396.819 271.916 396.672 271.951 396.541 272.023C396.412 272.095 396.311 272.2 396.236 272.337C396.161 272.475 396.124 272.642 396.124 272.838ZM400.637 274.937C400.312 274.937 400.032 274.865 399.796 274.722C399.562 274.577 399.381 274.375 399.254 274.116C399.128 273.855 399.065 273.552 399.065 273.207C399.065 272.861 399.128 272.557 399.254 272.293C399.381 272.028 399.558 271.822 399.785 271.674C400.013 271.525 400.28 271.45 400.584 271.45C400.76 271.45 400.933 271.479 401.105 271.538C401.276 271.596 401.432 271.692 401.572 271.823C401.713 271.954 401.825 272.126 401.908 272.342C401.992 272.557 402.034 272.822 402.034 273.136V273.356H399.434V272.908H401.507C401.507 272.718 401.468 272.548 401.392 272.399C401.318 272.249 401.211 272.131 401.072 272.045C400.934 271.959 400.772 271.916 400.584 271.916C400.378 271.916 400.199 271.967 400.049 272.069C399.899 272.17 399.784 272.302 399.704 272.465C399.623 272.627 399.583 272.801 399.583 272.987V273.286C399.583 273.54 399.627 273.756 399.715 273.933C399.804 274.109 399.928 274.243 400.086 274.335C400.244 274.426 400.428 274.471 400.637 274.471C400.773 274.471 400.896 274.452 401.006 274.414C401.117 274.375 401.213 274.316 401.294 274.239C401.374 274.16 401.436 274.062 401.48 273.944L401.981 274.085C401.928 274.255 401.84 274.404 401.715 274.533C401.591 274.66 401.437 274.76 401.254 274.832C401.071 274.902 400.865 274.937 400.637 274.937ZM402.822 274.867V271.494H403.322V272.003H403.358C403.419 271.837 403.53 271.701 403.691 271.597C403.852 271.493 404.034 271.441 404.236 271.441C404.274 271.441 404.322 271.442 404.379 271.443C404.436 271.445 404.479 271.447 404.508 271.45V271.977C404.491 271.973 404.45 271.966 404.387 271.957C404.326 271.947 404.261 271.942 404.192 271.942C404.028 271.942 403.882 271.976 403.753 272.045C403.625 272.112 403.524 272.206 403.45 272.326C403.377 272.445 403.34 272.58 403.34 272.732V274.867H402.822ZM406.115 274.946C405.901 274.946 405.707 274.905 405.533 274.825C405.359 274.743 405.221 274.625 405.118 274.471C405.016 274.316 404.964 274.129 404.964 273.909C404.964 273.716 405.002 273.559 405.079 273.439C405.155 273.318 405.256 273.223 405.384 273.154C405.511 273.085 405.652 273.034 405.805 273C405.961 272.965 406.116 272.937 406.273 272.917C406.478 272.89 406.644 272.871 406.771 272.858C406.9 272.843 406.994 272.819 407.053 272.785C407.113 272.751 407.143 272.693 407.143 272.609V272.592C407.143 272.375 407.083 272.207 406.965 272.087C406.848 271.967 406.67 271.907 406.431 271.907C406.184 271.907 405.99 271.961 405.849 272.069C405.709 272.178 405.61 272.293 405.553 272.416L405.061 272.241C405.149 272.036 405.266 271.876 405.412 271.762C405.56 271.646 405.721 271.566 405.895 271.52C406.071 271.473 406.244 271.45 406.414 271.45C406.522 271.45 406.646 271.463 406.787 271.49C406.929 271.514 407.066 271.566 407.197 271.645C407.331 271.725 407.441 271.844 407.529 272.003C407.617 272.163 407.661 272.377 407.661 272.645V274.867H407.143V274.41H407.116C407.081 274.483 407.023 274.561 406.941 274.645C406.859 274.728 406.75 274.799 406.613 274.858C406.477 274.916 406.311 274.946 406.115 274.946ZM406.194 274.48C406.399 274.48 406.572 274.44 406.712 274.359C406.854 274.279 406.961 274.175 407.033 274.048C407.106 273.92 407.143 273.786 407.143 273.646V273.172C407.121 273.198 407.072 273.222 406.998 273.244C406.924 273.265 406.84 273.283 406.743 273.299C406.648 273.314 406.555 273.327 406.464 273.338C406.375 273.349 406.302 273.357 406.247 273.365C406.112 273.382 405.986 273.411 405.869 273.45C405.753 273.488 405.66 273.546 405.588 273.624C405.518 273.7 405.483 273.804 405.483 273.936C405.483 274.116 405.549 274.252 405.682 274.344C405.817 274.435 405.988 274.48 406.194 274.48ZM410.073 271.494V271.933H408.326V271.494H410.073ZM408.835 270.686H409.353V273.901C409.353 274.047 409.374 274.157 409.417 274.23C409.461 274.302 409.516 274.35 409.584 274.375C409.653 274.398 409.725 274.41 409.801 274.41C409.858 274.41 409.905 274.407 409.942 274.401C409.978 274.394 410.008 274.388 410.029 274.384L410.135 274.849C410.1 274.862 410.051 274.875 409.988 274.889C409.925 274.903 409.845 274.911 409.748 274.911C409.602 274.911 409.459 274.879 409.318 274.816C409.179 274.753 409.063 274.657 408.971 274.529C408.88 274.4 408.835 274.237 408.835 274.041V270.686ZM412.187 274.937C411.882 274.937 411.615 274.865 411.385 274.72C411.157 274.575 410.978 274.372 410.85 274.111C410.722 273.851 410.659 273.546 410.659 273.198C410.659 272.847 410.722 272.54 410.85 272.278C410.978 272.016 411.157 271.812 411.385 271.667C411.615 271.523 411.882 271.45 412.187 271.45C412.491 271.45 412.758 271.523 412.986 271.667C413.216 271.812 413.395 272.016 413.522 272.278C413.651 272.54 413.715 272.847 413.715 273.198C413.715 273.546 413.651 273.851 413.522 274.111C413.395 274.372 413.216 274.575 412.986 274.72C412.758 274.865 412.491 274.937 412.187 274.937ZM412.187 274.471C412.418 274.471 412.608 274.412 412.758 274.294C412.907 274.175 413.018 274.019 413.089 273.826C413.161 273.633 413.197 273.423 413.197 273.198C413.197 272.972 413.161 272.762 413.089 272.568C413.018 272.373 412.907 272.216 412.758 272.096C412.608 271.976 412.418 271.916 412.187 271.916C411.956 271.916 411.765 271.976 411.616 272.096C411.467 272.216 411.356 272.373 411.284 272.568C411.213 272.762 411.177 272.972 411.177 273.198C411.177 273.423 411.213 273.633 411.284 273.826C411.356 274.019 411.467 274.175 411.616 274.294C411.765 274.412 411.956 274.471 412.187 274.471ZM414.506 274.867V271.494H415.007V272.003H415.042C415.103 271.837 415.215 271.701 415.376 271.597C415.537 271.493 415.718 271.441 415.92 271.441C415.958 271.441 416.006 271.442 416.063 271.443C416.12 271.445 416.163 271.447 416.193 271.45V271.977C416.175 271.973 416.135 271.966 416.072 271.957C416.01 271.947 415.945 271.942 415.876 271.942C415.712 271.942 415.566 271.976 415.437 272.045C415.31 272.112 415.209 272.206 415.134 272.326C415.061 272.445 415.024 272.58 415.024 272.732V274.867H414.506Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip14_4955_16369)">
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M442.888 263.972L440.704 262.994C440.306 262.816 440.296 262.254 440.687 262.062L446.648 259.124C447.029 258.937 447.46 259.264 447.382 259.682L446.314 265.365C446.246 265.726 445.832 265.902 445.525 265.7L444.674 265.142L443.789 265.927C443.69 266.015 443.562 266.063 443.43 266.063C443.131 266.063 442.888 265.821 442.888 265.521V263.972ZM441.001 262.522L446.826 259.652L445.782 265.209L443.484 263.699L445.189 262.071C445.299 261.966 445.303 261.791 445.198 261.681C445.093 261.571 444.918 261.567 444.808 261.672L442.986 263.411L441.001 262.522ZM444.197 264.828L443.44 264.331V265.499L444.197 264.828Z"
              fill="#5A6D91"
            />
          </g>
          <path
            d="M439.4 271.494C439.374 271.271 439.267 271.099 439.08 270.976C438.892 270.853 438.663 270.791 438.39 270.791C438.191 270.791 438.017 270.824 437.868 270.888C437.72 270.952 437.604 271.041 437.521 271.154C437.439 271.266 437.398 271.394 437.398 271.538C437.398 271.658 437.426 271.761 437.483 271.847C437.542 271.932 437.617 272.003 437.707 272.06C437.798 272.116 437.893 272.162 437.993 272.199C438.092 272.234 438.184 272.262 438.267 272.284L438.724 272.407C438.841 272.438 438.971 272.481 439.115 272.535C439.26 272.589 439.398 272.663 439.53 272.757C439.663 272.849 439.773 272.967 439.859 273.112C439.946 273.257 439.989 273.435 439.989 273.646C439.989 273.889 439.925 274.108 439.798 274.305C439.672 274.501 439.487 274.657 439.244 274.772C439.003 274.888 438.709 274.946 438.364 274.946C438.042 274.946 437.763 274.894 437.527 274.79C437.293 274.686 437.109 274.541 436.974 274.355C436.841 274.169 436.765 273.953 436.748 273.707H437.31C437.325 273.877 437.382 274.018 437.481 274.129C437.582 274.239 437.71 274.321 437.863 274.375C438.018 274.428 438.185 274.454 438.364 274.454C438.572 274.454 438.758 274.42 438.924 274.353C439.089 274.284 439.22 274.189 439.317 274.067C439.413 273.944 439.462 273.801 439.462 273.637C439.462 273.488 439.42 273.366 439.337 273.273C439.253 273.179 439.143 273.103 439.007 273.044C438.871 272.986 438.724 272.934 438.566 272.89L438.013 272.732C437.661 272.631 437.383 272.487 437.178 272.3C436.973 272.112 436.871 271.867 436.871 271.564C436.871 271.312 436.939 271.093 437.075 270.906C437.213 270.717 437.397 270.57 437.628 270.466C437.861 270.361 438.121 270.308 438.408 270.308C438.698 270.308 438.955 270.36 439.181 270.464C439.406 270.567 439.585 270.707 439.717 270.886C439.85 271.064 439.92 271.267 439.927 271.494H439.4ZM442.228 274.937C441.903 274.937 441.623 274.865 441.387 274.722C441.153 274.577 440.972 274.375 440.845 274.116C440.719 273.855 440.656 273.552 440.656 273.207C440.656 272.861 440.719 272.557 440.845 272.293C440.972 272.028 441.149 271.822 441.376 271.674C441.604 271.525 441.871 271.45 442.175 271.45C442.351 271.45 442.524 271.479 442.696 271.538C442.867 271.596 443.023 271.692 443.163 271.823C443.304 271.954 443.416 272.126 443.499 272.342C443.583 272.557 443.624 272.822 443.624 273.136V273.356H441.025V272.908H443.097C443.097 272.718 443.059 272.548 442.983 272.399C442.909 272.249 442.802 272.131 442.663 272.045C442.525 271.959 442.363 271.916 442.175 271.916C441.969 271.916 441.79 271.967 441.639 272.069C441.49 272.17 441.375 272.302 441.295 272.465C441.214 272.627 441.174 272.801 441.174 272.987V273.286C441.174 273.54 441.218 273.756 441.306 273.933C441.395 274.109 441.519 274.243 441.677 274.335C441.835 274.426 442.019 274.471 442.228 274.471C442.364 274.471 442.487 274.452 442.597 274.414C442.708 274.375 442.804 274.316 442.884 274.239C442.965 274.16 443.027 274.062 443.071 273.944L443.572 274.085C443.519 274.255 443.431 274.404 443.306 274.533C443.182 274.66 443.028 274.76 442.845 274.832C442.662 274.902 442.456 274.937 442.228 274.937ZM444.931 272.838V274.867H444.413V271.494H444.913V272.021H444.957C445.036 271.85 445.156 271.712 445.317 271.608C445.478 271.503 445.686 271.45 445.941 271.45C446.169 271.45 446.369 271.497 446.54 271.591C446.712 271.683 446.845 271.823 446.94 272.012C447.035 272.2 447.083 272.437 447.083 272.724V274.867H446.565V272.759C446.565 272.494 446.496 272.287 446.358 272.14C446.221 271.99 446.032 271.916 445.792 271.916C445.626 271.916 445.478 271.951 445.348 272.023C445.219 272.095 445.118 272.2 445.043 272.337C444.968 272.475 444.931 272.642 444.931 272.838ZM449.303 274.937C449.022 274.937 448.774 274.866 448.559 274.724C448.344 274.581 448.175 274.379 448.054 274.118C447.932 273.856 447.872 273.546 447.872 273.189C447.872 272.835 447.932 272.527 448.054 272.267C448.175 272.006 448.344 271.805 448.561 271.663C448.778 271.521 449.028 271.45 449.312 271.45C449.532 271.45 449.705 271.487 449.832 271.56C449.961 271.632 450.059 271.714 450.127 271.806C450.196 271.897 450.249 271.971 450.287 272.03H450.331V270.37H450.849V274.867H450.349V274.348H450.287C450.249 274.41 450.195 274.488 450.125 274.581C450.054 274.673 449.954 274.756 449.824 274.829C449.693 274.901 449.52 274.937 449.303 274.937ZM449.374 274.471C449.581 274.471 449.757 274.417 449.901 274.309C450.044 274.199 450.153 274.048 450.228 273.854C450.302 273.66 450.34 273.435 450.34 273.18C450.34 272.929 450.303 272.708 450.23 272.519C450.157 272.329 450.048 272.181 449.905 272.076C449.762 271.969 449.584 271.916 449.374 271.916C449.154 271.916 448.971 271.972 448.825 272.085C448.68 272.196 448.571 272.347 448.497 272.539C448.426 272.729 448.39 272.943 448.39 273.18C448.39 273.42 448.426 273.639 448.5 273.835C448.574 274.029 448.684 274.185 448.829 274.3C448.975 274.414 449.157 274.471 449.374 274.471Z"
            fill="#5A6D91"
          />
          <g clip-path="url(#clip15_4955_16369)">
            <path
              d="M485.44 263.475C486.166 263.475 486.754 262.882 486.754 262.15C486.754 261.418 486.166 260.825 485.44 260.825C484.715 260.825 484.127 261.418 484.127 262.15C484.127 262.882 484.715 263.475 485.44 263.475Z"
              fill="#5A6D91"
            />
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M488.819 259.107L489.794 260.777C489.9 260.958 489.863 261.188 489.705 261.325L489.057 261.888C489.063 261.975 489.067 262.062 489.067 262.15C489.067 262.239 489.063 262.327 489.057 262.414L489.702 262.975C489.86 263.112 489.898 263.342 489.792 263.524L488.817 265.193C488.711 265.375 488.491 265.458 488.292 265.391L487.477 265.119C487.331 265.217 487.178 265.305 487.019 265.381L486.85 266.213C486.809 266.419 486.629 266.567 486.421 266.567H484.457C484.249 266.567 484.069 266.419 484.028 266.213L483.86 265.382C483.699 265.306 483.545 265.217 483.398 265.119L482.583 265.391C482.384 265.458 482.164 265.375 482.058 265.193L481.083 263.524C480.977 263.342 481.014 263.112 481.172 262.975L481.818 262.413C481.812 262.326 481.809 262.239 481.809 262.15C481.809 262.062 481.812 261.975 481.818 261.889L481.17 261.325C481.012 261.188 480.974 260.958 481.081 260.777L482.055 259.107C482.162 258.925 482.381 258.842 482.581 258.909L483.397 259.182C483.544 259.083 483.698 258.995 483.86 258.918L484.028 258.087C484.069 257.881 484.249 257.733 484.457 257.733H486.421C486.629 257.733 486.809 257.881 486.85 258.087L487.019 258.919C487.179 258.996 487.332 259.084 487.478 259.182L488.294 258.909C488.493 258.842 488.713 258.925 488.819 259.107ZM484.141 259.516L484.438 259.374L484.636 258.396H486.242L486.441 259.375L486.737 259.517C486.868 259.58 486.994 259.652 487.113 259.733L487.38 259.913L488.34 259.592L489.132 260.949L488.378 261.604L488.402 261.937C488.407 262.007 488.41 262.078 488.41 262.15C488.41 262.222 488.407 262.294 488.402 262.365L488.377 262.698L489.13 263.352L488.337 264.709L487.379 264.388L487.112 264.568C486.993 264.648 486.868 264.72 486.737 264.783L486.441 264.925L486.242 265.904H484.636L484.438 264.926L484.141 264.784C484.009 264.721 483.883 264.648 483.763 264.568L483.496 264.388L482.537 264.709L481.745 263.352L482.498 262.697L482.473 262.364C482.468 262.294 482.466 262.222 482.466 262.15C482.466 262.078 482.468 262.007 482.473 261.937L482.498 261.605L481.743 260.949L482.535 259.592L483.495 259.913L483.762 259.733C483.882 259.652 484.009 259.579 484.141 259.516Z"
              fill="#5A6D91"
            />
          </g>
          <path
            d="M476.358 271.494C476.332 271.271 476.225 271.099 476.038 270.976C475.85 270.853 475.621 270.791 475.348 270.791C475.149 270.791 474.975 270.824 474.826 270.888C474.678 270.952 474.562 271.041 474.479 271.154C474.397 271.266 474.356 271.394 474.356 271.538C474.356 271.658 474.384 271.761 474.441 271.847C474.5 271.932 474.575 272.003 474.665 272.06C474.756 272.116 474.851 272.162 474.951 272.199C475.05 272.234 475.142 272.262 475.225 272.284L475.682 272.407C475.799 272.438 475.929 272.481 476.073 272.535C476.218 272.589 476.356 272.663 476.488 272.757C476.621 272.849 476.731 272.967 476.817 273.112C476.904 273.257 476.947 273.435 476.947 273.646C476.947 273.889 476.883 274.108 476.756 274.305C476.63 274.501 476.445 274.657 476.202 274.772C475.961 274.888 475.667 274.946 475.322 274.946C475 274.946 474.721 274.894 474.485 274.79C474.251 274.686 474.067 274.541 473.932 274.355C473.799 274.169 473.723 273.953 473.706 273.707H474.268C474.283 273.877 474.34 274.018 474.439 274.129C474.54 274.239 474.668 274.321 474.821 274.375C474.976 274.428 475.143 274.454 475.322 274.454C475.53 274.454 475.716 274.42 475.882 274.353C476.047 274.284 476.178 274.189 476.275 274.067C476.372 273.944 476.42 273.801 476.42 273.637C476.42 273.488 476.378 273.366 476.295 273.273C476.211 273.179 476.101 273.103 475.965 273.044C475.829 272.986 475.682 272.934 475.524 272.89L474.971 272.732C474.619 272.631 474.341 272.487 474.136 272.3C473.931 272.112 473.829 271.867 473.829 271.564C473.829 271.312 473.897 271.093 474.033 270.906C474.171 270.717 474.355 270.57 474.586 270.466C474.819 270.361 475.079 270.308 475.366 270.308C475.656 270.308 475.913 270.36 476.139 270.464C476.364 270.567 476.543 270.707 476.675 270.886C476.808 271.064 476.878 271.267 476.885 271.494H476.358ZM479.186 274.937C478.861 274.937 478.581 274.865 478.345 274.722C478.111 274.577 477.93 274.375 477.803 274.116C477.677 273.855 477.614 273.552 477.614 273.207C477.614 272.861 477.677 272.557 477.803 272.293C477.93 272.028 478.107 271.822 478.334 271.674C478.562 271.525 478.829 271.45 479.133 271.45C479.309 271.45 479.482 271.479 479.654 271.538C479.825 271.596 479.981 271.692 480.121 271.823C480.262 271.954 480.374 272.126 480.457 272.342C480.541 272.557 480.582 272.822 480.582 273.136V273.356H477.983V272.908H480.055C480.055 272.718 480.017 272.548 479.941 272.399C479.867 272.249 479.76 272.131 479.621 272.045C479.483 271.959 479.321 271.916 479.133 271.916C478.927 271.916 478.748 271.967 478.597 272.069C478.448 272.17 478.333 272.302 478.253 272.465C478.172 272.627 478.132 272.801 478.132 272.987V273.286C478.132 273.54 478.176 273.756 478.264 273.933C478.353 274.109 478.477 274.243 478.635 274.335C478.793 274.426 478.977 274.471 479.186 274.471C479.322 274.471 479.445 274.452 479.555 274.414C479.666 274.375 479.762 274.316 479.842 274.239C479.923 274.16 479.985 274.062 480.029 273.944L480.53 274.085C480.477 274.255 480.389 274.404 480.264 274.533C480.14 274.66 479.986 274.76 479.803 274.832C479.62 274.902 479.414 274.937 479.186 274.937ZM482.838 271.494V271.933H481.09V271.494H482.838ZM481.599 270.686H482.117V273.901C482.117 274.047 482.139 274.157 482.181 274.23C482.225 274.302 482.281 274.35 482.348 274.375C482.417 274.398 482.489 274.41 482.565 274.41C482.622 274.41 482.669 274.407 482.706 274.401C482.742 274.394 482.772 274.388 482.794 274.384L482.899 274.849C482.864 274.862 482.815 274.875 482.752 274.889C482.689 274.903 482.609 274.911 482.513 274.911C482.366 274.911 482.223 274.879 482.082 274.816C481.943 274.753 481.827 274.657 481.735 274.529C481.644 274.4 481.599 274.237 481.599 274.041V270.686ZM485.084 271.494V271.933H483.336V271.494H485.084ZM483.845 270.686H484.364V273.901C484.364 274.047 484.385 274.157 484.427 274.23C484.471 274.302 484.527 274.35 484.594 274.375C484.663 274.398 484.735 274.41 484.812 274.41C484.869 274.41 484.915 274.407 484.952 274.401C484.989 274.394 485.018 274.388 485.04 274.384L485.145 274.849C485.11 274.862 485.061 274.875 484.998 274.889C484.935 274.903 484.855 274.911 484.759 274.911C484.612 274.911 484.469 274.879 484.328 274.816C484.189 274.753 484.074 274.657 483.982 274.529C483.891 274.4 483.845 274.237 483.845 274.041V270.686ZM485.863 274.867V271.494H486.382V274.867H485.863ZM486.127 270.932C486.026 270.932 485.939 270.897 485.866 270.829C485.794 270.76 485.758 270.677 485.758 270.581C485.758 270.484 485.794 270.401 485.866 270.332C485.939 270.264 486.026 270.229 486.127 270.229C486.228 270.229 486.314 270.264 486.386 270.332C486.459 270.401 486.496 270.484 486.496 270.581C486.496 270.677 486.459 270.76 486.386 270.829C486.314 270.897 486.228 270.932 486.127 270.932ZM487.849 272.838V274.867H487.331V271.494H487.831V272.021H487.875C487.954 271.85 488.074 271.712 488.235 271.608C488.396 271.503 488.604 271.45 488.859 271.45C489.087 271.45 489.287 271.497 489.458 271.591C489.63 271.683 489.763 271.823 489.858 272.012C489.953 272.2 490.001 272.437 490.001 272.724V274.867H489.483V272.759C489.483 272.494 489.414 272.287 489.276 272.14C489.139 271.99 488.95 271.916 488.71 271.916C488.544 271.916 488.396 271.951 488.266 272.023C488.137 272.095 488.036 272.2 487.961 272.337C487.886 272.475 487.849 272.642 487.849 272.838ZM492.309 276.202C492.059 276.202 491.844 276.17 491.664 276.105C491.483 276.042 491.333 275.959 491.213 275.855C491.095 275.752 491 275.643 490.93 275.525L491.343 275.236C491.39 275.297 491.449 275.367 491.521 275.446C491.593 275.527 491.691 275.596 491.815 275.655C491.941 275.715 492.106 275.745 492.309 275.745C492.581 275.745 492.806 275.679 492.983 275.547C493.16 275.416 493.249 275.209 493.249 274.928V274.243H493.205C493.167 274.305 493.113 274.381 493.042 274.471C492.974 274.561 492.874 274.641 492.744 274.711C492.615 274.78 492.441 274.814 492.221 274.814C491.949 274.814 491.704 274.75 491.488 274.621C491.273 274.492 491.102 274.305 490.976 274.059C490.852 273.813 490.79 273.514 490.79 273.163C490.79 272.817 490.85 272.516 490.972 272.26C491.093 272.003 491.262 271.804 491.479 271.663C491.696 271.521 491.946 271.45 492.23 271.45C492.45 271.45 492.624 271.487 492.753 271.56C492.883 271.632 492.982 271.714 493.051 271.806C493.122 271.897 493.176 271.971 493.214 272.03H493.266V271.494H493.767V274.963C493.767 275.253 493.701 275.489 493.569 275.67C493.439 275.853 493.264 275.987 493.042 276.072C492.823 276.159 492.578 276.202 492.309 276.202ZM492.291 274.348C492.499 274.348 492.675 274.301 492.818 274.206C492.962 274.111 493.071 273.974 493.146 273.795C493.22 273.617 493.258 273.403 493.258 273.154C493.258 272.911 493.221 272.697 493.148 272.511C493.075 272.325 492.966 272.179 492.823 272.074C492.679 271.968 492.502 271.916 492.291 271.916C492.072 271.916 491.889 271.971 491.743 272.082C491.598 272.194 491.489 272.343 491.415 272.53C491.344 272.718 491.308 272.926 491.308 273.154C491.308 273.388 491.344 273.595 491.418 273.775C491.492 273.954 491.602 274.095 491.747 274.197C491.893 274.298 492.075 274.348 492.291 274.348ZM497.105 272.249L496.639 272.381C496.61 272.303 496.567 272.228 496.51 272.155C496.454 272.08 496.378 272.019 496.281 271.97C496.185 271.922 496.061 271.898 495.91 271.898C495.704 271.898 495.532 271.946 495.394 272.041C495.258 272.134 495.19 272.254 495.19 272.399C495.19 272.527 495.237 272.629 495.33 272.704C495.424 272.779 495.571 272.841 495.77 272.89L496.27 273.013C496.572 273.087 496.797 273.199 496.944 273.349C497.092 273.499 497.166 273.691 497.166 273.927C497.166 274.12 497.111 274.293 496.999 274.445C496.889 274.597 496.736 274.717 496.538 274.805C496.341 274.893 496.111 274.937 495.849 274.937C495.505 274.937 495.22 274.862 494.995 274.713C494.769 274.564 494.626 274.346 494.566 274.059L495.058 273.936C495.105 274.117 495.194 274.253 495.324 274.344C495.456 274.435 495.628 274.48 495.84 274.48C496.081 274.48 496.273 274.429 496.415 274.327C496.559 274.223 496.63 274.098 496.63 273.953C496.63 273.836 496.589 273.738 496.507 273.659C496.425 273.579 496.3 273.518 496.13 273.479L495.568 273.347C495.259 273.274 495.032 273.161 494.887 273.007C494.743 272.852 494.672 272.658 494.672 272.425C494.672 272.235 494.725 272.066 494.832 271.92C494.94 271.774 495.087 271.659 495.273 271.575C495.461 271.492 495.673 271.45 495.91 271.45C496.244 271.45 496.506 271.523 496.696 271.67C496.888 271.816 497.024 272.009 497.105 272.249Z"
            fill="#5A6D91"
          />
          <rect
            width="167.833"
            height="42.5667"
            transform="translate(339 76.7333)"
            fill="#F3F6F9"
          />
          <g clip-path="url(#clip16_4955_16369)">
            <path
              d="M347.833 82.254H478.566C480.396 82.254 481.879 83.7371 481.879 85.5665V94.3995C481.879 96.229 480.396 97.712 478.566 97.712H347.833C346.004 97.712 344.521 96.2289 344.521 94.3995V85.5665C344.521 83.7372 346.004 82.2541 347.833 82.254Z"
              fill="white"
            />
            <path
              d="M347.833 82.254H478.566C480.396 82.254 481.879 83.7371 481.879 85.5665V94.3995C481.879 96.229 480.396 97.712 478.566 97.712H347.833C346.004 97.712 344.521 96.2289 344.521 94.3995V85.5665C344.521 83.7372 346.004 82.2541 347.833 82.254Z"
              stroke="#5A6D91"
              stroke-width="0.441667"
            />
            <g clip-path="url(#clip17_4955_16369)">
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M354.633 91.9472C354.103 92.3763 353.427 92.6333 352.691 92.6333C350.984 92.6333 349.6 91.2491 349.6 89.5416C349.6 87.8341 350.984 86.45 352.691 86.45C354.399 86.45 355.783 87.8341 355.783 89.5416C355.783 90.2773 355.526 90.953 355.097 91.4838C355.11 91.4934 355.122 91.504 355.134 91.5157L356.459 92.8407C356.588 92.9701 356.588 93.1798 356.459 93.3092C356.329 93.4385 356.12 93.4385 355.99 93.3092L354.665 91.9842C354.654 91.9725 354.643 91.9601 354.633 91.9472ZM355.12 89.5416C355.12 90.8832 354.033 91.9708 352.691 91.9708C351.35 91.9708 350.262 90.8832 350.262 89.5416C350.262 88.2 351.35 87.1125 352.691 87.1125C354.033 87.1125 355.12 88.2 355.12 89.5416Z"
                fill="#5A6D91"
              />
            </g>
            <path
              d="M363.053 91.3722C363.053 91.2696 363.037 91.179 363.005 91.1005C362.975 91.02 362.92 90.9475 362.842 90.8831C362.766 90.8187 362.659 90.7573 362.522 90.6989C362.387 90.6406 362.216 90.5812 362.009 90.5208C361.791 90.4564 361.595 90.3849 361.42 90.3064C361.245 90.2259 361.095 90.1343 360.97 90.0317C360.845 89.929 360.75 89.8113 360.683 89.6784C360.617 89.5456 360.584 89.3936 360.584 89.2225C360.584 89.0514 360.619 88.8934 360.689 88.7485C360.76 88.6036 360.86 88.4778 360.991 88.3711C361.124 88.2624 361.282 88.1779 361.465 88.1175C361.648 88.0571 361.853 88.0269 362.078 88.0269C362.408 88.0269 362.688 88.0903 362.917 88.2171C363.149 88.3419 363.325 88.506 363.446 88.7093C363.567 88.9105 363.627 89.1259 363.627 89.3554H363.047C363.047 89.1903 363.012 89.0444 362.942 88.9176C362.871 88.7888 362.765 88.6881 362.622 88.6157C362.479 88.5412 362.298 88.504 362.078 88.504C361.871 88.504 361.7 88.5352 361.565 88.5976C361.43 88.66 361.329 88.7445 361.263 88.8512C361.199 88.9579 361.166 89.0796 361.166 89.2165C361.166 89.3091 361.185 89.3936 361.224 89.4701C361.264 89.5446 361.325 89.614 361.408 89.6784C361.492 89.7428 361.599 89.8022 361.728 89.8566C361.859 89.9109 362.015 89.9632 362.196 90.0136C362.445 90.084 362.661 90.1625 362.842 90.2491C363.023 90.3356 363.172 90.4332 363.289 90.5419C363.408 90.6486 363.495 90.7704 363.552 90.9073C363.61 91.0421 363.639 91.1951 363.639 91.3662C363.639 91.5453 363.603 91.7073 363.53 91.8523C363.458 91.9972 363.354 92.121 363.219 92.2236C363.085 92.3263 362.923 92.4058 362.733 92.4621C362.546 92.5165 362.337 92.5437 362.105 92.5437C361.902 92.5437 361.702 92.5155 361.504 92.4591C361.309 92.4028 361.131 92.3182 360.97 92.2055C360.811 92.0928 360.683 91.9539 360.587 91.7889C360.492 91.6218 360.445 91.4286 360.445 91.2092H361.024C361.024 91.3601 361.054 91.49 361.112 91.5986C361.17 91.7053 361.25 91.7939 361.351 91.8643C361.453 91.9348 361.569 91.9871 361.698 92.0213C361.829 92.0535 361.964 92.0696 362.105 92.0696C362.309 92.0696 362.481 92.0415 362.622 91.9851C362.762 91.9287 362.869 91.8482 362.942 91.7436C363.016 91.6389 363.053 91.5151 363.053 91.3722ZM365.653 92.5437C365.425 92.5437 365.219 92.5054 365.034 92.4289C364.851 92.3504 364.693 92.2407 364.56 92.0998C364.429 91.9589 364.328 91.7919 364.258 91.5986C364.188 91.4054 364.152 91.1941 364.152 90.9646V90.8378C364.152 90.5721 364.192 90.3356 364.27 90.1283C364.349 89.919 364.455 89.7418 364.59 89.5969C364.725 89.452 364.878 89.3423 365.049 89.2678C365.22 89.1933 365.397 89.1561 365.58 89.1561C365.814 89.1561 366.015 89.1964 366.184 89.2769C366.355 89.3574 366.495 89.4701 366.604 89.615C366.713 89.7579 366.793 89.927 366.845 90.1223C366.898 90.3155 366.924 90.5268 366.924 90.7563V91.0069H364.484V90.551H366.365V90.5087C366.357 90.3638 366.327 90.2229 366.275 90.086C366.225 89.9492 366.144 89.8364 366.033 89.7479C365.923 89.6593 365.772 89.615 365.58 89.615C365.454 89.615 365.337 89.6422 365.23 89.6965C365.124 89.7489 365.032 89.8274 364.955 89.932C364.879 90.0367 364.82 90.1645 364.777 90.3155C364.735 90.4664 364.714 90.6406 364.714 90.8378V90.9646C364.714 91.1196 364.735 91.2655 364.777 91.4024C364.822 91.5373 364.885 91.656 364.968 91.7587C365.052 91.8613 365.154 91.9418 365.272 92.0002C365.393 92.0586 365.53 92.0878 365.683 92.0878C365.88 92.0878 366.047 92.0475 366.184 91.967C366.321 91.8865 366.441 91.7788 366.544 91.6439L366.882 91.9126C366.811 92.0193 366.722 92.121 366.613 92.2176C366.504 92.3142 366.37 92.3927 366.211 92.4531C366.054 92.5135 365.868 92.5437 365.653 92.5437ZM369.502 91.9247V90.243C369.502 90.1142 369.476 90.0025 369.424 89.9079C369.374 89.8113 369.297 89.7368 369.194 89.6845C369.092 89.6321 368.965 89.606 368.814 89.606C368.673 89.606 368.549 89.6301 368.443 89.6784C368.338 89.7267 368.255 89.7901 368.195 89.8686C368.137 89.9471 368.107 90.0317 368.107 90.1223H367.549C367.549 90.0055 367.579 89.8898 367.64 89.775C367.7 89.6603 367.786 89.5567 367.899 89.4641C368.014 89.3695 368.151 89.295 368.31 89.2406C368.471 89.1843 368.65 89.1561 368.847 89.1561C369.085 89.1561 369.294 89.1964 369.475 89.2769C369.658 89.3574 369.801 89.4792 369.904 89.6422C370.009 89.8032 370.061 90.0055 370.061 90.2491V91.7707C370.061 91.8794 370.07 91.9952 370.088 92.118C370.108 92.2407 370.137 92.3464 370.176 92.435V92.4833H369.593C369.565 92.4189 369.543 92.3333 369.527 92.2266C369.51 92.118 369.502 92.0173 369.502 91.9247ZM369.599 90.5027L369.605 90.8952H369.04C368.881 90.8952 368.74 90.9083 368.615 90.9344C368.49 90.9586 368.385 90.9958 368.301 91.0461C368.216 91.0965 368.152 91.1599 368.107 91.2363C368.063 91.3108 368.041 91.3984 368.041 91.499C368.041 91.6017 368.064 91.6953 368.111 91.7798C368.157 91.8643 368.226 91.9318 368.319 91.9821C368.413 92.0304 368.529 92.0545 368.666 92.0545C368.837 92.0545 368.988 92.0183 369.119 91.9459C369.25 91.8734 369.353 91.7848 369.43 91.6802C369.508 91.5755 369.551 91.4739 369.557 91.3752L369.795 91.6439C369.781 91.7285 369.743 91.8221 369.681 91.9247C369.618 92.0274 369.535 92.126 369.43 92.2206C369.327 92.3132 369.204 92.3907 369.062 92.4531C368.921 92.5135 368.762 92.5437 368.585 92.5437C368.363 92.5437 368.169 92.5004 368.002 92.4138C367.837 92.3273 367.708 92.2115 367.615 92.0666C367.525 91.9197 367.48 91.7556 367.48 91.5745C367.48 91.3994 367.514 91.2454 367.582 91.1126C367.651 90.9777 367.749 90.866 367.878 90.7774C368.007 90.6868 368.162 90.6184 368.343 90.5721C368.524 90.5258 368.726 90.5027 368.95 90.5027H369.599ZM371.498 89.7298V92.4833H370.94V89.2165H371.483L371.498 89.7298ZM372.519 89.1984L372.516 89.7177C372.469 89.7076 372.425 89.7016 372.383 89.6996C372.342 89.6955 372.296 89.6935 372.244 89.6935C372.115 89.6935 372.001 89.7137 371.903 89.7539C371.804 89.7942 371.72 89.8505 371.652 89.923C371.584 89.9955 371.529 90.082 371.489 90.1826C371.451 90.2813 371.426 90.39 371.414 90.5087L371.257 90.5993C371.257 90.402 371.276 90.2169 371.314 90.0438C371.354 89.8707 371.416 89.7177 371.498 89.5848C371.581 89.45 371.685 89.3453 371.812 89.2708C371.941 89.1944 372.094 89.1561 372.271 89.1561C372.311 89.1561 372.358 89.1611 372.41 89.1712C372.462 89.1793 372.498 89.1883 372.519 89.1984ZM374.282 92.0847C374.415 92.0847 374.537 92.0576 374.65 92.0032C374.763 91.9489 374.855 91.8744 374.928 91.7798C375 91.6832 375.042 91.5735 375.052 91.4507H375.583C375.573 91.6439 375.508 91.8241 375.387 91.9911C375.268 92.1562 375.112 92.29 374.919 92.3927C374.726 92.4933 374.513 92.5437 374.282 92.5437C374.036 92.5437 373.822 92.5004 373.639 92.4138C373.458 92.3273 373.307 92.2085 373.186 92.0576C373.067 91.9066 372.977 91.7335 372.917 91.5383C372.859 91.341 372.83 91.1327 372.83 90.9133V90.7865C372.83 90.5671 372.859 90.3598 372.917 90.1645C372.977 89.9673 373.067 89.7932 373.186 89.6422C373.307 89.4912 373.458 89.3725 373.639 89.2859C373.822 89.1994 374.036 89.1561 374.282 89.1561C374.537 89.1561 374.761 89.2084 374.952 89.3131C375.143 89.4158 375.293 89.5567 375.402 89.7358C375.513 89.9129 375.573 90.1142 375.583 90.3396H375.052C375.042 90.2048 375.003 90.083 374.937 89.9743C374.873 89.8656 374.784 89.7791 374.671 89.7147C374.561 89.6482 374.431 89.615 374.282 89.615C374.111 89.615 373.967 89.6492 373.85 89.7177C373.735 89.7841 373.644 89.8747 373.575 89.9894C373.509 90.1021 373.461 90.2279 373.43 90.3668C373.402 90.5037 373.388 90.6436 373.388 90.7865V90.9133C373.388 91.0562 373.402 91.1971 373.43 91.336C373.459 91.4749 373.506 91.6007 373.572 91.7134C373.641 91.8261 373.732 91.9167 373.847 91.9851C373.964 92.0515 374.109 92.0847 374.282 92.0847ZM376.77 87.8458V92.4833H376.211V87.8458H376.77ZM376.637 90.7261L376.404 90.717C376.406 90.4936 376.439 90.2873 376.504 90.0981C376.568 89.9069 376.659 89.7408 376.776 89.5999C376.892 89.459 377.031 89.3503 377.192 89.2739C377.355 89.1954 377.535 89.1561 377.733 89.1561C377.894 89.1561 378.039 89.1783 378.167 89.2225C378.296 89.2648 378.406 89.3332 378.497 89.4278C378.589 89.5224 378.66 89.6452 378.708 89.7962C378.756 89.9451 378.78 90.1273 378.78 90.3427V92.4833H378.219V90.3366C378.219 90.1655 378.194 90.0287 378.143 89.926C378.093 89.8213 378.02 89.7459 377.923 89.6996C377.826 89.6513 377.708 89.6271 377.567 89.6271C377.428 89.6271 377.301 89.6563 377.186 89.7147C377.074 89.773 376.976 89.8535 376.893 89.9562C376.813 90.0589 376.749 90.1766 376.703 90.3094C376.659 90.4403 376.637 90.5792 376.637 90.7261Z"
              fill="#5A6D91"
            />
            <path
              d="M485.633 85.5667C485.633 83.6153 487.215 82.0333 489.166 82.0333H497.999C499.951 82.0333 501.533 83.6153 501.533 85.5667V94.4C501.533 96.3514 499.951 97.9333 497.999 97.9333H489.166C487.215 97.9333 485.633 96.3514 485.633 94.4V85.5667Z"
              fill="#5A6D91"
            />
            <g clip-path="url(#clip18_4955_16369)">
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M489.58 86.8089H490.35C490.514 86.4042 490.911 86.1188 491.374 86.1188C491.838 86.1188 492.234 86.4042 492.398 86.8089H497.585C497.814 86.8089 497.999 86.9943 497.999 87.2229C497.999 87.4516 497.814 87.637 497.585 87.637H492.398C492.234 88.0417 491.838 88.3271 491.374 88.3271C490.911 88.3271 490.514 88.0417 490.35 87.637H489.58C489.351 87.637 489.166 87.4516 489.166 87.2229C489.166 86.9943 489.351 86.8089 489.58 86.8089ZM491.65 87.2229C491.65 87.3754 491.527 87.499 491.374 87.499C491.222 87.499 491.098 87.3754 491.098 87.2229C491.098 87.0705 491.222 86.9469 491.374 86.9469C491.527 86.9469 491.65 87.0705 491.65 87.2229Z"
                fill="white"
              />
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M490.35 92.3297H489.58C489.351 92.3297 489.166 92.5151 489.166 92.7438C489.166 92.9725 489.351 93.1578 489.58 93.1578H490.35C490.514 93.5625 490.911 93.8479 491.374 93.8479C491.838 93.8479 492.234 93.5625 492.398 93.1578H497.585C497.814 93.1578 497.999 92.9725 497.999 92.7438C497.999 92.5151 497.814 92.3297 497.585 92.3297H492.398C492.234 91.9251 491.838 91.6396 491.374 91.6396C490.911 91.6396 490.514 91.9251 490.35 92.3297ZM491.65 92.7438C491.65 92.8962 491.527 93.0198 491.374 93.0198C491.222 93.0198 491.098 92.8962 491.098 92.7438C491.098 92.5913 491.222 92.4677 491.374 92.4677C491.527 92.4677 491.65 92.5913 491.65 92.7438Z"
                fill="white"
              />
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M496.815 89.5693C496.651 89.1646 496.254 88.8792 495.791 88.8792C495.328 88.8792 494.931 89.1646 494.767 89.5693H489.58C489.351 89.5693 489.166 89.7547 489.166 89.9834C489.166 90.212 489.351 90.3974 489.58 90.3974H494.767C494.931 90.8021 495.328 91.0875 495.791 91.0875C496.254 91.0875 496.651 90.8021 496.815 90.3974H497.585C497.814 90.3974 497.999 90.212 497.999 89.9834C497.999 89.7547 497.814 89.5693 497.585 89.5693H496.815ZM495.791 90.2594C495.639 90.2594 495.515 90.1358 495.515 89.9834C495.515 89.8309 495.639 89.7073 495.791 89.7073C495.943 89.7073 496.067 89.8309 496.067 89.9834C496.067 90.1358 495.943 90.2594 495.791 90.2594Z"
                fill="white"
              />
            </g>
            <path
              d="M350.566 101.687H414.883C418.222 101.687 420.929 104.394 420.929 107.733C420.929 111.072 418.222 113.779 414.883 113.779H350.566C347.227 113.779 344.521 111.072 344.521 107.733C344.521 104.394 347.227 101.687 350.566 101.687Z"
              stroke="#5A6D91"
              stroke-width="0.441667"
            />
            <g clip-path="url(#clip19_4955_16369)">
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M350.373 105.028C349.946 105.028 349.6 105.374 349.6 105.801V109.279C349.6 109.706 349.946 110.052 350.373 110.052H355.01C355.437 110.052 355.783 109.706 355.783 109.279V106.574C355.783 106.147 355.437 105.801 355.01 105.801H352.691L352.145 105.255C352 105.11 351.803 105.028 351.598 105.028H350.373ZM352.451 106.381L351.735 105.664C351.699 105.628 351.649 105.608 351.598 105.608H350.373C350.266 105.608 350.179 105.694 350.179 105.801V109.279C350.179 109.386 350.266 109.472 350.373 109.472H355.01C355.117 109.472 355.203 109.386 355.203 109.279V106.574C355.203 106.467 355.117 106.381 355.01 106.381H352.451Z"
                fill="#5A6D91"
              />
            </g>
            <path
              d="M359.526 105.837V110.233H358.943V105.837H359.526ZM361.367 107.815V108.292H359.399V107.815H361.367ZM361.666 105.837V106.314H359.399V105.837H361.666ZM362.062 108.636V108.567C362.062 108.331 362.096 108.113 362.164 107.912C362.233 107.708 362.331 107.532 362.46 107.383C362.589 107.232 362.745 107.116 362.928 107.033C363.111 106.949 363.317 106.906 363.544 106.906C363.774 106.906 363.98 106.949 364.163 107.033C364.348 107.116 364.505 107.232 364.634 107.383C364.765 107.532 364.865 107.708 364.933 107.912C365.001 108.113 365.036 108.331 365.036 108.567V108.636C365.036 108.872 365.001 109.09 364.933 109.291C364.865 109.493 364.765 109.669 364.634 109.82C364.505 109.969 364.349 110.085 364.166 110.17C363.985 110.253 363.78 110.294 363.55 110.294C363.321 110.294 363.114 110.253 362.931 110.17C362.748 110.085 362.591 109.969 362.46 109.82C362.331 109.669 362.233 109.493 362.164 109.291C362.096 109.09 362.062 108.872 362.062 108.636ZM362.62 108.567V108.636C362.62 108.799 362.639 108.953 362.678 109.098C362.716 109.241 362.773 109.368 362.85 109.479C362.928 109.589 363.026 109.677 363.143 109.741C363.259 109.804 363.395 109.835 363.55 109.835C363.703 109.835 363.837 109.804 363.952 109.741C364.068 109.677 364.165 109.589 364.242 109.479C364.318 109.368 364.375 109.241 364.414 109.098C364.454 108.953 364.474 108.799 364.474 108.636V108.567C364.474 108.406 364.454 108.254 364.414 108.111C364.375 107.966 364.317 107.838 364.239 107.727C364.162 107.615 364.065 107.526 363.949 107.462C363.834 107.397 363.699 107.365 363.544 107.365C363.391 107.365 363.256 107.397 363.14 107.462C363.025 107.526 362.928 107.615 362.85 107.727C362.773 107.838 362.716 107.966 362.678 108.111C362.639 108.254 362.62 108.406 362.62 108.567ZM366.343 105.596V110.233H365.781V105.596H366.343ZM369.299 109.599V105.596H369.86V110.233H369.347L369.299 109.599ZM367.101 108.636V108.573C367.101 108.323 367.131 108.097 367.191 107.894C367.254 107.688 367.341 107.512 367.454 107.365C367.569 107.218 367.705 107.106 367.862 107.027C368.021 106.946 368.198 106.906 368.393 106.906C368.598 106.906 368.777 106.942 368.93 107.015C369.085 107.085 369.216 107.189 369.323 107.326C369.432 107.461 369.517 107.624 369.58 107.815C369.642 108.006 369.685 108.223 369.709 108.464V108.742C369.687 108.981 369.644 109.197 369.58 109.388C369.517 109.579 369.432 109.742 369.323 109.877C369.216 110.012 369.085 110.116 368.93 110.188C368.775 110.259 368.594 110.294 368.387 110.294C368.196 110.294 368.021 110.253 367.862 110.17C367.705 110.087 367.569 109.972 367.454 109.823C367.341 109.674 367.254 109.499 367.191 109.297C367.131 109.094 367.101 108.874 367.101 108.636ZM367.662 108.573V108.636C367.662 108.799 367.678 108.952 367.711 109.095C367.745 109.238 367.797 109.364 367.868 109.473C367.938 109.581 368.028 109.667 368.136 109.729C368.245 109.79 368.375 109.82 368.526 109.82C368.711 109.82 368.863 109.781 368.982 109.702C369.102 109.624 369.199 109.52 369.272 109.391C369.344 109.262 369.4 109.122 369.441 108.971V108.244C369.416 108.133 369.381 108.026 369.335 107.924C369.291 107.819 369.232 107.726 369.16 107.646C369.089 107.563 369.002 107.498 368.897 107.45C368.795 107.401 368.673 107.377 368.532 107.377C368.379 107.377 368.247 107.409 368.136 107.474C368.028 107.536 367.938 107.623 367.868 107.733C367.797 107.842 367.745 107.969 367.711 108.114C367.678 108.257 367.662 108.41 367.662 108.573ZM372.085 110.294C371.858 110.294 371.652 110.256 371.467 110.179C371.283 110.101 371.125 109.991 370.993 109.85C370.862 109.709 370.761 109.542 370.691 109.349C370.62 109.156 370.585 108.944 370.585 108.715V108.588C370.585 108.322 370.624 108.086 370.703 107.878C370.781 107.669 370.888 107.492 371.023 107.347C371.158 107.202 371.311 107.092 371.482 107.018C371.653 106.943 371.83 106.906 372.013 106.906C372.246 106.906 372.448 106.946 372.617 107.027C372.788 107.108 372.928 107.22 373.037 107.365C373.145 107.508 373.226 107.677 373.278 107.872C373.33 108.066 373.357 108.277 373.357 108.506V108.757H370.917V108.301H372.798V108.259C372.79 108.114 372.76 107.973 372.707 107.836C372.657 107.699 372.577 107.587 372.466 107.498C372.355 107.409 372.204 107.365 372.013 107.365C371.886 107.365 371.769 107.392 371.663 107.447C371.556 107.499 371.465 107.578 371.388 107.682C371.312 107.787 371.252 107.915 371.21 108.066C371.168 108.217 371.146 108.391 371.146 108.588V108.715C371.146 108.87 371.168 109.016 371.21 109.153C371.254 109.287 371.318 109.406 371.4 109.509C371.485 109.611 371.586 109.692 371.705 109.75C371.826 109.809 371.963 109.838 372.116 109.838C372.313 109.838 372.48 109.798 372.617 109.717C372.754 109.637 372.873 109.529 372.976 109.394L373.314 109.663C373.244 109.769 373.154 109.871 373.046 109.968C372.937 110.064 372.803 110.143 372.644 110.203C372.487 110.264 372.301 110.294 372.085 110.294ZM374.567 107.48V110.233H374.009V106.967H374.552L374.567 107.48ZM375.588 106.949L375.585 107.468C375.538 107.458 375.494 107.452 375.452 107.45C375.412 107.446 375.365 107.444 375.313 107.444C375.184 107.444 375.07 107.464 374.972 107.504C374.873 107.544 374.79 107.601 374.721 107.673C374.653 107.746 374.598 107.832 374.558 107.933C374.52 108.031 374.495 108.14 374.483 108.259L374.326 108.349C374.326 108.152 374.345 107.967 374.383 107.794C374.423 107.621 374.485 107.468 374.567 107.335C374.65 107.2 374.754 107.095 374.881 107.021C375.01 106.944 375.163 106.906 375.34 106.906C375.38 106.906 375.427 106.911 375.479 106.921C375.531 106.929 375.568 106.938 375.588 106.949Z"
              fill="#5A6D91"
            />
            <g clip-path="url(#clip20_4955_16369)">
              <path
                d="M415.282 106.756C415.169 106.642 414.985 106.642 414.872 106.756L412.758 108.869L410.644 106.756C410.531 106.642 410.347 106.642 410.234 106.756C410.121 106.869 410.121 107.052 410.234 107.165L412.553 109.484C412.607 109.539 412.681 109.569 412.758 109.569C412.835 109.569 412.909 109.539 412.963 109.484L415.282 107.165C415.395 107.052 415.395 106.869 415.282 106.756Z"
                fill="#5A6D91"
              />
            </g>
            <path
              d="M430.95 101.687H495.267C498.606 101.687 501.312 104.394 501.312 107.733C501.312 111.072 498.606 113.779 495.267 113.779H430.95C427.611 113.779 424.904 111.072 424.904 107.733C424.904 104.394 427.611 101.687 430.95 101.687Z"
              stroke="#5A6D91"
              stroke-width="0.441667"
            />
            <path
              d="M431.142 106.381C430.929 106.381 430.756 106.208 430.756 105.994C430.756 105.781 430.929 105.608 431.142 105.608C431.356 105.608 431.529 105.781 431.529 105.994C431.529 106.208 431.356 106.381 431.142 106.381Z"
              fill="#5A6D91"
            />
            <path
              d="M430.756 107.733C430.756 107.947 430.929 108.12 431.142 108.12C431.356 108.12 431.529 107.947 431.529 107.733C431.529 107.52 431.356 107.347 431.142 107.347C430.929 107.347 430.756 107.52 430.756 107.733Z"
              fill="#5A6D91"
            />
            <path
              d="M430.756 109.472C430.756 109.686 430.929 109.859 431.142 109.859C431.356 109.859 431.529 109.686 431.529 109.472C431.529 109.259 431.356 109.086 431.142 109.086C430.929 109.086 430.756 109.259 430.756 109.472Z"
              fill="#5A6D91"
            />
            <path
              d="M432.592 105.705C432.431 105.705 432.302 105.834 432.302 105.994C432.302 106.154 432.431 106.284 432.592 106.284H435.49C435.65 106.284 435.78 106.154 435.78 105.994C435.78 105.834 435.65 105.705 435.49 105.705H432.592Z"
              fill="#5A6D91"
            />
            <path
              d="M432.592 107.444C432.431 107.444 432.302 107.573 432.302 107.733C432.302 107.894 432.431 108.023 432.592 108.023H435.49C435.65 108.023 435.78 107.894 435.78 107.733C435.78 107.573 435.65 107.444 435.49 107.444H432.592Z"
              fill="#5A6D91"
            />
            <path
              d="M432.302 109.472C432.302 109.312 432.431 109.183 432.592 109.183H435.49C435.65 109.183 435.78 109.312 435.78 109.472C435.78 109.633 435.65 109.762 435.49 109.762H432.592C432.431 109.762 432.302 109.633 432.302 109.472Z"
              fill="#5A6D91"
            />
            <path
              d="M440.951 105.837V110.233H440.377V105.837H440.951ZM442.364 105.837V106.314H438.967V105.837H442.364ZM443.632 109.895L444.541 106.967H445.139L443.828 110.738C443.798 110.818 443.758 110.905 443.708 110.997C443.659 111.092 443.597 111.181 443.52 111.266C443.444 111.351 443.351 111.419 443.243 111.471C443.136 111.526 443.008 111.553 442.859 111.553C442.815 111.553 442.758 111.547 442.69 111.535C442.622 111.523 442.573 111.513 442.545 111.504L442.542 111.052C442.558 111.054 442.583 111.056 442.618 111.058C442.654 111.062 442.679 111.064 442.693 111.064C442.82 111.064 442.928 111.047 443.016 111.012C443.105 110.98 443.179 110.925 443.24 110.846C443.302 110.77 443.355 110.664 443.4 110.529L443.632 109.895ZM442.965 106.967L443.813 109.503L443.958 110.091L443.557 110.297L442.355 106.967H442.965ZM446.201 107.595V111.489H445.64V106.967H446.153L446.201 107.595ZM448.402 108.573V108.636C448.402 108.874 448.374 109.094 448.318 109.297C448.261 109.499 448.179 109.674 448.07 109.823C447.964 109.972 447.832 110.087 447.675 110.17C447.518 110.253 447.338 110.294 447.134 110.294C446.927 110.294 446.744 110.26 446.585 110.191C446.426 110.123 446.291 110.023 446.18 109.892C446.07 109.761 445.981 109.604 445.915 109.421C445.85 109.238 445.806 109.032 445.782 108.802V108.464C445.806 108.223 445.851 108.006 445.918 107.815C445.984 107.624 446.072 107.461 446.18 107.326C446.291 107.189 446.425 107.085 446.582 107.015C446.739 106.942 446.92 106.906 447.125 106.906C447.331 106.906 447.513 106.946 447.672 107.027C447.831 107.106 447.965 107.218 448.073 107.365C448.182 107.512 448.264 107.688 448.318 107.894C448.374 108.097 448.402 108.323 448.402 108.573ZM447.841 108.636V108.573C447.841 108.41 447.824 108.257 447.789 108.114C447.755 107.969 447.702 107.842 447.629 107.733C447.559 107.623 447.468 107.536 447.358 107.474C447.247 107.409 447.115 107.377 446.962 107.377C446.821 107.377 446.699 107.401 446.594 107.45C446.491 107.498 446.404 107.563 446.331 107.646C446.259 107.726 446.199 107.819 446.153 107.924C446.109 108.026 446.076 108.133 446.053 108.244V109.026C446.094 109.167 446.15 109.299 446.223 109.424C446.295 109.547 446.392 109.647 446.512 109.723C446.633 109.798 446.785 109.835 446.968 109.835C447.119 109.835 447.249 109.804 447.358 109.741C447.468 109.677 447.559 109.589 447.629 109.479C447.702 109.368 447.755 109.241 447.789 109.098C447.824 108.953 447.841 108.799 447.841 108.636ZM450.471 110.294C450.243 110.294 450.037 110.256 449.852 110.179C449.668 110.101 449.51 109.991 449.378 109.85C449.247 109.709 449.146 109.542 449.076 109.349C449.005 109.156 448.97 108.944 448.97 108.715V108.588C448.97 108.322 449.009 108.086 449.088 107.878C449.166 107.669 449.273 107.492 449.408 107.347C449.543 107.202 449.696 107.092 449.867 107.018C450.038 106.943 450.215 106.906 450.398 106.906C450.632 106.906 450.833 106.946 451.002 107.027C451.173 107.108 451.313 107.22 451.422 107.365C451.53 107.508 451.611 107.677 451.663 107.872C451.715 108.066 451.742 108.277 451.742 108.506V108.757H449.302V108.301H451.183V108.259C451.175 108.114 451.145 107.973 451.092 107.836C451.042 107.699 450.962 107.587 450.851 107.498C450.74 107.409 450.589 107.365 450.398 107.365C450.271 107.365 450.155 107.392 450.048 107.447C449.941 107.499 449.85 107.578 449.773 107.682C449.697 107.787 449.637 107.915 449.595 108.066C449.553 108.217 449.532 108.391 449.532 108.588V108.715C449.532 108.87 449.553 109.016 449.595 109.153C449.639 109.287 449.703 109.406 449.785 109.509C449.87 109.611 449.971 109.692 450.09 109.75C450.211 109.809 450.348 109.838 450.501 109.838C450.698 109.838 450.865 109.798 451.002 109.717C451.139 109.637 451.259 109.529 451.361 109.394L451.699 109.663C451.629 109.769 451.539 109.871 451.431 109.968C451.322 110.064 451.188 110.143 451.029 110.203C450.872 110.264 450.686 110.294 450.471 110.294Z"
              fill="#5A6D91"
            />
            <g clip-path="url(#clip21_4955_16369)">
              <path
                d="M495.665 106.756C495.552 106.642 495.369 106.642 495.256 106.756L493.142 108.869L491.028 106.756C490.915 106.642 490.731 106.642 490.618 106.756C490.505 106.869 490.505 107.052 490.618 107.165L492.937 109.484C492.991 109.539 493.065 109.569 493.142 109.569C493.219 109.569 493.292 109.539 493.347 109.484L495.665 107.165C495.779 107.052 495.779 106.869 495.665 106.756Z"
                fill="#5A6D91"
              />
            </g>
          </g>
        </g>
      </g>
    </g>
    <defs>
      <filter
        id="filter0_d_4955_16369"
        x="498.906"
        y="40"
        width="8.4375"
        height="8.53125"
        filterUnits="userSpaceOnUse"
        color-interpolation-filters="sRGB"
      >
        <feFlood flood-opacity="0" result="BackgroundImageFix" />
        <feColorMatrix
          in="SourceAlpha"
          type="matrix"
          values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
          result="hardAlpha"
        />
        <feOffset dy="0.1875" />
        <feGaussianBlur stdDeviation="0.046875" />
        <feColorMatrix
          type="matrix"
          values="0 0 0 0 0.113725 0 0 0 0 0.160784 0 0 0 0 0.239216 0 0 0 0.02 0"
        />
        <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4955_16369" />
        <feBlend
          mode="normal"
          in="SourceGraphic"
          in2="effect1_dropShadow_4955_16369"
          result="shape"
        />
      </filter>
      <filter
        id="filter1_d_4955_16369"
        x="510.906"
        y="40"
        width="8.4375"
        height="8.53125"
        filterUnits="userSpaceOnUse"
        color-interpolation-filters="sRGB"
      >
        <feFlood flood-opacity="0" result="BackgroundImageFix" />
        <feColorMatrix
          in="SourceAlpha"
          type="matrix"
          values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
          result="hardAlpha"
        />
        <feOffset dy="0.1875" />
        <feGaussianBlur stdDeviation="0.046875" />
        <feColorMatrix
          type="matrix"
          values="0 0 0 0 0.113725 0 0 0 0 0.160784 0 0 0 0 0.239216 0 0 0 0.02 0"
        />
        <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4955_16369" />
        <feBlend
          mode="normal"
          in="SourceGraphic"
          in2="effect1_dropShadow_4955_16369"
          result="shape"
        />
      </filter>
      <filter
        id="filter2_d_4955_16369"
        x="521.906"
        y="40"
        width="8.4375"
        height="8.53125"
        filterUnits="userSpaceOnUse"
        color-interpolation-filters="sRGB"
      >
        <feFlood flood-opacity="0" result="BackgroundImageFix" />
        <feColorMatrix
          in="SourceAlpha"
          type="matrix"
          values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
          result="hardAlpha"
        />
        <feOffset dy="0.1875" />
        <feGaussianBlur stdDeviation="0.046875" />
        <feColorMatrix
          type="matrix"
          values="0 0 0 0 0.113725 0 0 0 0 0.160784 0 0 0 0 0.239216 0 0 0 0.02 0"
        />
        <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4955_16369" />
        <feBlend
          mode="normal"
          in="SourceGraphic"
          in2="effect1_dropShadow_4955_16369"
          result="shape"
        />
      </filter>
      <filter
        id="filter3_d_4955_16369"
        x="333.47"
        y="48"
        width="183.06"
        height="245.06"
        filterUnits="userSpaceOnUse"
        color-interpolation-filters="sRGB"
      >
        <feFlood flood-opacity="0" result="BackgroundImageFix" />
        <feColorMatrix
          in="SourceAlpha"
          type="matrix"
          values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
          result="hardAlpha"
        />
        <feOffset dx="2" dy="3.53" />
        <feGaussianBlur stdDeviation="3.765" />
        <feComposite in2="hardAlpha" operator="out" />
        <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
        <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4955_16369" />
        <feBlend
          mode="normal"
          in="SourceGraphic"
          in2="effect1_dropShadow_4955_16369"
          result="shape"
        />
      </filter>
      <filter
        id="filter4_d_4955_16369"
        x="431.895"
        y="56.8334"
        width="32.7581"
        height="15.7292"
        filterUnits="userSpaceOnUse"
        color-interpolation-filters="sRGB"
      >
        <feFlood flood-opacity="0" result="BackgroundImageFix" />
        <feColorMatrix
          in="SourceAlpha"
          type="matrix"
          values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
          result="hardAlpha"
        />
        <feOffset dy="0.441667" />
        <feGaussianBlur stdDeviation="0.110417" />
        <feColorMatrix
          type="matrix"
          values="0 0 0 0 0.113725 0 0 0 0 0.160784 0 0 0 0 0.239216 0 0 0 0.02 0"
        />
        <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4955_16369" />
        <feBlend
          mode="normal"
          in="SourceGraphic"
          in2="effect1_dropShadow_4955_16369"
          result="shape"
        />
      </filter>
      <pattern
        id="pattern0_4955_16369"
        patternContentUnits="objectBoundingBox"
        width="1"
        height="1"
      >
        <use xlink:href="#image0_4955_16369" transform="scale(0.000260417 0.000462964)" />
      </pattern>
      <pattern
        id="pattern1_4955_16369"
        patternContentUnits="objectBoundingBox"
        width="1"
        height="1"
      >
        <use xlink:href="#image0_4955_16369" transform="scale(0.000260417 0.000462964)" />
      </pattern>
      <pattern
        id="pattern2_4955_16369"
        patternContentUnits="objectBoundingBox"
        width="1"
        height="1"
      >
        <use
          xlink:href="#image1_4955_16369"
          transform="matrix(0.0203294 0 0 0.0202854 -0.574228 -0.665918)"
        />
      </pattern>
      <pattern
        id="pattern3_4955_16369"
        patternContentUnits="objectBoundingBox"
        width="1"
        height="1"
      >
        <use
          xlink:href="#image2_4955_16369"
          transform="matrix(0.00332268 0 0 0.00331616 -0.176344 -0.0951699)"
        />
      </pattern>
      <clipPath id="clip0_4955_16369">
        <path
          d="M85 28C85 23.5817 88.5817 20 93 20H591C595.418 20 599 23.5817 599 28V291H85V28Z"
          fill="white"
        />
      </clipPath>
      <clipPath id="clip1_4955_16369">
        <rect width="6" height="6" fill="white" transform="translate(500.125 41.125)" />
      </clipPath>
      <clipPath id="clip2_4955_16369">
        <rect width="5" height="6" fill="white" transform="translate(500.625 41.125)" />
      </clipPath>
      <clipPath id="clip3_4955_16369">
        <rect width="168" height="230" fill="white" transform="translate(339 52)" />
      </clipPath>
      <clipPath id="clip4_4955_16369">
        <rect width="10.6" height="10.6" fill="white" transform="translate(349.6 141.767)" />
      </clipPath>
      <clipPath id="clip5_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(471.5 143.533)" />
      </clipPath>
      <clipPath id="clip6_4955_16369">
        <rect width="10.6" height="10.6" fill="white" transform="translate(349.6 168.483)" />
      </clipPath>
      <clipPath id="clip7_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(471.5 170.25)" />
      </clipPath>
      <clipPath id="clip8_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(457.366 213.75)" />
      </clipPath>
      <clipPath id="clip9_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(471.5 213.75)" />
      </clipPath>
      <clipPath id="clip10_4955_16369">
        <rect width="10.6" height="10.6" fill="white" transform="translate(349.6 238.7)" />
      </clipPath>
      <clipPath id="clip11_4955_16369">
        <rect
          width="7.06667"
          height="7.06667"
          fill="white"
          transform="translate(457.366 240.467)"
        />
      </clipPath>
      <clipPath id="clip12_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(471.5 240.467)" />
      </clipPath>
      <clipPath id="clip13_4955_16369">
        <rect width="8.83333" height="8.83333" fill="white" transform="translate(397.521 258.15)" />
      </clipPath>
      <clipPath id="clip14_4955_16369">
        <rect width="8.83333" height="8.83333" fill="white" transform="translate(439.479 258.15)" />
      </clipPath>
      <clipPath id="clip15_4955_16369">
        <rect width="8.83333" height="8.83333" fill="white" transform="translate(481.438 258.15)" />
      </clipPath>
      <clipPath id="clip16_4955_16369">
        <rect width="157.233" height="37.2667" fill="white" transform="translate(344.3 82.0333)" />
      </clipPath>
      <clipPath id="clip17_4955_16369">
        <rect width="7.06667" height="7.06667" fill="white" transform="translate(349.6 86.45)" />
      </clipPath>
      <clipPath id="clip18_4955_16369">
        <rect
          width="8.83333"
          height="8.83333"
          fill="white"
          transform="translate(489.166 85.5667)"
        />
      </clipPath>
      <clipPath id="clip19_4955_16369">
        <rect width="6.18333" height="6.18333" fill="white" transform="translate(349.6 104.642)" />
      </clipPath>
      <clipPath id="clip20_4955_16369">
        <rect
          width="6.18333"
          height="6.18333"
          fill="white"
          transform="translate(409.666 104.642)"
        />
      </clipPath>
      <clipPath id="clip21_4955_16369">
        <rect width="6.18333" height="6.18333" fill="white" transform="translate(490.05 104.642)" />
      </clipPath>
      <image
        id="image0_4955_16369"
        width="3840"
        height="2160"
        preserveAspectRatio="none"
        xlink:href="data:image/png;base64, "
      />
      <image
        id="image1_4955_16369"
        width="730"
        height="116"
        preserveAspectRatio="none"
        xlink:href="data:image/png;base64, "
      />
      <image
        id="image2_4955_16369"
        width="1260"
        height="360"
        preserveAspectRatio="none"
        xlink:href="data:image/png;base64, "
      />
    </defs>
  </svg>`;var Lk=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Kk{constructor(e,t,i,n){this.platformUtilsService=e,this.accountService=t,this.dialogRef=i,this.webVaultExtensionPromptService=n,this.webStoreUrl="",this.extensionMockLogin=Yk}ngOnInit(){this.webStoreUrl=WQ(this.platformUtilsService.getDevice())}dismissPrompt(){return Lk(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.webVaultExtensionPromptService.getDialogDismissedState(e).update(()=>!0),this.dialogRef.close()})}static open(e){return e.open(Kk)}}Kk.ɵfac=function(e){return new(e||Kk)(B.rXU(V.y),B.rXU(Y.D),B.rXU(R.ce),B.rXU(Hk))},Kk.ɵcmp=B.VBU({type:Kk,selectors:[["web-vault-extension-prompt-dialog"]],decls:20,vars:20,consts:[[1,"tw-max-w-3xl","tw-p-9","tw-border","tw-border-solid","tw-border-border-base","tw-rounded-xl","tw-bg-background","tw-text-center"],[1,"tw-mb-[1.875rem]"],[1,"tw-mb-[1.875rem]",3,"content","ariaLabel"],[1,"tw-flex","tw-flex-col","tw-gap-[1.6875rem]"],[1,"tw-mb-0"],[1,"tw-flex","tw-gap-[1.125rem]","tw-justify-center"],["bitButton","secondary","type","button",3,"click"],["bitButton","","buttonType","primary","target","_blank","rel","noopener noreferrer",3,"click","href"],["name","bwi-external-link",1,"tw-ml-[0.42rem]"]],template:function(e,t){1&e&&(B.j41(0,"div",0)(1,"div",1),B.nI1(2,"i18n"),B.nrm(3,"bit-svg",2),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"div",3)(6,"h2",4),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"p",4),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.j41(12,"div",5)(13,"button",6),B.bIt("click",function(){return t.dismissPrompt()}),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.j41(16,"a",7),B.bIt("click",function(){return t.dismissPrompt()}),B.EFF(17),B.nI1(18,"i18n"),B.nrm(19,"bit-icon",8),B.k0s()()()()),2&e&&(B.R7$(),B.BMQ("alt",B.bMT(2,8,"extensionPromptImageAlt")),B.R7$(2),B.Y8G("content",t.extensionMockLogin)("ariaLabel",B.bMT(4,10,"extensionPromptImageAlt")),B.R7$(4),B.SpI(" ",B.bMT(8,12,"extensionPromptHeading")," "),B.R7$(3),B.SpI(" ",B.bMT(11,14,"extensionPromptBody")," "),B.R7$(4),B.SpI(" ",B.bMT(15,16,"skip")," "),B.R7$(2),B.Y8G("href",t.webStoreUrl,B.B4B),B.R7$(),B.SpI(" ",B.bMT(18,18,"downloadExtension")," "))},dependencies:[H.MD,Yd.t,Jd.Q,Nd.P,LA.R,gp.k,Zu.$Z],encapsulation:2,changeDetection:0});var Xk=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const qk=new w.Ok(w.yh,"vaultWelcomeExtensionDialogDismissed",{deserializer:e=>e,clearOn:[]});class Hk{constructor(){this.stateProvider=(0,E.WQX)(w.v2),this.webBrowserInteractionService=(0,E.WQX)(PQ),this.accountService=(0,E.WQX)(Y.D),this.configService=(0,E.WQX)(z.w),this.dialogService=(0,E.WQX)(R.o3)}conditionallyPromptUserForExtension(e){return Xk(this,void 0,void 0,function*(){if(!(yield this.configService.getFeatureFlag(dr.TO.PM29438_WelcomeDialogWithExtensionPrompt)))return!1;const t=(0,u._)(this.webBrowserInteractionService.extensionInstalled$);if(yield(0,u._)(this.getDialogDismissedState(e).state$.pipe((0,p.T)(e=>null!=e&&e))))return!1;if(!(yield this.profileIsWithinThresholds()))return!1;if(yield t)return!1;const i=Kk.open(this.dialogService);return yield(0,u._)(i.closed),!0})}getDialogDismissedState(e){return this.stateProvider.getUser(e,qk)}profileIsWithinThresholds(){return Xk(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.creationDate)));if(!e)return!1;const t=yield this.configService.getFeatureFlag(dr.TO.PM29438_DialogWithExtensionPromptAccountAge),i=((new Date).getTime()-e.getTime())/864e5;return i>=(null!=t?t:0)&&i<30})}}Hk.ɵfac=function(e){return new(e||Hk)},Hk.ɵprov=E.jDH({token:Hk,factory:Hk.ɵfac,providedIn:"root"});var Wk=i(7243),$k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Jk="dismissed",Zk="getStarted",_k=new w.Ok(w.b4,"vaultWelcomeDialogAcknowledged",{deserializer:e=>e,clearOn:[]});class eT{constructor(e){this.dialogRef=e,this.accountService=(0,E.WQX)(Y.D),this.stateProvider=(0,E.WQX)(w.v2),this.coachmarkService=(0,E.WQX)(Wk.T)}onDismiss(){return $k(this,void 0,void 0,function*(){yield this.setAcknowledged(),this.dialogRef.close(Jk)})}onPrimaryCta(){return $k(this,void 0,void 0,function*(){yield this.setAcknowledged(),this.dialogRef.close(Zk),yield this.coachmarkService.startTour()})}setAcknowledged(){return $k(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.stateProvider.setUserState(_k,!0,e)})}static open(e){return e.open(eT,{disableClose:!0,positionStrategy:new R.u3})}}eT.ɵfac=function(e){return new(e||eT)(B.rXU(R.ce))},eT.ɵcmp=B.VBU({type:eT,selectors:[["app-vault-welcome-dialog"]],decls:19,vars:15,consts:[["dialogSize","large",1,"tw-p-0"],["bitDialogContent","",1,"tw-p-2","tw-pb-0"],["src","../../../../images/welcome-dialog-graphic.png",1,"tw-max-w-full",3,"alt"],[1,"tw-px-12","tw-pt-6","tw-text-center"],[1,"tw-px-12"],["bitTypography","h2",1,"tw-mb-4"],["bitTypography","body1",1,"tw-mb-0","tw-text-muted"],["bitDialogFooter","",1,"tw-w-full","tw-flex","tw-justify-center","tw-gap-4","tw-pb-3"],["bitButton","","buttonType","secondary","type","button",3,"click"],["bitButton","","buttonType","primary","type","button",3,"click"]],template:function(e,t){1&e&&(B.j41(0,"bit-dialog",0)(1,"div",1),B.nrm(2,"img",2),B.nI1(3,"i18n"),B.j41(4,"div",3)(5,"div",4)(6,"h2",5),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"p",6),B.EFF(10),B.nI1(11,"i18n"),B.k0s()()()(),B.j41(12,"div",7)(13,"button",8),B.bIt("click",function(){return t.onDismiss()}),B.EFF(14),B.nI1(15,"i18n"),B.k0s(),B.j41(16,"button",9),B.bIt("click",function(){return t.onPrimaryCta()}),B.EFF(17),B.nI1(18,"i18n"),B.k0s()()()),2&e&&(B.R7$(2),B.Y8G("alt",B.bMT(3,5,"welcomeDialogGraphicAlt")),B.R7$(5),B.SpI(" ",B.bMT(8,7,"vaultWelcomeDialogTitle")," "),B.R7$(3),B.SpI(" ",B.bMT(11,9,"vaultWelcomeDialogDescription")," "),B.R7$(4),B.SpI(" ",B.bMT(15,11,"vaultWelcomeDialogDismissCta")," "),B.R7$(3),B.SpI(" ",B.bMT(18,13,"vaultWelcomeDialogPrimaryCta")," "))},dependencies:[H.MD,Nd.P,Hd.m,Wd.hJ,Yd.t,Jd.Q,DA.E,MA.r,jd.p,au.$],encapsulation:2,changeDetection:0});var tT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const iT=new w.Ok(w.b4,"vaultWelcomeDialogAcknowledged",{deserializer:e=>e,clearOn:[]});class nT{constructor(){this.accountService=(0,E.WQX)(Y.D),this.configService=(0,E.WQX)(z.w),this.dialogService=(0,E.WQX)(R.o3),this.stateProvider=(0,E.WQX)(w.v2)}conditionallyShowWelcomeDialog(){return tT(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);if(!e)return;if(!(yield this.configService.getFeatureFlag(dr.TO.PM29437_WelcomeDialog)))return;const t=e.creationDate;if(!t)return;const i=Date.now()-t.getTime();if(!(i>=0&&i<=2592e6))return;if(yield(0,u._)(this.stateProvider.getUserState$(iT,e.id).pipe((0,p.T)(e=>null!=e&&e))))return;const n=eT.open(this.dialogService);yield(0,u._)(n.closed)})}}nT.ɵfac=function(e){return new(e||nT)},nT.ɵprov=E.jDH({token:nT,factory:nT.ɵfac,providedIn:"root"});var rT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class sT{constructor(){this.unifiedUpgradePromptService=(0,E.WQX)(zk),this.vaultItemTransferService=(0,E.WQX)(xd.DL),this.policyService=(0,E.WQX)(me.m),this.accountService=(0,E.WQX)(Y.D),this.autoConfirmService=(0,E.WQX)(ce.zh),this.organizationService=(0,E.WQX)(f.PV),this.configService=(0,E.WQX)(z.w),this.dialogService=(0,E.WQX)(R.o3),this.logService=(0,E.WQX)(Ju.Kc),this.webVaultExtensionPromptService=(0,E.WQX)(Hk),this.welcomeDialogService=(0,E.WQX)(nT),this.userId$=this.accountService.activeAccount$.pipe(y.F6),this.organizations$=this.userId$.pipe((0,rt.n)(e=>this.organizationService.organizations$(e)))}conditionallyPromptUser(){return rT(this,void 0,void 0,function*(){const e=yield(0,u._)(this.userId$);(yield this.unifiedUpgradePromptService.displayUpgradePromptConditionally())||(yield this.vaultItemTransferService.enforceOrganizationDataOwnership(e),yield this.welcomeDialogService.conditionallyShowWelcomeDialog(),yield this.webVaultExtensionPromptService.conditionallyPromptUserForExtension(e),this.checkForAutoConfirm())})}openAutoConfirmFeatureDialog(e){return rT(this,void 0,void 0,function*(){sh.PI.open(this.dialogService,{data:{policy:new sh.WS,organization:e,firstTimeDialog:!0}})})}checkForAutoConfirm(){const e=this.organizations$.pipe((0,p.T)(e=>e[0])),t=this.configService.getFeatureFlag$(dr.TO.AutoConfirm),i=this.userId$.pipe((0,rt.n)(e=>this.autoConfirmService.configuration$(e))),n=(0,bi.z)([this.userId$.pipe((0,rt.n)(e=>this.policyService.policies$(e)),(0,p.T)(e=>e.find(e=>e.type===mt.tt.AutoConfirm&&e.enabled))),e]).pipe((0,p.T)(([e,t])=>{var i;return null!==(i=e&&e.organizationId===(null==t?void 0:t.id))&&void 0!==i&&i}));(0,hr.y)([e,t,i,n,this.userId$]).pipe((0,Cu.$)(),(0,rt.n)(e=>rT(this,[e],void 0,function*([e,t,i,n,r]){t&&!n&&i.showSetupDialog&&!!e&&e.canEnableAutoConfirmPolicy&&(yield this.openAutoConfirmFeatureDialog(e),yield this.autoConfirmService.upsert(r,Object.assign(Object.assign({},i),{showSetupDialog:!1})))}))).subscribe({error:e=>this.logService.error("Failed to update auto-confirm state",e)})}}sT.ɵfac=function(e){return new(e||sT)},sT.ɵprov=E.jDH({token:sT,factory:sT.ɵfac});var oT=i(9083),aT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function lT(e,t){if(1&e&&B.nrm(0,"bit-option",10),2&e){const e=t.$implicit;B.Y8G("value",e.id)("label",e.name)}}const cT="moved",dT="canceled";class uT{constructor(e,t,i,n,r,s,o,l,c){var d;this.dialogRef=t,this.cipherService=i,this.platformUtilsService=n,this.i18nService=r,this.folderService=s,this.formBuilder=o,this.toastService=l,this.accountService=c,this.cipherIds=[],this.formGroup=this.formBuilder.group({folderId:["",[a.k0.nullValidator]]}),this.submit=()=>aT(this,void 0,void 0,function*(){if(this.formGroup.invalid)return;const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.cipherService.moveManyWithServer(this.cipherIds,this.formGroup.value.folderId,e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("movedItems")}),this.close(cT)}),this.cipherIds=null!==(d=e.cipherIds)&&void 0!==d?d:[]}ngOnInit(){return aT(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));this.folders$=this.folderService.folderViews$(e),this.formGroup.patchValue({folderId:(yield(0,u._)(this.folders$))[0].id})})}cancel(){this.close(dT)}close(e){this.dialogRef.close(e)}}uT.ɵfac=function(e){return new(e||uT)(B.rXU(_g.Qs),B.rXU(R.ce),B.rXU(k.p),B.rXU(V.y),B.rXU(U.W),B.rXU(Q.k),B.rXU(a.ok),B.rXU(P.f),B.rXU(Y.D))},uT.ɵcmp=B.VBU({type:uT,selectors:[["ng-component"]],standalone:!1,decls:23,vars:21,consts:[[3,"formGroup","bitSubmit"],["dialogSize","small"],["bitDialogTitle",""],["bitDialogContent",""],["for","folder"],["formControlName","folderId"],[3,"value","label",4,"ngFor","ngForOf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"click"],[3,"value","label"]],template:function(e,t){1&e&&(B.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),B.EFF(3),B.nI1(4,"i18n"),B.k0s(),B.j41(5,"span",3)(6,"p"),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.j41(9,"bit-form-field")(10,"bit-label",4),B.EFF(11),B.nI1(12,"i18n"),B.k0s(),B.j41(13,"bit-select",5),B.DNE(14,lT,1,2,"bit-option",6),B.nI1(15,"async"),B.k0s()()(),B.qex(16,7),B.j41(17,"button",8),B.EFF(18),B.nI1(19,"i18n"),B.k0s(),B.j41(20,"button",9),B.bIt("click",function(){return t.cancel()}),B.EFF(21),B.nI1(22,"i18n"),B.k0s(),B.bVm(),B.k0s()()),2&e&&(B.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),B.R7$(3),B.SpI(" ",B.bMT(4,8,"addToFolder")," "),B.R7$(4),B.JRh(B.i5U(8,10,"moveSelectedItemsDesc",t.cipherIds.length)),B.R7$(4),B.JRh(B.bMT(12,13,"selectFolder")),B.R7$(3),B.Y8G("ngForOf",B.bMT(15,15,t.folders$)),B.R7$(4),B.SpI(" ",B.bMT(19,17,"save")," "),B.R7$(3),B.SpI(" ",B.bMT(22,19,"cancel")," "))},dependencies:[H.Sq,a.qT,a.BC,a.cb,a.j4,a.JD,_d.$,eu.L,Jd.Q,Hd.m,Wd.hJ,tu.j,ru.h,cg.w,dg.P,H.Jj,au.$],encapsulation:2});var hT=i(90097),AT=i(1094),pT=i(91326),gT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vT{constructor(e,t,i,n,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.tokenService=n,this.toastService=r,this.onVerified=new B.bkB,this.onDismiss=new B.bkB,this.send=()=>gT(this,void 0,void 0,function*(){yield this.verifyEmail()})}verifyEmail(){return gT(this,void 0,void 0,function*(){if(yield this.apiService.refreshIdentityToken(),yield this.tokenService.getEmailVerified())return this.onVerified.emit(!0),void this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailVerified")});yield this.apiService.postAccountVerifyEmail(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("checkInboxForVerification")})})}}vT.ɵfac=function(e){return new(e||vT)(B.rXU(de.G),B.rXU(U.W),B.rXU(V.y),B.rXU(q.B),B.rXU(P.f))},vT.ɵcmp=B.VBU({type:vT,selectors:[["app-verify-email"]],outputs:{onVerified:"onVerified",onDismiss:"onDismiss"},decls:6,vars:6,consts:[["bannerType","warning",3,"onClose"],["id","sendBtn","bitLink","","linkType","secondary","type","button","buttonType","unstyled",3,"click"]],template:function(e,t){1&e&&(B.j41(0,"bit-banner",0),B.bIt("onClose",function(){return t.onDismiss.emit()}),B.EFF(1),B.nI1(2,"i18n"),B.j41(3,"button",1),B.bIt("click",function(){return t.send()}),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,2,"verifyEmailDesc")," "),B.R7$(3),B.SpI(" ",B.bMT(5,4,"sendEmail")," "))},dependencies:[Kd.C,hT.H,pT.K,Yd.t,H.MD,jd.p,zd.V,$d.g,au.$],encapsulation:2});var fT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const mT={OutdatedBrowser:"outdated-browser",VerifyEmail:"verify-email",PendingAuthRequest:"pending-auth-request"},yT=new I.Ok(I.Iw,"bannersDismissed",{deserializer:e=>e,clearOn:[]});class CT{constructor(e,t,i,n,r,s){this.accountService=e,this.stateProvider=t,this.billingAccountProfileStateService=i,this.platformUtilsService=n,this.syncService=r,this.authRequestService=s}shouldShowPendingAuthRequestBanner(e){return fT(this,void 0,void 0,function*(){const t=(yield this.getBannerDismissedState(e)).includes(mT.PendingAuthRequest);return(yield(0,u._)(this.authRequestService.getPendingAuthRequests$())).length>0&&!t})}shouldShowUpdateBrowserBanner(e){return fT(this,void 0,void 0,function*(){const t=-1!==window.navigator.userAgent.indexOf("MSIE"),i=(yield this.getBannerDismissedState(e)).includes(mT.OutdatedBrowser);return t&&!i})}shouldShowVerifyEmailBanner(e){return fT(this,void 0,void 0,function*(){var t;const i=!(null===(t=yield(0,u._)(this.accountService.accounts$.pipe((0,p.T)(t=>t[e]))))||void 0===t?void 0:t.emailVerified),n=(yield this.getBannerDismissedState(e)).includes(mT.VerifyEmail);return i&&!n})}dismissBanner(e,t){return fT(this,void 0,void 0,function*(){yield this.sessionBannerState(e).update(e=>[...null!=e?e:[],t])})}sessionBannerState(e){return this.stateProvider.getUser(e,yT)}getBannerDismissedState(e){return fT(this,void 0,void 0,function*(){var t;return null!==(t=yield(0,u._)(this.sessionBannerState(e).state$))&&void 0!==t?t:[]})}}CT.ɵfac=function(e){return new(e||CT)(E.KVO(Y.D),E.KVO(I.v2),E.KVO(Rn.Q),E.KVO(V.y),E.KVO(uh.H),E.KVO(v.XF))},CT.ɵprov=E.jDH({token:CT,factory:CT.ɵfac});var wT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const IT=(e,t)=>t.id;function bT(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-organization-free-trial-warning",4),B.bIt("clicked",function(){const t=E.eBV(e).$implicit,i=B.XpG();return E.Njj(i.navigateToPaymentMethod(t.id))}),B.k0s()}if(2&e){const e=t.$implicit;B.Y8G("organization",e)("includeOrganizationNameInMessaging",!0)}}function BT(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-banner",5),B.bIt("onClose",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.dismissBanner(t.VisibleVaultBanner.OutdatedBrowser))}),B.EFF(1),B.nI1(2,"i18n"),B.j41(3,"a",6),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()}2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,2,"updateBrowserDesc")," "),B.R7$(3),B.SpI(" ",B.bMT(5,4,"updateBrowser")," "))}function ET(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-banner",7),B.bIt("onClose",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.dismissBanner(t.VisibleVaultBanner.PendingAuthRequest))}),B.EFF(1),B.nI1(2,"i18n"),B.j41(3,"a",8),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()}2&e&&(B.R7$(),B.SpI(" ",B.bMT(2,2,"youHaveAPendingLoginRequest")," "),B.R7$(3),B.SpI(" ",B.bMT(5,4,"reviewLoginRequest")," "))}function ST(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-verify-email",9),B.bIt("onDismiss",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.dismissBanner(t.VisibleVaultBanner.VerifyEmail))})("onVerified",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.dismissBanner(t.VisibleVaultBanner.VerifyEmail))}),B.k0s()}}class QT{constructor(e,t,i,n){this.vaultBannerService=e,this.router=t,this.accountService=i,this.messageListener=n,this.visibleBanners=[],this.VisibleVaultBanner=mT,this.organizations=[],this.activeUserId$=this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)),this.messageListener.allMessages$.pipe((0,h.p)(e=>"openLoginApproval"===e.command),(0,c.pQ)()).subscribe(()=>{this.visibleBanners.includes(mT.PendingAuthRequest)||(this.visibleBanners=[...this.visibleBanners,mT.PendingAuthRequest])})}ngOnInit(){return wT(this,void 0,void 0,function*(){yield this.determineVisibleBanners()})}dismissBanner(e){return wT(this,void 0,void 0,function*(){const t=yield(0,u._)(this.activeUserId$);t&&(yield this.vaultBannerService.dismissBanner(t,e),yield this.determineVisibleBanners())})}navigateToPaymentMethod(e){return wT(this,void 0,void 0,function*(){yield this.router.navigate(["organizations",e,"billing","payment-details"],{state:{launchPaymentModalAutomatically:!0}})})}determineVisibleBanners(){return wT(this,void 0,void 0,function*(){const e=yield(0,u._)(this.activeUserId$);if(!e)return;const t=yield this.vaultBannerService.shouldShowUpdateBrowserBanner(e),i=yield this.vaultBannerService.shouldShowVerifyEmailBanner(e),n=yield this.vaultBannerService.shouldShowPendingAuthRequestBanner(e);this.visibleBanners=[t?mT.OutdatedBrowser:null,i?mT.VerifyEmail:null,n?mT.PendingAuthRequest:null].filter(e=>null!==e)})}}QT.ɵfac=function(e){return new(e||QT)(B.rXU(CT),B.rXU(F.Ix),B.rXU(Y.D),B.rXU(io.qk))},QT.ɵcmp=B.VBU({type:QT,selectors:[["app-vault-banners"]],inputs:{organizations:"organizations"},features:[B.Jv_([CT])],decls:5,vars:3,consts:[[3,"organization","includeOrganizationNameInMessaging"],["id","update-browser-banner","bannerType","warning",3,"onClose",4,"ngIf"],["id","pending-auth-request-banner","bannerType","info","icon","bwi-info-circle",3,"onClose",4,"ngIf"],["id","verify-email-banner",3,"onDismiss","onVerified",4,"ngIf"],[3,"clicked","organization","includeOrganizationNameInMessaging"],["id","update-browser-banner","bannerType","warning",3,"onClose"],["bitLink","","linkType","secondary","target","_blank","href","https://browser-update.org/update-browser.html","rel","noreferrer noopener"],["id","pending-auth-request-banner","bannerType","info","icon","bwi-info-circle",3,"onClose"],["bitLink","","linkType","secondary","routerLink","/settings/security/device-management"],["id","verify-email-banner",3,"onDismiss","onVerified"]],template:function(e,t){1&e&&(B.Z7z(0,bT,1,2,"app-organization-free-trial-warning",0,IT),B.DNE(2,BT,6,6,"bit-banner",1)(3,ET,6,6,"bit-banner",2)(4,ST,1,0,"app-verify-email",3)),2&e&&(B.Dyx(t.organizations),B.R7$(2),B.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.OutdatedBrowser)),B.R7$(),B.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.PendingAuthRequest)),B.R7$(),B.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.VerifyEmail)))},dependencies:[vT,oh.G,H.bT,BA.Wk,$d.g,hT.H,pT.K,AT.z,au.$],encapsulation:2});var kT=i(85111),TT=i(56615),FT=i(1576),PT=i(88547),RT=i(55818),DT=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const MT=()=>[],xT=(e,t)=>({organizationId:e,collectionId:t}),OT=e=>({collectionId:e});function GT(e,t){if(1&e&&(B.j41(0,"bit-breadcrumb",10),B.EFF(1),B.nI1(2,"orgNameFromId"),B.nI1(3,"i18n"),B.nI1(4,"lowercase"),B.k0s()),2&e){const e=B.XpG(2);B.Y8G("route",B.lJ4(11,MT))("queryParams",B.l_i(12,xT,e.activeOrganizationId,e.All)),B.R7$(),B.Lme(" ",B.i5U(2,4,e.activeOrganizationId,e.organizations)," ",B.bMT(4,9,B.bMT(3,7,"vault"))," ")}}function UT(e,t){if(1&e&&(B.j41(0,"bit-breadcrumb",11),B.EFF(1),B.k0s()),2&e){const e=t.$implicit;B.Y8G("route",B.lJ4(3,MT))("queryParams",B.eq3(4,OT,e.id)),B.R7$(),B.SpI(" ",e.name," ")}}function VT(e,t){if(1&e&&(B.j41(0,"bit-breadcrumbs",7),B.DNE(1,GT,5,15,"bit-breadcrumb",8),B.qex(2),B.DNE(3,UT,2,6,"bit-breadcrumb",9),B.bVm(),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.Y8G("ngIf",e.activeOrganizationId),B.R7$(2),B.Y8G("ngForOf",e.collections)}}function jT(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",14),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.editCollection(t.CollectionDialogTabType.Info))}),B.nrm(1,"i",15),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"editInfo")," "))}function NT(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",14),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.editCollection(t.CollectionDialogTabType.Access))}),B.nrm(1,"i",16),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"access")," "))}function zT(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",14),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.deleteCollection())}),B.j41(1,"span",17),B.nrm(2,"i",18),B.EFF(3),B.nI1(4,"i18n"),B.k0s()()}2&e&&(B.R7$(3),B.SpI(" ",B.bMT(4,1,"delete")," "))}function YT(e,t){if(1&e&&(B.qex(0),B.nrm(1,"button",12),B.nI1(2,"i18n"),B.j41(3,"bit-menu",null,0),B.DNE(5,jT,4,3,"button",13)(6,NT,4,3,"button",13)(7,zT,5,3,"button",13),B.k0s(),B.bVm()),2&e){const e=B.sdS(4),t=B.XpG();B.R7$(),B.Y8G("bitMenuTriggerFor",e)("label",B.bMT(2,5,"editCollection")),B.R7$(4),B.Y8G("ngIf",t.canEditCollection),B.R7$(),B.Y8G("ngIf",t.canEditCollection),B.R7$(),B.Y8G("ngIf",t.canDeleteCollection)}}function LT(e,t){1&e&&(B.j41(0,"small"),B.nrm(1,"i",19),B.nI1(2,"i18n"),B.j41(3,"span",20),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function KT(e,t){if(1&e){const e=B.RV6();B.j41(0,"div",21)(1,"vault-new-cipher-menu",22),B.bIt("cipherAdded",function(t){E.eBV(e);const i=B.XpG();return E.Njj(i.addCipher(t))})("folderAdded",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.addFolder())})("collectionAdded",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.addCollection())}),B.k0s(),B.nrm(2,"app-coachmark",23,1),B.k0s()}if(2&e){const e=B.sdS(3),t=B.XpG();B.R7$(),B.Y8G("canCreateCipher",t.canCreateCipher)("canCreateFolder",!0)("canCreateSshKey",!0)("canCreateCollection",t.canCreateCollections)("coachmarkPopover",e.popover())("coachmarkPopoverOpen",t.addItemCoachmarkOpen())("coachmarkPosition",t.coachmarkService.getStepPosition("addItem"))}}class XT{constructor(e,t,i,n,r,s){this.i18nService=e,this.collectionAdminService=t,this.dialogService=i,this.router=n,this.configService=r,this.accountService=s,this.Unassigned=Ua.I_,this.All=xd.u8,this.CollectionDialogTabType=bk._K,this.CipherType=mc.gC,this.coachmarkService=(0,E.WQX)(BB.Tu),this.addItemCoachmarkOpen=(0,Rp.EW)(()=>"addItem"===this.coachmarkService.activeStepId()),this.loading=!0,this.organizations=[],this.canCreateCollections=!1,this.onAddCipher=new B.bkB,this.onAddCollection=new B.bkB,this.onAddFolder=new B.bkB,this.onEditCollection=new B.bkB,this.onDeleteCollection=new B.bkB}get activeOrganizationId(){var e;return null!=this.collection?this.collection.node.organizationId:void 0!==(null===(e=this.filter)||void 0===e?void 0:e.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(){var e;return void 0!==(null===(e=this.filter)||void 0===e?void 0:e.collectionId)&&this.filter.collectionId!==xd.u8}get title(){if(void 0===this.filter)return"";if(this.filter.collectionId===Ua.I_)return this.i18nService.t("unassigned");if(this.collection)return this.collection.node.name;if(this.filter.organizationId===Ua.I_)return this.i18nService.t("myVault");if("archive"===this.filter.type)return this.i18nService.t("archiveNoun");const e=this.activeOrganization;return e?`${e.name} ${this.i18nService.t("vault").toLowerCase()}`:this.i18nService.t("allVaults")}get icon(){var e,t;return(null===(e=this.filter)||void 0===e?void 0:e.collectionId)&&this.filter.collectionId!==xd.u8?(null===(t=this.collection)||void 0===t?void 0:t.node.type)===Ua.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared":""}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)}editCollection(e){return DT(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)}get canCreateCipher(){var e,t;return!(null===(e=this.activeOrganization)||void 0===e?void 0:e.isProviderUser)||(null===(t=this.activeOrganization)||void 0===t?void 0:t.isMember)}deleteCollection(){this.onDeleteCollection.emit()}addCipher(e){this.onAddCipher.emit(e)}addFolder(){return DT(this,void 0,void 0,function*(){this.onAddFolder.emit()})}addCollection(){return DT(this,void 0,void 0,function*(){var e,t;const i=null===(e=this.organizations)||void 0===e?void 0:e.find(e=>e.productTierType===rr.K_.Free);if(1==(null===(t=this.organizations)||void 0===t?void 0:t.length)&&i){if((yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.collectionAdminService.collectionAdminViews$(i.id,e))))).length===i.maxCollections)return void(yield this.showFreeOrgUpgradeDialog(i))}this.onAddCollection.emit()})}showFreeOrgUpgradeDialog(e){return DT(this,void 0,void 0,function*(){const t={title:this.i18nService.t("upgradeOrganization"),content:this.i18nService.t(e.canEditSubscription?"freeOrgMaxCollectionReachedManageBilling":"freeOrgMaxCollectionReachedNoManageBilling",e.maxCollections),type:"primary"};e.canEditSubscription?t.acceptButtonText=this.i18nService.t("upgrade"):(t.acceptButtonText=this.i18nService.t("ok"),t.cancelButtonText=null);const i=this.dialogService.openSimpleDialogRef(t);(yield(0,u._)(i.closed))&&e.canEditSubscription&&(yield this.router.navigate(["/organizations",e.id,"billing","subscription"],{queryParams:{upgrade:!0}}))})}}XT.ɵfac=function(e){return new(e||XT)(B.rXU(U.W),B.rXU(g.vE),B.rXU(R.o3),B.rXU(F.Ix),B.rXU(z.w),B.rXU(Y.D))},XT.ɵcmp=B.VBU({type:XT,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:6,vars:6,consts:[["editCollectionMenu",""],["addItemCoachmark",""],[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-shared","queryParamsHandling","merge",3,"route","queryParams",4,"ngFor","ngForOf"],["queryParamsHandling","merge",3,"route","queryParams"],["icon","bwi-collection-shared","queryParamsHandling","merge",3,"route","queryParams"],["bitIconButton","bwi-angle-down","size","small","type","button",3,"bitMenuTriggerFor","label"],["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","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-shrink-0"],[3,"cipherAdded","folderAdded","collectionAdded","canCreateCipher","canCreateFolder","canCreateSshKey","canCreateCollection","coachmarkPopover","coachmarkPopoverOpen","coachmarkPosition"],["stepId","addItem"]],template:function(e,t){1&e&&(B.j41(0,"app-header",2),B.DNE(1,VT,4,2,"bit-breadcrumbs",3),B.qex(2,4),B.nVh(3,YT,8,7,"ng-container"),B.DNE(4,LT,6,7,"small",5),B.bVm(),B.DNE(5,KT,4,7,"div",6),B.k0s()),2&e&&(B.Y8G("title",t.title)("icon",t.icon),B.R7$(),B.Y8G("ngIf",t.showBreadcrumbs),B.R7$(2),B.vxM(null!=t.collection&&(t.canEditCollection||t.canDeleteCollection)?3:-1),B.R7$(),B.Y8G("ngIf",t.loading),B.R7$(),B.Y8G("ngIf","trash"!==t.filter.type))},dependencies:[H.MD,H.Sq,H.bT,CC.M,cf.Z,df.O,uf.S,oh.G,Zd.s,TT.V,FT.m,PT.D,yg.G,wg.f,Ek.Y,jd.p,xd.eG,BB.nk,H.GH,au.$,RT.t],encapsulation:2,changeDetection:0});var qT=i(83691);class HT{}HT.ɵfac=function(e){return new(e||HT)},HT.ɵmod=B.$C({type:HT}),HT.ɵinj=E.G2t({imports:[Ph.G,qT.E]});class WT{}var $T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const JT=new I.Ok(I.iK,"tasks",{deserializer:e=>e,clearOn:[]});class ZT{constructor(e){this.stateProvider=e}vaultOnboardingState(e){return this.stateProvider.getUser(e,JT)}vaultOnboardingState$(e){return this.vaultOnboardingState(e).state$}setVaultOnboardingTasks(e,t){return $T(this,void 0,void 0,function*(){const i=this.vaultOnboardingState(e);yield i.update(()=>Object.assign({},t))})}}ZT.ɵfac=function(e){return new(e||ZT)(E.KVO(I.v2))},ZT.ɵprov=E.jDH({token:ZT,factory:ZT.ɵfac});const _T=e=>({"tw-opacity-50":e}),eF=e=>({"tw-text-primary-700 tw-line-through tw-decoration-primary-700 tw-opacity-50":e});function tF(e,t){if(1&e&&(B.nrm(0,"bit-icon",5),B.j41(1,"span",6),B.EFF(2),B.nrm(3,"bit-icon",7),B.k0s()),2&e){const e=B.XpG();B.Y8G("name",e.completed?"bwi-check":e.icon)("ngClass",e.completed?"tw-text-success":""),B.R7$(),B.Y8G("ngClass",B.eq3(4,eF,e.completed)),B.R7$(),B.JRh(e.title)}}function iF(e,t){1&e&&B.eu8(0)}function nF(e,t){if(1&e&&(B.j41(0,"a",8),B.DNE(1,iF,1,0,"ng-container",9),B.k0s()),2&e){const e=B.XpG(),t=B.sdS(1);B.Y8G("routerLink",e.route),B.R7$(),B.Y8G("ngTemplateOutlet",t)}}function rF(e,t){1&e&&B.eu8(0)}function sF(e,t){if(1&e&&(B.j41(0,"button",10),B.DNE(1,rF,1,0,"ng-container",9),B.k0s()),2&e){const e=B.XpG(),t=B.sdS(1);B.Y8G("disabled",e.isDisabled),B.R7$(),B.Y8G("ngTemplateOutlet",t)}}class oF{constructor(){this.completed=!1,this.icon="bwi-info-circle",this.isDisabled=!1}handleClick(e){e.stopPropagation()}}oF.ɵfac=function(e){return new(e||oF)},oF.ɵcmp=B.VBU({type:oF,selectors:[["app-onboarding-task"]],hostAttrs:[1,"tw-max-w-max"],inputs:{completed:"completed",icon:"icon",title:"title",route:"route",isDisabled:"isDisabled"},standalone:!1,ngContentSelectors:["*"],decls:7,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,"click","ngClass"],[1,"bwi-fw","!tw-mr-4",3,"name","ngClass"],[3,"ngClass"],["name","bwi-angle-right",1,"tw-ml-1"],["bitLink","",3,"routerLink"],[4,"ngTemplateOutlet"],["type","button","bitLink","",3,"disabled"]],template:function(e,t){if(1&e){const e=B.RV6();B.NAR(),B.DNE(0,tF,4,6,"ng-template",null,0,B.C5r),B.j41(2,"li",1),B.DNE(3,nF,2,2,"a",2)(4,sF,2,2,"button",3),B.j41(5,"div",4),B.bIt("click",function(i){return E.eBV(e),E.Njj(t.handleClick(i))}),B.SdG(6),B.k0s()()}2&e&&(B.R7$(3),B.Y8G("ngIf",t.route),B.R7$(),B.Y8G("ngIf",!t.route),B.R7$(),B.Y8G("ngClass",B.eq3(3,_T,t.completed)))},dependencies:[H.YU,H.bT,H.T3,BA.Wk,LA.R,$d.g],encapsulation:2});var aF=i(38140);function lF(e,t){if(1&e&&(B.j41(0,"span"),B.EFF(1),B.nI1(2,"i18n"),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.SpI(" ",B.brH(2,1,"complete",e.amountCompleted,e.tasks.length)," ")}}function cF(e,t){1&e&&B.nrm(0,"bit-icon",12)}class dF{constructor(){this.dismiss=new B.bkB,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}}dF.ɵfac=function(e){return new(e||dF)},dF.ɵcmp=B.VBU({type:dF,selectors:[["app-onboarding"]],contentQueries:function(e,t,i){if(1&e&&B.wni(i,oF,4),2&e){let e;B.mGM(e=B.lsd())&&(t.tasks=e)}},inputs:{title:"title"},outputs:{dismiss:"dismiss"},standalone:!1,ngContentSelectors:["*"],decls:17,vars:9,consts:[["details",""],["spinner",""],["open","",1,"tw-rounded-sm","tw-bg-background-alt","tw-text-main",3,"toggle"],[1,"tw-list-none","tw-p-2","tw-px-4"],[1,"tw-flex","tw-select-none","tw-items-center","tw-gap-4"],[1,"tw-text-lg"],[1,"tw-flex-1",3,"showText","barWidth"],[4,"ngIf","ngIfElse"],[1,"tw-my-auto",3,"name"],[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"],["name","bwi-spinner",1,"bwi-spin"]],template:function(e,t){if(1&e){const e=B.RV6();B.NAR(),B.j41(0,"details",2,0),B.bIt("toggle",function(){return E.eBV(e),E.Njj(t.toggle())}),B.j41(2,"summary",3)(3,"div",4)(4,"div",5),B.EFF(5),B.k0s(),B.nrm(6,"bit-progress",6),B.DNE(7,lF,3,5,"span",7),B.nrm(8,"bit-icon",8),B.k0s()(),B.j41(9,"ul",9),B.SdG(10),B.k0s(),B.j41(11,"div",10)(12,"button",11),B.bIt("click",function(){return E.eBV(e),E.Njj(t.dismiss.emit())}),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()(),B.DNE(15,cF,1,0,"ng-template",null,1,B.C5r)}if(2&e){const e=B.sdS(16);B.R7$(5),B.JRh(t.title),B.R7$(),B.Y8G("showText",!1)("barWidth",t.barWidth),B.R7$(),B.Y8G("ngIf",t.tasks.length>0)("ngIfElse",e),B.R7$(),B.Y8G("name",t.open?"bwi-angle-down":"bwi-angle-up"),B.R7$(5),B.SpI(" ",B.bMT(14,7,"dismiss")," ")}},dependencies:[H.bT,LA.R,$d.g,aF.X,au.$],encapsulation:2});var uF=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const hF=()=>["/tools/import"];function AF(e,t){if(1&e){const e=B.RV6();B.j41(0,"app-onboarding",3),B.nI1(1,"i18n"),B.bIt("dismiss",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.hideOnboarding())}),B.nrm(2,"app-onboarding-task",4),B.nI1(3,"i18n"),B.j41(4,"app-onboarding-task",5),B.nI1(5,"i18n"),B.j41(6,"p",6),B.EFF(7),B.nI1(8,"i18n"),B.j41(9,"button",7),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.emitToAddCipher())}),B.EFF(10),B.nI1(11,"i18n"),B.k0s(),B.j41(12,"span"),B.EFF(13),B.nI1(14,"i18n"),B.k0s()()(),B.j41(15,"app-onboarding-task",8),B.nI1(16,"i18n"),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.navigateToExtension())}),B.j41(17,"span",6),B.EFF(18),B.nI1(19,"i18n"),B.k0s()()()}if(2&e){const e=B.XpG().ngIf;B.Y8G("title",B.bMT(1,13,"getStarted")),B.R7$(2),B.Y8G("title",B.bMT(3,15,"createAnAccount"))("completed",e.createAccount)("isDisabled",!0),B.R7$(2),B.Y8G("title",B.bMT(5,17,"importData"))("route",B.lJ4(29,hF))("completed",e.importData),B.R7$(3),B.SpI(" ",B.bMT(8,19,"onboardingImportDataDetailsPartOne")," "),B.R7$(3),B.SpI(" ",B.bMT(11,21,"onboardingImportDataDetailsLoginLink")," "),B.R7$(3),B.SpI(" ",B.bMT(14,23,"onboardingImportDataDetailsPartTwoNoOrgs")," "),B.R7$(2),B.Y8G("title",B.bMT(16,25,"installBrowserExtension"))("completed",e.installExtension),B.R7$(3),B.SpI(" ",B.bMT(19,27,"installBrowserExtensionDetails")," ")}}function pF(e,t){if(1&e&&(B.j41(0,"div",1),B.DNE(1,AF,20,30,"app-onboarding",2),B.k0s()),2&e){const e=t.ngIf;B.R7$(),B.Y8G("ngIf",e)}}class gF{constructor(e,t,i,n,r){this.platformUtilsService=e,this.policyService=t,this.apiService=i,this.vaultOnboardingService=n,this.accountService=r,this.onAddCipher=new B.bkB,this.destroy$=new d.B,this.onboardingReleaseDate=new Date("2024-04-02"),this.showOnboarding=!1}ngOnInit(){return uF(this,void 0,void 0,function*(){this.activeId=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),this.onboardingTasks$=this.vaultOnboardingService.vaultOnboardingState$(this.activeId),yield this.setOnboardingTasks(),this.setInstallExtLink(),this.individualVaultPolicyCheck(),this.checkForBrowserExtension()})}ngOnChanges(e){return uF(this,void 0,void 0,function*(){if(this.showOnboarding&&(null==e?void 0:e.ciphers)){const e=yield(0,u._)(this.onboardingTasks$),t={createAccount:!0,importData:this.ciphers.length>0,installExtension:e.installExtension};yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,t)}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}checkForBrowserExtension(){this.showOnboarding&&((0,gu.R)(window,"message").pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.getMessages(e)}),window.postMessage({command:QQ.checkBwInstalled}))}getMessages(e){return uF(this,void 0,void 0,function*(){if(e.data.command===QQ.HasBwInstalled&&this.showOnboarding){const e=yield(0,u._)(this.onboardingTasks$),t={createAccount:e.createAccount,importData:e.importData,installExtension:!0};yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,t)}})}checkCreationDate(){return uF(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 uF(this,void 0,void 0,function*(){yield this.saveCompletedTasks({createAccount:!0,importData:!0,installExtension:!0})})}setOnboardingTasks(){return uF(this,void 0,void 0,function*(){var e;const t=yield(0,u._)(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 uF(this,void 0,void 0,function*(){this.showOnboarding=Object.values(e).includes(!1),yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,e)})}individualVaultPolicyCheck(){this.accountService.activeAccount$.pipe(y.F6,(0,rt.n)(e=>this.policyService.policyAppliesToUser$(mt.tt.OrganizationDataOwnership,e)),(0,pi.Q)(this.destroy$)).subscribe(e=>{this.isIndividualPolicyVault=e})}emitToAddCipher(){this.onAddCipher.emit(yc.gC.Login)}setInstallExtLink(){this.platformUtilsService.isChrome()?this.extensionUrl="https://chromewebstore.google.com/detail/bitwarden-password-manage/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")}}gF.ɵfac=function(e){return new(e||gF)(B.rXU(V.y),B.rXU(me.m),B.rXU(de.G),B.rXU(WT),B.rXU(Y.D))},gF.ɵcmp=B.VBU({type:gF,selectors:[["app-vault-onboarding"]],inputs:{ciphers:"ciphers",orgs:"orgs"},outputs:{onAddCipher:"onAddCipher"},features:[B.Jv_([{provide:WT,useClass:ZT}]),B.OA$],decls:2,vars:3,consts:[["class","tw-mb-6",4,"ngIf"],[1,"tw-mb-6"],[3,"title","dismiss",4,"ngIf"],[3,"dismiss","title"],[3,"title","completed","isDisabled"],["icon","bwi-import",3,"title","route","completed"],[1,"tw-pl-1"],["type","button","bitLink","",3,"click"],["icon","bwi-cli","route","[]",3,"click","title","completed"]],template:function(e,t){1&e&&(B.DNE(0,pF,2,1,"div",0),B.nI1(1,"async")),2&e&&B.Y8G("ngIf",B.bMT(1,1,t.isNewAccount&&t.showOnboarding&&t.onboardingTasks$))},dependencies:[HT,dF,oF,H.MD,H.bT,jd.p,zd.V,$d.g,H.Jj,au.$],encapsulation:2});var vF=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function fF(e,t){if(1&e&&(B.j41(0,"bit-callout",9),B.EFF(1),B.k0s()),2&e){const e=B.XpG();B.R7$(),B.SpI(" ",e.trashCleanupWarning," ")}}function mF(e,t){if(1&e){const e=B.RV6();B.j41(0,"bit-callout",10),B.nI1(1,"i18n"),B.qex(2),B.j41(3,"div"),B.EFF(4),B.nI1(5,"i18n"),B.k0s(),B.j41(6,"a",14),B.bIt("click",function(){E.eBV(e);const t=B.XpG();return E.Njj(t.navigateToGetPremium())}),B.EFF(7),B.nI1(8,"i18n"),B.k0s(),B.bVm(),B.k0s()}2&e&&(B.Y8G("title",B.bMT(1,3,"premiumSubscriptionEnded")),B.R7$(4),B.SpI(" ",B.bMT(5,5,"premiumSubscriptionEndedDesc")," "),B.R7$(3),B.SpI(" ",B.bMT(8,7,"restartPremium")," "))}function yF(e,t){1&e&&(B.j41(0,"div",15),B.nrm(1,"i",16),B.nI1(2,"i18n"),B.j41(3,"span",17),B.EFF(4),B.nI1(5,"i18n"),B.k0s()()),2&e&&(B.R7$(),B.Y8G("title",B.mNQ(B.bMT(2,3,"loading"))),B.R7$(3),B.JRh(B.bMT(5,5,"loading")))}function CF(e,t){if(1&e){const e=B.RV6();B.j41(0,"button",23),B.bIt("click",function(){E.eBV(e);const t=B.XpG(2);return E.Njj(t.addCipher())}),B.nrm(1,"i",24),B.EFF(2),B.nI1(3,"i18n"),B.k0s()}2&e&&(B.R7$(2),B.SpI(" ",B.bMT(3,1,"newItem")," "))}function wF(e,t){if(1&e&&(B.j41(0,"div",18)(1,"bit-no-items",19),B.nI1(2,"async"),B.j41(3,"div",20),B.EFF(4),B.nI1(5,"async"),B.nI1(6,"i18n"),B.k0s(),B.j41(7,"p",21),B.EFF(8),B.nI1(9,"async"),B.nI1(10,"i18n"),B.k0s(),B.DNE(11,CF,4,3,"button",22),B.k0s()()),2&e){let e,t,i;const n=B.XpG();B.R7$(),B.Y8G("icon",null==(e=B.bMT(2,4,n.emptyState$))?null:e.icon),B.R7$(3),B.SpI(" ",B.bMT(6,8,null==(t=B.bMT(5,6,n.emptyState$))?null:t.title)," "),B.R7$(4),B.SpI(" ",B.bMT(10,12,null==(i=B.bMT(9,10,n.emptyState$))?null:i.description)," "),B.R7$(3),B.Y8G("ngIf",n.showAddCipherBtn)}}const IF="VaultComponent";class bF{constructor(e,t,i,n,s,o,a,l,c,h,A,g,v,f,m,C,w,I,b,B,E,S,Q,k,T,F,P,R,D,M,x,O,G,U){this.syncService=e,this.route=t,this.router=i,this.changeDetectorRef=n,this.i18nService=s,this.dialogService=o,this.messagingService=a,this.platformUtilsService=l,this.broadcasterService=c,this.ngZone=h,this.organizationService=A,this.vaultFilterService=g,this.routedVaultFilterService=v,this.routedVaultFilterBridgeService=f,this.cipherService=m,this.passwordRepromptService=C,this.collectionService=w,this.logService=I,this.totpService=b,this.eventCollectionService=B,this.searchService=E,this.searchPipe=S,this.apiService=Q,this.billingAccountProfileStateService=k,this.toastService=T,this.accountService=F,this.cipherFormConfigService=P,this.billingApiService=R,this.restrictedItemTypesService=D,this.cipherArchiveService=M,this.organizationWarningsService=x,this.policyService=O,this.premiumUpgradePromptService=G,this.webVaultPromptService=U,this.filterComponent=(0,r.ebz)(kT.C),this.vaultItemsComponent=(0,r.ebz)(Ok.W_),this.trashCleanupWarning="",this.activeFilter=new xd.$5,this.deactivatedOrgIcon=jA,this.emptyTrashIcon=Qk,this.favoritesIcon=kk,this.itemTypesIcon=Tk,this.noResultsIcon=oB.a,this.performingInitialLoad=!0,this.refreshing=!1,this.processingEvent=!1,this.filter={},this.showBulkMove=!1,this.canAccessPremium=!1,this.allCollections=[],this.allOrganizations=[],this.ciphers=[],this.collections=[],this.isEmpty=!1,this.canCreateCollections=!1,this.currentSearchText$=this.route.queryParams.pipe((0,p.T)(e=>e.search)),this.searchText$=new d.B,this.refresh$=new d.B,this.destroy$=new d.B,this.showAddCipherBtn=!1,this.organizations$=this.accountService.activeAccount$.pipe((0,p.T)(e=>null==e?void 0:e.id)).pipe((0,rt.n)(e=>e?this.organizationService.organizations$(e):(0,Ii.of)([]))),this.emptyState$=(0,bi.z)([this.currentSearchText$,this.routedVaultFilterService.filter$,this.organizations$]).pipe((0,p.T)(([e,t,i])=>{const n=i.find(e=>e.id===t.organizationId);if(n&&!n.enabled)return this.showAddCipherBtn=!1,{title:"organizationIsSuspended",description:"organizationIsSuspendedDesc",icon:this.deactivatedOrgIcon};if(e)return{title:"noSearchResults",description:"clearFiltersOrTryAnother",icon:this.noResultsIcon};const r={trash:{title:"noItemsInTrash",description:"noItemsInTrashDesc",icon:this.emptyTrashIcon},favorites:{title:"emptyFavorites",description:"emptyFavoritesDesc",icon:this.favoritesIcon},archive:{title:"noItemsInArchive",description:"noItemsInArchiveDesc",icon:this.itemTypesIcon}};return(null==t?void 0:t.type)&&t.type in r?(this.showAddCipherBtn=!1,r[t.type]):(this.showAddCipherBtn=!0,{title:"noItemsInVault",description:"emptyVaultDescription",icon:this.itemTypesIcon})})),this.userId$=this.accountService.activeAccount$.pipe(y.F6),this.enforceOrgDataOwnershipPolicy$=this.userId$.pipe((0,rt.n)(e=>this.policyService.policyAppliesToUser$(mt.tt.OrganizationDataOwnership,e))),this.userCanArchive$=this.userId$.pipe((0,rt.n)(e=>this.cipherArchiveService.userCanArchive$(e))),this.showSubscriptionEndedMessaging$=this.userId$.pipe((0,rt.n)(e=>(0,bi.z)([this.routedVaultFilterBridgeService.activeFilter$,this.cipherArchiveService.showSubscriptionEndedMessaging$(e)]).pipe((0,p.T)(([e,t])=>e.isArchived&&t)))),this.addFolder=()=>{xd.px.open(this.dialogService)},this.editFolder=e=>vF(this,void 0,void 0,function*(){var t;const i=xd.px.open(this.dialogService,{editFolderConfig:{folder:Object.assign(Object.assign({},e),{name:null!==(t=e.fullName)&&void 0!==t?t:e.name})}});(yield(0,sg.s)(i.closed))===xd.np.Deleted&&(yield this.router.navigate([],{queryParams:{folderId:null},queryParamsHandling:"merge",replaceUrl:!0}))}),this.restore=e=>vF(this,void 0,void 0,function*(){let t;if(Lc.n.isDeleted(e))if(e.edit){if(yield this.repromptCipher([e])){t=Lc.n.isArchived(e)?this.i18nService.t("archivedItemRestored"):this.i18nService.t("restoredItem");try{const i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.cipherService.restoreWithServer((0,Ys.zw)(e.id),i),this.toastService.showToast({variant:"success",message:t}),this.refresh()}catch(i){return void this.logService.error(i)}}}else this.showMissingPermissionsError()})}ngOnInit(){return vF(this,void 0,void 0,function*(){this.trashCleanupWarning=this.i18nService.t(this.platformUtilsService.isSelfHost()?"trashCleanupWarningSelfHosted":"trashCleanupWarning");const e=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),t=this.route.queryParams.pipe((0,Cu.$)(),(0,rt.n)(e=>vF(this,void 0,void 0,function*(){yield this.syncService.fullSync(!1);const t=BF(e);if(!t)return;const i=new Ar.f;i.id=t,"clone"===e.action?yield this.cloneCipher(i):"view"===e.action?yield this.viewCipher(i):"edit"===e.action&&(yield this.editCipher(i))})),(0,Bi.t)({refCount:!0,bufferSize:1}));this.broadcasterService.subscribe(IF,e=>{this.ngZone.run(()=>vF(this,void 0,void 0,function*(){if("syncCompleted"===e.command)e.successfully&&(this.refresh(),this.changeDetectorRef.detectChanges())}))}),this.routedVaultFilterBridgeService.activeFilter$.pipe((0,pi.Q)(this.destroy$)).subscribe(e=>{this.activeFilter=e});const i=this.routedVaultFilterService.filter$,n=this.collectionService.decryptedCollections$(e),r=n.pipe((0,p.T)(e=>(0,Fk.mw)(e)));this.searchText$.pipe((0,Jg.B)(200),(0,hi.F)(),(0,pi.Q)(this.destroy$)).subscribe(e=>this.router.navigate([],{queryParams:{search:at.A.isNullOrEmpty(e)?null:e},queryParamsHandling:"merge",replaceUrl:!0,state:{focusAfterNav:!1}}));const s=this.cipherService.cipherListViews$(e).pipe((0,h.p)(e=>null!==e)),o=(0,bi.z)([s,this.restrictedItemTypesService.restricted$]).pipe((0,p.T)(([e,t])=>e.filter(e=>!this.restrictedItemTypesService.isCipherRestricted(e,t)))),a=(0,bi.z)([o,i,this.currentSearchText$]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,ra.H)(t=>vF(this,[t],void 0,function*([t,i,n]){var r;const s=null!==(r=yield(0,u._)(this.cipherService.failedToDecryptCiphers$(e)))&&void 0!==r?r:[],o=(0,xd.Jp)(i),a=[...s,...t];return(yield this.searchService.isSearchable(e,n))?yield this.searchService.searchCiphers(e,n,[o],a):t.filter(o)})),(0,Bi.t)({refCount:!0,bufferSize:1})),l=(0,bi.z)([r,i,this.currentSearchText$]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,ra.H)(t=>vF(this,[t],void 0,function*([t,i,n]){var r;if(void 0===i.collectionId||i.collectionId===Ua.I_)return[];let s=[];if(void 0!==i.organizationId&&i.collectionId===xd.u8)s=t.filter(e=>e.node.organizationId===i.organizationId);else if(i.collectionId===xd.u8)s=t;else{const e=Rk.F.getTreeNodeObjectFromList(t,i.collectionId);s=null!==(r=null==e?void 0:e.children)&&void 0!==r?r:[]}if(yield this.searchService.isSearchable(e,n)){const e=(0,Fk.eO)(s);return this.searchPipe.transform(e,n,e=>e.name,e=>e.id)}return s.map(e=>e.node)})),(0,Bi.t)({refCount:!0,bufferSize:1})),c=(0,bi.z)([r,i]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,p.T)(([e,t])=>{if(void 0!==t.collectionId&&t.collectionId!==xd.u8&&t.collectionId!==Ua.I_)return Rk.F.getTreeNodeObjectFromList(e,t.collectionId)}),(0,Bi.t)({refCount:!0,bufferSize:1}));t.pipe((0,rt.n)(()=>this.route.queryParams),(0,h.p)(()=>null==this.vaultItemDialogRef),(0,rt.n)(t=>vF(this,void 0,void 0,function*(){const i=BF(t);if(i)if(yield this.cipherService.get(i,e)){let e=t.action;if(null==e&&(e="view"),"showFailedToDecrypt"==e)return xd.Tp.open(this.dialogService,{cipherIds:[i]}),void(yield this.router.navigate([],{queryParams:{itemId:null,cipherId:null,action:null},queryParamsHandling:"merge",replaceUrl:!0}));"view"===e?yield this.viewCipherById(i):yield this.editCipherId(i)}else yield this.handleUnknownCipher()})),(0,pi.Q)(this.destroy$)).subscribe(),t.pipe((0,rt.n)(()=>this.cipherService.failedToDecryptCiphers$(e)),(0,cc.w)(),(0,p.T)(e=>e.filter(e=>!e.isDeleted)),(0,h.p)(e=>e.length>0),(0,Ai.s)(1),(0,pi.Q)(this.destroy$)).subscribe(e=>{xd.Tp.open(this.dialogService,{cipherIds:e.map(e=>e.id)})}),this.organizations$.pipe((0,h.p)(e=>1===e.length),(0,p.T)(e=>e[0]),(0,rt.n)(e=>this.organizationWarningsService.showInactiveSubscriptionDialog$(e)),(0,pi.Q)(this.destroy$)).subscribe(),t.pipe((0,rt.n)(()=>this.refresh$.pipe((0,gi.Z)(void 0))),(0,M.M)(()=>this.refreshing=!0),(0,rt.n)(()=>(0,bi.z)([i,this.billingAccountProfileStateService.hasPremiumFromAnySource$(e),n,this.organizations$,a,l,c])),(0,pi.Q)(this.destroy$)).subscribe(([e,t,i,n,r,s,o])=>{this.filter=e,this.canAccessPremium=t,this.allCollections=i,this.allOrganizations=n,this.ciphers=r,this.collections=s,this.selectedCollection=o,this.canCreateCollections=null==n?void 0:n.some(e=>e.canCreateNewCollections&&!e.isProviderUser),this.showBulkMove="trash"!==e.type,this.isEmpty=0===(null==s?void 0:s.length)&&0===(null==r?void 0:r.length),this.performingInitialLoad=!1,this.refreshing=!1,this.changeDetectorRef.markForCheck()}),this.webVaultPromptService.conditionallyPromptUser()})}ngOnDestroy(){this.broadcasterService.unsubscribe(IF),this.destroy$.next(),this.destroy$.complete(),this.vaultFilterService.clearOrganizationFilter()}navigateToGetPremium(){return vF(this,void 0,void 0,function*(){yield this.router.navigate(["/settings/subscription/premium"])})}onVaultItemsEvent(e){return vF(this,void 0,void 0,function*(){this.processingEvent=!0;try{switch(e.type){case"viewAttachments":yield this.editCipherAttachments(e.item);break;case"clone":yield this.cloneCipher(e.item);break;case"restore":1===e.items.length?yield this.restore(e.items[0]):yield this.bulkRestore(e.items);break;case"delete":yield this.handleDeleteEvent(e.items);break;case"moveToFolder":yield this.bulkMove(e.items);break;case"copyField":yield this.copy(e.item,e.field);break;case"editCollection":yield this.editCollection(e.item,bk._K.Info);break;case"viewCollectionAccess":yield this.editCollection(e.item,bk._K.Access);break;case"assignToCollections":yield this.bulkAssignToCollections(e.items);break;case"archive":1===e.items.length?yield this.archive(e.items[0]):yield this.bulkArchive(e.items);break;case"unarchive":1===e.items.length?yield this.unarchive(e.items[0]):yield this.bulkUnarchive(e.items);break;case"toggleFavorite":yield this.handleFavoriteEvent(e.item);break;case"editCipher":yield this.editCipher(e.item)}}finally{this.processingEvent=!1}})}handleUnknownCipher(){return vF(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",message:this.i18nService.t("unknownCipher")}),yield this.router.navigate([],{queryParams:{itemId:null,cipherId:null},queryParamsHandling:"merge"})})}archive(e){return vF(this,void 0,void 0,function*(){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveItem"},content:{key:"archiveItemDialogContent"},acceptButtonText:{key:"archiveVerb"},type:"info"})))return;const t=yield(0,u._)(this.userId$);try{yield this.cipherArchiveService.archiveWithServer(e.id,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemArchiveToast")}),this.refresh()}catch(i){this.logService.error("Error archiving cipher",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}bulkArchive(e){return vF(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveBulkItems"},content:{key:"archiveBulkItemsConfirmDesc"},type:"info"})))return;const t=yield(0,u._)(this.userId$),i=e.map(e=>e.id);try{yield this.cipherArchiveService.archiveWithServer(i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("bulkArchiveItems")}),this.refresh()}catch(n){this.logService.error("Error archiving ciphers",n),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}unarchive(e){return vF(this,void 0,void 0,function*(){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return;const t=yield(0,u._)(this.userId$);try{yield this.cipherArchiveService.unarchiveWithServer(e.id,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemUnarchivedToast")}),this.refresh()}catch(i){this.logService.error("Error unarchiving cipher",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}bulkUnarchive(e){return vF(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;const t=yield(0,u._)(this.userId$),i=e.map(e=>e.id);try{yield this.cipherArchiveService.unarchiveWithServer(i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("bulkUnarchiveItems")}),this.refresh()}catch(n){this.logService.error("Error unarchiving ciphers",n),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}applyOrganizationFilter(e){return vF(this,void 0,void 0,function*(){var t,i,n,r,s,o;null==e&&(e="MyVault");const a=null===(n=null===(i=null===(t=this.filterComponent())||void 0===t?void 0:t.filters)||void 0===i?void 0:i.organizationFilter)||void 0===n?void 0:n.data$;if(null==a)return;const l=yield(0,u._)(a),c=Rk.F.getTreeNodeObject(l,e);yield null===(o=null===(s=null===(r=this.filterComponent())||void 0===r?void 0:r.filters)||void 0===s?void 0:s.organizationFilter)||void 0===o?void 0:o.action(c)})}filterSearchText(e){this.searchText$.next(e)}editCipherAttachments(e){return vF(this,void 0,void 0,function*(){if(0!==(null==e?void 0:e.reprompt)&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null},this.configureRouterFocusToCipher("string"==typeof(null==e?void 0:e.id)?e.id:void 0)));if(null==e.organizationId&&!this.canAccessPremium)return void(yield this.premiumUpgradePromptService.promptForPremium());if(null!=e.organizationId){const t=yield(0,u._)(this.organizations$.pipe((0,f.Sw)((0,Ys.zw)(e.organizationId))));if(null!=t&&(null==t.maxStorageGb||0===t.maxStorageGb))return void this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId})}const t=xd._A.open(this.dialogService,{cipherId:e.id,organizationId:e.organizationId,canEditCipher:e.edit}),i=yield(0,sg.s)(t.closed);void 0!==i&&(i.action!==xd.NY.Uploaded&&i.action!==xd.NY.Removed||this.refresh())})}openVaultItemDialog(e,t,i){return vF(this,void 0,void 0,function*(){var n;this.vaultItemDialogRef=xk.V.open(this.dialogService,{mode:e,formConfig:t,activeCollectionId:i,restore:this.restore});const r=yield(0,sg.s)(this.vaultItemDialogRef.closed);this.vaultItemDialogRef=void 0,r!==xk.r.PremiumUpgrade&&(r!==xk.r.Deleted&&r!==xk.r.Saved||this.refresh(),yield this.go({cipherId:null,itemId:null,action:null},this.configureRouterFocusToCipher(null===(n=t.originalCipher)||void 0===n?void 0:n.id)))})}addCipher(e){return vF(this,void 0,void 0,function*(){var t;const i=null!=e?e:this.activeFilter.cipherType,n=yield this.cipherFormConfigService.buildConfig("add",void 0,i),r="AllCollections"!==this.activeFilter.collectionId&&null!=this.activeFilter.collectionId?this.activeFilter.collectionId:null;let s="MyVault"!==this.activeFilter.organizationId&&null!=this.activeFilter.organizationId?this.activeFilter.organizationId:null;if(r){const e=null===(t=(yield(0,u._)(this.vaultFilterService.filteredCollections$)).find(e=>e.id===this.activeFilter.collectionId))||void 0===t?void 0:t.organizationId;e&&(s=e)}n.initialValues={organizationId:s,collectionIds:[r],folderId:this.activeFilter.folderId},yield this.openVaultItemDialog("form",n)})}editCipher(e,t){return vF(this,void 0,void 0,function*(){return this.editCipherId((0,Ys.zw)(e.id),t)})}editCipherId(e,t){return vF(this,void 0,void 0,function*(){const i=yield(0,u._)((0,y.F6)(this.accountService.activeAccount$)),n=yield this.cipherService.get(e,i);if(!n)return void(yield this.handleUnknownCipher());if(n&&0!==n.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null,action:null},this.configureRouterFocusToCipher(n.id)));const r=yield this.cipherFormConfigService.buildConfig(t?"clone":"edit",n.id,n.type);yield this.openVaultItemDialog("form",r)})}viewCipher(e){return this.viewCipherById(e.id)}viewCipherById(e){return vF(this,void 0,void 0,function*(){var t;const i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),n=yield this.cipherService.get(e,i);if(!n)return void(yield this.handleUnknownCipher());if(n&&0!==n.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null,action:null},this.configureRouterFocusToCipher(n.id)));const r=yield this.cipherFormConfigService.buildConfig(n.edit?"edit":"partial-edit",n.id,n.type);yield this.openVaultItemDialog("view",r,null===(t=this.selectedCollection)||void 0===t?void 0:t.node.id)})}addCollection(){return vF(this,void 0,void 0,function*(){const e=(0,bk.jN)(this.dialogService,{data:{organizationId:this.allOrganizations.filter(e=>e.canCreateNewCollections&&!e.isProviderUser).sort(at.A.getSortFunction(this.i18nService,"name"))[0].id,parentCollectionId:this.filter.collectionId,showOrgSelector:!0,limitNestedCollections:!0}}),t=yield(0,sg.s)(e.closed);if(void 0!==t&&t.action===bk.RZ.Saved){if(t.collection){const e=new Ua.Fw(t.collection),i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.collectionService.upsert(e,i)}this.refresh()}})}editCollection(e,t){return vF(this,void 0,void 0,function*(){var i,n,r;const s=(0,bk.jN)(this.dialogService,{data:{collectionId:e.id,organizationId:e.organizationId,initialTab:t,limitNestedCollections:!0}}),o=yield(0,sg.s)(s.closed);if(void 0===o)return;const a=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));if(o.action===bk.RZ.Saved){if(o.collection){const e=new Ua.Fw(o.collection);yield this.collectionService.upsert(e,a)}this.refresh()}else if(o.action===bk.RZ.Deleted){const t=null===(i=this.selectedCollection)||void 0===i?void 0:i.parent,s=this.selectedCollection&&this.selectedCollection.node.id===e.id;yield this.collectionService.delete([null===(n=o.collection)||void 0===n?void 0:n.id],a),this.refresh(),s&&(yield this.router.navigate([],{queryParams:{collectionId:null!==(r=null==t?void 0:t.node.id)&&void 0!==r?r:null},queryParamsHandling:"merge",replaceUrl:!0}))}})}deleteCollection(e){return vF(this,void 0,void 0,function*(){var t,i;const n=yield(0,u._)(this.organizations$.pipe((0,f.Sw)(e.organizationId)));if(!e.canDelete(n))return void this.showMissingPermissionsError();if(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))try{const n=null===(t=this.selectedCollection)||void 0===t?void 0:t.parent,r=this.selectedCollection&&this.selectedCollection.node.id===e.id;yield this.apiService.deleteCollection(e.organizationId,e.id);const s=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.collectionService.delete([e.id],s),this.toastService.showToast({variant:"success",message:this.i18nService.t("deletedCollectionId",e.name)}),r&&(yield this.router.navigate([],{queryParams:{collectionId:null!==(i=null==n?void 0:n.node.id)&&void 0!==i?i:null},queryParamsHandling:"merge",replaceUrl:!0})),this.refresh()}catch(r){this.logService.error(r)}})}bulkAssignToCollections(e){return vF(this,void 0,void 0,function*(){var t,i;if(!(yield this.repromptCipher(e)))return;if(0===e.length)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("nothingSelected")});let n=[];const r=this.activeFilter.organizationId||(null===(t=e.find(e=>!!e.organizationId))||void 0===t?void 0:t.organizationId);if(r&&"MyVault"!==r){const e=this.allOrganizations.find(e=>e.id===r);n=this.allCollections.filter(t=>t.organizationId===(null==e?void 0:e.id))}let s;if(e.some(Lc.n.isCipherListView)){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));s=yield(0,u._)(this.cipherService.cipherViews$(t).pipe((0,p.T)(t=>t.filter(t=>e.some(e=>e.id===t.id)))))}else s=e;const o=Mk.G.open(this.dialogService,{data:{ciphers:s,organizationId:r,availableCollections:n,activeCollection:null===(i=this.activeFilter.selectedCollectionNode)||void 0===i?void 0:i.node}});(yield(0,sg.s)(o.closed))===xd.f$.Saved&&this.refresh()})}cloneCipher(e){return vF(this,void 0,void 0,function*(){if(Lc.n.hasFido2Credentials(e)){if(!(yield this.dialogService.openSimpleDialog({title:{key:"passkeyNotCopied"},content:{key:"passkeyNotCopiedAlert"},type:"info"})))return!1}yield this.editCipher(e,!0)})}bulkRestore(e){return vF(this,void 0,void 0,function*(){let t;if(e.some(e=>!e.edit))return void this.showMissingPermissionsError();if(t=e.some(e=>!Lc.n.isArchived(e))?this.i18nService.t("restoredItems"):this.i18nService.t("archivedItemsRestored"),!(yield this.repromptCipher(e)))return;const i=e.map(e=>(0,Ys.zw)(e.id));if(0===i.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("nothingSelected")});const n=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.cipherService.restoreManyWithServer(i,n),this.toastService.showToast({variant:"success",message:t}),this.refresh()})}handleDeleteEvent(e){return vF(this,void 0,void 0,function*(){const t=e.filter(e=>void 0===e.collection&&void 0!==e.cipher).map(e=>e.cipher),i=e.filter(e=>void 0!==e.collection).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 e=i.map(e=>e.organizationId),n=yield(0,u._)(this.organizations$.pipe((0,p.T)(t=>t.filter(t=>e.includes(t.id)))));yield this.bulkDelete(t,i,n)}})}deleteCipher(e){return vF(this,void 0,void 0,function*(){if(!(yield this.repromptCipher([e])))return;if(!e.edit)return void this.showMissingPermissionsError();const t=Lc.n.isDeleted(e);if(yield this.dialogService.openSimpleDialog({title:{key:t?"permanentlyDeleteItem":"deleteItem"},content:{key:t?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"}))try{const i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6));yield this.deleteCipherWithServer((0,Ys.zw)(e.id),i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t(t?"permanentlyDeletedItem":"deletedItem")}),this.refresh()}catch(i){this.logService.error(i)}})}bulkDelete(e,t,i){return vF(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;if(0===e.length&&0===t.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("nothingSelected")});const n=null==t||t.every(e=>e.canDelete(i.find(t=>t.id==e.organizationId))),r=null==e||e.every(e=>e.edit);if(!n||!r)return void this.showMissingPermissionsError();const s=(0,oT.Q0)(this.dialogService,{data:{permanent:"trash"===this.filter.type,cipherIds:e.map(e=>(0,Ys.zw)(e.id)),organizations:i,collections:t}});(yield(0,sg.s)(s.closed))===oT.vA.Deleted&&this.refresh()})}bulkMove(e){return vF(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;const t=e.map(e=>(0,Ys.zw)(e.id));if(0===t.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("nothingSelected")});const i=(n=this.dialogService,r={data:{cipherIds:t}},n.open(uT,r));var n,r;(yield(0,sg.s)(i.closed))===cT&&this.refresh()})}copy(e,t){return vF(this,void 0,void 0,function*(){let i,n,r;const s=Lc.n.getLogin(e);if(s){if("username"===t)i="Username",n=s.username,r="username";else if("password"===t)i="Password",n=yield this.getPasswordFromCipherViewLike(e),r="password";else{if("totp"!==t)return void this.showErrorToast();if(i="TOTP",!s.totp)return void this.showErrorToast();n=(yield(0,u._)(this.totpService.getCode$(s.totp))).code,r="verificationCodeTotp"}this.passwordRepromptService.protectedFields().includes(i)&&!(yield this.repromptCipher([e]))||e.viewPassword&&(n?(this.platformUtilsService.copyToClipboard(n,{window}),this.toastService.showToast({variant:"info",message:this.i18nService.t("valueCopied",this.i18nService.t(r))}),"password"===t?yield this.eventCollectionService.collect(C.Bx.Cipher_ClientCopiedPassword,(0,Ys.zw)(e.id)):"totp"===t&&(yield this.eventCollectionService.collect(C.Bx.Cipher_ClientCopiedHiddenField,(0,Ys.zw)(e.id)))):this.showErrorToast())}else this.showErrorToast()})}showErrorToast(){this.toastService.showToast({variant:"error",message:this.i18nService.t("unexpectedError")})}handleFavoriteEvent(e){return vF(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),i=yield this.cipherService.getFullCipherView(e);i.favorite=!i.favorite,yield this.cipherService.updateWithServer(i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t(i.favorite?"itemAddedToFavorites":"itemRemovedFromFavorites")}),this.refresh()})}deleteCipherWithServer(e,t,i){return i?this.cipherService.deleteWithServer(e,t):this.cipherService.softDeleteWithServer(e,t)}repromptCipher(e){return vF(this,void 0,void 0,function*(){return!e.find(e=>e.reprompt!==Pk.b.None)||(yield this.passwordRepromptService.showPasswordPrompt())})}refresh(){var e;this.refresh$.next(void 0),null===(e=this.vaultItemsComponent())||void 0===e||e.clearSelection()}configureRouterFocusToCipher(e){if(e)return{state:{focusAfterNav:`#cipher-btn-${e}`}}}go(){return vF(this,arguments,void 0,function*(e=null,t){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}),yield this.router.navigate([],Object.assign({relativeTo:this.route,queryParams:e,queryParamsHandling:"merge",replaceUrl:!0},t))})}showMissingPermissionsError(){this.toastService.showToast({variant:"error",message:this.i18nService.t("missingPermissions")})}getPasswordFromCipherViewLike(e){return vF(this,void 0,void 0,function*(){var t;if(!Lc.n.isCipherListView(e))return Promise.resolve(null===(t=null==e?void 0:e.login)||void 0===t?void 0:t.password);const i=yield(0,u._)(this.accountService.activeAccount$.pipe(y.F6)),n=yield this.cipherService.get((0,Ys.zw)(e.id),i);return(yield this.cipherService.decrypt(n,i)).login.password})}}bF.ɵfac=function(e){return new(e||bF)(B.rXU(Ga.H),B.rXU(F.nX),B.rXU(F.Ix),B.rXU(r.gRc),B.rXU(U.W),B.rXU(R.o3),B.rXU(js.U),B.rXU(V.y),B.rXU(S.y),B.rXU(B.SKi),B.rXU(f.PV),B.rXU(xd.cD),B.rXU(xd.BR),B.rXU(xd.aC),B.rXU(k.p),B.rXU(xd.qX),B.rXU(g.YD),B.rXU(Vs.K),B.rXU(ac.R),B.rXU(C.c_),B.rXU(j.S),B.rXU(Sk.R),B.rXU(de.G),B.rXU(Rn.Q),B.rXU(P.f),B.rXU(Y.D),B.rXU(xd.Ws),B.rXU(Fn.P),B.rXU(gd.b),B.rXU(tc.J),B.rXU(Dk.S),B.rXU(me.m),B.rXU(Lu.l),B.rXU(sT))},bF.ɵcmp=B.VBU({type:bF,selectors:[["app-vault"]],viewQuery:function(e,t){1&e&&(B.wEZ(t.filterComponent,kT.C,5),B.wEZ(t.vaultItemsComponent,Ok.W_,5)),2&e&&B.NyB(2)},features:[B.Jv_([xd.BR,xd.aC,xd.Ws,sT,{provide:xd.DL,useClass:xd._8}])],decls:19,vars:40,consts:[["vaultFilter",""],["vaultItems",""],[3,"organizations"],[3,"onAddCipher","onAddCollection","onAddFolder","onEditCollection","onDeleteCollection","filter","loading","organizations","canCreateCollections","collection"],[3,"onAddCipher","ciphers","orgs"],[1,"tw-flex","tw-flex-row","-tw-mx-2.5"],[1,"tw-basis-1/4","tw-max-w-1/4","tw-px-2.5"],[3,"searchTextChanged","onEditFolder","activeFilter","searchText"],[1,"tw-basis-3/4","tw-max-w-3/4","tw-px-2.5"],["type","warning"],["type","subtle",3,"title"],[3,"onEvent","ciphers","collections","allCollections","allOrganizations","disabled","showOwner","showCollections","showGroups","showPremiumFeatures","showBulkMove","showBulkTrashOptions","useEvents","showAdminActions","showBulkAddToCollections","userCanArchive","enforceOrgDataOwnershipPolicy"],["class","tw-mt-6 tw-flex tw-h-full tw-flex-col tw-items-center tw-justify-start",4,"ngIf"],["class","tw-mt-6 tw-flex tw-h-full tw-flex-col tw-items-center tw-justify-start tw-flex-1",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click"],[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","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mt-6","tw-flex","tw-h-full","tw-flex-col","tw-items-center","tw-justify-start","tw-flex-1"],[3,"icon"],["slot","title"],["slot","description","bitTypography","body2",1,"tw-max-w-md","tw-text-center"],["type","button","buttonType","primary","bitButton","","slot","button",3,"click",4,"ngIf"],["type","button","buttonType","primary","bitButton","","slot","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"]],template:function(e,t){if(1&e){const e=B.RV6();B.nrm(0,"app-vault-banners",2),B.nI1(1,"async"),B.j41(2,"app-vault-header",3),B.bIt("onAddCipher",function(i){return E.eBV(e),E.Njj(t.addCipher(i))})("onAddCollection",function(){return E.eBV(e),E.Njj(t.addCollection())})("onAddFolder",function(){return E.eBV(e),E.Njj(t.addFolder())})("onEditCollection",function(i){return E.eBV(e),E.Njj(t.editCollection(t.selectedCollection.node,i.tab))})("onDeleteCollection",function(){return E.eBV(e),E.Njj(t.deleteCollection(t.selectedCollection.node))}),B.k0s(),B.j41(3,"app-vault-onboarding",4),B.bIt("onAddCipher",function(i){return E.eBV(e),E.Njj(t.addCipher(i))}),B.k0s(),B.j41(4,"div",5)(5,"div",6)(6,"app-vault-filter",7,0),B.nI1(8,"async"),B.bIt("searchTextChanged",function(i){return E.eBV(e),E.Njj(t.filterSearchText(i))})("onEditFolder",function(i){return E.eBV(e),E.Njj(t.editFolder(i))}),B.k0s()(),B.j41(9,"div",8),B.nVh(10,fF,2,1,"bit-callout",9),B.nVh(11,mF,9,9,"bit-callout",10),B.nI1(12,"async"),B.j41(13,"app-vault-items",11,1),B.nI1(15,"async"),B.nI1(16,"async"),B.bIt("onEvent",function(i){return E.eBV(e),E.Njj(t.onVaultItemsEvent(i))}),B.k0s(),B.DNE(17,yF,6,7,"div",12)(18,wF,12,14,"div",13),B.k0s()()}2&e&&(B.Y8G("organizations",B.bMT(1,30,t.organizations$)),B.R7$(2),B.Y8G("filter",t.filter)("loading",t.refreshing&&!t.performingInitialLoad)("organizations",t.allOrganizations)("canCreateCollections",t.canCreateCollections)("collection",t.selectedCollection),B.R7$(),B.Y8G("ciphers",t.ciphers)("orgs",t.allOrganizations),B.R7$(3),B.Y8G("activeFilter",t.activeFilter)("searchText",B.bMT(8,32,t.currentSearchText$)),B.R7$(4),B.vxM(t.activeFilter.isDeleted?10:-1),B.R7$(),B.vxM(B.bMT(12,34,t.showSubscriptionEndedMessaging$)?11:-1),B.R7$(2),B.Y8G("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)("showBulkAddToCollections",!0)("userCanArchive",B.bMT(15,36,t.userCanArchive$))("enforceOrgDataOwnershipPolicy",B.bMT(16,38,t.enforceOrgDataOwnershipPolicy$)),B.R7$(4),B.Y8G("ngIf",t.performingInitialLoad),B.R7$(),B.Y8G("ngIf",t.isEmpty&&!t.performingInitialLoad))},dependencies:[XT,gF,QT,wE,kT.C,Gk.l,Ok.W_,Ph.G,H.bT,iv.Y,Jd.Q,zA.G,$d.g,cB.D,MA.r,H.Jj,au.$],encapsulation:2});const BF=e=>e.itemId||e.cipherId,EF=[{path:"",component:bF,data:{titleId:"vaults"}}];class SF{}SF.ɵfac=function(e){return new(e||SF)},SF.ɵmod=B.$C({type:SF}),SF.ɵinj=E.G2t({imports:[BA.iI.forChild(EF),BA.iI]});class QF{}QF.ɵfac=function(e){return new(e||QF)},QF.ɵmod=B.$C({type:QF}),QF.ɵinj=E.G2t({imports:[SF,yE.t,Ik.B,wk.K,Ek.Y,oh.G,Bk,bk.GW,bF]});const kF=[{path:"register",redirectTo:kA.SignUp,pathMatch:"full"},{path:"trial",redirectTo:kA.SignUp,pathMatch:"full"},{path:"",component:pI,data:{doNotSaveUrl:!0},children:[{path:"",pathMatch:"full",children:[],canActivate:[(0,TA.EO)()]},{path:"verify-email",component:gC},{path:Eg.AcceptOrganizationInvite,canActivate:[(0,Sg.i)()],component:Tg,data:{titleId:"joinOrganization",doNotSaveUrl:!1}},{path:"accept-families-for-enterprise",component:rg,canActivate:[(0,Sg.i)()],data:{titleId:"acceptFamilySponsorship",doNotSaveUrl:!1}},{path:"recover",pathMatch:"full",redirectTo:Eg.RecoverTwoFactor},{path:"verify-recover-delete-org",component:eg,canActivate:[(0,TA.Z6)()],data:{titleId:"deleteOrganization"}}]},{path:"",component:Wp,children:[{path:kA.LoginWithPasskey,canActivate:[(0,TA.Z6)()],data:{pageIcon:FA.s,titleId:"logInWithPasskey",pageTitle:{key:"logInWithPasskey"},pageSubtitle:{key:"readingPasskeyLoadingInfo"}},children:[{path:"",component:UA},{path:"",component:jw,outlet:"environment-selector"}]},{path:kA.SignUp,canActivate:[(0,TA.Z6)()],data:{pageIcon:ep.R,pageTitle:{key:"createAccount"},titleId:"createAccount"},children:[{path:"",component:le.dz},{path:"",component:le.Xj,outlet:"secondary",data:{loginRoute:"/login"}}]},{path:kA.FinishSignUp,canActivate:[(0,TA.Z6)()],data:{pageIcon:tp.X,titleId:"setAStrongPassword"},children:[{path:"",component:le.el}]},{path:kA.Login,canActivate:[(0,TA.Z6)()],data:{pageTitle:{key:"logIn"},pageIcon:ip.E},children:[{path:"",component:le.XJ},{path:"",component:le.O_,outlet:"secondary"},{path:"",component:jw,outlet:"environment-selector"}]},{path:kA.LoginWithDevice,data:{pageIcon:np,pageTitle:{key:"logInRequestSent"},pageSubtitle:{key:"aNotificationWasSentToYourDevice"},titleId:"loginInitiated"},children:[{path:"",component:le.Mf},{path:"",component:jw,outlet:"environment-selector"}]},{path:kA.AdminApprovalRequested,data:{pageIcon:np,pageTitle:{key:"adminApprovalRequested"},pageSubtitle:{key:"adminApprovalRequestSentToAdmins"},titleId:"adminApprovalRequested"},children:[{path:"",component:le.Mf}]},{path:kA.PasswordHint,canActivate:[(0,TA.Z6)()],data:{pageTitle:{key:"requestPasswordHint"},pageSubtitle:{key:"enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou"},pageIcon:rp.u,state:"hint"},children:[{path:"",component:le.s7},{path:"",component:jw,outlet:"environment-selector"}]},{path:kA.LoginInitiated,canActivate:[(0,TA.Xt)()],data:{pageIcon:np},children:[{path:"",component:le.K3}]},{path:"send/:sendId/:key",data:{pageTitle:{key:"viewSend"},showReadonlyHostname:!0,pageIcon:sp},children:[{path:"",component:mE},{path:"",outlet:"secondary",component:cQ}]},{path:kA.SetInitialPassword,canActivate:[TA.W_],component:_A,data:{maxWidth:"lg",pageIcon:tp.X}},{path:Eg.SignUpLinkExpired,canActivate:[(0,TA.Z6)()],data:{pageIcon:op.c,pageTitle:{key:"expiredLink"}},children:[{path:"",component:le.MP,data:{loginRoute:`/${kA.Login}`}}]},{path:kA.Sso,canActivate:[(0,TA.Z6)()],data:{pageTitle:{key:"singleSignOn"},titleId:"enterpriseSingleSignOn",pageSubtitle:{key:"singleSignOnEnterOrgIdentifierText"},pageIcon:ap},children:[{path:"",component:le.r0},{path:"",component:jw,outlet:"environment-selector"}]},{path:kA.TwoFactor,component:le.Yi,canActivate:[(0,TA.Z6)(),le.lA],children:[{path:"",component:le.Yi},{path:"",component:jw,outlet:"environment-selector"}],data:{pageTitle:{key:"verifyYourIdentity"},pageIcon:null}},{path:"lock",canActivate:[(0,Sg.i)(),(0,TA.HG)()],children:[{path:"",component:Xu.jN}],data:{pageTitle:{key:"yourVaultIsLockedV2"},pageIcon:tp.X,showReadonlyHostname:!0}},{path:kA.AuthenticationTimeout,canActivate:[(0,TA.Z6)()],children:[{path:"",component:QA},{path:"",component:jw,outlet:"environment-selector"}],data:{pageIcon:op.c,pageTitle:{key:"authenticationTimeout"},titleId:"authenticationTimeout"}},{path:Eg.RecoverTwoFactor,canActivate:[(0,TA.Z6)()],children:[{path:"",component:Og},{path:"",component:jw,outlet:"environment-selector"}],data:{pageTitle:{key:"recoverAccountTwoStep"},titleId:"recoverAccountTwoStep",pageIcon:lp.m}},{path:kA.NewDeviceVerification,canActivate:[(0,TA.Z6)(),(0,TA.CV)()],children:[{path:"",component:le.l$}],data:{pageIcon:cp.f,pageTitle:{key:"verifyYourIdentity"},pageSubtitle:{key:"weDontRecognizeThisDevice"}}},{path:Eg.AcceptEmergencyAccessInvite,canActivate:[(0,Sg.i)()],data:{pageTitle:{key:"emergencyAccess"},titleId:"acceptEmergency",doNotSaveUrl:!1,pageIcon:ip.E},children:[{path:"",loadComponent:()=>i.e(825).then(i.bind(i,33825)).then(e=>e.AcceptEmergencyComponent)}]},{path:Eg.RecoverDeleteAccount,canActivate:[(0,TA.Z6)()],data:{pageTitle:{key:"deleteAccount"},titleId:"deleteAccount",pageIcon:dp},children:[{path:"",component:Dg},{path:"",component:jw,outlet:"environment-selector"}]},{path:Eg.VerifyRecoverDeleteAccount,canActivate:[(0,TA.Z6)()],data:{pageTitle:{key:"deleteAccount"},titleId:"deleteAccount",pageIcon:dp},children:[{path:"",component:mC}]},{path:"remove-password",component:Xu.jg,canActivate:[TA.W_],data:{pageTitle:{key:"verifyYourOrganization"},titleId:"verifyYourOrganization",pageIcon:tp.X}},{path:"confirm-key-connector-domain",component:hI,canActivate:[],data:{pageTitle:{key:"verifyYourOrganization"},titleId:"verifyYourOrganization",pageIcon:up}},{path:"trial-initiation",canActivate:[(0,TA.Z6)()],component:Mw,resolve:{pageTitle:xw},data:{maxWidth:"3xl",pageIcon:hp}},{path:"secrets-manager-trial-initiation",canActivate:[(0,TA.Z6)()],component:Mw,resolve:{pageTitle:xw},data:{maxWidth:"3xl",pageIcon:hp}},{path:"browser-extension-prompt",data:{pageIcon:Ap},children:[{path:"",component:qQ},{path:"",component:GQ,outlet:"secondary"}]},{path:kA.ChangePassword,component:ne.h5,canActivate:[TA.W_],data:{pageIcon:tp.X}},{path:"setup-extension",data:{hideCardWrapper:!0,pageIcon:null,maxWidth:"4xl"},children:[{path:"",component:Ck}]}]},{path:"",component:xB,canActivate:[(0,Sg.i)(),TA.W_],children:[{path:"vault",canActivate:[()=>$p(void 0,void 0,void 0,function*(){const e=(0,E.WQX)(F.Ix),t=(0,E.WQX)(Y.D),i=(0,E.WQX)(se.a),n=(0,E.WQX)(Vs.K);try{const n=yield(0,u._)(t.activeAccount$);if(!n)return e.createUrlTree(["/login"]);return!(yield i.getPremiumInterest(n.id))||e.createUrlTree(["/settings/subscription/premium"],{queryParams:{callToAction:"upgradeToPremium"}})}catch(r){return n.error("Error in premiumInterestRedirectGuard",r),!0}}),()=>JQ(void 0,void 0,void 0,function*(){const e=(0,E.WQX)(F.Ix),t=(0,E.WQX)(Y.D),i=(0,E.WQX)($Q.r),n=(0,E.WQX)(I.v2);if(at.A.isMobileBrowser)return!0;const r=yield(0,u._)(t.activeAccount$);if(!r)return e.createUrlTree(["/login"]);const s=yield(0,u._)(n.getUser(r.id,ZQ).state$.pipe((0,p.T)(e=>null!=e&&e))),o=yield function(e,t){return JQ(this,void 0,void 0,function*(){return function(e){if(!e)return!1;const t=new Date(e).getTime(),i=(new Date).getTime()-t,n=864e5;return Math.round(i/n)>30}(yield e.getProfileCreationDate(t))})}(i,r.id).catch(()=>!0);return!(!s&&!o)||e.createUrlTree(["/setup-extension"])})],loadChildren:()=>QF},{path:"sends",component:SQ,data:{titleId:"send"},canActivate:[SA((e,t,i)=>t.getFeatureFlag$(dr.TO.SendControls).pipe((0,rt.n)(t=>t?i.policiesByType$(mt.tt.SendControls,e).pipe((0,p.T)(e=>!(null==e?void 0:e.some(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.disableSend)})))):i.policyAppliesToUser$(mt.tt.DisableSend,e).pipe((0,p.T)(e=>!e)))))]},{path:"sm-landing",component:zS,data:{titleId:"moreProductsFromBitwarden"}},{path:"request-sm-access",component:US,data:{titleId:"requestAccessToSecretsManager"}},{path:"create-organization",component:bg,data:{titleId:"newOrganization"}},{path:"settings",children:[{path:"",pathMatch:"full",redirectTo:Bg.Account},{path:Bg.Account,component:Mv,data:{titleId:"myAccount"}},{path:"appearance",component:qS,data:{titleId:"appearance"}},{path:"security",loadChildren:()=>hC},{path:"data-recovery",component:dI,data:{titleId:"dataRecovery"}},{path:"domain-rules",component:oQ,data:{titleId:"domainRules"}},{path:"subscription",loadChildren:()=>Promise.all([i.e(281),i.e(764)]).then(i.bind(i,75764)).then(e=>e.IndividualBillingModule)},{path:Bg.EmergencyAccess,children:[{path:"",component:Jf,canActivate:[SA(f.KP)],data:{titleId:"emergencyAccess"}},{path:":id",component:dm,canActivate:[SA(f.KP)],data:{titleId:"emergencyAccess"}}]},{path:"sponsored-families",component:MC,data:{titleId:"sponsoredFamilies"}}]},{path:"tools",canActivate:[TA.W_],children:[{path:"",pathMatch:"full",redirectTo:"generator"},{path:"import",loadComponent:()=>i.e(782).then(i.bind(i,74782)).then(e=>e.ImportWebComponent),data:{titleId:"importNoun"}},{path:"export",loadComponent:()=>Promise.all([i.e(573),i.e(677)]).then(i.bind(i,47677)).then(e=>e.ExportWebComponent),data:{titleId:"exportNoun"}},{path:"generator",component:lQ,data:{titleId:"generator"}}]},{path:"reports",loadChildren:()=>Nw.AX},{path:"setup/families-for-enterprise",component:mg}]},{path:"organizations",loadChildren:()=>i.e(155).then(i.bind(i,47155)).then(e=>e.OrganizationModule)}];class TF{}TF.ɵfac=function(e){return new(e||TF)},TF.ɵmod=B.$C({type:TF}),TF.ɵinj=E.G2t({imports:[BA.iI.forRoot(kF,{useHash:!0,paramsInheritanceStrategy:"always"}),BA.iI]});class FF{}FF.ɵfac=function(e){return new(e||FF)},FF.ɵmod=B.$C({type:FF}),FF.ɵinj=E.G2t({imports:[BA.iI.forChild([{path:"**",redirectTo:""}]),BA.iI]});class PF{}PF.ɵfac=function(e){return new(e||PF)},PF.ɵmod=B.$C({type:PF,bootstrap:[te]}),PF.ɵinj=E.G2t({imports:[RS,l.wb,a.YN,bA,s.ad,o.RH,TF,FF]}),(0,r.SmG)(),n.sG().bootstrapModule(PF)},89591(e,t,i){"use strict";i.d(t,{q:()=>N});var n=i(88565),r=i(72245),s=i(78781),o=i(31442),a=i(51757),l=i(94735),c=i(3633),d=i(37579),u=i(29029),h=i(81573),A=i(26411),p=i(22191),g=i(33812),v=i(17898),f=i(37115),m=i(50700),y=i(66316),C=i(69855),w=i(35500),I=i(49519),b=i(26657),B=i(38620),E=i(56898),S=i(7730),Q=i(68016),k=i(67311),T=i(86226),F=i(97553),P=i(43759),R=i(76356),D=i(69896),M=i(36288),x=i(25740),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class G{constructor(e,t,i,n,s,o,l){this.masterPasswordUnlockService=e,this.platformUtilsService=t,this.i18nService=i,this.formBuilder=n,this.dialogRef=s,this.toastService=o,this.accountService=l,this.formGroup=this.formBuilder.group({masterPassword:["",{validators:[a.k0.required],updateOn:"submit"}]}),this.submit=()=>O(this,void 0,void 0,function*(){if(!this.formGroup.value.masterPassword)return;const e=yield(0,r._)((0,c.F6)(this.accountService.activeAccount$));if(null==e)throw new Error("An active user is expected while doing password reprompt.");(yield this.masterPasswordUnlockService.proofOfDecryption(this.formGroup.value.masterPassword,e))?this.dialogRef.close(!0):this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})})}}G.ɵfac=function(e){return new(e||G)(g.rXU(v.b),g.rXU(f.y),g.rXU(m.W),g.rXU(a.ok),g.rXU(y.ce),g.rXU(C.f),g.rXU(w.D))},G.ɵcmp=g.VBU({type:G,selectors:[["vault-password-reprompt"]],decls:22,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&&(g.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),g.EFF(3),g.nI1(4,"i18n"),g.k0s(),g.qex(5,2),g.EFF(6),g.nI1(7,"i18n"),g.j41(8,"bit-form-field",3)(9,"bit-label"),g.EFF(10),g.nI1(11,"i18n"),g.k0s(),g.nrm(12,"input",4)(13,"button",5),g.k0s(),g.bVm(),g.qex(14,6),g.j41(15,"button",7)(16,"span"),g.EFF(17),g.nI1(18,"i18n"),g.k0s()(),g.j41(19,"button",8),g.EFF(20),g.nI1(21,"i18n"),g.k0s(),g.bVm(),g.k0s()()),2&e&&(g.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),g.R7$(3),g.SpI(" ",g.bMT(4,7,"passwordConfirmation")," "),g.R7$(3),g.SpI(" ",g.bMT(7,9,"passwordConfirmationDesc")," "),g.R7$(4),g.JRh(g.bMT(11,11,"masterPass")),g.R7$(7),g.JRh(g.bMT(18,13,"ok")),g.R7$(3),g.SpI(" ",g.bMT(21,15,"cancel")," "))},dependencies:[l.p,I.B,d.C,b.$,B.L,u.t,E.Q,h.P,S.I,Q.m,k.hJ,A.L,T.j,F.J,P.h,R.e,D.a,p.Q,M.s,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,x.$],encapsulation:2});var U=i(74208),V=i(62166),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class N{constructor(e,t){this.dialogService=e,this.userVerificationService=t,this.enabled$=s.A.asyncToObservable(()=>this.userVerificationService.hasMasterPasswordAndMasterKeyHash())}protectedFields(){return["TOTP","Password","H_Field","Card Number","Security Code"]}passwordRepromptCheck(e){return j(this,void 0,void 0,function*(){return e.reprompt===o.b1.None||(yield this.showPasswordPrompt())})}showPasswordPrompt(){return j(this,void 0,void 0,function*(){if(!(yield this.enabled()))return!0;const e=this.dialogService.open(G,{ariaModal:!0});return!0===(yield(0,n.s)(e.closed))})}enabled(){return(0,r._)(this.enabled$)}}N.ɵfac=function(e){return new(e||N)(U.KVO(y.o3),U.KVO(V.i))},N.ɵprov=U.jDH({token:N,factory:N.ɵfac})},89812(e,t,i){"use strict";i.d(t,{b:()=>b});var n=i(39180),r=i(94573),s=i(33812),o=i(51757),a=i(97658),l=i(36801),c=i(74208),d=i(67519),u=i(90143),h=i(26193);class A{constructor(){this.baseChip=(0,c.WQX)(d.rg,{host:!0}),this.label=(0,r.hFB)(""),this.startIcon=(0,r.hFB)(),this.dismissed=(0,r.CGW)(),this.baseChip.hasTrailingIcon.set(!0)}handleDismiss(e){e.stopPropagation(),this.baseChip.disabled()||this.dismissed.emit()}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=s.VBU({type:A,selectors:[["bit-chip"]],inputs:{label:[1,"label"],startIcon:[1,"startIcon"]},outputs:{dismissed:"dismissed"},features:[s.nM4([{directive:d.rg,inputs:["size","size","disabled","disabled"]}])],decls:4,vars:9,consts:[[3,"startIcon","size"],["bit-chip-dismiss-button","","slot","end","type","button",3,"click","disabled","size"]],template:function(e,t){1&e&&(s.j41(0,"bit-chip-content",0),s.EFF(1),s.j41(2,"button",1),s.nI1(3,"i18n"),s.bIt("click",function(e){return t.handleDismiss(e)}),s.k0s()()),2&e&&(s.Y8G("startIcon",t.startIcon())("size",t.baseChip.size()),s.R7$(),s.SpI(" ",t.label()," "),s.R7$(),s.Y8G("disabled",t.baseChip.disabled())("size",t.baseChip.size()),s.BMQ("aria-label",s.i5U(3,6,"removeItem",t.label())))},dependencies:[u.l,h.i,l.$Z],encapsulation:2,changeDetection:0});var p=i(22949),g=i(83632),v=i(50700);function f(e,t){1&e&&s.nrm(0,"bit-spinner",4)}function m(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-chip",5),s.bIt("dismissed",function(){const t=c.eBV(e),i=t.item,n=t.clear;return c.Njj(n(i))}),s.k0s()}if(2&e){const e=t.item,i=s.XpG();s.Y8G("label",e.labelName)("startIcon",e.icon)("disabled",i.disabled)}}function y(e,t){1&e&&s.nrm(0,"i",8)}function C(e,t){if(1&e&&s.nrm(0,"i",12),2&e){const e=s.XpG().item;s.HbH(s.VkB("bwi bwi-fw ",e.icon))}}function w(e,t){if(1&e&&(s.j41(0,"div",6)(1,"div",7),s.nVh(2,y,1,0,"i",8),s.k0s(),s.j41(3,"div",9),s.nVh(4,C,1,3,"i",10),s.k0s(),s.j41(5,"div",11),s.EFF(6),s.k0s()()),2&e){const e=t.item,i=s.XpG();s.R7$(2),s.vxM(i.isSelected(e)?2:-1),s.R7$(2),s.vxM(null!=e.icon?4:-1),s.R7$(2),s.SpI(" ",e.listName," ")}}let I=0;class b{constructor(e,t){this.i18nService=e,this.ngControl=t,this.select=r.ebz.required(a.vr),this.baseItems=r.geq.required(),this.removeSelectedItems=(0,r.hFB)(!1),this.placeholder=(0,r.geq)(),this.loading=(0,r.hFB)(!1),this.selectedItems=null,this.searchInputId="search-input-"+I++,this.onItemsConfirmed=new s.bkB,this.keyDown=e=>{const t=this.select();return!(!t.isOpen()&&"Enter"===e.key&&!(0,n.rp)(e))&&(!(t.isOpen()&&"Escape"===e.key&&!(0,n.rp)(e))||(this.selectedItems=[],t.close(),e.stopPropagation(),!1))},this.id=(0,r.hFB)("bit-multi-select-"+I++),null!=t&&(t.valueAccessor=this)}ngOnInit(){this.placeholder.update(e=>null!=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.set(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",null!=e?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.k0.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=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}b.ɵfac=function(e){return new(e||b)(s.rXU(v.W),s.rXU(o.vO,10))},b.ɵcmp=s.VBU({type:b,selectors:[["bit-multi-select"]],viewQuery:function(e,t){1&e&&s.wEZ(t.select,a.vr,5),2&e&&s.NyB()},hostVars:3,hostBindings:function(e,t){2&e&&(s.Avn("id",t.id()),s.BMQ("aria-describedby",t.ariaDescribedBy)("required",t.required))},inputs:{baseItems:[1,"baseItems"],removeSelectedItems:[1,"removeSelectedItems"],placeholder:[1,"placeholder"],loading:[1,"loading"],disabled:[2,"disabled","disabled",r.L39],id:[1,"id"],required:"required"},outputs:{baseItems:"baseItemsChange",placeholder:"placeholderChange",onItemsConfirmed:"onItemsConfirmed"},features:[s.Jv_([{provide:p.p,useExisting:b}])],decls:6,vars:19,consts:[["bindLabel","listName","groupBy","parentGrouping","appendTo","body",3,"ngModelChange","blur","close","items","ngModel","placeholder","loading","loadingText","notFoundText","clearAllText","multiple","closeOnSelect","disabled","clearSearchOnAdd","labelForId","keyDownFn"],["ng-loadingspinner-tmp",""],["ng-label-tmp",""],["ng-option-tmp",""],["size","small"],["size","small",1,"tw-me-1",3,"dismissed","label","startIcon","disabled"],[1,"tw-flex"],[1,"tw-w-7","tw-flex-none"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check"],[1,"tw-me-2","tw-flex-initial"],["aria-hidden","true",3,"class"],[1,"tw-flex-1"],["aria-hidden","true"]],template:function(e,t){1&e&&(s.j41(0,"ng-select",0),s.nI1(1,"i18n"),s.nI1(2,"i18n"),s.mxI("ngModelChange",function(e){return s.DH7(t.selectedItems,e)||(t.selectedItems=e),e}),s.bIt("ngModelChange",function(e){return t.onChange(e)})("blur",function(){return t.onBlur()})("close",function(){return t.onDropdownClosed()}),s.DNE(3,f,1,0,"ng-template",1)(4,m,1,3,"ng-template",2)(5,w,7,3,"ng-template",3),s.k0s()),2&e&&(s.Y8G("notFoundText",s.mNQ(s.bMT(1,15,"multiSelectNotFound")))("clearAllText",s.mNQ(s.bMT(2,17,"multiSelectClearAll")))("items",t.baseItems()),s.R50("ngModel",t.selectedItems),s.Y8G("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:[a.MQ,a.vr,a.Uq,a.ZZ,a.QQ,o.X1,o.BC,o.YN,o.vS,A,g.t,l.$Z],encapsulation:2})},90005(e,t,i){"use strict";i.d(t,{f:()=>n});const n=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4.72 12.85 92 80">
    <path class="tw-fill-illustration-bg-primary" d="M16.722 18.846a6 6 0 0 1 6-6h68a6 6 0 0 1 6 6v48a6 6 0 0 1-6 6h-68a6 6 0 0 1-6-6v-48Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M90.722 14.846h-68a4 4 0 0 0-4 4v48a4 4 0 0 0 4 4h68a4 4 0 0 0 4-4v-48a4 4 0 0 0-4-4Zm-68-2a6 6 0 0 0-6 6v48a6 6 0 0 0 6 6h68a6 6 0 0 0 6-6v-48a6 6 0 0 0-6-6h-68Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M54.732 34.216c1.353-2.327 4.713-2.327 6.066 0L72.24 53.898c1.36 2.34-.327 5.272-3.033 5.272H46.321c-2.705 0-4.392-2.933-3.032-5.272l11.443-19.682Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70.512 54.904 59.07 35.22c-.582-1-2.026-1-2.608 0L45.018 54.904a1.508 1.508 0 0 0 1.303 2.266h22.887a1.508 1.508 0 0 0 1.304-2.266Zm-9.714-20.688c-1.353-2.327-4.713-2.327-6.066 0L43.288 53.898c-1.36 2.34.328 5.272 3.033 5.272h22.887c2.706 0 4.393-2.933 3.033-5.272L60.798 34.216Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M59.168 53.557a1.403 1.403 0 1 1-2.806 0 1.403 1.403 0 0 1 2.806 0ZM55.702 41.315a.35.35 0 0 1 .348-.388h3.43a.35.35 0 0 1 .348.388l-.977 9.121a.35.35 0 0 1-.349.314h-1.474a.35.35 0 0 1-.35-.314l-.976-9.121Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M95.722 24.846h-78v-2h78v2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M92.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM86.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM80.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM9.722 31.846a2 2 0 0 1 2-2h15a2 2 0 0 1 2 2v15h-19v-15Z"/>
    <path class="tw-fill-illustration-tertiary" d="M12.722 32.846h3v11h-3v-11ZM17.722 34.846h3v9h-3v-9ZM22.722 32.846h3v11h-3v-11Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M8.722 44.846a4 4 0 0 0-4 4v40a4 4 0 0 0 4 4h21a4 4 0 0 0 4-4v-40a4 4 0 0 0-4-4h-21Zm10.5 36a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.722 46.846a2 2 0 0 0-2 2v40a2 2 0 0 0 2 2h21a2 2 0 0 0 2-2v-40a2 2 0 0 0-2-2h-21Zm10.5 32a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm-14.5-30a4 4 0 0 1 4-4h21a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4h-21a4 4 0 0 1-4-4v-40Zm17 34.5a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M19.222 72.846a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Zm0 2a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19Z" clip-rule="evenodd"/>
  </svg>
`},90097(e,t,i){"use strict";i.d(t,{H:()=>o});var n=i(91326),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.K]})},90107(e,t,i){"use strict";i.d(t,{V$:()=>s,$b:()=>r,Kc:()=>n});class n{}var r;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(r||(r={}));class s{constructor(e,t=null){this.isDev=e,this.filter=t,this.timersMap=new Map}debug(e,...t){this.isDev&&this.write(r.Debug,e,...t)}info(e,...t){this.write(r.Info,e,...t)}warning(e,...t){this.write(r.Warning,e,...t)}error(e,...t){this.write(r.Error,e,...t)}write(e,t,...i){if(null==this.filter||!this.filter(e))switch(e){case r.Debug:case r.Info:console.log(t,...i);break;case r.Warning:console.warn(t,...i);break;case r.Error:console.error(t,...i)}}measure(e,t,i,n,r){const s=`[${i}]: ${n}`,o=performance.measure(s,{start:e,detail:{devtools:{dataType:"track-entry",track:i,trackGroup:t,properties:r}}});return this.info(`${s} took ${o.duration}`,r),o}mark(e){const t=performance.mark(e,{detail:{devtools:{dataType:"marker"}}});return this.info(t.name,(new Date).toISOString()),t}}},90118(e,t,i){"use strict";i.d(t,{px:()=>Or,np:()=>xr,u8:()=>so,Gc:()=>wr,NY:()=>Gn,_A:()=>Un,e3:()=>Vi,zu:()=>Nn.z,hI:()=>Hn,vv:()=>Vn.v,Wg:()=>or,QZ:()=>qn,k:()=>on,f$:()=>yr,nR:()=>E,Mr:()=>G,Tp:()=>Qr,bj:()=>eo,Ws:()=>_n,cM:()=>Gs,_8:()=>qs,eG:()=>ws,Pq:()=>Ps.P,yk:()=>Er,qX:()=>u.q,tW:()=>Bs,l:()=>lo,aC:()=>Io,BR:()=>wo,Vi:()=>Us.V,$5:()=>ro,ug:()=>mo,cD:()=>uo,DL:()=>Vs,Jp:()=>co,IN:()=>Tr});var n=i(33338),r=i(3204),s=i(31857),o=i(69650),a=i(74208),l=i(5556);const c=new s.Ok(s.gc,"atRiskPasswords",{deserializer:e=>e,clearOn:["lock","logout"]});class d{constructor(e,t,i){this.taskService=e,this.cipherService=t,this.stateProvider=i}pendingTasks$(e){return(0,n.z)([this.taskService.pendingTasks$(e),this.cipherService.cipherViews$(e)]).pipe((0,r.T)(([e,t])=>e.filter(e=>{const i=t.find(t=>t.id===e.cipherId);return e.type===o.Wn.UpdateAtRiskCredential&&i&&i.edit&&i.viewPassword&&!i.isDeleted})))}completedTasks$(e){return this.taskService.completedTasks$(e).pipe((0,r.T)(e=>e.find(e=>e.type===o.Wn.UpdateAtRiskCredential)))}showCompletedTasksBanner$(e){return(0,n.z)([this.pendingTasks$(e),this.completedTasks$(e),this.atRiskPasswordState(e).state$]).pipe((0,r.T)(([e,t,i])=>{var n,r,s;const o=e.length>0,a=null!==(n=null==i?void 0:i.tasksBannerDismissed)&&void 0!==n&&n,l=null!==(r=null==i?void 0:i.hasInteractedWithTasks)&&void 0!==r&&r;return!!(o||l&&!a)&&!(!t||o||null!==(s=null==i?void 0:i.tasksBannerDismissed)&&void 0!==s&&s)}))}atRiskPasswordState(e){return this.stateProvider.getUser(e,c)}updateAtRiskPasswordState(e,t){this.atRiskPasswordState(e).update(()=>t)}}d.ɵfac=function(e){return new(e||d)(a.KVO(o.RB),a.KVO(l.p),a.KVO(s.v2))},d.ɵprov=a.jDH({token:d,factory:d.ɵfac});var u=i(89591),h=i(72245),A=i(54931),p=i(66523),g=i(31442),v=i(61325),f=i(37115),m=i(69855),y=i(63098),C=i(50700),w=i(58329),I=i(35500),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const B={username:{typeI18nKey:"username",protected:!1},password:{typeI18nKey:"password",protected:!0,event:A.Bx.Cipher_ClientCopiedPassword},totp:{typeI18nKey:"verificationCodeTotp",protected:!0},cardNumber:{typeI18nKey:"number",protected:!0},securityCode:{typeI18nKey:"securityCode",protected:!0,event:A.Bx.Cipher_ClientCopiedCardCode},email:{typeI18nKey:"email",protected:!0},phone:{typeI18nKey:"phone",protected:!0},address:{typeI18nKey:"address",protected:!0},secureNote:{typeI18nKey:"note",protected:!0},privateKey:{typeI18nKey:"sshPrivateKey",protected:!0},publicKey:{typeI18nKey:"sshPublicKey",protected:!0},keyFingerprint:{typeI18nKey:"sshFingerprint",protected:!0},hiddenField:{typeI18nKey:"value",protected:!0,event:A.Bx.Cipher_ClientCopiedHiddenField}};class E{constructor(e,t,i,n,r,s,o,a){this.platformUtilsService=e,this.toastService=t,this.eventCollectionService=i,this.passwordRepromptService=n,this.totpService=r,this.i18nService=s,this.billingAccountProfileStateService=o,this.accountService=a}copy(e,t,i){return b(this,arguments,void 0,function*(e,t,i,n=!1){const r=B[t];if(!n&&i.reprompt!==g.b1.None&&r.protected&&!(yield this.passwordRepromptService.showPasswordPrompt()))return!1;if(null==e)return!1;if("totp"===t){if(!(yield this.totpAllowed(i)))return!1;const t=yield(0,h._)(this.totpService.getCode$(e));if(!(null==t?void 0:t.code))return!1;e=t.code}return this.platformUtilsService.copyToClipboard(e),this.toastService.showToast({variant:"success",message:this.i18nService.t("valueCopied",this.i18nService.t(r.typeI18nKey)),title:""}),void 0!==r.event&&(yield this.eventCollectionService.collect(r.event,i.id?(0,p.zw)(i.id):void 0,!1,i.organizationId?(0,p.zw)(i.organizationId):void 0)),!0})}totpAllowed(e){return b(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$);if(!(null==t?void 0:t.id))return!1;const i=v.n.getLogin(e);return!!(null==i?void 0:i.totp)&&(e.organizationUseTotp||(yield(0,h._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id))))})}}E.ɵfac=function(e){return new(e||E)(a.KVO(f.y),a.KVO(m.f),a.KVO(A.c_),a.KVO(u.q),a.KVO(y.R),a.KVO(C.W),a.KVO(w.Q),a.KVO(I.D))},E.ɵprov=a.jDH({token:E,factory:E.ɵfac,providedIn:"root"});i(69592);var S=i(64447),Q=i(33812);class k{constructor(e,t){this.el=e,this.renderer=t,this.size="default",this.renderer.setAttribute(this.el.nativeElement,"aria-hidden","true")}get iconSize(){switch(this.size){case"small":return"bwi-sm";case"large":return"bwi-lg";default:return""}}get orgIcon(){switch(this.tierType){case S.K_.Free:case S.K_.Families:return"bwi-family";case S.K_.Teams:case S.K_.Enterprise:case S.K_.TeamsStarter:return"bwi-business";default:return""}}get classList(){return["bwi",this.iconSize,this.orgIcon]}}k.ɵfac=function(e){return new(e||k)(Q.rXU(Q.aKT),Q.rXU(Q.sFG))},k.ɵdir=Q.FsC({type:k,selectors:[["","appOrgIcon",""]],hostVars:2,hostBindings:function(e,t){2&e&&Q.HbH(t.classList)},inputs:{tierType:"tierType",size:"size"}});var T=i(14803),F=i(66046),P=i(11979);class R{set cipher(e){this.viewContainer.clear(),this.cipherAuthorizationService.canDeleteCipher$(e).pipe((0,T.Q)(this.destroy$)).subscribe(e=>{e?this.viewContainer.createEmbeddedView(this.templateRef):this.viewContainer.clear()})}constructor(e,t,i){this.templateRef=e,this.viewContainer=t,this.cipherAuthorizationService=i,this.destroy$=new F.B}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}R.ɵfac=function(e){return new(e||R)(Q.rXU(Q.C4Q),Q.rXU(Q.c1b),Q.rXU(P.y))},R.ɵdir=Q.FsC({type:R,selectors:[["","appCanDeleteCipher",""]],inputs:{cipher:[0,"appCanDeleteCipher","cipher"]}});var D=i(94573),M=i(83731),x=i(2073),O=i(83234);class G{constructor(){this.themeService=(0,a.WQX)(O.oO),this.systemTheme$=(0,a.WQX)(x.eL),this.el=(0,a.WQX)(Q.aKT),this.destroyRef=(0,a.WQX)(a.abz),this.darkImgSrc=D.hFB.required({alias:"appDarkImgSrc"})}ngOnInit(){this.lightImgSrc=this.el.nativeElement.getAttribute("src"),(0,n.z)([this.themeService.selectedTheme$,this.systemTheme$]).pipe((0,M.pQ)(this.destroyRef)).subscribe(([e,t])=>{const i="dark"===("system"===e?t:e);this.src=i?this.darkImgSrc():this.lightImgSrc})}}G.ɵfac=function(e){return new(e||G)},G.ɵdir=Q.FsC({type:G,selectors:[["","appDarkImgSrc",""]],hostVars:1,hostBindings:function(e,t){2&e&&Q.BMQ("src",t.src,Q.n$t)},inputs:{darkImgSrc:[1,"appDarkImgSrc","darkImgSrc"]}});i(55818);var U=i(77468),V=i(33277),j=i(44500),N=i(93695),z=i(75811),Y=i(84079),L=i(12610),K=i(23965),X=i(94735),q=i(67553),H=i(3633),W=i(39907),$=i(56962),J=i(15639),Z=i(97212),_=i(80351),ee=i(60893),te=i(57178),ie=i(75583),ne=i(14318),re=i(22191),se=i(89479),oe=i(58950),ae=i(26411),le=i(25024);class ce{constructor(){this.data=""}onDragStart(e){var t;null===(t=e.dataTransfer)||void 0===t||t.setData("text",this.data)}}ce.ɵfac=function(e){return new(e||ce)},ce.ɵdir=Q.FsC({type:ce,selectors:[["","appTextDrag",""]],hostAttrs:["draggable","true",1,"tw-cursor-move"],hostBindings:function(e,t){1&e&&Q.bIt("dragstart",function(e){return t.onDragStart(e)})},inputs:{data:[0,"appTextDrag","data"]}});var de=i(36288),ue=i(97553),he=i(58806),Ae=i(86226),pe=i(43759),ge=i(69896),ve=i(25740);class fe{constructor(){this.notes=""}}fe.ɵfac=function(e){return new(e||fe)},fe.ɵcmp=Q.VBU({type:fe,selectors:[["app-additional-options"]],inputs:{notes:"notes"},decls:15,vars:15,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[1,"[&_bit-form-field:last-of-type]:tw-mb-0"],["disableReadOnlyBorder",""],[3,"appTextDrag"],["readonly","","id","notes","bitInput","","rows","5","aria-readonly","true"],["bitSuffix","","bitIconButton","bwi-clone","size","small","type","button","showToast","",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"bit-card",2)(6,"bit-form-field",3)(7,"bit-label",4),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.j41(10,"textarea",5),Q.EFF(11),Q.k0s(),Q.nrm(12,"button",6),Q.nI1(13,"i18n"),Q.nI1(14,"i18n"),Q.k0s()()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,7,"additionalOptions")),Q.R7$(4),Q.Y8G("appTextDrag",t.notes),Q.R7$(),Q.JRh(Q.bMT(9,9,"note")),Q.R7$(3),Q.JRh(t.notes),Q.R7$(),Q.Y8G("appCopyClick",t.notes)("valueLabel",Q.bMT(13,11,"note"))("label",Q.bMT(14,13,"copyNotes")))},dependencies:[U.MD,X.p,le.D,ce,ne.i,re.Q,de.s,se.x,ue.J,oe.U,ie.E,he.r,ae.L,Ae.j,pe.h,ge.a,ve.$],encapsulation:2});var me=i(81714),ye=(i(75751),i(98403)),Ce=i(8916),we=i(7861),Ie=i(37579),be=i(12012),Be=i(53127),Ee=i(3892),Se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Qe(e,t){if(1&e&&(Q.nrm(0,"button",0),Q.nI1(1,"i18n")),2&e){const e=Q.XpG();Q.Y8G("bitAction",e.download)("label",Q.bMT(1,2,"downloadAttachmentLabel"))}}class ke{constructor(e,t,i,n,r,s){this.i18nService=e,this.apiService=t,this.fileDownloadService=i,this.toastService=n,this.stateProvider=r,this.cipherService=s,this.attachment=D.hFB.required(),this.cipher=D.hFB.required(),this.checkPwReprompt=(0,D.hFB)(!1),this.emergencyAccessId=(0,D.hFB)(),this.admin=(0,D.hFB)(!1),this.isDecryptionFailure=(0,V.EW)(()=>this.attachment().hasDecryptionError),this.download=()=>Se(this,void 0,void 0,function*(){const e=this.attachment(),t=this.cipher();let i;if(!e.id)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});try{i=(this.admin()?yield this.apiService.getAttachmentDataAdmin(t.id,e.id):yield this.apiService.getAttachmentData(t.id,e.id,this.emergencyAccessId())).url}catch(r){if(!(r instanceof we._&&404===r.statusCode))throw r instanceof we._?new Error(r.getSingleMessage()):r;i=e.url}if(!i)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});const n=yield fetch(new Request(i,{cache:"no-store"}));if(200===n.status)try{const i=yield(0,h._)(this.stateProvider.activeUserId$);if(!i||!e.fileName)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});const r=yield this.cipherService.getDecryptedAttachmentBuffer(t.id,e,n,i,Boolean(this.emergencyAccessId()));this.fileDownloadService.download({fileName:e.fileName,blobData:r})}catch(s){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})})}}ke.ɵfac=function(e){return new(e||ke)(Q.rXU(C.W),Q.rXU(be.G),Q.rXU(Be.y),Q.rXU(m.f),Q.rXU(s.v2),Q.rXU(l.p))},ke.ɵcmp=Q.VBU({type:ke,selectors:[["app-download-attachment"]],inputs:{attachment:[1,"attachment"],cipher:[1,"cipher"],checkPwReprompt:[1,"checkPwReprompt"],emergencyAccessId:[1,"emergencyAccessId"],admin:[1,"admin"]},decls:1,vars:1,consts:[["bitIconButton","bwi-download","buttonType","primaryGhost","size","small","type","button",3,"bitAction","label"]],template:function(e,t){1&e&&Q.nVh(0,Qe,2,4,"button",0),2&e&&Q.vxM(t.isDecryptionFailure()?-1:0)},dependencies:[Ie.C,Ee.p,U.MD,X.p,re.Q,de.s,ve.$],encapsulation:2,changeDetection:0});var Te=i(75556),Fe=i(90300),Pe=i(4017),Re=i(91962);function De(e,t){if(1&e&&(Q.j41(0,"span",4),Q.EFF(1),Q.k0s()),2&e){const e=Q.XpG().$implicit;Q.R7$(),Q.JRh(e.sizeName)}}function Me(e,t){if(1&e&&(Q.j41(0,"bit-item")(1,"bit-item-content")(2,"span",3),Q.EFF(3),Q.k0s(),Q.nVh(4,De,2,1,"span",4),Q.k0s(),Q.qex(5,5),Q.j41(6,"bit-item-action",6),Q.nrm(7,"app-download-attachment",7),Q.k0s(),Q.bVm(),Q.k0s()),2&e){const e=t.$implicit,i=Q.XpG();Q.R7$(2),Q.Y8G("title",i.getAttachmentFileName(e)),Q.R7$(),Q.SpI(" ",i.getAttachmentFileName(e)," "),Q.R7$(),Q.vxM(e.hasDecryptionError?-1:4),Q.R7$(3),Q.Y8G("admin",i.admin)("cipher",i.cipher)("attachment",e)("checkPwReprompt",!0)("emergencyAccessId",i.emergencyAccessId)}}class xe{constructor(e,t,i,n,r){this.keyService=e,this.billingAccountProfileStateService=t,this.stateProvider=i,this.accountService=n,this.i18nService=r,this.admin=!1,this.subscribeToHasPremiumCheck(),this.subscribeToOrgKey()}subscribeToHasPremiumCheck(){this.accountService.activeAccount$.pipe((0,j.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)),(0,M.pQ)()).subscribe(e=>{this.canAccessPremium=e})}subscribeToOrgKey(){this.stateProvider.activeUserId$.pipe((0,j.n)(e=>null!=e?this.keyService.orgKeys$(e):me.t),(0,M.pQ)()).subscribe(e=>{e&&(this.orgKey=e[this.cipher.organizationId])})}getAttachmentFileName(e){var t;return e.hasDecryptionError?this.i18nService.t("errorCannotDecrypt"):null!==(t=e.fileName)&&void 0!==t?t:""}}xe.ɵfac=function(e){return new(e||xe)(Q.rXU(Ce.Lu),Q.rXU(w.Q),Q.rXU(s.v2),Q.rXU(I.D),Q.rXU(C.W))},xe.ɵcmp=Q.VBU({type:xe,selectors:[["app-attachments-v2-view"]],inputs:{cipher:"cipher",emergencyAccessId:"emergencyAccessId",admin:"admin"},decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngFor","ngForOf"],["data-testid","file-name",3,"title"],["slot","secondary","data-testid","file-size"],["slot","end"],[1,"tw-pr-4","[@media(min-width:650px)]:tw-pr-6"],[3,"admin","cipher","attachment","checkPwReprompt","emergencyAccessId"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"bit-item-group"),Q.DNE(6,Me,8,8,"bit-item",2),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,2,"attachments")),Q.R7$(3),Q.Y8G("ngForOf",t.cipher.attachments))},dependencies:[U.MD,U.Sq,X.p,ye.k,Te.J,Fe.g,Pe.D,Re._,re.Q,oe.U,ie.E,he.r,ke,ve.$],encapsulation:2});var Oe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ge(e,t){if(1&e){const e=Q.RV6();Q.qex(0),Q.j41(1,"bit-form-field",3)(2,"bit-label"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.nrm(5,"input",4),Q.j41(6,"button",5),Q.nI1(7,"i18n"),Q.bIt("click",function(){const t=a.eBV(e).$implicit,i=Q.XpG();return a.Njj(i.openWebsite(t.launchUri))}),Q.k0s(),Q.nrm(8,"button",6),Q.nI1(9,"i18n"),Q.nI1(10,"i18n"),Q.k0s(),Q.bVm()}if(2&e){const e=t.$implicit,i=t.last;Q.R7$(),Q.Y8G("disableMargin",i)("disableReadOnlyBorder",i),Q.R7$(2),Q.SpI(" ",Q.bMT(4,8,"website")," "),Q.R7$(2),Q.Y8G("value",e.hostOrUri),Q.R7$(),Q.Y8G("label",Q.bMT(7,10,"launch")+" "+e.hostOrUri),Q.R7$(2),Q.Y8G("appCopyClick",e.uri)("valueLabel",Q.bMT(9,12,"website"))("label",Q.bMT(10,14,"copyWebsite"))}}class Ue{constructor(e,t,i){this.platformUtilsService=e,this.cipherService=t,this.accountService=i}openWebsite(e){return Oe(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));yield this.cipherService.updateLastLaunchedDate(this.cipherId,t),this.platformUtilsService.launchUri(e)})}}Ue.ɵfac=function(e){return new(e||Ue)(Q.rXU(f.y),Q.rXU(l.p),Q.rXU(I.D))},Ue.ɵcmp=Q.VBU({type:Ue,selectors:[["app-autofill-options-view"]],inputs:{loginUris:"loginUris",cipherId:"cipherId"},decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngFor","ngForOf"],["data-testid","autofill-view-list",3,"disableMargin","disableReadOnlyBorder"],["readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-website",3,"value"],["bitIconButton","bwi-external-link","bitSuffix","","type","button","data-testid","launch-website",3,"click","label"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-website",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"bit-card"),Q.DNE(6,Ge,11,16,"ng-container",2),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,2,"autofillOptions")),Q.R7$(3),Q.Y8G("ngForOf",t.loginUris))},dependencies:[U.MD,U.Sq,X.p,le.D,ne.i,oe.U,ie.E,he.r,ae.L,Ae.j,ue.J,pe.h,ge.a,re.Q,de.s,ve.$],encapsulation:2});const Ve={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 je{transform(e,t){let i=Ve[t];null==i&&(i=Ve.Other);const n=e.length;let r=i.find(e=>e.cardLength==n);null==r&&(r=i[0]);const s=r.blocks,o=[];let a=0;return s.forEach(t=>{o.push(e.slice(a,a+t)),a+=t}),n>a&&o.push(e.slice(a)),o.join(" ")}}je.ɵfac=function(e){return new(e||je)},je.ɵpipe=Q.EJ8({name:"creditCardNumber",type:je,pure:!0});class Ne{ngAfterViewInit(){var e;(null===(e=this.formFields)||void 0===e?void 0:e.last)&&setTimeout(()=>{this.formFields&&(this.formFields.last.disableReadOnlyBorder=!0)})}}Ne.ɵfac=function(e){return new(e||Ne)},Ne.ɵcmp=Q.VBU({type:Ne,selectors:[["read-only-cipher-card"]],contentQueries:function(e,t,i){if(1&e&&Q.wni(i,pe.h,4),2&e){let e;Q.mGM(e=Q.lsd())&&(t.formFields=e)}},ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"[&_bit-form-field:last-of-type]:tw-mb-0"]],template:function(e,t){1&e&&(Q.NAR(),Q.j41(0,"bit-card",0),Q.SdG(1),Q.k0s())},dependencies:[ne.i],encapsulation:2});var ze=i(76356),Ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Le(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",3),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",4),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.card.cardholderName),Q.R7$(),Q.JRh(Q.bMT(3,3,"cardholderName")),Q.R7$(2),Q.Y8G("value",e.card.cardholderName)}}function Ke(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-form-field")(1,"bit-label",3),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",5),Q.nI1(5,"creditCardNumber"),Q.j41(6,"button",6),Q.bIt("toggledChange",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.logCardEvent(t,i.EventType.Cipher_ClientToggledCardNumberVisible))}),Q.k0s(),Q.nrm(7,"button",7),Q.nI1(8,"i18n"),Q.nI1(9,"i18n"),Q.k0s()}if(2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.card.number),Q.R7$(),Q.JRh(Q.bMT(3,7,"number")),Q.R7$(2),Q.Y8G("value",Q.i5U(5,9,e.card.number,e.cipher.card.brand)),Q.R7$(2),Q.Y8G("toggled",e.revealCardNumber),Q.R7$(),Q.Y8G("appCopyClick",e.card.number)("valueLabel",Q.bMT(8,12,"number"))("label",Q.bMT(9,14,"copyNumber"))}}function Xe(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",3),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",8),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.card.expiration),Q.R7$(),Q.JRh(Q.bMT(3,3,"expiration")),Q.R7$(2),Q.Y8G("value",e.card.expiration)}}function qe(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-form-field")(1,"bit-label",3),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",9),Q.j41(5,"button",10),Q.bIt("toggledChange",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.logCardEvent(t,i.EventType.Cipher_ClientToggledCardCodeVisible))}),Q.k0s(),Q.j41(6,"button",11),Q.nI1(7,"i18n"),Q.nI1(8,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.logCardEvent(!0,t.EventType.Cipher_ClientCopiedCardCode))}),Q.k0s()()}if(2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.card.code),Q.R7$(),Q.JRh(Q.bMT(3,7,"securityCode")),Q.R7$(2),Q.Y8G("value",e.card.code),Q.R7$(),Q.Y8G("toggled",e.revealCardCode),Q.R7$(),Q.Y8G("appCopyClick",e.card.code)("valueLabel",Q.bMT(7,9,"securityCode"))("label",Q.bMT(8,11,"copySecurityCode"))}}class He{constructor(e,t){this.i18nService=e,this.eventCollectionService=t,this.EventType=A.Bx,this.revealCardNumber=!1,this.revealCardCode=!1}get card(){return this.cipher.card}ngOnChanges(e){e.cipher&&(this.revealCardNumber=!1,this.revealCardCode=!1)}get setSectionTitle(){return this.card.brand&&"Other"!==this.card.brand?this.i18nService.t("cardBrandDetails",this.card.brand):this.i18nService.t("cardDetails")}logCardEvent(e,t){return Ye(this,void 0,void 0,function*(){t===A.Bx.Cipher_ClientToggledCardNumberVisible?this.revealCardNumber=e:t===A.Bx.Cipher_ClientToggledCardCodeVisible&&(this.revealCardCode=e),e&&(yield this.eventCollectionService.collect(t,this.cipher.id,!1,this.cipher.organizationId))})}}He.ɵfac=function(e){return new(e||He)(Q.rXU(C.W),Q.rXU(A.c_))},He.ɵcmp=Q.VBU({type:He,selectors:[["app-card-details-view"]],inputs:{cipher:"cipher"},features:[Q.OA$],decls:9,vars:5,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"appTextDrag"],["id","cardholderName","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","cardholder-name",3,"value"],["id","cardNumber","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","cardholder-number",1,"tw-font-mono",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-number",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-number",3,"appCopyClick","valueLabel","label"],["id","expiration","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","cardholder-expiration",3,"value"],["id","securityCode","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","cardholder-code",1,"tw-font-mono",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-code",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-code",3,"click","appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.k0s()(),Q.j41(4,"read-only-cipher-card"),Q.DNE(5,Le,5,5,"bit-form-field",2)(6,Ke,10,16,"bit-form-field",2)(7,Xe,5,5,"bit-form-field",2)(8,qe,9,13,"bit-form-field",2),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(t.setSectionTitle),Q.R7$(2),Q.Y8G("ngIf",t.card.cardholderName),Q.R7$(),Q.Y8G("ngIf",t.card.number),Q.R7$(),Q.Y8G("ngIf",t.card.expiration),Q.R7$(),Q.Y8G("ngIf",t.card.code))},dependencies:[U.MD,U.bT,X.p,le.D,ce,oe.U,ie.E,he.r,ae.L,Ae.j,ue.J,pe.h,ze.e,ge.a,re.Q,de.s,Ne,ve.$,je],encapsulation:2});var We=i(6528),$e=i(67036),Je=i(14093),Ze=i(47135),_e=i(98479),et=i(40287),tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class it{constructor(e,t){this.autosize=e,this.ngZone=t,this.autosize.enabled=!1}ngAfterViewInit(){return tt(this,void 0,void 0,function*(){yield(0,h._)(this.ngZone.onStable),this.autosize.enabled=!0})}}it.ɵfac=function(e){return new(e||it)(Q.rXU(et.xb,1),Q.rXU(Q.SKi))},it.ɵdir=Q.FsC({type:it,selectors:[["textarea","vaultAutosizeReadOnlyTextArea",""]],features:[Q.Jv_([et.EE]),Q.nM4([et.xb])]});var nt=i(93103),rt=i(90246),st=i(50352),ot=i(27520),at=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const lt=e=>({"tw-mb-4":e}),ct=()=>({"tw-mt-3":!0,"tw-mb-2":!0});function dt(e,t){if(1&e&&(Q.j41(0,"bit-form-field",7)(1,"bit-label",8),Q.EFF(2),Q.k0s(),Q.nrm(3,"textarea",9)(4,"button",10),Q.nI1(5,"i18n"),Q.k0s()),2&e){const e=Q.XpG(),t=e.$implicit,i=e.last;Q.Y8G("disableReadOnlyBorder",i),Q.R7$(),Q.Y8G("appTextDrag",t.value),Q.R7$(),Q.JRh(t.name),Q.R7$(),Q.Y8G("value",t.value),Q.R7$(),Q.Y8G("appCopyClick",t.value)("valueLabel",t.name)("label",Q.i5U(5,7,"copyCustomField",t.name))}}function ut(e,t){if(1&e&&Q.nrm(0,"input",16),2&e){const e=Q.XpG(2).$implicit;Q.Y8G("value",e.value)}}function ht(e,t){if(1&e&&Q.nrm(0,"textarea",17),2&e){const e=Q.XpG(2).$implicit;Q.Y8G("value",e.value)}}function At(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",18),Q.nI1(1,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2).index,i=Q.XpG();return a.Njj(i.toggleCharacterCount(t))}),Q.k0s()}if(2&e){const e=Q.XpG(2).index,t=Q.XpG();Q.Y8G("label",Q.bMT(1,2,t.showHiddenValueCountFields.includes(e)?"hideCharacterCount":"showCharacterCount")),Q.BMQ("aria-expanded",t.showHiddenValueCountFields.includes(e))}}function pt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",19),Q.bIt("toggledChange",function(t){a.eBV(e);const i=Q.XpG(2).index,n=Q.XpG();return a.Njj(n.toggleHiddenField(t,i))}),Q.k0s()}}function gt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",20),Q.nI1(1,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(3);return a.Njj(t.logCopyEvent())}),Q.k0s()}if(2&e){const e=Q.XpG(2).$implicit;Q.Y8G("appCopyClick",e.value)("valueLabel",e.name)("label",Q.i5U(1,3,"copyCustomField",e.name))}}function vt(e,t){if(1&e&&(Q.j41(0,"bit-form-field",7)(1,"bit-label",8),Q.EFF(2),Q.k0s(),Q.DNE(3,ut,1,1,"input",11)(4,ht,1,1,"textarea",12)(5,At,2,4,"button",13)(6,pt,1,0,"button",14)(7,gt,2,6,"button",15),Q.k0s()),2&e){const e=Q.XpG(),t=e.$implicit,i=e.last,n=e.index,r=Q.XpG();Q.Y8G("disableReadOnlyBorder",i),Q.R7$(),Q.Y8G("appTextDrag",t.value),Q.R7$(),Q.JRh(t.name),Q.R7$(),Q.Y8G("ngIf",!r.revealedHiddenFields.includes(n)),Q.R7$(),Q.Y8G("ngIf",r.revealedHiddenFields.includes(n)),Q.R7$(),Q.Y8G("ngIf",r.canViewPassword&&r.revealedHiddenFields.includes(n)),Q.R7$(),Q.Y8G("ngIf",r.canViewPassword),Q.R7$(),Q.Y8G("ngIf",r.canViewPassword)}}function ft(e,t){if(1&e&&(Q.j41(0,"div",21),Q.nrm(1,"bit-color-password",22),Q.k0s()),2&e){const e=Q.XpG().$implicit;Q.Y8G("ngClass",Q.lJ4(3,ct)),Q.R7$(),Q.Y8G("password",e.value)("showCount",!0)}}function mt(e,t){if(1&e&&(Q.j41(0,"bit-form-control"),Q.nrm(1,"input",23),Q.j41(2,"bit-label",8),Q.EFF(3),Q.k0s()()),2&e){const e=Q.XpG().$implicit;Q.R7$(),Q.Y8G("checked","true"===e.value),Q.R7$(),Q.Y8G("appTextDrag",e.value),Q.R7$(),Q.SpI(" ",e.name," ")}}function yt(e,t){if(1&e&&(Q.j41(0,"bit-form-field",7)(1,"bit-label"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",24),Q.k0s()),2&e){const e=Q.XpG(),t=e.$implicit,i=e.last,n=Q.XpG();Q.Y8G("disableReadOnlyBorder",i),Q.R7$(2),Q.Lme(" ",Q.bMT(3,4,"cfTypeLinked"),": ",t.name," "),Q.R7$(2),Q.Y8G("value",n.getLinkedType(t.linkedId))}}function Ct(e,t){if(1&e&&(Q.j41(0,"div",3),Q.DNE(1,dt,6,10,"bit-form-field",4)(2,vt,8,8,"bit-form-field",4)(3,ft,2,4,"div",5)(4,mt,4,3,"bit-form-control",6)(5,yt,5,6,"bit-form-field",4),Q.k0s()),2&e){const e=t.$implicit,i=t.last,n=t.index,r=Q.XpG();Q.Y8G("ngClass",Q.eq3(6,lt,!i)),Q.R7$(),Q.Y8G("ngIf",e.type===r.fieldType.Text),Q.R7$(),Q.Y8G("ngIf",e.type===r.fieldType.Hidden),Q.R7$(),Q.Y8G("ngIf",r.showHiddenValueCountFields.includes(n)&&r.revealedHiddenFields.includes(n)),Q.R7$(),Q.Y8G("ngIf",e.type===r.fieldType.Boolean),Q.R7$(),Q.Y8G("ngIf",e.type===r.fieldType.Linked)}}class wt{constructor(e,t){this.i18nService=e,this.eventCollectionService=t,this.fieldType=g.PU,this.revealedHiddenFields=[],this.showHiddenValueCountFields=[]}ngOnInit(){this.fieldOptions=this.getLinkedFieldsOptionsForCipher()}ngOnChanges(e){e.cipher&&(this.revealedHiddenFields=[],this.fieldOptions=this.getLinkedFieldsOptionsForCipher())}getLinkedType(e){var t;const i=null===(t=this.fieldOptions)||void 0===t?void 0:t.get(e);return i?this.i18nService.t(i.i18nKey):null}get canViewPassword(){return this.cipher.viewPassword}toggleCharacterCount(e){const t=this.showHiddenValueCountFields.indexOf(e);t>-1?this.showHiddenValueCountFields.splice(t,1):this.showHiddenValueCountFields.push(e)}toggleHiddenField(e,t){return at(this,void 0,void 0,function*(){e?this.revealedHiddenFields.push(t):this.revealedHiddenFields=this.revealedHiddenFields.filter(e=>e!==t),e&&(yield this.eventCollectionService.collect(A.Bx.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id,!1,this.cipher.organizationId))})}logCopyEvent(){return at(this,void 0,void 0,function*(){yield this.eventCollectionService.collect(A.Bx.Cipher_ClientCopiedHiddenField,this.cipher.id,!1,this.cipher.organizationId)})}getLinkedFieldsOptionsForCipher(){switch(this.cipher.type){case g.gC.Login:return Je.r.prototype.linkedFieldOptions;case g.gC.Card:return We.G.prototype.linkedFieldOptions;case g.gC.Identity:return $e.O.prototype.linkedFieldOptions;default:return}}}wt.ɵfac=function(e){return new(e||wt)(Q.rXU(C.W),Q.rXU(A.c_))},wt.ɵcmp=Q.VBU({type:wt,selectors:[["app-custom-fields-v2"]],inputs:{cipher:"cipher"},features:[Q.OA$],decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["class","tw-border-secondary-300 [&_bit-form-field:last-of-type]:tw-mb-0","data-testid","custom-field",3,"ngClass",4,"ngFor","ngForOf"],["data-testid","custom-field",1,"tw-border-secondary-300","[&_bit-form-field:last-of-type]:tw-mb-0",3,"ngClass"],[3,"disableReadOnlyBorder",4,"ngIf"],[3,"ngClass",4,"ngIf"],[4,"ngIf"],[3,"disableReadOnlyBorder"],[3,"appTextDrag"],["readonly","","bitInput","","aria-readonly","true","vaultAutosizeReadOnlyTextArea","",3,"value"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-custom-field",3,"appCopyClick","valueLabel","label"],["readonly","","bitInput","","type","password","aria-readonly","true","class","tw-font-mono",3,"value",4,"ngIf"],["readonly","","bitInput","","type","password","aria-readonly","true","class","tw-font-mono","vaultAutosizeReadOnlyTextArea","",3,"value",4,"ngIf"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-hidden-field-value-count","appStopClick","",3,"label","click",4,"ngIf"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"appCopyClick","valueLabel","label","click",4,"ngIf"],["readonly","","bitInput","","type","password","aria-readonly","true",1,"tw-font-mono",3,"value"],["readonly","","bitInput","","type","password","aria-readonly","true","vaultAutosizeReadOnlyTextArea","",1,"tw-font-mono",3,"value"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-hidden-field-value-count","appStopClick","",3,"click","label"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","",3,"toggledChange"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"click","appCopyClick","valueLabel","label"],[3,"ngClass"],[3,"password","showCount"],["bitCheckbox","","type","checkbox","aria-readonly","true","disabled","",3,"checked"],["readonly","","bitInput","","type","text","aria-readonly","true",3,"value"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"bit-card"),Q.DNE(6,Ct,6,8,"div",2),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,2,"customFields")),Q.R7$(3),Q.Y8G("ngForOf",t.cipher.fields))},dependencies:[U.MD,U.YU,U.Sq,U.bT,X.p,nt.Y,le.D,ce,ne.i,re.Q,de.s,ae.L,rt.f,Ae.j,ue.J,pe.h,ze.e,ge.a,se.x,oe.U,ie.E,he.r,Ze.q,st.P,_e.p,ot.S,it,ve.$],encapsulation:2});var It=i(31436),bt=i(2738),Bt=i(52237),Et=i(84488),St=i(78078),Qt=i(639),kt=i(26333),Tt=i(47696);const Ft=e=>({"tw-mb-2":e}),Pt=(e,t)=>t.id;function Rt(e,t){1&e&&(Q.j41(0,"span",5),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"archived")," "))}function Dt(e,t){if(1&e&&(Q.nrm(0,"i",9),Q.nI1(1,"i18n")),2&e){const e=Q.XpG(2);Q.Y8G("tierType",e.organization().productTierType)("size","large")("title",Q.bMT(1,3,"owner"))}}function Mt(e,t){if(1&e&&Q.nrm(0,"i",10),2&e){const e=Q.XpG().$implicit,t=Q.XpG();Q.Y8G("ngClass",t.getIconClass(e))("title",t.getItemTitle(e))}}function xt(e,t){if(1&e&&(Q.j41(0,"span",7),Q.nVh(1,Dt,2,5,"i",9)(2,Mt,1,2,"i",10),Q.j41(3,"span",11),Q.EFF(4),Q.k0s()()),2&e){const e=t.$implicit,i=t.$index,n=t.$count,r=Q.XpG();Q.Y8G("ngClass",Q.eq3(4,Ft,i===n-1&&r.hasSmallScreen())),Q.BMQ("aria-label",r.getAriaLabel(e)),Q.R7$(),Q.vxM(r.isOrgIcon(e)?1:2),Q.R7$(3),Q.SpI(" ",e.name," ")}}function Ot(e,t){1&e&&(Q.j41(0,"span",8),Q.nI1(1,"i18n"),Q.nrm(2,"i",12),Q.nI1(3,"i18n"),Q.j41(4,"span",11),Q.EFF(5),Q.nI1(6,"i18n"),Q.k0s()()),2&e&&(Q.BMQ("aria-label",Q.bMT(1,3,"noneFolder")),Q.R7$(2),Q.Y8G("title",Q.bMT(3,5,"folder")),Q.R7$(3),Q.SpI(" ",Q.bMT(6,7,"noneFolder")," "))}function Gt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",14),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.toggleShowMore())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"showMore")," "))}function Ut(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",14),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.toggleShowMore())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"showLess")," "))}function Vt(e,t){if(1&e&&Q.DNE(0,Gt,3,3,"button",13)(1,Ut,3,3,"button",13),2&e){const e=Q.XpG();Q.Y8G("ngIf",!e.showAllDetails()),Q.R7$(),Q.Y8G("ngIf",e.showAllDetails())}}class jt{constructor(e,t){this.i18nService=e,this.platformUtilsService=t,this.hideOwner=(0,D.hFB)(!1),this.cipher=D.hFB.required(),this.organization=(0,D.hFB)(),this.folder=(0,D.hFB)(),this.collections=(0,D.hFB)(),this.showAllDetails=(0,a.vPA)(!1),this.showOwnership=(0,V.EW)(()=>this.cipher().organizationId&&this.organization()&&!this.hideOwner()),this.hasSmallScreen=(0,M.ot)((0,It.R)(window,"resize").pipe((0,r.T)(()=>window.innerWidth),(0,L.Z)(window.innerWidth),(0,r.T)(e=>e<681))),this.allItems=(0,V.EW)(()=>{var e;let t=[];return this.showOwnership()&&this.organization()&&t.push(this.organization()),(null===(e=this.cipher().collectionIds)||void 0===e?void 0:e.length)>0&&this.collections()&&(t=[...t,...this.collections()]),this.cipher().folderId&&this.folder()&&t.push(this.folder()),t}),this.showItems=(0,V.EW)(()=>{var e;return this.hasSmallScreen()&&this.allItems().length>2&&!this.showAllDetails()&&(null===(e=this.cipher().collectionIds)||void 0===e?void 0:e.length)>1?this.allItems().slice(0,2):this.allItems()}),this.showArchiveBadge=(0,V.EW)(()=>this.cipher().isArchived&&this.platformUtilsService.getClientType()===bt.s.Desktop)}toggleShowMore(){this.showAllDetails.update(e=>!e)}getAriaLabel(e){return e instanceof Et.y?this.i18nService.t("owner")+e.name:e instanceof Bt.iY?this.i18nService.t("collection")+e.name:e instanceof St.u?this.i18nService.t("folder")+e.name:""}getIconClass(e){return e instanceof Bt.iY?e.type===Bt.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared":e instanceof St.u?"bwi-folder":""}getItemTitle(e){return e instanceof Bt.iY?this.i18nService.t("collection"):e instanceof St.u?this.i18nService.t("folder"):""}isOrgIcon(e){return e instanceof Et.y}}jt.ɵfac=function(e){return new(e||jt)(Q.rXU(C.W),Q.rXU(f.y))},jt.ɵcmp=Q.VBU({type:jt,selectors:[["app-item-details-v2"]],inputs:{hideOwner:[1,"hideOwner"],cipher:[1,"cipher"],organization:[1,"organization"],folder:[1,"folder"],collections:[1,"collections"]},ngContentSelectors:["*"],decls:15,vars:9,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],[1,"tw-flex","tw-place-items-center","tw-w-full",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-justify-center",2,"width","40px","height","40px"],[3,"cipher","coloredIcon"],["bitTypography","h4","data-testid","item-name",1,"tw-ml-2","tw-mt-2","tw-select-auto","tw-flex-1","tw-break-all","tw-line-clamp-2"],["bitBadge",""],[1,"tw-flex","tw-flex-col","tw-mt-2","md:tw-flex-row","md:tw-flex-wrap"],["bitTypography","body2","data-testid","item-details-list",1,"tw-flex","tw-items-center","tw-mt-2","tw-mr-4",3,"ngClass"],["bitTypography","body2",1,"tw-flex","tw-items-center","tw-mt-2","tw-mr-4"],["appOrgIcon","",3,"tierType","size","title"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass","title"],["aria-hidden","true",1,"tw-pl-1.5"],["aria-hidden","true",1,"bwi","bwi-folder","bwi-lg",3,"title"],["bitTypography","body2","type","button","bitLink","","linkType","primary","class","tw-mt-1.5",3,"click",4,"ngIf"],["bitTypography","body2","type","button","bitLink","","linkType","primary",1,"tw-mt-1.5",3,"click"]],template:function(e,t){1&e&&(Q.NAR(),Q.j41(0,"section",0)(1,"bit-card")(2,"div",1)(3,"div",2),Q.nrm(4,"app-vault-icon",3),Q.k0s(),Q.j41(5,"h2",4),Q.EFF(6),Q.k0s(),Q.nVh(7,Rt,3,3,"span",5),Q.k0s(),Q.qex(8),Q.j41(9,"div",6),Q.Z7z(10,xt,5,6,"span",7,Pt),Q.nVh(12,Ot,7,9,"span",8),Q.nVh(13,Vt,2,2),Q.k0s(),Q.bVm(),Q.SdG(14),Q.k0s()()),2&e&&(Q.R7$(2),Q.Y8G("ngClass",Q.eq3(7,Ft,t.allItems.length>0)),Q.R7$(2),Q.Y8G("cipher",t.cipher())("coloredIcon",!0),Q.R7$(2),Q.SpI(" ",t.cipher().name," "),Q.R7$(),Q.vxM(t.showArchiveBadge()?7:-1),Q.R7$(3),Q.Dyx(t.showItems()),Q.R7$(2),Q.vxM(0===t.allItems().length?12:-1),Q.R7$(),Q.vxM(t.hasSmallScreen()&&t.allItems().length>2&&t.cipher().collectionIds.length>1?13:-1))},dependencies:[U.MD,U.YU,U.bT,X.p,kt.R,ne.i,ie.E,he.r,k,ae.L,te.g,Qt.E,Tt.n,ve.$],encapsulation:2});var Nt=i(6056),zt=i(88832),Yt=i(26477),Lt=i(75421),Kt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xt=(e,t)=>({"tw-mb-1 ":e,"tw-mb-0":t}),qt=e=>({"tw-mb-3":e});function Ht(e,t){if(1&e&&(Q.j41(0,"p",4)(1,"span",3),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.EFF(4),Q.nI1(5,"date"),Q.k0s()),2&e){const e=Q.XpG();Q.Y8G("ngClass",Q.eq3(8,qt,e.cipher.hasPasswordHistory)),Q.R7$(2),Q.SpI("",Q.bMT(3,3,"datePasswordUpdated"),":"),Q.R7$(2),Q.SpI(" ",Q.i5U(5,5,e.cipher.passwordRevisionDisplayDate,"medium")," ")}}function Wt(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",7),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.viewPasswordHistory())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"passwordHistory")," "))}class $t{constructor(e){this.viewPasswordHistoryService=e}get isLogin(){return this.cipher.type===g.gC.Login}viewPasswordHistory(){return Kt(this,void 0,void 0,function*(){yield this.viewPasswordHistoryService.viewPasswordHistory(this.cipher)})}}$t.ɵfac=function(e){return new(e||$t)(Q.rXU(Lt.Q))},$t.ɵcmp=Q.VBU({type:$t,selectors:[["app-item-history-v2"]],inputs:{cipher:"cipher"},decls:20,vars:23,consts:[["disableMargin",""],["bitTypography","h6"],[1,"tw-mb-1","tw-text-xs","tw-text-muted","tw-select-all"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-text-muted","tw-select-all",3,"ngClass"],["class","tw-text-xs tw-text-muted tw-select-all",3,"ngClass",4,"ngIf"],["bitTypography","body2","bitLink","","type","button",3,"click",4,"ngIf"],["bitTypography","body2","bitLink","","type","button",3,"click"]],template:function(e,t){1&e&&(Q.j41(0,"bit-section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"bit-card")(6,"p",2)(7,"span",3),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.EFF(10),Q.nI1(11,"date"),Q.k0s(),Q.j41(12,"p",4)(13,"span",3),Q.EFF(14),Q.nI1(15,"i18n"),Q.k0s(),Q.EFF(16),Q.nI1(17,"date"),Q.k0s(),Q.DNE(18,Ht,6,10,"p",5)(19,Wt,3,3,"button",6),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,8,"itemHistory")),Q.R7$(5),Q.SpI("",Q.bMT(9,10,"lastEdited"),":"),Q.R7$(2),Q.SpI(" ",Q.i5U(11,12,t.cipher.revisionDate,"medium")," "),Q.R7$(2),Q.Y8G("ngClass",Q.l_i(20,Xt,t.cipher.hasPasswordHistory,!t.cipher.hasPasswordHistory)),Q.R7$(2),Q.SpI("",Q.bMT(15,15,"dateCreated"),":"),Q.R7$(2),Q.SpI(" ",Q.i5U(17,17,t.cipher.creationDate,"medium")," "),Q.R7$(2),Q.Y8G("ngIf",t.cipher.passwordRevisionDisplayDate),Q.R7$(),Q.Y8G("ngIf",t.cipher.hasPasswordHistory))},dependencies:[U.MD,U.YU,U.bT,X.p,Nt.iI,ne.i,zt.n,oe.U,ie.E,he.r,Yt.V,te.g,U.vh,ve.$],encapsulation:2});var Jt=i(30675),Zt=i(36359),_t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ei=(e,t)=>({"tw-text-main":e,"tw-text-danger":t}),ti=(e,t)=>({"tw-stroke-text-main":e,"tw-stroke-danger-600":t}),ii=e=>({"stroke-dashoffset.px":e});function ni(e,t){if(1&e&&(Q.qex(0),Q.j41(1,"div",1)(2,"span",2)(3,"span",3),Q.EFF(4),Q.k0s(),a.qSk(),Q.j41(5,"svg",4)(6,"g"),Q.nrm(7,"circle",5)(8,"circle",6),Q.k0s()()()(),Q.bVm()),2&e){const e=t.ngIf;Q.R7$(3),Q.Y8G("ngClass",Q.l_i(5,ei,!e.totpLow,e.totpLow)),Q.R7$(),Q.JRh(e.totpSec),Q.R7$(3),Q.Y8G("ngClass",Q.l_i(8,ti,!e.totpLow,e.totpLow))("ngStyle",Q.eq3(11,ii,e.totpDash)),Q.R7$(),Q.Y8G("ngClass",Q.l_i(13,ti,!e.totpLow,e.totpLow))}}class ri{constructor(e){this.totpService=e,this.sendCopyCode=new Q.bkB}ngOnInit(){return _t(this,void 0,void 0,function*(){this.setTotpInfo()})}ngOnChanges(e){e.cipher&&this.setTotpInfo()}setTotpInfo(){var e,t;this.totpInfo$=(null===(t=null===(e=this.cipher)||void 0===e?void 0:e.login)||void 0===t?void 0:t.totp)?this.totpService.getCode$(this.cipher.login.totp).pipe((0,r.T)(e=>{const t=Math.round((new Date).getTime()/1e3)%e.period;return{totpCode:e.code,totpCodeFormatted:this.formatTotpCode(e.code),totpSec:e.period-t,totpDash:+(Math.round(60/e.period*t+"e+2")+"e-2"),totpLow:e.period-t<=7}}),(0,Zt.M)(e=>{e.totpCode&&e.totpCode.length>4&&this.sendCopyCode.emit({totpCode:e.totpCode,totpCodeFormatted:e.totpCodeFormatted})})):void 0}formatTotpCode(e){if(e.length>4){const t=Math.floor(e.length/2);return e.substring(0,t)+" "+e.substring(t)}return e}}ri.ɵfac=function(e){return new(e||ri)(Q.rXU(y.R))},ri.ɵcmp=Q.VBU({type:ri,selectors:[["","bitTotpCountdown",""]],inputs:{cipher:"cipher"},outputs:{sendCopyCode:"sendCopyCode"},features:[Q.OA$],attrs:["bitTotpCountdown",""],decls:2,vars:3,consts:[[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"tw-relative","tw-flex","tw-justify-center","tw-items-center"],["bitTypography","helper",1,"tw-absolute",3,"ngClass"],["transform","rotate(-90)","viewBox","0 0 28 28",1,"tw-size-7"],["r","9.5","cy","14","cx","14","stroke-width","2","stroke-dasharray","60",1,"tw-fill-none",3,"ngClass","ngStyle"],["r","11","cy","14","cx","14","stroke-width","1","stroke-dasharray","71","stroke-dashoffset","0",1,"tw-fill-none",3,"ngClass"]],template:function(e,t){1&e&&(Q.DNE(0,ni,9,16,"ng-container",0),Q.nI1(1,"async")),2&e&&Q.Y8G("ngIf",Q.bMT(1,1,t.totpInfo$))},dependencies:[U.MD,U.YU,U.bT,U.B3,ie.E,he.r,U.Jj],encapsulation:2});var si=i(43090),oi=i(93199),ai=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const li=["passwordInput"],ci=e=>({"tw-hidden":e}),di=e=>({"tw-mt-3":e,"tw-mb-2":!0});function ui(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",5),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",6)(5,"button",7),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.cipher.login.username),Q.R7$(),Q.SpI(" ",Q.bMT(3,6,"username")," "),Q.R7$(2),Q.Y8G("value",e.cipher.login.username),Q.R7$(),Q.Y8G("appCopyClick",e.cipher.login.username)("valueLabel",Q.bMT(6,8,"username"))("label",Q.bMT(7,10,"copyUsername"))}}function hi(e,t){if(1&e&&(Q.j41(0,"span",15),Q.nrm(1,"bit-color-password",16),Q.k0s()),2&e){const e=Q.XpG(2);Q.BMQ("aria-label",e.cipher.login.password),Q.R7$(),Q.Y8G("password",e.cipher.login.password)}}function Ai(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",17),Q.nI1(1,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.togglePasswordCount())}),Q.k0s()}if(2&e){const e=Q.XpG(2);Q.Y8G("label",Q.bMT(1,2,e.showPasswordCount?"hideCharacterCount":"showCharacterCount")),Q.BMQ("aria-expanded",e.showPasswordCount)}}function pi(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",18),Q.bIt("toggledChange",function(t){a.eBV(e);const i=Q.XpG(2);return a.Njj(i.pwToggleValue(t))}),Q.k0s()}if(2&e){const e=Q.XpG(2);Q.Y8G("toggled",e.passwordRevealed)}}function gi(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",19),Q.nI1(1,"i18n"),Q.nI1(2,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.logCopyEvent())}),Q.k0s()}if(2&e){const e=Q.XpG(2);Q.Y8G("appCopyClick",e.cipher.login.password)("valueLabel",Q.bMT(1,3,"password"))("label",Q.bMT(2,5,"copyPassword"))}}function vi(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"a",23),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(3);return a.Njj(t.launchChangePasswordEvent())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}if(2&e){const e=Q.XpG(3);Q.Y8G("href",e.changePasswordLink(),Q.B4B),Q.R7$(),Q.SpI(" ",Q.bMT(2,2,"changeNow")," ")}}function fi(e,t){if(1&e&&(Q.j41(0,"bit-hint",14),Q.nrm(1,"i",20),Q.j41(2,"span",21),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.nVh(5,vi,3,4,"a",22),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(3),Q.JRh(Q.bMT(4,2,"atRiskPassword")),Q.R7$(2),Q.vxM(e.changePasswordLink()?5:-1)}}function mi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",8),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",9,0),Q.DNE(6,hi,2,2,"span",10)(7,Ai,2,4,"button",11)(8,pi,1,1,"button",12)(9,gi,3,7,"button",13),Q.nVh(10,fi,6,4,"bit-hint",14),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.cipher.login.password),Q.R7$(),Q.SpI(" ",Q.bMT(3,9,"password")," "),Q.R7$(2),Q.Y8G("ngClass",Q.eq3(11,ci,e.passwordRevealed))("value",e.cipher.login.password),Q.R7$(2),Q.Y8G("ngIf",e.passwordRevealed),Q.R7$(),Q.Y8G("ngIf",e.cipher.viewPassword&&e.passwordRevealed),Q.R7$(),Q.Y8G("ngIf",e.cipher.viewPassword),Q.R7$(),Q.Y8G("ngIf",e.cipher.viewPassword),Q.R7$(),Q.vxM(e.showChangePasswordLink?10:-1)}}function yi(e,t){if(1&e&&(Q.j41(0,"div",24),Q.nrm(1,"bit-color-password",25),Q.k0s()),2&e){const e=Q.XpG();Q.Y8G("ngClass",Q.eq3(3,di,!e.cipher.login.totp)),Q.R7$(),Q.Y8G("password",e.cipher.login.password)("showCount",!0)}}function Ci(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",5),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",26),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",e.fido2CredentialCreationDateValue),Q.R7$(),Q.SpI("",Q.bMT(3,3,"typePasskey")," "),Q.R7$(2),Q.Y8G("value",e.fido2CredentialCreationDateValue)}}function wi(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"div",32),Q.bIt("sendCopyCode",function(t){a.eBV(e);const i=Q.XpG(2);return a.Njj(i.setTotpCopyCode(t))}),Q.k0s()}if(2&e){const e=Q.XpG(2);Q.Y8G("cipher",e.cipher)}}function Ii(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",5)(2,"div",27),Q.EFF(3),Q.nI1(4,"i18n"),Q.nrm(5,"app-premium-badge",28),Q.k0s()(),Q.nrm(6,"input",29),Q.nI1(7,"async"),Q.DNE(8,wi,1,1,"div",30),Q.nI1(9,"async"),Q.nrm(10,"button",31),Q.nI1(11,"i18n"),Q.nI1(12,"i18n"),Q.nI1(13,"async"),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("appTextDrag",null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCode),Q.R7$(2),Q.SpI(" ",Q.bMT(4,10,"verificationCodeTotp")," "),Q.R7$(2),Q.Y8G("organizationId",e.cipher.organizationId),Q.R7$(),Q.Y8G("type",Q.bMT(7,12,e.isPremium$)?"text":"password")("value",(null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCodeFormatted)||"*** ***"),Q.R7$(2),Q.Y8G("ngIf",Q.bMT(9,14,e.isPremium$)),Q.R7$(2),Q.Y8G("appCopyClick",null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCode)("valueLabel",Q.bMT(11,16,"verificationCodeTotp"))("label",Q.bMT(12,18,"copyVerificationCode"))("disabled",!Q.bMT(13,20,e.isPremium$))}}class bi{constructor(e,t,i,n,r){this.billingAccountProfileStateService=e,this.i18nService=t,this.premiumUpgradeService=i,this.eventCollectionService=n,this.accountService=r,this.changePasswordLink=(0,D.hFB)(),this.handleChangePassword=new Q.bkB,this.isPremium$=this.accountService.activeAccount$.pipe((0,j.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id))),this.showPasswordCount=!1,this.passwordRevealed=!1,this.datePipe=(0,a.WQX)(U.vh)}get fido2CredentialCreationDateValue(){var e;return`${this.i18nService.t("dateCreated")} ${this.datePipe.transform(null===(e=this.cipher.login.fido2Credentials[0])||void 0===e?void 0:e.creationDate,"short")}`}ngOnChanges(e){var t;e.cipher&&((null===(t=this.passwordInput)||void 0===t?void 0:t.nativeElement)&&(this.passwordInput.nativeElement.type="password"),this.passwordRevealed=!1,this.showPasswordCount=!1)}pwToggleValue(e){return ai(this,void 0,void 0,function*(){this.passwordRevealed=e,e&&(yield this.eventCollectionService.collect(A.Bx.Cipher_ClientToggledPasswordVisible,this.cipher.id,!1,this.cipher.organizationId))})}togglePasswordCount(){this.showPasswordCount=!this.showPasswordCount}setTotpCopyCode(e){this.totpCodeCopyObj=e}logCopyEvent(){return ai(this,void 0,void 0,function*(){yield this.eventCollectionService.collect(A.Bx.Cipher_ClientCopiedPassword,this.cipher.id,!1,this.cipher.organizationId)})}launchChangePasswordEvent(){this.handleChangePassword.emit()}}bi.ɵfac=function(e){return new(e||bi)(Q.rXU(w.Q),Q.rXU(C.W),Q.rXU(si.l),Q.rXU(A.c_),Q.rXU(I.D))},bi.ɵcmp=Q.VBU({type:bi,selectors:[["app-login-credentials-view"]],viewQuery:function(e,t){if(1&e&&Q.GBs(li,5),2&e){let e;Q.mGM(e=Q.lsd())&&(t.passwordInput=e.first)}},inputs:{cipher:"cipher",activeUserId:"activeUserId",showChangePasswordLink:"showChangePasswordLink",changePasswordLink:[1,"changePasswordLink"]},outputs:{handleChangePassword:"handleChangePassword"},features:[Q.OA$],decls:11,vars:8,consts:[["passwordInput",""],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],[3,"appTextDrag"],["id","userName","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-username",3,"value"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-username",3,"appCopyClick","valueLabel","label"],["id","password-label",3,"appTextDrag"],["id","password","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","login-password",3,"ngClass","value"],["role","textbox","tabindex","0","data-testid","login-password-color","aria-readonly","true","aria-labelledby","password-label",4,"ngIf"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-password-count","appStopClick","",3,"label","click",4,"ngIf"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-password",3,"toggled","toggledChange",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-password",3,"appCopyClick","valueLabel","label","click",4,"ngIf"],[1,"tw-flex","tw-mb-3","tw-items-center"],["role","textbox","tabindex","0","data-testid","login-password-color","aria-readonly","true","aria-labelledby","password-label"],[1,"tw-font-mono",3,"password"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-password-count","appStopClick","",3,"click","label"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-password",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-password",3,"click","appCopyClick","valueLabel","label"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-text-warning"],[1,"tw-ml-2","tw-mr-1"],["bitLink","","appStopClick","",3,"href"],["bitLink","","appStopClick","",3,"click","href"],[3,"ngClass"],[3,"password","showCount"],["id","fido","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-passkey",3,"value"],[1,"tw-flex","tw-items-center","tw-gap-2"],[3,"organizationId"],["id","totp","readonly","","bitInput","","aria-readonly","true","data-testid","login-totp",1,"tw-font-mono",3,"type","value"],["bitTotpCountdown","","bitSuffix","",3,"cipher","sendCopyCode",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-totp",1,"disabled:tw-cursor-default",3,"appCopyClick","valueLabel","label","disabled"],["bitTotpCountdown","","bitSuffix","",3,"sendCopyCode","cipher"]],template:function(e,t){1&e&&(Q.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"read-only-cipher-card"),Q.DNE(6,ui,8,12,"bit-form-field",3)(7,mi,11,13,"bit-form-field",3)(8,yi,2,5,"div",4)(9,Ci,5,5,"bit-form-field",3)(10,Ii,14,22,"bit-form-field",3),Q.k0s()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,6,"loginCredentials")),Q.R7$(3),Q.Y8G("ngIf",t.cipher.login.username),Q.R7$(),Q.Y8G("ngIf",t.cipher.login.password),Q.R7$(),Q.Y8G("ngIf",t.showPasswordCount&&t.passwordRevealed),Q.R7$(),Q.Y8G("ngIf",(null==t.cipher.login||null==t.cipher.login.fido2Credentials?null:t.cipher.login.fido2Credentials.length)>0),Q.R7$(),Q.Y8G("ngIf",t.cipher.login.totp))},dependencies:[U.MD,U.YU,U.bT,X.p,nt.Y,le.D,ce,oe.U,ie.E,he.r,ae.L,Ae.j,oi.I,ue.J,pe.h,ze.e,ge.a,re.Q,de.s,Qt.E,_e.p,ot.S,ri,Ne,Yt.V,te.g,Jt.a,U.Jj,ve.$],encapsulation:2});class Bi{constructor(){this.revealSshKey=!1}ngOnChanges(e){e.sshKey&&(this.revealSshKey=!1)}}function Ei(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",5)(5,"button",6),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.fullName),Q.R7$(),Q.JRh(Q.bMT(3,6,"name")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.fullName),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyName"))("appCopyClick",e.cipher.identity.fullName)("valueLabel",Q.bMT(7,10,"name"))}}function Si(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",7)(5,"button",8),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.username),Q.R7$(),Q.JRh(Q.bMT(3,6,"username")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.username),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyUsername"))("appCopyClick",e.cipher.identity.username)("valueLabel",Q.bMT(7,10,"username"))}}function Qi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",9)(5,"button",10),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.company),Q.R7$(),Q.JRh(Q.bMT(3,6,"company")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.company),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyCompany"))("appCopyClick",e.cipher.identity.company)("valueLabel",Q.bMT(7,10,"company"))}}function ki(e,t){if(1&e&&(Q.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"read-only-cipher-card"),Q.DNE(6,Ei,8,12,"bit-form-field",3)(7,Si,8,12,"bit-form-field",3)(8,Qi,8,12,"bit-form-field",3),Q.k0s()()),2&e){const e=Q.XpG();Q.R7$(3),Q.JRh(Q.bMT(4,4,"personalDetails")),Q.R7$(3),Q.Y8G("ngIf",e.cipher.identity.fullName),Q.R7$(),Q.Y8G("ngIf",e.cipher.identity.username),Q.R7$(),Q.Y8G("ngIf",e.cipher.identity.company)}}function Ti(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",11)(5,"button",12)(6,"button",13),Q.nI1(7,"i18n"),Q.nI1(8,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.ssn),Q.R7$(),Q.JRh(Q.bMT(3,6,"ssn")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.ssn),Q.R7$(2),Q.Y8G("label",Q.bMT(7,8,"copySSN"))("appCopyClick",e.cipher.identity.ssn)("valueLabel",Q.bMT(8,10,"ssn"))}}function Fi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",14)(5,"button",15)(6,"button",16),Q.nI1(7,"i18n"),Q.nI1(8,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.passportNumber),Q.R7$(),Q.JRh(Q.bMT(3,6,"passportNumber")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.passportNumber),Q.R7$(2),Q.Y8G("label",Q.bMT(7,8,"copyPassportNumber"))("appCopyClick",e.cipher.identity.passportNumber)("valueLabel",Q.bMT(8,10,"passportNumber"))}}function Pi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",17)(5,"button",18),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.licenseNumber),Q.R7$(),Q.JRh(Q.bMT(3,6,"licenseNumber")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.licenseNumber),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyLicenseNumber"))("appCopyClick",e.cipher.identity.licenseNumber)("valueLabel",Q.bMT(7,10,"licenseNumber"))}}function Ri(e,t){if(1&e&&(Q.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"read-only-cipher-card"),Q.DNE(6,Ti,9,12,"bit-form-field",3)(7,Fi,9,12,"bit-form-field",3)(8,Pi,8,12,"bit-form-field",3),Q.k0s()()),2&e){const e=Q.XpG();Q.R7$(3),Q.JRh(Q.bMT(4,4,"identification")),Q.R7$(3),Q.Y8G("ngIf",e.cipher.identity.ssn),Q.R7$(),Q.Y8G("ngIf",e.cipher.identity.passportNumber),Q.R7$(),Q.Y8G("ngIf",e.cipher.identity.licenseNumber)}}function Di(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",19)(5,"button",20),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.email),Q.R7$(),Q.JRh(Q.bMT(3,6,"email")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.email),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyEmail"))("appCopyClick",e.cipher.identity.email)("valueLabel",Q.bMT(7,10,"email"))}}function Mi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"input",21)(5,"button",22),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.cipher.identity.phone),Q.R7$(),Q.JRh(Q.bMT(3,6,"phone")),Q.R7$(2),Q.Y8G("value",e.cipher.identity.phone),Q.R7$(),Q.Y8G("label",Q.bMT(6,8,"copyPhone"))("appCopyClick",e.cipher.identity.phone)("valueLabel",Q.bMT(7,10,"phone"))}}function xi(e,t){if(1&e&&(Q.j41(0,"bit-form-field")(1,"bit-label",4),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.nrm(4,"textarea",23)(5,"button",24),Q.nI1(6,"i18n"),Q.nI1(7,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("appTextDrag",e.addressFields),Q.R7$(),Q.JRh(Q.bMT(3,7,"address")),Q.R7$(2),Q.Y8G("value",e.addressFields)("rows",e.addressRows),Q.R7$(),Q.Y8G("label",Q.bMT(6,9,"copyAddress"))("appCopyClick",e.addressFields)("valueLabel",Q.bMT(7,11,"address"))}}function Oi(e,t){if(1&e&&(Q.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"read-only-cipher-card"),Q.DNE(6,Di,8,12,"bit-form-field",3)(7,Mi,8,12,"bit-form-field",3)(8,xi,8,13,"bit-form-field",3),Q.k0s()()),2&e){const e=Q.XpG();Q.R7$(3),Q.JRh(Q.bMT(4,4,"contactInfo")),Q.R7$(3),Q.Y8G("ngIf",e.cipher.identity.email),Q.R7$(),Q.Y8G("ngIf",e.cipher.identity.phone),Q.R7$(),Q.Y8G("ngIf",e.addressFields)}}Bi.ɵfac=function(e){return new(e||Bi)},Bi.ɵcmp=Q.VBU({type:Bi,selectors:[["app-sshkey-view"]],inputs:{sshKey:"sshKey"},features:[Q.OA$],decls:31,vars:37,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["readonly","","bitInput","","aria-readonly","true","type","password","data-testid","private-key",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-privateKey",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"label","appCopyClick","valueLabel"],["readonly","","bitInput","","aria-readonly","true","data-testid","public-key",3,"value"],["readonly","","bitInput","","aria-readonly","true","data-testid","fingerprint",3,"value"]],template:function(e,t){1&e&&(Q.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s()(),Q.j41(5,"read-only-cipher-card")(6,"bit-form-field")(7,"bit-label"),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.nrm(10,"input",2),Q.j41(11,"button",3),Q.mxI("toggledChange",function(e){return Q.DH7(t.revealSshKey,e)||(t.revealSshKey=e),e}),Q.k0s(),Q.nrm(12,"button",4),Q.nI1(13,"i18n"),Q.nI1(14,"i18n"),Q.k0s(),Q.j41(15,"bit-form-field")(16,"bit-label"),Q.EFF(17),Q.nI1(18,"i18n"),Q.k0s(),Q.nrm(19,"input",5)(20,"button",4),Q.nI1(21,"i18n"),Q.nI1(22,"i18n"),Q.k0s(),Q.j41(23,"bit-form-field")(24,"bit-label"),Q.EFF(25),Q.nI1(26,"i18n"),Q.k0s(),Q.nrm(27,"input",6)(28,"button",4),Q.nI1(29,"i18n"),Q.nI1(30,"i18n"),Q.k0s()()()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,17,"typeSshKey")),Q.R7$(5),Q.JRh(Q.bMT(9,19,"sshPrivateKey")),Q.R7$(2),Q.Y8G("value",t.sshKey.privateKey),Q.R7$(),Q.R50("toggled",t.revealSshKey),Q.R7$(),Q.Y8G("label",Q.bMT(13,21,"copyPrivateKey"))("appCopyClick",t.sshKey.privateKey)("valueLabel",Q.bMT(14,23,"sshPrivateKey")),Q.R7$(5),Q.JRh(Q.bMT(18,25,"sshPublicKey")),Q.R7$(2),Q.Y8G("value",t.sshKey.publicKey),Q.R7$(),Q.Y8G("label",Q.bMT(21,27,"copyPublicKey"))("appCopyClick",t.sshKey.publicKey)("valueLabel",Q.bMT(22,29,"sshPublicKey")),Q.R7$(5),Q.JRh(Q.bMT(26,31,"sshFingerprint")),Q.R7$(2),Q.Y8G("value",t.sshKey.keyFingerprint),Q.R7$(),Q.Y8G("label",Q.bMT(29,33,"copyFingerprint"))("appCopyClick",t.sshKey.keyFingerprint)("valueLabel",Q.bMT(30,35,"sshFingerprint")))},dependencies:[U.MD,X.p,le.D,oe.U,Ne,ie.E,he.r,ae.L,Ae.j,ue.J,pe.h,ze.e,ge.a,re.Q,de.s,ve.$],encapsulation:2});class Gi{constructor(){this.cipher=null}get addressFields(){if(!this.cipher)return"";const{address1:e,address2:t,address3:i,fullAddressPart2:n,country:r}=this.cipher.identity;return[e,t,i,n,r].filter(Boolean).join("\n")}get addressRows(){return this.addressFields.split("\n").length}get hasPersonalDetails(){if(!this.cipher)return!1;const{username:e,company:t,fullName:i}=this.cipher.identity;return Boolean(i||e||t)}get hasIdentificationDetails(){if(!this.cipher)return!1;const{ssn:e,passportNumber:t,licenseNumber:i}=this.cipher.identity;return Boolean(e||t||i)}get hasContactDetails(){if(!this.cipher)return!1;const{email:e,phone:t}=this.cipher.identity;return Boolean(e||t||this.addressFields)}}Gi.ɵfac=function(e){return new(e||Gi)},Gi.ɵcmp=Q.VBU({type:Gi,selectors:[["app-view-identity-sections"]],inputs:{cipher:"cipher"},decls:3,vars:3,consts:[["class","tw-mb-5 bit-compact:tw-mb-4",4,"ngIf"],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"appTextDrag"],["bitInput","","id","fullName","readonly","","data-testid","name",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-name",3,"label","appCopyClick","valueLabel"],["bitInput","","id","username","readonly","","data-testid","username",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","",3,"label","appCopyClick","valueLabel"],["bitInput","","id","company","readonly","","data-testid","company",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-company",3,"label","appCopyClick","valueLabel"],["bitInput","","id","ssn","type","password","readonly","","data-testid","ssn",3,"value"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","ssn-toggle"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-ssn",3,"label","appCopyClick","valueLabel"],["id","passportNumber","bitInput","","type","password","readonly","","data-testid","passport",3,"value"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","passport-toggle"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-passport",3,"label","appCopyClick","valueLabel"],["bitInput","","id","licenseNumber","readonly","","data-testid","license",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-license",3,"label","appCopyClick","valueLabel"],["bitInput","","id","email","readonly","","data-testid","email",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-email",3,"label","appCopyClick","valueLabel"],["bitInput","","id","phone","readonly","","data-testid","phone",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-phone",3,"label","appCopyClick","valueLabel"],["bitInput","","id","address","readonly","","data-testid","address",1,"tw-resize-none",3,"value","rows"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-address",3,"label","appCopyClick","valueLabel"]],template:function(e,t){1&e&&Q.DNE(0,ki,9,6,"section",0)(1,Ri,9,6,"section",0)(2,Oi,9,6,"section",0),2&e&&(Q.Y8G("ngIf",t.hasPersonalDetails),Q.R7$(),Q.Y8G("ngIf",t.hasIdentificationDetails),Q.R7$(),Q.Y8G("ngIf",t.hasContactDetails))},dependencies:[U.bT,X.p,le.D,ce,oe.U,ie.E,he.r,ae.L,Ae.j,ue.J,pe.h,ze.e,ge.a,re.Q,de.s,Ne,ve.$],encapsulation:2});var Ui=i(74526);class Vi{}var ji=i(4532),Ni=i(44432),zi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yi=[[["","slot","button"]]];function Li(e,t){1&e&&(Q.j41(0,"bit-callout",10),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()),2&e&&(Q.Y8G("title",Q.bMT(1,2,"cardExpiredTitle")),Q.R7$(2),Q.SpI(" ",Q.bMT(3,4,"cardExpiredMessage")," "))}function Ki(e,t){1&e&&(Q.j41(0,"bit-callout",11),Q.nI1(1,"i18n"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()),2&e&&(Q.Y8G("title",Q.bMT(1,2,"missingWebsite")),Q.R7$(2),Q.SpI(" ",Q.bMT(3,4,"changeAtRiskPasswordAndAddWebsite")," "))}function Xi(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"a",13),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(3);return a.Njj(t.launchChangePassword())}),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()}if(2&e){const e=Q.XpG(3);Q.Y8G("href",e.changePasswordLink(),Q.B4B),Q.R7$(),Q.SpI(" ",Q.bMT(2,2,"changeAtRiskPassword")," ")}}function qi(e,t){1&e&&(Q.EFF(0),Q.nI1(1,"i18n")),2&e&&Q.SpI(" ",Q.bMT(1,1,"changeAtRiskPassword")," ")}function Hi(e,t){if(1&e&&(Q.j41(0,"bit-callout",11),Q.nVh(1,Xi,3,4,"a",12)(2,qi,2,3),Q.k0s()),2&e){const e=Q.XpG(2);Q.Y8G("title",""),Q.R7$(),Q.vxM(e.changePasswordLink()?1:2)}}function Wi(e,t){1&e&&(Q.j41(0,"p",14),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e&&(Q.R7$(),Q.SpI(" ",Q.bMT(2,1,"noEditPermissions")," "))}function $i(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"app-login-credentials-view",15),Q.nI1(1,"async"),Q.bIt("handleChangePassword",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.launchChangePassword())}),Q.k0s()}if(2&e){const e=Q.XpG(2);Q.Y8G("cipher",e.cipher())("activeUserId",Q.bMT(1,4,e.activeUserId$))("showChangePasswordLink",e.showChangePasswordLink())("changePasswordLink",e.changePasswordLink())}}function Ji(e,t){if(1&e&&Q.nrm(0,"app-autofill-options-view",16),2&e){const e=Q.XpG(2);Q.Y8G("loginUris",e.cipher().login.uris)("cipherId",e.cipher().id)}}function Zi(e,t){if(1&e&&Q.nrm(0,"app-card-details-view",9),2&e){const e=Q.XpG(2);Q.Y8G("cipher",e.cipher())}}function _i(e,t){if(1&e&&Q.nrm(0,"app-view-identity-sections",9),2&e){const e=Q.XpG(2);Q.Y8G("cipher",e.cipher())}}function en(e,t){if(1&e&&Q.nrm(0,"app-sshkey-view",17),2&e){const e=Q.XpG(2);Q.Y8G("sshKey",e.cipher().sshKey)}}function tn(e,t){if(1&e&&(Q.qex(0),Q.nrm(1,"app-additional-options",18),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("notes",e.cipher().notes)}}function nn(e,t){if(1&e&&(Q.qex(0),Q.nrm(1,"app-custom-fields-v2",9),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("cipher",e.cipher())}}function rn(e,t){if(1&e&&(Q.qex(0),Q.nrm(1,"app-attachments-v2-view",19),Q.bVm()),2&e){const e=Q.XpG(2);Q.R7$(),Q.Y8G("emergencyAccessId",e.emergencyAccessId())("cipher",e.cipher())("admin",e.isAdminConsole())}}function sn(e,t){if(1&e&&(Q.qex(0),Q.DNE(1,Li,4,6,"bit-callout",1)(2,Ki,4,6,"bit-callout",2)(3,Hi,3,2,"bit-callout",2)(4,Wi,3,3,"p",3),Q.j41(5,"app-item-details-v2",4),Q.SdG(6),Q.k0s(),Q.DNE(7,$i,2,6,"app-login-credentials-view",5)(8,Ji,1,2,"app-autofill-options-view",6)(9,Zi,1,1,"app-card-details-view",7)(10,_i,1,1,"app-view-identity-sections",7)(11,en,1,1,"app-sshkey-view",8)(12,tn,2,1,"ng-container",0)(13,nn,2,1,"ng-container",0)(14,rn,2,3,"ng-container",0),Q.nrm(15,"app-item-history-v2",9),Q.bVm()),2&e){let e,t,i,n,r;const s=Q.XpG();Q.R7$(),Q.Y8G("ngIf",s.cardIsExpired()),Q.R7$(),Q.Y8G("ngIf",!s.hasLoginUri()&&s.hadPendingChangePasswordTask()),Q.R7$(),Q.Y8G("ngIf",s.showChangePasswordLink()),Q.R7$(),Q.Y8G("ngIf",(null==(e=s.cipher())?null:e.isDeleted)&&!(null!=(e=s.cipher())&&e.edit)),Q.R7$(),Q.Y8G("cipher",s.cipher())("organization",s.organization())("collections",s.resolvedCollections())("folder",s.folder())("hideOwner",s.isAdminConsole()),Q.R7$(2),Q.Y8G("ngIf",s.hasLogin()),Q.R7$(),Q.Y8G("ngIf",s.hasAutofill()),Q.R7$(),Q.Y8G("ngIf",s.hasCard()),Q.R7$(),Q.Y8G("ngIf",null==(t=s.cipher())?null:t.identity),Q.R7$(),Q.Y8G("ngIf",s.hasSshKey()),Q.R7$(),Q.Y8G("ngIf",null==(i=s.cipher())?null:i.notes),Q.R7$(),Q.Y8G("ngIf",null==(n=s.cipher())?null:n.hasFields),Q.R7$(),Q.Y8G("ngIf",null==(r=s.cipher())?null:r.hasAttachments),Q.R7$(),Q.Y8G("cipher",s.cipher())}}class on{constructor(e,t,i,s,a,l,c,d,u,h,A,p){this.organizationService=e,this.collectionService=t,this.folderService=i,this.accountService=s,this.defaultTaskService=a,this.platformUtilsService=l,this.changeLoginPasswordService=c,this.cipherService=d,this.logService=u,this.cipherRiskService=h,this.billingAccountService=A,this.vaultSettingsService=p,this.cipher=D.hFB.required(),this.cipher$=(0,M.br)(this.cipher),this.emergencyAccessId=(0,D.hFB)(),this.collections=(0,D.hFB)(void 0),this.isAdminConsole=(0,D.hFB)(!1),this.activeUserId$=(0,H.F6)(this.accountService.activeAccount$),this.resolvedCollections=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$,(0,M.br)(this.collections)]).pipe((0,j.n)(([e,t,i])=>i&&i.length>0?(0,N.of)(i):t.collectionIds&&t.collectionIds.length>0?this.collectionService.decryptedCollections$(e).pipe((0,J.S)(t.collectionIds)):(0,N.of)(void 0)))),this.organization=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,j.n)(([e,t])=>e&&(null==t?void 0:t.organizationId)?this.organizationService.organizations$(e).pipe((0,r.T)(e=>e.find(e=>e.id===t.organizationId))):(0,N.of)(void 0)))),this.folder=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,j.n)(([e,t])=>e&&(null==t?void 0:t.folderId)?this.folderService.getDecrypted$(t.folderId,e):(0,N.of)(void 0)))),this.hadPendingChangePasswordTask=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,j.n)(([e,t])=>(null==t?void 0:t.type)===g.gC.Login&&(null==t?void 0:t.organizationId)?(0,n.z)([this.cipherService.ciphers$(e),this.defaultTaskService.pendingTasks$(e)]).pipe((0,r.T)(([e,i])=>{var n;const r=e[null==t?void 0:t.id];return!(!(null==r?void 0:r.edit)||!(null==r?void 0:r.viewPassword))&&(null!==(n=null==i?void 0:i.some(e=>e.cipherId===(null==t?void 0:t.id)&&e.type===o.Wn.UpdateAtRiskCredential))&&void 0!==n&&n)}),(0,z.W)(e=>(this.logService.error("Failed to retrieve change password tasks for cipher",e),(0,N.of)(!1)))):(0,N.of)(!1))),{initialValue:!1}),this.hasCard=(0,V.EW)(()=>{const e=this.cipher();if(!e)return!1;const{cardholderName:t,code:i,expMonth:n,expYear:r,number:s}=e.card;return t||i||n||r||s}),this.cardIsExpired=(0,V.EW)(()=>{const e=this.cipher();return null!=e&&(0,W.ov)(e.card)}),this.hasLogin=(0,V.EW)(()=>{const e=this.cipher();if(!e)return!1;const{username:t,password:i,totp:n,fido2Credentials:r}=e.login;return t||i||n||(null==r?void 0:r.length)>0}),this.hasAutofill=(0,V.EW)(()=>{var e,t;const i=this.cipher();return(null!==(t=null===(e=null==i?void 0:i.login)||void 0===e?void 0:e.uris.length)&&void 0!==t?t:0)>0}),this.hasSshKey=(0,V.EW)(()=>{var e;const t=this.cipher();return!!(null===(e=null==t?void 0:t.sshKey)||void 0===e?void 0:e.privateKey)}),this.hasLoginUri=(0,V.EW)(()=>{var e;const t=this.cipher();return null===(e=null==t?void 0:t.login)||void 0===e?void 0:e.hasUris}),this.passwordIsAtRisk=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,j.n)(([e,t])=>!t.hasLoginPassword||!t.edit||t.organizationId||t.isDeleted?(0,N.of)(!1):this.switchPremium$(e,()=>(0,Y.H)(this.checkIfPasswordIsAtRisk(t.id,e)).pipe((0,L.Z)(!1)),()=>(0,N.of)(!1)))),{initialValue:!1}),this.showChangePasswordLink=(0,V.EW)(()=>this.hasLoginUri()&&(this.hadPendingChangePasswordTask()||this.passwordIsAtRisk()&&this.showAtRiskPasswordNotifications())),this.showAtRiskPasswordNotifications=(0,M.ot)(this.vaultSettingsService.showAtRiskPasswordNotifications$),this.changePasswordUrl=(0,V.Zc)({params:()=>({cipher:this.cipher(),showPwLink:this.showChangePasswordLink()}),loader:e=>zi(this,[e],void 0,function*({params:e}){if(e.showPwLink)try{return yield this.changeLoginPasswordService.getChangePasswordUrl(e.cipher)}catch(t){return void this.logService.error(t.message)}})}),this.changePasswordLink=(0,V.EW)(()=>{if(this.changePasswordUrl.hasValue())return this.changePasswordUrl.value()}),this.launchChangePassword=()=>zi(this,void 0,void 0,function*(){const e=this.cipher();if(null!=e){const t=yield this.changeLoginPasswordService.getChangePasswordUrl(e);if(null==t)return;this.platformUtilsService.launchUri(t)}})}switchPremium$(e,t,i){return this.billingAccountService.hasPremiumFromAnySource$(e).pipe((0,j.n)(e=>e?t():i()))}checkIfPasswordIsAtRisk(e,t){return zi(this,void 0,void 0,function*(){try{const i=yield this.cipherRiskService.computeCipherRiskForUser(e,t,!0);return(0,Z.i)(i)}catch(i){return this.logService.error("Failed to check if password is at risk",i),!1}})}}on.ɵfac=function(e){return new(e||on)(Q.rXU(q.PV),Q.rXU(K.YD),Q.rXU(Ui.k),Q.rXU(I.D),Q.rXU(o.RB),Q.rXU(f.y),Q.rXU(Vi),Q.rXU(l.p),Q.rXU($.K),Q.rXU(Z.A),Q.rXU(w.Q),Q.rXU(ji.d))},on.ɵcmp=Q.VBU({type:on,selectors:[["app-cipher-view"]],inputs:{cipher:[1,"cipher"],emergencyAccessId:[1,"emergencyAccessId"],collections:[1,"collections"],isAdminConsole:[1,"isAdminConsole"]},ngContentSelectors:["[slot=button]"],decls:1,vars:1,consts:[[4,"ngIf"],["type","info",3,"title",4,"ngIf"],["type","warning",3,"title",4,"ngIf"],["class","tw-text-muted","bitTypography","helper",4,"ngIf"],[3,"cipher","organization","collections","folder","hideOwner"],[3,"cipher","activeUserId","showChangePasswordLink","changePasswordLink","handleChangePassword",4,"ngIf"],[3,"loginUris","cipherId",4,"ngIf"],[3,"cipher",4,"ngIf"],[3,"sshKey",4,"ngIf"],[3,"cipher"],["type","info",3,"title"],["type","warning",3,"title"],["bitLink","","appStopClick","","linkType","secondary","endIcon","bwi-external-link",3,"href"],["bitLink","","appStopClick","","linkType","secondary","endIcon","bwi-external-link",3,"click","href"],["bitTypography","helper",1,"tw-text-muted"],[3,"handleChangePassword","cipher","activeUserId","showChangePasswordLink","changePasswordLink"],[3,"loginUris","cipherId"],[3,"sshKey"],[3,"notes"],[3,"emergencyAccessId","cipher","admin"]],template:function(e,t){1&e&&(Q.NAR(Yi),Q.DNE(0,sn,16,18,"ng-container",0)),2&e&&Q.Y8G("ngIf",!!t.cipher())},dependencies:[_.j,Ni.G,U.MD,U.bT,ee.t,X.p,nt.Y,jt,fe,xe,$t,wt,He,Bi,Gi,bi,Ue,te.g,ie.E,he.r,U.Jj,ve.$],encapsulation:2});var an=i(81525),ln=i(29029),cn=i(81573),dn=i(36801),un=i(51757),hn=i(50451),An=i(23293),pn=i(38620),gn=(i(34461),i(66316)),vn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class fn{constructor(e,t,i,n,r,s){this.toastService=e,this.i18nService=t,this.cipherService=i,this.logService=n,this.dialogService=r,this.accountService=s,this.admin=!1,this.onDeletionSuccess=new Q.bkB,this.delete=()=>vn(this,void 0,void 0,function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"deleteAttachment"},content:{key:"permanentlyDeleteAttachmentConfirmation"},type:"warning"}))try{const e=yield(0,h._)(this.accountService.activeAccount$.pipe(H.bB));if(null==e)throw new Error("An active user is expected while deleting an attachment.");yield this.cipherService.deleteAttachmentWithServer(this.cipherId,this.attachment.id,e,this.admin),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deletedAttachment")}),this.onDeletionSuccess.emit()}catch(e){this.logService.error(e)}})}}fn.ɵfac=function(e){return new(e||fn)(Q.rXU(m.f),Q.rXU(C.W),Q.rXU(l.p),Q.rXU($.K),Q.rXU(gn.o3),Q.rXU(I.D))},fn.ɵcmp=Q.VBU({type:fn,selectors:[["app-delete-attachment"]],inputs:{cipherId:"cipherId",attachment:"attachment",admin:"admin"},outputs:{onDeletionSuccess:"onDeletionSuccess"},decls:2,vars:5,consts:[["bitIconButton","bwi-trash","buttonType","dangerGhost","size","small","type","button",1,"tw-border-transparent",3,"label","bitAction"]],template:function(e,t){1&e&&(Q.nrm(0,"button",0),Q.nI1(1,"i18n")),2&e&&Q.Y8G("label",Q.i5U(1,2,"deleteAttachmentName",t.attachment.fileName))("bitAction",t.delete)},dependencies:[Ie.C,Ee.p,U.MD,X.p,ln.t,re.Q,de.s,ve.$],encapsulation:2});var mn=i(56898),yn=i(54471),Cn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wn=["fileInput"],In=(e,t)=>t.id;function bn(e,t){1&e&&(Q.nrm(0,"i",6),Q.nI1(1,"i18n")),2&e&&Q.Y8G("appA11yTitle",Q.bMT(1,1,"fixEncryptionTooltip"))}function Bn(e,t){if(1&e&&Q.nrm(0,"app-download-attachment",8),2&e){let e;const t=Q.XpG(2).$implicit,i=Q.XpG(2);Q.Y8G("admin",i.admin()&&(null==(e=i.organization())?null:e.canEditAllCiphers))("cipher",i.cipher())("attachment",t)}}function En(e,t){if(1&e&&(Q.j41(0,"button",9),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e){const e=Q.XpG(2).$implicit,t=Q.XpG(2);Q.Y8G("bitAction",t.fixOldAttachment(e)),Q.R7$(),Q.SpI(" ",Q.bMT(2,2,"fixEncryption")," ")}}function Sn(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-item-action")(1,"app-delete-attachment",10),Q.bIt("onDeletionSuccess",function(){a.eBV(e);const t=Q.XpG(2).$implicit,i=Q.XpG(2);return a.Njj(i.removeAttachment(t))}),Q.k0s()()}if(2&e){let e;const t=Q.XpG(2).$implicit,i=Q.XpG(2);Q.R7$(),Q.Y8G("admin",i.admin()&&(null==(e=i.organization())?null:e.canEditAllCiphers))("cipherId",i.cipher().id)("attachment",t)}}function Qn(e,t){if(1&e&&(Q.j41(0,"bit-item")(1,"bit-item-content")(2,"span",4),Q.EFF(3),Q.k0s(),Q.j41(4,"span",5),Q.EFF(5),Q.k0s(),Q.nVh(6,bn,2,3,"i",6),Q.k0s(),Q.qex(7,7),Q.j41(8,"bit-item-action"),Q.nVh(9,Bn,1,3,"app-download-attachment",8)(10,En,3,4,"button",9),Q.k0s(),Q.nVh(11,Sn,2,3,"bit-item-action"),Q.bVm(),Q.k0s()),2&e){const e=Q.XpG().$implicit,t=Q.XpG(2);Q.R7$(2),Q.Y8G("title",e.fileName),Q.R7$(),Q.SpI(" ",e.fileName," "),Q.R7$(2),Q.JRh(e.sizeName),Q.R7$(),Q.vxM(null==e.key?6:-1),Q.R7$(3),Q.vxM(null!=e.key?9:10),Q.R7$(2),Q.vxM(t.cipher().edit?11:-1)}}function kn(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-item-action")(1,"app-delete-attachment",10),Q.bIt("onDeletionSuccess",function(){a.eBV(e);const t=Q.XpG(2).$implicit,i=Q.XpG(2);return a.Njj(i.removeAttachment(t))}),Q.k0s()()}if(2&e){let e;const t=Q.XpG(2).$implicit,i=Q.XpG(2);Q.R7$(),Q.Y8G("admin",i.admin()&&(null==(e=i.organization())?null:e.canEditAllCiphers))("cipherId",i.cipher().id)("attachment",t)}}function Tn(e,t){if(1&e&&(Q.j41(0,"bit-item")(1,"bit-item-content")(2,"span",4),Q.nI1(3,"i18n"),Q.EFF(4),Q.nI1(5,"i18n"),Q.k0s()(),Q.qex(6,7),Q.nVh(7,kn,2,3,"bit-item-action"),Q.bVm(),Q.k0s()),2&e){const e=Q.XpG(3);Q.R7$(2),Q.Y8G("title",Q.bMT(3,3,"errorCannotDecrypt")),Q.R7$(2),Q.SpI(" ",Q.bMT(5,5,"errorCannotDecrypt")," "),Q.R7$(3),Q.vxM(e.cipher().edit?7:-1)}}function Fn(e,t){if(1&e&&(Q.j41(0,"li"),Q.nVh(1,Qn,12,6,"bit-item")(2,Tn,8,7,"bit-item"),Q.k0s()),2&e){const e=t.$implicit;Q.R7$(),Q.vxM(e.hasDecryptionError?2:1)}}function Pn(e,t){1&e&&(Q.j41(0,"ul",2),Q.Z7z(1,Fn,3,1,"li",null,In),Q.k0s()),2&e&&(Q.R7$(),Q.Dyx(t))}function Rn(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"bit-card")(1,"label",11),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"div",12)(5,"input",13,0),Q.bIt("change",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.onFileChange(t))}),Q.k0s(),Q.j41(7,"div",14)(8,"button",15),Q.bIt("click",function(){a.eBV(e);const t=Q.sdS(6);return a.Njj(t.click())}),Q.EFF(9),Q.nI1(10,"i18n"),Q.k0s(),Q.j41(11,"p",16),Q.EFF(12),Q.nI1(13,"i18n"),Q.k0s()()(),Q.j41(14,"p",17),Q.EFF(15),Q.nI1(16,"i18n"),Q.k0s()()}if(2&e){const e=Q.XpG();Q.R7$(2),Q.SpI(" ",Q.bMT(3,4,"addAttachment")," "),Q.R7$(7),Q.SpI(" ",Q.bMT(10,6,"chooseFile")," "),Q.R7$(3),Q.SpI(" ",null!=e.attachmentForm.controls.file&&e.attachmentForm.controls.file.value?e.attachmentForm.controls.file.value.name:Q.bMT(13,8,"noFileChosen")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(16,10,"maxFileSizeSansPunctuation")," ")}}class Dn{constructor(e,t,i,n,r,s,o,l){this.cipherService=e,this.i18nService=t,this.formBuilder=i,this.logService=n,this.toastService=r,this.accountService=s,this.apiService=o,this.organizationService=l,this.fileInput=(0,D.ebz)("fileInput",{read:Q.aKT}),this.bitSubmit=(0,D.ebz)(pn.L),this.cipherId=D.hFB.required(),this.organizationId=(0,D.hFB)(),this.admin=(0,D.hFB)(!1),this.submitBtn=(0,D.hFB)(),this.onUploadStarted=(0,D.CGW)(),this.onUploadSuccess=(0,D.CGW)(),this.onUploadFailed=(0,D.CGW)(),this.onRemoveSuccess=(0,D.CGW)(),this.onCloseButtonPress=(0,D.CGW)(),this.organization=(0,a.vPA)(null),this.cipher=(0,a.vPA)(null),this.attachmentForm=this.formBuilder.group({file:new un.MJ(null,[un.k0.required])}),this.cipherDomain=null,this.activeUserId=null,this.destroyRef=(0,a.WQX)(a.abz),this.submit=()=>Cn(this,void 0,void 0,function*(){var e,t;if(null===(t=null===(e=this.cipher())||void 0===e?void 0:e.edit)||void 0===t||!t)return void this.onCloseButtonPress.emit();this.onUploadStarted.emit();const i=this.attachmentForm.value.file;if(null!=i){if(i.size>524288e3)this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("maxFileSize")});else if(this.cipherDomain&&this.activeUserId)try{this.cipherDomain=yield this.cipherService.saveAttachmentWithServer(this.cipherDomain,i,this.activeUserId,this.admin()),this.cipher.set(yield this.cipherService.decrypt(this.cipherDomain,this.activeUserId));const e=this.fileInput();e&&(e.nativeElement.value=""),this.attachmentForm.controls.file.setValue(null),this.toastService.showToast({variant:"success",message:this.i18nService.t("attachmentSaved")}),this.onUploadSuccess.emit()}catch(n){this.logService.error(n);let e=this.i18nService.t("unexpectedError");"string"==typeof n?e=n:n instanceof Error&&(null==n?void 0:n.message)&&(e=n.message),this.toastService.showToast({variant:"error",message:e}),this.onUploadFailed.emit()}}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")})}),this.fixOldAttachment=e=>()=>Cn(this,void 0,void 0,function*(){const t=this.cipher(),i=this.activeUserId;if(e.id&&i&&t)try{const n=yield this.cipherService.upgradeOldCipherAttachments(t,i,e.id);this.cipher.set(n),this.toastService.showToast({variant:"success",message:this.i18nService.t("attachmentUpdated")}),this.onUploadSuccess.emit()}catch(n){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}),this.attachmentForm.statusChanges.pipe((0,M.pQ)()).subscribe(e=>{const t=this.submitBtn();t&&t.disabled.set("VALID"!==e)}),(0,V.QZ)(()=>Cn(this,void 0,void 0,function*(){var e,t;const i=this.cipherId();if(!i)return;this.activeUserId=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6)),this.organization.set(yield this.getOrganization()),this.cipherDomain=yield this.getCipher(i),this.cipherDomain&&this.activeUserId&&this.cipher.set(yield this.cipherService.decrypt(this.cipherDomain,this.activeUserId));const n=this.submitBtn();n&&n.disabled.set(!this.attachmentForm.valid&&(null===(t=null===(e=this.cipher())||void 0===e?void 0:e.edit)||void 0===t||t))})),(0,V.QZ)(()=>{const e=this.bitSubmit(),t=this.submitBtn();e&&t&&(e.loading$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{t.loading.set(e)}),e.disabled$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{t.disabled.set(e)}))})}get attachmentFormId(){return Dn.attachmentFormID}onFileChange(e){const t=e.target;t.files&&t.files.length>0&&this.attachmentForm.controls.file.setValue(t.files[0])}removeAttachment(e){const t=this.cipher();if(!(null==t?void 0:t.attachments))return;const i=t.attachments.indexOf(e);i>-1&&(t.attachments.splice(i,1),this.cipher.set(Object.assign(Object.create(Object.getPrototypeOf(t)),t))),this.onRemoveSuccess.emit()}getCipher(e){return Cn(this,void 0,void 0,function*(){if(null==e||!this.activeUserId)return null;if(this.admin()){const t=yield this.apiService.getCipherAdmin(e);t.edit=!0;const i=new hn.A(t);return new An.o(i)}const t=yield this.cipherService.get(e,this.activeUserId);return null==t&&this.organizationId()?null:t})}getOrganization(){return Cn(this,void 0,void 0,function*(){const e=this.organizationId();if(!e||!this.activeUserId)return null;return(yield(0,h._)(this.organizationService.organizations$(this.activeUserId))).find(t=>t.id===e)||null})}}Dn.attachmentFormID="attachmentForm",Dn.ɵfac=function(e){return new(e||Dn)(Q.rXU(l.p),Q.rXU(C.W),Q.rXU(un.ok),Q.rXU($.K),Q.rXU(m.f),Q.rXU(I.D),Q.rXU(be.G),Q.rXU(q.PV))},Dn.ɵcmp=Q.VBU({type:Dn,selectors:[["app-cipher-attachments"]],viewQuery:function(e,t){1&e&&(Q.wEZ(t.fileInput,wn,5,Q.aKT),Q.wEZ(t.bitSubmit,pn.L,5)),2&e&&Q.NyB(2)},inputs:{cipherId:[1,"cipherId"],organizationId:[1,"organizationId"],admin:[1,"admin"],submitBtn:[1,"submitBtn"]},outputs:{onUploadStarted:"onUploadStarted",onUploadSuccess:"onUploadSuccess",onUploadFailed:"onUploadFailed",onRemoveSuccess:"onRemoveSuccess",onCloseButtonPress:"onCloseButtonPress"},decls:6,vars:8,consts:[["fileInput",""],["id","attachments",1,"tw-sr-only"],["aria-labelledby","attachments",1,"tw-list-none","tw-pl-0"],[3,"id","formGroup","bitSubmit"],["data-testid","file-name",3,"title"],["slot","secondary","data-testid","file-size"],["slot","default-trailing",1,"bwi","bwi-exclamation-triangle","bwi-sm","tw-text-muted",3,"appA11yTitle"],["slot","end"],[3,"admin","cipher","attachment"],["bitButton","","buttonType","primary","size","small","type","button",3,"bitAction"],[3,"onDeletionSuccess","admin","cipherId","attachment"],["for","file","bitTypography","body2",1,"tw-block","tw-text-muted","tw-px-1","tw-pb-1.5"],[1,"tw-relative"],["type","file","id","file","name","file","aria-describedby","fileHelp","tabindex","-1","required","",1,"tw-sr-only",3,"change"],["aria-hidden","true",1,"tw-flex","tw-gap-2","tw-items-center"],["bitButton","","buttonType","secondary","type","button",1,"tw-whitespace-nowrap",3,"click"],["bitTypography","body2",1,"tw-text-muted","tw-mb-0"],["id","fileHelp","bitTypography","helper",1,"tw-text-muted","tw-px-1","tw-pt-1","tw-mb-0"]],template:function(e,t){if(1&e&&(Q.j41(0,"h2",1),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s(),Q.nVh(3,Pn,3,0,"ul",2),Q.j41(4,"form",3),Q.nVh(5,Rn,17,12,"bit-card"),Q.k0s()),2&e){let e,i;Q.R7$(),Q.JRh(Q.bMT(2,6,"attachments")),Q.R7$(2),Q.vxM((e=null==(e=t.cipher())?null:e.attachments)?3:-1,e),Q.R7$(),Q.Y8G("id",t.attachmentFormId)("formGroup",t.attachmentForm)("bitSubmit",t.submit),Q.R7$(),Q.vxM(null!=(i=t.cipher())&&i.edit?5:-1)}},dependencies:[Ie.C,Ee.p,pn.L,ln.t,mn.Q,U.MD,ye.k,Te.J,Fe.g,Pe.D,X.p,yn.C,un.X1,un.qT,un.cb,un.j4,ie.E,he.r,ne.i,fn,ke,ve.$],encapsulation:2,changeDetection:0});var Mn=i(68016),xn=i(67311);function On(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"app-cipher-attachments",7),Q.bIt("onUploadStarted",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.uploadStarted())})("onUploadSuccess",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.uploadSuccessful())})("onUploadFailed",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.uploadFailed())})("onRemoveSuccess",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.removalSuccessful())})("onCloseButtonPress",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.closeButtonPressed())}),Q.k0s()}if(2&e){const e=Q.XpG(),t=Q.sdS(8);Q.Y8G("cipherId",e.cipherId)("organizationId",e.organizationId)("admin",e.admin)("submitBtn",t)}}const Gn={Uploaded:"uploaded",Removed:"removed",Closed:"closed"};class Un{constructor(e,t,i){var n,r;this.dialogRef=e,this.params=t,this.i18nService=i,this.admin=!1,this.attachmentFormId=Dn.attachmentFormID,this.isUploading=!1,this.handleBeforeUnloadEvent=e=>{if(this.isUploading){e.preventDefault();const t="Upload in progress. Are you sure you want to leave?";return e.returnValue=t,t}},this.cipherId=t.cipherId,this.organizationId=t.organizationId,this.admin=null!==(n=t.admin)&&void 0!==n&&n,this.canEditCipher=null!==(r=null==t?void 0:t.canEditCipher)&&void 0!==r&&r,this.buttonText=this.canEditCipher||this.admin?this.i18nService.t("upload"):this.i18nService.t("close")}static open(e,t){return e.open(Un,{data:t})}uploadStarted(){this.isUploading=!0,this.dialogRef.disableClose=!0}uploadSuccessful(){this.isUploading=!1,this.dialogRef.disableClose=!1,this.dialogRef.close({action:Gn.Uploaded})}uploadFailed(){this.isUploading=!1,this.dialogRef.disableClose=!1}removalSuccessful(){this.dialogRef.close({action:Gn.Removed})}closeButtonPressed(){this.dialogRef.close({action:Gn.Closed})}}Un.ɵfac=function(e){return new(e||Un)(Q.rXU(gn.ce),Q.rXU(an.Qs),Q.rXU(C.W))},Un.ɵcmp=Q.VBU({type:Un,selectors:[["app-vault-attachments-v2"]],hostBindings:function(e,t){1&e&&Q.bIt("beforeunload",function(e){return t.handleBeforeUnloadEvent(e)},Q.tSv)},decls:10,vars:6,consts:[["submitBtn",""],["dialogSize","default","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"cipherId","organizationId","admin","submitBtn","onUploadStarted","onUploadSuccess","onUploadFailed","onRemoveSuccess","onCloseButtonPress",4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary"],[3,"onUploadStarted","onUploadSuccess","onUploadFailed","onRemoveSuccess","onCloseButtonPress","cipherId","organizationId","admin","submitBtn"]],template:function(e,t){1&e&&(Q.j41(0,"bit-dialog",1)(1,"span",2),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.qex(4,3),Q.DNE(5,On,1,4,"app-cipher-attachments",4),Q.bVm(),Q.qex(6,5),Q.j41(7,"button",6,0),Q.EFF(9),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,4,"attachments")," "),Q.R7$(3),Q.Y8G("ngIf",t.cipherId),Q.R7$(2),Q.BMQ("form",t.attachmentFormId),Q.R7$(2),Q.SpI(" ",t.buttonText," "))},dependencies:[ln.t,mn.Q,U.MD,U.bT,cn.P,Mn.m,xn.hJ,Dn,dn.$Z],encapsulation:2});var Vn=i(86157),jn=i(69588),Nn=i(86639),zn=i(71373),Yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ln{constructor(e,t){this.passwordGenerationService=e,this.usernameGenerationService=t}generatePassword(){return Yn(this,void 0,void 0,function*(){const[e]=yield this.passwordGenerationService.getOptions();return yield this.passwordGenerationService.generatePassword(e)})}generateUsername(){return Yn(this,void 0,void 0,function*(){const e=yield this.usernameGenerationService.getOptions();return yield this.usernameGenerationService.generateUsername(e)})}}Ln.ɵfac=function(e){return new(e||Ln)(a.KVO(zn.JJ),a.KVO(zn.GL))},Ln.ɵprov=a.jDH({token:Ln,factory:Ln.ɵfac});var Kn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Xn{constructor(){this.cipherService=(0,a.WQX)(l.p),this.accountService=(0,a.WQX)(I.D),this.taskService=(0,a.WQX)(o.RB)}decryptCipher(e){return Kn(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));return yield this.cipherService.decrypt(e,t)})}saveCipher(e,t){return Kn(this,void 0,void 0,function*(){var i,n;const r=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));let s;if(null==e.id||""===e.id)return yield this.cipherService.createWithServer(e,r,t.admin);if(null==t.originalCipher)throw new Error("Original cipher is required for updating an existing cipher");const o=yield this.decryptCipher(t.originalCipher),a=new Set(null!==(i=t.originalCipher.collectionIds)&&void 0!==i?i:[]),l=new Set(null!==(n=e.collectionIds)&&void 0!==n?n:[]);if(null===t.originalCipher.organizationId&&null!=e.organizationId){const i=e.organizationId;e.organizationId=null,s=yield this.cipherService.shareWithServer(e,i,e.collectionIds,r,t.originalCipher)}else if(d=l,(c=a).size===d.size&&[...c].every(e=>d.has(e))){const i=yield this.cipherService.updateWithServer(e,r,o,t.admin);s=yield this.cipherService.encrypt(i,r).then(e=>e.cipher)}else{const i=e.collectionIds;e.collectionIds=t.originalCipher.collectionIds;const n=yield this.cipherService.updateWithServer(e,r,o,t.admin||0===a.size);n.collectionIds=i;const{cipher:l}=yield this.cipherService.encrypt(n,r);s=t.admin||0===a.size?yield this.cipherService.saveCollectionsWithServerAdmin(l):yield this.cipherService.saveCollectionsWithServer(l,r)}var c,d;return yield this.markAssociatedTaskAsComplete(r,e,t),null==s?null:yield this.cipherService.decrypt(s,r)})}markAssociatedTaskAsComplete(e,t,i){return Kn(this,void 0,void 0,function*(){var n;const s=yield this.cipherService.decrypt(i.originalCipher,e),a=yield(0,h._)(this.taskService.pendingTasks$(e).pipe((0,r.T)(e=>e.find(e=>e.type===o.Wn.UpdateAtRiskCredential&&e.cipherId===t.id)))),l=t.type===g.gC.Login&&t.login.password&&t.login.password!==(null===(n=null==s?void 0:s.login)||void 0===n?void 0:n.password);a&&l&&(yield this.taskService.markAsComplete(a.id,e))})}}Xn.ɵfac=function(e){return new(e||Xn)},Xn.ɵprov=a.jDH({token:Xn,factory:Xn.ɵfac});class qn{}qn.ɵfac=function(e){return new(e||qn)},qn.ɵmod=Q.$C({type:qn}),qn.ɵinj=a.G2t({providers:[{provide:jn.L,useClass:Xn},{provide:Vn.v,useClass:Ln}],imports:[Nn.z]});class Hn{}var Wn=i(69194),$n=i(18499),Jn=i(43978),Zn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _n{constructor(){this.policyService=(0,a.WQX)($n.m),this.organizationService=(0,a.WQX)(q.PV),this.cipherService=(0,a.WQX)(l.p),this.folderService=(0,a.WQX)(Ui.k),this.collectionService=(0,a.WQX)(K.YD),this.accountService=(0,a.WQX)(I.D),this.organizationDataOwnershipDisabled$=this.accountService.activeAccount$.pipe(H.F6,(0,j.n)(e=>this.policyService.policyAppliesToUser$(Jn.tt.OrganizationDataOwnership,e)),(0,r.T)(e=>!e))}buildConfig(e,t,i){return Zn(this,void 0,void 0,function*(){var s,o;const a=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6)),[l,c,d,u,A]=yield(0,h._)((0,n.z)([this.organizations$(a),this.collectionService.encryptedCollections$(a).pipe((0,r.T)(e=>null!=e?e:[]),(0,j.n)(e=>this.collectionService.decryptedCollections$(a).pipe((0,Wn.p)(t=>t.length===e.length)))),this.organizationDataOwnershipDisabled$,this.folderService.folders$(a).pipe((0,j.n)(e=>this.folderService.folderViews$(a).pipe((0,Wn.p)(t=>t.length>0||0===e.length)))),this.getCipher(a,t)]));return{mode:e,cipherType:null!==(o=null!==(s=null==A?void 0:A.type)&&void 0!==s?s:i)&&void 0!==o?o:g.gC.Login,admin:!1,organizationDataOwnershipDisabled:d,originalCipher:A,collections:c,organizations:l,folders:u}})}organizations$(e){return this.organizationService.organizations$(e).pipe((0,r.T)(e=>e.filter(e=>e.isMember&&e.enabled&&e.status===Jn.Zx.Confirmed)))}getCipher(e,t){return null==t?Promise.resolve(null):this.cipherService.get(t,e)}}_n.ɵfac=function(e){return new(e||_n)},_n.ɵprov=a.jDH({token:_n,factory:_n.ɵfac});var er=i(93161),tr=i(27545),ir=i(4162),nr=i(99327);function rr(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"tools-password-generator",2),Q.bIt("onGenerated",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.onCredentialGenerated(t))})("onAlgorithm",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.onAlgorithmSelected(t))}),Q.k0s()}if(2&e){const e=Q.XpG();Q.Y8G("disableMargin",e.disableMargin)}}function sr(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"tools-username-generator",3),Q.bIt("onGenerated",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.onCredentialGenerated(t))})("onAlgorithm",function(t){a.eBV(e);const i=Q.XpG();return a.Njj(i.onAlgorithmSelected(t))}),Q.k0s()}if(2&e){const e=Q.XpG();Q.Y8G("website",e.uri)("disableMargin",e.disableMargin)}}class or{constructor(){this.uri="",this.type="password",this.disableMargin=!1,this.algorithmSelected=new Q.bkB,this.valueGenerated=new Q.bkB,this.onAlgorithmSelected=e=>{this.algorithmSelected.emit(e)},this.onCredentialGenerated=e=>{this.valueGenerated.emit(e.credential)}}}or.ɵfac=function(e){return new(e||or)},or.ɵcmp=Q.VBU({type:or,selectors:[["vault-cipher-form-generator"]],inputs:{uri:"uri",type:"type",disableMargin:[2,"disableMargin","disableMargin",er.he]},outputs:{algorithmSelected:"algorithmSelected",valueGenerated:"valueGenerated"},decls:2,vars:2,consts:[[3,"disableMargin","onGenerated","onAlgorithm",4,"ngIf"],[3,"website","disableMargin","onGenerated","onAlgorithm",4,"ngIf"],[3,"onGenerated","onAlgorithm","disableMargin"],[3,"onGenerated","onAlgorithm","website","disableMargin"]],template:function(e,t){1&e&&Q.DNE(0,rr,1,1,"tools-password-generator",0)(1,sr,1,2,"tools-username-generator",1),2&e&&(Q.Y8G("ngIf","password"===t.type),Q.R7$(),Q.Y8G("ngIf","username"===t.type))},dependencies:[U.MD,U.bT,tr.Im,ir.M,nr.d],encapsulation:2});i(30623);var ar=i(27442),lr=i(61465),cr=i(8433),dr=i(89812),ur=i(33886),hr=i(68923),Ar=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function pr(e,t){if(1&e&&(Q.j41(0,"li")(1,"p"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()()),2&e){const e=Q.XpG();Q.R7$(2),Q.SpI(" ",Q.brH(3,1,"bulkCollectionAssignmentWarning",e.totalItemCount,e.readonlyItemCount)," ")}}function gr(e,t){if(1&e&&(Q.j41(0,"li")(1,"p"),Q.EFF(2),Q.k0s()()),2&e){const e=Q.XpG();Q.R7$(2),Q.SpI(" ",e.transferWarningText(e.orgName,e.personalItemsCount)," ")}}function vr(e,t){if(1&e&&Q.nrm(0,"bit-option",11),2&e){const e=t.$implicit;Q.Y8G("value",e.id)("label",e.name)}}function fr(e,t){if(1&e&&(Q.j41(0,"div",4)(1,"bit-form-field",8)(2,"bit-label"),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.j41(5,"bit-select",9),Q.DNE(6,vr,1,2,"bit-option",10),Q.nI1(7,"async"),Q.k0s()()()),2&e){const e=Q.XpG();Q.R7$(3),Q.JRh(Q.bMT(4,2,"moveToOrganization")),Q.R7$(3),Q.Y8G("ngForOf",Q.bMT(7,4,e.organizations$))}}function mr(e,t){if(1&e&&(Q.j41(0,"bit-hint",12),Q.EFF(1),Q.nI1(2,"i18n"),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.SpI(" ",Q.i5U(2,1,"cannotRemoveViewOnlyCollections",e.readOnlyCollectionNames.join(", "))," ")}}const yr={Saved:"saved",Canceled:"canceled"},Cr="MyVault";class wr{get selectedOrgId(){return this.formGroup.getRawValue().selectedOrg||this.params.organizationId}constructor(e,t,i,n,s,o,a){this.cipherService=e,this.i18nService=t,this.organizationService=i,this.collectionService=n,this.formBuilder=s,this.toastService=o,this.accountService=a,this.editableItemCountChange=new Q.bkB,this.onCollectionAssign=new Q.bkB,this.formGroup=this.formBuilder.group({selectedOrg:[null],collections:[[],[un.k0.required]]}),this.readOnlyCollectionNames=[],this.availableCollections=[],this.showOrgSelector=!1,this.organizations$=this.accountService.activeAccount$.pipe((0,j.n)(e=>this.organizationService.organizations$(null==e?void 0:e.id).pipe((0,r.T)(e=>e.filter(e=>e.enabled&&e.status===Jn.Zx.Confirmed).sort((e,t)=>e.name.localeCompare(t.name))),(0,Zt.M)(e=>{e.length>0&&this.showOrgSelector&&setTimeout(()=>{this.formGroup.patchValue({selectedOrg:e[0].id}),this.setFormValidators(),1===e.length&&this.formGroup.controls.selectedOrg.disable()})})))),this.transferWarningText=(e,t)=>{const i=!!e;return t>1&&i?this.i18nService.t("personalItemsWithOrgTransferWarningPlural",t,e):t>1&&!i?this.i18nService.t("personalItemsTransferWarningPlural",t):1===t&&i?this.i18nService.t("personalItemWithOrgTransferWarningSingular",e):this.i18nService.t("personalItemTransferWarningSingular")},this.editableItems=[],this.destroy$=new F.B,this.submit=()=>Ar(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.editableItems.filter(e=>e.organizationId).map(e=>e.id),t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));if(this.personalItemsCount>0&&(yield this.moveToOrganization(this.selectedOrgId,this.params.ciphers.filter(e=>null==e.organizationId),this.formGroup.controls.collections.value.map(e=>e.id),t)),e.length>0){const i=1===e.length&&0===this.personalItemsCount;yield i?this.updateAssignedCollections(this.editableItems[0],t):this.bulkUpdateCollections(e,t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("successfullyAssignedCollections")})}this.onCollectionAssign.emit(yr.Saved)}),this.sortItems=(e,t)=>this.i18nService.collator.compare(e.labelName,t.labelName)}ngOnInit(){return Ar(this,void 0,void 0,function*(){const e=this.params.ciphers.every(e=>null==e.organizationId);(this.selectedOrgId===Cr||e)&&(this.showOrgSelector=!0),yield this.initializeItems(this.selectedOrgId),this.selectedOrgId&&this.selectedOrgId!==Cr&&(yield this.handleOrganizationCiphers(this.selectedOrgId)),this.setupFormSubscriptions()})}ngAfterViewInit(){this.bitSubmit.loading$.pipe((0,T.Q)(this.destroy$)).subscribe(e=>{this.submitBtn&&this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,T.Q)(this.destroy$)).subscribe(e=>{this.submitBtn&&this.submitBtn.disabled.set(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}selectCollections(e){const t=[...this.formGroup.controls.collections.value,...e].sort(this.sortItems);this.formGroup.patchValue({collections:t})}handleOrganizationCiphers(e){return Ar(this,void 0,void 0,function*(){if(0==this.editableItemCount)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("nothingSelected")}),void this.onCollectionAssign.emit(yr.Canceled);const t=yield(0,h._)((0,H.F6)(this.accountService.activeAccount$)),i=yield(0,h._)(this.organizationService.organizations$(t).pipe((0,q.Sw)(e)));yield this.setReadOnlyCollectionNames();const n=this.canAccessDefaultCollection(this.params.availableCollections);this.availableCollections=this.params.availableCollections.filter(e=>n?e.canEditItems(i):e.canEditItems(i)&&e.type!==Bt.it.DefaultUserCollection).map(e=>({icon:e.type===Bt.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared",id:e.id,labelName:e.name,listName:e.name})),this.selectCollectionsAssignedToSingleCipher(),this.params.activeCollection&&this.selectCollections([{icon:"bwi-collection-shared",id:this.params.activeCollection.id,labelName:this.params.activeCollection.name,listName:this.params.activeCollection.name}])})}selectCollectionsAssignedToSingleCipher(){if(1!==this.params.ciphers.length)return;const e=this.params.ciphers[0].collectionIds,t=this.availableCollections.filter(t=>{var i;return e.includes(t.id)&&t.id!==(null===(i=this.params.activeCollection)||void 0===i?void 0:i.id)}).map(e=>({icon:e.icon,id:e.id,labelName:e.labelName,listName:e.listName}));t.length>0&&this.selectCollections(t)}initializeItems(e){return Ar(this,void 0,void 0,function*(){if(this.totalItemCount=this.params.ciphers.length,!e||e===Cr)return this.editableItems=this.params.ciphers,this.editableItemCount=this.params.ciphers.length,this.personalItemsCount=this.params.ciphers.length,void this.editableItemCountChange.emit(this.editableItemCount);const t=yield(0,h._)((0,H.F6)(this.accountService.activeAccount$)),i=yield(0,h._)(this.organizationService.organizations$(t).pipe((0,q.Sw)(e)));this.orgName=i.name,this.editableItems=i.canEditAllCiphers?this.params.ciphers:this.params.ciphers.filter(e=>e.edit),this.editableItemCount=this.editableItems.length,this.editableItemCountChange.emit(this.editableItemCount),this.personalItemsCount=this.params.ciphers.filter(e=>null==e.organizationId).length,this.readonlyItemCount=this.totalItemCount-this.editableItemCount})}setFormValidators(){const e=this.formGroup.get("selectedOrg");null==e||e.setValidators([un.k0.required]),null==e||e.updateValueAndValidity()}setupFormSubscriptions(){this.formGroup.controls.selectedOrg.valueChanges.pipe((0,Zt.M)(()=>{this.formGroup.controls.collections.setValue([],{emitEvent:!1})}),(0,j.n)(e=>this.getCollectionsForOrganization(e)),(0,T.Q)(this.destroy$)).subscribe(e=>{this.availableCollections=e.map(e=>({icon:e.type===Bt.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared",id:e.id,labelName:e.name,listName:e.name}))})}getCollectionsForOrganization(e){return this.accountService.activeAccount$.pipe(H.F6,(0,j.n)(e=>(0,n.z)([this.collectionService.decryptedCollections$(e),this.organizationService.organizations$(e)])),(0,r.T)(([t,i])=>{const n=i.find(t=>t.id===e);this.orgName=n.name;const r=t.filter(t=>t.organizationId===e),s=this.canAccessDefaultCollection(t);return r.filter(e=>s?!e.readOnly:!e.readOnly&&e.type!==Bt.it.DefaultUserCollection)}),(0,ar.t)({refCount:!0,bufferSize:1}))}moveToOrganization(e,t,i,n){return Ar(this,void 0,void 0,function*(){var r;yield this.cipherService.shareManyWithServer(t,e,i,n),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(1===t.length?"itemMovedToOrg":"itemsMovedToOrg",null!==(r=this.orgName)&&void 0!==r?r:this.i18nService.t("organization"))})})}bulkUpdateCollections(e,t){return Ar(this,void 0,void 0,function*(){this.formGroup.controls.collections.value.length>0&&(yield this.cipherService.bulkUpdateCollectionsWithServer(this.selectedOrgId,t,e,this.formGroup.controls.collections.value.map(e=>e.id),!1)),null!=this.params.activeCollection&&null==this.formGroup.controls.collections.value.find(e=>e.id===this.params.activeCollection.id)&&(yield this.cipherService.bulkUpdateCollectionsWithServer(this.selectedOrgId,t,e,[this.params.activeCollection.id],!0))})}updateAssignedCollections(e,t){return Ar(this,void 0,void 0,function*(){const{collections:i}=this.formGroup.getRawValue();e.collectionIds=i.map(e=>e.id);const{cipher:n}=yield this.cipherService.encrypt(e,t);this.params.isSingleCipherAdmin?yield this.cipherService.saveCollectionsWithServerAdmin(n):yield this.cipherService.saveCollectionsWithServer(n,t)})}setReadOnlyCollectionNames(){return Ar(this,void 0,void 0,function*(){const{availableCollections:e,ciphers:t}=this.params,i=yield(0,h._)(this.organizations$.pipe((0,r.T)(e=>e.find(e=>e.id===this.selectedOrgId))));this.readOnlyCollectionNames=e.filter(e=>e.readOnly&&t.some(t=>t.collectionIds.includes(e.id))&&!e.canEditItems(i)).map(e=>e.name)})}canAccessDefaultCollection(e){const t=Object.fromEntries(e.map(e=>[e.id,e])),i=this.params.ciphers.every(e=>!e.collectionIds.length||e.collectionIds.some(e=>{var i;return(null===(i=t[e])||void 0===i?void 0:i.type)===Bt.it.DefaultUserCollection}));return i}}function Ir(e,t){if(1&e&&(Q.j41(0,"bit-item")(1,"div",3),Q.nrm(2,"bit-color-password",4),Q.j41(3,"div",5),Q.EFF(4),Q.nI1(5,"date"),Q.k0s()(),Q.qex(6,6),Q.j41(7,"bit-item-action"),Q.nrm(8,"button",7),Q.nI1(9,"i18n"),Q.nI1(10,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()),2&e){const e=t.$implicit;Q.R7$(2),Q.Y8G("password",e.password)("showCount",!1),Q.R7$(2),Q.JRh(Q.i5U(5,6,e.lastUsedDate,"medium")),Q.R7$(4),Q.Y8G("label",Q.bMT(9,9,"copyPassword"))("appCopyClick",e.password)("valueLabel",Q.bMT(10,11,"password"))}}function br(e,t){if(1&e&&(Q.j41(0,"div"),Q.DNE(1,Ir,11,13,"bit-item",2),Q.k0s()),2&e){const e=Q.XpG();Q.R7$(),Q.Y8G("ngForOf",e.history)}}function Br(e,t){1&e&&(Q.j41(0,"div",8)(1,"p"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()()),2&e&&(Q.R7$(2),Q.JRh(Q.bMT(3,1,"noPasswordsInList")))}wr.ɵfac=function(e){return new(e||wr)(Q.rXU(l.p),Q.rXU(C.W),Q.rXU(q.PV),Q.rXU(K.YD),Q.rXU(un.ok),Q.rXU(m.f),Q.rXU(I.D))},wr.ɵcmp=Q.VBU({type:wr,selectors:[["assign-collections"]],viewQuery:function(e,t){if(1&e&&Q.GBs(pn.L,5),2&e){let e;Q.mGM(e=Q.lsd())&&(t.bitSubmit=e.first)}},inputs:{params:"params",submitBtn:"submitBtn"},outputs:{editableItemCountChange:"editableItemCountChange",onCollectionAssign:"onCollectionAssign"},decls:15,vars:13,consts:[["id","assign_collections_form",3,"formGroup","bitSubmit"],[1,"tw-list-disc","tw-pl-5","tw-space-y-2","tw-break-words"],[4,"ngIf"],["class","tw-flex",4,"ngIf"],[1,"tw-flex"],["disableMargin","",1,"tw-grow","tw-max-w-full"],["formControlName","collections",1,"tw-w-full",3,"baseItems"],["data-testid","view-only-hint",4,"ngIf"],[1,"tw-grow","tw-max-w-full"],["formControlName","selectedOrg"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-business",3,"value","label"],["data-testid","view-only-hint"]],template:function(e,t){1&e&&(Q.j41(0,"form",0)(1,"p"),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"ul",1),Q.DNE(5,pr,4,5,"li",2)(6,gr,3,1,"li",2),Q.k0s(),Q.DNE(7,fr,8,6,"div",3),Q.j41(8,"div",4)(9,"bit-form-field",5)(10,"bit-label"),Q.EFF(11),Q.nI1(12,"i18n"),Q.k0s(),Q.nrm(13,"bit-multi-select",6),Q.DNE(14,mr,3,4,"bit-hint",7),Q.k0s()()()),2&e&&(Q.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),Q.R7$(2),Q.SpI(" ",Q.bMT(3,9,1===t.personalItemsCount?"bulkCollectionAssignmentDialogDescriptionSingular":"bulkCollectionAssignmentDialogDescriptionPlural")," "),Q.R7$(3),Q.Y8G("ngIf",t.readonlyItemCount>0),Q.R7$(),Q.Y8G("ngIf",t.personalItemsCount>0),Q.R7$(),Q.Y8G("ngIf",t.showOrgSelector),Q.R7$(4),Q.JRh(Q.bMT(12,11,"selectCollectionsToAssign")),Q.R7$(2),Q.Y8G("baseItems",t.availableCollections),Q.R7$(),Q.Y8G("ngIf",t.readOnlyCollectionNames.length>0))},dependencies:[U.MD,U.Sq,U.bT,X.p,ae.L,Ae.j,oi.I,dr.b,pe.h,Ie.C,pn.L,lr.i,cr.p,ur.w,hr.P,un.X1,un.qT,un.BC,un.cb,un.j4,un.JD,ln.t,cn.P,U.Jj,ve.$],encapsulation:2});class Er{constructor(){this.history=[]}ngOnInit(){this.history=null==this.cipher.passwordHistory?[]:this.cipher.passwordHistory}}function Sr(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"li",9,0),Q.bIt("click",function(){a.eBV(e);const t=Q.sdS(1),i=Q.XpG();return a.Njj(i.selectText(t))}),Q.EFF(2),Q.k0s()}if(2&e){const e=t.$implicit;Q.R7$(2),Q.SpI(" ",e," ")}}Er.ɵfac=function(e){return new(e||Er)},Er.ɵcmp=Q.VBU({type:Er,selectors:[["vault-password-history-view"]],inputs:{cipher:"cipher"},decls:2,vars:2,consts:[[4,"ngIf"],["class","tw-absolute tw-top-1/2 tw-left-1/2 tw-transform tw--translate-x-1/2 tw--translate-y-1/2 tw-text-center",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tw-pl-3","tw-py-2"],[1,"tw-text-base",3,"password","showCount"],[1,"tw-text-sm","tw-text-muted"],["slot","end"],["type","button","bitIconButton","bwi-clone","appStopClick","","showToast","",3,"label","appCopyClick","valueLabel"],[1,"tw-absolute","tw-top-1/2","tw-left-1/2","tw-transform","tw--translate-x-1/2","tw--translate-y-1/2","tw-text-center"]],template:function(e,t){1&e&&Q.DNE(0,br,2,1,"div",0)(1,Br,4,3,"div",1),2&e&&(Q.Y8G("ngIf",t.history&&t.history.length),Q.R7$(),Q.Y8G("ngIf",!(null!=t.history&&t.history.length)))},dependencies:[U.MD,U.Sq,U.bT,ye.k,Te.J,Pe.D,_e.p,ot.S,re.Q,de.s,X.p,nt.Y,le.D,U.vh,ve.$],encapsulation:2});class Qr{constructor(){this.dialogRef=(0,a.WQX)(gn.ce),this.params=(0,a.WQX)(an.Qs),this.platformUtilsService=(0,a.WQX)(f.y)}selectText(e){const t=window.getSelection();if(null==t)return;t.removeAllRanges();const i=document.createRange();i.selectNodeContents(e),t.addRange(i)}openContactSupport(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/contact")}static open(e,t){return e.open(Qr,{data:t,positionStrategy:new gn.u3})}}Qr.ɵfac=function(e){return new(e||Qr)},Qr.ɵcmp=Q.VBU({type:Qr,selectors:[["vault-decryption-failure-dialog"]],decls:20,vars:16,consts:[["listItem",""],["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl","bwi-exclamation-triangle","tw-text-warning"],["bitDialogTitle",""],["bitDialogContent",""],["bitLink","","href","#",3,"click"],[1,"tw-list-none","tw-pl-0"],["class","tw-text-code tw-font-mono tw-py-0.5",3,"click",4,"ngFor","ngForOf"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary",3,"click"],[1,"tw-text-code","tw-font-mono","tw-py-0.5",3,"click"]],template:function(e,t){1&e&&(Q.j41(0,"bit-simple-dialog"),Q.nrm(1,"i",1),Q.j41(2,"span",2),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.j41(5,"div",3)(6,"p"),Q.EFF(7),Q.nI1(8,"i18n"),Q.j41(9,"a",4),Q.bIt("click",function(e){return t.openContactSupport(e)}),Q.EFF(10),Q.nI1(11,"i18n"),Q.k0s(),Q.EFF(12),Q.nI1(13,"i18n"),Q.k0s(),Q.j41(14,"ul",5),Q.DNE(15,Sr,3,1,"li",6),Q.k0s()(),Q.qex(16,7),Q.j41(17,"button",8),Q.bIt("click",function(){return t.dialogRef.close(!1)}),Q.EFF(18),Q.nI1(19,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,6,"decryptionError")),Q.R7$(4),Q.SpI(" ",Q.bMT(8,8,"couldNotDecryptVaultItemsBelow")," "),Q.R7$(3),Q.JRh(Q.bMT(11,10,"contactCSToAvoidDataLossPart1")),Q.R7$(2),Q.SpI(" ",Q.bMT(13,12,"contactCSToAvoidDataLossPart2")," "),Q.R7$(3),Q.Y8G("ngForOf",t.params.cipherIds),Q.R7$(3),Q.SpI(" ",Q.bMT(19,14,"close")," "))},dependencies:[cn.P,xn.LJ,xn.hJ,xn.o_,U.MD,U.Sq,ie.E,X.p,Ie.C,ln.t,mn.Q,te.g,ve.$],encapsulation:2});class kr{constructor(e,t){this.params=e,this.dialogRef=t,this.cipher=e.cipher}close(){this.dialogRef.close()}}function Tr(e,t){return e.open(kr,t)}kr.ɵfac=function(e){return new(e||kr)(Q.rXU(an.Qs),Q.rXU(gn.ce))},kr.ɵcmp=Q.VBU({type:kr,selectors:[["app-vault-password-history"]],decls:10,vars:7,consts:[["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"cipher"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"click"]],template:function(e,t){1&e&&(Q.j41(0,"bit-dialog",0)(1,"span",1),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.qex(4,2),Q.nrm(5,"vault-password-history-view",3),Q.bVm(),Q.qex(6,4),Q.j41(7,"button",5),Q.bIt("click",function(){return t.close()}),Q.EFF(8),Q.nI1(9,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,3,"passwordHistory")," "),Q.R7$(3),Q.Y8G("cipher",t.cipher),Q.R7$(3),Q.SpI(" ",Q.bMT(9,5,"close")," "))},dependencies:[ln.t,mn.Q,U.MD,Ie.C,cn.P,Mn.m,xn.hJ,Er,dn.$Z],encapsulation:2});var Fr=i(41103),Pr=i(7730),Rr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Dr=["submitBtn"];function Mr(e,t){if(1&e&&(Q.nrm(0,"button",10),Q.nI1(1,"i18n")),2&e){const e=Q.XpG();Q.Y8G("label",Q.bMT(1,2,"deleteFolder"))("bitAction",e.deleteFolder)}}const xr={Created:"created",Deleted:"deleted"};class Or{constructor(e,t,i,n,s,o,l,c,d,u,A){this.formBuilder=e,this.folderService=t,this.folderApiService=i,this.accountService=n,this.keyService=s,this.toastService=o,this.i18nService=l,this.logService=c,this.dialogService=d,this.dialogRef=u,this.data=A,this.folder=new St.u,this.variant="add",this.folderForm=this.formBuilder.group({name:["",un.k0.required]}),this.activeUserId$=this.accountService.activeAccount$.pipe((0,r.T)(e=>null==e?void 0:e.id)),this.destroyRef=(0,a.WQX)(a.abz),this.submit=()=>Rr(this,void 0,void 0,function*(){var e;if(!this.folderForm.invalid){this.folder.name=null!==(e=this.folderForm.controls.name.value)&&void 0!==e?e:"";try{const e=yield(0,h._)(this.activeUserId$),t=yield this.keyService.getUserKey(e),i=yield this.folderService.encrypt(this.folder,t);yield this.folderApiService.save(i,e),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("editedFolder")}),this.close(xr.Created)}catch(t){this.logService.error(t)}}}),this.deleteFolder=()=>Rr(this,void 0,void 0,function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"deleteFolder"},content:{key:"deleteFolderPermanently"},type:"warning"})){try{const e=yield(0,h._)(this.activeUserId$);yield this.folderApiService.delete(this.folder.id,e),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deletedFolder")})}catch(e){this.logService.error(e)}this.close(xr.Deleted)}})}ngOnInit(){var e;(null===(e=this.data)||void 0===e?void 0:e.editFolderConfig)?(this.variant="edit",this.folderForm.controls.name.setValue(this.data.editFolderConfig.folder.name),this.folder=this.data.editFolderConfig.folder):this.folder=new St.u}ngAfterViewInit(){var e;null===(e=this.bitSubmit)||void 0===e||e.loading$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn&&this.submitBtn.loading.set(e)})}close(e){this.dialogRef.close(e)}static open(e,t){return e.open(Or,{data:t})}}Or.ɵfac=function(e){return new(e||Or)(Q.rXU(un.ok),Q.rXU(Ui.k),Q.rXU(Fr.w),Q.rXU(I.D),Q.rXU(Ce.Lu),Q.rXU(m.f),Q.rXU(C.W),Q.rXU($.K),Q.rXU(gn.o3),Q.rXU(gn.ce),Q.rXU(an.Qs))},Or.ɵcmp=Q.VBU({type:Or,selectors:[["vault-add-edit-folder-dialog"]],viewQuery:function(e,t){if(1&e&&(Q.GBs(pn.L,5),Q.GBs(Dr,5)),2&e){let e;Q.mGM(e=Q.lsd())&&(t.bitSubmit=e.first),Q.mGM(e=Q.lsd())&&(t.submitBtn=e.first)}},decls:22,vars:19,consts:[["submitBtn",""],["bit-dialog","","id","add-edit-folder",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin",""],["bitInput","","id","folderName","formControlName","name","type","text"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","form","add-edit-folder",3,"disabled"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"],["type","button","buttonType","dangerGhost","class","tw-ml-auto","bitIconButton","bwi-trash",3,"label","bitAction",4,"ngIf"],["type","button","buttonType","dangerGhost","bitIconButton","bwi-trash",1,"tw-ml-auto",3,"label","bitAction"]],template:function(e,t){1&e&&(Q.j41(0,"form",1)(1,"span",2),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"div",3)(5,"bit-form-field",4)(6,"bit-label"),Q.EFF(7),Q.nI1(8,"i18n"),Q.k0s(),Q.nrm(9,"input",5),Q.j41(10,"bit-hint"),Q.EFF(11),Q.nI1(12,"i18n"),Q.k0s()()(),Q.qex(13,6),Q.j41(14,"button",7,0),Q.EFF(16),Q.nI1(17,"i18n"),Q.k0s(),Q.j41(18,"button",8),Q.EFF(19),Q.nI1(20,"i18n"),Q.k0s(),Q.DNE(21,Mr,2,4,"button",9),Q.bVm(),Q.k0s()),2&e&&(Q.Y8G("formGroup",t.folderForm)("bitSubmit",t.submit),Q.R7$(2),Q.SpI(" ",Q.bMT(3,9,"add"===t.variant?"newFolder":"editFolder")," "),Q.R7$(5),Q.JRh(Q.bMT(8,11,"folderName")),Q.R7$(4),Q.SpI(" ",Q.bMT(12,13,"folderHintText")," "),Q.R7$(3),Q.Y8G("disabled",t.folderForm.invalid),Q.R7$(2),Q.SpI(" ",Q.bMT(17,15,"save")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(20,17,"cancel")," "),Q.R7$(2),Q.Y8G("ngIf","edit"===t.variant))},dependencies:[U.MD,U.bT,X.p,cn.P,Pr.I,Mn.m,xn.hJ,ln.t,mn.Q,ae.L,Ae.j,oi.I,ue.J,pe.h,un.X1,un.qT,un.me,un.BC,un.cb,un.j4,un.JD,re.Q,de.s,Ie.C,Ee.p,pn.L,ve.$],encapsulation:2});var Gr=i(37831);const Ur=e=>({"tw-px-4 tw-py-5":e});function Vr(e,t){if(1&e&&(Q.j41(0,"div",0),Q.SdG(1),Q.k0s()),2&e){const e=Q.XpG();Q.Y8G("ngClass",Q.eq3(2,Ur,!e.disablePadding)),Q.BMQ("tabIndex",e.noFocusableChildren?0:void 0)}}class jr{get content(){return this._contentPortal}constructor(e){this.viewContainerRef=e,this.disablePadding=!1,this._contentPortal=null}ngOnInit(){this._contentPortal=new Gr.VA(this.implicitContent,this.viewContainerRef)}}jr.ɵfac=function(e){return new(e||jr)(Q.rXU(Q.c1b))},jr.ɵcmp=Q.VBU({type:jr,selectors:[["vault-carousel-slide"]],viewQuery:function(e,t){if(1&e&&Q.GBs(Q.C4Q,7),2&e){let e;Q.mGM(e=Q.lsd())&&(t.implicitContent=e.first)}},inputs:{label:"label",disablePadding:[2,"disablePadding","disablePadding",D.L39],noFocusableChildren:[2,"noFocusableChildren","noFocusableChildren",er.he]},ngContentSelectors:["*"],decls:1,vars:0,consts:[["role","tabpanel",3,"ngClass"]],template:function(e,t){1&e&&(Q.NAR(),Q.DNE(0,Vr,2,4,"ng-template"))},dependencies:[U.MD,U.YU],encapsulation:2});var Nr=i(58716),zr=i(58363);const Yr=i(82392).JW`
  <svg class="tw-block" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="inactive-carousel-icon">
    <rect class="tw-stroke-current" x="0.5" y="0.5" width="11" height="11" rx="5.5" />
  </svg>
`;var Lr=i(45383),Kr=i(8168);const Xr=["btn"];class qr{constructor(){this.CarouselIcon=Yr,this.onClick=new Q.bkB}focus(){this.button.nativeElement.focus()}get dynamicClasses(){return this.isActive?["[&_rect]:tw-fill-primary-600","tw-text-primary-600"]:["tw-text-muted","[&_rect]:hover:tw-fill-text-muted","focus-visible:tw-text-info-700"]}}function Hr(e,t){}qr.ɵfac=function(e){return new(e||qr)},qr.ɵcmp=Q.VBU({type:qr,selectors:[["vault-carousel-button"]],viewQuery:function(e,t){if(1&e&&Q.GBs(Xr,7),2&e){let e;Q.mGM(e=Q.lsd())&&(t.button=e.first)}},inputs:{slide:"slide",isActive:"isActive"},outputs:{onClick:"onClick"},decls:3,vars:5,consts:[["btn",""],["type","button","role","tab",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center","tw-border-2","tw-border-solid","tw-rounded-full","tw-transition","tw-bg-transparent","tw-border-transparent","focus-visible:tw-outline-none","focus-visible:tw-border-primary-600",3,"click","ngClass"],[3,"content"]],template:function(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",1,0),Q.bIt("click",function(){return a.eBV(e),a.Njj(t.onClick.emit())}),Q.nrm(2,"bit-svg",2),Q.k0s()}2&e&&(Q.Y8G("ngClass",t.dynamicClasses),Q.BMQ("aria-selected",t.isActive)("tabindex",t.isActive?0:-1)("aria-label",t.slide.label),Q.R7$(2),Q.Y8G("content",t.CarouselIcon))},dependencies:[U.MD,U.YU,Lr.Z,Kr.k],encapsulation:2});class Wr{}Wr.ɵfac=function(e){return new(e||Wr)},Wr.ɵcmp=Q.VBU({type:Wr,selectors:[["vault-carousel-content"]],inputs:{content:"content"},decls:2,vars:1,consts:[["aria-live","polite","aria-atomic","false",1,"tw-m-auto","tw-text-main"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(Q.j41(0,"div",0),Q.DNE(1,Hr,0,0,"ng-template",1),Q.k0s()),2&e&&(Q.R7$(),Q.Y8G("cdkPortalOutlet",t.content))},dependencies:[Gr.I3],encapsulation:2});var $r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Jr=["container"],Zr=["carouselButtonWrapper"],_r=["tempSlideContainer"],es=e=>({minHeight:e});function ts(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"vault-carousel-button",11),Q.bIt("onClick",function(){const t=a.eBV(e).index,i=Q.XpG();return a.Njj(i.selectSlide(t))}),Q.k0s()}if(2&e){const e=t.$implicit,i=t.index,n=Q.XpG();Q.Y8G("slide",e)("isActive",i===n.selectedIndex)}}function is(e,t){}function ns(e,t){1&e&&(Q.j41(0,"div",12,2),Q.DNE(2,is,0,0,"ng-template",13),Q.k0s())}class rs{constructor(e,t){this.ngZone=e,this.destroyRef=t,this.changeDetectorRef=(0,a.WQX)(D.gRc),this.label="",this.slideChange=new Q.bkB,this.selectedIndex=0,this.minHeight=null,this.keyManager=null}selectSlide(e){this.selectedIndex=e,this.slideChange.emit(e)}nextSlide(){this.selectedIndex<this.slides.length-1&&this.selectSlide(this.selectedIndex+1)}prevSlide(){this.selectedIndex>0&&this.selectSlide(this.selectedIndex-1)}ngAfterViewInit(){return $r(this,void 0,void 0,function*(){this.keyManager=new Nr.B(this.carouselButtons).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd(),this.keyManager.setFirstItemActive(),this.ngZone.onStable.pipe((0,zr.s)(1),(0,M.pQ)(this.destroyRef)).subscribe(()=>{this.setMinHeightOfCarousel()})})}setMinHeightOfCarousel(){return $r(this,void 0,void 0,function*(){const e=this.carouselButtonWrapper.nativeElement.offsetHeight,t=this.carouselContainer.nativeElement.offsetWidth,i=this.carouselContainer.nativeElement.offsetHeight;this.tempSlideContainer.nativeElement.style.width=`${t}px`;let n=i-e;for(let r=0;r<this.slides.length;r++)r!==this.selectedIndex&&(this.tempSlideOutlet.attach(this.slides.get(r).content),yield new Promise(requestAnimationFrame),this.tempSlideContainer.nativeElement.offsetHeight>n&&(n=this.tempSlideContainer.nativeElement.offsetHeight),this.tempSlideOutlet.detach());this.minHeight=`${n+e}px`,this.changeDetectorRef.detectChanges()})}}rs.ɵfac=function(e){return new(e||rs)(Q.rXU(Q.SKi),Q.rXU(a.abz))},rs.ɵcmp=Q.VBU({type:rs,selectors:[["vault-carousel"]],contentQueries:function(e,t,i){if(1&e&&Q.wni(i,jr,4),2&e){let e;Q.mGM(e=Q.lsd())&&(t.slides=e)}},viewQuery:function(e,t){if(1&e&&(Q.GBs(Jr,5),Q.GBs(Zr,5),Q.GBs(_r,5),Q.GBs(Gr.I3,5),Q.GBs(qr,5)),2&e){let e;Q.mGM(e=Q.lsd())&&(t.carouselContainer=e.first),Q.mGM(e=Q.lsd())&&(t.carouselButtonWrapper=e.first),Q.mGM(e=Q.lsd())&&(t.tempSlideContainer=e.first),Q.mGM(e=Q.lsd())&&(t.tempSlideOutlet=e.first),Q.mGM(e=Q.lsd())&&(t.carouselButtons=e)}},inputs:{label:"label"},outputs:{slideChange:"slideChange"},decls:12,vars:17,consts:[["container",""],["carouselButtonWrapper",""],["tempSlideContainer",""],["aria-roledescription","carousel",1,"tw-flex","tw-flex-col",3,"ngStyle"],[3,"content"],[1,"tw-w-full","tw-flex","tw-justify-between","tw-mt-auto","tw-px-4","tw-pb-2","tw-pt-4"],["type","button","bitIconButton","bwi-angle-left","size","small",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center",3,"click","disabled","label"],["role","tablist",1,"tw-w-full","tw-flex","tw-gap-2","tw-justify-center","tw-mt-auto",3,"keydown"],[3,"slide","isActive","onClick",4,"ngFor","ngForOf"],["type","button","bitIconButton","bwi-angle-right","size","small",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center",3,"click","disabled","label"],["class","tw-absolute tw-invisible",4,"ngIf"],[3,"onClick","slide","isActive"],[1,"tw-absolute","tw-invisible"],["cdkPortalOutlet",""]],template:function(e,t){var i;if(1&e){const e=Q.RV6();Q.j41(0,"section",3,0),Q.nrm(2,"vault-carousel-content",4),Q.j41(3,"div",5)(4,"button",6),Q.nI1(5,"i18n"),Q.bIt("click",function(){return a.eBV(e),a.Njj(t.prevSlide())}),Q.k0s(),Q.j41(6,"div",7,1),Q.bIt("keydown",function(i){return a.eBV(e),a.Njj(t.keyManager.onKeydown(i))}),Q.DNE(8,ts,1,2,"vault-carousel-button",8),Q.k0s(),Q.j41(9,"button",9),Q.nI1(10,"i18n"),Q.bIt("click",function(){return a.eBV(e),a.Njj(t.nextSlide())}),Q.k0s()(),Q.DNE(11,ns,3,0,"div",10),Q.k0s()}if(2&e){let e;Q.Y8G("ngStyle",Q.eq3(15,es,null!==(i=t.minHeight)&&void 0!==i?i:void 0)),Q.BMQ("aria-label",t.label),Q.R7$(2),Q.Y8G("content",null==(e=t.slides.get(t.selectedIndex))?null:e.content),Q.R7$(2),Q.Y8G("label",Q.mNQ(Q.bMT(5,11,"back")))("disabled",t.selectedIndex<=0),Q.R7$(4),Q.Y8G("ngForOf",t.slides),Q.R7$(),Q.Y8G("label",Q.mNQ(Q.bMT(10,13,"next")))("disabled",t.selectedIndex>=t.slides.length-1),Q.R7$(2),Q.Y8G("ngIf",null===t.minHeight)}},dependencies:[Gr.I3,U.MD,U.Sq,U.bT,U.B3,X.p,re.Q,de.s,ln.t,Wr,qr,ve.$],encapsulation:2});class ss{}ss.ɵfac=function(e){return new(e||ss)},ss.ɵmod=Q.$C({type:ss}),ss.ɵinj=a.G2t({imports:[rs,jr]});var os=i(66983);const as=Object.freeze([{type:g.gC.Login,icon:"bwi-globe",labelKey:"typeLogin"},{type:g.gC.Card,icon:"bwi-credit-card",labelKey:"typeCard"},{type:g.gC.Identity,icon:"bwi-id-card",labelKey:"typeIdentity"},{type:g.gC.SecureNote,icon:"bwi-sticky-note",labelKey:"typeNote"},{type:g.gC.SshKey,icon:"bwi-key",labelKey:"typeSshKey"}]);var ls=i(90647),cs=i(79783),ds=i(13496),us=i(53997),hs=i(78952),As=i(32924),ps=i(38411);const gs=(e,t)=>t.type;function vs(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",7),Q.bIt("click",function(){const t=a.eBV(e).$implicit,i=Q.XpG(2);return a.Njj(i.cipherAdded.emit(t.type))}),Q.nrm(1,"i",8),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()}if(2&e){const e=t.$implicit;Q.R7$(),Q.HbH(Q.VkB("bwi ",e.icon)),Q.R7$(),Q.SpI(" ",Q.bMT(3,4,e.labelKey)," ")}}function fs(e,t){1&e&&Q.nrm(0,"bit-menu-divider")}function ms(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",7),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.folderAdded.emit())}),Q.nrm(1,"i",9),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()}2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,1,"folder")," "))}function ys(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",7),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG(2);return a.Njj(t.collectionAdded.emit())}),Q.nrm(1,"i",10),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s()}2&e&&(Q.R7$(2),Q.SpI(" ",Q.bMT(3,1,"collection")," "))}function Cs(e,t){if(1&e){const e=Q.RV6();Q.qex(0),Q.j41(1,"div")(2,"button",2),Q.nI1(3,"i18n"),Q.bIt("click",function(){a.eBV(e);const t=Q.XpG();return a.Njj(t.handleButtonClick())}),Q.nrm(4,"i",3),Q.EFF(5),Q.nI1(6,"i18n"),Q.k0s(),Q.j41(7,"bit-menu",4,0),Q.Z7z(9,vs,4,6,"button",5,gs),Q.nI1(11,"async"),Q.DNE(12,fs,1,0,"bit-menu-divider",1)(13,ms,4,3,"button",6)(14,ys,4,3,"button",6),Q.k0s()(),Q.bVm()}if(2&e){const e=Q.sdS(8),t=Q.XpG();Q.R7$(2),Q.Y8G("bitMenuTriggerFor",t.isOnlyCollectionCreation()?null:e)("appA11yTitle",Q.bMT(3,11,t.getButtonLabel()))("bitPopoverAnchorFor",t.coachmarkPopover())("popoverOpen",t.coachmarkPopoverOpen())("position",t.coachmarkPosition())("spotlight",!!t.coachmarkPopover())("closeOnBackdropClick",!1),Q.R7$(3),Q.SpI(" ",Q.bMT(6,13,t.getButtonLabel())," "),Q.R7$(4),Q.Dyx(Q.bMT(11,15,t.cipherMenuItems$)),Q.R7$(3),Q.Y8G("ngIf",t.canCreateCipher()),Q.R7$(),Q.Y8G("ngIf",t.canCreateFolder()),Q.R7$(),Q.Y8G("ngIf",t.canCreateCollection())}}class ws{constructor(e){this.restrictedItemTypesService=e,this.canCreateCipher=(0,D.hFB)(!1),this.canCreateFolder=(0,D.hFB)(!1),this.canCreateCollection=(0,D.hFB)(!1),this.canCreateSshKey=(0,D.hFB)(!1),this.coachmarkPopover=(0,D.hFB)(),this.coachmarkPopoverOpen=(0,D.hFB)(!1),this.coachmarkPosition=(0,D.hFB)(),this.folderAdded=(0,D.CGW)(),this.collectionAdded=(0,D.CGW)(),this.cipherAdded=(0,D.CGW)(),this.cipherMenuItems$=(0,n.z)([this.restrictedItemTypesService.restricted$,(0,M.br)(this.canCreateCipher),(0,M.br)(this.canCreateSshKey)]).pipe((0,r.T)(([e,t,i])=>t?as.filter(t=>!(!i&&t.type===g.gC.SshKey)&&!e.some(e=>e.cipherType===t.type)):[]),(0,ar.t)({bufferSize:1,refCount:!0}))}getButtonLabel(){const e=this.canCreateCipher(),t=this.canCreateFolder(),i=this.canCreateCollection();return e||t||!i?"new":"newCollection"}isOnlyCollectionCreation(){return!this.canCreateCipher()&&!this.canCreateFolder()&&this.canCreateCollection()}handleButtonClick(){this.isOnlyCollectionCreation()&&this.collectionAdded.emit()}}ws.ɵfac=function(e){return new(e||ws)(Q.rXU(os.b))},ws.ɵcmp=Q.VBU({type:ws,selectors:[["vault-new-cipher-menu"]],inputs:{canCreateCipher:[1,"canCreateCipher"],canCreateFolder:[1,"canCreateFolder"],canCreateCollection:[1,"canCreateCollection"],canCreateSshKey:[1,"canCreateSshKey"],coachmarkPopover:[1,"coachmarkPopover"],coachmarkPopoverOpen:[1,"coachmarkPopoverOpen"],coachmarkPosition:[1,"coachmarkPosition"]},outputs:{folderAdded:"folderAdded",collectionAdded:"collectionAdded",cipherAdded:"cipherAdded"},decls:1,vars:1,consts:[["addOptions",""],[4,"ngIf"],["bitButton","","buttonType","primary","type","button","id","newItemDropdown",3,"click","bitMenuTriggerFor","appA11yTitle","bitPopoverAnchorFor","popoverOpen","position","spotlight","closeOnBackdropClick"],["aria-hidden","true",1,"bwi","bwi-plus","tw-me-2"],["aria-labelledby","newItemDropdown"],["type","button","bitMenuItem",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["slot","start","aria-hidden","true"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-folder"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection-shared"]],template:function(e,t){1&e&&Q.DNE(0,Cs,15,17,"ng-container",1),2&e&&Q.Y8G("ngIf",t.canCreateCipher()||t.canCreateCollection()||t.canCreateFolder())},dependencies:[ln.t,mn.Q,U.MD,U.bT,ls.M,ds.Z,us.O,hs.S,As.M,cs.k,ps.d,X.p,yn.C,U.Jj,dn.$Z],encapsulation:2});var Is=i(85800),bs=i(63581);class Bs{constructor(){this.platformUtilService=(0,a.WQX)(f.y)}openLearnMore(e){e.preventDefault(),this.platformUtilService.launchUri("https://bitwarden.com/help/website-icons/")}}Bs.ɵfac=function(e){return new(e||Bs)},Bs.ɵcmp=Q.VBU({type:Bs,selectors:[["vault-permit-cipher-details-popover"]],decls:14,vars:13,consts:[["permitDetailsPopover",""],["type","button","position","above-center","bitLink","",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-p-0",3,"bitPopoverTriggerFor","appA11yTitle"],[1,"bwi","bwi-question-circle"],[3,"title"],[1,"tw-flex","tw-gap-1.5","tw-items-center"],["bitLink","","href","#",1,"tw-flex",3,"click"],["slot","end","aria-hidden","true",1,"bwi","bwi-external-link","tw-text-primary-600"]],template:function(e,t){if(1&e){const e=Q.RV6();Q.j41(0,"button",1),Q.nI1(1,"i18n"),Q.nrm(2,"i",2),Q.k0s(),Q.j41(3,"bit-popover",3,0),Q.nI1(5,"i18n"),Q.j41(6,"p"),Q.EFF(7),Q.nI1(8,"i18n"),Q.k0s(),Q.j41(9,"div",4)(10,"a",5),Q.bIt("click",function(i){return a.eBV(e),a.Njj(t.openLearnMore(i))}),Q.EFF(11),Q.nI1(12,"i18n"),Q.k0s(),Q.nrm(13,"i",6),Q.k0s()()}if(2&e){const e=Q.sdS(4);Q.Y8G("bitPopoverTriggerFor",e)("appA11yTitle",Q.bMT(1,5,"aboutThisSetting")),Q.R7$(3),Q.Y8G("title",Q.bMT(5,7,"aboutThisSetting")),Q.R7$(4),Q.SpI(" ",Q.bMT(8,9,"permitCipherDetailsDescription")," "),Q.R7$(4),Q.SpI(" ",Q.bMT(12,11,"learnMore")," ")}},dependencies:[cs.k,Is.r,bs.k,X.p,yn.C,Yt.V,te.g,ve.$],encapsulation:2});var Es=i(55807);const Ss=Object.freeze({Accepted:"accepted",Declined:"declined"});class Qs{constructor(){this.params=(0,a.WQX)(an.Qs),this.dialogRef=(0,a.WQX)(gn.ce),this.platformUtilsService=(0,a.WQX)(f.y),this.organizationName=this.params.organizationName}acceptTransfer(){this.dialogRef.close(Ss.Accepted)}decline(){this.dialogRef.close(Ss.Declined)}openLearnMore(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/transfer-ownership/")}static open(e,t){return e.open(Qs,Object.assign({positionStrategy:new gn.u3,disableClose:!0},t))}}Qs.ɵfac=function(e){return new(e||Qs)},Qs.ɵcmp=Q.VBU({type:Qs,selectors:[["ng-component"]],decls:22,vars:23,consts:[["hideIcon",""],["bitDialogTitle",""],["bitDialogContent",""],["bitLink","","href","#","endIcon","bwi-external-link",3,"click","aria-label"],[1,"tw-mb-0"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click"],["bitLink","","type","button","linkType","primary",1,"tw-mt-1","tw-self-center","tw-text-sm",3,"click"]],template:function(e,t){1&e&&(Q.j41(0,"bit-simple-dialog",0)(1,"span",1),Q.EFF(2),Q.nI1(3,"i18n"),Q.k0s(),Q.j41(4,"span",2)(5,"p"),Q.EFF(6),Q.nI1(7,"i18n"),Q.j41(8,"a",3),Q.nI1(9,"i18n"),Q.bIt("click",function(e){return t.openLearnMore(e)}),Q.EFF(10),Q.nI1(11,"i18n"),Q.k0s()(),Q.j41(12,"p",4),Q.EFF(13),Q.nI1(14,"i18n"),Q.k0s()(),Q.qex(15,5),Q.j41(16,"button",6),Q.bIt("click",function(){return t.acceptTransfer()}),Q.EFF(17),Q.nI1(18,"i18n"),Q.k0s(),Q.j41(19,"button",7),Q.bIt("click",function(){return t.decline()}),Q.EFF(20),Q.nI1(21,"i18n"),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.R7$(2),Q.JRh(Q.i5U(3,7,"transferItemsToOrganizationTitle",t.organizationName)),Q.R7$(4),Q.SpI(" ",Q.i5U(7,10,"transferItemsToOrganizationDescription",t.organizationName)," "),Q.R7$(2),Q.jOp("aria-label",Q.bMT(9,13,"openTransferItemsHelpArticle")),Q.R7$(2),Q.SpI(" ",Q.bMT(11,15,"learnMore")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(14,17,"transferItemsToOrganizationAction")," "),Q.R7$(4),Q.SpI(" ",Q.bMT(18,19,"acceptTransfer")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(21,21,"declineAndLeave")," "))},dependencies:[ln.t,mn.Q,cn.P,xn.hJ,xn.o_,Es.o,Yt.V,te.g,ie.E,X.p,ve.$],encapsulation:2,changeDetection:0});var ks=i(58384);const Ts=Object.freeze({Confirmed:"confirmed",Back:"back"});class Fs{constructor(){this.params=(0,a.WQX)(an.Qs),this.dialogRef=(0,a.WQX)(gn.ce),this.platformUtilsService=(0,a.WQX)(f.y),this.organizationName=this.params.organizationName}confirmLeave(){this.dialogRef.close(Ts.Confirmed)}goBack(){this.dialogRef.close(Ts.Back)}openLearnMore(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/transfer-ownership/")}static open(e,t){return e.open(Fs,Object.assign({positionStrategy:new gn.u3,disableClose:!0},t))}}Fs.ɵfac=function(e){return new(e||Fs)},Fs.ɵcmp=Q.VBU({type:Fs,selectors:[["ng-component"]],decls:23,vars:19,consts:[["bitDialogIcon","","name","bwi-exclamation-triangle",1,"tw-text-warning","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["bitTypography","body1",1,"tw-mb-0"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","danger",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitLink","","href","#",1,"tw-self-center","tw-text-sm",3,"click"],["name","bwi-external-link",1,"tw-ml-1"]],template:function(e,t){1&e&&(Q.j41(0,"bit-simple-dialog"),Q.nrm(1,"bit-icon",0),Q.j41(2,"span",1),Q.EFF(3),Q.nI1(4,"i18n"),Q.k0s(),Q.qex(5,2),Q.j41(6,"p",3),Q.EFF(7),Q.nI1(8,"i18n"),Q.k0s(),Q.j41(9,"p",4),Q.EFF(10),Q.nI1(11,"i18n"),Q.k0s(),Q.bVm(),Q.qex(12,5),Q.j41(13,"button",6),Q.bIt("click",function(){return t.confirmLeave()}),Q.EFF(14),Q.nI1(15,"i18n"),Q.k0s(),Q.j41(16,"button",7),Q.bIt("click",function(){return t.goBack()}),Q.EFF(17),Q.nI1(18,"i18n"),Q.k0s(),Q.j41(19,"a",8),Q.bIt("click",function(e){return t.openLearnMore(e)}),Q.EFF(20),Q.nI1(21,"i18n"),Q.nrm(22,"bit-icon",9),Q.k0s(),Q.bVm(),Q.k0s()),2&e&&(Q.R7$(3),Q.JRh(Q.bMT(4,6,"leaveConfirmationDialogTitle")),Q.R7$(4),Q.SpI(" ",Q.bMT(8,8,"leaveConfirmationDialogContentOne")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(11,10,"leaveConfirmationDialogContentTwo")," "),Q.R7$(4),Q.SpI(" ",Q.i5U(15,12,"leaveConfirmationDialogConfirmButton",t.organizationName)," "),Q.R7$(3),Q.SpI(" ",Q.bMT(18,15,"goBack")," "),Q.R7$(3),Q.SpI(" ",Q.bMT(21,17,"howToManageMyVault")," "))},dependencies:[ln.t,mn.Q,cn.P,xn.LJ,xn.hJ,xn.o_,Es.o,ks.R,Yt.V,te.g,ie.E,he.r,X.p,ve.$],encapsulation:2,changeDetection:0});var Ps=i(75697),Rs=i(36890),Ds=i(96540),Ms=i(43215),xs=i(82781),Os=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Gs{constructor(e,t,i,n){this.dialogService=e,this.toastService=t,this.platformUtilsService=i,this.i18nService=n}importSshKeyFromClipboard(){return Os(this,void 0,void 0,function*(){const e=yield this.platformUtilsService.readFromClipboard();let t=!1,i=null;try{i=(0,xs.import_ssh_key)(e)}catch(n){const e=n;if("PasswordRequired"!==e.variant&&"WrongPassword"!==e.variant)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t(this.sshImportErrorVariantToI18nKey(e.variant))}),null;t=!0}if(t)for(;;){const t=yield this.getSshKeyPassword();if(""===t||null==t)return null;try{i=(0,xs.import_ssh_key)(e,t);break}catch(n){const e=n;if("WrongPassword"!==e.variant)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t(this.sshImportErrorVariantToI18nKey(e.variant))}),null}}return this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("sshKeyImported")}),new Ds.E(new Rs.m({privateKey:i.privateKey,publicKey:i.publicKey,keyFingerprint:i.fingerprint}))})}sshImportErrorVariantToI18nKey(e){switch(e){case"ParsingError":return"invalidSshKey";case"UnsupportedKeyType":return"sshKeyTypeUnsupported";case"PasswordRequired":case"WrongPassword":return"sshKeyWrongPassword";default:return"errorOccurred"}}getSshKeyPassword(){return Os(this,void 0,void 0,function*(){const e=this.dialogService.open(Ms.AM,{ariaModal:!0});return yield(0,h._)(e.closed)})}}Gs.ɵfac=function(e){return new(e||Gs)(a.KVO(gn.o3),a.KVO(m.f),a.KVO(f.y),a.KVO(C.W))},Gs.ɵprov=a.jDH({token:Gs,factory:Gs.ɵfac});var Us=i(22869);class Vs{}var js=i(16878),Ns=i(82468),zs=i(39488),Ys=i(97432),Ls=i(90107),Ks=i(1601),Xs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qs{constructor(e,t,i,n,r,s,o,a,l,c,d,u){this.cipherService=e,this.policyService=t,this.organizationService=i,this.collectionService=n,this.logService=r,this.i18nService=s,this.dialogService=o,this.toastService=a,this.eventCollectionService=l,this.configService=c,this.organizationUserApiService=d,this.syncService=u,this._transferInProgressSubject=new js.t(!1),this.transferInProgress$=this._transferInProgressSubject.asObservable(),this.enforcementInFlight=!1}enforcingOrganization$(e){return this.policyService.policiesByType$(Jn.tt.OrganizationDataOwnership,e).pipe((0,r.T)(e=>{var t;return null===(t=e.filter(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.enableIndividualItemsTransfer)}).sort((e,t)=>e.revisionDate.getTime()-t.revisionDate.getTime()))||void 0===t?void 0:t[0]}),(0,j.n)(t=>null==t?(0,N.of)(void 0):this.organizationService.organizations$(e).pipe((0,J.Hc)(t.organizationId))))}personalCiphers$(e){return this.cipherService.cipherViews$(e).pipe((0,Ys.w)(),(0,r.T)(e=>e.filter(e=>null==e.organizationId)))}userMigrationInfo$(e){return this.enforcingOrganization$(e).pipe((0,j.n)(t=>null==t?(0,N.of)({requiresMigration:!1}):(0,n.z)([this.personalCiphers$(e),this.collectionService.defaultUserCollection$(e,t.id)]).pipe((0,r.T)(([e,i])=>({requiresMigration:e.length>0,enforcingOrganization:t,defaultCollectionId:null==i?void 0:i.id})))))}promptUserForTransfer(e){return Xs(this,void 0,void 0,function*(){const t=Qs.open(this.dialogService,{data:{organizationName:e}});if((yield(0,h._)(t.closed))===Ss.Accepted)return!0;const i=Fs.open(this.dialogService,{data:{organizationName:e}});return(yield(0,h._)(i.closed))===Ts.Back&&this.promptUserForTransfer(e)})}enforceOrganizationDataOwnership(e){return Xs(this,void 0,void 0,function*(){if(!(yield this.configService.getFeatureFlag(Ns.TO.MigrateMyVaultToMyItems))||this.enforcementInFlight)return;const t=yield(0,h._)(this.userMigrationInfo$(e));if(!t.requiresMigration)return;if(null==t.defaultCollectionId)return void this.logService.warning("Default collection is missing for user during organization data ownership enforcement");this.enforcementInFlight=!0;if(!(yield this.promptUserForTransfer(t.enforcingOrganization.name)))return yield this.organizationUserApiService.revokeSelf(t.enforcingOrganization.id),this.toastService.showToast({variant:"success",message:this.i18nService.t("leftOrganization")}),yield this.syncService.fullSync(!0),void(this.enforcementInFlight=!1);try{this._transferInProgressSubject.next(!0),yield this.transferPersonalItems(e,t.enforcingOrganization.id,t.defaultCollectionId),this._transferInProgressSubject.next(!1),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemsTransferred")}),yield this.eventCollectionService.collect(A.Bx.Organization_ItemOrganization_Accepted,void 0,void 0,t.enforcingOrganization.id)}catch(i){this._transferInProgressSubject.next(!1),this.logService.error("Error transferring personal items to organization",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}finally{this.enforcementInFlight=!1}})}transferPersonalItems(e,t,i){return Xs(this,void 0,void 0,function*(){let n=yield(0,h._)(this.personalCiphers$(e));if(0===n.length)return;const r=n.filter(e=>e.hasOldAttachments);if(r.length>0){yield this.upgradeOldAttachments(r,e,t),n=yield(0,h._)(this.personalCiphers$(e));const i=n.filter(e=>e.hasOldAttachments);if(i.length>0)throw new Error(`Failed to upgrade all old attachments. ${i.length} ciphers still have old attachments.`)}this.logService.info(`Starting transfer of ${n.length} personal ciphers to organization ${t} for user ${e}`),yield this.cipherService.shareManyWithServer(n,t,[i],e)})}upgradeOldAttachments(e,t,i){return Xs(this,void 0,void 0,function*(){this.logService.info(`Found ${e.length} ciphers with old attachments needing upgrade during transfer to organization ${i} for user ${t}`);for(const r of e)try{if(!r.hasOldAttachments)continue;if((yield this.cipherService.upgradeOldCipherAttachments(r,t)).hasOldAttachments)throw this.logService.error(`Attachment upgrade did not complete successfully for cipher ${r.id} during transfer to organization ${i} for user ${t}`),new Error(`Failed to upgrade old attachments for cipher ${r.id}`)}catch(n){throw this.logService.error(`Failed to upgrade old attachments for cipher ${r.id} during transfer to organization ${i} for user ${t}: ${n}`),new Error(`Failed to upgrade old attachments for cipher ${r.id}`)}this.logService.info(`Successfully upgraded ${e.length} ciphers with old attachments during transfer to organization ${i} for user ${t}`)})}}qs.ɵfac=function(e){return new(e||qs)(a.KVO(l.p),a.KVO($n.m),a.KVO(q.PV),a.KVO(K.YD),a.KVO(Ls.Kc),a.KVO(C.W),a.KVO(gn.o3),a.KVO(m.f),a.KVO(A.c_),a.KVO(Ks.w),a.KVO(K.uB),a.KVO(zs.H))},qs.ɵprov=a.jDH({token:qs,factory:qs.ɵfac});var Hs=i(60276),Ws=i(29377),$s=i(78781),Js=i(20702);class Zs extends Js.r{constructor(e){super(e),this.uri=this.getResponseProperty("uri")}}var _s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class eo{constructor(e,t,i){this.apiService=e,this.environmentService=t,this.domainSettingsService=i}getChangePasswordUrl(e){return _s(this,void 0,void 0,function*(){if(e.type!==g.gC.Login||null==e.login||!e.login.hasUris)return null;const t=e.login.uris.map(e=>$s.A.getUrl(e.uri)).filter(e=>null!=e&&("http:"===e.protocol||"https:"===e.protocol));if(0===t.length)return null;if(!(yield(0,h._)(this.domainSettingsService.showFavicons$)))return t[0].href;for(const e of t){const t=yield this.fetchWellKnownChangePasswordUri(e.href);if(t)return t}return t[0].href})}fetchWellKnownChangePasswordUri(e){return _s(this,void 0,void 0,function*(){const t=yield this.buildChangePasswordUriRequest(e),i=yield this.apiService.fetch(t);if(!i.ok)return null;const n=yield i.json(),{uri:r}=new Zs(n);return r})}buildChangePasswordUriRequest(e){return _s(this,void 0,void 0,function*(){const t=new URLSearchParams;t.set("uri",e);const i=(yield(0,h._)(this.environmentService.environment$)).getIconsUrl(),n=new URL(`${i}/change-password-uri?${t.toString()}`);return new Request(n,{method:"GET"})})}}eo.ɵfac=function(e){return new(e||eo)(a.KVO(be.G),a.KVO(Ws.v),a.KVO(Hs.V))},eo.ɵprov=a.jDH({token:eo,factory:eo.ɵfac});var to=i(92411),io=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class no{constructor(e,t,i,n,r,s){this.cipherArchiveService=e,this.dialogService=t,this.passwordRepromptService=i,this.toastService=n,this.i18nService=r,this.accountService=s}archiveCipher(e){return io(this,arguments,void 0,function*(e,t=!1){if(!t){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return}if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveItem"},content:{key:"archiveItemDialogContent"},acceptButtonText:{key:"archiveVerb"},type:"info"})))return;const i=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));try{const t=yield this.cipherArchiveService.archiveWithServer(e.id,i);return this.toastService.showToast({variant:"success",message:this.i18nService.t("itemArchiveToast")}),t}catch(n){return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}unarchiveCipher(e){return io(this,arguments,void 0,function*(e,t=!1){if(!t){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return}const i=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));try{const t=yield this.cipherArchiveService.unarchiveWithServer(e.id,i);return this.toastService.showToast({variant:"success",message:this.i18nService.t("itemUnarchivedToast")}),t}catch(n){return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}}no.ɵfac=function(e){return new(e||no)(a.KVO(to.J),a.KVO(gn.o3),a.KVO(u.q),a.KVO(m.f),a.KVO(C.W),a.KVO(I.D))},no.ɵprov=a.jDH({token:no,factory:no.ɵfac,providedIn:"root"});class ro{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 isArchived(){var e;return"archive"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)}get organizationId(){var e;return null===(e=this.selectedOrganizationNode)||void 0===e?void 0:e.node.id}get cipherType(){var e,t;return(0,g.KN)(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)?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.isArchived&&t&&(t=e.isArchived),this.cipherType&&t&&(t=e.type===this.cipherType),this.selectedFolderNode&&(null===this.folderId&&t&&(t=null==e.folderId||""===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}}}const so="all",oo=["favorites","login","card","identity","note","sshKey","archive","trash",so];function ao(e){return oo.includes(e)}class lo{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)?Bt.I_: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=so:"AllItems"===(null==e?void 0:e.node.id)&&"query"===this.routedFilter.organizationIdParamType?t=void 0:ao(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?void 0:e.node.id)?e.node.id:Bt.I_;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?Bt.I_:"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?so: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 isArchived(){return this.legacyFilter.isArchived}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()}}function co(e){return t=>{const i=v.n.getType(t),n=v.n.isDeleted(t);if("favorites"===e.type&&!t.favorite)return!1;if("card"===e.type&&i!==g.gC.Card)return!1;if("identity"===e.type&&i!==g.gC.Identity)return!1;if("login"===e.type&&i!==g.gC.Login)return!1;if("note"===e.type&&i!==g.gC.SecureNote)return!1;if("sshKey"===e.type&&i!==g.gC.SshKey)return!1;if("trash"===e.type&&!n)return!1;if("trash"!==e.type&&n)return!1;if("archive"===e.type&&!v.n.isArchived(t))return!1;if("archive"!==e.type&&"trash"!==e.type&&v.n.isArchived(t))return!1;const r=e.folderId===Bt.I_||""===e.folderId,s=null!=t.folderId&&""!==t.folderId;return(!r||!s)&&((void 0===e.folderId||e.folderId===so||e.folderId===Bt.I_||""===e.folderId||t.folderId===e.folderId)&&(e.collectionId!==so&&((e.collectionId!==Bt.I_||!(null==t.organizationId||null!=t.collectionIds&&t.collectionIds.length>0))&&(!!(void 0===e.collectionId||e.collectionId===so||e.collectionId===Bt.I_||null!=t.collectionIds&&t.collectionIds.includes(e.collectionId))&&((e.organizationId!==Bt.I_||null==t.organizationId)&&(void 0===e.organizationId||e.organizationId===Bt.I_||t.organizationId===e.organizationId))))))}}class uo{}var ho=i(43317),Ao=i(84175),po=i(23567);const go=s.Ok.array(s.km,"collapsedGroupings",{deserializer:e=>e,clearOn:["logout","lock"]});var vo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const fo="/";class mo{collapsedGroupingsState(e){return this.stateProvider.getUser(e,go)}constructor(e,t,i,s,o,a,l,c){this.organizationService=e,this.folderService=t,this.cipherService=i,this.policyService=s,this.i18nService=o,this.stateProvider=a,this.collectionService=l,this.accountService=c,this.activeUserId$=this.accountService.activeAccount$.pipe(H.F6),this.memberOrganizations$=this.activeUserId$.pipe((0,j.n)(e=>this.organizationService.memberOrganizations$(e))),this.collapsedFilterNodes$=this.activeUserId$.pipe((0,j.n)(e=>this.collapsedGroupingsState(e).state$),(0,r.T)(e=>new Set(e))),this.organizationTree$=(0,n.z)([this.memberOrganizations$,this.activeUserId$.pipe((0,j.n)(e=>this.policyService.policyAppliesToUser$(Jn.tt.SingleOrg,e))),this.activeUserId$.pipe((0,j.n)(e=>this.policyService.policyAppliesToUser$(Jn.tt.OrganizationDataOwnership,e)))]).pipe((0,j.n)(([e,t,i])=>this.buildOrganizationTree(e,t,i))),this._organizationFilter=new js.t(null),this.filteredFolders$=this.activeUserId$.pipe((0,j.n)(e=>(0,n.z)([this.folderService.folderViews$(e),this.cipherService.cipherListViews$(e),this._organizationFilter])),(0,Wn.p)(([e,t,i])=>!!t),(0,j.n)(([e,t,i])=>this.filterFolders(e,t,i))),this.folderTree$=this.filteredFolders$.pipe((0,r.T)(e=>this.buildFolderTree(e))),this.filteredCollections$=(0,n.z)([this.accountService.activeAccount$.pipe(H.F6,(0,j.n)(e=>this.collectionService.decryptedCollections$(e))),this._organizationFilter]).pipe((0,j.n)(([e,t])=>this.filterCollections(e,t))),this.collectionTree$=(0,n.z)([this.filteredCollections$,this.memberOrganizations$]).pipe((0,r.T)(([e,t])=>this.buildCollectionTree(e,t))),this.cipherTypeTree$=this.buildCipherTypeTree()}getCollectionNodeFromTree(e){return vo(this,void 0,void 0,function*(){const t=yield(0,h._)(this.collectionTree$);return po.F.getTreeNodeObject(t,e)})}setCollapsedFilterNodes(e,t){return vo(this,void 0,void 0,function*(){yield this.collapsedGroupingsState(t).update(()=>Array.from(e))})}getCollapsedFilterNodes(){return vo(this,void 0,void 0,function*(){return yield(0,h._)(this.collapsedFilterNodes$)})}getOrganizationFilter(){return this._organizationFilter}clearOrganizationFilter(){this._organizationFilter.next(null)}setOrganizationFilter(e){"AllVaults"!=(null==e?void 0:e.id)?this._organizationFilter.next(e):this._organizationFilter.next(null)}expandOrgFilter(e){return vo(this,void 0,void 0,function*(){const t=yield(0,h._)(this.collapsedFilterNodes$);t.has("AllVaults")&&(t.delete("AllVaults"),yield this.setCollapsedFilterNodes(t,e))})}buildOrganizationTree(e,t,i){return vo(this,void 0,void 0,function*(){const n=this.getOrganizationFilterHead();if(!i){const e=this.getOrganizationFilterMyVault();n.children.push(e)}if(t&&(e=e.slice(0,1)),e){const t=[];e.forEach(e=>{const i=e;(null==e?void 0:e.productTierType)===S.K_.Free||(null==e?void 0:e.productTierType)===S.K_.Families?i.icon="bwi-family":i.icon="bwi-business";const r=new Ao.n(i,n,i.name);t.push(r)}),t.sort((e,t)=>e.node.name.localeCompare(t.node.name)),n.children.push(...t)}return n})}getOrganizationFilterHead(){const e=new Et.y;return e.enabled=!0,new Ao.n(e,null,"allVaults","AllVaults")}getOrganizationFilterMyVault(){const e=new Et.y;return e.id="MyVault",e.icon="bwi-user",e.enabled=!0,e.hideOptions=!0,new Ao.n(e,null,this.i18nService.t("myVault"))}buildTypeTree(e,t){const i=new Ao.n(e,null);return null==t||t.forEach(e=>{const t=new Ao.n(e,i,e.name);i.children.push(t)}),(0,N.of)(i)}filterCollections(e,t){return vo(this,void 0,void 0,function*(){return null!=(null==t?void 0:t.id)?e.filter(e=>e.organizationId===t.id):e})}buildCollectionTree(e,t){const i=this.getCollectionFilterHead();if(!e)return i;const n=[];e=function(e,t=[],i){return[...e.filter(e=>e.type===Bt.it.DefaultUserCollection).sort((e,n)=>{var r,s,o,a;const l=null!==(s=null===(r=t.find(t=>t.id===e.organizationId))||void 0===r?void 0:r.name)&&void 0!==s?s:e.organizationId,c=null!==(a=null===(o=t.find(e=>e.id===n.organizationId))||void 0===o?void 0:o.name)&&void 0!==a?a:n.organizationId;if(!l||!c)throw new Error("Collection does not have an organizationId.");return i.compare(l,c)}),...e.filter(e=>e.type!==Bt.it.DefaultUserCollection)]}(e,t,this.i18nService.collator);const r=this.collectionService.groupByOrganization(e);for(const s of r.values()){const e=[];for(const t of s){const i=(0,ho.sE)(new Bt.iY(Object.assign(Object.assign({},t),{name:t.name})));i.icon=t.type===Bt.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared";const n=t.name?t.name.replace(/^\/+|\/+$/g,"").split(fo):[];po.F.nestedTraverse(e,0,n,i,void 0,fo)}n.push(...e)}return n.forEach(e=>{e.parent=i,i.children.push(e)}),i}getCollectionFilterHead(){const e=Bt.iY.vaultFilterHead();return new Ao.n(e,null,"collections","AllCollections")}filterFolders(e,t,i){return vo(this,void 0,void 0,function*(){if(null==(null==i?void 0:i.id)||"MyVault"==(null==i?void 0:i.id))return e;const n=t.filter(e=>e.organizationId==(null==i?void 0:i.id));return e.filter(e=>n.some(t=>t.folderId==e.id)||!e.id)})}buildFolderTree(e){const t=this.getFolderFilterHead();if(!e)return t;const i=[];return e.forEach(e=>{const t=new St.u;t.id=e.id,t.revisionDate=e.revisionDate,t.icon="bwi-folder",t.fullName=e.name;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split(fo):[];po.F.nestedTraverse(i,0,n,t,null,fo)}),i.forEach(e=>{e.parent=t,t.children.push(e)}),t}getFolderFilterHead(){const e=new St.u;return new Ao.n(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:g.gC.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:g.gC.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:g.gC.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("typeSecureNote"),type:g.gC.SecureNote,icon:"bwi-sticky-note"},{id:"sshKey",name:this.i18nService.t("typeSshKey"),type:g.gC.SshKey,icon:"bwi-key"}];return this.buildTypeTree({id:"AllItems",name:"allItems",type:"all"},e)}}mo.ɵfac=function(e){return new(e||mo)(a.KVO(q.PV),a.KVO(Ui.k),a.KVO(l.p),a.KVO($n.m),a.KVO(C.W),a.KVO(s.v2),a.KVO(K.YD),a.KVO(I.D))},mo.ɵprov=a.jDH({token:mo,factory:mo.ɵfac});var yo=i(23649);const Co=new dn.aZ("VaultFilterBaseRoute");class wo{constructor(e){var t;this.onDestroy=new F.B,this.baseRoute=null!==(t=(0,a.WQX)(Co,{optional:!0}))&&void 0!==t?t:"",this.filter$=(0,n.z)([e.paramMap,e.queryParamMap]).pipe((0,r.T)(([e,t])=>{var i,n,r,s;const o=t.get("type"),a=ao(o)?o: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!==(s=null!==(r=e.get("organizationId"))&&void 0!==r?r:t.get("organizationId"))&&void 0!==s?s:void 0,organizationIdParamType:null!=e.get("organizationId")?"path":"query",type:a}}),(0,T.Q)(this.onDestroy))}createRoute(e){var t,i,n,r;return[this.baseRoute?[this.baseRoute]:[],{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!==(r=e.type)&&void 0!==r?r:null},queryParamsHandling:"merge",state:{focusAfterNav:!1}}]}ngOnDestroy(){this.onDestroy.next(),this.onDestroy.complete()}}wo.ɵfac=function(e){return new(e||wo)(a.KVO(yo.nX))},wo.ɵprov=a.jDH({token:wo,factory:wo.ɵfac});class Io{constructor(e,t,i){this.router=e,this.routedVaultFilterService=t,this.activeFilter$=(0,n.z)([t.filter$,i.collectionTree$,i.folderTree$,i.organizationTree$,i.cipherTypeTree$]).pipe((0,r.T)(([e,t,i,n,r])=>{const s=function(e){return"path"===e.organizationIdParamType}(e)?function(e,t,i){const n=new ro;void 0===e.collectionId&&void 0===e.type?n.selectedCollectionNode=po.F.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&e.collectionId===Bt.I_?n.selectedCollectionNode=po.F.getTreeNodeObject(t,null):void 0!==e.collectionId&&(n.selectedCollectionNode=po.F.getTreeNodeObject(t,e.collectionId));void 0===e.collectionId&&e.type===so?n.selectedCipherTypeNode=po.F.getTreeNodeObject(i,"AllItems"):void 0!==e.type&&"trash"===e.type?n.selectedCipherTypeNode=new Ao.n({id:"trash",name:"",type:"trash"},null):void 0!==e.type&&"trash"!==e.type&&(n.selectedCipherTypeNode=po.F.getTreeNodeObject(i,e.type));return n}(e,t,r):function(e,t,i,n,r){const s=new ro;void 0!==e.collectionId&&e.collectionId===Bt.I_?s.selectedCollectionNode=po.F.getTreeNodeObject(t,null):void 0!==e.collectionId&&e.collectionId===so?s.selectedCollectionNode=po.F.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&(s.selectedCollectionNode=po.F.getTreeNodeObject(t,e.collectionId));void 0===e.folderId||e.folderId!==Bt.I_&&""!==e.folderId?void 0!==e.folderId&&e.folderId!==Bt.I_&&(s.selectedFolderNode=po.F.getTreeNodeObject(i,e.folderId)):s.selectedFolderNode=po.F.getTreeNodeObject(i,null);void 0!==e.organizationId&&e.organizationId===Bt.I_?s.selectedOrganizationNode=po.F.getTreeNodeObject(n,"MyVault"):void 0!==e.organizationId&&e.organizationId!==Bt.I_&&(s.selectedOrganizationNode=po.F.getTreeNodeObject(n,e.organizationId));void 0===e.type?s.selectedCipherTypeNode=po.F.getTreeNodeObject(r,"AllItems"):void 0!==e.type&&"trash"===e.type?s.selectedCipherTypeNode=new Ao.n({id:"trash",name:"",type:"trash"},null):void 0!==e.type&&"archive"===e.type?s.selectedCipherTypeNode=new Ao.n({id:"archive",name:"",type:"archive"},null):void 0!==e.type&&"trash"!==e.type&&(s.selectedCipherTypeNode=po.F.getTreeNodeObject(r,e.type));return s}(e,t,i,n,r);return new lo(e,s,this)}))}navigate(e){const[t,i]=this.routedVaultFilterService.createRoute(e);this.router.navigate(t,i)}}Io.ɵfac=function(e){return new(e||Io)(a.KVO(yo.Ix),a.KVO(wo),a.KVO(uo))},Io.ɵprov=a.jDH({token:Io,factory:Io.ɵfac})},90143(e,t,i){"use strict";i.d(t,{l:()=>d});var n=i(94573),r=i(33277),s=i(58384),o=i(33812);const a=[[["","slot","start"]],"*",[["","slot","end"]]];function l(e,t){if(1&e&&o.nrm(0,"bit-icon",0),2&e){const e=o.XpG();o.Y8G("name",e.startIcon())}}function c(e,t){if(1&e&&o.nrm(0,"bit-icon",0),2&e){const e=o.XpG();o.Y8G("name",e.endIcon())}}class d{constructor(){this.startIcon=(0,n.hFB)(),this.endIcon=(0,n.hFB)(),this.size=(0,n.hFB)("large"),this.gapClass=(0,r.EW)(()=>"large"===(this.size()||"large")?"tw-gap-1.5":"tw-gap-1"),this.classList=(0,r.EW)(()=>["tw-inline-flex","tw-min-w-0","tw-w-full","tw-max-w-full","tw-items-center","tw-justify-between",this.gapClass()].join(" "))}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=o.VBU({type:d,selectors:[["bit-chip-content"],["","bit-chip-content",""]],hostVars:2,hostBindings:function(e,t){2&e&&o.HbH(t.classList())},inputs:{startIcon:[1,"startIcon"],endIcon:[1,"endIcon"],size:[1,"size"]},ngContentSelectors:["[slot=start]","*","[slot=end]"],decls:6,vars:2,consts:[[1,"tw-text-base/5",3,"name"],[1,"tw-text-start","tw-truncate","tw-leading-5","tw-min-w-0","tw-flex-1"]],template:function(e,t){1&e&&(o.NAR(a),o.SdG(0),o.nVh(1,l,1,1,"bit-icon",0),o.j41(2,"span",1),o.SdG(3,1),o.k0s(),o.nVh(4,c,1,1,"bit-icon",0),o.SdG(5,2)),2&e&&(o.R7$(),o.vxM(t.startIcon()?1:-1),o.R7$(3),o.vxM(t.endIcon()?4:-1))},dependencies:[s.R],encapsulation:2,changeDetection:0})},90171(e,t,i){"use strict";i.d(t,{b:()=>r});var n=i(33812);class r{transform(e){return null==e||null==e.name&&null==e.email?null:null==e.name||""===e.name.trim()?e.email:e.name}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"userName",type:r,pure:!0})},90246(e,t,i){"use strict";i.d(t,{f:()=>g});var n=i(77468),r=i(94573),s=i(36801),o=i(58806),a=i(15033),l=i(33812),c=i(50700);const d=["*",[["bit-label"]],[["bit-hint"]]],u=e=>[e];function h(e,t){1&e&&(l.j41(0,"span",3),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" (",l.bMT(2,1,"required"),")"))}function A(e,t){1&e&&(l.j41(0,"span",4),l.SdG(1,2),l.k0s())}function p(e,t){if(1&e&&(l.j41(0,"div",5),l.nrm(1,"i",6),l.EFF(2),l.k0s()),2&e){const e=l.XpG();l.R7$(2),l.SpI(" ",e.displayError," ")}}class g{get classes(){return[].concat(this.inline()?["tw-inline-block","tw-me-4"]:["tw-block"]).concat(this.disableMargin()?[]:["tw-mb-4"])}constructor(e){this.i18nService=e,this.label=(0,r.hFB)(),this.inline=(0,r.hFB)(!1,{transform:r.L39}),this.disableMargin=(0,r.hFB)(!1,{transform:r.L39}),this.formControl=r.sbv.required(a.J)}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}}g.ɵfac=function(e){return new(e||g)(l.rXU(c.W))},g.ɵcmp=l.VBU({type:g,selectors:[["bit-form-control"]],contentQueries:function(e,t,i){1&e&&l.C6U(i,t.formControl,a.J,5),2&e&&l.NyB()},hostVars:2,hostBindings:function(e,t){2&e&&l.HbH(t.classes)},inputs:{label:[1,"label"],inline:[1,"inline"],disableMargin:[1,"disableMargin"]},ngContentSelectors:["*","bit-label","bit-hint"],decls:8,vars:7,consts:[[1,"tw-transition","tw-items-start","[&:has(input[type='checkbox'])]:tw-gap-1","[&:has(input[type='radio'])]:tw-gap-1.5","tw-select-none","tw-mb-0","tw-inline-flex","tw-rounded","has-[:focus-visible]:tw-ring","has-[:focus-visible]:tw-ring-primary-600",3,"ngClass"],[1,"tw-inline-flex","tw-flex-col",3,"ngClass"],["bitTypography","body2"],[1,"tw-text-xs","tw-font-normal"],[1,"[&_bit-hint]:tw-mt-0","tw-leading-none"],[1,"tw-mt-1","tw-text-danger","tw-text-xs","tw-ms-0.5"],[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(l.NAR(d),l.j41(0,"label",0),l.SdG(1),l.j41(2,"span",1)(3,"span",2),l.SdG(4,1),l.nVh(5,h,3,3,"span",3),l.k0s(),l.nVh(6,A,2,0,"span",4),l.k0s()(),l.nVh(7,p,3,1,"div",5)),2&e&&(l.Y8G("ngClass",l.eq3(5,u,t.formControl().disabled?"tw-cursor-auto":"tw-cursor-pointer")),l.R7$(2),l.Y8G("ngClass",t.formControl().disabled?"tw-text-muted":"tw-text-main"),l.R7$(3),l.vxM(t.required?5:-1),l.R7$(),l.vxM(t.hasError?-1:6),l.R7$(),l.vxM(t.hasError?7:-1))},dependencies:[n.YU,o.r,s.$Z],encapsulation:2})},90300(e,t,i){"use strict";i.d(t,{g:()=>h});var n=i(77468),r=i(94573),s=i(74208),o=i(75583),a=i(33812),l=i(58806);const c=["endSlot"],d=[[["","slot","start"]],"*",[["","slot","default-trailing"]],[["","slot","secondary"]],[["","slot","end"]]],u=(e,t)=>({"tw-truncate":e,"tw-text-wrap tw-overflow-auto tw-break-words":t});class h{constructor(){this.endSlot=(0,r.ebz)("endSlot"),this.endSlotHasChildren=(0,s.vPA)(!1),this.truncate=(0,r.hFB)(!0)}ngAfterContentChecked(){var e,t;this.endSlotHasChildren.set((null!==(t=null===(e=this.endSlot())||void 0===e?void 0:e.nativeElement.childElementCount)&&void 0!==t?t:0)>0)}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=a.VBU({type:h,selectors:[["bit-item-content"],["","bit-item-content",""]],viewQuery:function(e,t){1&e&&a.wEZ(t.endSlot,c,5),2&e&&a.NyB()},hostAttrs:["data-fvw-target","",1,"tw-outline-none","tw-text-main","hover:tw-text-main","tw-no-underline","hover:tw-no-underline","tw-text-base","tw-py-2","tw-px-4","bit-compact:tw-py-1.5","bit-compact:tw-px-2","tw-bg-transparent","tw-w-full","tw-border-none","tw-flex","tw-gap-4","tw-items-center","tw-justify-between","disabled:tw-cursor-not-allowed","[&[disabled]_[bittypography]]:!tw-text-secondary-300","[&[disabled]_i]:!tw-text-secondary-300"],inputs:{truncate:[1,"truncate"]},ngContentSelectors:["[slot=start]","*","[slot=default-trailing]","[slot=secondary]","[slot=end]"],decls:13,vars:9,consts:[["endSlot",""],[1,"tw-flex","tw-gap-2","tw-items-center","tw-w-full","tw-min-w-0"],[1,"tw-flex","tw-flex-col","tw-items-start","tw-text-start","tw-w-full","tw-truncate","[&_p]:tw-mb-0"],["bitTypography","body2",1,"tw-text-main","tw-truncate","tw-inline-flex","tw-items-center","tw-gap-1.5","tw-w-full"],[3,"ngClass"],[1,"tw-flex-grow"],["bitTypography","helper",1,"tw-text-muted","tw-w-full",3,"ngClass"],[1,"tw-flex","tw-gap-2","tw-items-center",3,"hidden"]],template:function(e,t){1&e&&(a.NAR(d),a.j41(0,"div",1),a.SdG(1),a.j41(2,"div",2)(3,"div",3)(4,"div",4),a.SdG(5,1),a.k0s(),a.j41(6,"div",5),a.SdG(7,2),a.k0s()(),a.j41(8,"div",6),a.SdG(9,3),a.k0s()()(),a.j41(10,"div",7,0),a.SdG(12,4),a.k0s()),2&e&&(a.R7$(4),a.Y8G("ngClass",a.l_i(3,u,t.truncate(),!t.truncate())),a.R7$(4),a.Y8G("ngClass",a.l_i(6,u,t.truncate(),!t.truncate())),a.R7$(2),a.Y8G("hidden",!t.endSlotHasChildren()))},dependencies:[o.E,l.r,n.YU],encapsulation:2,changeDetection:0})},90586(e,t,i){"use strict";function n(e,t){return null==e&&null==t||(!e||null!=t)&&((null!=e||!t)&&("object"!=typeof e||"object"!=typeof t?e===t:JSON.stringify(e)===JSON.stringify(t)))}i.d(t,{c:()=>n})},90647(e,t,i){"use strict";i.d(t,{M:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},91059(e,t,i){"use strict";i.d(t,{Y:()=>n});class n{}},91261(e,t,i){"use strict";i.d(t,{z:()=>y});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(94735),h=i(26411),A=i(73638),p=i(86226),g=i(97553),v=i(43759),f=i(25740),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class y{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({subaddressEmail:[""]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return m(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return m(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(A.qG.plusAddress,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}y.ɵfac=function(e){return new(e||y)(n.rXU(r.ok),n.rXU(A.iE))},y.ɵcmp=n.VBU({type:y,selectors:[["tools-subaddress-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:6,vars:4,consts:[[1,"tw-container",3,"formGroup"],["bitInput","","formControlName","subaddressEmail","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"input",1),n.bIt("change",function(){return t.save("subaddressEmail")}),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(3),n.JRh(n.bMT(4,2,"email")))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,h.L,p.j,g.J,v.h,u.p,f.$],encapsulation:2})},91304(e,t,i){"use strict";i.d(t,{N:()=>r});var n=i(31442);class r{constructor(e){this.type=n.PU.Text,null!=e&&(this.type=e.type,this.name=e.name,this.value=e.value,this.linkedId=e.linkedId)}}},91326(e,t,i){"use strict";i.d(t,{K:()=>A});var n=i(94573),r=i(33277),s=i(36801),o=i(22191),a=i(74208),l=i(33812),c=i(36288);function d(e,t){1&e&&l.nrm(0,"i",4),2&e&&l.HbH(t)}function u(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",5),l.nI1(1,"i18n"),l.bIt("click",function(){a.eBV(e);const t=l.XpG();return a.Njj(t.onClose.emit())}),l.k0s()}2&e&&l.Y8G("label",l.bMT(1,1,"close"))}const h={premium:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"};class A{constructor(){this.bannerType=(0,n.hFB)("info"),this.icon=(0,n.hFB)(),this.useAlertRole=(0,n.hFB)(!0),this.showClose=(0,n.hFB)(!0),this.onClose=(0,n.CGW)(),this.displayIcon=(0,r.EW)(()=>{var e;return null===this.icon()?null:null!==(e=this.icon())&&void 0!==e?e:h[this.bannerType()]}),this.bannerClass=(0,r.EW)(()=>{switch(this.bannerType()){case"danger":return"tw-bg-danger-100 tw-border-b-danger-700";case"info":return"tw-bg-info-100 tw-border-b-info-700";case"premium":return"tw-bg-success-100 tw-border-b-success-700";case"warning":return"tw-bg-warning-100 tw-border-b-warning-700"}})}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=l.VBU({type:A,selectors:[["bit-banner"]],hostAttrs:[1,"tw-flex","tw-flex-col","[bit-layout_&]:-tw-mx-8","[bit-layout_&]:-tw-my-6","[bit-layout_&]:tw-pb-6"],inputs:{bannerType:[1,"bannerType"],icon:[1,"icon"],useAlertRole:[1,"useAlertRole"],showClose:[1,"showClose"]},outputs:{onClose:"onClose"},ngContentSelectors:["*"],decls:5,vars:6,consts:[[1,"tw-flex","tw-items-center","tw-gap-4","tw-p-2","tw-ps-4","tw-text-main","tw-border-transparent","tw-bg-clip-padding","tw-border-solid","tw-border-b","tw-border-0"],["aria-hidden","true",1,"bwi","tw-align-middle","tw-text-base",3,"class"],[1,"tw-grow","tw-text-base","[&>button[bitlink]:focus-visible:before]:!tw-ring-text-main"],["type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","small",3,"label"],["aria-hidden","true",1,"bwi","tw-align-middle","tw-text-base"],["type","button","bitIconButton","bwi-close","buttonType","primaryGhost","size","small",3,"click","label"]],template:function(e,t){if(1&e&&(l.NAR(),l.j41(0,"div",0),l.nVh(1,d,1,2,"i",1),l.j41(2,"span",2),l.SdG(3),l.k0s(),l.nVh(4,u,2,3,"button",3),l.k0s()),2&e){let e;l.HbH(t.bannerClass()),l.BMQ("role",t.useAlertRole()?"status":null)("aria-live",t.useAlertRole()?"polite":null),l.R7$(),l.vxM((e=t.displayIcon())?1:-1,e),l.R7$(3),l.vxM(t.showClose()?4:-1)}},dependencies:[o.Q,c.s,s.$Z],encapsulation:2,changeDetection:0})},91461(e,t,i){"use strict";i.d(t,{eO:()=>n.eO,mw:()=>n.mw});var n=i(43317)},91517(e,t,i){"use strict";i.d(t,{m:()=>O,F:()=>x});var n=i(51757),r=i(66046),s=i(12610),o=i(14803);const a=i(82392).JW`
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 580 104" fill="none">
    <path class="tw-fill-text-alt2" 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 class="tw-fill-bw-blue" 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 class="tw-fill-text-alt2" 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 l=i(64447),c=(i(69138),i(69580),i(33812)),d=i(50700),u=i(77468),h=i(26657),A=i(56898),p=i(50352),g=i(90246),v=i(86226),f=i(93199),m=i(97553),y=i(43759),C=i(8168),w=i(58806),I=i(25740);function b(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.JRh(c.i5U(2,1,"limitedUsers",e.maxUsers))}}function B(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(2,1,"projectsIncluded",e.maxProjects)," ")}}function E(e,t){1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"unlimitedProjects")))}function S(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"currency"),c.nI1(3,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(3,4,"additionalMachineAccountCost",c.i5U(2,1,e.monthlyCostPerServiceAccount,"$"))," ")}}function Q(e,t){if(1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"currency"),c.nI1(3,"i18n"),c.nI1(4,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.Lme(" ",c.i5U(3,5,"costPerUser",c.i5U(2,2,e.monthlyCostPerUser,"$"))," /",c.bMT(4,8,"month")," ")}}function k(e,t){1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"freeForever")))}function T(e,t){1&e&&(c.j41(0,"bit-hint"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"addSecretsManagerUpgradeDesc")))}function F(e,t){1&e&&(c.j41(0,"div",17)(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",18),c.j41(6,"bit-hint"),c.EFF(7),c.nI1(8,"i18n"),c.k0s()()()),2&e&&(c.R7$(3),c.JRh(c.bMT(4,2,"userSeats")),c.R7$(4),c.JRh(c.bMT(8,4,"userSeatsHowManyDesc")))}function P(e,t){if(1&e&&(c.j41(0,"div",17)(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",19),c.j41(6,"bit-hint"),c.EFF(7),c.nI1(8,"i18n"),c.nI1(9,"currency"),c.nI1(10,"i18n"),c.k0s()()()),2&e){const e=c.XpG(3);c.R7$(3),c.JRh(c.bMT(4,3,"additionalMachineAccounts")),c.R7$(4),c.Lme(" ",c.i5U(8,5,"includedMachineAccounts",e.serviceAccountsIncluded)," ",c.i5U(10,11,"addAdditionalMachineAccounts",c.i5U(9,8,e.monthlyCostPerServiceAccount,"$"))," ")}}function R(e,t){1&e&&(c.j41(0,"button",20),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"save")," "))}function D(e,t){if(1&e&&(c.qex(0),c.DNE(1,F,9,6,"div",15)(2,P,11,14,"div",15)(3,R,3,3,"button",16),c.bVm()),2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption),c.R7$(),c.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption),c.R7$(),c.Y8G("ngIf",e.showSubmitButton)}}function M(e,t){if(1&e&&(c.j41(0,"div",3)(1,"h3",4),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"div",5)(5,"div",6),c.nrm(6,"bit-svg",7),c.k0s()(),c.j41(7,"div",8)(8,"h4",9),c.EFF(9),c.nI1(10,"i18n"),c.k0s(),c.j41(11,"div",10),c.EFF(12),c.nI1(13,"i18n"),c.j41(14,"ul"),c.DNE(15,b,3,4,"li",11),c.j41(16,"li"),c.EFF(17),c.nI1(18,"i18n"),c.k0s(),c.DNE(19,B,3,4,"li",12)(20,E,3,3,"ng-template",null,0,c.C5r),c.j41(22,"li"),c.EFF(23),c.nI1(24,"i18n"),c.k0s(),c.DNE(25,S,4,7,"li",11),c.k0s()(),c.j41(26,"div",13),c.DNE(27,Q,5,10,"span",12)(28,k,3,3,"ng-template",null,1,c.C5r),c.k0s(),c.j41(30,"bit-form-control"),c.nrm(31,"input",14),c.j41(32,"bit-label"),c.EFF(33),c.nI1(34,"i18n"),c.k0s(),c.DNE(35,T,3,3,"bit-hint",11),c.k0s(),c.DNE(36,D,4,3,"ng-container",11),c.k0s()()),2&e){const e=c.sdS(21),t=c.sdS(29),i=c.XpG();c.Y8G("formGroup",i.formGroup),c.R7$(2),c.JRh(c.bMT(3,16,"moreFromBitwarden")),c.R7$(4),c.Y8G("content",i.logo),c.R7$(3),c.JRh(c.i5U(10,18,"secretsManagerForPlan",i.planName)),c.R7$(3),c.SpI(" ",c.bMT(13,21,"secretsManagerForPlanDesc")," "),c.R7$(3),c.Y8G("ngIf",i.product==i.productTypes.Free),c.R7$(2),c.JRh(c.bMT(18,23,"unlimitedSecrets")),c.R7$(2),c.Y8G("ngIf",i.product==i.productTypes.Free)("ngIfElse",e),c.R7$(4),c.JRh(c.i5U(24,25,"machineAccountsIncluded",i.serviceAccountsIncluded)),c.R7$(2),c.Y8G("ngIf",i.product!=i.productTypes.Free),c.R7$(2),c.Y8G("ngIf",i.product!=i.productTypes.Free)("ngIfElse",t),c.R7$(6),c.JRh(c.bMT(34,28,"subscribeToSecretsManager")),c.R7$(2),c.Y8G("ngIf",i.upgradeOrganization),c.R7$(),c.Y8G("ngIf",i.formGroup.value.enabled)}}const x=e=>e.group({enabled:[!1],userSeats:[1,[n.k0.required,n.k0.min(1),n.k0.max(1e5)]],additionalServiceAccounts:[0,[n.k0.required,n.k0.min(0),n.k0.max(1e5)]]});class O{constructor(e){this.i18nService=e,this.showSubmitButton=!1,this.logo=a,this.productTypes=l.K_,this.destroy$=new r.B,this.discountPrice=e=>e-(this.customerDiscount&&this.customerDiscount.active?e*(this.customerDiscount.percentOff/100):0)}ngOnInit(){this.formGroup.controls.enabled.valueChanges.pipe((0,s.Z)(this.formGroup.value.enabled),(0,o.Q)(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.productTier}get planName(){switch(this.product){case l.K_.Free:return this.i18nService.t("free2PersonOrganization");case l.K_.Teams:case l.K_.TeamsStarter:return this.i18nService.t("planNameTeams");case l.K_.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)}}O.ɵfac=function(e){return new(e||O)(c.rXU(d.W))},O.ɵcmp=c.VBU({type:O,selectors:[["sm-subscribe"]],inputs:{formGroup:"formGroup",upgradeOrganization:"upgradeOrganization",showSubmitButton:"showSubmitButton",selectedPlan:"selectedPlan",customerDiscount:"customerDiscount"},standalone:!1,decls:1,vars:1,consts:[["unlimitedProjects",""],["freeForever",""],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["bitTypography","h3"],[1,"tw-rounded-t","tw-bg-background-alt3","tw-p-5"],[1,"tw-w-72"],[3,"content"],[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"],[1,"tw-mb-5"],["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.DNE(0,M,37,30,"div",2),2&e&&c.Y8G("ngIf",t.formGroup&&null!=t.selectedPlan)},dependencies:[u.bT,n.me,n.Q0,n.Zm,n.BC,n.cb,n.j4,n.JD,h.$,A.Q,p.P,g.f,v.j,f.I,m.J,y.h,C.k,w.r,u.oe,I.$],encapsulation:2})},91834(e,t,i){"use strict";i.d(t,{R:()=>s,l:()=>n});var n,r=i(51757);function s(e,t,i,s,o="controlB"){return a=>{if(!(a instanceof r.gE))throw new Error("compareInputs only supports validation at the FormGroup level");const l=a.get(t),c=a.get(i);if(!l||!c)throw new Error("[compareInputs validator] one or both of the specified controls could not be found in the form group");const d="controlA"===o?l:c;if(""===l.value&&""===c.value)return A();const u=l.value===c.value;return e===n.InputsShouldMatch?u?A():h():e===n.InputsShouldNotMatch?u?h():A():null;function h(){return d.setErrors(Object.assign(Object.assign({},d.errors||{}),{compareInputsError:{message:s}})),{compareInputsError:{message:s}}}function A(){const e=null==d?void 0:d.errors;if(null!=e){(null==e?void 0:e.compareInputsError)&&delete e.compareInputsError;const t=0===Object.keys(e).length;d.setErrors(t?null:e)}return null}}}!function(e){e[e.InputsShouldMatch=0]="InputsShouldMatch",e[e.InputsShouldNotMatch=1]="InputsShouldNotMatch"}(n||(n={}))},91962(e,t,i){"use strict";i.d(t,{_:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-item-group"]],hostAttrs:[1,"tw-block"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2,changeDetection:0})},92027(e,t,i){"use strict";i.d(t,{J:()=>v,M:()=>n});class n{}var r=i(72245),s=i(3204),o=i(60512),a=i(35014),l=i(62870),c=i(66523),d=i(78781),u=i(43890),h=i(82781),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},p=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},g=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});class v{constructor(e,t,i,n,r,s,o,a,l,c){this.registerSdkService=e,this.accountCryptographicStateService=t,this.pinStateService=i,this.kdfService=n,this.accountService=r,this.masterPasswordService=s,this.cryptoFunctionService=o,this.stateProvider=a,this.logService=l,this.biometricsService=c}unlockWithPin(e,t){return A(this,void 0,void 0,function*(){const i=performance.now();yield(0,r._)(this.registerSdkService.registerClient$(e).pipe((0,s.T)(i=>A(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");return p(n,i.take(),!1).value.crypto().initialize_user_crypto({userId:(0,c.WD)(e),kdfParams:yield this.getKdfParams(e),email:yield this.getEmail(e),accountCryptographicState:yield this.getAccountCryptographicState(e),method:{pinEnvelope:{pin:t,pin_protected_user_key_envelope:yield this.getPinProtectedUserKeyEnvelope(e)}}})}catch(r){n.error=r,n.hasError=!0}finally{g(n)}})))),this.logService.measure(i,"Unlock","DefaultUnlockService","unlockWithPin")})}unlockWithMasterPassword(e,t){return A(this,void 0,void 0,function*(){const i=performance.now();yield(0,r._)(this.registerSdkService.registerClient$(e).pipe((0,s.T)(i=>A(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");return p(n,i.take(),!1).value.crypto().initialize_user_crypto({userId:(0,c.WD)(e),kdfParams:yield this.getKdfParams(e),email:yield this.getEmail(e),accountCryptographicState:yield this.getAccountCryptographicState(e),method:{masterPasswordUnlock:{password:t,master_password_unlock:yield this.getMasterPasswordUnlockData(e)}}})}catch(r){n.error=r,n.hasError=!0}finally{g(n)}})))),yield this.setLegacyMasterKeyFromUnlockData(t,yield this.getMasterPasswordUnlockData(e),e),this.logService.measure(i,"Unlock","DefaultUnlockService","unlockWithMasterPassword")})}unlockWithBiometrics(e){return A(this,void 0,void 0,function*(){const t=yield this.biometricsService.unlockWithBiometricsForUser(e);if(!t)throw new Error("Failed to unlock with biometrics");const i=performance.now();yield(0,r._)(this.registerSdkService.registerClient$(e).pipe((0,s.T)(i=>A(this,void 0,void 0,function*(){const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");return p(n,i.take(),!1).value.crypto().initialize_user_crypto({userId:(0,c.WD)(e),kdfParams:yield this.getKdfParams(e),email:yield this.getEmail(e),accountCryptographicState:yield this.getAccountCryptographicState(e),method:{decryptedKey:{decrypted_user_key:t.toBase64()}}})}catch(r){n.error=r,n.hasError=!0}finally{g(n)}})))),this.logService.measure(i,"Unlock","DefaultUnlockService","unlockWithBiometrics")})}getAccountCryptographicState(e){return A(this,void 0,void 0,function*(){const t=yield(0,r._)(this.accountCryptographicStateService.accountCryptographicState$(e));return(0,o.x)(t,"Account cryptographic state is required"),t})}getKdfParams(e){return A(this,void 0,void 0,function*(){const t=yield(0,r._)(this.kdfService.getKdfConfig$(e).pipe((0,s.T)(e=>null==e?void 0:e.toSdkConfig())));return(0,o.x)(t,"KDF parameters are required"),t})}getEmail(e){return A(this,void 0,void 0,function*(){const t=(yield(0,r._)(this.accountService.accounts$))[e].email;return(0,o.x)(t,"Email is required"),t})}getPinProtectedUserKeyEnvelope(e){return A(this,void 0,void 0,function*(){const t=yield this.pinStateService.getPinLockType(e),i=yield this.pinStateService.getPinProtectedUserKeyEnvelope(e,t);return(0,o.x)(i,"User is not enrolled in PIN unlock"),i})}getMasterPasswordUnlockData(e){return A(this,void 0,void 0,function*(){const t=yield(0,r._)(this.masterPasswordService.masterPasswordUnlockData$(e));return(0,o.x)(t,"Master password unlock data is required"),t.toSdk()})}setLegacyMasterKeyFromUnlockData(e,t,i){return A(this,void 0,void 0,function*(){(0,o.x)(e,"password"),(0,o.x)(t,"masterPasswordUnlockData"),(0,o.x)(i,"userId"),this.logService.info("[DefaultUnlockService] Setting legacy master key from unlock data"),yield l.B.Ready;const n=(new TextEncoder).encode(e),r=(new TextEncoder).encode(t.salt),s=h.PureCrypto.derive_kdf_material(n,r,t.kdf),c=yield this.cryptoFunctionService.pbkdf2(s,e,"sha256",2);yield this.stateProvider.getUser(i,a.Zr).update(e=>new u.e(s)),yield this.stateProvider.getUser(i,a.kJ).update(e=>d.A.fromBufferToB64(c))})}}},92411(e,t,i){"use strict";i.d(t,{J:()=>n});class n{}},92697(e,t,i){"use strict";i.d(t,{E:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},93103(e,t,i){"use strict";i.d(t,{Y:()=>r});var n=i(33812);class r{onClick(e){e.preventDefault()}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","appStopClick",""]],hostBindings:function(e,t){1&e&&n.bIt("click",function(e){return t.onClick(e)})}})},93173(e,t,i){"use strict";i.d(t,{Bz:()=>j,$5:()=>A,jx:()=>I,dR:()=>P,Bh:()=>O,df:()=>J,ep:()=>_,Cp:()=>V,mH:()=>q});var n=i(34040),r=i(44500),s=i(81714),o=i(3204),a=i(72245),l=i(22485),c=i(37567),d=i(21879),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class h{constructor(e,t,i){this.keyDefinition=e,this.activeUserId$=t,this.singleUserStateProvider=i,this.combinedState$=this.activeUserId$.pipe((0,r.n)(e=>null!=e?this.singleUserStateProvider.get(e,this.keyDefinition).combinedState$:s.t)),this.state$=this.combinedState$.pipe((0,o.T)(([e,t])=>t))}update(e){return u(this,arguments,void 0,function*(e,t={}){const i=yield(0,a._)(this.activeUserId$.pipe((0,l.w)({first:1e3,with:()=>(0,c.$)(()=>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)]})}}class A{constructor(e,t){this.activeAccountAccessor=e,this.singleUserStateProvider=t,this.activeUserId$=this.activeAccountAccessor.activeUserId$.pipe((0,n.F)((e,t)=>null==e||null==t?e==t:e===t))}get(e){return new h(e,this.activeUserId$,this.singleUserStateProvider)}}var p=i(66046),g=i(73276),v=i(83892),f=i(3097),m=i(72737),y=i(8029),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class w{constructor(e,t,i){this.parentState$=e,this.deriveDefinition=t,this.dependencies=i,this.forcedValueSubject=new p.B,this.storageKey=t.storageKey;const n=this.parentState$.pipe((0,g.H)(e=>C(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,v.h)(this.forcedValueSubject,n).pipe((0,f.u)({connector:()=>new m.m(1),resetOnRefCountZero:()=>(0,y.O)(this.deriveDefinition.cleanupDelayMs)}))}forceValue(e){return C(this,void 0,void 0,function*(){return this.forcedValueSubject.next(e),e})}}class I{constructor(){this.cache=new WeakMap}get(e,t,i){let n=this.cache.get(e);n||(n={},this.cache.set(e,n));const r=t.buildCacheKey(),s=n[r];if(null!=s)return s;const o=this.buildDerivedState(e,t,i);return n[r]=o,o}buildDerivedState(e,t,i){return new w(e,t,i)}}var b=i(69194),B=i(43008),E=i(36359),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Q(e,t,i){return S(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 k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T{constructor(e,t,i,n){this.key=e,this.storageService=t,this.keyDefinition=i,this.logService=n;const s=t.updates$.pipe((0,b.p)(t=>t.key===e),(0,r.n)(n=>k(this,void 0,void 0,function*(){return"remove"===n.updateType?null:yield Q(e,t,i.deserializer)})));let o=(0,v.h)((0,B.v)(()=>Q(e,t,i.deserializer)),s);i.debug.enableRetrievalLogging&&(o=o.pipe((0,E.M)({next:t=>{this.logService.info(`Retrieving '${e}' from storage, value is ${null==t?"null":"non-null"}`)}}))),0!==i.cleanupDelayMs&&(o=o.pipe((0,f.u)({connector:()=>new m.m(1),resetOnRefCountZero:()=>(0,y.O)(i.cleanupDelayMs)}))),this.state$=o}update(e){return k(this,arguments,void 0,function*(e,t={}){const i=function(e){const{combineLatestWith:t=null,shouldUpdate:i=()=>!0,msTimeout:n=1e3}=e;return{combineLatestWith:t,shouldUpdate:i,msTimeout:n}}(t);null!=this.updatePromise&&(yield this.updatePromise);try{return this.updatePromise=this.internalUpdate(e,i),yield this.updatePromise}finally{this.updatePromise=null}})}internalUpdate(e,t){return k(this,void 0,void 0,function*(){const i=yield this.getStateForUpdate(),n=null!=t.combineLatestWith?yield(0,a._)(t.combineLatestWith.pipe((0,l.w)(t.msTimeout))):null;if(!t.shouldUpdate(i,n))return i;const r=e(i,n);return yield this.doStorageSave(r,i),r})}doStorageSave(e,t){return k(this,void 0,void 0,function*(){this.keyDefinition.debug.enableUpdateLogging&&this.logService.info(`Updating '${this.key}' from ${null==t?"null":"non-null"} to ${null==e?"null":"non-null"}`),yield this.storageService.save(this.key,e)})}getStateForUpdate(){return k(this,void 0,void 0,function*(){return yield Q(this.key,this.storageService,this.keyDefinition.deserializer)})}}class F extends T{constructor(e,t,i){super(function(e){return`global_${e.stateDefinition.name}_${e.key}`}(e),t,e,i)}}class P{constructor(e,t){this.storageServiceProvider=e,this.logService=t,this.globalStateCache={}}get(e){const[t,i]=this.storageServiceProvider.get(e.stateDefinition.defaultStorageLocation,e.stateDefinition.storageLocationOverrides),n=this.buildCacheKey(t,e),r=this.globalStateCache[n];if(null!=r)return r;const s=new F(e,i,this.logService);return this.globalStateCache[n]=s,s}buildCacheKey(e,t){return`${e}_${t.fullName}`}}var R=i(33338),D=i(93695),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x extends T{constructor(e,t,i,n,r){super(t.buildKey(e),i,t,r),this.userId=e,this.stateEventRegistrarService=n,this.combinedState$=(0,R.z)([(0,D.of)(e),this.state$])}doStorageSave(e,t){const i=Object.create(null,{doStorageSave:{get:()=>super.doStorageSave}});return M(this,void 0,void 0,function*(){yield i.doStorageSave.call(this,e,t),yield this.stateEventRegistrarService.registerEvents(this.keyDefinition)})}}class O{constructor(e,t,i){this.storageServiceProvider=e,this.stateEventRegistrarService=t,this.logService=i,this.cache={}}get(e,t){const[i,n]=this.storageServiceProvider.get(t.stateDefinition.defaultStorageLocation,t.stateDefinition.storageLocationOverrides),r=this.buildCacheKey(i,e,t),s=this.cache[r];if(null!=s)return s;const o=new x(e,t,n,this.stateEventRegistrarService,this.logService);return this.cache[r]=o,o}buildCacheKey(e,t,i){return`${e}_${i.fullName}_${t}`}}var G=i(58363),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class V{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,b.p)(e=>null!=e),(0,G.s)(1),(0,r.n)(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,G.s)(1),(0,r.n)(t=>null!=t?this.getUser(t,e).state$:(0,D.of)(n)))}setUserState(e,t,i){return U(this,void 0,void 0,function*(){return i?[i,yield this.getUser(i,e).update(()=>t)]:yield this.getActive(e).update(()=>t)})}}class j{}class N{}var z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Y="global",L="_user_auto",K="_user_biometric",X="DuckDuckGoSharedKey";class q{constructor(e,t,i){this.storageService=e,this.secureStorageService=t,this.activeUserAccessor=i}clean(e){return z(this,void 0,void 0,function*(){yield this.setUserKeyAutoUnlock(null,e),yield this.clearUserKeyBiometric(e.userId)})}getUserKeyAutoUnlock(e){return z(this,void 0,void 0,function*(){return null==e.userId?null:yield this.secureStorageService.get(`${e.userId}${L}`,{userId:e.userId,keySuffix:"auto"})})}setUserKeyAutoUnlock(e,t){return z(this,void 0,void 0,function*(){null!=t.userId&&(yield this.saveSecureStorageKey(L,e,t.userId,"auto"))})}clearUserKeyBiometric(e){return z(this,void 0,void 0,function*(){null!=e&&(yield this.saveSecureStorageKey(K,null,e,"biometric"))})}getDuckDuckGoSharedKey(){return z(this,void 0,void 0,function*(){return null==(yield this.getActiveUserIdFromStorage())?null:yield this.secureStorageService.get(X)})}setDuckDuckGoSharedKey(e){return z(this,void 0,void 0,function*(){null!=(yield this.getActiveUserIdFromStorage())&&(null==e?yield this.secureStorageService.remove(X):yield this.secureStorageService.save(X,e))})}setEnableDuckDuckGoBrowserIntegration(e){return z(this,void 0,void 0,function*(){var t;const i=null!==(t=yield this.storageService.get(Y))&&void 0!==t?t:new N;i.enableDuckDuckGoBrowserIntegration=e,yield this.storageService.save(Y,i)})}getActiveUserIdFromStorage(){return z(this,void 0,void 0,function*(){return yield(0,a._)(this.activeUserAccessor.activeUserId$)})}saveSecureStorageKey(e,t,i,n){return z(this,void 0,void 0,function*(){return null==t?yield this.secureStorageService.remove(`${i}${e}`,{keySuffix:n}):yield this.secureStorageService.save(`${i}${e}`,t,{keySuffix:n})})}}var H=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const W=d.Zs.array(d.Z9,"lock",{deserializer:e=>e}),$=d.Zs.array(d.Z9,"logout",{deserializer:e=>e});class J{constructor(e,t){this.storageServiceProvider=t,this.stateEventStateMap={lock:e.get(W),logout:e.get($)}}registerEvents(e){return H(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),r={state:e.stateDefinition.name,key:e.key,location:n};yield i.update(e=>(null!=e||(e=[]),e.push(r),e),{shouldUpdate:e=>null==e||-1===e.findIndex(e=>e.state===r.state&&e.key===r.key&&e.location===r.location)})}})}}var Z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _{constructor(e,t){this.storageServiceProvider=t,this.stateEventMap={lock:e.get(W),logout:e.get($)}}handleEvent(e,t){return Z(this,void 0,void 0,function*(){let i=yield(0,a._)(this.stateEventMap[e].state$);null!=i||(i=[]);const n=[];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(r){let t="Unknown Error";null!=r&&"object"==typeof r&&"message"in r&&"string"==typeof r.message&&(t=r.message),n.push(`${t} in ${e.state} > ${e.key} located ${e.location}`)}if(n.length>0)throw new Error(`One or more errors occurred while handling event '${e}' for user ${t}.\n${n.join("\n")}`)})}storageKeyFor(e,t){return new d.Ok(new d.zU(t.state,t.location),t.key,{deserializer:e=>e,clearOn:[]}).buildKey(e)}}},93199(e,t,i){"use strict";i.d(t,{I:()=>s});var n=i(33812);let r=0;class s{constructor(){this.id="bit-hint-"+r++}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.FsC({type:s,selectors:[["bit-hint"]],hostAttrs:[1,"tw-text-muted","tw-font-normal","tw-inline-block","tw-mt-1","tw-text-xs"],hostVars:1,hostBindings:function(e,t){2&e&&n.Avn("id",t.id)}})},93817(e,t,i){"use strict";i.d(t,{l:()=>Ne});var n=i(94251),r=i(77468),s=i(6056),o=i(47659),a=i(20798),l=i(79303),c=i(62963),d=i(14092),u=i(10840),h=i(33812),A=i(31442),p=i(61325),g=i(53997),v=i(45980),f=i(85523),m=i(74208),y=i(50700),C=i(26333),w=i(47428),I=i(50352),b=i(36288),B=i(57178),E=i(13496),S=i(78952),Q=i(32924),k=i(38410),T=i(75697),F=i(55393),P=i(69592),R=i(37856),D=i(25740),M=i(55818),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const O=()=>[],G=(e,t)=>({itemId:e,action:t}),U=()=>({focusAfterNav:!1});function V(e,t){if(1&e){const e=h.RV6();h.j41(0,"input",16),h.nI1(1,"i18n"),h.bIt("change",function(t){m.eBV(e);const i=h.XpG();return m.Njj(t?i.checkedToggled.next():null)}),h.k0s()}if(2&e){const e=h.XpG();h.Y8G("disabled",e.disabled||e.decryptionFailure)("checked",e.checked),h.BMQ("aria-label",h.bMT(1,3,"vaultItemSelect"))}}function j(e,t){1&e&&(h.qex(0),h.nrm(1,"i",19),h.nI1(2,"i18n"),h.j41(3,"span",18),h.EFF(4),h.nI1(5,"i18n"),h.k0s(),h.bVm()),2&e&&(h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,3,"attachmentsNeedFix"))),h.R7$(3),h.JRh(h.bMT(5,5,"attachmentsNeedFix")))}function N(e,t){if(1&e&&(h.qex(0),h.nrm(1,"i",17),h.nI1(2,"i18n"),h.j41(3,"span",18),h.EFF(4),h.nI1(5,"i18n"),h.k0s(),h.DNE(6,j,6,7,"ng-container",9),h.bVm()),2&e){const e=h.XpG();h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,4,"attachments"))),h.R7$(3),h.JRh(h.bMT(5,6,"attachments")),h.R7$(2),h.Y8G("ngIf",e.showFixOldAttachments)}}function z(e,t){if(1&e&&(h.j41(0,"td",20),h.nrm(1,"app-org-badge",21),h.nI1(2,"orgNameFromId"),h.k0s()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(),h.Y8G("disabled",e.disabled)("organizationId",e.cipher.organizationId)("organizationName",h.i5U(2,4,e.cipher.organizationId,e.organizations))}}function Y(e,t){if(1&e&&h.nrm(0,"app-collection-badge",24),2&e){const e=h.XpG(2);h.Y8G("collectionIds",e.cipher.collectionIds)("collections",e.collections)}}function L(e,t){if(1&e&&(h.j41(0,"td",22),h.DNE(1,Y,1,2,"app-collection-badge",23),h.k0s()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(),h.Y8G("ngIf",e.cipher.collectionIds)}}function K(e,t){if(1&e&&h.nrm(0,"td",22),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass)}}function X(e,t){if(1&e&&(h.j41(0,"td",22)(1,"p",25),h.EFF(2),h.k0s()()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(2),h.SpI(" ",e.permissionText," ")}}function q(e,t){if(1&e&&(h.nrm(0,"button",26),h.nI1(1,"i18n")),2&e){const e=h.XpG(),t=h.sdS(20);h.Y8G("label",h.mNQ(h.bMT(1,4,"options")))("disabled",e.disabled||!e.canManageCollection)("bitMenuTriggerFor",t)}}function H(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.deleteCipher())}),h.j41(1,"span",28),h.nrm(2,"i",29),h.EFF(3),h.nI1(4,"i18n"),h.k0s()()}if(2&e){const e=h.XpG();h.R7$(3),h.SpI(" ",h.bMT(4,1,e.isDeleted?"permanentlyDelete":"delete")," ")}}function W(e,t){if(1&e&&(h.j41(0,"button",34),h.nrm(1,"i",33),h.EFF(2),h.nI1(3,"i18n"),h.k0s()),2&e){const e=h.XpG(3);h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(3,2,"copyPassword")," ")}}function $(e,t){if(1&e&&(h.j41(0,"a",37),h.nrm(1,"i",38),h.EFF(2),h.nI1(3,"i18n"),h.k0s()),2&e){const e=h.XpG(3);h.Y8G("href",e.launchUri,h.B4B),h.R7$(2),h.SpI(" ",h.bMT(3,2,"launch")," ")}}function J(e,t){if(1&e&&(h.qex(0),h.j41(1,"button",32),h.nrm(2,"i",33),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.nVh(5,W,4,4,"button",34),h.j41(6,"button",35),h.nrm(7,"i",33),h.EFF(8),h.nI1(9,"i18n"),h.k0s(),h.DNE(10,$,4,4,"a",36),h.bVm()),2&e){const e=h.XpG(2);h.R7$(),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(4,6,"copyUsername")," "),h.R7$(2),h.vxM(e.cipher.viewPassword?5:-1),h.R7$(),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(9,8,"copyVerificationCode")," "),h.R7$(2),h.Y8G("ngIf",e.canLaunch)}}function Z(e,t){if(1&e&&(h.qex(0),h.j41(1,"button",39),h.nrm(2,"i",33),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.j41(5,"button",40),h.nrm(6,"i",33),h.EFF(7),h.nI1(8,"i18n"),h.k0s(),h.bVm()),2&e){const e=h.XpG(2);h.R7$(),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(4,4,"copyNumber")," "),h.R7$(2),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(8,6,"copySecurityCode")," ")}}function _(e,t){if(1&e&&(h.qex(0),h.j41(1,"button",32),h.nrm(2,"i",33),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.j41(5,"button",41),h.nrm(6,"i",33),h.EFF(7),h.nI1(8,"i18n"),h.k0s(),h.j41(9,"button",42),h.nrm(10,"i",33),h.EFF(11),h.nI1(12,"i18n"),h.k0s(),h.j41(13,"button",43),h.nrm(14,"i",33),h.EFF(15),h.nI1(16,"i18n"),h.k0s(),h.bVm()),2&e){const e=h.XpG(2);h.R7$(),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(4,8,"copyUsername")," "),h.R7$(2),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(8,10,"copyEmail")," "),h.R7$(2),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(12,12,"copyPhone")," "),h.R7$(2),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(16,14,"copyAddress")," ")}}function ee(e,t){if(1&e&&(h.qex(0),h.j41(1,"button",44),h.nrm(2,"i",33),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.bVm()),2&e){const e=h.XpG(2);h.R7$(),h.Y8G("cipher",e.cipher),h.R7$(2),h.SpI(" ",h.bMT(4,2,"copyNote")," ")}}function te(e,t){1&e&&h.nrm(0,"bit-menu-divider")}function ie(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.toggleFavorite())}),h.nrm(1,"i",45),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}if(2&e){const e=h.XpG(2);h.R7$(2),h.SpI(" ",h.bMT(3,1,e.cipher.favorite?"unfavorite":"favorite")," ")}}function ne(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.editCipher())}),h.nrm(1,"i",46),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"edit")," "))}function re(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.attachments())}),h.nrm(1,"i",47),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"attachments")," "))}function se(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.clone())}),h.nrm(1,"i",48),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"clone")," "))}function oe(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(3);return m.Njj(t.assignToCollections())}),h.nrm(1,"i",49),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"assignToCollections")," "))}function ae(e,t){if(1&e&&h.DNE(0,oe,4,3,"button",15),2&e){const e=h.XpG(2);h.Y8G("ngIf",e.showAssignToCollections)}}function le(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.events())}),h.nrm(1,"i",50),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"eventLogs")," "))}function ce(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(3);return m.Njj(t.archive())}),h.nrm(1,"i",51),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"archiveVerb")," "))}function de(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(t){m.eBV(e);const i=h.sdS(6);return m.Njj(i.promptForPremium(t))}),h.nrm(1,"i",51),h.EFF(2),h.nI1(3,"i18n"),h.j41(4,"div",52),h.nrm(5,"app-premium-badge",null,2),h.k0s()()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"archiveVerb")," "))}function ue(e,t){if(1&e&&(h.nVh(0,ce,4,3,"button",31),h.nVh(1,de,7,3,"button",31)),2&e){const e=h.XpG(2);h.vxM(e.userCanArchive?0:-1),h.R7$(),h.vxM(e.userCanArchive?-1:1)}}function he(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.unarchive())}),h.nrm(1,"i",53),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"unArchive")," "))}function Ae(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.restore())}),h.nrm(1,"i",54),h.EFF(2),h.nI1(3,"i18n"),h.k0s()}2&e&&(h.R7$(2),h.SpI(" ",h.bMT(3,1,"restore")," "))}function pe(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",27),h.bIt("click",function(){m.eBV(e);const t=h.XpG(2);return m.Njj(t.deleteCipher())}),h.j41(1,"span",28),h.nrm(2,"i",29),h.EFF(3),h.nI1(4,"i18n"),h.k0s()()}if(2&e){const e=h.XpG(2);h.R7$(3),h.SpI(" ",h.bMT(4,1,e.isDeleted?"permanentlyDelete":"delete")," ")}}function ge(e,t){if(1&e&&(h.nrm(0,"button",30),h.nI1(1,"i18n"),h.j41(2,"bit-menu",null,1),h.DNE(4,J,11,10,"ng-container",9)(5,Z,9,8,"ng-container",9)(6,_,17,16,"ng-container",9)(7,ee,5,4,"ng-container",9)(8,te,1,0,"bit-menu-divider",9),h.nVh(9,ie,4,3,"button",31),h.nVh(10,ne,4,3,"button",31),h.nVh(11,re,4,3,"button",31),h.nVh(12,se,4,3,"button",31),h.nVh(13,ae,1,1,"button",31),h.nVh(14,le,4,3,"button",31),h.nVh(15,ue,2,2),h.nVh(16,he,4,3,"button",31),h.DNE(17,Ae,4,3,"button",15)(18,pe,5,3,"button",15),h.k0s()),2&e){const e=h.sdS(3),t=h.XpG();h.Y8G("label",h.mNQ(h.bMT(1,19,"options")))("bitMenuTriggerFor",e)("disabled",t.disabled),h.R7$(4),h.Y8G("ngIf",t.isLoginCipher),h.R7$(),h.Y8G("ngIf",t.isCardCipher),h.R7$(),h.Y8G("ngIf",t.isIdentityCipher),h.R7$(),h.Y8G("ngIf",t.isSecureNoteCipher),h.R7$(),h.Y8G("ngIf",t.showMenuDivider),h.R7$(),h.vxM(t.showFavorite?9:-1),h.R7$(),h.vxM(!t.isDeleted&&t.canEditCipher?10:-1),h.R7$(),h.vxM(t.showAttachments?11:-1),h.R7$(),h.vxM(t.showClone?12:-1),h.R7$(),h.vxM(t.showAssignToCollections?13:-1),h.R7$(),h.vxM(t.showEventLogs?14:-1),h.R7$(),h.vxM(t.showArchiveButton?15:-1),h.R7$(),h.vxM(t.showUnArchiveButton?16:-1),h.R7$(),h.Y8G("ngIf",t.isDeleted&&t.canRestoreCipher),h.R7$(),h.Y8G("ngIf",t.canDeleteCipher)}}class ve{constructor(e){this.i18nService=e,this.RowHeightClass=f.O6,this.onEvent=new h.bkB,this.checkedToggled=new h.bkB,this.CipherType=A.gC,this.permissionList=(0,v.M3)(),this.permissionPriority=["manageCollection","editItems","editItemsHidePass","viewItems","viewItemsHidePass"]}ngOnInit(){return x(this,void 0,void 0,function*(){null!=this.cipher.organizationId&&(this.organization=this.organizations.find(e=>e.id===this.cipher.organizationId))})}get showArchiveButton(){return!this.viewingOrgVault&&(!p.n.isArchived(this.cipher)&&!p.n.isDeleted(this.cipher))}get showUnArchiveButton(){return!this.viewingOrgVault&&(p.n.isArchived(this.cipher)&&!p.n.isDeleted(this.cipher))}get clickAction(){return this.decryptionFailure?"showFailedToDecrypt":"view"}get showTotpCopyButton(){var e;const t=p.n.getLogin(this.cipher);return null!==(e=null==t?void 0:t.totp)&&void 0!==e&&e&&(this.cipher.organizationUseTotp||this.showPremiumFeatures)}get showFixOldAttachments(){return this.cipher.hasOldAttachments&&null==this.cipher.organizationId}get hasAttachments(){return p.n.hasAttachments(this.cipher)}get showAttachments(){return!(p.n.isArchived(this.cipher)&&!this.userCanArchive||this.isDeleted)&&(this.canEditCipher||this.hasAttachments)}get canLaunch(){return p.n.canLaunch(this.cipher)}get launchUri(){return p.n.getLaunchUri(this.cipher)}get subtitle(){return p.n.subtitle(this.cipher)}get isDeleted(){return p.n.isDeleted(this.cipher)}get decryptionFailure(){return p.n.decryptionFailure(this.cipher)}get showAssignToCollections(){var e;return(null===(e=this.organizations)||void 0===e?void 0:e.length)&&this.canAssignCollections&&!p.n.isDeleted(this.cipher)}get showClone(){return!(p.n.isArchived(this.cipher)&&(!this.userCanArchive||this.enforceOrgDataOwnershipPolicy))&&(this.cloneable&&!p.n.isDeleted(this.cipher))}get showEventLogs(){return this.useEvents&&this.cipher.organizationId}get isLoginCipher(){return p.n.getType(this.cipher)===this.CipherType.Login&&!p.n.isDeleted(this.cipher)&&!p.n.isArchived(this.cipher)}get permissionText(){var e;if(!this.cipher.organizationId||0===this.cipher.collectionIds.length)return this.i18nService.t("manageCollection");const t=this.collections.filter(e=>{if(e.assigned)return this.cipher.collectionIds.find(t=>{if(e.id===t)return e})});if(1===(null==t?void 0:t.length))return this.i18nService.t(null===(e=this.permissionList.find(e=>e.perm===(0,v.Jh)(t[0])))||void 0===e?void 0:e.labelId);if((null==t?void 0:t.length)>1){const e=t.map(e=>{var t;return null===(t=this.permissionList.find(t=>t.perm===(0,v.Jh)(e)))||void 0===t?void 0:t.labelId}),i=this.permissionPriority.find(t=>e.includes(t));return this.i18nService.t(i)}return this.i18nService.t("noAccess")}get hasVisibleLoginOptions(){return this.isLoginCipher&&(p.n.hasCopyableValue(this.cipher,"username")||this.cipher.viewPassword&&p.n.hasCopyableValue(this.cipher,"password")||this.showTotpCopyButton||this.canLaunch)}get isCardCipher(){return p.n.getType(this.cipher)===this.CipherType.Card&&!this.isDeleted}get hasVisibleCardOptions(){return this.isCardCipher&&(p.n.hasCopyableValue(this.cipher,"cardNumber")||p.n.hasCopyableValue(this.cipher,"securityCode"))}get isIdentityCipher(){return!(p.n.isArchived(this.cipher)&&!this.userCanArchive)&&(p.n.getType(this.cipher)===this.CipherType.Identity&&!this.isDeleted)}get hasVisibleIdentityOptions(){return this.isIdentityCipher&&(p.n.hasCopyableValue(this.cipher,"address")||p.n.hasCopyableValue(this.cipher,"email")||p.n.hasCopyableValue(this.cipher,"username")||p.n.hasCopyableValue(this.cipher,"phone"))}get isSecureNoteCipher(){return p.n.getType(this.cipher)===this.CipherType.SecureNote&&!(this.isDeleted&&this.canRestoreCipher)}get hasVisibleSecureNoteOptions(){return this.isSecureNoteCipher&&p.n.hasCopyableValue(this.cipher,"secureNote")}get showMenuDivider(){return this.hasVisibleLoginOptions||this.hasVisibleCardOptions||this.hasVisibleIdentityOptions||this.hasVisibleSecureNoteOptions}clone(){this.onEvent.emit({type:"clone",item:this.cipher})}events(){this.onEvent.emit({type:"viewEvents",item:this.cipher})}archive(){this.onEvent.emit({type:"archive",items:[this.cipher]})}unarchive(){this.onEvent.emit({type:"unarchive",items:[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})}assignToCollections(){this.onEvent.emit({type:"assignToCollections",items:[this.cipher]})}get showCheckbox(){return!this.viewingOrgVault||!this.organization||(this.organization.canEditAllCiphers||this.cipher.edit&&this.cipher.viewPassword)}get showFavorite(){return!(!this.viewingOrgVault&&p.n.isArchived(this.cipher)&&!this.userCanArchive||p.n.isDeleted(this.cipher))}toggleFavorite(){this.onEvent.emit({type:"toggleFavorite",item:this.cipher})}editCipher(){this.onEvent.emit({type:"editCipher",item:this.cipher})}onRightClick(e){e.shiftKey&&e.ctrlKey||!this.disabled&&this.menuTrigger&&this.menuTrigger.toggleMenuOnRightClick(e)}}ve.ɵfac=function(e){return new(e||ve)(h.rXU(y.W))},ve.ɵcmp=h.VBU({type:ve,selectors:[["tr","appVaultCipherRow",""]],viewQuery:function(e,t){if(1&e&&h.GBs(g.O,5),2&e){let e;h.mGM(e=h.lsd())&&(t.menuTrigger=e.first)}},hostBindings:function(e,t){1&e&&h.bIt("contextmenu",function(e){return t.onRightClick(e)})},inputs:{disabled:"disabled",cipher:"cipher",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",showPremiumFeatures:"showPremiumFeatures",useEvents:"useEvents",cloneable:"cloneable",organizations:"organizations",collections:"collections",viewingOrgVault:"viewingOrgVault",canEditCipher:"canEditCipher",canAssignCollections:"canAssignCollections",canManageCollection:"canManageCollection",canDeleteCipher:"canDeleteCipher",canRestoreCipher:"canRestoreCipher",userCanArchive:"userCanArchive",enforceOrgDataOwnershipPolicy:"enforceOrgDataOwnershipPolicy",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},standalone:!1,attrs:["appVaultCipherRow",""],decls:23,vars:33,consts:[["corruptedCipherOptions",""],["cipherOptions",""],["badge",""],["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked","change",4,"ngIf"],[3,"cipher"],["bitCell","",1,"tw-truncate",3,"ngClass"],[1,"tw-inline-flex","tw-w-full"],["bitLink","","queryParamsHandling","merge","type","button","appStopProp","","aria-haspopup","dialog",1,"tw-overflow-hidden","tw-text-ellipsis","tw-text-start","tw-leading-snug",3,"disabled","routerLink","queryParams","replaceUrl","title","id","state"],[4,"ngIf"],["appStopProp","",1,"tw-text-sm","tw-text-muted"],["bitCell","","class","tw-hidden lg:tw-table-cell",3,"ngClass",4,"ngIf"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label",4,"ngIf"],["bitMenuItem","","type","button",3,"click",4,"ngIf"],["type","checkbox","bitCheckbox","","appStopProp","",3,"change","disabled","checked"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-2","tw-leading-normal",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-ml-2","tw-leading-normal","tw-text-warning",3,"title"],["bitCell","",1,"tw-hidden","lg:tw-table-cell",3,"ngClass"],["appStopProp","",3,"disabled","organizationId","organizationName"],["bitCell","",3,"ngClass"],[3,"collectionIds","collections",4,"ngIf"],[3,"collectionIds","collections"],[1,"tw-mb-0","tw-text-muted"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label"],["bitMenuItem","","type","button",3,"click"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"bitMenuTriggerFor","disabled","label"],["bitMenuItem","","type","button"],["type","button","bitMenuItem","","appCopyField","username",3,"cipher"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["bitMenuItem","","type","button","appCopyField","password",3,"cipher"],["bitMenuItem","","type","button","appCopyField","totp",3,"cipher"],["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-external-link"],["type","button","bitMenuItem","","appCopyField","cardNumber",3,"cipher"],["type","button","bitMenuItem","","appCopyField","securityCode",3,"cipher"],["type","button","bitMenuItem","","appCopyField","email",3,"cipher"],["type","button","bitMenuItem","","appCopyField","phone",3,"cipher"],["type","button","bitMenuItem","","appCopyField","address",3,"cipher"],["type","button","bitMenuItem","","appCopyField","secureNote",3,"cipher"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-star"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paperclip"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-files"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection-shared"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-file-text"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-archive"],["slot","end","aria-hidden","",1,"-tw-mt-0.5"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-unarchive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"]],template:function(e,t){1&e&&(h.j41(0,"td",3),h.DNE(1,V,2,5,"input",4),h.k0s(),h.j41(2,"td",3),h.nrm(3,"app-vault-icon",5),h.k0s(),h.j41(4,"td",6)(5,"div",7)(6,"button",8),h.nI1(7,"i18n"),h.EFF(8),h.k0s(),h.DNE(9,N,7,8,"ng-container",9),h.k0s(),h.nrm(10,"br"),h.j41(11,"span",10),h.EFF(12),h.k0s()(),h.DNE(13,z,3,7,"td",11)(14,L,2,2,"td",12)(15,K,1,1,"td",12)(16,X,3,2,"td",12),h.j41(17,"td",13),h.DNE(18,q,2,6,"button",14),h.j41(19,"bit-menu",null,0),h.DNE(21,H,5,3,"button",15),h.k0s(),h.nVh(22,ge,19,21),h.k0s()),2&e&&(h.Y8G("ngClass",t.RowHeightClass),h.R7$(),h.Y8G("ngIf",t.showCheckbox),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(),h.Y8G("cipher",t.cipher),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(2),h.Y8G("title",h.mNQ(h.i5U(7,25,"editItemWithName",t.cipher.name)))("id",h.VkB("cipher-btn-",t.cipher.id))("disabled",t.disabled)("routerLink",h.lJ4(28,O))("queryParams",h.l_i(29,G,t.cipher.id,t.clickAction))("replaceUrl",!0)("state",h.lJ4(32,U)),h.R7$(2),h.SpI(" ",t.cipher.name," "),h.R7$(),h.Y8G("ngIf",t.hasAttachments),h.R7$(3),h.JRh(t.subtitle),h.R7$(),h.Y8G("ngIf",t.showOwner),h.R7$(),h.Y8G("ngIf",t.showCollections),h.R7$(),h.Y8G("ngIf",t.showGroups),h.R7$(),h.Y8G("ngIf",t.viewingOrgVault),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(),h.Y8G("ngIf",t.decryptionFailure),h.R7$(3),h.Y8G("ngIf",t.canDeleteCipher),h.R7$(),h.vxM(t.decryptionFailure?-1:22))},dependencies:[r.YU,r.bT,s.Wk,C.R,w.x,I.P,b.s,B.g,E.Z,g.O,S.S,Q.M,k.Q,T.P,F.K,P.w,R.a,D.$,M.t],encapsulation:2});var fe=i(52237),me=i(47696),ye=i(94573),Ce=i(33277),we=i(94438);class Ie{constructor(e){this.i18nService=e,this.selectedGroups=(0,ye.hFB)([]),this.allGroups=(0,ye.hFB)([]),this.groupNames=(0,Ce.EW)(()=>{const e=this.allGroups();return e?this.selectedGroups().map(t=>{var i;return null===(i=e.find(e=>e.id===t.id))||void 0===i?void 0:i.name}).filter(e=>void 0!==e).sort(this.i18nService.collator.compare):[]})}}Ie.ɵfac=function(e){return new(e||Ie)(h.rXU(y.W))},Ie.ɵcmp=h.VBU({type:Ie,selectors:[["app-group-badge"]],inputs:{selectedGroups:[1,"selectedGroups"],allGroups:[1,"allGroups"]},standalone:!1,decls:1,vars:2,consts:[["variant","secondary",3,"items","maxItems"]],template:function(e,t){1&e&&h.nrm(0,"bit-badge-list",0),2&e&&h.Y8G("items",t.groupNames())("maxItems",3)},dependencies:[we.p],encapsulation:2,changeDetection:0});const be=()=>[],Be=e=>({collectionId:e});function Ee(e,t){if(1&e){const e=h.RV6();h.j41(0,"input",15),h.nI1(1,"i18n"),h.bIt("change",function(t){m.eBV(e);const i=h.XpG();return m.Njj(t?i.checkedToggled.next():null)}),h.k0s()}if(2&e){const e=h.XpG();h.Y8G("disabled",e.disabled)("checked",e.checked),h.BMQ("aria-label",h.bMT(1,3,"collectionItemSelect"))}}function Se(e,t){if(1&e){const e=h.RV6();h.j41(0,"span",16),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.addAccess(t.CollectionPermission.Manage))}),h.EFF(1),h.nI1(2,"i18n"),h.k0s()}2&e&&(h.R7$(),h.SpI(" ",h.bMT(2,1,"addAccess")," "))}function Qe(e,t){if(1&e&&(h.j41(0,"td",17),h.nrm(1,"app-org-badge",18),h.nI1(2,"orgNameFromId"),h.k0s()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(),h.Y8G("disabled",e.disabled)("organizationId",e.collection.organizationId)("organizationName",h.i5U(2,4,e.collection.organizationId,e.organizations))}}function ke(e,t){if(1&e&&h.nrm(0,"td",4),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass)}}function Te(e,t){if(1&e&&h.nrm(0,"app-group-badge",20),2&e){const e=h.XpG(2);h.Y8G("selectedGroups",e.collectionGroups)("allGroups",e.groups)}}function Fe(e,t){if(1&e&&(h.j41(0,"td",4),h.DNE(1,Te,1,2,"app-group-badge",19),h.k0s()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(),h.Y8G("ngIf",e.collectionGroups)}}function Pe(e,t){if(1&e&&(h.j41(0,"td",4)(1,"p",21),h.EFF(2),h.k0s()()),2&e){const e=h.XpG();h.Y8G("ngClass",e.RowHeightClass),h.R7$(),h.Y8G("title",e.permissionTooltip),h.R7$(),h.SpI(" ",e.permissionText," ")}}function Re(e,t){if(1&e&&(h.nrm(0,"button",12),h.nI1(1,"i18n")),2&e){const e=h.XpG(),t=h.sdS(19);h.Y8G("label",h.mNQ(h.bMT(1,4,"options")))("disabled",e.disabled)("bitMenuTriggerFor",t)}}function De(e,t){if(1&e){const e=h.RV6();h.qex(0),h.j41(1,"button",22),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.edit(!1))}),h.nrm(2,"i",23),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.j41(5,"button",22),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.access(!1))}),h.nrm(6,"i",24),h.EFF(7),h.nI1(8,"i18n"),h.k0s(),h.bVm()}2&e&&(h.R7$(3),h.SpI(" ",h.bMT(4,2,"editInfo")," "),h.R7$(4),h.SpI(" ",h.bMT(8,4,"editAccess")," "))}function Me(e,t){if(1&e){const e=h.RV6();h.qex(0),h.j41(1,"button",22),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.edit(!0))}),h.nrm(2,"i",23),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.j41(5,"button",22),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.access(!0))}),h.nrm(6,"i",24),h.EFF(7),h.nI1(8,"i18n"),h.k0s(),h.bVm()}2&e&&(h.R7$(3),h.SpI(" ",h.bMT(4,2,"viewInfo")," "),h.R7$(4),h.SpI(" ",h.bMT(8,4,"viewAccess")," "))}function xe(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",22),h.bIt("click",function(){m.eBV(e);const t=h.XpG();return m.Njj(t.deleteCollection())}),h.j41(1,"span",25),h.nrm(2,"i",26),h.EFF(3),h.nI1(4,"i18n"),h.k0s()()}2&e&&(h.R7$(3),h.SpI(" ",h.bMT(4,1,"delete")," "))}class Oe{constructor(e){this.i18nService=e,this.RowHeightClass=f.O6,this.Unassigned="unassigned",this.CollectionPermission=v.aF,this.DefaultCollectionType=fe.it.DefaultUserCollection,this.onEvent=new h.bkB,this.checkedToggled=new h.bkB}get collectionGroups(){return this.collection instanceof fe.nb?this.collection.groups:[]}get organization(){return this.organizations.find(e=>e.id===this.collection.organizationId)}get showAddAccess(){var e,t;return this.collection.id!=fe.I_&&(this.collection instanceof fe.nb&&(!(null===(e=this.organization)||void 0===e?void 0:e.allowAdminAccessToAllCollectionItems)&&this.collection.unmanaged&&(null===(t=this.organization)||void 0===t?void 0:t.canEditUnmanagedCollections)))}get permissionText(){var e,t;if(this.collection.id==fe.I_&&(null===(e=this.organization)||void 0===e?void 0:e.canEditUnassignedCiphers))return this.i18nService.t("editItems");if(this.collection.assigned){const e=(0,v.M3)();return this.i18nService.t(null===(t=e.find(e=>e.perm===(0,v.Jh)(this.collection)))||void 0===t?void 0:t.labelId)}return this.i18nService.t("noAccess")}get permissionTooltip(){return this.collection.id==fe.I_?this.i18nService.t("collectionAdminConsoleManaged"):""}edit(e){this.onEvent.next({type:"editCollection",item:this.collection,readonly:e})}access(e){this.onEvent.next({type:"viewCollectionAccess",item:this.collection,readonly:e})}addAccess(e){this.onEvent.next({type:"viewCollectionAccess",item:this.collection,readonly:!1,initialPermission:e})}deleteCollection(){this.onEvent.next({type:"delete",items:[{collection:this.collection}]})}onRightClick(e){e.shiftKey&&e.ctrlKey||!this.disabled&&this.menuTrigger&&this.menuTrigger.toggleMenuOnRightClick(e)}}Oe.ɵfac=function(e){return new(e||Oe)(h.rXU(y.W))},Oe.ɵcmp=h.VBU({type:Oe,selectors:[["tr","appVaultCollectionRow",""]],viewQuery:function(e,t){if(1&e&&h.GBs(g.O,5),2&e){let e;h.mGM(e=h.lsd())&&(t.menuTrigger=e.first)}},hostBindings:function(e,t){1&e&&h.bIt("contextmenu",function(e){return t.onRightClick(e)})},inputs:{disabled:"disabled",collection:"collection",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",canEditCollection:"canEditCollection",canDeleteCollection:"canDeleteCollection",canViewCollectionInfo:"canViewCollectionInfo",organizations:"organizations",groups:"groups",showPermissionsColumn:"showPermissionsColumn",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},standalone:!1,attrs:["appVaultCollectionRow",""],decls:23,vars:28,consts:[["collectionOptions",""],["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked"],["aria-hidden","true"],["bitCell","",3,"ngClass"],[1,"tw-flex"],["bitLink","","type","button","linkType","secondary","queryParamsHandling","merge","appStopProp","",1,"tw-flex","tw-text-start","tw-leading-snug","tw-max-w-56",3,"disabled","title","routerLink","queryParams"],[1,"tw-truncate","tw-mr-1","tw-max-w-56"],["bitBadge","","role","button","variant","warning",1,"tw-cursor-pointer"],["bitCell","","class","tw-hidden lg:tw-table-cell",3,"ngClass",4,"ngIf"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label"],[4,"ngIf"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","checkbox","bitCheckbox","","appStopProp","",3,"change","disabled","checked"],["bitBadge","","role","button","variant","warning",1,"tw-cursor-pointer",3,"click"],["bitCell","",1,"tw-hidden","lg:tw-table-cell",3,"ngClass"],["appStopProp","",3,"disabled","organizationId","organizationName"],[3,"selectedGroups","allGroups",4,"ngIf"],[3,"selectedGroups","allGroups"],[1,"tw-mb-0","tw-text-muted",3,"title"],["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&&(h.j41(0,"td",1),h.nVh(1,Ee,2,5,"input",2),h.k0s(),h.j41(2,"td",1)(3,"div",3),h.nrm(4,"i"),h.k0s()(),h.j41(5,"td",4)(6,"div",5)(7,"button",6),h.nI1(8,"i18n"),h.j41(9,"div",7),h.EFF(10),h.k0s()(),h.nVh(11,Se,3,3,"span",8),h.k0s()(),h.DNE(12,Qe,3,7,"td",9)(13,ke,1,1,"td",10)(14,Fe,2,2,"td",10)(15,Pe,3,3,"td",10),h.j41(16,"td",11),h.nVh(17,Re,2,6,"button",12),h.j41(18,"bit-menu",null,0),h.DNE(20,De,9,6,"ng-container",13)(21,Me,9,6,"ng-container",13)(22,xe,5,3,"button",14),h.k0s()()),2&e&&(h.Y8G("ngClass",t.RowHeightClass),h.R7$(),h.vxM(t.canEditCollection||t.canDeleteCollection?1:-1),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(2),h.HbH("bwi bwi-fw bwi-lg "+(t.collection.type===t.DefaultCollectionType?"bwi-user":"bwi-collection-shared")),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(2),h.Y8G("title",h.mNQ(h.i5U(8,22,"viewCollectionWithName",t.collection.name)))("disabled",t.disabled)("routerLink",h.lJ4(25,be))("queryParams",h.eq3(26,Be,t.collection.id)),h.R7$(3),h.JRh(t.collection.name),h.R7$(),h.vxM(t.showAddAccess?11:-1),h.R7$(),h.Y8G("ngIf",t.showOwner),h.R7$(),h.Y8G("ngIf",t.showCollections),h.R7$(),h.Y8G("ngIf",t.showGroups),h.R7$(),h.Y8G("ngIf",t.showPermissionsColumn),h.R7$(),h.Y8G("ngClass",t.RowHeightClass),h.R7$(),h.vxM(t.canEditCollection||t.canDeleteCollection||t.canViewCollectionInfo?17:-1),h.R7$(3),h.Y8G("ngIf",t.canEditCollection),h.R7$(),h.Y8G("ngIf",!t.canEditCollection&&t.canViewCollectionInfo),h.R7$(),h.Y8G("ngIf",t.canDeleteCollection))},dependencies:[r.YU,r.bT,s.Wk,w.x,me.n,I.P,b.s,B.g,E.Z,g.O,S.S,k.Q,T.P,Ie,D.$,M.t],encapsulation:2});var Ge=i(22466),Ue=i(32316),Ve=i(36572),je=i(69672);class Ne{}Ne.ɵfac=function(e){return new(e||Ne)},Ne.ɵmod=h.$C({type:Ne}),Ne.ɵinj=m.G2t({imports:[r.MD,s.iI,n.E9,c.G,o.b,d.t,a.K,l.B,u.Y]}),h.wjB(f.W_,[r.bT,n.yg,n.E$,n.d6,I.P,b.s,E.Z,g.O,S.S,k.Q,Ge.Y,Ue.O,Ve._,Ve.O,je.lp,ve,Oe],[r.Jj,D.$])},93824(e,t,i){"use strict";i.d(t,{x:()=>o});var n=i(20702),r=i(78781);class s extends n.r{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:r.A.fromUrlB64ToArray(e.id).buffer})),this.challenge=r.A.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 o extends n.r{constructor(e){super(e),this.options=new s(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}},94438(e,t,i){"use strict";i.d(t,{p:()=>A});var n=i(94573),r=i(33277),s=i(36801),o=i(639),a=i(33812),l=i(47696);function c(e,t){1&e&&(a.j41(0,"span",3),a.EFF(1,", "),a.k0s())}function d(e,t){if(1&e&&(a.j41(0,"span",2),a.EFF(1),a.k0s(),a.nVh(2,c,2,0,"span",3)),2&e){const e=t.$implicit,i=t.$index,n=t.$count,r=a.XpG();a.Y8G("variant",r.variant())("truncate",r.truncate()),a.R7$(),a.SpI(" ",e," "),a.R7$(),a.vxM(i!==n-1||r.isFiltered()?2:-1)}}function u(e,t){if(1&e&&(a.j41(0,"span",1),a.EFF(1),a.nI1(2,"i18n"),a.k0s()),2&e){const e=a.XpG();a.Y8G("variant",e.variant()),a.R7$(),a.SpI(" ",a.i5U(2,2,"plusNMore",(e.items().length-e.filteredItems().length).toString())," ")}}function h(e){return null==e?void 0:Math.max(1,e)}class A{constructor(){this.variant=(0,n.hFB)("primary"),this.items=(0,n.hFB)([]),this.truncate=(0,n.hFB)(!0),this.maxItems=(0,n.hFB)(void 0,{transform:h}),this.filteredItems=(0,r.EW)(()=>{const e=this.maxItems(),t=this.items();return null==e||t.length<=e?t:t.slice(0,e-1)}),this.isFiltered=(0,r.EW)(()=>this.items().length>this.filteredItems().length)}}A.ɵfac=function(e){return new(e||A)},A.ɵcmp=a.VBU({type:A,selectors:[["bit-badge-list"]],inputs:{variant:[1,"variant"],items:[1,"items"],truncate:[1,"truncate"],maxItems:[1,"maxItems"]},decls:4,vars:1,consts:[[1,"tw-inline-flex","tw-flex-wrap","tw-gap-2"],["bitBadge","",3,"variant"],["bitBadge","",3,"variant","truncate"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(a.j41(0,"div",0),a.Z7z(1,d,3,4,null,null,a.fX1),a.nVh(3,u,3,5,"span",1),a.k0s()),2&e&&(a.R7$(),a.Dyx(t.filteredItems()),a.R7$(2),a.vxM(t.isFiltered()?3:-1))},dependencies:[o.E,l.n,s.$Z],encapsulation:2,changeDetection:0})},94615(e,t,i){"use strict";i.d(t,{H:()=>G});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(72737),c=i(3204),d=i(62179),u=i(14803),h=i(36359),A=i(8131),p=i(94735),g=i(56962),v=i(20136),f=i(88832),m=i(75583),y=i(26411),C=i(47135),w=i(58950),I=i(14318),b=i(73638),B=i(50700),E=i(58806),S=i(90246),Q=i(86226),k=i(93199),T=i(97553),F=i(43759),P=i(50352),R=i(25740),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function M(e,t){1&e&&(s.j41(0,"bit-section-header")(1,"h6",9),s.EFF(2),s.nI1(3,"i18n"),s.k0s()()),2&e&&(s.R7$(2),s.JRh(s.bMT(3,1,"options")))}function x(e,t){1&e&&(s.j41(0,"p",8),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.JRh(s.bMT(2,1,"generatorPolicyInEffect")))}const O=Object.freeze({numWords:"numWords",includeNumber:"includeNumber",capitalize:"capitalize",wordSeparator:"wordSeparator"});class G{constructor(e,t,i,n){this.formBuilder=e,this.generatorService=t,this.i18nService=i,this.logService=n,this.debug=!1,this.log=(0,v.S2)({}),this.account=null,this.account$=new l.m(1),this.showHeader=!0,this.disableMargin=!1,this.onUpdated=new s.bkB,this.settings=this.formBuilder.group({[O.numWords]:[0],[O.wordSeparator]:[""],[O.capitalize]:[!1],[O.includeNumber]:[!1]}),this.wordSeparatorMaxLength=0,this.saveSettings=new a.B,this.policyInEffect=!1,this.numWordsBoundariesHint=new l.m(1),this.numWordsBoundariesHint$=this.numWordsBoundariesHint.asObservable(),this.destroyed$=new a.B}ngOnChanges(e){return D(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return D(this,void 0,void 0,function*(){this.log=(0,v.mJ)(this.debug,this.logService,{type:"PassphraseSettingsComponent"});const e=yield this.generatorService.settings(b.qG.passphrase,{account$:this.account$});e.withConstraints$.pipe((0,h.M)(e=>this.log.debug(e,"passphrase settings loaded with constraints")),(0,u.Q)(this.destroyed$)).subscribe(({state:e,constraints:t})=>{var i,n,r,s,o,a,l,c,d;this.settings.patchValue(e,{emitEvent:!1});let u=this.i18nService.t("spinboxBoundariesHint",null===(n=null===(i=t.numWords)||void 0===i?void 0:i.min)||void 0===n?void 0:n.toString(),null===(s=null===(r=t.numWords)||void 0===r?void 0:r.max)||void 0===s?void 0:s.toString());(null!==(o=e.numWords)&&void 0!==o?o:0)<=(null!==(l=null===(a=t.numWords)||void 0===a?void 0:a.recommendation)&&void 0!==l?l:0)&&(u+=this.i18nService.t("passphraseNumWordsRecommendationHint",null===(d=null===(c=t.numWords)||void 0===c?void 0:c.recommendation)||void 0===d?void 0:d.toString())),this.numWordsBoundariesHint.next(u)}),e.pipe((0,d.i)(1),(0,h.M)(e=>this.log.debug(e,"passphrase settings onUpdate event")),(0,u.Q)(this.destroyed$)).subscribe(this.onUpdated),this.generatorService.policy$(b.qG.passphrase,{account$:this.account$}).pipe((0,u.Q)(this.destroyed$)).subscribe(({constraints:e})=>{var t,i,n,r,s;this.wordSeparatorMaxLength=null!==(i=null===(t=e.wordSeparator)||void 0===t?void 0:t.maxLength)&&void 0!==i?i:0,this.policyInEffect=null!==(n=e.policyInEffect)&&void 0!==n&&n,this.toggleEnabled(O.capitalize,!(null===(r=e.capitalize)||void 0===r?void 0:r.readonly)),this.toggleEnabled(O.includeNumber,!(null===(s=e.includeNumber)||void 0===s?void 0:s.readonly))}),this.saveSettings.pipe((0,A.E)(this.settings.valueChanges),(0,h.M)(([e,t])=>this.log.debug({source:e,form:t},"save passphrase settings request")),(0,c.T)(([,e])=>e),(0,u.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}toggleEnabled(e,t){var i,n;t?null===(i=this.settings.get(e))||void 0===i||i.enable({emitEvent:!1}):null===(n=this.settings.get(e))||void 0===n||n.disable({emitEvent:!1})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}G.ɵfac=function(e){return new(e||G)(s.rXU(o.ok),s.rXU(b.iE),s.rXU(B.W),s.rXU(g.K))},G.ɵcmp=s.VBU({type:G,selectors:[["tools-passphrase-settings"]],inputs:{debug:"debug",account:"account",showHeader:"showHeader",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onUpdated:"onUpdated"},features:[s.OA$],decls:31,vars:21,consts:[[3,"disableMargin"],[1,"tw-container",3,"formGroup"],[1,"tw-mb-4"],["disableMargin",""],["bitInput","","formControlName","numWords","id","num-words","type","number",3,"change"],["bitInput","","formControlName","wordSeparator","id","word-separator","type","text",3,"change","maxlength"],["bitCheckbox","","formControlName","capitalize","id","capitalize","type","checkbox",3,"change"],["bitCheckbox","","formControlName","includeNumber","id","include-number","type","checkbox",3,"change"],["bitTypography","helper"],["bitTypography","h6"]],template:function(e,t){1&e&&(s.j41(0,"bit-section",0),s.nVh(1,M,4,3,"bit-section-header"),s.j41(2,"form",1)(3,"div",2)(4,"bit-card")(5,"bit-form-field",3)(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"input",4),s.bIt("change",function(){return t.save("numWords")}),s.k0s(),s.j41(10,"bit-hint"),s.EFF(11),s.nI1(12,"async"),s.k0s()()()(),s.j41(13,"div")(14,"bit-card")(15,"bit-form-field")(16,"bit-label"),s.EFF(17),s.nI1(18,"i18n"),s.k0s(),s.j41(19,"input",5),s.bIt("change",function(){return t.save("wordSeparator")}),s.k0s()(),s.j41(20,"bit-form-control")(21,"input",6),s.bIt("change",function(){return t.save("capitalize")}),s.k0s(),s.j41(22,"bit-label"),s.EFF(23),s.nI1(24,"i18n"),s.k0s()(),s.j41(25,"bit-form-control",0)(26,"input",7),s.bIt("change",function(){return t.save("includeNumber")}),s.k0s(),s.j41(27,"bit-label"),s.EFF(28),s.nI1(29,"i18n"),s.k0s()(),s.nVh(30,x,3,3,"p",8),s.k0s()()()()),2&e&&(s.Y8G("disableMargin",t.disableMargin),s.R7$(),s.vxM(t.showHeader?1:-1),s.R7$(),s.Y8G("formGroup",t.settings),s.R7$(5),s.JRh(s.bMT(8,11,"numWords")),s.R7$(4),s.JRh(s.bMT(12,13,t.numWordsBoundariesHint$)),s.R7$(6),s.JRh(s.bMT(18,15,"wordSeparator")),s.R7$(2),s.Y8G("maxlength",t.wordSeparatorMaxLength),s.R7$(4),s.JRh(s.bMT(24,17,"capitalize")),s.R7$(2),s.Y8G("disableMargin",!t.policyInEffect),s.R7$(3),s.JRh(s.bMT(29,19,"includeNumber")),s.R7$(2),s.vxM(t.policyInEffect?30:-1))},dependencies:[f.n,w.U,m.E,E.r,o.X1,o.qT,o.me,o.Q0,o.Zm,o.BC,o.cb,o.tU,o.j4,o.JD,I.i,y.L,S.f,Q.j,k.I,T.J,F.h,C.q,P.P,p.p,r.Jj,R.$],encapsulation:2})},94735(e,t,i){"use strict";i.d(t,{p:()=>j});var n=i(77468),r=i(51757),s=i(82630),o=i(28846),a=i(94573),l=i(33812),c=i(36801),d=i(22191),u=i(75583),h=i(36288),A=i(58806);function p(e,t){1&e&&(l.j41(0,"p",3),l.EFF(1),l.k0s()),2&e&&(l.R7$(),l.JRh(t))}function g(e,t){if(1&e&&(l.j41(0,"p",4),l.EFF(1),l.k0s()),2&e){const e=t.$implicit;l.R7$(),l.SpI(" ",e," ")}}const v={success:{icon:"bwi-check-circle",bgColor:"tw-bg-success-100"},error:{icon:"bwi-error",bgColor:"tw-bg-danger-100"},info:{icon:"bwi-info-circle",bgColor:"tw-bg-info-100"},warning:{icon:"bwi-exclamation-triangle",bgColor:"tw-bg-warning-100"}};class f{constructor(){this.variant=(0,a.hFB)("info"),this.message=a.hFB.required(),this.title=(0,a.hFB)(),this.progressWidth=(0,a.hFB)(0),this.onClose=new l.bkB}get iconClass(){return v[this.variant()].icon}get bgColor(){return v[this.variant()].bgColor}get messageArray(){const e=this.message();return Array.isArray(e)?e:[e]}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=l.VBU({type:f,selectors:[["bit-toast"]],inputs:{variant:[1,"variant"],message:[1,"message"],title:[1,"title"],progressWidth:[1,"progressWidth"]},outputs:{onClose:"onClose"},decls:13,vars:16,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",1,"tw-font-medium","tw-mb-0"],["bitTypography","body2","data-testid","toast-message",1,"tw-mb-2","last:tw-mb-0"],["bitIconButton","bwi-close","buttonType","primaryGhost","type","button","size","small",1,"tw-ms-auto","hover:tw-border-text-main","focus-visible:before:tw-ring-text-main",3,"click","label"],[1,"tw-h-1","tw-w-full","tw-bg-text-main/30"]],template:function(e,t){if(1&e&&(l.j41(0,"div")(1,"div",0),l.nrm(2,"i",1),l.j41(3,"div")(4,"span",2),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.nVh(7,p,2,1,"p",3),l.Z7z(8,g,2,1,"p",4,l.fX1),l.k0s(),l.j41(10,"button",5),l.nI1(11,"i18n"),l.bIt("click",function(){return t.onClose.emit()}),l.k0s()(),l.nrm(12,"div",6),l.k0s()),2&e){let e;l.HbH(l.VkB("tw-mb-1 tw-min-w-[--bit-toast-width] tw-text-main tw-flex tw-flex-col tw-justify-between tw-rounded-md tw-pointer-events-auto tw-cursor-default tw-overflow-hidden tw-shadow-lg ",t.bgColor)),l.BMQ("role","error"===t.variant()?"alert":null),l.R7$(2),l.HbH(l.VkB("bwi tw-text-xl tw-py-1.5 tw-px-2.5 ",t.iconClass)),l.R7$(3),l.JRh(l.bMT(6,12,t.variant())),l.R7$(2),l.vxM((e=t.title())?7:-1,e),l.R7$(),l.Dyx(t.messageArray),l.R7$(2),l.Y8G("label",l.bMT(11,14,"close")),l.R7$(2),l.xc7("width",t.progressWidth()+"%")}},dependencies:[d.Q,h.s,u.E,A.r,c.$Z],encapsulation:2});class m extends s.y8{constructor(e,t){super(e,t)}}m.ɵfac=function(e){return new(e||m)(l.rXU(s.tw),l.rXU(s.sn))},m.ɵcmp=l.VBU({type:m,selectors:[["ng-component"]],features:[l.Vt3],decls:1,vars:4,consts:[[3,"onClose","title","variant","message","progressWidth"]],template:function(e,t){1&e&&(l.j41(0,"bit-toast",0),l.bIt("onClose",function(){return t.remove()}),l.k0s()),2&e&&l.Y8G("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:[f],encapsulation:2,data:{animation:[(0,o.hZ)("flyInOut",[(0,o.wk)("inactive",(0,o.iF)({opacity:0})),(0,o.wk)("active",(0,o.iF)({opacity:1})),(0,o.wk)("removed",(0,o.iF)({opacity:0})),(0,o.kY)("inactive => active",(0,o.i0)("{{ easeTime }}ms {{ easing }}")),(0,o.kY)("active => removed",(0,o.i0)("{{ easeTime }}ms {{ easing }}"))])]}});var y=i(74208);class C{static forRoot(e={}){return{ngModule:C,providers:[{provide:s.lt,useValue:{default:w,config:e}}]}}}C.ɵfac=function(e){return new(e||C)},C.ɵmod=l.$C({type:C}),C.ɵinj=y.G2t({imports:[m]});const w=Object.assign(Object.assign({},s.H5),{toastComponent:m,tapToDismiss:!1,timeOut:5e3,extendedTimeOut:2e3,maxOpened:5,autoDismiss:!0,progressBar:!0});var I=i(37579),b=i(8297),B=i(26411),E=i(8433),S=i(29029),Q=i(80351),k=i(47135),T=i(81573),F=i(47659),P=i(90647),R=i(59525),D=i(45383),M=i(26477),x=i(2096),O=i(34530),G=i(90171),U=i(58270),V=i(26333);class j{}j.ɵfac=function(e){return new(e||j)},j.ɵmod=l.$C({type:j}),j.ɵinj=y.G2t({providers:[n.vh,c.$Z,O.R,G.b,U.c,x.n],imports:[C.forRoot({maxOpened:5,autoDismiss:!0,closeButton:!0}),n.MD,r.YN,r.X1,I.C,b.K,B.L,E.p,S.t,Q.j,k.q,T.P,u.E,F.b,P.M,R.s,d.Q,D.Z,M.V,V.R,C]})},95919(e,t,i){"use strict";i.d(t,{n:()=>r});var n=i(20702);class r extends n.r{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.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")}}},96540(e,t,i){"use strict";i.d(t,{E:()=>n});class n{constructor(e){null!=e&&(this.privateKey=e.privateKey,this.publicKey=e.publicKey,this.keyFingerprint=e.keyFingerprint)}}},97212(e,t,i){"use strict";i.d(t,{A:()=>n,i:()=>r});class n{}function r(e){var t;return"Found"===e.exposed_result.type&&e.exposed_result.value>0||(null!==(t=e.reuse_count)&&void 0!==t?t:1)>1||e.password_strength<3}},97432(e,t,i){"use strict";i.d(t,{j:()=>l,w:()=>c});var n=i(83892),r=i(99969),s=i(69194),o=i(3204),a=i(27442);function l(e,t=void 0){const i=new Map;return l=>{let c=i.get(l);return c||(null!=t||(t=r.w),c=(0,n.h)(e(l),t.pipe((0,s.p)(e=>e===l||null===e),(0,o.T)(()=>null))).pipe((0,a.t)({bufferSize:1,refCount:!1})),i.set(l,c)),c}}function c(){return(0,s.p)(e=>null!=e)}},97434(e,t,i){"use strict";i.d(t,{m:()=>o});var n=i(25065),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},97440(e,t,i){"use strict";i.d(t,{bZ:()=>s,j8:()=>r});const n="\\"+["/","-","."," "].join("\\").replace(" ","s"),r=(new RegExp(`[${n}]`,"g"),new RegExp(`[^\\d${n}]`,"g"),new RegExp("^(([1]{1}[0-2]{1})|(0?[1-9]{1}))$"),new RegExp("^2[0-1]{1}\\d{2}$"),{Never:null,TenSeconds:10,TwentySeconds:20,ThirtySeconds:30,OneMinute:60,TwoMinutes:120,FiveMinutes:300}),s={Off:0,OnButtonClick:1,OnFieldFocus:2}},97445(e,t,i){"use strict";i.d(t,{p:()=>m});var n=i(21991),r=i(72737),s=i(44500),o=i(69514),a=i(30082),l=i(3204),c=i(24999),d=i(7222),u=i(14803),h=i(20377),A=i(9764);class p{}var g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v extends p{constructor(e,t,i,n){super(),this.organizationId=e,this.encryptService=t,this.key=i,this.dataPacker=n,this.assertHasValue("organizationId",e),this.assertHasValue("key",i),this.assertHasValue("dataPacker",n),this.assertHasValue("encryptService",t)}encrypt(e){return g(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=this.dataPacker.pack(e);const i=yield this.encryptService.encryptString(t,this.key);return t=null,i})}decrypt(e){return g(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=yield this.encryptService.decryptString(e,this.key);const i=this.dataPacker.unpack(t);return t=null,i})}assertHasValue(e,t){if(null==t)throw new Error(`${e} cannot be null or undefined`)}}var f=i(22327);class m{constructor(e,t){this.encryptService=e,this.keyService=t}userEncryptor$(e,t){const i=new A.n(e);return t.singleUserId$.pipe((0,h.eO)(e=>e,(e,t)=>({expectedUserId:e,actualUserId:t})),(0,n.N)(e=>{const t=new r.m(1);return e.subscribe(t),t.pipe((0,s.n)(e=>this.keyService.userKey$(e).pipe((0,o.j)(e=>!e),(0,a.v)(e=>!!e),(0,l.T)(t=>{const n=new f.f(e,this.encryptService,t,i);return{userId:e,encryptor:n}}),(0,c.O)())),(0,d.Z)(),(0,u.Q)((0,h.E)(t)))}))}organizationEncryptor$(e,t){const i=new A.n(e);return t.singleOrganizationId$.pipe((0,h.eO)(e=>e.userId,(e,t)=>({expectedUserId:e,actualUserId:t})),(0,h.eO)(e=>e.organizationId,(e,t)=>({expectedOrganizationId:e,actualOrganizationId:t})),(0,n.N)(e=>{const t=new r.m(1);return e.subscribe(t),t.pipe((0,s.n)(e=>this.keyService.orgKeys$(e.userId).pipe((0,o.j)(e=>!e),(0,a.v)(e=>!!e),(0,l.T)(t=>{const n=e.organizationId,r=t[n];return{organizationId:n,encryptor:new v(n,this.encryptService,r,i)}}),(0,c.O)())),(0,d.Z)(),(0,u.Q)((0,h.E)(t)))}))}}},97553(e,t,i){"use strict";i.d(t,{J:()=>d,V:()=>c});var n=i(94573),r=i(51757),s=i(22949),o=i(33812),a=i(43759);let l=0;function c(e){return["tw-border","!tw-border-solid",e?"tw-border-danger-600":"tw-border-secondary-500","focus:tw-outline-none"]}class d{classList(){const e=["tw-block","tw-w-full","tw-h-full","tw-px-1","tw-text-main","tw-placeholder-text-muted","tw-bg-background","tw-border-none","focus:tw-outline-none","[&:is(input,textarea):disabled]:tw-bg-secondary-100"];return null===this.parentFormField&&e.push(...c(this.hasError),...this.standaloneInputClasses),e.filter(e=>""!=e)}get ariaInvalid(){return!!this.hasError||void 0}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.k0.required))&&void 0!==n&&n}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,r,s;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===(r=this.ngControl)||void 0===r?void 0:r.status)||!(null===(s=this.ngControl)||void 0===s?void 0:s.touched))}get error(){var e;const t=null!==(e=this.ngControl.errors)&&void 0!==e?e:{},i=Object.keys(t)[0];return[i,t[i]]}constructor(e,t,i,r){this.ngControl=e,this.ngZone=t,this.elementRef=i,this.parentFormField=r,this.id=(0,n.hFB)("bit-input-"+l++),this.type=(0,n.geq)(),this.spellcheck=(0,n.geq)(),this.hasPrefix=(0,n.hFB)(!1),this.hasSuffix=(0,n.hFB)(!1),this.showErrorsWhenDisabled=(0,n.hFB)(!1)}focus(){this.ngZone.runOutsideAngular(()=>{const e=this.elementRef.nativeElement.value.length;this.elementRef.nativeElement.setSelectionRange(e,e),this.elementRef.nativeElement.focus()})}get readOnly(){return this.elementRef.nativeElement.readOnly}get standaloneInputClasses(){return["tw-px-3","tw-py-2","tw-rounded-lg",this.hasError?"hover:tw-border-danger-700":"hover:tw-border-primary-600","focus:hover:tw-border-primary-600","disabled:tw-bg-secondary-100","disabled:hover:tw-border-secondary-500","focus:tw-border-primary-600","focus:tw-ring-1","focus:tw-ring-inset","focus:tw-ring-primary-600","focus:tw-z-10"]}}d.ɵfac=function(e){return new(e||d)(o.rXU(r.vO,10),o.rXU(o.SKi),o.rXU(o.aKT),o.rXU(a.h,8))},d.ɵdir=o.FsC({type:d,selectors:[["input","bitInput",""],["select","bitInput",""],["textarea","bitInput",""]],hostVars:8,hostBindings:function(e,t){1&e&&o.bIt("input",function(){return t.onInput()}),2&e&&(o.Avn("id",t.id())("required",t.required),o.BMQ("type",t.type())("spellcheck",t.spellcheck())("aria-describedby",t.ariaDescribedBy)("aria-invalid",t.ariaInvalid),o.HbH(t.classList()))},inputs:{id:[1,"id"],type:[1,"type"],spellcheck:[1,"spellcheck"],required:"required",hasPrefix:[1,"hasPrefix"],hasSuffix:[1,"hasSuffix"],showErrorsWhenDisabled:[1,"showErrorsWhenDisabled"]},outputs:{type:"typeChange",spellcheck:"spellcheckChange"},features:[o.Jv_([{provide:s.p,useExisting:d}])]})},97560(e,t,i){"use strict";i.d(t,{T:()=>A});var n=i(94573),r=i(74208),s=i(83731),o=i(6056),a=i(39200),l=i(33812),c=i(39805);const d=["rla"],u=["*",[["","slot","end"]]],h=()=>({focusAfterNav:!1});class A{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.destroyRef=(0,r.WQX)(r.abz),this.tabItem=n.ebz.required(a.y),this.routerLinkActive=n.ebz.required("rla"),this.routerLinkMatchOptions={queryParams:"ignored",matrixParams:"ignored",paths:"subset",fragment:"ignored"},this.route=(0,n.hFB)(),this.disabled=!1}focus(){this.tabItem().focus()}ngAfterViewInit(){this.routerLinkActive().isActiveChange.pipe((0,s.pQ)(this.destroyRef)).subscribe(e=>this._tabNavBar.updateActiveLink())}}A.ɵfac=function(e){return new(e||A)(l.rXU(c.J))},A.ɵcmp=l.VBU({type:A,selectors:[["bit-tab-link"]],viewQuery:function(e,t){1&e&&(l.wEZ(t.tabItem,a.y,5),l.wEZ(t.routerLinkActive,d,5)),2&e&&l.NyB(2)},hostBindings:function(e,t){1&e&&l.bIt("keydown",function(e){return t.onKeyDown(e)})},inputs:{route:[1,"route"],disabled:"disabled"},ngContentSelectors:["*","[slot=end]"],decls:6,vars:7,consts:[["rla","routerLinkActive"],["bitTabListItem","","routerLinkActive","","ariaCurrentWhenActive","page","role","link",1,"tw-flex","tw-group/tab","hover:tw-no-underline",3,"routerLink","routerLinkActiveOptions","active","state","disabled"],[1,"group-hover/tab:tw-underline"],[1,"tw-font-normal","tw-ms-2","empty:tw-ms-0"]],template:function(e,t){if(1&e&&(l.NAR(u),l.j41(0,"a",1,0)(2,"div",2),l.SdG(3),l.k0s(),l.j41(4,"div",3),l.SdG(5,1),l.k0s()()),2&e){const e=l.sdS(1);l.Y8G("routerLink",t.disabled?null:t.route())("routerLinkActiveOptions",t.routerLinkMatchOptions)("active",e.isActive)("state",l.lJ4(6,h))("disabled",t.disabled),l.BMQ("aria-disabled",t.disabled)}},dependencies:[a.y,o.iI,o.Wk,o.wQ],encapsulation:2})},97883(e,t,i){"use strict";i.d(t,{c:()=>s});var n=i(78781);class r{constructor(e){this.id=e.id,this.rawId=n.A.fromBufferToUrlB64(e.rawId),this.type=e.type,this.extensions={}}}class s extends r{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAssertionResponse))throw new Error("Invalid authenticator response");this.response={authenticatorData:n.A.fromBufferToUrlB64(e.response.authenticatorData),signature:n.A.fromBufferToUrlB64(e.response.signature),clientDataJSON:n.A.fromBufferToUrlB64(e.response.clientDataJSON),userHandle:n.A.fromBufferToUrlB64(e.response.userHandle)}}static fromJSON(e){return Object.assign(Object.create(s.prototype),e)}}},97948(e,t,i){"use strict";var n;i.d(t,{v:()=>n}),function(e){e[e.SignalR=0]="SignalR",e[e.WebPush=1]="WebPush"}(n||(n={}))},98267(e,t,i){"use strict";i.d(t,{s:()=>a});class n{constructor(e){if(this.securityState=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("securityState"in e)||"string"!=typeof e.securityState)throw new TypeError("Response must contain a valid securityState");this.securityState=e.securityState}}var r=i(78781);class s{constructor(e){if(this.signedPublicKey=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKey"in e)||"string"!=typeof e.publicKey)throw new TypeError("Response must contain a valid publicKey");if(this.publicKey=r.A.fromB64ToArray(e.publicKey),!("wrappedPrivateKey"in e)||"string"!=typeof e.wrappedPrivateKey)throw new TypeError("Response must contain a valid wrappedPrivateKey");this.wrappedPrivateKey=e.wrappedPrivateKey,"signedPublicKey"in e&&"string"==typeof e.signedPublicKey?this.signedPublicKey=e.signedPublicKey:this.signedPublicKey=null}}class o{constructor(e){if("object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("wrappedSigningKey"in e)||"string"!=typeof e.wrappedSigningKey)throw new TypeError("Response must contain a valid wrappedSigningKey");if(this.wrappedSigningKey=e.wrappedSigningKey,!("verifyingKey"in e)||"string"!=typeof e.verifyingKey)throw new TypeError("Response must contain a valid verifyingKey");this.verifyingKey=e.verifyingKey}}class a{constructor(e){if(this.signatureKeyPair=null,this.securityState=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKeyEncryptionKeyPair"in e)||"object"!=typeof e.publicKeyEncryptionKeyPair)throw new TypeError("Response must contain a valid publicKeyEncryptionKeyPair");if(this.publicKeyEncryptionKeyPair=new s(e.publicKeyEncryptionKeyPair),"signatureKeyPair"in e&&"object"==typeof e.signatureKeyPair&&null!=e.signatureKeyPair&&(this.signatureKeyPair=new o(e.signatureKeyPair)),"securityState"in e&&"object"==typeof e.securityState&&null!=e.securityState&&(this.securityState=new n(e.securityState)),null!==this.signatureKeyPair&&null===this.securityState||null===this.signatureKeyPair&&null!==this.securityState)throw new TypeError("Both signatureKeyPair and securityState must be present or absent together")}toWrappedAccountCryptographicState(){if(null===this.signatureKeyPair&&null===this.securityState)return{V1:{private_key:this.publicKeyEncryptionKeyPair.wrappedPrivateKey}};if(null!==this.signatureKeyPair&&null!==this.securityState)return{V2:{private_key:this.publicKeyEncryptionKeyPair.wrappedPrivateKey,signing_key:this.signatureKeyPair.wrappedSigningKey,signed_public_key:this.publicKeyEncryptionKeyPair.signedPublicKey,security_state:this.securityState.securityState}};throw new Error("Both signatureKeyPair and securityState must be present or absent together")}isV2Encryption(){return null!==this.signatureKeyPair&&null!==this.securityState}}},98403(e,t,i){"use strict";i.d(t,{k:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},98479(e,t,i){"use strict";i.d(t,{p:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},98850(e,t,i){"use strict";i.d(t,{s:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.revisionDate=this.getResponseProperty("RevisionDate")}}},99327(e,t,i){"use strict";i.d(t,{d:()=>se});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(16878),c=i(72737),d=i(72245),u=i(33338),h=i(75811),A=i(80909),p=i(34040),g=i(69194),v=i(3204),f=i(14803),m=i(36359),y=i(8131),C=i(94735),w=i(56962),I=i(20136),b=i(25024),B=i(88832),E=i(75583),S=i(26411),Q=i(14318),k=i(27520),T=i(36288),F=i(58950),P=i(33886),R=i(73638),D=i(192),M=i(8245),x=i(23979),O=i(91261),G=i(58503),U=i(18030),V=i(74208),j=i(69855),N=i(50700),z=i(35500),Y=i(60989),L=i(58806),K=i(86226),X=i(93199),q=i(43759),H=i(25740),W=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $=e=>({"tw-mb-4":e});function J(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"async"),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.JRh(s.bMT(2,1,e.credentialTypeHint$))}}function Z(e,t){if(1&e&&(s.j41(0,"form",9)(1,"bit-form-field")(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"bit-select",13),s.nI1(6,"async"),s.k0s()()),2&e){const e=s.XpG();s.Y8G("formGroup",e.forwarder),s.R7$(3),s.JRh(s.bMT(4,3,"service")),s.R7$(2),s.Y8G("items",s.bMT(6,5,e.forwarderOptions$))}}function _(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-catchall-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("catchall settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}function ee(e,t){if(1&e&&s.nrm(0,"tools-forwarder-settings",12),2&e){s.XpG();const e=s.r8f(37);s.Y8G("forwarder",t)("account",e)}}function te(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-subaddress-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("subaddress settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}function ie(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-username-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("username settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}const ne="forwarder",re="none";class se{constructor(e,t,i,n,r,o,d,u,h){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.logService=n,this.i18nService=r,this.accountService=o,this.zone=d,this.formBuilder=u,this.ariaLive=h,this.Algorithm=R.oG,this.account=null,this.account$=new c.m(1),this.debug=!1,this.log=(0,I.S2)({}),this.website=null,this.onGenerated=new s.bkB,this.onAlgorithm=new s.bkB,this.disableMargin=!1,this.username=this.formBuilder.group({nav:[null]}),this.forwarder=this.formBuilder.group({nav:[null]}),this.typeOptions$=new l.t([]),this.forwarderId$=new l.t(null),this.forwarderOptions$=new l.t([]),this.showForwarder$=new l.t(!1),this.maybeAlgorithm$=new c.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,g.p)(e=>!!e)),this.credentialTypeHint$=new c.m(1),this.generatedCredential$=new l.t(void 0),this.value$=this.generatedCredential$.pipe((0,v.T)(e=>{var t;return null!==(t=null==e?void 0:e.credential)&&void 0!==t?t:"-"})),this.generate$=new a.B,this.showAlgorithm$=this.maybeAlgorithm$.pipe((0,A.v)(this.showForwarder$),(0,v.T)(([e,t])=>t?null:e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,v.T)(({i18nKeys:{copyCredential:e}})=>(0,U.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,v.T)(({i18nKeys:{generateCredential:e}})=>(0,U.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,v.T)(({i18nKeys:{credentialType:e}})=>(0,U.Tl)(e,this.i18nService))),this.USER_REQUEST="user request",this.destroyed=new a.B}ngOnChanges(e){return W(this,void 0,void 0,function*(){var t,i;const n=null==e?void 0:e.account;n&&n.currentValue.id&&n.previousValue.id!==n.currentValue.id&&(this.log.debug({previousUserId:null===(t=null==n?void 0:n.previousValue)||void 0===t?void 0:t.id,currentUserId:null===(i=null==n?void 0:n.currentValue)||void 0===i?void 0:i.id},"account input change detected"),this.account$.next(n.currentValue.id))})}ngOnInit(){return W(this,void 0,void 0,function*(){if(this.log=(0,I.mJ)(this.debug,this.logService,{type:"UsernameGeneratorComponent"}),!this.account){const e=yield(0,d._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}(0,u.z)([this.generatorService.algorithms$("email",{account$:this.account$}),this.generatorService.algorithms$("username",{account$:this.account$})]).pipe((0,v.T)(e=>e.flat()),(0,v.T)(e=>{const t=e.filter(e=>!(0,R.$S)(e.id));t.sort((e,t)=>e.weight-t.weight);const i=this.toOptions(t);i.splice(-1,0,{value:ne,label:this.i18nService.t("forwardedEmail")});const n=e.filter(e=>(0,R.$S)(e.id));n.sort((e,t)=>e.weight-t.weight);const r=this.toOptions(n);return r.unshift({value:re,label:this.i18nService.t("select")}),[i,r]}),(0,m.M)(e=>this.log.debug({algorithms:e},"algorithms loaded")),(0,f.Q)(this.destroyed)).subscribe(([e,t])=>{this.zone.run(()=>{this.typeOptions$.next(e),this.forwarderOptions$.next(t)})}),this.maybeAlgorithm$.pipe((0,v.T)(e=>{var t;return(null===(t=null==e?void 0:e.i18nKeys)||void 0===t?void 0:t.description)?(0,U.Tl)(e.i18nKeys.description,this.i18nService):""}),(0,f.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.credentialTypeHint$.next(e)})}),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,h.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,y.E)(this.account$,this.maybeAlgorithm$),(0,f.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n,r;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null,algorithm:null!==(r=null==i?void 0:i.id)&&void 0!==r?r:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{i&&e.source===this.USER_REQUEST&&this.announce((0,U.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.generatedCredential$.next(e),this.onGenerated.next(e)})});const e=new a.B,t=new a.B;this.username.valueChanges.pipe((0,v.T)(e=>{if(e.nav===ne)return{nav:e.nav};if(e.nav)return{nav:e.nav,algorithm:JSON.parse(e.nav)};{const[e]=R.I4[R.ZU.username];return{nav:JSON.stringify(e),algorithm:e}}}),(0,f.Q)(this.destroyed)).subscribe(e),this.forwarder.valueChanges.pipe((0,v.T)(e=>e.nav===re?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:re}),(0,f.Q)(this.destroyed)).subscribe(t),(0,u.z)([e,t]).pipe((0,v.T)(([e,t])=>{const i=!e.algorithm;return[i,i&&t.algorithm&&(0,R.$S)(t.algorithm)?t.algorithm.forwarder:null]}),(0,p.F)((e,t)=>e[0]===t[0]&&e[1]===t[1]),(0,f.Q)(this.destroyed)).subscribe(([e,t])=>{this.log.debug({forwarderId:t,showForwarder:e},"forwarder visibility updated"),this.zone.run(()=>{this.showForwarder$.next(e),this.forwarderId$.next(t)})}),(0,u.z)([e,t]).pipe((0,v.T)(([e,t])=>{var i;const n=null!==(i=e.algorithm)&&void 0!==i?i:t.algorithm;return n?this.generatorService.algorithm(n):null}),(0,p.F)((e,t)=>null!==e&&null!==t&&(0,R.W0)(e.id,t.id)),(0,f.Q)(this.destroyed)).subscribe(e=>{var t;this.log.debug({algorithm:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},"algorithm selected"),this.zone.run(()=>{this.maybeAlgorithm$.next(e),e?this.onAlgorithm.next((0,U.VI)(e,this.i18nService)):this.onAlgorithm.next(null)})});const i=yield this.generatorService.preferences({account$:this.account$});this.algorithm$.pipe((0,y.E)(i),(0,f.Q)(this.destroyed)).subscribe(([e,t])=>{if((0,R.MP)(e.id))t.email.algorithm=e.id,t.email.updated=new Date;else{if(!(0,R.yJ)(e.id))return;t.username.algorithm=e.id,t.username.updated=new Date}this.log.info({algorithm:e.id,type:e.type},"algorithm preferences updated"),i.next(t)}),i.pipe((0,v.T)(({email:e,username:t})=>{const i=e.updated>t.updated?e:t,n=(0,R.$S)(i.algorithm)?i:null,r=n?JSON.stringify(n.algorithm):re,s=n?ne:JSON.stringify(i.algorithm);return{username:{selection:{nav:s},active:{nav:s,algorithm:n?void 0:i.algorithm}},forwarder:{selection:{nav:r},active:{nav:r,algorithm:null==n?void 0:n.algorithm}}}}),(0,f.Q)(this.destroyed)).subscribe(({username:i,forwarder:n})=>{this.log.debug({username:i.selection,forwarder:n.selection},"navigation updated"),this.username.setValue(i.selection,{emitEvent:!1}),this.forwarder.setValue(n.selection,{emitEvent:!1}),e.next(i.active),t.next(n.active)}),this.maybeAlgorithm$.pipe((0,f.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.generatedCredential$.next(void 0))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}generate(e){return W(this,void 0,void 0,function*(){const t=yield(0,d._)(this.algorithm$),i={source:e,algorithm:t.id};this.website&&(i.website=this.website),this.log.debug(i,"generation requested"),this.generate$.next(i)})}toOptions(e){return e.map(e=>({value:JSON.stringify(e.id),label:(0,U.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.generate$.complete(),this.generatedCredential$.complete(),this.onGenerated.complete(),this.log.debug("component destroyed")}}se.ɵfac=function(e){return new(e||se)(s.rXU(R.iE),s.rXU(D.ZS),s.rXU(j.f),s.rXU(w.K),s.rXU(N.W),s.rXU(z.D),s.rXU(s.SKi),s.rXU(o.ok),s.rXU(Y.Ai))},se.ɵcmp=s.VBU({type:se,selectors:[["tools-username-generator"]],inputs:{account:"account",debug:"debug",website:"website",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onGenerated:"onGenerated",onAlgorithm:"onAlgorithm"},features:[s.OA$],decls:44,vars:58,consts:[[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","primaryGhost",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","primaryGhost","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[3,"disableMargin"],["bitTypography","h6"],[3,"ngClass"],[1,"tw-container",3,"formGroup"],["formControlName","nav","data-testid","username-type",3,"items"],[3,"account"],[3,"forwarder","account"],["formControlName","nav","data-testid","email-forwarding-service",3,"items"],[3,"onUpdated","account"]],template:function(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-card",0)(1,"div",1),s.nrm(2,"bit-color-password",2),s.nI1(3,"async"),s.k0s(),s.j41(4,"div",3)(5,"button",4),s.nI1(6,"async"),s.nI1(7,"async"),s.bIt("click",function(){return V.eBV(e),V.Njj(t.generate(t.USER_REQUEST))}),s.EFF(8),s.nI1(9,"async"),s.k0s(),s.j41(10,"button",5),s.nI1(11,"async"),s.nI1(12,"async"),s.nI1(13,"async"),s.nI1(14,"async"),s.EFF(15),s.nI1(16,"async"),s.k0s()()(),s.j41(17,"bit-section",6)(18,"bit-section-header")(19,"h2",7),s.EFF(20),s.nI1(21,"i18n"),s.k0s()(),s.j41(22,"div",8)(23,"bit-card")(24,"form",9)(25,"bit-form-field")(26,"bit-label"),s.EFF(27),s.nI1(28,"i18n"),s.k0s(),s.nrm(29,"bit-select",10),s.nI1(30,"async"),s.nVh(31,J,3,3,"bit-hint"),s.nI1(32,"async"),s.k0s()(),s.nVh(33,Z,7,7,"form",9),s.nI1(34,"async"),s.SS7(35),s.nI1(36,"async"),s.SS7(37),s.nI1(38,"async"),s.nVh(39,_,1,1,"tools-catchall-settings",11),s.nVh(40,ee,1,2,"tools-forwarder-settings",12),s.nI1(41,"async"),s.nVh(42,te,1,1,"tools-subaddress-settings",11),s.nVh(43,ie,1,1,"tools-username-settings",11),s.k0s()()()}if(2&e){let e;s.R7$(2),s.Y8G("password",s.bMT(3,21,t.value$)),s.R7$(3),s.Y8G("label",s.bMT(6,23,t.credentialTypeGenerateLabel$))("disabled",!s.bMT(7,25,t.algorithm$)),s.R7$(3),s.SpI(" ",s.bMT(9,27,t.credentialTypeGenerateLabel$)," "),s.R7$(2),s.Y8G("label",s.bMT(11,29,t.credentialTypeCopyLabel$))("appCopyClick",s.bMT(12,31,t.value$))("valueLabel",s.bMT(13,33,t.credentialTypeLabel$))("disabled",!s.bMT(14,35,t.algorithm$)),s.R7$(5),s.SpI(" ",s.bMT(16,37,t.credentialTypeCopyLabel$)," "),s.R7$(2),s.Y8G("disableMargin",t.disableMargin),s.R7$(3),s.JRh(s.bMT(21,39,"options")),s.R7$(2),s.Y8G("ngClass",s.eq3(56,$,!t.disableMargin)),s.R7$(2),s.Y8G("formGroup",t.username),s.R7$(3),s.JRh(s.bMT(28,41,"type")),s.R7$(2),s.Y8G("items",s.bMT(30,43,t.typeOptions$)),s.R7$(2),s.vxM(s.bMT(32,45,t.credentialTypeHint$)?31:-1),s.R7$(2),s.vxM(s.bMT(34,47,t.showForwarder$)?33:-1);const i=s.bMT(36,49,t.showAlgorithm$);s.R7$(4),s.bH3(s.bMT(38,51,t.account$)),s.R7$(2),s.vxM((null==i?null:i.id)===t.Algorithm.catchall?39:-1),s.R7$(),s.vxM((e=s.bMT(41,54,t.forwarderId$))?40:-1,e),s.R7$(2),s.vxM((null==i?null:i.id)===t.Algorithm.plusAddress?42:-1),s.R7$(),s.vxM((null==i?null:i.id)===t.Algorithm.username?43:-1)}},dependencies:[Q.i,k.S,T.s,b.D,B.n,F.U,E.E,L.r,r.YU,o.X1,o.qT,o.BC,o.cb,o.j4,o.JD,P.w,S.L,K.j,X.I,q.h,M.b,x.h,O.z,G.b,C.p,r.Jj,H.$],encapsulation:2})},99352(e,t,i){"use strict";i.d(t,{x:()=>r});var n=i(78781);class r{constructor(e){e&&Object.assign(this,e)}toJSON(){return{id:this.id,privateKey:n.A.fromArrayToByteString(this.privateKey)}}static fromJSON(e){if(null==e)return null;let t=null;return e.privateKey&&(t=n.A.fromByteStringToArray(e.privateKey)),new r({id:e.id,privateKey:t})}}}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,s),i.loaded=!0,i.exports}s.m=n,e=[],s.O=(t,i,n,r)=>{if(!i){var o=1/0;for(d=0;d<e.length;d++){for(var[i,n,r]=e[d],a=!0,l=0;l<i.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every(e=>s.O[e](i[l]))?i.splice(l--,1):(a=!1,r<o&&(o=r));if(a){e.splice(d--,1);var c=n();void 0!==c&&(t=c)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[i,n,r]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,i)=>(s.f[i](e,t),t),[])),s.u=e=>e+"."+{155:"4a59992bc81b07f1d664",281:"63232854adb3d881461c",438:"b101cc119b59303b9dae",449:"77b1a2989b6fc1da930a",502:"a8c0b3940c55b2774961",573:"76b04d6fd033089260be",614:"9ee7ac3bd57e172639a7",677:"f8ef5cfa5aae7e4b9baf",712:"3e04eb3c6175f87e2300",764:"368213e107870205bd2f",767:"750aae5eb5312fc8fa96",782:"98098434b07e68b3ed00",825:"14a474ff6b99440f2efa",922:"4c1fca313f1dfe75cf04",981:"77c5ea804618d88936cd"}[e]+".js",s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},i="@bitwarden/web-vault:",s.l=(e,n,r,o)=>{if(t[e])t[e].push(n);else{var a,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+r){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+r),a.src=e),t[e]=[n];var h=(i,n)=>{a.onerror=a.onload=null,clearTimeout(A);var r=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(n)),i)return i(n)},A=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.v=(e,t,i,n)=>{var r=fetch(s.p+""+i+".module.wasm"),o=()=>r.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,n)).then(t=>Object.assign(e,t.instance.exports));return r.then(t=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,n).then(t=>Object.assign(e,t.instance.exports),e=>{if("application/wasm"!==t.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e),o();throw e}):o())},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=i[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e+"../"})(),(()=>{var e={84:0};s.f.j=(t,i)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise((i,r)=>n=e[t]=[i,r]);i.push(n[2]=r);var o=s.p+s.u(t),a=new Error;s.l(o,i=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,i)=>{var n,r,[o,a,l]=i,c=0;if(o.some(t=>0!==e[t])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(l)var d=l(s)}for(t&&t(i);c<o.length;c++)r=o[c],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(d)},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 o=s.O(void 0,[245],()=>s(89491));o=s.O(o)})();
//# sourceMappingURL=main.ccecbc3360eea592b940.js.map