(()=>{var e,t={35192:(e,t,i)=>{"use strict";var n=i(67849),s=i(78470),o=i(39293),r=i(37080),a=i(29982),l=i(16001),c=i(41749),u=i(10585),d=i(83177),h=i(5957),p=i(70880),g=i(58805),v=i(25829),y=i(44525),f=i(94198),m=i(88777),w=i(14744),b=i(82739),S=i(23271),U=i(47589),x=i(35410),A=i(40736),_=i(7710),Z=i(77553),T=i(85368),C=i(43967),k=i(19621),O=i(44899),P=i(30825),I=i(73825),q=i(86512),D=i(2513),M=i(7586),F=i(72616),N=i(46329),L=i(34957),E=i(75561),R=i(23349),J=i(19330),Y=i(32729),z=i(53637),K=i(69335),B=i(26746),G=i(52725),Q=i(44683),V=i(24337),H=i(6507),j=i(95012),W=i(39255),$=i(10065),X=i(35927),ee=i(33419),te=i(24932),ie=i(25374),ne=i(69669),se=i(21785),oe=i(36230),re=i(66256),ae=i(43998),le=i(92852),ce=i(70684),ue=i(45741),de=i(73415),he=i(32125),pe=i(42391);function ge(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",6),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.remove())})),s.TgZ(1,"span",7),s._uU(2,"×"),s.qZA()()}}function ve(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij("[",e.duplicatesCount+1,"]")}}function ye(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.YNc(2,ve,2,1,"ng-container",5),s.qZA()),2&e){const e=s.oxw();s.Tol(e.options.titleClass),s.uIk("aria-label",e.title),s.xp6(1),s.hij(" ",e.title," "),s.xp6(1),s.Q6J("ngIf",e.duplicatesCount)}}function fe(e,t){if(1&e&&s._UZ(0,"div",8),2&e){const e=s.oxw();s.Tol(e.options.messageClass),s.Q6J("innerHTML",e.message,s.oJD)}}function me(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.Tol(e.options.messageClass),s.uIk("aria-label",e.message),s.xp6(1),s.hij(" ",e.message," ")}}function we(e,t){if(1&e&&(s.TgZ(0,"div"),s._UZ(1,"div",10),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Udp("width",e.width+"%")}}class be extends pe.FN{constructor(e,t){super(e,t),this.toastrService=e,this.toastPackage=t}}be.ɵfac=function(e){return new(e||be)(s.Y36(pe._W),s.Y36(pe.PR))},be.ɵcmp=s.Xpm({type:be,selectors:[["","toast-component2",""]],features:[s.qOj],attrs:["toast-component2",""],decls:8,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[1,"icon"],[3,"class",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class","innerHTML",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alertdialog","aria-live","polite",3,"innerHTML"],["role","alertdialog","aria-live","polite"],[1,"toast-progress"]],template:function(e,t){1&e&&(s.YNc(0,ge,3,0,"button",0),s.TgZ(1,"div",1),s._UZ(2,"i"),s.qZA(),s.TgZ(3,"div"),s.YNc(4,ye,3,5,"div",2),s.YNc(5,fe,1,3,"div",3),s.YNc(6,me,2,4,"div",4),s.qZA(),s.YNc(7,we,2,2,"div",5)),2&e&&(s.Q6J("ngIf",t.options.closeButton),s.xp6(4),s.Q6J("ngIf",t.title),s.xp6(1),s.Q6J("ngIf",t.message&&t.options.enableHtml),s.xp6(1),s.Q6J("ngIf",t.message&&!t.options.enableHtml),s.xp6(1),s.Q6J("ngIf",t.options.progressBar))},dependencies:[u.O5],encapsulation:2,data:{animation:[(0,he.X$)("flyInOut",[(0,he.SB)("inactive",(0,he.oB)({opacity:0})),(0,he.SB)("active",(0,he.oB)({opacity:1})),(0,he.SB)("removed",(0,he.oB)({opacity:0})),(0,he.eR)("inactive => active",(0,he.jt)("{{ easeTime }}ms {{ easing }}")),(0,he.eR)("active => removed",(0,he.jt)("{{ easeTime }}ms {{ easing }}"))])]}});const Se=Object.assign(Object.assign({},pe.mU),{toastComponent:be});class Ue{static forRoot(e={}){return{ngModule:Ue,providers:[{provide:pe.$e,useValue:{default:Se,config:e}}]}}}Ue.ɵfac=function(e){return new(e||Ue)},Ue.ɵmod=s.oAB({type:Ue}),Ue.ɵinj=s.cJS({imports:[u.ez]});const xe={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]}],Mir:[{cardLength:16,blocks:[4,4,4,4]},{cardLength:17,blocks:[5,4,4,4]},{cardLength:18,blocks:[6,4,4,4]},{cardLength:19,blocks:[7,4,4,4]}],Other:[{cardLength:16,blocks:[4,4,4,4]}]};class Ae{transform(e,t){let i=xe[t];null==i&&(i=xe.Other);const n=e.length;let s=i.find((e=>e.cardLength==n));null==s&&(s=i[0]);const o=s.blocks,r=[];let a=0;return o.forEach((t=>{r.push(e.slice(a,a+t)),a+=t})),n>a&&r.push(e.slice(a)),r.join(" ")}}Ae.ɵfac=function(e){return new(e||Ae)},Ae.ɵpipe=s.Yjl({name:"creditCardNumber",type:Ae,pure:!0});class _e{}class Ze{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}Ze.ɵfac=function(e){return new(e||Ze)(s.Y36(_e,16))},Ze.ɵpipe=s.Yjl({name:"i18n",type:Ze,pure:!0});class Te{transform(e,t,i,n,s){return null==e||0===e.length?[]:null==t||t.length<2?e:(t=t.trim().toLowerCase(),e.filter((e=>null!=i&&null!=e[i]&&e[i].toString().toLowerCase().indexOf(t)>-1||(null!=n&&null!=e[n]&&e[n].toString().toLowerCase().indexOf(t)>-1||null!=s&&null!=e[s]&&e[s].toString().toLowerCase().indexOf(t)>-1))))}}Te.ɵfac=function(e){return new(e||Te)},Te.ɵpipe=s.Yjl({name:"search",type:Te,pure:!0});class Ce{transform(e){return null==e?null:null==e.name||""===e.name.trim()?e.email:e.name}}Ce.ɵfac=function(e){return new(e||Ce)},Ce.ɵpipe=s.Yjl({name:"userName",type:Ce,pure:!0});class ke{}ke.ɵfac=function(e){return new(e||ke)},ke.ɵmod=s.oAB({type:ke}),ke.ɵinj=s.cJS({providers:[Ae,u.uU,Ze,Te,Ce],imports:[Ue.forRoot({maxOpened:5,autoDismiss:!0,closeButton:!0}),u.ez,ue.u5,ue.UX,Ue]});var Oe,Pe=i(89033);!function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(Oe||(Oe={}));class Ie{}class qe{}class De{}var Me=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Fe{constructor(e,t,i,n){this.authService=e,this.router=t,this.messagingService=i,this.keyConnectorService=n}canActivate(e,t){return Me(this,void 0,void 0,(function*(){const e=yield this.authService.getAuthStatus();return e===Oe.LoggedOut?(this.messagingService.send("authBlocked",{url:t.url}),!1):e===Oe.Locked?(null!=t&&this.messagingService.send("lockedUrl",{url:t.url}),this.router.createUrlTree(["lock"],{queryParams:{promptBiometric:!0}})):!(!t.url.includes("remove-password")&&(yield this.keyConnectorService.getConvertAccountRequired()))||this.router.createUrlTree(["/remove-password"])}))}}Fe.ɵfac=function(e){return new(e||Fe)(s.LFG(Ie),s.LFG(Pe.F0),s.LFG(qe),s.LFG(De))},Fe.ɵprov=s.Yz7({token:Fe,factory:Fe.ɵfac});var Ne=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Le{constructor(e,t){this.authService=e,this.router=t,this.homepage="vault",this.loginpage="login"}canActivate(){return Ne(this,void 0,void 0,(function*(){const e=yield this.authService.getAuthStatus();if(e===Oe.Locked)return!0;const t=e===Oe.LoggedOut?this.loginpage:this.homepage;return this.router.createUrlTree([t])}))}}Le.ɵfac=function(e){return new(e||Le)(s.LFG(Ie),s.LFG(Pe.F0))},Le.ɵprov=s.Yz7({token:Le,factory:Le.ɵfac});var Ee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Re{constructor(e,t){this.authService=e,this.router=t,this.homepage="vault"}canActivate(){return Ee(this,void 0,void 0,(function*(){const e=yield this.authService.getAuthStatus();return e===Oe.LoggedOut||(e===Oe.Locked?this.router.createUrlTree(["lock"]):this.router.createUrlTree([this.homepage]))}))}}Re.ɵfac=function(e){return new(e||Re)(s.LFG(Ie),s.LFG(Pe.F0))},Re.ɵprov=s.Yz7({token:Re,factory:Re.ɵfac});class Je{}class Ye{}var ze=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ke{constructor(e,t,i){this.platformUtilsService=e,this.environmentService=t,this.i18nService=i,this.onSaved=new s.vpe,this.showCustom=!1;const n=this.environmentService.getUrls();this.baseUrl=n.base||"",this.webVaultUrl=n.webVault||"",this.apiUrl=n.api||"",this.identityUrl=n.identity||"",this.iconsUrl=n.icons||"",this.notificationsUrl=n.notifications||""}submit(){return ze(this,void 0,void 0,(function*(){const e=yield this.environmentService.setUrls({base:this.baseUrl,api:this.apiUrl,identity:this.identityUrl,webVault:this.webVaultUrl,icons:this.iconsUrl,notifications:this.notificationsUrl});this.baseUrl=e.base,this.apiUrl=e.api,this.identityUrl=e.identity,this.webVaultUrl=e.webVault,this.iconsUrl=e.icons,this.notificationsUrl=e.notifications,this.platformUtilsService.showToast("success",null,this.i18nService.t("environmentSaved")),this.saved()}))}toggleCustom(){this.showCustom=!this.showCustom}saved(){this.onSaved.emit()}}Ke.ɵfac=function(e){return new(e||Ke)(s.Y36(Je),s.Y36(Ye),s.Y36(_e))},Ke.ɵdir=s.lG2({type:Ke,outputs:{onSaved:"onSaved"}});var Be=i(99918),Ge=i(47456);class Qe{constructor(){this.base=null,this.api=null,this.identity=null,this.icons=null,this.notifications=null,this.events=null,this.webVault=null,this.keyConnector=null}static fromJSON(e){return Object.assign(new Qe,e)}}var Ve=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class He{constructor(e){this.stateService=e,this.urlsSubject=new Be.x,this.urls=this.urlsSubject,this.scimUrl=null,this.stateService.activeAccount$.pipe((0,Ge.b)((()=>Ve(this,void 0,void 0,(function*(){yield this.setUrlsFromStorage()}))))).subscribe()}hasBaseUrl(){return null!=this.baseUrl}getNotificationsUrl(){return null!=this.notificationsUrl?this.notificationsUrl:null!=this.baseUrl?this.baseUrl+"/notifications":"https://notifications.bitwarden.com"}getWebVaultUrl(){return null!=this.webVaultUrl?this.webVaultUrl:this.baseUrl?this.baseUrl:"https://vault.bitwarden.com"}getSendUrl(){return"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://send.bitwarden.com/#":this.getWebVaultUrl()+"/#/send/"}getIconsUrl(){return null!=this.iconsUrl?this.iconsUrl:this.baseUrl?this.baseUrl+"/icons":"https://icons.bitwarden.net"}getApiUrl(){return null!=this.apiUrl?this.apiUrl:this.baseUrl?this.baseUrl+"/api":"https://api.bitwarden.com"}getIdentityUrl(){return null!=this.identityUrl?this.identityUrl:this.baseUrl?this.baseUrl+"/identity":"https://identity.bitwarden.com"}getEventsUrl(){return null!=this.eventsUrl?this.eventsUrl:this.baseUrl?this.baseUrl+"/events":"https://events.bitwarden.com"}getKeyConnectorUrl(){return this.keyConnectorUrl}getScimUrl(){return null!=this.scimUrl?this.scimUrl+"/v2":"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://scim.bitwarden.com/v2":this.getWebVaultUrl()+"/scim/v2"}setUrlsFromStorage(){return Ve(this,void 0,void 0,(function*(){const e=yield this.stateService.getEnvironmentUrls(),t=new Qe;this.baseUrl=t.base=e.base,this.webVaultUrl=e.webVault,this.apiUrl=t.api=e.api,this.identityUrl=t.identity=e.identity,this.iconsUrl=e.icons,this.notificationsUrl=e.notifications,this.eventsUrl=t.events=e.events,this.keyConnectorUrl=e.keyConnector}))}setUrls(e){var t;return Ve(this,void 0,void 0,(function*(){return e.base=this.formatUrl(e.base),e.webVault=this.formatUrl(e.webVault),e.api=this.formatUrl(e.api),e.identity=this.formatUrl(e.identity),e.icons=this.formatUrl(e.icons),e.notifications=this.formatUrl(e.notifications),e.events=this.formatUrl(e.events),e.keyConnector=this.formatUrl(e.keyConnector),e.scim=null!==(t=this.formatUrl(e.scim))&&void 0!==t?t:this.scimUrl,yield this.stateService.setEnvironmentUrls({base:e.base,api:e.api,identity:e.identity,webVault:e.webVault,icons:e.icons,notifications:e.notifications,events:e.events,keyConnector:e.keyConnector}),this.baseUrl=e.base,this.webVaultUrl=e.webVault,this.apiUrl=e.api,this.identityUrl=e.identity,this.iconsUrl=e.icons,this.notificationsUrl=e.notifications,this.eventsUrl=e.events,this.keyConnectorUrl=e.keyConnector,this.scimUrl=e.scim,this.urlsSubject.next(e),e}))}getUrls(){return{base:this.baseUrl,webVault:this.webVaultUrl,api:this.apiUrl,identity:this.identityUrl,icons:this.iconsUrl,notifications:this.notificationsUrl,events:this.eventsUrl,keyConnector:this.keyConnectorUrl,scim:this.scimUrl}}formatUrl(e){return null==e||""===e?null:((e=e.replace(/\/+$/g,"")).startsWith("http://")||e.startsWith("https://")||(e="https://"+e),e.trim())}isCloud(){return["https://api.bitwarden.com","https://vault.bitwarden.com/api"].includes(this.getApiUrl())}}var je,We=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $e extends He{constructor(e,t){super(e),this.logService=t}hasManagedEnvironment(){return We(this,void 0,void 0,(function*(){try{return null!=(yield this.getManagedEnvironment())}catch(e){return this.logService.error(e),!1}}))}settingsHaveChanged(){return We(this,void 0,void 0,(function*(){const e=yield this.getManagedEnvironment();return e.base!=this.baseUrl||e.webVault!=this.webVaultUrl||e.api!=this.webVaultUrl||e.identity!=this.identityUrl||e.icons!=this.iconsUrl||e.notifications!=this.notificationsUrl||e.events!=this.eventsUrl}))}getManagedEnvironment(){return new Promise(((e,t)=>{chrome.storage.managed.get("environment",(i=>{if(chrome.runtime.lastError)return t(chrome.runtime.lastError);e(i.environment)}))}))}setUrlsToManagedEnvironment(){return We(this,void 0,void 0,(function*(){const e=yield this.getManagedEnvironment();yield this.setUrls({base:e.base,webVault:e.webVault,api:e.api,identity:e.identity,icons:e.icons,notifications:e.notifications,events:e.events})}))}}class Xe{constructor(e){this.el=null,this.el=e.nativeElement}ngOnInit(){this.formEls=Array.from(this.el.querySelectorAll('input:not([type="hidden"]), select, textarea')),this.formEls.forEach((e=>{e.addEventListener("focus",(()=>{this.el.classList.add("active")}),!1),e.addEventListener("blur",(()=>{this.el.classList.remove("active")}),!1)}))}onClick(e){const t=e.target;if((t===this.el||t.classList.contains("progress")||t.classList.contains("progress-bar"))&&this.formEls.length>0){const e=this.formEls[0];if("input"===e.tagName.toLowerCase()){const t=e;if(null!=t.type&&"checkbox"===t.type.toLowerCase())return void t.click()}e.focus()}}}Xe.ɵfac=function(e){return new(e||Xe)(s.Y36(s.SBq))},Xe.ɵdir=s.lG2({type:Xe,selectors:[["","appBoxRow",""]],hostBindings:function(e,t){1&e&&s.NdJ("click",(function(e){return t.onClick(e)}))}}),function(e){e[e.AesCbc256_B64=0]="AesCbc256_B64",e[e.AesCbc128_HmacSha256_B64=1]="AesCbc128_HmacSha256_B64",e[e.AesCbc256_HmacSha256_B64=2]="AesCbc256_HmacSha256_B64",e[e.Rsa2048_OaepSha256_B64=3]="Rsa2048_OaepSha256_B64",e[e.Rsa2048_OaepSha1_B64=4]="Rsa2048_OaepSha1_B64",e[e.Rsa2048_OaepSha256_HmacSha256_B64=5]="Rsa2048_OaepSha256_HmacSha256_B64",e[e.Rsa2048_OaepSha1_HmacSha256_B64=6]="Rsa2048_OaepSha1_HmacSha256_B64"}(je||(je={}));var et=i(96905),tt=i(71469);const it="undefined"==typeof window?i(50209):null;class nt{static init(){nt.inited||(nt.inited=!0,nt.isNode=void 0!==tt&&null!=tt.release&&"node"===tt.release.name,nt.isBrowser="undefined"!=typeof window,nt.isMobileBrowser=nt.isBrowser&&this.isMobile(window),nt.isAppleMobileBrowser=nt.isBrowser&&this.isAppleMobile(window),nt.isNode?nt.global=i.g:nt.isBrowser?nt.global=window:nt.global=self)}static fromB64ToArray(e){if(nt.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=nt.global.atob(e),i=new Uint8Array(t.length);for(let e=0;e("00"+e.toString(16)).slice(-2))).join("")}}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 nt.fromB64ToUtf8(nt.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return nt.isNode?Buffer.from(e,"utf8").toString("base64"):decodeURIComponent(escape(nt.global.btoa(e)))}static fromUtf8ToUrlB64(e){return nt.fromBufferToUrlB64(nt.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return nt.isNode?Buffer.from(e,"base64").toString("utf8"):decodeURIComponent(escape(nt.global.atob(e)))}static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}static isGuid(e){return RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,"i").test(e)}static getHostname(e){const t=nt.getUrl(e);try{return null!=t&&""!==t.hostname?t.hostname:null}catch(e){return null}}static getHost(e){const t=nt.getUrl(e);try{return null!=t&&""!==t.host?t.host:null}catch(e){return null}}static getDomain(e){if(null==e)return null;if(""===(e=e.trim()))return null;if(e.startsWith("data:"))return null;let t=e.startsWith("http://")||e.startsWith("https://");if(!t&&e.indexOf("://")<0&&nt.tldEndingRegex.test(e)&&e.indexOf("@")<0&&(e="http://"+e,t=!0),t)try{const t=nt.getUrlObject(e);if(!(null==(null==et?void 0:et.isValid)||et.isValid(t.hostname)))return null;if("localhost"===t.hostname||nt.validIpAddress(t.hostname))return t.hostname;const i=null!=et&&null!=et.getDomain?et.getDomain(t.hostname):null;return null!=i?i:t.hostname}catch(e){}try{const t=null!=et&&null!=et.getDomain?et.getDomain(e):null;if(null!=t)return t}catch(e){return null}return null}static getQueryParams(e){const t=nt.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 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){if(null==e)return null;if(""===(e=e.trim()))return null;let t=nt.getUrlObject(e);if(null==t){!(0===e.indexOf("http://")||0===e.indexOf("https://"))&&e.indexOf(".")>-1&&(t=nt.getUrlObject("http://"+e))}return t}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 i=0;i>8*e&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 validIpAddress(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(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 isAppleMobile(e){return null!=e.navigator.userAgent.match(/iPhone/i)||null!=e.navigator.userAgent.match(/iPad/i)}static getUrlObject(e){try{if(null!=it)return new it.URL(e);if("function"==typeof URL)return new URL(e);if("undefined"!=typeof window){const t=e.indexOf("://")>-1;if(!t&&e.indexOf(".")>-1)e="http://"+e;else if(!t)return null;const i=window.document.createElement("a");return i.href=e,i}}catch(e){}return null}}nt.inited=!1,nt.isNode=!1,nt.isBrowser=!0,nt.isMobileBrowser=!1,nt.isAppleMobileBrowser=!1,nt.global=null,nt.tldEndingRegex=/.*\.(com|net|org|edu|uk|gov|ca|de|jp|fr|au|ru|ch|io|es|us|co|xyz|info|ly|mil)$/,nt.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,nt.init();var st=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ot{constructor(e,t,i,n){null!=t?this.initFromData(e,t,i,n):this.initFromEncryptedString(e)}get ivBytes(){return null==this.iv?null:nt.fromB64ToArray(this.iv).buffer}get macBytes(){return null==this.mac?null:nt.fromB64ToArray(this.mac).buffer}get dataBytes(){return null==this.data?null:nt.fromB64ToArray(this.data).buffer}toJSON(){return this.encryptedString}static fromJSON(e){return new ot(e)}initFromData(e,t,i,n){this.encryptedString=null!=i?e+"."+i+"|"+t:e+"."+t,null!=n&&(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}=this.parseEncryptedString(this.encryptedString);switch(this.encryptionType=t,t){case je.AesCbc128_HmacSha256_B64:case je.AesCbc256_HmacSha256_B64:if(3!==i.length)return;this.iv=i[0],this.data=i[1],this.mac=i[2];break;case je.AesCbc256_B64:if(2!==i.length)return;this.iv=i[0],this.data=i[1];break;case je.Rsa2048_OaepSha256_B64:case je.Rsa2048_OaepSha1_B64:if(1!==i.length)return;this.data=i[0];break;default:return}}parseEncryptedString(e){const t=e.split(".");let i,n=null;if(2===t.length)try{i=parseInt(t[0],null),n=t[1].split("|")}catch(e){return}else n=e.split("|"),i=3===n.length?je.AesCbc128_HmacSha256_B64:je.AesCbc256_B64;return{encType:i,encPieces:n}}decrypt(e,t=null){return st(this,void 0,void 0,(function*(){if(null!=this.decryptedValue)return this.decryptedValue;try{if(null==t&&(t=yield this.getKeyForDecryption(e)),null==t)throw new Error("No key to decrypt EncString with orgId "+e);const i=nt.getContainerService().getEncryptService();this.decryptedValue=yield i.decryptToUtf8(this,t)}catch(e){this.decryptedValue="[error: cannot decrypt]"}return this.decryptedValue}))}getKeyForDecryption(e){return st(this,void 0,void 0,(function*(){const t=nt.getContainerService().getCryptoService();return null!=e?yield t.getOrgKey(e):yield t.getKeyForUserEncryption()}))}}var rt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class at{buildDomainModel(e,t,i,n=[]){for(const s in i){if(!i.hasOwnProperty(s))continue;const o=t[i[s]||s];n.indexOf(s)>-1?e[s]=o||null:e[s]=o?new ot(o):null}}buildDataModel(e,t,i,n=[]){for(const s in i){if(!i.hasOwnProperty(s))continue;const o=e[i[s]||s];n.indexOf(s)>-1?t[s]=null!=o?o:null:t[s]=null!=o?o.encryptedString:null}}decryptObj(e,t,i,n=null){return rt(this,void 0,void 0,(function*(){const s=[],o=this;for(const r in t)t.hasOwnProperty(r)&&function(r){const a=Promise.resolve().then((()=>{const e=t[r]||r;return o[e]?o[e].decrypt(i,n):null})).then((t=>{e[r]=t}));s.push(a)}(r);return yield Promise.all(s),e}))}}class lt extends at{constructor(){super(...arguments),this.minComplexity=0,this.minLength=0,this.requireUpper=!1,this.requireLower=!1,this.requireNumbers=!1,this.requireSpecial=!1}}function ct(e,t){if(1&e&&s._UZ(0,"i",6),2&e){const e=s.oxw(2);s.Gre("bwi ",e.icon,"")}}function ut(e,t){if(1&e&&(s.TgZ(0,"h3",4),s._uU(1,"\n "),s.YNc(2,ct,1,3,"i",5),s._uU(3),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.icon),s.xp6(1),s.hij("\n ",e.title,"\n ")}}function dt(e,t){if(1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij("\n ",s.xi3(2,1,"policyInEffectMinComplexity",e.getPasswordScoreAlertDisplay()),"\n ")}}function ht(e,t){if(1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij("\n ",s.xi3(2,1,"policyInEffectMinLength",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minLength.toString()),"\n ")}}function pt(e,t){1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"policyInEffectUppercase"),"\n "))}function gt(e,t){1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"policyInEffectLowercase"),"\n "))}function vt(e,t){1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"policyInEffectNumbers"),"\n "))}function yt(e,t){1&e&&(s.TgZ(0,"li"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.xi3(2,1,"policyInEffectSpecial","!@#$%^&*"),"\n "))}function ft(e,t){if(1&e&&(s.TgZ(0,"div",7),s._uU(1),s.TgZ(2,"ul"),s._uU(3,"\n "),s.YNc(4,dt,3,4,"li",8),s._uU(5,"\n "),s.YNc(6,ht,3,4,"li",8),s._uU(7,"\n "),s.YNc(8,pt,3,3,"li",8),s._uU(9,"\n "),s.YNc(10,gt,3,3,"li",8),s._uU(11,"\n "),s.YNc(12,vt,3,3,"li",8),s._uU(13,"\n "),s.YNc(14,yt,3,4,"li",8),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n ",e.enforcedPolicyMessage,"\n "),s.xp6(3),s.Q6J("ngIf",(null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minComplexity)>0),s.xp6(2),s.Q6J("ngIf",(null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.minLength)>0),s.xp6(2),s.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireUpper),s.xp6(2),s.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireLower),s.xp6(2),s.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireNumbers),s.xp6(2),s.Q6J("ngIf",null==e.enforcedPolicyOptions?null:e.enforcedPolicyOptions.requireSpecial)}}const mt=function(e){return{clickable:e}};class wt{constructor(e){this.i18nService=e,this.type="info",this.useAlertRole=!1}ngOnInit(){this.calloutStyle=this.type,void 0===this.enforcedPolicyMessage&&(this.enforcedPolicyMessage=this.i18nService.t("masterPasswordPolicyInEffect")),"warning"===this.type||"danger"===this.type?("danger"===this.type&&(this.calloutStyle="danger"),void 0===this.title&&(this.title=this.i18nService.t("warning")),void 0===this.icon&&(this.icon="bwi-exclamation-triangle")):"error"===this.type?(this.calloutStyle="danger",void 0===this.title&&(this.title=this.i18nService.t("error")),void 0===this.icon&&(this.icon="bwi-error")):"tip"===this.type&&(this.calloutStyle="success",void 0===this.title&&(this.title=this.i18nService.t("tip")),void 0===this.icon&&(this.icon="bwi-lightbulb"))}getPasswordScoreAlertDisplay(){if(null==this.enforcedPolicyOptions)return"";let e;switch(this.enforcedPolicyOptions.minComplexity){case 4:e=this.i18nService.t("strong");break;case 3:e=this.i18nService.t("good");break;default:e=this.i18nService.t("weak")}return e+" ("+this.enforcedPolicyOptions.minComplexity+")"}}wt.ɵfac=function(e){return new(e||wt)(s.Y36(_e))},wt.ɵcmp=s.Xpm({type:wt,selectors:[["app-callout"]],inputs:{type:"type",icon:"icon",title:"title",clickable:"clickable",enforcedPolicyOptions:"enforcedPolicyOptions",enforcedPolicyMessage:"enforcedPolicyMessage",useAlertRole:"useAlertRole"},ngContentSelectors:["*"],decls:10,vars:9,consts:[[3,"ngClass"],["callout",""],["class","callout-heading",4,"ngIf"],["class","enforced-policy-options",4,"ngIf"],[1,"callout-heading"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true"],[1,"enforced-policy-options"],[4,"ngIf"]],template:function(e,t){1&e&&(s.F$t(),s.TgZ(0,"div",0,1),s._uU(2,"\n "),s.YNc(3,ut,4,2,"h3",2),s._uU(4,"\n "),s.YNc(5,ft,17,7,"div",3),s._uU(6,"\n "),s.Hsn(7),s._uU(8,"\n"),s.qZA(),s._uU(9,"\n")),2&e&&(s.Gre("callout callout-",t.calloutStyle,""),s.Q6J("ngClass",s.VKq(7,mt,t.clickable)),s.uIk("role",t.useAlertRole?"alert":null),s.xp6(3),s.Q6J("ngIf",t.title),s.xp6(2),s.Q6J("ngIf",t.enforcedPolicyOptions))},dependencies:[u.mk,u.O5,Ze],encapsulation:2});class bt{constructor(e,t){this.el=e,this.renderer=t}set appInputVerbatim(e){this.disableComplete=""===e||!0===e}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")}}bt.ɵfac=function(e){return new(e||bt)(s.Y36(s.SBq),s.Y36(s.Qsj))},bt.ɵdir=s.lG2({type:bt,selectors:[["","appInputVerbatim",""]],inputs:{appInputVerbatim:"appInputVerbatim"}});class St{onClick(e){e.preventDefault()}}St.ɵfac=function(e){return new(e||St)},St.ɵdir=s.lG2({type:St,selectors:[["","appStopClick",""]],hostBindings:function(e,t){1&e&&s.NdJ("click",(function(e){return t.onClick(e)}))}});var Ut=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function xt(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-callout",31),s.ALo(1,"i18n"),s._uU(2,"\n "),s.TgZ(3,"a",32),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.resetEnvironment())})),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6),s.ALo(7,"i18n"),s.qZA()}2&e&&(s.s9C("title",s.lcZ(1,3,"settingsEdited")),s.xp6(4),s.hij("\n ",s.lcZ(5,5,"environmentEditedClick"),"\n "),s.xp6(2),s.hij("\n ",s.lcZ(7,7,"environmentEditedReset"),"\n "))}class At extends Ke{constructor(e,t,i,n){super(e,t,i),this.environmentService=t,this.router=n,this.showEditedManagedSettings=!1,this.showCustom=!0}ngOnInit(){return Ut(this,void 0,void 0,(function*(){this.showEditedManagedSettings=yield this.environmentService.settingsHaveChanged()}))}resetEnvironment(){return Ut(this,void 0,void 0,(function*(){const e=yield this.environmentService.getManagedEnvironment();this.baseUrl=e.base,this.webVaultUrl=e.webVault,this.apiUrl=e.api,this.iconsUrl=e.icons,this.identityUrl=e.identity,this.notificationsUrl=e.notifications,this.iconsUrl=e.icons}))}saved(){super.saved(),this.router.navigate([""])}}At.ɵfac=function(e){return new(e||At)(s.Y36(Je),s.Y36($e),s.Y36(_e),s.Y36(Pe.F0))},At.ɵcmp=s.Xpm({type:At,selectors:[["app-environment"]],features:[s.qOj],decls:120,vars:51,consts:[[3,"ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/home"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],["type","info",3,"title",4,"ngIf"],[1,"box"],[1,"box-header"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","baseUrl"],["id","baseUrl","type","text","name","BaseUrl","placeholder","ex. https://bitwarden.company.com","appInputVerbatim","",3,"ngModel","ngModelChange"],[1,"box-footer"],[1,"box-content",3,"hidden"],["for","webVaultUrl"],["id","webVaultUrl","type","text","name","WebVaultUrl","inputmode","url","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","apiUrl"],["id","apiUrl","type","text","name","ApiUrl","inputmode","url","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","identityUrl"],["id","identityUrl","type","text","name","IdentityUrl","inputmode","url","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","notificationsUrl"],["id","notificationsUrl","type","text","name","NotificationsUrl","inputmode","url","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","iconsUrl"],["id","iconsUrl","type","text","name","IconsUrl","inputmode","url","appInputVerbatim","",3,"ngModel","ngModelChange"],[1,"box-footer",3,"hidden"],["type","info",3,"title"],["href","#","appStopClick","",3,"click"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.YNc(34,xt,8,9,"app-callout",11),s._uU(35,"\n\n "),s.TgZ(36,"div",12),s._uU(37,"\n "),s.TgZ(38,"h2",13),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n "),s.TgZ(42,"div",14),s._uU(43,"\n "),s.TgZ(44,"div",15),s._uU(45,"\n "),s.TgZ(46,"label",16),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"input",17),s.NdJ("ngModelChange",(function(e){return t.baseUrl=e})),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.TgZ(54,"div",18),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"div",12),s._uU(60,"\n "),s.TgZ(61,"h2",13),s._uU(62),s.ALo(63,"i18n"),s.qZA(),s._uU(64,"\n "),s.TgZ(65,"div",19),s._uU(66,"\n "),s.TgZ(67,"div",15),s._uU(68,"\n "),s.TgZ(69,"label",20),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n "),s.TgZ(73,"input",21),s.NdJ("ngModelChange",(function(e){return t.webVaultUrl=e})),s.qZA(),s._uU(74,"\n "),s.qZA(),s._uU(75,"\n "),s.TgZ(76,"div",15),s._uU(77,"\n "),s.TgZ(78,"label",22),s._uU(79),s.ALo(80,"i18n"),s.qZA(),s._uU(81,"\n "),s.TgZ(82,"input",23),s.NdJ("ngModelChange",(function(e){return t.apiUrl=e})),s.qZA(),s._uU(83,"\n "),s.qZA(),s._uU(84,"\n "),s.TgZ(85,"div",15),s._uU(86,"\n "),s.TgZ(87,"label",24),s._uU(88),s.ALo(89,"i18n"),s.qZA(),s._uU(90,"\n "),s.TgZ(91,"input",25),s.NdJ("ngModelChange",(function(e){return t.identityUrl=e})),s.qZA(),s._uU(92,"\n "),s.qZA(),s._uU(93,"\n "),s.TgZ(94,"div",15),s._uU(95,"\n "),s.TgZ(96,"label",26),s._uU(97),s.ALo(98,"i18n"),s.qZA(),s._uU(99,"\n "),s.TgZ(100,"input",27),s.NdJ("ngModelChange",(function(e){return t.notificationsUrl=e})),s.qZA(),s._uU(101,"\n "),s.qZA(),s._uU(102,"\n "),s.TgZ(103,"div",15),s._uU(104,"\n "),s.TgZ(105,"label",28),s._uU(106),s.ALo(107,"i18n"),s.qZA(),s._uU(108,"\n "),s.TgZ(109,"input",29),s.NdJ("ngModelChange",(function(e){return t.iconsUrl=e})),s.qZA(),s._uU(110,"\n "),s.qZA(),s._uU(111,"\n "),s.qZA(),s._uU(112,"\n "),s.TgZ(113,"div",30),s._uU(114),s.ALo(115,"i18n"),s.qZA(),s._uU(116,"\n "),s.qZA(),s._uU(117,"\n "),s.qZA(),s._uU(118,"\n"),s.qZA(),s._uU(119,"\n")),2&e){const e=s.MAs(1);s.xp6(8),s.Oqu(s.lcZ(9,25,"close")),s.xp6(7),s.Oqu(s.lcZ(16,27,"appName")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,29,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(7),s.Q6J("ngIf",t.showEditedManagedSettings),s.xp6(5),s.hij("\n ",s.lcZ(40,31,"selfHostedEnvironment"),"\n "),s.xp6(8),s.Oqu(s.lcZ(48,33,"baseUrl")),s.xp6(3),s.Q6J("ngModel",t.baseUrl),s.xp6(5),s.hij("\n ",s.lcZ(56,35,"selfHostedEnvironmentFooter"),"\n "),s.xp6(7),s.hij("\n ",s.lcZ(63,37,"customEnvironment"),"\n "),s.xp6(3),s.Q6J("hidden",!t.showCustom),s.xp6(5),s.Oqu(s.lcZ(71,39,"webVaultUrl")),s.xp6(3),s.Q6J("ngModel",t.webVaultUrl),s.xp6(6),s.Oqu(s.lcZ(80,41,"apiUrl")),s.xp6(3),s.Q6J("ngModel",t.apiUrl),s.xp6(6),s.Oqu(s.lcZ(89,43,"identityUrl")),s.xp6(3),s.Q6J("ngModel",t.identityUrl),s.xp6(6),s.Oqu(s.lcZ(98,45,"notificationsUrl")),s.xp6(3),s.Q6J("ngModel",t.notificationsUrl),s.xp6(6),s.Oqu(s.lcZ(107,47,"iconsUrl")),s.xp6(3),s.Q6J("ngModel",t.iconsUrl),s.xp6(4),s.Q6J("hidden",!t.showCustom),s.xp6(1),s.hij("\n ",s.lcZ(115,49,"customEnvironmentFooter"),"\n ")}},dependencies:[Pe.rH,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.On,ue.F,Xe,wt,bt,St,Ze],encapsulation:2});class _t{constructor(e){this.email=e}}var Zt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Tt{}class Ct{}class kt{constructor(e,t){this.i18nService=e,this.platformUtilsService=t}showError(e){const t=this.i18nService.t("unexpectedError");let i=[];return null!=e&&"string"==typeof e?i.push(e):null==e||"object"!=typeof e?i.push(t):null!=e.validationErrors?i=i.concat(e.getAllMessages()):i.push(e.message?e.message:t),1===i.length?this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i[0]):i.length>1&&this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i,{timeout:5e3*i.length}),i}}kt.ɵfac=function(e){return new(e||kt)(s.LFG(_e),s.LFG(Je))},kt.ɵprov=s.Yz7({token:kt,factory:kt.ɵfac});class Ot{constructor(e,t,i){this.el=e,this.validationService=t,this.logService=i}ngOnChanges(e){null!=this.appApiAction&&null!=this.appApiAction.then&&(this.el.nativeElement.loading=!0,this.appApiAction.then((e=>{this.el.nativeElement.loading=!1}),(e=>{var t;this.el.nativeElement.loading=!1,e.captchaRequired?this.logService.error("Captcha required error response: "+e.getSingleMessage()):(null===(t=this.logService)||void 0===t||t.error(`Received API exception: ${e}`),this.validationService.showError(e))})))}}Ot.ɵfac=function(e){return new(e||Ot)(s.Y36(s.SBq),s.Y36(kt),s.Y36(Ct))},Ot.ɵdir=s.lG2({type:Ot,selectors:[["","appApiAction",""]],inputs:{appApiAction:"appApiAction"},features:[s.TTD]});var Pt=i(17108);class It{constructor(e,t){this.el=e,this.ngZone=t}set appAutofocus(e){this.autofocus=""===e||!0===e}ngOnInit(){!nt.isMobileBrowser&&this.autofocus&&(this.ngZone.isStable?this.el.nativeElement.focus():this.ngZone.onStable.pipe((0,Pt.q)(1)).subscribe((()=>this.el.nativeElement.focus())))}}It.ɵfac=function(e){return new(e||It)(s.Y36(s.SBq),s.Y36(s.R0b))},It.ɵdir=s.lG2({type:It,selectors:[["","appAutofocus",""]],inputs:{appAutofocus:"appAutofocus"}});class qt extends class{constructor(e,t,i,n,s){this.router=e,this.i18nService=t,this.apiService=i,this.platformUtilsService=n,this.logService=s,this.email="",this.successRoute="login"}submit(){return Zt(this,void 0,void 0,(function*(){if(null!=this.email&&""!==this.email)if(-1!==this.email.indexOf("@"))try{this.formPromise=this.apiService.postPasswordHint(new _t(this.email)),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("masterPassSent")),null!=this.onSuccessfulSubmit?this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}catch(e){this.logService.error(e)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidEmail"));else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("emailRequired"))}))}}{constructor(e,t,i,n,s){super(e,i,n,t,s)}}qt.ɵfac=function(e){return new(e||qt)(s.Y36(Pe.F0),s.Y36(Je),s.Y36(_e),s.Y36(Tt),s.Y36(Ct))},qt.ɵcmp=s.Xpm({type:qt,selectors:[["app-hint"]],features:[s.qOj],decls:55,vars:20,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/login"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","email"],["id","email","type","text","name","Email","required","","appAutofocus","","inputmode","email","appInputVerbatim","false",3,"ngModel","ngModelChange"],[1,"box-footer"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.TgZ(34,"div",11),s._uU(35,"\n "),s.TgZ(36,"div",12),s._uU(37,"\n "),s.TgZ(38,"div",13),s._uU(39,"\n "),s.TgZ(40,"label",14),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s.TgZ(44,"input",15),s.NdJ("ngModelChange",(function(e){return t.email=e})),s.qZA(),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n "),s.qZA(),s._uU(47,"\n "),s.TgZ(48,"div",16),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n"),s.qZA(),s._uU(54,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,10,"cancel")),s.xp6(7),s.Oqu(s.lcZ(16,12,"passwordHint")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,14,"submit")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(14),s.Oqu(s.lcZ(42,16,"emailAddress")),s.xp6(3),s.Q6J("ngModel",t.email),s.xp6(5),s.hij("\n ",s.lcZ(50,18,"enterEmailToGetHint"),"\n ")}},dependencies:[Pe.rH,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ot,It,Xe,bt,Ze],encapsulation:2});class Dt{}class Mt{}class Ft{}var Nt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Lt{constructor(e,t,i,n,s){this.platformUtilsService=e,this.passwordGenerationService=t,this.stateService=i,this.cryptoFunctionService=n,this.environmentService=s}launchSsoBrowser(){return Nt(this,void 0,void 0,(function*(){const e={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1},t=(yield this.passwordGenerationService.generatePassword(e))+":clientId=browser",i=yield this.passwordGenerationService.generatePassword(e),n=yield this.cryptoFunctionService.hash(i,"sha256"),s=nt.fromBufferToUrlB64(n);yield this.stateService.setSsoCodeVerifier(i),yield this.stateService.setSsoState(t);let o=this.environmentService.getWebVaultUrl();null==o&&(o="https://vault.bitwarden.com");const r=o+"/sso-connector.html";this.platformUtilsService.launchUri(o+"/#/sso?clientId=browser&redirectUri="+encodeURIComponent(r)+"&state="+t+"&codeChallenge="+s)}))}}Lt.ɵfac=function(e){return new(e||Lt)(s.Y36(Je),s.Y36(Dt),s.Y36(Mt),s.Y36(Ft),s.Y36(Ye))},Lt.ɵcmp=s.Xpm({type:Lt,selectors:[["app-home"]],decls:37,vars:15,consts:[[1,"center-content"],[1,"content"],[1,"logo-image"],[1,"lead","text-center"],["type","button","routerLink","/login",1,"btn","primary","block"],["type","button",1,"btn","block",3,"click"],["aria-hidden","true",1,"bwi","bwi-bank"],["type","button","routerLink","/register",1,"btn","block"],["type","button","routerLink","/environment",1,"settings-icon"],["aria-hidden","true",1,"bwi","bwi-cog-f","bwi-lg"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s._UZ(4,"div",2),s._uU(5,"\n "),s.TgZ(6,"p",3),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"button",4),s._uU(11,"\n "),s.TgZ(12,"b"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"button",5),s.NdJ("click",(function(){return t.launchSsoBrowser()})),s._uU(18,"\n "),s._UZ(19,"i",6),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n "),s.TgZ(23,"button",7),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n"),s.qZA(),s._uU(28,"\n"),s.TgZ(29,"button",8),s._uU(30,"\n "),s._UZ(31,"i",9),s.TgZ(32,"span"),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n")),2&e&&(s.xp6(7),s.Oqu(s.lcZ(8,5,"loginOrCreateNewAccount")),s.xp6(6),s.Oqu(s.lcZ(14,7,"login")),s.xp6(7),s.hij(" ",s.lcZ(21,9,"enterpriseSingleSignOn"),"\n "),s.xp6(4),s.hij("\n ",s.lcZ(25,11,"createAccount"),"\n "),s.xp6(9),s.hij(" ",s.lcZ(34,13,"settings"),""))},dependencies:[Pe.rH,Ze],encapsulation:2});var Et,Rt,Jt=i(61872);!function(e){e[e.ServerAuthorization=1]="ServerAuthorization",e[e.LocalAuthorization=2]="LocalAuthorization"}(Et||(Et={})),function(e){e.Auto="auto",e.Biometric="biometric"}(Rt||(Rt={}));class Yt{}class zt{}class Kt{}class Bt{}var Gt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Qt{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){this.router=e,this.i18nService=t,this.platformUtilsService=i,this.messagingService=n,this.cryptoService=s,this.vaultTimeoutService=o,this.vaultTimeoutSettingsService=r,this.environmentService=a,this.stateService=l,this.apiService=c,this.logService=u,this.keyConnectorService=d,this.ngZone=h,this.masterPassword="",this.pin="",this.showPassword=!1,this.pinLock=!1,this.webVaultHostname="",this.successRoute="vault",this.invalidPinAttempts=0,this.destroy$=new Be.x}ngOnInit(){return Gt(this,void 0,void 0,(function*(){this.stateService.activeAccount$.pipe((0,Ge.b)((()=>Gt(this,void 0,void 0,(function*(){yield this.load()})))),(0,Jt.R)(this.destroy$)).subscribe()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submit(){return Gt(this,void 0,void 0,(function*(){if(this.pinLock)return yield this.handlePinRequiredUnlock();yield this.handleMasterPasswordRequiredUnlock()}))}logOut(){return Gt(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("logOutConfirmation"),this.i18nService.t("logOut"),this.i18nService.t("logOut"),this.i18nService.t("cancel")))&&this.messagingService.send("logout")}))}unlockBiometric(){return Gt(this,void 0,void 0,(function*(){if(!this.biometricLock)return;const e=null!=(yield this.cryptoService.getKey(Rt.Biometric));return e&&(yield this.doContinue()),e}))}togglePassword(){this.showPassword=!this.showPassword;const e=document.getElementById(this.pinLock?"pin":"masterPassword");this.ngZone.isStable?e.focus():this.ngZone.onStable.pipe((0,Pt.q)(1)).subscribe((()=>e.focus()))}handlePinRequiredUnlock(){return Gt(this,void 0,void 0,(function*(){if(null!=this.pin&&""!==this.pin)return yield this.doUnlockWithPin();this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("pinRequired"))}))}doUnlockWithPin(){return Gt(this,void 0,void 0,(function*(){let e=!0;try{const t=yield this.stateService.getKdfType(),i=yield this.stateService.getKdfIterations();if(this.pinSet[0]){const n=yield this.cryptoService.makeKeyFromPin(this.pin,this.email,t,i,yield this.stateService.getDecryptedPinProtected()),s=yield this.cryptoService.getEncKey(n),o=yield this.stateService.getProtectedPin();e=(yield this.cryptoService.decryptToUtf8(new ot(o),s))!==this.pin,e||(yield this.setKeyAndContinue(n))}else{const n=yield this.cryptoService.makeKeyFromPin(this.pin,this.email,t,i);e=!1,yield this.setKeyAndContinue(n)}}catch(t){e=!0}if(e){if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return void this.messagingService.send("logout");this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidPin"))}}))}handleMasterPasswordRequiredUnlock(){return Gt(this,void 0,void 0,(function*(){null!=this.masterPassword&&""!==this.masterPassword?yield this.doUnlockWithMasterPassword():this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired"))}))}doUnlockWithMasterPassword(){return Gt(this,void 0,void 0,(function*(){const e=yield this.stateService.getKdfType(),t=yield this.stateService.getKdfIterations(),i=yield this.cryptoService.makeKey(this.masterPassword,this.email,e,t);let n=!1;if(null!=(yield this.cryptoService.getKeyHash()))n=yield this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,i);else{const e=new Yt,t=yield this.cryptoService.hashPassword(this.masterPassword,i,Et.ServerAuthorization);e.masterPasswordHash=t;try{this.formPromise=this.apiService.postAccountVerifyPassword(e),yield this.formPromise,n=!0;const t=yield this.cryptoService.hashPassword(this.masterPassword,i,Et.LocalAuthorization);yield this.cryptoService.setKeyHash(t)}catch(e){this.logService.error(e)}}if(n){if(this.pinSet[0]){const n=yield this.stateService.getProtectedPin(),s=yield this.cryptoService.getEncKey(i),o=yield this.cryptoService.decryptToUtf8(new ot(n),s),r=yield this.cryptoService.makePinKey(o,this.email,e,t);yield this.stateService.setDecryptedPinProtected(yield this.cryptoService.encrypt(i.key,r))}yield this.setKeyAndContinue(i)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"))}))}setKeyAndContinue(e){return Gt(this,void 0,void 0,(function*(){yield this.cryptoService.setKey(e),yield this.doContinue()}))}doContinue(){return Gt(this,void 0,void 0,(function*(){yield this.stateService.setEverBeenUnlocked(!0);const e=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!e),this.messagingService.send("unlocked"),null!=this.onSuccessfulSubmit?yield this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}))}load(){return Gt(this,void 0,void 0,(function*(){this.pinSet=yield this.vaultTimeoutSettingsService.isPinLockSet(),this.pinLock=this.pinSet[0]&&null!=(yield this.stateService.getDecryptedPinProtected())||this.pinSet[1],this.supportsBiometric=yield this.platformUtilsService.supportsBiometric(),this.biometricLock=(yield this.vaultTimeoutSettingsService.isBiometricLockSet())&&((yield this.cryptoService.hasKeyStored(Rt.Biometric))||!this.platformUtilsService.supportsSecureStorage()),this.biometricText=yield this.stateService.getBiometricText(),this.email=yield this.stateService.getEmail();const e=yield this.keyConnectorService.getUsesKeyConnector();this.hideInput=e&&!this.pinLock,!e||this.biometricLock||this.pinLock||(yield this.vaultTimeoutService.logOut());const t=this.environmentService.getWebVaultUrl(),i="https://vault.bitwarden.com"===t?"https://bitwarden.com":t;this.webVaultHostname=nt.getHostname(i)}))}}Qt.ɵfac=function(e){return new(e||Qt)(s.Y36(Pe.F0),s.Y36(_e),s.Y36(Je),s.Y36(qe),s.Y36(zt),s.Y36(Kt),s.Y36(Bt),s.Y36(Ye),s.Y36(Mt),s.Y36(Tt),s.Y36(Ct),s.Y36(De),s.Y36(s.R0b))},Qt.ɵdir=s.lG2({type:Qt});const Vt={startDesktop:{title:"startDesktopTitle",description:"startDesktopDesc"},desktopIntegrationDisabled:{title:"desktopIntegrationDisabledTitle",description:"desktopIntegrationDisabledDesc"}};class Ht{constructor(e,t){this.el=e,this.renderer=t}set appA11yTitle(e){this.title=e}ngOnInit(){this.el.nativeElement.hasAttribute("title")||this.renderer.setAttribute(this.el.nativeElement,"title",this.title),this.el.nativeElement.hasAttribute("aria-label")||this.renderer.setAttribute(this.el.nativeElement,"aria-label",this.title)}}Ht.ɵfac=function(e){return new(e||Ht)(s.Y36(s.SBq),s.Y36(s.Qsj))},Ht.ɵdir=s.lG2({type:Ht,selectors:[["","appA11yTitle",""]],inputs:{appA11yTitle:"appA11yTitle"}});var jt=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wt{static getTabFromCurrentWindowId(){return jt(this,void 0,void 0,(function*(){return yield Wt.tabsQueryFirst({active:!0,windowId:chrome.windows.WINDOW_ID_CURRENT})}))}static getTabFromCurrentWindow(){return jt(this,void 0,void 0,(function*(){return yield Wt.tabsQueryFirst({active:!0,currentWindow:!0})}))}static getActiveTabs(){return jt(this,void 0,void 0,(function*(){return yield Wt.tabsQuery({active:!0})}))}static tabsQuery(e){return jt(this,void 0,void 0,(function*(){return new Promise((t=>{chrome.tabs.query(e,(e=>{t(e)}))}))}))}static tabsQueryFirst(e){return jt(this,void 0,void 0,(function*(){const t=yield Wt.tabsQuery(e);return t.length>0?t[0]:null}))}static tabSendMessageData(e,t,i=null){const n={command:t};return null!=i&&(n.data=i),Wt.tabSendMessage(e,n)}static tabSendMessage(e,t,i=null){return jt(this,void 0,void 0,(function*(){if(e&&e.id)return new Promise((n=>{chrome.tabs.sendMessage(e.id,t,i,(()=>{chrome.runtime.lastError,n()}))}))}))}static getPrivateModeWindows(){return jt(this,void 0,void 0,(function*(){return(yield browser.windows.getAll()).filter((e=>e.incognito))}))}static onWindowCreated(e){return jt(this,void 0,void 0,(function*(){return chrome.windows.onCreated.addListener(e)}))}static getBackgroundPage(){return chrome.extension.getBackgroundPage()}static getApplicationVersion(){return chrome.runtime.getManifest().version}static isPopupOpen(){return jt(this,void 0,void 0,(function*(){return Promise.resolve(chrome.extension.getViews({type:"popup"}).length>0)}))}static createNewTab(e,t=!1,i=!0){chrome.tabs.create({url:e,active:i})}static messageListener(e,t){chrome.runtime.onMessage.addListener(((e,i,n)=>{t(e,i,n)}))}static sendMessage(e,t={}){const i=Object.assign({},{command:e},t);return chrome.runtime.sendMessage(i)}static closeLoginTab(){return jt(this,void 0,void 0,(function*(){const e=yield Wt.tabsQuery({active:!0,title:"Bitwarden",windowType:"normal",currentWindow:!0});if(0===e.length)return;const t=e[e.length-1].id;chrome.tabs.remove(t)}))}static focusSpecifiedTab(e){return jt(this,void 0,void 0,(function*(){chrome.tabs.update(e,{active:!0,highlighted:!0})}))}static closePopup(e){Wt.isWebExtensionsApi&&Wt.isFirefoxOnAndroid?browser.tabs.update({active:!0}).finally(e.close):e.close()}static gaFilter(){return!1}static getUILanguage(e){return chrome.i18n.getUILanguage()}static reloadExtension(e){return null!=e?e.location.reload(!0):chrome.runtime.reload()}static reloadOpenWindows(){chrome.extension.getViews().filter((e=>null!=e.location.href)).forEach((e=>{e.location.reload()}))}static connectNative(e){return Wt.isWebExtensionsApi?browser.runtime.connectNative(e):Wt.isChromeApi?chrome.runtime.connectNative(e):void 0}static requestPermission(e){return Wt.isWebExtensionsApi?browser.permissions.request(e):new Promise(((t,i)=>{chrome.permissions.request(e,t)}))}static getPlatformInfo(){return Wt.isWebExtensionsApi?browser.runtime.getPlatformInfo():new Promise((e=>{chrome.runtime.getPlatformInfo(e)}))}}Wt.isWebExtensionsApi="undefined"!=typeof browser,Wt.isSafariApi=-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf(" Chrome/")&&-1===navigator.userAgent.indexOf(" Chromium/"),Wt.isChromeApi=!Wt.isSafariApi&&"undefined"!=typeof chrome,Wt.isFirefoxOnAndroid=-1!==navigator.userAgent.indexOf("Firefox/")&&-1!==navigator.userAgent.indexOf("Android");class $t{constructor(e=!1){this.privateMode=e}inSidebar(e){return""!==e.location.search&&e.location.search.indexOf("uilocation=sidebar")>-1}inTab(e){return""!==e.location.search&&e.location.search.indexOf("uilocation=tab")>-1}inPopout(e){return""!==e.location.search&&e.location.search.indexOf("uilocation=popout")>-1}inPopup(e){return""===e.location.search||-1===e.location.search.indexOf("uilocation=")||e.location.search.indexOf("uilocation=popup")>-1}inPrivateMode(){return this.privateMode}getContentScrollY(e,t="main"){return e.document.getElementsByTagName(t)[0].scrollTop}setContentScrollY(e,t,i="main"){if(null!=t){e.document.getElementsByTagName(i)[0].scrollTop=t}}popOut(e,t=null){if(null===t&&(t=e.location.href),"undefined"!=typeof chrome&&chrome.windows&&chrome.windows.create){if(t.indexOf("?uilocation=")>-1)t=t.replace("uilocation=popup","uilocation=popout").replace("uilocation=tab","uilocation=popout").replace("uilocation=sidebar","uilocation=popout");else{const e=t.split("#");t=e[0]+"?uilocation=popout"+(e.length>0?"#"+e[1]:"")}const i=document.querySelector("body").getBoundingClientRect();chrome.windows.create({url:t,type:"popup",width:Math.round(i.width?i.width+60:375),height:Math.round(i.height||600)}),this.inPopup(e)&&Wt.closePopup(e)}else"undefined"!=typeof chrome&&chrome.tabs&&chrome.tabs.create&&(t=t.replace("uilocation=popup","uilocation=tab").replace("uilocation=popout","uilocation=tab").replace("uilocation=sidebar","uilocation=tab"),chrome.tabs.create({url:t}))}}function Xt(e,t){1&e&&(s.TgZ(0,"app-callout",1),s._uU(1),s.ALo(2,"i18n"),s.TgZ(3,"a",2),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6,"\n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,2,"privateModeWarning"),"\n "),s.xp6(3),s.Oqu(s.lcZ(5,4,"learnMore")))}$t.ɵfac=function(e){s.$Z()},$t.ɵprov=s.Yz7({token:$t,factory:$t.ɵfac});class ei{constructor(e){this.popupUtilsService=e,this.showWarning=!1}ngOnInit(){this.showWarning=this.popupUtilsService.inPrivateMode()}}ei.ɵfac=function(e){return new(e||ei)(s.Y36($t))},ei.ɵcmp=s.Xpm({type:ei,selectors:[["app-private-mode-warning"]],decls:2,vars:1,consts:[["type","warning",4,"ngIf"],["type","warning"],["href","https://bitwarden.com/help/article/private-mode/","target","_blank","rel","noopener"]],template:function(e,t){1&e&&(s.YNc(0,Xt,7,6,"app-callout",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.showWarning)},dependencies:[u.O5,wt,Ze],encapsulation:2});var ti=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ii(e,t){1&e&&(s.TgZ(0,"button",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"unlock")))}function ni(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n "),s.TgZ(2,"label",23),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"input",24),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.pin=t)})),s.qZA(),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"pin")),s.xp6(3),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.pin)}}function si(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",22),s._uU(1,"\n "),s.TgZ(2,"label",25),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"input",26),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.masterPassword=t)})),s.qZA(),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"masterPass")),s.xp6(3),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.masterPassword)}}const oi=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function ri(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n "),s.YNc(2,ni,8,5,"div",18),s._uU(3,"\n "),s.YNc(4,si,8,5,"div",18),s._uU(5,"\n "),s.TgZ(6,"div",19),s._uU(7,"\n "),s.TgZ(8,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.togglePassword())})),s.ALo(9,"i18n"),s._uU(10,"\n "),s._UZ(11,"i",21),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.pinLock),s.xp6(2),s.Q6J("ngIf",!e.pinLock),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(9,5,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(7,oi,!e.showPassword,e.showPassword))}}function ai(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",7),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.unlockBiometric())})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(4),s.Q6J("disabled",e.pendingBiometric),s.xp6(1),s.hij("\n ",s.lcZ(6,2,"unlockWithBiometrics"),"\n ")}}function li(e,t){if(1&e&&(s.TgZ(0,"app-callout",28),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.Oqu(e.biometricError)}}function ci(e,t){1&e&&(s.TgZ(0,"p",29),s._uU(1,"\n "),s._UZ(2,"i",30),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.xp6(3),s.hij(" ",s.lcZ(4,1,"awaitDesktop"),"\n "))}class ui extends Qt{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p){super(e,t,i,n,s,o,r,a,l,c,u,d,h),this.authService=p,this.pendingBiometric=!1,this.successRoute="/tabs/current",this.isInitialLockScreen=null==window.previousPopupUrl}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t;return ti(this,void 0,void 0,(function*(){yield e.ngOnInit.call(this);const i=null===(t=yield this.stateService.getDisableAutoBiometricsPrompt())||void 0===t||t;window.setTimeout((()=>ti(this,void 0,void 0,(function*(){document.getElementById(this.pinLock?"pin":"masterPassword").focus(),this.biometricLock&&!i&&this.isInitialLockScreen&&(yield this.authService.getAuthStatus())===Oe.Locked&&(yield this.unlockBiometric())}))),100)}))}unlockBiometric(){const e=Object.create(null,{unlockBiometric:{get:()=>super.unlockBiometric}});return ti(this,void 0,void 0,(function*(){if(!this.biometricLock)return;let t;this.pendingBiometric=!0,this.biometricError=null;try{t=yield e.unlockBiometric.call(this)}catch(e){const t=Vt[e];null==t&&this.logService.error("Unknown error: "+e),this.biometricError=this.i18nService.t(t.description)}return this.pendingBiometric=!1,t}))}}var di;ui.ɵfac=function(e){return new(e||ui)(s.Y36(Pe.F0),s.Y36(_e),s.Y36(Je),s.Y36(qe),s.Y36(zt),s.Y36(Kt),s.Y36(Bt),s.Y36(Ye),s.Y36(Mt),s.Y36(Tt),s.Y36(Ct),s.Y36(De),s.Y36(s.R0b),s.Y36(Ie))},ui.ɵcmp=s.Xpm({type:ui,selectors:[["app-lock"]],features:[s.qOj],decls:54,vars:19,consts:[[3,"ngSubmit"],[1,"left"],[1,"center"],[1,"title"],[1,"right"],["type","submit",4,"ngIf"],["tabindex","-1"],[1,"box"],[1,"box-content"],["class","box-content-row box-content-row-flex","appBoxRow","",4,"ngIf"],[1,"box-footer"],["class","box",4,"ngIf"],[1,"text-center"],["type","button","appStopClick","",3,"click"],["type","error",4,"ngIf"],["class","text-center text-muted",4,"ngIf"],["type","submit"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],["class","row-main",4,"ngIf"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"row-main"],["for","pin"],["id","pin","name","PIN","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],["for","masterPassword"],["id","masterPassword","name","MasterPassword","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],["type","button","appStopClick","",1,"btn","primary","block",3,"disabled","click"],["type","error"],[1,"text-center","text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(1,"\n "),s.TgZ(2,"header"),s._uU(3,"\n "),s._UZ(4,"div",1),s._uU(5,"\n "),s.TgZ(6,"h1",2),s._uU(7,"\n "),s.TgZ(8,"span",3),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",4),s._uU(14,"\n "),s.YNc(15,ii,3,3,"button",5),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"main",6),s._uU(20,"\n "),s.TgZ(21,"div",7),s._uU(22,"\n "),s.TgZ(23,"div",8),s._uU(24,"\n "),s.YNc(25,ri,15,10,"div",9),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"div",10),s._uU(29,"\n "),s.TgZ(30,"p"),s._uU(31),s.ALo(32,"i18n"),s.qZA(),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.YNc(37,ai,9,4,"div",11),s._uU(38,"\n "),s.TgZ(39,"p",12),s._uU(40,"\n "),s.TgZ(41,"button",13),s.NdJ("click",(function(){return t.logOut()})),s._uU(42),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n "),s.qZA(),s._uU(45,"\n "),s._UZ(46,"app-private-mode-warning"),s._uU(47,"\n "),s.YNc(48,li,2,1,"app-callout",14),s._uU(49,"\n "),s.YNc(50,ci,5,3,"p",15),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n"),s.qZA(),s._uU(53,"\n")),2&e&&(s.xp6(9),s.Oqu(s.lcZ(10,9,"verifyIdentity")),s.xp6(6),s.Q6J("ngIf",!t.hideInput),s.xp6(10),s.Q6J("ngIf",!t.hideInput),s.xp6(6),s.Oqu(s.lcZ(32,11,"yourVaultIsLocked")),s.xp6(2),s.hij("\n ",s.Dn7(34,13,"loggedInAsOn",t.email,t.webVaultHostname),"\n "),s.xp6(4),s.Q6J("ngIf",t.biometricLock),s.xp6(5),s.Oqu(s.lcZ(43,17,"logOut")),s.xp6(6),s.Q6J("ngIf",t.biometricError),s.xp6(2),s.Q6J("ngIf",t.pendingBiometric))},dependencies:[u.mk,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ht,Xe,wt,bt,St,ei,Ze],encapsulation:2}),function(e){e[e.Password=0]="Password",e[e.Sso=1]="Sso",e[e.Api=2]="Api",e[e.Passwordless=3]="Passwordless"}(di||(di={}));class hi{constructor(e,t,i,n){this.email=e,this.masterPassword=t,this.captchaToken=i,this.twoFactor=n,this.type=di.Password}}class pi{constructor(e,t,i,n,s){this.code=e,this.codeVerifier=t,this.redirectUrl=i,this.orgId=n,this.twoFactor=s,this.type=di.Sso}}class gi extends class{constructor(e,t,i,n,s,o,r){this.win=e,this.webVaultUrl=t,this.path=i,this.iframeId=n,this.successCallback=s,this.errorCallback=o,this.infoCallback=r,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}stop(){this.sendMessage("stop")}start(){this.sendMessage("start")}sendMessage(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)}base64Encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode("0x"+t))))}cleanup(){this.win.removeEventListener("message",this.parseFunction,!1)}createParams(e,t){return new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),v:t.toString()})}initComponent(e){this.connectorLink.href=`${this.webVaultUrl}/${this.path}?${e}`,this.iframe=this.win.document.getElementById(this.iframeId),this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1)}parseMessage(e){if(!this.validMessage(e))return;const t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}validMessage(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))}}{constructor(e,t,i,n,s,o){super(e,t,"captcha-connector.html","hcaptcha_iframe",n,s,(e=>{const t=JSON.parse(e);"string"!=typeof t?(this.iframe.height=t.height.toString(),this.iframe.width=t.width.toString()):o(t)})),this.i18nService=i}init(e){super.initComponent(this.createParams({siteKey:e,locale:this.i18nService.translationLocale},1))}}var vi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yi{constructor(e,t,i){this.environmentService=e,this.i18nService=t,this.platformUtilsService=i,this.captchaSiteKey=null,this.captchaToken=null}setupCaptcha(){return vi(this,void 0,void 0,(function*(){const e=this.environmentService.getWebVaultUrl();this.captcha=new gi(window,e,this.i18nService,(e=>{this.captchaToken=e}),(e=>{this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}),(e=>{this.platformUtilsService.showToast("info",this.i18nService.t("info"),e)}))}))}showCaptcha(){return!nt.isNullOrWhitespace(this.captchaSiteKey)}handleCaptchaRequired(e){return!nt.isNullOrWhitespace(e.captchaSiteKey)&&(this.captchaSiteKey=e.captchaSiteKey,this.captcha.init(e.captchaSiteKey),!0)}}yi.ɵfac=function(e){return new(e||yi)(s.Y36(Ye),s.Y36(_e),s.Y36(Je))},yi.ɵdir=s.lG2({type:yi,inputs:{captchaSiteKey:"captchaSiteKey"}});class fi{}var mi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wi extends yi{constructor(e,t,i,n,s,o,r,a,l,c,u,d){super(o,n,i),this.authService=e,this.router=t,this.stateService=s,this.passwordGenerationService=r,this.cryptoFunctionService=a,this.logService=l,this.ngZone=c,this.formBuilder=u,this.formValidationErrorService=d,this.showPassword=!1,this.selfHosted=!1,this.formGroup=this.formBuilder.group({email:["",[ue.kI.required,ue.kI.email]],masterPassword:["",[ue.kI.required,ue.kI.minLength(8)]],rememberEmail:[!0]}),this.twoFactorRoute="2fa",this.successRoute="vault",this.forcePasswordResetRoute="update-temp-password",this.alwaysRememberEmail=!1,this.selfHosted=i.isSelfHost()}get selfHostedDomain(){return this.environmentService.hasBaseUrl()?this.environmentService.getWebVaultUrl():null}ngOnInit(){var e,t,i,n;return mi(this,void 0,void 0,(function*(){let s=null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value;if(null!=s&&""!==s||(s=yield this.stateService.getRememberedEmail(),null===(t=this.formGroup.get("email"))||void 0===t||t.setValue(s),null==s&&(null===(i=this.formGroup.get("email"))||void 0===i||i.setValue(""))),!this.alwaysRememberEmail){const e=null!=(yield this.stateService.getRememberedEmail());null===(n=this.formGroup.get("rememberEmail"))||void 0===n||n.setValue(e)}}))}submit(e=!0){var t,i,n;return mi(this,void 0,void 0,(function*(){const s=null===(t=this.formGroup.get("email"))||void 0===t?void 0:t.value,o=null===(i=this.formGroup.get("masterPassword"))||void 0===i?void 0:i.value,r=null===(n=this.formGroup.get("rememberEmail"))||void 0===n?void 0:n.value;if(yield this.setupCaptcha(),this.formGroup.markAllAsTouched(),!this.formGroup.invalid||e)if(this.formGroup.invalid&&e){const e=this.getErrorToastMessage();this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}else try{const e=new hi(s,o,this.captchaToken,null);this.formPromise=this.authService.logIn(e);const t=yield this.formPromise;if(r||this.alwaysRememberEmail?yield this.stateService.setRememberedEmail(s):yield this.stateService.setRememberedEmail(null),this.handleCaptchaRequired(t))return;if(t.requiresTwoFactor)null!=this.onSuccessfulLoginTwoFactorNavigate?this.onSuccessfulLoginTwoFactorNavigate():this.router.navigate([this.twoFactorRoute]);else if(t.forcePasswordReset)null!=this.onSuccessfulLoginForceResetNavigate?this.onSuccessfulLoginForceResetNavigate():this.router.navigate([this.forcePasswordResetRoute]);else{const e=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!e),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute])}}catch(e){this.logService.error(e)}}))}togglePassword(){this.showPassword=!this.showPassword,this.ngZone.isStable?document.getElementById("masterPassword").focus():this.ngZone.onStable.pipe((0,Pt.q)(1)).subscribe((()=>document.getElementById("masterPassword").focus()))}launchSsoBrowser(e,t){return mi(this,void 0,void 0,(function*(){const i={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1},n=yield this.passwordGenerationService.generatePassword(i),s=yield this.passwordGenerationService.generatePassword(i),o=yield this.cryptoFunctionService.hash(s,"sha256"),r=nt.fromBufferToUrlB64(o);yield this.stateService.setSsoState(n),yield this.stateService.setSsoCodeVerifier(s);const a=this.environmentService.getWebVaultUrl();this.platformUtilsService.launchUri(a+"/#/sso?clientId="+e+"&redirectUri="+encodeURIComponent(t)+"&state="+n+"&codeChallenge="+r)}))}getErrorToastMessage(){const e=this.formValidationErrorService.getFormValidationErrors(this.formGroup.controls).shift();if(e)return"email"===e.errorName?this.i18nService.t("invalidEmail"):this.i18nService.t(this.errorTag(e))}errorTag(e){const t=e.errorName.charAt(0).toUpperCase()+e.errorName.slice(1);return`${e.controlName}${t}`}focusInput(){var e;const t=null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value;document.getElementById(null==t||""===t?"email":"masterPassword").focus()}}wi.ɵfac=function(e){return new(e||wi)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(Je),s.Y36(_e),s.Y36(Mt),s.Y36(Ye),s.Y36(Dt),s.Y36(Ft),s.Y36(Ct),s.Y36(s.R0b),s.Y36(ue.qu),s.Y36(fi))},wi.ɵdir=s.lG2({type:wi,features:[s.qOj]});class bi{}var Si=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Ui(e,t){if(1&e&&(s.TgZ(0,"p",28),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n ",s.xi3(2,1,"loggingInTo",e.selfHostedDomain),"\n ")}}const xi=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class Ai extends wi{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){super(e,t,i,n,s,o,r,a,c,u,d,h),this.platformUtilsService=i,this.i18nService=n,this.stateService=s,this.environmentService=o,this.passwordGenerationService=r,this.cryptoFunctionService=a,this.alwaysRememberEmail=!0,super.onSuccessfulLogin=()=>Si(this,void 0,void 0,(function*(){yield l.fullSync(!0)})),super.successRoute="/tabs/vault"}settings(){this.router.navigate(["environment"])}}Ai.ɵfac=function(e){return new(e||Ai)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(Je),s.Y36(_e),s.Y36(Mt),s.Y36(Ye),s.Y36(Dt),s.Y36(Ft),s.Y36(bi),s.Y36(Ct),s.Y36(s.R0b),s.Y36(ue.qu),s.Y36(fi))},Ai.ɵcmp=s.Xpm({type:Ai,selectors:[["app-login"]],features:[s.qOj],decls:88,vars:34,consts:[[3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/home"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","email"],["id","email","type","email","formControlName","email","appInputVerbatim","false"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","masterPassword"],["id","masterPassword","formControlName","masterPassword","appInputVerbatim","",1,"monospaced",3,"type"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"box-content-row",3,"hidden"],["id","hcaptcha_iframe","height","80"],["class","text-center text-muted",4,"ngIf"],[1,"text-center"],["type","button","routerLink","/hint"],[1,"text-center","text-muted"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.TgZ(34,"div",11),s._uU(35,"\n "),s.TgZ(36,"div",12),s._uU(37,"\n "),s.TgZ(38,"div",13),s._uU(39,"\n "),s.TgZ(40,"label",14),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s._UZ(44,"input",15),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n "),s.TgZ(47,"div",16),s._uU(48,"\n "),s.TgZ(49,"div",17),s._uU(50,"\n "),s.TgZ(51,"label",18),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n "),s._UZ(55,"input",19),s._uU(56,"\n "),s.qZA(),s._uU(57,"\n "),s.TgZ(58,"div",20),s._uU(59,"\n "),s.TgZ(60,"button",21),s.NdJ("click",(function(){return t.togglePassword()})),s.ALo(61,"i18n"),s._uU(62,"\n "),s._UZ(63,"i",22),s._uU(64,"\n "),s.qZA(),s._uU(65,"\n "),s.qZA(),s._uU(66,"\n "),s.qZA(),s._uU(67,"\n "),s.TgZ(68,"div",23),s._uU(69,"\n "),s._UZ(70,"iframe",24),s._uU(71,"\n "),s.qZA(),s._uU(72,"\n "),s.qZA(),s._uU(73,"\n "),s.qZA(),s._uU(74,"\n "),s.YNc(75,Ui,3,4,"p",25),s._uU(76,"\n "),s.TgZ(77,"p",26),s._uU(78,"\n "),s.TgZ(79,"button",27),s._uU(80),s.ALo(81,"i18n"),s.qZA(),s._uU(82,"\n "),s.qZA(),s._uU(83,"\n "),s._UZ(84,"app-private-mode-warning"),s._uU(85,"\n "),s.qZA(),s._uU(86,"\n"),s.qZA(),s._uU(87,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise)("formGroup",t.formGroup),s.xp6(8),s.Oqu(s.lcZ(9,17,"cancel")),s.xp6(7),s.Oqu(s.lcZ(16,19,"appName")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,21,"login")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(14),s.Oqu(s.lcZ(42,23,"emailAddress")),s.xp6(11),s.Oqu(s.lcZ(53,25,"masterPass")),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(61,27,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(31,xi,!t.showPassword,t.showPassword)),s.xp6(5),s.Q6J("hidden",!t.showCaptcha()),s.xp6(7),s.Q6J("ngIf",t.selfHostedDomain),s.xp6(5),s.Oqu(s.lcZ(81,29,"getMasterPasswordHint"))}},dependencies:[Pe.rH,u.mk,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,Ht,Ot,Xe,bt,St,ue.sg,ue.u,ei,Ze],encapsulation:2});class _i{static validateInputsDoesntMatch(e,t){return i=>{var n;return i.parent&&i.parent.controls&&(null==i?void 0:i.value)===(null===(n=null==i?void 0:i.parent)||void 0===n?void 0:n.controls)[e].value?{inputsMatchError:{message:t}}:null}}static validateInputsMatch(e,t){return i=>{var n;return i.parent&&i.parent.controls?(null==i?void 0:i.value)===(null===(n=null==i?void 0:i.parent)||void 0===n?void 0:n.controls)[e].value?null:{inputsDoesntMatchError:{message:t}}:null}}static validateFormInputsMatch(e,t,i){return n=>{const s=n.controls[e],o=n.controls[t];s.value!==o.value?o.setErrors({inputsDoesntMatchError:{message:i}}):o.setErrors(null)}}}var Zi;!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256"}(Zi||(Zi={}));const Ti=Zi.PBKDF2_SHA256,Ci=1e5;class ki{constructor(e,t){this.publicKey=e,this.encryptedPrivateKey=t}}class Oi{constructor(e,t,i,n,s,o,r,a,l){this.email=e,this.name=t,this.masterPasswordHash=i,this.key=s,this.kdf=o,this.kdfIterations=r,this.referenceData=a,this.captchaResponse=l,this.masterPasswordHint=n||null}}var Pi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ii extends yi{constructor(e,t,i,n,o,r,a,l,c,u,d,h){super(d,o,c),this.formValidationErrorService=e,this.formBuilder=t,this.authService=i,this.router=n,this.cryptoService=r,this.apiService=a,this.stateService=l,this.passwordGenerationService=u,this.logService=h,this.isInTrialFlow=!1,this.createdAccount=new s.vpe,this.showPassword=!1,this.showTerms=!0,this.showErrorSummary=!1,this.formGroup=this.formBuilder.group({email:["",[ue.kI.required,ue.kI.email]],name:[""],masterPassword:["",[ue.kI.required,ue.kI.minLength(8)]],confirmMasterPassword:["",[ue.kI.required,ue.kI.minLength(8)]],hint:[null,[_i.validateInputsDoesntMatch("masterPassword",this.i18nService.t("hintEqualsPassword"))]],acceptPolicies:[!1,[this.acceptPoliciesValidation()]]},{validator:_i.validateFormInputsMatch("masterPassword","confirmMasterPassword",this.i18nService.t("masterPassDoesntMatch"))}),this.successRoute="login",this.accountCreated=!1,this.captchaBypassToken=null,this.showTerms=!c.isSelfHost()}ngOnInit(){return Pi(this,void 0,void 0,(function*(){this.setupCaptcha()}))}submit(e=!0){var t,i,n,s;return Pi(this,void 0,void 0,(function*(){let o=null===(t=this.formGroup.get("email"))||void 0===t?void 0:t.value;o=o.trim().toLowerCase();let r=null===(i=this.formGroup.get("name"))||void 0===i?void 0:i.value;r=""===r?null:r;const a=null===(n=this.formGroup.get("masterPassword"))||void 0===n?void 0:n.value;try{if(!this.accountCreated){const t=yield this.registerAccount(yield this.buildRegisterRequest(o,a,r),e);if(!t.successful)return;this.captchaBypassToken=t.captchaBypassToken,this.accountCreated=!0}if(this.isInTrialFlow){this.accountCreated||this.platformUtilsService.showToast("success",null,this.i18nService.t("trialAccountCreated"));if((yield this.logIn(o,a,this.captchaBypassToken)).captchaRequired)return;this.createdAccount.emit(null===(s=this.formGroup.get("email"))||void 0===s?void 0:s.value)}else this.platformUtilsService.showToast("success",null,this.i18nService.t("newAccountCreated")),this.router.navigate([this.successRoute],{queryParams:{email:o}})}catch(e){this.logService.error(e)}}))}togglePassword(){this.showPassword=!this.showPassword}getStrengthResult(e){this.passwordStrengthResult=e}getPasswordScoreText(e){this.color=e.color,this.text=e.text}getErrorToastMessage(){const e=this.formValidationErrorService.getFormValidationErrors(this.formGroup.controls).shift();if(e)switch(e.errorName){case"email":return this.i18nService.t("invalidEmail");case"inputsDoesntMatchError":return this.i18nService.t("masterPassDoesntMatch");case"inputsMatchError":return this.i18nService.t("hintEqualsPassword");default:return this.i18nService.t(this.errorTag(e))}}errorTag(e){const t=e.errorName.charAt(0).toUpperCase()+e.errorName.slice(1);return`${e.controlName}${t}`}acceptPoliciesValidation(){return e=>!e.value&&this.showTerms?{required:!0}:null}validateRegistration(e){return Pi(this,void 0,void 0,(function*(){if(this.formGroup.markAllAsTouched(),this.showErrorSummary=!0,this.formGroup.get("acceptPolicies").hasError("required"))return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("acceptPoliciesRequired")),{isValid:!1};if(this.formGroup.invalid&&!e)return{isValid:!1};if(this.formGroup.invalid&&e){const e=this.getErrorToastMessage();return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e),{isValid:!1}}if(null!=this.passwordStrengthResult&&this.passwordStrengthResult.score<3){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("weakMasterPasswordDesc"),this.i18nService.t("weakMasterPassword"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return{isValid:!1}}return{isValid:!0}}))}buildRegisterRequest(e,t,i){var n;return Pi(this,void 0,void 0,(function*(){const s=null===(n=this.formGroup.get("hint"))||void 0===n?void 0:n.value,o=Ti,r=Ci,a=yield this.cryptoService.makeKey(t,e,o,r),l=yield this.cryptoService.makeEncKey(a),c=yield this.cryptoService.hashPassword(t,a),u=yield this.cryptoService.makeKeyPair(l[0]),d=new Oi(e,i,c,s,l[1].encryptedString,o,r,this.referenceData,this.captchaToken);d.keys=new ki(u[0],u[1].encryptedString);const h=yield this.stateService.getOrganizationInvitation();return null!=h&&null!=h.token&&null!=h.organizationUserId&&(d.token=h.token,d.organizationUserId=h.organizationUserId),d}))}registerAccount(e,t){return Pi(this,void 0,void 0,(function*(){if(!(yield this.validateRegistration(t)).isValid)return{successful:!1};this.formPromise=this.apiService.postRegister(e);try{return{successful:!0,captchaBypassToken:(yield this.formPromise).captchaBypassToken}}catch(e){if(this.handleCaptchaRequired(e))return{successful:!1};throw e}}))}logIn(e,t,i){return Pi(this,void 0,void 0,(function*(){const n=new hi(e,t,i,null),s=yield this.authService.logIn(n);return this.handleCaptchaRequired(s)?{captchaRequired:!0}:{captchaRequired:!1}}))}}function qi(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.hij("\n ",e.text,"\n ")}}Ii.ɵfac=function(e){return new(e||Ii)(s.Y36(fi),s.Y36(ue.QS),s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(zt),s.Y36(Tt),s.Y36(Mt),s.Y36(Je),s.Y36(Dt),s.Y36(Ye),s.Y36(Ct))},Ii.ɵdir=s.lG2({type:Ii,inputs:{isInTrialFlow:"isInTrialFlow"},outputs:{createdAccount:"createdAccount"},features:[s.qOj]});const Di=function(e){return{width:e}};class Mi{constructor(e,t){this.i18nService=e,this.passwordGenerationService=t,this.showText=!1,this.passwordStrengthResult=new s.vpe,this.passwordScoreColor=new s.vpe,this.scoreWidth=0,this.color="bg-danger"}set password(e){this.updatePasswordStrength(e)}get masterPasswordScoreColor(){switch(this.masterPasswordScore){case 4:return"success";case 3:return"primary";case 2:return"warning";default:return"danger"}}get masterPasswordScoreText(){switch(this.masterPasswordScore){case 4:return this.i18nService.t("strong");case 3:return this.i18nService.t("good");case 2:return this.i18nService.t("weak");default:return null!=this.masterPasswordScore?this.i18nService.t("weak"):null}}ngOnChanges(){this.masterPasswordStrengthTimeout=setTimeout((()=>{switch(this.scoreWidth=null==this.masterPasswordScore?0:20*(this.masterPasswordScore+1),this.masterPasswordScore){case 4:this.color="bg-success",this.text=this.i18nService.t("strong");break;case 3:this.color="bg-primary",this.text=this.i18nService.t("good");break;case 2:this.color="bg-warning",this.text=this.i18nService.t("weak");break;default:this.color="bg-danger",this.text=null!=this.masterPasswordScore?this.i18nService.t("weak"):null}this.setPasswordScoreText(this.color,this.text)}),300)}updatePasswordStrength(e){const t=e;null!=this.masterPasswordStrengthTimeout&&clearTimeout(this.masterPasswordStrengthTimeout);const i=this.passwordGenerationService.passwordStrength(t,this.getPasswordStrengthUserInput());this.passwordStrengthResult.emit(i),this.masterPasswordScore=null==i?null:i.score}getPasswordStrengthUserInput(){let e=[];const t=this.email,i=this.name,n=null==t?void 0:t.indexOf("@");return n>-1&&(e=e.concat(t.substr(0,n).trim().toLowerCase().split(/[^A-Za-z0-9]/))),null!=i&&""!==i&&(e=e.concat(i.trim().toLowerCase().split(" "))),e}setPasswordScoreText(e,t){e=e.slice(3),this.passwordScoreColor.emit({color:e,text:t})}}function Fi(e,t){if(1&e&&(s.TgZ(0,"strong"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.Gre("sub-label text-",e.color,""),s.xp6(1),s.hij("\n ",e.text,"\n ")}}function Ni(e,t){1&e&&(s.TgZ(0,"div",33),s._uU(1,"\n "),s.TgZ(2,"div",12),s._uU(3,"\n "),s.TgZ(4,"div",34),s._uU(5,"\n "),s._UZ(6,"input",35),s._uU(7,"\n "),s.TgZ(8,"label",36),s._uU(9),s.ALo(10,"i18n"),s._UZ(11,"br"),s._uU(12,"\n "),s.TgZ(13,"a",37),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,",\n "),s.TgZ(17,"a",38),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA()),2&e&&(s.xp6(9),s.hij("\n ",s.lcZ(10,3,"acceptPolicies"),""),s.xp6(5),s.Oqu(s.lcZ(15,5,"termsOfService")),s.xp6(4),s.Oqu(s.lcZ(19,7,"privacyPolicy")))}Mi.ɵfac=function(e){return new(e||Mi)(s.Y36(_e),s.Y36(Dt))},Mi.ɵcmp=s.Xpm({type:Mi,selectors:[["app-password-strength"]],inputs:{showText:"showText",email:"email",name:"name",password:"password"},outputs:{passwordStrengthResult:"passwordStrengthResult",passwordScoreColor:"passwordScoreColor"},features:[s.TTD],decls:8,vars:8,consts:[[1,"progress"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngStyle"],[4,"ngIf"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.YNc(4,qi,2,1,"ng-container",2),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n"),s.qZA(),s._uU(7,"\n")),2&e&&(s.xp6(2),s.Gre("progress-bar ",t.color,""),s.Q6J("ngStyle",s.VKq(6,Di,t.scoreWidth+"%")),s.uIk("aria-valuenow",t.scoreWidth),s.xp6(2),s.Q6J("ngIf",t.showText&&t.text))},dependencies:[u.O5,u.PC],encapsulation:2});const Li=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class Ei extends Ii{constructor(e,t,i,n,s,o,r,a,l,c,u,d){super(e,t,i,n,s,o,r,a,l,c,u,d)}}Ei.ɵfac=function(e){return new(e||Ei)(s.Y36(fi),s.Y36(ue.QS),s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(zt),s.Y36(Tt),s.Y36(Mt),s.Y36(Je),s.Y36(Dt),s.Y36(Ye),s.Y36(Ct))},Ei.ɵcmp=s.Xpm({type:Ei,selectors:[["app-register"]],features:[s.qOj],decls:129,vars:56,consts:[[3,"appApiAction","formGroup","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/home"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","email"],["id","email","type","email","formControlName","email","appInputVerbatim","false"],[1,"box-content-row-flex"],[1,"row-main"],["for","masterPassword"],[3,"class",4,"ngIf"],["id","masterPassword","formControlName","masterPassword","appInputVerbatim","",1,"monospaced",3,"type"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[3,"password","email","name","passwordStrengthResult","passwordScoreColor"],[1,"box-footer"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],["for","masterPasswordRetype"],["id","masterPasswordRetype","formControlName","confirmMasterPassword","appInputVerbatim","",1,"monospaced",3,"type"],["for","hint"],["id","hint","type","text","formControlName","hint"],["id","hcaptcha_iframe","height","80"],["class","box last",4,"ngIf"],[1,"box","last"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox","box-content-row-checkbox-left","box-content-row-word-break"],["type","checkbox","id","acceptPolicies","formControlName","acceptPolicies"],["for","acceptPolicies"],["href","https://bitwarden.com/terms/","target","_blank","rel","noopener"],["href","https://bitwarden.com/privacy/","target","_blank","rel","noopener"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.TgZ(34,"div",11),s._uU(35,"\n "),s.TgZ(36,"div",12),s._uU(37,"\n "),s.TgZ(38,"div",13),s._uU(39,"\n "),s.TgZ(40,"label",14),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s._UZ(44,"input",15),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n "),s.TgZ(47,"div",13),s._uU(48,"\n "),s.TgZ(49,"div",16),s._uU(50,"\n "),s.TgZ(51,"div",17),s._uU(52,"\n "),s.TgZ(53,"label",18),s._uU(54),s.ALo(55,"i18n"),s.YNc(56,Fi,2,4,"strong",19),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s._UZ(59,"input",20),s._uU(60,"\n "),s.qZA(),s._uU(61,"\n "),s.TgZ(62,"div",21),s._uU(63,"\n "),s.TgZ(64,"button",22),s.NdJ("click",(function(){return t.togglePassword()})),s.ALo(65,"i18n"),s._uU(66,"\n "),s._UZ(67,"i",23),s._uU(68,"\n "),s.qZA(),s._uU(69,"\n "),s.qZA(),s._uU(70,"\n "),s.qZA(),s._uU(71,"\n "),s.TgZ(72,"app-password-strength",24),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)}))("passwordScoreColor",(function(e){return t.getPasswordScoreText(e)})),s._uU(73,"\n "),s.qZA(),s._uU(74,"\n "),s.qZA(),s._uU(75,"\n "),s.qZA(),s._uU(76,"\n "),s.TgZ(77,"div",25),s._uU(78),s.ALo(79,"i18n"),s.qZA(),s._uU(80,"\n "),s.qZA(),s._uU(81,"\n "),s.TgZ(82,"div",11),s._uU(83,"\n "),s.TgZ(84,"div",12),s._uU(85,"\n "),s.TgZ(86,"div",26),s._uU(87,"\n "),s.TgZ(88,"div",17),s._uU(89,"\n "),s.TgZ(90,"label",27),s._uU(91),s.ALo(92,"i18n"),s.qZA(),s._uU(93,"\n "),s._UZ(94,"input",28),s._uU(95,"\n "),s.qZA(),s._uU(96,"\n "),s.TgZ(97,"div",21),s._uU(98,"\n "),s.TgZ(99,"button",22),s.NdJ("click",(function(){return t.togglePassword()})),s.ALo(100,"i18n"),s._uU(101,"\n "),s._UZ(102,"i",23),s._uU(103,"\n "),s.qZA(),s._uU(104,"\n "),s.qZA(),s._uU(105,"\n "),s.qZA(),s._uU(106,"\n "),s.TgZ(107,"div",13),s._uU(108,"\n "),s.TgZ(109,"label",29),s._uU(110),s.ALo(111,"i18n"),s.qZA(),s._uU(112,"\n "),s._UZ(113,"input",30),s._uU(114,"\n "),s.qZA(),s._uU(115,"\n "),s.qZA(),s._uU(116,"\n "),s.TgZ(117,"div",25),s._uU(118),s.ALo(119,"i18n"),s.qZA(),s._uU(120,"\n "),s.qZA(),s._uU(121,"\n "),s.TgZ(122,"div",8),s._UZ(123,"iframe",31),s.qZA(),s._uU(124,"\n "),s.YNc(125,Ni,24,9,"div",32),s._uU(126,"\n "),s.qZA(),s._uU(127,"\n"),s.qZA(),s._uU(128,"\n")),2&e){const e=s.MAs(1);let i,n,o;s.Q6J("appApiAction",t.formPromise)("formGroup",t.formGroup),s.xp6(8),s.Oqu(s.lcZ(9,28,"cancel")),s.xp6(7),s.Oqu(s.lcZ(16,30,"createAccount")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,32,"submit")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(14),s.Oqu(s.lcZ(42,34,"emailAddress")),s.xp6(13),s.hij("\n ",s.lcZ(55,36,"masterPass"),"\n "),s.xp6(2),s.Q6J("ngIf",t.text),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(65,38,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(50,Li,!t.showPassword,t.showPassword)),s.xp6(5),s.Q6J("password",null==(i=t.formGroup.get("masterPassword"))?null:i.value)("email",null==(n=t.formGroup.get("email"))?null:n.value)("name",null==(o=t.formGroup.get("name"))?null:o.value),s.xp6(6),s.hij("\n ",s.lcZ(79,40,"masterPassDesc"),"\n "),s.xp6(13),s.Oqu(s.lcZ(92,42,"reTypeMasterPass")),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(100,44,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(53,Li,!t.showPassword,t.showPassword)),s.xp6(8),s.Oqu(s.lcZ(111,46,"masterPassHint")),s.xp6(8),s.hij("\n ",s.lcZ(119,48,"masterPassHintDesc"),"\n "),s.xp6(4),s.Q6J("hidden",!t.showCaptcha()),s.xp6(3),s.Q6J("ngIf",t.showTerms)}},dependencies:[Pe.rH,u.mk,u.O5,ue._Y,ue.Fj,ue.Wl,ue.JJ,ue.JL,Ht,Ot,Xe,bt,St,Mi,ue.sg,ue.u,Ze],encapsulation:2});class Ri{}var Ji=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Yi{constructor(e,t,i,n,s,o,r,a){this.router=e,this.stateService=t,this.apiService=i,this.syncService=n,this.platformUtilsService=s,this.i18nService=o,this.keyConnectorService=r,this.organizationApiService=a,this.continuing=!1,this.leaving=!1,this.loading=!0}ngOnInit(){return Ji(this,void 0,void 0,(function*(){this.organization=yield this.keyConnectorService.getManagingOrganization(),this.email=yield this.stateService.getEmail(),yield this.syncService.fullSync(!1),this.loading=!1}))}convert(){return Ji(this,void 0,void 0,(function*(){this.continuing=!0,this.actionPromise=this.keyConnectorService.migrateUser();try{yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("removedMasterPassword")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e.message)}}))}leave(){return Ji(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("leaveOrganizationConfirmation"),this.organization.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.leaving=!0,this.actionPromise=this.organizationApiService.leave(this.organization.id).then((()=>this.syncService.fullSync(!0))),yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("leftOrganization")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}}))}}function zi(e,t){1&e&&(s._UZ(0,"i",12),s.ALo(1,"i18n")),2&e&&s.s9C("title",s.lcZ(1,1,"loading"))}function Ki(e,t){1&e&&(s._UZ(0,"i",12),s.ALo(1,"i18n")),2&e&&s.s9C("title",s.lcZ(1,1,"loading"))}Yi.ɵfac=function(e){return new(e||Yi)(s.Y36(Pe.F0),s.Y36(Mt),s.Y36(Tt),s.Y36(bi),s.Y36(Je),s.Y36(_e),s.Y36(De),s.Y36(Ri))},Yi.ɵdir=s.lG2({type:Yi});class Bi extends Yi{}Bi.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(Bi)))(t||Bi)}}(),Bi.ɵcmp=s.Xpm({type:Bi,selectors:[["app-remove-password"]],features:[s.qOj],decls:48,vars:17,consts:[[1,"left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],[1,"box-content-row"],["type","button",1,"btn","block","primary",3,"disabled","click"],["class","bwi bwi-spinner bwi-spin","aria-hidden","true",3,"title",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","block",3,"disabled","click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s._UZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"div",1),s._uU(5,"\n "),s.TgZ(6,"span",2),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s._UZ(11,"div",3),s._uU(12,"\n"),s.qZA(),s._uU(13,"\n\n"),s.TgZ(14,"main",4),s._uU(15,"\n "),s.TgZ(16,"div",5),s._uU(17,"\n "),s.TgZ(18,"div",6),s._uU(19,"\n "),s.TgZ(20,"div",7),s._uU(21,"\n "),s.TgZ(22,"p"),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.TgZ(29,"button",9),s.NdJ("click",(function(){return t.convert()})),s._uU(30,"\n "),s.YNc(31,zi,2,3,"i",10),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"div",8),s._uU(37,"\n "),s.TgZ(38,"button",11),s.NdJ("click",(function(){return t.leave()})),s._uU(39,"\n "),s.YNc(40,Ki,2,3,"i",10),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.qZA(),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n"),s.qZA(),s._uU(47,"\n")),2&e&&(s.xp6(7),s.Oqu(s.lcZ(8,8,"removeMasterPassword")),s.xp6(16),s.Oqu(s.xi3(24,10,"convertOrganizationEncryptionDesc",t.organization.name)),s.xp6(6),s.Q6J("disabled",t.actionPromise),s.xp6(2),s.Q6J("ngIf",t.continuing),s.xp6(1),s.hij("\n ",s.lcZ(33,13,"removeMasterPassword"),"\n "),s.xp6(6),s.Q6J("disabled",t.actionPromise),s.xp6(2),s.Q6J("ngIf",t.leaving),s.xp6(1),s.hij("\n ",s.lcZ(42,15,"leaveOrganization"),"\n "))},dependencies:[u.O5,Xe,Ze],encapsulation:2});var Gi=i(94824);class Qi extends Yt{}class Vi{constructor(e,t,i,n,s,o,r){this.masterPasswordHash=e,this.key=t,this.masterPasswordHint=i,this.kdf=n,this.kdfIterations=s,this.orgIdentifier=o,this.keys=r}}class Hi{}var ji=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wi{constructor(e,t,i,n,s,o,r){this.i18nService=e,this.cryptoService=t,this.messagingService=i,this.passwordGenerationService=n,this.platformUtilsService=s,this.policyService=o,this.stateService=r}ngOnInit(){var e;return ji(this,void 0,void 0,(function*(){this.email=yield this.stateService.getEmail(),null!==(e=this.enforcedPolicyOptions)&&void 0!==e||(this.enforcedPolicyOptions=yield this.policyService.getMasterPasswordPolicyOptions())}))}submit(){return ji(this,void 0,void 0,(function*(){if(!(yield this.strongPassword()))return;if(!(yield this.setupSubmitActions()))return;const e=yield this.stateService.getEmail();null==this.kdf&&(this.kdf=yield this.stateService.getKdfType()),null==this.kdfIterations&&(this.kdfIterations=yield this.stateService.getKdfIterations());const t=yield this.cryptoService.makeKey(this.masterPassword,e.trim().toLowerCase(),this.kdf,this.kdfIterations),i=yield this.cryptoService.hashPassword(this.masterPassword,t);let n=null;n=null==(yield this.cryptoService.getEncKey())?yield this.cryptoService.makeEncKey(t):yield this.cryptoService.remakeEncKey(t),yield this.performSubmitActions(i,t,n)}))}setupSubmitActions(){return ji(this,void 0,void 0,(function*(){return!0}))}performSubmitActions(e,t,i){return ji(this,void 0,void 0,(function*(){}))}strongPassword(){return ji(this,void 0,void 0,(function*(){if(null==this.masterPassword||""===this.masterPassword)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordRequired")),!1;if(this.masterPassword.length<8)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordMinlength")),!1;if(this.masterPassword!==this.masterPasswordRetype)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassDoesntMatch")),!1;const e=this.passwordStrengthResult;if(null!=this.enforcedPolicyOptions&&!this.policyService.evaluateMasterPassword(e.score,this.masterPassword,this.enforcedPolicyOptions))return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordPolicyRequirementsNotMet")),!1;if(null!=e&&e.score<3){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("weakMasterPasswordDesc"),this.i18nService.t("weakMasterPassword"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1}return!0}))}logOut(){return ji(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("logOutConfirmation"),this.i18nService.t("logOut"),this.i18nService.t("logOut"),this.i18nService.t("cancel")))&&this.messagingService.send("logout")}))}getStrengthResult(e){this.passwordStrengthResult=e}getPasswordScoreText(e){this.color=e.color,this.text=e.text}}Wi.ɵfac=function(e){return new(e||Wi)(s.Y36(_e),s.Y36(zt),s.Y36(qe),s.Y36(Dt),s.Y36(Je),s.Y36(Hi),s.Y36(Mt))},Wi.ɵdir=s.lG2({type:Wi});class $i{}var Xi=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class en extends Wi{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){super(e,t,i,n,s,r,d),this.policyApiService=o,this.router=a,this.apiService=l,this.syncService=c,this.route=u,this.organizationApiService=h,this.syncLoading=!0,this.showPassword=!1,this.hint="",this.identifier=null,this.resetPasswordAutoEnroll=!1,this.successRoute="vault"}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Xi(this,void 0,void 0,(function*(){if(yield this.syncService.fullSync(!0),this.syncLoading=!1,this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>Xi(this,void 0,void 0,(function*(){null!=e.identifier&&(this.identifier=e.identifier)})))),null!=this.identifier)try{const e=yield this.organizationApiService.getAutoEnrollStatus(this.identifier);this.orgId=e.id,this.resetPasswordAutoEnroll=e.resetPasswordEnabled,this.enforcedPolicyOptions=yield this.policyApiService.getMasterPasswordPoliciesForInvitedUsers(this.orgId)}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}e.ngOnInit.call(this)}))}setupSubmitActions(){return Xi(this,void 0,void 0,(function*(){return this.kdf=Ti,this.kdfIterations=Ci,!0}))}performSubmitActions(e,t,i){return Xi(this,void 0,void 0,(function*(){const n=yield this.cryptoService.makeKeyPair(i[0]),s=new Vi(e,i[1].encryptedString,this.hint,this.kdf,this.kdfIterations,this.identifier,new ki(n[0],n[1].encryptedString));try{this.resetPasswordAutoEnroll?this.formPromise=this.apiService.setPassword(s).then((()=>Xi(this,void 0,void 0,(function*(){return yield this.onSetPasswordSuccess(t,i,n),this.organizationApiService.getKeys(this.orgId)})))).then((t=>Xi(this,void 0,void 0,(function*(){if(null==t)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const i=yield this.stateService.getUserId(),n=nt.fromB64ToArray(t.publicKey),s=yield this.cryptoService.getEncKey(),o=yield this.cryptoService.rsaEncrypt(s.key,n.buffer),r=new Qi;return r.masterPasswordHash=e,r.resetPasswordKey=o.encryptedString,this.apiService.putOrganizationUserResetPasswordEnrollment(this.orgId,i,r)})))):this.formPromise=this.apiService.setPassword(s).then((()=>Xi(this,void 0,void 0,(function*(){yield this.onSetPasswordSuccess(t,i,n)})))),yield this.formPromise,null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.router.navigate([this.successRoute])}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}}))}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}onSetPasswordSuccess(e,t,i){return Xi(this,void 0,void 0,(function*(){yield this.stateService.setKdfType(this.kdf),yield this.stateService.setKdfIterations(this.kdfIterations),yield this.cryptoService.setKey(e),yield this.cryptoService.setEncKey(t[1].encryptedString),yield this.cryptoService.setEncPrivateKey(i[1].encryptedString);const n=yield this.cryptoService.hashPassword(this.masterPassword,e,Et.LocalAuthorization);yield this.cryptoService.setKeyHash(n)}))}}function tn(e,t){1&e&&(s.TgZ(0,"div",13),s._uU(1,"\n "),s._UZ(2,"i",14),s._uU(3,"\n "),s.qZA())}function nn(e,t){1&e&&(s.TgZ(0,"app-callout",36),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"resetPasswordPolicyAutoEnroll")),s.xp6(2),s.hij("\n ",s.lcZ(3,4,"resetPasswordAutoEnrollInviteWarning"),"\n "))}function sn(e,t){if(1&e&&(s.TgZ(0,"app-callout",37),s._uU(1,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.Q6J("enforcedPolicyOptions",e.enforcedPolicyOptions)}}function on(e,t){if(1&e&&(s.TgZ(0,"strong"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.Gre("sub-label text-",null==e.passwordStrengthComponent?null:e.passwordStrengthComponent.masterPasswordScoreColor,""),s.xp6(1),s.hij("\n ",null==e.passwordStrengthComponent?null:e.passwordStrengthComponent.masterPasswordScoreText,"\n ")}}en.ɵfac=function(e){return new(e||en)(s.Y36(_e),s.Y36(zt),s.Y36(qe),s.Y36(Dt),s.Y36(Je),s.Y36($i),s.Y36(Hi),s.Y36(Pe.F0),s.Y36(Tt),s.Y36(bi),s.Y36(Pe.gz),s.Y36(Mt),s.Y36(Ri))},en.ɵdir=s.lG2({type:en,features:[s.qOj]});const rn=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function an(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"div",15),s._uU(3,"\n "),s.TgZ(4,"app-callout",16),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.YNc(8,nn,4,6,"app-callout",17),s._uU(9,"\n "),s.YNc(10,sn,2,1,"app-callout",18),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",15),s._uU(14,"\n "),s.TgZ(15,"div",19),s._uU(16,"\n "),s.TgZ(17,"div",20),s._uU(18,"\n "),s.TgZ(19,"div",21),s._uU(20,"\n "),s.TgZ(21,"div",22),s._uU(22,"\n "),s.TgZ(23,"label",23),s._uU(24),s.ALo(25,"i18n"),s.YNc(26,on,2,4,"strong",24),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.TgZ(29,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.masterPassword=t)})),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"div",26),s._uU(33,"\n "),s.TgZ(34,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.togglePassword(!1))})),s.ALo(35,"i18n"),s._uU(36,"\n "),s._UZ(37,"i",28),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.qZA(),s._uU(41,"\n\n "),s.TgZ(42,"app-password-strength",29),s.NdJ("passwordStrengthResult",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.getStrengthResult(t))}))("passwordScoreColor",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.getPasswordScoreText(t))})),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.qZA(),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n "),s.TgZ(47,"div",30),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n "),s.qZA(),s._uU(51,"\n "),s.TgZ(52,"div",15),s._uU(53,"\n "),s.TgZ(54,"div",19),s._uU(55,"\n "),s.TgZ(56,"div",20),s._uU(57,"\n "),s.TgZ(58,"div",21),s._uU(59,"\n "),s.TgZ(60,"div",22),s._uU(61,"\n "),s.TgZ(62,"label",31),s._uU(63),s.ALo(64,"i18n"),s.qZA(),s._uU(65,"\n "),s.TgZ(66,"input",32),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.masterPasswordRetype=t)})),s.qZA(),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.TgZ(69,"div",26),s._uU(70,"\n "),s.TgZ(71,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.togglePassword(!0))})),s.ALo(72,"i18n"),s._uU(73,"\n "),s._UZ(74,"i",28),s._uU(75,"\n "),s.qZA(),s._uU(76,"\n "),s.qZA(),s._uU(77,"\n "),s.qZA(),s._uU(78,"\n "),s.qZA(),s._uU(79,"\n "),s.qZA(),s._uU(80,"\n "),s.qZA(),s._uU(81,"\n "),s.TgZ(82,"div",33),s._uU(83,"\n "),s.TgZ(84,"div",19),s._uU(85,"\n "),s.TgZ(86,"div",20),s._uU(87,"\n "),s.TgZ(88,"label",34),s._uU(89),s.ALo(90,"i18n"),s.qZA(),s._uU(91,"\n "),s.TgZ(92,"input",35),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.hint=t)})),s.qZA(),s._uU(93,"\n "),s.qZA(),s._uU(94,"\n "),s.qZA(),s._uU(95,"\n "),s.TgZ(96,"div",30),s._uU(97),s.ALo(98,"i18n"),s.qZA(),s._uU(99,"\n "),s.qZA(),s._uU(100,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,21,"ssoCompleteRegistration")),s.xp6(3),s.Q6J("ngIf",e.resetPasswordAutoEnroll),s.xp6(2),s.Q6J("ngIf",e.enforcedPolicyOptions),s.xp6(14),s.hij("",s.lcZ(25,23,"masterPass"),"\n "),s.xp6(2),s.Q6J("ngIf",null==e.passwordStrengthComponent?null:e.passwordStrengthComponent.masterPasswordScoreText),s.xp6(3),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.masterPassword),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(35,25,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(37,rn,!e.showPassword,e.showPassword)),s.xp6(5),s.Q6J("password",e.masterPassword)("email",e.email),s.xp6(6),s.hij("\n ",s.lcZ(49,27,"masterPassDesc"),"\n "),s.xp6(15),s.Oqu(s.lcZ(64,29,"reTypeMasterPass")),s.xp6(3),s.Q6J("ngModel",e.masterPasswordRetype),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(72,31,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(40,rn,!e.showPassword,e.showPassword)),s.xp6(15),s.Oqu(s.lcZ(90,33,"masterPassHint")),s.xp6(3),s.Q6J("ngModel",e.hint),s.xp6(5),s.hij("\n ",s.lcZ(98,35,"masterPassHintDesc"),"\n ")}}class ln extends en{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){super(t,i,n,o,r,a,l,c,e,u,d,s,h)}}ln.ɵfac=function(e){return new(e||ln)(s.Y36(Tt),s.Y36(_e),s.Y36(zt),s.Y36(qe),s.Y36(Mt),s.Y36(Dt),s.Y36(Je),s.Y36($i),s.Y36(Hi),s.Y36(Pe.F0),s.Y36(bi),s.Y36(Pe.gz),s.Y36(Ri))},ln.ɵcmp=s.Xpm({type:ln,selectors:[["app-set-password"]],features:[s.qOj],decls:40,vars:15,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/home"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],["class","full-loading-spinner",4,"ngIf"],[4,"ngIf"],[1,"full-loading-spinner"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[1,"box"],["type","tip"],["type","warning",3,"title",4,"ngIf"],["type","info",3,"enforcedPolicyOptions",4,"ngIf"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],[1,"box-content-row-flex"],[1,"row-main"],["for","masterPassword"],[3,"class",4,"ngIf"],["id","masterPassword","name","MasterPassword","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[3,"password","email","passwordStrengthResult","passwordScoreColor"],[1,"box-footer"],["for","masterPasswordRetype"],["id","masterPasswordRetype","type","password","name","MasterPasswordRetype","required","","appInputVerbatim","","autocomplete","new-password",1,"monospaced",3,"ngModel","ngModelChange"],[1,"box","last"],["for","hint"],["id","hint","type","text","name","Hint",3,"ngModel","ngModelChange"],["type","warning",3,"title"],["type","info",3,"enforcedPolicyOptions"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.YNc(34,tn,4,0,"div",11),s._uU(35,"\n "),s.YNc(36,an,101,43,"div",12),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,9,"cancel")),s.xp6(7),s.Oqu(s.lcZ(16,11,"setMasterPassword")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,13,"submit")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(7),s.Q6J("ngIf",t.syncLoading),s.xp6(2),s.Q6J("ngIf",!t.syncLoading)}},dependencies:[Pe.rH,u.mk,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ht,Ot,Xe,wt,bt,St,Mi,Ze],encapsulation:2});var cn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class un{constructor(e,t,i,n,s,o,r,a,l,c,u){this.authService=e,this.router=t,this.i18nService=i,this.route=n,this.stateService=s,this.platformUtilsService=o,this.apiService=r,this.cryptoFunctionService=a,this.environmentService=l,this.passwordGenerationService=c,this.logService=u,this.loggingIn=!1,this.twoFactorRoute="2fa",this.successRoute="lock",this.changePasswordRoute="set-password",this.forcePasswordResetRoute="update-temp-password"}ngOnInit(){return cn(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>cn(this,void 0,void 0,(function*(){if(null!=e.code&&null!=e.state){const t=yield this.stateService.getSsoCodeVerifier(),i=yield this.stateService.getSsoState();yield this.stateService.setSsoCodeVerifier(null),yield this.stateService.setSsoState(null),null!=e.code&&null!=t&&null!=i&&this.checkState(i,e.state)&&(yield this.logIn(e.code,t,this.getOrgIdentifierFromState(e.state)))}else null!=e.clientId&&null!=e.redirectUri&&null!=e.state&&null!=e.codeChallenge&&(this.redirectUri=e.redirectUri,this.state=e.state,this.codeChallenge=e.codeChallenge,this.clientId=e.clientId)}))))}))}submit(e,t){return cn(this,void 0,void 0,(function*(){if(null==this.identifier||""===this.identifier)return void this.platformUtilsService.showToast("error",this.i18nService.t("ssoValidationFailed"),this.i18nService.t("ssoIdentifierRequired"));this.initiateSsoFormPromise=this.apiService.preValidateSso(this.identifier);const i=yield this.initiateSsoFormPromise,n=yield this.buildAuthorizeUrl(e,t,i.token);this.platformUtilsService.launchUri(n,{sameWindow:!0})}))}buildAuthorizeUrl(e,t,i){return cn(this,void 0,void 0,(function*(){let n=this.codeChallenge,s=this.state;const o={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};if(null==n){const e=yield this.passwordGenerationService.generatePassword(o),t=yield this.cryptoFunctionService.hash(e,"sha256");n=nt.fromBufferToUrlB64(t),yield this.stateService.setSsoCodeVerifier(e)}null==s&&(s=yield this.passwordGenerationService.generatePassword(o),e&&(s+=`_returnUri='${e}'`)),s+=`_identifier=${this.identifier}`,yield this.stateService.setSsoState(s);let r=this.environmentService.getIdentityUrl()+"/connect/authorize?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&scope=api offline_access&state="+s+"&code_challenge="+n+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(this.identifier)+"&ssoToken="+encodeURIComponent(i);if(t){const e=yield this.apiService.getSsoUserIdentifier();r+=`&user_identifier=${encodeURIComponent(e)}`}return r}))}logIn(e,t,i){return cn(this,void 0,void 0,(function*(){this.loggingIn=!0;try{const n=new pi(e,t,this.redirectUri,i);this.formPromise=this.authService.logIn(n);const s=yield this.formPromise;if(s.requiresTwoFactor)null!=this.onSuccessfulLoginTwoFactorNavigate?this.onSuccessfulLoginTwoFactorNavigate():this.router.navigate([this.twoFactorRoute],{queryParams:{identifier:i,sso:"true"}});else if(s.resetMasterPassword)null!=this.onSuccessfulLoginChangePasswordNavigate?this.onSuccessfulLoginChangePasswordNavigate():this.router.navigate([this.changePasswordRoute],{queryParams:{identifier:i}});else if(s.forcePasswordReset)null!=this.onSuccessfulLoginForceResetNavigate?this.onSuccessfulLoginForceResetNavigate():this.router.navigate([this.forcePasswordResetRoute]);else{const e=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!e),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute])}}catch(e){this.logService.error(e),"Key Connector error"===e.message&&this.platformUtilsService.showToast("error",null,this.i18nService.t("ssoKeyConnectorError"))}this.loggingIn=!1}))}getOrgIdentifierFromState(e){if(null==e)return null;const t=e.split("_identifier=");return t.length>1?t[1]:null}checkState(e,t){if(null==e)return!1;if(null==t)return!1;const i=e.split("_identifier="),n=t.split("_identifier=");return i[0]===n[0]}}un.ɵfac=function(e){return new(e||un)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Pe.gz),s.Y36(Mt),s.Y36(Je),s.Y36(Tt),s.Y36(Ft),s.Y36(Ye),s.Y36(Dt),s.Y36(Ct))},un.ɵdir=s.lG2({type:un});var dn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hn extends un{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){super(e,t,i,n,s,o,r,a,u,l,d),this.vaultTimeoutService=h;const p=this.environmentService.getWebVaultUrl();this.redirectUri=p+"/sso-connector.html",this.clientId="browser",super.onSuccessfulLogin=()=>dn(this,void 0,void 0,(function*(){yield c.fullSync(!0),(yield this.authService.getAuthStatus())!==Oe.Unlocked&&Wt.reloadOpenWindows();window.open("","_self").close()}))}}hn.ɵfac=function(e){return new(e||hn)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Pe.gz),s.Y36(Mt),s.Y36(Je),s.Y36(Tt),s.Y36(Ft),s.Y36(Dt),s.Y36(bi),s.Y36(Ye),s.Y36(Ct),s.Y36(Kt))},hn.ɵcmp=s.Xpm({type:hn,selectors:[["app-sso"]],features:[s.qOj],decls:0,vars:0,template:function(e,t){},encapsulation:2});class pn{}class gn{constructor(e,t,i,n,o){this.twoFactorService=e,this.router=t,this.i18nService=i,this.platformUtilsService=n,this.win=o,this.onProviderSelected=new s.vpe,this.onRecoverSelected=new s.vpe,this.providers=[]}ngOnInit(){this.providers=this.twoFactorService.getSupportedProviders(this.win)}choose(e){this.onProviderSelected.emit(e.type)}recover(){this.platformUtilsService.launchUri("https://bitwarden.com/help/lost-two-step-device/"),this.onRecoverSelected.emit()}}function vn(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",9),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw();return s.KtG(i.choose(t))})),s._uU(1,"\n "),s.TgZ(2,"span",10),s._uU(3),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"span",11),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(3),s.Oqu(e.name),s.xp6(3),s.Oqu(e.description)}}gn.ɵfac=function(e){return new(e||gn)(s.Y36(pn),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Je),s.Y36(Window))},gn.ɵdir=s.lG2({type:gn,outputs:{onProviderSelected:"onProviderSelected",onRecoverSelected:"onRecoverSelected"}});class yn extends gn{constructor(e,t,i,n){super(e,t,i,n,window)}choose(e){super.choose(e),this.twoFactorService.setSelectedProvider(e.type),this.router.navigate(["2fa"])}}yn.ɵfac=function(e){return new(e||yn)(s.Y36(pn),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Je))},yn.ɵcmp=s.Xpm({type:yn,selectors:[["app-two-factor-options"]],features:[s.qOj],decls:41,vars:13,consts:[[1,"left"],["type","button","routerLink","/2fa"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"box"],[1,"box-content"],["type","button","appStopClick","","class","box-content-row",3,"click",4,"ngFor","ngForOf"],["type","button","appStopClick","",1,"box-content-row",3,"click"],[1,"text"],[1,"detail"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"h1",2),s._uU(10,"\n "),s.TgZ(11,"span",3),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s._UZ(16,"div",4),s._uU(17,"\n"),s.qZA(),s._uU(18,"\n"),s.TgZ(19,"main",5),s._uU(20,"\n "),s.TgZ(21,"div",6),s._uU(22,"\n "),s.TgZ(23,"div",7),s._uU(24,"\n "),s.YNc(25,vn,8,2,"button",8),s._uU(26,"\n "),s.TgZ(27,"button",9),s.NdJ("click",(function(){return t.recover()})),s._uU(28,"\n "),s.TgZ(29,"span",10),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n "),s.TgZ(33,"span",11),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n"),s.qZA(),s._uU(40,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,5,"close")),s.xp6(7),s.Oqu(s.lcZ(13,7,"twoStepOptions")),s.xp6(13),s.Q6J("ngForOf",t.providers),s.xp6(5),s.Oqu(s.lcZ(31,9,"recoveryCodeTitle")),s.xp6(4),s.Oqu(s.lcZ(35,11,"recoveryCodeDesc")))},dependencies:[Pe.rH,u.sg,St,Ze],encapsulation:2});var fn,mn=i(86309);!function(e){e[e.Authenticator=0]="Authenticator",e[e.Email=1]="Email",e[e.Duo=2]="Duo",e[e.Yubikey=3]="Yubikey",e[e.U2f=4]="U2f",e[e.Remember=5]="Remember",e[e.OrganizationDuo=6]="OrganizationDuo",e[e.WebAuthn=7]="WebAuthn"}(fn||(fn={}));class wn{constructor(e,t,i,n,s,o,r,a){this.win=e,this.webVaultUrl=t,this.webAuthnNewTab=i,this.platformUtilsService=n,this.i18nService=s,this.successCallback=o,this.errorCallback=r,this.infoCallback=a,this.iframe=null,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}init(e){const t=new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),btnText:encodeURIComponent(this.i18nService.t("webAuthnAuthenticate")),v:"1"});this.webAuthnNewTab?(t.append("locale",this.i18nService.translationLocale),this.platformUtilsService.launchUri(`${this.webVaultUrl}/webauthn-fallback-connector.html?${t}`)):(this.connectorLink.href=`${this.webVaultUrl}/webauthn-connector.html?${t}`,this.iframe=this.win.document.getElementById("webauthn_iframe"),this.iframe.allow="publickey-credentials-get "+new URL(this.webVaultUrl).origin,this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1))}stop(){this.sendMessage("stop")}start(){this.sendMessage("start")}sendMessage(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)}base64Encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode("0x"+t))))}cleanup(){this.win.removeEventListener("message",this.parseFunction,!1)}parseMessage(e){if(!this.validMessage(e))return;const t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}validMessage(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))}}class bn{constructor(e=null,t=null,i=!1){this.provider=e,this.token=t,this.remember=i}}class Sn extends Yt{}const Un={[fn.Authenticator]:{type:fn.Authenticator,name:null,description:null,priority:1,sort:1,premium:!1},[fn.Yubikey]:{type:fn.Yubikey,name:null,description:null,priority:3,sort:2,premium:!0},[fn.Duo]:{type:fn.Duo,name:"Duo",description:null,priority:2,sort:3,premium:!0},[fn.OrganizationDuo]:{type:fn.OrganizationDuo,name:"Duo (Organization)",description:null,priority:10,sort:4,premium:!1},[fn.Email]:{type:fn.Email,name:null,description:null,priority:0,sort:6,premium:!1},[fn.WebAuthn]:{type:fn.WebAuthn,name:null,description:null,priority:4,sort:5,premium:!0}};class xn{constructor(e,t){this.i18nService=e,this.platformUtilsService=t,this.selectedTwoFactorProviderType=null}init(){Un[fn.Email].name=this.i18nService.t("emailTitle"),Un[fn.Email].description=this.i18nService.t("emailDesc"),Un[fn.Authenticator].name=this.i18nService.t("authenticatorAppTitle"),Un[fn.Authenticator].description=this.i18nService.t("authenticatorAppDesc"),Un[fn.Duo].description=this.i18nService.t("duoDesc"),Un[fn.OrganizationDuo].name="Duo ("+this.i18nService.t("organization")+")",Un[fn.OrganizationDuo].description=this.i18nService.t("duoOrganizationDesc"),Un[fn.WebAuthn].name=this.i18nService.t("webAuthnTitle"),Un[fn.WebAuthn].description=this.i18nService.t("webAuthnDesc"),Un[fn.Yubikey].name=this.i18nService.t("yubiKeyTitle"),Un[fn.Yubikey].description=this.i18nService.t("yubiKeyDesc")}getSupportedProviders(e){const t=[];return null==this.twoFactorProvidersData||(this.twoFactorProvidersData.has(fn.OrganizationDuo)&&this.platformUtilsService.supportsDuo()&&t.push(Un[fn.OrganizationDuo]),this.twoFactorProvidersData.has(fn.Authenticator)&&t.push(Un[fn.Authenticator]),this.twoFactorProvidersData.has(fn.Yubikey)&&t.push(Un[fn.Yubikey]),this.twoFactorProvidersData.has(fn.Duo)&&this.platformUtilsService.supportsDuo()&&t.push(Un[fn.Duo]),this.twoFactorProvidersData.has(fn.WebAuthn)&&this.platformUtilsService.supportsWebAuthn(e)&&t.push(Un[fn.WebAuthn]),this.twoFactorProvidersData.has(fn.Email)&&t.push(Un[fn.Email])),t}getDefaultProvider(e){if(null==this.twoFactorProvidersData)return null;if(null!=this.selectedTwoFactorProviderType&&this.twoFactorProvidersData.has(this.selectedTwoFactorProviderType))return this.selectedTwoFactorProviderType;let t=null,i=-1;return this.twoFactorProvidersData.forEach(((n,s)=>{const o=Un[s];if(null!=o&&o.priority>i){if(s===fn.WebAuthn&&!e)return;t=s,i=o.priority}})),t}setSelectedProvider(e){this.selectedTwoFactorProviderType=e}clearSelectedProvider(){this.selectedTwoFactorProviderType=null}setProviders(e){this.twoFactorProvidersData=e.twoFactorProviders2}clearProviders(){this.twoFactorProvidersData=null}getProviders(){return this.twoFactorProvidersData}}class An{}var _n=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Zn extends yi{constructor(e,t,i,n,s,o,r,a,l,c,u,d){super(r,i,s),this.authService=e,this.router=t,this.i18nService=i,this.apiService=n,this.platformUtilsService=s,this.win=o,this.environmentService=r,this.stateService=a,this.route=l,this.logService=c,this.twoFactorService=u,this.appIdService=d,this.token="",this.remember=!1,this.webAuthnReady=!1,this.webAuthnNewTab=!1,this.providers=Un,this.providerType=fn,this.selectedProviderType=fn.Authenticator,this.webAuthnSupported=!1,this.webAuthn=null,this.title="",this.twoFactorEmail=null,this.identifier=null,this.loginRoute="login",this.successRoute="vault",this.webAuthnSupported=this.platformUtilsService.supportsWebAuthn(o)}get webAuthnAllow(){return`publickey-credentials-get ${this.environmentService.getWebVaultUrl()}`}ngOnInit(){return _n(this,void 0,void 0,(function*(){if(this.authing&&null!=this.twoFactorService.getProviders()){if(this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>{null!=e.identifier&&(this.identifier=e.identifier)})),this.needsLock&&(this.successRoute="lock"),null!=this.win&&this.webAuthnSupported){const e=this.environmentService.getWebVaultUrl();this.webAuthn=new wn(this.win,e,this.webAuthnNewTab,this.platformUtilsService,this.i18nService,(e=>{this.token=e,this.submit()}),(e=>{this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}),(e=>{"ready"===e&&(this.webAuthnReady=!0)}))}this.selectedProviderType=this.twoFactorService.getDefaultProvider(this.webAuthnSupported),yield this.init()}else this.router.navigate([this.loginRoute])}))}ngOnDestroy(){this.cleanupWebAuthn(),this.webAuthn=null}init(){return _n(this,void 0,void 0,(function*(){if(null==this.selectedProviderType)return void(this.title=this.i18nService.t("loginUnavailable"));this.cleanupWebAuthn(),this.title=Un[this.selectedProviderType].name;const e=this.twoFactorService.getProviders().get(this.selectedProviderType);switch(this.selectedProviderType){case fn.WebAuthn:this.webAuthnNewTab||setTimeout((()=>{this.authWebAuthn()}),500);break;case fn.Duo:case fn.OrganizationDuo:setTimeout((()=>{mn.init({iframe:void 0,host:e.Host,sig_request:e.Signature,submit_callback:e=>_n(this,void 0,void 0,(function*(){const t=e.querySelector('input[name="sig_response"]');null!=t&&(this.token=t.value,yield this.submit())}))})}),0);break;case fn.Email:this.twoFactorEmail=e.Email,this.twoFactorService.getProviders().size>1&&(yield this.sendEmail(!1))}}))}submit(){return _n(this,void 0,void 0,(function*(){if(yield this.setupCaptcha(),null!=this.token&&""!==this.token){if(this.selectedProviderType===fn.WebAuthn){if(null==this.webAuthn)return;this.webAuthn.stop()}else this.selectedProviderType!==fn.Email&&this.selectedProviderType!==fn.Authenticator||(this.token=this.token.replace(" ","").trim());try{yield this.doSubmit()}catch(e){this.selectedProviderType===fn.WebAuthn&&null!=this.webAuthn&&this.webAuthn.start()}}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("verificationCodeRequired"))}))}doSubmit(){return _n(this,void 0,void 0,(function*(){this.formPromise=this.authService.logInTwoFactor(new bn(this.selectedProviderType,this.token,this.remember),this.captchaToken);const e=yield this.formPromise,t=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!t),this.handleCaptchaRequired(e)||(null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),e.resetMasterPassword&&(this.successRoute="set-password"),e.forcePasswordReset&&(this.successRoute="update-temp-password"),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute],{queryParams:{identifier:this.identifier}}))}))}sendEmail(e){return _n(this,void 0,void 0,(function*(){if(this.selectedProviderType===fn.Email&&null==this.emailPromise){try{const t=new Sn;t.email=this.authService.email,t.masterPasswordHash=this.authService.masterPasswordHash,t.deviceIdentifier=yield this.appIdService.getAppId(),this.emailPromise=this.apiService.postTwoFactorEmail(t),yield this.emailPromise,e&&this.platformUtilsService.showToast("success",null,this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail))}catch(e){this.logService.error(e)}this.emailPromise=null}}))}authWebAuthn(){const e=this.twoFactorService.getProviders().get(this.selectedProviderType);this.webAuthnSupported&&null!=this.webAuthn&&this.webAuthn.init(e)}cleanupWebAuthn(){null!=this.webAuthn&&(this.webAuthn.stop(),this.webAuthn.cleanup())}get authing(){return this.authService.authingWithPassword()||this.authService.authingWithSso()||this.authService.authingWithApiKey()}get needsLock(){return this.authService.authingWithSso()||this.authService.authingWithApiKey()}}Zn.ɵfac=function(e){return new(e||Zn)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Tt),s.Y36(Je),s.Y36(Window),s.Y36(Ye),s.Y36(Mt),s.Y36(Pe.gz),s.Y36(Ct),s.Y36(pn),s.Y36(An))},Zn.ɵdir=s.lG2({type:Zn,features:[s.qOj]});class Tn{}var Cn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function kn(e,t){if(1&e&&(s.TgZ(0,"button",14),s._uU(1,"\n "),s.TgZ(2,"span",15),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"i",16),s._uU(7,"\n "),s.qZA()),2&e){s.oxw();const e=s.MAs(1);s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(4,4,"continue")),s.xp6(3),s.Q6J("hidden",!e.loading)}}function On(e,t){1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"enterVerificationCodeApp"),"\n "))}function Pn(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij("\n ",s.xi3(2,1,"enterVerificationCodeEmail",e.twoFactorEmail),"\n ")}}function In(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",17),s._uU(3,"\n "),s.YNc(4,On,3,3,"span",9),s._uU(5,"\n "),s.YNc(6,Pn,3,4,"span",9),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",18),s._uU(10,"\n "),s.TgZ(11,"div",19),s._uU(12,"\n "),s.TgZ(13,"div",20),s._uU(14,"\n "),s.TgZ(15,"label",21),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"input",22),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.token=t)})),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"div",23),s._uU(23,"\n "),s.TgZ(24,"label",24),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.remember=t)})),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Authenticator),s.xp6(2),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Email),s.xp6(10),s.Oqu(s.lcZ(17,6,"verificationCode")),s.xp6(3),s.Q6J("ngModel",e.token),s.xp6(6),s.Oqu(s.lcZ(26,8,"rememberMe")),s.xp6(3),s.Q6J("ngModel",e.remember)}}function qn(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",17),s._uU(3,"\n "),s.TgZ(4,"p",26),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s._UZ(8,"img",27),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",18),s._uU(12,"\n "),s.TgZ(13,"div",19),s._uU(14,"\n "),s.TgZ(15,"div",20),s._uU(16,"\n "),s.TgZ(17,"label",28),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"input",29),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.token=t)})),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"div",23),s._uU(25,"\n "),s.TgZ(26,"label",24),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n "),s.TgZ(30,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.remember=t)})),s.qZA(),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.qZA(),s._uU(34,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,5,"insertYubiKey")),s.xp6(13),s.Oqu(s.lcZ(19,7,"verificationCode")),s.xp6(3),s.Q6J("ngModel",e.token),s.xp6(6),s.Oqu(s.lcZ(28,9,"rememberMe")),s.xp6(3),s.Q6J("ngModel",e.remember)}}function Dn(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",30),s._UZ(3,"iframe",31),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"div",32),s._uU(6,"\n "),s.TgZ(7,"div",19),s._uU(8,"\n "),s.TgZ(9,"div",23),s._uU(10,"\n "),s.TgZ(11,"label",24),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.remember=t)})),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(3),s.Q6J("allow",e.webAuthnAllow),s.xp6(9),s.Oqu(s.lcZ(13,3,"rememberMe")),s.xp6(3),s.Q6J("ngModel",e.remember)}}function Mn(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n "),s.TgZ(2,"p",26),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.authWebAuthn())})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA()}2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"webAuthnNewTab")),s.xp6(4),s.hij("\n ",s.lcZ(8,4,"webAuthnNewTabOpen"),"\n "))}function Fn(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Mn,10,6,"div",33),s._uU(3,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.webAuthnNewTab)}}function Nn(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",35),s._UZ(3,"iframe",36),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"div",32),s._uU(6,"\n "),s.TgZ(7,"div",19),s._uU(8,"\n "),s.TgZ(9,"div",23),s._uU(10,"\n "),s.TgZ(11,"label",24),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.remember=t)})),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(12),s.Oqu(s.lcZ(13,2,"rememberMe")),s.xp6(3),s.Q6J("ngModel",e.remember)}}function Ln(e,t){1&e&&(s.TgZ(0,"div",37),s._uU(1,"\n "),s.TgZ(2,"p",26),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"p",26),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"noTwoStepProviders")),s.xp6(4),s.Oqu(s.lcZ(8,4,"noTwoStepProviders2")))}function En(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"p",26),s._uU(1,"\n "),s.TgZ(2,"button",41),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.sendEmail(!0))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("appApiAction",e.emailPromise),s.xp6(1),s.hij("\n ",s.lcZ(4,2,"sendVerificationCodeEmailAgain"),"\n ")}}function Rn(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",38),s._uU(1,"\n "),s.TgZ(2,"p",26),s._uU(3,"\n "),s.TgZ(4,"button",39),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.anotherMethod())})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.YNc(9,En,6,4,"p",40),s._uU(10,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(5),s.hij("\n ",s.lcZ(6,2,"useAnotherTwoStepMethod"),"\n "),s.xp6(4),s.Q6J("ngIf",e.selectedProviderType===e.providerType.Email)}}class Jn extends Zn{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g){super(e,t,i,n,s,window,r,c,u,h,p,g),this.syncService=o,this.broadcasterService=a,this.popupUtilsService=l,this.messagingService=d,this.showNewWindowMessage=!1,super.onSuccessfulLogin=()=>o.fullSync(!0),super.successRoute="/tabs/vault",this.webAuthnNewTab=this.platformUtilsService.isFirefox()||this.platformUtilsService.isSafari()}ngOnInit(){const e=Object.create(null,{onSuccessfulLogin:{get:()=>super.onSuccessfulLogin,set:e=>super.onSuccessfulLogin=e},ngOnInit:{get:()=>super.ngOnInit,set:e=>super.ngOnInit=e}});return Cn(this,void 0,void 0,(function*(){if(this.route.snapshot.paramMap.has("webAuthnResponse"))return this.selectedProviderType=fn.WebAuthn,this.token=this.route.snapshot.paramMap.get("webAuthnResponse"),e.onSuccessfulLogin=()=>Cn(this,void 0,void 0,(function*(){this.syncService.fullSync(!0),this.messagingService.send("reloadPopup"),window.close()})),this.remember="true"===this.route.snapshot.paramMap.get("remember"),void(yield this.doSubmit());if(yield e.ngOnInit.call(this),null!=this.selectedProviderType){if(this.selectedProviderType===fn.WebAuthn&&(yield this.isLinux())&&document.body.classList.add("linux-webauthn"),this.selectedProviderType===fn.Email&&this.popupUtilsService.inPopup(window)){(yield this.platformUtilsService.showDialog(this.i18nService.t("popup2faCloseMessage"),null,this.i18nService.t("yes"),this.i18nService.t("no")))&&this.popupUtilsService.popOut(window)}this.route.queryParams.pipe((0,Gi.P)()).subscribe((t=>Cn(this,void 0,void 0,(function*(){"true"===t.sso&&(e.onSuccessfulLogin=()=>{Wt.reloadOpenWindows();return window.open("","_self").close(),this.syncService.fullSync(!0)})}))))}}))}ngOnDestroy(){const e=Object.create(null,{ngOnDestroy:{get:()=>super.ngOnDestroy}});return Cn(this,void 0,void 0,(function*(){this.broadcasterService.unsubscribe("TwoFactorComponent"),this.selectedProviderType===fn.WebAuthn&&(yield this.isLinux())&&document.body.classList.remove("linux-webauthn"),e.ngOnDestroy.call(this)}))}anotherMethod(){this.router.navigate(["2fa-options"])}isLinux(){return Cn(this,void 0,void 0,(function*(){return"linux"===(yield Wt.getPlatformInfo()).os}))}}Jn.ɵfac=function(e){return new(e||Jn)(s.Y36(Ie),s.Y36(Pe.F0),s.Y36(_e),s.Y36(Tt),s.Y36(Je),s.Y36(bi),s.Y36(Ye),s.Y36(Tn),s.Y36($t),s.Y36(Mt),s.Y36(Pe.gz),s.Y36(qe),s.Y36(Ct),s.Y36(pn),s.Y36(An))},Jn.ɵcmp=s.Xpm({type:Jn,selectors:[["app-two-factor"]],features:[s.qOj],decls:47,vars:14,consts:[["id","two-factor-page",3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/login"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled",4,"ngIf"],["tabindex","-1"],[4,"ngIf"],[1,"box-content-row",3,"hidden"],["id","hcaptcha_iframe","height","80"],["class","content",4,"ngIf"],["class","content no-vpad",4,"ngIf"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],[1,"content","text-center"],[1,"box","first"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","code"],["id","code","type","text","name","Code","required","","appAutofocus","","inputmode","tel","appInputVerbatim","",3,"ngModel","ngModelChange"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","remember"],["id","remember","type","checkbox","name","Remember",3,"ngModel","ngModelChange"],[1,"text-center"],["src","../images/yubikey.jpg","alt","",1,"img-rounded","img-responsive"],["for","code",1,"sr-only"],["id","code","type","password","name","Code","required","","appAutofocus","","appInputVerbatim","",3,"ngModel","ngModelChange"],["id","web-authn-frame"],["id","webauthn_iframe",3,"allow"],[1,"box"],["class","content text-center",4,"ngIf"],["type","button","appStopClick","",1,"btn","primary","block",3,"click"],["id","duo-frame"],["id","duo_iframe"],[1,"content"],[1,"content","no-vpad"],["type","button","appStopClick","",3,"click"],["class","text-center",4,"ngIf"],["type","button","appStopClick","",3,"appApiAction","click"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",6),s._uU(19,"\n "),s.YNc(20,kn,8,6,"button",7),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"main",8),s._uU(25,"\n "),s.YNc(26,In,33,10,"ng-container",9),s._uU(27,"\n "),s.YNc(28,qn,35,11,"ng-container",9),s._uU(29,"\n "),s.YNc(30,Dn,20,5,"ng-container",9),s._uU(31,"\n "),s.YNc(32,Fn,4,1,"ng-container",9),s._uU(33,"\n "),s.YNc(34,Nn,20,4,"ng-container",9),s._uU(35,"\n "),s.TgZ(36,"div",10),s._uU(37,"\n "),s._UZ(38,"iframe",11),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.YNc(41,Ln,10,6,"div",12),s._uU(42,"\n "),s.YNc(43,Rn,11,4,"div",13),s._uU(44,"\n "),s.qZA(),s._uU(45,"\n"),s.qZA(),s._uU(46,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,12,"back")),s.xp6(7),s.Oqu(t.title),s.xp6(5),s.Q6J("ngIf",null!=t.selectedProviderType&&t.selectedProviderType!==t.providerType.Duo&&t.selectedProviderType!==t.providerType.OrganizationDuo&&(t.selectedProviderType!==t.providerType.WebAuthn||e.loading)),s.xp6(6),s.Q6J("ngIf",t.selectedProviderType===t.providerType.Authenticator||t.selectedProviderType===t.providerType.Email),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.Yubikey),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.WebAuthn&&!t.webAuthnNewTab),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.WebAuthn&&t.webAuthnNewTab),s.xp6(2),s.Q6J("ngIf",t.selectedProviderType===t.providerType.Duo||t.selectedProviderType===t.providerType.OrganizationDuo),s.xp6(2),s.Q6J("hidden",!t.showCaptcha()),s.xp6(5),s.Q6J("ngIf",null==t.selectedProviderType),s.xp6(2),s.Q6J("ngIf",null!=t.selectedProviderType)}},dependencies:[Pe.rH,u.O5,ue._Y,ue.Fj,ue.Wl,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ot,It,Xe,bt,St,Ze],encapsulation:2});class Yn extends class{}{}var zn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kn extends Wi{constructor(e,t,i,n,s,o,r,a,l,c){super(e,s,o,i,t,n,a),this.apiService=r,this.syncService=l,this.logService=c,this.showPassword=!1}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return zn(this,void 0,void 0,(function*(){yield this.syncService.fullSync(!0),e.ngOnInit.call(this)}))}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}setupSubmitActions(){return zn(this,void 0,void 0,(function*(){return this.enforcedPolicyOptions=yield this.policyService.getMasterPasswordPolicyOptions(),this.email=yield this.stateService.getEmail(),this.kdf=yield this.stateService.getKdfType(),this.kdfIterations=yield this.stateService.getKdfIterations(),!0}))}submit(){return zn(this,void 0,void 0,(function*(){if((yield this.strongPassword())&&(yield this.setupSubmitActions()))try{const e=yield this.cryptoService.makeKey(this.masterPassword,this.email.trim().toLowerCase(),this.kdf,this.kdfIterations),t=yield this.cryptoService.hashPassword(this.masterPassword,e),i=yield this.cryptoService.getEncKey(),n=yield this.cryptoService.remakeEncKey(e,i);yield this.performSubmitActions(t,e,n)}catch(e){this.logService.error(e)}}))}performSubmitActions(e,t,i){return zn(this,void 0,void 0,(function*(){try{const t=new Yn;t.key=i[1].encryptedString,t.newMasterPasswordHash=e,t.masterPasswordHint=this.hint,this.formPromise=this.apiService.putUpdateTempPassword(t),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("updatedMasterPassword")),null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.messagingService.send("logout")}catch(e){this.logService.error(e)}}))}}function Bn(e,t){if(1&e&&(s.TgZ(0,"app-callout",31),s._uU(1,"\n "),s.qZA()),2&e){const e=s.oxw();s.Q6J("enforcedPolicyOptions",e.enforcedPolicyOptions)}}function Gn(e,t){if(1&e&&(s.TgZ(0,"strong"),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.Gre("sub-label text-",e.color,""),s.xp6(1),s.hij("\n ",e.text,"\n ")}}Kn.ɵfac=function(e){return new(e||Kn)(s.Y36(_e),s.Y36(Je),s.Y36(Dt),s.Y36(Hi),s.Y36(zt),s.Y36(qe),s.Y36(Tt),s.Y36(Mt),s.Y36(bi),s.Y36(Ct))},Kn.ɵdir=s.lG2({type:Kn,features:[s.qOj]});const Qn=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class Vn extends Kn{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,n,s,r,a,o,l,c)}}Vn.ɵfac=function(e){return new(e||Vn)(s.Y36(_e),s.Y36(Je),s.Y36(Dt),s.Y36(Hi),s.Y36(zt),s.Y36(Mt),s.Y36(qe),s.Y36(Tt),s.Y36(bi),s.Y36(Ct))},Vn.ɵcmp=s.Xpm({type:Vn,selectors:[["app-update-temp-password"]],features:[s.qOj],decls:124,vars:56,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],[3,"click"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],["type","warning",3,"title"],["type","info",3,"enforcedPolicyOptions",4,"ngIf"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],[1,"box-content-row-flex"],[1,"row-main"],["for","masterPassword"],[3,"class",4,"ngIf"],["id","masterPassword","name","MasterPassword","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[3,"password","email","passwordStrengthResult","passwordScoreColor"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],["for","masterPasswordRetype"],["id","masterPasswordRetype","name","MasterPasswordRetype","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],["for","hint"],["id","hint","type","text","name","Hint",3,"ngModel","ngModelChange"],[1,"box-footer"],["type","info",3,"enforcedPolicyOptions"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"a",3),s.NdJ("click",(function(){return t.logOut()})),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.TgZ(34,"app-callout",11),s.ALo(35,"i18n"),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n "),s.YNc(39,Bn,2,1,"app-callout",12),s._uU(40,"\n "),s.TgZ(41,"div",13),s._uU(42,"\n "),s.TgZ(43,"div",14),s._uU(44,"\n "),s.TgZ(45,"div",15),s._uU(46,"\n "),s.TgZ(47,"div",16),s._uU(48,"\n "),s.TgZ(49,"div",17),s._uU(50,"\n "),s.TgZ(51,"label",18),s._uU(52),s.ALo(53,"i18n"),s.YNc(54,Gn,2,4,"strong",19),s._uU(55,"\n "),s.qZA(),s._uU(56,"\n "),s.TgZ(57,"input",20),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(58,"\n "),s.qZA(),s._uU(59,"\n "),s.TgZ(60,"div",21),s._uU(61,"\n "),s.TgZ(62,"button",22),s.NdJ("click",(function(){return t.togglePassword(!1)})),s.ALo(63,"i18n"),s._uU(64,"\n "),s._UZ(65,"i",23),s._uU(66,"\n "),s.qZA(),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.qZA(),s._uU(69,"\n "),s.TgZ(70,"app-password-strength",24),s.NdJ("passwordStrengthResult",(function(e){return t.getStrengthResult(e)}))("passwordScoreColor",(function(e){return t.getPasswordScoreText(e)})),s._uU(71,"\n "),s.qZA(),s._uU(72,"\n "),s.qZA(),s._uU(73,"\n "),s.qZA(),s._uU(74,"\n "),s.qZA(),s._uU(75,"\n "),s.TgZ(76,"div",13),s._uU(77,"\n "),s.TgZ(78,"div",14),s._uU(79,"\n "),s.TgZ(80,"div",25),s._uU(81,"\n "),s.TgZ(82,"div",17),s._uU(83,"\n "),s.TgZ(84,"label",26),s._uU(85),s.ALo(86,"i18n"),s.qZA(),s._uU(87,"\n "),s.TgZ(88,"input",27),s.NdJ("ngModelChange",(function(e){return t.masterPasswordRetype=e})),s.qZA(),s._uU(89,"\n "),s.qZA(),s._uU(90,"\n "),s.TgZ(91,"div",21),s._uU(92,"\n "),s.TgZ(93,"button",22),s.NdJ("click",(function(){return t.togglePassword(!0)})),s.ALo(94,"i18n"),s._uU(95,"\n "),s._UZ(96,"i",23),s._uU(97,"\n "),s.qZA(),s._uU(98,"\n "),s.qZA(),s._uU(99,"\n "),s.qZA(),s._uU(100,"\n "),s.qZA(),s._uU(101,"\n "),s.qZA(),s._uU(102,"\n "),s.TgZ(103,"div",13),s._uU(104,"\n "),s.TgZ(105,"div",14),s._uU(106,"\n "),s.TgZ(107,"div",15),s._uU(108,"\n "),s.TgZ(109,"label",28),s._uU(110),s.ALo(111,"i18n"),s.qZA(),s._uU(112,"\n "),s.TgZ(113,"input",29),s.NdJ("ngModelChange",(function(e){return t.hint=e})),s.qZA(),s._uU(114,"\n "),s.qZA(),s._uU(115,"\n "),s.qZA(),s._uU(116,"\n "),s.TgZ(117,"div",30),s._uU(118),s.ALo(119,"i18n"),s.qZA(),s._uU(120,"\n "),s.qZA(),s._uU(121,"\n "),s.qZA(),s._uU(122,"\n"),s.qZA(),s._uU(123,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,28,"logOut")),s.xp6(7),s.Oqu(s.lcZ(16,30,"updateMasterPassword")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,32,"submit")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(7),s.s9C("title",s.lcZ(35,34,"updateMasterPassword")),s.xp6(2),s.hij("\n ",s.lcZ(37,36,"updateMasterPasswordWarning"),"\n "),s.xp6(3),s.Q6J("ngIf",t.enforcedPolicyOptions),s.xp6(13),s.hij("\n ",s.lcZ(53,38,"masterPass"),"\n "),s.xp6(2),s.Q6J("ngIf",t.text),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPassword),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(63,40,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(50,Qn,!t.showPassword,t.showPassword)),s.xp6(5),s.Q6J("password",t.masterPassword)("email",t.email),s.xp6(15),s.Oqu(s.lcZ(86,42,"reTypeMasterPass")),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPasswordRetype),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(94,44,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(53,Qn,!t.showPassword,t.showPassword)),s.xp6(14),s.Oqu(s.lcZ(111,46,"masterPassHint")),s.xp6(3),s.Q6J("ngModel",t.hint),s.xp6(5),s.hij("\n ",s.lcZ(119,48,"masterPassHintDesc"),"\n ")}},dependencies:[u.mk,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ht,Ot,Xe,wt,bt,St,Mi,Ze],encapsulation:2});class Hn{}var jn=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wn{constructor(e,t,i,n,o,r,a,l){this.passwordGenerationService=e,this.usernameGenerationService=t,this.platformUtilsService=i,this.stateService=n,this.i18nService=o,this.logService=r,this.route=a,this.win=l,this.comingFromAddEdit=!1,this.onSelected=new s.vpe,this.usernameOptions={},this.passwordOptions={},this.username="-",this.password="-",this.showOptions=!1,this.avoidAmbiguous=!1,this.usernameWebsite=null,this.typeOptions=[{name:o.t("password"),value:"password"},{name:o.t("username"),value:"username"}],this.passTypeOptions=[{name:o.t("password"),value:"password"},{name:o.t("passphrase"),value:"passphrase"}],this.usernameTypeOptions=[{name:o.t("plusAddressedEmail"),value:"subaddress",desc:o.t("plusAddressedEmailDesc")},{name:o.t("catchallEmail"),value:"catchall",desc:o.t("catchallEmailDesc")},{name:o.t("forwardedEmail"),value:"forwarded",desc:o.t("forwardedEmailDesc")},{name:o.t("randomWord"),value:"word"}],this.subaddressOptions=[{name:o.t("random"),value:"random"}],this.catchallOptions=[{name:o.t("random"),value:"random"}],this.forwardOptions=[{name:"SimpleLogin",value:"simplelogin"},{name:"AnonAddy",value:"anonaddy"},{name:"Firefox Relay",value:"firefoxrelay"},{name:"Fastmail",value:"fastmail"},{name:"DuckDuckGo",value:"duckduckgo"}]}ngOnInit(){return jn(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>jn(this,void 0,void 0,(function*(){var t;const i=yield this.passwordGenerationService.getOptions();if(this.passwordOptions=i[0],this.enforcedPasswordPolicyOptions=i[1],this.avoidAmbiguous=!this.passwordOptions.ambiguous,this.passwordOptions.type="passphrase"===this.passwordOptions.type?"passphrase":"password",this.usernameOptions=yield this.usernameGenerationService.getOptions(),null==this.usernameOptions.type&&(this.usernameOptions.type="word"),null!=this.usernameOptions.subaddressEmail&&""!==this.usernameOptions.subaddressEmail||(this.usernameOptions.subaddressEmail=yield this.stateService.getEmail()),null==this.usernameWebsite)this.usernameOptions.subaddressType=this.usernameOptions.catchallType="random";else{this.usernameOptions.website=this.usernameWebsite;const e={name:this.i18nService.t("websiteName"),value:"website-name"};this.subaddressOptions.push(e),this.catchallOptions.push(e)}if("username"!==this.type&&"password"!==this.type)if("username"===e.type||"password"===e.type)this.type=e.type;else{const e=yield this.stateService.getGeneratorOptions();this.type=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:"password"}this.regenerateWithoutButtonPress()&&(yield this.regenerate())}))))}))}typeChanged(){return jn(this,void 0,void 0,(function*(){yield this.stateService.setGeneratorOptions({type:this.type}),this.regenerateWithoutButtonPress()&&(yield this.regenerate())}))}regenerate(){return jn(this,void 0,void 0,(function*(){"password"===this.type?yield this.regeneratePassword():"username"===this.type&&(yield this.regenerateUsername())}))}sliderChanged(){return jn(this,void 0,void 0,(function*(){this.savePasswordOptions(!1),yield this.passwordGenerationService.addHistory(this.password)}))}sliderInput(){return jn(this,void 0,void 0,(function*(){this.normalizePasswordOptions(),this.password=yield this.passwordGenerationService.generatePassword(this.passwordOptions)}))}savePasswordOptions(e=!0){return jn(this,void 0,void 0,(function*(){this.normalizePasswordOptions(),yield this.passwordGenerationService.saveOptions(this.passwordOptions),e&&this.regenerateWithoutButtonPress()&&(yield this.regeneratePassword())}))}saveUsernameOptions(e=!0){return jn(this,void 0,void 0,(function*(){yield this.usernameGenerationService.saveOptions(this.usernameOptions),"forwarded"===this.usernameOptions.type&&(this.username="-"),e&&this.regenerateWithoutButtonPress()&&(yield this.regenerateUsername())}))}regeneratePassword(){return jn(this,void 0,void 0,(function*(){this.password=yield this.passwordGenerationService.generatePassword(this.passwordOptions),yield this.passwordGenerationService.addHistory(this.password)}))}regenerateUsername(){return this.generateUsername()}generateUsername(){return jn(this,void 0,void 0,(function*(){try{this.usernameGeneratingPromise=this.usernameGenerationService.generateUsername(this.usernameOptions),this.username=yield this.usernameGeneratingPromise,""!==this.username&&null!==this.username||(this.username="-")}catch(e){this.logService.error(e)}}))}copy(){const e="password"===this.type,t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e?this.password:this.username,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(e?"password":"username")))}select(){this.onSelected.emit("password"===this.type?this.password:this.username)}toggleOptions(){this.showOptions=!this.showOptions}regenerateWithoutButtonPress(){return"username"!==this.type||"forwarded"!==this.usernameOptions.type}normalizePasswordOptions(){if(this.passwordOptions.ambiguous=!this.avoidAmbiguous,!(this.passwordOptions.uppercase||this.passwordOptions.lowercase||this.passwordOptions.number||this.passwordOptions.special)&&(this.passwordOptions.lowercase=!0,null!=this.win)){const e=this.win.document.querySelector("#lowercase");e&&(e.checked=!0)}this.passwordGenerationService.normalizeOptions(this.passwordOptions,this.enforcedPasswordPolicyOptions)}}Wn.ɵfac=function(e){return new(e||Wn)(s.Y36(Dt),s.Y36(Hn),s.Y36(Je),s.Y36(Mt),s.Y36(_e),s.Y36(Ct),s.Y36(Pe.gz),s.Y36(Window))},Wn.ɵdir=s.lG2({type:Wn,inputs:{comingFromAddEdit:"comingFromAddEdit",type:"type"},outputs:{onSelected:"onSelected"}});class $n{constructor(e,t){this.el=e,this.platformUtilsService=t}onCopy(){if(null==window)return;let e="";const t=window.getSelection();for(let i=0;i-1){""===n.substr(o).trim()&&(s=o)}e+=n.substring(0,s)}this.platformUtilsService.copyToClipboard(e,{window})}}function Xn(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"button",1),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.expand())})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",2),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n"),s.BQk()}2&e&&(s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,1,"popOutNewWindow")))}$n.ɵfac=function(e){return new(e||$n)(s.Y36(s.SBq),s.Y36(Je))},$n.ɵdir=s.lG2({type:$n,selectors:[["","appSelectCopy",""]],hostBindings:function(e,t){1&e&&s.NdJ("copy",(function(){return t.onCopy()}))}});class es{constructor(e,t){this.platformUtilsService=e,this.popupUtilsService=t,this.show=!0}ngOnInit(){this.show&&(this.popupUtilsService.inSidebar(window)&&this.platformUtilsService.isFirefox()||this.popupUtilsService.inPopout(window))&&(this.show=!1)}expand(){this.popupUtilsService.popOut(window)}}es.ɵfac=function(e){return new(e||es)(s.Y36(Je),s.Y36($t))},es.ɵcmp=s.Xpm({type:es,selectors:[["app-pop-out"]],inputs:{show:"show"},decls:2,vars:1,consts:[[4,"ngIf"],["type","button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-external-link","bwi-rotate-270","bwi-lg","bwi-fw"]],template:function(e,t){1&e&&(s.YNc(0,Xn,8,3,"ng-container",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.show)},dependencies:[u.O5,Ht,Ze],encapsulation:2});class ts{transform(e){return this.generateTemplate(e,((e,t)=>`${e}`))}generateTemplate(e,t){const i=Array.from(e);let n="";for(let e=0;e":s=">",o=!0;break;case" ":s=" ",o=!0}let r="letter";s.match(nt.regexpEmojiPresentation)?r="emoji":o||s.match(/[^\w ]/)?r="special":s.match(/\d/)&&(r="number"),n+=t(s,r,e)}return n}}ts.ɵfac=function(e){return new(e||ts)},ts.ɵpipe=s.Yjl({name:"colorPassword",type:ts,pure:!0});var is=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ns(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.close())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"cancel"),"\n "))}function ss(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.select())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"select"),"\n "))}function os(e,t){1&e&&(s.TgZ(0,"app-callout",16),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"passwordGeneratorPolicyInEffect"),"\n "))}function rs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n "),s._UZ(2,"div",18),s.ALo(3,"colorPassword"),s._uU(4,"\n "),s.TgZ(5,"div",19),s._uU(6,"\n "),s.TgZ(7,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy())})),s.ALo(8,"i18n"),s._uU(9,"\n "),s._UZ(10,"i",21),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.regenerate())})),s.ALo(14,"i18n"),s._uU(15,"\n "),s._UZ(16,"i",23),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("innerHTML",s.lcZ(3,3,e.password),s.oJD),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(8,5,"copyPassword")),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(14,7,"regeneratePassword"))}}function as(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n "),s._UZ(2,"div",18),s.ALo(3,"colorPassword"),s._uU(4,"\n "),s.TgZ(5,"div",24,25),s._uU(7,"\n "),s.TgZ(8,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy())})),s.ALo(9,"i18n"),s._uU(10,"\n "),s._UZ(11,"i",21),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"button",26),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.regenerate())})),s.ALo(15,"i18n"),s._uU(16,"\n "),s._UZ(17,"i",27),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA()}if(2&e){const e=s.MAs(6),t=s.oxw();s.xp6(2),s.Q6J("innerHTML",s.lcZ(3,6,t.username),s.oJD),s.xp6(3),s.Q6J("appApiAction",t.usernameGeneratingPromise),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(9,8,"copyUsername")),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(15,10,"regenerateUsername")),s.Q6J("disabled",e.loading),s.xp6(3),s.Q6J("ngClass",e.loading?"bwi-spin":"")}}function ls(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",28),s._uU(1,"\n "),s.TgZ(2,"input",29),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.typeChanged())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw();s.xp6(2),s.MGl("id","type_",e.value,""),s.Q6J("ngModel",i.type)("value",e.value)("checked",i.type===e.value)("disabled",i.comingFromAddEdit&&i.type!==e.value),s.xp6(2),s.MGl("for","type_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function cs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",28),s._uU(1,"\n "),s.TgZ(2,"input",40),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(2),s.MGl("id","passwordtype_",e.value,""),s.Q6J("ngModel",i.passwordOptions.type)("value",e.value)("checked",i.passwordOptions.type===e.value),s.xp6(2),s.MGl("for","passwordtype_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function us(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"div",41),s._uU(5,"\n "),s.TgZ(6,"label",42),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",43),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.numWords=t)})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",41),s._uU(14,"\n "),s.TgZ(15,"label",44),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"input",45),s.NdJ("input",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.wordSeparator=t)})),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"div",46),s._uU(23,"\n "),s.TgZ(24,"label",47),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"input",48),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.capitalize=t)})),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.TgZ(31,"div",46),s._uU(32,"\n "),s.TgZ(33,"label",49),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n "),s.TgZ(37,"input",50),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.includeNumber=t)})),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,10,"numWords")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.numWords),s.xp6(6),s.Oqu(s.lcZ(17,12,"wordSeparator")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.wordSeparator),s.xp6(6),s.Oqu(s.lcZ(26,14,"capitalize")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.capitalize)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.capitalize),s.xp6(6),s.Oqu(s.lcZ(35,16,"includeNumber")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.includeNumber)("disabled",null==e.enforcedPasswordPolicyOptions?null:e.enforcedPasswordPolicyOptions.includeNumber)}}function ds(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",9),s._uU(3,"\n "),s.TgZ(4,"div",10),s._uU(5,"\n "),s.TgZ(6,"div",51),s._uU(7,"\n "),s.TgZ(8,"label",52),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"input",53),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.length=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())})),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"input",54),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.length=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.sliderChanged())}))("input",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.sliderInput())})),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",46),s._uU(19,"\n "),s.TgZ(20,"label",55),s._uU(21,"A-Z"),s.qZA(),s._uU(22,"\n "),s.TgZ(23,"input",56),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.uppercase=t)})),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"div",46),s._uU(28,"\n "),s.TgZ(29,"label",57),s._uU(30,"a-z"),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"input",58),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.lowercase=t)})),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"div",46),s._uU(37,"\n "),s.TgZ(38,"label",59),s._uU(39,"0-9"),s.qZA(),s._uU(40,"\n "),s.TgZ(41,"input",60),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.number=t)})),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.TgZ(45,"div",46),s._uU(46,"\n "),s.TgZ(47,"label",61),s._uU(48,"!@#$%^&*"),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"input",62),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.special=t)})),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.qZA(),s._uU(55,"\n "),s.TgZ(56,"div",9),s._uU(57,"\n "),s.TgZ(58,"div",10),s._uU(59,"\n "),s.TgZ(60,"div",41),s._uU(61,"\n "),s.TgZ(62,"label",63),s._uU(63),s.ALo(64,"i18n"),s.qZA(),s._uU(65,"\n "),s.TgZ(66,"input",64),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.minNumber=t)})),s.qZA(),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.TgZ(69,"div",41),s._uU(70,"\n "),s.TgZ(71,"label",65),s._uU(72),s.ALo(73,"i18n"),s.qZA(),s._uU(74,"\n "),s.TgZ(75,"input",66),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.passwordOptions.minSpecial=t)})),s.qZA(),s._uU(76,"\n "),s.qZA(),s._uU(77,"\n "),s.TgZ(78,"div",46),s._uU(79,"\n "),s.TgZ(80,"label",67),s._uU(81),s.ALo(82,"i18n"),s.qZA(),s._uU(83,"\n "),s.TgZ(84,"input",68),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.savePasswordOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.avoidAmbiguous=t)})),s.qZA(),s._uU(85,"\n "),s.qZA(),s._uU(86,"\n "),s.qZA(),s._uU(87,"\n "),s.qZA(),s._uU(88,"\n "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(9),s.Oqu(s.lcZ(10,22,"length")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.length),s.xp6(2),s.Q6J("ngModel",e.passwordOptions.length),s.uIk("aria-label",s.lcZ(15,24,"length")),s.xp6(9),s.Q6J("disabled",e.enforcedPasswordPolicyOptions.useUppercase)("ngModel",e.passwordOptions.uppercase),s.uIk("aria-label",s.lcZ(24,26,"uppercase")),s.xp6(9),s.Q6J("disabled",e.enforcedPasswordPolicyOptions.useLowercase)("ngModel",e.passwordOptions.lowercase),s.uIk("aria-label",s.lcZ(33,28,"lowercase")),s.xp6(9),s.Q6J("disabled",e.enforcedPasswordPolicyOptions.useNumbers)("ngModel",e.passwordOptions.number),s.uIk("aria-label",s.lcZ(42,30,"numbers")),s.xp6(9),s.Q6J("disabled",e.enforcedPasswordPolicyOptions.useSpecial)("ngModel",e.passwordOptions.special),s.uIk("aria-label",s.lcZ(51,32,"specialCharacters")),s.xp6(13),s.Oqu(s.lcZ(64,34,"minNumbers")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.minNumber),s.xp6(6),s.Oqu(s.lcZ(73,36,"minSpecial")),s.xp6(3),s.Q6J("ngModel",e.passwordOptions.minSpecial),s.xp6(6),s.Oqu(s.lcZ(82,38,"avoidAmbChar")),s.xp6(3),s.Q6J("ngModel",e.avoidAmbiguous)}}function hs(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",9),s._uU(3,"\n "),s.TgZ(4,"h2",31),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",10),s._uU(9,"\n "),s.TgZ(10,"div",32),s._uU(11,"\n "),s.TgZ(12,"label",33),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.YNc(16,cs,7,6,"div",13),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.YNc(21,us,41,18,"div",34),s._uU(22,"\n "),s.YNc(23,ds,89,40,"ng-container",14),s._uU(24,"\n "),s.TgZ(25,"div",35),s._uU(26,"\n "),s.TgZ(27,"div",36),s._uU(28,"\n "),s.TgZ(29,"a",37),s._uU(30,"\n "),s.TgZ(31,"div",38),s._uU(32),s.ALo(33,"i18n"),s.qZA(),s._uU(34,"\n "),s._UZ(35,"i",39),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.hij("\n ",s.lcZ(6,6,"options"),"\n "),s.xp6(8),s.Oqu(s.lcZ(14,8,"passwordType")),s.xp6(3),s.Q6J("ngForOf",e.passTypeOptions),s.xp6(5),s.Q6J("ngIf","passphrase"===e.passwordOptions.type),s.xp6(2),s.Q6J("ngIf","password"===e.passwordOptions.type),s.xp6(9),s.Oqu(s.lcZ(33,10,"passwordHistory"))}}function ps(e,t){if(1&e&&(s.TgZ(0,"div",77),s._uU(1),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.Oqu(e.desc)}}function gs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",74),s._uU(1,"\n "),s.TgZ(2,"input",75),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.YNc(6,ps,2,1,"div",76),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(2);s.xp6(2),s.MGl("id","type_",e.value,""),s.Q6J("ngModel",i.usernameOptions.type)("value",e.value)("checked",i.usernameOptions.type===e.value),s.xp6(2),s.MGl("for","type_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n "),s.xp6(1),s.Q6J("ngIf",e.desc)}}function vs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",28),s._uU(1,"\n "),s.TgZ(2,"input",80),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedService=t)}))("change",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(3);s.xp6(2),s.MGl("id","forwardtype_",e.value,""),s.Q6J("ngModel",i.usernameOptions.forwardedService)("value",e.value)("checked",i.usernameOptions.forwardedService===e.value),s.xp6(2),s.MGl("for","forwardtype_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function ys(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",81),s._uU(3,"\n "),s.TgZ(4,"label",82),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",83),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedSimpleLoginApiKey=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.BQk()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiKey")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedSimpleLoginApiKey)}}function fs(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",81),s._uU(3,"\n "),s.TgZ(4,"label",84),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",85),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedDuckDuckGoToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.BQk()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiKey")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedDuckDuckGoToken)}}function ms(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",81),s._uU(3,"\n "),s.TgZ(4,"label",86),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",87),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedAnonAddyApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",81),s._uU(12,"\n "),s.TgZ(13,"label",88),s._uU(14),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"input",89),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedAnonAddyDomain=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.BQk()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,4,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedAnonAddyApiToken),s.xp6(6),s.Oqu(s.lcZ(15,6,"domainName")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedAnonAddyDomain)}}function ws(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",81),s._uU(3,"\n "),s.TgZ(4,"label",90),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",91),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedFirefoxApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.BQk()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedFirefoxApiToken)}}function bs(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",81),s._uU(3,"\n "),s.TgZ(4,"label",92),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",93),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.usernameOptions.forwardedFastmailApiToken=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.BQk()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,2,"apiAccessToken")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.forwardedFastmailApiToken)}}function Ss(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"div",78),s._uU(5,"\n "),s.TgZ(6,"label",79),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.YNc(10,vs,7,6,"div",13),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.YNc(13,ys,11,4,"ng-container",14),s._uU(14,"\n "),s.YNc(15,fs,11,4,"ng-container",14),s._uU(16,"\n "),s.YNc(17,ms,20,8,"ng-container",14),s._uU(18,"\n "),s.YNc(19,ws,11,4,"ng-container",14),s._uU(20,"\n "),s.YNc(21,bs,11,4,"ng-container",14),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,7,"service")),s.xp6(3),s.Q6J("ngForOf",e.forwardOptions),s.xp6(3),s.Q6J("ngIf","simplelogin"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","duckduckgo"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","anonaddy"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","firefoxrelay"===e.usernameOptions.forwardedService),s.xp6(2),s.Q6J("ngIf","fastmail"===e.usernameOptions.forwardedService)}}function Us(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",28),s._uU(1,"\n "),s.TgZ(2,"input",100),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(4);return s.KtG(i.usernameOptions.subaddressType=t)}))("change",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(4);s.xp6(2),s.MGl("id","subaddresstype_",e.value,""),s.Q6J("ngModel",i.usernameOptions.subaddressType)("value",e.value)("checked",i.usernameOptions.subaddressType===e.value),s.xp6(2),s.MGl("for","subaddresstype_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function xs(e,t){if(1&e&&(s.TgZ(0,"div",98),s._uU(1,"\n "),s.TgZ(2,"label",99),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,Us,7,6,"div",13),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"type")),s.xp6(3),s.Q6J("ngForOf",e.subaddressOptions)}}function As(e,t){if(1&e&&(s.TgZ(0,"div",81),s._uU(1,"\n "),s.TgZ(2,"label",101),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"input",102),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"website")),s.xp6(3),s.Q6J("value",e.usernameOptions.website)}}function _s(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"div",81),s._uU(5,"\n "),s.TgZ(6,"label",94),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",95),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.subaddressEmail=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.YNc(13,xs,8,4,"div",96),s._uU(14,"\n "),s.YNc(15,As,8,4,"div",97),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,4,"emailAddress")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.subaddressEmail),s.xp6(3),s.Q6J("ngIf",e.subaddressOptions.length>1),s.xp6(2),s.Q6J("ngIf",e.usernameWebsite)}}function Zs(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",28),s._uU(1,"\n "),s.TgZ(2,"input",108),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(4);return s.KtG(i.usernameOptions.catchallType=t)}))("change",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",30),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(4);s.xp6(2),s.MGl("id","catchalltype_",e.value,""),s.Q6J("ngModel",i.usernameOptions.catchallType)("value",e.value)("checked",i.usernameOptions.catchallType===e.value),s.xp6(2),s.MGl("for","catchalltype_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function Ts(e,t){if(1&e&&(s.TgZ(0,"div",106),s._uU(1,"\n "),s.TgZ(2,"label",107),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,Zs,7,6,"div",13),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"type")),s.xp6(3),s.Q6J("ngForOf",e.catchallOptions)}}function Cs(e,t){if(1&e&&(s.TgZ(0,"div",81),s._uU(1,"\n "),s.TgZ(2,"label",109),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"input",110),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"website")),s.xp6(3),s.Q6J("value",e.usernameOptions.website)}}function ks(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"div",81),s._uU(5,"\n "),s.TgZ(6,"label",103),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",104),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.catchallDomain=t)}))("blur",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.YNc(13,Ts,8,4,"div",105),s._uU(14,"\n "),s.YNc(15,Cs,8,4,"div",97),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,4,"domainName")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.catchallDomain),s.xp6(3),s.Q6J("ngIf",e.catchallOptions.length>1),s.xp6(2),s.Q6J("ngIf",e.usernameWebsite)}}function Os(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",10),s._uU(3,"\n "),s.TgZ(4,"div",46),s._uU(5,"\n "),s.TgZ(6,"label",47),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",111),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.wordCapitalize=t)})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",46),s._uU(14,"\n "),s.TgZ(15,"label",49),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"input",112),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveUsernameOptions())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.usernameOptions.wordIncludeNumber=t)})),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,4,"capitalize")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.wordCapitalize),s.xp6(6),s.Oqu(s.lcZ(17,6,"includeNumber")),s.xp6(3),s.Q6J("ngModel",e.usernameOptions.wordIncludeNumber)}}function Ps(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",9),s._uU(3,"\n "),s.TgZ(4,"h2",31),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",10),s._uU(9,"\n "),s.TgZ(10,"div",69),s._uU(11,"\n "),s.TgZ(12,"label",70),s._uU(13),s.ALo(14,"i18n"),s.TgZ(15,"a",71),s.ALo(16,"i18n"),s._uU(17,"\n "),s._UZ(18,"i",72),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.YNc(22,gs,9,7,"div",73),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.YNc(27,Ss,24,9,"div",34),s._uU(28,"\n "),s.YNc(29,_s,18,6,"div",34),s._uU(30,"\n "),s.YNc(31,ks,18,6,"div",34),s._uU(32,"\n "),s.YNc(33,Os,23,8,"div",34),s._uU(34,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.hij("\n ",s.lcZ(6,8,"options"),"\n "),s.xp6(8),s.hij("\n ",s.lcZ(14,10,"usernameType"),"\n "),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(16,12,"learnMore")),s.xp6(7),s.Q6J("ngForOf",e.usernameTypeOptions),s.xp6(5),s.Q6J("ngIf","forwarded"===e.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","subaddress"===e.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","catchall"===e.usernameOptions.type),s.xp6(2),s.Q6J("ngIf","word"===e.usernameOptions.type)}}class Is extends Wn{constructor(e,t,i,n,s,o,r,a){super(e,t,i,s,n,r,o,window),this.location=a}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t,i;return is(this,void 0,void 0,(function*(){this.addEditCipherInfo=yield this.stateService.getAddEditCipherInfo(),null!=this.addEditCipherInfo&&(this.cipherState=this.addEditCipherInfo.cipher),this.comingFromAddEdit=null!=this.cipherState,(null===(i=null===(t=this.cipherState)||void 0===t?void 0:t.login)||void 0===i?void 0:i.hasUris)&&(this.usernameWebsite=this.cipherState.login.uris[0].hostname),yield e.ngOnInit.call(this)}))}select(){super.select(),"password"===this.type?this.cipherState.login.password=this.password:"username"===this.type&&(this.cipherState.login.username=this.username),this.addEditCipherInfo.cipher=this.cipherState,this.stateService.setAddEditCipherInfo(this.addEditCipherInfo),this.close()}close(){this.location.back()}}Is.ɵfac=function(e){return new(e||Is)(s.Y36(Dt),s.Y36(Hn),s.Y36(Je),s.Y36(_e),s.Y36(Mt),s.Y36(Pe.gz),s.Y36(Ct),s.Y36(u.Ye))},Is.ɵcmp=s.Xpm({type:Is,selectors:[["app-generator"]],features:[s.qOj],decls:50,vars:15,consts:[[1,"left"],[3,"show"],["type","button",3,"click",4,"ngIf"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],["type","info",4,"ngIf"],["class","generated-block",4,"ngIf"],[1,"box"],[1,"box-content"],["role","radiogroup","aria-labelledby","typeHeading",1,"box-content-row"],["id","typeHeading",1,"radio-header"],["class","radio-group text-default","appBoxRow","",4,"ngFor","ngForOf"],[4,"ngIf"],["type","button",3,"click"],["type","info"],[1,"generated-block"],["appSelectCopy","",1,"generated-wrapper",3,"innerHTML"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["type","button","appStopClick","",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-generate"],[1,"action-buttons",3,"appApiAction"],["form",""],["type","button","appStopClick","",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-generate",3,"ngClass"],["appBoxRow","",1,"radio-group","text-default"],["type","radio","name","Type",3,"ngModel","id","value","checked","disabled","ngModelChange","change"],[3,"for"],[1,"box-header"],["role","radiogroup","aria-labelledby","passwordTypeHeading",1,"box-content-row"],["id","passwordTypeHeading",1,"radio-header"],["class","box",4,"ngIf"],[1,"box","list"],[1,"box-content","single-line"],["routerLink","/generator-history",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["aria-hidden","true",1,"bwi","bwi-angle-right","bwi-lg","row-sub-icon"],["type","radio","name","PasswordType",3,"ngModel","id","value","checked","ngModelChange","change"],["appBoxRow","",1,"box-content-row","box-content-row-input"],["for","num-words"],["id","num-words","type","number","min","3","max","20",3,"ngModel","change","ngModelChange"],["for","word-separator"],["id","word-separator","type","text","maxlength","1",3,"ngModel","input","ngModelChange"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","capitalize"],["id","capitalize","type","checkbox",3,"ngModel","disabled","change","ngModelChange"],["for","include-number"],["id","include-number","type","checkbox",3,"ngModel","disabled","change","ngModelChange"],["appBoxRow","",1,"box-content-row","box-content-row-slider"],["for","length"],["id","length","type","number","min","5","max","128",3,"ngModel","ngModelChange","change"],["id","lengthRange","type","range","min","5","max","128","step","1","tabindex","-1",3,"ngModel","ngModelChange","change","input"],["for","uppercase"],["id","uppercase","type","checkbox",3,"disabled","ngModel","change","ngModelChange"],["for","lowercase"],["id","lowercase","type","checkbox",3,"disabled","ngModel","change","ngModelChange"],["for","numbers"],["id","numbers","type","checkbox",3,"disabled","ngModel","change","ngModelChange"],["for","special"],["id","special","type","checkbox",3,"disabled","ngModel","change","ngModelChange"],["for","min-number"],["id","min-number","type","number","min","0","max","9",3,"ngModel","change","ngModelChange"],["for","min-special"],["id","min-special","type","number","min","0","max","9",3,"ngModel","change","ngModelChange"],["for","ambiguous"],["id","ambiguous","type","checkbox",3,"ngModel","change","ngModelChange"],["role","radiogroup","aria-labelledby","usernameTypeHeading",1,"box-content-row"],["id","usernameTypeHeading",1,"radio-header"],["href","https://bitwarden.com/help/generator/#username-types","target","_blank","rel","noopener",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["class","radio-group align-start text-default","appBoxRow","",4,"ngFor","ngForOf"],["appBoxRow","",1,"radio-group","align-start","text-default"],["type","radio","name","UsernameType",3,"ngModel","id","value","checked","ngModelChange","change"],["class","small text-muted",4,"ngIf"],[1,"small","text-muted"],["role","radiogroup","aria-labelledby","forwardTypeHeading",1,"box-content-row"],["id","forwardTypeHeading",1,"radio-header"],["type","radio","name","ForwardType",3,"ngModel","id","value","checked","ngModelChange","change"],["appBoxRow","",1,"box-content-row"],["for","simplelogin-apikey"],["id","simplelogin-apikey","type","password","name","SimpleLoginApiKey",3,"ngModel","ngModelChange","blur"],["for","duckduckgo-apikey"],["id","duckduckgo-apikey","type","password","name","DuckDudkGoApiKey",3,"ngModel","ngModelChange","blur"],["for","anonaddy-accessToken"],["id","anonaddy-accessToken","type","password","name","AnonAddyAccessToken",3,"ngModel","ngModelChange","blur"],["for","anonaddy-domain"],["id","anonaddy-domain","type","text","name","AnonAddyDomain",3,"ngModel","ngModelChange","blur"],["for","firefox-apikey"],["id","firefox-apikey","type","password","name","FirefoxApiKey",3,"ngModel","ngModelChange","blur"],["for","fastmail-apiToken"],["id","fastmail-apiToken","type","password","name","FastmailApiToken",3,"ngModel","ngModelChange","blur"],["for","subaddress-email"],["id","subaddress-email","type","text","name","SubaddressEmail",3,"ngModel","ngModelChange","blur"],["class","box-content-row","role","radiogroup","aria-labelledby","subaddressTypeHeading",4,"ngIf"],["class","box-content-row","appBoxRow","",4,"ngIf"],["role","radiogroup","aria-labelledby","subaddressTypeHeading",1,"box-content-row"],["id","subaddressTypeHeading",1,"radio-header"],["type","radio","name","SubaddressType",3,"ngModel","id","value","checked","ngModelChange","change"],["for","subaddress-website"],["id","subaddress-website","type","text","name","SubaddressWebsite","disabled","","readonly","",3,"value"],["for","catchall-domain"],["id","catchall-domain","type","text","name","CatchallDomain",3,"ngModel","ngModelChange","blur"],["class","box-content-row","role","radiogroup","aria-labelledby","catchallTypeHeading",4,"ngIf"],["role","radiogroup","aria-labelledby","catchallTypeHeading",1,"box-content-row"],["id","catchallTypeHeading",1,"radio-header"],["type","radio","name","CatchallType",3,"ngModel","id","value","checked","ngModelChange","change"],["for","catchall-website"],["id","catchall-website","type","text","name","CatchallWebsite","disabled","","readonly","",3,"value"],["id","capitalize","type","checkbox",3,"ngModel","change","ngModelChange"],["id","include-number","type","checkbox",3,"ngModel","change","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s._UZ(4,"app-pop-out",1),s._uU(5,"\n "),s.YNc(6,ns,3,3,"button",2),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"h1",3),s._uU(10,"\n "),s.TgZ(11,"span",4),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"div",5),s._uU(17,"\n "),s.YNc(18,ss,3,3,"button",2),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n"),s.qZA(),s._uU(21,"\n"),s.TgZ(22,"main",6),s._uU(23,"\n "),s.YNc(24,os,3,3,"app-callout",7),s._uU(25,"\n "),s.YNc(26,rs,20,9,"div",8),s._uU(27,"\n "),s.YNc(28,as,21,12,"div",8),s._uU(29,"\n "),s.TgZ(30,"div",9),s._uU(31,"\n "),s.TgZ(32,"div",10),s._uU(33,"\n "),s.TgZ(34,"div",11),s._uU(35,"\n "),s.TgZ(36,"label",12),s._uU(37),s.ALo(38,"i18n"),s.qZA(),s._uU(39,"\n "),s.YNc(40,ls,7,7,"div",13),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.YNc(45,hs,40,12,"ng-container",14),s._uU(46,"\n "),s.YNc(47,Ps,35,14,"ng-container",14),s._uU(48,"\n"),s.qZA(),s._uU(49,"\n")),2&e&&(s.xp6(4),s.Q6J("show",!t.comingFromAddEdit),s.xp6(2),s.Q6J("ngIf",t.comingFromAddEdit),s.xp6(6),s.Oqu(s.lcZ(13,11,"generator")),s.xp6(6),s.Q6J("ngIf",t.comingFromAddEdit),s.xp6(6),s.Q6J("ngIf",(null==t.enforcedPasswordPolicyOptions?null:t.enforcedPasswordPolicyOptions.inEffect())&&"password"===t.type),s.xp6(2),s.Q6J("ngIf","password"===t.type),s.xp6(2),s.Q6J("ngIf","username"===t.type),s.xp6(9),s.Oqu(s.lcZ(38,13,"whatWouldYouLikeToGenerate")),s.xp6(3),s.Q6J("ngForOf",t.typeOptions),s.xp6(5),s.Q6J("ngIf","password"===t.type),s.xp6(2),s.Q6J("ngIf","username"===t.type))},dependencies:[Pe.yS,u.mk,u.sg,u.O5,ue.Fj,ue.wV,ue.eT,ue.Wl,ue._,ue.JJ,ue.nD,ue.qQ,ue.Fd,ue.On,Ht,Ot,Xe,wt,$n,St,es,ts,Ze],encapsulation:2});var qs,Ds,Ms=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Fs{constructor(e,t,i,n){this.passwordGenerationService=e,this.platformUtilsService=t,this.i18nService=i,this.win=n,this.history=[]}ngOnInit(){return Ms(this,void 0,void 0,(function*(){this.history=yield this.passwordGenerationService.getHistory()}))}clear(){this.history=[],this.passwordGenerationService.clear()}copy(e){const t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t("password")))}}function Ns(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"div",14),s._uU(3,"\n "),s.TgZ(4,"div",15),s._uU(5,"\n "),s._UZ(6,"div",16),s.ALo(7,"colorPassword"),s._uU(8,"\n "),s.TgZ(9,"span",17),s._uU(10),s.ALo(11,"date"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"div",18),s._uU(16,"\n "),s.TgZ(17,"button",19),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.copy(t.password))})),s.ALo(18,"i18n"),s._uU(19,"\n "),s._UZ(20,"i",20),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(6),s.Q6J("innerHTML",s.lcZ(7,3,e.password),s.oJD),s.xp6(4),s.Oqu(s.xi3(11,5,e.date,"medium")),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(18,8,"copyPassword"))}}function Ls(e,t){if(1&e&&(s.TgZ(0,"div",10),s._uU(1,"\n "),s.TgZ(2,"div",11),s._uU(3,"\n "),s.YNc(4,Ns,24,10,"div",12),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.history)}}function Es(e,t){1&e&&(s.TgZ(0,"div",21),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"noPasswordsInList")))}Fs.ɵfac=function(e){return new(e||Fs)(s.Y36(Dt),s.Y36(Je),s.Y36(_e),s.Y36(Window))},Fs.ɵdir=s.lG2({type:Fs});class Rs extends Fs{constructor(e,t,i,n){super(e,t,i,window),this.location=n}close(){this.location.back()}}Rs.ɵfac=function(e){return new(e||Rs)(s.Y36(Dt),s.Y36(Je),s.Y36(_e),s.Y36(u.Ye))},Rs.ɵcmp=s.Xpm({type:Rs,selectors:[["app-password-generator-history"]],features:[s.qOj],decls:37,vars:11,consts:[[1,"left"],["type","button","type","button",3,"click"],["aria-hidden","true",1,"header-icon"],[1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],["class","box list full-list",4,"ngIf"],["class","no-items",4,"ngIf"],[1,"box","list","full-list"],[1,"box-content"],["class","box-content-row box-content-row-flex",4,"ngFor","ngForOf"],[1,"box-content-row","box-content-row-flex"],[1,"row-main"],[1,"row-main-content"],["appSelectCopy","",1,"monospaced","password-wrapper",3,"innerHTML"],[1,"detail"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],[1,"no-items"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.close()})),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16,"\n "),s.TgZ(17,"span",5),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"div",6),s._uU(23,"\n "),s.TgZ(24,"button",1),s.NdJ("click",(function(){return t.clear()})),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n"),s.qZA(),s._uU(29,"\n"),s.TgZ(30,"main",7),s._uU(31,"\n "),s.YNc(32,Ls,7,1,"div",8),s._uU(33,"\n "),s.YNc(34,Es,6,3,"div",9),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,5,"back")),s.xp6(8),s.Oqu(s.lcZ(19,7,"passwordHistory")),s.xp6(7),s.hij("\n ",s.lcZ(26,9,"clear"),"\n "),s.xp6(7),s.Q6J("ngIf",t.history&&t.history.length),s.xp6(2),s.Q6J("ngIf",!t.history||!t.history.length))},dependencies:[u.sg,u.O5,Ht,$n,St,u.uU,ts,Ze],encapsulation:2}),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"}(qs||(qs={})),function(e){e[e.Text=0]="Text",e[e.File=1]="File"}(Ds||(Ds={}));class Js{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}}class Ys{constructor(e){this.text=null,e&&(this.hidden=e.hidden)}get maskedText(){return null!=this.text?"••••••••":null}}class zs{constructor(e){this.id=null,this.accessId=null,this.name=null,this.notes=null,this.type=null,this.text=new Ys,this.file=new Js,this.maxAccessCount=null,this.accessCount=0,this.revisionDate=null,this.deletionDate=null,this.expirationDate=null,this.password=null,this.disabled=!1,this.hideEmail=!1,e&&(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.deletionDate=e.deletionDate,this.expirationDate=e.expirationDate,this.disabled=e.disabled,this.password=e.password,this.hideEmail=e.hideEmail)}get urlB64Key(){return nt.fromBufferToUrlB64(this.key)}get maxAccessCountReached(){return null!=this.maxAccessCount&&this.accessCount>=this.maxAccessCount}get expired(){return null!=this.expirationDate&&this.expirationDate<=new Date}get pendingDelete(){return this.deletionDate<=new Date}}class Ks{}var Bs,Gs,Qs,Vs=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hs{constructor(e,t,i,n,o,r,a,l,c){this.i18nService=e,this.platformUtilsService=t,this.environmentService=i,this.datePipe=n,this.sendService=o,this.messagingService=r,this.policyService=a,this.logService=l,this.stateService=c,this.onSavedSend=new s.vpe,this.onDeletedSend=new s.vpe,this.onCancelled=new s.vpe,this.copyLink=!1,this.disableSend=!1,this.disableHideEmail=!1,this.showPassword=!1,this.sendType=Ds,this.canAccessPremium=!0,this.emailVerified=!0,this.alertShown=!1,this.showOptions=!1,this.typeOptions=[{name:e.t("sendTypeFile"),value:Ds.File},{name:e.t("sendTypeText"),value:Ds.Text}],this.sendLinkBaseUrl=this.environmentService.getSendUrl()}get link(){return null!=this.send.id&&null!=this.send.accessId?this.sendLinkBaseUrl+this.send.accessId+"/"+this.send.urlB64Key:null}get isSafari(){return this.platformUtilsService.isSafari()}get isDateTimeLocalSupported(){return!(this.platformUtilsService.isFirefox()||this.platformUtilsService.isSafari())}ngOnInit(){return Vs(this,void 0,void 0,(function*(){yield this.load()}))}get editMode(){return null!=this.sendId}get title(){return this.i18nService.t(this.editMode?"editSend":"createSend")}setDates(e){this.deletionDate=e.deletionDate,this.expirationDate=e.expirationDate}load(){return Vs(this,void 0,void 0,(function*(){if(this.disableSend=yield this.policyService.policyAppliesToUser(qs.DisableSend),this.disableHideEmail=yield this.policyService.policyAppliesToUser(qs.SendOptions,(e=>e.data.disableHideEmail)),this.canAccessPremium=yield this.stateService.getCanAccessPremium(),this.emailVerified=yield this.stateService.getEmailVerified(),this.canAccessPremium&&this.emailVerified||(this.type=Ds.Text),null==this.send)if(this.editMode){const e=yield this.loadSend();this.send=yield e.decrypt()}else this.send=new zs,this.send.type=null==this.type?Ds.File:this.type,this.send.file=new Js,this.send.text=new Ys,this.send.deletionDate=new Date,this.send.deletionDate.setDate(this.send.deletionDate.getDate()+7);this.hasPassword=null!=this.send.password&&""!==this.send.password.trim()}))}submit(){return Vs(this,void 0,void 0,(function*(){if(this.disableSend)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("sendDisabledWarning")),!1;if(null==this.send.name||""===this.send.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;let e=null;if(this.send.type===Ds.File&&!this.editMode){const t=document.getElementById("file").files;if(null==t||0===t.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile"));if(e=t[0],t[0].size>524288e3)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize"))}null!=this.password&&""===this.password.trim()&&(this.password=null),this.formPromise=this.encryptSend(e).then((e=>Vs(this,void 0,void 0,(function*(){const t=this.sendService.saveWithServer(e);if(yield t,null==this.send.id&&(this.send.id=e[0].id),null==this.send.accessId&&(this.send.accessId=e[0].accessId),this.onSavedSend.emit(this.send),this.copyLink&&null!=this.link){const e=yield this.copyLinkToClipboard(this.link);null==e||e?this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedSend":"createdSend")):(yield this.platformUtilsService.showDialog(this.i18nService.t(this.editMode?"editedSend":"createdSend"),null,this.i18nService.t("ok"),null,"success",null),yield this.copyLinkToClipboard(this.link))}}))));try{return yield this.formPromise,!0}catch(e){this.logService.error(e)}return!1}))}copyLinkToClipboard(e){return Vs(this,void 0,void 0,(function*(){return Promise.resolve(this.platformUtilsService.copyToClipboard(e))}))}delete(){return Vs(this,void 0,void 0,(function*(){if(null!=this.deletePromise)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteSendConfirmation"),this.i18nService.t("deleteSend"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{return this.deletePromise=this.sendService.deleteWithServer(this.send.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.load(),this.onDeletedSend.emit(this.send),!0}catch(e){this.logService.error(e)}return!1}))}typeChanged(){this.send.type!==Ds.File||this.alertShown||(this.canAccessPremium?this.emailVerified||(this.alertShown=!0,this.messagingService.send("emailVerificationRequired")):(this.alertShown=!0,this.messagingService.send("premiumRequired")))}toggleOptions(){this.showOptions=!this.showOptions}loadSend(){return Vs(this,void 0,void 0,(function*(){return this.sendService.get(this.sendId)}))}encryptSend(e){return Vs(this,void 0,void 0,(function*(){const t=yield this.sendService.encrypt(this.send,e,this.password,null);try{t[0].deletionDate=null==this.deletionDate?null:new Date(this.deletionDate)}catch(e){t[0].deletionDate=null}try{t[0].expirationDate=null==this.expirationDate?null:new Date(this.expirationDate)}catch(e){t[0].expirationDate=null}return t}))}togglePasswordVisible(){this.showPassword=!this.showPassword,document.getElementById("password").focus()}}Hs.ɵfac=function(e){return new(e||Hs)(s.Y36(_e),s.Y36(Je),s.Y36(Ye),s.Y36(u.uU),s.Y36(Ks),s.Y36(qe),s.Y36(Hi),s.Y36(Ct),s.Y36(Mt))},Hs.ɵdir=s.lG2({type:Hs,inputs:{sendId:"sendId",type:"type"},outputs:{onSavedSend:"onSavedSend",onDeletedSend:"onDeletedSend",onCancelled:"onCancelled"}});class js extends Mt{}!function(e){e.Default="default",e.Firefox="firefox",e.Safari="safari"}(Bs||(Bs={})),function(e){e.DeletionDate="deletion",e.ExpriationDate="expiration"}(Gs||(Gs={})),function(e){e[e.OneHour=1]="OneHour",e[e.OneDay=24]="OneDay",e[e.TwoDays=48]="TwoDays",e[e.ThreeDays=72]="ThreeDays",e[e.SevenDays=168]="SevenDays",e[e.ThirtyDays=720]="ThirtyDays",e[e.Custom=0]="Custom",e[e.Never=null]="Never"}(Qs||(Qs={}));class Ws{constructor(e,t,i){this.i18nService=e,this.platformUtilsService=t,this.datePipe=i,this.datesChanged=new s.vpe,this.datesForm=new ue.nJ({selectedDeletionDatePreset:new ue.p4,selectedExpirationDatePreset:new ue.p4,defaultDeletionDateTime:new ue.p4,defaultExpirationDateTime:new ue.p4,fallbackDeletionDate:new ue.p4,fallbackDeletionTime:new ue.p4,fallbackExpirationDate:new ue.p4,fallbackExpirationTime:new ue.p4}),this.deletionDatePresets=[{name:this.i18nService.t("oneHour"),value:Qs.OneHour},{name:this.i18nService.t("oneDay"),value:Qs.OneDay},{name:this.i18nService.t("days","2"),value:Qs.TwoDays},{name:this.i18nService.t("days","3"),value:Qs.ThreeDays},{name:this.i18nService.t("days","7"),value:Qs.SevenDays},{name:this.i18nService.t("days","30"),value:Qs.ThirtyDays},{name:this.i18nService.t("custom"),value:Qs.Custom}],this.expirationDatePresets=[{name:this.i18nService.t("never"),value:Qs.Never}].concat([...this.deletionDatePresets])}get browserPath(){return this.platformUtilsService.isFirefox()?Bs.Firefox:this.platformUtilsService.isSafari()?Bs.Safari:Bs.Default}get selectedDeletionDatePreset(){return this.datesForm.get("selectedDeletionDatePreset")}get selectedExpirationDatePreset(){return this.datesForm.get("selectedExpirationDatePreset")}get defaultDeletionDateTime(){return this.datesForm.get("defaultDeletionDateTime")}get defaultExpirationDateTime(){return this.datesForm.get("defaultExpirationDateTime")}get fallbackDeletionDate(){return this.datesForm.get("fallbackDeletionDate")}get fallbackDeletionTime(){return this.datesForm.get("fallbackDeletionTime")}get fallbackExpirationDate(){return this.datesForm.get("fallbackExpirationDate")}get fallbackExpirationTime(){return this.datesForm.get("fallbackExpirationTime")}get formattedDeletionDate(){switch(this.selectedDeletionDatePreset.value){case Qs.Never:return this.selectedDeletionDatePreset.setValue(Qs.SevenDays),this.formattedDeletionDate;case Qs.Custom:switch(this.browserPath){case Bs.Safari:case Bs.Firefox:return this.fallbackDeletionDate.value+"T"+this.fallbackDeletionTime.value;default:return this.defaultDeletionDateTime.value}default:{const e=new Date,t=e.setTime(e.getTime()+60*this.selectedDeletionDatePreset.value*60*1e3);return new Date(t).toString()}}}get formattedExpirationDate(){switch(this.selectedExpirationDatePreset.value){case Qs.Never:return null;case Qs.Custom:switch(this.browserPath){case Bs.Safari:case Bs.Firefox:return this.fallbackExpirationDate.value&&this.fallbackExpirationTime.value||!this.editMode?this.fallbackExpirationDate.value+"T"+this.fallbackExpirationTime.value:null;default:return this.defaultExpirationDateTime.value?this.defaultExpirationDateTime.value:null}default:{const e=new Date,t=e.setTime(e.getTime()+60*this.selectedExpirationDatePreset.value*60*1e3);return new Date(t).toString()}}}get safariDeletionTimePresetOptions(){return this.safariTimePresetOptions(Gs.DeletionDate)}get safariExpirationTimePresetOptions(){return this.safariTimePresetOptions(Gs.ExpriationDate)}get nextWeek(){const e=new Date;return e.setDate(e.getDate()+7),e}ngOnInit(){this.setInitialFormValues(),this.emitDates(),this.datesForm.valueChanges.subscribe((()=>{this.emitDates()}))}onDeletionDatePresetSelect(e){this.selectedDeletionDatePreset.setValue(e)}clearExpiration(){switch(this.browserPath){case Bs.Safari:case Bs.Firefox:this.fallbackExpirationDate.setValue(null),this.fallbackExpirationTime.setValue(null);break;case Bs.Default:this.defaultExpirationDateTime.setValue(null)}}emitDates(){this.datesChanged.emit({deletionDate:this.formattedDeletionDate,expirationDate:this.formattedExpirationDate})}setInitialFormValues(){if(this.editMode)switch(this.selectedDeletionDatePreset.setValue(Qs.Custom),this.selectedExpirationDatePreset.setValue(Qs.Custom),this.browserPath){case Bs.Safari:case Bs.Firefox:this.fallbackDeletionDate.setValue(this.initialDeletionDate.toISOString().slice(0,10)),this.fallbackDeletionTime.setValue(this.initialDeletionDate.toTimeString().slice(0,5)),null!=this.initialExpirationDate&&(this.fallbackExpirationDate.setValue(this.initialExpirationDate.toISOString().slice(0,10)),this.fallbackExpirationTime.setValue(this.initialExpirationDate.toTimeString().slice(0,5)));break;case Bs.Default:this.initialExpirationDate&&this.defaultExpirationDateTime.setValue(this.datePipe.transform(new Date(this.initialExpirationDate),"yyyy-MM-ddTHH:mm")),this.defaultDeletionDateTime.setValue(this.datePipe.transform(new Date(this.initialDeletionDate),"yyyy-MM-ddTHH:mm"))}else if(this.selectedDeletionDatePreset.setValue(Qs.SevenDays),this.selectedExpirationDatePreset.setValue(Qs.Never),this.browserPath===Bs.Safari)this.fallbackDeletionDate.setValue(this.nextWeek.toISOString().slice(0,10)),this.fallbackDeletionTime.setValue(this.safariTimePresetOptions(Gs.DeletionDate)[1].twentyFourHour)}safariTimePresetOptions(e){const t=[],i=[],n=[],s=[];for(let e=1;e<=12;e++)for(let o=0;o<60;o+=15){let r=e.toString(),a=o.toString();if(e<10&&(r="0"+r),o<10&&(a="0"+a),12===e){const e={twelveHour:`${r}:${a} AM`,twentyFourHour:`00:${a}`};i.push(e);const n={twelveHour:`${r}:${a} PM`,twentyFourHour:`${r}:${a}`};t.push(n)}else{const t={twelveHour:`${r}:${a} AM`,twentyFourHour:`${r}:${a}`};n.push(t);const i={twelveHour:`${r}:${a} PM`,twentyFourHour:`${e+12}:${a}`};s.push(i)}}const o=[...i,...n,...t,...s];if(e===Gs.ExpriationDate&&null!=this.initialExpirationDate&&this.editMode){return[{twelveHour:this.datePipe.transform(this.initialExpirationDate,"hh:mm a"),twentyFourHour:this.datePipe.transform(this.initialExpirationDate,"HH:mm")},{twelveHour:null,twentyFourHour:null},...o]}if(e===Gs.DeletionDate&&null!=this.initialDeletionDate&&this.editMode){return[{twelveHour:this.datePipe.transform(this.initialDeletionDate,"hh:mm a"),twentyFourHour:this.datePipe.transform(this.initialDeletionDate,"HH:mm")},...o]}return[{twelveHour:null,twentyFourHour:null},...o]}}function $s(e,t){if(1&e&&(s.TgZ(0,"option",12),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Xs(e,t){1&e&&s.GkF(0)}function eo(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.YNc(2,Xs,1,0,"ng-container",13),s._uU(3,"\n "),s.qZA()),2&e){s.oxw(2);const e=s.MAs(35);s.xp6(2),s.Q6J("ngTemplateOutlet",e)}}function to(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",8),s._uU(3,"\n "),s.TgZ(4,"label",9),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"select",10),s._uU(9,"\n "),s.YNc(10,$s,2,2,"option",11),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.YNc(14,eo,4,1,"div",4),s._uU(15,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,3,"deletionDate")),s.xp6(5),s.Q6J("ngForOf",e.deletionDatePresets),s.xp6(4),s.Q6J("ngIf",0===e.selectedDeletionDatePreset.value)}}function io(e,t){1&e&&s.GkF(0)}function no(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.TgZ(2,"label",9),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,io,1,0,"ng-container",13),s._uU(7,"\n "),s.qZA()),2&e){s.oxw();const e=s.MAs(35);s.xp6(3),s.Oqu(s.lcZ(4,2,"deletionDate")),s.xp6(3),s.Q6J("ngTemplateOutlet",e)}}function so(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s._UZ(2,"br"),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"a",14),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.popOutWindow.emit())})),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8),s.ALo(9,"i18n"),s.BQk()}2&e&&(s.xp6(3),s.hij("",s.lcZ(4,3,"sendFirefoxCustomDatePopoutMessage1"),"\n "),s.xp6(3),s.Oqu(s.lcZ(7,5,"sendFirefoxCustomDatePopoutMessage2")),s.xp6(2),s.hij("\n ",s.lcZ(9,7,"sendFirefoxCustomDatePopoutMessage3"),"\n "))}function oo(e,t){if(1&e&&(s.TgZ(0,"option",12),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function ro(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.TgZ(2,"label",15),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"select",16),s._uU(7,"\n "),s.YNc(8,oo,2,2,"option",11),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,2,"expirationDate")),s.xp6(5),s.Q6J("ngForOf",e.expirationDatePresets)}}function ao(e,t){1&e&&s.GkF(0)}function lo(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.YNc(2,ao,1,0,"ng-container",13),s._uU(3,"\n "),s.qZA()),2&e){s.oxw(2);const e=s.MAs(38);s.xp6(2),s.Q6J("ngTemplateOutlet",e)}}function co(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,ro,11,4,"div",4),s._uU(3,"\n "),s.YNc(4,lo,4,1,"div",4),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.editMode),s.xp6(2),s.Q6J("ngIf",0===e.selectedExpirationDatePreset.value)}}function uo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",19),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.clearExpiration())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"clear"),"\n "))}function ho(e,t){1&e&&s.GkF(0)}function po(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.TgZ(2,"div",17),s._uU(3,"\n "),s.TgZ(4,"label"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.YNc(8,uo,3,3,"button",18),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.YNc(11,ho,1,0,"ng-container",13),s._uU(12,"\n "),s.qZA()),2&e){const e=s.oxw(),t=s.MAs(38);s.xp6(5),s.Oqu(s.lcZ(6,3,"expirationDate")),s.xp6(3),s.Q6J("ngIf",!e.disabled),s.xp6(3),s.Q6J("ngTemplateOutlet",t)}}function go(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s._UZ(2,"br"),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"a",14),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.popOutWindow.emit())})),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8),s.ALo(9,"i18n"),s.BQk()}2&e&&(s.xp6(3),s.hij("",s.lcZ(4,3,"sendFirefoxCustomDatePopoutMessage1"),"\n "),s.xp6(3),s.Oqu(s.lcZ(7,5,"sendFirefoxCustomDatePopoutMessage2")),s.xp6(2),s.hij("\n ",s.lcZ(9,7,"sendFirefoxCustomDatePopoutMessage3"),"\n "))}function vo(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s._UZ(4,"input",24),s._uU(5,"\n "),s._UZ(6,"input",25),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("readOnly",e.disabled),s.xp6(2),s.Q6J("readOnly",e.disabled)}}function yo(e,t){if(1&e&&(s.TgZ(0,"option",12),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.twentyFourHour),s.xp6(1),s.hij("\n ",e.twelveHour,"\n ")}}function fo(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s._UZ(4,"input",24),s._uU(5,"\n "),s.TgZ(6,"select",26),s._uU(7,"\n "),s.YNc(8,yo,2,2,"option",11),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("readOnly",e.disabled),s.xp6(4),s.Q6J("ngForOf",e.safariDeletionTimePresetOptions)}}function mo(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"input",27),s._uU(3,"\n "),s.BQk())}function wo(e,t){if(1&e&&(s._uU(0,"\n "),s.ynx(1,20),s._uU(2,"\n "),s.YNc(3,vo,9,2,"ng-container",21),s._uU(4,"\n "),s.YNc(5,fo,12,2,"ng-container",21),s._uU(6,"\n "),s.YNc(7,mo,4,0,"ng-container",22),s._uU(8,"\n "),s.BQk(),s._uU(9,"\n ")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngSwitch",e.browserPath),s.xp6(2),s.Q6J("ngSwitchCase","firefox"),s.xp6(2),s.Q6J("ngSwitchCase","safari")}}function bo(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s._UZ(4,"input",28),s._uU(5,"\n "),s._UZ(6,"input",29),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("required",!e.editMode)("readOnly",e.disabled),s.xp6(2),s.Q6J("required",!e.editMode)("readOnly",e.disabled)}}function So(e,t){if(1&e&&(s.TgZ(0,"option",12),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.twentyFourHour),s.xp6(1),s.hij("\n ",e.twelveHour,"\n ")}}function Uo(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s._UZ(4,"input",28),s._uU(5,"\n "),s.TgZ(6,"select",30),s._uU(7,"\n "),s.YNc(8,So,2,2,"option",11),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("required",!e.editMode)("readOnly",e.disabled),s.xp6(4),s.Q6J("ngForOf",e.safariExpirationTimePresetOptions)}}function xo(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"input",31),s._uU(3,"\n "),s.BQk()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("readOnly",e.disabled)}}function Ao(e,t){if(1&e&&(s._uU(0,"\n "),s.ynx(1,20),s._uU(2,"\n "),s.YNc(3,bo,9,4,"ng-container",21),s._uU(4,"\n "),s.YNc(5,Uo,12,3,"ng-container",21),s._uU(6,"\n "),s.YNc(7,xo,4,1,"ng-container",22),s._uU(8,"\n "),s.BQk(),s._uU(9,"\n ")),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngSwitch",e.browserPath),s.xp6(2),s.Q6J("ngSwitchCase","firefox"),s.xp6(2),s.Q6J("ngSwitchCase","safari")}}Ws.ɵfac=function(e){return new(e||Ws)(s.Y36(_e),s.Y36(Je),s.Y36(u.uU))},Ws.ɵdir=s.lG2({type:Ws,inputs:{initialDeletionDate:"initialDeletionDate",initialExpirationDate:"initialExpirationDate",editMode:"editMode",disabled:"disabled"},outputs:{datesChanged:"datesChanged"}});class _o extends Ws{constructor(e,t,i){super(e,t,i),this.i18nService=e,this.platformUtilsService=t,this.datePipe=i,this.popOutWindow=new s.vpe}}_o.ɵfac=function(e){return new(e||_o)(s.Y36(_e),s.Y36(Je),s.Y36(u.uU))},_o.ɵcmp=s.Xpm({type:_o,selectors:[["app-send-efflux-dates"]],inputs:{inPopout:"inPopout"},outputs:{popOutWindow:"popOutWindow"},features:[s._Bn([],[{provide:ue.gN,useExisting:ue.F}]),s.qOj],decls:41,vars:13,consts:[[3,"formGroup"],[1,"box"],[1,"box-content"],[4,"ngIf"],["class","box-content-row","appBoxRow","",4,"ngIf"],[1,"box-footer"],["deletionDateCustom",""],["expirationDateCustom",""],["appBoxRow","",1,"box-content-row"],["for","deletionDate"],["id","deletionDate","name","DeletionDateSelect","formControlName","selectedDeletionDatePreset","required",""],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[4,"ngTemplateOutlet"],[3,"click"],["for","editExpirationDate"],["id","expirationDate","name","ExpirationDateSelect","formControlName","selectedExpirationDatePreset","required",""],[1,"flex-label"],["type","button","appStopClick","",3,"click",4,"ngIf"],["type","button","appStopClick","",3,"click"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"flex","flex-grow"],["id","deletionDateCustomFallback","type","date","name","DeletionDateFallback","formControlName","fallbackDeletionDate","required","","placeholder","MM/DD/YYYY","data-date-format","mm/dd/yyyy",3,"readOnly"],["id","deletionTimeCustomFallback","type","time","name","DeletionTimeDate","formControlName","fallbackDeletionTime","required","","placeholder","HH:MM AM/PM",3,"readOnly"],["id","deletionTimeCustomFallback","formControlName","fallbackDeletionTime","name","SafariDeletionTime"],["id","deletionDateCustom","type","datetime-local","name","DeletionDate","formControlName","defaultDeletionDateTime","required","","placeholder","MM/DD/YYYY HH:MM AM/PM"],["id","expirationDateCustomFallback","type","date","name","ExpirationDateFallback","formControlName","fallbackExpirationDate","placeholder","MM/DD/YYYY","data-date-format","mm/dd/yyyy",3,"required","readOnly"],["id","expirationTimeCustomFallback","type","time","name","ExpirationTimeFallback","formControlName","fallbackExpirationTime","placeholder","HH:MM AM/PM",3,"required","readOnly"],["id","expirationTimeCustomFallback","formControlName","fallbackExpirationTime","name","SafariExpirationTime"],["id","expirationDateCustom","type","datetime-local","name","ExpirationDate","formControlName","defaultExpirationDateTime","required","","placeholder","MM/DD/YYYY HH:MM AM/PM",3,"readOnly"]],template:function(e,t){1&e&&(s.ynx(0,0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"div",2),s._uU(5,"\n "),s.YNc(6,to,16,5,"ng-container",3),s._uU(7,"\n "),s.YNc(8,no,8,4,"div",4),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",5),s._uU(12),s.ALo(13,"i18n"),s.YNc(14,so,10,9,"ng-container",3),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",1),s._uU(19,"\n "),s.TgZ(20,"div",2),s._uU(21,"\n "),s.YNc(22,co,6,2,"ng-container",3),s._uU(23,"\n "),s.YNc(24,po,13,5,"div",4),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"div",5),s._uU(28),s.ALo(29,"i18n"),s.YNc(30,go,10,9,"ng-container",3),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.YNc(34,wo,10,3,"ng-template",null,6,s.W1O),s._uU(36,"\n "),s.YNc(37,Ao,10,3,"ng-template",null,7,s.W1O),s._uU(39,"\n"),s.BQk(),s._uU(40,"\n")),2&e&&(s.Q6J("formGroup",t.datesForm),s.xp6(6),s.Q6J("ngIf",!t.editMode),s.xp6(2),s.Q6J("ngIf",t.editMode),s.xp6(4),s.hij("\n ",s.lcZ(13,9,"deletionDateDesc"),"\n "),s.xp6(2),s.Q6J("ngIf",!t.inPopout&&"firefox"==t.browserPath&&(t.editMode||0===t.selectedDeletionDatePreset.value&&!t.editMode)),s.xp6(8),s.Q6J("ngIf",!t.editMode),s.xp6(2),s.Q6J("ngIf",t.editMode),s.xp6(4),s.hij("\n ",s.lcZ(29,11,"expirationDateDesc"),"\n "),s.xp6(2),s.Q6J("ngIf",!t.inPopout&&"firefox"==t.browserPath&&(t.editMode||0===t.selectedExpirationDatePreset.value&&!t.editMode)))},dependencies:[u.sg,u.O5,u.tP,u.RF,u.n9,u.ED,ue.YN,ue.Kr,ue.Fj,ue.EJ,ue.JJ,ue.JL,ue.Q7,Xe,St,ue.sg,ue.u,Ze],encapsulation:2});var Zo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function To(e,t){1&e&&(s.TgZ(0,"app-callout",44),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"sendDisabled")),s.xp6(2),s.hij("\n ",s.lcZ(3,4,"sendDisabledWarning"),"\n "))}function Co(e,t){1&e&&(s.TgZ(0,"app-callout",45),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"sendOptionsPolicyInEffect"),"\n "))}function ko(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"sendLinuxChromiumFileWarning")))}function Oo(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"sendFirefoxFileWarning")))}function Po(e,t){1&e&&(s.TgZ(0,"div"),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"sendSafariFileWarning")))}function Io(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-callout",46),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.popOutWindow())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.YNc(3,ko,3,3,"div",47),s._uU(4,"\n "),s.YNc(5,Oo,3,3,"div",47),s._uU(6,"\n "),s.YNc(7,Po,3,3,"div",47),s._uU(8,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.s9C("title",s.lcZ(1,5,"sendFileCalloutHeader")),s.Q6J("clickable",!0),s.xp6(3),s.Q6J("ngIf",e.showChromiumFileWarning),s.xp6(2),s.Q6J("ngIf",e.showFirefoxFileWarning),s.xp6(2),s.Q6J("ngIf",e.showSafariFileWarning)}}function qo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",52),s._uU(1,"\n "),s.TgZ(2,"input",53),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.send.type=t)}))("change",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.typeChanged())})),s.qZA(),s._uU(3,"\n "),s.TgZ(4,"label",54),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(3);s.xp6(2),s.MGl("name","Type_",e.value,"")("id","type_",e.value,""),s.Q6J("ngModel",i.send.type)("value",e.value)("checked",i.send.type===e.value)("readonly",i.disableSend),s.xp6(2),s.MGl("for","type_",e.value,""),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function Do(e,t){if(1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",48),s._uU(3,"\n "),s.TgZ(4,"div",49),s._uU(5,"\n "),s.TgZ(6,"label",50),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.YNc(10,qo,7,8,"div",51),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,2,"sendTypeHeader")),s.xp6(3),s.Q6J("ngForOf",e.typeOptions)}}function Mo(e,t){if(1&e&&(s.TgZ(0,"div",49),s._uU(1,"\n "),s.TgZ(2,"label",57),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",33),s._uU(7),s.qZA(),s._uU(8,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,3,"file")),s.xp6(4),s.AsE("",e.send.file.fileName," (",e.send.file.sizeName,")")}}function Fo(e,t){if(1&e&&(s.TgZ(0,"div",49),s._uU(1,"\n "),s.TgZ(2,"label",57),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"input",58),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"file")),s.xp6(3),s.Q6J("readonly",e.disableSend)}}function No(e,t){1&e&&(s.TgZ(0,"div",20),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.AsE("\n ",s.lcZ(2,2,"sendFileDesc")," ",s.lcZ(3,4,"maxFileSize"),"\n "))}function Lo(e,t){if(1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",48),s._uU(3,"\n "),s.YNc(4,Mo,9,5,"div",55),s._uU(5,"\n "),s.YNc(6,Fo,8,4,"div",55),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.YNc(9,No,4,6,"div",56),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("ngIf",e.editMode),s.xp6(2),s.Q6J("ngIf",e.showFileSelector),s.xp6(3),s.Q6J("ngIf",e.showFileSelector)}}function Eo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",16),s._uU(3,"\n "),s.TgZ(4,"div",17),s._uU(5,"\n "),s.TgZ(6,"label",59),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"textarea",60),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.send.text.text=t)})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"div",20),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",16),s._uU(19,"\n "),s.TgZ(20,"div",23),s._uU(21,"\n "),s.TgZ(22,"label",61),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s.TgZ(26,"input",62),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.send.text.hidden=t)})),s.qZA(),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,7,"sendTypeText")),s.xp6(3),s.Q6J("ngModel",e.send.text.text)("readonly",e.disableSend),s.xp6(5),s.hij("\n ",s.lcZ(16,9,"sendTextDesc"),"\n "),s.xp6(8),s.Oqu(s.lcZ(24,11,"sendHideText")),s.xp6(3),s.Q6J("ngModel",e.send.text.hidden)("disabled",e.disableSend)}}function Ro(e,t){1&e&&s._UZ(0,"i",63)}function Jo(e,t){1&e&&s._UZ(0,"i",64)}function Yo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",16),s._uU(3,"\n "),s.TgZ(4,"div",17),s._uU(5,"\n "),s.TgZ(6,"label",65),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",66),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.send.accessCount=t)})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,2,"currentAccessCount")),s.xp6(3),s.Q6J("ngModel",e.send.accessCount)}}function zo(e,t){1&e&&(s.TgZ(0,"label",67),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"newPassword")))}function Ko(e,t){1&e&&(s.TgZ(0,"label",67),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"password")))}const Bo=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Go(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",68),s._uU(1,"\n "),s.TgZ(2,"button",69),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.togglePasswordVisible())})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",70),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,3,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(5,Bo,!e.showPassword,e.showPassword))}}function Qo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",71),s._uU(1,"\n "),s.TgZ(2,"div",72),s._uU(3,"\n "),s.TgZ(4,"button",73,74),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.delete())})),s._uU(6,"\n "),s.TgZ(7,"div",75),s._uU(8,"\n "),s.TgZ(9,"div",76),s._uU(10,"\n "),s._UZ(11,"i",77),s._uU(12,"\n "),s._UZ(13,"i",78),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"span"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(2);s.xp6(4),s.Q6J("appApiAction",t.deletePromise),s.xp6(7),s.Q6J("hidden",e.loading),s.xp6(2),s.Q6J("hidden",!e.loading),s.xp6(4),s.Oqu(s.lcZ(18,4,"deleteSend"))}}function Vo(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"main",11),s._uU(1,"\n "),s._uU(2,"\n "),s.YNc(3,To,4,6,"app-callout",12),s._uU(4,"\n "),s.YNc(5,Co,3,3,"app-callout",13),s._uU(6,"\n "),s._uU(7,"\n "),s.YNc(8,Io,9,7,"app-callout",14),s._uU(9,"\n "),s._uU(10,"\n "),s.TgZ(11,"div",15),s._uU(12,"\n "),s.TgZ(13,"div",16),s._uU(14,"\n "),s.TgZ(15,"div",17),s._uU(16,"\n "),s.TgZ(17,"label",18),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"input",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.send.name=t)})),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"div",20),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s._uU(30,"\n "),s.YNc(31,Do,14,4,"div",21),s._uU(32,"\n "),s._uU(33,"\n "),s.YNc(34,Lo,11,3,"div",21),s._uU(35,"\n "),s._uU(36,"\n "),s.YNc(37,Eo,30,13,"div",21),s._uU(38,"\n "),s._uU(39,"\n "),s.TgZ(40,"div",15),s._uU(41,"\n "),s.TgZ(42,"h2",22),s._uU(43),s.ALo(44,"i18n"),s.qZA(),s._uU(45,"\n "),s.TgZ(46,"div",16),s._uU(47,"\n "),s._uU(48,"\n "),s.TgZ(49,"div",23),s._uU(50,"\n "),s.TgZ(51,"label",24),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n "),s.TgZ(55,"input",25),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.copyLink=t)})),s.qZA(),s._uU(56,"\n "),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.qZA(),s._uU(59,"\n "),s._uU(60,"\n "),s.TgZ(61,"div",15),s._uU(62,"\n "),s.TgZ(63,"h2"),s._uU(64,"\n "),s.TgZ(65,"button",26),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.showOptions=!t.showOptions)})),s._uU(66),s.ALo(67,"i18n"),s.YNc(68,Ro,1,0,"i",27),s._uU(69,"\n "),s.YNc(70,Jo,1,0,"i",28),s._uU(71,"\n "),s.qZA(),s._uU(72,"\n "),s.qZA(),s._uU(73,"\n "),s.qZA(),s._uU(74,"\n "),s.TgZ(75,"div",8),s._uU(76,"\n "),s.TgZ(77,"app-send-efflux-dates",29),s.NdJ("datesChanged",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.setDates(t))}))("popOutWindow",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.popOutWindow())})),s._uU(78,"\n "),s.qZA(),s._uU(79,"\n "),s._uU(80,"\n "),s.TgZ(81,"div",15),s._uU(82,"\n "),s.TgZ(83,"div",16),s._uU(84,"\n "),s.TgZ(85,"div",17),s._uU(86,"\n "),s.TgZ(87,"label",30),s._uU(88),s.ALo(89,"i18n"),s.qZA(),s._uU(90,"\n "),s.TgZ(91,"input",31),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.send.maxAccessCount=t)})),s.qZA(),s._uU(92,"\n "),s.qZA(),s._uU(93,"\n "),s.qZA(),s._uU(94,"\n "),s.TgZ(95,"div",20),s._uU(96),s.ALo(97,"i18n"),s.qZA(),s._uU(98,"\n "),s.qZA(),s._uU(99,"\n "),s._uU(100,"\n "),s.YNc(101,Yo,14,4,"div",21),s._uU(102,"\n "),s._uU(103,"\n "),s.TgZ(104,"div",15),s._uU(105,"\n "),s.TgZ(106,"div",16),s._uU(107,"\n "),s.TgZ(108,"div",32),s._uU(109,"\n "),s.TgZ(110,"div",33),s._uU(111,"\n "),s.YNc(112,zo,3,3,"label",34),s._uU(113,"\n "),s.YNc(114,Ko,3,3,"label",34),s._uU(115,"\n "),s.TgZ(116,"input",35),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.password=t)})),s.qZA(),s._uU(117,"\n "),s.qZA(),s._uU(118,"\n "),s.YNc(119,Go,8,8,"div",36),s._uU(120,"\n "),s.qZA(),s._uU(121,"\n "),s.qZA(),s._uU(122,"\n "),s.TgZ(123,"div",20),s._uU(124),s.ALo(125,"i18n"),s.qZA(),s._uU(126,"\n "),s.qZA(),s._uU(127,"\n "),s._uU(128,"\n "),s.TgZ(129,"div",15),s._uU(130,"\n "),s.TgZ(131,"div",16),s._uU(132,"\n "),s.TgZ(133,"div",17),s._uU(134,"\n "),s.TgZ(135,"label",37),s._uU(136),s.ALo(137,"i18n"),s.qZA(),s._uU(138,"\n "),s.TgZ(139,"textarea",38),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.send.notes=t)})),s.qZA(),s._uU(140,"\n "),s.qZA(),s._uU(141,"\n "),s.qZA(),s._uU(142,"\n "),s.TgZ(143,"div",20),s._uU(144),s.ALo(145,"i18n"),s.qZA(),s._uU(146,"\n "),s.qZA(),s._uU(147,"\n "),s._uU(148,"\n "),s.TgZ(149,"div",15),s._uU(150,"\n "),s.TgZ(151,"div",16),s._uU(152,"\n "),s.TgZ(153,"div",23),s._uU(154,"\n "),s.TgZ(155,"label",39),s._uU(156),s.ALo(157,"i18n"),s.qZA(),s._uU(158,"\n "),s.TgZ(159,"input",40),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.send.hideEmail=t)})),s.qZA(),s._uU(160,"\n "),s.qZA(),s._uU(161,"\n "),s.qZA(),s._uU(162,"\n "),s.qZA(),s._uU(163,"\n "),s._uU(164,"\n "),s.TgZ(165,"div",15),s._uU(166,"\n "),s.TgZ(167,"div",16),s._uU(168,"\n "),s.TgZ(169,"div",23),s._uU(170,"\n "),s.TgZ(171,"label",41),s._uU(172),s.ALo(173,"i18n"),s.qZA(),s._uU(174,"\n "),s.TgZ(175,"input",42),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.send.disabled=t)})),s.qZA(),s._uU(176,"\n "),s.qZA(),s._uU(177,"\n "),s.qZA(),s._uU(178,"\n "),s.qZA(),s._uU(179,"\n "),s.qZA(),s._uU(180,"\n "),s._uU(181,"\n "),s.YNc(182,Qo,23,6,"div",43),s._uU(183,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(3),s.Q6J("ngIf",e.disableSend),s.xp6(2),s.Q6J("ngIf",e.disableHideEmail&&!e.disableSend),s.xp6(3),s.Q6J("ngIf",e.showFilePopoutMessage&&e.send.type===e.sendType.File&&!e.disableSend),s.xp6(10),s.Oqu(s.lcZ(19,46,"name")),s.xp6(3),s.Q6J("ngModel",e.send.name)("readonly",e.disableSend),s.xp6(5),s.hij("\n ",s.lcZ(27,48,"sendNameDesc"),"\n "),s.xp6(5),s.Q6J("ngIf",!e.editMode),s.xp6(3),s.Q6J("ngIf",e.send.type===e.sendType.File&&(e.editMode||e.showFileSelector)),s.xp6(3),s.Q6J("ngIf",e.send.type===e.sendType.Text),s.xp6(6),s.hij("\n ",s.lcZ(44,50,"share"),"\n "),s.xp6(9),s.Oqu(s.lcZ(53,52,"sendShareDesc")),s.xp6(3),s.Q6J("ngModel",e.copyLink)("disabled",e.disableSend),s.xp6(10),s.uIk("aria-expanded",e.showOptions),s.xp6(1),s.hij("\n ",s.lcZ(67,54,"options"),"\n "),s.xp6(2),s.Q6J("ngIf",!e.showOptions),s.xp6(2),s.Q6J("ngIf",e.showOptions),s.xp6(5),s.Q6J("hidden",!e.showOptions),s.xp6(2),s.Q6J("initialDeletionDate",e.send.deletionDate)("initialExpirationDate",e.send.expirationDate)("editMode",e.editMode)("disabled",e.disableSend),s.xp6(11),s.Oqu(s.lcZ(89,56,"maximumAccessCount")),s.xp6(3),s.Q6J("ngModel",e.send.maxAccessCount)("readonly",e.disableSend),s.xp6(5),s.hij("\n ",s.lcZ(97,58,"maximumAccessCountDesc"),"\n "),s.xp6(5),s.Q6J("ngIf",e.editMode),s.xp6(11),s.Q6J("ngIf",e.hasPassword),s.xp6(2),s.Q6J("ngIf",!e.hasPassword),s.xp6(2),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.password)("readonly",e.disableSend),s.xp6(3),s.Q6J("ngIf",!e.disableSend),s.xp6(5),s.hij("\n ",s.lcZ(125,60,"sendPasswordDesc"),"\n "),s.xp6(12),s.Oqu(s.lcZ(137,62,"notes")),s.xp6(3),s.Q6J("ngModel",e.send.notes)("readonly",e.disableSend),s.xp6(5),s.hij("\n ",s.lcZ(145,64,"sendNotesDesc"),"\n "),s.xp6(12),s.Oqu(s.lcZ(157,66,"hideEmail")),s.xp6(3),s.Q6J("ngModel",e.send.hideEmail)("disabled",e.disableHideEmail&&!e.send.hideEmail||e.disableSend),s.xp6(13),s.Oqu(s.lcZ(173,68,"sendDisableDesc")),s.xp6(3),s.Q6J("ngModel",e.send.disabled)("disabled",e.disableSend),s.xp6(7),s.Q6J("ngIf",e.editMode)}}class Ho extends Hs{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){super(e,t,o,r,a,n,s,h,i),this.route=l,this.router=c,this.location=u,this.popupUtilsService=d,this.showOptions=!1,this.isFirefox=!1,this.inPopout=!1,this.inSidebar=!1,this.isLinux=!1,this.isUnsupportedMac=!1}get showFileSelector(){return!(this.editMode||this.showFilePopoutMessage)}get showFilePopoutMessage(){return!this.editMode&&(this.showFirefoxFileWarning||this.showSafariFileWarning||this.showChromiumFileWarning)}get showFirefoxFileWarning(){return this.isFirefox&&!(this.inSidebar||this.inPopout)}get showSafariFileWarning(){return this.isSafari&&!this.inPopout}get showChromiumFileWarning(){return(this.isLinux||this.isUnsupportedMac)&&!this.isFirefox&&!(this.inSidebar||this.inPopout)}popOutWindow(){this.popupUtilsService.popOut(window)}ngOnInit(){var e,t;return Zo(this,void 0,void 0,(function*(){this.isFirefox=this.platformUtilsService.isFirefox(),this.inPopout=this.popupUtilsService.inPopout(window),this.inSidebar=this.popupUtilsService.inSidebar(window),this.isLinux=-1!==(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent.indexOf("Linux")),this.isUnsupportedMac=this.platformUtilsService.isChrome()&&(null===(t=null===window||void 0===window?void 0:window.navigator)||void 0===t?void 0:t.appVersion.includes("Mac OS X 11")),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>Zo(this,void 0,void 0,(function*(){if(e.sendId&&(this.sendId=e.sendId),e.type){const t=parseInt(e.type,null);this.type=t}yield this.load()})))),window.setTimeout((()=>{this.editMode||document.getElementById("name").focus()}),200)}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return Zo(this,void 0,void 0,(function*(){return!!(yield e.submit.call(this))&&(this.cancel(),!0)}))}delete(){const e=Object.create(null,{delete:{get:()=>super.delete}});return Zo(this,void 0,void 0,(function*(){return!!(yield e.delete.call(this))&&(this.cancel(),!0)}))}cancel(){window.previousPopupUrl.startsWith("/add-send")?this.router.navigate(["tabs/send"]):this.location.back()}}Ho.ɵfac=function(e){return new(e||Ho)(s.Y36(_e),s.Y36(Je),s.Y36(js),s.Y36(qe),s.Y36(Hi),s.Y36(Ye),s.Y36(u.uU),s.Y36(Ks),s.Y36(Pe.gz),s.Y36(Pe.F0),s.Y36(u.Ye),s.Y36($t),s.Y36(Ct))},Ho.ɵcmp=s.Xpm({type:Ho,selectors:[["app-send-add-edit"]],features:[s.qOj],decls:34,vars:12,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button",3,"click"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1",4,"ngIf"],["tabindex","-1"],["type","warning",3,"title",4,"ngIf"],["type","info",4,"ngIf"],["type","warning","icon","bwi-external-link bwi-rotate-270 bwi-fw",3,"clickable","title","click",4,"ngIf"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","name"],["id","name","type","text","name","Name",3,"ngModel","readonly","ngModelChange"],[1,"box-footer"],["class","box",4,"ngIf"],[1,"box-header"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","copyOnSave"],["id","copyOnSave","type","checkbox","name","CopyOnSave",3,"ngModel","disabled","ngModelChange"],["type","button",1,"box-header-expandable",3,"click"],["class","bwi bwi-angle-down bwi-sm icon","aria-hidden","true",4,"ngIf"],["class","bwi bwi-chevron-up bwi-sm icon","aria-hidden","true",4,"ngIf"],[3,"initialDeletionDate","initialExpirationDate","editMode","disabled","datesChanged","popOutWindow"],["for","maximumAccessCount"],["id","maximumAccessCount","min","1","type","number","name","MaximumAccessCount",3,"ngModel","readonly","ngModelChange"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","password",4,"ngIf"],["id","password","name","Password","appInputVerbatim","",1,"monospaced",3,"type","ngModel","readonly","ngModelChange"],["class","action-buttons",4,"ngIf"],["for","notes"],["id","notes","name","Notes","rows","6",3,"ngModel","readonly","ngModelChange"],["for","hideEmail"],["id","hideEmail","type","checkbox","name","HideEmail",3,"ngModel","disabled","ngModelChange"],["for","disableSend"],["id","disableSend","type","checkbox","name","DisableSend",3,"ngModel","disabled","ngModelChange"],["class","box list",4,"ngIf"],["type","warning",3,"title"],["type","info"],["type","warning","icon","bwi-external-link bwi-rotate-270 bwi-fw",3,"clickable","title","click"],[4,"ngIf"],[1,"box-content","no-hover"],[1,"box-content-row"],["for","sendTypeOptions"],["class","radio-group text-default","appBoxRow","","name","SendTypeOptions",4,"ngFor","ngForOf"],["appBoxRow","","name","SendTypeOptions",1,"radio-group","text-default"],["type","radio",3,"ngModel","name","id","value","checked","readonly","ngModelChange","change"],[3,"for"],["class","box-content-row",4,"ngIf"],["class","box-footer",4,"ngIf"],["for","file"],["type","file","id","file","name","file","required","",3,"readonly"],["for","text"],["id","text","name","Text","rows","6",3,"ngModel","readonly","ngModelChange"],["for","hideText"],["id","hideText","type","checkbox","name","HideText",3,"ngModel","disabled","ngModelChange"],["aria-hidden","true",1,"bwi","bwi-angle-down","bwi-sm","icon"],["aria-hidden","true",1,"bwi","bwi-chevron-up","bwi-sm","icon"],["for","currentAccessCount"],["id","currentAccessCount","readonly","","type","text","name","CurrentAccessCount",3,"ngModel","ngModelChange"],["for","password"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"box","list"],[1,"box-content","single-line"],["type","button","appStopClick","",1,"box-content-row",3,"appApiAction","click"],["deleteBtn",""],[1,"row-main","text-danger"],["aria-hidden","true",1,"icon","text-danger"],[1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],[1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s.NdJ("click",(function(){return t.cancel()})),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",6),s._uU(19,"\n "),s.TgZ(20,"button",7),s._uU(21,"\n "),s.TgZ(22,"span",8),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s._UZ(26,"i",9),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.YNc(31,Vo,184,70,"main",10),s._uU(32,"\n"),s.qZA(),s._uU(33,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,8,"cancel")),s.xp6(7),s.Oqu(t.title),s.xp6(5),s.Q6J("disabled",e.loading||t.disableSend),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(24,10,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(5),s.Q6J("ngIf",t.send)}},dependencies:[u.mk,u.sg,u.O5,ue._Y,ue.Fj,ue.wV,ue.Wl,ue._,ue.JJ,ue.JL,ue.qQ,ue.On,ue.F,Ht,Ot,Xe,wt,bt,St,_o,Ze],encapsulation:2});class jo{constructor(){this.indexedEntityId=null}}var Wo=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $o{constructor(e,t,i,n,s,o,r,a){this.sendService=e,this.i18nService=t,this.platformUtilsService=i,this.environmentService=n,this.ngZone=s,this.searchService=o,this.policyService=r,this.logService=a,this.disableSend=!1,this.sendType=Ds,this.loaded=!1,this.loading=!0,this.refreshing=!1,this.expired=!1,this.type=null,this.sends=[],this.filteredSends=[],this.searchPending=!1,this.hasSearched=!1}ngOnInit(){return Wo(this,void 0,void 0,(function*(){this.disableSend=yield this.policyService.policyAppliesToUser(qs.DisableSend)}))}load(e=null){return Wo(this,void 0,void 0,(function*(){this.loading=!0;const e=yield this.sendService.getAllDecrypted();this.sends=e,null!=this.onSuccessfulLoad?yield this.onSuccessfulLoad():this.selectAll(),this.loading=!1,this.loaded=!0}))}reload(e=null){return Wo(this,void 0,void 0,(function*(){this.loaded=!1,this.sends=[],yield this.load(e)}))}refresh(){return Wo(this,void 0,void 0,(function*(){try{this.refreshing=!0,yield this.reload(this.filter)}finally{this.refreshing=!1}}))}applyFilter(e=null){return Wo(this,void 0,void 0,(function*(){this.filter=e,yield this.search(null)}))}search(e=null){return Wo(this,void 0,void 0,(function*(){if(this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout),null==e)return this.hasSearched=this.searchService.isSearchable(this.searchText),this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),void this.applyTextSearch();this.searchPending=!0,this.searchTimeout=setTimeout((()=>Wo(this,void 0,void 0,(function*(){this.hasSearched=this.searchService.isSearchable(this.searchText),this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),this.applyTextSearch(),this.searchPending=!1}))),e)}))}removePassword(e){return Wo(this,void 0,void 0,(function*(){if(null!=this.actionPromise||null==e.password)return;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("removePasswordConfirmation"),this.i18nService.t("removePassword"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.actionPromise=this.sendService.removePasswordWithServer(e.id),yield this.actionPromise,null!=this.onSuccessfulRemovePassword?this.onSuccessfulRemovePassword():(this.platformUtilsService.showToast("success",null,this.i18nService.t("removedPassword")),yield this.load())}catch(e){this.logService.error(e)}this.actionPromise=null}))}delete(e){return Wo(this,void 0,void 0,(function*(){if(null!=this.actionPromise)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteSendConfirmation"),this.i18nService.t("deleteSend"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.actionPromise=this.sendService.deleteWithServer(e.id),yield this.actionPromise,null!=this.onSuccessfulDelete?this.onSuccessfulDelete():(this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.refresh())}catch(e){this.logService.error(e)}return this.actionPromise=null,!0}))}copy(e){const t=this.environmentService.getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("valueCopied",this.i18nService.t("sendLink")))}searchTextChanged(){this.search(200)}selectAll(){this.clearSelections(),this.selectedAll=!0,this.applyFilter(null)}selectType(e){this.clearSelections(),this.selectedType=e,this.applyFilter((t=>t.type===e))}clearSelections(){this.selectedAll=!1,this.selectedType=null}applyTextSearch(){null!=this.searchText&&(this.filteredSends=this.searchService.searchSends(this.filteredSends,this.searchText))}}$o.ɵfac=function(e){return new(e||$o)(s.Y36(Ks),s.Y36(_e),s.Y36(Je),s.Y36(Ye),s.Y36(s.R0b),s.Y36(jo),s.Y36(Hi),s.Y36(Ct))},$o.ɵdir=s.lG2({type:$o});class Xo{onClick(e){e.stopPropagation()}}function er(e,t){1&e&&s._UZ(0,"i",16)}function tr(e,t){1&e&&s._UZ(0,"i",17)}function ir(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",18),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"disabled")),s.xp6(4),s.Oqu(s.lcZ(7,4,"disabled")))}function nr(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",20),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"passwordProtected")),s.xp6(4),s.Oqu(s.lcZ(7,4,"passwordProtected")))}function sr(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",21),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"maxAccessCountReached")),s.xp6(4),s.Oqu(s.lcZ(7,4,"maxAccessCountReached")))}function or(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",22),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"expired")),s.xp6(4),s.Oqu(s.lcZ(7,4,"expired")))}function rr(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",23),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",19),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"pendingDeletion")),s.xp6(4),s.Oqu(s.lcZ(7,4,"pendingDeletion")))}Xo.ɵfac=function(e){return new(e||Xo)},Xo.ɵdir=s.lG2({type:Xo,selectors:[["","appStopProp",""]],hostBindings:function(e,t){1&e&&s.NdJ("click",(function(e){return t.onClick(e)}))}});const ar=function(e){return{disabled:e}};function lr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",24),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw();return s.KtG(i.removePassword(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",25),s._uU(4,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(1,3,"removePassword")),s.Q6J("ngClass",s.VKq(5,ar,e.disabledByPolicy)),s.uIk("disabled",e.disabledByPolicy?"":null)}}function cr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",1),s._uU(1,"\n "),s.TgZ(2,"button",2),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw();return s.KtG(i.selectSend(t))})),s._uU(3,"\n "),s.TgZ(4,"div",3),s._uU(5,"\n "),s.TgZ(6,"div",4),s._uU(7,"\n "),s.YNc(8,er,1,0,"i",5),s._uU(9,"\n "),s.YNc(10,tr,1,0,"i",6),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"div",7),s._uU(15,"\n "),s.TgZ(16,"span",8),s._uU(17),s.YNc(18,ir,9,6,"ng-container",9),s._uU(19,"\n "),s.YNc(20,nr,9,6,"ng-container",9),s._uU(21,"\n "),s.YNc(22,sr,9,6,"ng-container",9),s._uU(23,"\n "),s.YNc(24,or,9,6,"ng-container",9),s._uU(25,"\n "),s.YNc(26,rr,9,6,"ng-container",9),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.TgZ(29,"span",10),s._uU(30),s.ALo(31,"date"),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.qZA(),s._uU(34,"\n "),s.TgZ(35,"div",11),s._uU(36,"\n "),s.TgZ(37,"button",12),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw();return s.KtG(i.copySendLink(t))})),s.ALo(38,"i18n"),s._uU(39,"\n "),s._UZ(40,"i",13),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.YNc(43,lr,5,7,"button",14),s._uU(44,"\n "),s.TgZ(45,"button",12),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw();return s.KtG(i.delete(t))})),s.ALo(46,"i18n"),s._uU(47,"\n "),s._UZ(48,"i",15),s._uU(49,"\n "),s.qZA(),s._uU(50,"\n "),s.qZA(),s._uU(51,"\n"),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw();s.s9C("appA11yTitle",e.name),s.xp6(2),s.hYB("title","",i.title," - ",e.name,""),s.xp6(6),s.Q6J("ngIf",e.type===i.sendType.Text),s.xp6(2),s.Q6J("ngIf",e.type===i.sendType.File),s.xp6(7),s.hij("\n ",e.name,"\n "),s.xp6(1),s.Q6J("ngIf",e.disabled),s.xp6(2),s.Q6J("ngIf",e.password),s.xp6(2),s.Q6J("ngIf",e.maxAccessCountReached),s.xp6(2),s.Q6J("ngIf",e.expired),s.xp6(2),s.Q6J("ngIf",e.pendingDelete),s.xp6(4),s.Oqu(s.xi3(31,15,e.deletionDate,"medium")),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(38,18,"copySendLink")),s.xp6(6),s.Q6J("ngIf",e.password),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(46,20,"delete"))}}class ur{constructor(){this.disabledByPolicy=!1,this.onSelected=new s.vpe,this.onCopySendLink=new s.vpe,this.onRemovePassword=new s.vpe,this.onDeleteSend=new s.vpe,this.sendType=Ds}selectSend(e){this.onSelected.emit(e)}copySendLink(e){this.onCopySendLink.emit(e)}removePassword(e){this.onRemovePassword.emit(e)}delete(e){this.onDeleteSend.emit(e)}}ur.ɵfac=function(e){return new(e||ur)},ur.ɵcmp=s.Xpm({type:ur,selectors:[["app-send-list"]],inputs:{sends:"sends",title:"title",disabledByPolicy:"disabledByPolicy"},outputs:{onSelected:"onSelected",onCopySendLink:"onCopySendLink",onRemovePassword:"onRemovePassword",onDeleteSend:"onDeleteSend"},decls:2,vars:1,consts:[["role","group","class","box-content-row box-content-row-flex",3,"appA11yTitle",4,"ngFor","ngForOf"],["role","group",1,"box-content-row","box-content-row-flex",3,"appA11yTitle"],["type","button","appStopClick","",1,"row-main",3,"title","click"],[1,"app-vault-icon"],["aria-hidden","true",1,"icon"],["class","bwi bwi-fw bwi-lg bwi-file-text",4,"ngIf"],["class","bwi bwi-fw bwi-lg bwi-file",4,"ngIf"],[1,"row-main-content"],[1,"text"],[4,"ngIf"],[1,"detail"],[1,"action-buttons"],["type","button","appStopClick","","appStopProp","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-files"],["type","button","class","row-btn","appStopClick","","appStopProp","",3,"ngClass","appA11yTitle","click",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-trash"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text"],[1,"bwi","bwi-fw","bwi-lg","bwi-file"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","text-muted",3,"title"],[1,"sr-only"],["aria-hidden","true",1,"bwi","bwi-key","text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-ban","text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-clock","text-muted",3,"title"],["aria-hidden","true",1,"bwi","bwi-trash","text-muted",3,"title"],["type","button","appStopClick","","appStopProp","",1,"row-btn",3,"ngClass","appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-undo"]],template:function(e,t){1&e&&(s.YNc(0,cr,52,22,"div",0),s._uU(1,"\n")),2&e&&s.Q6J("ngForOf",t.sends)},dependencies:[u.mk,u.sg,u.O5,Ht,St,Xo,u.uU,Ze],encapsulation:2});var dr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function hr(e,t){1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n "),s._UZ(2,"app-pop-out"),s._uU(3,"\n "),s.qZA())}function pr(e,t){1&e&&(s.TgZ(0,"app-callout",13),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"sendDisabled")),s.xp6(2),s.hij("\n ",s.lcZ(3,4,"sendDisabledWarning"),"\n "))}function gr(e,t){1&e&&s._UZ(0,"i",16)}function vr(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s._UZ(2,"img",17),s._uU(3,"\n "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addSend())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,3,"noItemsInList")),s.xp6(3),s.Q6J("disabled",e.disableSend),s.xp6(1),s.hij("\n ",s.lcZ(10,5,"addSend"),"\n ")}}function yr(e,t){if(1&e&&(s.TgZ(0,"div",14),s._uU(1,"\n "),s.YNc(2,gr,1,0,"i",15),s._uU(3,"\n "),s.YNc(4,vr,12,7,"ng-container",11),s._uU(5,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.loaded),s.xp6(2),s.Q6J("ngIf",e.loaded)}}function fr(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",19),s._uU(3,"\n "),s.TgZ(4,"h2",20),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",21),s._uU(9,"\n "),s.TgZ(10,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.sendType.Text))})),s._uU(11,"\n "),s.TgZ(12,"div",23),s._uU(13,"\n "),s.TgZ(14,"div",24),s._UZ(15,"i",25),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"span",26),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"span",27),s._uU(23),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"span"),s._UZ(26,"i",28),s.qZA(),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.TgZ(29,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.sendType.File))})),s._uU(30,"\n "),s.TgZ(31,"div",23),s._uU(32,"\n "),s.TgZ(33,"div",24),s._UZ(34,"i",29),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"span",26),s._uU(37),s.ALo(38,"i18n"),s.qZA(),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.TgZ(41,"span",27),s._uU(42),s.qZA(),s._uU(43,"\n "),s.TgZ(44,"span"),s._UZ(45,"i",28),s.qZA(),s._uU(46,"\n "),s.qZA(),s._uU(47,"\n "),s.qZA(),s._uU(48,"\n "),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"div",19),s._uU(51,"\n "),s.TgZ(52,"h2",20),s._uU(53),s.ALo(54,"i18n"),s.TgZ(55,"div",30),s._uU(56),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"div",31),s._uU(60,"\n "),s.TgZ(61,"app-send-list",32),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.selectSend(t))}))("onCopySendLink",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.copy(t))}))("onRemovePassword",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.removePassword(t))}))("onDeleteSend",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.delete(t))})),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n "),s.qZA(),s._uU(64,"\n "),s.qZA(),s._uU(65,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(5),s.hij("\n ",s.lcZ(6,10,"types"),"\n "),s.xp6(13),s.Oqu(s.lcZ(19,12,"sendTypeText")),s.xp6(5),s.Oqu(e.typeCounts.get(e.sendType.Text)||0),s.xp6(14),s.Oqu(s.lcZ(38,14,"sendTypeFile")),s.xp6(5),s.Oqu(e.typeCounts.get(e.sendType.File)||0),s.xp6(11),s.hij("\n ",s.lcZ(54,16,"allSends"),"\n "),s.xp6(3),s.Oqu(e.sends.length),s.xp6(5),s.s9C("title",s.lcZ(62,18,"editItem")),s.Q6J("sends",e.sends)("disabledByPolicy",e.disableSend)}}function mr(e,t){1&e&&(s.TgZ(0,"div",14),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"noItemsInList")))}function wr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",34),s._uU(1,"\n "),s.TgZ(2,"div",31),s._uU(3,"\n "),s.TgZ(4,"app-send-list",32),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.selectSend(t))}))("onCopySendLink",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.copy(t))}))("onRemovePassword",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.removePassword(t))}))("onDeleteSend",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.delete(t))})),s.ALo(5,"i18n"),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(4),s.s9C("title",s.lcZ(5,3,"editItem")),s.Q6J("sends",e.filteredSends)("disabledByPolicy",e.disableSend)}}function br(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,mr,6,3,"div",10),s._uU(3,"\n "),s.YNc(4,wr,9,5,"div",33),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.filteredSends||!e.filteredSends.length),s.xp6(2),s.Q6J("ngIf",e.filteredSends&&e.filteredSends.length>0)}}const Sr=function(e,t){return{flex:e,"tab-page":t}},Ur="SendComponent";class xr extends $o{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p){super(e,t,i,n,s,r,o,p),this.popupUtils=a,this.stateService=l,this.router=c,this.syncService=u,this.changeDetectorRef=d,this.broadcasterService=h,this.showLeftHeader=!0,this.typeCounts=new Map,super.onSuccessfulLoad=()=>dr(this,void 0,void 0,(function*(){this.calculateTypeCounts(),this.selectAll()}))}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});var t;return dr(this,void 0,void 0,(function*(){this.showLeftHeader=!(this.popupUtils.inSidebar(window)&&this.platformUtilsService.isFirefox()),yield this.stateService.setBrowserSendTypeComponentState(null),yield e.ngOnInit.call(this);const i=yield this.restoreState();null!=(null===(t=this.state)||void 0===t?void 0:t.searchText)&&(this.searchText=this.state.searchText),this.syncService.syncInProgress?this.loadedTimeout=window.setTimeout((()=>{this.loaded||this.load()}),5e3):this.load(),this.syncService.syncInProgress&&!i||window.setTimeout((()=>{var e;return this.popupUtils.setContentScrollY(window,null===(e=this.state)||void 0===e?void 0:e.scrollY)}),0),this.broadcasterService.subscribe(Ur,(e=>{this.ngZone.run((()=>dr(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)window.setTimeout((()=>{this.load()}),500);this.changeDetectorRef.detectChanges()}))))}))}))}ngOnDestroy(){null!=this.loadedTimeout&&window.clearTimeout(this.loadedTimeout),this.saveState(),this.broadcasterService.unsubscribe(Ur)}selectType(e){return dr(this,void 0,void 0,(function*(){this.router.navigate(["/send-type"],{queryParams:{type:e}})}))}selectSend(e){return dr(this,void 0,void 0,(function*(){this.router.navigate(["/edit-send"],{queryParams:{sendId:e.id}})}))}addSend(){return dr(this,void 0,void 0,(function*(){this.disableSend||this.router.navigate(["/add-send"])}))}removePassword(e){const t=Object.create(null,{removePassword:{get:()=>super.removePassword}});return dr(this,void 0,void 0,(function*(){this.disableSend||t.removePassword.call(this,e)}))}showSearching(){return this.hasSearched||!this.searchPending&&this.searchService.isSearchable(this.searchText)}calculateTypeCounts(){const e=new Map;this.sends.forEach((t=>{e.has(t.type)?e.set(t.type,e.get(t.type)+1):e.set(t.type,1)})),this.typeCounts=e}saveState(){return dr(this,void 0,void 0,(function*(){this.state={scrollY:this.popupUtils.getContentScrollY(window),searchText:this.searchText,sends:this.sends,typeCounts:this.typeCounts},yield this.stateService.setBrowserSendComponentState(this.state)}))}restoreState(){return dr(this,void 0,void 0,(function*(){return this.state=yield this.stateService.getBrowserSendComponentState(),null!=this.state&&(null!=this.state.sends&&(this.sends=this.state.sends),null!=this.state.typeCounts&&(this.typeCounts=this.state.typeCounts),!0)}))}}xr.ɵfac=function(e){return new(e||xr)(s.Y36(Ks),s.Y36(_e),s.Y36(Je),s.Y36(Ye),s.Y36(s.R0b),s.Y36(Hi),s.Y36(jo),s.Y36($t),s.Y36(js),s.Y36(Pe.F0),s.Y36(bi),s.Y36(s.sBO),s.Y36(Tn),s.Y36(Ct))},xr.ɵcmp=s.Xpm({type:xr,selectors:[["app-send-groupings"]],features:[s.qOj],decls:37,vars:20,consts:[["class","left",4,"ngIf"],[1,"sr-only"],[1,"search"],["type","search","id","search","autocomplete","off","appAutofocus","",3,"placeholder","ngModel","ngModelChange","input"],[1,"bwi","bwi-search"],[1,"right"],["type","button",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1",3,"ngClass"],["type","warning",3,"title",4,"ngIf"],["class","no-items",4,"ngIf"],[4,"ngIf"],[1,"left"],["type","warning",3,"title"],[1,"no-items"],["class","bwi bwi-spinner bwi-spin bwi-3x",4,"ngIf"],[1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["aria-hidden","true",1,"no-items-image"],["type","button",1,"btn","block","primary","link",3,"disabled","click"],[1,"box","list"],[1,"box-header"],[1,"box-content","single-line"],["type","button","appStopClick","",1,"box-content-row",3,"click"],[1,"row-main"],[1,"icon"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text"],[1,"text"],[1,"row-sub-label"],[1,"bwi","bwi-angle-right","bwi-lg","row-sub-icon"],[1,"bwi","bwi-fw","bwi-lg","bwi-file"],[1,"flex-right"],[1,"box-content"],[3,"sends","title","disabledByPolicy","onSelected","onCopySendLink","onRemovePassword","onDeleteSend"],["class","box list full-list",4,"ngIf"],[1,"box","list","full-list"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.YNc(2,hr,4,0,"div",0),s._uU(3,"\n "),s.TgZ(4,"h1",1),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",2),s._uU(9,"\n "),s.TgZ(10,"input",3),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.search(200)})),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s._UZ(13,"i",4),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"div",5),s._uU(17,"\n "),s.TgZ(18,"button",6),s.NdJ("click",(function(){return t.addSend()})),s.ALo(19,"i18n"),s._uU(20,"\n "),s._UZ(21,"i",7),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n"),s.qZA(),s._uU(25,"\n"),s.TgZ(26,"main",8),s._uU(27,"\n "),s.YNc(28,pr,4,6,"app-callout",9),s._uU(29,"\n "),s.YNc(30,yr,6,2,"div",10),s._uU(31,"\n "),s.YNc(32,fr,66,20,"ng-container",11),s._uU(33,"\n "),s.YNc(34,br,6,2,"ng-container",11),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n")),2&e&&(s.xp6(2),s.Q6J("ngIf",t.showLeftHeader),s.xp6(3),s.Oqu(s.lcZ(6,11,"send")),s.xp6(5),s.s9C("placeholder",s.lcZ(11,13,"searchSends")),s.Q6J("ngModel",t.searchText),s.xp6(8),s.s9C("appA11yTitle",s.lcZ(19,15,"addSend")),s.Q6J("disabled",t.disableSend),s.xp6(8),s.Q6J("ngClass",s.WLB(17,Sr,t.disableSend,t.disableSend)),s.xp6(2),s.Q6J("ngIf",t.disableSend),s.xp6(2),s.Q6J("ngIf",!(t.sends&&t.sends.length||t.showSearching())),s.xp6(2),s.Q6J("ngIf",t.sends&&t.sends.length&&!t.showSearching()),s.xp6(2),s.Q6J("ngIf",t.showSearching()))},dependencies:[u.mk,u.O5,ue.Fj,ue.JJ,ue.On,Ht,It,wt,St,es,ur,Ze],encapsulation:2});var Ar=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _r(e,t){1&e&&(s.TgZ(0,"app-callout",15),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"sendDisabled")),s.xp6(2),s.hij("\n ",s.lcZ(3,4,"sendDisabledWarning"),"\n "))}function Zr(e,t){1&e&&s._UZ(0,"i",19)}function Tr(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addSend())})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.BQk()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"noItemsInList")),s.xp6(3),s.Q6J("disabled",e.disableSend),s.xp6(1),s.hij("\n ",s.lcZ(8,5,"addSend"),"\n ")}}function Cr(e,t){if(1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n "),s.YNc(2,Zr,1,0,"i",17),s._uU(3,"\n "),s.YNc(4,Tr,10,7,"ng-container",18),s._uU(5,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.loaded),s.xp6(2),s.Q6J("ngIf",e.loaded)}}function kr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",21),s._uU(1,"\n "),s.TgZ(2,"h2",22),s._uU(3),s.TgZ(4,"span",23),s._uU(5),s.qZA(),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",24),s._uU(9,"\n "),s.TgZ(10,"app-send-list",25),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.selectSend(t))}))("onCopySendLink",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.copy(t))}))("onRemovePassword",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.removePassword(t))}))("onDeleteSend",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.delete(t))})),s.ALo(11,"i18n"),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(3),s.hij("\n ",e.groupingTitle,"\n "),s.xp6(2),s.Oqu(e.filteredSends.length),s.xp6(5),s.s9C("title",s.lcZ(11,5,"editItem")),s.Q6J("sends",e.filteredSends)("disabledByPolicy",e.disableSend)}}const Or=function(e){return{flex:e}},Pr="SendTypeComponent";class Ir extends $o{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g){super(e,t,i,n,s,r,o,g),this.popupUtils=a,this.stateService=l,this.route=c,this.location=u,this.changeDetectorRef=d,this.broadcasterService=h,this.router=p,this.applySavedState=!0,super.onSuccessfulLoad=()=>Ar(this,void 0,void 0,(function*(){this.selectType(this.type)})),this.applySavedState=null!=window.previousPopupUrl&&!window.previousPopupUrl.startsWith("/send-type")}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Ar(this,void 0,void 0,(function*(){yield e.ngOnInit.call(this),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>Ar(this,void 0,void 0,(function*(){var t;if(this.applySavedState&&(this.state=yield this.stateService.getBrowserSendTypeComponentState(),null!=(null===(t=this.state)||void 0===t?void 0:t.searchText)&&(this.searchText=this.state.searchText)),null!=e.type){switch(this.type=parseInt(e.type,null),this.type){case Ds.Text:this.groupingTitle=this.i18nService.t("sendTypeText");break;case Ds.File:this.groupingTitle=this.i18nService.t("sendTypeFile")}yield this.load((e=>e.type===this.type))}this.applySavedState&&null!=this.state&&window.setTimeout((()=>{var e;return this.popupUtils.setContentScrollY(window,null===(e=this.state)||void 0===e?void 0:e.scrollY)}),0),this.stateService.setBrowserSendTypeComponentState(null)})))),this.broadcasterService.subscribe(Pr,(e=>{this.ngZone.run((()=>Ar(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)e.successfully&&(this.refreshTimeout=window.setTimeout((()=>{this.refresh()}),500));this.changeDetectorRef.detectChanges()}))))}))}))}ngOnDestroy(){null!=this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.saveState(),this.broadcasterService.unsubscribe(Pr)}selectSend(e){return Ar(this,void 0,void 0,(function*(){this.router.navigate(["/edit-send"],{queryParams:{sendId:e.id}})}))}addSend(){return Ar(this,void 0,void 0,(function*(){this.disableSend||this.router.navigate(["/add-send"],{queryParams:{type:this.type}})}))}removePassword(e){const t=Object.create(null,{removePassword:{get:()=>super.removePassword}});return Ar(this,void 0,void 0,(function*(){this.disableSend||t.removePassword.call(this,e)}))}back(){window.routeDirection="b",this.location.back()}saveState(){return Ar(this,void 0,void 0,(function*(){this.state={scrollY:this.popupUtils.getContentScrollY(window),searchText:this.searchText},yield this.stateService.setBrowserSendTypeComponentState(this.state)}))}}Ir.ɵfac=function(e){return new(e||Ir)(s.Y36(Ks),s.Y36(_e),s.Y36(Je),s.Y36(Ye),s.Y36(s.R0b),s.Y36(Hi),s.Y36(jo),s.Y36($t),s.Y36(js),s.Y36(Pe.gz),s.Y36(u.Ye),s.Y36(s.sBO),s.Y36(Tn),s.Y36(Pe.F0),s.Y36(Ct))},Ir.ɵcmp=s.Xpm({type:Ir,selectors:[["app-send-type"]],features:[s.qOj],decls:46,vars:20,consts:[[1,"left"],["type","button",3,"click"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"sr-only"],[1,"search"],["type","search","id","search","autocomplete","off","appAutofocus","",3,"placeholder","ngModel","ngModelChange","input"],[1,"bwi","bwi-search"],[1,"right"],["type","button",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1",3,"ngClass"],["type","warning",3,"title",4,"ngIf"],["class","no-items",4,"ngIf"],["class","box list only-list",4,"ngIf"],["type","warning",3,"title"],[1,"no-items"],["class","bwi bwi-spinner bwi-spin bwi-3x","aria-hidden","true",4,"ngIf"],[4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["type","button",1,"btn","block","primary","link",3,"disabled","click"],[1,"box","list","only-list"],[1,"box-header"],[1,"flex-right"],[1,"box-content"],[3,"sends","title","disabledByPolicy","onSelected","onCopySendLink","onRemovePassword","onDeleteSend"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.back()})),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",5),s._uU(20,"\n "),s.TgZ(21,"input",6),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.search(200)})),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s._UZ(24,"i",7),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.TgZ(29,"button",9),s.NdJ("click",(function(){return t.addSend()})),s.ALo(30,"i18n"),s._uU(31,"\n "),s._UZ(32,"i",10),s._uU(33,"\n "),s.qZA(),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n"),s.TgZ(37,"main",11),s._uU(38,"\n "),s.YNc(39,_r,4,6,"app-callout",12),s._uU(40,"\n "),s.YNc(41,Cr,6,2,"div",13),s._uU(42,"\n "),s.YNc(43,kr,15,7,"div",14),s._uU(44,"\n"),s.qZA(),s._uU(45,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,10,"back")),s.xp6(6),s.Oqu(s.lcZ(17,12,"send")),s.xp6(5),s.s9C("placeholder",s.lcZ(22,14,"searchType")),s.Q6J("ngModel",t.searchText),s.xp6(8),s.s9C("appA11yTitle",s.lcZ(30,16,"addSend")),s.Q6J("disabled",t.disableSend),s.xp6(8),s.Q6J("ngClass",s.VKq(18,Or,t.disableSend)),s.xp6(2),s.Q6J("ngIf",t.disableSend),s.xp6(2),s.Q6J("ngIf",!t.filteredSends.length),s.xp6(2),s.Q6J("ngIf",t.filteredSends.length))},dependencies:[u.mk,u.O5,ue.Fj,ue.JJ,ue.On,Ht,It,wt,ur,Ze],encapsulation:2});var qr=i(19133),Dr=i(41216),Mr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Fr{constructor(e){this.router=e,this.navigationStartSub=this.router.events.pipe((0,qr.h)((e=>e instanceof Pe.OD)),(0,Dr.G)()).subscribe((e=>[this.lastNavigation,this.thisNavigation]=e)),this.navigationSuccessSub=this.router.events.pipe((0,qr.h)((e=>e instanceof Pe.m2))).subscribe((e=>this.lastNavigationSuccessId=e.id))}canActivate(){var e,t;return Mr(this,void 0,void 0,(function*(){return!("hashchange"===(null===(e=this.thisNavigation)||void 0===e?void 0:e.navigationTrigger)&&"popstate"===this.lastNavigation.navigationTrigger&&this.lastNavigationSuccessId===this.lastNavigation.id&&this.lastNavigation.url===(null===(t=this.thisNavigation)||void 0===t?void 0:t.url))}))}ngOnDestroy(){null!=this.navigationStartSub&&this.navigationStartSub.unsubscribe(),null!=this.navigationSuccessSub&&this.navigationSuccessSub.unsubscribe()}}Fr.ɵfac=function(e){return new(e||Fr)(s.LFG(Pe.F0))},Fr.ɵprov=s.Yz7({token:Fr,factory:Fr.ɵfac});var Nr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Lr(e,t){if(1&e&&(s.TgZ(0,"option",29),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e),s.xp6(1),s.Oqu(e)}}function Er(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"select",28),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.uri=t)})),s._uU(1,"\n "),s.TgZ(2,"option",29),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,Lr,2,2,"option",30),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit,n=s.oxw(2);s.MGl("id","currentUris",t,"")("name","currentUris",t,""),s.Q6J("ngModel",i.uri)("hidden",!i.showCurrentUris),s.xp6(2),s.Q6J("ngValue",null),s.xp6(1),s.hij("-- ",s.lcZ(4,7,"select")," --"),s.xp6(3),s.Q6J("ngForOf",n.currentUris)}}function Rr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",31),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.toggleUriInput(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",32),s._uU(4,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.s9C("appA11yTitle",s.lcZ(1,2,"toggleCurrentUris")),s.uIk("aria-pressed",!0===e.showCurrentUris)}}function Jr(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"button",19),s.NdJ("click",(function(){const t=s.CHM(e).index,i=s.oxw(2);return s.KtG(i.removeUri(t))})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",20),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",21),s._uU(9,"\n "),s.TgZ(10,"label",22),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"input",23),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.uri=t)})),s.ALo(15,"i18n"),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"label",24),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.YNc(21,Er,8,9,"select",25),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"div",26),s._uU(25,"\n "),s.YNc(26,Rr,5,4,"button",27),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(2);s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,12,"remove")),s.xp6(8),s.MGl("for","excludedDomain",i,""),s.xp6(1),s.Oqu(s.xi3(12,14,"uriPosition",i+1)),s.xp6(3),s.MGl("id","excludedDomain",i,"")("name","excludedDomain",i,"")("placeholder","",s.lcZ(15,17,"ex")," https://google.com"),s.Q6J("ngModel",e.uri),s.xp6(3),s.MGl("for","currentUris",i,""),s.xp6(1),s.AsE("\n ",s.lcZ(19,19,"currentUri")," ",i+1,"\n "),s.xp6(3),s.Q6J("ngIf",n.currentUris&&n.currentUris.length),s.xp6(5),s.Q6J("ngIf",n.currentUris&&n.currentUris.length)}}function Yr(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Jr,29,21,"div",17),s._uU(3,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngForOf",e.excludedDomains)("ngForTrackBy",e.trackByFunction)}}const zr="excludedDomains";class Kr{constructor(e,t,i,n,s,o){this.stateService=e,this.i18nService=t,this.router=i,this.broadcasterService=n,this.ngZone=s,this.platformUtilsService=o,this.excludedDomains=[],this.existingExcludedDomains=[]}ngOnInit(){return Nr(this,void 0,void 0,(function*(){const e=yield this.stateService.getNeverDomains();if(e)for(const t of Object.keys(e))this.excludedDomains.push({uri:t,showCurrentUris:!1}),this.existingExcludedDomains.push({uri:t,showCurrentUris:!1});yield this.loadCurrentUris(),this.broadcasterService.subscribe(zr,(e=>{this.ngZone.run((()=>Nr(this,void 0,void 0,(function*(){switch(e.command){case"tabChanged":case"windowChanged":null!=this.loadCurrentUrisTimeout&&window.clearTimeout(this.loadCurrentUrisTimeout),this.loadCurrentUrisTimeout=window.setTimeout((()=>Nr(this,void 0,void 0,(function*(){return yield this.loadCurrentUris()}))),500)}}))))}))}))}ngOnDestroy(){this.broadcasterService.unsubscribe(zr)}addUri(){return Nr(this,void 0,void 0,(function*(){this.excludedDomains.push({uri:"",showCurrentUris:!1})}))}removeUri(e){return Nr(this,void 0,void 0,(function*(){this.excludedDomains.splice(e,1)}))}submit(){return Nr(this,void 0,void 0,(function*(){const e={},t=this.getNewlyAddedDomians(this.excludedDomains);for(const i of this.excludedDomains){if(0===t.filter((e=>e.uri===i.uri)).length)e[i.uri]=null;else if(i.uri&&""!==i.uri){const t=nt.getHostname(i.uri);if(!t)return void this.platformUtilsService.showToast("error",null,this.i18nService.t("excludedDomainsInvalidDomain",i.uri));e[t]=null}}yield this.stateService.setNeverDomains(e),this.router.navigate(["/tabs/settings"])}))}trackByFunction(e,t){return e}getNewlyAddedDomians(e){return this.excludedDomains.filter((e=>!this.existingExcludedDomains.some((t=>e.uri===t.uri))))}toggleUriInput(e){e.showCurrentUris=!e.showCurrentUris}loadCurrentUris(){return Nr(this,void 0,void 0,(function*(){const e=yield Wt.tabsQuery({windowType:"normal"});if(e){const t=new Set(e.map((e=>nt.getHostname(e.url))));t.delete(null),this.currentUris=Array.from(t)}}))}}Kr.ɵfac=function(e){return new(e||Kr)(s.Y36(Mt),s.Y36(_e),s.Y36(Pe.F0),s.Y36(Tn),s.Y36(s.R0b),s.Y36(Je))},Kr.ɵcmp=s.Xpm({type:Kr,selectors:[["app-excluded-domains"]],decls:55,vars:16,consts:[[3,"ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/tabs/settings"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["type","submit"],["tabindex","-1"],[1,"box"],[1,"box-content"],[4,"ngIf"],["type","button","appStopClick","",1,"box-content-row","box-content-row-newmulti",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw","bwi-lg"],[1,"box-footer"],["class","box-content-row box-content-row-multi","appBoxRow","",4,"ngFor","ngForOf","ngForTrackBy"],["appBoxRow","",1,"box-content-row","box-content-row-multi"],["type","button","appStopClick","",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],[1,"row-main"],[3,"for"],["type","text","inputmode","url","appInputVerbatim","",3,"id","name","ngModel","placeholder","ngModelChange"],[1,"sr-only",3,"for"],[3,"id","name","ngModel","hidden","ngModelChange",4,"ngIf"],[1,"action-buttons"],["type","button","class","row-btn","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],[3,"id","name","ngModel","hidden","ngModelChange"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-list"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8,"\n "),s.TgZ(9,"span",4),s._UZ(10,"i",5),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"span"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"h1",6),s._uU(19,"\n "),s.TgZ(20,"span",7),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"div",8),s._uU(26,"\n "),s.TgZ(27,"button",9),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.TgZ(33,"main",10),s._uU(34,"\n "),s.TgZ(35,"div",11),s._uU(36,"\n "),s.TgZ(37,"div",12),s._uU(38,"\n "),s.YNc(39,Yr,4,2,"ng-container",13),s._uU(40,"\n "),s.TgZ(41,"button",14),s.NdJ("click",(function(){return t.addUri()})),s._uU(42,"\n "),s._UZ(43,"i",15),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n "),s.qZA(),s._uU(47,"\n "),s.TgZ(48,"div",16),s._uU(49),s.ALo(50,"i18n"),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n"),s.qZA(),s._uU(54,"\n")),2&e&&(s.xp6(13),s.Oqu(s.lcZ(14,6,"back")),s.xp6(8),s.Oqu(s.lcZ(22,8,"excludedDomains")),s.xp6(7),s.Oqu(s.lcZ(29,10,"save")),s.xp6(11),s.Q6J("ngIf",t.excludedDomains),s.xp6(5),s.hij(" ",s.lcZ(45,12,"newUri"),"\n "),s.xp6(5),s.hij("\n ",s.lcZ(50,14,"excludedDomainsDesc"),"\n "))},dependencies:[Pe.rH,u.sg,u.O5,ue._Y,ue.YN,ue.Kr,ue.Fj,ue.EJ,ue.JJ,ue.JL,ue.On,ue.F,Ht,Xe,bt,St,Ze],encapsulation:2});var Br,Gr,Qr=i(56083),Vr=i(84224);!function(e){e[e.AccountEncrypted=0]="AccountEncrypted",e[e.FileEncrypted=1]="FileEncrypted"}(Br||(Br={})),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.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.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.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.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"}(Gr||(Gr={}));class Hr{}class jr{}class Wr{}class $r{}var Xr=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ea{constructor(e,t,i,n,o,r,a,l,c,u,d){this.cryptoService=e,this.i18nService=t,this.platformUtilsService=i,this.exportService=n,this.eventService=o,this.policyService=r,this.win=a,this.logService=l,this.userVerificationService=c,this.formBuilder=u,this.fileDownloadService=d,this.onSaved=new s.vpe,this.disabledByPolicy=!1,this.exportForm=this.formBuilder.group({format:["json"],secret:[""],filePassword:["",ue.kI.required],confirmFilePassword:["",ue.kI.required],fileEncryptionType:[Br.AccountEncrypted]}),this.formatOptions=[{name:".json",value:"json"},{name:".csv",value:"csv"},{name:".json (Encrypted)",value:"encrypted_json"}],this.destroy$=new Be.x}ngOnInit(){return Xr(this,void 0,void 0,(function*(){yield this.checkExportDisabled(),(0,Qr.T)(this.exportForm.get("format").valueChanges,this.exportForm.get("fileEncryptionType").valueChanges).pipe((0,Jt.R)(this.destroy$)).pipe((0,Vr.O)(0)).subscribe((()=>this.adjustValidators()))}))}ngOnDestroy(){this.destroy$.next()}checkExportDisabled(){return Xr(this,void 0,void 0,(function*(){this.disabledByPolicy=yield this.policyService.policyAppliesToUser(qs.DisablePersonalVaultExport),this.disabledByPolicy&&this.exportForm.disable()}))}get encryptedFormat(){return"encrypted_json"===this.format}doExport(){return Xr(this,void 0,void 0,(function*(){try{this.formPromise=this.getExportData();const e=yield this.formPromise;this.downloadFile(e),this.saved(),yield this.collectEvent(),this.exportForm.get("secret").setValue(""),this.exportForm.clearValidators()}catch(e){this.logService.error(e)}}))}submit(){return Xr(this,void 0,void 0,(function*(){if(this.disabledByPolicy)return void this.platformUtilsService.showToast("error",null,this.i18nService.t("personalVaultExportPolicyInEffect"));if(!(yield this.warningDialog()))return;const e=this.exportForm.get("secret").value;try{yield this.userVerificationService.verifyUser(e)}catch(e){return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e.message)}this.doExport()}))}warningDialog(){return Xr(this,void 0,void 0,(function*(){return this.encryptedFormat?yield this.platformUtilsService.showDialog("

"+this.i18nService.t("encExportKeyWarningDesc")+"

"+this.i18nService.t("encExportAccountWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning",!0):yield this.platformUtilsService.showDialog(this.i18nService.t("exportWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning")}))}saved(){this.onSaved.emit()}getExportData(){return"encrypted_json"===this.format&&this.fileEncryptionType===Br.FileEncrypted?this.exportService.getPasswordProtectedExport(this.filePassword):this.exportService.getExport(this.format,null)}getFileName(e){let t=this.format;return"encrypted_json"===this.format&&(e=null==e?"encrypted":"encrypted_"+e,t="json"),this.exportService.getFileName(e,t)}collectEvent(){return Xr(this,void 0,void 0,(function*(){yield this.eventService.collect(Gr.User_ClientExportedVault)}))}get format(){return this.exportForm.get("format").value}get filePassword(){return this.exportForm.get("filePassword").value}get confirmFilePassword(){return this.exportForm.get("confirmFilePassword").value}get fileEncryptionType(){return this.exportForm.get("fileEncryptionType").value}toggleFilePassword(){this.showFilePassword=!this.showFilePassword,document.getElementById("filePassword").focus()}toggleConfirmFilePassword(){this.showConfirmFilePassword=!this.showConfirmFilePassword,document.getElementById("confirmFilePassword").focus()}adjustValidators(){this.exportForm.get("confirmFilePassword").reset(),this.exportForm.get("filePassword").reset(),this.encryptedFormat&&this.fileEncryptionType==Br.FileEncrypted?(this.exportForm.controls.filePassword.enable(),this.exportForm.controls.confirmFilePassword.enable()):(this.exportForm.controls.filePassword.disable(),this.exportForm.controls.confirmFilePassword.disable())}downloadFile(e){const t=this.getFileName();this.fileDownloadService.download({fileName:t,blobData:e,blobOptions:{type:"text/plain"}})}}ea.ɵfac=function(e){return new(e||ea)(s.Y36(zt),s.Y36(_e),s.Y36(Je),s.Y36(Hr),s.Y36(jr),s.Y36(Hi),s.Y36(Window),s.Y36(Ct),s.Y36(Wr),s.Y36(ue.QS),s.Y36($r))},ea.ɵdir=s.lG2({type:ea,outputs:{onSaved:"onSaved"}});class ta{}var ia,na=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function sa(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"app-callout",1),s.ALo(3,"i18n"),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6,"\n"),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.s9C("title",s.lcZ(3,2,e.scopeConfig.title)),s.xp6(2),s.hij("\n ",s.xi3(5,4,e.scopeConfig.description,e.scopeConfig.scopeIdentifier),"\n ")}}class oa{constructor(e,t){this.organizationService=e,this.stateService=t,this.organizationId=null,this.show=!1}ngOnInit(){return na(this,void 0,void 0,(function*(){(yield this.organizationService.hasOrganizations())&&(this.scopeConfig=null!=this.organizationId?{title:"exportingOrganizationVaultTitle",description:"exportingOrganizationVaultDescription",scopeIdentifier:(yield this.organizationService.get(this.organizationId)).name}:{title:"exportingPersonalVaultTitle",description:"exportingPersonalVaultDescription",scopeIdentifier:yield this.stateService.getEmail()},this.show=!0)}))}}oa.ɵfac=function(e){return new(e||oa)(s.Y36(ta),s.Y36(Mt))},oa.ɵcmp=s.Xpm({type:oa,selectors:[["app-export-scope-callout"]],inputs:{organizationId:"organizationId"},decls:2,vars:1,consts:[[4,"ngIf"],["type","info",3,"title"]],template:function(e,t){1&e&&(s.YNc(0,sa,7,7,"ng-container",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.show)},dependencies:[u.O5,wt,Ze],encapsulation:2}),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.OTP=1]="OTP"}(ia||(ia={}));var ra=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function aa(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"label",1),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"input",2),s._uU(7,"\n "),s.TgZ(8,"small",3),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n"),s.BQk()),2&e){const e=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,3,"masterPass")),s.xp6(3),s.Q6J("formControl",e.secret),s.xp6(3),s.Oqu(s.lcZ(10,5,"confirmIdentity"))}}function la(e,t){1&e&&(s.TgZ(0,"span",10),s._uU(1,"\n "),s._UZ(2,"i",11),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.Q6J("@sent",void 0),s.xp6(3),s.hij("\n ",s.lcZ(4,2,"codeSent"),"\n "))}function ca(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",4),s._uU(3,"\n "),s.TgZ(4,"label",5),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",6),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.requestOTP())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.YNc(12,la,5,4,"span",7),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n\n "),s.TgZ(15,"div",4),s._uU(16,"\n "),s.TgZ(17,"label",8),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s._UZ(21,"input",9),s._uU(22,"\n "),s.TgZ(23,"small",3),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n"),s.BQk()}if(2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,7,"sendVerificationCode")),s.xp6(3),s.Q6J("disabled",e.disableRequestOTP),s.xp6(1),s.hij("\n ",s.lcZ(10,9,"sendCode"),"\n "),s.xp6(3),s.Q6J("ngIf",e.sentCode),s.xp6(6),s.Oqu(s.lcZ(19,11,"verificationCode")),s.xp6(3),s.Q6J("formControl",e.secret),s.xp6(3),s.Oqu(s.lcZ(25,13,"confirmIdentity"))}}class ua{constructor(e,t){this.keyConnectorService=e,this.userVerificationService=t,this.usesKeyConnector=!1,this.disableRequestOTP=!1,this.sentCode=!1,this.secret=new ue.NI("")}ngOnInit(){return ra(this,void 0,void 0,(function*(){this.usesKeyConnector=yield this.keyConnectorService.getUsesKeyConnector(),this.processChanges(this.secret.value),this.secret.valueChanges.subscribe((e=>this.processChanges(e)))}))}requestOTP(){return ra(this,void 0,void 0,(function*(){if(this.usesKeyConnector){this.disableRequestOTP=!0;try{yield this.userVerificationService.requestOTP(),this.sentCode=!0}finally{this.disableRequestOTP=!1}}}))}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()}processChanges(e){null!=this.onChange&&this.onChange({type:this.usesKeyConnector?ia.OTP:ia.MasterPassword,secret:nt.isNullOrWhitespace(e)?null:e})}}function da(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"label",2),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s._UZ(8,"input",3),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n"),s.BQk()),2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,2,"masterPass")),s.xp6(3),s.Q6J("formControl",e.secret)}}function ha(e,t){1&e&&(s.TgZ(0,"span",9),s._uU(1,"\n "),s._UZ(2,"i",10),s._uU(3),s.ALo(4,"i18n"),s.qZA()),2&e&&(s.Q6J("@sent",void 0),s.xp6(3),s.hij("\n ",s.lcZ(4,2,"codeSent"),"\n "))}function pa(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"label",4),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.requestOTP())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.YNc(12,ha,5,4,"span",6),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n\n "),s.TgZ(15,"div",1),s._uU(16,"\n "),s.TgZ(17,"label",7),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s._UZ(21,"input",8),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n"),s.BQk()}if(2&e){const e=s.oxw();s.xp6(5),s.Oqu(s.lcZ(6,6,"sendVerificationCode")),s.xp6(3),s.Q6J("disabled",e.disableRequestOTP),s.xp6(1),s.hij("\n ",s.lcZ(10,8,"sendCode"),"\n "),s.xp6(3),s.Q6J("ngIf",e.sentCode),s.xp6(6),s.Oqu(s.lcZ(19,10,"verificationCode")),s.xp6(3),s.Q6J("formControl",e.secret)}}ua.ɵfac=function(e){return new(e||ua)(s.Y36(De),s.Y36(Wr))},ua.ɵcmp=s.Xpm({type:ua,selectors:[["app-user-verification"]],features:[s._Bn([{provide:ue.JU,multi:!0,useExisting:ua}])],decls:4,vars:2,consts:[[4,"ngIf"],["for","masterPassword"],["id","masterPassword","type","password","name","MasterPasswordHash","required","","appAutofocus","","appInputVerbatim","",1,"form-control",3,"formControl"],[1,"form-text","text-muted"],[1,"form-group"],[1,"d-block"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["class","ml-2 text-success","role","alert",4,"ngIf"],["for","verificationCode"],["id","verificationCode","type","input","name","verificationCode","required","","appAutofocus","","appInputVerbatim","",1,"form-control",3,"formControl"],["role","alert",1,"ml-2","text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"]],template:function(e,t){1&e&&(s.YNc(0,aa,12,7,"ng-container",0),s._uU(1,"\n"),s.YNc(2,ca,28,15,"ng-container",0),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",!t.usesKeyConnector),s.xp6(2),s.Q6J("ngIf",t.usesKeyConnector))},encapsulation:2,data:{animation:[(0,he.X$)("sent",[(0,he.eR)(":enter",[(0,he.oB)({opacity:0}),(0,he.jt)("100ms",(0,he.oB)({opacity:1}))])])]}});class ga extends ua{}function va(e,t){1&e&&(s.TgZ(0,"app-callout",20),s.ALo(1,"i18n"),s._uU(2),s.ALo(3,"i18n"),s.qZA()),2&e&&(s.s9C("title",s.lcZ(1,2,"vaultExportDisabled")),s.xp6(2),s.hij("\n ",s.lcZ(3,4,"personalVaultExportPolicyInEffect"),"\n "))}function ya(e,t){1&e&&s._UZ(0,"app-export-scope-callout")}function fa(e,t){if(1&e&&(s.TgZ(0,"option",21),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("value",e.value),s.xp6(1),s.Oqu(e.name)}}ga.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(ga)))(t||ga)}}(),ga.ɵcmp=s.Xpm({type:ga,selectors:[["app-user-verification"]],features:[s._Bn([{provide:ue.JU,multi:!0,useExisting:ga}]),s.qOj],decls:4,vars:2,consts:[[4,"ngIf"],["appBoxRow","",1,"box-content-row"],["for","masterPassword"],["id","masterPassword","type","password","name","MasterPasswordHash","required","","appAutofocus","","appInputVerbatim","",1,"form-control",3,"formControl"],[1,"d-block"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["class","ml-2 text-success","role","alert",4,"ngIf"],["for","verificationCode"],["id","verificationCode","type","input","name","verificationCode","required","","appAutofocus","","appInputVerbatim","",1,"form-control",3,"formControl"],["role","alert",1,"ml-2","text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"]],template:function(e,t){1&e&&(s.YNc(0,da,11,4,"ng-container",0),s._uU(1,"\n"),s.YNc(2,pa,24,12,"ng-container",0),s._uU(3,"\n")),2&e&&(s.Q6J("ngIf",!t.usesKeyConnector),s.xp6(2),s.Q6J("ngIf",t.usesKeyConnector))},dependencies:[u.O5,ue.Fj,ue.JJ,ue.Q7,It,Xe,bt,ue.oH,Ze],encapsulation:2,data:{animation:[(0,he.X$)("sent",[(0,he.eR)(":enter",[(0,he.oB)({opacity:0}),(0,he.jt)("100ms",(0,he.oB)({opacity:1}))])])]}});class ma extends ea{constructor(e,t,i,n,s,o,r,a,l,c,u){super(e,t,i,n,s,o,window,a,l,c,u),this.router=r}saved(){super.saved(),this.router.navigate(["/tabs/settings"])}}ma.ɵfac=function(e){return new(e||ma)(s.Y36(zt),s.Y36(_e),s.Y36(Je),s.Y36(Hr),s.Y36(jr),s.Y36(Hi),s.Y36(Pe.F0),s.Y36(Ct),s.Y36(Wr),s.Y36(ue.QS),s.Y36($r))},ma.ɵcmp=s.Xpm({type:ma,selectors:[["app-export"]],features:[s.qOj],decls:68,vars:20,consts:[[3,"formGroup","ngSubmit"],[1,"left"],["type","button","routerLink","/tabs/settings"],["aria-hidden","true",1,"header-icon"],[1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],["tabindex","-1"],["type","warning",3,"title",4,"ngIf"],[4,"ngIf"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","format"],["id","format","name","Format","formControlName","format"],[3,"value",4,"ngFor","ngForOf"],["ngDefaultControl","","formControlName","secret","name","Secret"],[1,"box-footer"],["type","warning",3,"title"],[3,"value"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(1,"\n "),s.TgZ(2,"header"),s._uU(3,"\n "),s.TgZ(4,"div",1),s._uU(5,"\n "),s.TgZ(6,"button",2),s._uU(7,"\n "),s.TgZ(8,"span",3),s._UZ(9,"i",4),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"span"),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"h1",5),s._uU(18,"\n "),s.TgZ(19,"span",6),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"div",7),s._uU(25,"\n "),s.TgZ(26,"button",8),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",9),s._uU(33,"\n "),s.YNc(34,va,4,6,"app-callout",10),s._uU(35,"\n "),s.YNc(36,ya,1,0,"app-export-scope-callout",11),s._uU(37,"\n\n "),s.TgZ(38,"div",12),s._uU(39,"\n "),s.TgZ(40,"div",13),s._uU(41,"\n "),s.TgZ(42,"div",14),s._uU(43,"\n "),s.TgZ(44,"label",15),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n "),s.TgZ(48,"select",16),s._uU(49,"\n "),s.YNc(50,fa,2,2,"option",17),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.TgZ(54,"app-user-verification",18),s._uU(55,"\n "),s.qZA(),s._uU(56,"\n "),s.qZA(),s._uU(57,"\n "),s.TgZ(58,"div",19),s._uU(59,"\n "),s.TgZ(60,"p"),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n "),s.qZA(),s._uU(64,"\n "),s.qZA(),s._uU(65,"\n "),s.qZA(),s._uU(66,"\n"),s.qZA(),s._uU(67,"\n")),2&e&&(s.Q6J("formGroup",t.exportForm),s.xp6(12),s.Oqu(s.lcZ(13,10,"back")),s.xp6(8),s.Oqu(s.lcZ(21,12,"exportVault")),s.xp6(6),s.Q6J("disabled",!t.exportForm.enabled),s.xp6(1),s.hij("\n ",s.lcZ(28,14,"submit"),"\n "),s.xp6(7),s.Q6J("ngIf",t.disabledByPolicy),s.xp6(2),s.Q6J("ngIf",!t.disabledByPolicy),s.xp6(9),s.Oqu(s.lcZ(46,16,"fileFormat")),s.xp6(5),s.Q6J("ngForOf",t.formatOptions),s.xp6(11),s.Oqu(s.lcZ(62,18,"confirmIdentity")))},dependencies:[Pe.rH,u.sg,u.O5,ue._Y,ue.YN,ue.Kr,ue.Fj,ue.EJ,ue.JJ,ue.JL,Xe,wt,oa,ue.sg,ue.u,ga,Ze],encapsulation:2});class wa{constructor(e){this.id=null,this.name=null,this.revisionDate=null,e&&(this.id=e.id,this.revisionDate=e.revisionDate)}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new wa,e,{revisionDate:t})}}class ba{}class Sa{}var Ua=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class xa{constructor(e,t,i,n,o){this.folderService=e,this.folderApiService=t,this.i18nService=i,this.platformUtilsService=n,this.logService=o,this.onSavedFolder=new s.vpe,this.onDeletedFolder=new s.vpe,this.editMode=!1,this.folder=new wa}ngOnInit(){return Ua(this,void 0,void 0,(function*(){yield this.init()}))}submit(){return Ua(this,void 0,void 0,(function*(){if(null==this.folder.name||""===this.folder.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;try{const e=yield this.folderService.encrypt(this.folder);return this.formPromise=this.folderApiService.save(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedFolder":"addedFolder")),this.onSavedFolder.emit(this.folder),!0}catch(e){this.logService.error(e)}return!1}))}delete(){return Ua(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteFolderConfirmation"),this.i18nService.t("deleteFolder"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.deletePromise=this.folderApiService.delete(this.folder.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedFolder")),this.onDeletedFolder.emit(this.folder)}catch(e){this.logService.error(e)}return!0}))}init(){return Ua(this,void 0,void 0,(function*(){if(this.editMode=null!=this.folderId,this.editMode){this.editMode=!0,this.title=this.i18nService.t("editFolder");const e=yield this.folderService.get(this.folderId);this.folder=yield e.decrypt()}else this.title=this.i18nService.t("addFolder")}))}}xa.ɵfac=function(e){return new(e||xa)(s.Y36(ba),s.Y36(Sa),s.Y36(_e),s.Y36(Je),s.Y36(Ct))},xa.ɵdir=s.lG2({type:xa,inputs:{folderId:"folderId"},outputs:{onSavedFolder:"onSavedFolder",onDeletedFolder:"onDeletedFolder"}});var Aa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _a(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"div",19),s._uU(3,"\n "),s.TgZ(4,"button",20,21),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.delete())})),s._uU(6,"\n "),s.TgZ(7,"div",22),s._uU(8,"\n "),s.TgZ(9,"div",23),s._uU(10,"\n "),s._UZ(11,"i",24),s._uU(12,"\n "),s._UZ(13,"i",25),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"span"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(2);s.xp6(4),s.Q6J("appApiAction",t.deletePromise),s.xp6(7),s.Q6J("hidden",e.loading),s.xp6(2),s.Q6J("hidden",!e.loading),s.xp6(4),s.Oqu(s.lcZ(18,4,"deleteFolder"))}}function Za(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"main",11),s._uU(1,"\n "),s.TgZ(2,"div",12),s._uU(3,"\n "),s.TgZ(4,"div",13),s._uU(5,"\n "),s.TgZ(6,"div",14),s._uU(7,"\n "),s.TgZ(8,"label",15),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"input",16),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.folder.name=t)})),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.YNc(17,_a,23,6,"div",17),s._uU(18,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(9),s.Oqu(s.lcZ(10,4,"name")),s.xp6(3),s.Q6J("ngModel",e.folder.name)("appAutofocus",!e.editMode),s.xp6(5),s.Q6J("ngIf",e.editMode)}}class Ta extends xa{constructor(e,t,i,n,s,o,r){super(e,t,i,n,r),this.router=s,this.route=o}ngOnInit(){return Aa(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>Aa(this,void 0,void 0,(function*(){e.folderId&&(this.folderId=e.folderId),yield this.init()}))))}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return Aa(this,void 0,void 0,(function*(){return!!(yield e.submit.call(this))&&(this.router.navigate(["/folders"]),!0)}))}delete(){const e=Object.create(null,{delete:{get:()=>super.delete}});return Aa(this,void 0,void 0,(function*(){const t=yield e.delete.call(this);return t&&this.router.navigate(["/folders"]),t}))}}Ta.ɵfac=function(e){return new(e||Ta)(s.Y36(ba),s.Y36(Sa),s.Y36(_e),s.Y36(Je),s.Y36(Pe.F0),s.Y36(Pe.gz),s.Y36(Ct))},Ta.ɵcmp=s.Xpm({type:Ta,selectors:[["app-folder-add-edit"]],features:[s.qOj],decls:34,vars:12,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button","routerLink","/folders"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1",4,"ngIf"],["tabindex","-1"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","name"],["id","name","type","text","name","Name",3,"ngModel","appAutofocus","ngModelChange"],["class","box list",4,"ngIf"],[1,"box","list"],[1,"box-content","single-line"],["type","button","appStopClick","",1,"box-content-row",3,"appApiAction","click"],["deleteBtn",""],[1,"row-main","text-danger"],["aria-hidden","true",1,"icon","text-danger"],[1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],[1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",6),s._uU(19,"\n "),s.TgZ(20,"button",7),s._uU(21,"\n "),s.TgZ(22,"span",8),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s._UZ(26,"i",9),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.YNc(31,Za,19,6,"main",10),s._uU(32,"\n"),s.qZA(),s._uU(33,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,8,"cancel")),s.xp6(7),s.Oqu(t.title),s.xp6(5),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(24,10,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(5),s.Q6J("ngIf",t.folder)}},dependencies:[Pe.rH,u.O5,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.On,ue.F,Ot,It,Xe,St,Ze],encapsulation:2});var Ca,ka,Oa=i(24075);function Pa(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",15),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.folderSelected(t))})),s._uU(1),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(1),s.hij("\n ",e.name,"\n ")}}function Ia(e,t){if(1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"div",13),s._uU(3,"\n "),s.YNc(4,Pa,2,1,"button",14),s.ALo(5,"async"),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",s.lcZ(5,1,e.folders$))}}function qa(e,t){1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"noFolders")))}class Da{constructor(e,t){this.folderService=e,this.router=t,this.folders$=this.folderService.folderViews$.pipe((0,Oa.U)((e=>(e.length>0&&(e=e.slice(0,e.length-1)),e))))}folderSelected(e){this.router.navigate(["/edit-folder"],{queryParams:{folderId:e.id}})}addFolder(){this.router.navigate(["/add-folder"])}}Da.ɵfac=function(e){return new(e||Da)(s.Y36(ba),s.Y36(Pe.F0))},Da.ɵcmp=s.Xpm({type:Da,selectors:[["app-folders"]],decls:41,vars:15,consts:[[1,"left"],["type","button","routerLink","/tabs/settings"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["type","button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1"],["class","box list full-list",4,"ngIf"],["class","no-items",4,"ngIf"],[1,"box","list","full-list"],[1,"box-content"],["type","button","appStopClick","","class","box-content-row padded",3,"click",4,"ngFor","ngForOf"],["type","button","appStopClick","",1,"box-content-row","padded",3,"click"],[1,"no-items"]],template:function(e,t){if(1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16,"\n "),s.TgZ(17,"span",5),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"div",6),s._uU(23,"\n "),s.TgZ(24,"button",7),s.NdJ("click",(function(){return t.addFolder()})),s.ALo(25,"i18n"),s._uU(26,"\n "),s._UZ(27,"i",8),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n"),s.qZA(),s._uU(31,"\n"),s.TgZ(32,"main",9),s._uU(33,"\n "),s.YNc(34,Ia,8,3,"div",10),s.ALo(35,"async"),s._uU(36,"\n "),s.YNc(37,qa,6,3,"div",11),s.ALo(38,"async"),s._uU(39,"\n"),s.qZA(),s._uU(40,"\n")),2&e){let e,i;s.xp6(10),s.Oqu(s.lcZ(11,5,"back")),s.xp6(8),s.Oqu(s.lcZ(19,7,"folders")),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(25,9,"addFolder")),s.xp6(10),s.Q6J("ngIf",null==(e=s.lcZ(35,11,t.folders$))?null:e.length),s.xp6(3),s.Q6J("ngIf",!(null!=(i=s.lcZ(38,13,t.folders$))&&i.length))}},dependencies:[Pe.rH,u.sg,u.O5,Ht,St,u.Ov,Ze],encapsulation:2}),function(e){e.System="system",e.Light="light",e.Dark="dark",e.Nord="nord",e.SolarizedDark="solarizedDark"}(Ca||(Ca={})),function(e){e[e.Domain=0]="Domain",e[e.Host=1]="Host",e[e.StartsWith=2]="StartsWith",e[e.Exact=3]="Exact",e[e.RegularExpression=4]="RegularExpression",e[e.Never=5]="Never"}(ka||(ka={}));class Ma{}class Fa{}var Na=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function La(e,t){1&e&&s._UZ(0,"i",14)}function Ea(e,t){1&e&&s._UZ(0,"i",15)}function Ra(e,t){if(1&e&&(s.TgZ(0,"option",32),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Ja(e,t){if(1&e&&(s.TgZ(0,"option",32),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function Ya(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",8),s._uU(1,"\n "),s.TgZ(2,"div",16),s._uU(3,"\n "),s.TgZ(4,"div",17),s._uU(5,"\n "),s.TgZ(6,"label",33),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"select",34),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.clearClipboard=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.saveClearClipboard())})),s._uU(11,"\n "),s.YNc(12,Ja,2,2,"option",20),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"div",21),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,4,"clearClipboard")),s.xp6(3),s.Q6J("ngModel",e.clearClipboard),s.xp6(2),s.Q6J("ngForOf",e.clearClipboardOptions),s.xp6(6),s.Oqu(s.lcZ(19,6,"clearClipboardDesc"))}}function za(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",8),s._uU(3,"\n "),s.TgZ(4,"div",16),s._uU(5,"\n "),s.TgZ(6,"div",17),s._uU(7,"\n "),s.TgZ(8,"label",18),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"select",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.defaultUriMatch=t)}))("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.saveDefaultUriMatch())})),s._uU(13,"\n "),s.YNc(14,Ra,2,2,"option",20),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",21),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.YNc(24,Ya,21,8,"div",22),s._uU(25,"\n "),s.TgZ(26,"div",8),s._uU(27,"\n "),s.TgZ(28,"div",16),s._uU(29,"\n "),s.TgZ(30,"div",23),s._uU(31,"\n "),s.TgZ(32,"label",24),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"input",25),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateAutoTotpCopy())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableAutoTotpCopy=t)})),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.TgZ(40,"div",21),s._uU(41),s.ALo(42,"i18n"),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.TgZ(45,"div",8),s._uU(46,"\n "),s.TgZ(47,"div",16),s._uU(48,"\n "),s.TgZ(49,"div",23),s._uU(50,"\n "),s.TgZ(51,"label",26),s._uU(52),s.ALo(53,"i18n"),s.qZA(),s._uU(54,"\n "),s.TgZ(55,"input",27),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateAddLoginNotification())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableAddLoginNotification=t)})),s.qZA(),s._uU(56,"\n "),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"div",21),s._uU(60),s.ALo(61,"i18n"),s.qZA(),s._uU(62,"\n "),s.qZA(),s._uU(63,"\n "),s.TgZ(64,"div",8),s._uU(65,"\n "),s.TgZ(66,"div",16),s._uU(67,"\n "),s.TgZ(68,"div",23),s._uU(69,"\n "),s.TgZ(70,"label",28),s._uU(71),s.ALo(72,"i18n"),s.qZA(),s._uU(73,"\n "),s.TgZ(74,"input",29),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateChangedPasswordNotification())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableChangedPasswordNotification=t)})),s.qZA(),s._uU(75,"\n "),s.qZA(),s._uU(76,"\n "),s.qZA(),s._uU(77,"\n "),s.TgZ(78,"div",21),s._uU(79),s.ALo(80,"i18n"),s.qZA(),s._uU(81,"\n "),s.qZA(),s._uU(82,"\n "),s.TgZ(83,"div",8),s._uU(84,"\n "),s.TgZ(85,"div",16),s._uU(86,"\n "),s.TgZ(87,"div",23),s._uU(88,"\n "),s.TgZ(89,"label",30),s._uU(90),s.ALo(91,"i18n"),s.qZA(),s._uU(92,"\n "),s.TgZ(93,"input",31),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateContextMenuItem())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableContextMenuItem=t)})),s.qZA(),s._uU(94,"\n "),s.qZA(),s._uU(95,"\n "),s.qZA(),s._uU(96,"\n "),s.TgZ(97,"div",21),s._uU(98),s.ALo(99,"i18n"),s.qZA(),s._uU(100,"\n "),s.qZA(),s._uU(101,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(9),s.Oqu(s.lcZ(10,17,"defaultUriMatchDetection")),s.xp6(3),s.Q6J("ngModel",e.defaultUriMatch),s.xp6(2),s.Q6J("ngForOf",e.uriMatchOptions),s.xp6(6),s.Oqu(s.lcZ(21,19,"defaultUriMatchDetectionDesc")),s.xp6(4),s.Q6J("ngIf",e.showClearClipboard),s.xp6(9),s.Oqu(s.lcZ(34,21,"enableAutoTotpCopy")),s.xp6(3),s.Q6J("ngModel",e.enableAutoTotpCopy),s.xp6(5),s.Oqu(s.lcZ(42,23,"disableAutoTotpCopyDesc")),s.xp6(11),s.Oqu(s.lcZ(53,25,"enableAddLoginNotification")),s.xp6(3),s.Q6J("ngModel",e.enableAddLoginNotification),s.xp6(5),s.Oqu(s.lcZ(61,27,"addLoginNotificationDesc")),s.xp6(11),s.Oqu(s.lcZ(72,29,"enableChangedPasswordNotification")),s.xp6(3),s.Q6J("ngModel",e.enableChangedPasswordNotification),s.xp6(5),s.Oqu(s.lcZ(80,31,"changedPasswordNotificationDesc")),s.xp6(11),s.Oqu(s.lcZ(91,33,"enableContextMenuItem")),s.xp6(3),s.Q6J("ngModel",e.enableContextMenuItem),s.xp6(5),s.Oqu(s.lcZ(99,35,"contextMenuItemDesc"))}}function Ka(e,t){1&e&&s._UZ(0,"i",14)}function Ba(e,t){1&e&&s._UZ(0,"i",15)}function Ga(e,t){if(1&e&&(s.TgZ(0,"option",32),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Qa(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",8),s._uU(3,"\n "),s.TgZ(4,"div",16),s._uU(5,"\n "),s.TgZ(6,"div",23),s._uU(7,"\n "),s.TgZ(8,"label",35),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"input",36),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateShowCardsCurrentTab())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.showCardsCurrentTab=t)})),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"div",21),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"div",8),s._uU(22,"\n "),s.TgZ(23,"div",16),s._uU(24,"\n "),s.TgZ(25,"div",23),s._uU(26,"\n "),s.TgZ(27,"label",37),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n "),s.TgZ(31,"input",38),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateShowIdentitiesCurrentTab())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.showIdentitiesCurrentTab=t)})),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.qZA(),s._uU(34,"\n "),s.TgZ(35,"div",21),s._uU(36),s.ALo(37,"i18n"),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.TgZ(40,"div",8),s._uU(41,"\n "),s.TgZ(42,"div",16),s._uU(43,"\n "),s.TgZ(44,"div",23),s._uU(45,"\n "),s.TgZ(46,"label",39),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"input",40),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateFavicon())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableFavicon=t)})),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.TgZ(54,"div",21),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"div",8),s._uU(60,"\n "),s.TgZ(61,"div",16),s._uU(62,"\n "),s.TgZ(63,"div",23),s._uU(64,"\n "),s.TgZ(65,"label",41),s._uU(66),s.ALo(67,"i18n"),s.qZA(),s._uU(68,"\n "),s.TgZ(69,"input",42),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateBadgeCounter())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableBadgeCounter=t)})),s.qZA(),s._uU(70,"\n "),s.qZA(),s._uU(71,"\n "),s.qZA(),s._uU(72,"\n "),s.TgZ(73,"div",21),s._uU(74),s.ALo(75,"i18n"),s.qZA(),s._uU(76,"\n "),s.qZA(),s._uU(77,"\n "),s.TgZ(78,"div",8),s._uU(79,"\n "),s.TgZ(80,"div",16),s._uU(81,"\n "),s.TgZ(82,"div",17),s._uU(83,"\n "),s.TgZ(84,"label",43),s._uU(85),s.ALo(86,"i18n"),s.qZA(),s._uU(87,"\n "),s.TgZ(88,"select",44),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.theme=t)}))("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.saveTheme())})),s._uU(89,"\n "),s.YNc(90,Ga,2,2,"option",20),s._uU(91,"\n "),s.qZA(),s._uU(92,"\n "),s.qZA(),s._uU(93,"\n "),s.qZA(),s._uU(94,"\n "),s.TgZ(95,"div",21),s._uU(96),s.ALo(97,"i18n"),s.qZA(),s._uU(98,"\n "),s.qZA(),s._uU(99,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(9),s.Oqu(s.lcZ(10,16,"showCardsCurrentTab")),s.xp6(3),s.Q6J("ngModel",e.showCardsCurrentTab),s.xp6(5),s.Oqu(s.lcZ(18,18,"showCardsCurrentTabDesc")),s.xp6(11),s.Oqu(s.lcZ(29,20,"showIdentitiesCurrentTab")),s.xp6(3),s.Q6J("ngModel",e.showIdentitiesCurrentTab),s.xp6(5),s.Oqu(s.lcZ(37,22,"showIdentitiesCurrentTabDesc")),s.xp6(11),s.Oqu(s.lcZ(48,24,"enableFavicon")),s.xp6(3),s.Q6J("ngModel",e.enableFavicon),s.xp6(5),s.Oqu(s.lcZ(56,26,"faviconDesc")),s.xp6(11),s.Oqu(s.lcZ(67,28,"enableBadgeCounter")),s.xp6(3),s.Q6J("ngModel",e.enableBadgeCounter),s.xp6(5),s.Oqu(s.lcZ(75,30,"badgeCounterDesc")),s.xp6(11),s.Oqu(s.lcZ(86,32,"theme")),s.xp6(3),s.Q6J("ngModel",e.theme),s.xp6(2),s.Q6J("ngForOf",e.themeOptions),s.xp6(6),s.Oqu(s.lcZ(97,34,"themeDesc"))}}function Va(e,t){1&e&&s._UZ(0,"i",14)}function Ha(e,t){1&e&&s._UZ(0,"i",15)}function ja(e,t){if(1&e&&(s.TgZ(0,"option",32),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function Wa(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"div",8),s._uU(3,"\n "),s.TgZ(4,"div",16),s._uU(5,"\n "),s.TgZ(6,"div",23),s._uU(7,"\n "),s.TgZ(8,"label",45),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"input",46),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateAutoFillOnPageLoad())}))("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.enableAutoFillOnPageLoad=t)})),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"div",21),s._uU(17),s.ALo(18,"i18n"),s.TgZ(19,"b"),s._uU(20),s.ALo(21,"i18n"),s.qZA(),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.TgZ(26,"div",8),s._uU(27,"\n "),s.TgZ(28,"div",16),s._uU(29,"\n "),s.TgZ(30,"div",17),s._uU(31,"\n "),s.TgZ(32,"label",47),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"select",48),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.autoFillOnPageLoadDefault=t)}))("change",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.updateAutoFillOnPageLoadDefault())})),s._uU(37,"\n "),s.YNc(38,ja,2,2,"option",20),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.qZA(),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.TgZ(43,"div",21),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n "),s.qZA(),s._uU(47,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(9),s.Oqu(s.lcZ(10,10,"enableAutoFillOnPageLoad")),s.xp6(3),s.Q6J("ngModel",e.enableAutoFillOnPageLoad),s.xp6(5),s.hij("\n ",s.lcZ(18,12,"enableAutoFillOnPageLoadDesc"),"\n "),s.xp6(3),s.Oqu(s.lcZ(21,14,"warning")),s.xp6(2),s.hij(": ",s.lcZ(23,16,"experimentalFeature"),"\n "),s.xp6(11),s.Oqu(s.lcZ(34,18,"defaultAutoFillOnPageLoad")),s.xp6(3),s.Q6J("ngModel",e.autoFillOnPageLoadDefault)("disabled",!e.enableAutoFillOnPageLoad),s.xp6(2),s.Q6J("ngForOf",e.autoFillOnPageLoadOptions),s.xp6(6),s.Oqu(s.lcZ(45,20,"defaultAutoFillOnPageLoadDesc"))}}class $a{constructor(e,t,i,n,s){this.messagingService=e,this.stateService=t,this.totpService=i,this.themingService=s,this.enableFavicon=!1,this.enableBadgeCounter=!1,this.enableAutoFillOnPageLoad=!1,this.autoFillOnPageLoadDefault=!1,this.enableAutoTotpCopy=!1,this.enableContextMenuItem=!1,this.enableAddLoginNotification=!1,this.enableChangedPasswordNotification=!1,this.showCardsCurrentTab=!1,this.showIdentitiesCurrentTab=!1,this.showClearClipboard=!0,this.defaultUriMatch=ka.Domain,this.showGeneral=!0,this.showAutofill=!0,this.showDisplay=!0,this.themeOptions=[{name:n.t("default"),value:Ca.System},{name:n.t("light"),value:Ca.Light},{name:n.t("dark"),value:Ca.Dark},{name:"Nord",value:Ca.Nord},{name:n.t("solarizedDark"),value:Ca.SolarizedDark}],this.uriMatchOptions=[{name:n.t("baseDomain"),value:ka.Domain},{name:n.t("host"),value:ka.Host},{name:n.t("startsWith"),value:ka.StartsWith},{name:n.t("regEx"),value:ka.RegularExpression},{name:n.t("exact"),value:ka.Exact},{name:n.t("never"),value:ka.Never}],this.clearClipboardOptions=[{name:n.t("never"),value:null},{name:n.t("tenSeconds"),value:10},{name:n.t("twentySeconds"),value:20},{name:n.t("thirtySeconds"),value:30},{name:n.t("oneMinute"),value:60},{name:n.t("twoMinutes"),value:120},{name:n.t("fiveMinutes"),value:300}],this.autoFillOnPageLoadOptions=[{name:n.t("autoFillOnPageLoadYes"),value:!0},{name:n.t("autoFillOnPageLoadNo"),value:!1}]}ngOnInit(){var e;return Na(this,void 0,void 0,(function*(){this.enableAutoFillOnPageLoad=yield this.stateService.getEnableAutoFillOnPageLoad(),this.autoFillOnPageLoadDefault=null===(e=yield this.stateService.getAutoFillOnPageLoadDefault())||void 0===e||e,this.enableAddLoginNotification=!(yield this.stateService.getDisableAddLoginNotification()),this.enableChangedPasswordNotification=!(yield this.stateService.getDisableChangedPasswordNotification()),this.enableContextMenuItem=!(yield this.stateService.getDisableContextMenuItem()),this.showCardsCurrentTab=!(yield this.stateService.getDontShowCardsCurrentTab()),this.showIdentitiesCurrentTab=!(yield this.stateService.getDontShowIdentitiesCurrentTab()),this.enableAutoTotpCopy=!(yield this.stateService.getDisableAutoTotpCopy()),this.enableFavicon=!(yield this.stateService.getDisableFavicon()),this.enableBadgeCounter=!(yield this.stateService.getDisableBadgeCounter()),this.theme=yield this.stateService.getTheme();const t=yield this.stateService.getDefaultUriMatch();this.defaultUriMatch=null==t?ka.Domain:t,this.clearClipboard=yield this.stateService.getClearClipboard()}))}updateAddLoginNotification(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableAddLoginNotification(!this.enableAddLoginNotification)}))}updateChangedPasswordNotification(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableChangedPasswordNotification(!this.enableChangedPasswordNotification)}))}updateContextMenuItem(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableContextMenuItem(!this.enableContextMenuItem),this.messagingService.send("bgUpdateContextMenu")}))}updateAutoTotpCopy(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableAutoTotpCopy(!this.enableAutoTotpCopy)}))}updateAutoFillOnPageLoad(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setEnableAutoFillOnPageLoad(this.enableAutoFillOnPageLoad)}))}updateAutoFillOnPageLoadDefault(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setAutoFillOnPageLoadDefault(this.autoFillOnPageLoadDefault)}))}updateFavicon(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableFavicon(!this.enableFavicon)}))}updateBadgeCounter(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDisableBadgeCounter(!this.enableBadgeCounter),this.messagingService.send("bgUpdateContextMenu")}))}updateShowCardsCurrentTab(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDontShowCardsCurrentTab(!this.showCardsCurrentTab)}))}updateShowIdentitiesCurrentTab(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDontShowIdentitiesCurrentTab(!this.showIdentitiesCurrentTab)}))}saveTheme(){return Na(this,void 0,void 0,(function*(){yield this.themingService.updateConfiguredTheme(this.theme)}))}saveDefaultUriMatch(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setDefaultUriMatch(this.defaultUriMatch)}))}saveClearClipboard(){return Na(this,void 0,void 0,(function*(){yield this.stateService.setClearClipboard(this.clearClipboard)}))}}$a.ɵfac=function(e){return new(e||$a)(s.Y36(qe),s.Y36(Mt),s.Y36(Ma),s.Y36(_e),s.Y36(Fa))},$a.ɵcmp=s.Xpm({type:$a,selectors:[["app-options"]],decls:73,vars:18,consts:[[1,"left"],["type","button","routerLink","/tabs/settings"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"box"],["type","button",1,"box-header-expandable",3,"click"],["class","bwi bwi-angle-down bwi-sm icon","aria-hidden","true",4,"ngIf"],["class","bwi bwi-chevron-up bwi-sm icon","aria-hidden","true",4,"ngIf"],[4,"ngIf"],[1,"box","box-section-divider"],["aria-hidden","true",1,"bwi","bwi-angle-down","bwi-sm","icon"],["aria-hidden","true",1,"bwi","bwi-chevron-up","bwi-sm","icon"],[1,"box-content"],["appBoxRow","",1,"box-content-row"],["for","defaultUriMatch"],["id","defaultUriMatch","name","DefaultUriMatch",3,"ngModel","ngModelChange","change"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"box-footer"],["class","box",4,"ngIf"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","totp"],["id","totp","type","checkbox",3,"ngModel","change","ngModelChange"],["for","addlogin-notification-bar"],["id","addlogin-notification-bar","type","checkbox",3,"ngModel","change","ngModelChange"],["for","changedpass-notification-bar"],["id","changedpass-notification-bar","type","checkbox",3,"ngModel","change","ngModelChange"],["for","context-menu"],["id","context-menu","type","checkbox",3,"ngModel","change","ngModelChange"],[3,"ngValue"],["for","clearClipboard"],["id","clearClipboard","name","ClearClipboard",3,"ngModel","ngModelChange","change"],["for","showCardsCurrentTab"],["id","showCardsCurrentTab","type","checkbox",3,"ngModel","change","ngModelChange"],["for","showIdentitiesCurrentTab"],["id","showIdentitiesCurrentTab","type","checkbox",3,"ngModel","change","ngModelChange"],["for","favicon"],["id","favicon","type","checkbox",3,"ngModel","change","ngModelChange"],["for","badge"],["id","badge","type","checkbox",3,"ngModel","change","ngModelChange"],["for","theme"],["id","theme","name","Theme",3,"ngModel","ngModelChange","change"],["for","autofill"],["id","autofill","type","checkbox",3,"ngModel","change","ngModelChange"],["for","defaultAutofill"],["id","defaultAutofill","name","DefaultAutofill",3,"ngModel","disabled","ngModelChange","change"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16,"\n "),s.TgZ(17,"span",5),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s._UZ(22,"div",6),s._uU(23,"\n"),s.qZA(),s._uU(24,"\n"),s.TgZ(25,"main",7),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.TgZ(29,"h2"),s._uU(30,"\n "),s.TgZ(31,"button",9),s.NdJ("click",(function(){return t.showGeneral=!t.showGeneral})),s._uU(32,"\n General\n "),s.YNc(33,La,1,0,"i",10),s._uU(34,"\n "),s.YNc(35,Ea,1,0,"i",11),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.YNc(40,za,102,37,"ng-container",12),s._uU(41,"\n "),s.TgZ(42,"div",13),s._uU(43,"\n "),s.TgZ(44,"h2"),s._uU(45,"\n "),s.TgZ(46,"button",9),s.NdJ("click",(function(){return t.showDisplay=!t.showDisplay})),s._uU(47,"\n Display\n "),s.YNc(48,Ka,1,0,"i",10),s._uU(49,"\n "),s.YNc(50,Ba,1,0,"i",11),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.YNc(55,Qa,100,36,"ng-container",12),s._uU(56,"\n "),s.TgZ(57,"div",13),s._uU(58,"\n "),s.TgZ(59,"h2"),s._uU(60,"\n "),s.TgZ(61,"button",9),s.NdJ("click",(function(){return t.showAutofill=!t.showAutofill})),s._uU(62,"\n Autofill\n "),s.YNc(63,Va,1,0,"i",10),s._uU(64,"\n "),s.YNc(65,Ha,1,0,"i",11),s._uU(66,"\n "),s.qZA(),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.qZA(),s._uU(69,"\n "),s.YNc(70,Wa,48,22,"ng-container",12),s._uU(71,"\n"),s.qZA(),s._uU(72,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,14,"back")),s.xp6(8),s.Oqu(s.lcZ(19,16,"options")),s.xp6(13),s.uIk("aria-expanded",t.showGeneral),s.xp6(2),s.Q6J("ngIf",!t.showGeneral),s.xp6(2),s.Q6J("ngIf",t.showGeneral),s.xp6(5),s.Q6J("ngIf",t.showGeneral),s.xp6(6),s.uIk("aria-expanded",t.showDisplay),s.xp6(2),s.Q6J("ngIf",!t.showDisplay),s.xp6(2),s.Q6J("ngIf",t.showDisplay),s.xp6(5),s.Q6J("ngIf",t.showDisplay),s.xp6(6),s.uIk("aria-expanded",t.showAutofill),s.xp6(2),s.Q6J("ngIf",!t.showAutofill),s.xp6(2),s.Q6J("ngIf",t.showAutofill),s.xp6(5),s.Q6J("ngIf",t.showAutofill))},dependencies:[Pe.rH,u.sg,u.O5,ue.YN,ue.Kr,ue.Wl,ue.EJ,ue.JJ,ue.On,Xe,Ze],encapsulation:2});var Xa=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class el{constructor(e,t,i,n,s){this.i18nService=e,this.platformUtilsService=t,this.apiService=i,this.logService=n,this.stateService=s,this.isPremium=!1,this.price=10}ngOnInit(){return Xa(this,void 0,void 0,(function*(){this.isPremium=yield this.stateService.getCanAccessPremium()}))}refresh(){return Xa(this,void 0,void 0,(function*(){try{this.refreshPromise=this.apiService.refreshIdentityToken(),yield this.refreshPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("refreshComplete")),this.isPremium=yield this.stateService.getCanAccessPremium()}catch(e){this.logService.error(e)}}))}purchase(){return Xa(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("premiumPurchaseAlert"),this.i18nService.t("premiumPurchase"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=purchase")}))}manage(){return Xa(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("premiumManageAlert"),this.i18nService.t("premiumManage"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=manage")}))}}function tl(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"p",10),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"p"),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"ul",11),s._uU(11,"\n "),s.TgZ(12,"li"),s._uU(13,"\n "),s._UZ(14,"i",12),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"li"),s._uU(19,"\n "),s._UZ(20,"i",12),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"li"),s._uU(25,"\n "),s._UZ(26,"i",12),s._uU(27),s.ALo(28,"i18n"),s.qZA(),s._uU(29,"\n "),s.TgZ(30,"li"),s._uU(31,"\n "),s._UZ(32,"i",12),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"li"),s._uU(37,"\n "),s._UZ(38,"i",12),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n "),s.TgZ(42,"li"),s._uU(43,"\n "),s._UZ(44,"i",12),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n "),s.qZA(),s._uU(48,"\n "),s.TgZ(49,"p",10),s._uU(50),s.qZA(),s._uU(51,"\n "),s.TgZ(52,"button",13),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.purchase())})),s._uU(53,"\n "),s.TgZ(54,"b"),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"button",14,15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.refresh())})),s._uU(61,"\n "),s.TgZ(62,"span",16),s._uU(63),s.ALo(64,"i18n"),s.qZA(),s._uU(65,"\n "),s._UZ(66,"i",17),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.BQk()}if(2&e){const e=s.MAs(60),t=s.oxw();s.xp6(3),s.Oqu(s.lcZ(4,15,"premiumNotCurrentMember")),s.xp6(4),s.Oqu(s.lcZ(8,17,"premiumSignUpAndGet")),s.xp6(8),s.hij("\n ",s.lcZ(16,19,"ppremiumSignUpStorage"),"\n "),s.xp6(6),s.hij("\n ",s.lcZ(22,21,"ppremiumSignUpTwoStep"),"\n "),s.xp6(6),s.hij("\n ",s.lcZ(28,23,"ppremiumSignUpReports"),"\n "),s.xp6(6),s.hij("\n ",s.lcZ(34,25,"ppremiumSignUpTotp"),"\n "),s.xp6(6),s.hij("\n ",s.lcZ(40,27,"ppremiumSignUpSupport"),"\n "),s.xp6(6),s.hij("\n ",s.lcZ(46,29,"ppremiumSignUpFuture"),"\n "),s.xp6(5),s.Oqu(t.priceString),s.xp6(5),s.Oqu(s.lcZ(56,31,"premiumPurchase")),s.xp6(4),s.Q6J("disabled",e.loading)("appApiAction",t.refreshPromise),s.xp6(3),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(64,33,"premiumRefresh")),s.xp6(3),s.Q6J("hidden",!e.loading)}}function il(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"p",10),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"p",18),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"button",19),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.manage())})),s._uU(11,"\n "),s.TgZ(12,"b"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.BQk()}2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,3,"premiumCurrentMember")),s.xp6(4),s.Oqu(s.lcZ(8,5,"premiumCurrentMemberThanks")),s.xp6(6),s.Oqu(s.lcZ(14,7,"premiumManage")))}el.ɵfac=function(e){return new(e||el)(s.Y36(_e),s.Y36(Je),s.Y36(Tt),s.Y36(Ct),s.Y36(Mt))},el.ɵdir=s.lG2({type:el});class nl extends el{constructor(e,t,i,n,s,o,r){super(e,t,i,s,n),this.location=o,this.currencyPipe=r;const a=this.currencyPipe.transform(this.price,"$");this.priceString=e.t("premiumPrice",a),this.priceString.indexOf("%price%")>-1&&(this.priceString=this.priceString.replace("%price%",a))}goBack(){this.location.back()}}nl.ɵfac=function(e){return new(e||nl)(s.Y36(_e),s.Y36(Je),s.Y36(Tt),s.Y36(Mt),s.Y36(Ct),s.Y36(u.Ye),s.Y36(u.H9))},nl.ɵcmp=s.Xpm({type:nl,selectors:[["app-premium"]],features:[s.qOj],decls:35,vars:8,consts:[[1,"left"],["type","button",3,"click"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"content"],[4,"ngIf"],[1,"text-center","lead"],[1,"bwi-ul"],["aria-hidden","true",1,"bwi","bwi-li","bwi-check","text-success"],["type","button",1,"btn","primary","block",3,"click"],["type","button",1,"btn","link","block",3,"disabled","appApiAction","click"],["refreshBtn",""],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden"],[1,"text-center"],["type","button",1,"btn","block","primary",3,"click"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.goBack()})),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16,"\n "),s.TgZ(17,"span",5),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s._UZ(22,"div",6),s._uU(23,"\n"),s.qZA(),s._uU(24,"\n"),s.TgZ(25,"main",7),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.YNc(29,tl,69,35,"ng-container",9),s._uU(30,"\n "),s.YNc(31,il,17,9,"ng-container",9),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n"),s.qZA(),s._uU(34,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,4,"back")),s.xp6(8),s.Oqu(s.lcZ(19,6,"premiumMembership")),s.xp6(11),s.Q6J("ngIf",!t.isPremium),s.xp6(2),s.Q6J("ngIf",t.isPremium))},dependencies:[u.O5,Ot,Ze],encapsulation:2});var sl=i(46417),ol=i.n(sl);class rl{constructor(){this._onCreated=new Be.x,this._onClose=new Be.x,this._onClosed=new Be.x,this._onShow=new Be.x,this._onShown=new Be.x,this.onCreated=this._onCreated.asObservable(),this.onClose=this._onClose.asObservable(),this.onClosed=this._onClosed.asObservable(),this.onShow=this._onShow.asObservable(),this.onShown=this._onShow.asObservable()}show(){this._onShow.next()}shown(){this._onShown.next()}close(e){this.lastResult=e,this._onClose.next(e)}closed(){this._onClosed.next(this.lastResult)}created(e){this._onCreated.next(e)}onClosedPromise(){return this.onClosed.pipe((0,Gi.P)()).toPromise()}}const al=["modalContent"];function ll(e,t){}class cl{constructor(e,t,i,n,s){this.modalService=e,this.cd=t,this.el=i,this.focusTrapFactory=n,this.modalRef=s}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){const t=this.modalService.resolveComponentFactory(e);this.modalContentRef.clear(),this.componentRef=this.modalContentRef.createComponent(t)}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()}}cl.ɵfac=function(e){return new(e||cl)(s.Y36(gl),s.Y36(s.sBO),s.Y36(s.SBq),s.Y36(o.vO),s.Y36(rl))},cl.ɵcmp=s.Xpm({type:cl,selectors:[["app-modal"]],viewQuery:function(e,t){if(1&e&&s.Gf(al,7,s.s_b),2&e){let e;s.iGM(e=s.CRH())&&(t.modalContentRef=e.first)}},decls:2,vars:0,consts:[["modalContent",""]],template:function(e,t){1&e&&s.YNc(0,ll,0,0,"ng-template",null,0,s.W1O)},encapsulation:2});class ul{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 dl,hl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class pl{}class gl{constructor(e,t,i){this.componentFactoryResolver=e,this.applicationRef=t,this.injector=i,this.modalList=[],this.factoryResolvers=new Map,document.addEventListener("keyup",(e=>{"Escape"===e.key&&this.modalCount>0&&this.topModal.instance.close()}))}get modalCount(){return this.modalList.length}get topModal(){return this.modalList[this.modalCount-1]}openViewRef(e,t,i=null){return hl(this,void 0,void 0,(function*(){const[n,s]=this.openInternal(e,null,!1);return s.instance.setComponentParameters=i,t.insert(s.hostView),yield n.onCreated.pipe((0,Gi.P)()).toPromise(),[n,s.instance.componentRef.instance]}))}open(e,t={}){const{replaceTopModal:i=!1,allowMultipleModals:n=!1}=t;if(this.modalCount>0&&i&&this.topModal.instance.close(),this.modalCount>0&&!n)return;const[s]=this.openInternal(e,t,!0);return s}registerComponentFactoryResolver(e,t){this.factoryResolvers.set(e,t)}resolveComponentFactory(e){return this.factoryResolvers.has(e)?this.factoryResolvers.get(e).resolveComponentFactory(e):this.componentFactoryResolver.resolveComponentFactory(e)}closeAll(){this.modalList.forEach((e=>e.instance.close()))}openInternal(e,t,i){const[n,s]=this.createModalComponent(t);if(s.instance.childComponentType=e,i){this.applicationRef.attachView(s.hostView);const e=s.hostView.rootNodes[0];document.body.appendChild(e)}return n.onClosed.pipe((0,Gi.P)()).subscribe((()=>{i&&this.applicationRef.detachView(s.hostView),s.destroy(),this.modalList.pop(),this.modalCount>0&&this.topModal.instance.getFocus()})),this.setupHandlers(n),this.modalList.push(s),[n,s]}setupHandlers(e){let t=null;e.onCreated.pipe((0,Gi.P)()).subscribe((i=>{document.body.classList.add("modal-open");const n=i.querySelector(".modal"),s=n.querySelector(".modal-dialog");t=document.createElement("div"),t.className="modal-backdrop fade",t.style.zIndex=`${this.modalCount}040`,n.prepend(t),s.addEventListener("click",(e=>{e.stopPropagation()})),s.style.zIndex=`${this.modalCount}050`;const o=Array.from(i.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]'));for(const t of o)t.addEventListener("click",(()=>{e.close()}))})),e.onClose.pipe((0,Gi.P)()).subscribe((()=>{e.closed(),0===this.modalCount&&document.body.classList.remove("modal-open")}))}createModalComponent(e){const t=new rl,i=new WeakMap;i.set(pl,e),i.set(rl,t);return[t,this.componentFactoryResolver.resolveComponentFactory(cl).create(new ul(this.injector,i))]}}gl.ɵfac=function(e){return new(e||gl)(s.LFG(s._Vd),s.LFG(s.z2F),s.LFG(s.zs3))},gl.ɵprov=s.Yz7({token:gl,factory:gl.ɵfac}),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"}(dl||(dl={}));var vl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yl{constructor(e,t,i,n){this.modalRef=e,this.cryptoService=t,this.keyConnectorService=i,this.stateService=n,this.pin="",this.showPin=!1,this.masterPassOnRestart=!0,this.showMasterPassOnRestart=!0}ngOnInit(){return vl(this,void 0,void 0,(function*(){this.showMasterPassOnRestart=this.masterPassOnRestart=!(yield this.keyConnectorService.getUsesKeyConnector())}))}toggleVisibility(){this.showPin=!this.showPin}submit(){return vl(this,void 0,void 0,(function*(){nt.isNullOrWhitespace(this.pin)&&this.modalRef.close(!1);const e=yield this.stateService.getKdfType(),t=yield this.stateService.getKdfIterations(),i=yield this.stateService.getEmail(),n=yield this.cryptoService.makePinKey(this.pin,i,e,t),s=yield this.cryptoService.getKey(),o=yield this.cryptoService.encrypt(s.key,n);if(this.masterPassOnRestart){const e=yield this.cryptoService.encrypt(this.pin);yield this.stateService.setProtectedPin(e.encryptedString),yield this.stateService.setDecryptedPinProtected(o)}else yield this.stateService.setEncryptedPinProtected(o.encryptedString);this.modalRef.close(!0)}))}}function fl(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"label",19),s._uU(3,"\n "),s.TgZ(4,"input",20),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.masterPassOnRestart=t)})),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"span"),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngModel",e.masterPassOnRestart),s.xp6(3),s.Oqu(s.lcZ(8,2,"lockWithMasterPassOnRestart"))}}yl.ɵfac=function(e){return new(e||yl)(s.Y36(rl),s.Y36(zt),s.Y36(De),s.Y36(Mt))},yl.ɵdir=s.lG2({type:yl});const ml=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class wl extends yl{}wl.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(wl)))(t||wl)}}(),wl.ɵcmp=s.Xpm({type:wl,selectors:[["ng-component"]],features:[s.qOj],decls:60,vars:23,consts:[["role","dialog","aria-modal","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],[1,"modal-content",3,"ngSubmit"],["form",""],[1,"modal-body"],[1,"box"],[1,"box-content"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","pin"],["id","pin","name","Pin","required","","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["class","checkbox",4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"checkbox"],["for","masterPasswordOnRestart"],["type","checkbox","id","masterPasswordOnRestart","name","MasterPasswordOnRestart",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n "),s.TgZ(7,"div",4),s._uU(8,"\n "),s.TgZ(9,"div"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",5),s._uU(14,"\n "),s.TgZ(15,"div",6),s._uU(16,"\n "),s.TgZ(17,"div",7),s._uU(18,"\n "),s.TgZ(19,"div",8),s._uU(20,"\n "),s.TgZ(21,"label",9),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"input",10),s.NdJ("ngModelChange",(function(e){return t.pin=e})),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"div",11),s._uU(29,"\n "),s.TgZ(30,"button",12),s.NdJ("click",(function(){return t.toggleVisibility()})),s.ALo(31,"i18n"),s._uU(32,"\n "),s._UZ(33,"i",13),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.qZA(),s._uU(39,"\n "),s.YNc(40,fl,11,4,"div",14),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.TgZ(43,"div",15),s._uU(44,"\n "),s.TgZ(45,"button",16),s._uU(46,"\n "),s.TgZ(47,"span"),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n "),s.qZA(),s._uU(51,"\n "),s.TgZ(52,"button",17),s._uU(53),s.ALo(54,"i18n"),s.qZA(),s._uU(55,"\n "),s.qZA(),s._uU(56,"\n "),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n"),s.qZA(),s._uU(59,"\n")),2&e&&(s.xp6(10),s.hij("\n ",s.lcZ(11,10,"setYourPinCode"),"\n "),s.xp6(12),s.Oqu(s.lcZ(23,12,"pin")),s.xp6(3),s.s9C("type",t.showPin?"text":"password"),s.Q6J("ngModel",t.pin),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(31,14,"toggleVisibility")),s.uIk("aria-pressed",t.showPin),s.xp6(3),s.Q6J("ngClass",s.WLB(20,ml,!t.showPin,t.showPin)),s.xp6(7),s.Q6J("ngIf",t.showMasterPassOnRestart),s.xp6(8),s.Oqu(s.lcZ(49,16,"ok")),s.xp6(5),s.hij("\n ",s.lcZ(54,18,"cancel"),"\n "))},dependencies:[u.mk,u.O5,ue._Y,ue.Fj,ue.Wl,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ht,Xe,bt,St,Ze],encapsulation:2});class bl{}function Sl(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"date"),s.qZA()),2&e){const e=s.oxw(2).ngIf;s.xp6(1),s.hij("\n (",s.xi3(2,1,"lastSeenOn",s.xi3(3,4,e.utcDate,"mediumDate")),")\n ")}}function Ul(e,t){if(1&e&&(s.TgZ(0,"p",4),s._uU(1),s.ALo(2,"i18n"),s.YNc(3,Sl,4,7,"span",6),s._uU(4,"\n "),s.qZA()),2&e){const e=s.oxw().ngIf;s.xp6(1),s.AsE("\n ",s.lcZ(2,3,"serverVersion"),": ",null==e?null:e.version,"\n "),s.xp6(2),s.Q6J("ngIf",!e.isValid())}}function xl(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"date"),s.qZA()),2&e){const e=s.oxw(3).ngIf;s.xp6(1),s.hij("\n (",s.xi3(2,1,"lastSeenOn",s.xi3(3,4,e.utcDate,"mediumDate")),")\n ")}}function Al(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"p",4),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"small"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8),s.YNc(9,xl,4,7,"span",6),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"div",4),s._uU(13,"\n "),s.TgZ(14,"small"),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.BQk()),2&e){const e=s.oxw(2).ngIf;s.xp6(3),s.hij("\n ",s.lcZ(4,5,"serverVersion")," "),s.xp6(3),s.hij("(",s.lcZ(7,7,"thirdParty"),")"),s.xp6(2),s.hij(":\n ",null==e?null:e.version,"\n "),s.xp6(1),s.Q6J("ngIf",!e.isValid()),s.xp6(6),s.Oqu(s.xi3(16,9,"thirdPartyServerMessage",null==e.server?null:e.server.name))}}function _l(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.ALo(2,"i18n"),s.ALo(3,"date"),s.qZA()),2&e){const e=s.oxw(3).ngIf;s.xp6(1),s.hij("\n (",s.xi3(2,1,"lastSeenOn",s.xi3(3,4,e.utcDate,"mediumDate")),")\n ")}}function Zl(e,t){if(1&e&&(s.TgZ(0,"p",4),s._uU(1),s.ALo(2,"i18n"),s.TgZ(3,"small"),s._uU(4),s.ALo(5,"i18n"),s.qZA(),s._uU(6),s.YNc(7,_l,4,7,"span",6),s._uU(8,"\n "),s.qZA()),2&e){const e=s.oxw(2).ngIf;s.xp6(1),s.hij("\n ",s.lcZ(2,4,"serverVersion")," "),s.xp6(3),s.hij("(",s.lcZ(5,6,"selfHosted"),")"),s.xp6(2),s.hij(":\n ",null==e?null:e.version,"\n "),s.xp6(1),s.Q6J("ngIf",!e.isValid())}}function Tl(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Al,19,12,"ng-container",6),s._uU(3,"\n\n "),s.YNc(4,Zl,9,8,"p",9),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw().ngIf;s.xp6(2),s.Q6J("ngIf",e.server),s.xp6(2),s.Q6J("ngIf",!e.server)}}function Cl(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Ul,5,5,"p",9),s._uU(3,"\n\n "),s.YNc(4,Tl,6,2,"ng-container",6),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.isCloud),s.xp6(2),s.Q6J("ngIf",!e.isCloud)}}class kl{constructor(e,t){this.year=(new Date).getFullYear(),this.version=Wt.getApplicationVersion(),this.serverConfig$=e.serverConfig$,this.isCloud=t.isCloud()}}kl.ɵfac=function(e){return new(e||kl)(s.Y36(bl),s.Y36(Ye))},kl.ɵcmp=s.Xpm({type:kl,selectors:[["app-about"]],decls:40,vars:11,consts:[["role","dialog","aria-modal","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-content"],[1,"modal-body"],[1,"text-center"],["aria-hidden","true",1,"bwi","bwi-shield","bwi-3x"],[4,"ngIf"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","text-center",4,"ngIf"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"div",2),s._uU(5,"\n "),s.TgZ(6,"div",3),s._uU(7,"\n "),s.TgZ(8,"p",4),s._uU(9,"\n "),s._UZ(10,"i",5),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"p",4),s._uU(14,"\n "),s.TgZ(15,"b"),s._uU(16,"Bitwarden"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"p",4),s._uU(20),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"p",4),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s.YNc(26,Cl,6,2,"ng-container",6),s.ALo(27,"async"),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.TgZ(30,"div",7),s._uU(31,"\n "),s.TgZ(32,"button",8),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n")),2&e&&(s.xp6(20),s.hij("© Bitwarden Inc. 2015-",t.year,""),s.xp6(3),s.AsE("",s.lcZ(24,5,"version"),": ",t.version,""),s.xp6(3),s.Q6J("ngIf",s.lcZ(27,7,t.serverConfig$)),s.xp6(7),s.hij("\n ",s.lcZ(34,9,"close"),"\n "))},dependencies:[u.O5,u.Ov,u.uU,Ze],encapsulation:2});var Ol=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Pl{constructor(e,t,i){this.formBuilder=e,this.policyService=t,this.i18nService=i,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[null],minutes:[null]})})}get showCustom(){return this.form.get("vaultTimeout").value===Pl.CUSTOM_VALUE}get exceedsMinimumTimout(){return!this.showCustom||this.customTimeInMinutes()>Pl.MIN_CUSTOM_MINUTES}ngOnInit(){return Ol(this,void 0,void 0,(function*(){if(yield this.policyService.policyAppliesToUser(qs.MaximumVaultTimeout)){const e=yield this.policyService.getAll(qs.MaximumVaultTimeout);this.vaultTimeoutPolicy=e[0],this.vaultTimeoutPolicyHours=Math.floor(this.vaultTimeoutPolicy.data.minutes/60),this.vaultTimeoutPolicyMinutes=this.vaultTimeoutPolicy.data.minutes%60,this.vaultTimeouts=this.vaultTimeouts.filter((e=>e.value<=this.vaultTimeoutPolicy.data.minutes&&(e.value>0||e.value===Pl.CUSTOM_VALUE)&&null!=e.value)),this.validatorChange()}this.form.valueChanges.subscribe((e=>Ol(this,void 0,void 0,(function*(){this.onChange(this.getVaultTimeout(e))})))),this.form.get("vaultTimeout").valueChanges.subscribe((e=>{if(e!==Pl.CUSTOM_VALUE)return;const t=Math.max(this.form.value.vaultTimeout,0);this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}})}))}))}ngOnChanges(){this.vaultTimeouts.push({name:this.i18nService.t("custom"),value:Pl.CUSTOM_VALUE})}getVaultTimeout(e){return e.vaultTimeout!==Pl.CUSTOM_VALUE?e.vaultTimeout:60*e.custom.hours+e.custom.minutes}writeValue(e){null!=e&&(this.vaultTimeouts.every((t=>t.value!==e))?this.form.setValue({vaultTimeout:Pl.CUSTOM_VALUE,custom:{hours:Math.floor(e/60),minutes:e%60}}):this.form.patchValue({vaultTimeout:e}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){var t,i;return this.vaultTimeoutPolicy&&(null===(i=null===(t=this.vaultTimeoutPolicy)||void 0===t?void 0:t.data)||void 0===i?void 0:i.minutes)Fl(this,void 0,void 0,(function*(){yield this.saveVaultTimeout(e)}))));const i=yield this.stateService.getVaultTimeoutAction();this.vaultTimeoutAction=null==i?"lock":i;const n=yield this.vaultTimeoutSettingsService.isPinLockSet();this.pin=n[0]||n[1],this.supportsBiometric=yield this.platformUtilsService.supportsBiometric(),this.biometric=yield this.vaultTimeoutSettingsService.isBiometricLockSet(),this.enableAutoBiometricsPrompt=!(yield this.stateService.getDisableAutoBiometricsPrompt()),this.showChangeMasterPass=!(yield this.keyConnectorService.getUsesKeyConnector())}))}saveVaultTimeout(e){return Fl(this,void 0,void 0,(function*(){if(null==e){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("neverLockWarning"),null,this.i18nService.t("yes"),this.i18nService.t("cancel"),"warning")))return void this.vaultTimeout.setValue(this.previousVaultTimeout)}this.vaultTimeout.hasError("policyError")?this.platformUtilsService.showToast("error",null,this.i18nService.t("vaultTimeoutTooLarge")):(this.previousVaultTimeout=this.vaultTimeout.value,yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.vaultTimeout.value,this.vaultTimeoutAction),null==this.previousVaultTimeout&&this.messagingService.send("bgReseedStorage"))}))}saveVaultTimeoutAction(e){return Fl(this,void 0,void 0,(function*(){if("logOut"===e){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("vaultTimeoutLogOutConfirmation"),this.i18nService.t("vaultTimeoutLogOutConfirmationTitle"),this.i18nService.t("yes"),this.i18nService.t("cancel"),"warning")))return void this.vaultTimeoutActions.forEach(((e,t)=>{e.value===this.vaultTimeoutAction&&(this.vaultTimeoutActionSelectRef.nativeElement.value=t+": "+this.vaultTimeoutAction)}))}this.vaultTimeout.hasError("policyError")?this.platformUtilsService.showToast("error",null,this.i18nService.t("vaultTimeoutTooLarge")):(this.vaultTimeoutAction=e,yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.vaultTimeout.value,this.vaultTimeoutAction))}))}updatePin(){return Fl(this,void 0,void 0,(function*(){if(this.pin){const e=this.modalService.open(wl,{allowMultipleModals:!0});if(null==e)return void(this.pin=!1);this.pin=yield e.onClosedPromise()}else yield this.cryptoService.clearPinProtectedKey(),yield this.vaultTimeoutSettingsService.clear()}))}updateBiometric(){return Fl(this,void 0,void 0,(function*(){if(this.biometric&&this.supportsBiometric){let e;try{e=yield Wt.requestPermission({permissions:["nativeMessaging"]})}catch(e){if(console.error(e),this.platformUtilsService.isFirefox()&&this.popupUtilsService.inSidebar(window))return yield this.platformUtilsService.showDialog(this.i18nService.t("nativeMessaginPermissionSidebarDesc"),this.i18nService.t("nativeMessaginPermissionSidebarTitle"),this.i18nService.t("ok"),null),void(this.biometric=!1)}if(!e)return yield this.platformUtilsService.showDialog(this.i18nService.t("nativeMessaginPermissionErrorDesc"),this.i18nService.t("nativeMessaginPermissionErrorTitle"),this.i18nService.t("ok"),null),void(this.biometric=!1);const t=ol().fire({heightAuto:!1,buttonsStyling:!1,titleText:this.i18nService.t("awaitDesktop"),text:this.i18nService.t("awaitDesktopDesc"),icon:"info",iconHtml:'',showCancelButton:!0,cancelButtonText:this.i18nService.t("cancel"),showConfirmButton:!1,allowOutsideClick:!1});yield this.stateService.setBiometricAwaitingAcceptance(!0),yield this.cryptoService.toggleKey(),yield Promise.race([t.then((e=>Fl(this,void 0,void 0,(function*(){e.dismiss===ol().DismissReason.cancel&&(this.biometric=!1,yield this.stateService.setBiometricAwaitingAcceptance(null))})))),this.platformUtilsService.authenticateBiometric().then((e=>{this.biometric=e,ol().close(),!1===this.biometric&&this.platformUtilsService.showToast("error",this.i18nService.t("errorEnableBiometricTitle"),this.i18nService.t("errorEnableBiometricDesc"))})).catch((e=>{this.biometric=!1;const t=Vt[e];this.platformUtilsService.showDialog(this.i18nService.t(t.description),this.i18nService.t(t.title),this.i18nService.t("ok"),null,"error")}))])}else yield this.stateService.setBiometricUnlock(null),yield this.stateService.setBiometricFingerprintValidated(!1)}))}updateAutoBiometricsPrompt(){return Fl(this,void 0,void 0,(function*(){yield this.stateService.setDisableAutoBiometricsPrompt(!this.enableAutoBiometricsPrompt)}))}lock(){return Fl(this,void 0,void 0,(function*(){yield this.vaultTimeoutService.lock()}))}logOut(){return Fl(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("logOutConfirmation"),this.i18nService.t("logOut"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&this.messagingService.send("logout")}))}changePassword(){return Fl(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("changeMasterPasswordConfirmation"),this.i18nService.t("changeMasterPassword"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&Wt.createNewTab("https://bitwarden.com/help/master-password/#change-your-master-password")}))}twoStep(){return Fl(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("twoStepLoginConfirmation"),this.i18nService.t("twoStepLogin"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&Wt.createNewTab("https://bitwarden.com/help/setup-two-step-login/")}))}share(){return Fl(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("learnOrgConfirmation"),this.i18nService.t("learnOrg"),this.i18nService.t("yes"),this.i18nService.t("cancel")))&&Wt.createNewTab("https://bitwarden.com/help/about-organizations/")}))}webVault(){return Fl(this,void 0,void 0,(function*(){const e=this.environmentService.getWebVaultUrl();Wt.createNewTab(e)}))}import(){Wt.createNewTab("https://bitwarden.com/help/import-data/")}export(){this.router.navigate(["/export"])}help(){Wt.createNewTab("https://bitwarden.com/help/")}about(){this.modalService.open(kl)}fingerprint(){return Fl(this,void 0,void 0,(function*(){const e=yield this.cryptoService.getFingerprint(yield this.stateService.getUserId()),t=document.createElement("p");t.innerText=this.i18nService.t("yourAccountsFingerprint")+":";const i=document.createElement("p");i.innerText=e.join("-");const n=document.createElement("div");n.appendChild(t),n.appendChild(i);(yield ol().fire({heightAuto:!1,buttonsStyling:!1,html:n,showCancelButton:!0,cancelButtonText:this.i18nService.t("close"),showConfirmButton:!0,confirmButtonText:this.i18nService.t("learnMore")})).value&&this.platformUtilsService.launchUri("https://bitwarden.com/help/fingerprint-phrase/")}))}rate(){const e=this.platformUtilsService.getDevice();Wt.createNewTab(Yl[e])}}zl.ɵfac=function(e){return new(e||zl)(s.Y36(Je),s.Y36(_e),s.Y36(Kt),s.Y36(Bt),s.Y36(qe),s.Y36(Pe.F0),s.Y36(Ye),s.Y36(zt),s.Y36(Mt),s.Y36($t),s.Y36(gl),s.Y36(De))},zl.ɵcmp=s.Xpm({type:zl,selectors:[["app-settings"]],viewQuery:function(e,t){if(1&e&&s.Gf(Nl,7,s.SBq),2&e){let e;s.iGM(e=s.CRH())&&(t.vaultTimeoutActionSelectRef=e.first)}},decls:259,vars:83,consts:[[1,"left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"box","list"],[1,"box-header"],[1,"box-content","single-line"],["type","button","routerLink","/folders",1,"box-content-row","box-content-row-flex","text-default"],[1,"row-main"],["aria-hidden","true",1,"bwi","bwi-angle-right","bwi-lg","row-sub-icon"],["type","button","routerLink","/sync",1,"box-content-row","box-content-row-flex","text-default"],["type","button","routerLink","/excluded-domains",1,"box-content-row","box-content-row-flex","text-default"],["ngDefaultControl","",3,"vaultTimeouts","formControl"],["appBoxRow","",1,"box-content-row","display-block"],["for","vaultTimeoutAction"],["id","vaultTimeoutAction","name","VaultTimeoutActions",3,"ngModel","ngModelChange"],["vaultTimeoutActionSelect",""],[3,"ngValue",4,"ngFor","ngForOf"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","pin"],["id","pin","type","checkbox",3,"ngModel","change","ngModelChange"],["class","box-content-row box-content-row-checkbox","appBoxRow","",4,"ngIf"],["type","button","appStopClick","",1,"box-content-row","box-content-row-flex","text-default",3,"click"],["type","button","routerLink","/premium",1,"box-content-row"],[1,"icon","text-primary"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lg","bwi-star-f"],[1,"text","text-primary"],["type","button","class","box-content-row box-content-row-flex text-default","appStopClick","",3,"click",4,"ngIf"],["type","button","routerLink","/options",1,"box-content-row","box-content-row-flex","text-default"],[1,"box-footer"],[3,"ngValue"],["for","biometric"],["id","biometric","type","checkbox",3,"ngModel","change","ngModelChange"],["for","autoBiometricsPrompt"],["id","autoBiometricsPrompt","type","checkbox",3,"disabled","ngModel","change","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s._UZ(4,"app-pop-out"),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.TgZ(7,"h1",1),s._uU(8,"\n "),s.TgZ(9,"span",2),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s._UZ(14,"div",3),s._uU(15,"\n"),s.qZA(),s._uU(16,"\n"),s.TgZ(17,"main",4),s._uU(18,"\n "),s.TgZ(19,"div",5),s._uU(20,"\n "),s.TgZ(21,"h2",6),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"div",7),s._uU(26,"\n "),s.TgZ(27,"button",8),s._uU(28,"\n "),s.TgZ(29,"div",9),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n "),s._UZ(33,"i",10),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.TgZ(36,"button",11),s._uU(37,"\n "),s.TgZ(38,"div",9),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n "),s._UZ(42,"i",10),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.TgZ(45,"button",12),s._uU(46,"\n "),s.TgZ(47,"div",9),s._uU(48),s.ALo(49,"i18n"),s.qZA(),s._uU(50,"\n "),s._UZ(51,"i",10),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.qZA(),s._uU(55,"\n "),s.TgZ(56,"div",5),s._uU(57,"\n "),s.TgZ(58,"h2",6),s._uU(59),s.ALo(60,"i18n"),s.qZA(),s._uU(61,"\n "),s.TgZ(62,"div",7),s._uU(63,"\n "),s.TgZ(64,"app-vault-timeout-input",13),s._uU(65,"\n "),s.qZA(),s._uU(66,"\n "),s.TgZ(67,"div",14),s._uU(68,"\n "),s.TgZ(69,"label",15),s._uU(70),s.ALo(71,"i18n"),s.qZA(),s._uU(72,"\n "),s.TgZ(73,"select",16,17),s.NdJ("ngModelChange",(function(e){return t.saveVaultTimeoutAction(e)})),s._uU(75,"\n "),s.YNc(76,Ll,2,2,"option",18),s._uU(77,"\n "),s.qZA(),s._uU(78,"\n "),s.qZA(),s._uU(79,"\n "),s.TgZ(80,"div",19),s._uU(81,"\n "),s.TgZ(82,"label",20),s._uU(83),s.ALo(84,"i18n"),s.qZA(),s._uU(85,"\n "),s.TgZ(86,"input",21),s.NdJ("change",(function(){return t.updatePin()}))("ngModelChange",(function(e){return t.pin=e})),s.qZA(),s._uU(87,"\n "),s.qZA(),s._uU(88,"\n "),s.YNc(89,El,8,4,"div",22),s._uU(90,"\n "),s.YNc(91,Rl,8,5,"div",22),s._uU(92,"\n "),s.TgZ(93,"button",23),s.NdJ("click",(function(){return t.lock()})),s._uU(94,"\n "),s.TgZ(95,"div",9),s._uU(96),s.ALo(97,"i18n"),s.qZA(),s._uU(98,"\n "),s._UZ(99,"i",10),s._uU(100,"\n "),s.qZA(),s._uU(101,"\n "),s.TgZ(102,"button",23),s.NdJ("click",(function(){return t.twoStep()})),s._uU(103,"\n "),s.TgZ(104,"div",9),s._uU(105),s.ALo(106,"i18n"),s.qZA(),s._uU(107,"\n "),s._UZ(108,"i",10),s._uU(109,"\n "),s.qZA(),s._uU(110,"\n "),s.qZA(),s._uU(111,"\n "),s.qZA(),s._uU(112,"\n "),s.TgZ(113,"div",5),s._uU(114,"\n "),s.TgZ(115,"h2",6),s._uU(116),s.ALo(117,"i18n"),s.qZA(),s._uU(118,"\n "),s.TgZ(119,"div",7),s._uU(120,"\n "),s.TgZ(121,"button",24),s._uU(122,"\n "),s.TgZ(123,"div",9),s._uU(124,"\n "),s.TgZ(125,"div",25),s._uU(126,"\n "),s._UZ(127,"i",26),s._uU(128,"\n "),s.qZA(),s._uU(129,"\n "),s.TgZ(130,"span",27)(131,"b"),s._uU(132),s.ALo(133,"i18n"),s.qZA()(),s._uU(134,"\n "),s.qZA(),s._uU(135,"\n "),s.TgZ(136,"span"),s._UZ(137,"i",10),s.qZA(),s._uU(138,"\n "),s.qZA(),s._uU(139,"\n "),s.YNc(140,Jl,8,3,"button",28),s._uU(141,"\n "),s.TgZ(142,"button",23),s.NdJ("click",(function(){return t.fingerprint()})),s._uU(143,"\n "),s.TgZ(144,"div",9),s._uU(145),s.ALo(146,"i18n"),s.qZA(),s._uU(147,"\n "),s._UZ(148,"i",10),s._uU(149,"\n "),s.qZA(),s._uU(150,"\n "),s.TgZ(151,"button",23),s.NdJ("click",(function(){return t.logOut()})),s._uU(152,"\n "),s.TgZ(153,"div",9),s._uU(154),s.ALo(155,"i18n"),s.qZA(),s._uU(156,"\n "),s._UZ(157,"i",10),s._uU(158,"\n "),s.qZA(),s._uU(159,"\n "),s.qZA(),s._uU(160,"\n "),s.qZA(),s._uU(161,"\n "),s.TgZ(162,"div",5),s._uU(163,"\n "),s.TgZ(164,"h2",6),s._uU(165),s.ALo(166,"i18n"),s.qZA(),s._uU(167,"\n "),s.TgZ(168,"div",7),s._uU(169,"\n "),s.TgZ(170,"button",23),s.NdJ("click",(function(){return t.import()})),s._uU(171,"\n "),s.TgZ(172,"div",9),s._uU(173),s.ALo(174,"i18n"),s.qZA(),s._uU(175,"\n "),s._UZ(176,"i",10),s._uU(177,"\n "),s.qZA(),s._uU(178,"\n "),s.TgZ(179,"button",23),s.NdJ("click",(function(){return t.export()})),s._uU(180,"\n "),s.TgZ(181,"div",9),s._uU(182),s.ALo(183,"i18n"),s.qZA(),s._uU(184,"\n "),s._UZ(185,"i",10),s._uU(186,"\n "),s.qZA(),s._uU(187,"\n "),s.TgZ(188,"button",23),s.NdJ("click",(function(){return t.webVault()})),s._uU(189,"\n "),s.TgZ(190,"div",9),s._uU(191),s.ALo(192,"i18n"),s.qZA(),s._uU(193,"\n "),s._UZ(194,"i",10),s._uU(195,"\n "),s.qZA(),s._uU(196,"\n "),s.qZA(),s._uU(197,"\n "),s.qZA(),s._uU(198,"\n "),s.TgZ(199,"div",5),s._uU(200,"\n "),s.TgZ(201,"h2",6),s._uU(202),s.ALo(203,"i18n"),s.qZA(),s._uU(204,"\n "),s.TgZ(205,"div",7),s._uU(206,"\n "),s.TgZ(207,"button",29),s._uU(208,"\n "),s.TgZ(209,"div",9),s._uU(210),s.ALo(211,"i18n"),s.qZA(),s._uU(212,"\n "),s._UZ(213,"i",10),s._uU(214,"\n "),s.qZA(),s._uU(215,"\n "),s.TgZ(216,"button",23),s.NdJ("click",(function(){return t.about()})),s._uU(217,"\n "),s.TgZ(218,"div",9),s._uU(219),s.ALo(220,"i18n"),s.qZA(),s._uU(221,"\n "),s._UZ(222,"i",10),s._uU(223,"\n "),s.qZA(),s._uU(224,"\n "),s.TgZ(225,"button",23),s.NdJ("click",(function(){return t.share()})),s._uU(226,"\n "),s.TgZ(227,"div",9),s._uU(228),s.ALo(229,"i18n"),s.qZA(),s._uU(230,"\n "),s._UZ(231,"i",10),s._uU(232,"\n "),s.qZA(),s._uU(233,"\n "),s.TgZ(234,"button",23),s.NdJ("click",(function(){return t.help()})),s._uU(235,"\n "),s.TgZ(236,"div",9),s._uU(237),s.ALo(238,"i18n"),s.qZA(),s._uU(239,"\n "),s._UZ(240,"i",10),s._uU(241,"\n "),s.qZA(),s._uU(242,"\n "),s.TgZ(243,"button",23),s.NdJ("click",(function(){return t.rate()})),s._uU(244,"\n "),s.TgZ(245,"div",9),s._uU(246),s.ALo(247,"i18n"),s.qZA(),s._uU(248,"\n "),s._UZ(249,"i",10),s._uU(250,"\n "),s.qZA(),s._uU(251,"\n "),s.qZA(),s._uU(252,"\n "),s.TgZ(253,"div",30),s._uU(254),s.ALo(255,"i18n"),s.qZA(),s._uU(256,"\n "),s.qZA(),s._uU(257,"\n"),s.qZA(),s._uU(258,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,33,"settings")),s.xp6(12),s.Oqu(s.lcZ(23,35,"manage")),s.xp6(8),s.Oqu(s.lcZ(31,37,"folders")),s.xp6(9),s.Oqu(s.lcZ(40,39,"sync")),s.xp6(9),s.Oqu(s.lcZ(49,41,"excludedDomains")),s.xp6(11),s.Oqu(s.lcZ(60,43,"security")),s.xp6(5),s.Q6J("vaultTimeouts",t.vaultTimeouts)("formControl",t.vaultTimeout),s.xp6(6),s.Oqu(s.lcZ(71,45,"vaultTimeoutAction")),s.xp6(3),s.Q6J("ngModel",t.vaultTimeoutAction),s.xp6(3),s.Q6J("ngForOf",t.vaultTimeoutActions),s.xp6(7),s.Oqu(s.lcZ(84,47,"unlockWithPin")),s.xp6(3),s.Q6J("ngModel",t.pin),s.xp6(3),s.Q6J("ngIf",t.supportsBiometric),s.xp6(2),s.Q6J("ngIf",t.supportsBiometric&&t.biometric),s.xp6(5),s.Oqu(s.lcZ(97,49,"lockNow")),s.xp6(9),s.Oqu(s.lcZ(106,51,"twoStepLogin")),s.xp6(11),s.Oqu(s.lcZ(117,53,"account")),s.xp6(16),s.Oqu(s.lcZ(133,55,"premiumMembership")),s.xp6(8),s.Q6J("ngIf",t.showChangeMasterPass),s.xp6(5),s.Oqu(s.lcZ(146,57,"fingerprintPhrase")),s.xp6(9),s.Oqu(s.lcZ(155,59,"logOut")),s.xp6(11),s.Oqu(s.lcZ(166,61,"tools")),s.xp6(8),s.Oqu(s.lcZ(174,63,"importItems")),s.xp6(9),s.Oqu(s.lcZ(183,65,"exportVault")),s.xp6(9),s.Oqu(s.lcZ(192,67,"bitWebVault")),s.xp6(11),s.Oqu(s.lcZ(203,69,"other")),s.xp6(8),s.Oqu(s.lcZ(211,71,"options")),s.xp6(9),s.Oqu(s.lcZ(220,73,"about")),s.xp6(9),s.Oqu(s.lcZ(229,75,"learnOrg")),s.xp6(9),s.Oqu(s.lcZ(238,77,"helpFeedback")),s.xp6(9),s.Oqu(s.lcZ(247,79,"rateExtension")),s.xp6(8),s.Oqu(s.lcZ(255,81,"rateExtensionDesc")))},dependencies:[Pe.rH,u.sg,u.O5,ue.YN,ue.Kr,ue.Fj,ue.Wl,ue.EJ,ue.JJ,ue.On,Xe,St,ue.oH,es,Ml,Ze],encapsulation:2});var Kl,Bl,Gl,Ql,Vl,Hl,jl,Wl=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $l{constructor(e,t,i){this.syncService=e,this.platformUtilsService=t,this.i18nService=i,this.lastSync="--"}ngOnInit(){return Wl(this,void 0,void 0,(function*(){yield this.setLastSync()}))}sync(){return Wl(this,void 0,void 0,(function*(){this.syncPromise=this.syncService.fullSync(!0);(yield this.syncPromise)?(yield this.setLastSync(),this.platformUtilsService.showToast("success",null,this.i18nService.t("syncingComplete"))):this.platformUtilsService.showToast("error",null,this.i18nService.t("syncingFailed"))}))}setLastSync(){return Wl(this,void 0,void 0,(function*(){const e=yield this.syncService.getLastSync();this.lastSync=null!=e?e.toLocaleDateString()+" "+e.toLocaleTimeString():this.i18nService.t("never")}))}}function Xl(e,t){if(1&e&&(s.TgZ(0,"li",3,16),s._uU(2,"\n "),s.TgZ(3,"button",17),s.ALo(4,"i18n"),s._uU(5,"\n "),s._UZ(6,"i",18),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA()),2&e){const e=s.MAs(1);s.xp6(3),s.s9C("appA11yTitle",s.lcZ(4,3,"currentTab")),s.uIk("aria-pressed",e.isActive),s.xp6(4),s.hij("",s.lcZ(8,5,"tab"),"\n ")}}$l.ɵfac=function(e){return new(e||$l)(s.Y36(bi),s.Y36(Je),s.Y36(_e))},$l.ɵcmp=s.Xpm({type:$l,selectors:[["app-sync"]],decls:45,vars:17,consts:[[1,"left"],["type","button","routerLink","/tabs/settings"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],[1,"content","center-content"],["type","button",1,"btn","block","primary",3,"disabled","appApiAction","click"],["syncBtn",""],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],[1,"text-center","text-muted","small"]],template:function(e,t){if(1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16,"\n "),s.TgZ(17,"span",5),s._uU(18),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s._UZ(22,"div",6),s._uU(23,"\n"),s.qZA(),s._uU(24,"\n"),s.TgZ(25,"main",7),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.TgZ(29,"button",9,10),s.NdJ("click",(function(){return t.sync()})),s._uU(31,"\n "),s.TgZ(32,"span",11),s._uU(33),s.ALo(34,"i18n"),s.qZA(),s._uU(35,"\n "),s._UZ(36,"i",12),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.TgZ(39,"p",13),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n"),s.qZA(),s._uU(44,"\n")),2&e){const e=s.MAs(30);s.xp6(10),s.Oqu(s.lcZ(11,9,"back")),s.xp6(8),s.Oqu(s.lcZ(19,11,"sync")),s.xp6(11),s.Q6J("disabled",e.loading)("appApiAction",t.syncPromise),s.xp6(3),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(34,13,"syncVaultNow")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(4),s.AsE("",s.lcZ(41,15,"lastSync")," ",t.lastSync,"")}},dependencies:[Pe.rH,Ot,Ze],encapsulation:2});class ec{constructor(e){this.popupUtilsService=e,this.showCurrentTab=!0}ngOnInit(){this.showCurrentTab=!this.popupUtilsService.inPopout(window)}}ec.ɵfac=function(e){return new(e||ec)(s.Y36($t))},ec.ɵcmp=s.Xpm({type:ec,selectors:[["app-tabs"]],decls:57,vars:29,consts:[[1,"tab-page"],[1,"tabs"],["routerLinkActive","active",4,"ngIf"],["routerLinkActive","active"],["rlaMyVault","routerLinkActive"],["type","button","routerLink","vault",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-lock-f","bwi-2x"],["rlaSend","routerLinkActive"],["type","button","routerLink","send",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-send-f","bwi-2x"],["rlaGenerator","routerLinkActive"],["type","button","routerLink","generator",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-generate-f","bwi-2x"],["rlaSettings","routerLinkActive"],["type","button","routerLink","settings",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-cog-f","bwi-2x"],["rlaCurrentTab","routerLinkActive"],["type","button","routerLink","current",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-folder-closed-f","bwi-2x"]],template:function(e,t){if(1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s._UZ(2,"router-outlet"),s._uU(3,"\n "),s.TgZ(4,"nav",1),s._uU(5,"\n "),s.TgZ(6,"ul"),s._uU(7,"\n "),s.YNc(8,Xl,10,7,"li",2),s._uU(9,"\n "),s.TgZ(10,"li",3,4),s._uU(12,"\n "),s.TgZ(13,"button",5),s.ALo(14,"i18n"),s._uU(15,"\n "),s._UZ(16,"i",6),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"li",3,7),s._uU(23,"\n "),s.TgZ(24,"button",8),s.ALo(25,"i18n"),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"li",3,10),s._uU(34,"\n "),s.TgZ(35,"button",11),s.ALo(36,"i18n"),s._uU(37,"\n "),s._UZ(38,"i",12),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.TgZ(43,"li",3,13),s._uU(45,"\n "),s.TgZ(46,"button",14),s.ALo(47,"i18n"),s._uU(48,"\n "),s._UZ(49,"i",15),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.qZA(),s._uU(55,"\n"),s.qZA(),s._uU(56,"\n")),2&e){const e=s.MAs(11),i=s.MAs(22),n=s.MAs(33),o=s.MAs(44);s.xp6(8),s.Q6J("ngIf",t.showCurrentTab),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(14,13,"myVault")),s.uIk("aria-pressed",e.isActive),s.xp6(4),s.hij("",s.lcZ(18,15,"vault"),"\n "),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(25,17,"send")),s.uIk("aria-pressed",i.isActive),s.xp6(4),s.hij("",s.lcZ(29,19,"send"),"\n "),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(36,21,"passGen")),s.uIk("aria-pressed",n.isActive),s.xp6(4),s.hij("",s.lcZ(40,23,"generator"),"\n "),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(47,25,"settings")),s.uIk("aria-pressed",o.isActive),s.xp6(4),s.hij("",s.lcZ(51,27,"settings"),"\n ")}},dependencies:[Pe.lC,Pe.rH,Pe.Od,u.O5,Ht,Ze],encapsulation:2}),function(e){e[e.None=0]="None",e[e.Password=1]="Password"}(Kl||(Kl={})),function(e){e[e.Login=1]="Login",e[e.SecureNote=2]="SecureNote",e[e.Card=3]="Card",e[e.Identity=4]="Identity"}(Bl||(Bl={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(Gl||(Gl={})),function(e){e[e.Generic=0]="Generic"}(Ql||(Ql={})),function(e){e[e.Username=100]="Username",e[e.Password=101]="Password"}(Vl||(Vl={})),function(e){e[e.CardholderName=300]="CardholderName",e[e.ExpMonth=301]="ExpMonth",e[e.ExpYear=302]="ExpYear",e[e.Code=303]="Code",e[e.Brand=304]="Brand",e[e.Number=305]="Number"}(Hl||(Hl={})),function(e){e[e.Title=400]="Title",e[e.MiddleName=401]="MiddleName",e[e.Address1=402]="Address1",e[e.Address2=403]="Address2",e[e.Address3=404]="Address3",e[e.City=405]="City",e[e.State=406]="State",e[e.PostalCode=407]="PostalCode",e[e.Country=408]="Country",e[e.Company=409]="Company",e[e.Email=410]="Email",e[e.Phone=411]="Phone",e[e.Ssn=412]="Ssn",e[e.Username=413]="Username",e[e.PassportNumber=414]="PassportNumber",e[e.LicenseNumber=415]="LicenseNumber",e[e.FirstName=416]="FirstName",e[e.LastName=417]="LastName",e[e.FullName=418]="FullName"}(jl||(jl={}));class tc{constructor(e,t){this.propertyKey=e,this._i18nKey=t}get i18nKey(){var e;return null!==(e=this._i18nKey)&&void 0!==e?e:this.propertyKey}}function ic(e,t){return(i,n)=>{null==i.linkedFieldOptions&&(i.linkedFieldOptions=new Map),i.linkedFieldOptions.set(e,new tc(n,t))}}class nc{}var sc=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oc=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class rc extends nc{constructor(){super(...arguments),this.cardholderName=null,this.expMonth=null,this.expYear=null,this.code=null,this._brand=null,this._number=null,this._subTitle=null}get maskedCode(){return null!=this.code?"•".repeat(this.code.length):null}get maskedNumber(){return null!=this.number?"•".repeat(this.number.length):null}get brand(){return this._brand}set brand(e){this._brand=e,this._subTitle=null}get number(){return this._number}set number(e){this._number=e,this._subTitle=null}get subTitle(){if(null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4)){null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="";const e=this.number.length>=5&&null!=this.number.match(new RegExp("^3[47]"))?5:4;this._subTitle+="*"+this.number.substr(this.number.length-e)}return this._subTitle}get expiration(){if(!this.expMonth&&!this.expYear)return null;let e=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return e+=" / "+(null!=this.expYear?this.formatYear(this.expYear):"____"),e}formatYear(e){return 2===e.length?"20"+e:e}static fromJSON(e){return Object.assign(new rc,e)}}sc([ic(Hl.CardholderName),oc("design:type",String)],rc.prototype,"cardholderName",void 0),sc([ic(Hl.ExpMonth,"expirationMonth"),oc("design:type",String)],rc.prototype,"expMonth",void 0),sc([ic(Hl.ExpYear,"expirationYear"),oc("design:type",String)],rc.prototype,"expYear",void 0),sc([ic(Hl.Code,"securityCode"),oc("design:type",String)],rc.prototype,"code",void 0),sc([ic(Hl.Brand),oc("design:type",String),oc("design:paramtypes",[String])],rc.prototype,"brand",null),sc([ic(Hl.Number),oc("design:type",String),oc("design:paramtypes",[String])],rc.prototype,"number",null);class ac{constructor(e,t){if(null==e)throw new Error("Must provide key");if(null==t)if(32===e.byteLength)t=je.AesCbc256_B64;else{if(64!==e.byteLength)throw new Error("Unable to determine encType.");t=je.AesCbc256_HmacSha256_B64}if(this.key=e,this.encType=t,t===je.AesCbc256_B64&&32===e.byteLength)this.encKey=e,this.macKey=null;else if(t===je.AesCbc128_HmacSha256_B64&&32===e.byteLength)this.encKey=e.slice(0,16),this.macKey=e.slice(16,32);else{if(t!==je.AesCbc256_HmacSha256_B64||64!==e.byteLength)throw new Error("Unsupported encType/key length.");this.encKey=e.slice(0,32),this.macKey=e.slice(32,64)}null!=this.key&&(this.keyB64=nt.fromBufferToB64(this.key)),null!=this.encKey&&(this.encKeyB64=nt.fromBufferToB64(this.encKey)),null!=this.macKey&&(this.macKeyB64=nt.fromBufferToB64(this.macKey))}toJSON(){return{keyB64:this.keyB64}}static fromJSON(e){if(null==e)return null;const t=nt.fromB64ToArray(e.keyB64).buffer;return new ac(t)}}class lc{constructor(e){this.id=null,this.url=null,this.size=null,this.sizeName=null,this.fileName=null,this.key=null,e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName)}get fileSize(){try{if(null!=this.size)return parseInt(this.size,null)}catch(e){}return 0}static fromJSON(e){const t=null==e.key?null:ac.fromJSON(e.key);return Object.assign(new lc,e,{key:t})}}class cc{constructor(e){this.name=null,this.value=null,this.type=null,this.newField=!1,this.showValue=!1,this.showCount=!1,this.linkedId=null,e&&(this.type=e.type,this.linkedId=e.linkedId)}get maskedValue(){return null!=this.value?"••••••••":null}static fromJSON(e){return Object.assign(new cc,e)}}var uc=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},dc=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class hc extends nc{constructor(){super(),this.title=null,this.middleName=null,this.address1=null,this.address2=null,this.address3=null,this.city=null,this.state=null,this.postalCode=null,this.country=null,this.company=null,this.email=null,this.phone=null,this.ssn=null,this.username=null,this.passportNumber=null,this.licenseNumber=null,this._firstName=null,this._lastName=null,this._subTitle=null}get firstName(){return this._firstName}set firstName(e){this._firstName=e,this._subTitle=null}get lastName(){return this._lastName}set lastName(e){this._lastName=e,this._subTitle=null}get subTitle(){return null!=this._subTitle||null==this.firstName&&null==this.lastName||(this._subTitle="",null!=this.firstName&&(this._subTitle=this.firstName),null!=this.lastName&&(""!==this._subTitle&&(this._subTitle+=" "),this._subTitle+=this.lastName)),this._subTitle}get fullName(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){let e="";return null!=this.title&&(e+=this.title+" "),null!=this.firstName&&(e+=this.firstName+" "),null!=this.middleName&&(e+=this.middleName+" "),null!=this.lastName&&(e+=this.lastName),e.trim()}return null}get fullAddress(){let e=this.address1;return nt.isNullOrWhitespace(this.address2)||(nt.isNullOrWhitespace(e)||(e+=", "),e+=this.address2),nt.isNullOrWhitespace(this.address3)||(nt.isNullOrWhitespace(e)||(e+=", "),e+=this.address3),e}get fullAddressPart2(){if(null==this.city&&null==this.state&&null==this.postalCode)return null;const e=this.city||"-",t=this.state,i=this.postalCode||"-";let n=e;return nt.isNullOrWhitespace(t)||(n+=", "+t),n+=", "+i,n}static fromJSON(e){return Object.assign(new hc,e)}}uc([ic(jl.Title),dc("design:type",String)],hc.prototype,"title",void 0),uc([ic(jl.MiddleName),dc("design:type",String)],hc.prototype,"middleName",void 0),uc([ic(jl.Address1),dc("design:type",String)],hc.prototype,"address1",void 0),uc([ic(jl.Address2),dc("design:type",String)],hc.prototype,"address2",void 0),uc([ic(jl.Address3),dc("design:type",String)],hc.prototype,"address3",void 0),uc([ic(jl.City,"cityTown"),dc("design:type",String)],hc.prototype,"city",void 0),uc([ic(jl.State,"stateProvince"),dc("design:type",String)],hc.prototype,"state",void 0),uc([ic(jl.PostalCode,"zipPostalCode"),dc("design:type",String)],hc.prototype,"postalCode",void 0),uc([ic(jl.Country),dc("design:type",String)],hc.prototype,"country",void 0),uc([ic(jl.Company),dc("design:type",String)],hc.prototype,"company",void 0),uc([ic(jl.Email),dc("design:type",String)],hc.prototype,"email",void 0),uc([ic(jl.Phone),dc("design:type",String)],hc.prototype,"phone",void 0),uc([ic(jl.Ssn),dc("design:type",String)],hc.prototype,"ssn",void 0),uc([ic(jl.Username),dc("design:type",String)],hc.prototype,"username",void 0),uc([ic(jl.PassportNumber),dc("design:type",String)],hc.prototype,"passportNumber",void 0),uc([ic(jl.LicenseNumber),dc("design:type",String)],hc.prototype,"licenseNumber",void 0),uc([ic(jl.FirstName),dc("design:type",String),dc("design:paramtypes",[String])],hc.prototype,"firstName",null),uc([ic(jl.LastName),dc("design:type",String),dc("design:paramtypes",[String])],hc.prototype,"lastName",null),uc([ic(jl.FullName),dc("design:type",String),dc("design:paramtypes",[])],hc.prototype,"fullName",null);const pc=["https://","http://","ssh://","ftp://","sftp://","irc://","vnc://","rdp://","ms-rd:","chrome://","iosapp://","androidapp://"];class gc{constructor(e){this.match=null,this._uri=null,this._domain=null,this._hostname=null,this._host=null,this._canLaunch=null,e&&(this.match=e.match)}get uri(){return this._uri}set uri(e){this._uri=e,this._domain=null,this._canLaunch=null}get domain(){return null==this._domain&&null!=this.uri&&(this._domain=nt.getDomain(this.uri),""===this._domain&&(this._domain=null)),this._domain}get hostname(){return this.match===ka.RegularExpression?null:(null==this._hostname&&null!=this.uri&&(this._hostname=nt.getHostname(this.uri),""===this._hostname&&(this._hostname=null)),this._hostname)}get host(){return this.match===ka.RegularExpression?null:(null==this._host&&null!=this.uri&&(this._host=nt.getHost(this.uri),""===this._host&&(this._host=null)),this._host)}get hostnameOrUri(){return null!=this.hostname?this.hostname:this.uri}get hostOrUri(){return null!=this.host?this.host:this.uri}get isWebsite(){return null!=this.uri&&(0===this.uri.indexOf("http://")||0===this.uri.indexOf("https://")||this.uri.indexOf("://")<0&&nt.tldEndingRegex.test(this.uri))}get canLaunch(){if(null!=this._canLaunch)return this._canLaunch;if(null!=this.uri&&this.match!==ka.RegularExpression){const e=this.launchUri;for(let t=0;t=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},yc=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class fc extends nc{constructor(e){super(),this.username=null,this.password=null,this.passwordRevisionDate=null,this.totp=null,this.uris=null,this.autofillOnPageLoad=null,e&&(this.passwordRevisionDate=e.passwordRevisionDate,this.autofillOnPageLoad=e.autofillOnPageLoad)}get uri(){return this.hasUris?this.uris[0].uri:null}get maskedPassword(){return null!=this.password?"••••••••":null}get subTitle(){return this.username}get canLaunch(){return this.hasUris&&this.uris.some((e=>e.canLaunch))}get hasTotp(){return!nt.isNullOrWhitespace(this.totp)}get launchUri(){if(this.hasUris){const e=this.uris.find((e=>e.canLaunch));if(null!=e)return e.launchUri}return null}get hasUris(){return null!=this.uris&&this.uris.length>0}static fromJSON(e){var t;const i=null==e.passwordRevisionDate?null:new Date(e.passwordRevisionDate),n=null===(t=e.uris)||void 0===t?void 0:t.map((e=>gc.fromJSON(e)));return Object.assign(new fc,e,{passwordRevisionDate:i,uris:n})}}vc([ic(Vl.Username),yc("design:type",String)],fc.prototype,"username",void 0),vc([ic(Vl.Password),yc("design:type",String)],fc.prototype,"password",void 0);class mc{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 mc,e,{lastUsedDate:t})}}class wc extends nc{constructor(e){super(),this.type=null,e&&(this.type=e.type)}get subTitle(){return null}static fromJSON(e){return Object.assign(new wc,e)}}class bc{constructor(e){var t;this.id=null,this.organizationId=null,this.folderId=null,this.name=null,this.notes=null,this.type=null,this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,this.viewPassword=!0,this.login=new fc,this.identity=new hc,this.card=new rc,this.secureNote=new wc,this.attachments=null,this.fields=null,this.passwordHistory=null,this.collectionIds=null,this.revisionDate=null,this.deletedDate=null,this.reprompt=Kl.None,e&&(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.type=e.type,this.localData=e.localData,this.collectionIds=e.collectionIds,this.revisionDate=e.revisionDate,this.deletedDate=e.deletedDate,this.reprompt=null!==(t=e.reprompt)&&void 0!==t?t:Kl.None)}get item(){switch(this.type){case Bl.Login:return this.login;case Bl.SecureNote:return this.secureNote;case Bl.Card:return this.card;case Bl.Identity:return this.identity}return null}get subTitle(){return this.item.subTitle}get hasPasswordHistory(){return this.passwordHistory&&this.passwordHistory.length>0}get hasAttachments(){return this.attachments&&this.attachments.length>0}get hasOldAttachments(){if(this.hasAttachments)for(let e=0;e0}get passwordRevisionDisplayDate(){return this.type!==Bl.Login||null==this.login||null==this.login.password||""===this.login.password?null:this.login.passwordRevisionDate}get isDeleted(){return null!=this.deletedDate}get linkedFieldOptions(){return this.item.linkedFieldOptions}linkedFieldValue(e){var t;const i=null===(t=this.linkedFieldOptions)||void 0===t?void 0:t.get(e);if(null==i)return null;this.item;return this.item[i.propertyKey]}linkedFieldI18nKey(e){var t;return null===(t=this.linkedFieldOptions.get(e))||void 0===t?void 0:t.i18nKey}static fromJSON(e){var t,i,n;const s=new bc,o=null==e.revisionDate?null:new Date(e.revisionDate),r=null==e.deletedDate?null:new Date(e.deletedDate),a=null===(t=e.attachments)||void 0===t?void 0:t.map((e=>lc.fromJSON(e))),l=null===(i=e.fields)||void 0===i?void 0:i.map((e=>cc.fromJSON(e))),c=null===(n=e.passwordHistory)||void 0===n?void 0:n.map((e=>mc.fromJSON(e)));switch(Object.assign(s,e,{revisionDate:o,deletedDate:r,attachments:a,fields:l,passwordHistory:c}),e.type){case Bl.Card:s.card=rc.fromJSON(e.card);break;case Bl.Identity:s.identity=hc.fromJSON(e.identity);break;case Bl.Login:s.login=fc.fromJSON(e.login);break;case Bl.SecureNote:s.secureNote=wc.fromJSON(e.secureNote)}return s}}class Sc{}class Uc{}class xc{}class Ac{}var _c,Zc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Tc{constructor(e,t,i,n,o,r,a,l,c,u,d,h,p){this.cipherService=e,this.folderService=t,this.i18nService=i,this.platformUtilsService=n,this.auditService=o,this.stateService=r,this.collectionService=a,this.messagingService=l,this.eventService=c,this.policyService=u,this.logService=d,this.passwordRepromptService=h,this.organizationService=p,this.cloneMode=!1,this.folderId=null,this.organizationId=null,this.onSavedCipher=new s.vpe,this.onDeletedCipher=new s.vpe,this.onRestoredCipher=new s.vpe,this.onCancelled=new s.vpe,this.onEditAttachments=new s.vpe,this.onShareCipher=new s.vpe,this.onEditCollections=new s.vpe,this.onGeneratePassword=new s.vpe,this.onGenerateUsername=new s.vpe,this.editMode=!1,this.collections=[],this.showPassword=!1,this.showCardNumber=!1,this.showCardCode=!1,this.cipherType=Bl,this.ownershipOptions=[],this.currentDate=new Date,this.allowPersonal=!0,this.reprompt=!1,this.canUseReprompt=!0,this.typeOptions=[{name:i.t("typeLogin"),value:Bl.Login},{name:i.t("typeCard"),value:Bl.Card},{name:i.t("typeIdentity"),value:Bl.Identity},{name:i.t("typeSecureNote"),value:Bl.SecureNote}],this.cardBrandOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:"Visa",value:"Visa"},{name:"Mastercard",value:"Mastercard"},{name:"American Express",value:"Amex"},{name:"Discover",value:"Discover"},{name:"Diners Club",value:"Diners Club"},{name:"JCB",value:"JCB"},{name:"Maestro",value:"Maestro"},{name:"UnionPay",value:"UnionPay"},{name:"RuPay",value:"RuPay"},{name:i.t("cardBrandMir"),value:"Mir"},{name:i.t("other"),value:"Other"}],this.cardExpMonthOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:"01 - "+i.t("january"),value:"1"},{name:"02 - "+i.t("february"),value:"2"},{name:"03 - "+i.t("march"),value:"3"},{name:"04 - "+i.t("april"),value:"4"},{name:"05 - "+i.t("may"),value:"5"},{name:"06 - "+i.t("june"),value:"6"},{name:"07 - "+i.t("july"),value:"7"},{name:"08 - "+i.t("august"),value:"8"},{name:"09 - "+i.t("september"),value:"9"},{name:"10 - "+i.t("october"),value:"10"},{name:"11 - "+i.t("november"),value:"11"},{name:"12 - "+i.t("december"),value:"12"}],this.identityTitleOptions=[{name:"-- "+i.t("select")+" --",value:null},{name:i.t("mr"),value:i.t("mr")},{name:i.t("mrs"),value:i.t("mrs")},{name:i.t("ms"),value:i.t("ms")},{name:i.t("dr"),value:i.t("dr")}],this.uriMatchOptions=[{name:i.t("defaultMatchDetection"),value:null},{name:i.t("baseDomain"),value:ka.Domain},{name:i.t("host"),value:ka.Host},{name:i.t("startsWith"),value:ka.StartsWith},{name:i.t("regEx"),value:ka.RegularExpression},{name:i.t("exact"),value:ka.Exact},{name:i.t("never"),value:ka.Never}],this.autofillOnPageLoadOptions=[{name:i.t("autoFillOnPageLoadUseDefault"),value:null},{name:i.t("autoFillOnPageLoadYes"),value:!0},{name:i.t("autoFillOnPageLoadNo"),value:!1}]}ngOnInit(){return Zc(this,void 0,void 0,(function*(){yield this.init()}))}init(){return Zc(this,void 0,void 0,(function*(){if(this.ownershipOptions.length&&(this.ownershipOptions=[]),yield this.policyService.policyAppliesToUser(qs.PersonalOwnership))this.allowPersonal=!1;else{const e=yield this.stateService.getEmail();this.ownershipOptions.push({name:e,value:null})}(yield this.organizationService.getAll()).sort(nt.getSortFunction(this.i18nService,"name")).forEach((e=>{e.enabled&&e.status===Gl.Confirmed&&this.ownershipOptions.push({name:e.name,value:e.id})})),this.allowPersonal||(this.organizationId=this.ownershipOptions[0].value),this.writeableCollections=yield this.loadCollections(),this.canUseReprompt=yield this.passwordRepromptService.enabled()}))}load(){return Zc(this,void 0,void 0,(function*(){this.editMode=null!=this.cipherId,this.editMode?(this.editMode=!0,this.cloneMode?(this.cloneMode=!0,this.title=this.i18nService.t("addItem")):this.title=this.i18nService.t("editItem")):this.title=this.i18nService.t("addItem");const e=yield this.stateService.getAddEditCipherInfo();if(null!=e&&(this.cipher=e.cipher,this.collectionIds=e.collectionIds),yield this.stateService.setAddEditCipherInfo(null),null==this.cipher)if(this.editMode){const e=yield this.loadCipher();this.cipher=yield e.decrypt(),this.cloneMode&&(this.cipher.name+=" - "+this.i18nService.t("clone"),null!=this.cipher.organizationId||this.allowPersonal||(this.cipher.organizationId=this.organizationId))}else this.cipher=new bc,this.cipher.organizationId=null==this.organizationId?null:this.organizationId,this.cipher.folderId=this.folderId,this.cipher.type=null==this.type?Bl.Login:this.type,this.cipher.login=new fc,this.cipher.login.uris=[new gc],this.cipher.card=new rc,this.cipher.identity=new hc,this.cipher.secureNote=new wc,this.cipher.secureNote.type=Ql.Generic,this.cipher.reprompt=Kl.None;null==this.cipher||this.editMode&&null==e&&!this.cloneMode||(yield this.organizationChanged(),null!=this.collectionIds&&this.collectionIds.length>0&&this.collections.length>0&&this.collections.forEach((e=>{this.collectionIds.indexOf(e.id)>-1&&(e.checked=!0)}))),this.folders$=this.folderService.folderViews$,this.editMode&&this.previousCipherId!==this.cipherId&&this.eventService.collect(Gr.Cipher_ClientViewed,this.cipherId),this.previousCipherId=this.cipherId,this.reprompt=this.cipher.reprompt!==Kl.None}))}submit(){return Zc(this,void 0,void 0,(function*(){if(this.cipher.isDeleted)return this.restore();if(null==this.cipher.name||""===this.cipher.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;if((!this.editMode||this.cloneMode)&&!this.allowPersonal&&null==this.cipher.organizationId)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("personalOwnershipSubmitError")),!1;this.editMode&&!this.cloneMode||this.cipher.type!==Bl.Login||null==this.cipher.login.uris||1!==this.cipher.login.uris.length||null!=this.cipher.login.uris[0].uri&&""!==this.cipher.login.uris[0].uri||(this.cipher.login.uris=null),this.editMode&&!this.cloneMode||null==this.cipher.organizationId||(this.cipher.collectionIds=null==this.collections?[]:this.collections.filter((e=>e.checked)).map((e=>e.id))),this.cloneMode&&(this.cipher.id=null);const e=yield this.encryptCipher();try{return this.formPromise=this.saveCipher(e),yield this.formPromise,this.cipher.id=e.id,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode&&!this.cloneMode?"editedItem":"addedItem")),this.onSavedCipher.emit(this.cipher),this.messagingService.send(this.editMode&&!this.cloneMode?"editedCipher":"addedCipher"),!0}catch(e){this.logService.error(e)}return!1}))}addUri(){this.cipher.type===Bl.Login&&(null==this.cipher.login.uris&&(this.cipher.login.uris=[]),this.cipher.login.uris.push(new gc))}removeUri(e){if(this.cipher.type!==Bl.Login||null==this.cipher.login.uris)return;const t=this.cipher.login.uris.indexOf(e);t>-1&&this.cipher.login.uris.splice(t,1)}trackByFunction(e,t){return e}cancel(){this.onCancelled.emit(this.cipher)}attachments(){this.onEditAttachments.emit(this.cipher)}share(){this.onShareCipher.emit(this.cipher)}editCollections(){this.onEditCollections.emit(this.cipher)}delete(){return Zc(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t(this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"),this.i18nService.t("deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.deletePromise=this.deleteCipher(),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")),this.onDeletedCipher.emit(this.cipher),this.messagingService.send(this.cipher.isDeleted?"permanentlyDeletedCipher":"deletedCipher")}catch(e){this.logService.error(e)}return!0}))}restore(){return Zc(this,void 0,void 0,(function*(){if(!this.cipher.isDeleted)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("restoreItemConfirmation"),this.i18nService.t("restoreItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.restorePromise=this.restoreCipher(),yield this.restorePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItem")),this.onRestoredCipher.emit(this.cipher),this.messagingService.send("restoredCipher")}catch(e){this.logService.error(e)}return!0}))}generateUsername(){var e,t;return Zc(this,void 0,void 0,(function*(){if(null===(t=null===(e=this.cipher.login)||void 0===e?void 0:e.username)||void 0===t?void 0:t.length){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("overwriteUsernameConfirmation"),this.i18nService.t("overwriteUsername"),this.i18nService.t("yes"),this.i18nService.t("no"))))return!1}return this.onGenerateUsername.emit(),!0}))}generatePassword(){var e,t;return Zc(this,void 0,void 0,(function*(){if(null===(t=null===(e=this.cipher.login)||void 0===e?void 0:e.password)||void 0===t?void 0:t.length){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("overwritePasswordConfirmation"),this.i18nService.t("overwritePassword"),this.i18nService.t("yes"),this.i18nService.t("no"))))return!1}return this.onGeneratePassword.emit(),!0}))}togglePassword(){this.showPassword=!this.showPassword,document.getElementById("loginPassword").focus(),this.editMode&&this.showPassword&&this.eventService.collect(Gr.Cipher_ClientToggledPasswordVisible,this.cipherId)}toggleCardNumber(){return Zc(this,void 0,void 0,(function*(){this.showCardNumber=!this.showCardNumber,this.showCardNumber&&this.eventService.collect(Gr.Cipher_ClientToggledCardNumberVisible,this.cipherId)}))}toggleCardCode(){this.showCardCode=!this.showCardCode,document.getElementById("cardCode").focus(),this.editMode&&this.showCardCode&&this.eventService.collect(Gr.Cipher_ClientToggledCardCodeVisible,this.cipherId)}toggleUriOptions(e){const t=e;t.showOptions=(null!=t.showOptions||null==e.match)&&!t.showOptions}loginUriMatchChanged(e){const t=e;t.showOptions=null==t.showOptions||t.showOptions}organizationChanged(){return Zc(this,void 0,void 0,(function*(){if(null!=this.writeableCollections&&this.writeableCollections.forEach((e=>e.checked=!1)),null!=this.cipher.organizationId){this.collections=this.writeableCollections.filter((e=>e.organizationId===this.cipher.organizationId));const e=yield this.organizationService.get(this.cipher.organizationId);null!=e&&(this.cipher.organizationUseTotp=e.useTotp)}else this.collections=[]}))}checkPassword(){return Zc(this,void 0,void 0,(function*(){if(null!=this.checkPasswordPromise)return;if(null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password)return;this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password);const e=yield this.checkPasswordPromise;this.checkPasswordPromise=null,e>0?this.platformUtilsService.showToast("warning",null,this.i18nService.t("passwordExposed",e.toString())):this.platformUtilsService.showToast("success",null,this.i18nService.t("passwordSafe"))}))}repromptChanged(){this.reprompt=!this.reprompt,this.reprompt?this.cipher.reprompt=Kl.Password:this.cipher.reprompt=Kl.None}loadCollections(){return Zc(this,void 0,void 0,(function*(){return(yield this.collectionService.getAllDecrypted()).filter((e=>!e.readOnly))}))}loadCipher(){return this.cipherService.get(this.cipherId)}encryptCipher(){return this.cipherService.encrypt(this.cipher)}saveCipher(e){return this.cipherService.saveWithServer(e)}deleteCipher(){return this.cipher.isDeleted?this.cipherService.deleteWithServer(this.cipher.id):this.cipherService.softDeleteWithServer(this.cipher.id)}restoreCipher(){return this.cipherService.restoreWithServer(this.cipher.id)}}Tc.ɵfac=function(e){return new(e||Tc)(s.Y36(Sc),s.Y36(ba),s.Y36(_e),s.Y36(Je),s.Y36(Uc),s.Y36(Mt),s.Y36(xc),s.Y36(qe),s.Y36(jr),s.Y36(Hi),s.Y36(Ct),s.Y36(Ac),s.Y36(ta))},Tc.ɵdir=s.lG2({type:Tc,inputs:{cloneMode:"cloneMode",folderId:"folderId",cipherId:"cipherId",type:"type",collectionIds:"collectionIds",organizationId:"organizationId"},outputs:{onSavedCipher:"onSavedCipher",onDeletedCipher:"onDeletedCipher",onRestoredCipher:"onRestoredCipher",onCancelled:"onCancelled",onEditAttachments:"onEditAttachments",onShareCipher:"onShareCipher",onEditCollections:"onEditCollections",onGeneratePassword:"onGeneratePassword",onGenerateUsername:"onGenerateUsername"}}),function(e){e[e.Text=0]="Text",e[e.Hidden=1]="Hidden",e[e.Boolean=2]="Boolean",e[e.Linked=3]="Linked"}(_c||(_c={}));class Cc{constructor(e,t){this.i18nService=e,this.eventService=t,this.addFieldType=_c.Text,this.linkedFieldOptions=[],this.cipherType=Bl,this.fieldType=_c,this.eventType=Gr,this.addFieldTypeOptions=[{name:e.t("cfTypeText"),value:_c.Text},{name:e.t("cfTypeHidden"),value:_c.Hidden},{name:e.t("cfTypeBoolean"),value:_c.Boolean}],this.addFieldLinkedTypeOption={name:this.i18nService.t("cfTypeLinked"),value:_c.Linked}}ngOnChanges(e){null!=e.thisCipherType&&(this.setLinkedFieldOptions(),e.thisCipherType.firstChange||this.resetCipherLinkedFields())}addField(){null==this.cipher.fields&&(this.cipher.fields=[]);const e=new cc;e.type=this.addFieldType,e.newField=!0,e.type===_c.Linked&&(e.linkedId=this.linkedFieldOptions[0].value),this.cipher.fields.push(e)}removeField(e){const t=this.cipher.fields.indexOf(e);t>-1&&this.cipher.fields.splice(t,1)}toggleFieldValue(e){const t=e;t.showValue=!t.showValue,this.editMode&&t.showValue&&this.eventService.collect(Gr.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id)}trackByFunction(e,t){return e}drop(e){(0,r.bA)(this.cipher.fields,e.previousIndex,e.currentIndex)}setLinkedFieldOptions(){if(null==this.cipher.linkedFieldOptions)return;const e=[];this.cipher.linkedFieldOptions.forEach(((t,i)=>e.push({name:this.i18nService.t(t.i18nKey),value:i}))),this.linkedFieldOptions=e.sort(nt.getSortFunction(this.i18nService,"name"))}resetCipherLinkedFields(){null!=this.cipher.fields&&0!==this.cipher.fields.length&&(null!=this.cipher.linkedFieldOptions?this.cipher.fields.filter((e=>e.type===_c.Linked)).forEach((e=>e.linkedId=this.linkedFieldOptions[0].value)):this.cipher.fields=this.cipher.fields.filter((e=>e.type!==_c.Linked)))}}Cc.ɵfac=function(e){return new(e||Cc)(s.Y36(_e),s.Y36(jr))},Cc.ɵdir=s.lG2({type:Cc,inputs:{cipher:"cipher",thisCipherType:"thisCipherType",editMode:"editMode"},features:[s.TTD]});class kc{constructor(e,t){this.elementRef=e,this.renderer=t,this.trueValue=!0,this.falseValue=!1,this.propagateChange=e=>{}}onHostChange(e){this.propagateChange(e.target.checked?this.trueValue:this.falseValue)}writeValue(e){e===this.trueValue?this.renderer.setProperty(this.elementRef.nativeElement,"checked",!0):this.renderer.setProperty(this.elementRef.nativeElement,"checked",!1)}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}setDisabledState(e){}}function Oc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"input",26),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.value=t)})),s.ALo(1,"i18n"),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit;s.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),s.s9C("placeholder",s.lcZ(1,5,"value")),s.Q2q("aria-describedby","fieldName",t,""),s.Q6J("ngModel",i.value)}}function Pc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"input",27),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.value=t)})),s.ALo(1,"i18n"),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit,n=s.oxw(2);s.MGl("id","fieldValue",t,""),s.s9C("type",i.showValue?"text":"password"),s.MGl("name","Field.Value",t,""),s.s9C("placeholder",s.lcZ(1,7,"value")),s.Q2q("aria-describedby","fieldName",t,""),s.Q6J("ngModel",i.value)("disabled",!n.cipher.viewPassword&&!i.newField)}}function Ic(e,t){if(1&e&&(s.TgZ(0,"option",29),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function qc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"select",28),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.linkedId=t)})),s._uU(1,"\n "),s.YNc(2,Ic,2,2,"option",9),s._uU(3,"\n "),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit,n=s.oxw(2);s.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),s.Q2q("aria-describedby","fieldName",t,""),s.Q6J("ngModel",i.linkedId),s.xp6(2),s.Q6J("ngForOf",n.linkedFieldOptions)}}function Dc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"input",30),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.value=t)})),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit;s.MGl("id","fieldValue",t,"")("name","Field.Value",t,""),s.Q2q("aria-describedby","fieldName",t,""),s.Q6J("ngModel",i.value)}}kc.ɵfac=function(e){return new(e||kc)(s.Y36(s.SBq),s.Y36(s.Qsj))},kc.ɵdir=s.lG2({type:kc,selectors:[["input","type","checkbox","appTrueFalseValue",""]],hostBindings:function(e,t){1&e&&s.NdJ("change",(function(e){return t.onHostChange(e)}))},inputs:{trueValue:"trueValue",falseValue:"falseValue"},features:[s._Bn([{provide:ue.JU,useExisting:(0,s.Gpc)((()=>kc)),multi:!0}])]});const Mc=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Fc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",31),s._uU(1,"\n "),s.TgZ(2,"button",32),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(2);return s.KtG(i.toggleFieldValue(t))})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",33),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,3,"toggleVisibility")),s.uIk("aria-pressed",e.showValue),s.xp6(3),s.Q6J("ngClass",s.WLB(5,Mc,!e.showValue,e.showValue))}}const Nc=function(e){return{"box-content-row-checkbox":e}};function Lc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"button",14),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.removeField(t))})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",15),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"label",16),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"label",16),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"div",17),s._uU(17,"\n "),s.TgZ(18,"input",18),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.name=t)})),s.ALo(19,"i18n"),s.qZA(),s._uU(20,"\n "),s._uU(21,"\n "),s.YNc(22,Oc,2,7,"input",19),s._uU(23,"\n "),s._uU(24,"\n "),s.YNc(25,Pc,2,9,"input",20),s._uU(26,"\n "),s._uU(27,"\n "),s.YNc(28,qc,4,5,"select",21),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s._uU(31,"\n "),s.YNc(32,Dc,1,4,"input",22),s._uU(33,"\n "),s.YNc(34,Fc,8,8,"div",23),s._uU(35,"\n "),s.TgZ(36,"div",24),s.ALo(37,"i18n"),s._uU(38,"\n "),s._UZ(39,"i",25),s._uU(40,"\n "),s.qZA(),s._uU(41,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(2);s.Q6J("ngClass",s.VKq(27,Nc,e.type===n.fieldType.Boolean)),s.uIk("aria-label",e.name),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,17,"remove")),s.xp6(6),s.MGl("for","fieldName",i,""),s.xp6(1),s.Oqu(s.lcZ(10,19,"name")),s.xp6(3),s.MGl("for","fieldValue",i,""),s.xp6(1),s.Oqu(s.lcZ(14,21,"value")),s.xp6(5),s.MGl("id","fieldName",i,"")("name","Field.Name",i,""),s.s9C("placeholder",s.lcZ(19,23,"name")),s.Q6J("ngModel",e.name),s.xp6(4),s.Q6J("ngIf",e.type===n.fieldType.Text),s.xp6(3),s.Q6J("ngIf",e.type===n.fieldType.Hidden),s.xp6(3),s.Q6J("ngIf",e.type===n.fieldType.Linked&&null!=n.cipher.linkedFieldOptions),s.xp6(4),s.Q6J("ngIf",e.type===n.fieldType.Boolean),s.xp6(2),s.Q6J("ngIf",e.type===n.fieldType.Hidden&&(n.cipher.viewPassword||e.newField)),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(37,25,"dragToSort"))}}function Ec(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",11),s.NdJ("cdkDropListDropped",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.drop(t))})),s._uU(1,"\n "),s.YNc(2,Lc,42,29,"div",12),s._uU(3,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngForOf",e.cipher.fields)("ngForTrackBy",e.trackByFunction)}}function Rc(e,t){if(1&e&&(s.TgZ(0,"option",29),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Jc(e,t){if(1&e&&(s.TgZ(0,"option",29),s._uU(1),s.qZA()),2&e){const e=s.oxw();s.Q6J("ngValue",e.addFieldLinkedTypeOption.value),s.xp6(1),s.hij("\n ",e.addFieldLinkedTypeOption.name,"\n ")}}class Yc extends Cc{constructor(e,t){super(e,t)}}Yc.ɵfac=function(e){return new(e||Yc)(s.Y36(_e),s.Y36(jr))},Yc.ɵcmp=s.Xpm({type:Yc,selectors:[["app-vault-add-edit-custom-fields"]],features:[s.qOj],decls:34,vars:13,consts:[[1,"box"],[1,"box-header"],[1,"box-content"],["cdkDropList","",3,"cdkDropListDropped",4,"ngIf"],["appBoxRow","",1,"box-content-row","box-content-row-newmulti"],["type","button","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw","bwi-lg"],["for","addFieldType",1,"sr-only"],["id","addFieldType","name","AddFieldType",1,"field-type",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue",4,"ngIf"],["cdkDropList","",3,"cdkDropListDropped"],["role","group","class","box-content-row box-content-row-multi box-draggable-row","appBoxRow","","cdkDrag","",3,"ngClass",4,"ngFor","ngForOf","ngForTrackBy"],["role","group","appBoxRow","","cdkDrag","",1,"box-content-row","box-content-row-multi","box-draggable-row",3,"ngClass"],["type","button","appStopClick","",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],[1,"sr-only",3,"for"],[1,"row-main"],["type","text","appInputVerbatim","",1,"row-label",3,"id","name","ngModel","placeholder","ngModelChange"],["type","text","appInputVerbatim","",3,"id","name","ngModel","placeholder","ngModelChange",4,"ngIf"],["class","monospaced","appInputVerbatim","",3,"id","type","name","ngModel","placeholder","disabled","ngModelChange",4,"ngIf"],[3,"id","name","ngModel","ngModelChange",4,"ngIf"],["type","checkbox","appTrueFalseValue","","trueValue","true","falseValue","false",3,"id","name","ngModel","ngModelChange",4,"ngIf"],["class","action-buttons",4,"ngIf"],["cdkDragHandle","",1,"drag-handle",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-hamburger"],["type","text","appInputVerbatim","",3,"id","name","ngModel","placeholder","ngModelChange"],["appInputVerbatim","",1,"monospaced",3,"id","type","name","ngModel","placeholder","disabled","ngModelChange"],[3,"id","name","ngModel","ngModelChange"],[3,"ngValue"],["type","checkbox","appTrueFalseValue","","trueValue","true","falseValue","false",3,"id","name","ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"h2",1),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",2),s._uU(7,"\n "),s._uU(8,"\n "),s.YNc(9,Ec,4,2,"div",3),s._uU(10,"\n "),s._uU(11,"\n "),s.TgZ(12,"div",4),s._uU(13,"\n "),s.TgZ(14,"button",5),s.NdJ("click",(function(){return t.addField()})),s._uU(15,"\n "),s._UZ(16,"i",6),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.TgZ(20,"label",7),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s.TgZ(24,"select",8),s.NdJ("ngModelChange",(function(e){return t.addFieldType=e})),s._uU(25,"\n "),s.YNc(26,Rc,2,2,"option",9),s._uU(27,"\n "),s.YNc(28,Jc,2,2,"option",10),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n"),s.qZA(),s._uU(33,"\n")),2&e&&(s.xp6(3),s.hij("\n ",s.lcZ(4,7,"customFields"),"\n "),s.xp6(6),s.Q6J("ngIf",t.cipher.hasFields),s.xp6(8),s.hij("\n ",s.lcZ(18,9,"newCustomField"),"\n "),s.xp6(4),s.Oqu(s.lcZ(22,11,"type")),s.xp6(3),s.Q6J("ngModel",t.addFieldType),s.xp6(2),s.Q6J("ngForOf",t.addFieldTypeOptions),s.xp6(2),s.Q6J("ngIf",null!=t.cipher.linkedFieldOptions))},dependencies:[u.mk,u.sg,u.O5,r.Wj,r.Zt,r.Bh,ue.YN,ue.Kr,ue.Fj,ue.Wl,ue.EJ,ue.JJ,ue.On,Ht,Xe,bt,St,kc,Ze],encapsulation:2});var zc=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Kc(e,t){1&e&&(s.TgZ(0,"app-callout",34),s._uU(1),s.ALo(2,"i18n"),s.qZA()),2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"personalOwnershipPolicyInEffect"),"\n "))}function Bc(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Gc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",17),s._uU(1,"\n "),s.TgZ(2,"label",35),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"select",36),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.type=t)})),s._uU(7,"\n "),s.YNc(8,Bc,2,2,"option",24),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"type")),s.xp6(3),s.Q6J("ngModel",e.cipher.type),s.xp6(2),s.Q6J("ngForOf",e.typeOptions)}}function Qc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",51,52),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.checkPassword())})),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",53),s._uU(5,"\n "),s._UZ(6,"i",54),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw(3);s.s9C("appA11yTitle",s.lcZ(2,5,"checkPassword")),s.Q6J("appApiAction",t.checkPasswordPromise)("disabled",e.loading),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.Q6J("hidden",!e.loading)}}const Vc=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Hc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.togglePassword())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",55),s._uU(4,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.s9C("appA11yTitle",s.lcZ(1,3,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(5,Vc,!e.showPassword,e.showPassword))}}function jc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.generatePassword())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",44),s._uU(4,"\n "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"generatePassword"))}function Wc(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"div",38),s._uU(3,"\n "),s.TgZ(4,"div",39),s._uU(5,"\n "),s.TgZ(6,"label",40),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"input",41),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.username=t)})),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",42),s._uU(14,"\n "),s.TgZ(15,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.generateUsername())})),s.ALo(16,"i18n"),s._uU(17,"\n "),s._UZ(18,"i",44),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.TgZ(23,"div",38),s._uU(24,"\n "),s.TgZ(25,"div",39),s._uU(26,"\n "),s.TgZ(27,"label",45),s._uU(28),s.ALo(29,"i18n"),s.qZA(),s._uU(30,"\n "),s.TgZ(31,"input",46),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.password=t)})),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.TgZ(34,"div",42),s._uU(35,"\n "),s.YNc(36,Qc,8,7,"button",47),s._uU(37,"\n "),s.YNc(38,Hc,5,8,"button",48),s._uU(39,"\n "),s.YNc(40,jc,5,3,"button",48),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n "),s.TgZ(44,"div",17),s._uU(45,"\n "),s.TgZ(46,"label",49),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"input",50),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.totp=t)})),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.Oqu(s.lcZ(8,14,"username")),s.xp6(3),s.Q6J("ngModel",e.cipher.login.username),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(16,16,"generateUsername")),s.xp6(13),s.Oqu(s.lcZ(29,18,"password")),s.xp6(3),s.s9C("type",e.showPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.password)("disabled",!e.cipher.viewPassword),s.xp6(5),s.Q6J("ngIf",e.cipher.viewPassword),s.xp6(2),s.Q6J("ngIf",e.cipher.viewPassword),s.xp6(2),s.Q6J("ngIf",e.cipher.viewPassword),s.xp6(7),s.Oqu(s.lcZ(48,20,"authenticatorKeyTotp")),s.xp6(3),s.s9C("type",e.cipher.viewPassword?"text":"password"),s.Q6J("ngModel",e.cipher.login.totp)("disabled",!e.cipher.viewPassword)}}function $c(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function Xc(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function eu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"div",17),s._uU(3,"\n "),s.TgZ(4,"label",56),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"input",57),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.cardholderName=t)})),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",38),s._uU(12,"\n "),s.TgZ(13,"div",39),s._uU(14,"\n "),s.TgZ(15,"label",58),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"input",59),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.number=t)})),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"div",42),s._uU(23,"\n "),s.TgZ(24,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardNumber())})),s.ALo(25,"i18n"),s._uU(26,"\n "),s._UZ(27,"i",55),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"div",17),s._uU(33,"\n "),s.TgZ(34,"label",60),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n "),s.TgZ(38,"select",61),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.brand=t)})),s._uU(39,"\n "),s.YNc(40,$c,2,2,"option",24),s._uU(41,"\n "),s.qZA(),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n "),s.TgZ(44,"div",17),s._uU(45,"\n "),s.TgZ(46,"label",62),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"select",63),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.expMonth=t)})),s._uU(51,"\n "),s.YNc(52,Xc,2,2,"option",24),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.qZA(),s._uU(55,"\n "),s.TgZ(56,"div",17),s._uU(57,"\n "),s.TgZ(58,"label",64),s._uU(59),s.ALo(60,"i18n"),s.qZA(),s._uU(61,"\n "),s.TgZ(62,"input",65),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.expYear=t)})),s.ALo(63,"i18n"),s.ALo(64,"date"),s.qZA(),s._uU(65,"\n "),s.qZA(),s._uU(66,"\n "),s.TgZ(67,"div",38),s._uU(68,"\n "),s.TgZ(69,"div",39),s._uU(70,"\n "),s.TgZ(71,"label",66),s._uU(72),s.ALo(73,"i18n"),s.qZA(),s._uU(74,"\n "),s.TgZ(75,"input",67),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.card.code=t)})),s.qZA(),s._uU(76,"\n "),s.qZA(),s._uU(77,"\n "),s.TgZ(78,"div",42),s._uU(79,"\n "),s.TgZ(80,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.toggleCardCode())})),s.ALo(81,"i18n"),s._uU(82,"\n "),s._UZ(83,"i",55),s._uU(84,"\n "),s.qZA(),s._uU(85,"\n "),s.qZA(),s._uU(86,"\n "),s.qZA(),s._uU(87,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,24,"cardholderName")),s.xp6(3),s.Q6J("ngModel",e.cipher.card.cardholderName),s.xp6(8),s.Oqu(s.lcZ(17,26,"number")),s.xp6(3),s.s9C("type",e.showCardNumber?"text":"password"),s.Q6J("ngModel",e.cipher.card.number),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(25,28,"toggleVisibility")),s.uIk("aria-pressed",e.showCardNumber),s.xp6(3),s.Q6J("ngClass",s.WLB(45,Vc,!e.showCardNumber,e.showCardNumber)),s.xp6(8),s.Oqu(s.lcZ(36,30,"brand")),s.xp6(3),s.Q6J("ngModel",e.cipher.card.brand),s.xp6(2),s.Q6J("ngForOf",e.cardBrandOptions),s.xp6(7),s.Oqu(s.lcZ(48,32,"expirationMonth")),s.xp6(3),s.Q6J("ngModel",e.cipher.card.expMonth),s.xp6(2),s.Q6J("ngForOf",e.cardExpMonthOptions),s.xp6(7),s.Oqu(s.lcZ(60,34,"expirationYear")),s.xp6(3),s.hYB("placeholder","",s.lcZ(63,36,"ex")," ",s.xi3(64,38,e.currentDate,"yyyy"),""),s.Q6J("ngModel",e.cipher.card.expYear),s.xp6(10),s.Oqu(s.lcZ(73,41,"securityCode")),s.xp6(3),s.s9C("type",e.showCardCode?"text":"password"),s.Q6J("ngModel",e.cipher.card.code),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(81,43,"toggleVisibility")),s.uIk("aria-pressed",e.showCardCode),s.xp6(3),s.Q6J("ngClass",s.WLB(48,Vc,!e.showCardCode,e.showCardCode))}}function tu(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function iu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"div",17),s._uU(3,"\n "),s.TgZ(4,"label",68),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"select",69),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.title=t)})),s._uU(9,"\n "),s.YNc(10,tu,2,2,"option",24),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"div",17),s._uU(15,"\n "),s.TgZ(16,"label",70),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.TgZ(20,"input",71),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.firstName=t)})),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.TgZ(23,"div",17),s._uU(24,"\n "),s.TgZ(25,"label",72),s._uU(26),s.ALo(27,"i18n"),s.qZA(),s._uU(28,"\n "),s.TgZ(29,"input",73),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.middleName=t)})),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"div",17),s._uU(33,"\n "),s.TgZ(34,"label",74),s._uU(35),s.ALo(36,"i18n"),s.qZA(),s._uU(37,"\n "),s.TgZ(38,"input",75),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.lastName=t)})),s.qZA(),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n "),s.TgZ(41,"div",17),s._uU(42,"\n "),s.TgZ(43,"label",76),s._uU(44),s.ALo(45,"i18n"),s.qZA(),s._uU(46,"\n "),s.TgZ(47,"input",77),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.username=t)})),s.qZA(),s._uU(48,"\n "),s.qZA(),s._uU(49,"\n "),s.TgZ(50,"div",17),s._uU(51,"\n "),s.TgZ(52,"label",78),s._uU(53),s.ALo(54,"i18n"),s.qZA(),s._uU(55,"\n "),s.TgZ(56,"input",79),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.company=t)})),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.TgZ(59,"div",17),s._uU(60,"\n "),s.TgZ(61,"label",80),s._uU(62),s.ALo(63,"i18n"),s.qZA(),s._uU(64,"\n "),s.TgZ(65,"input",81),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.ssn=t)})),s.qZA(),s._uU(66,"\n "),s.qZA(),s._uU(67,"\n "),s.TgZ(68,"div",17),s._uU(69,"\n "),s.TgZ(70,"label",82),s._uU(71),s.ALo(72,"i18n"),s.qZA(),s._uU(73,"\n "),s.TgZ(74,"input",83),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.passportNumber=t)})),s.qZA(),s._uU(75,"\n "),s.qZA(),s._uU(76,"\n "),s.TgZ(77,"div",17),s._uU(78,"\n "),s.TgZ(79,"label",84),s._uU(80),s.ALo(81,"i18n"),s.qZA(),s._uU(82,"\n "),s.TgZ(83,"input",85),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.licenseNumber=t)})),s.qZA(),s._uU(84,"\n "),s.qZA(),s._uU(85,"\n "),s.TgZ(86,"div",17),s._uU(87,"\n "),s.TgZ(88,"label",86),s._uU(89),s.ALo(90,"i18n"),s.qZA(),s._uU(91,"\n "),s.TgZ(92,"input",87),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.email=t)})),s.qZA(),s._uU(93,"\n "),s.qZA(),s._uU(94,"\n "),s.TgZ(95,"div",17),s._uU(96,"\n "),s.TgZ(97,"label",88),s._uU(98),s.ALo(99,"i18n"),s.qZA(),s._uU(100,"\n "),s.TgZ(101,"input",89),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.phone=t)})),s.qZA(),s._uU(102,"\n "),s.qZA(),s._uU(103,"\n "),s.TgZ(104,"div",17),s._uU(105,"\n "),s.TgZ(106,"label",90),s._uU(107),s.ALo(108,"i18n"),s.qZA(),s._uU(109,"\n "),s.TgZ(110,"input",91),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address1=t)})),s.qZA(),s._uU(111,"\n "),s.qZA(),s._uU(112,"\n "),s.TgZ(113,"div",17),s._uU(114,"\n "),s.TgZ(115,"label",92),s._uU(116),s.ALo(117,"i18n"),s.qZA(),s._uU(118,"\n "),s.TgZ(119,"input",93),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address2=t)})),s.qZA(),s._uU(120,"\n "),s.qZA(),s._uU(121,"\n "),s.TgZ(122,"div",17),s._uU(123,"\n "),s.TgZ(124,"label",94),s._uU(125),s.ALo(126,"i18n"),s.qZA(),s._uU(127,"\n "),s.TgZ(128,"input",95),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.address3=t)})),s.qZA(),s._uU(129,"\n "),s.qZA(),s._uU(130,"\n "),s.TgZ(131,"div",17),s._uU(132,"\n "),s.TgZ(133,"label",96),s._uU(134),s.ALo(135,"i18n"),s.qZA(),s._uU(136,"\n "),s.TgZ(137,"input",97),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.city=t)})),s.qZA(),s._uU(138,"\n "),s.qZA(),s._uU(139,"\n "),s.TgZ(140,"div",17),s._uU(141,"\n "),s.TgZ(142,"label",98),s._uU(143),s.ALo(144,"i18n"),s.qZA(),s._uU(145,"\n "),s.TgZ(146,"input",99),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.state=t)})),s.qZA(),s._uU(147,"\n "),s.qZA(),s._uU(148,"\n "),s.TgZ(149,"div",17),s._uU(150,"\n "),s.TgZ(151,"label",100),s._uU(152),s.ALo(153,"i18n"),s.qZA(),s._uU(154,"\n "),s.TgZ(155,"input",101),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.postalCode=t)})),s.qZA(),s._uU(156,"\n "),s.qZA(),s._uU(157,"\n "),s.TgZ(158,"div",17),s._uU(159,"\n "),s.TgZ(160,"label",102),s._uU(161),s.ALo(162,"i18n"),s.qZA(),s._uU(163,"\n "),s.TgZ(164,"input",103),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.identity.country=t)})),s.qZA(),s._uU(165,"\n "),s.qZA(),s._uU(166,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,37,"title")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.title),s.xp6(2),s.Q6J("ngForOf",e.identityTitleOptions),s.xp6(7),s.Oqu(s.lcZ(18,39,"firstName")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.firstName),s.xp6(6),s.Oqu(s.lcZ(27,41,"middleName")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.middleName),s.xp6(6),s.Oqu(s.lcZ(36,43,"lastName")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.lastName),s.xp6(6),s.Oqu(s.lcZ(45,45,"username")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.username),s.xp6(6),s.Oqu(s.lcZ(54,47,"company")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.company),s.xp6(6),s.Oqu(s.lcZ(63,49,"ssn")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.ssn),s.xp6(6),s.Oqu(s.lcZ(72,51,"passportNumber")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.passportNumber),s.xp6(6),s.Oqu(s.lcZ(81,53,"licenseNumber")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.licenseNumber),s.xp6(6),s.Oqu(s.lcZ(90,55,"email")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.email),s.xp6(6),s.Oqu(s.lcZ(99,57,"phone")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.phone),s.xp6(6),s.Oqu(s.lcZ(108,59,"address1")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.address1),s.xp6(6),s.Oqu(s.lcZ(117,61,"address2")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.address2),s.xp6(6),s.Oqu(s.lcZ(126,63,"address3")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.address3),s.xp6(6),s.Oqu(s.lcZ(135,65,"cityTown")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.city),s.xp6(6),s.Oqu(s.lcZ(144,67,"stateProvince")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.state),s.xp6(6),s.Oqu(s.lcZ(153,69,"zipPostalCode")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.postalCode),s.xp6(6),s.Oqu(s.lcZ(162,71,"country")),s.xp6(3),s.Q6J("ngModel",e.cipher.identity.country)}}function nu(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e),s.xp6(1),s.Oqu(e)}}function su(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"select",116),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw().$implicit;return s.KtG(i.uri=t)})),s._uU(1,"\n "),s.TgZ(2,"option",37),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,nu,2,2,"option",24),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.oxw(),t=e.index,i=e.$implicit,n=s.oxw(4);s.MGl("id","currentUris",t,"")("name","Login.Uris[",t,"].CurrentUris"),s.Q6J("ngModel",i.uri)("hidden",!i.showCurrentUris),s.xp6(2),s.Q6J("ngValue",null),s.xp6(1),s.hij("-- ",s.lcZ(4,7,"select")," --"),s.xp6(3),s.Q6J("ngForOf",n.currentUris)}}function ou(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function ru(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",43),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(4);return s.KtG(i.toggleUriInput(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",117),s._uU(4,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.s9C("appA11yTitle",s.lcZ(1,2,"toggleCurrentUris")),s.uIk("aria-pressed",!0===e.showCurrentUris)}}function au(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",107),s.ALo(1,"i18n"),s._uU(2,"\n "),s.TgZ(3,"button",108),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.removeUri(t))})),s.ALo(4,"i18n"),s._uU(5,"\n "),s._UZ(6,"i",109),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",39),s._uU(10,"\n "),s.TgZ(11,"label",110),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"input",111),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.uri=t)})),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"label",112),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n "),s.YNc(22,su,8,9,"select",113),s._uU(23,"\n "),s.TgZ(24,"label",112),s._uU(25),s.ALo(26,"i18n"),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"select",114),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.match=t)}))("change",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.loginUriMatchChanged(t))})),s._uU(29,"\n "),s.YNc(30,ou,2,2,"option",24),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.TgZ(34,"div",42),s._uU(35,"\n "),s.YNc(36,ru,5,4,"button",48),s._uU(37,"\n "),s.TgZ(38,"button",43),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(4);return s.KtG(i.toggleUriOptions(t))})),s.ALo(39,"i18n"),s._uU(40,"\n "),s._UZ(41,"i",115),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index,n=s.oxw(4);s.uIk("aria-label",s.xi3(1,24,"uriPosition",i+1)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(4,27,"remove")),s.xp6(8),s.MGl("for","loginUri",i,""),s.xp6(1),s.Oqu(s.xi3(13,29,"uriPosition",i+1)),s.xp6(3),s.MGl("id","loginUri",i,"")("name","Login.Uris[",i,"].Uri")("placeholder","",s.lcZ(16,32,"ex")," https://google.com"),s.Q6J("ngModel",e.uri)("hidden",!0===e.showUriOptionsInput),s.xp6(3),s.MGl("for","loginUriMatch",i,""),s.xp6(1),s.AsE("\n ",s.lcZ(20,34,"currentUri")," ",i+1,"\n "),s.xp6(3),s.Q6J("ngIf",n.currentUris&&n.currentUris.length),s.xp6(2),s.MGl("for","loginUriMatch",i,""),s.xp6(1),s.AsE("\n ",s.lcZ(26,36,"matchDetection")," ",i+1,"\n "),s.xp6(3),s.MGl("id","loginUriMatch",i,"")("name","Login.Uris[",i,"].Match"),s.Q6J("ngModel",e.match)("hidden",!1===e.showOptions||null==e.showOptions&&null==e.match),s.xp6(2),s.Q6J("ngForOf",n.uriMatchOptions),s.xp6(6),s.Q6J("ngIf",n.currentUris&&n.currentUris.length),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(39,38,"toggleOptions")),s.uIk("aria-pressed",!0===e.showOptions)}}function lu(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,au,45,40,"div",106),s._uU(3,"\n "),s.BQk()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.cipher.login.uris)("ngForTrackBy",e.trackByFunction)}}function cu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"div",15),s._uU(3,"\n "),s.YNc(4,lu,4,2,"ng-container",20),s._uU(5,"\n "),s.TgZ(6,"button",104),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addUri())})),s._uU(7,"\n "),s._UZ(8,"i",105),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("ngIf",e.cipher.login.hasUris),s.xp6(5),s.hij(" ",s.lcZ(10,2,"newUri"),"\n ")}}function uu(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.hij("\n ",e.name,"\n ")}}function du(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"div",15),s._uU(3,"\n "),s.TgZ(4,"div",17),s._uU(5,"\n "),s.TgZ(6,"label",118),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"select",119),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.login.autofillOnPageLoad=t)})),s._uU(11,"\n "),s.YNc(12,uu,2,2,"option",24),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(7),s.hij("",s.lcZ(8,3,"itemAutoFillOnPageLoad")," "),s.xp6(3),s.Q6J("ngModel",e.cipher.login.autofillOnPageLoad),s.xp6(2),s.Q6J("ngForOf",e.autofillOnPageLoadOptions)}}function hu(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.id),s.xp6(1),s.Oqu(e.name)}}function pu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",25),s._uU(1,"\n "),s.TgZ(2,"label",120),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"a",121),s.ALo(6,"i18n"),s._uU(7,"\n "),s._UZ(8,"i",122),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"input",123),s.NdJ("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.repromptChanged())})),s.qZA(),s._uU(13,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"passwordPrompt"),"\n "),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(6,5,"learnMore")),s.xp6(7),s.Q6J("ngModel",e.reprompt)}}function gu(e,t){1&e&&s._UZ(0,"i",127)}function vu(e,t){1&e&&s._UZ(0,"i",128)}function yu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",124),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.attachments())})),s._uU(1,"\n "),s.TgZ(2,"div",39),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,gu,1,0,"i",125),s._uU(7,"\n "),s.YNc(8,vu,1,0,"i",126),s._uU(9,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.Oqu(s.lcZ(4,3,"attachments")),s.xp6(3),s.Q6J("ngIf",e.openAttachmentsInPopup),s.xp6(2),s.Q6J("ngIf",!e.openAttachmentsInPopup)}}function fu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",124),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.editCollections())})),s._uU(1,"\n "),s.TgZ(2,"div",39),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s._UZ(6,"i",128),s._uU(7,"\n "),s.qZA()}2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"collections")))}function mu(e,t){if(1&e&&(s.TgZ(0,"option",37),s._uU(1),s.qZA()),2&e){const e=t.$implicit;s.Q6J("ngValue",e.value),s.xp6(1),s.Oqu(e.name)}}function wu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"h2",14),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",15),s._uU(7,"\n "),s.TgZ(8,"div",17),s._uU(9,"\n "),s.TgZ(10,"label",129),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"select",130),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.cipher.organizationId=t)}))("change",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.organizationChanged())})),s._uU(15,"\n "),s.YNc(16,mu,2,2,"option",24),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,4,"ownership"),"\n "),s.xp6(8),s.Oqu(s.lcZ(12,6,"whoOwnsThisItem")),s.xp6(3),s.Q6J("ngModel",e.cipher.organizationId),s.xp6(2),s.Q6J("ngForOf",e.ownershipOptions)}}function bu(e,t){1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",132),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.hij("\n ",s.lcZ(4,1,"noCollectionsInList"),"\n "))}function Su(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",25),s._uU(1,"\n "),s.TgZ(2,"label",110),s._uU(3),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"input",134),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index;s.xp6(2),s.MGl("for","collection_",i,""),s.xp6(1),s.Oqu(e.name),s.xp6(2),s.MGl("id","collection_",i,"")("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked)}}function Uu(e,t){if(1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.YNc(2,Su,7,5,"div",133),s._uU(3,"\n "),s.qZA()),2&e){const e=s.oxw(3);s.xp6(2),s.Q6J("ngForOf",e.collections)}}function xu(e,t){if(1&e&&(s.TgZ(0,"div",13),s._uU(1,"\n "),s.TgZ(2,"h2",14),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,bu,6,3,"div",131),s._uU(7,"\n "),s.YNc(8,Uu,4,1,"div",131),s._uU(9,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"collections"),"\n "),s.xp6(3),s.Q6J("ngIf",!e.collections||!e.collections.length),s.xp6(2),s.Q6J("ngIf",e.collections&&e.collections.length)}}function Au(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",135),s._uU(1,"\n "),s.TgZ(2,"div",136),s._uU(3,"\n "),s.TgZ(4,"button",137,138),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.delete())})),s._uU(6,"\n "),s.TgZ(7,"div",139),s._uU(8,"\n "),s.TgZ(9,"div",140),s._uU(10,"\n "),s._UZ(11,"i",141),s._uU(12,"\n "),s._UZ(13,"i",142),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"span"),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA()}if(2&e){const e=s.MAs(5),t=s.oxw(2);s.xp6(4),s.Q6J("appApiAction",t.deletePromise),s.xp6(7),s.Q6J("hidden",e.loading),s.xp6(2),s.Q6J("hidden",!e.loading),s.xp6(4),s.Oqu(s.lcZ(18,4,"deleteItem"))}}function _u(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"main",11),s._uU(1,"\n "),s.YNc(2,Kc,3,3,"app-callout",12),s._uU(3,"\n "),s.TgZ(4,"div",13),s._uU(5,"\n "),s.TgZ(6,"h2",14),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"div",15),s._uU(11,"\n "),s.YNc(12,Gc,11,5,"div",16),s._uU(13,"\n "),s.TgZ(14,"div",17),s._uU(15,"\n "),s.TgZ(16,"label",18),s._uU(17),s.ALo(18,"i18n"),s.qZA(),s._uU(19,"\n "),s.TgZ(20,"input",19),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.name=t)})),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s._uU(23,"\n "),s.YNc(24,Wc,53,22,"div",20),s._uU(25,"\n "),s._uU(26,"\n "),s.YNc(27,eu,88,51,"div",20),s._uU(28,"\n "),s._uU(29,"\n "),s.YNc(30,iu,167,73,"div",20),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.YNc(34,cu,13,4,"div",21),s._uU(35,"\n "),s.YNc(36,du,17,5,"div",21),s._uU(37,"\n "),s.TgZ(38,"div",13),s._uU(39,"\n "),s.TgZ(40,"div",15),s._uU(41,"\n "),s.TgZ(42,"div",17),s._uU(43,"\n "),s.TgZ(44,"label",22),s._uU(45),s.ALo(46,"i18n"),s.qZA(),s._uU(47,"\n "),s.TgZ(48,"select",23),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.folderId=t)})),s._uU(49,"\n "),s.YNc(50,hu,2,2,"option",24),s.ALo(51,"async"),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.qZA(),s._uU(54,"\n "),s.TgZ(55,"div",25),s._uU(56,"\n "),s.TgZ(57,"label",26),s._uU(58),s.ALo(59,"i18n"),s.qZA(),s._uU(60,"\n "),s.TgZ(61,"input",27),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.favorite=t)})),s.qZA(),s._uU(62,"\n "),s.qZA(),s._uU(63,"\n "),s.YNc(64,pu,14,7,"div",28),s._uU(65,"\n "),s.YNc(66,yu,10,5,"button",29),s._uU(67,"\n "),s.YNc(68,fu,8,3,"button",29),s._uU(69,"\n "),s.qZA(),s._uU(70,"\n "),s.qZA(),s._uU(71,"\n "),s.TgZ(72,"div",13),s._uU(73,"\n "),s.TgZ(74,"h2",14),s._uU(75,"\n "),s.TgZ(76,"label",30),s._uU(77),s.ALo(78,"i18n"),s.qZA(),s._uU(79,"\n "),s.qZA(),s._uU(80,"\n "),s.TgZ(81,"div",15),s._uU(82,"\n "),s.TgZ(83,"div",17),s._uU(84,"\n "),s.TgZ(85,"textarea",31),s.NdJ("ngModelChange",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.cipher.notes=t)})),s.qZA(),s._uU(86,"\n "),s.qZA(),s._uU(87,"\n "),s.qZA(),s._uU(88,"\n "),s.qZA(),s._uU(89,"\n "),s.TgZ(90,"app-vault-add-edit-custom-fields",32),s._uU(91,"\n "),s.qZA(),s._uU(92,"\n "),s.YNc(93,wu,21,8,"div",21),s._uU(94,"\n "),s.YNc(95,xu,10,5,"div",21),s._uU(96,"\n "),s.YNc(97,Au,23,6,"div",33),s._uU(98,"\n "),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.allowOwnershipOptions()&&!e.allowPersonal),s.xp6(5),s.hij("\n ",s.lcZ(8,26,"itemInformation"),"\n "),s.xp6(5),s.Q6J("ngIf",!e.editMode),s.xp6(5),s.Oqu(s.lcZ(18,28,"name")),s.xp6(3),s.Q6J("ngModel",e.cipher.name),s.xp6(4),s.Q6J("ngIf",e.cipher.type===e.cipherType.Login),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Card),s.xp6(3),s.Q6J("ngIf",e.cipher.type===e.cipherType.Identity),s.xp6(4),s.Q6J("ngIf",e.cipher.type===e.cipherType.Login),s.xp6(2),s.Q6J("ngIf",e.showAutoFillOnPageLoadOptions),s.xp6(9),s.Oqu(s.lcZ(46,30,"folder")),s.xp6(3),s.Q6J("ngModel",e.cipher.folderId),s.xp6(2),s.Q6J("ngForOf",s.lcZ(51,32,e.folders$)),s.xp6(8),s.Oqu(s.lcZ(59,34,"favorite")),s.xp6(3),s.Q6J("ngModel",e.cipher.favorite),s.xp6(3),s.Q6J("ngIf",e.canUseReprompt),s.xp6(2),s.Q6J("ngIf",e.editMode&&e.showAttachments&&!e.cloneMode),s.xp6(2),s.Q6J("ngIf",e.editMode&&e.cipher.organizationId&&!e.cloneMode),s.xp6(9),s.Oqu(s.lcZ(78,36,"notes")),s.xp6(8),s.Q6J("ngModel",e.cipher.notes),s.xp6(5),s.Q6J("cipher",e.cipher)("thisCipherType",e.cipher.type)("editMode",e.editMode),s.xp6(3),s.Q6J("ngIf",e.allowOwnershipOptions()),s.xp6(2),s.Q6J("ngIf",(!e.editMode||e.cloneMode)&&e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.editMode&&!e.cloneMode)}}class Zu extends Tc{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g,v,y){super(e,t,i,n,s,o,r,a,d,h,y,v,g),this.route=l,this.router=c,this.location=u,this.popupUtilsService=p,this.showAttachments=!0}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return zc(this,void 0,void 0,(function*(){if(yield e.ngOnInit.call(this),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>zc(this,void 0,void 0,(function*(){if(e.cipherId&&(this.cipherId=e.cipherId),e.folderId&&(this.folderId=e.folderId),e.collectionId){const t=this.writeableCollections.find((t=>t.id===e.collectionId));null!=t&&(this.collectionIds=[t.id],this.organizationId=t.organizationId)}if(e.type){const t=parseInt(e.type,null);this.type=t}this.editMode=!e.cipherId,null!=e.cloneMode&&(this.cloneMode="true"===e.cloneMode),e.selectedVault&&(this.organizationId=e.selectedVault),yield this.load(),this.editMode&&!this.cloneMode||(this.popupUtilsService.inPopout(window)||!e.name||null!=this.cipher.name&&""!==this.cipher.name||(this.cipher.name=e.name),this.popupUtilsService.inPopout(window)||!e.uri||null!=this.cipher.login.uris[0].uri&&""!==this.cipher.login.uris[0].uri||(this.cipher.login.uris[0].uri=e.uri)),this.openAttachmentsInPopup=this.popupUtilsService.inPopup(window)})))),!this.editMode){const e=yield Wt.tabsQuery({windowType:"normal"});this.currentUris=null==e?null:e.filter((e=>null!=e.url&&""!==e.url)).map((e=>e.url))}window.setTimeout((()=>{this.editMode||(null!=this.cipher.name&&""!==this.cipher.name?document.getElementById("loginUsername").focus():document.getElementById("name").focus())}),200)}))}load(){const e=Object.create(null,{load:{get:()=>super.load}});return zc(this,void 0,void 0,(function*(){yield e.load.call(this),this.showAutoFillOnPageLoadOptions=this.cipher.type===Bl.Login&&(yield this.stateService.getEnableAutoFillOnPageLoad())}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return zc(this,void 0,void 0,(function*(){return!!(yield e.submit.call(this))&&(this.cloneMode?this.router.navigate(["/tabs/vault"]):this.location.back(),!0)}))}attachments(){if(super.attachments(),this.openAttachmentsInPopup){const e=this.router.createUrlTree(["/attachments"],{queryParams:{cipherId:this.cipher.id}}).toString(),t=window.location.href.replace(this.router.url,"");this.popupUtilsService.popOut(window,t+e)}else this.router.navigate(["/attachments"],{queryParams:{cipherId:this.cipher.id}})}editCollections(){super.editCollections(),null!=this.cipher.organizationId&&this.router.navigate(["/collections"],{queryParams:{cipherId:this.cipher.id}})}cancel(){super.cancel(),this.location.back()}generateUsername(){const e=Object.create(null,{generateUsername:{get:()=>super.generateUsername}});return zc(this,void 0,void 0,(function*(){const t=yield e.generateUsername.call(this);return t&&(yield this.saveCipherState(),this.router.navigate(["generator"],{queryParams:{type:"username"}})),t}))}generatePassword(){const e=Object.create(null,{generatePassword:{get:()=>super.generatePassword}});return zc(this,void 0,void 0,(function*(){const t=yield e.generatePassword.call(this);return t&&(yield this.saveCipherState(),this.router.navigate(["generator"],{queryParams:{type:"password"}})),t}))}delete(){const e=Object.create(null,{delete:{get:()=>super.delete}});return zc(this,void 0,void 0,(function*(){const t=yield e.delete.call(this);return t&&this.router.navigate(["/tabs/vault"]),t}))}toggleUriInput(e){const t=e;t.showCurrentUris=!t.showCurrentUris}allowOwnershipOptions(){return(!this.editMode||this.cloneMode)&&this.ownershipOptions&&(this.ownershipOptions.length>1||!this.allowPersonal)}saveCipherState(){return this.stateService.setAddEditCipherInfo({cipher:this.cipher,collectionIds:null==this.collections?[]:this.collections.filter((e=>e.checked)).map((e=>e.id))})}}Zu.ɵfac=function(e){return new(e||Zu)(s.Y36(Sc),s.Y36(ba),s.Y36(_e),s.Y36(Je),s.Y36(Uc),s.Y36(Mt),s.Y36(xc),s.Y36(qe),s.Y36(Pe.gz),s.Y36(Pe.F0),s.Y36(u.Ye),s.Y36(jr),s.Y36(Hi),s.Y36($t),s.Y36(ta),s.Y36(Ac),s.Y36(Ct))},Zu.ɵcmp=s.Xpm({type:Zu,selectors:[["app-vault-add-edit"]],features:[s.qOj],decls:34,vars:12,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button",3,"click"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1",4,"ngIf"],["tabindex","-1"],["type","info",4,"ngIf"],[1,"box"],[1,"box-header"],[1,"box-content"],["class","box-content-row","appBoxRow","",4,"ngIf"],["appBoxRow","",1,"box-content-row"],["for","name"],["id","name","type","text","name","Name",3,"ngModel","ngModelChange"],[4,"ngIf"],["class","box",4,"ngIf"],["for","folder"],["id","folder","name","FolderId",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],["for","favorite"],["id","favorite","type","checkbox","name","Favorite",3,"ngModel","ngModelChange"],["class","box-content-row box-content-row-checkbox","appBoxRow","",4,"ngIf"],["type","button","class","box-content-row box-content-row-flex text-default","appStopClick","",3,"click",4,"ngIf"],["for","notes"],["id","notes","name","Notes","rows","6",3,"ngModel","ngModelChange"],[3,"cipher","thisCipherType","editMode"],["class","box list",4,"ngIf"],["type","info"],["for","type"],["id","type","name","Type",3,"ngModel","ngModelChange"],[3,"ngValue"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","loginUsername"],["id","loginUsername","type","text","name","Login.Username","inputmode","email","appInputVerbatim","",3,"ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-generate"],["for","loginPassword"],["id","loginPassword","name","Login.Password","appInputVerbatim","",1,"monospaced",3,"type","ngModel","disabled","ngModelChange"],["type","button","class","row-btn btn",3,"appA11yTitle","appApiAction","disabled","click",4,"ngIf"],["type","button","class","row-btn","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"monospaced",3,"type","ngModel","disabled","ngModelChange"],["type","button",1,"row-btn","btn",3,"appA11yTitle","appApiAction","disabled","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"bwi","bwi-lg","bwi-check-circle",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-spinner","bwi-spin",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",3,"ngModel","ngModelChange"],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],["for","cardBrand"],["id","cardBrand","name","Card.Brand",3,"ngModel","ngModelChange"],["for","cardExpMonth"],["id","cardExpMonth","name","Card.ExpMonth",3,"ngModel","ngModelChange"],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",3,"ngModel","placeholder","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","",1,"monospaced",3,"type","ngModel","ngModelChange"],["for","idTitle"],["id","idTitle","name","Identity.Title",3,"ngModel","ngModelChange"],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",3,"ngModel","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",3,"ngModel","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",3,"ngModel","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",3,"ngModel","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","name","Identity.Email","appInputVerbatim","",3,"ngModel","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","name","Identity.Phone",3,"ngModel","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",3,"ngModel","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",3,"ngModel","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",3,"ngModel","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",3,"ngModel","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",3,"ngModel","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",3,"ngModel","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",3,"ngModel","ngModelChange"],["type","button","appStopClick","",1,"box-content-row","box-content-row-newmulti",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus-circle","bwi-fw","bwi-lg"],["role","group","class","box-content-row box-content-row-multi","appBoxRow","",4,"ngFor","ngForOf","ngForTrackBy"],["role","group","appBoxRow","",1,"box-content-row","box-content-row-multi"],["type","button","appStopClick","",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-minus-circle","bwi-lg"],[3,"for"],["type","text","inputmode","url","appInputVerbatim","",3,"id","name","ngModel","hidden","placeholder","ngModelChange"],[1,"sr-only",3,"for"],[3,"id","name","ngModel","hidden","ngModelChange",4,"ngIf"],[3,"id","name","ngModel","hidden","ngModelChange","change"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-cog"],[3,"id","name","ngModel","hidden","ngModelChange"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-list"],["for","autofillOnPageLoad"],["id","autofillOnPageLoad","name","AutofillOnPageLoad",3,"ngModel","ngModelChange"],["for","passwordPrompt"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/managing-items/#protect-individual-items",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","passwordPrompt","type","checkbox","name","PasswordPrompt",3,"ngModel","change"],["type","button","appStopClick","",1,"box-content-row","box-content-row-flex","text-default",3,"click"],["class","bwi bwi-external-link bwi-lg bwi-fw","aria-hidden","true",4,"ngIf"],["class","bwi bwi-angle-right row-sub-icon","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-external-link","bwi-lg","bwi-fw"],["aria-hidden","true",1,"bwi","bwi-angle-right","row-sub-icon"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","ngModelChange","change"],["class","box-content",4,"ngIf"],[1,"box-content-row","padded","no-hover"],["class","box-content-row box-content-row-checkbox","appBoxRow","",4,"ngFor","ngForOf"],["type","checkbox",3,"id","ngModel","name","ngModelChange"],[1,"box","list"],[1,"box-content","single-line"],["type","button","appStopClick","",1,"box-content-row",3,"appApiAction","click"],["deleteBtn",""],[1,"row-main","text-danger"],["aria-hidden","true",1,"icon","text-danger"],[1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],[1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s.NdJ("click",(function(){return t.cancel()})),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"div",6),s._uU(19,"\n "),s.TgZ(20,"button",7),s._uU(21,"\n "),s.TgZ(22,"span",8),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s._UZ(26,"i",9),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.YNc(31,_u,99,38,"main",10),s._uU(32,"\n"),s.qZA(),s._uU(33,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,8,"cancel")),s.xp6(7),s.Oqu(t.title),s.xp6(5),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(24,10,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(5),s.Q6J("ngIf",t.cipher)}},dependencies:[u.mk,u.sg,u.O5,ue._Y,ue.YN,ue.Kr,ue.Fj,ue.Wl,ue.EJ,ue.JJ,ue.JL,ue.On,ue.F,Ht,Ot,Xe,wt,bt,St,Yc,u.Ov,u.uU,Ze],encapsulation:2});var Tu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Cu{constructor(e){this.buffer=e,this.encryptionType=null,this.dataBytes=null,this.ivBytes=null,this.macBytes=null;const t=new Uint8Array(e),i=t[0];switch(i){case je.AesCbc128_HmacSha256_B64:case je.AesCbc256_HmacSha256_B64:{const e=50;t.length1&&(i+=e.slice(1)),void 0===t[e=i]&&(e=e.toLowerCase()),void 0===t[e]&&(e=e.toUpperCase())}return t[e]}}class Ou extends ku{constructor(e,t,i){var n,s;super(e);let o=null;if(null!=e){const t=this.getResponseProperty("ErrorModel");o=t&&i?t:e}429===t?this.message="Rate limit exceeded. Try again later.":o&&(this.message=this.getResponseProperty("Message",o),this.validationErrors=this.getResponseProperty("ValidationErrors",o),this.captchaSiteKey=null===(s=null===(n=this.validationErrors)||void 0===n?void 0:n.HCaptcha_SiteKey)||void 0===s?void 0:s[0],this.captchaRequired=!nt.isNullOrWhitespace(this.captchaSiteKey)),this.statusCode=t}getSingleMessage(){if(null==this.validationErrors)return this.message;for(const e in this.validationErrors)if(this.validationErrors.hasOwnProperty(e)&&this.validationErrors[e].length)return this.validationErrors[e][0];return this.message}getAllMessages(){const e=[];if(null==this.validationErrors)return e;for(const t in this.validationErrors)this.validationErrors.hasOwnProperty(t)&&this.validationErrors[t].forEach((i=>{let n="";if(t.indexOf("[")>-1&&t.indexOf("]")>-1){const e=t.lastIndexOf(".");n=t.substr(0,e>-1?e:t.length)+": "}e.push(n+i)}));return e}}var Pu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Iu{constructor(e,t,i,n,o,r,a,l,c){this.cipherService=e,this.i18nService=t,this.cryptoService=i,this.platformUtilsService=n,this.apiService=o,this.win=r,this.logService=a,this.stateService=l,this.fileDownloadService=c,this.onUploadedAttachment=new s.vpe,this.onDeletedAttachment=new s.vpe,this.onReuploadedAttachment=new s.vpe,this.deletePromises={},this.reuploadPromises={},this.emergencyAccessId=null}ngOnInit(){return Pu(this,void 0,void 0,(function*(){yield this.init()}))}submit(){return Pu(this,void 0,void 0,(function*(){if(!this.hasUpdatedKey)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("updateKey"));const e=document.getElementById("file"),t=e.files;if(null!=t&&0!==t.length)if(t[0].size>524288e3)this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize"));else{try{this.formPromise=this.saveCipherAttachment(t[0]),this.cipherDomain=yield this.formPromise,this.cipher=yield this.cipherDomain.decrypt(),this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onUploadedAttachment.emit()}catch(e){this.logService.error(e)}e.type="",e.type="file",e.value=""}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile"))}))}delete(e){return Pu(this,void 0,void 0,(function*(){if(null!=this.deletePromises[e.id])return;if(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteAttachmentConfirmation"),this.i18nService.t("deleteAttachment"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")){try{this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),yield this.deletePromises[e.id],this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedAttachment"));const t=this.cipher.attachments.indexOf(e);t>-1&&this.cipher.attachments.splice(t,1)}catch(e){this.logService.error(e)}this.deletePromises[e.id]=null,this.onDeletedAttachment.emit()}}))}download(e){return Pu(this,void 0,void 0,(function*(){const t=e;if(t.downloading)return;if(!this.canAccessAttachments)return void this.platformUtilsService.showToast("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc"));let i;try{i=(yield this.apiService.getAttachmentData(this.cipher.id,e.id,this.emergencyAccessId)).url}catch(t){if(!(t instanceof Ou&&404===t.statusCode))throw t instanceof Ou?new Error(t.getSingleMessage()):t;i=e.url}t.downloading=!0;const n=yield fetch(new Request(i,{cache:"no-store"}));if(200!==n.status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),void(t.downloading=!1);try{const t=yield Cu.fromResponse(n),i=null!=e.key?e.key:yield this.cryptoService.getOrgKey(this.cipher.organizationId),s=yield this.cryptoService.decryptFromBytes(t,i);this.fileDownloadService.download({fileName:e.fileName,blobData:s})}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}t.downloading=!1}))}init(){return Pu(this,void 0,void 0,(function*(){this.cipherDomain=yield this.loadCipher(),this.cipher=yield this.cipherDomain.decrypt(),this.hasUpdatedKey=yield this.cryptoService.hasEncKey();const e=yield this.stateService.getCanAccessPremium();if(this.canAccessAttachments=e||null!=this.cipher.organizationId,this.canAccessAttachments){if(!this.hasUpdatedKey){(yield this.platformUtilsService.showDialog(this.i18nService.t("updateKey"),this.i18nService.t("featureUnavailable"),this.i18nService.t("learnMore"),this.i18nService.t("cancel"),"warning"))&&this.platformUtilsService.launchUri("https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key")}}else{(yield this.platformUtilsService.showDialog(this.i18nService.t("premiumRequiredDesc"),this.i18nService.t("premiumRequired"),this.i18nService.t("learnMore"),this.i18nService.t("cancel")))&&this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=purchase")}}))}reuploadCipherAttachment(e,t){return Pu(this,void 0,void 0,(function*(){const i=e;if(null==e.key&&!i.downloading&&null==this.reuploadPromises[e.id])try{this.reuploadPromises[e.id]=Promise.resolve().then((()=>Pu(this,void 0,void 0,(function*(){i.downloading=!0;const n=yield fetch(new Request(e.url,{cache:"no-store"}));if(200!==n.status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),void(i.downloading=!1);try{const i=yield Cu.fromResponse(n),s=null!=e.key?e.key:yield this.cryptoService.getOrgKey(this.cipher.organizationId),o=yield this.cryptoService.decryptFromBytes(i,s);this.cipherDomain=yield this.cipherService.saveAttachmentRawWithServer(this.cipherDomain,e.fileName,o,t),this.cipher=yield this.cipherDomain.decrypt(),this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),yield this.deletePromises[e.id];const r=this.cipher.attachments.filter((t=>t.id===e.id));if(r.length>0){const e=this.cipher.attachments.indexOf(r[0]);e>-1&&this.cipher.attachments.splice(e,1)}this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onReuploadedAttachment.emit()}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}i.downloading=!1})))),yield this.reuploadPromises[e.id]}catch(e){this.logService.error(e)}}))}loadCipher(){return this.cipherService.get(this.cipherId)}saveCipherAttachment(e){return this.cipherService.saveAttachmentWithServer(this.cipherDomain,e)}deleteCipherAttachment(e){return this.cipherService.deleteAttachmentWithServer(this.cipher.id,e)}}Iu.ɵfac=function(e){return new(e||Iu)(s.Y36(Sc),s.Y36(_e),s.Y36(zt),s.Y36(Je),s.Y36(Tt),s.Y36(Window),s.Y36(Ct),s.Y36(Mt),s.Y36($r))},Iu.ɵdir=s.lG2({type:Iu,inputs:{cipherId:"cipherId"},outputs:{onUploadedAttachment:"onUploadedAttachment",onDeletedAttachment:"onDeletedAttachment",onReuploadedAttachment:"onReuploadedAttachment"}});var qu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Du(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",19),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.close())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"close"),"\n "))}function Mu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",19),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.back())})),s._uU(1,"\n "),s.TgZ(2,"span",20),s._UZ(3,"i",21),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"span"),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.qZA()}2&e&&(s.xp6(6),s.Oqu(s.lcZ(7,1,"back")))}function Fu(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",23),s._uU(1,"\n "),s.TgZ(2,"div",24),s._uU(3),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"small",25),s._uU(6),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",26),s._uU(9,"\n "),s.TgZ(10,"button",27,28),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.delete(t))})),s.ALo(12,"i18n"),s._uU(13,"\n "),s._UZ(14,"i",29),s._uU(15,"\n "),s._UZ(16,"i",30),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.MAs(11),n=s.oxw(2);s.xp6(3),s.hij("\n ",e.fileName,"\n "),s.xp6(3),s.Oqu(e.sizeName),s.xp6(4),s.s9C("appA11yTitle",s.lcZ(12,7,"deleteAttachment")),s.Q6J("appApiAction",n.deletePromises[e.id])("disabled",i.loading),s.xp6(4),s.Q6J("hidden",i.loading),s.xp6(2),s.Q6J("hidden",!i.loading)}}function Nu(e,t){if(1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"div",14),s._uU(3,"\n "),s.YNc(4,Fu,20,9,"div",22),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.cipher.attachments)}}class Lu extends Iu{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,n,s,window,l,a,c),this.location=o,this.route=r}ngOnInit(){return qu(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>qu(this,void 0,void 0,(function*(){this.cipherId=e.cipherId,yield this.init()})))),this.openedAttachmentsInPopup=1===history.length}))}back(){this.location.back()}close(){window.close()}}Lu.ɵfac=function(e){return new(e||Lu)(s.Y36(Sc),s.Y36(_e),s.Y36(zt),s.Y36(Je),s.Y36(Tt),s.Y36(u.Ye),s.Y36(Pe.gz),s.Y36(Mt),s.Y36(Ct),s.Y36($r))},Lu.ɵcmp=s.Xpm({type:Lu,selectors:[["app-vault-attachments"]],features:[s.qOj],decls:61,vars:22,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button",3,"click",4,"ngIf"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],["class","box",4,"ngIf"],[1,"box"],[1,"box-header"],[1,"box-content","no-hover"],[1,"box-content-row"],["for","file"],["type","file","id","file","name","file","required",""],[1,"box-footer"],["type","button",3,"click"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],["class","box-content-row box-content-row-flex",4,"ngFor","ngForOf"],[1,"box-content-row","box-content-row-flex"],[1,"row-main"],[1,"row-sub-label"],[1,"action-buttons","no-pad"],["type","button","type","button","appStopClick","",1,"row-btn","btn",3,"appA11yTitle","appApiAction","disabled","click"],["deleteBtn",""],["aria-hidden","true",1,"bwi","bwi-trash","bwi-lg","bwi-fw",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-lg","bwi-fw",3,"hidden"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.YNc(7,Du,3,3,"button",3),s._uU(8,"\n "),s.YNc(9,Mu,9,3,"button",3),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.TgZ(21,"button",7),s._uU(22,"\n "),s.TgZ(23,"span",8),s._uU(24),s.ALo(25,"i18n"),s.qZA(),s._uU(26,"\n "),s._UZ(27,"i",9),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.TgZ(32,"main",10),s._uU(33,"\n "),s.YNc(34,Nu,7,1,"div",11),s._uU(35,"\n "),s.TgZ(36,"div",12),s._uU(37,"\n "),s.TgZ(38,"h2",13),s._uU(39),s.ALo(40,"i18n"),s.qZA(),s._uU(41,"\n "),s.TgZ(42,"div",14),s._uU(43,"\n "),s.TgZ(44,"div",15),s._uU(45,"\n "),s.TgZ(46,"label",16),s._uU(47),s.ALo(48,"i18n"),s.qZA(),s._uU(49,"\n "),s._UZ(50,"input",17),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.TgZ(54,"div",18),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.qZA(),s._uU(59,"\n"),s.qZA(),s._uU(60,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(7),s.Q6J("ngIf",t.openedAttachmentsInPopup),s.xp6(2),s.Q6J("ngIf",!t.openedAttachmentsInPopup),s.xp6(6),s.Oqu(s.lcZ(16,12,"attachments")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(25,14,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(7),s.Q6J("ngIf",t.cipher&&t.cipher.hasAttachments),s.xp6(5),s.hij("\n ",s.lcZ(40,16,"newAttachment"),"\n "),s.xp6(8),s.Oqu(s.lcZ(48,18,"file")),s.xp6(8),s.hij("\n ",s.lcZ(56,20,"maxFileSize"),"\n ")}},dependencies:[u.sg,u.O5,ue._Y,ue.JL,ue.F,Ht,Ot,St,Ze],encapsulation:2});var Eu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ru{constructor(e){this.searchService=e,this.activeCipherId=null,this.onCipherClicked=new s.vpe,this.onCipherRightClicked=new s.vpe,this.onAddCipher=new s.vpe,this.onAddCipherOptions=new s.vpe,this.loaded=!1,this.ciphers=[],this.searchPlaceholder=null,this.filter=null,this.deleted=!1,this.searchPending=!1,this.searchTimeout=null,this.deletedFilter=e=>e.isDeleted===this.deleted}load(e=null,t=!1){return Eu(this,void 0,void 0,(function*(){this.deleted=t||!1,yield this.applyFilter(e),this.loaded=!0}))}reload(e=null,t=!1){return Eu(this,void 0,void 0,(function*(){this.loaded=!1,yield this.load(e,t)}))}refresh(){return Eu(this,void 0,void 0,(function*(){yield this.reload(this.filter,this.deleted)}))}applyFilter(e=null){return Eu(this,void 0,void 0,(function*(){this.filter=e,yield this.search(null)}))}search(e=null,t){return Eu(this,void 0,void 0,(function*(){this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout),null!=e?(this.searchPending=!0,this.searchTimeout=setTimeout((()=>Eu(this,void 0,void 0,(function*(){yield this.doSearch(t),this.searchPending=!1}))),e)):yield this.doSearch(t)}))}selectCipher(e){this.onCipherClicked.emit(e)}rightClickCipher(e){this.onCipherRightClicked.emit(e)}addCipher(){this.onAddCipher.emit()}addCipherOptions(){this.onAddCipherOptions.emit()}isSearching(){return!this.searchPending&&this.searchService.isSearchable(this.searchText)}doSearch(e){return Eu(this,void 0,void 0,(function*(){this.ciphers=yield this.searchService.searchCiphers(this.searchText,[this.filter,this.deletedFilter],e)}))}}Ru.ɵfac=function(e){return new(e||Ru)(s.Y36(jo))},Ru.ɵdir=s.lG2({type:Ru,inputs:{activeCipherId:"activeCipherId"},outputs:{onCipherClicked:"onCipherClicked",onCipherRightClicked:"onCipherRightClicked",onAddCipher:"onAddCipher",onAddCipherOptions:"onAddCipherOptions"}});class Ju{constructor(e){this.selectedCollection=!1,this.selectedFolder=!1,this.myVaultOnly=!1,this.refreshCollectionsAndFolders=!1,Object.assign(this,e)}resetFilter(){this.cipherType=null,this.status=null,this.selectedCollection=!1,this.selectedCollectionId=null,this.selectedFolder=!1,this.selectedFolderId=null}resetOrganization(){this.myVaultOnly=!1,this.selectedOrganizationId=null,this.resetFilter()}buildFilter(){return e=>{let t=!0;return"favorites"===this.status&&t&&(t=e.favorite),"trash"===this.status&&t&&(t=e.isDeleted),null!=this.cipherType&&t&&(t=e.type===this.cipherType),this.selectedFolder&&null==this.selectedFolderId&&t&&(t=null==e.folderId),this.selectedFolder&&null!=this.selectedFolderId&&t&&(t=e.folderId===this.selectedFolderId),this.selectedCollection&&null==this.selectedCollectionId&&t&&(t=null!=e.organizationId&&(null==e.collectionIds||0===e.collectionIds.length)),this.selectedCollection&&null!=this.selectedCollectionId&&t&&(t=null!=e.collectionIds&&e.collectionIds.includes(this.selectedCollectionId)),null!=this.selectedOrganizationId&&t&&(t=e.organizationId===this.selectedOrganizationId),this.myVaultOnly&&t&&(t=null===e.organizationId),t}}}var Yu=i(47575),zu=i(80986),Ku=i(62858);class Bu{constructor(e,t,i){this.children=[],this.parent=i,this.node=e,this.node.name=t}}class Gu{static nestedTraverse(e,t,i,n,s,o){if(i.length<=t)return;const r=t===i.length-1,a=i[t];for(let l=0;le.node.name===a)).length){if(r)return void e.push(new Bu(n,a,s));const l=i[t]+o+i[t+1];Gu.nestedTraverse(e,0,[l,...i.slice(t+2)],n,s,o)}}static getTreeNodeObject(e,t){for(let i=0;it.id===e)).length>0}}var Vu=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hu{constructor(e,t,i,n,s,o){this.stateService=e,this.organizationService=t,this.folderService=i,this.cipherService=n,this.collectionService=s,this.policyService=o}storeCollapsedFilterNodes(e){return Vu(this,void 0,void 0,(function*(){yield this.stateService.setCollapsedGroupings(Array.from(e))}))}buildCollapsedFilterNodes(){return Vu(this,void 0,void 0,(function*(){return new Set(yield this.stateService.getCollapsedGroupings())}))}buildOrganizations(){return Vu(this,void 0,void 0,(function*(){return yield this.organizationService.getAll()}))}buildNestedFolders(e){const t=t=>Vu(this,void 0,void 0,(function*(){let i;if(null!=e){const n=yield this.cipherService.getAllDecrypted(),s=n.filter((t=>t.organizationId==e));i=t.filter((e=>s.filter((t=>t.folderId==e.id)).length>0||n.filter((t=>t.folderId==e.id)).length<1))}else i=t;const n=yield this.getAllFoldersNested(i);return new Qu({fullList:i,nestedList:n})}));return this.folderService.folderViews$.pipe((0,Yu.z)((e=>(0,zu.D)(t(e)))))}buildCollections(e){return Vu(this,void 0,void 0,(function*(){const t=yield this.collectionService.getAllDecrypted();let i;i=null!=e?t.filter((t=>t.organizationId===e)):t;const n=yield this.collectionService.getAllNested(i);return new Qu({fullList:i,nestedList:n})}))}checkForSingleOrganizationPolicy(){return Vu(this,void 0,void 0,(function*(){return yield this.policyService.policyAppliesToUser(qs.SingleOrg)}))}checkForPersonalOwnershipPolicy(){return Vu(this,void 0,void 0,(function*(){return yield this.policyService.policyAppliesToUser(qs.PersonalOwnership)}))}getAllFoldersNested(e){return Vu(this,void 0,void 0,(function*(){const t=[];return e.forEach((e=>{const i=new wa;i.id=e.id,i.revisionDate=e.revisionDate;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split("/"):[];Gu.nestedTraverse(t,0,n,i,null,"/")})),t}))}getFolderNested(e){return Vu(this,void 0,void 0,(function*(){const t=yield this.getAllFoldersNested(yield(0,Ku.z)(this.folderService.folderViews$));return Gu.getTreeNodeObject(t,e)}))}}Hu.ɵfac=function(e){return new(e||Hu)(s.LFG(Mt),s.LFG(ta),s.LFG(ba),s.LFG(Sc),s.LFG(xc),s.LFG(Hi))},Hu.ɵprov=s.Yz7({token:Hu,factory:Hu.ɵfac});class ju extends Hu{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.vaultFilter=new Ju,this.allVaults="allVaults",this.myVault="myVault",this.vaultFilter.myVaultOnly=!1,this.vaultFilter.selectedOrganizationId=null}getVaultFilter(){return this.vaultFilter}setVaultFilter(e){e===this.allVaults?(this.vaultFilter.myVaultOnly=!1,this.vaultFilter.selectedOrganizationId=null):e===this.myVault?(this.vaultFilter.myVaultOnly=!0,this.vaultFilter.selectedOrganizationId=null):(this.vaultFilter.myVaultOnly=!1,this.vaultFilter.selectedOrganizationId=e)}clear(){this.setVaultFilter(this.allVaults)}filterCipherForSelectedVault(e){if(!this.vaultFilter.selectedOrganizationId&&!this.vaultFilter.myVaultOnly)return!1;if(this.vaultFilter.selectedOrganizationId){if(e.organizationId===this.vaultFilter.selectedOrganizationId)return!1}else if(this.vaultFilter.myVaultOnly&&!e.organizationId)return!1;return!0}}class Wu{constructor(e){this.el=e}onError(){this.el.nativeElement.src=this.appFallbackSrc}}Wu.ɵfac=function(e){return new(e||Wu)(s.Y36(s.SBq))},Wu.ɵdir=s.lG2({type:Wu,selectors:[["","appFallbackSrc",""]],hostBindings:function(e,t){1&e&&s.NdJ("error",(function(){return t.onError()}))},inputs:{appFallbackSrc:"appFallbackSrc"}});var $u=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Xu(e,t){if(1&e&&s._UZ(0,"img",3),2&e){const e=s.oxw();s.s9C("appFallbackSrc",e.fallbackImage),s.Q6J("src",e.image,s.LSH)}}function ed(e,t){if(1&e&&s._UZ(0,"i"),2&e){const e=s.oxw();s.Gre("bwi bwi-fw bwi-lg ",e.icon,"")}}const td={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",Mir:"card-mir"};class id{constructor(e,t){this.stateService=t,this.iconsUrl=e.getIconsUrl()}ngOnChanges(){return $u(this,void 0,void 0,(function*(){this.image=null,this.fallbackImage=null,this.imageEnabled=!(yield this.stateService.getDisableFavicon()),this.load()}))}load(){switch(this.cipher.type){case Bl.Login:this.icon="bwi-globe",this.setLoginIcon();break;case Bl.SecureNote:this.icon="bwi-sticky-note";break;case Bl.Card:this.icon="bwi-credit-card",this.setCardIcon();break;case Bl.Identity:this.icon="bwi-id-card"}}setLoginIcon(){if(this.cipher.login.uri){let e=this.cipher.login.uri,t=!1;if(0===e.indexOf("androidapp://")?(this.icon="bwi-android",this.image=null):0===e.indexOf("iosapp://")?(this.icon="bwi-apple",this.image=null):this.imageEnabled&&-1===e.indexOf("://")&&e.indexOf(".")>-1?(e="http://"+e,t=!0):this.imageEnabled&&(t=0===e.indexOf("http")&&e.indexOf(".")>-1),this.imageEnabled&&t)try{this.image=this.iconsUrl+"/"+nt.getHostname(e)+"/icon.png",this.fallbackImage="images/bwi-globe.png"}catch(e){}}else this.image=null}setCardIcon(){const e=this.cipher.card.brand;this.imageEnabled&&e in td&&(this.icon="credit-card-icon "+td[e])}}id.ɵfac=function(e){return new(e||id)(s.Y36(Ye),s.Y36(Mt))},id.ɵcmp=s.Xpm({type:id,selectors:[["app-vault-icon"]],inputs:{cipher:"cipher"},features:[s.TTD],decls:7,vars:2,consts:[["aria-hidden","true",1,"icon"],["alt","","decoding","async","loading","lazy",3,"src","appFallbackSrc",4,"ngIf"],[3,"class",4,"ngIf"],["alt","","decoding","async","loading","lazy",3,"src","appFallbackSrc"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.YNc(2,Xu,1,2,"img",1),s._uU(3,"\n "),s.YNc(4,ed,1,3,"i",2),s._uU(5,"\n"),s.qZA(),s._uU(6,"\n")),2&e&&(s.xp6(2),s.Q6J("ngIf",t.imageEnabled&&t.image),s.xp6(2),s.Q6J("ngIf",!t.imageEnabled||!t.image))},dependencies:[u.O5,Wu],encapsulation:2});var nd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function sd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",2),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.view())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",3),s._uU(4,"\n"),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"view"))}const od=function(e){return{disabled:e}};function rd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.launchCipher())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",9),s._uU(4,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.s9C("appA11yTitle",s.lcZ(1,3,"launch")),s.Q6J("ngClass",s.VKq(5,od,!e.cipher.login.canLaunch)),s.uIk("disabled",e.cipher.login.canLaunch?null:"")}}function ad(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.YNc(2,rd,5,7,"button",4),s._uU(3,"\n "),s.TgZ(4,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.login.username,"username","Username"))})),s.ALo(5,"i18n"),s._uU(6,"\n "),s._UZ(7,"i",6),s._uU(8,"\n "),s.qZA(),s._uU(9,"\n "),s.TgZ(10,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.login.password,"password","Password"))})),s.ALo(11,"i18n"),s._uU(12,"\n "),s._UZ(13,"i",7),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.login.totp,"verificationCodeTotp","TOTP"))})),s.ALo(17,"i18n"),s._uU(18,"\n "),s._UZ(19,"i",8),s._uU(20,"\n "),s.qZA(),s._uU(21,"\n"),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.showView),s.xp6(2),s.s9C("appA11yTitle",s.lcZ(5,10,"copyUsername")),s.Q6J("ngClass",s.VKq(16,od,!e.cipher.login.username)),s.uIk("disabled",e.cipher.login.username?null:""),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(11,12,"copyPassword")),s.Q6J("ngClass",s.VKq(18,od,!e.cipher.login.password||!e.cipher.viewPassword)),s.uIk("disabled",e.cipher.login.password?null:""),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(17,14,"copyVerificationCode")),s.Q6J("ngClass",s.VKq(20,od,!e.displayTotpCopyButton(e.cipher))),s.uIk("disabled",e.displayTotpCopyButton(e.cipher)?null:"")}}function ld(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.card.number,"number","Card Number"))})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",10),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.card.code,"securityCode","Security Code"))})),s.ALo(9,"i18n"),s._uU(10,"\n "),s._UZ(11,"i",7),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n"),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,6,"copyNumber")),s.Q6J("ngClass",s.VKq(10,od,!e.cipher.card.number)),s.uIk("disabled",e.cipher.card.number?null:""),s.xp6(6),s.s9C("appA11yTitle",s.lcZ(9,8,"copySecurityCode")),s.Q6J("ngClass",s.VKq(12,od,!e.cipher.card.code)),s.uIk("disabled",e.cipher.card.code?null:"")}}function cd(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"button",5),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.copy(t.cipher,t.cipher.notes,"note","Note"))})),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",11),s._uU(6,"\n "),s.qZA(),s._uU(7,"\n"),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.s9C("appA11yTitle",s.lcZ(3,3,"copyNote")),s.Q6J("ngClass",s.VKq(5,od,!e.cipher.notes)),s.uIk("disabled",e.cipher.notes?null:"")}}class ud{constructor(e,t,i,n,o,r){this.i18nService=e,this.platformUtilsService=t,this.eventService=i,this.totpService=n,this.stateService=o,this.passwordRepromptService=r,this.onView=new s.vpe,this.launchEvent=new s.vpe,this.showView=!1,this.cipherType=Bl,this.userHasPremiumAccess=!1}ngOnInit(){return nd(this,void 0,void 0,(function*(){this.userHasPremiumAccess=yield this.stateService.getCanAccessPremium()}))}launchCipher(){this.launchEvent.emit(this.cipher)}copy(e,t,i,n){return nd(this,void 0,void 0,(function*(){this.cipher.reprompt!==Kl.None&&this.passwordRepromptService.protectedFields().includes(n)&&!(yield this.passwordRepromptService.showPasswordPrompt())||null==t||"TOTP"===n&&!this.displayTotpCopyButton(e)||("TOTP"===n&&(t=yield this.totpService.getCode(t)),e.viewPassword&&(this.platformUtilsService.copyToClipboard(t,{window}),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(i))),"password"===i||"verificationCodeTotp"===i?this.eventService.collect(Gr.Cipher_ClientToggledHiddenFieldVisible,e.id):"securityCode"===i&&this.eventService.collect(Gr.Cipher_ClientCopiedCardCode,e.id)))}))}displayTotpCopyButton(e){var t,i;return null!==(i=null===(t=null==e?void 0:e.login)||void 0===t?void 0:t.hasTotp)&&void 0!==i&&i&&(e.organizationUseTotp||this.userHasPremiumAccess)}view(){this.onView.emit(this.cipher)}}function dd(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",10),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",11),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"shared")),s.xp6(4),s.Oqu(s.lcZ(7,4,"shared")))}function hd(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s._UZ(2,"i",12),s.ALo(3,"i18n"),s._uU(4,"\n "),s.TgZ(5,"span",11),s._uU(6),s.ALo(7,"i18n"),s.qZA(),s._uU(8,"\n "),s.BQk()),2&e&&(s.xp6(2),s.s9C("title",s.lcZ(3,2,"attachments")),s.xp6(4),s.Oqu(s.lcZ(7,4,"attachments")))}ud.ɵfac=function(e){return new(e||ud)(s.Y36(_e),s.Y36(Je),s.Y36(jr),s.Y36(Ma),s.Y36(Mt),s.Y36(Ac))},ud.ɵcmp=s.Xpm({type:ud,selectors:[["app-action-buttons"]],inputs:{cipher:"cipher",showView:"showView"},outputs:{onView:"onView",launchEvent:"launchEvent"},decls:8,vars:4,consts:[["type","button","class","row-btn","appStopClick","","appStopProp","",3,"appA11yTitle","click",4,"ngIf"],[4,"ngIf"],["type","button","appStopClick","","appStopProp","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-list-alt"],["type","button","class","row-btn","appStopClick","","appStopProp","",3,"appA11yTitle","ngClass","click",4,"ngIf"],["type","button","appStopClick","","appStopProp","",1,"row-btn",3,"appA11yTitle","ngClass","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-user"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-key"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clock"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-share-square"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-hashtag"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"]],template:function(e,t){1&e&&(s.YNc(0,sd,5,3,"button",0),s._uU(1,"\n"),s.YNc(2,ad,22,22,"ng-container",1),s._uU(3,"\n"),s.YNc(4,ld,14,14,"ng-container",1),s._uU(5,"\n"),s.YNc(6,cd,8,7,"ng-container",1),s._uU(7,"\n")),2&e&&(s.Q6J("ngIf",t.showView),s.xp6(2),s.Q6J("ngIf",t.cipher.type===t.cipherType.Login),s.xp6(2),s.Q6J("ngIf",t.cipher.type===t.cipherType.Card),s.xp6(2),s.Q6J("ngIf",t.cipher.type===t.cipherType.SecureNote))},dependencies:[u.mk,u.O5,Ht,St,Xo,Ze],encapsulation:2});const pd=function(e){return{"override-last":e}};class gd{constructor(){this.onSelected=new s.vpe,this.launchEvent=new s.vpe,this.onView=new s.vpe,this.showView=!1}selectCipher(e){this.onSelected.emit(e)}launchCipher(e){this.launchEvent.emit(e)}viewCipher(e){this.onView.emit(e)}}gd.ɵfac=function(e){return new(e||gd)},gd.ɵcmp=s.Xpm({type:gd,selectors:[["app-cipher-row"]],inputs:{cipher:"cipher",last:"last",showView:"showView",title:"title"},outputs:{onSelected:"onSelected",launchEvent:"launchEvent",onView:"onView"},decls:30,vars:13,consts:[["role","group",1,"box-content-row","box-content-row-flex","virtual-scroll-item",3,"appA11yTitle","ngClass"],["type","button","appStopClick","",1,"row-main",3,"title","click","dblclick"],[3,"cipher"],[1,"row-main-content"],[1,"text"],[1,"truncate-box"],[1,"truncate"],[4,"ngIf"],[1,"detail"],[1,"action-buttons",3,"cipher","showView","onView","launchEvent"],["aria-hidden","true",1,"bwi","bwi-collection","text-muted",3,"title"],[1,"sr-only"],["aria-hidden","true",1,"bwi","bwi-paperclip","text-muted",3,"title"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"button",1),s.NdJ("click",(function(){return t.selectCipher(t.cipher)}))("dblclick",(function(){return t.launchCipher(t.cipher)})),s._uU(3,"\n "),s._UZ(4,"app-vault-icon",2),s._uU(5,"\n "),s.TgZ(6,"div",3),s._uU(7,"\n "),s.TgZ(8,"span",4),s._uU(9,"\n "),s.TgZ(10,"span",5),s._uU(11,"\n "),s.TgZ(12,"span",6),s._uU(13),s.qZA(),s._uU(14,"\n "),s.YNc(15,dd,9,6,"ng-container",7),s._uU(16,"\n "),s.YNc(17,hd,9,6,"ng-container",7),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"span",8),s._uU(22),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.TgZ(26,"app-action-buttons",9),s.NdJ("onView",(function(){return t.viewCipher(t.cipher)}))("launchEvent",(function(){return t.launchCipher(t.cipher)})),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n"),s.qZA(),s._uU(29,"\n")),2&e&&(s.s9C("appA11yTitle",t.cipher.name),s.Q6J("ngClass",s.VKq(11,pd,!t.last)),s.xp6(2),s.hYB("title","",t.title," - ",t.cipher.name,""),s.xp6(2),s.Q6J("cipher",t.cipher),s.xp6(9),s.Oqu(t.cipher.name),s.xp6(2),s.Q6J("ngIf",t.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",t.cipher.hasAttachments),s.xp6(5),s.Oqu(t.cipher.subTitle),s.xp6(4),s.Q6J("cipher",t.cipher)("showView",t.showView))},dependencies:[u.mk,u.O5,Ht,id,St,ud,Ze],encapsulation:2});var vd=i(5645);class yd{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)}}yd.ɵfac=function(e){return new(e||yd)},yd.ɵpipe=s.Yjl({name:"ellipsis",type:yd,pure:!0});var fd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const md=["toggleVaults"],wd=["vaultSelectorTemplate"];function bd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.selectMyVault())})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",13),s._uU(5),s.ALo(6,"i18n"),s.qZA()}2&e&&(s.hYB("appA11yTitle","",s.lcZ(1,3,"vault"),": ",s.lcZ(2,5,"myVault"),""),s.xp6(5),s.hij("\n  ",s.lcZ(6,7,"myVault"),"\n "))}function Sd(e,t){1&e&&s._UZ(0,"i",17)}function Ud(e,t){1&e&&s._UZ(0,"i",18)}function xd(e,t){1&e&&(s._UZ(0,"i",19),s.ALo(1,"i18n"),s.ALo(2,"i18n")),2&e&&(s.s9C("aria-label",s.lcZ(1,2,"organizationIsDisabled")),s.s9C("appA11yTitle",s.lcZ(2,4,"organizationIsDisabled")))}function Ad(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",12),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectOrganization(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.YNc(3,Sd,1,0,"i",14),s._uU(4,"\n "),s.YNc(5,Ud,1,0,"i",15),s._uU(6,"\n "),s.TgZ(7,"span"),s._uU(8),s.ALo(9,"ellipsis"),s.qZA(),s._uU(10,"\n "),s.YNc(11,xd,3,6,"i",16),s._uU(12,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.hYB("appA11yTitle","",s.lcZ(1,6,"vault"),": ",e.name,""),s.xp6(3),s.Q6J("ngIf",1!==e.planProductType),s.xp6(2),s.Q6J("ngIf",1===e.planProductType),s.xp6(3),s.hij(" ",s.Dn7(9,8,e.name,e.enabled?21:18,!0),""),s.xp6(3),s.Q6J("ngIf",!e.enabled)}}const _d=function(e){return{active:e}};function Zd(e,t){if(1&e){const e=s.EpF();s._uU(0,"\n "),s.TgZ(1,"div",7),s._uU(2,"\n "),s.TgZ(3,"button",8),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.selectAllVaults())})),s.ALo(4,"i18n"),s.ALo(5,"i18n"),s._uU(6,"\n "),s._UZ(7,"i",9),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.YNc(11,bd,7,9,"button",10),s._uU(12,"\n "),s.YNc(13,Ad,13,12,"button",11),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n ")}if(2&e){const e=s.oxw(2);s.xp6(1),s.Q6J("@transformPanel","open"),s.xp6(2),s.hYB("appA11yTitle","",s.lcZ(4,7,"vault"),": ",s.lcZ(5,9,"allVaults"),""),s.Q6J("ngClass",s.VKq(13,_d,!e.myVaultOnly&&!e.selectOrganizationId)),s.xp6(5),s.hij("\n  ",s.lcZ(9,11,"allVaults"),"\n "),s.xp6(3),s.Q6J("ngIf",!e.enforcePersonalOwnwership),s.xp6(2),s.Q6J("ngForOf",e.organizations)}}const Td=function(e,t){return{"bwi-angle-down":e,"bwi-chevron-up":t}};function Cd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",1),s._uU(1,"\n "),s.TgZ(2,"button",2,3),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.openOverlay())})),s._uU(4),s.ALo(5,"ellipsis"),s._UZ(6,"i",4),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.YNc(9,Zd,16,15,"ng-template",5,6,s.W1O),s._uU(11,"\n"),s.qZA()}if(2&e){const e=s.oxw();s.xp6(2),s.uIk("aria-expanded",e.isOpen)("aria-label",e.vaultFilterDisplay),s.xp6(2),s.hij("\n ",s.xi3(5,4,e.vaultFilterDisplay,45)," \n "),s.xp6(2),s.Q6J("ngClass",s.WLB(7,Td,!e.isOpen,e.isOpen))}}class kd{constructor(e,t,i,n,o,r,a){this.vaultFilterService=e,this.i18nService=t,this.ngZone=i,this.broadcasterService=n,this.overlay=o,this.viewContainerRef=r,this.platformUtilsService=a,this.onVaultSelectionChanged=new s.vpe,this.isOpen=!1,this.loaded=!1,this.vaultFilter=new Ju,this.vaultFilterDisplay="",this.enforcePersonalOwnwership=!1,this.overlayPostition=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]}get show(){return this.organizations.length>0&&!this.enforcePersonalOwnwership||this.organizations.length>1&&this.enforcePersonalOwnwership}handleKeyboardEvent(e){this.isOpen&&(e.preventDefault(),this.close())}ngOnInit(){return fd(this,void 0,void 0,(function*(){yield this.load(),this.broadcasterService.subscribe(this.constructor.name,(e=>{this.ngZone.run((()=>fd(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)yield this.load()}))))}))}))}load(){return fd(this,void 0,void 0,(function*(){this.vaultFilter=this.vaultFilterService.getVaultFilter(),this.organizations=(yield this.vaultFilterService.buildOrganizations()).sort(((e,t)=>e.name.localeCompare(t.name))),this.enforcePersonalOwnwership=yield this.vaultFilterService.checkForPersonalOwnershipPolicy(),this.show&&(this.enforcePersonalOwnwership&&!this.vaultFilter.myVaultOnly?(this.vaultFilterService.setVaultFilter(this.organizations[0].id),this.vaultFilter.selectedOrganizationId=this.organizations[0].id,this.vaultFilterDisplay=this.organizations.find((e=>e.id===this.vaultFilter.selectedOrganizationId)).name):this.vaultFilter.myVaultOnly?this.vaultFilterDisplay=this.i18nService.t(this.vaultFilterService.myVault):null!=this.vaultFilter.selectedOrganizationId?this.vaultFilterDisplay=this.organizations.find((e=>e.id===this.vaultFilter.selectedOrganizationId)).name:this.vaultFilterDisplay=this.i18nService.t(this.vaultFilterService.allVaults)),this.loaded=!0}))}openOverlay(){const e=Math.max(document.documentElement.clientHeight,window.innerHeight||0),t=this.overlay.position().flexibleConnectedTo(this.buttonRef.nativeElement).withFlexibleDimensions(!0).withPush(!0).withViewportMargin(10).withGrowAfterOpen(!0).withPositions(this.overlayPostition);this.overlayRef=this.overlay.create({hasBackdrop:!0,positionStrategy:t,maxHeight:e-160,backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.close()});const i=new vd.UE(this.templateRef,this.viewContainerRef);this.overlayRef.attach(i),this.isOpen=!0,(0,Qr.T)(this.overlayRef.outsidePointerEvents(),this.overlayRef.backdropClick(),this.overlayRef.detachments()).subscribe((()=>{this.close()}))}close(){this.overlayRef&&(this.overlayRef.dispose(),this.overlayRef=void 0),this.isOpen=!1}selectOrganization(e){e.enabled?(this.vaultFilterDisplay=e.name,this.vaultFilterService.setVaultFilter(e.id),this.onVaultSelectionChanged.emit(),this.close()):this.platformUtilsService.showToast("error",null,this.i18nService.t("disabledOrganizationFilterError"))}selectAllVaults(){this.vaultFilterDisplay=this.i18nService.t(this.vaultFilterService.allVaults),this.vaultFilterService.setVaultFilter(this.vaultFilterService.allVaults),this.onVaultSelectionChanged.emit(),this.close()}selectMyVault(){this.vaultFilterDisplay=this.i18nService.t(this.vaultFilterService.myVault),this.vaultFilterService.setVaultFilter(this.vaultFilterService.myVault),this.onVaultSelectionChanged.emit(),this.close()}}kd.ɵfac=function(e){return new(e||kd)(s.Y36(ju),s.Y36(_e),s.Y36(s.R0b),s.Y36(Tn),s.Y36(l.aV),s.Y36(s.s_b),s.Y36(Je))},kd.ɵcmp=s.Xpm({type:kd,selectors:[["app-vault-select"]],viewQuery:function(e,t){if(1&e&&(s.Gf(md,5,s.SBq),s.Gf(wd,5,s.Rgc)),2&e){let e;s.iGM(e=s.CRH())&&(t.buttonRef=e.first),s.iGM(e=s.CRH())&&(t.templateRef=e.first)}},hostBindings:function(e,t){1&e&&s.NdJ("keydown.escape",(function(e){return t.handleKeyboardEvent(e)}),!1,s.evT)},outputs:{onVaultSelectionChanged:"onVaultSelectionChanged"},decls:2,vars:1,consts:[["class","content org-filter-content",4,"ngIf"],[1,"content","org-filter-content"],["aria-haspopup","menu","aria-controls","cdk-overlay-container",1,"org-filter",3,"click"],["toggleVaults",""],["aria-hidden","true",1,"bwi","bwi-sm",3,"ngClass"],["class","vault-select-container"],["vaultSelectorTemplate",""],["cdkTrapFocus","","cdkTrapFocusAutoCapture","","role","dialog","aria-modal","true",1,"vault-select"],["appStopClick","",3,"ngClass","appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-filter"],["appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["appStopClick","",3,"appA11yTitle","click",4,"ngFor","ngForOf"],["appStopClick","",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-user"],["class","bwi bwi-fw bwi-business","aria-hidden","true",4,"ngIf"],["class","bwi bwi-fw bwi-family","aria-hidden","true",4,"ngIf"],["class","bwi bwi-fw bwi-exclamation-triangle text-danger",3,"aria-label","appA11yTitle",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-business"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-family"],[1,"bwi","bwi-fw","bwi-exclamation-triangle","text-danger",3,"aria-label","appA11yTitle"]],template:function(e,t){1&e&&(s.YNc(0,Cd,12,10,"div",0),s._uU(1,"\n")),2&e&&s.Q6J("ngIf",t.loaded&&t.show)},dependencies:[o.mK,u.mk,u.sg,u.O5,Ht,St,yd,Ze],encapsulation:2,data:{animation:[(0,he.X$)("transformPanel",[(0,he.SB)("void",(0,he.oB)({opacity:0})),(0,he.eR)("void => open",(0,he.jt)("100ms linear",(0,he.oB)({opacity:1}))),(0,he.eR)("* => void",(0,he.jt)("100ms linear",(0,he.oB)({opacity:0})))])]}});var Od=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Pd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-vault-select",15),s.NdJ("onVaultSelectionChanged",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.changeVaultSelection())})),s.qZA()}}function Id(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectFolder(t.node))})),s._uU(1,"\n "),s.TgZ(2,"div",21),s._uU(3,"\n "),s.TgZ(4,"div",22),s._uU(5,"\n "),s._UZ(6,"i",23),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span",24),s._uU(10),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"span"),s._UZ(14,"i",25),s.qZA(),s._uU(15,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(10),s.Oqu(e.node.name)}}function qd(e,t){if(1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n "),s.TgZ(2,"h2",17),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",18),s._uU(7,"\n "),s.YNc(8,Id,16,1,"button",19),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,2,"folders"),"\n "),s.xp6(5),s.Q6J("ngForOf",e.nestedFolders)}}function Dd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectCollection(t.node))})),s._uU(1,"\n "),s.TgZ(2,"div",21),s._uU(3,"\n "),s.TgZ(4,"div",22),s._uU(5,"\n "),s._UZ(6,"i",26),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span",24),s._uU(10),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"span"),s._UZ(14,"i",25),s.qZA(),s._uU(15,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(10),s.Oqu(e.node.name)}}function Md(e,t){if(1&e&&(s.TgZ(0,"div",16),s._uU(1,"\n "),s.TgZ(2,"h2",17),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",18),s._uU(7,"\n "),s.YNc(8,Dd,16,1,"button",19),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,2,"collections"),"\n "),s.xp6(5),s.Q6J("ngForOf",e.nestedCollections)}}function Fd(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Pd,1,0,"app-vault-select",13),s._uU(3,"\n "),s.YNc(4,qd,11,4,"div",14),s._uU(5,"\n "),s.YNc(6,Md,11,4,"div",14),s._uU(7,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.showVaultFilter),s.xp6(2),s.Q6J("ngIf",e.nestedFolders&&e.nestedFolders.length),s.xp6(2),s.Q6J("ngIf",e.nestedCollections&&e.nestedCollections.length)}}function Nd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-vault-select",15),s.NdJ("onVaultSelectionChanged",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.changeVaultSelection())})),s.qZA()}}function Ld(e,t){1&e&&s._UZ(0,"i",30)}function Ed(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s._UZ(2,"img",31),s._uU(3,"\n "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",32),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.addCipher())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.BQk()}2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,2,"noItemsInList")),s.xp6(4),s.hij("\n ",s.lcZ(10,4,"addItem"),"\n "))}function Rd(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,Nd,1,0,"app-vault-select",13),s._uU(3,"\n "),s.TgZ(4,"div",28),s._uU(5,"\n "),s.YNc(6,Ld,1,0,"i",29),s._uU(7,"\n "),s.YNc(8,Ed,12,6,"ng-container",12),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.showVaultFilter&&!e.showGroupings()),s.xp6(4),s.Q6J("ngIf",!e.loaded),s.xp6(2),s.Q6J("ngIf",e.loaded)}}function Jd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-vault-select",15),s.NdJ("onVaultSelectionChanged",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.changeVaultSelection())})),s.qZA()}}function Yd(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",39),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.selectCipher(t))}))("launchEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.launchCipher(t))})),s.ALo(1,"i18n"),s.qZA()}if(2&e){const e=t.$implicit,i=t.last;s.s9C("title",s.lcZ(1,3,"viewItem")),s.Q6J("cipher",e)("last",i)}}function zd(e,t){if(1&e&&(s.TgZ(0,"cdk-virtual-scroll-viewport",33,34),s.YNc(2,Jd,1,0,"app-vault-select",13),s._uU(3,"\n "),s.TgZ(4,"div",35),s._uU(5,"\n "),s.TgZ(6,"h2",17),s._uU(7),s.TgZ(8,"span",36),s._uU(9),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"div",37),s._uU(13,"\n "),s.YNc(14,Yd,2,5,"app-cipher-row",38),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.showVaultFilter&&!e.showGroupings()),s.xp6(5),s.hij("\n ",e.groupingTitle,"\n "),s.xp6(2),s.Oqu((e.isSearching(),e.ciphers.length)),s.xp6(5),s.Q6J("cdkVirtualForOf",e.ciphers)}}function Kd(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Rd,11,3,"div",12),s._uU(3,"\n "),s.YNc(4,zd,18,4,"cdk-virtual-scroll-viewport",27),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.ciphers.length),s.xp6(2),s.Q6J("ngIf",e.ciphers.length)}}const Bd=function(e){return{"stacked-boxes":e}},Gd="CiphersComponent";class Qd extends Ru{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g,v){super(e),this.organizationService=t,this.route=i,this.router=n,this.location=s,this.ngZone=o,this.broadcasterService=r,this.changeDetectorRef=a,this.stateService=l,this.popupUtils=c,this.i18nService=u,this.folderService=d,this.collectionService=h,this.platformUtilsService=p,this.cipherService=g,this.vaultFilterService=v,this.folderId=null,this.collectionId=null,this.type=null,this.searchTypeSearch=!1,this.showOrganizations=!1,this.deleted=!0,this.noneFolder=!1,this.showVaultFilter=!1,this.preventSelected=!1,this.applySavedState=!0,this.scrollingContainer="cdk-virtual-scroll-viewport",this.applySavedState=null!=window.previousPopupUrl&&!window.previousPopupUrl.startsWith("/ciphers")}ngOnInit(){return Od(this,void 0,void 0,(function*(){this.searchTypeSearch=!this.platformUtilsService.isSafari(),this.showOrganizations=yield this.organizationService.hasOrganizations(),this.vaultFilter=this.vaultFilterService.getVaultFilter(),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>Od(this,void 0,void 0,(function*(){var t;if(this.applySavedState&&(this.state=yield this.stateService.getBrowserCipherComponentState(),(null===(t=this.state)||void 0===t?void 0:t.searchText)&&(this.searchText=this.state.searchText)),e.deleted)this.showVaultFilter=!0,this.groupingTitle=this.i18nService.t("trash"),this.searchPlaceholder=this.i18nService.t("searchTrash"),yield this.load(this.buildFilter(),!0);else if(e.type){switch(this.showVaultFilter=!0,this.searchPlaceholder=this.i18nService.t("searchType"),this.type=parseInt(e.type,null),this.type){case Bl.Login:this.groupingTitle=this.i18nService.t("logins");break;case Bl.Card:this.groupingTitle=this.i18nService.t("cards");break;case Bl.Identity:this.groupingTitle=this.i18nService.t("identities");break;case Bl.SecureNote:this.groupingTitle=this.i18nService.t("secureNotes")}yield this.load(this.buildFilter())}else if(e.folderId){if(this.showVaultFilter=!0,this.folderId="none"===e.folderId?null:e.folderId,this.searchPlaceholder=this.i18nService.t("searchFolder"),null!=this.folderId){this.showOrganizations=!1;const e=yield this.vaultFilterService.getFolderNested(this.folderId);null!=e&&null!=e.node&&(this.groupingTitle=e.node.name,this.nestedFolders=null!=e.children&&e.children.length>0?e.children:null)}else this.noneFolder=!0,this.groupingTitle=this.i18nService.t("noneFolder");yield this.load(this.buildFilter())}else if(e.collectionId){this.showVaultFilter=!1,this.collectionId=e.collectionId,this.searchPlaceholder=this.i18nService.t("searchCollection");const t=yield this.collectionService.getNested(this.collectionId);null!=t&&null!=t.node&&(this.groupingTitle=t.node.name,this.nestedCollections=null!=t.children&&t.children.length>0?t.children:null),yield this.load((e=>null!=e.collectionIds&&e.collectionIds.indexOf(this.collectionId)>-1))}else this.showVaultFilter=!0,this.groupingTitle=this.i18nService.t("allItems"),yield this.load(this.buildFilter());this.applySavedState&&null!=this.state&&window.setTimeout((()=>this.popupUtils.setContentScrollY(window,this.state.scrollY,this.scrollingContainer)),0),yield this.stateService.setBrowserCipherComponentState(null)})))),this.broadcasterService.subscribe(Gd,(e=>{this.ngZone.run((()=>Od(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)e.successfully&&window.setTimeout((()=>{this.refresh()}),500);this.changeDetectorRef.detectChanges()}))))}))}))}ngOnDestroy(){this.saveState(),this.broadcasterService.unsubscribe(Gd)}selectCipher(e){this.selectedTimeout=window.setTimeout((()=>{this.preventSelected||(super.selectCipher(e),this.router.navigate(["/view-cipher"],{queryParams:{cipherId:e.id}})),this.preventSelected=!1}),200)}selectFolder(e){null!=e.id&&this.router.navigate(["/ciphers"],{queryParams:{folderId:e.id}})}selectCollection(e){this.router.navigate(["/ciphers"],{queryParams:{collectionId:e.id}})}launchCipher(e){return Od(this,void 0,void 0,(function*(){e.type===Bl.Login&&e.login.canLaunch&&(null!=this.selectedTimeout&&window.clearTimeout(this.selectedTimeout),this.preventSelected=!0,yield this.cipherService.updateLastLaunchedDate(e.id),Wt.createNewTab(e.login.launchUri),this.popupUtils.inPopup(window)&&Wt.closePopup(window))}))}addCipher(){if(this.deleted)return!1;super.addCipher(),this.router.navigate(["/add-cipher"],{queryParams:{folderId:this.folderId,type:this.type,collectionId:this.collectionId,selectedVault:this.vaultFilter.selectedOrganizationId}})}back(){window.routeDirection="b",this.location.back()}showGroupings(){return!this.isSearching()&&(this.nestedFolders&&this.nestedFolders.length||this.nestedCollections&&this.nestedCollections.length)}changeVaultSelection(){return Od(this,void 0,void 0,(function*(){this.vaultFilter=this.vaultFilterService.getVaultFilter(),yield this.load(this.buildFilter(),this.deleted)}))}buildFilter(){return e=>{let t=!0;return this.deleted&&t&&(t=e.isDeleted),null!=this.type&&t&&(t=e.type===this.type),null!=this.folderId&&"none"!=this.folderId&&t&&(t=e.folderId===this.folderId),this.noneFolder&&(t=null==e.folderId),null!=this.collectionId&&t&&(t=null!=e.collectionIds&&e.collectionIds.indexOf(this.collectionId)>-1),null!=this.vaultFilter.selectedOrganizationId&&t&&(t=e.organizationId===this.vaultFilter.selectedOrganizationId),this.vaultFilter.myVaultOnly&&t&&(t=null===e.organizationId),t}}saveState(){return Od(this,void 0,void 0,(function*(){this.state={scrollY:this.popupUtils.getContentScrollY(window,this.scrollingContainer),searchText:this.searchText},yield this.stateService.setBrowserCipherComponentState(this.state)}))}}Qd.ɵfac=function(e){return new(e||Qd)(s.Y36(jo),s.Y36(ta),s.Y36(Pe.gz),s.Y36(Pe.F0),s.Y36(u.Ye),s.Y36(s.R0b),s.Y36(Tn),s.Y36(s.sBO),s.Y36(js),s.Y36($t),s.Y36(_e),s.Y36(ba),s.Y36(xc),s.Y36(Je),s.Y36(Sc),s.Y36(ju))},Qd.ɵcmp=s.Xpm({type:Qd,selectors:[["app-vault-ciphers"]],features:[s.qOj],decls:44,vars:19,consts:[[1,"left"],["type","button",3,"click"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"sr-only"],[1,"search"],["id","search","autocomplete","off","appAutofocus","",3,"type","placeholder","ngModel","ngModelChange","input"],["aria-hidden","true",1,"bwi","bwi-search"],[1,"right"],["type","button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1",3,"ngClass"],[4,"ngIf"],[3,"onVaultSelectionChanged",4,"ngIf"],["class","box list",4,"ngIf"],[3,"onVaultSelectionChanged"],[1,"box","list"],[1,"box-header"],[1,"box-content","single-line"],["type","button","class","box-content-row","appStopClick","",3,"click",4,"ngFor","ngForOf"],["type","button","appStopClick","",1,"box-content-row",3,"click"],[1,"row-main"],[1,"icon"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lg","bwi-folder"],[1,"text"],["aria-hidden","true",1,"bwi","bwi-angle-right","bwi-lg","row-sub-icon"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lg","bwi-collection"],["itemSize","46","minBufferPx","400","maxBufferPx","600",4,"ngIf"],[1,"no-items"],["class","bwi bwi-spinner bwi-spin bwi-3x","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["aria-hidden","true",1,"no-items-image"],["type","button",1,"btn","block","primary","link",3,"click"],["itemSize","46","minBufferPx","400","maxBufferPx","600"],["virtualScrollViewport",""],[1,"box","list","only-list"],[1,"flex-right"],[1,"box-content"],[3,"cipher","last","title","onSelected","launchEvent",4,"cdkVirtualFor","cdkVirtualForOf"],[3,"cipher","last","title","onSelected","launchEvent"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.back()})),s._uU(5,"\n "),s.TgZ(6,"span",2),s._UZ(7,"i",3),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"h1",4),s._uU(16),s.ALo(17,"i18n"),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",5),s._uU(20,"\n "),s.TgZ(21,"input",6),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.search(200)})),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s._UZ(24,"i",7),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"div",8),s._uU(28,"\n "),s.TgZ(29,"button",9),s.NdJ("click",(function(){return t.addCipher()})),s.ALo(30,"i18n"),s._uU(31,"\n "),s._UZ(32,"i",10),s._uU(33,"\n "),s.qZA(),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n"),s.qZA(),s._uU(36,"\n"),s.TgZ(37,"main",11),s._uU(38,"\n "),s.YNc(39,Fd,8,3,"ng-container",12),s._uU(40,"\n "),s.YNc(41,Kd,6,2,"ng-container",12),s._uU(42,"\n"),s.qZA(),s._uU(43,"\n")),2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,9,"back")),s.xp6(6),s.Oqu(s.lcZ(17,11,"myVault")),s.xp6(5),s.s9C("type",t.searchTypeSearch?"search":"text"),s.s9C("placeholder",t.searchPlaceholder||s.lcZ(22,13,"searchVault")),s.Q6J("ngModel",t.searchText),s.xp6(8),s.s9C("appA11yTitle",s.lcZ(30,15,"addItem")),s.xp6(8),s.Q6J("ngClass",s.VKq(17,Bd,t.showGroupings())),s.xp6(2),s.Q6J("ngIf",t.showGroupings()),s.xp6(2),s.Q6J("ngIf",t.ciphers))},dependencies:[u.mk,u.sg,u.O5,ue.Fj,ue.JJ,ue.On,Ht,It,St,c.xd,c.x0,c.N7,gd,kd,Ze],encapsulation:2});var Vd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hd{constructor(e,t,i,n,o){this.collectionService=e,this.platformUtilsService=t,this.i18nService=i,this.cipherService=n,this.logService=o,this.allowSelectNone=!1,this.onSavedCollections=new s.vpe,this.collections=[]}ngOnInit(){return Vd(this,void 0,void 0,(function*(){yield this.load()}))}load(){return Vd(this,void 0,void 0,(function*(){this.cipherDomain=yield this.loadCipher(),this.collectionIds=this.loadCipherCollections(),this.cipher=yield this.cipherDomain.decrypt(),this.collections=yield this.loadCollections(),this.collections.forEach((e=>e.checked=!1)),null!=this.collectionIds&&this.collections.forEach((e=>{e.checked=null!=this.collectionIds&&this.collectionIds.indexOf(e.id)>-1}))}))}submit(){return Vd(this,void 0,void 0,(function*(){const e=this.collections.filter((e=>!!e.checked)).map((e=>e.id));if(this.allowSelectNone||0!==e.length){this.cipherDomain.collectionIds=e;try{this.formPromise=this.saveCollections(),yield this.formPromise,this.onSavedCollections.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("editedItem"))}catch(e){this.logService.error(e)}}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection"))}))}loadCipher(){return this.cipherService.get(this.cipherId)}loadCipherCollections(){return this.cipherDomain.collectionIds}loadCollections(){return Vd(this,void 0,void 0,(function*(){return(yield this.collectionService.getAllDecrypted()).filter((e=>!e.readOnly&&e.organizationId===this.cipher.organizationId))}))}saveCollections(){return this.cipherService.saveCollectionsWithServer(this.cipherDomain)}}Hd.ɵfac=function(e){return new(e||Hd)(s.Y36(xc),s.Y36(Je),s.Y36(_e),s.Y36(Sc),s.Y36(Ct))},Hd.ɵdir=s.lG2({type:Hd,inputs:{cipherId:"cipherId",allowSelectNone:"allowSelectNone"},outputs:{onSavedCollections:"onSavedCollections"}});var jd=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Wd(e,t){1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.TgZ(2,"div",16),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.hij("\n ",s.lcZ(4,1,"noCollectionsInList"),"\n "))}function $d(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"label",19),s._uU(3),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"input",20),s.NdJ("ngModelChange",(function(t){const i=s.CHM(e).$implicit;return s.KtG(i.checked=t)})),s.qZA(),s._uU(6,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index;s.xp6(2),s.MGl("for","collection_",i,""),s.xp6(1),s.Oqu(e.name),s.xp6(2),s.MGl("id","collection_",i,"")("name","Collection[",i,"].Checked"),s.Q6J("ngModel",e.checked)}}function Xd(e,t){if(1&e&&(s.TgZ(0,"div",15),s._uU(1,"\n "),s.YNc(2,$d,7,5,"div",17),s._uU(3,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngForOf",e.collections)}}class eh extends Hd{constructor(e,t,i,n,s,o,r){super(e,t,i,n,r),this.route=s,this.location=o}ngOnInit(){return jd(this,void 0,void 0,(function*(){this.onSavedCollections.subscribe((()=>{this.back()})),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>jd(this,void 0,void 0,(function*(){this.cipherId=e.cipherId,yield this.load()}))))}))}back(){this.location.back()}}eh.ɵfac=function(e){return new(e||eh)(s.Y36(xc),s.Y36(Je),s.Y36(_e),s.Y36(Sc),s.Y36(Pe.gz),s.Y36(u.Ye),s.Y36(Ct))},eh.ɵcmp=s.Xpm({type:eh,selectors:[["app-vault-collections"]],features:[s.qOj],decls:49,vars:15,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button",3,"click"],[1,"header-icon"],["aria-hidden","true",1,"bwi","bwi-angle-left"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],["tabindex","-1"],[1,"box"],["class","box-content",4,"ngIf"],[1,"box-content"],[1,"box-content-row","padded","no-hover"],["class","box-content-row box-content-row-checkbox","appBoxRow","",4,"ngFor","ngForOf"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],[3,"for"],["type","checkbox",3,"id","ngModel","name","ngModelChange"]],template:function(e,t){if(1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s.NdJ("click",(function(){return t.back()})),s._uU(8,"\n "),s.TgZ(9,"span",4),s._UZ(10,"i",5),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"span"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"h1",6),s._uU(19,"\n "),s.TgZ(20,"span",7),s._uU(21),s.ALo(22,"i18n"),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"div",8),s._uU(26,"\n "),s.TgZ(27,"button",9),s._uU(28,"\n "),s.TgZ(29,"span",10),s._uU(30),s.ALo(31,"i18n"),s.qZA(),s._uU(32,"\n "),s._UZ(33,"i",11),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.TgZ(38,"main",12),s._uU(39,"\n "),s.TgZ(40,"div",13),s._uU(41,"\n "),s.YNc(42,Wd,6,3,"div",14),s._uU(43,"\n "),s.YNc(44,Xd,4,1,"div",14),s._uU(45,"\n "),s.qZA(),s._uU(46,"\n "),s.qZA(),s._uU(47,"\n"),s.qZA(),s._uU(48,"\n")),2&e){const e=s.MAs(1);s.Q6J("appApiAction",t.formPromise),s.xp6(13),s.Oqu(s.lcZ(14,9,"back")),s.xp6(8),s.Oqu(s.lcZ(22,11,"collections")),s.xp6(6),s.Q6J("disabled",e.loading),s.xp6(2),s.Q6J("hidden",e.loading),s.xp6(1),s.Oqu(s.lcZ(31,13,"save")),s.xp6(3),s.Q6J("hidden",!e.loading),s.xp6(9),s.Q6J("ngIf",!t.collections||!t.collections.length),s.xp6(2),s.Q6J("ngIf",t.collections&&t.collections.length)}},dependencies:[u.sg,u.O5,ue._Y,ue.Wl,ue.JJ,ue.JL,ue.On,ue.F,Ot,Xe,Ze],encapsulation:2});class th{}var ih=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function nh(e,t){1&e&&s._UZ(0,"app-pop-out")}function sh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",8),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.refresh())})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",12),s._uU(4,"\n "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"refresh"))}function oh(e,t){1&e&&(s.TgZ(0,"div",13),s._uU(1,"\n "),s._UZ(2,"i",14),s._uU(3,"\n "),s.qZA())}function rh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",23),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.fillCipher(t))}))("onView",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.viewCipher(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,3,"autoFill")),s.Q6J("cipher",e)("showView",!0)}}function ah(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",24),s._uU(1,"\n "),s.TgZ(2,"p",25),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"button",26),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.addCipher())})),s._uU(7),s.ALo(8,"i18n"),s.qZA(),s._uU(9,"\n "),s.qZA()}2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,2,"autoFillInfo")),s.xp6(4),s.hij("\n ",s.lcZ(8,4,"addLogin"),"\n "))}function lh(e,t){if(1&e&&(s.TgZ(0,"div",17),s._uU(1,"\n "),s.TgZ(2,"h2",18),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",19),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",20),s._uU(10,"\n "),s.YNc(11,rh,3,5,"app-cipher-row",21),s._uU(12,"\n "),s.YNc(13,ah,10,6,"div",22),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,4,"typeLogins"),"\n "),s.xp6(3),s.Oqu(e.loginCiphers.length),s.xp6(5),s.Q6J("ngForOf",e.loginCiphers),s.xp6(2),s.Q6J("ngIf",!e.loginCiphers.length)}}function ch(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",23),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.fillCipher(t))}))("onView",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.viewCipher(t))})),s.ALo(1,"i18n"),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,3,"autoFill")),s.Q6J("cipher",e)("showView",!0)}}function uh(e,t){if(1&e&&(s.TgZ(0,"div",17),s._uU(1,"\n "),s.TgZ(2,"h2",18),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",19),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",20),s._uU(10,"\n "),s.YNc(11,ch,2,5,"app-cipher-row",21),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"cards"),"\n "),s.xp6(3),s.Oqu(e.cardCiphers.length),s.xp6(5),s.Q6J("ngForOf",e.cardCiphers)}}function dh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",23),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.fillCipher(t))}))("onView",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.viewCipher(t))})),s.ALo(1,"i18n"),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,3,"autoFill")),s.Q6J("cipher",e)("showView",!0)}}function hh(e,t){if(1&e&&(s.TgZ(0,"div",17),s._uU(1,"\n "),s.TgZ(2,"h2",18),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",19),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",20),s._uU(10,"\n "),s.YNc(11,dh,2,5,"app-cipher-row",21),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"identities"),"\n "),s.xp6(3),s.Oqu(e.identityCiphers.length),s.xp6(5),s.Q6J("ngForOf",e.identityCiphers)}}function ph(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"app-vault-select",15),s.NdJ("onVaultSelectionChanged",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.load())})),s.qZA(),s._uU(3,"\n "),s.YNc(4,lh,16,6,"div",16),s._uU(5,"\n "),s.YNc(6,uh,14,5,"div",16),s._uU(7,"\n "),s.YNc(8,hh,14,5,"div",16),s._uU(9,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngIf",e.loginCiphers),s.xp6(2),s.Q6J("ngIf",e.cardCiphers&&e.cardCiphers.length),s.xp6(2),s.Q6J("ngIf",e.identityCiphers&&e.identityCiphers.length)}}const gh="CurrentTabComponent";class vh{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g){this.platformUtilsService=e,this.cipherService=t,this.popupUtilsService=i,this.autofillService=n,this.i18nService=s,this.router=o,this.ngZone=r,this.broadcasterService=a,this.changeDetectorRef=l,this.syncService=c,this.searchService=u,this.stateService=d,this.passwordRepromptService=h,this.organizationService=p,this.vaultFilterService=g,this.pageDetails=[],this.inSidebar=!1,this.searchTypeSearch=!1,this.loaded=!1,this.isLoading=!1,this.showOrganizations=!1}ngOnInit(){return ih(this,void 0,void 0,(function*(){this.searchTypeSearch=!this.platformUtilsService.isSafari(),this.inSidebar=this.popupUtilsService.inSidebar(window),this.broadcasterService.subscribe(gh,(e=>{this.ngZone.run((()=>ih(this,void 0,void 0,(function*(){switch(e.command){case"syncCompleted":this.isLoading&&window.setTimeout((()=>{this.load()}),500);break;case"collectPageDetailsResponse":e.sender===gh&&this.pageDetails.push({frameId:e.webExtSender.frameId,tab:e.tab,details:e.details})}this.changeDetectorRef.detectChanges()}))))})),this.syncService.syncInProgress?this.loadedTimeout=window.setTimeout((()=>ih(this,void 0,void 0,(function*(){this.isLoading||(yield this.load())}))),5e3):yield this.load(),window.setTimeout((()=>{document.getElementById("search").focus()}),100)}))}ngOnDestroy(){window.clearTimeout(this.loadedTimeout),this.broadcasterService.unsubscribe(gh)}refresh(){return ih(this,void 0,void 0,(function*(){yield this.load()}))}addCipher(){this.router.navigate(["/add-cipher"],{queryParams:{name:this.hostname,uri:this.url,selectedVault:this.vaultFilterService.getVaultFilter().selectedOrganizationId}})}viewCipher(e){this.router.navigate(["/view-cipher"],{queryParams:{cipherId:e.id}})}fillCipher(e){return ih(this,void 0,void 0,(function*(){if(e.reprompt===Kl.None||(yield this.passwordRepromptService.showPasswordPrompt()))if(this.totpCode=null,null!=this.totpTimeout&&window.clearTimeout(this.totpTimeout),null!=this.pageDetails&&0!==this.pageDetails.length)try{this.totpCode=yield this.autofillService.doAutoFill({tab:this.tab,cipher:e,pageDetails:this.pageDetails,doc:window.document,fillNewPassword:!0}),null!=this.totpCode&&this.platformUtilsService.copyToClipboard(this.totpCode,{window}),this.popupUtilsService.inPopup(window)&&(this.platformUtilsService.isFirefox()||this.platformUtilsService.isSafari()?Wt.closePopup(window):setTimeout((()=>Wt.closePopup(window)),50))}catch(e){this.ngZone.run((()=>{this.platformUtilsService.showToast("error",null,this.i18nService.t("autofillError")),this.changeDetectorRef.detectChanges()}))}else this.platformUtilsService.showToast("error",null,this.i18nService.t("autofillError"))}))}searchVault(){null!=this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchService.isSearchable(this.searchText)&&(this.searchTimeout=window.setTimeout((()=>ih(this,void 0,void 0,(function*(){this.router.navigate(["/tabs/vault"],{queryParams:{searchText:this.searchText}})}))),200))}closeOnEsc(e){"Escape"!==e.key||null!=this.searchText&&""!==this.searchText||Wt.closePopup(window)}load(){return ih(this,void 0,void 0,(function*(){if(this.isLoading=!1,this.tab=yield Wt.getTabFromCurrentWindow(),null==this.tab)return this.loginCiphers=[],void(this.isLoading=this.loaded=!0);this.url=this.tab.url,this.hostname=nt.getHostname(this.url),this.pageDetails=[],Wt.tabSendMessage(this.tab,{command:"collectPageDetails",tab:this.tab,sender:gh});const e=[],t=yield this.stateService.getDontShowCardsCurrentTab(),i=yield this.stateService.getDontShowIdentitiesCurrentTab();this.showOrganizations=yield this.organizationService.hasOrganizations(),t||e.push(Bl.Card),i||e.push(Bl.Identity);const n=yield this.cipherService.getAllDecryptedForUrl(this.url,e.length>0?e:null);this.loginCiphers=[],this.cardCiphers=[],this.identityCiphers=[],n.forEach((e=>{if(!this.vaultFilterService.filterCipherForSelectedVault(e))switch(e.type){case Bl.Login:this.loginCiphers.push(e);break;case Bl.Card:this.cardCiphers.push(e);break;case Bl.Identity:this.identityCiphers.push(e)}})),this.loginCiphers=this.loginCiphers.sort(((e,t)=>this.cipherService.sortCiphersByLastUsedThenName(e,t))),this.isLoading=this.loaded=!0}))}}vh.ɵfac=function(e){return new(e||vh)(s.Y36(Je),s.Y36(Sc),s.Y36($t),s.Y36(th),s.Y36(_e),s.Y36(Pe.F0),s.Y36(s.R0b),s.Y36(Tn),s.Y36(s.sBO),s.Y36(bi),s.Y36(jo),s.Y36(Mt),s.Y36(Ac),s.Y36(ta),s.Y36(ju))},vh.ɵcmp=s.Xpm({type:vh,selectors:[["app-current-tab"]],decls:38,vars:15,consts:[[1,"sr-only"],[1,"left"],[4,"ngIf"],["type","button",3,"appA11yTitle","click",4,"ngIf"],[1,"search"],["id","search","autocomplete","off",3,"type","placeholder","ngModel","ngModelChange","input","keydown"],["aria-hidden","true",1,"bwi","bwi-search"],[1,"right"],["type","button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1"],["class","no-items",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-refresh-tab","bwi-lg","bwi-fw"],[1,"no-items"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[3,"onVaultSelectionChanged"],["class","box list",4,"ngIf"],[1,"box","list"],[1,"box-header"],[1,"flex-right"],[1,"box-content"],[3,"cipher","title","showView","onSelected","onView",4,"ngFor","ngForOf"],["class","box-content-row padded no-hover",4,"ngIf"],[3,"cipher","title","showView","onSelected","onView"],[1,"box-content-row","padded","no-hover"],[1,"text-center"],["type","button",1,"btn","primary","link","block",3,"click"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"h1",0),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",1),s._uU(7,"\n "),s.YNc(8,nh,1,0,"app-pop-out",2),s._uU(9,"\n "),s.YNc(10,sh,5,3,"button",3),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",4),s._uU(14,"\n "),s.TgZ(15,"input",5),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.searchVault()}))("keydown",(function(e){return t.closeOnEsc(e)})),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s._UZ(18,"i",6),s._uU(19,"\n "),s.qZA(),s._uU(20,"\n "),s.TgZ(21,"div",7),s._uU(22,"\n "),s.TgZ(23,"button",8),s.NdJ("click",(function(){return t.addCipher()})),s.ALo(24,"i18n"),s._uU(25,"\n "),s._UZ(26,"i",9),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n"),s.qZA(),s._uU(30,"\n"),s.TgZ(31,"main",10),s._uU(32,"\n "),s.YNc(33,oh,4,0,"div",11),s._uU(34,"\n "),s.YNc(35,ph,10,3,"ng-container",2),s._uU(36,"\n"),s.qZA(),s._uU(37,"\n")),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,9,"currentTab")),s.xp6(5),s.Q6J("ngIf",!t.inSidebar),s.xp6(2),s.Q6J("ngIf",t.inSidebar),s.xp6(5),s.s9C("type",t.searchTypeSearch?"search":"text"),s.s9C("placeholder",s.lcZ(16,11,"searchVault")),s.Q6J("ngModel",t.searchText),s.xp6(8),s.s9C("appA11yTitle",s.lcZ(24,13,"addItem")),s.xp6(10),s.Q6J("ngIf",!t.loaded),s.xp6(2),s.Q6J("ngIf",t.loaded))},dependencies:[u.sg,u.O5,ue.Fj,ue.JJ,ue.On,Ht,gd,es,kd,Ze],encapsulation:2});var yh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class fh{constructor(e,t,i,n){this.cipherService=e,this.platformUtilsService=t,this.i18nService=i,this.win=n,this.history=[]}ngOnInit(){return yh(this,void 0,void 0,(function*(){yield this.init()}))}copy(e){const t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t("password")))}init(){return yh(this,void 0,void 0,(function*(){const e=yield this.cipherService.get(this.cipherId),t=yield e.decrypt();this.history=null==t.passwordHistory?[]:t.passwordHistory}))}}fh.ɵfac=function(e){return new(e||fh)(s.Y36(Sc),s.Y36(Je),s.Y36(_e),s.Y36(Window))},fh.ɵdir=s.lG2({type:fh});var mh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function wh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",11),s._uU(1,"\n "),s.TgZ(2,"div",12),s._uU(3,"\n "),s.TgZ(4,"div",13),s._uU(5,"\n "),s.TgZ(6,"span",14),s._uU(7),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span",15),s._uU(10),s.ALo(11,"date"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"div",16),s._uU(16,"\n "),s.TgZ(17,"button",17),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(2);return s.KtG(i.copy(t.password))})),s.ALo(18,"i18n"),s._uU(19,"\n "),s._UZ(20,"i",18),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(7),s.hij("\n ",e.password,"\n "),s.xp6(3),s.Oqu(s.xi3(11,3,e.lastUsedDate,"medium")),s.xp6(7),s.s9C("appA11yTitle",s.lcZ(18,6,"copyPassword"))}}function bh(e,t){if(1&e&&(s.TgZ(0,"div",8),s._uU(1,"\n "),s.TgZ(2,"div",9),s._uU(3,"\n "),s.YNc(4,wh,24,8,"div",10),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(4),s.Q6J("ngForOf",e.history)}}function Sh(e,t){1&e&&(s.TgZ(0,"div",19),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"noPasswordsInList")))}class Uh extends fh{constructor(e,t,i,n,s){super(e,t,i,window),this.location=n,this.route=s}ngOnInit(){return mh(this,void 0,void 0,(function*(){this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>mh(this,void 0,void 0,(function*(){e.cipherId?this.cipherId=e.cipherId:this.close(),yield this.init()}))))}))}close(){this.location.back()}}Uh.ɵfac=function(e){return new(e||Uh)(s.Y36(Sc),s.Y36(Je),s.Y36(_e),s.Y36(u.Ye),s.Y36(Pe.gz))},Uh.ɵcmp=s.Xpm({type:Uh,selectors:[["app-password-history"]],features:[s.qOj],decls:26,vars:8,consts:[[1,"left"],["type","button",3,"click"],[1,"center"],[1,"title"],[1,"right"],["tabindex","-1"],["class","box list full-list",4,"ngIf"],["class","no-items",4,"ngIf"],[1,"box","list","full-list"],[1,"box-content"],["class","box-content-row box-content-row-flex",4,"ngFor","ngForOf"],[1,"box-content-row","box-content-row-flex"],[1,"row-main"],[1,"row-main-content"],[1,"text","monospaced","no-ellipsis"],[1,"detail"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],[1,"no-items"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.close()})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"h1",2),s._uU(10,"\n "),s.TgZ(11,"span",3),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s._UZ(16,"div",4),s._uU(17,"\n"),s.qZA(),s._uU(18,"\n"),s.TgZ(19,"main",5),s._uU(20,"\n "),s.YNc(21,bh,7,1,"div",6),s._uU(22,"\n "),s.YNc(23,Sh,6,3,"div",7),s._uU(24,"\n"),s.qZA(),s._uU(25,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,4,"close")),s.xp6(7),s.Oqu(s.lcZ(13,6,"passwordHistory")),s.xp6(9),s.Q6J("ngIf",t.history&&t.history.length),s.xp6(2),s.Q6J("ngIf",!t.history||!t.history.length))},dependencies:[u.sg,u.O5,Ht,St,u.uU,Ze],encapsulation:2});var xh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ah{constructor(e,t,i,n,o,r){this.collectionService=e,this.platformUtilsService=t,this.i18nService=i,this.cipherService=n,this.logService=o,this.organizationService=r,this.onSharedCipher=new s.vpe,this.collections=[],this.organizations=[],this.writeableCollections=[]}ngOnInit(){return xh(this,void 0,void 0,(function*(){yield this.load()}))}load(){return xh(this,void 0,void 0,(function*(){const e=yield this.collectionService.getAllDecrypted();this.writeableCollections=e.map((e=>e)).filter((e=>!e.readOnly));const t=yield this.organizationService.getAll();this.organizations=t.sort(nt.getSortFunction(this.i18nService,"name")).filter((e=>e.enabled&&e.status===Gl.Confirmed));const i=yield this.cipherService.get(this.cipherId);this.cipher=yield i.decrypt(),null==this.organizationId&&this.organizations.length>0&&(this.organizationId=this.organizations[0].id),this.filterCollections()}))}filterCollections(){this.writeableCollections.forEach((e=>e.checked=!1)),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter((e=>e.organizationId===this.organizationId))}submit(){var e,t;return xh(this,void 0,void 0,(function*(){const i=this.collections.filter((e=>!!e.checked)).map((e=>e.id));if(0===i.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection"));const n=yield this.cipherService.get(this.cipherId),s=yield n.decrypt(),o=null!==(t=null===(e=this.organizations.find((e=>e.id===this.organizationId)))||void 0===e?void 0:e.name)&&void 0!==t?t:this.i18nService.t("organization");try{return this.formPromise=this.cipherService.shareWithServer(s,this.organizationId,i).then((()=>xh(this,void 0,void 0,(function*(){this.onSharedCipher.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("movedItemToOrg",s.name,o))})))),yield this.formPromise,!0}catch(e){this.logService.error(e)}return!1}))}get canSave(){if(null!=this.collections)for(let e=0;e{this.router.navigate(["view-cipher",{cipherId:this.cipherId}])})),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>_h(this,void 0,void 0,(function*(){this.cipherId=e.cipherId,yield this.load()}))))}))}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return _h(this,void 0,void 0,(function*(){const t=yield e.submit.call(this);return t&&this.cancel(),t}))}cancel(){this.router.navigate(["/view-cipher"],{replaceUrl:!0,queryParams:{cipherId:this.cipher.id}})}}Dh.ɵfac=function(e){return new(e||Dh)(s.Y36(xc),s.Y36(Je),s.Y36(_e),s.Y36(Ct),s.Y36(Sc),s.Y36(Pe.gz),s.Y36(Pe.F0),s.Y36(ta))},Dh.ɵcmp=s.Xpm({type:Dh,selectors:[["app-vault-share"]],features:[s.qOj],decls:42,vars:14,consts:[[3,"appApiAction","ngSubmit"],["form",""],[1,"left"],["type","button",3,"click"],[1,"center"],[1,"title"],[1,"right"],["type","submit",3,"disabled",4,"ngIf"],["tabindex","-1"],[1,"box"],["class","box-content",4,"ngIf"],[1,"box-footer"],["class","box",4,"ngIf"],["type","submit",3,"disabled"],[3,"hidden"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin",3,"hidden"],[1,"box-content"],[1,"box-content-row","padded","no-hover"],["appBoxRow","",1,"box-content-row"],["for","organization"],["id","organization","name","OrganizationId",3,"ngModel","ngModelChange","change"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[1,"box-header"],["class","box-content-row box-content-row-checkbox","appBoxRow","",4,"ngFor","ngForOf"],["appBoxRow","",1,"box-content-row","box-content-row-checkbox"],[3,"for"],["type","checkbox",3,"id","ngModel","name","ngModelChange"]],template:function(e,t){1&e&&(s.TgZ(0,"form",0,1),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(2,"\n "),s.TgZ(3,"header"),s._uU(4,"\n "),s.TgZ(5,"div",2),s._uU(6,"\n "),s.TgZ(7,"button",3),s.NdJ("click",(function(){return t.cancel()})),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"h1",4),s._uU(13,"\n "),s.TgZ(14,"span",5),s._uU(15),s.ALo(16,"i18n"),s.qZA(),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",6),s._uU(20,"\n "),s.YNc(21,Zh,8,6,"button",7),s._uU(22,"\n "),s.qZA(),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"main",8),s._uU(26,"\n "),s.TgZ(27,"div",9),s._uU(28,"\n "),s.YNc(29,Th,6,3,"div",10),s._uU(30,"\n "),s.YNc(31,kh,14,5,"div",10),s._uU(32,"\n "),s.TgZ(33,"div",11),s._uU(34),s.ALo(35,"i18n"),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.YNc(38,qh,10,5,"div",12),s._uU(39,"\n "),s.qZA(),s._uU(40,"\n"),s.qZA(),s._uU(41,"\n")),2&e&&(s.Q6J("appApiAction",t.formPromise),s.xp6(8),s.Oqu(s.lcZ(9,8,"cancel")),s.xp6(7),s.Oqu(s.lcZ(16,10,"moveToOrganization")),s.xp6(6),s.Q6J("ngIf",t.organizations&&t.organizations.length),s.xp6(8),s.Q6J("ngIf",!t.organizations||!t.organizations.length),s.xp6(2),s.Q6J("ngIf",t.organizations&&t.organizations.length),s.xp6(3),s.hij("\n ",s.lcZ(35,12,"moveToOrgDesc"),"\n "),s.xp6(4),s.Q6J("ngIf",t.organizations&&t.organizations.length))},dependencies:[u.sg,u.O5,ue._Y,ue.YN,ue.Kr,ue.Wl,ue.EJ,ue.JJ,ue.JL,ue.On,ue.F,Ot,Xe,Ze],encapsulation:2});var Mh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Fh(e,t){1&e&&s._UZ(0,"i",14)}function Nh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s._UZ(2,"img",15),s._uU(3,"\n "),s.TgZ(4,"p"),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"button",16),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.addCipher())})),s._uU(9),s.ALo(10,"i18n"),s.qZA(),s._uU(11,"\n "),s.BQk()}2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,2,"noItemsInList")),s.xp6(4),s.hij("\n ",s.lcZ(10,4,"addItem"),"\n "))}function Lh(e,t){if(1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n "),s.YNc(2,Fh,1,0,"i",13),s._uU(3,"\n "),s.YNc(4,Nh,12,6,"ng-container",11),s._uU(5,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.loaded),s.xp6(2),s.Q6J("ngIf",e.loaded)}}function Eh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",34),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.selectCipher(t))}))("launchEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.launchCipher(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,2,"viewItem")),s.Q6J("cipher",e)}}function Rh(e,t){if(1&e&&(s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"h2",19),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",20),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",32),s._uU(10,"\n "),s.YNc(11,Eh,3,4,"app-cipher-row",33),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"favorites"),"\n "),s.xp6(3),s.Oqu(e.favoriteCiphers.length),s.xp6(5),s.Q6J("ngForOf",e.favoriteCiphers)}}function Jh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",22),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectFolder(t.node))})),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s.TgZ(4,"div",24),s._uU(5,"\n "),s._UZ(6,"i",36),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span",26),s._uU(10),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"span",27),s._uU(14),s.qZA(),s._uU(15,"\n "),s.TgZ(16,"span"),s._UZ(17,"i",28),s.qZA(),s._uU(18,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(3);s.xp6(10),s.Oqu(e.node.name),s.xp6(4),s.Oqu(i.folderCounts.get(e.node.id)||0)}}function Yh(e,t){if(1&e&&(s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"h2",19),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",20),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",21),s._uU(10,"\n "),s.YNc(11,Jh,19,2,"button",35),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"folders"),"\n "),s.xp6(3),s.Oqu(e.folderCount),s.xp6(5),s.Q6J("ngForOf",e.nestedFolders)}}function zh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",22),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.selectCollection(t.node))})),s._uU(1,"\n "),s.TgZ(2,"div",23),s._uU(3,"\n "),s.TgZ(4,"div",24),s._UZ(5,"i",37),s.qZA(),s._uU(6,"\n "),s.TgZ(7,"span",26),s._uU(8),s.qZA(),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"span",27),s._uU(12),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"span"),s._UZ(15,"i",28),s.qZA(),s._uU(16,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=s.oxw(3);s.xp6(8),s.Oqu(e.node.name),s.xp6(4),s.Oqu(i.collectionCounts.get(e.node.id)||0)}}function Kh(e,t){if(1&e&&(s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"h2",19),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",20),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",21),s._uU(10,"\n "),s.YNc(11,zh,17,2,"button",35),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"collections"),"\n "),s.xp6(3),s.Oqu(e.nestedCollections.length),s.xp6(5),s.Q6J("ngForOf",e.nestedCollections)}}function Bh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",34),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.selectCipher(t))}))("launchEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.launchCipher(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,2,"viewItem")),s.Q6J("cipher",e)}}function Gh(e,t){if(1&e&&(s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"h2",19),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"div",20),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",32),s._uU(10,"\n "),s.YNc(11,Bh,3,4,"app-cipher-row",33),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,3,"noneFolder"),"\n "),s.xp6(3),s.Oqu(e.noFolderCiphers.length),s.xp6(5),s.Q6J("ngForOf",e.noFolderCiphers)}}function Qh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",18),s._uU(1,"\n "),s.TgZ(2,"h2",19),s._uU(3),s.ALo(4,"i18n"),s.TgZ(5,"span",20),s._uU(6),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",21),s._uU(10,"\n "),s.TgZ(11,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.selectTrash())})),s._uU(12,"\n "),s.TgZ(13,"div",23),s._uU(14,"\n "),s.TgZ(15,"div",24),s._UZ(16,"i",38),s.qZA(),s._uU(17,"\n "),s.TgZ(18,"span",26),s._uU(19),s.ALo(20,"i18n"),s.qZA(),s._uU(21,"\n "),s.qZA(),s._uU(22,"\n "),s.TgZ(23,"span",27),s._uU(24),s.qZA(),s._uU(25,"\n "),s.TgZ(26,"span"),s._UZ(27,"i",28),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,4,"trash"),"\n "),s.xp6(3),s.Oqu(e.deletedCount),s.xp6(13),s.Oqu(s.lcZ(20,6,"trash")),s.xp6(5),s.Oqu(e.deletedCount)}}function Vh(e,t){if(1&e){const e=s.EpF();s.ynx(0),s._uU(1,"\n "),s.YNc(2,Rh,14,5,"div",17),s._uU(3,"\n "),s.TgZ(4,"div",18),s._uU(5,"\n "),s.TgZ(6,"h2",19),s._uU(7),s.ALo(8,"i18n"),s.TgZ(9,"span",20),s._uU(10,"4"),s.qZA(),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.TgZ(13,"div",21),s._uU(14,"\n "),s.TgZ(15,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.cipherType.Login))})),s._uU(16,"\n "),s.TgZ(17,"div",23),s._uU(18,"\n "),s.TgZ(19,"div",24),s._UZ(20,"i",25),s.qZA(),s._uU(21,"\n "),s.TgZ(22,"span",26),s._uU(23),s.ALo(24,"i18n"),s.qZA(),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"span",27),s._uU(28),s.qZA(),s._uU(29,"\n "),s.TgZ(30,"span"),s._UZ(31,"i",28),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.TgZ(34,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.cipherType.Card))})),s._uU(35,"\n "),s.TgZ(36,"div",23),s._uU(37,"\n "),s.TgZ(38,"div",24),s._UZ(39,"i",29),s.qZA(),s._uU(40,"\n "),s.TgZ(41,"span",26),s._uU(42),s.ALo(43,"i18n"),s.qZA(),s._uU(44,"\n "),s.qZA(),s._uU(45,"\n "),s.TgZ(46,"span",27),s._uU(47),s.qZA(),s._uU(48,"\n "),s.TgZ(49,"span"),s._UZ(50,"i",28),s.qZA(),s._uU(51,"\n "),s.qZA(),s._uU(52,"\n "),s.TgZ(53,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.cipherType.Identity))})),s._uU(54,"\n "),s.TgZ(55,"div",23),s._uU(56,"\n "),s.TgZ(57,"div",24),s._UZ(58,"i",30),s.qZA(),s._uU(59,"\n "),s.TgZ(60,"span",26),s._uU(61),s.ALo(62,"i18n"),s.qZA(),s._uU(63,"\n "),s.qZA(),s._uU(64,"\n "),s.TgZ(65,"span",27),s._uU(66),s.qZA(),s._uU(67,"\n "),s.TgZ(68,"span"),s._UZ(69,"i",28),s.qZA(),s._uU(70,"\n "),s.qZA(),s._uU(71,"\n "),s.TgZ(72,"button",22),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.selectType(t.cipherType.SecureNote))})),s._uU(73,"\n "),s.TgZ(74,"div",23),s._uU(75,"\n "),s.TgZ(76,"div",24),s._UZ(77,"i",31),s.qZA(),s._uU(78,"\n "),s.TgZ(79,"span",26),s._uU(80),s.ALo(81,"i18n"),s.qZA(),s._uU(82,"\n "),s.qZA(),s._uU(83,"\n "),s.TgZ(84,"span",27),s._uU(85),s.qZA(),s._uU(86,"\n "),s.TgZ(87,"span"),s._UZ(88,"i",28),s.qZA(),s._uU(89,"\n "),s.qZA(),s._uU(90,"\n "),s.qZA(),s._uU(91,"\n "),s.qZA(),s._uU(92,"\n "),s.YNc(93,Yh,14,5,"div",17),s._uU(94,"\n "),s.YNc(95,Kh,14,5,"div",17),s._uU(96,"\n "),s.YNc(97,Gh,14,5,"div",17),s._uU(98,"\n "),s.YNc(99,Qh,31,8,"div",17),s._uU(100,"\n "),s.BQk()}if(2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",e.favoriteCiphers),s.xp6(5),s.hij("\n ",s.lcZ(8,14,"types"),"\n "),s.xp6(16),s.Oqu(s.lcZ(24,16,"typeLogin")),s.xp6(5),s.Oqu(e.typeCounts.get(e.cipherType.Login)||0),s.xp6(14),s.Oqu(s.lcZ(43,18,"typeCard")),s.xp6(5),s.Oqu(e.typeCounts.get(e.cipherType.Card)||0),s.xp6(14),s.Oqu(s.lcZ(62,20,"typeIdentity")),s.xp6(5),s.Oqu(e.typeCounts.get(e.cipherType.Identity)||0),s.xp6(14),s.Oqu(s.lcZ(81,22,"typeSecureNote")),s.xp6(5),s.Oqu(e.typeCounts.get(e.cipherType.SecureNote)||0),s.xp6(8),s.Q6J("ngIf",null==e.nestedFolders?null:e.nestedFolders.length),s.xp6(2),s.Q6J("ngIf",e.showCollections&&e.nestedCollections&&e.nestedCollections.length),s.xp6(2),s.Q6J("ngIf",e.showNoFolderCiphers),s.xp6(2),s.Q6J("ngIf",e.deletedCount)}}function Hh(e,t){1&e&&(s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"p"),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.qZA()),2&e&&(s.xp6(3),s.Oqu(s.lcZ(4,1,"noItemsInList")))}function jh(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"app-cipher-row",34),s.NdJ("onSelected",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.selectCipher(t))}))("launchEvent",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.launchCipher(t))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.s9C("title",s.lcZ(1,2,"viewItem")),s.Q6J("cipher",e)}}function Wh(e,t){if(1&e&&(s.TgZ(0,"cdk-virtual-scroll-viewport",40),s._uU(1,"\n "),s.TgZ(2,"div",41),s._uU(3,"\n "),s.TgZ(4,"div",32),s._uU(5,"\n "),s.YNc(6,jh,3,4,"app-cipher-row",42),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.qZA(),s._uU(9,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(6),s.Q6J("cdkVirtualForOf",e.ciphers)}}function $h(e,t){if(1&e&&(s.ynx(0),s._uU(1,"\n "),s.YNc(2,Hh,6,3,"div",10),s._uU(3,"\n "),s.YNc(4,Wh,10,1,"cdk-virtual-scroll-viewport",39),s._uU(5,"\n "),s.BQk()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.ciphers||!e.ciphers.length),s.xp6(2),s.Q6J("ngIf",e.ciphers&&e.ciphers.length>0)}}const Xh="VaultComponent";class ep{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h){this.cipherService=e,this.router=t,this.ngZone=i,this.broadcasterService=n,this.changeDetectorRef=s,this.route=o,this.popupUtils=r,this.syncService=a,this.platformUtilsService=l,this.searchService=c,this.location=u,this.browserStateService=d,this.vaultFilterService=h,this.loaded=!1,this.cipherType=Bl,this.folderCounts=new Map,this.collectionCounts=new Map,this.typeCounts=new Map,this.showLeftHeader=!0,this.searchPending=!1,this.searchTypeSearch=!1,this.deletedCount=0,this.selectedOrganization=null,this.showCollections=!0,this.preventSelected=!1,this.noFolderListSize=100,this.searchTimeout=null,this.hasSearched=!1,this.hasLoadedAllCiphers=!1,this.allCiphers=null,this.noFolderListSize=100}get showNoFolderCiphers(){return null!=this.noFolderCiphers&&this.noFolderCiphers.length{this.ngZone.run((()=>Mh(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)window.setTimeout((()=>{this.load()}),500);this.changeDetectorRef.detectChanges()}))))}));const e=yield this.restoreState();this.route.queryParams.pipe((0,Gi.P)()).subscribe((t=>Mh(this,void 0,void 0,(function*(){var i;this.state=yield this.browserStateService.getBrowserGroupingComponentState(),(null===(i=this.state)||void 0===i?void 0:i.searchText)?this.searchText=this.state.searchText:t.searchText&&(this.searchText=t.searchText,this.location.replaceState("vault")),this.syncService.syncInProgress?this.loadedTimeout=window.setTimeout((()=>{this.loaded||this.load()}),5e3):this.load(),this.syncService.syncInProgress&&!e||window.setTimeout((()=>{var e;return this.popupUtils.setContentScrollY(window,null===(e=this.state)||void 0===e?void 0:e.scrollY)}),0)}))))}))}ngOnDestroy(){null!=this.loadedTimeout&&window.clearTimeout(this.loadedTimeout),null!=this.selectedTimeout&&window.clearTimeout(this.selectedTimeout),this.saveState(),this.broadcasterService.unsubscribe(Xh)}load(){return Mh(this,void 0,void 0,(function*(){this.vaultFilter=this.vaultFilterService.getVaultFilter(),this.updateSelectedOrg(),yield this.loadCollectionsAndFolders(),yield this.loadCiphers(),this.showNoFolderCiphers&&this.nestedFolders.length>0&&(this.nestedFolders=this.nestedFolders.slice(0,this.nestedFolders.length-1)),this.loaded=!0}))}loadCiphers(){return Mh(this,void 0,void 0,(function*(){this.allCiphers=yield this.cipherService.getAllDecrypted(),this.hasLoadedAllCiphers||(this.hasLoadedAllCiphers=!this.searchService.isSearchable(this.searchText)),yield this.search(null),this.getCounts()}))}loadCollections(){return Mh(this,void 0,void 0,(function*(){const e=yield this.vaultFilterService.buildCollections(this.selectedOrganization);this.collections=e.fullList,this.nestedCollections=e.nestedList}))}loadFolders(){return Mh(this,void 0,void 0,(function*(){const e=yield(0,Ku.z)(this.vaultFilterService.buildNestedFolders(this.selectedOrganization));this.folders=e.fullList,this.nestedFolders=e.nestedList}))}search(e=null){return Mh(this,void 0,void 0,(function*(){this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout);const t=e=>!e.isDeleted;if(null==e)return this.hasSearched=this.searchService.isSearchable(this.searchText),this.ciphers=yield this.searchService.searchCiphers(this.searchText,t,this.allCiphers),void(this.ciphers=this.ciphers.filter((e=>!this.vaultFilterService.filterCipherForSelectedVault(e))));this.searchPending=!0,this.searchTimeout=setTimeout((()=>Mh(this,void 0,void 0,(function*(){this.hasSearched=this.searchService.isSearchable(this.searchText),this.hasLoadedAllCiphers||this.hasSearched?this.ciphers=yield this.searchService.searchCiphers(this.searchText,t,this.allCiphers):yield this.loadCiphers(),this.ciphers=this.ciphers.filter((e=>!this.vaultFilterService.filterCipherForSelectedVault(e))),this.searchPending=!1}))),e)}))}selectType(e){return Mh(this,void 0,void 0,(function*(){this.router.navigate(["/ciphers"],{queryParams:{type:e}})}))}selectFolder(e){return Mh(this,void 0,void 0,(function*(){this.router.navigate(["/ciphers"],{queryParams:{folderId:e.id||"none"}})}))}selectCollection(e){return Mh(this,void 0,void 0,(function*(){this.router.navigate(["/ciphers"],{queryParams:{collectionId:e.id}})}))}selectTrash(){return Mh(this,void 0,void 0,(function*(){this.router.navigate(["/ciphers"],{queryParams:{deleted:!0}})}))}selectCipher(e){return Mh(this,void 0,void 0,(function*(){this.selectedTimeout=window.setTimeout((()=>{this.preventSelected||this.router.navigate(["/view-cipher"],{queryParams:{cipherId:e.id}}),this.preventSelected=!1}),200)}))}launchCipher(e){return Mh(this,void 0,void 0,(function*(){e.type===Bl.Login&&e.login.canLaunch&&(null!=this.selectedTimeout&&window.clearTimeout(this.selectedTimeout),this.preventSelected=!0,yield this.cipherService.updateLastLaunchedDate(e.id),Wt.createNewTab(e.login.launchUri),this.popupUtils.inPopup(window)&&Wt.closePopup(window))}))}addCipher(){return Mh(this,void 0,void 0,(function*(){this.router.navigate(["/add-cipher"],{queryParams:{selectedVault:this.vaultFilter.selectedOrganizationId}})}))}vaultFilterChanged(){return Mh(this,void 0,void 0,(function*(){this.showSearching&&(yield this.search()),this.updateSelectedOrg(),yield this.loadCollectionsAndFolders(),this.getCounts()}))}updateSelectedOrg(){this.vaultFilter=this.vaultFilterService.getVaultFilter(),null!=this.vaultFilter.selectedOrganizationId?this.selectedOrganization=this.vaultFilter.selectedOrganizationId:this.selectedOrganization=null}getCounts(){var e;let t=null,i=null;const n=new Map,s=new Map,o=new Map;this.deletedCount=this.allCiphers.filter((e=>e.isDeleted&&!this.vaultFilterService.filterCipherForSelectedVault(e))).length,null===(e=this.ciphers)||void 0===e||e.forEach((e=>{if(!this.vaultFilterService.filterCipherForSelectedVault(e)){if(e.isDeleted)return;e.favorite&&(null==t&&(t=[]),t.push(e)),null==e.folderId&&(null==i&&(i=[]),i.push(e)),o.has(e.type)?o.set(e.type,o.get(e.type)+1):o.set(e.type,1),n.has(e.folderId)?n.set(e.folderId,n.get(e.folderId)+1):n.set(e.folderId,1),null!=e.collectionIds&&e.collectionIds.forEach((e=>{s.has(e)?s.set(e,s.get(e)+1):s.set(e,1)}))}})),this.favoriteCiphers=t,this.noFolderCiphers=i,this.typeCounts=o,this.folderCounts=n,this.collectionCounts=s}showSearching(){return this.hasSearched||!this.searchPending&&this.searchService.isSearchable(this.searchText)}closeOnEsc(e){"Escape"!==e.key||null!=this.searchText&&""!==this.searchText||Wt.closePopup(window)}loadCollectionsAndFolders(){return Mh(this,void 0,void 0,(function*(){this.showCollections=!this.vaultFilter.myVaultOnly,yield this.loadFolders(),yield this.loadCollections()}))}saveState(){return Mh(this,void 0,void 0,(function*(){this.state={scrollY:this.popupUtils.getContentScrollY(window),searchText:this.searchText,favoriteCiphers:this.favoriteCiphers,noFolderCiphers:this.noFolderCiphers,ciphers:this.ciphers,collectionCounts:this.collectionCounts,folderCounts:this.folderCounts,typeCounts:this.typeCounts,folders:this.folders,collections:this.collections,deletedCount:this.deletedCount},yield this.browserStateService.setBrowserGroupingComponentState(this.state)}))}restoreState(){return Mh(this,void 0,void 0,(function*(){return this.state=yield this.browserStateService.getBrowserGroupingComponentState(),null!=this.state&&(null!=this.state.favoriteCiphers&&(this.favoriteCiphers=this.state.favoriteCiphers),null!=this.state.noFolderCiphers&&(this.noFolderCiphers=this.state.noFolderCiphers),null!=this.state.ciphers&&(this.ciphers=this.state.ciphers),null!=this.state.collectionCounts&&(this.collectionCounts=this.state.collectionCounts),null!=this.state.folderCounts&&(this.folderCounts=this.state.folderCounts),null!=this.state.typeCounts&&(this.typeCounts=this.state.typeCounts),null!=this.state.folders&&(this.folders=this.state.folders),null!=this.state.collections&&(this.collections=this.state.collections),null!=this.state.deletedCount&&(this.deletedCount=this.state.deletedCount),!0)}))}}ep.ɵfac=function(e){return new(e||ep)(s.Y36(Sc),s.Y36(Pe.F0),s.Y36(s.R0b),s.Y36(Tn),s.Y36(s.sBO),s.Y36(Pe.gz),s.Y36($t),s.Y36(bi),s.Y36(Je),s.Y36(jo),s.Y36(u.Ye),s.Y36(js),s.Y36(ju))},ep.ɵcmp=s.Xpm({type:ep,selectors:[["app-vault-filter"]],decls:40,vars:14,consts:[[1,"left"],[1,"sr-only"],[1,"search"],["id","search","autocomplete","off","appAutofocus","",3,"type","placeholder","ngModel","ngModelChange","input","keydown"],[1,"bwi","bwi-search"],[1,"right"],["type","button",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-lg","bwi-fw"],["tabindex","-1","cdk-scrollable",""],[3,"onVaultSelectionChanged"],["class","no-items",4,"ngIf"],[4,"ngIf"],[1,"no-items"],["class","bwi bwi-spinner bwi-spin bwi-3x",4,"ngIf"],[1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["aria-hidden","true",1,"no-items-image"],["type","button",1,"btn","block","primary","link",3,"click"],["class","box list",4,"ngIf"],[1,"box","list"],[1,"box-header"],[1,"flex-right"],[1,"box-content","single-line"],["type","button","appStopClick","",1,"box-content-row",3,"click"],[1,"row-main"],[1,"icon"],[1,"bwi","bwi-fw","bwi-lg","bwi-globe"],[1,"text"],[1,"row-sub-label"],[1,"bwi","bwi-angle-right","bwi-lg","row-sub-icon"],[1,"bwi","bwi-fw","bwi-lg","bwi-credit-card"],[1,"bwi","bwi-fw","bwi-lg","bwi-id-card"],[1,"bwi","bwi-fw","bwi-lg","bwi-sticky-note"],[1,"box-content"],[3,"cipher","title","onSelected","launchEvent",4,"ngFor","ngForOf"],[3,"cipher","title","onSelected","launchEvent"],["type","button","class","box-content-row","appStopClick","",3,"click",4,"ngFor","ngForOf"],[1,"bwi","bwi-fw","bwi-lg","bwi-folder"],[1,"bwi","bwi-fw","bwi-lg","bwi-collection"],[1,"bwi","bwi-fw","bwi-lg","bwi-trash"],["itemSize","46","minBufferPx","400","maxBufferPx","600",4,"ngIf"],["itemSize","46","minBufferPx","400","maxBufferPx","600"],[1,"box","list","full-list"],[3,"cipher","title","onSelected","launchEvent",4,"cdkVirtualFor","cdkVirtualForOf"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s._UZ(4,"app-pop-out"),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.TgZ(7,"h1",1),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",2),s._uU(12,"\n "),s.TgZ(13,"input",3),s.NdJ("ngModelChange",(function(e){return t.searchText=e}))("input",(function(){return t.search(200)}))("keydown",(function(e){return t.closeOnEsc(e)})),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s._UZ(16,"i",4),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.TgZ(19,"div",5),s._uU(20,"\n "),s.TgZ(21,"button",6),s.NdJ("click",(function(){return t.addCipher()})),s.ALo(22,"i18n"),s._uU(23,"\n "),s._UZ(24,"i",7),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n"),s.qZA(),s._uU(28,"\n"),s.TgZ(29,"main",8),s._uU(30,"\n "),s.TgZ(31,"app-vault-select",9),s.NdJ("onVaultSelectionChanged",(function(){return t.vaultFilterChanged()})),s.qZA(),s._uU(32,"\n "),s.YNc(33,Lh,6,2,"div",10),s._uU(34,"\n "),s.YNc(35,Vh,101,24,"ng-container",11),s._uU(36,"\n "),s.YNc(37,$h,6,2,"ng-container",11),s._uU(38,"\n"),s.qZA(),s._uU(39,"\n")),2&e&&(s.xp6(8),s.Oqu(s.lcZ(9,8,"myVault")),s.xp6(5),s.s9C("type",t.searchTypeSearch?"search":"text"),s.s9C("placeholder",s.lcZ(14,10,"searchVault")),s.Q6J("ngModel",t.searchText),s.xp6(8),s.s9C("appA11yTitle",s.lcZ(22,12,"addItem")),s.xp6(12),s.Q6J("ngIf",!(t.ciphers&&t.ciphers.length||t.showSearching())),s.xp6(2),s.Q6J("ngIf",t.ciphers&&t.ciphers.length&&!t.showSearching()),s.xp6(2),s.Q6J("ngIf",t.showSearching()))},dependencies:[u.sg,u.O5,c.PQ,ue.Fj,ue.JJ,ue.On,Ht,It,St,c.xd,c.x0,c.N7,gd,es,kd,Ze],encapsulation:2});class tp{}var ip=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const np="ViewComponent";class sp{constructor(e,t,i,n,o,r,a,l,c,u,d,h,p,g,v,y,f){this.cipherService=e,this.totpService=t,this.tokenService=i,this.i18nService=n,this.cryptoService=o,this.platformUtilsService=r,this.auditService=a,this.win=l,this.broadcasterService=c,this.ngZone=u,this.changeDetectorRef=d,this.eventService=h,this.apiService=p,this.passwordRepromptService=g,this.logService=v,this.stateService=y,this.fileDownloadService=f,this.onEditCipher=new s.vpe,this.onCloneCipher=new s.vpe,this.onShareCipher=new s.vpe,this.onDeletedCipher=new s.vpe,this.onRestoredCipher=new s.vpe,this.fieldType=_c,this.passwordReprompted=!1}ngOnInit(){this.broadcasterService.subscribe(np,(e=>{this.ngZone.run((()=>ip(this,void 0,void 0,(function*(){if("syncCompleted"===e.command)e.successfully&&(yield this.load(),this.changeDetectorRef.detectChanges())}))))}))}ngOnDestroy(){this.broadcasterService.unsubscribe(np),this.cleanUp()}load(){return ip(this,void 0,void 0,(function*(){this.cleanUp();const e=yield this.cipherService.get(this.cipherId);if(this.cipher=yield e.decrypt(),this.canAccessPremium=yield this.stateService.getCanAccessPremium(),this.showPremiumRequiredTotp=this.cipher.login.totp&&!this.canAccessPremium&&!this.cipher.organizationUseTotp,this.cipher.type===Bl.Login&&this.cipher.login.totp&&(e.organizationUseTotp||this.canAccessPremium)){yield this.totpUpdateCode();const e=this.totpService.getTimeInterval(this.cipher.login.totp);yield this.totpTick(e),this.totpInterval=setInterval((()=>ip(this,void 0,void 0,(function*(){yield this.totpTick(e)}))),1e3)}this.previousCipherId!==this.cipherId&&this.eventService.collect(Gr.Cipher_ClientViewed,this.cipherId),this.previousCipherId=this.cipherId}))}edit(){return ip(this,void 0,void 0,(function*(){return!!(yield this.promptPassword())&&(this.onEditCipher.emit(this.cipher),!0)}))}clone(){return ip(this,void 0,void 0,(function*(){return!!(yield this.promptPassword())&&(this.onCloneCipher.emit(this.cipher),!0)}))}share(){return ip(this,void 0,void 0,(function*(){return!!(yield this.promptPassword())&&(this.onShareCipher.emit(this.cipher),!0)}))}delete(){return ip(this,void 0,void 0,(function*(){if(!(yield this.promptPassword()))return;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t(this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"),this.i18nService.t("deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{yield this.deleteCipher(),this.platformUtilsService.showToast("success",null,this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")),this.onDeletedCipher.emit(this.cipher)}catch(e){this.logService.error(e)}return!0}))}restore(){return ip(this,void 0,void 0,(function*(){if(!this.cipher.isDeleted)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("restoreItemConfirmation"),this.i18nService.t("restoreItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{yield this.restoreCipher(),this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItem")),this.onRestoredCipher.emit(this.cipher)}catch(e){this.logService.error(e)}return!0}))}togglePassword(){return ip(this,void 0,void 0,(function*(){(yield this.promptPassword())&&(this.showPassword=!this.showPassword,this.showPasswordCount=!1,this.showPassword&&this.eventService.collect(Gr.Cipher_ClientToggledPasswordVisible,this.cipherId))}))}togglePasswordCount(){return ip(this,void 0,void 0,(function*(){this.showPassword&&(this.showPasswordCount=!this.showPasswordCount)}))}toggleCardNumber(){return ip(this,void 0,void 0,(function*(){(yield this.promptPassword())&&(this.showCardNumber=!this.showCardNumber,this.showCardNumber&&this.eventService.collect(Gr.Cipher_ClientToggledCardCodeVisible,this.cipherId))}))}toggleCardCode(){return ip(this,void 0,void 0,(function*(){(yield this.promptPassword())&&(this.showCardCode=!this.showCardCode,this.showCardCode&&this.eventService.collect(Gr.Cipher_ClientToggledCardCodeVisible,this.cipherId))}))}checkPassword(){return ip(this,void 0,void 0,(function*(){if(null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password)return;this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password);const e=yield this.checkPasswordPromise;e>0?this.platformUtilsService.showToast("warning",null,this.i18nService.t("passwordExposed",e.toString())):this.platformUtilsService.showToast("success",null,this.i18nService.t("passwordSafe"))}))}launch(e,t){e.canLaunch&&(t&&this.cipherService.updateLastLaunchedDate(t),this.platformUtilsService.launchUri(e.launchUri))}copy(e,t,i){return ip(this,void 0,void 0,(function*(){if(null==e)return;if(this.passwordRepromptService.protectedFields().includes(i)&&!(yield this.promptPassword()))return;const n=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e,n),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t(t))),"password"===t?this.eventService.collect(Gr.Cipher_ClientToggledHiddenFieldVisible,this.cipherId):"securityCode"===t?this.eventService.collect(Gr.Cipher_ClientCopiedCardCode,this.cipherId):"H_Field"===i&&this.eventService.collect(Gr.Cipher_ClientCopiedHiddenField,this.cipherId)}))}setTextDataOnDrag(e,t){e.dataTransfer.setData("text",t)}downloadAttachment(e){return ip(this,void 0,void 0,(function*(){if(!(yield this.promptPassword()))return;const t=e;if(t.downloading)return;if(null==this.cipher.organizationId&&!this.canAccessPremium)return void this.platformUtilsService.showToast("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc"));let i;try{i=(yield this.apiService.getAttachmentData(this.cipher.id,e.id)).url}catch(t){if(!(t instanceof Ou&&404===t.statusCode))throw t instanceof Ou?new Error(t.getSingleMessage()):t;i=e.url}t.downloading=!0;const n=yield fetch(new Request(i,{cache:"no-store"}));if(200!==n.status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),void(t.downloading=!1);try{const t=yield Cu.fromResponse(n),i=null!=e.key?e.key:yield this.cryptoService.getOrgKey(this.cipher.organizationId),s=yield this.cryptoService.decryptFromBytes(t,i);this.fileDownloadService.download({fileName:e.fileName,blobData:s})}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}t.downloading=!1}))}deleteCipher(){return this.cipher.isDeleted?this.cipherService.deleteWithServer(this.cipher.id):this.cipherService.softDeleteWithServer(this.cipher.id)}restoreCipher(){return this.cipherService.restoreWithServer(this.cipher.id)}promptPassword(){return ip(this,void 0,void 0,(function*(){return!(this.cipher.reprompt!==Kl.None&&!this.passwordReprompted)||(this.passwordReprompted=yield this.passwordRepromptService.showPasswordPrompt())}))}cleanUp(){this.totpCode=null,this.cipher=null,this.showPassword=!1,this.showCardNumber=!1,this.showCardCode=!1,this.passwordReprompted=!1,this.totpInterval&&clearInterval(this.totpInterval)}totpUpdateCode(){return ip(this,void 0,void 0,(function*(){if(null!=this.cipher&&this.cipher.type===Bl.Login&&null!=this.cipher.login.totp)if(this.totpCode=yield this.totpService.getCode(this.cipher.login.totp),null!=this.totpCode)if(this.totpCode.length>4){const e=Math.floor(this.totpCode.length/2);this.totpCodeFormatted=this.totpCode.substring(0,e)+" "+this.totpCode.substring(e)}else this.totpCodeFormatted=this.totpCode;else this.totpCodeFormatted=null,this.totpInterval&&clearInterval(this.totpInterval);else this.totpInterval&&clearInterval(this.totpInterval)}))}totpTick(e){return ip(this,void 0,void 0,(function*(){const t=Math.round((new Date).getTime()/1e3)%e;this.totpSec=e-t,this.totpDash=+(Math.round(78.6/e*t+"e+2")+"e-2"),this.totpLow=this.totpSec<=7,0===t&&(yield this.totpUpdateCode())}))}}sp.ɵfac=function(e){return new(e||sp)(s.Y36(Sc),s.Y36(Ma),s.Y36(tp),s.Y36(_e),s.Y36(zt),s.Y36(Je),s.Y36(Uc),s.Y36(Window),s.Y36(Tn),s.Y36(s.R0b),s.Y36(s.sBO),s.Y36(jr),s.Y36(Tt),s.Y36(Ac),s.Y36(Ct),s.Y36(Mt),s.Y36($r))},sp.ɵdir=s.lG2({type:sp,inputs:{cipherId:"cipherId"},outputs:{onEditCipher:"onEditCipher",onCloneCipher:"onCloneCipher",onShareCipher:"onShareCipher",onDeletedCipher:"onDeletedCipher",onRestoredCipher:"onRestoredCipher"}});var op=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class rp{constructor(e){this.eventService=e,this.fieldType=_c}toggleFieldValue(e){return op(this,void 0,void 0,(function*(){if(!(yield this.promptPassword()))return;const t=e;t.showValue=!t.showValue,t.showCount=!1,t.showValue&&this.eventService.collect(Gr.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id)}))}toggleFieldCount(e){return op(this,void 0,void 0,(function*(){e.showValue&&(e.showCount=!e.showCount)}))}setTextDataOnDrag(e,t){e.dataTransfer.setData("text",t)}}rp.ɵfac=function(e){return new(e||rp)(s.Y36(jr))},rp.ɵdir=s.lG2({type:rp,inputs:{cipher:"cipher",promptPassword:"promptPassword",copy:"copy"}});class ap extends ts{transform(e){return this.generateTemplate(e,((e,t,i)=>`\n ${e}${i+1}\n `))}}function lp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span",11),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw().$implicit,n=s.oxw();return s.KtG(n.setTextDataOnDrag(t,i.value))})),s._uU(1),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.xp6(1),s.Oqu(e.name)}}function cp(e,t){if(1&e&&(s.TgZ(0,"span",12),s._uU(1),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.Oqu(e.name)}}function up(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij("\n ",e.value||" ","\n ")}}function dp(e,t){if(1&e&&(s.TgZ(0,"span",16),s._uU(1),s.qZA()),2&e){const e=s.oxw(2).$implicit;s.xp6(1),s.Oqu(e.maskedValue)}}function hp(e,t){if(1&e&&(s._UZ(0,"span",17),s.ALo(1,"colorPassword")),2&e){const e=s.oxw(2).$implicit;s.Q6J("innerHTML",s.lcZ(1,1,e.value),s.oJD)}}function pp(e,t){if(1&e&&(s._UZ(0,"span",18),s.ALo(1,"colorPasswordCount")),2&e){const e=s.oxw(2).$implicit;s.Q6J("innerHTML",s.lcZ(1,1,e.value),s.oJD)}}function gp(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,dp,2,1,"span",13),s._uU(3,"\n "),s.YNc(4,hp,2,3,"span",14),s._uU(5,"\n "),s.YNc(6,pp,2,3,"span",15),s._uU(7,"\n "),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(2),s.Q6J("ngIf",!e.showValue),s.xp6(2),s.Q6J("ngIf",e.showValue&&!e.showCount),s.xp6(2),s.Q6J("ngIf",e.showValue&&e.showCount)}}function vp(e,t){1&e&&s._UZ(0,"i",22)}function yp(e,t){1&e&&s._UZ(0,"i",23)}function fp(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,vp,1,0,"i",19),s._uU(3,"\n "),s.YNc(4,yp,1,0,"i",20),s._uU(5,"\n "),s.TgZ(6,"span",21),s._uU(7),s.qZA(),s._uU(8,"\n "),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(2),s.Q6J("ngIf","true"===e.value),s.xp6(2),s.Q6J("ngIf","true"!==e.value),s.xp6(3),s.Oqu(e.value)}}function mp(e,t){if(1&e&&(s.TgZ(0,"div",24),s._uU(1,"\n "),s.TgZ(2,"div",25),s._uU(3,"\n "),s._UZ(4,"i",26),s.ALo(5,"i18n"),s._uU(6,"\n "),s.TgZ(7,"span",21),s._uU(8),s.ALo(9,"i18n"),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"span"),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s.qZA()),2&e){const e=s.oxw().$implicit,t=s.oxw();s.xp6(4),s.s9C("appA11yTitle",s.lcZ(5,3,"linkedValue")),s.xp6(4),s.Oqu(s.lcZ(9,5,"linkedValue")),s.xp6(5),s.Oqu(s.lcZ(14,7,t.cipher.linkedFieldI18nKey(e.linkedId)))}}function wp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw();return s.KtG(i.toggleFieldCount(t))})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",28),s._uU(5,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.zWS("aria-label","",s.lcZ(1,4,"toggleCharacterCount")," ",e.name,""),s.s9C("appA11yTitle",s.lcZ(2,6,"toggleCharacterCount")),s.uIk("aria-pressed",e.showCount)}}ap.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(ap)))(t||ap)}}(),ap.ɵpipe=s.Yjl({name:"colorPasswordCount",type:ap,pure:!0});const bp=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Sp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw();return s.KtG(i.toggleFieldValue(t))})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",29),s._uU(5,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.zWS("aria-label","",s.lcZ(1,5,"toggleVisibility")," ",e.name,""),s.s9C("appA11yTitle",s.lcZ(2,7,"toggleVisibility")),s.uIk("aria-pressed",e.showValue),s.xp6(4),s.Q6J("ngClass",s.WLB(9,bp,!e.showValue,e.showValue))}}function Up(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",27),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw();return s.KtG(i.copy(t.value,"value",t.type===i.fieldType.Hidden?"H_Field":"Field"))})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",30),s._uU(5,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.zWS("aria-label","",s.lcZ(1,3,"copyValue")," ",e.name,""),s.s9C("appA11yTitle",s.lcZ(2,5,"copyValue"))}}function xp(e,t){if(1&e&&(s.TgZ(0,"div",3),s._uU(1,"\n "),s.TgZ(2,"div",4),s._uU(3,"\n "),s.YNc(4,lp,2,1,"span",5),s._uU(5,"\n "),s.YNc(6,cp,2,1,"span",6),s._uU(7,"\n "),s.YNc(8,up,2,1,"div",7),s._uU(9,"\n "),s.YNc(10,gp,8,3,"div",7),s._uU(11,"\n "),s.YNc(12,fp,9,3,"div",7),s._uU(13,"\n "),s.YNc(14,mp,16,9,"div",8),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"div",9),s._uU(18,"\n "),s.YNc(19,wp,6,8,"button",10),s._uU(20,"\n "),s.YNc(21,Sp,6,12,"button",10),s._uU(22,"\n "),s.YNc(23,Up,6,7,"button",10),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.qZA()),2&e){const e=t.$implicit,i=s.oxw();s.xp6(4),s.Q6J("ngIf",e.type!=i.fieldType.Linked),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Linked),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Text),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Hidden),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Boolean),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Linked),s.xp6(5),s.Q6J("ngIf",e.type===i.fieldType.Hidden&&i.cipher.viewPassword&&e.showValue),s.xp6(2),s.Q6J("ngIf",e.type===i.fieldType.Hidden&&i.cipher.viewPassword),s.xp6(2),s.Q6J("ngIf",e.value&&e.type!==i.fieldType.Boolean&&e.type!==i.fieldType.Linked&&!(e.type===i.fieldType.Hidden&&!i.cipher.viewPassword))}}class Ap extends rp{constructor(e){super(e)}}Ap.ɵfac=function(e){return new(e||Ap)(s.Y36(jr))},Ap.ɵcmp=s.Xpm({type:Ap,selectors:[["app-vault-view-custom-fields"]],features:[s.qOj],decls:12,vars:4,consts:[[1,"box-header"],[1,"box-content"],["class","box-content-row box-content-row-flex",4,"ngFor","ngForOf"],[1,"box-content-row","box-content-row-flex"],[1,"row-main"],["class","row-label draggable","draggable","true",3,"dragstart",4,"ngIf"],["class","row-label",4,"ngIf"],[4,"ngIf"],["class","box-content-row-flex",4,"ngIf"],[1,"action-buttons","action-buttons-fixed"],["type","button","class","row-btn","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["draggable","true",1,"row-label","draggable",3,"dragstart"],[1,"row-label"],["class","monospaced",4,"ngIf"],["class","monospaced show-whitespace",3,"innerHTML",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[1,"monospaced"],[1,"monospaced","show-whitespace",3,"innerHTML"],[3,"innerHTML"],["class","bwi bwi-check-square","aria-hidden","true",4,"ngIf"],["class","bwi bwi-square","aria-hidden","true",4,"ngIf"],[1,"sr-only"],["aria-hidden","true",1,"bwi","bwi-check-square"],["aria-hidden","true",1,"bwi","bwi-square"],[1,"box-content-row-flex"],[1,"icon","icon-small"],["aria-hidden","true",1,"bwi","bwi-link",3,"appA11yTitle"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-numbered-list"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"]],template:function(e,t){1&e&&(s.ynx(0),s._uU(1,"\n "),s.TgZ(2,"h2",0),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",1),s._uU(7,"\n "),s.YNc(8,xp,26,9,"div",2),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n"),s.BQk(),s._uU(11,"\n")),2&e&&(s.xp6(3),s.hij("\n ",s.lcZ(4,2,"customFields"),"\n "),s.xp6(5),s.Q6J("ngForOf",t.cipher.fields))},dependencies:[u.mk,u.sg,u.O5,Ht,St,ap,ts,Ze],encapsulation:2});var _p=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Zp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",1),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.edit())})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}2&e&&(s.xp6(1),s.hij("\n ",s.lcZ(2,1,"edit"),"\n "))}function Tp(e,t){if(1&e&&(s.TgZ(0,"div",6),s._uU(1,"\n "),s.YNc(2,Zp,3,3,"button",7),s._uU(3,"\n "),s.qZA()),2&e){const e=s.oxw();s.xp6(2),s.Q6J("ngIf",!e.cipher.isDeleted)}}function Cp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",29),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"label",31),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.login.username))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s._UZ(8,"input",32),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"div",33),s._uU(12,"\n "),s.TgZ(13,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.cipher.login.username,"username","Username"))})),s.ALo(14,"i18n"),s._uU(15,"\n "),s._UZ(16,"i",35),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s.qZA(),s._uU(19,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.hij("",s.lcZ(6,3,"username"),"\n "),s.xp6(3),s.Q6J("value",e.cipher.login.username),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(14,5,"copyUsername"))}}function kp(e,t){if(1&e&&(s.TgZ(0,"div",43),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.hij("\n ",e.cipher.login.maskedPassword,"\n ")}}function Op(e,t){if(1&e&&(s._UZ(0,"div",44),s.ALo(1,"colorPassword")),2&e){const e=s.oxw(4);s.Q6J("innerHTML",s.lcZ(1,1,e.cipher.login.password),s.oJD)}}function Pp(e,t){if(1&e&&(s._UZ(0,"div",45),s.ALo(1,"colorPasswordCount")),2&e){const e=s.oxw(4);s.Q6J("innerHTML",s.lcZ(1,1,e.cipher.login.password),s.oJD)}}function Ip(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",46,47),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.checkPassword())})),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",48),s._uU(5,"\n "),s._UZ(6,"i",49),s._uU(7,"\n "),s.qZA()}if(2&e){const e=s.MAs(1),t=s.oxw(4);s.s9C("appA11yTitle",s.lcZ(2,5,"checkPassword")),s.Q6J("appApiAction",t.checkPasswordPromise)("disabled",e.loading),s.xp6(4),s.Q6J("hidden",e.loading),s.xp6(2),s.Q6J("hidden",!e.loading)}}function qp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.togglePasswordCount())})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",50),s._uU(6,"\n "),s.qZA()}if(2&e){const e=s.oxw(4);s.zWS("aria-label","",s.lcZ(1,4,"toggleCharacterCount")," ",s.lcZ(2,6,"password"),""),s.s9C("appA11yTitle",s.lcZ(3,8,"toggleCharacterCount")),s.uIk("aria-pressed",e.showPasswordCount)}}const Dp=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};function Mp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.togglePassword())})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s.ALo(3,"i18n"),s._uU(4,"\n "),s._UZ(5,"i",51),s._uU(6,"\n "),s.qZA()}if(2&e){const e=s.oxw(4);s.zWS("aria-label","",s.lcZ(1,5,"toggleVisibility")," ",s.lcZ(2,7,"password"),""),s.s9C("appA11yTitle",s.lcZ(3,9,"toggleVisibility")),s.uIk("aria-pressed",e.showPassword),s.xp6(5),s.Q6J("ngClass",s.WLB(11,Dp,!e.showPassword,e.showPassword))}}function Fp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(4);return s.KtG(t.copy(t.cipher.login.password,"password","Password"))})),s.ALo(1,"i18n"),s._uU(2,"\n "),s._UZ(3,"i",35),s._uU(4,"\n "),s.qZA()}2&e&&s.s9C("appA11yTitle",s.lcZ(1,1,"copyPassword"))}function Np(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",29),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.login.password))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.YNc(8,kp,2,1,"div",37),s._uU(9,"\n "),s.YNc(10,Op,2,3,"div",38),s._uU(11,"\n "),s.YNc(12,Pp,2,3,"div",39),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"div",40),s._uU(16,"\n "),s.YNc(17,Ip,8,7,"button",41),s._uU(18,"\n "),s.YNc(19,qp,7,10,"button",42),s._uU(20,"\n "),s.YNc(21,Mp,7,14,"button",42),s._uU(22,"\n "),s.YNc(23,Fp,5,3,"button",42),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,8,"password")),s.xp6(3),s.Q6J("ngIf",!e.showPassword),s.xp6(2),s.Q6J("ngIf",e.showPassword&&!e.showPasswordCount),s.xp6(2),s.Q6J("ngIf",e.showPassword&&e.showPasswordCount),s.xp6(5),s.Q6J("ngIf",e.cipher.viewPassword),s.xp6(2),s.Q6J("ngIf",e.showPassword),s.xp6(2),s.Q6J("ngIf",e.cipher.viewPassword),s.xp6(2),s.Q6J("ngIf",e.cipher.viewPassword)}}const Lp=function(e){return{low:e}},Ep=function(e){return{"stroke-dashoffset.px":e}};function Rp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",52),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.totpCode))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"span",53),s._uU(9),s.qZA(),s._uU(10,"\n "),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"span",54),s._uU(13,"\n "),s.TgZ(14,"span",55),s._uU(15),s.qZA(),s._uU(16,"\n "),s.O4$(),s.TgZ(17,"svg"),s._uU(18,"\n "),s.TgZ(19,"g"),s._uU(20,"\n "),s._UZ(21,"circle",56),s._uU(22,"\n "),s._UZ(23,"circle",57),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n "),s.kcU(),s.TgZ(28,"div",33),s._uU(29,"\n "),s.TgZ(30,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.totpCode,"verificationCodeTotp","TOTP"))})),s.ALo(31,"i18n"),s._uU(32,"\n "),s._UZ(33,"i",35),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.Q6J("ngClass",s.VKq(10,Lp,e.totpLow)),s.xp6(5),s.Oqu(s.lcZ(6,6,"verificationCodeTotp")),s.xp6(4),s.Oqu(e.totpCodeFormatted),s.xp6(6),s.Oqu(e.totpSec),s.xp6(6),s.Q6J("ngStyle",s.VKq(12,Ep,e.totpDash)),s.xp6(9),s.s9C("appA11yTitle",s.lcZ(31,8,"copyVerificationCode"))}}function Jp(e,t){1&e&&(s.TgZ(0,"div",58),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"span",59),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"span",59),s._uU(9,"\n "),s.TgZ(10,"a",60),s._uU(11),s.ALo(12,"i18n"),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA()),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,2,"verificationCodeTotp")),s.xp6(6),s.hij("\n ",s.lcZ(12,4,"premiumSubcriptionRequired"),"\n "))}function Yp(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,Cp,20,7,"div",26),s._uU(3,"\n "),s.YNc(4,Np,26,10,"div",26),s._uU(5,"\n "),s.YNc(6,Rp,37,14,"div",27),s._uU(7,"\n\n "),s.YNc(8,Jp,16,6,"div",28),s._uU(9,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.cipher.login.username),s.xp6(2),s.Q6J("ngIf",e.cipher.login.password),s.xp6(2),s.Q6J("ngIf",e.cipher.login.totp&&e.totpCode),s.xp6(2),s.Q6J("ngIf",e.showPremiumRequiredTotp)}}function zp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.card.cardholderName))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"cardholderName")),s.xp6(2),s.hij("\n ",e.cipher.card.cardholderName,"\n ")}}function Kp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",29),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.card.number))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"span",62),s._uU(9),s.ALo(10,"creditCardNumber"),s.qZA(),s._uU(11,"\n "),s.TgZ(12,"span",62),s._uU(13),s.ALo(14,"creditCardNumber"),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.TgZ(17,"div",33),s._uU(18,"\n "),s.TgZ(19,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.toggleCardNumber())})),s.ALo(20,"i18n"),s.ALo(21,"i18n"),s.ALo(22,"i18n"),s._uU(23,"\n "),s._UZ(24,"i",51),s._uU(25,"\n "),s.qZA(),s._uU(26,"\n "),s.TgZ(27,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.cipher.card.number,"number","Card Number"))})),s.ALo(28,"i18n"),s._uU(29,"\n "),s._UZ(30,"i",35),s._uU(31,"\n "),s.qZA(),s._uU(32,"\n "),s.qZA(),s._uU(33,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,11,"number")),s.xp6(3),s.Q6J("hidden",e.showCardNumber),s.xp6(1),s.Oqu(s.xi3(10,13,e.cipher.card.maskedNumber,e.cipher.card.brand)),s.xp6(3),s.Q6J("hidden",!e.showCardNumber),s.xp6(1),s.Oqu(s.xi3(14,16,e.cipher.card.number,e.cipher.card.brand)),s.xp6(6),s.zWS("aria-label","",s.lcZ(20,19,"toggleVisibility")," ",s.lcZ(21,21,"number"),""),s.s9C("appA11yTitle",s.lcZ(22,23,"toggleVisibility")),s.uIk("aria-pressed",e.showCardNumber),s.xp6(5),s.Q6J("ngClass",s.WLB(27,Dp,!e.showCardNumber,e.showCardNumber)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(28,25,"copyNumber"))}}function Bp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.card.brand))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"brand")),s.xp6(2),s.hij("\n ",e.cipher.card.brand,"\n ")}}function Gp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.card.expiration))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"expiration")),s.xp6(2),s.hij("\n ",e.cipher.card.expiration,"\n ")}}function Qp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",29),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.TgZ(4,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.card.code))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"span",62),s._uU(9),s.qZA(),s._uU(10,"\n "),s.TgZ(11,"span",62),s._uU(12),s.qZA(),s._uU(13,"\n "),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"div",33),s._uU(16,"\n "),s.TgZ(17,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.toggleCardCode())})),s.ALo(18,"i18n"),s.ALo(19,"i18n"),s.ALo(20,"i18n"),s._uU(21,"\n "),s._UZ(22,"i",51),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(3);return s.KtG(t.copy(t.cipher.card.code,"securityCode","Security Code"))})),s.ALo(26,"i18n"),s._uU(27,"\n "),s._UZ(28,"i",35),s._uU(29,"\n "),s.qZA(),s._uU(30,"\n "),s.qZA(),s._uU(31,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(5),s.Oqu(s.lcZ(6,11,"securityCode")),s.xp6(3),s.Q6J("hidden",e.showCardCode),s.xp6(1),s.Oqu(e.cipher.card.maskedCode),s.xp6(2),s.Q6J("hidden",!e.showCardCode),s.xp6(1),s.Oqu(e.cipher.card.code),s.xp6(5),s.zWS("aria-label","",s.lcZ(18,13,"toggleVisibility")," ",s.lcZ(19,15,"securityCode"),""),s.s9C("appA11yTitle",s.lcZ(20,17,"toggleVisibility")),s.uIk("aria-pressed",e.showCardCode),s.xp6(5),s.Q6J("ngClass",s.WLB(21,Dp,!e.showCardCode,e.showCardCode)),s.xp6(3),s.s9C("appA11yTitle",s.lcZ(26,19,"copySecurityCode"))}}function Vp(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,zp,6,4,"div",61),s._uU(3,"\n "),s.YNc(4,Kp,34,30,"div",26),s._uU(5,"\n "),s.YNc(6,Bp,6,4,"div",61),s._uU(7,"\n "),s.YNc(8,Gp,6,4,"div",61),s._uU(9,"\n "),s.YNc(10,Qp,32,24,"div",26),s._uU(11,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.cipher.card.cardholderName),s.xp6(2),s.Q6J("ngIf",e.cipher.card.number),s.xp6(2),s.Q6J("ngIf",e.cipher.card.brand),s.xp6(2),s.Q6J("ngIf",e.cipher.card.expiration),s.xp6(2),s.Q6J("ngIf",e.cipher.card.code)}}function Hp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.fullName))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"identityName")),s.xp6(2),s.hij("\n ",e.cipher.identity.fullName,"\n ")}}function jp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.username))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"username")),s.xp6(2),s.hij("\n ",e.cipher.identity.username,"\n ")}}function Wp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.company))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"company")),s.xp6(2),s.hij("\n ",e.cipher.identity.company,"\n ")}}function $p(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.ssn))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"ssn")),s.xp6(2),s.hij("\n ",e.cipher.identity.ssn,"\n ")}}function Xp(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.passportNumber))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"passportNumber")),s.xp6(2),s.hij("\n ",e.cipher.identity.passportNumber,"\n ")}}function eg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.licenseNumber))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"licenseNumber")),s.xp6(2),s.hij("\n ",e.cipher.identity.licenseNumber,"\n ")}}function tg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.email))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"email")),s.xp6(2),s.hij("\n ",e.cipher.identity.email,"\n ")}}function ig(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,i.cipher.identity.phone))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,2,"phone")),s.xp6(2),s.hij("\n ",e.cipher.identity.phone,"\n ")}}function ng(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.Oqu(e.cipher.identity.address1)}}function sg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.Oqu(e.cipher.identity.address2)}}function og(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.Oqu(e.cipher.identity.address3)}}function rg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.Oqu(e.cipher.identity.fullAddressPart2)}}function ag(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&e){const e=s.oxw(4);s.xp6(1),s.Oqu(e.cipher.identity.country)}}function lg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",12),s._uU(1,"\n "),s.TgZ(2,"span",36),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(3);return s.KtG(i.setTextDataOnDrag(t,(i.cipher.identity.address1?i.cipher.identity.address1+"\n":"")+(i.cipher.identity.address2?i.cipher.identity.address2+"\n":"")+(i.cipher.identity.address3?i.cipher.identity.address3+"\n":"")+(i.cipher.identity.fullAddressPart2?i.cipher.identity.fullAddressPart2+"\n":"")+(i.cipher.identity.country?i.cipher.identity.country:"")))})),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.YNc(6,ng,2,1,"div",15),s._uU(7,"\n "),s.YNc(8,sg,2,1,"div",15),s._uU(9,"\n "),s.YNc(10,og,2,1,"div",15),s._uU(11,"\n "),s.YNc(12,rg,2,1,"div",15),s._uU(13,"\n "),s.YNc(14,ag,2,1,"div",15),s._uU(15,"\n "),s.qZA()}if(2&e){const e=s.oxw(3);s.xp6(3),s.Oqu(s.lcZ(4,6,"address")),s.xp6(3),s.Q6J("ngIf",e.cipher.identity.address1),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.address2),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.address3),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.fullAddressPart2),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.country)}}function cg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.YNc(2,Hp,6,4,"div",61),s._uU(3,"\n "),s.YNc(4,jp,6,4,"div",61),s._uU(5,"\n "),s.YNc(6,Wp,6,4,"div",61),s._uU(7,"\n "),s.YNc(8,$p,6,4,"div",61),s._uU(9,"\n "),s.YNc(10,Xp,6,4,"div",61),s._uU(11,"\n "),s.YNc(12,eg,6,4,"div",61),s._uU(13,"\n "),s.YNc(14,tg,6,4,"div",61),s._uU(15,"\n "),s.YNc(16,ig,6,4,"div",61),s._uU(17,"\n "),s.YNc(18,lg,16,8,"div",61),s._uU(19,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("ngIf",e.cipher.identity.fullName),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.username),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.company),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.ssn),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.passportNumber),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.licenseNumber),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.email),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.phone),s.xp6(2),s.Q6J("ngIf",e.cipher.identity.address1||e.cipher.identity.city||e.cipher.identity.country)}}function ug(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"label",67),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw().$implicit,n=s.oxw(3);return s.KtG(n.setTextDataOnDrag(t,i.uri))})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}if(2&e){const e=s.oxw().index;s.MGl("for","hostOrUri",e,""),s.xp6(1),s.Oqu(s.lcZ(2,2,"uri"))}}function dg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"label",67),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw().$implicit,n=s.oxw(3);return s.KtG(n.setTextDataOnDrag(t,i.uri))})),s._uU(1),s.ALo(2,"i18n"),s.qZA()}if(2&e){const e=s.oxw().index;s.MGl("for","hostOrUri",e,""),s.xp6(1),s.Oqu(s.lcZ(2,2,"website"))}}function hg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",34),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,i=s.oxw(3);return s.KtG(i.launch(t))})),s.ALo(1,"i18n"),s.ALo(2,"i18n"),s._uU(3,"\n "),s._UZ(4,"i",68),s._uU(5,"\n "),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.zWS("aria-label","",s.lcZ(1,3,"launch")," ",e.uri,""),s.s9C("appA11yTitle",s.lcZ(2,5,"launch"))}}function pg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",29),s._uU(1,"\n "),s.TgZ(2,"div",30),s._uU(3,"\n "),s.YNc(4,ug,3,4,"label",64),s._uU(5,"\n "),s.YNc(6,dg,3,4,"label",64),s._uU(7,"\n "),s.TgZ(8,"span",65),s._uU(9,"\n "),s._UZ(10,"input",66),s._uU(11,"\n "),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.TgZ(14,"div",33),s._uU(15,"\n "),s.YNc(16,hg,6,7,"button",42),s._uU(17,"\n "),s.TgZ(18,"button",34),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.copy(t.uri,t.isWebsite?"website":"uri","URI"))})),s.ALo(19,"i18n"),s.ALo(20,"i18n"),s._uU(21,"\n "),s._UZ(22,"i",35),s._uU(23,"\n "),s.qZA(),s._uU(24,"\n "),s.qZA(),s._uU(25,"\n "),s.qZA()}if(2&e){const e=t.$implicit,i=t.index;s.xp6(4),s.Q6J("ngIf",!e.isWebsite),s.xp6(2),s.Q6J("ngIf",e.isWebsite),s.xp6(2),s.s9C("title",e.uri),s.xp6(2),s.MGl("id","hostOrUri",i,""),s.Q6J("value",e.hostOrUri),s.xp6(6),s.Q6J("ngIf",e.canLaunch),s.xp6(2),s.zWS("aria-label","",s.lcZ(19,9,"copyUri")," ",e.uri,""),s.s9C("appA11yTitle",s.lcZ(20,11,"copyUri"))}}function gg(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"div",11),s._uU(3,"\n "),s.YNc(4,pg,26,13,"div",63),s._uU(5,"\n "),s.qZA(),s._uU(6,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(4),s.Q6J("ngForOf",e.cipher.login.uris)}}function vg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"h2",10),s._uU(3,"\n "),s.TgZ(4,"label",69),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw(2);return s.KtG(i.setTextDataOnDrag(t,i.cipher.notes))})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"div",11),s._uU(10,"\n "),s.TgZ(11,"div",12),s._uU(12,"\n "),s._UZ(13,"textarea",70),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.qZA(),s._uU(16,"\n "),s.qZA()}if(2&e){const e=s.oxw(2);s.xp6(5),s.Oqu(s.lcZ(6,2,"notes")),s.xp6(8),s.Q6J("value",e.cipher.notes)}}function yg(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1,"\n "),s._UZ(2,"app-vault-view-custom-fields",71),s._uU(3,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(2),s.Q6J("cipher",e.cipher)("promptPassword",e.promptPassword.bind(e))("copy",e.copy.bind(e))}}function fg(e,t){1&e&&s._UZ(0,"i",77)}function mg(e,t){1&e&&s._UZ(0,"i",78)}function wg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",73),s.NdJ("click",(function(){const t=s.CHM(e).$implicit,i=s.oxw(3);return s.KtG(i.downloadAttachment(t))})),s._uU(1,"\n "),s.TgZ(2,"span",30),s._uU(3),s.qZA(),s._uU(4,"\n "),s.TgZ(5,"small",74),s._uU(6),s.qZA(),s._uU(7,"\n "),s.YNc(8,fg,1,0,"i",75),s._uU(9,"\n "),s.YNc(10,mg,1,0,"i",76),s._uU(11,"\n "),s.qZA()}if(2&e){const e=t.$implicit;s.xp6(3),s.Oqu(e.fileName),s.xp6(3),s.Oqu(e.sizeName),s.xp6(2),s.Q6J("ngIf",!e.downloading),s.xp6(2),s.Q6J("ngIf",e.downloading)}}function bg(e,t){if(1&e&&(s.TgZ(0,"div",9),s._uU(1,"\n "),s.TgZ(2,"h2",10),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"div",11),s._uU(7,"\n "),s.YNc(8,wg,12,4,"button",72),s._uU(9,"\n "),s.qZA(),s._uU(10,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("\n ",s.lcZ(4,2,"attachments"),"\n "),s.xp6(5),s.Q6J("ngForOf",e.cipher.attachments)}}function Sg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.fillCipher())})),s._uU(1,"\n "),s.TgZ(2,"div",79),s._uU(3,"\n "),s.TgZ(4,"div",80),s._uU(5,"\n "),s._UZ(6,"i",81),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,1,"autoFill")))}function Ug(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.fillCipherAndSave())})),s._uU(1,"\n "),s.TgZ(2,"div",79),s._uU(3,"\n "),s.TgZ(4,"div",80),s._uU(5,"\n "),s._UZ(6,"i",82),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,1,"autoFillAndSave")))}function xg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.clone())})),s._uU(1,"\n "),s.TgZ(2,"div",79),s._uU(3,"\n "),s.TgZ(4,"div",80),s._uU(5,"\n "),s._UZ(6,"i",83),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,1,"cloneItem")))}function Ag(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.share())})),s._uU(1,"\n "),s.TgZ(2,"div",79),s._uU(3,"\n "),s.TgZ(4,"div",80),s._uU(5,"\n "),s._UZ(6,"i",84),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,1,"moveToOrganization")))}function _g(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.restore())})),s._uU(1,"\n "),s.TgZ(2,"div",79),s._uU(3,"\n "),s.TgZ(4,"div",80),s._uU(5,"\n "),s._UZ(6,"i",85),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"span"),s._uU(10),s.ALo(11,"i18n"),s.qZA(),s._uU(12,"\n "),s.qZA(),s._uU(13,"\n "),s.qZA()}2&e&&(s.xp6(10),s.Oqu(s.lcZ(11,1,"restoreItem")))}function Zg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"b",25),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5),s.ALo(6,"date"),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("",s.lcZ(4,2,"datePasswordUpdated"),":"),s.xp6(2),s.hij("\n ",s.xi3(6,4,e.cipher.passwordRevisionDisplayDate,"medium"),"\n ")}}const Tg=function(e){return{cipherId:e}};function Cg(e,t){if(1&e&&(s.TgZ(0,"div"),s._uU(1,"\n "),s.TgZ(2,"b",25),s._uU(3),s.ALo(4,"i18n"),s.qZA(),s._uU(5,"\n "),s.TgZ(6,"button",86),s.ALo(7,"i18n"),s._uU(8),s.qZA(),s._uU(9,"\n "),s.qZA()),2&e){const e=s.oxw(2);s.xp6(3),s.hij("",s.lcZ(4,4,"passwordHistory"),":"),s.xp6(3),s.s9C("title",s.lcZ(7,6,"passwordHistory")),s.Q6J("queryParams",s.VKq(8,Tg,e.cipher.id)),s.xp6(2),s.hij("\n ",e.cipher.passwordHistory.length,"\n ")}}function kg(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"main",8),s._uU(1,"\n "),s.TgZ(2,"div",9),s._uU(3,"\n "),s.TgZ(4,"h2",10),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.TgZ(8,"div",11),s._uU(9,"\n "),s.TgZ(10,"div",12),s._uU(11,"\n "),s.TgZ(12,"label",13),s.NdJ("dragstart",(function(t){s.CHM(e);const i=s.oxw();return s.KtG(i.setTextDataOnDrag(t,i.cipher.name))})),s._uU(13),s.ALo(14,"i18n"),s.qZA(),s._uU(15,"\n "),s._UZ(16,"input",14),s._uU(17,"\n "),s.qZA(),s._uU(18,"\n "),s._uU(19,"\n "),s.YNc(20,Yp,10,4,"div",15),s._uU(21,"\n "),s._uU(22,"\n "),s.YNc(23,Vp,12,5,"div",15),s._uU(24,"\n "),s._uU(25,"\n "),s.YNc(26,cg,20,9,"div",15),s._uU(27,"\n "),s.qZA(),s._uU(28,"\n "),s.qZA(),s._uU(29,"\n "),s.YNc(30,gg,7,1,"div",16),s._uU(31,"\n "),s.YNc(32,vg,17,4,"div",16),s._uU(33,"\n "),s.YNc(34,yg,4,3,"div",16),s._uU(35,"\n "),s.YNc(36,bg,11,4,"div",16),s._uU(37,"\n "),s.TgZ(38,"div",17),s._uU(39,"\n "),s.TgZ(40,"div",18),s._uU(41,"\n "),s.YNc(42,Sg,14,3,"button",19),s._uU(43,"\n "),s.YNc(44,Ug,14,3,"button",19),s._uU(45,"\n "),s.YNc(46,xg,14,3,"button",19),s._uU(47,"\n "),s.YNc(48,Ag,14,3,"button",19),s._uU(49,"\n "),s.YNc(50,_g,14,3,"button",19),s._uU(51,"\n "),s.TgZ(52,"button",20),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw();return s.KtG(t.delete())})),s._uU(53,"\n "),s.TgZ(54,"div",21),s._uU(55,"\n "),s.TgZ(56,"div",22),s._uU(57,"\n "),s._UZ(58,"i",23),s._uU(59,"\n "),s.qZA(),s._uU(60,"\n "),s.TgZ(61,"span"),s._uU(62),s.ALo(63,"i18n"),s.qZA(),s._uU(64,"\n "),s.qZA(),s._uU(65,"\n "),s.qZA(),s._uU(66,"\n "),s.qZA(),s._uU(67,"\n "),s.qZA(),s._uU(68,"\n "),s.TgZ(69,"div",9),s._uU(70,"\n "),s.TgZ(71,"div",24),s._uU(72,"\n "),s.TgZ(73,"div"),s._uU(74,"\n "),s.TgZ(75,"b",25),s._uU(76),s.ALo(77,"i18n"),s.qZA(),s._uU(78),s.ALo(79,"date"),s.qZA(),s._uU(80,"\n "),s.YNc(81,Zg,7,7,"div",15),s._uU(82,"\n "),s.YNc(83,Cg,10,10,"div",15),s._uU(84,"\n "),s.qZA(),s._uU(85,"\n "),s.qZA(),s._uU(86,"\n"),s.qZA()}if(2&e){const e=s.oxw();s.xp6(5),s.hij("\n ",s.lcZ(6,20,"itemInformation"),"\n "),s.xp6(8),s.Oqu(s.lcZ(14,22,"name")),s.xp6(3),s.Q6J("value",e.cipher.name),s.xp6(4),s.Q6J("ngIf",e.cipher.login),s.xp6(3),s.Q6J("ngIf",e.cipher.card),s.xp6(3),s.Q6J("ngIf",e.cipher.identity),s.xp6(4),s.Q6J("ngIf",e.cipher.login&&e.cipher.login.hasUris),s.xp6(2),s.Q6J("ngIf",e.cipher.notes),s.xp6(2),s.Q6J("ngIf",e.cipher.hasFields),s.xp6(2),s.Q6J("ngIf",e.cipher.hasAttachments&&(e.canAccessPremium||e.cipher.organizationId)&&e.showAttachments),s.xp6(6),s.Q6J("ngIf",e.cipher.type!==e.cipherType.SecureNote&&!e.cipher.isDeleted&&!e.inPopout),s.xp6(2),s.Q6J("ngIf",e.cipher.type===e.cipherType.Login&&!e.cipher.isDeleted&&!e.inPopout),s.xp6(2),s.Q6J("ngIf",!e.cipher.organizationId&&!e.cipher.isDeleted),s.xp6(2),s.Q6J("ngIf",!e.cipher.organizationId),s.xp6(2),s.Q6J("ngIf",e.cipher.isDeleted),s.xp6(12),s.Oqu(s.lcZ(63,24,e.cipher.isDeleted?"permanentlyDeleteItem":"deleteItem")),s.xp6(14),s.hij("",s.lcZ(77,26,"dateUpdated"),":"),s.xp6(2),s.hij("\n ",s.xi3(79,28,e.cipher.revisionDate,"medium"),"\n "),s.xp6(3),s.Q6J("ngIf",e.cipher.passwordRevisionDisplayDate),s.xp6(2),s.Q6J("ngIf",e.cipher.hasPasswordHistory)}}const Og="ChildViewComponent";class Pg extends sp{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g,v,y,f,m,w,b,S){super(e,t,i,n,s,o,r,window,u,d,h,g,m,w,b,p,S),this.route=a,this.router=l,this.location=c,this.autofillService=v,this.messagingService=y,this.popupUtilsService=f,this.showAttachments=!0,this.pageDetails=[],this.inPopout=!1,this.cipherType=Bl}ngOnInit(){this.inPopout=this.popupUtilsService.inPopout(window),this.route.queryParams.pipe((0,Gi.P)()).subscribe((e=>_p(this,void 0,void 0,(function*(){e.cipherId?this.cipherId=e.cipherId:this.close(),yield this.load()})))),super.ngOnInit(),this.broadcasterService.subscribe(Og,(e=>{this.ngZone.run((()=>_p(this,void 0,void 0,(function*(){switch(e.command){case"collectPageDetailsResponse":e.sender===Og&&this.pageDetails.push({frameId:e.webExtSender.frameId,tab:e.tab,details:e.details});break;case"tabChanged":case"windowChanged":null!=this.loadPageDetailsTimeout&&window.clearTimeout(this.loadPageDetailsTimeout),this.loadPageDetailsTimeout=window.setTimeout((()=>this.loadPageDetails()),500)}}))))}))}ngOnDestroy(){super.ngOnDestroy(),this.broadcasterService.unsubscribe(Og)}load(){const e=Object.create(null,{load:{get:()=>super.load}});return _p(this,void 0,void 0,(function*(){yield e.load.call(this),yield this.loadPageDetails()}))}edit(){const e=Object.create(null,{edit:{get:()=>super.edit}});return _p(this,void 0,void 0,(function*(){return!this.cipher.isDeleted&&(!!(yield e.edit.call(this))&&(this.router.navigate(["/edit-cipher"],{queryParams:{cipherId:this.cipher.id}}),!0))}))}clone(){const e=Object.create(null,{clone:{get:()=>super.clone}});return _p(this,void 0,void 0,(function*(){return!this.cipher.isDeleted&&(!!(yield e.clone.call(this))&&(this.router.navigate(["/clone-cipher"],{queryParams:{cloneMode:!0,cipherId:this.cipher.id}}),!0))}))}share(){const e=Object.create(null,{share:{get:()=>super.share}});return _p(this,void 0,void 0,(function*(){return!!(yield e.share.call(this))&&(null==this.cipher.organizationId&&this.router.navigate(["/share-cipher"],{replaceUrl:!0,queryParams:{cipherId:this.cipher.id}}),!0)}))}fillCipher(){return _p(this,void 0,void 0,(function*(){(yield this.doAutofill())&&this.platformUtilsService.showToast("success",null,this.i18nService.t("autoFillSuccess"))}))}fillCipherAndSave(){return _p(this,void 0,void 0,(function*(){if(yield this.doAutofill()){if(null==this.tab)throw new Error("No tab found.");if(null==this.cipher.login.uris)this.cipher.login.uris=[];else if(this.cipher.login.uris.some((e=>e.uri===this.tab.url)))return void this.platformUtilsService.showToast("success",null,this.i18nService.t("autoFillSuccessAndSavedUri"));const e=new gc;e.uri=this.tab.url,this.cipher.login.uris.push(e);try{const e=yield this.cipherService.encrypt(this.cipher);yield this.cipherService.saveWithServer(e),this.platformUtilsService.showToast("success",null,this.i18nService.t("autoFillSuccessAndSavedUri")),this.messagingService.send("editedCipher")}catch(e){this.platformUtilsService.showToast("error",null,this.i18nService.t("unexpectedError"))}}}))}restore(){const e=Object.create(null,{restore:{get:()=>super.restore}});return _p(this,void 0,void 0,(function*(){return!!this.cipher.isDeleted&&(!!(yield e.restore.call(this))&&(this.close(),!0))}))}delete(){const e=Object.create(null,{delete:{get:()=>super.delete}});return _p(this,void 0,void 0,(function*(){return!!(yield e.delete.call(this))&&(this.messagingService.send("deletedCipher"),this.close(),!0)}))}close(){this.location.back()}loadPageDetails(){return _p(this,void 0,void 0,(function*(){this.pageDetails=[],this.tab=yield Wt.getTabFromCurrentWindow(),null!=this.tab&&Wt.tabSendMessage(this.tab,{command:"collectPageDetails",tab:this.tab,sender:Og})}))}doAutofill(){return _p(this,void 0,void 0,(function*(){if(!(yield this.promptPassword()))return!1;if(null==this.pageDetails||0===this.pageDetails.length)return this.platformUtilsService.showToast("error",null,this.i18nService.t("autofillError")),!1;try{this.totpCode=yield this.autofillService.doAutoFill({tab:this.tab,cipher:this.cipher,pageDetails:this.pageDetails,doc:window.document,fillNewPassword:!0}),null!=this.totpCode&&this.platformUtilsService.copyToClipboard(this.totpCode,{window})}catch(e){return this.platformUtilsService.showToast("error",null,this.i18nService.t("autofillError")),this.changeDetectorRef.detectChanges(),!1}return!0}))}}Pg.ɵfac=function(e){return new(e||Pg)(s.Y36(Sc),s.Y36(Ma),s.Y36(tp),s.Y36(_e),s.Y36(zt),s.Y36(Je),s.Y36(Uc),s.Y36(Pe.gz),s.Y36(Pe.F0),s.Y36(u.Ye),s.Y36(Tn),s.Y36(s.R0b),s.Y36(s.sBO),s.Y36(Mt),s.Y36(jr),s.Y36(th),s.Y36(qe),s.Y36($t),s.Y36(Tt),s.Y36(Ac),s.Y36(Ct),s.Y36($r))},Pg.ɵcmp=s.Xpm({type:Pg,selectors:[["app-vault-view"]],features:[s.qOj],decls:21,vars:8,consts:[[1,"left"],["type","button",3,"click"],[1,"center"],[1,"title"],["class","right",4,"ngIf"],["tabindex","-1",4,"ngIf"],[1,"right"],["type","button",3,"click",4,"ngIf"],["tabindex","-1"],[1,"box"],[1,"box-header"],[1,"box-content"],[1,"box-content-row"],["for","name","draggable","true",1,"draggable",3,"dragstart"],["id","name","type","text","readonly","","aria-readonly","true",3,"value"],[4,"ngIf"],["class","box",4,"ngIf"],[1,"box","list"],[1,"box-content","single-line"],["type","button","class","box-content-row","appStopClick","",3,"click",4,"ngIf"],["type","button","appStopClick","",1,"box-content-row",3,"click"],[1,"row-main","text-danger"],["aria-hidden","true",1,"icon","text-danger"],[1,"bwi","bwi-trash","bwi-lg","bwi-fw"],[1,"box-footer"],[1,"font-weight-semibold"],["class","box-content-row box-content-row-flex",4,"ngIf"],["class","box-content-row box-content-row-flex totp",3,"ngClass",4,"ngIf"],["class","box-content-row box-content-row-flex totp",4,"ngIf"],[1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","loginUsername","draggable","true",1,"row-label","draggable",3,"dragstart"],["id","loginUsername","type","text","readonly","","aria-readonly","true",3,"value"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-clone"],["draggable","true",1,"row-label","draggable",3,"dragstart"],["class","monospaced",4,"ngIf"],["class","monospaced password-wrapper","appSelectCopy","",3,"innerHTML",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[1,"action-buttons","action-buttons-fixed"],["type","button","class","row-btn btn",3,"appA11yTitle","appApiAction","disabled","click",4,"ngIf"],["type","button","class","row-btn","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],[1,"monospaced"],["appSelectCopy","",1,"monospaced","password-wrapper",3,"innerHTML"],[3,"innerHTML"],["type","button",1,"row-btn","btn",3,"appA11yTitle","appApiAction","disabled","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"bwi","bwi-lg","bwi-check-circle",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-spinner","bwi-spin",3,"hidden"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-numbered-list"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"box-content-row","box-content-row-flex","totp",3,"ngClass"],[1,"totp-code"],[1,"totp-countdown"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"box-content-row","box-content-row-flex","totp"],[1,"row-label"],["routerLink","/premium"],["class","box-content-row",4,"ngIf"],[1,"monospaced",3,"hidden"],["class","box-content-row box-content-row-flex",4,"ngFor","ngForOf"],["class","row-label draggable","draggable","true",3,"for","dragstart",4,"ngIf"],[3,"title"],["type","text","readonly","","aria-readonly","true",3,"id","value"],["draggable","true",1,"row-label","draggable",3,"for","dragstart"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-share-square"],["for","notes","draggable","true",1,"draggable",3,"dragstart"],["id","notes","rows","6","readonly","","aria-readonly","true",3,"value"],[3,"cipher","promptPassword","copy"],["type","button","class","box-content-row box-content-row-flex text-default","appStopClick","",3,"click",4,"ngFor","ngForOf"],["type","button","appStopClick","",1,"box-content-row","box-content-row-flex","text-default",3,"click"],[1,"row-sub-label"],["class","bwi bwi-download bwi-fw row-sub-icon","aria-hidden","true",4,"ngIf"],["class","bwi bwi-spinner bwi-fw bwi-spin row-sub-icon","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-download","bwi-fw","row-sub-icon"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-fw","bwi-spin","row-sub-icon"],[1,"row-main","text-primary"],["aria-hidden","true",1,"icon","text-primary"],[1,"bwi","bwi-pencil-square","bwi-lg","bwi-fw"],[1,"bwi","bwi-bookmark","bwi-lg","bwi-fw"],[1,"bwi","bwi-files","bwi-lg","bwi-fw"],[1,"bwi","bwi-arrow-circle-right","bwi-lg","bwi-fw"],[1,"bwi","bwi-undo","bwi-lg","bwi-fw"],["routerLink","/cipher-password-history","appStopClick","",3,"queryParams","title"]],template:function(e,t){1&e&&(s.TgZ(0,"header"),s._uU(1,"\n "),s.TgZ(2,"div",0),s._uU(3,"\n "),s.TgZ(4,"button",1),s.NdJ("click",(function(){return t.close()})),s._uU(5),s.ALo(6,"i18n"),s.qZA(),s._uU(7,"\n "),s.qZA(),s._uU(8,"\n "),s.TgZ(9,"h1",2),s._uU(10,"\n "),s.TgZ(11,"span",3),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.qZA(),s._uU(15,"\n "),s.YNc(16,Tp,4,1,"div",4),s._uU(17,"\n"),s.qZA(),s._uU(18,"\n"),s.YNc(19,kg,87,31,"main",5),s._uU(20,"\n")),2&e&&(s.xp6(5),s.Oqu(s.lcZ(6,4,"close")),s.xp6(7),s.Oqu(s.lcZ(13,6,"viewItem")),s.xp6(4),s.Q6J("ngIf",t.cipher),s.xp6(3),s.Q6J("ngIf",t.cipher))},dependencies:[Pe.rH,Pe.yS,u.mk,u.sg,u.O5,u.PC,Ht,Ot,$n,St,Ap,u.uU,ap,ts,Ae,Ze],encapsulation:2});const Ig=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"vault",redirectTo:"/tabs/vault",pathMatch:"full"},{path:"home",component:Lt,canActivate:[Re],data:{state:"home"}},{path:"login",component:Ai,canActivate:[Re],data:{state:"login"}},{path:"lock",component:ui,canActivate:[Le],data:{state:"lock"}},{path:"2fa",component:Jn,canActivate:[Re],data:{state:"2fa"}},{path:"2fa-options",component:yn,canActivate:[Re],data:{state:"2fa-options"}},{path:"sso",component:hn,canActivate:[Re],data:{state:"sso"}},{path:"set-password",component:ln,data:{state:"set-password"}},{path:"remove-password",component:Bi,canActivate:[Fe],data:{state:"remove-password"}},{path:"register",component:Ei,canActivate:[Re],data:{state:"register"}},{path:"hint",component:qt,canActivate:[Re],data:{state:"hint"}},{path:"environment",component:At,canActivate:[Re],data:{state:"environment"}},{path:"ciphers",component:Qd,canActivate:[Fe],data:{state:"ciphers"}},{path:"view-cipher",component:Pg,canActivate:[Fe],data:{state:"view-cipher"}},{path:"cipher-password-history",component:Uh,canActivate:[Fe],data:{state:"cipher-password-history"}},{path:"add-cipher",component:Zu,canActivate:[Fe,Fr],data:{state:"add-cipher"},runGuardsAndResolvers:"always"},{path:"edit-cipher",component:Zu,canActivate:[Fe,Fr],data:{state:"edit-cipher"},runGuardsAndResolvers:"always"},{path:"share-cipher",component:Dh,canActivate:[Fe],data:{state:"share-cipher"}},{path:"collections",component:eh,canActivate:[Fe],data:{state:"collections"}},{path:"attachments",component:Lu,canActivate:[Fe],data:{state:"attachments"}},{path:"generator",component:Is,canActivate:[Fe],data:{state:"generator"}},{path:"generator-history",component:Rs,canActivate:[Fe],data:{state:"generator-history"}},{path:"export",component:ma,canActivate:[Fe],data:{state:"export"}},{path:"folders",component:Da,canActivate:[Fe],data:{state:"folders"}},{path:"add-folder",component:Ta,canActivate:[Fe],data:{state:"add-folder"}},{path:"edit-folder",component:Ta,canActivate:[Fe],data:{state:"edit-folder"}},{path:"sync",component:$l,canActivate:[Fe],data:{state:"sync"}},{path:"excluded-domains",component:Kr,canActivate:[Fe],data:{state:"excluded-domains"}},{path:"premium",component:nl,canActivate:[Fe],data:{state:"premium"}},{path:"options",component:$a,canActivate:[Fe],data:{state:"options"}},{path:"clone-cipher",component:Zu,canActivate:[Fe],data:{state:"clone-cipher"}},{path:"send-type",component:Ir,canActivate:[Fe],data:{state:"send-type"}},{path:"add-send",component:Ho,canActivate:[Fe],data:{state:"add-send"}},{path:"edit-send",component:Ho,canActivate:[Fe],data:{state:"edit-send"}},{path:"update-temp-password",component:Vn,canActivate:[Fe],data:{state:"update-temp-password"}},{path:"tabs",component:ec,data:{state:"tabs"},children:[{path:"",redirectTo:"/tabs/vault",pathMatch:"full"},{path:"current",component:vh,canActivate:[Fe],data:{state:"tabs_current"},runGuardsAndResolvers:"always"},{path:"vault",component:ep,canActivate:[Fe],data:{state:"tabs_vault"}},{path:"generator",component:Is,canActivate:[Fe],data:{state:"tabs_generator"}},{path:"settings",component:zl,canActivate:[Fe],data:{state:"tabs_settings"}},{path:"send",component:xr,canActivate:[Fe],data:{state:"tabs_send"}}]}];class qg{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return!1}}qg.ɵfac=function(e){return new(e||qg)},qg.ɵprov=s.Yz7({token:qg,factory:qg.ɵfac});class Dg{}Dg.ɵfac=function(e){return new(e||Dg)},Dg.ɵmod=s.oAB({type:Dg}),Dg.ɵinj=s.cJS({providers:[{provide:Pe.wN,useClass:qg}],imports:[Pe.Bz.forRoot(Ig,{useHash:!0,onSameUrlNavigation:"reload"}),Pe.Bz]});const Mg=(0,he.IO)(":enter, :leave",[(0,he.oB)({position:"fixed",width:"100%",height:"100%"})],{optional:!0}),Fg=(0,he.IO)("router-outlet ~ *",[(0,he.oB)({}),(0,he.jt)(1,(0,he.oB)({}))],{optional:!0});function Ng(e,t,i,n,s=1e3){return(0,he.IO)(":"+e,[(0,he.oB)({transform:"translate"+t+"("+i+"%)",zIndex:s,boxShadow:"0 3px 2px -2px gray"}),(0,he.jt)("0.4s ease-in-out",(0,he.oB)({transform:"translate"+t+"("+n+"%)"}))],{optional:!0})}function Lg(e,t,i,n=1e3){return Ng(e,"X",t,i,n)}function Eg(e,t,i,n=1e3){return Ng(e,"Y",t,i,n)}const Rg=[Mg,(0,he.ru)([Lg("enter",100,0),Lg("leave",0,-100),Fg])],Jg=[Mg,(0,he.ru)([Lg("enter",-100,0),Lg("leave",0,100)])],Yg=[Mg,(0,he.ru)([Eg("enter",100,0,1010),Eg("leave",0,0),Fg])],zg=[Mg,(0,he.ru)([Eg("enter",0,0),Eg("leave",0,100,1010)])],Kg=[Mg,(0,he.ru)([Eg("enter",-100,0,1010),Eg("leave",0,0),Fg])];(0,he.ru)([Eg("enter",0,0),Eg("leave",0,-100,1010)]);const Bg=(0,he.X$)("routerTransition",[(0,he.eR)("void => home",Rg),(0,he.eR)("void => tabs",Rg),(0,he.eR)("home => environment, home => login, home => register",Yg),(0,he.eR)("login => home",zg),(0,he.eR)("login => hint",Yg),(0,he.eR)("login => tabs, login => 2fa",Rg),(0,he.eR)("hint => login, register => home, environment => home",zg),(0,he.eR)("2fa => login",Jg),(0,he.eR)("2fa => 2fa-options",Yg),(0,he.eR)("2fa-options => 2fa",zg),(0,he.eR)("2fa => tabs",Rg),(0,he.eR)((function(e,t){return null!=e&&null!==t&&-1!==t.indexOf("ciphers_")&&(0===e.indexOf("ciphers_")&&-1===e.indexOf("ciphers_direction=b")||"tabs"===e)}),Rg),(0,he.eR)((function(e,t){return null!=e&&null!==t&&-1!==e.indexOf("ciphers_")&&(0===t.indexOf("ciphers_direction=b")||"tabs"===t)}),Jg),(0,he.eR)((function(e,t){return null!=e&&null!==t&&(0===e.indexOf("ciphers_")&&("view-cipher"===t||"add-cipher"===t||"clone-cipher"===t))}),Yg),(0,he.eR)((function(e,t){return null!=e&&null!==t&&(("view-cipher"===e||"add-cipher"===e||"clone-cipher"===e)&&0===t.indexOf("ciphers_"))}),zg),(0,he.eR)("tabs => view-cipher",Yg),(0,he.eR)("view-cipher => tabs",zg),(0,he.eR)("view-cipher => edit-cipher, view-cipher => cipher-password-history",Yg),(0,he.eR)("edit-cipher => view-cipher, cipher-password-history => view-cipher, edit-cipher => tabs",zg),(0,he.eR)("view-cipher => clone-cipher",Yg),(0,he.eR)("clone-cipher => view-cipher, clone-cipher => tabs",zg),(0,he.eR)("view-cipher => share-cipher",Yg),(0,he.eR)("share-cipher => view-cipher",zg),(0,he.eR)("tabs => add-cipher",Yg),(0,he.eR)("add-cipher => tabs",zg),(0,he.eR)("generator => generator-history, tabs => generator-history",Rg),(0,he.eR)("generator-history => generator, generator-history => tabs",Jg),(0,he.eR)("add-cipher => generator, edit-cipher => generator, clone-cipher => generator",Yg),(0,he.eR)("generator => add-cipher, generator => edit-cipher, generator => clone-cipher",zg),(0,he.eR)("edit-cipher => attachments, edit-cipher => collections",Rg),(0,he.eR)("attachments => edit-cipher, collections => edit-cipher",Jg),(0,he.eR)("clone-cipher => attachments, clone-cipher => collections",Rg),(0,he.eR)("attachments => clone-cipher, collections => clone-cipher",Jg),(0,he.eR)("tabs => export",Rg),(0,he.eR)("export => tabs",Jg),(0,he.eR)("tabs => folders",Rg),(0,he.eR)("folders => tabs",Jg),(0,he.eR)("folders => edit-folder, folders => add-folder",Yg),(0,he.eR)("edit-folder => folders, add-folder => folders",zg),(0,he.eR)("tabs => sync",Rg),(0,he.eR)("sync => tabs",Jg),(0,he.eR)("tabs => excluded-domains",Rg),(0,he.eR)("excluded-domains => tabs",Jg),(0,he.eR)("tabs => options",Rg),(0,he.eR)("options => tabs",Jg),(0,he.eR)("tabs => premium",Rg),(0,he.eR)("premium => tabs",Jg),(0,he.eR)("tabs => lock",Kg),(0,he.eR)("tabs => send-type",Rg),(0,he.eR)("send-type => tabs",Jg),(0,he.eR)("tabs => add-send, send-type => add-send",Yg),(0,he.eR)("add-send => tabs, add-send => send-type",zg),(0,he.eR)("tabs => edit-send, send-type => edit-send",Yg),(0,he.eR)("edit-send => tabs, edit-send => send-type",zg)]);var Gg=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Qg{constructor(e,t,i,n,s,o,r,a,l,c,u){this.toastrService=e,this.broadcasterService=t,this.authService=i,this.i18nService=n,this.router=s,this.stateService=o,this.messagingService=r,this.changeDetectorRef=a,this.ngZone=l,this.sanitizer=c,this.platformUtilsService=u,this.lastActivity=null,this.destroy$=new Be.x}ngOnInit(){return Gg(this,void 0,void 0,(function*(){yield this.clearComponentStates(),this.stateService.activeAccount$.pipe((0,Jt.R)(this.destroy$)).subscribe((e=>{this.activeUserId=e})),this.ngZone.runOutsideAngular((()=>{window.onmousedown=()=>this.recordActivity(),window.ontouchstart=()=>this.recordActivity(),window.onclick=()=>this.recordActivity(),window.onscroll=()=>this.recordActivity(),window.onkeypress=()=>this.recordActivity()})),window.bitwardenPopupMainMessageListener=(e,t,i)=>Gg(this,void 0,void 0,(function*(){if("doneLoggingOut"===e.command)this.ngZone.run((()=>Gg(this,void 0,void 0,(function*(){this.authService.logOut((()=>Gg(this,void 0,void 0,(function*(){e.expired&&this.showToast({type:"warning",title:this.i18nService.t("loggedOut"),text:this.i18nService.t("loginExpired")}),null===this.activeUserId&&this.router.navigate(["home"])})))),this.changeDetectorRef.detectChanges()}))));else if("authBlocked"===e.command)this.ngZone.run((()=>{this.router.navigate(["home"])}));else if("locked"===e.command)null!=e.userId&&e.userId!==(yield this.stateService.getUserId())||this.ngZone.run((()=>{this.router.navigate(["lock"])}));else if("showDialog"===e.command)yield this.showDialog(e);else if("showToast"===e.command)this.ngZone.run((()=>{this.showToast(e)}));else if("reloadProcess"===e.command){const e=this.platformUtilsService.isSafari()||this.platformUtilsService.isFirefox()||this.platformUtilsService.isOpera();window.setTimeout((()=>Wt.reloadExtension(e?window:null)),2e3)}else"reloadPopup"===e.command?this.ngZone.run((()=>{this.router.navigate(["/"])})):"convertAccountToKeyConnector"===e.command?this.ngZone.run((()=>Gg(this,void 0,void 0,(function*(){this.router.navigate(["/remove-password"])})))):(e.webExtSender=t,this.broadcasterService.send(e))})),Wt.messageListener("app.component",window.bitwardenPopupMainMessageListener),this.router.events.pipe((0,Jt.R)(this.destroy$)).subscribe((e=>Gg(this,void 0,void 0,(function*(){if(e instanceof Pe.m2){const t=e.urlAfterRedirects||e.url||"";t.startsWith("/tabs/")&&null!=window.previousPopupUrl&&window.previousPopupUrl.startsWith("/tabs/")&&(yield this.clearComponentStates()),t.startsWith("/tabs/")&&(yield this.stateService.setAddEditCipherInfo(null)),window.previousPopupUrl=t,null!=window.routeDirection&&window.setTimeout((()=>{window.routeDirection=null}),400)}}))))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getState(e){if("ciphers"===e.activatedRouteData.state){return"ciphers_direction="+(null!=window.routeDirection?window.routeDirection:"")+"_"+e.activatedRoute.queryParams.value.folderId+"_"+e.activatedRoute.queryParams.value.collectionId}return e.activatedRouteData.state}recordActivity(){return Gg(this,void 0,void 0,(function*(){if(null==this.activeUserId)return;const e=(new Date).getTime();null!=this.lastActivity&&e-this.lastActivity<250||(this.lastActivity=e,yield this.stateService.setLastActive(e,{userId:this.activeUserId}))}))}showToast(e){let t="";const i={};"string"==typeof e.text?t=e.text:1===e.text.length?t=e.text[0]:(e.text.forEach((e=>t+="

"+this.sanitizer.sanitize(s.q3G.HTML,e)+"

")),i.enableHtml=!0),null!=e.options&&(!0===e.options.trustedHtml&&(i.enableHtml=!0),null!=e.options.timeout&&e.options.timeout>0&&(i.timeOut=e.options.timeout)),this.toastrService.show(t,e.title,i,"toast-"+e.type)}showDialog(e){return Gg(this,void 0,void 0,(function*(){let t=null;const i=e.type;if(null!=i)switch(i){case"success":t="bwi-check text-success";break;case"warning":t="bwi-exclamation-triangle text-warning";break;case"error":t="bwi-error text-danger";break;case"info":t="bwi-info-circle text-info"}const n=e.cancelText,s=e.confirmText,o=yield ol().fire({heightAuto:!1,buttonsStyling:!1,icon:i,iconHtml:null!=t?``:void 0,text:e.text,html:e.html,titleText:e.title,showCancelButton:null!=n,cancelButtonText:n,showConfirmButton:!0,confirmButtonText:null==s?this.i18nService.t("ok"):s,timer:3e5});this.messagingService.send("showDialogResolve",{dialogId:e.dialogId,confirmed:o.value})}))}clearComponentStates(){return Gg(this,void 0,void 0,(function*(){(yield this.stateService.getIsAuthenticated())&&(yield Promise.all([this.stateService.setBrowserGroupingComponentState(null),this.stateService.setBrowserCipherComponentState(null),this.stateService.setBrowserSendComponentState(null),this.stateService.setBrowserSendTypeComponentState(null)]))}))}}Qg.ɵfac=function(e){return new(e||Qg)(s.Y36(pe._W),s.Y36(Tn),s.Y36(Ie),s.Y36(_e),s.Y36(Pe.F0),s.Y36(js),s.Y36(qe),s.Y36(s.sBO),s.Y36(s.R0b),s.Y36(n.H7),s.Y36(Je))},Qg.ɵcmp=s.Xpm({type:Qg,selectors:[["app-root"]],decls:6,vars:1,consts:[["o","outlet"]],template:function(e,t){if(1&e&&(s._uU(0," "),s.TgZ(1,"div"),s._uU(2,"\n "),s._UZ(3,"router-outlet",null,0),s._uU(5,"\n "),s.qZA()),2&e){const e=s.MAs(4);s.xp6(1),s.Q6J("@routerTransition",t.getState(e))}},dependencies:[Pe.lC],encapsulation:2,data:{animation:[Bg]}});const Vg=new s.OlP("WINDOW"),Hg=new s.OlP("MEMORY_STORAGE"),jg=new s.OlP("SECURE_STORAGE"),Wg=new s.OlP("STATE_FACTORY"),$g=new s.OlP("STATE_SERVICE_USE_CACHE"),Xg=new s.OlP("LOGOUT_CALLBACK"),ev=new s.OlP("LOCKED_CALLBACK"),tv=(new s.OlP("CLIENT_TYPE"),new s.OlP("LOCALES_DIRECTORY")),iv=new s.OlP("SYSTEM_LANGUAGE"),nv=new s.OlP("LOG_MAC_FAILURES");var sv=i(97123),ov=i(85940);class rv{constructor(e,t){this.configuredTheme=e,this.systemTheme=t}get effectiveTheme(){return this.configuredTheme!=Ca.System?this.configuredTheme:this.systemTheme}updateSystemTheme(e){return new rv(this.configuredTheme,e)}updateConfiguredTheme(e){return new rv(e,this.systemTheme)}}var av,lv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cv{constructor(e,t,i){this.stateService=e,this.window=t,this.document=i,this._theme=new sv.X(null),this.theme$=this._theme.pipe((0,qr.h)((e=>null!==e))),this.monitorThemeChanges()}monitorThemeChanges(){return lv(this,void 0,void 0,(function*(){this._theme.next(new rv(yield this.stateService.getTheme(),yield this.getSystemTheme())),this.monitorConfiguredThemeChanges(),this.monitorSystemThemeChanges()}))}updateSystemTheme(e){this._theme.next(this._theme.getValue().updateSystemTheme(e))}updateConfiguredTheme(e){return lv(this,void 0,void 0,(function*(){yield this.stateService.setTheme(e),this._theme.next(this._theme.getValue().updateConfiguredTheme(e))}))}monitorConfiguredThemeChanges(){this.theme$.subscribe((e=>{this.document.documentElement.classList.remove("theme_"+Ca.Light,"theme_"+Ca.Dark,"theme_"+Ca.Nord,"theme_"+Ca.SolarizedDark),this.document.documentElement.classList.add("theme_"+e.effectiveTheme)}))}getSystemTheme(){return lv(this,void 0,void 0,(function*(){return this.window.matchMedia("(prefers-color-scheme: dark)").matches?Ca.Dark:Ca.Light}))}monitorSystemThemeChanges(){(0,ov.R)(this.window.matchMedia("(prefers-color-scheme: dark)"),"change").subscribe((e=>{this.updateSystemTheme(e.matches?Ca.Dark:Ca.Light)}))}}cv.ɵfac=function(e){return new(e||cv)(s.LFG(Mt),s.LFG(Vg),s.LFG(u.K0))},cv.ɵprov=s.Yz7({token:cv,factory:cv.ɵfac});class uv{}class dv{}class hv{}class pv{}class gv{}class vv{}class yv{}class fv{}class mv{}class wv extends mv{}class bv{}class Sv{constructor(e){this.accountConstructor=e}create(e){return new this.accountConstructor(e)}}class Uv{constructor(e){this.globalStateConstructor=e}create(e){return new this.globalStateConstructor(e)}}class xv{constructor(e,t){this.globalStateFactory=new Uv(e),this.accountFactory=new Sv(t)}createGlobal(e){return this.globalStateFactory.create(e)}createAccount(e){return this.accountFactory.create(e)}}class Av{constructor(e){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 _v(e.server):null,this.utcDate=(new Date).toISOString(),this.environment=(null==e?void 0:e.environment)?new Zv(e.environment):null}static fromJSON(e){return Object.assign(new Av({}),e,{server:(null==e?void 0:e.server)?_v.fromJSON(e.server):null,environment:(null==e?void 0:e.environment)?Zv.fromJSON(e.environment):null})}}class _v{constructor(e){this.name=e.name,this.url=e.url}static fromJSON(e){return Object.assign(new _v({}),e)}}class Zv{constructor(e){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 Zv({}),e)}}class Tv{toJSON(){return{encrypted:this.encrypted,decrypted:this.decrypted instanceof ArrayBuffer?nt.fromBufferToByteString(this.decrypted):this.decrypted}}static fromJSON(e,t,i){if(null==e)return null;const n=new Tv;return null!=(null==e?void 0:e.encrypted)&&(n.encrypted=i?i(e.encrypted):e.encrypted),null!=(null==e?void 0:e.decrypted)&&(n.decrypted=t?t(e.decrypted):e.decrypted),n}}class Cv{}class kv{}class Ov{constructor(){this.ciphers=new Cv,this.folders=new kv,this.sends=new Cv,this.collections=new Cv,this.policies=new Cv,this.passwordGenerationHistory=new Tv}}class Pv{constructor(){this.cryptoSymmetricKey=new Tv,this.organizationKeys=new Tv,this.providerKeys=new Tv,this.privateKey=new Tv}toJSON(){return Object.assign(this,{publicKey:nt.fromBufferToByteString(this.publicKey)})}static fromJSON(e){var t;return null==e?null:Object.assign(new Pv,{cryptoMasterKey:ac.fromJSON(null==e?void 0:e.cryptoMasterKey)},{cryptoSymmetricKey:Tv.fromJSON(null==e?void 0:e.cryptoSymmetricKey,ac.fromJSON)},{organizationKeys:Pv.initRecordEncryptionPairsFromJSON(null==e?void 0:e.organizationKeys)},{providerKeys:Pv.initRecordEncryptionPairsFromJSON(null==e?void 0:e.providerKeys)},{privateKey:Tv.fromJSON(null==e?void 0:e.privateKey,(e=>nt.fromByteStringToArray(e).buffer))},{publicKey:null===(t=nt.fromByteStringToArray(null==e?void 0:e.publicKey))||void 0===t?void 0:t.buffer})}static initRecordEncryptionPairsFromJSON(e){return Tv.fromJSON(e,(t=>{if(null==e)return null;const i={};for(const e in t)i[e]=ac.fromJSON(t[e]);return i}))}}class Iv{static fromJSON(e){return null==e?null:Object.assign(new Iv,e)}}class qv{constructor(){this.environmentUrls=new Qe,this.pinProtected=new Tv,this.vaultTimeoutAction="lock"}static fromJSON(e){return null==e?null:Object.assign(new qv,e,{environmentUrls:Qe.fromJSON(null==e?void 0:e.environmentUrls),pinProtected:Tv.fromJSON(null==e?void 0:e.pinProtected,ot.fromJSON),serverConfig:Av.fromJSON(null==e?void 0:e.serverConfig)})}}class Dv{static fromJSON(e){return null==e?null:Object.assign(new Dv,e)}}class Mv{constructor(e){this.data=new Ov,this.keys=new Pv,this.profile=new Iv,this.settings=new qv,this.tokens=new Dv,Object.assign(this,{data:Object.assign(Object.assign({},new Ov),null==e?void 0:e.data),keys:Object.assign(Object.assign({},new Pv),null==e?void 0:e.keys),profile:Object.assign(Object.assign({},new Iv),null==e?void 0:e.profile),settings:Object.assign(Object.assign({},new qv),null==e?void 0:e.settings),tokens:Object.assign(Object.assign({},new Dv),null==e?void 0:e.tokens)})}static fromJSON(e){return null==e?null:Object.assign(new Mv({}),e,{keys:Pv.fromJSON(null==e?void 0:e.keys),profile:Iv.fromJSON(null==e?void 0:e.profile),settings:qv.fromJSON(null==e?void 0:e.settings),tokens:Dv.fromJSON(null==e?void 0:e.tokens)})}}!function(e){e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e[e.Four=4]="Four",e[e.Five=5]="Five",e[e.Six=6]="Six",e[e.Latest=6]="Latest"}(av||(av={}));class Fv{}class Nv{constructor(){this.theme=Ca.System,this.window=new Fv,this.stateVersion=av.One,this.environmentUrls=new Qe}}var Lv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var Ev,Rv=i(50263),Jv=i(5085),Yv=i(35098);!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"}(Ev||(Ev={}));class zv extends ku{constructor(e){super(e),this.contextId=this.getResponseProperty("ContextId"),this.type=this.getResponseProperty("Type");const t=this.getResponseProperty("Payload");switch(this.type){case Ev.SyncCipherCreate:case Ev.SyncCipherDelete:case Ev.SyncCipherUpdate:case Ev.SyncLoginDelete:this.payload=new Kv(t);break;case Ev.SyncFolderCreate:case Ev.SyncFolderDelete:case Ev.SyncFolderUpdate:this.payload=new Bv(t);break;case Ev.SyncVault:case Ev.SyncCiphers:case Ev.SyncOrgKeys:case Ev.SyncSettings:case Ev.LogOut:this.payload=new Gv(t);break;case Ev.SyncSendCreate:case Ev.SyncSendUpdate:case Ev.SyncSendDelete:this.payload=new Qv(t);break;case Ev.AuthRequest:case Ev.AuthRequestResponse:this.payload=new Vv(t)}}}class Kv extends ku{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 Bv extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class Gv extends ku{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.date=new Date(this.getResponseProperty("Date"))}}class Qv extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class Vv extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId")}}var Hv=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jv{constructor(e,t,i){this.environmentService=e,this.authService=t,this.logService=i}createHubConnection(e){return Hv(this,void 0,void 0,(function*(){this.url=this.environmentService.getNotificationsUrl(),this.anonHubConnection=(new Rv.s).withUrl(this.url+"/anonymous-hub?Token="+e,{skipNegotiation:!0,transport:Jv.n.WebSockets}).withHubProtocol(new Yv.e).build(),this.anonHubConnection.start().catch((e=>this.logService.error(e))),this.anonHubConnection.on("AuthRequestResponseRecieved",(e=>{this.ProcessNotification(new zv(e))}))}))}stopHubConnection(){this.anonHubConnection&&this.anonHubConnection.stop()}ProcessNotification(e){return Hv(this,void 0,void 0,(function*(){yield this.authService.authResponsePushNotifiction(e.payload)}))}}jv.ɵfac=function(e){return new(e||jv)(s.LFG(Ye),s.LFG(Ie),s.LFG(Ct))},jv.ɵprov=s.Yz7({token:jv,factory:jv.ɵfac});class Wv{constructor(e,t){this.type=t.getDevice(),this.name=t.getDeviceString(),this.identifier=e,this.pushToken=null}}class $v{constructor(e,t){this.twoFactor=e,this.device=null!=t?t:null}alterIdentityTokenHeaders(e){}setTwoFactor(e){this.twoFactor=e}setPasswordlessAccessCode(e){this.passwordlessAuthRequest=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.passwordlessAuthRequest&&(t.authRequest=this.passwordlessAuthRequest),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}}class Xv extends $v{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}}class ey extends ku{constructor(e){super(e),this.apiKey=this.getResponseProperty("ApiKey"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class ty extends ku{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")}}class iy extends ku{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"))}}class ny extends ku{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"))}}class sy extends ku{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"))}}class oy extends ku{constructor(e=null){if(super(e),this.match=null,null==e)return;this.uri=this.getResponseProperty("Uri");const t=this.getResponseProperty("Match");this.match=null!=t?t:null}}class ry extends ku{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 oy(e))))}}class ay extends ku{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"))}}class ly extends ku{constructor(e){super(e),this.password=this.getResponseProperty("Password"),this.lastUsedDate=this.getResponseProperty("LastUsedDate")}}class cy extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.folderId=this.getResponseProperty("FolderId")||null,this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.favorite=this.getResponseProperty("Favorite")||!1,this.edit=!!this.getResponseProperty("Edit"),null==this.getResponseProperty("ViewPassword")?this.viewPassword=!0:this.viewPassword=this.getResponseProperty("ViewPassword"),this.organizationUseTotp=this.getResponseProperty("OrganizationUseTotp"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.collectionIds=this.getResponseProperty("CollectionIds"),this.deletedDate=this.getResponseProperty("DeletedDate");const t=this.getResponseProperty("Login");null!=t&&(this.login=new ry(t));const i=this.getResponseProperty("Card");null!=i&&(this.card=new iy(i));const n=this.getResponseProperty("Identity");null!=n&&(this.identity=new sy(n));const s=this.getResponseProperty("SecureNote");null!=s&&(this.secureNote=new ay(s));const o=this.getResponseProperty("Fields");null!=o&&(this.fields=o.map((e=>new ny(e))));const r=this.getResponseProperty("Attachments");null!=r&&(this.attachments=r.map((e=>new ty(e))));const a=this.getResponseProperty("PasswordHistory");null!=a&&(this.passwordHistory=a.map((e=>new ly(e)))),this.reprompt=this.getResponseProperty("Reprompt")||Kl.None}}class uy extends ku{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 cy(t),this.cipherMiniResponse=null==i?null:new cy(i),this.url=this.getResponseProperty("Url")}}class dy extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.publicKey=this.getResponseProperty("PublicKey"),this.requestDeviceType=this.getResponseProperty("RequestDeviceType"),this.requestIpAddress=this.getResponseProperty("RequestIpAddress"),this.key=this.getResponseProperty("Key"),this.masterPasswordHash=this.getResponseProperty("MasterPasswordHash"),this.creationDate=this.getResponseProperty("CreationDate"),this.requestApproved=this.getResponseProperty("RequestApproved")}}class hy extends ku{constructor(e){super(e),this.captchaBypassToken=this.getResponseProperty("CaptchaBypassToken")}}class py extends ku{constructor(e){super(e),this.invoices=[],this.transactions=[],this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource"),i=this.getResponseProperty("Transactions"),n=this.getResponseProperty("Invoices");this.paymentSource=null==t?null:new gy(t),null!=i&&(this.transactions=i.map((e=>new yy(e)))),null!=n&&(this.invoices=n.map((e=>new vy(e))))}}class gy extends ku{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 vy extends ku{constructor(e){super(e),this.url=this.getResponseProperty("Url"),this.pdfUrl=this.getResponseProperty("PdfUrl"),this.number=this.getResponseProperty("Number"),this.paid=this.getResponseProperty("Paid"),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}class yy extends ku{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 fy extends ku{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 yy(e)))),null!=i&&(this.invoices=i.map((e=>new vy(e))))}get hasNoHistory(){return 0==this.invoices.length&&0==this.transactions.length}}class my extends ku{constructor(e){super(e),this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource");this.paymentSource=null==t?null:new gy(t)}}class wy extends ku{constructor(e){super(e),this.addedDate=this.getResponseProperty("AddedDate"),this.breachDate=this.getResponseProperty("BreachDate"),this.dataClasses=this.getResponseProperty("DataClasses"),this.description=this.getResponseProperty("Description"),this.domain=this.getResponseProperty("Domain"),this.isActive=this.getResponseProperty("IsActive"),this.isVerified=this.getResponseProperty("IsVerified"),this.logoPath=this.getResponseProperty("LogoPath"),this.modifiedDate=this.getResponseProperty("ModifiedDate"),this.name=this.getResponseProperty("Name"),this.pwnCount=this.getResponseProperty("PwnCount"),this.title=this.getResponseProperty("Title")}}class by extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.readOnly=this.getResponseProperty("ReadOnly"),this.hidePasswords=this.getResponseProperty("HidePasswords")}}class Sy extends ku{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 Uy extends Sy{constructor(e){super(e),this.readOnly=this.getResponseProperty("ReadOnly")||!1}}class xy extends Sy{constructor(e){super(e),this.groups=[];const t=this.getResponseProperty("Groups");null!=t&&(this.groups=t.map((e=>new by(e))))}}class Ay extends ku{constructor(e){super(e),this.isDeviceVerificationSectionEnabled=this.getResponseProperty("IsDeviceVerificationSectionEnabled"),this.unknownDeviceVerificationEnabled=this.getResponseProperty("UnknownDeviceVerificationEnabled")}}class _y extends ku{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.domains=this.getResponseProperty("Domains"),this.excluded=this.getResponseProperty("Excluded")}}class Zy extends ku{constructor(e){super(e),this.globalEquivalentDomains=[],this.equivalentDomains=this.getResponseProperty("EquivalentDomains");const t=this.getResponseProperty("GlobalEquivalentDomains");this.globalEquivalentDomains=null!=t?t.map((e=>new _y(e))):[]}}class Ty extends ku{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")}}class Cy extends ku{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")}}class ky extends ku{constructor(e){super(e),this.keyEncrypted=this.getResponseProperty("KeyEncrypted"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations")}}class Oy extends ku{constructor(e){super(e),this.ciphers=[],this.keyEncrypted=this.getResponseProperty("KeyEncrypted");const t=this.getResponseProperty("Ciphers");null!=t&&(this.ciphers=t.map((e=>new cy(e))))}}class Py extends ku{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")}}class Iy extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.accessAll=this.getResponseProperty("AccessAll"),this.externalId=this.getResponseProperty("ExternalId")}}class qy extends Iy{constructor(e){super(e),this.collections=[];const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map((e=>new by(e))))}}class Dy extends ku{constructor(e){super(e),this.siteKey=this.getResponseProperty("HCaptcha_SiteKey")}}class My extends ku{constructor(e){super(e),this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.refreshToken=e.refresh_token,this.tokenType=e.token_type,this.resetMasterPassword=this.getResponseProperty("ResetMasterPassword"),this.privateKey=this.getResponseProperty("PrivateKey"),this.key=this.getResponseProperty("Key"),this.twoFactorToken=this.getResponseProperty("TwoFactorToken"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.forcePasswordReset=this.getResponseProperty("ForcePasswordReset"),this.apiUseKeyConnector=this.getResponseProperty("ApiUseKeyConnector"),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl")}}class Fy extends ku{constructor(e){super(e),this.twoFactorProviders2=new Map,this.captchaToken=this.getResponseProperty("CaptchaBypassToken"),this.twoFactorProviders=this.getResponseProperty("TwoFactorProviders");const t=this.getResponseProperty("TwoFactorProviders2");if(null!=t)for(const e in t)t.hasOwnProperty(e)&&this.twoFactorProviders2.set(parseInt(e,null),t[e])}}class Ny extends ku{constructor(e){super(e),this.key=this.getResponseProperty("Key")}}class Ly extends ku{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")}}class Ey extends ku{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 Ry extends ku{constructor(e){super(e),this.collections=this.getResponseProperty("Collections"),this.ciphers=this.getResponseProperty("Ciphers")}}class Jy extends ku{constructor(e){super(e);const t=this.getResponseProperty("LastSyncDate");t&&(this.lastSyncDate=new Date(t))}}class Yy extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.key=this.getResponseProperty("Key")}}class zy extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class Ky extends ku{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.manageAllCollections=this.getResponseProperty("ManageAllCollections"),this.manageAssignedCollections=this.getResponseProperty("ManageAssignedCollections"),this.createNewCollections=this.getResponseProperty("CreateNewCollections"),this.editAnyCollection=this.getResponseProperty("EditAnyCollection"),this.deleteAnyCollection=this.getResponseProperty("DeleteAnyCollection"),this.editAssignedCollections=this.getResponseProperty("EditAssignedCollections"),this.deleteAssignedCollections=this.getResponseProperty("DeleteAssignedCollections"),this.manageCiphers=this.getResponseProperty("ManageCiphers"),this.manageGroups=this.getResponseProperty("ManageGroups"),this.manageSso=this.getResponseProperty("ManageSso"),this.managePolicies=this.getResponseProperty("ManagePolicies"),this.manageUsers=this.getResponseProperty("ManageUsers"),this.manageResetPassword=this.getResponseProperty("ManageResetPassword"),this.manageScim=this.getResponseProperty("ManageScim")}}class By extends ku{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 Ky(this.getResponseProperty("Permissions")),this.accessAll=this.getResponseProperty("AccessAll"),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled")}}class Gy extends By{constructor(e){var t;super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled"),this.usesKeyConnector=null!==(t=this.getResponseProperty("UsesKeyConnector"))&&void 0!==t&&t}}class Qy extends By{constructor(e){super(e),this.collections=[];const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map((e=>new by(e))))}}class Vy extends ku{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.resetPasswordKey=this.getResponseProperty("ResetPasswordKey"),this.encryptedPrivateKey=this.getResponseProperty("EncryptedPrivateKey")}}class Hy extends ku{constructor(e){var t,i,n;super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.usePolicies=this.getResponseProperty("UsePolicies"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useSso=this.getResponseProperty("UseSso"),this.useKeyConnector=null!==(t=this.getResponseProperty("UseKeyConnector"))&&void 0!==t&&t,this.useScim=null!==(i=this.getResponseProperty("UseScim"))&&void 0!==i&&i,this.useResetPassword=this.getResponseProperty("UseResetPassword"),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 Ky(this.getResponseProperty("permissions")),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.userId=this.getResponseProperty("UserId"),this.providerId=this.getResponseProperty("ProviderId"),this.providerName=this.getResponseProperty("ProviderName"),this.familySponsorshipFriendlyName=this.getResponseProperty("FamilySponsorshipFriendlyName"),this.familySponsorshipAvailable=this.getResponseProperty("FamilySponsorshipAvailable"),this.planProductType=this.getResponseProperty("PlanProductType"),this.keyConnectorEnabled=null!==(n=this.getResponseProperty("KeyConnectorEnabled"))&&void 0!==n&&n,this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl");const s=this.getResponseProperty("FamilySponsorshipLastSyncDate");s&&(this.familySponsorshipLastSyncDate=new Date(s));const o=this.getResponseProperty("FamilySponsorshipValidUntil");o&&(this.familySponsorshipValidUntil=new Date(o)),this.familySponsorshipToDelete=this.getResponseProperty("FamilySponsorshipToDelete")}}class jy extends Hy{constructor(e){super(e),this.keyConnectorEnabled=!1}}class Wy extends ku{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 Ky(this.getResponseProperty("permissions")),this.userId=this.getResponseProperty("UserId"),this.useEvents=this.getResponseProperty("UseEvents")}}class $y extends ku{constructor(e){var t,i;super(e),this.organizations=[],this.providers=[],this.providerOrganizations=[],this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.emailVerified=this.getResponseProperty("EmailVerified"),this.masterPasswordHint=this.getResponseProperty("MasterPasswordHint"),this.premiumPersonally=this.getResponseProperty("Premium"),this.premiumFromOrganization=this.getResponseProperty("PremiumFromOrganization"),this.culture=this.getResponseProperty("Culture"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled"),this.key=this.getResponseProperty("Key"),this.privateKey=this.getResponseProperty("PrivateKey"),this.securityStamp=this.getResponseProperty("SecurityStamp"),this.forcePasswordReset=null!==(t=this.getResponseProperty("ForcePasswordReset"))&&void 0!==t&&t,this.usesKeyConnector=null!==(i=this.getResponseProperty("UsesKeyConnector"))&&void 0!==i&&i;const n=this.getResponseProperty("Organizations");null!=n&&(this.organizations=n.map((e=>new Hy(e))));const s=this.getResponseProperty("Providers");null!=s&&(this.providers=s.map((e=>new Wy(e))));const o=this.getResponseProperty("ProviderOrganizations");null!=o&&(this.providerOrganizations=o.map((e=>new jy(e))))}}class Xy extends ku{constructor(e){super(e);const t=this.getResponseProperty("UserProfile");null!=t&&(this.userProfile=new $y(t)),this.paymentIntentClientSecret=this.getResponseProperty("PaymentIntentClientSecret"),this.success=this.getResponseProperty("Success")}}class ef extends ku{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.product=this.getResponseProperty("Product"),this.name=this.getResponseProperty("Name"),this.isAnnual=this.getResponseProperty("IsAnnual"),this.nameLocalizationKey=this.getResponseProperty("NameLocalizationKey"),this.descriptionLocalizationKey=this.getResponseProperty("DescriptionLocalizationKey"),this.canBeUsedByBusiness=this.getResponseProperty("CanBeUsedByBusiness"),this.baseSeats=this.getResponseProperty("BaseSeats"),this.baseStorageGb=this.getResponseProperty("BaseStorageGb"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxUsers=this.getResponseProperty("MaxUsers"),this.hasAdditionalSeatsOption=this.getResponseProperty("HasAdditionalSeatsOption"),this.maxAdditionalSeats=this.getResponseProperty("MaxAdditionalSeats"),this.hasAdditionalStorageOption=this.getResponseProperty("HasAdditionalStorageOption"),this.maxAdditionalStorage=this.getResponseProperty("MaxAdditionalStorage"),this.hasPremiumAccessOption=this.getResponseProperty("HasPremiumAccessOption"),this.trialPeriodDays=this.getResponseProperty("TrialPeriodDays"),this.hasSelfHost=this.getResponseProperty("HasSelfHost"),this.hasPolicies=this.getResponseProperty("HasPolicies"),this.hasGroups=this.getResponseProperty("HasGroups"),this.hasDirectory=this.getResponseProperty("HasDirectory"),this.hasEvents=this.getResponseProperty("HasEvents"),this.hasTotp=this.getResponseProperty("HasTotp"),this.has2fa=this.getResponseProperty("Has2fa"),this.hasApi=this.getResponseProperty("HasApi"),this.hasSso=this.getResponseProperty("HasSso"),this.hasResetPassword=this.getResponseProperty("HasResetPassword"),this.usersGetPremium=this.getResponseProperty("UsersGetPremium"),this.upgradeSortOrder=this.getResponseProperty("UpgradeSortOrder"),this.displaySortOrder=this.getResponseProperty("SortOrder"),this.legacyYear=this.getResponseProperty("LegacyYear"),this.disabled=this.getResponseProperty("Disabled"),this.stripePlanId=this.getResponseProperty("StripePlanId"),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.stripeStoragePlanId=this.getResponseProperty("StripeStoragePlanId"),this.stripePremiumAccessPlanId=this.getResponseProperty("StripePremiumAccessPlanId"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.additionalStoragePricePerGb=this.getResponseProperty("AdditionalStoragePricePerGb"),this.premiumAccessOptionPrice=this.getResponseProperty("PremiumAccessOptionPrice")}}class tf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.type=this.getResponseProperty("Type"),this.data=this.getResponseProperty("Data"),this.enabled=this.getResponseProperty("Enabled")}}class nf extends ku{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations")}}class sf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.providerId=this.getResponseProperty("ProviderId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.key=this.getResponseProperty("Key"),this.settings=this.getResponseProperty("Settings"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.userCount=this.getResponseProperty("UserCount"),this.seats=this.getResponseProperty("Seats"),this.plan=this.getResponseProperty("Plan")}}class of extends sf{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}class rf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.billingEmail=this.getResponseProperty("BillingEmail")}}class af extends Yy{}class lf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class cf extends ku{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 Ky(this.getResponseProperty("Permissions"))}}class uf extends cf{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email")}}class df extends ku{constructor(e=null){super(e),null!=e&&(this.id=this.getResponseProperty("Id"),this.fileName=this.getResponseProperty("FileName"),this.size=this.getResponseProperty("Size"),this.sizeName=this.getResponseProperty("SizeName"))}}class hf extends ku{constructor(e=null){super(e),null!=e&&(this.text=this.getResponseProperty("Text"),this.hidden=this.getResponseProperty("Hidden")||!1)}}class pf extends ku{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 hf(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new df(i)),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.creatorIdentifier=this.getResponseProperty("CreatorIdentifier")}}class gf extends ku{constructor(e){super(e),this.id=null,this.url=null,this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url")}}class vf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.accessId=this.getResponseProperty("AccessId"),this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.key=this.getResponseProperty("Key"),this.maxAccessCount=this.getResponseProperty("MaxAccessCount"),this.accessCount=this.getResponseProperty("AccessCount"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.deletionDate=this.getResponseProperty("DeletionDate"),this.password=this.getResponseProperty("Password"),this.disable=this.getResponseProperty("Disabled")||!1,this.hideEmail=this.getResponseProperty("HideEmail")||!1;const t=this.getResponseProperty("Text");null!=t&&(this.text=new hf(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new df(i))}}class yf extends ku{constructor(e){super(e),this.url=null,this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("SendResponse");this.sendResponse=null==t?null:new vf(t),this.url=this.getResponseProperty("Url")}}class ff extends ku{constructor(e){super(e),this.token=this.getResponseProperty("Token")}}class mf extends ku{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"),this.usingInAppPurchase=this.getResponseProperty("UsingInAppPurchase");const t=this.getResponseProperty("Subscription"),i=this.getResponseProperty("UpcomingInvoice");this.subscription=null==t?null:new wf(t),this.upcomingInvoice=null==i?null:new Sf(i)}}class wf extends ku{constructor(e){super(e),this.items=[],this.trialEndDate=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 bf(e))))}}class bf extends ku{constructor(e){super(e),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")}}class Sf extends ku{constructor(e){super(e),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}class Uf extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.revisionDate=this.getResponseProperty("RevisionDate")}}class xf extends ku{constructor(e){super(e),this.folders=[],this.collections=[],this.ciphers=[],this.policies=[],this.sends=[];const t=this.getResponseProperty("Profile");null!=t&&(this.profile=new $y(t));const i=this.getResponseProperty("Folders");null!=i&&(this.folders=i.map((e=>new Uf(e))));const n=this.getResponseProperty("Collections");null!=n&&(this.collections=n.map((e=>new Uy(e))));const s=this.getResponseProperty("Ciphers");null!=s&&(this.ciphers=s.map((e=>new cy(e))));const o=this.getResponseProperty("Domains");null!=o&&(this.domains=new Zy(o));const r=this.getResponseProperty("Policies");null!=r&&(this.policies=r.map((e=>new tf(e))));const a=this.getResponseProperty("Sends");null!=a&&(this.sends=a.map((e=>new vf(e))))}}class Af extends ku{constructor(e){super(e),this.taxId=this.getResponseProperty("TaxIdNumber"),this.taxIdType=this.getResponseProperty("TaxIdType"),this.line1=this.getResponseProperty("Line1"),this.line2=this.getResponseProperty("Line2"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.country=this.getResponseProperty("Country")}}class _f extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.country=this.getResponseProperty("Country"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.rate=this.getResponseProperty("Rate")}}class Zf extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key=this.getResponseProperty("Key")}}class Tf extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.host=this.getResponseProperty("Host"),this.secretKey=this.getResponseProperty("SecretKey"),this.integrationKey=this.getResponseProperty("IntegrationKey")}}class Cf extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.email=this.getResponseProperty("Email")}}class kf extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.type=this.getResponseProperty("Type")}}class Of extends ku{constructor(e){super(e),this.code=this.getResponseProperty("Code")}}class Pf extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled");const t=this.getResponseProperty("Keys");this.keys=null==t?null:t.map((e=>new If(e)))}}class If extends ku{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.id=this.getResponseProperty("Id"),this.migrated=this.getResponseProperty("Migrated")}}class qf extends ku{constructor(e){super(e),this.attestation=this.getResponseProperty("attestation"),this.authenticatorSelection=this.getResponseProperty("authenticatorSelection"),this.challenge=nt.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.excludeCredentials=this.getResponseProperty("excludeCredentials").map((e=>(e.id=nt.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=nt.fromUrlB64ToArray(t.id),this.user=t}}class Df extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key1=this.getResponseProperty("Key1"),this.key2=this.getResponseProperty("Key2"),this.key3=this.getResponseProperty("Key3"),this.key4=this.getResponseProperty("Key4"),this.key5=this.getResponseProperty("Key5"),this.nfc=this.getResponseProperty("Nfc")}}class Mf extends ku{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.publicKey=this.getResponseProperty("PublicKey")}}var Ff,Nf=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Lf{constructor(e,t,i,n,s,o=null){this.tokenService=e,this.platformUtilsService=t,this.environmentService=i,this.appIdService=n,this.logoutCallback=s,this.customUserAgent=o,this.isWebClient=!1,this.isDesktopClient=!1,this.device=t.getDevice(),this.deviceType=this.device.toString(),this.isWebClient=this.device===dl.IEBrowser||this.device===dl.ChromeBrowser||this.device===dl.EdgeBrowser||this.device===dl.FirefoxBrowser||this.device===dl.OperaBrowser||this.device===dl.SafariBrowser||this.device===dl.UnknownBrowser||this.device===dl.VivaldiBrowser,this.isDesktopClient=this.device===dl.WindowsDesktop||this.device===dl.MacOsDesktop||this.device===dl.LinuxDesktop}postIdentityToken(e){return Nf(this,void 0,void 0,(function*(){const t=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent),e.alterIdentityTokenHeaders(t);const i=e instanceof Xv?e.toIdentityToken():e.toIdentityToken(this.platformUtilsService.getClientType()),n=yield this.fetch(new Request(this.environmentService.getIdentityUrl()+"/connect/token",{body:this.qsStringify(i),credentials:this.getCredentials(),cache:"no-store",headers:t,method:"POST"}));let s=null;if(this.isJsonResponse(n)&&(s=yield n.json()),null!=s){if(200===n.status)return new My(s);if(400===n.status&&s.TwoFactorProviders2&&Object.keys(s.TwoFactorProviders2).length)return yield this.tokenService.clearTwoFactorToken(),new Fy(s);if(400===n.status&&s.HCaptcha_SiteKey&&Object.keys(s.HCaptcha_SiteKey).length)return new Dy(s)}return Promise.reject(new Ou(s,n.status,!0))}))}refreshIdentityToken(){return Nf(this,void 0,void 0,(function*(){try{yield this.doAuthRefresh()}catch(e){return Promise.reject(null)}}))}postAuthRequest(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/auth-requests/",e,!1,!0);return new dy(t)}))}getAuthResponse(e,t){return Nf(this,void 0,void 0,(function*(){const i=`/auth-requests/${e}/response?code=${t}`,n=yield this.send("GET",i,null,!1,!0);return new dy(n)}))}getProfile(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/profile",null,!0,!0);return new $y(e)}))}getUserSubscription(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/subscription",null,!0,!0);return new mf(e)}))}getTaxInfo(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/tax",null,!0,!0);return new Af(e)}))}putProfile(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/accounts/profile",e,!0,!0);return new $y(t)}))}putTaxInfo(e){return this.send("PUT","/accounts/tax",e,!0,!1)}postPrelogin(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/prelogin",e,!1,!0,this.platformUtilsService.isDev()?this.environmentService.getIdentityUrl():this.environmentService.getApiUrl());return new nf(t)}))}postEmailToken(e){return this.send("POST","/accounts/email-token",e,!0,!1)}postEmail(e){return this.send("POST","/accounts/email",e,!0,!1)}postPassword(e){return this.send("POST","/accounts/password",e,!0,!1)}setPassword(e){return this.send("POST","/accounts/set-password",e,!0,!1)}postSetKeyConnectorKey(e){return this.send("POST","/accounts/set-key-connector-key",e,!0,!1)}postSecurityStamp(e){return this.send("POST","/accounts/security-stamp",e,!0,!1)}getAccountRevisionDate(){return Nf(this,void 0,void 0,(function*(){return yield this.send("GET","/accounts/revision-date",null,!0,!0)}))}postPasswordHint(e){return this.send("POST","/accounts/password-hint",e,!1,!1)}postRegister(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/register",e,!1,!0,this.platformUtilsService.isDev()?this.environmentService.getIdentityUrl():this.environmentService.getApiUrl());return new hy(t)}))}postPremium(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/premium",e,!0,!0);return new Xy(t)}))}postIapCheck(e){return Nf(this,void 0,void 0,(function*(){return this.send("POST","/accounts/iap-check",e,!0,!1)}))}postReinstatePremium(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)}postCancelPremium(){return this.send("POST","/accounts/cancel-premium",null,!0,!1)}postAccountStorage(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/accounts/storage",e,!0,!0);return new Xy(t)}))}postAccountPayment(e){return this.send("POST","/accounts/payment",e,!0,!1)}postAccountLicense(e){return this.send("POST","/accounts/license",e,!0,!1)}postAccountKeys(e){return this.send("POST","/accounts/keys",e,!0,!1)}postAccountKey(e){return this.send("POST","/accounts/key",e,!0,!1)}postAccountVerifyEmail(){return this.send("POST","/accounts/verify-email",null,!0,!1)}postAccountVerifyEmailToken(e){return this.send("POST","/accounts/verify-email-token",e,!1,!1)}postAccountVerifyPassword(e){return this.send("POST","/accounts/verify-password",e,!0,!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 Nf(this,void 0,void 0,(function*(){return this.send("DELETE","/accounts/sso/"+e,null,!0,!1)}))}getSsoUserIdentifier(){return Nf(this,void 0,void 0,(function*(){return this.send("GET","/accounts/sso/user-identifier",null,!0,!0)}))}postUserApiKey(e,t){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("POST","/accounts/api-key",t,!0,!0);return new ey(e)}))}postUserRotateApiKey(e,t){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("POST","/accounts/rotate-api-key",t,!0,!0);return new ey(e)}))}putUpdateTempPassword(e){return this.send("PUT","/accounts/update-temp-password",e,!0,!1)}postConvertToKeyConnector(){return this.send("POST","/accounts/convert-to-key-connector",null,!0,!1)}getUserBillingHistory(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/billing/history",null,!0,!0);return new fy(e)}))}getUserBillingPayment(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/accounts/billing/payment-method",null,!0,!0);return new my(e)}))}getSend(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/sends/"+e,null,!0,!0);return new vf(t)}))}postSendAccess(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("POST","/sends/access/"+e,t,!1,!0,i,(t=>{t.set("Send-Id",e)}));return new pf(n)}))}getSendFileDownloadData(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("POST","/sends/"+e.id+"/access/file/"+e.file.id,t,!1,!0,i,(t=>{t.set("Send-Id",e.id)}));return new gf(n)}))}getSends(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/sends",null,!0,!0);return new Ly(e,vf)}))}postSend(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/sends",e,!0,!0);return new vf(t)}))}postFileTypeSend(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/sends/file/v2",e,!0,!0);return new yf(t)}))}renewSendFileUploadUrl(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/sends/"+e+"/file/"+t,null,!0,!0);return new yf(i)}))}postSendFile(e,t,i){return this.send("POST","/sends/"+e+"/file/"+t,i,!0,!1)}postSendFileLegacy(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/sends/file",e,!0,!0);return new vf(t)}))}putSend(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/sends/"+e,t,!0,!0);return new vf(i)}))}putSendRemovePassword(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/sends/"+e+"/remove-password",null,!0,!0);return new vf(t)}))}deleteSend(e){return this.send("DELETE","/sends/"+e,null,!0,!1)}getCipher(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e,null,!0,!0);return new cy(t)}))}getFullCipherDetails(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e+"/details",null,!0,!0);return new cy(t)}))}getCipherAdmin(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/"+e+"/admin",null,!0,!0);return new cy(t)}))}getCiphersOrganization(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/ciphers/organization-details?organizationId="+e,null,!0,!0);return new Ly(t,cy)}))}postCipher(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers",e,!0,!0);return new cy(t)}))}postCipherCreate(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers/create",e,!0,!0);return new cy(t)}))}postCipherAdmin(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/ciphers/admin",e,!0,!0);return new cy(t)}))}putCipher(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e,t,!0,!0);return new cy(i)}))}putCipherAdmin(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/admin",t,!0,!0);return new cy(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 Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/ciphers/"+e+"/share",t,!0,!0);return new cy(i)}))}putShareCiphers(e){return this.send("PUT","/ciphers/share",e,!0,!1)}putCipherCollections(e,t){return this.send("PUT","/ciphers/"+e+"/collections",t,!0,!1)}putCipherCollectionsAdmin(e,t){return this.send("PUT","/ciphers/"+e+"/collections-admin",t,!0,!1)}postPurgeCiphers(e,t=null){let i="/ciphers/purge";return null!=t&&(i+="?organizationId="+t),this.send("POST",i,e,!0,!1)}postImportCiphers(e){return this.send("POST","/ciphers/import",e,!0,!1)}postImportOrganizationCiphers(e,t){return this.send("POST","/ciphers/import-organization?organizationId="+e,t,!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 Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore",null,!0,!0);return new cy(t)}))}putRestoreCipherAdmin(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore-admin",null,!0,!0);return new cy(t)}))}putRestoreManyCiphers(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/ciphers/restore",e,!0,!0);return new Ly(t,cy)}))}getAttachmentData(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=(null!=i?"/emergency-access/"+i+"/":"/ciphers/")+e+"/attachment/"+t,s=yield this.send("GET",n,null,!0,!0);return new ty(s)}))}postCipherAttachment(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment/v2",t,!0,!0);return new uy(i)}))}postCipherAttachmentLegacy(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment",t,!0,!0);return new cy(i)}))}postCipherAttachmentAdminLegacy(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment-admin",t,!0,!0);return new cy(i)}))}deleteCipherAttachment(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t,null,!0,!1)}deleteCipherAttachmentAdmin(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t+"/admin",null,!0,!1)}postShareCipherAttachment(e,t,i,n){return this.send("POST","/ciphers/"+e+"/attachment/"+t+"/share?organizationId="+n,i,!0,!1)}renewAttachmentUploadUrl(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/ciphers/"+e+"/attachment/"+t+"/renew",null,!0,!0);return new uy(i)}))}postAttachmentFile(e,t,i){return this.send("POST","/ciphers/"+e+"/attachment/"+t,i,!0,!1)}getCollectionDetails(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/organizations/"+e+"/collections/"+t+"/details",null,!0,!0);return new xy(i)}))}getUserCollections(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/collections",null,!0,!0);return new Ly(e,Sy)}))}getCollections(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/collections",null,!0,!0);return new Ly(t,Sy)}))}getCollectionUsers(e,t){return Nf(this,void 0,void 0,(function*(){return(yield this.send("GET","/organizations/"+e+"/collections/"+t+"/users",null,!0,!0)).map((e=>new by(e)))}))}postCollection(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/collections",t,!0,!0);return new Sy(i)}))}putCollection(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("PUT","/organizations/"+e+"/collections/"+t,i,!0,!0);return new Sy(n)}))}putCollectionUsers(e,t,i){return Nf(this,void 0,void 0,(function*(){yield this.send("PUT","/organizations/"+e+"/collections/"+t+"/users",i,!0,!1)}))}deleteCollection(e,t){return this.send("DELETE","/organizations/"+e+"/collections/"+t,null,!0,!1)}deleteCollectionUser(e,t,i){return this.send("DELETE","/organizations/"+e+"/collections/"+t+"/user/"+i,null,!0,!1)}getGroupDetails(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/organizations/"+e+"/groups/"+t+"/details",null,!0,!0);return new qy(i)}))}getGroups(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/groups",null,!0,!0);return new Ly(t,Iy)}))}getGroupUsers(e,t){return Nf(this,void 0,void 0,(function*(){return yield this.send("GET","/organizations/"+e+"/groups/"+t+"/users",null,!0,!0)}))}postGroup(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/groups",t,!0,!0);return new Iy(i)}))}putGroup(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("PUT","/organizations/"+e+"/groups/"+t,i,!0,!0);return new Iy(n)}))}putGroupUsers(e,t,i){return Nf(this,void 0,void 0,(function*(){yield this.send("PUT","/organizations/"+e+"/groups/"+t+"/users",i,!0,!1)}))}deleteGroup(e,t){return this.send("DELETE","/organizations/"+e+"/groups/"+t,null,!0,!1)}deleteGroupUser(e,t,i){return this.send("DELETE","/organizations/"+e+"/groups/"+t+"/user/"+i,null,!0,!1)}getOrganizationUser(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/organizations/"+e+"/users/"+t,null,!0,!0);return new Qy(i)}))}getOrganizationUserGroups(e,t){return Nf(this,void 0,void 0,(function*(){return yield this.send("GET","/organizations/"+e+"/users/"+t+"/groups",null,!0,!0)}))}getOrganizationUsers(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/users",null,!0,!0);return new Ly(t,Gy)}))}getOrganizationUserResetPasswordDetails(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/organizations/"+e+"/users/"+t+"/reset-password-details",null,!0,!0);return new Vy(i)}))}postOrganizationUserInvite(e,t){return this.send("POST","/organizations/"+e+"/users/invite",t,!0,!1)}postOrganizationUserReinvite(e,t){return this.send("POST","/organizations/"+e+"/users/"+t+"/reinvite",null,!0,!1)}postManyOrganizationUserReinvite(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/users/reinvite",t,!0,!0);return new Ly(i,zy)}))}postOrganizationUserAccept(e,t,i){return this.send("POST","/organizations/"+e+"/users/"+t+"/accept",i,!0,!1)}postOrganizationUserConfirm(e,t,i){return this.send("POST","/organizations/"+e+"/users/"+t+"/confirm",i,!0,!1)}postOrganizationUsersPublicKey(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/users/public-keys",t,!0,!0);return new Ly(i,Yy)}))}postOrganizationUserBulkConfirm(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/users/confirm",t,!0,!0);return new Ly(i,zy)}))}putOrganizationUser(e,t,i){return this.send("PUT","/organizations/"+e+"/users/"+t,i,!0,!1)}putOrganizationUserGroups(e,t,i){return this.send("PUT","/organizations/"+e+"/users/"+t+"/groups",i,!0,!1)}putOrganizationUserResetPasswordEnrollment(e,t,i){return this.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password-enrollment",i,!0,!1)}putOrganizationUserResetPassword(e,t,i){return this.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password",i,!0,!1)}deleteOrganizationUser(e,t){return this.send("DELETE","/organizations/"+e+"/users/"+t,null,!0,!1)}deleteManyOrganizationUsers(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("DELETE","/organizations/"+e+"/users",t,!0,!0);return new Ly(i,zy)}))}revokeOrganizationUser(e,t){return this.send("PUT","/organizations/"+e+"/users/"+t+"/revoke",null,!0,!1)}revokeManyOrganizationUsers(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/users/revoke",t,!0,!0);return new Ly(i,zy)}))}restoreOrganizationUser(e,t){return this.send("PUT","/organizations/"+e+"/users/"+t+"/restore",null,!0,!1)}restoreManyOrganizationUsers(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/users/restore",t,!0,!0);return new Ly(i,zy)}))}getPlans(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/plans/",null,!1,!0);return new Ly(e,ef)}))}postPublicImportDirectory(e){return Nf(this,void 0,void 0,(function*(){return this.send("POST","/public/organization/import",e,!0,!1)}))}getTaxRates(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/plans/sales-tax-rates/",null,!0,!0);return new Ly(e,_f)}))}getSettingsDomains(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/settings/domains",null,!0,!0);return new Zy(e)}))}putSettingsDomains(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/settings/domains",e,!0,!0);return new Zy(t)}))}getSync(){return Nf(this,void 0,void 0,(function*(){const e=this.isDesktopClient||this.isWebClient?"/sync?excludeDomains=true":"/sync",t=yield this.send("GET",e,null,!0,!0);return new xf(t)}))}getTwoFactorProviders(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/two-factor",null,!0,!0);return new Ly(e,kf)}))}getTwoFactorOrganizationProviders(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/two-factor",null,!0,!0);return new Ly(t,kf)}))}getTwoFactorAuthenticator(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-authenticator",e,!0,!0);return new Zf(t)}))}getTwoFactorEmail(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-email",e,!0,!0);return new Cf(t)}))}getTwoFactorDuo(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-duo",e,!0,!0);return new Tf(t)}))}getTwoFactorOrganizationDuo(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/"+e+"/two-factor/get-duo",t,!0,!0);return new Tf(i)}))}getTwoFactorYubiKey(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-yubikey",e,!0,!0);return new Df(t)}))}getTwoFactorWebAuthn(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-webauthn",e,!0,!0);return new Pf(t)}))}getTwoFactorWebAuthnChallenge(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-webauthn-challenge",e,!0,!0);return new qf(t)}))}getTwoFactorRecover(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/two-factor/get-recover",e,!0,!0);return new Of(t)}))}putTwoFactorAuthenticator(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/authenticator",e,!0,!0);return new Zf(t)}))}putTwoFactorEmail(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/email",e,!0,!0);return new Cf(t)}))}putTwoFactorDuo(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/duo",e,!0,!0);return new Tf(t)}))}putTwoFactorOrganizationDuo(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/two-factor/duo",t,!0,!0);return new Tf(i)}))}putTwoFactorYubiKey(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/yubikey",e,!0,!0);return new Df(t)}))}putTwoFactorWebAuthn(e){return Nf(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:nt.fromBufferToB64(t.attestationObject),clientDataJson:nt.fromBufferToB64(t.clientDataJSON)}};const n=yield this.send("PUT","/two-factor/webauthn",i,!0,!0);return new Pf(n)}))}deleteTwoFactorWebAuthn(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("DELETE","/two-factor/webauthn",e,!0,!0);return new Pf(t)}))}putTwoFactorDisable(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/disable",e,!0,!0);return new kf(t)}))}putTwoFactorOrganizationDisable(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/organizations/"+e+"/two-factor/disable",t,!0,!0);return new kf(i)}))}postTwoFactorRecover(e){return this.send("POST","/two-factor/recover",e,!1,!1)}postTwoFactorEmailSetup(e){return this.send("POST","/two-factor/send-email",e,!0,!1)}postTwoFactorEmail(e){return this.send("POST","/two-factor/send-email-login",e,!1,!1)}getDeviceVerificationSettings(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/two-factor/get-device-verification-settings",null,!0,!0);return new Ay(e)}))}putDeviceVerificationSettings(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("PUT","/two-factor/device-verification-settings",e,!0,!0);return new Ay(t)}))}getEmergencyAccessTrusted(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/emergency-access/trusted",null,!0,!0);return new Ly(e,Ty)}))}getEmergencyAccessGranted(){return Nf(this,void 0,void 0,(function*(){const e=yield this.send("GET","/emergency-access/granted",null,!0,!0);return new Ly(e,Cy)}))}getEmergencyAccess(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/emergency-access/"+e,null,!0,!0);return new Ty(t)}))}getEmergencyGrantorPolicies(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/emergency-access/"+e+"/policies",null,!0,!0);return new Ly(t,tf)}))}putEmergencyAccess(e,t){return this.send("PUT","/emergency-access/"+e,t,!0,!1)}deleteEmergencyAccess(e){return this.send("DELETE","/emergency-access/"+e,null,!0,!1)}postEmergencyAccessInvite(e){return this.send("POST","/emergency-access/invite",e,!0,!1)}postEmergencyAccessReinvite(e){return this.send("POST","/emergency-access/"+e+"/reinvite",null,!0,!1)}postEmergencyAccessAccept(e,t){return this.send("POST","/emergency-access/"+e+"/accept",t,!0,!1)}postEmergencyAccessConfirm(e,t){return this.send("POST","/emergency-access/"+e+"/confirm",t,!0,!1)}postEmergencyAccessInitiate(e){return this.send("POST","/emergency-access/"+e+"/initiate",null,!0,!1)}postEmergencyAccessApprove(e){return this.send("POST","/emergency-access/"+e+"/approve",null,!0,!1)}postEmergencyAccessReject(e){return this.send("POST","/emergency-access/"+e+"/reject",null,!0,!1)}postEmergencyAccessTakeover(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/emergency-access/"+e+"/takeover",null,!0,!0);return new ky(t)}))}postEmergencyAccessPassword(e,t){return Nf(this,void 0,void 0,(function*(){yield this.send("POST","/emergency-access/"+e+"/password",t,!0,!0)}))}postEmergencyAccessView(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("POST","/emergency-access/"+e+"/view",null,!0,!0);return new Oy(t)}))}getCloudCommunicationsEnabled(){return Nf(this,void 0,void 0,(function*(){return yield this.send("GET","/organizations/connections/enabled",null,!0,!0)}))}getOrganizationConnection(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("GET",`/organizations/connections/${e}/${t}`,null,!0,!0);return new Ey(n,i)}))}createOrganizationConnection(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/organizations/connections/",e,!0,!0);return new Ey(i,t)}))}updateOrganizationConnection(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("PUT","/organizations/connections/"+i,e,!0,!0);return new Ey(n,t)}))}deleteOrganizationConnection(e){return Nf(this,void 0,void 0,(function*(){return this.send("DELETE","/organizations/connections/"+e,null,!0,!1)}))}postProviderSetup(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/setup",t,!0,!0);return new rf(i)}))}getProvider(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/providers/"+e,null,!0,!0);return new rf(t)}))}putProvider(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("PUT","/providers/"+e,t,!0,!0);return new rf(i)}))}getProviderUsers(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/providers/"+e+"/users",null,!0,!0);return new Ly(t,uf)}))}getProviderUser(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("GET","/providers/"+e+"/users/"+t,null,!0,!0);return new cf(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 Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/reinvite",t,!0,!0);return new Ly(i,lf)}))}postProviderUserBulkConfirm(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/confirm",t,!0,!0);return new Ly(i,lf)}))}deleteManyProviderUsers(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("DELETE","/providers/"+e+"/users",t,!0,!0);return new Ly(i,lf)}))}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 Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/users/public-keys",t,!0,!0);return new Ly(i,af)}))}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 Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new Ly(t,of)}))}postProviderAddOrganization(e,t){return this.send("POST","/providers/"+e+"/organizations/add",t,!0,!1)}postProviderCreateOrganization(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.send("POST","/providers/"+e+"/organizations",t,!0,!0);return new sf(i)}))}deleteProviderOrganization(e,t){return this.send("DELETE","/providers/"+e+"/organizations/"+t,null,!0,!1)}getEvents(e,t,i){return Nf(this,void 0,void 0,(function*(){const n=yield this.send("GET",this.addEventParameters("/events",e,t,i),null,!0,!0);return new Ly(n,Py)}))}getEventsCipher(e,t,i,n){return Nf(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/ciphers/"+e+"/events",t,i,n),null,!0,!0);return new Ly(s,Py)}))}getEventsOrganization(e,t,i,n){return Nf(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/events",t,i,n),null,!0,!0);return new Ly(s,Py)}))}getEventsOrganizationUser(e,t,i,n,s){return Nf(this,void 0,void 0,(function*(){const o=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/users/"+t+"/events",i,n,s),null,!0,!0);return new Ly(o,Py)}))}getEventsProvider(e,t,i,n){return Nf(this,void 0,void 0,(function*(){const s=yield this.send("GET",this.addEventParameters("/providers/"+e+"/events",t,i,n),null,!0,!0);return new Ly(s,Py)}))}getEventsProviderUser(e,t,i,n,s){return Nf(this,void 0,void 0,(function*(){const o=yield this.send("GET",this.addEventParameters("/providers/"+e+"/users/"+t+"/events",i,n,s),null,!0,!0);return new Ly(o,Py)}))}postEventsCollect(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.getActiveBearerToken(),i=new Headers({"Device-Type":this.deviceType,Authorization:"Bearer "+t,"Content-Type":"application/json; charset=utf-8"});null!=this.customUserAgent&&i.set("User-Agent",this.customUserAgent);if(200!==(yield this.fetch(new Request(this.environmentService.getEventsUrl()+"/collect",{cache:"no-store",credentials:this.getCredentials(),method:"POST",body:JSON.stringify(e),headers:i}))).status)return Promise.reject("Event post failed.")}))}getUserPublicKey(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/users/"+e+"/public-key",null,!0,!0);return new Mf(t)}))}getHibpBreach(e){return Nf(this,void 0,void 0,(function*(){return(yield this.send("GET","/hibp/breach?username="+e,null,!0,!0)).map((e=>new wy(e)))}))}postBitPayInvoice(e){return Nf(this,void 0,void 0,(function*(){return yield this.send("POST","/bitpay-invoice",e,!0,!0)}))}postSetupPayment(){return Nf(this,void 0,void 0,(function*(){return yield this.send("POST","/setup-payment",null,!0,!0)}))}getUserKeyFromKeyConnector(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.getActiveBearerToken(),i=yield this.fetch(new Request(e+"/user-keys",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+t})}));if(200!==i.status){const e=yield this.handleError(i,!1,!0);return Promise.reject(e)}return new Ny(yield i.json())}))}postUserKeyToKeyConnector(e,t){return Nf(this,void 0,void 0,(function*(){const i=yield this.getActiveBearerToken(),n=yield this.fetch(new Request(e+"/user-keys",{cache:"no-store",method:"POST",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+i,"Content-Type":"application/json; charset=utf-8"}),body:JSON.stringify(t)}));if(200!==n.status){const e=yield this.handleError(n,!1,!0);return Promise.reject(e)}}))}getKeyConnectorAlive(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.fetch(new Request(e+"/alive",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json","Content-Type":"application/json; charset=utf-8"})}));if(200!==t.status){const e=yield this.handleError(t,!1,!0);return Promise.reject(e)}}))}getOrganizationExport(e){return Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organizations/"+e+"/export",null,!0,!0);return new Ry(t)}))}getActiveBearerToken(){return Nf(this,void 0,void 0,(function*(){let e=yield this.tokenService.getToken();return(yield this.tokenService.tokenNeedsRefresh())&&(yield this.doAuthRefresh(),e=yield this.tokenService.getToken()),e}))}fetch(e){return Nf(this,void 0,void 0,(function*(){return"GET"===e.method&&(e.headers.set("Cache-Control","no-store"),e.headers.set("Pragma","no-cache")),e.headers.set("Bitwarden-Client-Name",this.platformUtilsService.getClientType()),e.headers.set("Bitwarden-Client-Version",yield this.platformUtilsService.getApplicationVersion()),this.nativeFetch(e)}))}nativeFetch(e){return fetch(e)}preValidateSso(e){return Nf(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=`/account/prevalidate?domainHint=${encodeURIComponent(e)}`,n=yield this.fetch(new Request(this.environmentService.getIdentityUrl()+i,{cache:"no-store",credentials:this.getCredentials(),headers:t,method:"GET"}));if(200===n.status){const e=yield n.json();return new ff(e)}{const e=yield this.handleError(n,!1,!0);return Promise.reject(e)}}))}postCreateSponsorship(e,t){return Nf(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 Nf(this,void 0,void 0,(function*(){const t=yield this.send("GET","/organization/sponsorship/"+e+"/sync-status",null,!0,!0);return new Jy(t)}))}deleteRevokeSponsorship(e){return Nf(this,void 0,void 0,(function*(){return yield this.send("DELETE","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e,null,!0,!1)}))}deleteRemoveSponsorship(e){return Nf(this,void 0,void 0,(function*(){return yield this.send("DELETE","/organization/sponsorship/sponsored/"+e,null,!0,!1)}))}postPreValidateSponsorshipToken(e){return Nf(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/validate-token?sponsorshipToken="+encodeURIComponent(e),null,!0,!0)}))}postRedeemSponsorship(e,t){return Nf(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/redeem?sponsorshipToken="+encodeURIComponent(e),t,!0,!1)}))}postResendSponsorshipOffer(e){return Nf(this,void 0,void 0,(function*(){return yield this.send("POST","/organization/sponsorship/"+e+"/families-for-enterprise/resend",null,!0,!1)}))}doAuthRefresh(){return Nf(this,void 0,void 0,(function*(){const e=yield this.tokenService.getRefreshToken();if(null!=e&&""!==e)return this.doRefreshToken();const t=yield this.tokenService.getClientId(),i=yield this.tokenService.getClientSecret();if(!nt.isNullOrWhitespace(t)&&!nt.isNullOrWhitespace(i))return this.doApiTokenRefresh();throw new Error("Cannot refresh token, no refresh token or api keys are stored")}))}doRefreshToken(){return Nf(this,void 0,void 0,(function*(){const e=yield this.tokenService.getRefreshToken();if(null==e||""===e)throw new Error;const t=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent);const i=yield this.tokenService.decodeToken(),n=yield this.fetch(new Request(this.environmentService.getIdentityUrl()+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:i.client_id,refresh_token:e}),cache:"no-store",credentials:this.getCredentials(),headers:t,method:"POST"}));if(200!==n.status){const e=yield this.handleError(n,!0,!0);return Promise.reject(e)}{const e=yield n.json(),t=new My(e);yield this.tokenService.setTokens(t.accessToken,t.refreshToken,null)}}))}doApiTokenRefresh(){return Nf(this,void 0,void 0,(function*(){const e=yield this.tokenService.getClientId(),t=yield this.tokenService.getClientSecret(),i=yield this.appIdService.getAppId(),n=new Wv(i,this.platformUtilsService),s=new Xv(e,t,new bn,n),o=yield this.postIdentityToken(s);if(!(o instanceof My))throw new Error("Invalid response received when refreshing api token");yield this.tokenService.setToken(o.accessToken)}))}send(e,t,i,n,s,o,r){return Nf(this,void 0,void 0,(function*(){const a=(o=nt.isNullOrWhitespace(o)?this.environmentService.getApiUrl():o)+t;if(new URL(a).href!==a)return Promise.reject("Invalid request url path.");const l=new Headers({"Device-Type":this.deviceType});null!=this.customUserAgent&&l.set("User-Agent",this.customUserAgent);const c={cache:"no-store",credentials:this.getCredentials(),method:e};if(n){const e=yield this.getActiveBearerToken();l.set("Authorization","Bearer "+e)}null!=i&&("string"==typeof i?(c.body=i,l.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof i&&(i instanceof FormData?c.body=i:(l.set("Content-Type","application/json; charset=utf-8"),c.body=JSON.stringify(i)))),s&&l.set("Accept","application/json"),null!=r&&r(l),c.headers=l;const u=yield this.fetch(new Request(a,c)),d=u.headers.get("content-type"),h=null!=d&&-1!==d.indexOf("application/json");if(s&&200===u.status&&h){return yield u.json()}if(200!==u.status){const e=yield this.handleError(u,!1,n);return Promise.reject(e)}}))}handleError(e,t,i){return Nf(this,void 0,void 0,(function*(){if(i&&(t&&400===e.status||401===e.status||403===e.status))return yield this.logoutCallback(!0),null;let n=null;return this.isJsonResponse(e)?n=yield e.json():this.isTextResponse(e)&&(n={Message:yield e.text()}),new Ou(n,e.status,t)}))}qsStringify(e){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}getCredentials(){if(!this.isWebClient||this.environmentService.hasBaseUrl())return"include"}addEventParameters(e,t,i,n){return null!=t&&(e+="?start="+t),null!=i&&(e+=e.indexOf("?")>-1?"&":"?",e+="end="+i),null!=n&&(e+=e.indexOf("?")>-1?"&":"?",e+="continuationToken="+n),e}isJsonResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("application/json")>-1}isTextResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("text")>-1}}!function(e){e.Local="local",e.Memory="memory",e.Session="session"}(Ff||(Ff={}));var Ef=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Rf{constructor(e){this.storageService=e}getAppId(){return this.makeAndGetAppId("appId")}getAnonymousAppId(){return this.makeAndGetAppId("anonymousAppId")}makeAndGetAppId(e){return Ef(this,void 0,void 0,(function*(){const t=yield this.storageService.get(e,{htmlStorageLocation:Ff.Local});if(null!=t)return t;const i=nt.newGuid();return yield this.storageService.save(e,i,{htmlStorageLocation:Ff.Local}),i}))}}var Jf=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Yf=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},zf=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kf{constructor(e,t){this.cryptoFunctionService=e,this.apiService=t}passwordLeaked(e){return zf(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.hash(e,"sha1"),i=nt.fromBufferToHex(t).toUpperCase(),n=i.substr(0,5),s=i.substr(5),o=yield this.apiService.nativeFetch(new Request("https://api.pwnedpasswords.com/range/"+n)),r=(yield o.text()).split(/\r?\n/).find((e=>e.split(":")[0]===s));return null!=r?parseInt(r.split(":")[1],10):0}))}breachedAccounts(e){return zf(this,void 0,void 0,(function*(){try{return yield this.apiService.getHibpBreach(e)}catch(e){if(404===e.statusCode)return[];throw new Error}}))}}var Bf,Gf;Jf([(Bf=100,Gf=()=>"passwordLeaked",(e,t,i)=>{const n=i.value,s=new Map;return{value:function(...e){const t=(e=>{let t=s.get(e);return null!=t||(t=new Map,s.set(e,t)),t})(this),i=Gf(e);let o=t.get(i);return null==o&&(o=[],t.set(i,o)),new Promise(((r,a)=>{const l=()=>{const c=()=>{o.splice(o.indexOf(l),1),o.length>=Bf?o[Bf-1]():0===o.length&&(t.delete(i),0===t.size&&s.delete(this))};n.apply(this,e).then((e=>(c(),e))).catch((e=>{throw c(),e})).then(r,a)};o.push(l),o.length<=Bf&&l()}))}}}),Yf("design:type",Function),Yf("design:paramtypes",[String]),Yf("design:returntype",Promise)],Kf.prototype,"passwordLeaked",null);class Qf{constructor(){this.captchaSiteKey="",this.resetMasterPassword=!1,this.forcePasswordReset=!1,this.twoFactorProviders=null}get requiresCaptcha(){return!nt.isNullOrWhitespace(this.captchaSiteKey)}get requiresTwoFactor(){return null!=this.twoFactorProviders}}var Vf=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hf{constructor(e,t,i,n,s,o,r,a,l){this.cryptoService=e,this.apiService=t,this.tokenService=i,this.appIdService=n,this.platformUtilsService=s,this.messagingService=o,this.logService=r,this.stateService=a,this.twoFactorService=l,this.captchaBypassToken=null}logInTwoFactor(e,t=null){return Vf(this,void 0,void 0,(function*(){return this.tokenRequest.setTwoFactor(e),this.startLogIn()}))}startLogIn(){return Vf(this,void 0,void 0,(function*(){this.twoFactorService.clearSelectedProvider();const e=yield this.apiService.postIdentityToken(this.tokenRequest);if(e instanceof Fy)return this.processTwoFactorResponse(e);if(e instanceof Dy)return this.processCaptchaResponse(e);if(e instanceof My)return this.processTokenResponse(e);throw new Error("Invalid response object.")}))}onSuccessfulLogin(e){return null}buildDeviceRequest(){return Vf(this,void 0,void 0,(function*(){const e=yield this.appIdService.getAppId();return new Wv(e,this.platformUtilsService)}))}buildTwoFactor(e){return Vf(this,void 0,void 0,(function*(){if(null!=e)return e;const t=yield this.tokenService.getTwoFactorToken();return null!=t?new bn(fn.Remember,t,!1):new bn}))}saveAccountInformation(e){return Vf(this,void 0,void 0,(function*(){const t=yield this.tokenService.decodeToken(e.accessToken);yield this.stateService.addAccount(new Mv({profile:Object.assign(Object.assign({},new Iv),{userId:t.sub,email:t.email,hasPremiumPersonally:t.premium,kdfIterations:e.kdfIterations,kdfType:e.kdf}),tokens:Object.assign(Object.assign({},new Dv),{accessToken:e.accessToken,refreshToken:e.refreshToken})}))}))}processTokenResponse(e){var t;return Vf(this,void 0,void 0,(function*(){const i=new Qf;i.resetMasterPassword=e.resetMasterPassword,i.forcePasswordReset=e.forcePasswordReset,yield this.saveAccountInformation(e),null!=e.twoFactorToken&&(yield this.tokenService.setTwoFactorToken(e));return null==e.key||(yield this.cryptoService.setEncKey(e.key),yield this.cryptoService.setEncPrivateKey(null!==(t=e.privateKey)&&void 0!==t?t:yield this.createKeyPairForOldAccount())),yield this.onSuccessfulLogin(e),this.messagingService.send("loggedIn"),i}))}processTwoFactorResponse(e){var t;return Vf(this,void 0,void 0,(function*(){const i=new Qf;return i.twoFactorProviders=e.twoFactorProviders2,this.twoFactorService.setProviders(e),this.captchaBypassToken=null!==(t=e.captchaToken)&&void 0!==t?t:null,i}))}processCaptchaResponse(e){return Vf(this,void 0,void 0,(function*(){const t=new Qf;return t.captchaSiteKey=e.siteKey,t}))}createKeyPairForOldAccount(){return Vf(this,void 0,void 0,(function*(){try{const[e,t]=yield this.cryptoService.makeKeyPair();return yield this.apiService.postAccountKeys(new ki(e,t.encryptedString)),t.encryptedString}catch(e){this.logService.error(e)}}))}}var jf=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wf extends Hf{constructor(e,t,i,n,s,o,r,a,l,c,u){super(e,t,i,n,s,o,r,a,l),this.environmentService=c,this.keyConnectorService=u}onSuccessfulLogin(e){return jf(this,void 0,void 0,(function*(){if(e.apiUseKeyConnector){const e=this.environmentService.getKeyConnectorUrl();yield this.keyConnectorService.getAndSetKey(e)}}))}logIn(e){return jf(this,void 0,void 0,(function*(){return this.tokenRequest=new Xv(e.clientId,e.clientSecret,yield this.buildTwoFactor(),yield this.buildDeviceRequest()),this.startLogIn()}))}saveAccountInformation(e){const t=Object.create(null,{saveAccountInformation:{get:()=>super.saveAccountInformation}});return jf(this,void 0,void 0,(function*(){yield t.saveAccountInformation.call(this,e),yield this.stateService.setApiKeyClientId(this.tokenRequest.clientId),yield this.stateService.setApiKeyClientSecret(this.tokenRequest.clientSecret)}))}}class $f extends $v{constructor(e,t,i,n,s){super(n,s),this.email=e,this.masterPasswordHash=t,this.captchaResponse=i,this.twoFactor=n}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="password",t.username=this.email,t.password=this.masterPasswordHash,null!=this.captchaResponse&&(t.captchaResponse=this.captchaResponse),t}alterIdentityTokenHeaders(e){e.set("Auth-Email",nt.fromUtf8ToUrlB64(this.email))}}var Xf=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class em extends Hf{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,n,s,o,r,a,l),this.authService=c}get email(){return this.tokenRequest.email}get masterPasswordHash(){return this.tokenRequest.masterPasswordHash}onSuccessfulLogin(){return Xf(this,void 0,void 0,(function*(){yield this.cryptoService.setKey(this.key),yield this.cryptoService.setKeyHash(this.localHashedPassword)}))}logInTwoFactor(e,t){const i=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return Xf(this,void 0,void 0,(function*(){return this.tokenRequest.captchaResponse=null!=t?t:this.captchaBypassToken,i.logInTwoFactor.call(this,e)}))}logIn(e){return Xf(this,void 0,void 0,(function*(){const{email:t,masterPassword:i,captchaToken:n,twoFactor:s}=e;this.key=yield this.authService.makePreloginKey(i,t),this.localHashedPassword=yield this.cryptoService.hashPassword(i,this.key,Et.LocalAuthorization);const o=yield this.cryptoService.hashPassword(i,this.key);return this.tokenRequest=new $f(t,o,n,yield this.buildTwoFactor(s),yield this.buildDeviceRequest()),this.startLogIn()}))}}var tm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class im extends Hf{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,n,s,o,r,a,l),this.authService=c}get email(){return this.tokenRequest.email}get masterPasswordHash(){return this.tokenRequest.masterPasswordHash}onSuccessfulLogin(){return tm(this,void 0,void 0,(function*(){yield this.cryptoService.setKey(this.key),yield this.cryptoService.setKeyHash(this.localHashedPassword)}))}logInTwoFactor(e,t){const i=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return tm(this,void 0,void 0,(function*(){return this.tokenRequest.captchaResponse=null!=t?t:this.captchaBypassToken,i.logInTwoFactor.call(this,e)}))}logIn(e){return tm(this,void 0,void 0,(function*(){return this.localHashedPassword=e.localPasswordHash,this.key=e.decKey,this.tokenRequest=new $f(e.email,e.accessCode,null,yield this.buildTwoFactor(e.twoFactor),yield this.buildDeviceRequest()),this.tokenRequest.setPasswordlessAccessCode(e.authRequestId),this.startLogIn()}))}}class nm extends $v{constructor(e,t,i,n,s){super(n,s),this.code=e,this.codeVerifier=t,this.redirectUri=i,this.twoFactor=n}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="authorization_code",t.code=this.code,t.code_verifier=this.codeVerifier,t.redirect_uri=this.redirectUri,t}}var sm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class om extends Hf{constructor(e,t,i,n,s,o,r,a,l,c){super(e,t,i,n,s,o,r,a,l),this.keyConnectorService=c}onSuccessfulLogin(e){return sm(this,void 0,void 0,(function*(){const t=null==e.key;null!=e.keyConnectorUrl&&(t?yield this.keyConnectorService.convertNewSsoUserToKeyConnector(e,this.orgId):yield this.keyConnectorService.getAndSetKey(e.keyConnectorUrl))}))}logIn(e){return sm(this,void 0,void 0,(function*(){return this.orgId=e.orgId,this.tokenRequest=new nm(e.code,e.codeVerifier,e.redirectUrl,yield this.buildTwoFactor(e.twoFactor),yield this.buildDeviceRequest()),this.startLogIn()}))}}class rm{constructor(e){this.email=e}}var am=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class lm{constructor(e,t,i,n,s,o,r,a,l,c,u,d){this.cryptoService=e,this.apiService=t,this.tokenService=i,this.appIdService=n,this.platformUtilsService=s,this.messagingService=o,this.logService=r,this.keyConnectorService=a,this.environmentService=l,this.stateService=c,this.twoFactorService=u,this.i18nService=d,this.pushNotificationSubject=new Be.x}get email(){return this.logInStrategy instanceof em?this.logInStrategy.email:null}get masterPasswordHash(){return this.logInStrategy instanceof em?this.logInStrategy.masterPasswordHash:null}logIn(e){return am(this,void 0,void 0,(function*(){let t;switch(this.clearState(),e.type){case di.Password:t=new em(this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this);break;case di.Sso:t=new om(this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.keyConnectorService);break;case di.Api:t=new Wf(this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.environmentService,this.keyConnectorService);break;case di.Passwordless:t=new im(this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this)}const i=yield t.logIn(e);return(null==i?void 0:i.requiresTwoFactor)&&this.saveState(t),i}))}logInTwoFactor(e,t){return am(this,void 0,void 0,(function*(){if(null==this.logInStrategy)throw new Error(this.i18nService.t("sessionTimeout"));try{const i=yield this.logInStrategy.logInTwoFactor(e,t);return i.requiresTwoFactor||i.requiresCaptcha||this.clearState(),i}catch(e){throw e instanceof Ou||this.clearState(),e}}))}logOut(e){e(),this.messagingService.send("loggedOut")}authingWithApiKey(){return this.logInStrategy instanceof Wf}authingWithSso(){return this.logInStrategy instanceof om}authingWithPassword(){return this.logInStrategy instanceof em}getAuthStatus(e){return am(this,void 0,void 0,(function*(){if(!(yield this.stateService.getIsAuthenticated({userId:e})))return Oe.LoggedOut;(yield this.cryptoService.hasKeyStored(Rt.Auto,e))&&!(yield this.stateService.getEverBeenUnlocked({userId:e}))&&(yield this.cryptoService.getKey(Rt.Auto,e));return(yield this.cryptoService.hasKeyInMemory(e))?Oe.Unlocked:Oe.Locked}))}makePreloginKey(e,t){return am(this,void 0,void 0,(function*(){t=t.trim().toLowerCase();let i=null,n=null;try{const e=yield this.apiService.postPrelogin(new rm(t));null!=e&&(i=e.kdf,n=e.kdfIterations)}catch(e){if(null==e||404!==e.statusCode)throw e}return this.cryptoService.makeKey(e,t,i,n)}))}authResponsePushNotifiction(e){return am(this,void 0,void 0,(function*(){this.pushNotificationSubject.next(e.id)}))}getPushNotifcationObs$(){return this.pushNotificationSubject.asObservable()}saveState(e){this.logInStrategy=e,this.startSessionTimeout()}clearState(){this.logInStrategy=null,this.clearSessionTimeout()}startSessionTimeout(){this.clearSessionTimeout(),this.sessionTimeout=setTimeout((()=>this.clearState()),12e4)}clearSessionTimeout(){null!=this.sessionTimeout&&clearTimeout(this.sessionTimeout)}}function cm(e){return(t,i,n)=>{const s=n.value,o=new Map;return{value:function(...t){const i=(e=>{let t=o.get(e);return null!=t||(t=new Map,o.set(e,t)),t})(this),n=e(t);let r=i.get(n);if(null!=r)return r;const a=()=>{i.delete(n),0===i.size&&o.delete(this)};return r=s.apply(this,t).then((e=>(a(),e))).catch((e=>{throw a(),e})),i.set(n,r),r}}}}class um{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)}}class dm{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)}}class hm{constructor(e){null!=e&&(this.type=e.type,this.name=e.name,this.value=e.value,this.linkedId=e.linkedId)}}class pm{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)}}class gm{constructor(e){this.match=null,null!=e&&(this.uri=e.uri,this.match=e.match)}}class vm{constructor(e){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 gm(e)))))}}class ym{constructor(e){null!=e&&(this.password=e.password,this.lastUsedDate=e.lastUsedDate)}}class fm{constructor(e){null!=e&&(this.type=e.type)}}class mm{constructor(e,t){if(null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.edit=e.edit,this.viewPassword=e.viewPassword,this.organizationUseTotp=e.organizationUseTotp,this.favorite=e.favorite,this.revisionDate=e.revisionDate,this.type=e.type,this.name=e.name,this.notes=e.notes,this.collectionIds=null!=t?t:e.collectionIds,this.deletedDate=e.deletedDate,this.reprompt=e.reprompt,this.type){case Bl.Login:this.login=new vm(e.login);break;case Bl.SecureNote:this.secureNote=new fm(e.secureNote);break;case Bl.Card:this.card=new dm(e.card);break;case Bl.Identity:this.identity=new pm(e.identity)}null!=e.fields&&(this.fields=e.fields.map((e=>new hm(e)))),null!=e.attachments&&(this.attachments=e.attachments.map((e=>new um(e)))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map((e=>new ym(e))))}}}var wm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bm extends at{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,url:null,sizeName:null,fileName:null,key:null},["id","url","sizeName"]))}decrypt(e,t){return wm(this,void 0,void 0,(function*(){const i=yield this.decryptObj(new lc(this),{fileName:null},e,t);return null!=this.key&&(i.key=yield this.decryptAttachmentKey(e,t)),i}))}decryptAttachmentKey(e,t){return wm(this,void 0,void 0,(function*(){try{null==t&&(t=yield this.getKeyForDecryption(e));const i=nt.getContainerService().getEncryptService(),n=yield i.decryptToBytes(this.key,t);return new ac(n)}catch(e){}}))}getKeyForDecryption(e){return wm(this,void 0,void 0,(function*(){const t=nt.getContainerService().getCryptoService();return null!=e?yield t.getOrgKey(e):yield t.getKeyForUserEncryption()}))}toAttachmentData(){const e=new um;return e.size=this.size,this.buildDataModel(this,e,{id:null,url:null,sizeName:null,fileName:null,key:null},["id","url","sizeName"]),e}}class Sm extends at{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},[])}decrypt(e,t){return this.decryptObj(new rc,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},e,t)}toCardData(){const e=new dm;return this.buildDataModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),e}}class Um extends at{constructor(e){super(),null!=e&&(this.type=e.type,this.linkedId=e.linkedId,this.buildDomainModel(this,e,{name:null,value:null},[]))}decrypt(e,t){return this.decryptObj(new cc(this),{name:null,value:null},e,t)}toFieldData(){const e=new hm;return this.buildDataModel(this,e,{name:null,value:null,type:null,linkedId:null},["type","linkedId"]),e}}class xm extends at{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},[])}decrypt(e,t){return this.decryptObj(new hc,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},e,t)}toIdentityData(){const e=new pm;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}}class Am extends at{constructor(e){super(),null!=e&&(this.match=e.match,this.buildDomainModel(this,e,{uri:null},[]))}decrypt(e,t){return this.decryptObj(new gc(this),{uri:null},e,t)}toLoginUriData(){const e=new gm;return this.buildDataModel(this,e,{uri:null,match:null},["match"]),e}}var _m=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Zm extends at{constructor(e){super(),null!=e&&(this.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):null,this.autofillOnPageLoad=e.autofillOnPageLoad,this.buildDomainModel(this,e,{username:null,password:null,totp:null},[]),e.uris&&(this.uris=[],e.uris.forEach((e=>{this.uris.push(new Am(e))}))))}decrypt(e,t){return _m(this,void 0,void 0,(function*(){const i=yield this.decryptObj(new fc(this),{username:null,password:null,totp:null},e,t);if(null!=this.uris){i.uris=[];for(let n=0;n0&&(e.uris=[],this.uris.forEach((t=>{e.uris.push(t.toLoginUriData())}))),e}}class Tm extends at{constructor(e){super(),null!=e&&(this.buildDomainModel(this,e,{password:null}),this.lastUsedDate=new Date(e.lastUsedDate))}decrypt(e,t){return this.decryptObj(new mc(this),{password:null},e,t)}toPasswordHistoryData(){const e=new ym;return e.lastUsedDate=this.lastUsedDate.toISOString(),this.buildDataModel(this,e,{password:null}),e}}class Cm extends at{constructor(e){super(),null!=e&&(this.type=e.type)}decrypt(e,t){return Promise.resolve(new wc(this))}toSecureNoteData(){const e=new fm;return e.type=this.type,e}}var km=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Om extends at{constructor(e,t=null){if(super(),null!=e){switch(this.buildDomainModel(this,e,{id:null,organizationId:null,folderId:null,name:null,notes:null},["id","organizationId","folderId"]),this.type=e.type,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,null!=e.viewPassword?this.viewPassword=e.viewPassword:this.viewPassword=!0,this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null,this.collectionIds=e.collectionIds,this.localData=t,this.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):null,this.reprompt=e.reprompt,this.type){case Bl.Login:this.login=new Zm(e.login);break;case Bl.SecureNote:this.secureNote=new Cm(e.secureNote);break;case Bl.Card:this.card=new Sm(e.card);break;case Bl.Identity:this.identity=new xm(e.identity)}null!=e.attachments?this.attachments=e.attachments.map((e=>new bm(e))):this.attachments=null,null!=e.fields?this.fields=e.fields.map((e=>new Um(e))):this.fields=null,null!=e.passwordHistory?this.passwordHistory=e.passwordHistory.map((e=>new Tm(e))):this.passwordHistory=null}}decrypt(e){return km(this,void 0,void 0,(function*(){const t=new bc(this);switch(yield this.decryptObj(t,{name:null,notes:null},this.organizationId,e),this.type){case Bl.Login:t.login=yield this.login.decrypt(this.organizationId,e);break;case Bl.SecureNote:t.secureNote=yield this.secureNote.decrypt(this.organizationId,e);break;case Bl.Card:t.card=yield this.card.decrypt(this.organizationId,e);break;case Bl.Identity:t.identity=yield this.identity.decrypt(this.organizationId,e)}const i=this.organizationId;if(null!=this.attachments&&this.attachments.length>0){const n=[];yield this.attachments.reduce(((t,s)=>t.then((()=>s.decrypt(i,e))).then((e=>{n.push(e)}))),Promise.resolve()),t.attachments=n}if(null!=this.fields&&this.fields.length>0){const n=[];yield this.fields.reduce(((t,s)=>t.then((()=>s.decrypt(i,e))).then((e=>{n.push(e)}))),Promise.resolve()),t.fields=n}if(null!=this.passwordHistory&&this.passwordHistory.length>0){const n=[];yield this.passwordHistory.reduce(((t,s)=>t.then((()=>s.decrypt(i,e))).then((e=>{n.push(e)}))),Promise.resolve()),t.passwordHistory=n}return t}))}toCipherData(){const e=new mm;switch(e.id=this.id,e.organizationId=this.organizationId,e.folderId=this.folderId,e.edit=this.edit,e.viewPassword=this.viewPassword,e.organizationUseTotp=this.organizationUseTotp,e.favorite=this.favorite,e.revisionDate=null!=this.revisionDate?this.revisionDate.toISOString():null,e.type=this.type,e.collectionIds=this.collectionIds,e.deletedDate=null!=this.deletedDate?this.deletedDate.toISOString():null,e.reprompt=this.reprompt,this.buildDataModel(this,e,{name:null,notes:null}),e.type){case Bl.Login:e.login=this.login.toLoginData();break;case Bl.SecureNote:e.secureNote=this.secureNote.toSecureNoteData();break;case Bl.Card:e.card=this.card.toCardData();break;case Bl.Identity:e.identity=this.identity.toIdentityData()}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}}class Pm{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 Im(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 Im{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()}}class qm{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}class Dm{constructor(e,t){this.ids=null==e?[]:e,this.folderId=t}}class Mm{constructor(e){this.ids=null==e?[]:e}}class Fm{}class Nm{constructor(e){switch(this.type=e.type,this.folderId=e.folderId,this.organizationId=e.organizationId,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.favorite=e.favorite,this.lastKnownRevisionDate=e.revisionDate,this.reprompt=e.reprompt,this.type){case Bl.Login:this.login=new ry,this.login.uris=null,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.uris&&(this.login.uris=e.login.uris.map((e=>{const t=new oy;return t.uri=null!=e.uri?e.uri.encryptedString:null,t.match=null!=e.match?e.match:null,t})));break;case Bl.SecureNote:this.secureNote=new ay,this.secureNote.type=e.secureNote.type;break;case Bl.Card:this.card=new iy,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 Bl.Identity:this.identity=new sy,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 ny;return t.type=e.type,t.name=e.name?e.name.encryptedString:null,t.value=e.value?e.value.encryptedString:null,t.linkedId=e.linkedId,t}))),null!=e.passwordHistory&&(this.passwordHistory=[],e.passwordHistory.forEach((e=>{this.passwordHistory.push({lastUsedDate:e.lastUsedDate,password:e.password?e.password.encryptedString:null})}))),null!=e.attachments&&(this.attachments={},this.attachments2={},e.attachments.forEach((e=>{const t=e.fileName?e.fileName.encryptedString:null;this.attachments[e.id]=t;const i=new Fm;i.fileName=t,null!=e.key&&(i.key=e.key.encryptedString),this.attachments2[e.id]=i})))}}class Lm extends Nm{constructor(e){super(e),this.id=e.id}}class Em{constructor(e,t){null!=e&&(this.ciphers=[],e.forEach((e=>{this.ciphers.push(new Lm(e))}))),this.collectionIds=t}}class Rm{constructor(e){this.collectionIds=null==e?[]:e}}class Jm{constructor(e){this.cipher=new Nm(e),this.collectionIds=e.collectionIds}}class Ym{constructor(e){this.cipher=new Nm(e),this.collectionIds=e.collectionIds}}var zm=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Km=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Bm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Gm=new Map([["google.com",new Set(["script.google.com"])]]);class Qm{constructor(e,t,i,n,s,o,r,a){this.cryptoService=e,this.settingsService=t,this.apiService=i,this.fileUploadService=n,this.i18nService=s,this.searchService=o,this.logService=r,this.stateService=a,this.sortedCiphersCache=new Pm(this.sortCiphersByLastUsed)}getDecryptedCipherCache(){return Bm(this,void 0,void 0,(function*(){return yield this.stateService.getDecryptedCiphers()}))}setDecryptedCipherCache(e){return Bm(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedCiphers(e),null!=this.searchService&&(null==e?this.searchService().clearIndex():this.searchService().indexCiphers())}))}clearCache(e){return Bm(this,void 0,void 0,(function*(){yield this.clearDecryptedCiphersState(e)}))}encrypt(e,t,i=null){return Bm(this,void 0,void 0,(function*(){if(null!=e.id){if(null==i&&(i=yield this.get(e.id)),null!=i){const t=yield i.decrypt();if(e.passwordHistory=t.passwordHistory||[],e.type===Bl.Login&&t.type===Bl.Login)if(null!=t.login.password&&""!==t.login.password&&t.login.password!==e.login.password){const i=new mc;i.password=t.login.password,i.lastUsedDate=e.login.passwordRevisionDate=new Date,e.passwordHistory.splice(0,0,i)}else e.login.passwordRevisionDate=t.login.passwordRevisionDate;if(t.hasFields){const i=t.fields.filter((e=>e.type===_c.Hidden&&null!=e.name&&""!==e.name&&null!=e.value&&""!==e.value)),n=null==e.fields?[]:e.fields.filter((e=>e.type===_c.Hidden&&null!=e.name&&""!==e.name));i.forEach((t=>{const i=n.find((e=>e.name===t.name));if(null==i||i.value!==t.value){const i=new mc;i.password=t.name+": "+t.value,i.lastUsedDate=new Date,e.passwordHistory.splice(0,0,i)}}))}}null!=e.passwordHistory&&0===e.passwordHistory.length?e.passwordHistory=null:null!=e.passwordHistory&&e.passwordHistory.length>5&&(e.passwordHistory=e.passwordHistory.slice(0,5))}const n=new Om;if(n.id=e.id,n.folderId=e.folderId,n.favorite=e.favorite,n.organizationId=e.organizationId,n.type=e.type,n.collectionIds=e.collectionIds,n.revisionDate=e.revisionDate,n.reprompt=e.reprompt,null==t&&null!=n.organizationId&&null==(t=yield this.cryptoService.getOrgKey(n.organizationId)))throw new Error("Cannot encrypt cipher for organization. No key.");return yield Promise.all([this.encryptObjProperty(e,n,{name:null,notes:null},t),this.encryptCipherData(n,e,t),this.encryptFields(e.fields,t).then((e=>{n.fields=e})),this.encryptPasswordHistories(e.passwordHistory,t).then((e=>{n.passwordHistory=e})),this.encryptAttachments(e.attachments,t).then((e=>{n.attachments=e}))]),n}))}encryptAttachments(e,t){return Bm(this,void 0,void 0,(function*(){if(null==e||0===e.length)return null;const i=[],n=[];return e.forEach((e=>Bm(this,void 0,void 0,(function*(){const s=new bm;s.id=e.id,s.size=e.size,s.sizeName=e.sizeName,s.url=e.url;const o=this.encryptObjProperty(e,s,{fileName:null},t).then((()=>Bm(this,void 0,void 0,(function*(){null!=e.key&&(s.key=yield this.cryptoService.encrypt(e.key.key,t)),n.push(s)}))));i.push(o)})))),yield Promise.all(i),n}))}encryptFields(e,t){return Bm(this,void 0,void 0,(function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce(((e,s)=>Bm(this,void 0,void 0,(function*(){yield e;const o=yield i.encryptField(s,t);n.push(o)}))),Promise.resolve()),n}))}encryptField(e,t){return Bm(this,void 0,void 0,(function*(){const i=new Um;return i.type=e.type,i.linkedId=e.linkedId,e.type===_c.Boolean&&"true"!==e.value&&(e.value="false"),yield this.encryptObjProperty(e,i,{name:null,value:null},t),i}))}encryptPasswordHistories(e,t){return Bm(this,void 0,void 0,(function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce(((e,s)=>Bm(this,void 0,void 0,(function*(){yield e;const o=yield i.encryptPasswordHistory(s,t);n.push(o)}))),Promise.resolve()),n}))}encryptPasswordHistory(e,t){return Bm(this,void 0,void 0,(function*(){const i=new Tm;return i.lastUsedDate=e.lastUsedDate,yield this.encryptObjProperty(e,i,{password:null},t),i}))}get(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCiphers();if(null==t||!t.hasOwnProperty(e))return null;const i=yield this.stateService.getLocalData();return new Om(t[e],i?i[e]:null)}))}getAll(){return Bm(this,void 0,void 0,(function*(){const e=yield this.stateService.getLocalData(),t=yield this.stateService.getEncryptedCiphers(),i=[];for(const n in t)t.hasOwnProperty(n)&&i.push(new Om(t[n],e?e[n]:null));return i}))}getAllDecrypted(){var e;return Bm(this,void 0,void 0,(function*(){const t=yield this.stateService.getUserId();if(null!=(yield this.getDecryptedCipherCache()))return null!=this.searchService&&(null!==(e=this.searchService().indexedEntityId)&&void 0!==e?e:t)!==t&&(yield this.searchService().indexCiphers(t,yield this.getDecryptedCipherCache())),yield this.getDecryptedCipherCache();const i=[];if(!(yield this.cryptoService.hasKey()))throw new Error("No key.");const n=[];return(yield this.getAll()).forEach((e=>Bm(this,void 0,void 0,(function*(){n.push(e.decrypt().then((e=>i.push(e))))})))),yield Promise.all(n),i.sort(this.getLocaleSortingFunction()),yield this.setDecryptedCipherCache(i),i}))}getAllDecryptedForGrouping(e,t=!0){return Bm(this,void 0,void 0,(function*(){return(yield this.getAllDecrypted()).filter((i=>!i.isDeleted&&(!(!t||i.folderId!==e)||!t&&null!=i.collectionIds&&i.collectionIds.indexOf(e)>-1)))}))}getAllDecryptedForUrl(e,t,i=null){return Bm(this,void 0,void 0,(function*(){if(null==e&&null==t)return Promise.resolve([]);const n=nt.getDomain(e),s=null==n?Promise.resolve([]):(0,Ku.z)(this.settingsService.settings$).then((e=>{var t;let i=[];return null===(t=e.equivalentDomains)||void 0===t||t.forEach((e=>{e.length&&e.indexOf(n)>=0&&(i=i.concat(e))})),i.length||i.push(n),i})),o=yield Promise.all([s,this.getAllDecrypted()]),r=o[0],a=o[1];return null==i&&null==(i=yield this.stateService.getDefaultUriMatch())&&(i=ka.Domain),a.filter((s=>{if(null!=s.deletedDate)return!1;if(null!=t&&t.indexOf(s.type)>-1)return!0;if(null!=e&&s.type===Bl.Login&&null!=s.login.uris)for(let t=0;t-1){if(!Gm.has(o.domain))return!0;{const t=nt.getHost(e);if(!Gm.get(o.domain).has(t))return!0}}break;case ka.Host:{const t=nt.getHost(e);if(null!=t&&t===nt.getHost(o.uri))return!0;break}case ka.Exact:if(e===o.uri)return!0;break;case ka.StartsWith:if(e.startsWith(o.uri))return!0;break;case ka.RegularExpression:try{if(new RegExp(o.uri,"i").test(e))return!0}catch(e){this.logService.error(e)}case ka.Never:}}return!1}))}))}getAllFromApiForOrganization(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.apiService.getCiphersOrganization(e);if(null!=t&&null!=t.data&&t.data.length){const e=[],i=[];return t.data.forEach((t=>{const n=new mm(t),s=new Om(n);i.push(s.decrypt().then((t=>e.push(t))))})),yield Promise.all(i),e.sort(this.getLocaleSortingFunction()),e}return[]}))}getLastUsedForUrl(e,t=!1){return Bm(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!0,!1,t)}))}getLastLaunchedForUrl(e,t=!1){return Bm(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!1,!0,t)}))}getNextCipherForUrl(e){return Bm(this,void 0,void 0,(function*(){return this.getCipherForUrl(e,!1,!1,!1)}))}updateLastUsedIndexForUrl(e){this.sortedCiphersCache.updateLastUsedIndex(e)}updateLastUsedDate(e){return Bm(this,void 0,void 0,(function*(){let t=yield this.stateService.getLocalData();t||(t={}),t[e]?t[e].lastUsedDate=(new Date).getTime():t[e]={lastUsedDate:(new Date).getTime()},yield this.stateService.setLocalData(t);const i=yield this.stateService.getDecryptedCiphers();if(i){for(let n=0;n{null==i.key&&n.push(this.shareAttachmentWithServer(i,e.id,t))})),yield Promise.all(n),e.organizationId=t,e.collectionIds=i;const s=yield this.encrypt(e),o=new Ym(s),r=yield this.apiService.putShareCipher(e.id,o),a=new mm(r,i);yield this.upsert(a)}))}shareManyWithServer(e,t,i){return Bm(this,void 0,void 0,(function*(){const n=[],s=[];for(const o of e)o.organizationId=t,o.collectionIds=i,n.push(this.encrypt(o).then((e=>{s.push(e)})));yield Promise.all(n);const o=new Em(s,i);try{yield this.apiService.putShareCiphers(o)}catch(t){for(const t of e)t.organizationId=null,t.collectionIds=null;throw t}yield this.upsert(s.map((e=>e.toCipherData())))}))}saveAttachmentWithServer(e,t,i=!1){return new Promise(((n,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>Bm(this,void 0,void 0,(function*(){try{const s=yield this.saveAttachmentRawWithServer(e,t.name,o.target.result,i);n(s)}catch(e){s(e)}})),o.onerror=()=>{s("Error reading file.")}}))}saveAttachmentRawWithServer(e,t,i,n=!1){return Bm(this,void 0,void 0,(function*(){const s=yield this.cryptoService.getOrgKey(e.organizationId),o=yield this.cryptoService.encrypt(t,s),r=yield this.cryptoService.makeEncKey(s),a=yield this.cryptoService.encryptToBytes(i,r[0]),l={key:r[1].encryptedString,fileName:o.encryptedString,fileSize:a.buffer.byteLength,adminRequest:n};let c;try{const t=yield this.apiService.postCipherAttachment(e.id,l);c=n?t.cipherMiniResponse:t.cipherResponse,yield this.fileUploadService.uploadCipherAttachment(n,t,o,a)}catch(t){if(!(t instanceof Ou&&404===t.statusCode||405===t.statusCode))throw t instanceof Ou?new Error(t.getSingleMessage()):t;c=yield this.legacyServerAttachmentFileUpload(n,e.id,o,a,r[1])}const u=new mm(c,e.collectionIds);return n||(yield this.upsert(u)),new Om(u)}))}legacyServerAttachmentFileUpload(e,t,i,n,s){return Bm(this,void 0,void 0,(function*(){const o=new FormData;try{const e=new Blob([n.buffer],{type:"application/octet-stream"});o.append("key",s.encryptedString),o.append("data",e,i.encryptedString)}catch(e){if(!nt.isNode||nt.isBrowser)throw e;o.append("key",s.encryptedString),o.append("data",Buffer.from(n.buffer),{filepath:i.encryptedString,contentType:"application/octet-stream"})}let r;try{r=e?yield this.apiService.postCipherAttachmentAdminLegacy(t,o):yield this.apiService.postCipherAttachmentLegacy(t,o)}catch(e){throw new Error(e.getSingleMessage())}return r}))}saveCollectionsWithServer(e){return Bm(this,void 0,void 0,(function*(){const t=new Rm(e.collectionIds);yield this.apiService.putCipherCollections(e.id,t);const i=e.toCipherData();yield this.upsert(i)}))}upsert(e){return Bm(this,void 0,void 0,(function*(){let t=yield this.stateService.getEncryptedCiphers();if(null==t&&(t={}),e instanceof mm){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));yield this.replace(t)}))}replace(e){return Bm(this,void 0,void 0,(function*(){yield this.clearDecryptedCiphersState(),yield this.stateService.setEncryptedCiphers(e)}))}clear(e){return Bm(this,void 0,void 0,(function*(){yield this.clearEncryptedCiphersState(e),yield this.clearCache(e)}))}moveManyWithServer(e,t){return Bm(this,void 0,void 0,(function*(){yield this.apiService.putMoveCiphers(new Dm(e,t));let i=yield this.stateService.getEncryptedCiphers();null==i&&(i={}),e.forEach((e=>{i.hasOwnProperty(e)&&(i[e].folderId=t)})),yield this.clearCache(),yield this.stateService.setEncryptedCiphers(i)}))}delete(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCiphers();if(null!=t){if("string"==typeof e){if(null==t[e])return;delete t[e]}else e.forEach((e=>{delete t[e]}));yield this.clearCache(),yield this.stateService.setEncryptedCiphers(t)}}))}deleteWithServer(e){return Bm(this,void 0,void 0,(function*(){yield this.apiService.deleteCipher(e),yield this.delete(e)}))}deleteManyWithServer(e){return Bm(this,void 0,void 0,(function*(){yield this.apiService.deleteManyCiphers(new qm(e)),yield this.delete(e)}))}deleteAttachment(e,t){return Bm(this,void 0,void 0,(function*(){const i=yield this.stateService.getEncryptedCiphers();if(null!=i&&i.hasOwnProperty(e)&&null!=i[e].attachments){for(let n=0;nn?-1:null!=n&&null==i?1:0}sortCiphersByLastUsedThenName(e,t){const i=this.sortCiphersByLastUsed(e,t);return 0!==i?i:this.getLocaleSortingFunction()(e,t)}getLocaleSortingFunction(){return(e,t)=>{let i=e.name,n=t.name;if(null==i&&null!=n)return-1;if(null!=i&&null==n)return 1;if(null==i&&null==n)return 0;const s=this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n);return 0!==s||e.type!==Bl.Login||t.type!==Bl.Login?s:(null!=e.login.username&&(i+=e.login.username),null!=t.login.username&&(n+=t.login.username),this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n))}}softDelete(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCiphers();if(null==t)return;const i=e=>{null!=t[e]&&(t[e].deletedDate=(new Date).toISOString())};"string"==typeof e?i(e):e.forEach(i),yield this.clearCache(),yield this.stateService.setEncryptedCiphers(t)}))}softDeleteWithServer(e){return Bm(this,void 0,void 0,(function*(){yield this.apiService.putDeleteCipher(e),yield this.softDelete(e)}))}softDeleteManyWithServer(e){return Bm(this,void 0,void 0,(function*(){yield this.apiService.putDeleteManyCiphers(new qm(e)),yield this.softDelete(e)}))}restore(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCiphers();if(null==t)return;const i=e=>{null!=t[e.id]&&(t[e.id].deletedDate=null,t[e.id].revisionDate=e.revisionDate)};e.constructor.name===Array.name?e.forEach(i):i(e),yield this.clearCache(),yield this.stateService.setEncryptedCiphers(t)}))}restoreWithServer(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.apiService.putRestoreCipher(e);yield this.restore({id:e,revisionDate:t.revisionDate})}))}restoreManyWithServer(e){return Bm(this,void 0,void 0,(function*(){const t=yield this.apiService.putRestoreManyCiphers(new Mm(e)),i=[];for(const e of t.data)i.push({id:e.id,revisionDate:e.revisionDate});yield this.restore(i)}))}shareAttachmentWithServer(e,t,i){return Bm(this,void 0,void 0,(function*(){const n=yield this.apiService.nativeFetch(new Request(e.url,{cache:"no-store"}));if(200!==n.status)throw Error("Failed to download attachment: "+n.status.toString());const s=yield Cu.fromResponse(n),o=yield this.cryptoService.decryptFromBytes(s,null),r=yield this.cryptoService.getOrgKey(i),a=yield this.cryptoService.encrypt(e.fileName,r),l=yield this.cryptoService.makeEncKey(r),c=yield this.cryptoService.encryptToBytes(o,l[0]),u=new FormData;try{const e=new Blob([c.buffer],{type:"application/octet-stream"});u.append("key",l[1].encryptedString),u.append("data",e,a.encryptedString)}catch(e){if(!nt.isNode||nt.isBrowser)throw e;u.append("key",l[1].encryptedString),u.append("data",Buffer.from(c.buffer),{filepath:a.encryptedString,contentType:"application/octet-stream"})}try{yield this.apiService.postShareCipherAttachment(t,e.id,u,i)}catch(e){throw new Error(e.getSingleMessage())}}))}encryptObjProperty(e,t,i,n){return Bm(this,void 0,void 0,(function*(){const s=[],o=this;for(const r in i)i.hasOwnProperty(r)&&function(t,r){const a=Promise.resolve().then((()=>{const s=e[i[t]||t];return s&&""!==s?o.cryptoService.encrypt(s,n):null})).then((e=>{r[t]=e}));s.push(a)}(r,t);yield Promise.all(s)}))}encryptCipherData(e,t,i){return Bm(this,void 0,void 0,(function*(){switch(e.type){case Bl.Login:if(e.login=new Zm,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=[];for(let n=0;nt.login.autofillOnPageLoad||null==t.login.autofillOnPageLoad&&!1!==e)),0===t.length)return null}this.sortedCiphersCache.addCiphers(s,t)}return i?this.sortedCiphersCache.getLastLaunched(s):t?this.sortedCiphersCache.getLastUsed(s):this.sortedCiphersCache.getNext(s)}))}clearEncryptedCiphersState(e){return Bm(this,void 0,void 0,(function*(){yield this.stateService.setEncryptedCiphers(null,{userId:e})}))}clearDecryptedCiphersState(e){return Bm(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedCiphers(null,{userId:e}),this.clearSortedCiphers()}))}clearSortedCiphers(){this.sortedCiphersCache.clear()}}zm([cm((()=>"getAllDecrypted")),Km("design:type",Function),Km("design:paramtypes",[]),Km("design:returntype",Promise)],Qm.prototype,"getAllDecrypted",null);class Vm{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.name=e.name,this.externalId=e.externalId,this.readOnly=e.readOnly}}class Hm{constructor(e){this.id=null,this.organizationId=null,this.name=null,this.externalId=null,this.readOnly=null,this.hidePasswords=null,e&&(this.id=e.id,this.organizationId=e.organizationId,this.externalId=e.externalId,e instanceof jm&&(this.readOnly=e.readOnly,this.hidePasswords=e.hidePasswords))}}class jm extends at{constructor(e){super(),null!=e&&this.buildDomainModel(this,e,{id:null,organizationId:null,name:null,externalId:null,readOnly:null,hidePasswords:null},["id","organizationId","externalId","readOnly","hidePasswords"])}decrypt(){return this.decryptObj(new Hm(this),{name:null},this.organizationId)}}var Wm=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $m{constructor(e,t,i){this.cryptoService=e,this.i18nService=t,this.stateService=i}clearCache(e){return Wm(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedCollections(null,{userId:e})}))}encrypt(e){return Wm(this,void 0,void 0,(function*(){if(null==e.organizationId)throw new Error("Collection has no organization id.");const t=yield this.cryptoService.getOrgKey(e.organizationId);if(null==t)throw new Error("No key for this collection's organization.");const i=new jm;return i.id=e.id,i.organizationId=e.organizationId,i.readOnly=e.readOnly,i.name=yield this.cryptoService.encrypt(e.name,t),i}))}decryptMany(e){return Wm(this,void 0,void 0,(function*(){if(null==e)return[];const t=[],i=[];return e.forEach((e=>{i.push(e.decrypt().then((e=>t.push(e))))})),yield Promise.all(i),t.sort(nt.getSortFunction(this.i18nService,"name"))}))}get(e){return Wm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCollections();return null!=t&&t.hasOwnProperty(e)?new jm(t[e]):null}))}getAll(){return Wm(this,void 0,void 0,(function*(){const e=yield this.stateService.getEncryptedCollections(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new jm(e[i]));return t}))}getAllDecrypted(){return Wm(this,void 0,void 0,(function*(){let e=yield this.stateService.getDecryptedCollections();if(null!=e)return e;if(!(yield this.cryptoService.hasKey()))throw new Error("No key.");const t=yield this.getAll();return e=yield this.decryptMany(t),yield this.stateService.setDecryptedCollections(e),e}))}getAllNested(e=null){return Wm(this,void 0,void 0,(function*(){null==e&&(e=yield this.getAllDecrypted());const t=[];return e.forEach((e=>{const i=new Hm;i.id=e.id,i.organizationId=e.organizationId;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split("/"):[];Gu.nestedTraverse(t,0,n,i,null,"/")})),t}))}getNested(e){return Wm(this,void 0,void 0,(function*(){const t=yield this.getAllNested();return Gu.getTreeNodeObject(t,e)}))}upsert(e){return Wm(this,void 0,void 0,(function*(){let t=yield this.stateService.getEncryptedCollections();if(null==t&&(t={}),e instanceof Vm){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));yield this.replace(t)}))}replace(e){return Wm(this,void 0,void 0,(function*(){yield this.clearCache(),yield this.stateService.setEncryptedCollections(e)}))}clear(e){return Wm(this,void 0,void 0,(function*(){yield this.clearCache(e),yield this.stateService.setEncryptedCollections(null,{userId:e})}))}delete(e){return Wm(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedCollections();null!=t&&("string"==typeof e?delete t[e]:e.forEach((e=>{delete t[e]})),yield this.replace(t))}))}}class Xm extends ku{constructor(e){super(e),null!=e&&(this.version=this.getResponseProperty("Version"),this.gitHash=this.getResponseProperty("GitHash"),this.server=new tw(this.getResponseProperty("Server")),this.environment=new ew(this.getResponseProperty("Environment")))}}class ew extends ku{constructor(e=null){super(e),null!=e&&(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 tw extends ku{constructor(e=null){super(e),null!=e&&(this.name=this.getResponseProperty("Name"),this.url=this.getResponseProperty("Url"))}}var iw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var nw=i(16052),sw=i(33140),ow=i(20814);class rw{constructor(e){var t,i;this.version=e.version,this.gitHash=e.gitHash,this.server=e.server,this.utcDate=new Date(e.utcDate),this.environment=e.environment,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}expiresSoon(){return this.getAgeInMilliseconds()>=648e5}}var aw,lw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(aw||(aw={}));class cw{constructor(e,t=null){this.isDev=e,this.filter=t,this.timersMap=new Map}debug(e){this.isDev&&this.write(aw.Debug,e)}info(e){this.write(aw.Info,e)}warning(e){this.write(aw.Warning,e)}error(e){this.write(aw.Error,e)}write(e,t){if(null==this.filter||!this.filter(e))switch(e){case aw.Debug:case aw.Info:console.log(t);break;case aw.Warning:console.warn(t);break;case aw.Error:console.error(t)}}}var uw=i(79622);const dw=["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"];var hw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class pw{static fromData(e){switch(e.type){case"organization":return new gw(e.key);case"provider":return new vw(e.key,e.providerId);default:return null}}}class gw{constructor(e){this.key=e}decrypt(e){return hw(this,void 0,void 0,(function*(){const t=yield e.rsaDecrypt(this.key);return new ac(t)}))}toData(){return{type:"organization",key:this.key}}}class vw{constructor(e,t){this.key=e,this.providerId=t}decrypt(e){return hw(this,void 0,void 0,(function*(){const t=yield e.getProviderKey(this.providerId),i=yield e.decryptToBytes(new ot(this.key),t);return new ac(i)}))}toData(){return{type:"provider",key:this.key,providerId:this.providerId}}}var yw=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fw=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},mw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ww{constructor(e,t,i,n,s){this.cryptoFunctionService=e,this.encryptService=t,this.platformUtilService=i,this.logService=n,this.stateService=s}setKey(e,t){return mw(this,void 0,void 0,(function*(){yield this.stateService.setCryptoMasterKey(e,{userId:t}),yield this.storeKey(e,t)}))}setKeyHash(e){return mw(this,void 0,void 0,(function*(){yield this.stateService.setKeyHash(e)}))}setEncKey(e){return mw(this,void 0,void 0,(function*(){null!=e&&(yield this.stateService.setDecryptedCryptoSymmetricKey(null),yield this.stateService.setEncryptedCryptoSymmetricKey(e))}))}setEncPrivateKey(e){return mw(this,void 0,void 0,(function*(){null!=e&&(yield this.stateService.setDecryptedPrivateKey(null),yield this.stateService.setEncryptedPrivateKey(e))}))}setOrgKeys(e=[],t=[]){return mw(this,void 0,void 0,(function*(){const i={};return e.forEach((e=>{i[e.id]={type:"organization",key:e.key}})),t.forEach((e=>{i[e.id]={type:"provider",providerId:e.providerId,key:e.key}})),yield this.stateService.setDecryptedOrganizationKeys(null),yield this.stateService.setEncryptedOrganizationKeys(i)}))}setProviderKeys(e){return mw(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=e.key})),yield this.stateService.setDecryptedProviderKeys(null),yield this.stateService.setEncryptedProviderKeys(t)}))}getKey(e,t){return mw(this,void 0,void 0,(function*(){const i=yield this.stateService.getCryptoMasterKey({userId:t});if(null!=i)return i;e||(e=Rt.Auto);const n=yield this.getKeyFromStorage(e,t);return null!=n&&this.setKey(n,t),n}))}getKeyFromStorage(e,t){return mw(this,void 0,void 0,(function*(){const i=yield this.retrieveKeyFromStorage(e,t);if(null!=i){const e=new ac(nt.fromB64ToArray(i).buffer);return(yield this.validateKey(e))?e:(this.logService.warning("Wrong key, throwing away stored key"),yield this.clearSecretKeyStore(t),null)}return null}))}getKeyHash(){return mw(this,void 0,void 0,(function*(){return yield this.stateService.getKeyHash()}))}compareAndUpdateKeyHash(e,t){return mw(this,void 0,void 0,(function*(){const i=yield this.getKeyHash();if(null!=e&&null!=i){const n=yield this.hashPassword(e,t,Et.LocalAuthorization);if(null!=n&&i===n)return!0;const s=yield this.hashPassword(e,t,Et.ServerAuthorization);if(null!=s&&i===s)return yield this.setKeyHash(n),!0}return!1}))}getEncKey(e=null){return this.getEncKeyHelper(e)}getPublicKey(){return mw(this,void 0,void 0,(function*(){const e=yield this.stateService.getPublicKey();if(null!=e)return e;const t=yield this.getPrivateKey();if(null==t)return null;const i=yield this.cryptoFunctionService.rsaExtractPublicKey(t);return yield this.stateService.setPublicKey(i),i}))}getPrivateKey(){return mw(this,void 0,void 0,(function*(){const e=yield this.stateService.getDecryptedPrivateKey();if(null!=e)return e;const t=yield this.stateService.getEncryptedPrivateKey();if(null==t)return null;const i=yield this.decryptToBytes(new ot(t),null);return yield this.stateService.setDecryptedPrivateKey(i),i}))}getFingerprint(e,t){return mw(this,void 0,void 0,(function*(){if(null==t&&(t=yield this.getPublicKey()),null===t)throw new Error("No public key available.");const i=yield this.cryptoFunctionService.hash(t,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(i,e,32,"sha256");return this.hashPhrase(n)}))}getOrgKeys(){return mw(this,void 0,void 0,(function*(){const e=new Map,t=yield this.stateService.getDecryptedOrganizationKeys();if(null!=t&&t.size>0)return t;const i=yield this.stateService.getEncryptedOrganizationKeys();if(null==i)return null;let n=!1;for(const t of Object.keys(i)){if(e.has(t))continue;const s=pw.fromData(i[t]),o=yield s.decrypt(this);e.set(t,o),n=!0}return n&&(yield this.stateService.setDecryptedOrganizationKeys(e)),e}))}getOrgKey(e){return mw(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.getOrgKeys();return null!=t&&t.has(e)?t.get(e):null}))}getProviderKeys(){return mw(this,void 0,void 0,(function*(){const e=new Map,t=yield this.stateService.getDecryptedProviderKeys();if(null!=t&&t.size>0)return t;const i=yield this.stateService.getEncryptedProviderKeys();if(null==i)return null;let n=!1;for(const t in i){if(!i.hasOwnProperty(t))continue;const s=yield this.rsaDecrypt(i[t]);e.set(t,new ac(s)),n=!0}return n&&(yield this.stateService.setDecryptedProviderKeys(e)),e}))}getProviderKey(e){return mw(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.getProviderKeys();return null!=t&&t.has(e)?t.get(e):null}))}hasKey(){return mw(this,void 0,void 0,(function*(){return(yield this.hasKeyInMemory())||(yield this.hasKeyStored(Rt.Auto))||(yield this.hasKeyStored(Rt.Biometric))}))}hasKeyInMemory(e){return mw(this,void 0,void 0,(function*(){return null!=(yield this.stateService.getCryptoMasterKey({userId:e}))}))}hasKeyStored(e,t){return mw(this,void 0,void 0,(function*(){switch(e){case Rt.Auto:return null!=(yield this.stateService.getCryptoMasterKeyAuto({userId:t}));case Rt.Biometric:return!0===(yield this.stateService.hasCryptoMasterKeyBiometric({userId:t}));default:return!1}}))}hasEncKey(){return mw(this,void 0,void 0,(function*(){return null!=(yield this.stateService.getEncryptedCryptoSymmetricKey())}))}clearKey(e=!0,t){return mw(this,void 0,void 0,(function*(){yield this.stateService.setCryptoMasterKey(null,{userId:t}),e&&(yield this.clearSecretKeyStore(t))}))}clearStoredKey(e){return mw(this,void 0,void 0,(function*(){e===Rt.Auto?yield this.stateService.setCryptoMasterKeyAuto(null):yield this.stateService.setCryptoMasterKeyBiometric(null)}))}clearKeyHash(e){return mw(this,void 0,void 0,(function*(){return yield this.stateService.setKeyHash(null,{userId:e})}))}clearEncKey(e,t){return mw(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedCryptoSymmetricKey(null,{userId:t}),e||(yield this.stateService.setEncryptedCryptoSymmetricKey(null,{userId:t}))}))}clearKeyPair(e,t){return mw(this,void 0,void 0,(function*(){const i=[this.stateService.setDecryptedPrivateKey(null,{userId:t}),this.stateService.setPublicKey(null,{userId:t})];return e||i.push(this.stateService.setEncryptedPrivateKey(null,{userId:t})),Promise.all(i)}))}clearOrgKeys(e,t){return mw(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedOrganizationKeys(null,{userId:t}),e||(yield this.stateService.setEncryptedOrganizationKeys(null,{userId:t}))}))}clearProviderKeys(e,t){return mw(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedProviderKeys(null,{userId:t}),e||(yield this.stateService.setEncryptedProviderKeys(null,{userId:t}))}))}clearPinProtectedKey(e){return mw(this,void 0,void 0,(function*(){return yield this.stateService.setEncryptedPinProtected(null,{userId:e})}))}clearKeys(e){return mw(this,void 0,void 0,(function*(){yield this.clearKey(!0,e),yield this.clearKeyHash(e),yield this.clearOrgKeys(!1,e),yield this.clearProviderKeys(!1,e),yield this.clearEncKey(!1,e),yield this.clearKeyPair(!1,e),yield this.clearPinProtectedKey(e)}))}toggleKey(){return mw(this,void 0,void 0,(function*(){const e=yield this.getKey();yield this.setKey(e)}))}makeKey(e,t,i,n){return mw(this,void 0,void 0,(function*(){let s=null;if(null!=i&&i!==Zi.PBKDF2_SHA256)throw new Error("Unknown Kdf.");if(null==n)n=5e3;else if(n<5e3)throw new Error("PBKDF2 iteration minimum is 5000.");return s=yield this.cryptoFunctionService.pbkdf2(e,t,"sha256",n),new ac(s)}))}makeKeyFromPin(e,t,i,n,s=null){return mw(this,void 0,void 0,(function*(){if(null==s){const e=yield this.stateService.getEncryptedPinProtected();if(null==e)throw new Error("No PIN protected key found.");s=new ot(e)}const o=yield this.makePinKey(e,t,i,n),r=yield this.decryptToBytes(s,o);return new ac(r)}))}makeShareKey(){return mw(this,void 0,void 0,(function*(){const e=yield this.cryptoFunctionService.randomBytes(64),t=yield this.getPublicKey();return[yield this.rsaEncrypt(e,t),new ac(e)]}))}makeKeyPair(e){return mw(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);return[nt.fromBufferToB64(t[0]),yield this.encrypt(t[1],e)]}))}makePinKey(e,t,i,n){return mw(this,void 0,void 0,(function*(){const s=yield this.makeKey(e,t,i,n);return yield this.stretchKey(s)}))}makeSendKey(e){return mw(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.hkdf(e,"bitwarden-send","send",64,"sha256");return new ac(t)}))}hashPassword(e,t,i){return mw(this,void 0,void 0,(function*(){if(null==t&&(t=yield this.getKey()),null==e||null==t)throw new Error("Invalid parameters.");const n=i===Et.LocalAuthorization?2:1,s=yield this.cryptoFunctionService.pbkdf2(t.key,e,"sha256",n);return nt.fromBufferToB64(s)}))}makeEncKey(e){return mw(this,void 0,void 0,(function*(){const t=yield this.getKeyForUserEncryption(e),i=yield this.cryptoFunctionService.randomBytes(64);return this.buildEncKey(t,i)}))}remakeEncKey(e,t){return mw(this,void 0,void 0,(function*(){return null==t&&(t=yield this.getEncKey()),this.buildEncKey(e,t.key)}))}encrypt(e,t){return mw(this,void 0,void 0,(function*(){return t=yield this.getKeyForUserEncryption(t),yield this.encryptService.encrypt(e,t)}))}encryptToBytes(e,t){return mw(this,void 0,void 0,(function*(){return t=yield this.getKeyForUserEncryption(t),this.encryptService.encryptToBytes(e,t)}))}rsaEncrypt(e,t){return mw(this,void 0,void 0,(function*(){if(null==t&&(t=yield this.getPublicKey()),null==t)throw new Error("Public key unavailable.");const i=yield this.cryptoFunctionService.rsaEncrypt(e,t,"sha1");return new ot(je.Rsa2048_OaepSha1_B64,nt.fromBufferToB64(i))}))}rsaDecrypt(e,t){return mw(this,void 0,void 0,(function*(){const i=e.split(".");let n,s=null;if(1===i.length)s=je.Rsa2048_OaepSha256_B64,n=[i[0]];else if(2===i.length)try{s=parseInt(i[0],null),n=i[1].split("|")}catch(e){this.logService.error(e)}switch(s){case je.Rsa2048_OaepSha256_B64:case je.Rsa2048_OaepSha1_B64:case je.Rsa2048_OaepSha256_HmacSha256_B64:case je.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}if(null==n||n.length<=0)throw new Error("encPieces unavailable.");const o=nt.fromB64ToArray(n[0]).buffer,r=null!=t?t:yield this.getPrivateKey();if(null==r)throw new Error("No private key.");let a="sha1";switch(s){case je.Rsa2048_OaepSha256_B64:case je.Rsa2048_OaepSha256_HmacSha256_B64:a="sha256";break;case je.Rsa2048_OaepSha1_B64:case je.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}return this.cryptoFunctionService.rsaDecrypt(o,r,a)}))}decryptToBytes(e,t){return mw(this,void 0,void 0,(function*(){const i=yield this.getKeyForUserEncryption(t);return this.encryptService.decryptToBytes(e,i)}))}decryptToUtf8(e,t){return mw(this,void 0,void 0,(function*(){return t=yield this.getKeyForUserEncryption(t),yield this.encryptService.decryptToUtf8(e,t)}))}decryptFromBytes(e,t){return mw(this,void 0,void 0,(function*(){if(null==e)throw new Error("No buffer provided for decryption.");return t=yield this.getKeyForUserEncryption(t),this.encryptService.decryptToBytes(e,t)}))}randomNumber(e,t){return mw(this,void 0,void 0,(function*(){let i=0;const n=t-e+1,s=Math.ceil(Math.log2(n));if(s>53)throw new Error("We cannot generate numbers larger than 53 bits.");const o=Math.ceil(s/8),r=Math.pow(2,s)-1,a=new Uint8Array(yield this.cryptoFunctionService.randomBytes(o));let l=8*(o-1);for(let e=0;e=n?this.randomNumber(e,t):e+i}))}validateKey(e){return mw(this,void 0,void 0,(function*(){try{const t=yield this.stateService.getEncryptedPrivateKey(),i=yield this.getEncKeyHelper(e);if(null==t||null==i)return!1;const n=yield this.decryptToBytes(new ot(t),i);yield this.cryptoFunctionService.rsaExtractPublicKey(n)}catch(e){return!1}return!0}))}storeKey(e,t){return mw(this,void 0,void 0,(function*(){(yield this.shouldStoreKey(Rt.Auto,t))?yield this.stateService.setCryptoMasterKeyAuto(e.keyB64,{userId:t}):(yield this.shouldStoreKey(Rt.Biometric,t))?yield this.stateService.setCryptoMasterKeyBiometric(e.keyB64,{userId:t}):(yield this.stateService.setCryptoMasterKeyAuto(null,{userId:t}),yield this.stateService.setCryptoMasterKeyBiometric(null,{userId:t}))}))}shouldStoreKey(e,t){return mw(this,void 0,void 0,(function*(){let i=!1;if(e===Rt.Auto){i=null==(yield this.stateService.getVaultTimeout({userId:t}))}else if(e===Rt.Biometric){i=(yield this.stateService.getBiometricUnlock({userId:t}))&&this.platformUtilService.supportsSecureStorage()}return i}))}retrieveKeyFromStorage(e,t){return mw(this,void 0,void 0,(function*(){return e===Rt.Auto?yield this.stateService.getCryptoMasterKeyAuto({userId:t}):yield this.stateService.getCryptoMasterKeyBiometric({userId:t})}))}getKeyForUserEncryption(e){return mw(this,void 0,void 0,(function*(){if(null!=e)return e;const t=yield this.getEncKey();return null!=t?t:yield this.getKey()}))}stretchKey(e){return mw(this,void 0,void 0,(function*(){const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e.key,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e.key,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new ac(t.buffer)}))}hashPhrase(e,t=64){return mw(this,void 0,void 0,(function*(){const i=Math.log(dw.length)/Math.log(2);let n=Math.ceil(t/i);const s=Array.from(new Uint8Array(e));if(n*i>4*s.length)throw new Error("Output entropy of hash function is too small");const o=[];let r=uw.fromArray(s,256);for(;n--;){const e=r.mod(dw.length);r=r.divide(dw.length),o.push(dw[e])}return o}))}buildEncKey(e,t){return mw(this,void 0,void 0,(function*(){let i=null;if(32===e.key.byteLength){const n=yield this.stretchKey(e);i=yield this.encrypt(t,n)}else{if(64!==e.key.byteLength)throw new Error("Invalid key size.");i=yield this.encrypt(t,e)}return[new ac(t),i]}))}clearSecretKeyStore(e){return mw(this,void 0,void 0,(function*(){yield this.stateService.setCryptoMasterKeyAuto(null,{userId:e}),yield this.stateService.setCryptoMasterKeyBiometric(null,{userId:e})}))}getEncKeyHelper(e=null){return mw(this,void 0,void 0,(function*(){const t=yield this.stateService.getDecryptedCryptoSymmetricKey();if(null!=t)return t;const i=yield this.stateService.getEncryptedCryptoSymmetricKey();if(null==i)return null;if(null==e&&(e=yield this.getKey()),null==e)return null;let n;const s=new ot(i);if(s.encryptionType===je.AesCbc256_B64)n=yield this.decryptToBytes(s,e);else{if(s.encryptionType!==je.AesCbc256_HmacSha256_B64)throw new Error("Unsupported encKey type.");{const t=yield this.stretchKey(e);n=yield this.decryptToBytes(s,t)}}if(null==n)return null;const o=new ac(n);return yield this.stateService.setDecryptedCryptoSymmetricKey(o),o}))}}yw([cm((()=>"getEncKey")),fw("design:type",Function),fw("design:paramtypes",[ac]),fw("design:returntype",Promise)],ww.prototype,"getEncKey",null),yw([cm((()=>"getOrgKeys")),fw("design:type",Function),fw("design:paramtypes",[]),fw("design:returntype",Promise)],ww.prototype,"getOrgKeys",null),yw([cm((()=>"getProviderKeys")),fw("design:type",Function),fw("design:paramtypes",[]),fw("design:returntype",Promise)],ww.prototype,"getProviderKeys",null);class bw{}var Sw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Uw{constructor(e,t,i){this.cryptoFunctionService=e,this.logService=t,this.logMacFailures=i}encrypt(e,t){return Sw(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");if(null==e)return Promise.resolve(null);let i;i="string"==typeof e?nt.fromUtf8ToArray(e).buffer:e;const n=yield this.aesEncrypt(i,t),s=nt.fromBufferToB64(n.iv),o=nt.fromBufferToB64(n.data),r=null!=n.mac?nt.fromBufferToB64(n.mac):null;return new ot(n.key.encType,o,s,r)}))}encryptToBytes(e,t){return Sw(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");const i=yield this.aesEncrypt(e,t);let n=0;null!=i.mac&&(n=i.mac.byteLength);const s=new Uint8Array(1+i.iv.byteLength+n+i.data.byteLength);return s.set([i.key.encType]),s.set(new Uint8Array(i.iv),1),null!=i.mac&&s.set(new Uint8Array(i.mac),1+i.iv.byteLength),s.set(new Uint8Array(i.data),1+i.iv.byteLength+n),new Cu(s.buffer)}))}decryptToUtf8(e,t){return Sw(this,void 0,void 0,(function*(){if(null==t)throw new Error("No key provided for decryption.");if(null!=(t=this.resolveLegacyKey(t,e)).macKey&&null==(null==e?void 0:e.mac))return this.logService.error("mac required."),null;if(t.encType!==e.encryptionType)return this.logService.error("encType unavailable."),null;const i=this.cryptoFunctionService.aesDecryptFastParameters(e.data,e.iv,e.mac,t);if(null!=i.macKey&&null!=i.mac){const e=yield this.cryptoFunctionService.hmacFast(i.macData,i.macKey,"sha256");if(!(yield this.cryptoFunctionService.compareFast(i.mac,e)))return this.logMacFailed("mac failed."),null}return yield this.cryptoFunctionService.aesDecryptFast(i)}))}decryptToBytes(e,t){return Sw(this,void 0,void 0,(function*(){if(null==t)throw new Error("No encryption key provided.");if(null==e)throw new Error("Nothing provided for decryption.");if(null!=(t=this.resolveLegacyKey(t,e)).macKey&&null==e.macBytes)return null;if(t.encType!==e.encryptionType)return null;if(null!=t.macKey&&null!=e.macBytes){const i=new Uint8Array(e.ivBytes.byteLength+e.dataBytes.byteLength);i.set(new Uint8Array(e.ivBytes),0),i.set(new Uint8Array(e.dataBytes),e.ivBytes.byteLength);const n=yield this.cryptoFunctionService.hmac(i.buffer,t.macKey,"sha256");if(null===n)return null;if(!(yield this.cryptoFunctionService.compare(e.macBytes,n)))return this.logMacFailed("mac failed."),null}const i=yield this.cryptoFunctionService.aesDecrypt(e.dataBytes,e.ivBytes,t.encKey);return null!=i?i:null}))}aesEncrypt(e,t){return Sw(this,void 0,void 0,(function*(){const i=new bw;if(i.key=t,i.iv=yield this.cryptoFunctionService.randomBytes(16),i.data=yield this.cryptoFunctionService.aesEncrypt(e,i.iv,i.key.encKey),null!=i.key.macKey){const e=new Uint8Array(i.iv.byteLength+i.data.byteLength);e.set(new Uint8Array(i.iv),0),e.set(new Uint8Array(i.data),i.iv.byteLength),i.mac=yield this.cryptoFunctionService.hmac(e.buffer,i.key.macKey,"sha256")}return i}))}logMacFailed(e){this.logMacFailures&&this.logService.error(e)}resolveLegacyKey(e,t){return t.encryptionType===je.AesCbc128_HmacSha256_B64&&e.encType===je.AesCbc256_B64?new ac(e.key,je.AesCbc128_HmacSha256_B64):e}}class xw{}class Aw{}var _w=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Zw{constructor(e,t,i,n,s){this.apiService=e,this.cipherService=t,this.stateService=i,this.logService=n,this.organizationService=s,this.inited=!1}init(e){this.inited||(this.inited=!0,e&&(this.uploadEvents(),setInterval((()=>this.uploadEvents()),6e4)))}collect(e,t=null,i=!1,n=null){return _w(this,void 0,void 0,(function*(){if(!(yield this.stateService.getIsAuthenticated()))return;const s=yield this.organizationService.getAll();if(null==s)return;const o=new Set(s.filter((e=>e.useEvents)).map((e=>e.id)));if(0===o.size)return;if(null!=t){const e=yield this.cipherService.get(t);if(null==e||null==e.organizationId||!o.has(e.organizationId))return}if(null!=n&&!o.has(n))return;let r=yield this.stateService.getEventCollection();null==r&&(r=[]);const a=new xw;a.type=e,a.cipherId=t,a.date=(new Date).toISOString(),a.organizationId=n,r.push(a),yield this.stateService.setEventCollection(r),i&&(yield this.uploadEvents())}))}uploadEvents(e){return _w(this,void 0,void 0,(function*(){if(!(yield this.stateService.getIsAuthenticated({userId:e})))return;const t=yield this.stateService.getEventCollection({userId:e});if(null==t||0===t.length)return;const i=t.map((e=>{const t=new Aw;return t.type=e.type,t.cipherId=e.cipherId,t.date=e.date,t.organizationId=e.organizationId,t}));try{yield this.apiService.postEventsCollect(i),this.clearEvents(e)}catch(e){this.logService.error(e)}}))}clearEvents(e){return _w(this,void 0,void 0,(function*(){yield this.stateService.setEventCollection(null,{userId:e})}))}}var Tw=i(890);class Cw{constructor(e){var t,i,n,s,o,r;null!=e&&(e instanceof rc?(this.cardholderName=e.cardholderName,this.brand=e.brand,this.number=e.number,this.expMonth=e.expMonth,this.expYear=e.expYear,this.code=e.code):(this.cardholderName=null===(t=e.cardholderName)||void 0===t?void 0:t.encryptedString,this.brand=null===(i=e.brand)||void 0===i?void 0:i.encryptedString,this.number=null===(n=e.number)||void 0===n?void 0:n.encryptedString,this.expMonth=null===(s=e.expMonth)||void 0===s?void 0:s.encryptedString,this.expYear=null===(o=e.expYear)||void 0===o?void 0:o.encryptedString,this.code=null===(r=e.code)||void 0===r?void 0:r.encryptedString))}static template(){const e=new Cw;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 rc){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 Sm){return t.cardholderName=null!=e.cardholderName?new ot(e.cardholderName):null,t.brand=null!=e.brand?new ot(e.brand):null,t.number=null!=e.number?new ot(e.number):null,t.expMonth=null!=e.expMonth?new ot(e.expMonth):null,t.expYear=null!=e.expYear?new ot(e.expYear):null,t.code=null!=e.code?new ot(e.code):null,t}}class kw{constructor(e){var t,i;null!=e&&(e instanceof cc?(this.name=e.name,this.value=e.value):(this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.value=null===(i=e.value)||void 0===i?void 0:i.encryptedString),this.type=e.type,this.linkedId=e.linkedId)}static template(){const e=new kw;return e.name="Field name",e.value="Some value",e.type=_c.Text,e}static toView(e,t=new cc){return t.type=e.type,t.value=e.value,t.name=e.name,t.linkedId=e.linkedId,t}static toDomain(e,t=new Um){return t.type=e.type,t.value=null!=e.value?new ot(e.value):null,t.name=null!=e.name?new ot(e.name):null,t.linkedId=e.linkedId,t}}class Ow{constructor(e){var t,i,n,s,o,r,a,l,c,u,d,h,p,g,v,y,f,m;null!=e&&(e instanceof hc?(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):(this.title=null===(t=e.title)||void 0===t?void 0:t.encryptedString,this.firstName=null===(i=e.firstName)||void 0===i?void 0:i.encryptedString,this.middleName=null===(n=e.middleName)||void 0===n?void 0:n.encryptedString,this.lastName=null===(s=e.lastName)||void 0===s?void 0:s.encryptedString,this.address1=null===(o=e.address1)||void 0===o?void 0:o.encryptedString,this.address2=null===(r=e.address2)||void 0===r?void 0:r.encryptedString,this.address3=null===(a=e.address3)||void 0===a?void 0:a.encryptedString,this.city=null===(l=e.city)||void 0===l?void 0:l.encryptedString,this.state=null===(c=e.state)||void 0===c?void 0:c.encryptedString,this.postalCode=null===(u=e.postalCode)||void 0===u?void 0:u.encryptedString,this.country=null===(d=e.country)||void 0===d?void 0:d.encryptedString,this.company=null===(h=e.company)||void 0===h?void 0:h.encryptedString,this.email=null===(p=e.email)||void 0===p?void 0:p.encryptedString,this.phone=null===(g=e.phone)||void 0===g?void 0:g.encryptedString,this.ssn=null===(v=e.ssn)||void 0===v?void 0:v.encryptedString,this.username=null===(y=e.username)||void 0===y?void 0:y.encryptedString,this.passportNumber=null===(f=e.passportNumber)||void 0===f?void 0:f.encryptedString,this.licenseNumber=null===(m=e.licenseNumber)||void 0===m?void 0:m.encryptedString))}static template(){const e=new Ow;return e.title="Mr",e.firstName="John",e.middleName="William",e.lastName="Doe",e.address1="123 Any St",e.address2="Apt #123",e.address3=null,e.city="New York",e.state="NY",e.postalCode="10001",e.country="US",e.company="Acme Inc.",e.email="john@company.com",e.phone="5555551234",e.ssn="000-123-4567",e.username="jdoe",e.passportNumber="US-123456789",e.licenseNumber="D123-12-123-12333",e}static toView(e,t=new hc){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 xm){return t.title=null!=e.title?new ot(e.title):null,t.firstName=null!=e.firstName?new ot(e.firstName):null,t.middleName=null!=e.middleName?new ot(e.middleName):null,t.lastName=null!=e.lastName?new ot(e.lastName):null,t.address1=null!=e.address1?new ot(e.address1):null,t.address2=null!=e.address2?new ot(e.address2):null,t.address3=null!=e.address3?new ot(e.address3):null,t.city=null!=e.city?new ot(e.city):null,t.state=null!=e.state?new ot(e.state):null,t.postalCode=null!=e.postalCode?new ot(e.postalCode):null,t.country=null!=e.country?new ot(e.country):null,t.company=null!=e.company?new ot(e.company):null,t.email=null!=e.email?new ot(e.email):null,t.phone=null!=e.phone?new ot(e.phone):null,t.ssn=null!=e.ssn?new ot(e.ssn):null,t.username=null!=e.username?new ot(e.username):null,t.passportNumber=null!=e.passportNumber?new ot(e.passportNumber):null,t.licenseNumber=null!=e.licenseNumber?new ot(e.licenseNumber):null,t}}class Pw{constructor(e){var t;this.match=null,null!=e&&(this.uri=e instanceof gc?e.uri:null===(t=e.uri)||void 0===t?void 0:t.encryptedString,this.match=e.match)}static template(){const e=new Pw;return e.uri="https://google.com",e.match=null,e}static toView(e,t=new gc){return t.uri=e.uri,t.match=e.match,t}static toDomain(e,t=new Am){return t.uri=null!=e.uri?new ot(e.uri):null,t.match=e.match,t}}class Iw{constructor(e){var t,i,n;null!=e&&(null!=e.uris&&(this.uris=e.uris.map((e=>new Pw(e)))),e instanceof fc?(this.username=e.username,this.password=e.password,this.totp=e.totp):(this.username=null===(t=e.username)||void 0===t?void 0:t.encryptedString,this.password=null===(i=e.password)||void 0===i?void 0:i.encryptedString,this.totp=null===(n=e.totp)||void 0===n?void 0:n.encryptedString))}static template(){const e=new Iw;return e.uris=[],e.username="jdoe",e.password="myp@ssword123",e.totp="JBSWY3DPEHPK3PXP",e}static toView(e,t=new fc){return null!=e.uris&&(t.uris=e.uris.map((e=>Pw.toView(e)))),t.username=e.username,t.password=e.password,t.totp=e.totp,t}static toDomain(e,t=new Zm){return null!=e.uris&&(t.uris=e.uris.map((e=>Pw.toDomain(e)))),t.username=null!=e.username?new ot(e.username):null,t.password=null!=e.password?new ot(e.password):null,t.totp=null!=e.totp?new ot(e.totp):null,t}}class qw{constructor(e){null!=e&&(this.type=e.type)}static template(){const e=new qw;return e.type=Ql.Generic,e}static toView(e,t=new wc){return t.type=e.type,t}static toDomain(e,t=new Cm){return t.type=e.type,t}}class Dw{static template(){const e=new Dw;return e.organizationId=null,e.collectionIds=null,e.folderId=null,e.type=Bl.Login,e.name="Item name",e.notes="Some notes about this item.",e.favorite=!1,e.fields=[],e.login=null,e.secureNote=null,e.card=null,e.identity=null,e.reprompt=Kl.None,e}static toView(e,t=new bc){var i,n,s;if(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.collectionIds||e.collectionIds){const s=new Set((null!==(i=t.collectionIds)&&void 0!==i?i:[]).concat(null!==(n=e.collectionIds)&&void 0!==n?n:[]));t.collectionIds=Array.from(s.values())}switch(t.name=e.name,t.notes=e.notes,t.favorite=e.favorite,t.reprompt=null!==(s=e.reprompt)&&void 0!==s?s:Kl.None,null!=e.fields&&(t.fields=e.fields.map((e=>kw.toView(e)))),e.type){case Bl.Login:t.login=Iw.toView(e.login);break;case Bl.SecureNote:t.secureNote=qw.toView(e.secureNote);break;case Bl.Card:t.card=Cw.toView(e.card);break;case Bl.Identity:t.identity=Ow.toView(e.identity)}return t}static toDomain(e,t=new Om){var i;switch(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.name=null!=e.name?new ot(e.name):null,t.notes=null!=e.notes?new ot(e.notes):null,t.favorite=e.favorite,t.reprompt=null!==(i=e.reprompt)&&void 0!==i?i:Kl.None,null!=e.fields&&(t.fields=e.fields.map((e=>kw.toDomain(e)))),e.type){case Bl.Login:t.login=Iw.toDomain(e.login);break;case Bl.SecureNote:t.secureNote=qw.toDomain(e.secureNote);break;case Bl.Card:t.card=Cw.toDomain(e.card);break;case Bl.Identity:t.identity=Ow.toDomain(e.identity)}return t}build(e){var t,i;switch(this.organizationId=e.organizationId,this.folderId=e.folderId,this.type=e.type,this.reprompt=e.reprompt,e instanceof bc?(this.name=e.name,this.notes=e.notes):(this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.notes=null===(i=e.notes)||void 0===i?void 0:i.encryptedString),this.favorite=e.favorite,null!=e.fields&&(this.fields=e.fields.map((e=>new kw(e)))),e.type){case Bl.Login:this.login=new Iw(e.login);break;case Bl.SecureNote:this.secureNote=new qw(e.secureNote);break;case Bl.Card:this.card=new Cw(e.card);break;case Bl.Identity:this.identity=new Ow(e.identity)}}}class Mw extends Dw{build(e){this.id=e.id,super.build(e),this.collectionIds=e.collectionIds}}class Fw{static template(){const e=new Fw;return e.organizationId="00000000-0000-0000-0000-000000000000",e.name="Collection name",e.externalId=null,e}static toView(e,t=new Hm){return t.name=e.name,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}static toDomain(e,t=new jm){return t.name=null!=e.name?new ot(e.name):null,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}build(e){var t;this.organizationId=e.organizationId,this.name=e instanceof Hm?e.name:null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.externalId=e.externalId}}class Nw extends Fw{build(e){this.id=e.id,super.build(e)}}class Lw{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=Gr[e.type],this.installationId=e.installationId}}class Ew extends at{constructor(e){super(),null!=e&&(this.buildDomainModel(this,e,{id:null,name:null},["id"]),this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null)}decrypt(){return this.decryptObj(new wa(this),{name:null},null)}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new Ew,e,{name:ot.fromJSON(e.name),revisionDate:t})}}class Rw{static template(){const e=new Rw;return e.name="Folder name",e}static toView(e,t=new wa){return t.name=e.name,t}static toDomain(e,t=new Ew){return t.name=null!=e.name?new ot(e.name):null,t}build(e){var t;this.name=e instanceof wa?e.name:null===(t=e.name)||void 0===t?void 0:t.encryptedString}}class Jw extends Rw{build(e){this.id=e.id,super.build(e)}}var Yw,zw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kw{constructor(e,t,i,n,s){this.folderService=e,this.cipherService=t,this.apiService=i,this.cryptoService=n,this.cryptoFunctionService=s}getExport(e="csv",t){return zw(this,void 0,void 0,(function*(){return t?yield this.getOrganizationExport(t,e):"encrypted_json"===e?this.getEncryptedExport():this.getDecryptedExport(e)}))}getPasswordProtectedExport(e,t){return zw(this,void 0,void 0,(function*(){const i=t?yield this.getOrganizationExport(t,"json"):yield this.getExport("json"),n=nt.fromBufferToB64(yield this.cryptoFunctionService.randomBytes(16)),s=Ci,o=yield this.cryptoService.makePinKey(e,n,Zi.PBKDF2_SHA256,s),r=yield this.cryptoService.encrypt(nt.newGuid(),o),a=yield this.cryptoService.encrypt(i,o),l={encrypted:!0,passwordProtected:!0,salt:n,kdfIterations:s,kdfType:Zi.PBKDF2_SHA256,encKeyValidation_DO_NOT_EDIT:r.encryptedString,data:a.encryptedString};return JSON.stringify(l,null," ")}))}getOrganizationExport(e,t="csv"){return zw(this,void 0,void 0,(function*(){return"encrypted_json"===t?this.getOrganizationEncryptedExport(e):this.getOrganizationDecryptedExport(e,t)}))}getEventExport(e){return zw(this,void 0,void 0,(function*(){return Tw.unparse(e.map((e=>new Lw(e))))}))}getFileName(e=null,t="csv"){const i=new Date;return"bitwarden"+(e?"_"+e:"")+"_export_"+(i.getFullYear()+""+this.padNumber(i.getMonth()+1,2)+this.padNumber(i.getDate(),2)+this.padNumber(i.getHours(),2)+this.padNumber(i.getMinutes(),2)+this.padNumber(i.getSeconds(),2))+"."+t}getDecryptedExport(e){return zw(this,void 0,void 0,(function*(){let t=[],i=[];const n=[];if(n.push((0,Ku.z)(this.folderService.folderViews$).then((e=>{t=e}))),n.push(this.cipherService.getAllDecrypted().then((e=>{i=e.filter((e=>null==e.deletedDate))}))),yield Promise.all(n),"csv"===e){const e=new Map;t.forEach((t=>{null!=t.id&&e.set(t.id,t)}));const n=[];return i.forEach((t=>{if(t.type!==Bl.Login&&t.type!==Bl.SecureNote)return;if(null!=t.organizationId)return;const i={};i.folder=null!=t.folderId&&e.has(t.folderId)?e.get(t.folderId).name:null,i.favorite=t.favorite?1:null,this.buildCommonCipher(i,t),n.push(i)})),Tw.unparse(n)}{const e={encrypted:!1,folders:[],items:[]};return t.forEach((t=>{if(null==t.id)return;const i=new Jw;i.build(t),e.folders.push(i)})),i.forEach((t=>{if(null!=t.organizationId)return;const i=new Mw;i.build(t),i.collectionIds=null,e.items.push(i)})),JSON.stringify(e,null," ")}}))}getEncryptedExport(){return zw(this,void 0,void 0,(function*(){let e=[],t=[];const i=[];i.push((0,Ku.z)(this.folderService.folders$).then((t=>{e=t}))),i.push(this.cipherService.getAll().then((e=>{t=e.filter((e=>null==e.deletedDate))}))),yield Promise.all(i);const n={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.cryptoService.encrypt(nt.newGuid())).encryptedString,folders:[],items:[]};return e.forEach((e=>{if(null==e.id)return;const t=new Jw;t.build(e),n.folders.push(t)})),t.forEach((e=>{if(null!=e.organizationId)return;const t=new Mw;t.build(e),t.collectionIds=null,n.items.push(t)})),JSON.stringify(n,null," ")}))}getOrganizationDecryptedExport(e,t){return zw(this,void 0,void 0,(function*(){const i=[],n=[],s=[];if(s.push(this.apiService.getOrganizationExport(e).then((e=>{const t=[];return null!=e&&(null!=e.collections&&null!=e.collections.data&&e.collections.data.length>0&&e.collections.data.forEach((e=>{const n=new jm(new Vm(e));t.push(n.decrypt().then((e=>{i.push(e)})))})),null!=e.ciphers&&null!=e.ciphers.data&&e.ciphers.data.length>0&&e.ciphers.data.filter((e=>null===e.deletedDate)).forEach((e=>{const i=new Om(new mm(e));t.push(i.decrypt().then((e=>{n.push(e)})))}))),Promise.all(t)}))),yield Promise.all(s),"csv"===t){const e=new Map;i.forEach((t=>{e.set(t.id,t)}));const t=[];return n.forEach((i=>{if(i.type!==Bl.Login&&i.type!==Bl.SecureNote)return;const n={collections:[]};null!=i.collectionIds&&(n.collections=i.collectionIds.filter((t=>e.has(t))).map((t=>e.get(t).name))),this.buildCommonCipher(n,i),t.push(n)})),Tw.unparse(t)}{const e={encrypted:!1,collections:[],items:[]};return i.forEach((t=>{const i=new Nw;i.build(t),e.collections.push(i)})),n.forEach((t=>{const i=new Mw;i.build(t),e.items.push(i)})),JSON.stringify(e,null," ")}}))}getOrganizationEncryptedExport(e){return zw(this,void 0,void 0,(function*(){const t=[],i=[],n=[];n.push(this.apiService.getCollections(e).then((e=>(null!=e&&null!=e.data&&e.data.length>0&&e.data.forEach((e=>{const i=new jm(new Vm(e));t.push(i)})),Promise.all([]))))),n.push(this.apiService.getCiphersOrganization(e).then((e=>(null!=e&&null!=e.data&&e.data.length>0&&e.data.filter((e=>null===e.deletedDate)).forEach((e=>{const t=new Om(new mm(e));i.push(t)})),Promise.all([]))))),yield Promise.all(n);const s=yield this.cryptoService.getOrgKey(e),o={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.cryptoService.encrypt(nt.newGuid(),s)).encryptedString,collections:[],items:[]};return t.forEach((e=>{const t=new Nw;t.build(e),o.collections.push(t)})),i.forEach((e=>{const t=new Mw;t.build(e),o.items.push(t)})),JSON.stringify(o,null," ")}))}padNumber(e,t,i="0"){const n=e.toString();return n.length>=t?n:new Array(t-n.length+1).join(i)+n}buildCommonCipher(e,t){switch(e.type=null,e.name=t.name,e.notes=t.notes,e.fields=null,e.reprompt=t.reprompt,e.login_uri=null,e.login_username=null,e.login_password=null,e.login_totp=null,t.fields&&t.fields.forEach((t=>{e.fields?e.fields+="\n":e.fields="",e.fields+=(t.name||"")+": "+t.value})),t.type){case Bl.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 Bl.SecureNote:e.type="note";break;default:return}return e}}!function(e){e[e.Direct=0]="Direct",e[e.Azure=1]="Azure"}(Yw||(Yw={}));var Bw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Gw{constructor(e){this.logService=e}upload(e,t,i){return Bw(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 Bw(this,void 0,void 0,(function*(){const i=nt.getUrl(e),n=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":i.searchParams.get("sv"),"Content-Length":t.buffer.byteLength.toString(),"x-ms-blob-type":"BlockBlob"}),s=new Request(e,{body:t.buffer,cache:"no-store",method:"PUT",headers:n}),o=yield fetch(s);if(201!==o.status)throw new Error(`Failed to create Azure blob: ${o.status}`)}))}azureUploadBlocks(e,t,i){return Bw(this,void 0,void 0,(function*(){const n=nt.getUrl(e),s=this.getMaxBlockSize(n.searchParams.get("sv"));let o=0;const r=Math.ceil(t.buffer.byteLength/s),a=[];if(r>5e4)throw new Error("Cannot upload file, exceeds maximum size of "+5e4*s);try{for(;o{t+=`${e}`})),t+="",t}getMaxBlockSize(e){return Qw.compare(e,"2019-12-12")>=0?4194304e3:Qw.compare(e,"2016-05-31")>=0?104857600:4194304}}class Qw{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(e){}}static compare(e,t){return"string"==typeof e&&(e=new Qw(e)),"string"==typeof t&&(t=new Qw(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}compare(e){return Qw.compare(this,e)}}var Vw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hw{upload(e,t,i){return Vw(this,void 0,void 0,(function*(){const n=new FormData;try{const i=new Blob([t.buffer],{type:"application/octet-stream"});n.append("data",i,e)}catch(i){if(!nt.isNode||nt.isBrowser)throw i;n.append("data",Buffer.from(t.buffer),{filepath:e,contentType:"application/octet-stream"})}yield i(n)}))}}var jw=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ww{constructor(e,t){this.logService=e,this.apiService=t,this.azureFileUploadService=new Gw(e),this.bitwardenFileUploadService=new Hw}uploadSendFile(e,t,i){return jw(this,void 0,void 0,(function*(){try{switch(e.fileUploadType){case Yw.Direct:yield this.bitwardenFileUploadService.upload(t.encryptedString,i,(t=>this.apiService.postSendFile(e.sendResponse.id,e.sendResponse.file.id,t)));break;case Yw.Azure:{const t=()=>jw(this,void 0,void 0,(function*(){return(yield this.apiService.renewSendFileUploadUrl(e.sendResponse.id,e.sendResponse.file.id)).url}));yield this.azureFileUploadService.upload(e.url,i,t);break}default:throw new Error("Unknown file upload type")}}catch(t){throw yield this.apiService.deleteSend(e.sendResponse.id),t}}))}uploadCipherAttachment(e,t,i,n){return jw(this,void 0,void 0,(function*(){const s=e?t.cipherMiniResponse:t.cipherResponse;try{switch(t.fileUploadType){case Yw.Direct:yield this.bitwardenFileUploadService.upload(i.encryptedString,n,(e=>this.apiService.postAttachmentFile(s.id,t.attachmentId,e)));break;case Yw.Azure:{const e=()=>jw(this,void 0,void 0,(function*(){return(yield this.apiService.renewAttachmentUploadUrl(s.id,t.attachmentId)).url}));yield this.azureFileUploadService.upload(t.url,n,e);break}default:throw new Error("Unknown file upload type.")}}catch(i){throw e?yield this.apiService.deleteCipherAttachmentAdmin(s.id,t.attachmentId):yield this.apiService.deleteCipherAttachment(s.id,t.attachmentId),i}}))}}class $w{constructor(e){this.name=e.name,this.id=e.id,this.revisionDate=e.revisionDate}}class Xw{constructor(e){this.name=e.name?e.name.encryptedString:null}}var eb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class tb{constructor(e,t){this.folderService=e,this.apiService=t}save(e){return eb(this,void 0,void 0,(function*(){const t=new Xw(e);let i;null==e.id?(i=yield this.postFolder(t),e.id=i.id):i=yield this.putFolder(e.id,t);const n=new $w(i);yield this.folderService.upsert(n)}))}delete(e){return eb(this,void 0,void 0,(function*(){yield this.deleteFolder(e),yield this.folderService.delete(e)}))}get(e){return eb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/folders/"+e,null,!0,!0);return new Uf(t)}))}postFolder(e){return eb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/folders",e,!0,!0);return new Uf(t)}))}putFolder(e,t){return eb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/folders/"+e,t,!0,!0);return new Uf(i)}))}deleteFolder(e){return this.apiService.send("DELETE","/folders/"+e,null,!0,!1)}}var ib,nb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class sb{constructor(e,t,i,n){this.cryptoService=e,this.i18nService=t,this.cipherService=i,this.stateService=n,this._folders=new sv.X([]),this._folderViews=new sv.X([]),this.folders$=this._folders.asObservable(),this.folderViews$=this._folderViews.asObservable(),this.stateService.activeAccountUnlocked$.pipe((0,Ge.b)((e=>nb(this,void 0,void 0,(function*(){if(null==nt.global.bitwardenContainerService)return;if(!e)return this._folders.next([]),void this._folderViews.next([]);const t=yield this.stateService.getEncryptedFolders();yield this.updateObservables(t)}))))).subscribe()}clearCache(){return nb(this,void 0,void 0,(function*(){this._folderViews.next([])}))}encrypt(e,t){return nb(this,void 0,void 0,(function*(){const i=new Ew;return i.id=e.id,i.name=yield this.cryptoService.encrypt(e.name,t),i}))}get(e){return nb(this,void 0,void 0,(function*(){return this._folders.getValue().find((t=>t.id===e))}))}getAllDecryptedFromState(){return nb(this,void 0,void 0,(function*(){const e=yield this.stateService.getEncryptedFolders(),t=Object.values(e||{}).map((e=>new Ew(e)));return this.decryptFolders(t)}))}upsert(e){return nb(this,void 0,void 0,(function*(){let t=yield this.stateService.getEncryptedFolders();if(null==t&&(t={}),e instanceof $w){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));yield this.updateObservables(t),yield this.stateService.setEncryptedFolders(t)}))}replace(e){return nb(this,void 0,void 0,(function*(){yield this.updateObservables(e),yield this.stateService.setEncryptedFolders(e)}))}clear(e){return nb(this,void 0,void 0,(function*(){null!=e&&e!=(yield this.stateService.getUserId())||(this._folders.next([]),this._folderViews.next([])),yield this.stateService.setEncryptedFolders(null,{userId:e})}))}delete(e){return nb(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedFolders();if(null==t)return;if("string"==typeof e){if(null==t[e])return;delete t[e]}else e.forEach((e=>{delete t[e]}));yield this.updateObservables(t),yield this.stateService.setEncryptedFolders(t);const i=yield this.stateService.getEncryptedCiphers();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&&this.cipherService.upsert(t)}}))}updateObservables(e){return nb(this,void 0,void 0,(function*(){const t=Object.values(e||{}).map((e=>new Ew(e)));this._folders.next(t),(yield this.cryptoService.hasKey())&&this._folderViews.next(yield this.decryptFolders(t))}))}decryptFolders(e){return nb(this,void 0,void 0,(function*(){const t=e.map((e=>e.decrypt())),i=yield Promise.all(t);i.sort(nt.getSortFunction(this.i18nService,"name"));const n=new wa;return n.name=this.i18nService.t("noneFolder"),i.push(n),i}))}}!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"}(ib||(ib={}));class ob{constructor(e,t,i,n,s){this.key=e,this.kdf=t,this.kdfIterations=i,this.orgIdentifier=n,this.keys=s}}class rb{constructor(e){this.key=e}}var ab=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class lb{constructor(e,t,i,n,s,o,r,a){this.stateService=e,this.cryptoService=t,this.apiService=i,this.tokenService=n,this.logService=s,this.organizationService=o,this.cryptoFunctionService=r,this.logoutCallback=a}setUsesKeyConnector(e){return this.stateService.setUsesKeyConnector(e)}getUsesKeyConnector(){return ab(this,void 0,void 0,(function*(){return yield this.stateService.getUsesKeyConnector()}))}userNeedsMigration(){return ab(this,void 0,void 0,(function*(){const e=yield this.tokenService.getIsExternal(),t=null!=(yield this.getManagingOrganization()),i=!(yield this.getUsesKeyConnector());return e&&t&&i}))}migrateUser(){return ab(this,void 0,void 0,(function*(){const e=yield this.getManagingOrganization(),t=yield this.cryptoService.getKey(),i=new rb(t.encKeyB64);try{yield this.apiService.postUserKeyToKeyConnector(e.keyConnectorUrl,i)}catch(e){this.handleKeyConnectorError(e)}yield this.apiService.postConvertToKeyConnector()}))}getAndSetKey(e){return ab(this,void 0,void 0,(function*(){try{const t=yield this.apiService.getUserKeyFromKeyConnector(e),i=nt.fromB64ToArray(t.key),n=new ac(i);yield this.cryptoService.setKey(n)}catch(e){this.handleKeyConnectorError(e)}}))}getManagingOrganization(){return ab(this,void 0,void 0,(function*(){return(yield this.organizationService.getAll()).find((e=>e.keyConnectorEnabled&&e.type!==ib.Admin&&e.type!==ib.Owner&&!e.isProviderUser))}))}convertNewSsoUserToKeyConnector(e,t){return ab(this,void 0,void 0,(function*(){const{kdf:i,kdfIterations:n,keyConnectorUrl:s}=e,o=yield this.cryptoFunctionService.randomBytes(64),r=yield this.cryptoService.makeKey(nt.fromBufferToB64(o),yield this.tokenService.getEmail(),i,n),a=new rb(r.encKeyB64);yield this.cryptoService.setKey(r);const l=yield this.cryptoService.makeEncKey(r);yield this.cryptoService.setEncKey(l[1].encryptedString);const[c,u]=yield this.cryptoService.makeKeyPair();try{yield this.apiService.postUserKeyToKeyConnector(s,a)}catch(e){this.handleKeyConnectorError(e)}const d=new ki(c,u.encryptedString),h=new ob(l[1].encryptedString,i,n,t,d);yield this.apiService.postSetKeyConnectorKey(h)}))}setConvertAccountRequired(e){return ab(this,void 0,void 0,(function*(){yield this.stateService.setConvertAccountToKeyConnector(e)}))}getConvertAccountRequired(){return ab(this,void 0,void 0,(function*(){return yield this.stateService.getConvertAccountToKeyConnector()}))}removeConvertAccountRequired(){return ab(this,void 0,void 0,(function*(){yield this.stateService.setConvertAccountToKeyConnector(null)}))}clear(){return ab(this,void 0,void 0,(function*(){yield this.removeConvertAccountRequired()}))}handleKeyConnectorError(e){throw this.logService.error(e),null!=this.logoutCallback&&this.logoutCallback(!1),new Error("Key Connector error")}}var cb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ub{constructor(e,t,i,n,s,o,r,a){this.syncService=e,this.appIdService=t,this.apiService=i,this.environmentService=n,this.logoutCallback=s,this.logService=o,this.stateService=r,this.authService=a,this.connected=!1,this.inited=!1,this.inactive=!1,this.reconnectTimer=null,this.environmentService.urls.subscribe((()=>{this.inited&&this.init()}))}init(){return cb(this,void 0,void 0,(function*(){this.inited=!1,this.url=this.environmentService.getNotificationsUrl(),"https://-"!==this.url&&(null!=this.signalrConnection&&(this.signalrConnection.off("ReceiveMessage"),this.signalrConnection.off("Heartbeat"),yield this.signalrConnection.stop(),this.connected=!1,this.signalrConnection=null),this.signalrConnection=(new Rv.s).withUrl(this.url+"/hub",{accessTokenFactory:()=>this.apiService.getActiveBearerToken(),skipNegotiation:!0,transport:Jv.n.WebSockets}).withHubProtocol(new Yv.e).build(),this.signalrConnection.on("ReceiveMessage",(e=>this.processNotification(new zv(e)))),this.signalrConnection.on("Heartbeat",(e=>{})),this.signalrConnection.onclose((()=>{this.connected=!1,this.reconnect(!0)})),this.inited=!0,(yield this.isAuthedAndUnlocked())&&(yield this.reconnect(!1)))}))}updateConnection(e=!1){return cb(this,void 0,void 0,(function*(){if(this.inited)try{(yield this.isAuthedAndUnlocked())?yield this.reconnect(e):yield this.signalrConnection.stop()}catch(e){this.logService.error(e.toString())}}))}reconnectFromActivity(){return cb(this,void 0,void 0,(function*(){this.inactive=!1,this.inited&&!this.connected&&(yield this.reconnect(!0))}))}disconnectFromInactivity(){return cb(this,void 0,void 0,(function*(){this.inactive=!0,this.inited&&this.connected&&(yield this.signalrConnection.stop())}))}processNotification(e){return cb(this,void 0,void 0,(function*(){const t=yield this.appIdService.getAppId();if(null==e||e.contextId===t)return;const i=yield this.stateService.getIsAuthenticated(),n=e.payload.userId||e.payload.UserId,s=yield this.stateService.getUserId();if(!i||null==n||n===s)switch(e.type){case Ev.SyncCipherCreate:case Ev.SyncCipherUpdate:yield this.syncService.syncUpsertCipher(e.payload,e.type===Ev.SyncCipherUpdate);break;case Ev.SyncCipherDelete:case Ev.SyncLoginDelete:yield this.syncService.syncDeleteCipher(e.payload);break;case Ev.SyncFolderCreate:case Ev.SyncFolderUpdate:yield this.syncService.syncUpsertFolder(e.payload,e.type===Ev.SyncFolderUpdate);break;case Ev.SyncFolderDelete:yield this.syncService.syncDeleteFolder(e.payload);break;case Ev.SyncVault:case Ev.SyncCiphers:case Ev.SyncSettings:i&&(yield this.syncService.fullSync(!1));break;case Ev.SyncOrgKeys:i&&(yield this.syncService.fullSync(!0),yield this.signalrConnection.stop());break;case Ev.LogOut:i&&this.logoutCallback(!0);break;case Ev.SyncSendCreate:case Ev.SyncSendUpdate:yield this.syncService.syncUpsertSend(e.payload,e.type===Ev.SyncSendUpdate);break;case Ev.SyncSendDelete:yield this.syncService.syncDeleteSend(e.payload)}}))}reconnect(e){return cb(this,void 0,void 0,(function*(){if(null!=this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.connected||!this.inited||this.inactive)return;if(yield this.isAuthedAndUnlocked()){try{yield this.signalrConnection.start(),this.connected=!0,e&&(yield this.syncService.fullSync(!1))}catch(e){this.logService.error(e)}this.connected||(this.reconnectTimer=setTimeout((()=>this.reconnect(e)),this.random(12e4,3e5)))}}))}isAuthedAndUnlocked(){return cb(this,void 0,void 0,(function*(){return(yield this.authService.getAuthStatus())>=Oe.Unlocked}))}random(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}}class db{constructor(e){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useResetPassword=e.useResetPassword,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.isProviderUser=e.isProviderUser,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.planProductType=e.planProductType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete)}get canAccess(){return this.type===ib.Owner||this.enabled&&this.status===Gl.Confirmed}get isManager(){return this.type===ib.Manager||this.type===ib.Owner||this.type===ib.Admin}get isAdmin(){return this.type===ib.Owner||this.type===ib.Admin}get isOwner(){return this.type===ib.Owner||this.isProviderUser}get canAccessEventLogs(){return(this.isAdmin||this.permissions.accessEventLogs)&&this.useEvents}get canAccessImportExport(){return this.isAdmin||this.permissions.accessImportExport}get canAccessReports(){return this.isAdmin||this.permissions.accessReports}get canCreateNewCollections(){var e;return this.isManager||(null!==(e=this.permissions.createNewCollections)&&void 0!==e?e:this.permissions.manageAllCollections)}get canEditAnyCollection(){var e;return this.isAdmin||(null!==(e=this.permissions.editAnyCollection)&&void 0!==e?e:this.permissions.manageAllCollections)}get canDeleteAnyCollection(){var e;return this.isAdmin||(null!==(e=this.permissions.deleteAnyCollection)&&void 0!==e?e:this.permissions.manageAllCollections)}get canViewAllCollections(){return this.canCreateNewCollections||this.canEditAnyCollection||this.canDeleteAnyCollection}get canEditAssignedCollections(){var e;return this.isManager||(null!==(e=this.permissions.editAssignedCollections)&&void 0!==e?e:this.permissions.manageAssignedCollections)}get canDeleteAssignedCollections(){var e;return this.isManager||(null!==(e=this.permissions.deleteAssignedCollections)&&void 0!==e?e:this.permissions.manageAssignedCollections)}get canViewAssignedCollections(){return this.canDeleteAssignedCollections||this.canEditAssignedCollections}get canManageGroups(){return(this.isAdmin||this.permissions.manageGroups)&&this.useGroups}get canManageSso(){return(this.isAdmin||this.permissions.manageSso)&&this.useSso}get 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 isExemptFromPolicies(){return this.canManagePolicies}get canManageBilling(){return this.isOwner&&(this.isProviderUser||!this.hasProvider)}get hasProvider(){return null!=this.providerId||null!=this.providerName}}var hb,pb,gb,vb,yb,fb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class mb{constructor(e){this.stateService=e}get(e){return fb(this,void 0,void 0,(function*(){const t=yield this.stateService.getOrganizations();return null!=t&&t.hasOwnProperty(e)?new db(t[e]):null}))}getByIdentifier(e){return fb(this,void 0,void 0,(function*(){const t=yield this.getAll();return null==t||0===t.length?null:t.find((t=>t.identifier===e))}))}getAll(e){return fb(this,void 0,void 0,(function*(){const t=yield this.stateService.getOrganizations({userId:e}),i=[];for(const e in t)t.hasOwnProperty(e)&&!t[e].isProviderUser&&i.push(new db(t[e]));return i.sort(((e,t)=>e.name.localeCompare(t.name)))}))}save(e){return fb(this,void 0,void 0,(function*(){return yield this.stateService.setOrganizations(e)}))}canManageSponsorships(){return fb(this,void 0,void 0,(function*(){return(yield this.getAll()).some((e=>e.familySponsorshipAvailable||null!==e.familySponsorshipFriendlyName))}))}hasOrganizations(e){return fb(this,void 0,void 0,(function*(){return(yield this.getAll(e)).length>0}))}}!function(e){e[e.None=0]="None",e[e.OpenIdConnect=1]="OpenIdConnect",e[e.Saml2=2]="Saml2"}(hb||(hb={})),function(e){e[e.RedirectGet=0]="RedirectGet",e[e.FormPost=1]="FormPost"}(pb||(pb={})),function(e){e[e.HttpRedirect=1]="HttpRedirect",e[e.HttpPost=2]="HttpPost"}(gb||(gb={})),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"}(vb||(vb={})),function(e){e[e.IfIdpWantAuthnRequestsSigned=0]="IfIdpWantAuthnRequestsSigned",e[e.Always=1]="Always",e[e.Never=3]="Never"}(yb||(yb={}));class wb extends ku{constructor(e=null){super(e),null!=e&&(this.configType=this.getResponseProperty("ConfigType"),this.keyConnectorEnabled=this.getResponseProperty("KeyConnectorEnabled"),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.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"))}static fromView(e,t=new wb){return t.configType=e.configType,t.keyConnectorEnabled=e.keyConnectorEnabled,t.keyConnectorUrl=e.keyConnectorUrl,t.configType===hb.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===hb.Saml2&&(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}}class bb extends ku{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.data=null!=this.getResponseProperty("Data")?new wb(this.getResponseProperty("Data")):null,this.urls=new Sb(this.getResponseProperty("Urls"))}}class Sb extends ku{constructor(e){super(e),this.callbackPath=this.getResponseProperty("CallbackPath"),this.signedOutCallbackPath=this.getResponseProperty("SignedOutCallbackPath"),this.spEntityId=this.getResponseProperty("SpEntityId"),this.spMetadataUrl=this.getResponseProperty("SpMetadataUrl"),this.spAcsUrl=this.getResponseProperty("SpAcsUrl")}}class Ub extends ku{constructor(e){super(e),this.keyType=this.getResponseProperty("KeyType")}}class xb extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.resetPasswordEnabled=this.getResponseProperty("ResetPasswordEnabled")}}class Ab extends ku{constructor(e){super(e),this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey")}}class _b extends Ab{constructor(e){super(e)}}class Zb extends ku{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.identifier=this.getResponseProperty("Identifier"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.businessAddress1=this.getResponseProperty("BusinessAddress1"),this.businessAddress2=this.getResponseProperty("BusinessAddress2"),this.businessAddress3=this.getResponseProperty("BusinessAddress3"),this.businessCountry=this.getResponseProperty("BusinessCountry"),this.businessTaxNumber=this.getResponseProperty("BusinessTaxNumber"),this.billingEmail=this.getResponseProperty("BillingEmail");const t=this.getResponseProperty("Plan");this.plan=null==t?null:new ef(t),this.planType=this.getResponseProperty("PlanType"),this.seats=this.getResponseProperty("Seats"),this.maxAutoscaleSeats=this.getResponseProperty("MaxAutoscaleSeats"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useResetPassword=this.getResponseProperty("UseResetPassword"),this.hasPublicAndPrivateKeys=this.getResponseProperty("HasPublicAndPrivateKeys")}}class Tb extends Zb{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 wf(t);const i=this.getResponseProperty("UpcomingInvoice");this.upcomingInvoice=null==i?null:new Sf(i),this.expiration=this.getResponseProperty("Expiration")}}var Cb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var kb=i(59029);class Ob{constructor(e,t){this.password=e,this.date=t}}class Pb extends at{constructor(){super(...arguments),this.defaultType="",this.minLength=0,this.useUppercase=!1,this.useLowercase=!1,this.useNumbers=!1,this.numberCount=0,this.useSpecial=!1,this.specialCount=0,this.minNumberWords=0,this.capitalize=!1,this.includeNumber=!1}inEffect(){return""!==this.defaultType||this.minLength>0||this.numberCount>0||this.specialCount>0||this.useUppercase||this.useLowercase||this.useNumbers||this.useSpecial||this.minNumberWords>0||this.capitalize||this.includeNumber}}var Ib=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const qb={length:14,ambiguous:!1,number:!0,minNumber:1,uppercase:!0,minUppercase:0,lowercase:!0,minLowercase:0,special:!1,minSpecial:1,type:"password",numWords:3,wordSeparator:"-",capitalize:!1,includeNumber:!1};class Db{constructor(e,t,i){this.cryptoService=e,this.policyService=t,this.stateService=i}generatePassword(e){return Ib(this,void 0,void 0,(function*(){const t=Object.assign({},qb,e);if("passphrase"===t.type)return this.generatePassphrase(e);this.sanitizePasswordLength(t,!0);const i=t.minUppercase+t.minLowercase+t.minNumber+t.minSpecial;t.length0)for(let e=0;e0)for(let e=0;e0)for(let e=0;e0)for(let e=0;e1)&&(t.wordSeparator=" "),null==t.capitalize&&(t.capitalize=!1),null==t.includeNumber&&(t.includeNumber=!1);const i=dw.length-1,n=new Array(t.numWords);for(let e=0;ee.length&&(e.minSpecial=e.length-e.minNumber),e.numWords{e.enabled&&null!=e.data&&(null==t&&(t=new Pb),null!=e.data.defaultType&&"password"!==t.defaultType&&(t.defaultType=e.data.defaultType),null!=e.data.minLength&&e.data.minLength>t.minLength&&(t.minLength=e.data.minLength),e.data.useUpper&&(t.useUppercase=!0),e.data.useLower&&(t.useLowercase=!0),e.data.useNumbers&&(t.useNumbers=!0),null!=e.data.minNumbers&&e.data.minNumbers>t.numberCount&&(t.numberCount=e.data.minNumbers),e.data.useSpecial&&(t.useSpecial=!0),null!=e.data.minSpecial&&e.data.minSpecial>t.specialCount&&(t.specialCount=e.data.minSpecial),null!=e.data.minNumberWords&&e.data.minNumberWords>t.minNumberWords&&(t.minNumberWords=e.data.minNumberWords),e.data.capitalize&&(t.capitalize=!0),e.data.includeNumber&&(t.includeNumber=!0))})),t}))}saveOptions(e){return Ib(this,void 0,void 0,(function*(){yield this.stateService.setPasswordGenerationOptions(e)}))}getHistory(){return Ib(this,void 0,void 0,(function*(){if(!(yield this.cryptoService.hasKey()))return new Array;if(null==(yield this.stateService.getDecryptedPasswordGenerationHistory())){const e=yield this.stateService.getEncryptedPasswordGenerationHistory(),t=yield this.decryptHistory(e);yield this.stateService.setDecryptedPasswordGenerationHistory(t)}const e=yield this.stateService.getDecryptedPasswordGenerationHistory();return null!=e?e:new Array}))}addHistory(e){return Ib(this,void 0,void 0,(function*(){if(!(yield this.cryptoService.hasKey()))return;const t=yield this.getHistory();if(this.matchesPrevious(e,t))return;t.unshift(new Ob(e,Date.now())),t.length>100&&t.pop();const i=yield this.encryptHistory(t);return yield this.stateService.setDecryptedPasswordGenerationHistory(t),yield this.stateService.setEncryptedPasswordGenerationHistory(i)}))}clear(e){return Ib(this,void 0,void 0,(function*(){yield this.stateService.setEncryptedPasswordGenerationHistory(null,{userId:e}),yield this.stateService.setDecryptedPasswordGenerationHistory(null,{userId:e})}))}passwordStrength(e,t=null){if(null==e||0===e.length)return null;let i=["bitwarden","bit","warden"];null!=t&&t.length>0&&(i=i.concat(t));const n=Array.from(new Set(i));return kb(e,n)}normalizeOptions(e,t){e.minLowercase=0,e.minUppercase=0,!e.length||e.length<5?e.length=5:e.length>128&&(e.length=128),e.lengthe.length?e.minNumber=e.length:e.minNumber>9&&(e.minNumber=9):e.minNumber=0,e.minNumbere.length?e.minSpecial=e.length:e.minSpecial>9&&(e.minSpecial=9):e.minSpecial=0,e.minSpeciale.length&&(e.minSpecial=e.length-e.minNumber),null==e.numWords||e.length<3?e.numWords=3:e.numWords>20&&(e.numWords=20),e.numWords1&&(e.wordSeparator=e.wordSeparator[0]),this.sanitizePasswordLength(e,!1)}capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}appendRandomNumberToRandomWord(e){return Ib(this,void 0,void 0,(function*(){if(null==e||e.length<=0)return;const t=yield this.cryptoService.randomNumber(0,e.length-1),i=yield this.cryptoService.randomNumber(0,9);e[t]=e[t]+i}))}encryptHistory(e){return Ib(this,void 0,void 0,(function*(){if(null==e||0===e.length)return Promise.resolve([]);const t=e.map((e=>Ib(this,void 0,void 0,(function*(){const t=yield this.cryptoService.encrypt(e.password);return new Ob(t.encryptedString,e.date)}))));return yield Promise.all(t)}))}decryptHistory(e){return Ib(this,void 0,void 0,(function*(){if(null==e||0===e.length)return Promise.resolve([]);const t=e.map((e=>Ib(this,void 0,void 0,(function*(){const t=yield this.cryptoService.decryptToUtf8(new ot(e.password));return new Ob(t,e.date)}))));return yield Promise.all(t)}))}matchesPrevious(e,t){return null!=t&&0!==t.length&&t[t.length-1].password===e}shuffleArray(e){return Ib(this,void 0,void 0,(function*(){for(let t=e.length-1;t>0;t--){const i=yield this.cryptoService.randomNumber(0,t);[e[t],e[i]]=[e[i],e[t]]}}))}sanitizePasswordLength(e,t){let i=0,n=0,s=e.minNumber,o=e.minSpecial;e.uppercase&&e.minUppercase<=0?i=1:e.uppercase||(i=0),e.lowercase&&e.minLowercase<=0?n=1:e.lowercase||(n=0),e.number&&e.minNumber<=0?s=1:e.number||(s=0),e.special&&e.minSpecial<=0?o=1:e.special||(o=0),(!e.length||e.length<1)&&(e.length=10);const r=i+n+s+o;e.lengtht.type===e)):i}))}getMasterPasswordPolicyOptions(e){return Yb(this,void 0,void 0,(function*(){let t=null;return null==(e=null==e?yield this.getAll(qs.MasterPassword):e.filter((e=>e.type===qs.MasterPassword)))||0===e.length||e.forEach((e=>{e.enabled&&null!=e.data&&(null==t&&(t=new lt),null!=e.data.minComplexity&&e.data.minComplexity>t.minComplexity&&(t.minComplexity=e.data.minComplexity),null!=e.data.minLength&&e.data.minLength>t.minLength&&(t.minLength=e.data.minLength),e.data.requireUpper&&(t.requireUpper=!0),e.data.requireLower&&(t.requireLower=!0),e.data.requireNumbers&&(t.requireNumbers=!0),e.data.requireSpecial&&(t.requireSpecial=!0))})),t}))}evaluateMasterPassword(e,t,i){return null==i||!(i.minComplexity>0&&i.minComplexity>e)&&(!(i.minLength>0&&i.minLength>t.length)&&((!i.requireUpper||t.toLocaleLowerCase()!==t)&&((!i.requireLower||t.toLocaleUpperCase()!==t)&&(!(i.requireNumbers&&!/[0-9]/.test(t))&&!(i.requireSpecial&&!/[!@#$%\^&*]/g.test(t))))))}getResetPasswordPolicyOptions(e,t){var i,n,s;const o=new Eb;if(null==e||null==t)return[o,!1];const r=e.find((e=>e.organizationId===t&&e.type===qs.ResetPassword&&e.enabled));return o.autoEnrollEnabled=null!==(n=null===(i=null==r?void 0:r.data)||void 0===i?void 0:i.autoEnrollEnabled)&&void 0!==n&&n,[o,null!==(s=null==r?void 0:r.enabled)&&void 0!==s&&s]}mapPoliciesFromToken(e){if(null==e||null==e.data)return null;return e.data.map((e=>new Mb(e))).map((e=>new Fb(e)))}policyAppliesToUser(e,t,i){return Yb(this,void 0,void 0,(function*(){const n=yield this.getAll(e,i),s=yield this.organizationService.getAll(i);let o;o=null!=t?n.filter((e=>e.enabled&&t(e))):n.filter((e=>e.enabled));const r=new Set(o.map((e=>e.organizationId)));return s.some((t=>t.enabled&&t.status>=Gl.Accepted&&t.usePolicies&&!this.isExcemptFromPolicies(t,e)&&r.has(t.id)))}))}upsert(e){return Yb(this,void 0,void 0,(function*(){let t=yield this.stateService.getEncryptedPolicies();null==t&&(t={}),t[e.id]=e,yield this.stateService.setDecryptedPolicies(null),yield this.stateService.setEncryptedPolicies(t)}))}replace(e){return Yb(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedPolicies(null),yield this.stateService.setEncryptedPolicies(e)}))}clear(e){return Yb(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedPolicies(null,{userId:e}),yield this.stateService.setEncryptedPolicies(null,{userId:e})}))}isExcemptFromPolicies(e,t){return t===qs.MaximumVaultTimeout?e.type===ib.Owner:e.isExemptFromPolicies}}!function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(Rb||(Rb={})),function(e){e[e.ProviderAdmin=0]="ProviderAdmin",e[e.ServiceUser=1]="ServiceUser"}(Jb||(Jb={}));class Kb{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)}get canAccess(){return!!this.isProviderAdmin||this.enabled&&this.status===Rb.Confirmed}get canCreateOrganizations(){return this.enabled&&this.isProviderAdmin}get canManageUsers(){return this.isProviderAdmin}get canAccessEventLogs(){return this.isProviderAdmin}get isProviderAdmin(){return this.type===Jb.ProviderAdmin}}var Bb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Gb{constructor(e){this.stateService=e}get(e){return Bb(this,void 0,void 0,(function*(){const t=yield this.stateService.getProviders();return null!=t&&t.hasOwnProperty(e)?new Kb(t[e]):null}))}getAll(){return Bb(this,void 0,void 0,(function*(){const e=yield this.stateService.getProviders(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new Kb(e[i]));return t}))}save(e){return Bb(this,void 0,void 0,(function*(){yield this.stateService.setProviders(e)}))}}var Qb=i(58626),Vb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Hb{constructor(e,t,i){this.cipherService=e,this.logService=t,this.i18nService=i,this.indexedEntityId=null,this.indexing=!1,this.index=null,this.immediateSearchLocales=["zh-CN","zh-TW","ja","ko","vi"],this.defaultSearchableMinLength=2,this.searchableMinLength=this.defaultSearchableMinLength,this.i18nService.locale$.subscribe((e=>{-1!==this.immediateSearchLocales.indexOf(e)?this.searchableMinLength=1:this.searchableMinLength=this.defaultSearchableMinLength})),Hb.registeredPipeline||(Hb.registeredPipeline=!0,Qb.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction,"normalizeAccents"))}clearIndex(){this.indexedEntityId=null,this.index=null}isSearchable(e){return!(null==(e=Hb.normalizeSearchQuery(e))||null==this.index&&e.length"))}indexCiphers(e,t){return Vb(this,void 0,void 0,(function*(){if(this.indexing)return;this.indexing=!0,this.indexedEntityId=e,this.index=null;const i=new Qb.Builder;i.pipeline.add(this.normalizeAccentsPipelineFunction),i.ref("id"),i.field("shortid",{boost:100,extractor:e=>e.id.substr(0,8)}),i.field("name",{boost:10}),i.field("subtitle",{boost:5,extractor:e=>null!=e.subTitle&&e.type===Bl.Card?e.subTitle.replace(/\*/g,""):e.subTitle}),i.field("notes"),i.field("login.username",{extractor:e=>e.type===Bl.Login&&null!=e.login?e.login.username:null}),i.field("login.uris",{boost:2,extractor:e=>this.uriExtractor(e)}),i.field("fields",{extractor:e=>this.fieldExtractor(e,!1)}),i.field("fields_joined",{extractor:e=>this.fieldExtractor(e,!0)}),i.field("attachments",{extractor:e=>this.attachmentExtractor(e,!1)}),i.field("attachments_joined",{extractor:e=>this.attachmentExtractor(e,!0)}),i.field("organizationid",{extractor:e=>e.organizationId}),(t=t||(yield this.cipherService.getAllDecrypted())).forEach((e=>i.add(e))),this.index=i.build(),this.indexing=!1,this.logService.info("Finished search indexing")}))}searchCiphers(e,t=null,i=null){return Vb(this,void 0,void 0,(function*(){const n=[];if(null!=e&&(e=Hb.normalizeSearchQuery(e.trim().toLowerCase())),""===e&&(e=null),null==i&&(i=yield this.cipherService.getAllDecrypted()),null!=t&&Array.isArray(t)&&t.length>0?i=i.filter((e=>t.every((t=>null==t||t(e))))):null!=t&&(i=i.filter(t)),!this.isSearchable(e))return i;this.indexing&&(yield new Promise((e=>setTimeout(e,250))),this.indexing&&(yield new Promise((e=>setTimeout(e,500)))));const s=this.getIndexForSearch();if(null==s)return this.searchCiphersBasic(i,e);const o=new Map;i.forEach((e=>o.set(e.id,e)));let r=null;if(null!=e&&e.length>1&&0===e.indexOf(">"))try{r=s.search(e.substr(1).trim())}catch(e){this.logService.error(e)}else{const t=Qb.Query.wildcard.LEADING|Qb.Query.wildcard.TRAILING;r=s.query((i=>{Qb.tokenizer(e).forEach((e=>{const n=e.toString();i.term(n,{fields:["name"],wildcard:t}),i.term(n,{fields:["subtitle"],wildcard:t}),i.term(n,{fields:["login.uris"],wildcard:t}),i.term(n,{})}))}))}return null!=r&&r.forEach((e=>{o.has(e.ref)&&n.push(o.get(e.ref))})),n}))}searchCiphersBasic(e,t,i=!1){return t=Hb.normalizeSearchQuery(t.trim().toLowerCase()),e.filter((e=>i===e.isDeleted&&(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1||(!!(t.length>=8&&e.id.startsWith(t))||(null!=e.subTitle&&e.subTitle.toLowerCase().indexOf(t)>-1||!!(e.login&&e.login.hasUris&&e.login.uris.some((e=>{var i;return(null===(i=null==e?void 0:e.uri)||void 0===i?void 0:i.toLowerCase().indexOf(t))>-1}))))))))}searchSends(e,t){if(null===(t=Hb.normalizeSearchQuery(t.trim().toLocaleLowerCase())))return e;const i=[],n=[];return e.forEach((e=>{var s,o,r;null!=e.name&&e.name.toLowerCase().indexOf(t)>-1?i.push(e):(t.length>=8&&(e.id.startsWith(t)||e.accessId.toLocaleLowerCase().startsWith(t)||null!=(null===(s=e.file)||void 0===s?void 0:s.id)&&e.file.id.startsWith(t))||null!=e.notes&&e.notes.toLowerCase().indexOf(t)>-1||null!=(null===(o=e.text)||void 0===o?void 0:o.text)&&e.text.text.toLowerCase().indexOf(t)>-1||null!=(null===(r=e.file)||void 0===r?void 0:r.fileName)&&e.file.fileName.toLowerCase().indexOf(t)>-1)&&n.push(e)})),i.concat(n)}getIndexForSearch(){return this.index}fieldExtractor(e,t){if(!e.hasFields)return null;let i=[];return e.fields.forEach((e=>{null!=e.name&&i.push(e.name),e.type===_c.Text&&null!=e.value&&i.push(e.value)})),i=i.filter((e=>""!==e.trim())),0===i.length?null:t?i.join(" "):i}attachmentExtractor(e,t){if(!e.hasAttachments)return null;let i=[];return e.attachments.forEach((e=>{null!=e&&null!=e.fileName&&(t&&e.fileName.indexOf(".")>-1?i.push(e.fileName.substr(0,e.fileName.lastIndexOf("."))):i.push(e.fileName))})),i=i.filter((e=>""!==e.trim())),0===i.length?null:t?i.join(" "):i}uriExtractor(e){if(e.type!==Bl.Login||null==e.login||!e.login.hasUris)return null;const t=[];return e.login.uris.forEach((e=>{if(null==e.uri||""===e.uri)return;if(null!=e.hostname)return void t.push(e.hostname);let i=e.uri;if(e.match!==ka.RegularExpression){const e=i.indexOf("://");e>-1&&(i=i.substr(e+3));const t=i.search(/\?|&|#/);t>-1&&(i=i.substring(0,t))}t.push(i)})),t.length>0?t:null}normalizeAccentsPipelineFunction(e){const t=["name","login.username","subtitle","notes"];return e.metadata.fields.every((e=>t.includes(e)))?Hb.normalizeSearchQuery(e.toString()):e}static normalizeSearchQuery(e){return null==e?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}}Hb.registeredPipeline=!1;class jb{constructor(e){null!=e&&(this.id=e.id,this.fileName=e.fileName,this.size=e.size,this.sizeName=e.sizeName)}}class Wb{constructor(e){null!=e&&(this.text=e.text,this.hidden=e.hidden)}}class $b{constructor(e){if(null!=e)switch(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.name=e.name,this.notes=e.notes,this.key=e.key,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.expirationDate=e.expirationDate,this.deletionDate=e.deletionDate,this.password=e.password,this.disabled=e.disable,this.hideEmail=e.hideEmail,this.type){case Ds.Text:this.text=new Wb(e.text);break;case Ds.File:this.file=new jb(e.file)}}}var Xb=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class eS extends at{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,sizeName:null,fileName:null},["id","sizeName"]))}decrypt(e){return Xb(this,void 0,void 0,(function*(){return yield this.decryptObj(new Js(this),{fileName:null},null,e)}))}}class tS extends at{constructor(e){super(),null!=e&&(this.hidden=e.hidden,this.buildDomainModel(this,e,{text:null},[]))}decrypt(e){return this.decryptObj(new Ys(this),{text:null},null,e)}}var iS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class nS extends at{constructor(e){if(super(),null!=e)switch(this.buildDomainModel(this,e,{id:null,accessId:null,name:null,notes:null,key:null},["id","accessId"]),this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.password=e.password,this.disabled=e.disabled,this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null,this.deletionDate=null!=e.deletionDate?new Date(e.deletionDate):null,this.expirationDate=null!=e.expirationDate?new Date(e.expirationDate):null,this.hideEmail=e.hideEmail,this.type){case Ds.Text:this.text=new tS(e.text);break;case Ds.File:this.file=new eS(e.file)}}decrypt(){return iS(this,void 0,void 0,(function*(){const e=new zs(this),t=nt.getContainerService().getCryptoService();try{e.key=yield t.decryptToBytes(this.key,null),e.cryptoKey=yield t.makeSendKey(e.key)}catch(e){}switch(yield this.decryptObj(e,{name:null,notes:null},null,e.cryptoKey),this.type){case Ds.File:e.file=yield this.file.decrypt(e.cryptoKey);break;case Ds.Text:e.text=yield this.text.decrypt(e.cryptoKey)}return e}))}}class sS{constructor(e,t){switch(this.type=e.type,this.fileLength=t,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.maxAccessCount=e.maxAccessCount,this.expirationDate=null!=e.expirationDate?e.expirationDate.toISOString():null,this.deletionDate=null!=e.deletionDate?e.deletionDate.toISOString():null,this.key=null!=e.key?e.key.encryptedString:null,this.password=e.password,this.disabled=e.disabled,this.hideEmail=e.hideEmail,this.type){case Ds.Text:this.text=new hf,this.text.text=null!=e.text.text?e.text.text.encryptedString:null,this.text.hidden=e.text.hidden;break;case Ds.File:this.file=new df,this.file.fileName=null!=e.file.fileName?e.file.fileName.encryptedString:null}}}var oS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class rS{constructor(e,t,i,n,s,o){this.cryptoService=e,this.apiService=t,this.fileUploadService=i,this.i18nService=n,this.cryptoFunctionService=s,this.stateService=o}clearCache(){return oS(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedSends(null)}))}encrypt(e,t,i,n){return oS(this,void 0,void 0,(function*(){let s=null;const o=new nS;if(o.id=e.id,o.type=e.type,o.disabled=e.disabled,o.hideEmail=e.hideEmail,o.maxAccessCount=e.maxAccessCount,null==e.key&&(e.key=yield this.cryptoFunctionService.randomBytes(16),e.cryptoKey=yield this.cryptoService.makeSendKey(e.key)),null!=i){const t=yield this.cryptoFunctionService.pbkdf2(i,e.key,"sha256",1e5);o.password=nt.fromBufferToB64(t)}if(o.key=yield this.cryptoService.encrypt(e.key,n),o.name=yield this.cryptoService.encrypt(e.name,e.cryptoKey),o.notes=yield this.cryptoService.encrypt(e.notes,e.cryptoKey),o.type===Ds.Text)o.text=new tS,o.text.text=yield this.cryptoService.encrypt(e.text.text,e.cryptoKey),o.text.hidden=e.text.hidden;else if(o.type===Ds.File&&(o.file=new eS,null!=t))if(t instanceof ArrayBuffer){const[i,n]=yield this.encryptFileData(e.file.fileName,t,e.cryptoKey);o.file.fileName=i,s=n}else s=yield this.parseFile(o,t,e.cryptoKey);return[o,s]}))}get(e){return oS(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedSends();return null!=t&&t.hasOwnProperty(e)?new nS(t[e]):null}))}getAll(){return oS(this,void 0,void 0,(function*(){const e=yield this.stateService.getEncryptedSends(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new nS(e[i]));return t}))}getAllDecrypted(){return oS(this,void 0,void 0,(function*(){let e=yield this.stateService.getDecryptedSends();if(null!=e)return e;e=[];if(!(yield this.cryptoService.hasKey()))throw new Error("No key.");const t=[];return(yield this.getAll()).forEach((i=>{t.push(i.decrypt().then((t=>e.push(t))))})),yield Promise.all(t),e.sort(nt.getSortFunction(this.i18nService,"name")),yield this.stateService.setDecryptedSends(e),e}))}saveWithServer(e){var t;return oS(this,void 0,void 0,(function*(){const i=new sS(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===Ds.Text)n=yield this.apiService.postSend(i);else try{const t=yield this.apiService.postFileTypeSend(i);n=t.sendResponse,yield this.fileUploadService.uploadSendFile(t,e[0].file.fileName,e[1])}catch(t){if(!(t instanceof Ou&&404===t.statusCode))throw t instanceof Ou?new Error(t.getSingleMessage()):t;n=yield this.legacyServerSendFileUpload(e,i)}e[0].id=n.id,e[0].accessId=n.accessId}else n=yield this.apiService.putSend(e[0].id,i);const s=new $b(n);yield this.upsert(s)}))}legacyServerSendFileUpload(e,t){return oS(this,void 0,void 0,(function*(){const i=new FormData;try{const n=new Blob([e[1].buffer],{type:"application/octet-stream"});i.append("model",JSON.stringify(t)),i.append("data",n,e[0].file.fileName.encryptedString)}catch(n){if(!nt.isNode||nt.isBrowser)throw n;i.append("model",JSON.stringify(t)),i.append("data",Buffer.from(e[1].buffer),{filepath:e[0].file.fileName.encryptedString,contentType:"application/octet-stream"})}return yield this.apiService.postSendFileLegacy(i)}))}upsert(e){return oS(this,void 0,void 0,(function*(){let t=yield this.stateService.getEncryptedSends();if(null==t&&(t={}),e instanceof $b){const i=e;t[i.id]=i}else e.forEach((e=>{t[e.id]=e}));yield this.replace(t)}))}replace(e){return oS(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedSends(null),yield this.stateService.setEncryptedSends(e)}))}clear(){return oS(this,void 0,void 0,(function*(){yield this.stateService.setDecryptedSends(null),yield this.stateService.setEncryptedSends(null)}))}delete(e){return oS(this,void 0,void 0,(function*(){const t=yield this.stateService.getEncryptedSends();if(null!=t){if("string"==typeof e){if(null==t[e])return;delete t[e]}else e.forEach((e=>{delete t[e]}));yield this.replace(t)}}))}deleteWithServer(e){return oS(this,void 0,void 0,(function*(){yield this.apiService.deleteSend(e),yield this.delete(e)}))}removePasswordWithServer(e){return oS(this,void 0,void 0,(function*(){const t=yield this.apiService.putSendRemovePassword(e),i=new $b(t);yield this.upsert(i)}))}parseFile(e,t,i){return new Promise(((n,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>oS(this,void 0,void 0,(function*(){try{const[s,r]=yield this.encryptFileData(t.name,o.target.result,i);e.file.fileName=s,n(r)}catch(e){s(e)}})),o.onerror=()=>{s("Error reading file.")}}))}encryptFileData(e,t,i){return oS(this,void 0,void 0,(function*(){return[yield this.cryptoService.encrypt(e,i),yield this.cryptoService.encryptToBytes(t,i)]}))}}var aS,lS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cS{constructor(e){this.stateService=e,this._settings=new sv.X({}),this.settings$=this._settings.asObservable(),this.stateService.activeAccountUnlocked$.pipe((0,Ge.b)((e=>lS(this,void 0,void 0,(function*(){if(null==nt.global.bitwardenContainerService)return;if(!e)return void this._settings.next({});const t=yield this.stateService.getSettings();this._settings.next(t)}))))).subscribe()}setEquivalentDomains(e){var t;return lS(this,void 0,void 0,(function*(){const i=null!==(t=this._settings.getValue())&&void 0!==t?t:{};i.equivalentDomains=e,this._settings.next(i),yield this.stateService.setSettings(i)}))}clear(e){return lS(this,void 0,void 0,(function*(){null!=e&&e!=(yield this.stateService.getUserId())||this._settings.next({}),yield this.stateService.setSettings(null,{userId:e})}))}}!function(e){e.Both="both",e.Disk="disk",e.Memory="memory"}(aS||(aS={}));class uS{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}}class dS{constructor(e){this.accounts={},this.authenticatedAccounts=[],this.accountActivity={},this.globals=e}static fromJSON(e){return null==e?null:Object.assign(new dS(null),e,{accounts:dS.buildAccountMapFromJSON(null==e?void 0:e.accounts)})}static buildAccountMapFromJSON(e){if(!e)return{};const t={};for(const i in e)t[i]=Mv.fromJSON(e[i]);return t}}var hS=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},pS=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const vS="state",yS="global",fS="authenticatedAccounts",mS="activeUserId",wS="tempAccountSettings",bS="accountActivity",SS="_masterkey_auto",US="_masterkey_biometric",xS="_masterkey",AS="DuckDuckGoSharedKey";class _S{constructor(e,t,i,n,s,o,r=!0){this.storageService=e,this.secureStorageService=t,this.memoryStorageService=i,this.logService=n,this.stateMigrationService=s,this.stateFactory=o,this.useAccountCache=r,this.accounts=new sv.X({}),this.activeAccountSubject=new sv.X(null),this.activeAccount$=this.activeAccountSubject.asObservable(),this.activeAccountUnlockedSubject=new sv.X(!1),this.activeAccountUnlocked$=this.activeAccountUnlockedSubject.asObservable(),this.hasBeenInited=!1,this.isRecoveredSession=!1,this.accountDiskCache=new Map,this.activeAccountSubject.pipe((0,Ge.b)((e=>gS(this,void 0,void 0,(function*(){null==e&&0==this.activeAccountUnlockedSubject.getValue()||(null==e&&this.activeAccountUnlockedSubject.next(!1),this.activeAccountUnlockedSubject.next(null!=(yield this.getCryptoMasterKey())))}))))).subscribe()}init(){return gS(this,void 0,void 0,(function*(){this.hasBeenInited||((yield this.stateMigrationService.needsMigration())&&(yield this.stateMigrationService.migrate()),yield this.state().then((e=>gS(this,void 0,void 0,(function*(){null==e?yield this.setState(new dS(this.createGlobals())):this.isRecoveredSession=!0})))),yield this.initAccountState(),this.hasBeenInited=!0)}))}initAccountState(){return gS(this,void 0,void 0,(function*(){this.isRecoveredSession||(yield this.updateState((e=>gS(this,void 0,void 0,(function*(){var t;e.authenticatedAccounts=null!==(t=yield this.storageService.get(fS))&&void 0!==t?t:[];for(const t in e.authenticatedAccounts)null!=t&&(yield this.syncAccountFromDisk(e.authenticatedAccounts[t]));const i=yield this.storageService.get(mS);return null!=i&&(e.activeUserId=i),yield this.pushAccounts(),this.activeAccountSubject.next(e.activeUserId),e})))))}))}syncAccountFromDisk(e){return gS(this,void 0,void 0,(function*(){null!=e&&(yield this.updateState((t=>gS(this,void 0,void 0,(function*(){null==t.accounts&&(t.accounts={}),t.accounts[e]=this.createAccount();const i=yield this.getAccountFromDisk({userId:e});return t.accounts[e].profile=i.profile,t})))))}))}addAccount(e){return gS(this,void 0,void 0,(function*(){e=yield this.setAccountEnvironmentUrls(e),yield this.updateState((t=>gS(this,void 0,void 0,(function*(){return t.authenticatedAccounts.push(e.profile.userId),yield this.storageService.save(fS,t.authenticatedAccounts),t.accounts[e.profile.userId]=e,t})))),yield this.scaffoldNewAccountStorage(e),yield this.setLastActive((new Date).getTime(),{userId:e.profile.userId}),yield this.setActiveUser(e.profile.userId),this.activeAccountSubject.next(e.profile.userId)}))}setActiveUser(e){return gS(this,void 0,void 0,(function*(){this.clearDecryptedDataForActiveUser(),yield this.updateState((t=>gS(this,void 0,void 0,(function*(){return t.activeUserId=e,yield this.storageService.save(mS,e),this.activeAccountSubject.next(t.activeUserId),t})))),yield this.pushAccounts()}))}clean(e){var t;return gS(this,void 0,void 0,(function*(){e=this.reconcileOptions(e,yield this.defaultInMemoryOptions()),yield this.deAuthenticateAccount(e.userId),e.userId===(null===(t=yield this.state())||void 0===t?void 0:t.activeUserId)&&(yield this.dynamicallySetActiveUser()),yield this.removeAccountFromDisk(null==e?void 0:e.userId),this.removeAccountFromMemory(null==e?void 0:e.userId),yield this.pushAccounts()}))}getAccessToken(e){var t,i;return gS(this,void 0,void 0,(function*(){return e=yield this.getTimeoutBasedStorageOptions(e),null===(i=null===(t=yield this.getAccount(e))||void 0===t?void 0:t.tokens)||void 0===i?void 0:i.accessToken}))}setAccessToken(e,t){return gS(this,void 0,void 0,(function*(){t=yield this.getTimeoutBasedStorageOptions(t);const i=yield this.getAccount(t);i.tokens.accessToken=e,yield this.saveAccount(i,t)}))}getAddEditCipherInfo(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.addEditCipherInfo}))}setAddEditCipherInfo(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.addEditCipherInfo=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getAlwaysShowDock(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.alwaysShowDock)&&void 0!==i&&i}))}setAlwaysShowDock(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.alwaysShowDock=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getApiKeyClientId(e){var t,i;return gS(this,void 0,void 0,(function*(){return e=yield this.getTimeoutBasedStorageOptions(e),null===(i=null===(t=yield this.getAccount(e))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.apiKeyClientId}))}setApiKeyClientId(e,t){return gS(this,void 0,void 0,(function*(){t=yield this.getTimeoutBasedStorageOptions(t);const i=yield this.getAccount(t);i.profile.apiKeyClientId=e,yield this.saveAccount(i,t)}))}getApiKeyClientSecret(e){var t,i;return gS(this,void 0,void 0,(function*(){return e=yield this.getTimeoutBasedStorageOptions(e),null===(i=null===(t=yield this.getAccount(e))||void 0===t?void 0:t.keys)||void 0===i?void 0:i.apiKeyClientSecret}))}setApiKeyClientSecret(e,t){return gS(this,void 0,void 0,(function*(){t=yield this.getTimeoutBasedStorageOptions(t);const i=yield this.getAccount(t);i.keys.apiKeyClientSecret=e,yield this.saveAccount(i,t)}))}getAutoConfirmFingerPrints(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.autoConfirmFingerPrints)&&void 0!==n&&n}))}setAutoConfirmFingerprints(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.autoConfirmFingerPrints=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getAutoFillOnPageLoadDefault(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.autoFillOnPageLoadDefault)||void 0===n||n}))}setAutoFillOnPageLoadDefault(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.autoFillOnPageLoadDefault=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getBiometricAwaitingAcceptance(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.biometricAwaitingAcceptance)&&void 0!==i&&i}))}setBiometricAwaitingAcceptance(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.biometricAwaitingAcceptance=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getBiometricFingerprintValidated(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.biometricFingerprintValidated)&&void 0!==i&&i}))}setBiometricFingerprintValidated(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.biometricFingerprintValidated=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getBiometricText(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.biometricText}))}setBiometricText(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.biometricText=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getBiometricUnlock(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.biometricUnlock)&&void 0!==n&&n}))}setBiometricUnlock(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.biometricUnlock=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getCanAccessPremium(e){return gS(this,void 0,void 0,(function*(){return!!(yield this.getIsAuthenticated(e))&&((yield this.getHasPremiumPersonally(e))||(yield this.getHasPremiumFromOrganization(e)))}))}getHasPremiumPersonally(e){var t;return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions()));return null===(t=null==i?void 0:i.profile)||void 0===t?void 0:t.hasPremiumPersonally}))}setHasPremiumPersonally(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.hasPremiumPersonally=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getHasPremiumFromOrganization(e){var t;return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions()));if(null===(t=i.profile)||void 0===t?void 0:t.hasPremiumFromOrganization)return!0;const n=yield this.getOrganizations(e);if(null==n)return!1;for(const e of Object.keys(n)){const t=n[e];if(t.enabled&&t.usersGetPremium&&!t.isProviderUser)return!0}return!1}))}setHasPremiumFromOrganization(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.hasPremiumFromOrganization=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getClearClipboard(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.clearClipboard)&&void 0!==n?n:null}))}setClearClipboard(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.clearClipboard=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getCollapsedGroupings(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.collapsedGroupings}))}setCollapsedGroupings(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.collapsedGroupings=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getConvertAccountToKeyConnector(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.convertAccountToKeyConnector}))}setConvertAccountToKeyConnector(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.convertAccountToKeyConnector=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getCryptoMasterKey(e){var t;return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions()));return null===(t=null==i?void 0:i.keys)||void 0===t?void 0:t.cryptoMasterKey}))}setCryptoMasterKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));if(i.keys.cryptoMasterKey=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions())),t.userId==this.activeAccountSubject.getValue()){const t=null!=e;this.activeAccountUnlockedSubject.getValue()!=t&&this.activeAccountUnlockedSubject.next(t)}}))}getCryptoMasterKeyAuto(e){return gS(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"auto"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${e.userId}${SS}`,e)}))}setCryptoMasterKeyAuto(e,t){return gS(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"auto"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(SS,e,t))}))}getCryptoMasterKeyB64(e){return gS(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(e,yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${null==e?void 0:e.userId}${xS}`,e)}))}setCryptoMasterKeyB64(e,t){return gS(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(t,yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(xS,e,t))}))}getCryptoMasterKeyBiometric(e){return gS(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(`${e.userId}${US}`,e)}))}hasCryptoMasterKeyBiometric(e){return gS(this,void 0,void 0,(function*(){return null!=(null==(e=this.reconcileOptions(this.reconcileOptions(e,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:e.userId)&&(yield this.secureStorageService.has(`${e.userId}${US}`,e))}))}setCryptoMasterKeyBiometric(e,t){return gS(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(this.reconcileOptions(t,{keySuffix:"biometric"}),yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(yield this.saveSecureStorageKey(US,e,t))}))}getDecryptedCiphers(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.ciphers)||void 0===n?void 0:n.decrypted}))}setDecryptedCiphers(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.ciphers.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedCollections(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.collections)||void 0===n?void 0:n.decrypted}))}setDecryptedCollections(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.collections.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedCryptoSymmetricKey(e){var t,i;return gS(this,void 0,void 0,(function*(){const n=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions()));return null===(i=null===(t=null==n?void 0:n.keys)||void 0===t?void 0:t.cryptoSymmetricKey)||void 0===i?void 0:i.decrypted}))}setDecryptedCryptoSymmetricKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.keys.cryptoSymmetricKey.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedOrganizationKeys(e){var t,i;return gS(this,void 0,void 0,(function*(){const n=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions()));return this.recordToMap(null===(i=null===(t=null==n?void 0:n.keys)||void 0===t?void 0:t.organizationKeys)||void 0===i?void 0:i.decrypted)}))}setDecryptedOrganizationKeys(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.keys.organizationKeys.decrypted=this.mapToRecord(e),yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedPasswordGenerationHistory(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.passwordGenerationHistory)||void 0===n?void 0:n.decrypted}))}setDecryptedPasswordGenerationHistory(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.passwordGenerationHistory.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedPinProtected(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinProtected)||void 0===n?void 0:n.decrypted}))}setDecryptedPinProtected(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.settings.pinProtected.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedPolicies(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.policies)||void 0===n?void 0:n.decrypted}))}setDecryptedPolicies(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.policies.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedPrivateKey(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.keys)||void 0===i?void 0:i.privateKey.decrypted}))}setDecryptedPrivateKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.keys.privateKey.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedProviderKeys(e){var t,i;return gS(this,void 0,void 0,(function*(){const n=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions()));return this.recordToMap(null===(i=null===(t=null==n?void 0:n.keys)||void 0===t?void 0:t.providerKeys)||void 0===i?void 0:i.decrypted)}))}setDecryptedProviderKeys(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.keys.providerKeys.decrypted=this.mapToRecord(e),yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDecryptedSends(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.sends)||void 0===n?void 0:n.decrypted}))}setDecryptedSends(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.data.sends.decrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getDefaultUriMatch(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.defaultUriMatch}))}setDefaultUriMatch(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.defaultUriMatch=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableAddLoginNotification(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableAddLoginNotification)&&void 0!==n&&n}))}setDisableAddLoginNotification(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableAddLoginNotification=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableAutoBiometricsPrompt(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableAutoBiometricsPrompt)&&void 0!==n&&n}))}setDisableAutoBiometricsPrompt(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableAutoBiometricsPrompt=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableAutoTotpCopy(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableAutoTotpCopy)&&void 0!==n&&n}))}setDisableAutoTotpCopy(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableAutoTotpCopy=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableBadgeCounter(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableBadgeCounter)&&void 0!==n&&n}))}setDisableBadgeCounter(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableBadgeCounter=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableChangedPasswordNotification(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableChangedPasswordNotification)&&void 0!==n&&n}))}setDisableChangedPasswordNotification(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableChangedPasswordNotification=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableContextMenuItem(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableContextMenuItem)&&void 0!==n&&n}))}setDisableContextMenuItem(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableContextMenuItem=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDisableFavicon(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.disableFavicon)&&void 0!==i&&i}))}setDisableFavicon(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.disableFavicon=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getDisableGa(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.disableGa)&&void 0!==n&&n}))}setDisableGa(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.disableGa=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDontShowCardsCurrentTab(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.dontShowCardsCurrentTab)&&void 0!==n&&n}))}setDontShowCardsCurrentTab(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.dontShowCardsCurrentTab=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDontShowIdentitiesCurrentTab(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.dontShowIdentitiesCurrentTab)&&void 0!==n&&n}))}setDontShowIdentitiesCurrentTab(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.dontShowIdentitiesCurrentTab=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getDuckDuckGoSharedKey(e){return gS(this,void 0,void 0,(function*(){return null==(null==(e=this.reconcileOptions(e,yield this.defaultSecureStorageOptions()))?void 0:e.userId)?null:yield this.secureStorageService.get(AS,e)}))}setDuckDuckGoSharedKey(e,t){return gS(this,void 0,void 0,(function*(){null!=(null==(t=this.reconcileOptions(t,yield this.defaultSecureStorageOptions()))?void 0:t.userId)&&(null==e?yield this.secureStorageService.remove(AS,t):yield this.secureStorageService.save(AS,e,t))}))}getEmail(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.email}))}setEmail(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.profile.email=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getEmailVerified(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile.emailVerified)&&void 0!==i&&i}))}setEmailVerified(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.emailVerified=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableAlwaysOnTop(e){var t,i,n,s;return gS(this,void 0,void 0,(function*(){const o=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.enableAlwaysOnTop,r=null===(n=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===n?void 0:n.enableAlwaysOnTop;return null!==(s=null!=o?o:r)&&void 0!==s&&s}))}setEnableAlwaysOnTop(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.enableAlwaysOnTop=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()));const n=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));n.enableAlwaysOnTop=e,yield this.saveGlobals(n,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableAutoFillOnPageLoad(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.enableAutoFillOnPageLoad)&&void 0!==n&&n}))}setEnableAutoFillOnPageLoad(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.enableAutoFillOnPageLoad=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableBiometric(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableBiometrics)&&void 0!==i&&i}))}setEnableBiometric(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableBiometrics=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableBrowserIntegration(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableBrowserIntegration)&&void 0!==i&&i}))}setEnableBrowserIntegration(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableBrowserIntegration=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableBrowserIntegrationFingerprint(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableBrowserIntegrationFingerprint)&&void 0!==i&&i}))}setEnableBrowserIntegrationFingerprint(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableBrowserIntegrationFingerprint=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableCloseToTray(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableCloseToTray)&&void 0!==i&&i}))}setEnableCloseToTray(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableCloseToTray=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableDuckDuckGoBrowserIntegration(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableDuckDuckGoBrowserIntegration)&&void 0!==i&&i}))}setEnableDuckDuckGoBrowserIntegration(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableDuckDuckGoBrowserIntegration=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableFullWidth(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.enableFullWidth)&&void 0!==n&&n}))}setEnableFullWidth(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.enableFullWidth=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getEnableGravitars(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.enableGravitars)&&void 0!==n&&n}))}setEnableGravitars(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.enableGravitars=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getEnableMinimizeToTray(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableMinimizeToTray)&&void 0!==i&&i}))}setEnableMinimizeToTray(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableMinimizeToTray=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableStartToTray(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableStartToTray)&&void 0!==i&&i}))}setEnableStartToTray(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableStartToTray=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEnableTray(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.enableTray)&&void 0!==i&&i}))}setEnableTray(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.enableTray=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedCiphers(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.ciphers)||void 0===n?void 0:n.encrypted}))}setEncryptedCiphers(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.data.ciphers.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getEncryptedCollections(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.collections)||void 0===n?void 0:n.encrypted}))}setEncryptedCollections(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.data.collections.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getEncryptedCryptoSymmetricKey(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.keys.cryptoSymmetricKey.encrypted}))}setEncryptedCryptoSymmetricKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.keys.cryptoSymmetricKey.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedFolders(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.folders)||void 0===n?void 0:n.encrypted}))}setEncryptedFolders(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.data.folders.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getEncryptedOrganizationKeys(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.keys)||void 0===i?void 0:i.organizationKeys.encrypted}))}setEncryptedOrganizationKeys(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.keys.organizationKeys.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedPasswordGenerationHistory(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.passwordGenerationHistory)||void 0===n?void 0:n.encrypted}))}setEncryptedPasswordGenerationHistory(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.passwordGenerationHistory.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedPinProtected(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pinProtected)||void 0===n?void 0:n.encrypted}))}setEncryptedPinProtected(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.pinProtected.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedPolicies(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.policies)||void 0===n?void 0:n.encrypted}))}setEncryptedPolicies(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.policies.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedPrivateKey(e){var t,i;return gS(this,void 0,void 0,(function*(){const n=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions()));return null===(i=null===(t=null==n?void 0:n.keys)||void 0===t?void 0:t.privateKey)||void 0===i?void 0:i.encrypted}))}setEncryptedPrivateKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.keys.privateKey.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedProviderKeys(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null===(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.keys)||void 0===i?void 0:i.providerKeys)||void 0===n?void 0:n.encrypted}))}setEncryptedProviderKeys(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.keys.providerKeys.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEncryptedSends(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.sends.encrypted}))}setEncryptedSends(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.data.sends.encrypted=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getEntityId(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.entityId}))}setEntityId(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.profile.entityId=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getEntityType(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.entityType}))}setEntityType(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.profile.entityType=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getEnvironmentUrls(e){var t,i,n,s;return gS(this,void 0,void 0,(function*(){return null==(null===(t=yield this.state())||void 0===t?void 0:t.activeUserId)?yield this.getGlobalEnvironmentUrls(e):(e=this.reconcileOptions(e,yield this.defaultOnDiskOptions()),null!==(s=null===(n=null===(i=yield this.getAccount(e))||void 0===i?void 0:i.settings)||void 0===n?void 0:n.environmentUrls)&&void 0!==s?s:new Qe)}))}setEnvironmentUrls(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.environmentUrls=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEquivalentDomains(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.equivalentDomains}))}setEquivalentDomains(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.equivalentDomains=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEventCollection(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.eventCollection}))}setEventCollection(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.eventCollection=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getEverBeenUnlocked(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.everBeenUnlocked)&&void 0!==n&&n}))}setEverBeenUnlocked(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.profile.everBeenUnlocked=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getForcePasswordReset(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.forcePasswordReset)&&void 0!==n&&n}))}setForcePasswordReset(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.profile.forcePasswordReset=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getInstalledVersion(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.installedVersion}))}setInstalledVersion(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.installedVersion=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getIsAuthenticated(e){return gS(this,void 0,void 0,(function*(){return null!=(yield this.getAccessToken(e))&&null!=(yield this.getUserId(e))}))}getKdfIterations(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.kdfIterations}))}setKdfIterations(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.kdfIterations=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getKdfType(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.kdfType}))}setKdfType(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.kdfType=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getKeyHash(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.keyHash}))}setKeyHash(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.keyHash=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getLastActive(e){return gS(this,void 0,void 0,(function*(){e=this.reconcileOptions(e,yield this.defaultOnDiskOptions());const t=yield this.storageService.get(bS,e);return null==t||Object.keys(t).length<1?null:t[e.userId]}))}setLastActive(e,t){var i;return gS(this,void 0,void 0,(function*(){if(null==(t=this.reconcileOptions(t,yield this.defaultOnDiskOptions())).userId)return;const n=null!==(i=yield this.storageService.get(bS,t))&&void 0!==i?i:{};n[t.userId]=e,yield this.storageService.save(bS,n,t)}))}getLastSync(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.lastSync}))}setLastSync(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.profile.lastSync=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getLocalData(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.localData}))}setLocalData(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.data.localData=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getLocale(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.locale}))}setLocale(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.locale=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getMainWindowSize(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.mainWindowSize}))}setMainWindowSize(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.mainWindowSize=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getMinimizeOnCopyToClipboard(e){var t,i,n;return gS(this,void 0,void 0,(function*(){return null!==(n=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.minimizeOnCopyToClipboard)&&void 0!==n&&n}))}setMinimizeOnCopyToClipboard(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.minimizeOnCopyToClipboard=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getNeverDomains(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.neverDomains}))}setNeverDomains(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.neverDomains=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getNoAutoPromptBiometrics(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.noAutoPromptBiometrics)&&void 0!==i&&i}))}setNoAutoPromptBiometrics(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.noAutoPromptBiometrics=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getNoAutoPromptBiometricsText(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.noAutoPromptBiometricsText}))}setNoAutoPromptBiometricsText(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.noAutoPromptBiometricsText=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getOpenAtLogin(e){var t,i;return gS(this,void 0,void 0,(function*(){return null!==(i=null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.openAtLogin)&&void 0!==i&&i}))}setOpenAtLogin(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.openAtLogin=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getOrganizationInvitation(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.organizationInvitation}))}setOrganizationInvitation(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.organizationInvitation=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getOrganizations(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.organizations}))}setOrganizations(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.organizations=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getPasswordGenerationOptions(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.passwordGenerationOptions}))}setPasswordGenerationOptions(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.passwordGenerationOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getUsernameGenerationOptions(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.usernameGenerationOptions}))}setUsernameGenerationOptions(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.usernameGenerationOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getGeneratorOptions(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.generatorOptions}))}setGeneratorOptions(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.generatorOptions=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getProtectedPin(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.protectedPin}))}setProtectedPin(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.settings.protectedPin=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getProviders(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.data)||void 0===i?void 0:i.providers}))}setProviders(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.data.providers=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getPublicKey(e){var t;return gS(this,void 0,void 0,(function*(){const i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.keys;return null==i?void 0:i.publicKey}))}setPublicKey(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.keys.publicKey=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getRefreshToken(e){var t,i;return gS(this,void 0,void 0,(function*(){return e=yield this.getTimeoutBasedStorageOptions(e),null===(i=null===(t=yield this.getAccount(e))||void 0===t?void 0:t.tokens)||void 0===i?void 0:i.refreshToken}))}setRefreshToken(e,t){return gS(this,void 0,void 0,(function*(){t=yield this.getTimeoutBasedStorageOptions(t);const i=yield this.getAccount(t);i.tokens.refreshToken=e,yield this.saveAccount(i,t)}))}getRememberedEmail(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.rememberedEmail}))}setRememberedEmail(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.rememberedEmail=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getSecurityStamp(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.tokens)||void 0===i?void 0:i.securityStamp}))}setSecurityStamp(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.tokens.securityStamp=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getSettings(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskMemoryOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.settings}))}setSettings(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()));i.settings.settings=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskMemoryOptions()))}))}getSsoCodeVerifier(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.ssoCodeVerifier}))}setSsoCodeVerifier(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.ssoCodeVerifier=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getSsoOrgIdentifier(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.ssoOrganizationIdentifier}))}setSsoOrganizationIdentifier(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.ssoOrganizationIdentifier=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getSsoState(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.ssoState}))}setSsoState(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.ssoState=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getTheme(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.theme}))}setTheme(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.theme=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getTwoFactorToken(e){var t;return gS(this,void 0,void 0,(function*(){return null===(t=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.twoFactorToken}))}setTwoFactorToken(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.twoFactorToken=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getUserId(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId}))}getUsesKeyConnector(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskOptions())))||void 0===t?void 0:t.profile)||void 0===i?void 0:i.usesKeyConnector}))}setUsesKeyConnector(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));i.profile.usesKeyConnector=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}getVaultTimeout(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.vaultTimeout}))}setVaultTimeout(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.vaultTimeout=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getVaultTimeoutAction(e){var t,i,n;return gS(this,void 0,void 0,(function*(){const s=null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.vaultTimeoutAction,o=null===(n=yield this.getGlobals(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===n?void 0:n.vaultTimeoutAction;return null!=s?s:o}))}setVaultTimeoutAction(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));i.settings.vaultTimeoutAction=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getStateVersion(){var e;return gS(this,void 0,void 0,(function*(){return null!==(e=(yield this.getGlobals(yield this.defaultOnDiskLocalOptions())).stateVersion)&&void 0!==e?e:1}))}setStateVersion(e){return gS(this,void 0,void 0,(function*(){const t=yield this.getGlobals(yield this.defaultOnDiskOptions());t.stateVersion=e,yield this.saveGlobals(t,yield this.defaultOnDiskOptions())}))}getWindow(){return gS(this,void 0,void 0,(function*(){const e=yield this.getGlobals(yield this.defaultOnDiskOptions());return null!=(null==e?void 0:e.window)&&Object.keys(e.window).length>0?e.window:new Fv}))}setWindow(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getGlobals(this.reconcileOptions(t,yield this.defaultOnDiskOptions()));return i.window=e,yield this.saveGlobals(i,this.reconcileOptions(t,yield this.defaultOnDiskOptions()))}))}setServerConfig(e,t){return gS(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()));return i.settings.serverConfig=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultOnDiskLocalOptions()))}))}getServerConfig(e){var t,i;return gS(this,void 0,void 0,(function*(){return null===(i=null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultOnDiskLocalOptions())))||void 0===t?void 0:t.settings)||void 0===i?void 0:i.serverConfig}))}getGlobals(e){return gS(this,void 0,void 0,(function*(){let t;return this.useMemory(e.storageLocation)&&(t=yield this.getGlobalsFromMemory()),this.useDisk&&null==t&&(t=yield this.getGlobalsFromDisk(e)),null!=t?t:this.createGlobals()}))}saveGlobals(e,t){return gS(this,void 0,void 0,(function*(){return this.useMemory(t.storageLocation)?this.saveGlobalsToMemory(e):yield this.saveGlobalsToDisk(e,t)}))}getGlobalsFromMemory(){return gS(this,void 0,void 0,(function*(){return(yield this.state()).globals}))}getGlobalsFromDisk(e){return gS(this,void 0,void 0,(function*(){return yield this.storageService.get(yS,e)}))}saveGlobalsToMemory(e){return gS(this,void 0,void 0,(function*(){yield this.updateState((t=>gS(this,void 0,void 0,(function*(){return t.globals=e,t}))))}))}saveGlobalsToDisk(e,t){return gS(this,void 0,void 0,(function*(){t.useSecureStorage?yield this.secureStorageService.save(yS,e,t):yield this.storageService.save(yS,e,t)}))}getAccount(e){return gS(this,void 0,void 0,(function*(){try{let t;return this.useMemory(e.storageLocation)&&(t=yield this.getAccountFromMemory(e)),this.useDisk(e.storageLocation)&&null==t&&(t=yield this.getAccountFromDisk(e)),t}catch(e){this.logService.error(e)}}))}getAccountFromMemory(e){return gS(this,void 0,void 0,(function*(){return yield this.state().then((t=>gS(this,void 0,void 0,(function*(){return null==t.accounts?null:t.accounts[yield this.getUserIdFromMemory(e)]}))))}))}getUserIdFromMemory(e){return gS(this,void 0,void 0,(function*(){return yield this.state().then((t=>{var i,n;return null!=(null==e?void 0:e.userId)?null===(n=null===(i=t.accounts[e.userId])||void 0===i?void 0:i.profile)||void 0===n?void 0:n.userId:t.activeUserId}))}))}getAccountFromDisk(e){var t,i;return gS(this,void 0,void 0,(function*(){if(null==(null==e?void 0:e.userId)&&null==(null===(t=yield this.state())||void 0===t?void 0:t.activeUserId))return null;if(this.useAccountCache){const t=this.accountDiskCache.get(e.userId);if(null!=t)return t}const n=(null==e?void 0:e.useSecureStorage)?null!==(i=yield this.secureStorageService.get(e.userId,e))&&void 0!==i?i:yield this.storageService.get(e.userId,this.reconcileOptions(e,{htmlStorageLocation:Ff.Local})):yield this.storageService.get(e.userId,e);return this.useAccountCache&&this.accountDiskCache.set(e.userId,n),n}))}useMemory(e){return e===aS.Memory||e===aS.Both}useDisk(e){return e===aS.Disk||e===aS.Both}saveAccount(e,t={storageLocation:aS.Both,useSecureStorage:!1}){return gS(this,void 0,void 0,(function*(){return this.useMemory(t.storageLocation)?yield this.saveAccountToMemory(e):yield this.saveAccountToDisk(e,t)}))}saveAccountToDisk(e,t){return gS(this,void 0,void 0,(function*(){const i=t.useSecureStorage?this.secureStorageService:this.storageService;yield i.save(`${t.userId}`,e,t),this.useAccountCache&&this.accountDiskCache.delete(t.userId)}))}saveAccountToMemory(e){return gS(this,void 0,void 0,(function*(){null!==this.getAccountFromMemory({userId:e.profile.userId})&&(yield this.updateState((t=>new Promise((i=>{t.accounts[e.profile.userId]=e,i(t)}))))),yield this.pushAccounts()}))}scaffoldNewAccountStorage(e){return gS(this,void 0,void 0,(function*(){const t=JSON.parse(JSON.stringify(e));yield this.scaffoldNewAccountLocalStorage(t),yield this.scaffoldNewAccountSessionStorage(t),yield this.scaffoldNewAccountMemoryStorage(t)}))}scaffoldNewAccountLocalStorage(e){return gS(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskLocalOptions())),i=e.settings.environmentUrls;null!=(null==t?void 0:t.settings)?e.settings=t.settings:(yield this.storageService.has(wS))&&(e.settings=yield this.storageService.get(wS),yield this.storageService.remove(wS)),e.settings.environmentUrls=i,"logOut"===e.settings.vaultTimeoutAction&&null!=e.settings.vaultTimeout&&(e.tokens.accessToken=null,e.tokens.refreshToken=null,e.profile.apiKeyClientId=null,e.keys.apiKeyClientSecret=null),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskLocalOptions()))}))}scaffoldNewAccountMemoryStorage(e){return gS(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskMemoryOptions()));null!=(null==t?void 0:t.settings)&&(t.settings.environmentUrls=e.settings.environmentUrls,e.settings=t.settings),yield this.storageService.save(e.profile.userId,e,yield this.defaultOnDiskMemoryOptions()),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskMemoryOptions()))}))}scaffoldNewAccountSessionStorage(e){return gS(this,void 0,void 0,(function*(){const t=yield this.getAccount(this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskOptions()));null!=(null==t?void 0:t.settings)&&(t.settings.environmentUrls=e.settings.environmentUrls,e.settings=t.settings),yield this.storageService.save(e.profile.userId,e,yield this.defaultOnDiskMemoryOptions()),yield this.saveAccount(e,this.reconcileOptions({userId:e.profile.userId},yield this.defaultOnDiskOptions()))}))}pushAccounts(){return gS(this,void 0,void 0,(function*(){yield this.pruneInMemoryAccounts(),yield this.state().then((e=>{null==e.accounts||Object.keys(e.accounts).length<1?this.accounts.next(null):this.accounts.next(e.accounts)}))}))}reconcileOptions(e,t){var i,n,s,o,r;return null==e?t:(e.userId=null!==(i=null==e?void 0:e.userId)&&void 0!==i?i:t.userId,e.storageLocation=null!==(n=null==e?void 0:e.storageLocation)&&void 0!==n?n:t.storageLocation,e.useSecureStorage=null!==(s=null==e?void 0:e.useSecureStorage)&&void 0!==s?s:t.useSecureStorage,e.htmlStorageLocation=null!==(o=null==e?void 0:e.htmlStorageLocation)&&void 0!==o?o:t.htmlStorageLocation,e.keySuffix=null!==(r=null==e?void 0:e.keySuffix)&&void 0!==r?r:t.keySuffix,e)}defaultInMemoryOptions(){return gS(this,void 0,void 0,(function*(){return{storageLocation:aS.Memory,userId:(yield this.state()).activeUserId}}))}defaultOnDiskOptions(){var e,t;return gS(this,void 0,void 0,(function*(){return{storageLocation:aS.Disk,htmlStorageLocation:Ff.Session,userId:null!==(t=null===(e=yield this.state())||void 0===e?void 0:e.activeUserId)&&void 0!==t?t:yield this.getActiveUserIdFromStorage(),useSecureStorage:!1}}))}defaultOnDiskLocalOptions(){var e,t;return gS(this,void 0,void 0,(function*(){return{storageLocation:aS.Disk,htmlStorageLocation:Ff.Local,userId:null!==(t=null===(e=yield this.state())||void 0===e?void 0:e.activeUserId)&&void 0!==t?t:yield this.getActiveUserIdFromStorage(),useSecureStorage:!1}}))}defaultOnDiskMemoryOptions(){var e,t;return gS(this,void 0,void 0,(function*(){return{storageLocation:aS.Disk,htmlStorageLocation:Ff.Memory,userId:null!==(t=null===(e=yield this.state())||void 0===e?void 0:e.activeUserId)&&void 0!==t?t:yield this.getUserId(),useSecureStorage:!1}}))}defaultSecureStorageOptions(){var e,t;return gS(this,void 0,void 0,(function*(){return{storageLocation:aS.Disk,useSecureStorage:!0,userId:null!==(t=null===(e=yield this.state())||void 0===e?void 0:e.activeUserId)&&void 0!==t?t:yield this.getActiveUserIdFromStorage()}}))}getActiveUserIdFromStorage(){return gS(this,void 0,void 0,(function*(){return yield this.storageService.get(mS)}))}removeAccountFromLocalStorage(e=null){var t;return gS(this,void 0,void 0,(function*(){e=null!=e?e:null===(t=yield this.state())||void 0===t?void 0:t.activeUserId;const i=yield this.getAccount(this.reconcileOptions({userId:e},yield this.defaultOnDiskLocalOptions()));yield this.saveAccount(this.resetAccount(i),this.reconcileOptions({userId:e},yield this.defaultOnDiskLocalOptions()))}))}removeAccountFromSessionStorage(e=null){var t;return gS(this,void 0,void 0,(function*(){e=null!=e?e:null===(t=yield this.state())||void 0===t?void 0:t.activeUserId;const i=yield this.getAccount(this.reconcileOptions({userId:e},yield this.defaultOnDiskOptions()));yield this.saveAccount(this.resetAccount(i),this.reconcileOptions({userId:e},yield this.defaultOnDiskOptions()))}))}removeAccountFromSecureStorage(e=null){var t;return gS(this,void 0,void 0,(function*(){e=null!=e?e:null===(t=yield this.state())||void 0===t?void 0:t.activeUserId,yield this.setCryptoMasterKeyAuto(null,{userId:e}),yield this.setCryptoMasterKeyBiometric(null,{userId:e}),yield this.setCryptoMasterKeyB64(null,{userId:e})}))}removeAccountFromMemory(e=null){return gS(this,void 0,void 0,(function*(){yield this.updateState((t=>gS(this,void 0,void 0,(function*(){return e=null!=e?e:t.activeUserId,delete t.accounts[e],this.useAccountCache&&this.accountDiskCache.delete(e),t}))))}))}pruneInMemoryAccounts(){var e;return gS(this,void 0,void 0,(function*(){for(const t in null===(e=yield this.state())||void 0===e?void 0:e.accounts)(yield this.getIsAuthenticated({userId:t}))||(yield this.removeAccountFromMemory(t))}))}resetAccount(e){const t={settings:e.settings};return Object.assign(this.createAccount(),t)}setAccountEnvironmentUrls(e){return gS(this,void 0,void 0,(function*(){return e.settings.environmentUrls=yield this.getGlobalEnvironmentUrls(),e}))}getGlobalEnvironmentUrls(e){var t;return gS(this,void 0,void 0,(function*(){return e=this.reconcileOptions(e,yield this.defaultOnDiskOptions()),null!==(t=(yield this.getGlobals(e)).environmentUrls)&&void 0!==t?t:new Qe}))}clearDecryptedDataForActiveUser(){return gS(this,void 0,void 0,(function*(){yield this.updateState((e=>gS(this,void 0,void 0,(function*(){var t;const i=null==e?void 0:e.activeUserId;return null!=i&&null!=(null===(t=null==e?void 0:e.accounts[i])||void 0===t?void 0:t.data)&&(e.accounts[i].data=new Ov),e}))))}))}createAccount(e=null){return this.stateFactory.createAccount(e)}createGlobals(e=null){return this.stateFactory.createGlobal(e)}deAuthenticateAccount(e){return gS(this,void 0,void 0,(function*(){yield this.setAccessToken(null,{userId:e}),yield this.setLastActive(null,{userId:e}),yield this.updateState((t=>gS(this,void 0,void 0,(function*(){return t.authenticatedAccounts=t.authenticatedAccounts.filter((t=>t!==e)),yield this.storageService.save(fS,t.authenticatedAccounts),t}))))}))}removeAccountFromDisk(e){return gS(this,void 0,void 0,(function*(){yield this.removeAccountFromSessionStorage(e),yield this.removeAccountFromLocalStorage(e),yield this.removeAccountFromSecureStorage(e)}))}dynamicallySetActiveUser(){var e;return gS(this,void 0,void 0,(function*(){const t=null===(e=yield this.state())||void 0===e?void 0:e.accounts;if(null==t||Object.keys(t).length<1)yield this.setActiveUser(null);else for(const e in t)if(null!=e){if(yield this.getIsAuthenticated({userId:e})){yield this.setActiveUser(e);break}yield this.setActiveUser(null)}}))}getTimeoutBasedStorageOptions(e){return gS(this,void 0,void 0,(function*(){const t=yield this.getVaultTimeoutAction({userId:null==e?void 0:e.userId}),i=yield this.getVaultTimeout({userId:null==e?void 0:e.userId}),n="logOut"===t&&null!=i?yield this.defaultInMemoryOptions():yield this.defaultOnDiskOptions();return this.reconcileOptions(e,n)}))}saveSecureStorageKey(e,t,i){return gS(this,void 0,void 0,(function*(){return null==t?yield this.secureStorageService.remove(`${i.userId}${e}`,i):yield this.secureStorageService.save(`${i.userId}${e}`,t,i)}))}state(){return gS(this,void 0,void 0,(function*(){return yield this.memoryStorageService.get(vS,{deserializer:e=>dS.fromJSON(e)})}))}setState(e){return gS(this,void 0,void 0,(function*(){yield this.memoryStorageService.save(vS,e)}))}updateState(e){return gS(this,void 0,void 0,(function*(){yield this.state().then((t=>gS(this,void 0,void 0,(function*(){const i=yield e(t);if(null==i)throw new Error("Attempted to update state to null value");yield this.setState(i)}))))}))}mapToRecord(e){return null==e?null:Object.fromEntries(e)}recordToMap(e){return null==e?null:new Map(Object.entries(e))}}function ZS(e,t=(e=>e)){return(i,n,s)=>{const o=s.value;return{value:function(...i){const s=o.apply(this,i);if(!(s instanceof Promise))throw new Error(`Error applying prototype to stored value -- result is not a promise for method ${String(n)}`);return s.then((i=>null==i||i.constructor.name===e.prototype.constructor.name?t(i):t(Object.create(e.prototype,Object.getOwnPropertyDescriptors(i)))))}}}}function TS(e,t=(e=>e)){return(i,n,s)=>{const o=s.value;return{value:function(...i){const s=o.apply(this,i);if(!(s instanceof Promise))throw new Error(`Error applying prototype to stored value -- result is not a promise for method ${String(n)}`);return s.then((i=>{if(null==i)return null;if(i instanceof Array)return i.map((i=>null==i||i.constructor.name===e.prototype.constructor.name?t(i):t(Object.create(e.prototype,Object.getOwnPropertyDescriptors(i)))));throw new Error(`Attempted to retrieve non array type from state as an array for method ${String(n)}`)}))}}}}function CS(e,t=(e=>e)){return(i,n,s)=>{const o=s.value;return{value:function(...i){const s=o.apply(this,i);if(!(s instanceof Promise))throw new Error(`Error applying prototype to stored value -- result is not a promise for method ${String(n)}`);return s.then((i=>{if(null==i)return null;for(const[n,s]of Object.entries(i))i[n]=null==s||s.constructor.name===e.prototype.constructor.name?t(s):t(Object.create(e.prototype,Object.getOwnPropertyDescriptors(s)));return i}))}}}}hS([TS(bc,bc.fromJSON),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getDecryptedCiphers",null),hS([TS(Hm),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getDecryptedCollections",null),hS([TS(Ob),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getDecryptedPasswordGenerationHistory",null),hS([TS(Fb),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getDecryptedPolicies",null),hS([TS(zs),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getDecryptedSends",null),hS([CS(mm),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedCiphers",null),hS([CS(Vm),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedCollections",null),hS([CS($w),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedFolders",null),hS([TS(Ob),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedPasswordGenerationHistory",null),hS([CS(Mb),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedPolicies",null),hS([CS($b),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEncryptedSends",null),hS([TS(xw),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getEventCollection",null),hS([CS(uS),pS("design:type",Function),pS("design:paramtypes",[Object]),pS("design:returntype",Promise)],_S.prototype,"getProviders",null);var kS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class OS{constructor(e){this.stateService=e}static decodeToken(e){if(null==e)throw new Error("Token not provided.");const t=e.split(".");if(3!==t.length)throw new Error("JWT must have 3 parts");const i=nt.fromUrlB64ToUtf8(t[1]);if(null==i)throw new Error("Cannot decode the token");return JSON.parse(i)}setTokens(e,t,i){return kS(this,void 0,void 0,(function*(){yield this.setToken(e),yield this.setRefreshToken(t),null!=i&&(yield this.setClientId(i[0]),yield this.setClientSecret(i[1]))}))}setClientId(e){return kS(this,void 0,void 0,(function*(){return yield this.stateService.setApiKeyClientId(e)}))}getClientId(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.getApiKeyClientId()}))}setClientSecret(e){return kS(this,void 0,void 0,(function*(){return yield this.stateService.setApiKeyClientSecret(e)}))}getClientSecret(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.getApiKeyClientSecret()}))}setToken(e){return kS(this,void 0,void 0,(function*(){yield this.stateService.setAccessToken(e)}))}getToken(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.getAccessToken()}))}setRefreshToken(e){return kS(this,void 0,void 0,(function*(){return yield this.stateService.setRefreshToken(e)}))}getRefreshToken(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.getRefreshToken()}))}setTwoFactorToken(e){return kS(this,void 0,void 0,(function*(){return yield this.stateService.setTwoFactorToken(e.twoFactorToken)}))}getTwoFactorToken(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.getTwoFactorToken()}))}clearTwoFactorToken(){return kS(this,void 0,void 0,(function*(){return yield this.stateService.setTwoFactorToken(null)}))}clearToken(e){return kS(this,void 0,void 0,(function*(){yield this.stateService.setAccessToken(null,{userId:e}),yield this.stateService.setRefreshToken(null,{userId:e}),yield this.stateService.setApiKeyClientId(null,{userId:e}),yield this.stateService.setApiKeyClientSecret(null,{userId:e})}))}decodeToken(e){return kS(this,void 0,void 0,(function*(){if(null==(e=null!=e?e:yield this.stateService.getAccessToken()))throw new Error("Token not found.");return OS.decodeToken(e)}))}getTokenExpirationDate(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();if(void 0===e.exp)return null;const t=new Date(0);return t.setUTCSeconds(e.exp),t}))}tokenSecondsRemaining(e=0){return kS(this,void 0,void 0,(function*(){const t=yield this.getTokenExpirationDate();if(null==t)return 0;const i=t.valueOf()-((new Date).valueOf()+1e3*e);return Math.round(i/1e3)}))}tokenNeedsRefresh(e=5){return kS(this,void 0,void 0,(function*(){return(yield this.tokenSecondsRemaining())<60*e}))}getUserId(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();if(void 0===e.sub)throw new Error("No user id found");return e.sub}))}getEmail(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();if(void 0===e.email)throw new Error("No email found");return e.email}))}getEmailVerified(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();if(void 0===e.email_verified)throw new Error("No email verification found");return e.email_verified}))}getName(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();return void 0===e.name?null:e.name}))}getIssuer(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();if(void 0===e.iss)throw new Error("No issuer found");return e.iss}))}getIsExternal(){return kS(this,void 0,void 0,(function*(){const e=yield this.decodeToken();return Array.isArray(e.amr)&&e.amr.includes("external")}))}}var PS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const IS={accessToken:"accessToken",alwaysShowDock:"alwaysShowDock",autoConfirmFingerprints:"autoConfirmFingerprints",autoFillOnPageLoadDefault:"autoFillOnPageLoadDefault",biometricAwaitingAcceptance:"biometricAwaitingAcceptance",biometricFingerprintValidated:"biometricFingerprintValidated",biometricText:"biometricText",biometricUnlock:"biometric",clearClipboard:"clearClipboardKey",clientId:"apikey_clientId",clientSecret:"apikey_clientSecret",collapsedGroupings:"collapsedGroupings",convertAccountToKeyConnector:"convertAccountToKeyConnector",defaultUriMatch:"defaultUriMatch",disableAddLoginNotification:"disableAddLoginNotification",disableAutoBiometricsPrompt:"noAutoPromptBiometrics",disableAutoTotpCopy:"disableAutoTotpCopy",disableBadgeCounter:"disableBadgeCounter",disableChangedPasswordNotification:"disableChangedPasswordNotification",disableContextMenuItem:"disableContextMenuItem",disableFavicon:"disableFavicon",disableGa:"disableGa",dontShowCardsCurrentTab:"dontShowCardsCurrentTab",dontShowIdentitiesCurrentTab:"dontShowIdentitiesCurrentTab",emailVerified:"emailVerified",enableAlwaysOnTop:"enableAlwaysOnTopKey",enableAutoFillOnPageLoad:"enableAutoFillOnPageLoad",enableBiometric:"enabledBiometric",enableBrowserIntegration:"enableBrowserIntegration",enableBrowserIntegrationFingerprint:"enableBrowserIntegrationFingerprint",enableCloseToTray:"enableCloseToTray",enableFullWidth:"enableFullWidth",enableGravatars:"enableGravatars",enableMinimizeToTray:"enableMinimizeToTray",enableStartToTray:"enableStartToTrayKey",enableTray:"enableTray",encKey:"encKey",encOrgKeys:"encOrgKeys",encPrivate:"encPrivateKey",encProviderKeys:"encProviderKeys",entityId:"entityId",entityType:"entityType",environmentUrls:"environmentUrls",equivalentDomains:"equivalentDomains",eventCollection:"eventCollection",forcePasswordReset:"forcePasswordReset",history:"generatedPasswordHistory",installedVersion:"installedVersion",kdf:"kdf",kdfIterations:"kdfIterations",key:"key",keyHash:"keyHash",lastActive:"lastActive",localData:"sitesLocalData",locale:"locale",mainWindowSize:"mainWindowSize",minimizeOnCopyToClipboard:"minimizeOnCopyToClipboardKey",neverDomains:"neverDomains",noAutoPromptBiometricsText:"noAutoPromptBiometricsText",openAtLogin:"openAtLogin",passwordGenerationOptions:"passwordGenerationOptions",pinProtected:"pinProtectedKey",protectedPin:"protectedPin",refreshToken:"refreshToken",ssoCodeVerifier:"ssoCodeVerifier",ssoIdentifier:"ssoOrgIdentifier",ssoState:"ssoState",stamp:"securityStamp",theme:"theme",userEmail:"userEmail",userId:"userId",usesConnector:"usesKeyConnector",vaultTimeoutAction:"vaultTimeoutAction",vaultTimeout:"lockOption",rememberedEmail:"rememberedEmail"},qS={ciphers:"ciphers_",collections:"collections_",folders:"folders_",lastSync:"lastSync_",policies:"policies_",twoFactorToken:"twoFactorToken_",organizations:"organizations_",providers:"providers_",sends:"sends_",settings:"settings_"},DS="global",MS="authenticatedAccounts",FS="activeUserId",NS="tempAccountSettings",LS="accountActivity",ES="_masterkey_auto",RS="_masterkey_biometric",JS="_masterkey";class YS{constructor(e,t,i){this.storageService=e,this.secureStorageService=t,this.stateFactory=i}needsMigration(){return PS(this,void 0,void 0,(function*(){const e=yield this.getCurrentStateVersion();return null==e||ePS(this,void 0,void 0,(function*(){for(const e in IS)null!=e&&(yield this.set(IS[e],null));if(null!=e)for(const e in qS)null!=e&&(yield this.set(qS[e]+j,null))})),H=null!==(e=yield this.get(DS))&&void 0!==e?e:this.stateFactory.createGlobal(null);H.stateVersion=av.Two,H.environmentUrls=null!==(t=yield this.get(IS.environmentUrls))&&void 0!==t?t:H.environmentUrls,H.locale=null!==(i=yield this.get(IS.locale))&&void 0!==i?i:H.locale,H.noAutoPromptBiometrics=null!==(n=yield this.get(IS.disableAutoBiometricsPrompt))&&void 0!==n?n:H.noAutoPromptBiometrics,H.noAutoPromptBiometricsText=null!==(s=yield this.get(IS.noAutoPromptBiometricsText))&&void 0!==s?s:H.noAutoPromptBiometricsText,H.ssoCodeVerifier=null!==(o=yield this.get(IS.ssoCodeVerifier))&&void 0!==o?o:H.ssoCodeVerifier,H.ssoOrganizationIdentifier=null!==(r=yield this.get(IS.ssoIdentifier))&&void 0!==r?r:H.ssoOrganizationIdentifier,H.ssoState=null!==(a=yield this.get(IS.ssoState))&&void 0!==a?a:H.ssoState,H.rememberedEmail=null!==(l=yield this.get(IS.rememberedEmail))&&void 0!==l?l:H.rememberedEmail,H.theme=null!==(c=yield this.get(IS.theme))&&void 0!==c?c:H.theme,H.vaultTimeout=null!==(u=yield this.get(IS.vaultTimeout))&&void 0!==u?u:H.vaultTimeout,H.vaultTimeoutAction=null!==(d=yield this.get(IS.vaultTimeoutAction))&&void 0!==d?d:H.vaultTimeoutAction,H.window=null!==(h=yield this.get(IS.mainWindowSize))&&void 0!==h?h:H.window,H.enableTray=null!==(p=yield this.get(IS.enableTray))&&void 0!==p?p:H.enableTray,H.enableMinimizeToTray=null!==(g=yield this.get(IS.enableMinimizeToTray))&&void 0!==g?g:H.enableMinimizeToTray,H.enableCloseToTray=null!==(v=yield this.get(IS.enableCloseToTray))&&void 0!==v?v:H.enableCloseToTray,H.enableStartToTray=null!==(y=yield this.get(IS.enableStartToTray))&&void 0!==y?y:H.enableStartToTray,H.openAtLogin=null!==(f=yield this.get(IS.openAtLogin))&&void 0!==f?f:H.openAtLogin,H.alwaysShowDock=null!==(m=yield this.get(IS.alwaysShowDock))&&void 0!==m?m:H.alwaysShowDock,H.enableBrowserIntegration=null!==(w=yield this.get(IS.enableBrowserIntegration))&&void 0!==w?w:H.enableBrowserIntegration,H.enableBrowserIntegrationFingerprint=null!==(b=yield this.get(IS.enableBrowserIntegrationFingerprint))&&void 0!==b?b:H.enableBrowserIntegrationFingerprint;const j=null!==(S=yield this.get(IS.userId))&&void 0!==S?S:yield this.get(IS.entityId),W=this.stateFactory.createAccount(null),$={autoConfirmFingerPrints:null!==(U=yield this.get(IS.autoConfirmFingerprints))&&void 0!==U?U:W.settings.autoConfirmFingerPrints,autoFillOnPageLoadDefault:null!==(x=yield this.get(IS.autoFillOnPageLoadDefault))&&void 0!==x?x:W.settings.autoFillOnPageLoadDefault,biometricUnlock:null!==(A=yield this.get(IS.biometricUnlock))&&void 0!==A?A:W.settings.biometricUnlock,clearClipboard:null!==(_=yield this.get(IS.clearClipboard))&&void 0!==_?_:W.settings.clearClipboard,defaultUriMatch:null!==(Z=yield this.get(IS.defaultUriMatch))&&void 0!==Z?Z:W.settings.defaultUriMatch,disableAddLoginNotification:null!==(T=yield this.get(IS.disableAddLoginNotification))&&void 0!==T?T:W.settings.disableAddLoginNotification,disableAutoBiometricsPrompt:null!==(C=yield this.get(IS.disableAutoBiometricsPrompt))&&void 0!==C?C:W.settings.disableAutoBiometricsPrompt,disableAutoTotpCopy:null!==(k=yield this.get(IS.disableAutoTotpCopy))&&void 0!==k?k:W.settings.disableAutoTotpCopy,disableBadgeCounter:null!==(O=yield this.get(IS.disableBadgeCounter))&&void 0!==O?O:W.settings.disableBadgeCounter,disableChangedPasswordNotification:null!==(P=yield this.get(IS.disableChangedPasswordNotification))&&void 0!==P?P:W.settings.disableChangedPasswordNotification,disableContextMenuItem:null!==(I=yield this.get(IS.disableContextMenuItem))&&void 0!==I?I:W.settings.disableContextMenuItem,disableGa:null!==(q=yield this.get(IS.disableGa))&&void 0!==q?q:W.settings.disableGa,dontShowCardsCurrentTab:null!==(D=yield this.get(IS.dontShowCardsCurrentTab))&&void 0!==D?D:W.settings.dontShowCardsCurrentTab,dontShowIdentitiesCurrentTab:null!==(M=yield this.get(IS.dontShowIdentitiesCurrentTab))&&void 0!==M?M:W.settings.dontShowIdentitiesCurrentTab,enableAlwaysOnTop:null!==(F=yield this.get(IS.enableAlwaysOnTop))&&void 0!==F?F:W.settings.enableAlwaysOnTop,enableAutoFillOnPageLoad:null!==(N=yield this.get(IS.enableAutoFillOnPageLoad))&&void 0!==N?N:W.settings.enableAutoFillOnPageLoad,enableBiometric:null!==(L=yield this.get(IS.enableBiometric))&&void 0!==L?L:W.settings.enableBiometric,enableFullWidth:null!==(E=yield this.get(IS.enableFullWidth))&&void 0!==E?E:W.settings.enableFullWidth,enableGravitars:null!==(R=yield this.get(IS.enableGravatars))&&void 0!==R?R:W.settings.enableGravitars,environmentUrls:null!==(J=H.environmentUrls)&&void 0!==J?J:W.settings.environmentUrls,equivalentDomains:null!==(Y=yield this.get(IS.equivalentDomains))&&void 0!==Y?Y:W.settings.equivalentDomains,minimizeOnCopyToClipboard:null!==(z=yield this.get(IS.minimizeOnCopyToClipboard))&&void 0!==z?z:W.settings.minimizeOnCopyToClipboard,neverDomains:null!==(K=yield this.get(IS.neverDomains))&&void 0!==K?K:W.settings.neverDomains,passwordGenerationOptions:null!==(B=yield this.get(IS.passwordGenerationOptions))&&void 0!==B?B:W.settings.passwordGenerationOptions,pinProtected:Object.assign(new Tv,{decrypted:null,encrypted:yield this.get(IS.pinProtected)}),protectedPin:yield this.get(IS.protectedPin),settings:null==j?null:yield this.get(qS.settings+j),vaultTimeout:null!==(G=yield this.get(IS.vaultTimeout))&&void 0!==G?G:W.settings.vaultTimeout,vaultTimeoutAction:null!==(Q=yield this.get(IS.vaultTimeoutAction))&&void 0!==Q?Q:W.settings.vaultTimeoutAction};if(null==j)return yield this.set(NS,$),yield this.set(DS,H),yield this.set(MS,[]),yield this.set(FS,null),void(yield V());H.twoFactorToken=yield this.get(qS.twoFactorToken+j),yield this.set(DS,H),yield this.set(j,{data:{addEditCipherInfo:null,ciphers:{decrypted:null,encrypted:yield this.get(qS.ciphers+j)},collapsedGroupings:null,collections:{decrypted:null,encrypted:yield this.get(qS.collections+j)},eventCollection:yield this.get(IS.eventCollection),folders:{decrypted:null,encrypted:yield this.get(qS.folders+j)},localData:null,organizations:yield this.get(qS.organizations+j),passwordGenerationHistory:{decrypted:null,encrypted:yield this.get(IS.history)},policies:{decrypted:null,encrypted:yield this.get(qS.policies+j)},providers:yield this.get(qS.providers+j),sends:{decrypted:null,encrypted:yield this.get(qS.sends+j)}},keys:{apiKeyClientSecret:yield this.get(IS.clientSecret),cryptoMasterKey:null,cryptoMasterKeyAuto:null,cryptoMasterKeyB64:null,cryptoMasterKeyBiometric:null,cryptoSymmetricKey:{encrypted:yield this.get(IS.encKey),decrypted:null},legacyEtmKey:null,organizationKeys:{decrypted:null,encrypted:yield this.get(IS.encOrgKeys)},privateKey:{decrypted:null,encrypted:yield this.get(IS.encPrivate)},providerKeys:{decrypted:null,encrypted:yield this.get(IS.encProviderKeys)},publicKey:null},profile:{apiKeyClientId:yield this.get(IS.clientId),authenticationStatus:null,convertAccountToKeyConnector:yield this.get(IS.convertAccountToKeyConnector),email:yield this.get(IS.userEmail),emailVerified:yield this.get(IS.emailVerified),entityId:null,entityType:null,everBeenUnlocked:null,forcePasswordReset:null,hasPremiumPersonally:null,kdfIterations:yield this.get(IS.kdfIterations),kdfType:yield this.get(IS.kdf),keyHash:yield this.get(IS.keyHash),lastSync:null,userId:j,usesKeyConnector:null},settings:$,tokens:{accessToken:yield this.get(IS.accessToken),decodedToken:null,refreshToken:yield this.get(IS.refreshToken),securityStamp:null}}),yield this.set(MS,[j]),yield this.set(FS,j);const X={[j]:yield this.get(IS.lastActive)};X[j]=yield this.get(IS.lastActive),yield this.set(LS,X),yield V(j),(yield this.secureStorageService.has(IS.key,{keySuffix:"biometric"}))&&(yield this.secureStorageService.save(`${j}${RS}`,yield this.secureStorageService.get(IS.key,{keySuffix:"biometric"}),{keySuffix:"biometric"}),yield this.secureStorageService.remove(IS.key,{keySuffix:"biometric"})),(yield this.secureStorageService.has(IS.key,{keySuffix:"auto"}))&&(yield this.secureStorageService.save(`${j}${ES}`,yield this.secureStorageService.get(IS.key,{keySuffix:"auto"}),{keySuffix:"auto"}),yield this.secureStorageService.remove(IS.key,{keySuffix:"auto"})),(yield this.secureStorageService.has(IS.key))&&(yield this.secureStorageService.save(`${j}${JS}`,yield this.secureStorageService.get(IS.key)),yield this.secureStorageService.remove(IS.key))}))}migrateStateFrom2To3(){return PS(this,void 0,void 0,(function*(){const e=yield this.get(MS);yield Promise.all(e.map((e=>PS(this,void 0,void 0,(function*(){var t,i;const n=yield this.get(e);if(null===(null===(t=null==n?void 0:n.profile)||void 0===t?void 0:t.hasPremiumPersonally)&&null!=(null===(i=n.tokens)||void 0===i?void 0:i.accessToken)){const t=yield OS.decodeToken(n.tokens.accessToken);n.profile.hasPremiumPersonally=t.premium,yield this.set(e,n)}})))));const t=yield this.getGlobals();t.stateVersion=av.Three,yield this.set(DS,t)}))}migrateStateFrom3To4(){return PS(this,void 0,void 0,(function*(){const e=yield this.get(MS);yield Promise.all(e.map((e=>PS(this,void 0,void 0,(function*(){var t;const i=yield this.get(e);if(null!=(null===(t=null==i?void 0:i.profile)||void 0===t?void 0:t.everBeenUnlocked))return delete i.profile.everBeenUnlocked,this.set(e,i)})))));const t=yield this.getGlobals();t.stateVersion=av.Four,yield this.set(DS,t)}))}migrateAccountFrom4To5(e){var t,i;return PS(this,void 0,void 0,(function*(){const n=null===(i=null===(t=e.keys)||void 0===t?void 0:t.organizationKeys)||void 0===i?void 0:i.encrypted;if(null!=n)for(const[e,t]of Object.entries(n))n[e]={type:"organization",key:t};return e}))}migrateAccountFrom5To6(e){var t;return PS(this,void 0,void 0,(function*(){return null===(t=e.keys)||void 0===t||delete t.legacyEtmKey,e}))}get options(){return{htmlStorageLocation:Ff.Local}}get(e){return this.storageService.get(e,this.options)}set(e,t){return null==t?this.storageService.remove(e,this.options):this.storageService.save(e,t,this.options)}getGlobals(){return PS(this,void 0,void 0,(function*(){return yield this.get(DS)}))}getCurrentStateVersion(){var e,t;return PS(this,void 0,void 0,(function*(){return null!==(t=null===(e=yield this.getGlobals())||void 0===e?void 0:e.stateVersion)&&void 0!==t?t:av.One}))}setCurrentStateVersion(e){return PS(this,void 0,void 0,(function*(){const t=yield this.getGlobals();t.stateVersion=e,yield this.set(DS,t)}))}getAuthenticatedAccounts(){return PS(this,void 0,void 0,(function*(){const e=yield this.get(MS);return Promise.all(e.map((e=>this.get(e))))}))}}class zS{constructor(e){this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useResetPassword=e.useResetPassword,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.planProductType=e.planProductType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete}}var KS=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},BS=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},GS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class QS{constructor(e,t,i,n,s,o,r,a,l,c,u,d,h,p,g,v){this.apiService=e,this.settingsService=t,this.folderService=i,this.cipherService=n,this.cryptoService=s,this.collectionService=o,this.messagingService=r,this.policyService=a,this.sendService=l,this.logService=c,this.keyConnectorService=u,this.stateService=d,this.organizationService=h,this.providerService=p,this.folderApiService=g,this.logoutCallback=v,this.syncInProgress=!1,this._sync=new Be.x,this.sync$=this._sync.asObservable()}getLastSync(){return GS(this,void 0,void 0,(function*(){if(null==(yield this.stateService.getUserId()))return null;const e=yield this.stateService.getLastSync();return e?new Date(e):null}))}setLastSync(e,t){return GS(this,void 0,void 0,(function*(){yield this.stateService.setLastSync(e.toJSON(),{userId:t})}))}fullSync(e,t=!1){return GS(this,void 0,void 0,(function*(){this.syncStarted();if(!(yield this.stateService.getIsAuthenticated()))return this.syncCompleted(!1);const i=new Date;let n=!1;try{n=yield this.needsSyncing(e)}catch(e){if(t)throw e}if(!n)return yield this.setLastSync(i),this.syncCompleted(!1);try{yield this.apiService.refreshIdentityToken();const e=yield this.apiService.getSync();return yield this.syncProfile(e.profile),yield this.syncFolders(e.folders),yield this.syncCollections(e.collections),yield this.syncCiphers(e.ciphers),yield this.syncSends(e.sends),yield this.syncSettings(e.domains),yield this.syncPolicies(e.policies),yield this.setLastSync(i),this.syncCompleted(!0)}catch(e){if(t)throw e;return this.syncCompleted(!1)}}))}syncUpsertFolder(e,t){return GS(this,void 0,void 0,(function*(){if(this.syncStarted(),yield this.stateService.getIsAuthenticated())try{const i=yield this.folderService.get(e.id);if(!t&&null==i||t&&null!=i&&i.revisionDate=e.revisionDate&&(i=!1);let s=!1;if(i&&(t?(i=null!=n,s=!0):null==e.collectionIds||null==e.organizationId?i=null==n:(i=!1,s=!0)),!i&&s&&null!=e.organizationId&&null!=e.collectionIds&&e.collectionIds.length>0){const t=yield this.collectionService.getAll();if(null!=t)for(let n=0;n-1){i=!0;break}}if(i){const t=yield this.apiService.getFullCipherDetails(e.id);if(null!=t)return yield this.cipherService.upsert(new mm(t)),this.messagingService.send("syncedUpsertedCipher",{cipherId:e.id}),this.syncCompleted(!0)}}catch(i){if(null!=i&&404===i.statusCode&&t)return yield this.cipherService.delete(e.id),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0)}return this.syncCompleted(!1)}))}syncDeleteCipher(e){return GS(this,void 0,void 0,(function*(){return this.syncStarted(),(yield this.stateService.getIsAuthenticated())?(yield this.cipherService.delete(e.id),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0)):this.syncCompleted(!1)}))}syncUpsertSend(e,t){return GS(this,void 0,void 0,(function*(){if(this.syncStarted(),yield this.stateService.getIsAuthenticated())try{const i=yield this.sendService.get(e.id);if(!t&&null==i||t&&null!=i&&i.revisionDate{i[e.id]=new zS(e)}));const n={};e.providers.forEach((e=>{n[e.id]=new uS(e)})),e.providerOrganizations.forEach((e=>{null==i[e.id]&&(i[e.id]=new zS(e),i[e.id].isProviderUser=!0)})),yield this.organizationService.save(i),yield this.providerService.save(n),(yield this.keyConnectorService.userNeedsMigration())?(yield this.keyConnectorService.setConvertAccountRequired(!0),this.messagingService.send("convertAccountToKeyConnector")):this.keyConnectorService.removeConvertAccountRequired()}))}syncFolders(e){return GS(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new $w(e)})),yield this.folderService.replace(t)}))}syncCollections(e){return GS(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new Vm(e)})),yield this.collectionService.replace(t)}))}syncCiphers(e){return GS(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new mm(e)})),yield this.cipherService.replace(t)}))}syncSends(e){return GS(this,void 0,void 0,(function*(){const t={};return e.forEach((e=>{t[e.id]=new $b(e)})),yield this.sendService.replace(t)}))}syncSettings(e){return GS(this,void 0,void 0,(function*(){let t=[];return null!=e&&null!=e.equivalentDomains&&(t=t.concat(e.equivalentDomains)),null!=e&&null!=e.globalEquivalentDomains&&e.globalEquivalentDomains.forEach((e=>{e.domains.length>0&&t.push(e.domains)})),this.settingsService.setEquivalentDomains(t)}))}syncPolicies(e){return GS(this,void 0,void 0,(function*(){const t={};return null!=e&&e.forEach((e=>{t[e.id]=new Mb(e)})),yield this.policyService.replace(t)}))}}KS([cm((()=>"fullSync")),BS("design:type",Function),BS("design:paramtypes",[Boolean,Object]),BS("design:returntype",Promise)],QS.prototype,"fullSync",null);var VS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const HS="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",jS="23456789BCDFGHJKMNPQRTVWXY";class WS{constructor(e,t){this.cryptoFunctionService=e,this.logService=t}getCode(e){return VS(this,void 0,void 0,(function*(){if(null==e)return null;let t=30,i="sha1",n=6,s=e;const o=0===e.toLowerCase().indexOf("otpauth://"),r=!o&&0===e.toLowerCase().indexOf("steam://");if(o){const o=nt.getQueryParams(e);if(o.has("digits")&&null!=o.get("digits"))try{const e=parseInt(o.get("digits").trim(),null);e>10?n=10:e>0&&(n=e)}catch(e){this.logService.error("Invalid digits param.")}if(o.has("period")&&null!=o.get("period"))try{const e=parseInt(o.get("period").trim(),null);e>0&&(t=e)}catch(e){this.logService.error("Invalid period param.")}if(o.has("secret")&&null!=o.get("secret")&&(s=o.get("secret")),o.has("algorithm")&&null!=o.get("algorithm")){const e=o.get("algorithm").toLowerCase();"sha1"!==e&&"sha256"!==e&&"sha512"!==e||(i=e)}}else r&&(s=e.substr("steam://".length),n=5);const a=Math.round((new Date).getTime()/1e3),l=this.leftPad(this.decToHex(Math.floor(a/t)),16,"0"),c=nt.fromHexToArray(l),u=this.b32ToBytes(s);if(!u.length||!c.length)return null;const d=yield this.sign(u,c,i);if(0===d.length)return null;const h=15&d[d.length-1],p=(127&d[h])<<24|(255&d[h+1])<<16|(255&d[h+2])<<8|255&d[h+3];let g="";if(r){let e=2147483647&p;for(let t=0;t=e.length&&(e=Array(t+1-e.length).join(i)+e),e}decToHex(e){return(e<15.5?"0":"")+Math.round(e).toString(16)}b32ToHex(e){e=e.toUpperCase();let t="";for(let i=0;i0&&e.methodResponses[0].length>0)if("MaskedEmail/set"===e.methodResponses[0][0]){if(null!=(null===(n=null===(i=e.methodResponses[0][1])||void 0===i?void 0:i.created)||void 0===n?void 0:n["new-masked-email"]))return null===(r=null===(o=null===(s=e.methodResponses[0][1])||void 0===s?void 0:s.created)||void 0===o?void 0:o["new-masked-email"])||void 0===r?void 0:r.email;if(null!=(null===(l=null===(a=e.methodResponses[0][1])||void 0===a?void 0:a.notCreated)||void 0===l?void 0:l["new-masked-email"]))throw"Fastmail error: "+(null===(d=null===(u=null===(c=e.methodResponses[0][1])||void 0===c?void 0:c.notCreated)||void 0===u?void 0:u["new-masked-email"])||void 0===d?void 0:d.description)}else if("error"===e.methodResponses[0][0])throw"Fastmail error: "+(null===(h=e.methodResponses[0][1])||void 0===h?void 0:h.description)}if(401===y.status||403===y.status)throw"Invalid Fastmail API token.";throw"Unknown Fastmail error occurred."}))}getAccountId(e,t){return aU(this,void 0,void 0,(function*(){const i={cache:"no-store",method:"GET",headers:new Headers({Authorization:"Bearer "+t.apiKey})},n=new Request("https://api.fastmail.com/.well-known/jmap",i),s=yield e.nativeFetch(n);if(200===s.status){const e=yield s.json();if(null!=e.primaryAccounts)return e.primaryAccounts["https://www.fastmail.com/dev/maskedemail"]}return null}))}}var cU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class uU{generate(e,t){return cU(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid Firefox Relay API token.";const i={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authorization:"Token "+t.apiKey,"Content-Type":"application/json"})};i.body=JSON.stringify({enabled:!0,generated_for:t.website,description:(null!=t.website?t.website+" - ":"")+"Generated by Bitwarden."});const n=new Request("https://relay.firefox.com/api/v1/relayaddresses/",i),s=yield e.nativeFetch(n);if(200===s.status||201===s.status){const e=yield s.json();return null==e?void 0:e.full_address}if(401===s.status)throw"Invalid Firefox Relay API token.";throw"Unknown Firefox Relay error occurred."}))}}class dU{constructor(){this.fastmail=new hU,this.anonaddy=new pU}}class hU{}class pU{}var gU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vU{generate(e,t){return gU(this,void 0,void 0,(function*(){if(null==t.apiKey||""===t.apiKey)throw"Invalid SimpleLogin API key.";const i={redirect:"manual",cache:"no-store",method:"POST",headers:new Headers({Authentication:t.apiKey,"Content-Type":"application/json"})};let n="https://app.simplelogin.io/api/alias/random/new";null!=t.website&&(n+="?hostname="+t.website),i.body=JSON.stringify({note:(null!=t.website?"Website: "+t.website+". ":"")+"Generated by Bitwarden."});const s=new Request(n,i),o=yield e.nativeFetch(s);if(200===o.status||201===o.status){return(yield o.json()).alias}if(401===o.status)throw"Invalid SimpleLogin API key.";try{const e=yield o.json();if(null!=(null==e?void 0:e.error))throw"SimpleLogin error:"+e.error}catch(e){}throw"Unknown SimpleLogin error occurred."}))}}var yU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fU={type:"word",wordCapitalize:!0,wordIncludeNumber:!0,subaddressType:"random",catchallType:"random",forwardedService:"simplelogin",forwardedAnonAddyDomain:"anonaddy.me"};class mU{constructor(e,t,i){this.cryptoService=e,this.stateService=t,this.apiService=i}generateUsername(e){return"catchall"===e.type?this.generateCatchall(e):"subaddress"===e.type?this.generateSubaddress(e):"forwarded"===e.type?this.generateForwarded(e):this.generateWord(e)}generateWord(e){return yU(this,void 0,void 0,(function*(){const t=Object.assign({},fU,e);null==t.wordCapitalize&&(t.wordCapitalize=!0),null==t.wordIncludeNumber&&(t.wordIncludeNumber=!0);const i=yield this.cryptoService.randomNumber(0,dw.length-1);let n=dw[i];if(t.wordCapitalize&&(n=n.charAt(0).toUpperCase()+n.slice(1)),t.wordIncludeNumber){const e=yield this.cryptoService.randomNumber(1,9999);n+=this.zeroPad(e.toString(),4)}return n}))}generateSubaddress(e){return yU(this,void 0,void 0,(function*(){const t=Object.assign({},fU,e),i=t.subaddressEmail;if(null==i||i.length<3)return t.subaddressEmail;const n=i.indexOf("@");if(n<1||n>=i.length-1)return i;null==t.subaddressType&&(t.subaddressType="random");const s=i.substr(0,n),o=i.substr(n+1,i.length);let r="";return"random"===t.subaddressType?r=yield this.randomString(8):"website-name"===t.subaddressType&&(r=t.website),s+"+"+r+"@"+o}))}generateCatchall(e){return yU(this,void 0,void 0,(function*(){const t=Object.assign({},fU,e);if(null==t.catchallDomain||""===t.catchallDomain)return null;null==t.catchallType&&(t.catchallType="random");let i="";return"random"===t.catchallType?i=yield this.randomString(8):"website-name"===t.catchallType&&(i=t.website),i+"@"+t.catchallDomain}))}generateForwarded(e){return yU(this,void 0,void 0,(function*(){const t=Object.assign({},fU,e);if(null==t.forwardedService)return null;let i=null;const n=new dU;return n.website=t.website,"simplelogin"===t.forwardedService?(i=new vU,n.apiKey=t.forwardedSimpleLoginApiKey):"anonaddy"===t.forwardedService?(i=new sU,n.apiKey=t.forwardedAnonAddyApiToken,n.anonaddy.domain=t.forwardedAnonAddyDomain):"firefoxrelay"===t.forwardedService?(i=new uU,n.apiKey=t.forwardedFirefoxApiToken):"fastmail"===t.forwardedService?(i=new lU,n.apiKey=t.forwardedFastmailApiToken):"duckduckgo"===t.forwardedService&&(i=new rU,n.apiKey=t.forwardedDuckDuckGoToken),null==i?null:i.generate(this.apiService,n)}))}getOptions(){return yU(this,void 0,void 0,(function*(){let e=yield this.stateService.getUsernameGenerationOptions();return e=null==e?Object.assign({},fU):Object.assign({},fU,e),yield this.stateService.setUsernameGenerationOptions(e),e}))}saveOptions(e){return yU(this,void 0,void 0,(function*(){yield this.stateService.setUsernameGenerationOptions(e)}))}randomString(e){return yU(this,void 0,void 0,(function*(){let t="";const i="abcdefghijklmnopqrstuvwxyz1234567890";for(let n=0;n=t?e:new Array(t-e.length+1).join("0")+e}}var wU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bU{constructor(e,t,i,n,s,o,r,a,l,c,u,d=null,h=null){this.cipherService=e,this.folderService=t,this.collectionService=i,this.cryptoService=n,this.platformUtilsService=s,this.messagingService=o,this.searchService=r,this.keyConnectorService=a,this.stateService=l,this.authService=c,this.vaultTimeoutSettingsService=u,this.lockedCallback=d,this.loggedOutCallback=h,this.inited=!1}init(e){this.inited||(this.inited=!0,e&&this.startCheck())}startCheck(){this.checkVaultTimeout(),setInterval((()=>this.checkVaultTimeout()),1e4)}checkVaultTimeout(){return wU(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.isViewOpen()))for(const e in this.stateService.accounts.getValue())null!=e&&(yield this.shouldLock(e))&&(yield this.executeTimeoutAction(e))}))}lock(e){return wU(this,void 0,void 0,(function*(){if(yield this.stateService.getIsAuthenticated({userId:e})){if(yield this.keyConnectorService.getUsesKeyConnector()){const t=yield this.vaultTimeoutSettingsService.isPinLockSet();t[0]&&null!=(yield this.stateService.getDecryptedPinProtected())||t[1]||(yield this.vaultTimeoutSettingsService.isBiometricLockSet())||(yield this.logOut(e))}null!=e&&e!==(yield this.stateService.getUserId())||(this.searchService.clearIndex(),yield this.folderService.clearCache()),yield this.stateService.setEverBeenUnlocked(!0,{userId:e}),yield this.stateService.setCryptoMasterKeyAuto(null,{userId:e}),yield this.cryptoService.clearKey(!1,e),yield this.cryptoService.clearOrgKeys(!0,e),yield this.cryptoService.clearKeyPair(!0,e),yield this.cryptoService.clearEncKey(!0,e),yield this.cipherService.clearCache(e),yield this.collectionService.clearCache(e),this.messagingService.send("locked",{userId:e}),null!=this.lockedCallback&&(yield this.lockedCallback(e))}}))}logOut(e){return wU(this,void 0,void 0,(function*(){null!=this.loggedOutCallback&&(yield this.loggedOutCallback(!1,e))}))}shouldLock(e){return wU(this,void 0,void 0,(function*(){const t=yield this.authService.getAuthStatus(e);if(t===Oe.Locked||t===Oe.LoggedOut)return!1;const i=yield this.vaultTimeoutSettingsService.getVaultTimeout(e);if(null==i||i<0)return!1;const n=yield this.stateService.getLastActive({userId:e});if(null==n)return!1;const s=60*i;return((new Date).getTime()-n)/1e3>=s}))}executeTimeoutAction(e){return wU(this,void 0,void 0,(function*(){"logOut"===(yield this.stateService.getVaultTimeoutAction({userId:e}))?yield this.logOut(e):yield this.lock(e)}))}}var SU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class UU{constructor(e,t,i,n){this.cryptoService=e,this.tokenService=t,this.policyService=i,this.stateService=n}setVaultTimeoutOptions(e,t){return SU(this,void 0,void 0,(function*(){yield this.stateService.setVaultTimeout(e);const i=yield this.tokenService.getToken(),n=yield this.tokenService.getRefreshToken(),s=yield this.tokenService.getClientId(),o=yield this.tokenService.getClientSecret(),r=yield this.stateService.getVaultTimeoutAction();null==e&&0!==e||"logOut"!==t||t===r||(yield this.tokenService.clearToken()),yield this.stateService.setVaultTimeoutAction(t),yield this.tokenService.setToken(i),yield this.tokenService.setRefreshToken(n),yield this.tokenService.setClientId(s),yield this.tokenService.setClientSecret(o),yield this.cryptoService.toggleKey()}))}isPinLockSet(){return SU(this,void 0,void 0,(function*(){return[null!=(yield this.stateService.getProtectedPin()),null!=(yield this.stateService.getEncryptedPinProtected())]}))}isBiometricLockSet(){return SU(this,void 0,void 0,(function*(){return yield this.stateService.getBiometricUnlock()}))}getVaultTimeout(e){return SU(this,void 0,void 0,(function*(){const t=yield this.stateService.getVaultTimeout({userId:e});if(yield this.policyService.policyAppliesToUser(qs.MaximumVaultTimeout,null,e)){const i=yield this.policyService.getAll(qs.MaximumVaultTimeout,e);let n=Math.min(t,i[0].data.minutes);return(null==t||n<0)&&(n=i[0].data.minutes),t!==n&&(yield this.stateService.setVaultTimeout(n,{userId:e})),n}return t}))}clear(e){return SU(this,void 0,void 0,(function*(){yield this.stateService.setEverBeenUnlocked(!1,{userId:e}),yield this.stateService.setDecryptedPinProtected(null,{userId:e}),yield this.stateService.setProtectedPin(null,{userId:e})}))}}var xU=i(57897);class AU{}var _U=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ZU{constructor(e){this.crypto=void 0!==e.crypto?e.crypto:null,this.subtle=this.crypto&&void 0!==e.crypto.subtle?e.crypto.subtle:null}pbkdf2(e,t,i,n){return _U(this,void 0,void 0,(function*(){const s="sha256"===i?256:512,o=this.toBuf(e),r={name:"PBKDF2",salt:this.toBuf(t),iterations:n,hash:{name:this.toWebCryptoAlgorithm(i)}},a=yield this.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]);return yield this.subtle.deriveBits(r,a,s)}))}hkdf(e,t,i,n,s){return _U(this,void 0,void 0,(function*(){const o={name:"HKDF",salt:this.toBuf(t),info:this.toBuf(i),hash:{name:this.toWebCryptoAlgorithm(s)}},r=yield this.subtle.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"]);return yield this.subtle.deriveBits(o,r,8*n)}))}hkdfExpand(e,t,i,n){return _U(this,void 0,void 0,(function*(){const s="sha256"===n?32:64;if(i>255*s)throw new Error("outputByteSize is too large.");if(new Uint8Array(e).length=i)break}return u.slice(0,i).buffer}))}hash(e,t){return _U(this,void 0,void 0,(function*(){if("md5"===t){const i="md5"===t?xU.md.md5.create():xU.md.sha1.create(),n=this.toByteString(e);return i.update(n,"raw"),nt.fromByteStringToArray(i.digest().data).buffer}const i=this.toBuf(e);return yield this.subtle.digest({name:this.toWebCryptoAlgorithm(t)},i)}))}hmac(e,t,i){return _U(this,void 0,void 0,(function*(){const n={name:"HMAC",hash:{name:this.toWebCryptoAlgorithm(i)}},s=yield this.subtle.importKey("raw",t,n,!1,["sign"]);return yield this.subtle.sign(n,s,e)}))}compare(e,t){return _U(this,void 0,void 0,(function*(){const i=yield this.randomBytes(32),n={name:"HMAC",hash:{name:"SHA-256"}},s=yield this.subtle.importKey("raw",i,n,!1,["sign"]),o=yield this.subtle.sign(n,s,e),r=yield this.subtle.sign(n,s,t);if(o.byteLength!==r.byteLength)return!1;const a=new Uint8Array(o),l=new Uint8Array(r);for(let e=0;e{t(e)})):this.subscribers.has(t)&&this.subscribers.get(t)(e)}subscribe(e,t){this.subscribers.set(e,t)}unsubscribe(e){this.subscribers.has(e)&&this.subscribers.delete(e)}}{}TU.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(TU)))(t||TU)}}(),TU.ɵprov=s.Yz7({token:TU,factory:TU.ɵfac});var CU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class kU{constructor(e,t,i,n){this.modalRef=e,this.cryptoService=t,this.platformUtilsService=i,this.i18nService=n,this.showPassword=!1,this.masterPassword=""}togglePassword(){this.showPassword=!this.showPassword}submit(){return CU(this,void 0,void 0,(function*(){(yield this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,null))?this.modalRef.close(!0):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"))}))}}kU.ɵfac=function(e){return new(e||kU)(s.Y36(rl),s.Y36(zt),s.Y36(Je),s.Y36(_e))},kU.ɵdir=s.lG2({type:kU});var OU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class PU{constructor(e,t){this.modalService=e,this.keyConnectorService=t,this.component=kU}protectedFields(){return["TOTP","Password","H_Field","Card Number","Security Code"]}showPasswordPrompt(){return OU(this,void 0,void 0,(function*(){if(!(yield this.enabled()))return!0;const e=this.modalService.open(this.component,{allowMultipleModals:!0});if(null==e)return!1;return!0===(yield e.onClosedPromise())}))}enabled(){return OU(this,void 0,void 0,(function*(){return!(yield this.keyConnectorService.getUsesKeyConnector())}))}}PU.ɵfac=function(e){return new(e||PU)(s.LFG(gl),s.LFG(De))},PU.ɵprov=s.Yz7({token:PU,factory:PU.ɵfac});class IU{}IU.ɵfac=function(e){return new(e||IU)},IU.ɵmod=s.oAB({type:IU}),IU.ɵinj=s.cJS({providers:[kt,Fe,Re,Le,gl,{provide:Vg,useValue:window},{provide:s.soG,useFactory:e=>e.translationLocale,deps:[_e]},{provide:tv,useValue:"./locales"},{provide:iv,useFactory:e=>e.navigator.language,deps:[Vg]},{provide:Wg,useValue:new xv(Nv,Mv)},{provide:$g,useValue:!0},{provide:Xg,useFactory:e=>(t,i)=>e.send("logout",{expired:t,userId:i}),deps:[qe]},{provide:ev,useValue:null},{provide:nv,useValue:!0},{provide:An,useClass:Rf,deps:[mv]},{provide:Uc,useClass:Kf,deps:[Ft,Tt]},{provide:Ie,useClass:lm,deps:[zt,Tt,tp,An,Je,qe,Ct,De,Ye,Mt,pn,_e]},{provide:Sc,useFactory:(e,t,i,n,s,o,r,a)=>new Qm(e,t,i,n,s,(()=>o.get(jo)),r,a),deps:[zt,yv,Tt,pv,_e,s.zs3,Ct,Mt]},{provide:ba,useClass:sb,deps:[zt,_e,Sc,Mt]},{provide:class extends ba{},useExisting:ba},{provide:Sa,useClass:tb,deps:[ba,Tt]},{provide:dv,useClass:class{constructor(e){this.apiService=e}deleteAccount(e){return this.apiService.send("DELETE","/accounts",e,!0,!1)}},deps:[Tt]},{provide:class{},useClass:class{constructor(e,t,i,n){this.accountApiService=e,this.userVerificationService=t,this.messagingService=i,this.logService=n}delete(e){return Lv(this,void 0,void 0,(function*(){try{const t=yield this.userVerificationService.buildRequest(e);yield this.accountApiService.deleteAccount(t),this.messagingService.send("logout")}catch(e){throw this.logService.error(e),e}}))}},deps:[dv,Wr,qe,Ct]},{provide:Ct,useFactory:()=>new cw(!1)},{provide:xc,useClass:$m,deps:[zt,_e,Mt]},{provide:Ye,useClass:He,deps:[Mt]},{provide:Ma,useClass:WS,deps:[Ft,Ct,Mt]},{provide:tp,useClass:OS,deps:[Mt]},{provide:zt,useClass:ww,deps:[Ft,uv,Je,Ct,Mt]},{provide:Dt,useClass:Db,deps:[zt,Hi,Mt]},{provide:Hn,useClass:mU,deps:[zt,Mt,Tt]},{provide:Tt,useClass:Lf,deps:[tp,Je,Ye,An,Xg]},{provide:pv,useClass:Ww,deps:[Ct,Tt]},{provide:bi,useClass:QS,deps:[Tt,yv,ba,Sc,zt,xc,qe,Hi,Ks,Ct,De,Mt,ta,vv,Sa,Xg]},{provide:Tn,useClass:TU},{provide:yv,useClass:cS,deps:[Mt]},{provide:Bt,useClass:UU,deps:[zt,tp,Hi,Mt]},{provide:Kt,useClass:bU,deps:[Sc,ba,xc,zt,Je,qe,jo,De,Mt,Ie,Bt,ev,Xg]},{provide:Mt,useClass:_S,deps:[mv,jg,Hg,Ct,fv,Wg,$g]},{provide:fv,useClass:YS,deps:[mv,jg,Wg]},{provide:Hr,useClass:Kw,deps:[ba,Sc,Tt,zt,Ft]},{provide:jo,useClass:Hb,deps:[Sc,Ct,_e]},{provide:gv,useClass:ub,deps:[bi,An,Tt,Ye,Xg,Ct,Mt,Ie]},{provide:Ft,useClass:ZU,deps:[Vg]},{provide:uv,useClass:Uw,deps:[Ft,Ct,nv]},{provide:jr,useClass:Zw,deps:[Tt,Sc,Mt,Ct,ta]},{provide:Hi,useClass:zb,deps:[Mt,ta]},{provide:class extends Hi{},useExisting:Hi},{provide:$i,useClass:Lb,deps:[Hi,Tt,Mt,ta]},{provide:Ks,useClass:rS,deps:[zt,Tt,pv,_e,Ft,Mt]},{provide:De,useClass:lb,deps:[Mt,zt,Tt,tp,Ct,ta,Ft,Xg]},{provide:Wr,useClass:iU,deps:[zt,_e,bv]},{provide:Ac,useClass:PU},{provide:ta,useClass:mb,deps:[Mt]},{provide:vv,useClass:Gb,deps:[Mt]},{provide:pn,useClass:xn,deps:[_e,Je]},{provide:Fa,useClass:cv},{provide:fi,useClass:class{getFormValidationErrors(e){let t=[];return Object.keys(e).forEach((i=>{const n=e[i];n instanceof ue.nJ&&(t=t.concat(this.getFormValidationErrors(n.controls)));const s=e[i].errors;null!==s&&Object.keys(s).forEach((e=>{t.push({controlName:i,errorName:e})}))})),t}}},{provide:bv,useClass:XS,deps:[Tt]},{provide:Ri,useClass:class{constructor(e){this.apiService=e}get(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e,null,!0,!0);return new Zb(t)}))}getBilling(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing",null,!0,!0);return new py(t)}))}getSubscription(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/subscription",null,!0,!0);return new Tb(t)}))}getLicense(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("GET","/organizations/"+e+"/license?installationId="+t,null,!0,!0)}))}getAutoEnrollStatus(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/auto-enroll-status",null,!0,!0);return new xb(t)}))}create(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/organizations",e,!0,!0);return new Zb(t)}))}createLicense(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("POST","/organizations/license",e,!0,!0);return new Zb(t)}))}save(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("PUT","/organizations/"+e,t,!0,!0);return new Zb(i)}))}updatePayment(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/payment",t,!0,!1)}))}upgrade(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/upgrade",t,!0,!0);return new Xy(i)}))}updateSubscription(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/subscription",t,!0,!1)}))}updateSeats(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/seat",t,!0,!0);return new Xy(i)}))}updateStorage(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/storage",t,!0,!0);return new Xy(i)}))}verifyBank(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/verify-bank",t,!0,!1)}))}cancel(e){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/cancel",null,!0,!1)}))}reinstate(e){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/reinstate",null,!0,!1)}))}leave(e){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/leave",null,!0,!1)}))}delete(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("DELETE","/organizations/"+e,t,!0,!1)}))}updateLicense(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/license",t,!0,!1)}))}importDirectory(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("POST","/organizations/"+e+"/import",t,!0,!1)}))}getOrCreateApiKey(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/api-key",t,!0,!0);return new ey(i)}))}getApiKeyInformation(e,t=null){return Cb(this,void 0,void 0,(function*(){const i=null===t?"/organizations/"+e+"/api-key-information":"/organizations/"+e+"/api-key-information/"+t,n=yield this.apiService.send("GET",i,null,!0,!0);return new Ly(n,Ub)}))}rotateApiKey(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/rotate-api-key",t,!0,!0);return new ey(i)}))}getTaxInfo(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/tax",null,!0,!0);return new Af(t)}))}updateTaxInfo(e,t){return Cb(this,void 0,void 0,(function*(){return this.apiService.send("PUT","/organizations/"+e+"/tax",t,!0,!1)}))}getKeys(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/keys",null,!0,!0);return new _b(t)}))}updateKeys(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/keys",t,!0,!0);return new _b(i)}))}getSso(e){return Cb(this,void 0,void 0,(function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/sso",null,!0,!0);return new bb(t)}))}updateSso(e,t){return Cb(this,void 0,void 0,(function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sso",t,!0,!0);return new bb(i)}))}},deps:[Tt]},{provide:bl,useClass:class{constructor(e,t){this.stateService=e,this.configApiService=t,this._serverConfig=new sv.X(null),this.serverConfig$=this._serverConfig.asObservable(),this.stateService.activeAccountUnlocked$.pipe((0,nw.w)((e=>e?(0,ow.H)(0,36e5).pipe((0,Oa.U)((()=>e))):(this._serverConfig.next(null),sw.E))),(0,Ge.b)((e=>lw(this,void 0,void 0,(function*(){return e?yield this.buildServerConfig():null}))))).subscribe((e=>{this._serverConfig.next(e)}))}buildServerConfig(){return lw(this,void 0,void 0,(function*(){const e=yield this.stateService.getServerConfig(),t=e?new rw(e):null;if(null==t||!t.isValid()||t.expiresSoon()){const e=yield this.fetchServerConfig();return null!=e?e:t}return t}))}fetchServerConfig(){return lw(this,void 0,void 0,(function*(){try{const e=yield this.configApiService.get();if(null!=e){const t=new Av(e);return yield this.stateService.setServerConfig(t),new rw(t)}}catch(e){return null}}))}},deps:[Mt,hv]},{provide:hv,useClass:class{constructor(e){this.apiService=e}get(){return iw(this,void 0,void 0,(function*(){const e=yield this.apiService.send("GET","/config",null,!0,!0);return new Xm(e)}))}},deps:[Tt]},{provide:class{},useClass:jv,deps:[Ye,Ie,Ct]}]});class qU{constructor(e,t){this.cryptoService=e,this.encryptService=t}attachToGlobal(e){e.bitwardenContainerService||(e.bitwardenContainerService=this)}getCryptoService(){if(null==this.cryptoService)throw new Error("ContainerService.cryptoService not initialized.");return this.cryptoService}getEncryptService(){if(null==this.encryptService)throw new Error("ContainerService.encryptService not initialized.");return this.encryptService}}var DU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class MU extends mv{constructor(){super(...arguments),this.store=new Map}get(e){if(this.store.has(e)){const t=this.store.get(e);return Promise.resolve(t)}return Promise.resolve(null)}has(e){return DU(this,void 0,void 0,(function*(){return null!=this.get(e)}))}save(e,t){return null==t?this.remove(e):(this.store.set(e,t),Promise.resolve())}remove(e){return this.store.delete(e),Promise.resolve()}}var FU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class NU{constructor(e,t,i=null,n){this.messagingService=e,this.platformUtilsService=t,this.reloadCallback=i,this.stateService=n,this.reloadInterval=null,this.clearClipboardTimeout=null,this.clearClipboardTimeoutFunction=null}startProcessReload(e){return FU(this,void 0,void 0,(function*(){const t=this.stateService.accounts.getValue();if(null!=t){const i=Object.keys(t);if(i.length>0)for(const t of i)if((yield e.getAuthStatus(t))===Oe.Unlocked)return}if(null!=this.reloadInterval)return;null==(yield this.stateService.getDecryptedPinProtected())&&(this.cancelProcessReload(),this.reloadInterval=setInterval((()=>FU(this,void 0,void 0,(function*(){return yield this.executeProcessReload()}))),1e4))}))}inactiveMoreThanSeconds(e){return FU(this,void 0,void 0,(function*(){const t=yield this.stateService.getLastActive();if(null!=t){return(new Date).getTime()-t>=1e3*e}return!0}))}executeProcessReload(){return FU(this,void 0,void 0,(function*(){const e=this.stateService.accounts.getValue(),t=null==e||0==Object.keys(e).length||(yield this.inactiveMoreThanSeconds(5)),i=yield this.stateService.getBiometricFingerprintValidated();t&&!i&&(clearInterval(this.reloadInterval),this.reloadInterval=null,this.messagingService.send("reloadProcess"),null!=this.reloadCallback&&(yield this.reloadCallback()))}))}cancelProcessReload(){null!=this.reloadInterval&&(clearInterval(this.reloadInterval),this.reloadInterval=null)}clearClipboard(e,t=null){return FU(this,void 0,void 0,(function*(){null!=this.clearClipboardTimeout&&(clearTimeout(this.clearClipboardTimeout),this.clearClipboardTimeout=null),nt.isNullOrWhitespace(e)||(yield this.stateService.getClearClipboard().then((i=>{null!=i&&(null==t&&(t=1e3*i),this.clearClipboardTimeoutFunction=()=>FU(this,void 0,void 0,(function*(){const t=yield this.platformUtilsService.readFromClipboard();e===t&&this.platformUtilsService.copyToClipboard("",{clearing:!0})})),this.clearClipboardTimeout=setTimeout((()=>FU(this,void 0,void 0,(function*(){yield this.clearPendingClipboard()}))),t))})))}))}clearPendingClipboard(){return FU(this,void 0,void 0,(function*(){null!=this.clearClipboardTimeoutFunction&&(yield this.clearClipboardTimeoutFunction(),this.clearClipboardTimeoutFunction=null)}))}}class LU{static sendMessageToApp(e,t=null,i=!1){return Wt.isSafariApi?new Promise((i=>{const n=(new Date).getTime().toString()+"_"+Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);browser.runtime.sendNativeMessage("com.bitwarden.desktop",{id:n,command:e,data:t,responseData:null},(e=>{i(e)}))})):Promise.resolve(null)}}class EU{}class RU extends EU{}class JU extends EU{}class YU extends qv{constructor(){super(...arguments),this.vaultTimeout=-1}}class zU extends Mv{constructor(e){var t,i,n,s;super(e),this.settings=new YU,Object.assign(this.settings,Object.assign(Object.assign({},new YU),this.settings)),this.groupings=null!==(t=null==e?void 0:e.groupings)&&void 0!==t?t:new RU,this.send=null!==(i=null==e?void 0:e.send)&&void 0!==i?i:new JU,this.ciphers=null!==(n=null==e?void 0:e.ciphers)&&void 0!==n?n:new EU,this.sendType=null!==(s=null==e?void 0:e.sendType)&&void 0!==s?s:new EU}}class KU{constructor(e){this.script=[],this.documentUUID={},this.properties={},this.options={},this.metadata={},this.autosubmit=null,this.documentUUID=e}}class BU{}BU.UsernameFieldNames=["username","user name","email","email address","e-mail","e-mail address","userid","user id","customer id","login id","benutzername","benutzer name","email adresse","e-mail adresse","benutzerid","benutzer id"],BU.PasswordFieldIgnoreList=["onetimepassword","captcha","findanything","forgot"],BU.ExcludedAutofillTypes=["radio","checkbox","hidden","file","button","image","reset","search"];class GU{}GU.CardAttributes=["autoCompleteType","data-stripe","htmlName","htmlID","label-tag","placeholder","label-left","label-top","data-recurly"],GU.CardAttributesExtended=[...GU.CardAttributes,"label-right"],GU.CardHolderFieldNames=["cc-name","card-name","cardholder-name","cardholder","name","nom"],GU.CardHolderFieldNameValues=["cc-name","card-name","cardholder-name","cardholder","tbName"],GU.CardNumberFieldNames=["cc-number","cc-num","card-number","card-num","number","cc","cc-no","card-no","credit-card","numero-carte","carte","carte-credit","num-carte","cb-num"],GU.CardNumberFieldNameValues=["cc-number","cc-num","card-number","card-num","cc-no","card-no","numero-carte","num-carte","cb-num"],GU.CardExpiryFieldNames=["cc-exp","card-exp","cc-expiration","card-expiration","cc-ex","card-ex","card-expire","card-expiry","validite","expiration","expiry","mm-yy","mm-yyyy","yy-mm","yyyy-mm","expiration-date","payment-card-expiration","payment-cc-date"],GU.CardExpiryFieldNameValues=["mm-yy","mm-yyyy","yy-mm","yyyy-mm","expiration-date","payment-card-expiration"],GU.ExpiryMonthFieldNames=["exp-month","cc-exp-month","cc-month","card-month","cc-mo","card-mo","exp-mo","card-exp-mo","cc-exp-mo","card-expiration-month","expiration-month","cc-mm","cc-m","card-mm","card-m","card-exp-mm","cc-exp-mm","exp-mm","exp-m","expire-month","expire-mo","expiry-month","expiry-mo","card-expire-month","card-expire-mo","card-expiry-month","card-expiry-mo","mois-validite","mois-expiration","m-validite","m-expiration","expiry-date-field-month","expiration-date-month","expiration-date-mm","exp-mon","validity-mo","exp-date-mo","cb-date-mois","date-m"],GU.ExpiryYearFieldNames=["exp-year","cc-exp-year","cc-year","card-year","cc-yr","card-yr","exp-yr","card-exp-yr","cc-exp-yr","card-expiration-year","expiration-year","cc-yy","cc-y","card-yy","card-y","card-exp-yy","cc-exp-yy","exp-yy","exp-y","cc-yyyy","card-yyyy","card-exp-yyyy","cc-exp-yyyy","expire-year","expire-yr","expiry-year","expiry-yr","card-expire-year","card-expire-yr","card-expiry-year","card-expiry-yr","an-validite","an-expiration","annee-validite","annee-expiration","expiry-date-field-year","expiration-date-year","cb-date-ann","expiration-date-yy","expiration-date-yyyy","validity-year","exp-date-year","date-y"],GU.CVVFieldNames=["cvv","cvc","cvv2","cc-csc","cc-cvv","card-csc","card-cvv","cvd","cid","cvc2","cnv","cvn2","cc-code","card-code","code-securite","security-code","crypto","card-verif","verification-code","csc","ccv"],GU.CardBrandFieldNames=["cc-type","card-type","card-brand","cc-brand","cb-type"],GU.MonthAbbr=["mm","mm","mm","mm","mm","mm"],GU.YearAbbrShort=["yy","åå","jj","aa","гг","rr"],GU.YearAbbrLong=["yyyy","åååå","jjjj","aa","гггг","rrrr"];class QU{}QU.IdentityAttributes=["autoCompleteType","data-stripe","htmlName","htmlID","label-tag","placeholder","label-left","label-top","data-recurly"],QU.FullNameFieldNames=["name","full-name","your-name"],QU.FullNameFieldNameValues=["full-name","your-name"],QU.TitleFieldNames=["honorific-prefix","prefix","title"],QU.FirstnameFieldNames=["f-name","first-name","given-name","first-n","vorname"],QU.MiddlenameFieldNames=["m-name","middle-name","additional-name","middle-initial","middle-n","middle-i"],QU.LastnameFieldNames=["l-name","last-name","s-name","surname","family-name","family-n","last-n","nachname","familienname"],QU.EmailFieldNames=["e-mail","email-address"],QU.AddressFieldNames=["address","street-address","addr","street","mailing-addr","billing-addr","mail-addr","bill-addr"],QU.AddressFieldNameValues=["mailing-addr","billing-addr","mail-addr","bill-addr"],QU.Address1FieldNames=["address-1","address-line-1","addr-1","street-1"],QU.Address2FieldNames=["address-2","address-line-2","addr-2","street-2"],QU.Address3FieldNames=["address-3","address-line-3","addr-3","street-3"],QU.PostalCodeFieldNames=["postal","zip","zip2","zip-code","postal-code","post-code","address-zip","address-postal","address-code","address-postal-code","address-zip-code"],QU.CityFieldNames=["city","town","address-level-2","address-city","address-town"],QU.StateFieldNames=["state","province","provence","address-level-1","address-state","address-province"],QU.CountryFieldNames=["country","country-code","country-name","address-country","address-country-name","address-country-code"],QU.PhoneFieldNames=["phone","mobile","mobile-phone","tel","telephone","phone-number"],QU.UserNameFieldNames=["user-name","user-id","screen-name"],QU.CompanyFieldNames=["company","company-name","organization","organization-name"],QU.IsoCountries={afghanistan:"AF","aland islands":"AX",albania:"AL",algeria:"DZ","american samoa":"AS",andorra:"AD",angola:"AO",anguilla:"AI",antarctica:"AQ","antigua and barbuda":"AG",argentina:"AR",armenia:"AM",aruba:"AW",australia:"AU",austria:"AT",azerbaijan:"AZ",bahamas:"BS",bahrain:"BH",bangladesh:"BD",barbados:"BB",belarus:"BY",belgium:"BE",belize:"BZ",benin:"BJ",bermuda:"BM",bhutan:"BT",bolivia:"BO","bosnia and herzegovina":"BA",botswana:"BW","bouvet island":"BV",brazil:"BR","british indian ocean territory":"IO","brunei darussalam":"BN",bulgaria:"BG","burkina faso":"BF",burundi:"BI",cambodia:"KH",cameroon:"CM",canada:"CA","cape verde":"CV","cayman islands":"KY","central african republic":"CF",chad:"TD",chile:"CL",china:"CN","christmas island":"CX","cocos (keeling) islands":"CC",colombia:"CO",comoros:"KM",congo:"CG","congo, democratic republic":"CD","cook islands":"CK","costa rica":"CR","cote d'ivoire":"CI",croatia:"HR",cuba:"CU",cyprus:"CY","czech republic":"CZ",denmark:"DK",djibouti:"DJ",dominica:"DM","dominican republic":"DO",ecuador:"EC",egypt:"EG","el salvador":"SV","equatorial guinea":"GQ",eritrea:"ER",estonia:"EE",ethiopia:"ET","falkland islands":"FK","faroe islands":"FO",fiji:"FJ",finland:"FI",france:"FR","french guiana":"GF","french polynesia":"PF","french southern territories":"TF",gabon:"GA",gambia:"GM",georgia:"GE",germany:"DE",ghana:"GH",gibraltar:"GI",greece:"GR",greenland:"GL",grenada:"GD",guadeloupe:"GP",guam:"GU",guatemala:"GT",guernsey:"GG",guinea:"GN","guinea-bissau":"GW",guyana:"GY",haiti:"HT","heard island & mcdonald islands":"HM","holy see (vatican city state)":"VA",honduras:"HN","hong kong":"HK",hungary:"HU",iceland:"IS",india:"IN",indonesia:"ID","iran, islamic republic of":"IR",iraq:"IQ",ireland:"IE","isle of man":"IM",israel:"IL",italy:"IT",jamaica:"JM",japan:"JP",jersey:"JE",jordan:"JO",kazakhstan:"KZ",kenya:"KE",kiribati:"KI","republic of korea":"KR","south korea":"KR","democratic people's republic of korea":"KP","north korea":"KP",kuwait:"KW",kyrgyzstan:"KG","lao people's democratic republic":"LA",latvia:"LV",lebanon:"LB",lesotho:"LS",liberia:"LR","libyan arab jamahiriya":"LY",liechtenstein:"LI",lithuania:"LT",luxembourg:"LU",macao:"MO",macedonia:"MK",madagascar:"MG",malawi:"MW",malaysia:"MY",maldives:"MV",mali:"ML",malta:"MT","marshall islands":"MH",martinique:"MQ",mauritania:"MR",mauritius:"MU",mayotte:"YT",mexico:"MX","micronesia, federated states of":"FM",moldova:"MD",monaco:"MC",mongolia:"MN",montenegro:"ME",montserrat:"MS",morocco:"MA",mozambique:"MZ",myanmar:"MM",namibia:"NA",nauru:"NR",nepal:"NP",netherlands:"NL","netherlands antilles":"AN","new caledonia":"NC","new zealand":"NZ",nicaragua:"NI",niger:"NE",nigeria:"NG",niue:"NU","norfolk island":"NF","northern mariana islands":"MP",norway:"NO",oman:"OM",pakistan:"PK",palau:"PW","palestinian territory, occupied":"PS",panama:"PA","papua new guinea":"PG",paraguay:"PY",peru:"PE",philippines:"PH",pitcairn:"PN",poland:"PL",portugal:"PT","puerto rico":"PR",qatar:"QA",reunion:"RE",romania:"RO","russian federation":"RU",rwanda:"RW","saint barthelemy":"BL","saint helena":"SH","saint kitts and nevis":"KN","saint lucia":"LC","saint martin":"MF","saint pierre and miquelon":"PM","saint vincent and grenadines":"VC",samoa:"WS","san marino":"SM","sao tome and principe":"ST","saudi arabia":"SA",senegal:"SN",serbia:"RS",seychelles:"SC","sierra leone":"SL",singapore:"SG",slovakia:"SK",slovenia:"SI","solomon islands":"SB",somalia:"SO","south africa":"ZA","south georgia and sandwich isl.":"GS",spain:"ES","sri lanka":"LK",sudan:"SD",suriname:"SR","svalbard and jan mayen":"SJ",swaziland:"SZ",sweden:"SE",switzerland:"CH","syrian arab republic":"SY",taiwan:"TW",tajikistan:"TJ",tanzania:"TZ",thailand:"TH","timor-leste":"TL",togo:"TG",tokelau:"TK",tonga:"TO","trinidad and tobago":"TT",tunisia:"TN",turkey:"TR",turkmenistan:"TM","turks and caicos islands":"TC",tuvalu:"TV",uganda:"UG",ukraine:"UA","united arab emirates":"AE","united kingdom":"GB","united states":"US","united states outlying islands":"UM",uruguay:"UY",uzbekistan:"UZ",vanuatu:"VU",venezuela:"VE",vietnam:"VN","virgin islands, british":"VG","virgin islands, u.s.":"VI","wallis and futuna":"WF","western sahara":"EH",yemen:"YE",zambia:"ZM",zimbabwe:"ZW"},QU.IsoStates={alabama:"AL",alaska:"AK","american samoa":"AS",arizona:"AZ",arkansas:"AR",california:"CA",colorado:"CO",connecticut:"CT",delaware:"DE","district of columbia":"DC","federated states of micronesia":"FM",florida:"FL",georgia:"GA",guam:"GU",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME","marshall islands":"MH",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND","northern mariana islands":"MP",ohio:"OH",oklahoma:"OK",oregon:"OR",palau:"PW",pennsylvania:"PA","puerto rico":"PR","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT","virgin islands":"VI",virginia:"VA",washington:"WA","west virginia":"WV",wisconsin:"WI",wyoming:"WY"},QU.IsoProvinces={alberta:"AB","british columbia":"BC",manitoba:"MB","new brunswick":"NB","newfoundland and labrador":"NL","nova scotia":"NS",ontario:"ON","prince edward island":"PE",quebec:"QC",saskatchewan:"SK"};var VU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class HU{constructor(e,t,i,n,s){this.cipherService=e,this.stateService=t,this.totpService=i,this.eventService=n,this.logService=s}getFormsWithPasswordFields(e){const t=[],i=HU.loadPasswordFields(e,!0,!0,!1,!1);if(0===i.length)return t;for(const n in e.forms){if(!e.forms.hasOwnProperty(n))continue;const s=i.filter((e=>n===e.form));if(s.length>0){let i=this.findUsernameField(e,s[0],!1,!1,!1);null==i&&(i=this.findUsernameField(e,s[0],!0,!0,!1)),t.push({form:e.forms[n],password:s[0],username:i,passwords:s})}}return t}doAutoFill(e){return VU(this,void 0,void 0,(function*(){const t=e.tab;if(!(t&&e.cipher&&e.pageDetails&&e.pageDetails.length))throw new Error("Nothing to auto-fill.");let i=null;const n=yield this.stateService.getCanAccessPremium();let s=!1;if(e.pageDetails.forEach((o=>{if(o.tab.id!==t.id||o.tab.url!==t.url)return;const r=this.generateFillScript(o.details,{skipUsernameOnlyFill:e.skipUsernameOnlyFill||!1,onlyEmptyFields:e.onlyEmptyFields||!1,onlyVisibleFields:e.onlyVisibleFields||!1,fillNewPassword:e.fillNewPassword||!1,cipher:e.cipher});r&&r.script&&r.script.length&&(r.properties.delay_between_operations=20,s=!0,e.skipLastUsed||this.cipherService.updateLastUsedDate(e.cipher.id),Wt.tabSendMessage(t,{command:"fillForm",fillScript:r,url:t.url},{frameId:o.frameId}),e.cipher.type===Bl.Login&&!i&&e.cipher.login.totp&&(n||e.cipher.organizationUseTotp)&&(i=this.stateService.getDisableAutoTotpCopy().then((t=>t?null:this.totpService.getCode(e.cipher.login.totp)))))})),s)return this.eventService.collect(Gr.Cipher_ClientAutofilled,e.cipher.id),null!=i?yield i:null;throw new Error("Did not auto-fill.")}))}doAutoFillOnTab(e,t,i){var n,s;return VU(this,void 0,void 0,(function*(){let o;if(i)o=yield this.cipherService.getNextCipherForUrl(t.url);else{const e=yield this.cipherService.getLastLaunchedForUrl(t.url,!0);if(o=e&&Date.now().valueOf()-(null===(s=null===(n=e.localData)||void 0===n?void 0:n.lastLaunched)||void 0===s?void 0:s.valueOf())<3e4?e:yield this.cipherService.getLastUsedForUrl(t.url,!0),null==o)return null}if(o.reprompt!==Kl.None)return;const r=yield this.doAutoFill({tab:t,cipher:o,pageDetails:e,skipLastUsed:!i,skipUsernameOnlyFill:!i,onlyEmptyFields:!i,onlyVisibleFields:!i,fillNewPassword:i});return i&&this.cipherService.updateLastUsedIndexForUrl(t.url),r}))}doAutoFillActiveTab(e,t){return VU(this,void 0,void 0,(function*(){const i=yield this.getActiveTab();if(i&&i.url)return yield this.doAutoFillOnTab(e,i,t)}))}getActiveTab(){return VU(this,void 0,void 0,(function*(){const e=yield Wt.getTabFromCurrentWindow();if(!e)throw new Error("No tab found.");return e}))}generateFillScript(e,t){if(!e||!t.cipher)return null;let i=new KU(e.documentUUID);const n={},s=t.cipher.fields;if(s&&s.length){const o=[];s.forEach((e=>{HU.hasValue(e.name)&&o.push(e.name.toLowerCase())})),e.fields.forEach((e=>{if(n.hasOwnProperty(e.opid))return;if(!e.viewable&&"span"!==e.tagName)return;const r=this.findMatchingFieldIndex(e,o);if(r>-1){const o=s[r];let a;o.type===_c.Linked?a=t.cipher.linkedFieldValue(o.linkedId):(a=o.value,null==a&&o.type===_c.Boolean&&(a="false")),n[e.opid]=e,HU.fillByOpid(i,e,a)}}))}switch(t.cipher.type){case Bl.Login:i=this.generateLoginFillScript(i,e,n,t);break;case Bl.Card:i=this.generateCardFillScript(i,e,n,t);break;case Bl.Identity:i=this.generateIdentityFillScript(i,e,n,t);break;default:return null}return i}generateLoginFillScript(e,t,i,n){if(!n.cipher.login)return null;const s=[],o=[];let r=null,a=null;const l=n.cipher.login;if(!l.password||""===l.password)return e=HU.setFillScriptForFocus(i,e);let c=HU.loadPasswordFields(t,!1,!1,n.onlyEmptyFields,n.fillNewPassword);c.length||n.onlyVisibleFields||(c=HU.loadPasswordFields(t,!0,!0,n.onlyEmptyFields,n.fillNewPassword));for(const e in t.forms){if(!t.forms.hasOwnProperty(e))continue;const i=[];c.forEach((t=>{e===t.form&&i.push(t)})),c.forEach((e=>{r=e,s.push(r),l.username&&(a=this.findUsernameField(t,r,!1,!1,!1),a||n.onlyVisibleFields||(a=this.findUsernameField(t,r,!0,!0,!1)),a&&o.push(a))}))}return c.length&&!s.length&&(r=c[0],s.push(r),l.username&&r.elementNumber>0&&(a=this.findUsernameField(t,r,!1,!1,!0),a||n.onlyVisibleFields||(a=this.findUsernameField(t,r,!0,!0,!0)),a&&o.push(a))),c.length||n.skipUsernameOnlyFill||t.fields.forEach((e=>{e.viewable&&("text"===e.type||"email"===e.type||"tel"===e.type)&&HU.fieldIsFuzzyMatch(e,BU.UsernameFieldNames)&&o.push(e)})),o.forEach((t=>{i.hasOwnProperty(t.opid)||(i[t.opid]=t,HU.fillByOpid(e,t,l.username))})),s.forEach((t=>{i.hasOwnProperty(t.opid)||(i[t.opid]=t,HU.fillByOpid(e,t,l.password))})),e=HU.setFillScriptForFocus(i,e)}generateCardFillScript(e,t,i,n){if(!n.cipher.card)return null;const s={};t.fields.forEach((e=>{if(!HU.forCustomFieldsOnly(e)&&!this.isExcludedType(e.type,BU.ExcludedAutofillTypes))for(let t=0;t1&&(t=n[1])}}else!this.fieldAttrsContain(s.expMonth,"mm")&&2!==s.expMonth.maxLength||1!==t.length||(t="0"+t);i[s.expMonth.opid]=s.expMonth,HU.fillByOpid(e,s.expMonth,t)}if(s.expYear&&HU.hasValue(o.expYear)){let t=o.expYear;if(s.expYear.selectInfo&&s.expYear.selectInfo.options)for(let e=0;e-1&&i[1].length>n+1){const e=i[1].substring(n+2);if(null!=e&&""!==e.trim()&&e===o.expYear){t=i[1];break}}}else this.fieldAttrsContain(s.expYear,"yyyy")||4===s.expYear.maxLength?2===t.length&&(t="20"+t):(this.fieldAttrsContain(s.expYear,"yy")||2===s.expYear.maxLength)&&4===t.length&&(t=t.substr(2));i[s.expYear.opid]=s.expYear,HU.fillByOpid(e,s.expYear,t)}if(s.exp&&HU.hasValue(o.expMonth)&&HU.hasValue(o.expYear)){const t=("0"+o.expMonth).slice(-2);let n=o.expYear,r=null;2===n.length?(r=n,n="20"+n):4===n.length&&(r=n.substr(2,2));let a=null;for(let e=0;e{if(i||!e.hasOwnProperty(n)||!e[n])return;let s=e[n];s=s.replace(/ /g,"").toLowerCase(),i=s.indexOf(t)>-1})),i}generateIdentityFillScript(e,t,i,n){if(!n.cipher.identity)return null;const s={};t.fields.forEach((e=>{if(!HU.forCustomFieldsOnly(e)&&!this.isExcludedType(e.type,BU.ExcludedAutofillTypes))for(let t=0;t2){const t=o.state.toLowerCase(),n=QU.IsoStates[t]||QU.IsoProvinces[t];n&&(r=!0,this.makeScriptActionWithValue(e,n,s.state,i))}r||this.makeScriptAction(e,o,s,i,"state");let a=!1;if(s.country&&o.country&&o.country.length>2){const t=o.country.toLowerCase(),n=QU.IsoCountries[t];n&&(a=!0,this.makeScriptActionWithValue(e,n,s.country,i))}if(a||this.makeScriptAction(e,o,s,i,"country"),s.name&&(o.firstName||o.lastName)){let t="";HU.hasValue(o.firstName)&&(t=o.firstName),HU.hasValue(o.middleName)&&(""!==t&&(t+=" "),t+=o.middleName),HU.hasValue(o.lastName)&&(""!==t&&(t+=" "),t+=o.lastName),this.makeScriptActionWithValue(e,t,s.name,i)}if(s.address&&HU.hasValue(o.address1)){let t="";HU.hasValue(o.address1)&&(t=o.address1),HU.hasValue(o.address2)&&(""!==t&&(t+=", "),t+=o.address2),HU.hasValue(o.address3)&&(""!==t&&(t+=", "),t+=o.address3),this.makeScriptActionWithValue(e,t,s.address,i)}return e}isExcludedType(e,t){return t.indexOf(e)>-1}static isFieldMatch(e,t,i){e=e.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,"");for(let n=0;n-1;if(s=s.toLowerCase().replace(/-/g,""),e===s||o&&e.indexOf(s)>-1)return!0}return!1}makeScriptAction(e,t,i,n,s,o){o=o||s,this.makeScriptActionWithValue(e,t[s],i[o],n)}makeScriptActionWithValue(e,t,i,n){let s=!1;if(HU.hasValue(t)&&i)if("select-one"===i.type&&i.selectInfo&&i.selectInfo.options)for(let e=0;e1&&(t=n[1]);break}if(s)break}else s=!0;s&&(n[i.opid]=i,HU.fillByOpid(e,i,t))}static loadPasswordFields(e,t,i,n,s){const o=[];return e.fields.forEach((e=>{if(HU.forCustomFieldsOnly(e))return;const r="password"===e.type,a=e=>{if(null==e)return!1;const t=e.toLowerCase().replace(/[\s_\-]/g,"");return!(t.indexOf("password")<0)&&!BU.PasswordFieldIgnoreList.some((e=>t.indexOf(e)>-1))};e.disabled||!i&&e.readonly||!(r||"text"===e.type&&(a(e.htmlID)||a(e.htmlName)||a(e.placeholder)))||!t&&!e.viewable||n&&null!=e.value&&""!==e.value.trim()||!s&&"new-password"===e.autoCompleteType||o.push(e)})),o}findUsernameField(e,t,i,n,s){let o=null;for(let r=0;r=t.elementNumber)break;if(!a.disabled&&(n||!a.readonly)&&(s||a.form===t.form)&&(i||a.viewable)&&("text"===a.type||"email"===a.type||"tel"===a.type)&&(o=a,this.findMatchingFieldIndex(a,BU.UsernameFieldNames)>-1))break}}return o}findMatchingFieldIndex(e,t){for(let i=0;i-1){if(this.fieldPropertyIsPrefixMatch(e,"htmlID",t[i],"id"))return i;if(this.fieldPropertyIsPrefixMatch(e,"htmlName",t[i],"name"))return i;if(this.fieldPropertyIsPrefixMatch(e,"label-tag",t[i],"label"))return i;if(this.fieldPropertyIsPrefixMatch(e,"label-aria",t[i],"label"))return i;if(this.fieldPropertyIsPrefixMatch(e,"placeholder",t[i],"placeholder"))return i}if(this.fieldPropertyIsMatch(e,"htmlID",t[i]))return i;if(this.fieldPropertyIsMatch(e,"htmlName",t[i]))return i;if(this.fieldPropertyIsMatch(e,"label-tag",t[i]))return i;if(this.fieldPropertyIsMatch(e,"label-aria",t[i]))return i;if(this.fieldPropertyIsMatch(e,"placeholder",t[i]))return i}return-1}fieldPropertyIsPrefixMatch(e,t,i,n,s="="){if(0===i.indexOf(n+s)){const n=i.indexOf(s),o=i.substring(n+1);return null!=o&&this.fieldPropertyIsMatch(e,t,o)}return!1}fieldPropertyIsMatch(e,t,i){let n=e[t];if(!HU.hasValue(n))return!1;if(n=n.trim().replace(/(?:\r\n|\r|\n)/g,""),i.startsWith("regex="))try{const e=i.split("=",2);if(2===e.length){return new RegExp(e[1],"i").test(n)}}catch(e){this.logService.error(e)}else if(i.startsWith("csv=")){const e=i.split("=",2);if(2===e.length){const t=e[1].split(",");for(let e=0;e-1)return!0;return!1}static hasValue(e){return e&&""!==e}static setFillScriptForFocus(e,t){let i=null,n=null;for(const t in e)e.hasOwnProperty(t)&&e[t].viewable&&(i=e[t],"password"===e[t].type&&(n=e[t]));return n?t.script.push(["focus_by_opid",n.opid]):i&&t.script.push(["focus_by_opid",i.opid]),t}static fillByOpid(e,t,i){t.maxLength&&i&&i.length>t.maxLength&&(i=i.substr(0,i.length)),"span"!==t.tagName&&(e.script.push(["click_on_opid",t.opid]),e.script.push(["focus_by_opid",t.opid])),e.script.push(["fill_by_opid",t.opid,i])}static forCustomFieldsOnly(e){return"span"===e.tagName}}var jU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class WU extends ww{retrieveKeyFromStorage(e){const t=Object.create(null,{retrieveKeyFromStorage:{get:()=>super.retrieveKeyFromStorage}});var i;return jU(this,void 0,void 0,(function*(){return"biometric"===e?(yield this.platformUtilService.authenticateBiometric(),null===(i=yield this.getKey())||void 0===i?void 0:i.keyB64):yield t.retrieveKeyFromStorage.call(this,e)}))}}var $U,XU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ex{get(e){return XU(this,void 0,void 0,(function*(){return new Promise((t=>{this.chromeStorageApi.get(e,(i=>{null==i||null==i[e]?t(null):t(i[e])}))}))}))}has(e){return XU(this,void 0,void 0,(function*(){return null!=(yield this.get(e))}))}save(e,t){return XU(this,void 0,void 0,(function*(){if(null==t)return new Promise((t=>{this.chromeStorageApi.remove(e,(()=>{t()}))}));t instanceof Set&&(t=Array.from(t));const i={[e]:t};return new Promise((e=>{this.chromeStorageApi.set(i,(()=>{e()}))}))}))}remove(e){return XU(this,void 0,void 0,(function*(){return new Promise((t=>{this.chromeStorageApi.remove(e,(()=>{t()}))}))}))}}class tx extends ex{constructor(){super(...arguments),this.chromeStorageApi=chrome.storage.local}}class ix{send(e,t={}){return Wt.sendMessage(e,t)}}class nx{send(e,t={}){const i=Object.assign({},{command:e},t);window.bitwardenPopupMainMessageListener(i)}}!function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Mobile="mobile",e.Cli="cli",e.DirectoryConnector="connector"}($U||($U={}));var sx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ox=6e5;class rx{constructor(e,t,i){this.messagingService=e,this.clipboardWriteCallback=t,this.biometricCallback=i,this.showDialogResolves=new Map,this.passwordDialogResolves=new Map,this.deviceCache=null}getDevice(){return this.deviceCache||(-1!==navigator.userAgent.indexOf(" Firefox/")||-1!==navigator.userAgent.indexOf(" Gecko/")?this.deviceCache=dl.FirefoxExtension:window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0?this.deviceCache=dl.OperaExtension:-1!==navigator.userAgent.indexOf(" Edg/")?this.deviceCache=dl.EdgeExtension:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.deviceCache=dl.VivaldiExtension:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.deviceCache=dl.ChromeExtension:-1!==navigator.userAgent.indexOf(" Safari/")&&(this.deviceCache=dl.SafariExtension)),this.deviceCache}getDeviceString(){return dl[this.getDevice()].toLowerCase().replace("extension","")}getClientType(){return $U.Browser}isFirefox(){return this.getDevice()===dl.FirefoxExtension}isChrome(){return this.getDevice()===dl.ChromeExtension}isEdge(){return this.getDevice()===dl.EdgeExtension}isOpera(){return this.getDevice()===dl.OperaExtension}isVivaldi(){return this.getDevice()===dl.VivaldiExtension}isSafari(){return this.getDevice()===dl.SafariExtension}isIE(){return!1}isMacAppStore(){return!1}isViewOpen(){return sx(this,void 0,void 0,(function*(){if(yield Wt.isPopupOpen())return!0;if(this.isSafari())return!1;const e=this.sidebarViewName();if(null!=e&&chrome.extension.getViews({type:e}).length>0)return!0;return chrome.extension.getViews({type:"tab"}).length>0}))}lockTimeout(){return null}launchUri(e,t){Wt.createNewTab(e,t&&!0===t.extensionPage)}getApplicationVersion(){return Promise.resolve(Wt.getApplicationVersion())}supportsWebAuthn(e){return"undefined"!=typeof PublicKeyCredential}supportsDuo(){return!0}showToast(e,t,i,n){this.messagingService.send("showToast",{text:i,title:t,type:e,options:n})}showDialog(e,t,i,n,s,o=!1){const r=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);return this.messagingService.send("showDialog",{text:o?null:e,html:o?e:null,title:t,confirmText:i,cancelText:n,type:s,dialogId:r}),new Promise((e=>{this.showDialogResolves.set(r,{resolve:e,date:new Date})}))}isDev(){return!1}isSelfHost(){return!1}copyToClipboard(e,t){let i=window,n=window.document;t&&(t.window||t.win)?(i=t.window||t.win,n=i.document):t&&t.doc&&(n=t.doc);const s=!!t&&!!t.clearing,o=t&&t.clearMs?t.clearMs:null;if(this.isSafari())LU.sendMessageToApp("copyToClipboard",e).then((()=>{s||null==this.clipboardWriteCallback||this.clipboardWriteCallback(e,o)}));else if(this.isFirefox()&&i.navigator.clipboard&&i.navigator.clipboard.writeText)i.navigator.clipboard.writeText(e).then((()=>{s||null==this.clipboardWriteCallback||this.clipboardWriteCallback(e,o)}));else if(i.clipboardData&&i.clipboardData.setData)i.clipboardData.setData("Text",e),s||null==this.clipboardWriteCallback||this.clipboardWriteCallback(e,o);else if(n.queryCommandSupported&&n.queryCommandSupported("copy")){this.isChrome()&&""===e&&(e="\0");const t=n.createElement("textarea");t.textContent=null==e||""===e?" ":e,t.style.position="fixed",n.body.appendChild(t),t.select();try{n.execCommand("copy")&&!s&&null!=this.clipboardWriteCallback&&this.clipboardWriteCallback(e,o)}catch(e){console.warn("Copy to clipboard failed.",e)}finally{n.body.removeChild(t)}}}readFromClipboard(e){return sx(this,void 0,void 0,(function*(){let t=window,i=window.document;if(e&&(e.window||e.win)?(t=e.window||e.win,i=t.document):e&&e.doc&&(i=e.doc),this.isSafari())return yield LU.sendMessageToApp("readFromClipboard");if(this.isFirefox()&&t.navigator.clipboard&&t.navigator.clipboard.readText)return yield t.navigator.clipboard.readText();if(i.queryCommandSupported&&i.queryCommandSupported("paste")){const e=i.createElement("textarea");e.style.position="fixed",i.body.appendChild(e),e.focus();try{if(i.execCommand("paste"))return e.value}catch(e){console.warn("Read from clipboard failed.",e)}finally{i.body.removeChild(e)}}return null}))}resolveDialogPromise(e,t){if(this.showDialogResolves.has(e)){this.showDialogResolves.get(e).resolve(t),this.showDialogResolves.delete(e)}this.showDialogResolves.forEach(((e,t)=>{(new Date).getTime()-e.date.getTime()>ox&&this.showDialogResolves.delete(t)}))}resolvePasswordDialogPromise(e,t,i){return sx(this,void 0,void 0,(function*(){let n=!1;if(this.passwordDialogResolves.has(e)){const s=this.passwordDialogResolves.get(e);(yield s.tryResolve(t,i))&&(this.passwordDialogResolves.delete(e),n=!0)}return this.passwordDialogResolves.forEach(((e,t)=>{(new Date).getTime()-e.date.getTime()>ox&&this.passwordDialogResolves.delete(t)})),n}))}supportsBiometric(){return sx(this,void 0,void 0,(function*(){return"android"!==(yield Wt.getPlatformInfo()).os&&(!this.isFirefox()||parseInt((yield browser.runtime.getBrowserInfo()).version.split(".")[0],10)>=87)}))}authenticateBiometric(){return this.biometricCallback()}sidebarViewName(){return window.chrome.sidebarAction&&this.isFirefox()?"sidebar":this.isOpera()&&"undefined"!=typeof opr&&opr.sidebarAction?"sidebar_panel":null}supportsSecureStorage(){return!1}}var ax=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},lx=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},cx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class ux extends _S{getFromSessionMemory(e,t){return cx(this,void 0,void 0,(function*(){return this.memoryStorageService instanceof wv?yield this.memoryStorageService.getBypassCache(e,{deserializer:t}):yield this.memoryStorageService.get(e)}))}setInSessionMemory(e,t){return cx(this,void 0,void 0,(function*(){yield this.memoryStorageService.save(e,t)}))}addAccount(e){const t=Object.create(null,{addAccount:{get:()=>super.addAccount}});return cx(this,void 0,void 0,(function*(){e=new zU(e),yield t.addAccount.call(this,e)}))}getIsAuthenticated(e){const t=Object.create(null,{getIsAuthenticated:{get:()=>super.getIsAuthenticated}});return cx(this,void 0,void 0,(function*(){return(yield t.getIsAuthenticated.call(this,e))&&null!=(yield this.getAccount(yield this.defaultInMemoryOptions()))}))}getBrowserGroupingComponentState(e){var t;return cx(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.groupings}))}setBrowserGroupingComponentState(e,t){return cx(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.groupings=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getBrowserCipherComponentState(e){var t;return cx(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.ciphers}))}setBrowserCipherComponentState(e,t){return cx(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.ciphers=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getBrowserSendComponentState(e){var t;return cx(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.send}))}setBrowserSendComponentState(e,t){return cx(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.send=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}getBrowserSendTypeComponentState(e){var t;return cx(this,void 0,void 0,(function*(){return null===(t=yield this.getAccount(this.reconcileOptions(e,yield this.defaultInMemoryOptions())))||void 0===t?void 0:t.sendType}))}setBrowserSendTypeComponentState(e,t){return cx(this,void 0,void 0,(function*(){const i=yield this.getAccount(this.reconcileOptions(t,yield this.defaultInMemoryOptions()));i.sendType=e,yield this.saveAccount(i,this.reconcileOptions(t,yield this.defaultInMemoryOptions()))}))}}ax([ZS(RU),lx("design:type",Function),lx("design:paramtypes",[Object]),lx("design:returntype",Promise)],ux.prototype,"getBrowserGroupingComponentState",null),ax([ZS(EU),lx("design:type",Function),lx("design:paramtypes",[Object]),lx("design:returntype",Promise)],ux.prototype,"getBrowserCipherComponentState",null),ax([ZS(JU),lx("design:type",Function),lx("design:paramtypes",[Object]),lx("design:returntype",Promise)],ux.prototype,"getBrowserSendComponentState",null),ax([ZS(EU),lx("design:type",Function),lx("design:paramtypes",[Object]),lx("design:returntype",Promise)],ux.prototype,"getBrowserSendTypeComponentState",null);var dx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hx{constructor(e,t,i){if(this.behaviorSubject=e,this.stateService=t,this.metaData=i,this.id=nt.newGuid(),this.ignoreNextUpdate=!0,!(e instanceof sv.X))throw new Error("behaviorSubject must be an instance of BehaviorSubject");if(null==i.ctor&&null==i.initializer)throw new Error("ctor or initializer must be provided")}init(){3==chrome.runtime.getManifest().manifest_version&&(this.observe(),this.listenForUpdates())}observe(){this.subscription=this.behaviorSubject.pipe((0,Ge.b)((e=>dx(this,void 0,void 0,(function*(){this.ignoreNextUpdate?this.ignoreNextUpdate=!1:yield this.updateSession(e)}))))).subscribe()}listenForUpdates(){Wt.messageListener(this.updateMessageCommand,(e=>dx(this,void 0,void 0,(function*(){return yield this.updateFromMessage(e)}))))}updateFromMessage(e){return dx(this,void 0,void 0,(function*(){if(e.command!=this.updateMessageCommand||e.id===this.id)return;const t=class{static builder(e){const t=null!=e.initializer?e.initializer:t=>Object.assign(new e.ctor,t);return e.initializeAsArray?e=>e.map((e=>t(e))):e=>t(e)}}.builder(this.metaData),i=yield this.stateService.getFromSessionMemory(this.metaData.sessionKey,t);this.ignoreNextUpdate=!0,this.behaviorSubject.next(i)}))}updateSession(e){return dx(this,void 0,void 0,(function*(){yield this.stateService.setInSessionMemory(this.metaData.sessionKey,e),yield Wt.sendMessage(this.updateMessageCommand,{id:this.id})}))}get updateMessageCommand(){return`${this.metaData.sessionKey}_update`}}function px(e){return(t,i)=>{const n=t;null==n.__syncedItemMetadata&&(n.__syncedItemMetadata=[]),n.__syncedItemMetadata.push({propertyKey:i,sessionKey:`${t.constructor.name}_${i}`,ctor:e.ctor,initializer:e.initializer,initializeAsArray:e.initializeAsArray})}}var gx=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},vx=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let yx=class extends sb{};gx([px({initializer:Ew.fromJSON,initializeAsArray:!0}),vx("design:type",sv.X)],yx.prototype,"_folders",void 0),gx([px({initializer:wa.fromJSON,initializeAsArray:!0}),vx("design:type",sv.X)],yx.prototype,"_folderViews",void 0),yx=gx([function(e){return class extends e{constructor(...t){super(...t);const i=t.find((e=>e instanceof ux));if(!i)throw new Error(`Cannot decorate ${e.name} with browserSession, Browser's StateService must be injected`);null!=this.__syncedItemMetadata&&this.__syncedItemMetadata instanceof Array&&(this.__sessionSyncers=this.__syncedItemMetadata.map((e=>this.buildSyncer(e,i))))}buildSyncer(e,t){const i=new hx(this[e.propertyKey],t,e);return i.init(),i}}}],yx);var fx=i(1607),mx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var wx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class bx extends class{constructor(e,t,i){this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this._locale=new fx.t(1),this.locale$=this._locale.asObservable(),this.supportedTranslationLocales=["en"],this.localeNames=new Map([["af","Afrikaans"],["ar","العربية الفصحى"],["az","Azərbaycanca"],["be","Беларуская"],["bg","български"],["bn","বাংলা"],["bs","bosanski jezik"],["ca","català"],["cs","čeština"],["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"],["he","עברית"],["hi","हिन्दी"],["hr","hrvatski"],["hu","magyar"],["id","Bahasa Indonesia"],["it","italiano"],["ja","日本語"],["ka","ქართული"],["km","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ"],["kn","ಕನ್ನಡ"],["ko","한국어"],["lt","lietuvių kalba"],["lv","Latvietis"],["me","црногорски"],["ml","മലയാളം"],["nb","norsk (bokmål)"],["nl","Nederlands"],["nn","Norsk Nynorsk"],["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"],["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 mx(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,this._locale.next(this.translationLocale);try{this.collator=new Intl.Collator(this.translationLocale,{numeric:!0,sensitivity:"base"})}catch(e){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.supportedTranslationLocales[0])),null!=this.localesDirectory&&(yield this.loadMessages(this.translationLocale,this.localeMessages),this.translationLocale!==this.supportedTranslationLocales[0]&&(yield this.loadMessages(this.supportedTranslationLocales[0],this.defaultMessages)))}))}t(e,t,i,n){return this.translate(e,t,i,n)}translate(e,t,i,n){let s;return s=this.localeMessages.hasOwnProperty(e)&&this.localeMessages[e]?this.localeMessages[e]:this.defaultMessages.hasOwnProperty(e)&&this.defaultMessages[e]?this.defaultMessages[e]:"",""!==s&&(null!=t&&(s=s.split("__$1__").join(t)),null!=i&&(s=s.split("__$2__").join(i)),null!=n&&(s=s.split("__$3__").join(n))),s}loadMessages(e,t){return mx(this,void 0,void 0,(function*(){const i=e.replace("-","_"),n=yield this.getLocalesJson(i);for(const e in n)if(n.hasOwnProperty(e)&&(t[e]=n[e].message,n[e].placeholders))for(const i in n[e].placeholders){if(!n[e].placeholders.hasOwnProperty(i)||!n[e].placeholders[i].content)continue;const s="\\$"+i.toUpperCase()+"\\$";let o=n[e].placeholders[i].content;"$1"!==o&&"$2"!==o&&"$3"!==o||(o="__$"+o+"__"),t[e]=t[e].replace(new RegExp(s,"g"),o)}}))}}{constructor(e){super(e,null,(e=>wx(this,void 0,void 0,(function*(){const t=yield fetch(this.localesDirectory+e+"/messages.json");return yield t.json()})))),this.supportedTranslationLocales=["en","ar","az","be","bg","bn","bs","ca","cs","da","de","el","en-GB","en-IN","es","et","eu","fa","fi","fil","fr","he","hi","hr","hu","id","it","ja","ka","km","kn","ko","lt","lv","ml","nb","nl","nn","pl","pt-BR","pt-PT","ro","ru","si","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-TW"]}t(e,t,i,n){return this.translate(e,t,i,n)}translate(e,t,i,n){if(null==this.localesDirectory){const s=[];return null!=t&&s.push(t),null!=i&&s.push(i),null!=n&&s.push(n),s.length?chrome.i18n.getMessage(e,s):chrome.i18n.getMessage(e)}return super.translate(e,t,i,n)}}var Sx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ux{constructor(e){this.cryptoFunctionService=e}makeEphemeralKey(e=16){return Sx(this,void 0,void 0,(function*(){const t=yield this.cryptoFunctionService.randomBytes(e),i=yield this.cryptoFunctionService.hkdf(t,"bitwarden-ephemeral","ephemeral",64,"sha256");return new ac(i)}))}}class xx extends ex{constructor(){super(...arguments),this.chromeStorageApi=chrome.storage.session}}var Ax=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_x=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Zx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Tx="localEncryptionKey",Cx="session";class kx extends wv{constructor(e,t){super(),this.encryptService=e,this.keyGenerationService=t,this.cache=new Map,this.localStorage=new tx,this.sessionStorage=new xx}get(e,t){return Zx(this,void 0,void 0,(function*(){return this.cache.has(e)?this.cache.get(e):yield this.getBypassCache(e,t)}))}getBypassCache(e,t){return Zx(this,void 0,void 0,(function*(){const i=yield this.getLocalSession(yield this.getSessionEncKey());if(null==i||!Object.keys(i).includes(e))return null;let n=i[e];return null!=(null==t?void 0:t.deserializer)&&(n=t.deserializer(n)),this.cache.set(e,n),this.cache.get(e)}))}has(e){return Zx(this,void 0,void 0,(function*(){return null!=(yield this.get(e))}))}save(e,t){var i;return Zx(this,void 0,void 0,(function*(){null==t?this.cache.delete(e):this.cache.set(e,t);const n=yield this.getSessionEncKey(),s=null!==(i=yield this.getLocalSession(n))&&void 0!==i?i:{};s[e]=t,yield this.setLocalSession(s,n)}))}remove(e){return Zx(this,void 0,void 0,(function*(){yield this.save(e,null)}))}getLocalSession(e){return Zx(this,void 0,void 0,(function*(){const t=yield this.localStorage.get(Cx);if(null==t)return null;const i=yield this.encryptService.decryptToUtf8(new ot(t),e);return null==i?(yield this.setSessionEncKey(null),yield this.localStorage.remove(Cx),null):JSON.parse(i)}))}setLocalSession(e,t){return Zx(this,void 0,void 0,(function*(){yield this.setEncryptedLocalSession(e,t)}))}setDecryptedLocalSession(e){return Zx(this,void 0,void 0,(function*(){const t=JSON.parse(JSON.stringify(e));null==e?yield this.localStorage.remove(Cx):yield this.localStorage.save(Cx,t)}))}setEncryptedLocalSession(e,t){return Zx(this,void 0,void 0,(function*(){const i=JSON.stringify(e),n=yield this.encryptService.encrypt(i,t);if(null==n)return yield this.localStorage.remove(Cx);yield this.localStorage.save(Cx,n.encryptedString)}))}getSessionEncKey(){return Zx(this,void 0,void 0,(function*(){let e=yield this.sessionStorage.get(Tx);return null!=e&&0!=Object.keys(e).length||(e=yield this.keyGenerationService.makeEphemeralKey(),yield this.setSessionEncKey(e)),ac.fromJSON(e)}))}setSessionEncKey(e){return Zx(this,void 0,void 0,(function*(){null==e?yield this.sessionStorage.remove(Tx):yield this.sessionStorage.save(Tx,e)}))}}Ax([function(e,t,i){i.value,i.value=function(...e){throw new Error("This method should not be called, it is protected by a disabled dev flag.")}},_x("design:type",Function),_x("design:paramtypes",[Object]),_x("design:returntype",Promise)],kx.prototype,"setDecryptedLocalSession",null);var Ox=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Px extends bU{startCheck(){this.checkVaultTimeout(),this.platformUtilsService.isSafari()?this.checkSafari():setInterval((()=>this.checkVaultTimeout()),1e4)}checkSafari(){return Ox(this,void 0,void 0,(function*(){for(;;)try{yield LU.sendMessageToApp("sleep"),this.checkVaultTimeout()}catch(e){console.log("Exception Safari VaultTimeout",e)}}))}}var Ix=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class qx{constructor(e,t,i,n,s){this.main=e,this.passwordGenerationService=t,this.platformUtilsService=i,this.vaultTimeoutService=n,this.authService=s,this.isSafari=this.platformUtilsService.isSafari(),this.isVivaldi=this.platformUtilsService.isVivaldi()}init(){return Ix(this,void 0,void 0,(function*(){Wt.messageListener("commands.background",((e,t,i)=>Ix(this,void 0,void 0,(function*(){"unlockCompleted"===e.command&&"commands.background"===e.data.target&&(yield this.processCommand(e.data.commandToRetry.msg.command,e.data.commandToRetry.sender))})))),chrome&&chrome.commands&&chrome.commands.onCommand.addListener((e=>Ix(this,void 0,void 0,(function*(){yield this.processCommand(e)}))))}))}processCommand(e,t){return Ix(this,void 0,void 0,(function*(){switch(e){case"generate_password":yield this.generatePasswordToClipboard();break;case"autofill_login":yield this.autoFillLogin(t?t.tab:null);break;case"open_popup":yield this.openPopup();break;case"lock_vault":yield this.vaultTimeoutService.lock()}}))}generatePasswordToClipboard(){return Ix(this,void 0,void 0,(function*(){const e=(yield this.passwordGenerationService.getOptions())[0],t=yield this.passwordGenerationService.generatePassword(e);this.platformUtilsService.copyToClipboard(t,{window}),this.passwordGenerationService.addHistory(t)}))}autoFillLogin(e){return Ix(this,void 0,void 0,(function*(){if(e||(e=yield Wt.getTabFromCurrentWindowId()),null!=e){if((yield this.authService.getAuthStatus())Dx(this,void 0,void 0,(function*(){"generate-password"===e.menuItemId?yield this.generatePasswordToClipboard():"copy-identifier"===e.menuItemId?yield this.getClickedElement(t,e.frameId):"autofill"!==e.parentMenuItemId&&"copy-username"!==e.parentMenuItemId&&"copy-password"!==e.parentMenuItemId&&"copy-totp"!==e.parentMenuItemId||(yield this.cipherAction(t,e))})))),Wt.messageListener("contextmenus.background",((e,t,i)=>Dx(this,void 0,void 0,(function*(){"unlockCompleted"===e.command&&"contextmenus.background"===e.data.target&&(yield this.cipherAction(e.data.commandToRetry.sender.tab,e.data.commandToRetry.msg.data))})))))}))}generatePasswordToClipboard(){return Dx(this,void 0,void 0,(function*(){const e=(yield this.passwordGenerationService.getOptions())[0],t=yield this.passwordGenerationService.generatePassword(e);this.platformUtilsService.copyToClipboard(t,{window}),this.passwordGenerationService.addHistory(t)}))}getClickedElement(e,t){return Dx(this,void 0,void 0,(function*(){null!=e&&Wt.tabSendMessage(e,{command:"getClickedElement"},{frameId:t})}))}cipherAction(e,t){return Dx(this,void 0,void 0,(function*(){if("string"!=typeof t.menuItemId)return;const i=t.menuItemId.split("_")[1];if((yield this.authService.getAuthStatus())e.reprompt===Kl.None))}else{n=(yield this.cipherService.getAllDecrypted()).find((e=>e.id===i))}if(null!=n)if("autofill"===t.parentMenuItemId)yield this.startAutofillPage(e,n);else if("copy-username"===t.parentMenuItemId)this.platformUtilsService.copyToClipboard(n.login.username,{window});else if("copy-password"===t.parentMenuItemId)this.platformUtilsService.copyToClipboard(n.login.password,{window}),this.eventService.collect(Gr.Cipher_ClientCopiedPassword,n.id);else if("copy-totp"===t.parentMenuItemId){const e=yield this.totpService.getCode(n.login.totp);this.platformUtilsService.copyToClipboard(e,{window})}}))}startAutofillPage(e,t){return Dx(this,void 0,void 0,(function*(){this.main.loginToAutoFill=t,null!=e&&Wt.tabSendMessage(e,{command:"collectPageDetails",tab:e,sender:"contextMenu"})}))}}var Fx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Nx{constructor(e,t,i){this.vaultTimeoutService=e,this.stateService=t,this.notificationsService=i,this.idleTimer=null,this.idleState="active",this.idle=chrome.idle||(null!=browser?browser.idle:null)}init(){return Fx(this,void 0,void 0,(function*(){if(!this.idle)return;const e=e=>{"active"===e?this.notificationsService.reconnectFromActivity():this.notificationsService.disconnectFromInactivity()};this.idle.onStateChanged&&this.idle.setDetectionInterval?(this.idle.setDetectionInterval(300),this.idle.onStateChanged.addListener(e)):this.pollIdle(e),this.idle.onStateChanged&&this.idle.onStateChanged.addListener((e=>Fx(this,void 0,void 0,(function*(){if("locked"===e){if(-2===(yield this.stateService.getVaultTimeout())){"logOut"===(yield this.stateService.getVaultTimeoutAction())?yield this.vaultTimeoutService.logOut():yield this.vaultTimeoutService.lock()}}}))))}))}pollIdle(e){null!=this.idleTimer&&(window.clearTimeout(this.idleTimer),this.idleTimer=null),this.idle.queryState(300,(t=>{t!==this.idleState&&(this.idleState=t,e(t)),this.idleTimer=window.setTimeout((()=>this.pollIdle(e)),5e3)}))}}var Lx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ex{constructor(e,t,i,n,s,o,r,a,l,c){var u;this.cryptoService=e,this.cryptoFunctionService=t,this.runtimeBackground=i,this.i18nService=n,this.messagingService=s,this.appIdService=o,this.platformUtilsService=r,this.stateService=a,this.logService=l,this.authService=c,this.connected=!1,this.resolver=null,this.privateKey=null,this.publicKey=null,this.secureSetupResolve=null,this.stateService.setBiometricFingerprintValidated(!1),(null===(u=null===chrome||void 0===chrome?void 0:chrome.permissions)||void 0===u?void 0:u.onAdded)&&chrome.permissions.onAdded.addListener((e=>{Wt.reloadExtension(null)}))}connect(){return Lx(this,void 0,void 0,(function*(){return this.appId=yield this.appIdService.getAppId(),this.stateService.setBiometricFingerprintValidated(!1),new Promise(((e,t)=>{this.port=Wt.connectNative("com.8bit.bitwarden"),this.connecting=!0;const i=()=>{this.connected=!0,this.connecting=!1,e()};this.platformUtilsService.isSafari()&&i(),this.port.onMessage.addListener((e=>Lx(this,void 0,void 0,(function*(){switch(e.command){case"connected":i();break;case"disconnected":this.connecting&&t("startDesktop"),this.connected=!1,this.port.disconnect();break;case"setupEncryption":{if(e.appId!==this.appId)return;const t=nt.fromB64ToArray(e.sharedSecret),i=yield this.cryptoFunctionService.rsaDecrypt(t.buffer,this.privateKey,"sha1");this.validatingFingerprint&&(this.validatingFingerprint=!1,this.stateService.setBiometricFingerprintValidated(!0)),this.sharedSecret=new ac(i),this.secureSetupResolve();break}case"invalidateEncryption":if(e.appId!==this.appId)return;this.sharedSecret=null,this.privateKey=null,this.connected=!1,this.messagingService.send("showDialog",{text:this.i18nService.t("nativeMessagingInvalidEncryptionDesc"),title:this.i18nService.t("nativeMessagingInvalidEncryptionTitle"),confirmText:this.i18nService.t("ok"),type:"error"});break;case"verifyFingerprint":null==this.sharedSecret&&(this.validatingFingerprint=!0,this.showFingerprintDialog());break;case"wrongUserId":this.showWrongUserDialog();break;default:if(!this.platformUtilsService.isSafari()&&e.appId!==this.appId)return;this.onMessage(e.message)}})))),this.port.onDisconnect.addListener((e=>{let i;i=Wt.isWebExtensionsApi?e.error.message:chrome.runtime.lastError.message,this.sharedSecret=null,this.privateKey=null,this.connected=!1;t(null!=i?"desktopIntegrationDisabled":null)}))}))}))}showWrongUserDialog(){this.messagingService.send("showDialog",{text:this.i18nService.t("nativeMessagingWrongUserDesc"),title:this.i18nService.t("nativeMessagingWrongUserTitle"),confirmText:this.i18nService.t("ok"),type:"error"})}send(e){return Lx(this,void 0,void 0,(function*(){this.connected||(yield this.connect()),e.userId=yield this.stateService.getUserId(),e.timestamp=Date.now(),this.platformUtilsService.isSafari()?this.postMessage(e):this.postMessage({appId:this.appId,message:yield this.encryptMessage(e)})}))}encryptMessage(e){return Lx(this,void 0,void 0,(function*(){return null==this.sharedSecret&&(yield this.secureCommunication()),yield this.cryptoService.encrypt(JSON.stringify(e),this.sharedSecret)}))}getResponse(){return new Promise(((e,t)=>{this.resolver=e}))}postMessage(e){try{const t=e;e.message instanceof ot&&(t.message={encryptedString:e.message.encryptedString,encryptionType:e.message.encryptionType,data:e.message.data,iv:e.message.iv,mac:e.message.mac}),this.port.postMessage(t)}catch(e){this.logService.error("NativeMessaging port disconnected, disconnecting."),this.sharedSecret=null,this.privateKey=null,this.connected=!1,this.messagingService.send("showDialog",{text:this.i18nService.t("nativeMessagingInvalidEncryptionDesc"),title:this.i18nService.t("nativeMessagingInvalidEncryptionTitle"),confirmText:this.i18nService.t("ok"),type:"error"})}}onMessage(e){return Lx(this,void 0,void 0,(function*(){let t=e;if(this.platformUtilsService.isSafari()||(t=JSON.parse(yield this.cryptoService.decryptToUtf8(e,this.sharedSecret))),Math.abs(t.timestamp-Date.now())>1e4)this.logService.error("NativeMessage is to old, ignoring.");else{switch(t.command){case"biometricUnlock":{if(yield this.stateService.setBiometricAwaitingAcceptance(null),"not enabled"===t.response){this.messagingService.send("showDialog",{text:this.i18nService.t("biometricsNotEnabledDesc"),title:this.i18nService.t("biometricsNotEnabledTitle"),confirmText:this.i18nService.t("ok"),type:"error"});break}if("not supported"===t.response){this.messagingService.send("showDialog",{text:this.i18nService.t("biometricsNotSupportedDesc"),title:this.i18nService.t("biometricsNotSupportedTitle"),confirmText:this.i18nService.t("ok"),type:"error"});break}const e=yield this.stateService.getBiometricUnlock();if(null===e||!1===e){"unlocked"===t.response&&(yield this.stateService.setBiometricUnlock(!0));break}if((yield this.authService.getAuthStatus())===Oe.Unlocked)break;if("unlocked"===t.response){yield this.cryptoService.setKey(new ac(nt.fromB64ToArray(t.keyB64).buffer));try{yield this.cryptoService.getFingerprint(yield this.stateService.getUserId())}catch(e){return this.logService.error("Unable to verify key: "+e),yield this.cryptoService.clearKey(),this.showWrongUserDialog(),void(this.resolver&&this.resolver(t))}this.runtimeBackground.processMessage({command:"unlocked"},null,null)}break}default:this.logService.error("NativeMessage, got unknown command: "+t.command)}this.resolver&&this.resolver(t)}}))}secureCommunication(){return Lx(this,void 0,void 0,(function*(){const[e,t]=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);return this.publicKey=e,this.privateKey=t,this.sendUnencrypted({command:"setupEncryption",publicKey:nt.fromBufferToB64(e),userId:yield this.stateService.getUserId()}),new Promise(((e,t)=>this.secureSetupResolve=e))}))}sendUnencrypted(e){return Lx(this,void 0,void 0,(function*(){this.connected||(yield this.connect()),e.timestamp=Date.now(),this.postMessage({appId:this.appId,message:e})}))}showFingerprintDialog(){return Lx(this,void 0,void 0,(function*(){const e=(yield this.cryptoService.getFingerprint(yield this.stateService.getUserId(),this.publicKey)).join(" ");this.messagingService.send("showDialog",{html:`${this.i18nService.t("desktopIntegrationVerificationText")}

${e}`,title:this.i18nService.t("desktopSyncVerificationTitle"),confirmText:this.i18nService.t("ok"),type:"warning"})}))}}var Rx;!function(e){e[e.AddLogin=0]="AddLogin",e[e.ChangePassword=1]="ChangePassword"}(Rx||(Rx={}));var Jx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Yx{constructor(e,t,i,n,s,o){this.autofillService=e,this.cipherService=t,this.authService=i,this.policyService=n,this.folderService=s,this.stateService=o,this.notificationQueue=[]}init(){return Jx(this,void 0,void 0,(function*(){null!=chrome.runtime&&(Wt.messageListener("notification.background",((e,t)=>Jx(this,void 0,void 0,(function*(){yield this.processMessage(e,t)})))),this.cleanupNotificationQueue())}))}processMessage(e,t){return Jx(this,void 0,void 0,(function*(){switch(e.command){case"unlockCompleted":if("notification.background"!==e.data.target)return;yield this.processMessage(e.data.commandToRetry.msg,e.data.commandToRetry.sender);break;case"bgGetDataForTab":yield this.getDataForTab(t.tab,e.responseCommand);break;case"bgCloseNotificationBar":yield Wt.tabSendMessageData(t.tab,"closeNotificationBar");break;case"bgAdjustNotificationBar":yield Wt.tabSendMessageData(t.tab,"adjustNotificationBar",e.data);break;case"bgAddLogin":yield this.addLogin(e.login,t.tab);break;case"bgChangedPassword":yield this.changedPassword(e.data,t.tab);break;case"bgAddClose":case"bgChangeClose":this.removeTabFromNotificationQueue(t.tab);break;case"bgAddSave":case"bgChangeSave":if((yield this.authService.getAuthStatus())=0;e--)this.notificationQueue[e].expiresthis.cleanupNotificationQueue()),12e4)}doNotificationQueueCheck(e){if(null==e)return;const t=nt.getDomain(e.url);if(null!=t)for(let i=0;i=0;t--)this.notificationQueue[t].tabId===e.id&&this.notificationQueue.splice(t,1)}addLogin(e,t){return Jx(this,void 0,void 0,(function*(){const i=yield this.authService.getAuthStatus();if(i===Oe.LoggedOut)return;const n=nt.getDomain(e.url);if(null==n)return;let s=e.username;null!=s&&(s=s.toLowerCase());const o=yield this.stateService.getDisableAddLoginNotification();if(i===Oe.Locked){if(o)return;if(!(yield this.allowPersonalOwnership()))return;return void this.pushAddLoginToQueue(n,e,t,!0)}const r=(yield this.cipherService.getAllDecryptedForUrl(e.url)).filter((e=>null!=e.login.username&&e.login.username.toLowerCase()===s));if(0===r.length){if(o)return;if(!(yield this.allowPersonalOwnership()))return;this.pushAddLoginToQueue(n,e,t)}else if(1===r.length&&r[0].login.password!==e.password){if(yield this.stateService.getDisableChangedPasswordNotification())return;this.pushChangePasswordToQueue(r[0].id,n,e.password,t)}}))}pushAddLoginToQueue(e,t,i,n=!1){return Jx(this,void 0,void 0,(function*(){this.removeTabFromNotificationQueue(i);const s={type:Rx.AddLogin,username:t.username,password:t.password,domain:e,uri:t.url,tabId:i.id,expires:new Date((new Date).getTime()+3e5),wasVaultLocked:n};this.notificationQueue.push(s),yield this.checkNotificationQueue(i)}))}changedPassword(e,t){return Jx(this,void 0,void 0,(function*(){const i=nt.getDomain(e.url);if(null==i)return;if((yield this.authService.getAuthStatus())t.login.password===e.currentPassword));1===t.length&&(n=t[0].id)}else 1===s.length&&(n=s[0].id);null!=n&&this.pushChangePasswordToQueue(n,i,e.newPassword,t)}))}pushChangePasswordToQueue(e,t,i,n,s=!1){return Jx(this,void 0,void 0,(function*(){this.removeTabFromNotificationQueue(n);const o={type:Rx.ChangePassword,cipherId:e,newPassword:i,domain:t,tabId:n.id,expires:new Date((new Date).getTime()+3e5),wasVaultLocked:s};this.notificationQueue.push(o),yield this.checkNotificationQueue(n)}))}saveOrUpdateCredentials(e,t){return Jx(this,void 0,void 0,(function*(){for(let i=this.notificationQueue.length-1;i>=0;i--){const n=this.notificationQueue[i];if(n.tabId!==e.id||n.type!==Rx.AddLogin&&n.type!==Rx.ChangePassword)continue;const s=nt.getDomain(e.url);if(null==s||s===n.domain){if(this.notificationQueue.splice(i,1),Wt.tabSendMessageData(e,"closeNotificationBar"),n.type===Rx.ChangePassword){const e=n,t=yield this.getDecryptedCipherById(e.cipherId);if(null==t)return;return void(yield this.updateCipher(t,e.newPassword))}if(n.type===Rx.AddLogin){if(!n.wasVaultLocked)return yield this.createNewCipher(n,t),void Wt.tabSendMessageData(e,"addedCipher");const i=n,s=(yield this.cipherService.getAllDecryptedForUrl(i.uri)).filter((e=>null!=e.login.username&&e.login.username.toLowerCase()===i.username));if(s.length>=1)return void(yield this.updateCipher(s[0],i.password));yield this.createNewCipher(i,t),Wt.tabSendMessageData(e,"addedCipher")}}}}))}createNewCipher(e,t){return Jx(this,void 0,void 0,(function*(){const i=new fc,n=new gc;n.uri=e.uri,i.uris=[n],i.username=e.username,i.password=e.password;const s=new bc;if(s.name=nt.getHostname(e.uri)||e.domain,s.name=s.name.replace(/^www\./,""),s.type=Bl.Login,s.login=i,!nt.isNullOrWhitespace(t)){(yield(0,Ku.z)(this.folderService.folderViews$)).some((e=>e.id===t))&&(s.folderId=t)}const o=yield this.cipherService.encrypt(s);yield this.cipherService.saveWithServer(o)}))}getDecryptedCipherById(e){return Jx(this,void 0,void 0,(function*(){const t=yield this.cipherService.get(e);return null!=t&&t.type===Bl.Login?yield t.decrypt():null}))}updateCipher(e,t){return Jx(this,void 0,void 0,(function*(){if(null!=e&&e.type===Bl.Login){e.login.password=t;const i=yield this.cipherService.encrypt(e);yield this.cipherService.saveWithServer(i)}}))}saveNever(e){return Jx(this,void 0,void 0,(function*(){for(let t=this.notificationQueue.length-1;t>=0;t--){const i=this.notificationQueue[t];if(i.tabId!==e.id||i.type!==Rx.AddLogin)continue;const n=nt.getDomain(e.url);if(null!=n&&n!==i.domain)continue;this.notificationQueue.splice(t,1),Wt.tabSendMessageData(e,"closeNotificationBar");const s=nt.getHostname(e.url);yield this.cipherService.saveNeverDomain(s)}}))}getDataForTab(e,t){return Jx(this,void 0,void 0,(function*(){const i={};"notificationBarGetFoldersList"===t&&(i.folders=yield(0,Ku.z)(this.folderService.folderViews$)),yield Wt.tabSendMessageData(e,t,i)}))}allowPersonalOwnership(){return Jx(this,void 0,void 0,(function*(){return!(yield this.policyService.policyAppliesToUser(qs.PersonalOwnership))}))}}var zx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kx{constructor(e,t,i,n,s,o,r,a,l){this.main=e,this.autofillService=t,this.platformUtilsService=i,this.i18nService=n,this.notificationsService=s,this.systemService=o,this.environmentService=r,this.messagingService=a,this.logService=l,this.pageDetailsToAutoFill=[],this.onInstalledReason=null,this.lockedVaultPendingNotifications=[],chrome.runtime.onInstalled.addListener((e=>{this.onInstalledReason=e.reason}))}init(){return zx(this,void 0,void 0,(function*(){if(!chrome.runtime)return;yield this.checkOnInstalled();const e=(e,t,i)=>zx(this,void 0,void 0,(function*(){yield this.processMessage(e,t,i)}));Wt.messageListener("runtime.background",e),this.main.isPrivateMode&&(window.bitwardenBackgroundMessageListener=e)}))}processMessage(e,t,i){var n,s,o;return zx(this,void 0,void 0,(function*(){switch(e.command){case"loggedIn":case"unlocked":{let t;(null===(n=this.lockedVaultPendingNotifications)||void 0===n?void 0:n.length)>0&&(yield Wt.closeLoginTab(),t=this.lockedVaultPendingNotifications.pop(),(null===(o=null===(s=t.commandToRetry.sender)||void 0===s?void 0:s.tab)||void 0===o?void 0:o.id)&&(yield Wt.focusSpecifiedTab(t.commandToRetry.sender.tab.id))),yield this.main.setIcon(),yield this.main.refreshBadgeAndMenu(!1),this.notificationsService.updateConnection("unlocked"===e.command),this.systemService.cancelProcessReload(),t&&(yield Wt.tabSendMessageData(t.commandToRetry.sender.tab,"unlockCompleted",t));break}case"addToLockedVaultPendingNotifications":this.lockedVaultPendingNotifications.push(e.data);break;case"logout":yield this.main.logout(e.expired,e.userId);break;case"syncCompleted":e.successfully&&setTimeout((()=>zx(this,void 0,void 0,(function*(){return yield this.main.refreshBadgeAndMenu()}))),2e3);break;case"openPopup":yield this.main.openPopup();break;case"promptForLogin":yield Wt.createNewTab("popup/index.html?uilocation=popout",!0,!0);break;case"showDialogResolve":this.platformUtilsService.resolveDialogPromise(e.dialogId,e.confirmed);break;case"bgCollectPageDetails":yield this.main.collectPageDetailsForContentScript(t.tab,e.sender,t.frameId);break;case"bgUpdateContextMenu":case"editedCipher":case"addedCipher":case"deletedCipher":yield this.main.refreshBadgeAndMenu();break;case"bgReseedStorage":yield this.main.reseedStorage();break;case"collectPageDetailsResponse":switch(e.sender){case"autofiller":case"autofill_cmd":{const i=yield this.autofillService.doAutoFillActiveTab([{frameId:t.frameId,tab:e.tab,details:e.details}],"autofill_cmd"===e.sender);null!=i&&this.platformUtilsService.copyToClipboard(i,{window});break}case"contextMenu":clearTimeout(this.autofillTimeout),this.pageDetailsToAutoFill.push({frameId:t.frameId,tab:e.tab,details:e.details}),this.autofillTimeout=setTimeout((()=>zx(this,void 0,void 0,(function*(){return yield this.autofillPage(e.tab)}))),300)}break;case"authResult":{const t=this.environmentService.getWebVaultUrl();if(null==e.referrer||nt.getHostname(t)!==e.referrer)return;try{Wt.createNewTab("popup/index.html?uilocation=popout#/sso?code="+encodeURIComponent(e.code)+"&state="+encodeURIComponent(e.state))}catch(e){this.logService.error("Unable to open sso popout tab")}break}case"webAuthnResult":{const t=this.environmentService.getWebVaultUrl();if(null==e.referrer||nt.getHostname(t)!==e.referrer)return;const i=`webAuthnResponse=${encodeURIComponent(e.data)};remember=${encodeURIComponent(e.remember)}`;Wt.createNewTab(`popup/index.html?uilocation=popout#/2fa;${i}`,void 0,!1);break}case"reloadPopup":this.messagingService.send("reloadPopup");break;case"emailVerificationRequired":this.messagingService.send("showDialog",{dialogId:"emailVerificationRequired",title:this.i18nService.t("emailVerificationRequired"),text:this.i18nService.t("emailVerificationRequiredDesc"),confirmText:this.i18nService.t("ok"),type:"info"});break;case"getClickedElementResponse":this.platformUtilsService.copyToClipboard(e.identifier,{window})}}))}autofillPage(e){return zx(this,void 0,void 0,(function*(){const t=yield this.autofillService.doAutoFill({tab:e,cipher:this.main.loginToAutoFill,pageDetails:this.pageDetailsToAutoFill,fillNewPassword:!0});null!=t&&this.platformUtilsService.copyToClipboard(t,{window}),this.main.loginToAutoFill=null,this.pageDetailsToAutoFill=[]}))}checkOnInstalled(){return zx(this,void 0,void 0,(function*(){setTimeout((()=>zx(this,void 0,void 0,(function*(){null!=this.onInstalledReason&&("install"===this.onInstalledReason&&(Wt.createNewTab("https://bitwarden.com/browser-start/"),(yield this.environmentService.hasManagedEnvironment())&&(yield this.environmentService.setUrlsToManagedEnvironment())),this.onInstalledReason=null)}))),100)}))}}var Bx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Gx{constructor(e,t){this.main=e,this.notificationBackground=t}init(){return Bx(this,void 0,void 0,(function*(){chrome.tabs&&chrome.windows&&(chrome.windows.onFocusChanged.addListener((e=>Bx(this,void 0,void 0,(function*(){null===e||e<0||(this.focusedWindowId=e,this.main.messagingService.send("windowChanged"))})))),chrome.tabs.onActivated.addListener((e=>Bx(this,void 0,void 0,(function*(){yield this.main.refreshBadgeAndMenu(),this.main.messagingService.send("tabChanged")})))),chrome.tabs.onReplaced.addListener(((e,t)=>Bx(this,void 0,void 0,(function*(){this.main.onReplacedRan||(this.main.onReplacedRan=!0,yield this.notificationBackground.checkNotificationQueue(),yield this.main.refreshBadgeAndMenu(),this.main.messagingService.send("tabChanged"))})))),chrome.tabs.onUpdated.addListener(((e,t,i)=>Bx(this,void 0,void 0,(function*(){this.focusedWindowId>0&&i.windowId!=this.focusedWindowId||i.active&&(this.main.onUpdatedRan||(this.main.onUpdatedRan=!0,yield this.notificationBackground.checkNotificationQueue(i),yield this.main.refreshBadgeAndMenu(),this.main.messagingService.send("tabChanged")))})))))}))}}var Qx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Vx{constructor(e,t,i){this.cipherService=t,this.authService=i,this.pendingAuthRequests=[];2===chrome.runtime.getManifest().manifest_version&&(this.webRequest=window.chrome.webRequest),this.isFirefox=e.isFirefox()}init(){return Qx(this,void 0,void 0,(function*(){this.webRequest&&this.webRequest.onAuthRequired&&(this.webRequest.onAuthRequired.addListener(((e,t)=>Qx(this,void 0,void 0,(function*(){if(e.url&&-1===this.pendingAuthRequests.indexOf(e.requestId)){if(this.pendingAuthRequests.push(e.requestId),this.isFirefox)return new Promise(((t,i)=>Qx(this,void 0,void 0,(function*(){yield this.resolveAuthCredentials(e.url,t,i)}))));yield this.resolveAuthCredentials(e.url,t,t)}else t&&t()}))),{urls:["http://*/*","https://*/*"]},[this.isFirefox?"blocking":"asyncBlocking"]),this.webRequest.onCompleted.addListener((e=>this.completeAuthRequest(e)),{urls:["http://*/*"]}),this.webRequest.onErrorOccurred.addListener((e=>this.completeAuthRequest(e)),{urls:["http://*/*"]}))}))}resolveAuthCredentials(e,t,i){return Qx(this,void 0,void 0,(function*(){if((yield this.authService.getAuthStatus())-1&&this.pendingAuthRequests.splice(t,1)}}var Hx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jx{constructor(e=!1){this.isPrivateMode=e,this.backgroundWindow=window,this.loginToAutoFill=null,this.menuOptionsLoaded=[];const t=(e,t)=>Hx(this,void 0,void 0,(function*(){return yield this.logout(e,t)}));this.messagingService=e?new nx:new ix,this.logService=new cw(!1),this.cryptoFunctionService=new ZU(window),this.storageService=new tx,this.secureStorageService=new tx,this.memoryStorageService=3==chrome.runtime.getManifest().manifest_version?new kx(new Uw(this.cryptoFunctionService,this.logService,!1),new Ux(this.cryptoFunctionService)):new MU,this.stateMigrationService=new YS(this.storageService,this.secureStorageService,new xv(Nv,zU)),this.stateService=new ux(this.storageService,this.secureStorageService,this.memoryStorageService,this.logService,this.stateMigrationService,new xv(Nv,zU)),this.platformUtilsService=new rx(this.messagingService,((e,t)=>{null!=this.systemService&&this.systemService.clearClipboard(e,t)}),(()=>Hx(this,void 0,void 0,(function*(){if(null!=this.nativeMessagingBackground){const e=this.nativeMessagingBackground.getResponse();try{yield this.nativeMessagingBackground.send({command:"biometricUnlock"})}catch(e){return Promise.reject(e)}return e.then((e=>"unlocked"===e.response))}})))),this.i18nService=new bx(Wt.getUILanguage(window)),this.encryptService=new Uw(this.cryptoFunctionService,this.logService,!0),this.cryptoService=new WU(this.cryptoFunctionService,this.encryptService,this.platformUtilsService,this.logService,this.stateService),this.tokenService=new OS(this.stateService),this.appIdService=new Rf(this.storageService),this.environmentService=new $e(this.stateService,this.logService),this.apiService=new Lf(this.tokenService,this.platformUtilsService,this.environmentService,this.appIdService,(e=>this.logout(e))),this.settingsService=new cS(this.stateService),this.fileUploadService=new Ww(this.logService,this.apiService),this.cipherService=new Qm(this.cryptoService,this.settingsService,this.apiService,this.fileUploadService,this.i18nService,(()=>this.searchService),this.logService,this.stateService),this.folderService=new yx(this.cryptoService,this.i18nService,this.cipherService,this.stateService),this.folderApiService=new tb(this.folderService,this.apiService),this.collectionService=new $m(this.cryptoService,this.i18nService,this.stateService),this.searchService=new Hb(this.cipherService,this.logService,this.i18nService),this.sendService=new rS(this.cryptoService,this.apiService,this.fileUploadService,this.i18nService,this.cryptoFunctionService,this.stateService),this.organizationService=new mb(this.stateService),this.policyService=new zb(this.stateService,this.organizationService),this.policyApiService=new Lb(this.policyService,this.apiService,this.stateService,this.organizationService),this.keyConnectorService=new lb(this.stateService,this.cryptoService,this.apiService,this.tokenService,this.logService,this.organizationService,this.cryptoFunctionService,t),this.vaultFilterService=new ju(this.stateService,this.organizationService,this.folderService,this.cipherService,this.collectionService,this.policyService),this.twoFactorService=new xn(this.i18nService,this.platformUtilsService);const i=this,n=new class extends qe{constructor(){super(...arguments),this.send=(e,t={})=>{const n=Object.assign({},{command:e},t);i.runtimeBackground.processMessage(n,i,null)}}};this.authService=new lm(this.cryptoService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,n,this.logService,this.keyConnectorService,this.environmentService,this.stateService,this.twoFactorService,this.i18nService),this.vaultTimeoutSettingsService=new UU(this.cryptoService,this.tokenService,this.policyService,this.stateService),this.vaultTimeoutService=new Px(this.cipherService,this.folderService,this.collectionService,this.cryptoService,this.platformUtilsService,this.messagingService,this.searchService,this.keyConnectorService,this.stateService,this.authService,this.vaultTimeoutSettingsService,(e=>Hx(this,void 0,void 0,(function*(){null!=this.notificationsService&&this.notificationsService.updateConnection(!1),yield this.setIcon(),yield this.refreshBadgeAndMenu(!0),null!=this.systemService&&(yield this.systemService.clearPendingClipboard(),yield this.systemService.startProcessReload(this.authService))}))),t),this.providerService=new Gb(this.stateService),this.syncService=new QS(this.apiService,this.settingsService,this.folderService,this.cipherService,this.cryptoService,this.collectionService,this.messagingService,this.policyService,this.sendService,this.logService,this.keyConnectorService,this.stateService,this.organizationService,this.providerService,this.folderApiService,t),this.eventService=new Zw(this.apiService,this.cipherService,this.stateService,this.logService,this.organizationService),this.passwordGenerationService=new Db(this.cryptoService,this.policyService,this.stateService),this.totpService=new WS(this.cryptoFunctionService,this.logService),this.autofillService=new HU(this.cipherService,this.stateService,this.totpService,this.eventService,this.logService),this.containerService=new qU(this.cryptoService,this.encryptService),this.auditService=new Kf(this.cryptoFunctionService,this.apiService),this.exportService=new Kw(this.folderService,this.cipherService,this.apiService,this.cryptoService,this.cryptoFunctionService),this.notificationsService=new ub(this.syncService,this.appIdService,this.apiService,this.environmentService,t,this.logService,this.stateService,this.authService),this.popupUtilsService=new $t(e),this.userVerificationApiService=new XS(this.apiService),this.userVerificationService=new iU(this.cryptoService,this.i18nService,this.userVerificationApiService);this.systemService=new NU(this.messagingService,this.platformUtilsService,(()=>{const e=this.platformUtilsService.isSafari()||this.platformUtilsService.isFirefox()||this.platformUtilsService.isOpera();return Wt.reloadExtension(e?window:null),Promise.resolve()}),this.stateService),this.isSafari=this.platformUtilsService.isSafari(),this.sidebarAction=this.isSafari?null:"undefined"!=typeof opr&&opr.sidebarAction?opr.sidebarAction:window.chrome.sidebarAction,this.runtimeBackground=new Kx(this,this.autofillService,this.platformUtilsService,this.i18nService,this.notificationsService,this.systemService,this.environmentService,this.messagingService,this.logService),this.nativeMessagingBackground=new Ex(this.cryptoService,this.cryptoFunctionService,this.runtimeBackground,this.i18nService,this.messagingService,this.appIdService,this.platformUtilsService,this.stateService,this.logService,this.authService),this.commandsBackground=new qx(this,this.passwordGenerationService,this.platformUtilsService,this.vaultTimeoutService,this.authService),this.notificationBackground=new Yx(this.autofillService,this.cipherService,this.authService,this.policyService,this.folderService,this.stateService),this.tabsBackground=new Gx(this,this.notificationBackground),this.contextMenusBackground=new Mx(this,this.cipherService,this.passwordGenerationService,this.platformUtilsService,this.authService,this.eventService,this.totpService),this.idleBackground=new Nx(this.vaultTimeoutService,this.stateService,this.notificationsService),this.webRequestBackground=new Vx(this.platformUtilsService,this.cipherService,this.authService),this.usernameGenerationService=new mU(this.cryptoService,this.stateService,this.apiService)}bootstrap(){return Hx(this,void 0,void 0,(function*(){if(this.containerService.attachToGlobal(window),yield this.stateService.init(),yield this.vaultTimeoutService.init(!0),yield this.i18nService.init(),yield this.eventService.init(!0),yield this.runtimeBackground.init(),yield this.notificationBackground.init(),yield this.commandsBackground.init(),this.twoFactorService.init(),yield this.tabsBackground.init(),yield this.contextMenusBackground.init(),yield this.idleBackground.init(),yield this.webRequestBackground.init(),this.platformUtilsService.isFirefox()&&!this.isPrivateMode){(yield Wt.getPrivateModeWindows()).forEach((e=>Hx(this,void 0,void 0,(function*(){yield this.actionSetIcon(chrome.browserAction,"",e.id),yield this.actionSetIcon(this.sidebarAction,"",e.id)})))),Wt.onWindowCreated((e=>Hx(this,void 0,void 0,(function*(){e.incognito&&(yield this.actionSetIcon(chrome.browserAction,"",e.id),yield this.actionSetIcon(this.sidebarAction,"",e.id))}))))}return new Promise((e=>{setTimeout((()=>Hx(this,void 0,void 0,(function*(){yield this.environmentService.setUrlsFromStorage(),yield this.setIcon(),this.fullSync(!0),setTimeout((()=>this.notificationsService.init()),2500),e()}))),500)}))}))}setIcon(){return Hx(this,void 0,void 0,(function*(){if(!chrome.browserAction&&!this.sidebarAction||this.isPrivateMode)return;const e=yield this.authService.getAuthStatus();let t="";e===Oe.LoggedOut?t="_gray":e===Oe.Locked&&(t="_locked"),yield this.actionSetIcon(chrome.browserAction,t),yield this.actionSetIcon(this.sidebarAction,t)}))}refreshBadgeAndMenu(e=!1){return Hx(this,void 0,void 0,(function*(){if(!chrome.windows||!chrome.contextMenus)return;const t=yield this.stateService.getDisableContextMenuItem();if(t?yield this.contextMenusRemoveAll():yield this.buildContextMenu(),e)return yield this.loadMenuAndUpdateBadgeForNoAccessState(!t),void(this.onUpdatedRan=this.onReplacedRan=!1);const i=yield Wt.getTabFromCurrentWindow();i&&(yield this.contextMenuReady(i,!t))}))}logout(e,t){return Hx(this,void 0,void 0,(function*(){yield this.eventService.uploadEvents(t),yield Promise.all([this.eventService.clearEvents(t),this.syncService.setLastSync(new Date(0),t),this.cryptoService.clearKeys(t),this.settingsService.clear(t),this.cipherService.clear(t),this.folderService.clear(t),this.collectionService.clear(t),this.policyService.clear(t),this.passwordGenerationService.clear(t),this.vaultTimeoutSettingsService.clear(t),this.keyConnectorService.clear(),this.vaultFilterService.clear()]),yield this.stateService.clean({userId:t}),null!=t&&t!==(yield this.stateService.getUserId())||(this.searchService.clearIndex(),this.messagingService.send("doneLoggingOut",{expired:e,userId:t})),yield this.setIcon(),yield this.refreshBadgeAndMenu(!0),yield this.reseedStorage(),this.notificationsService.updateConnection(!1),yield this.systemService.clearPendingClipboard(),yield this.systemService.startProcessReload(this.authService)}))}collectPageDetailsForContentScript(e,t,i=null){return Hx(this,void 0,void 0,(function*(){if(null==e||!e.id)return;const n={};null!=i&&(n.frameId=i),Wt.tabSendMessage(e,{command:"collectPageDetails",tab:e,sender:t},n)}))}openPopup(){return Hx(this,void 0,void 0,(function*(){this.isSafari&&(yield LU.sendMessageToApp("showPopover",null,!0))}))}reseedStorage(){return Hx(this,void 0,void 0,(function*(){if(!this.platformUtilsService.isChrome()&&!this.platformUtilsService.isVivaldi()&&!this.platformUtilsService.isOpera())return;if(null==(yield this.stateService.getVaultTimeout()))return;const e=yield new Promise((e=>{chrome.storage.local.get(null,(t=>e(t)))}));yield new Promise((e=>{chrome.storage.local.clear((()=>e()))}));for(const t in e)e.hasOwnProperty(t)&&(yield this.storageService.save(t,e[t]))}))}buildContextMenu(){return Hx(this,void 0,void 0,(function*(){chrome.contextMenus&&!this.buildingContextMenu&&(this.buildingContextMenu=!0,yield this.contextMenusRemoveAll(),yield this.contextMenusCreate({type:"normal",id:"root",contexts:["all"],title:"Bitwarden"}),yield this.contextMenusCreate({type:"normal",id:"autofill",parentId:"root",contexts:["all"],title:this.i18nService.t("autoFill")}),yield this.contextMenusCreate({type:"normal",id:"copy-username",parentId:"root",contexts:["all"],title:this.i18nService.t("copyUsername")}),yield this.contextMenusCreate({type:"normal",id:"copy-password",parentId:"root",contexts:["all"],title:this.i18nService.t("copyPassword")}),(yield this.stateService.getCanAccessPremium())&&(yield this.contextMenusCreate({type:"normal",id:"copy-totp",parentId:"root",contexts:["all"],title:this.i18nService.t("copyVerificationCode")})),yield this.contextMenusCreate({type:"separator",parentId:"root"}),yield this.contextMenusCreate({type:"normal",id:"generate-password",parentId:"root",contexts:["all"],title:this.i18nService.t("generatePasswordCopied")}),yield this.contextMenusCreate({type:"normal",id:"copy-identifier",parentId:"root",contexts:["all"],title:this.i18nService.t("copyElementIdentifier")}),this.buildingContextMenu=!1)}))}contextMenuReady(e,t){return Hx(this,void 0,void 0,(function*(){yield this.loadMenuAndUpdateBadge(e.url,e.id,t),this.onUpdatedRan=this.onReplacedRan=!1}))}loadMenuAndUpdateBadge(e,t,i){return Hx(this,void 0,void 0,(function*(){if(!e||!chrome.browserAction&&!this.sidebarAction)return;this.actionSetBadgeBackgroundColor(chrome.browserAction),this.actionSetBadgeBackgroundColor(this.sidebarAction),this.menuOptionsLoaded=[];if((yield this.authService.getAuthStatus())===Oe.Unlocked)try{const n=yield this.cipherService.getAllDecryptedForUrl(e);n.sort(((e,t)=>this.cipherService.sortCiphersByLastUsedThenName(e,t))),i&&n.forEach((e=>{this.loadLoginContextMenuOptions(e)}));const s=yield this.stateService.getDisableBadgeCounter();let o="";return s||(n.length>0&&n.length<=9?o=n.length.toString():n.length>0&&(o="9+")),i&&0===n.length&&(yield this.loadNoLoginsContextMenuOptions(this.i18nService.t("noMatchingLogins"))),this.sidebarActionSetBadgeText(o,t),void this.browserActionSetBadgeText(o,t)}catch(e){this.logService.error(e)}yield this.loadMenuAndUpdateBadgeForNoAccessState(i)}))}loadMenuAndUpdateBadgeForNoAccessState(e){return Hx(this,void 0,void 0,(function*(){if(e){const e=yield this.stateService.getIsAuthenticated();yield this.loadNoLoginsContextMenuOptions(this.i18nService.t(e?"unlockVaultMenu":"loginToVaultMenu"))}const t=yield Wt.getActiveTabs();null!=t&&t.forEach((e=>{null!=e.id&&(this.browserActionSetBadgeText("",e.id),this.sidebarActionSetBadgeText("",e.id))}))}))}loadLoginContextMenuOptions(e){return Hx(this,void 0,void 0,(function*(){if(null==e||e.type!==Bl.Login||e.reprompt!==Kl.None)return;let t=e.name;e.login.username&&""!==e.login.username&&(t+=" ("+e.login.username+")"),yield this.loadContextMenuOptions(t,e.id,e)}))}loadNoLoginsContextMenuOptions(e){return Hx(this,void 0,void 0,(function*(){yield this.loadContextMenuOptions(e,"noop",null)}))}loadContextMenuOptions(e,t,i){return Hx(this,void 0,void 0,(function*(){if(!chrome.contextMenus||this.menuOptionsLoaded.indexOf(t)>-1||null!=i&&i.type!==Bl.Login)return;this.menuOptionsLoaded.push(t),(null==i||i.login.password&&""!==i.login.password)&&(yield this.contextMenusCreate({type:"normal",id:"autofill_"+t,parentId:"autofill",contexts:["all"],title:this.sanitizeContextMenuTitle(e)})),(null==i||i.login.username&&""!==i.login.username)&&(yield this.contextMenusCreate({type:"normal",id:"copy-username_"+t,parentId:"copy-username",contexts:["all"],title:this.sanitizeContextMenuTitle(e)})),(null==i||i.login.password&&""!==i.login.password&&i.viewPassword)&&(yield this.contextMenusCreate({type:"normal",id:"copy-password_"+t,parentId:"copy-password",contexts:["all"],title:this.sanitizeContextMenuTitle(e)}));(yield this.stateService.getCanAccessPremium())&&(null==i||i.login.totp&&""!==i.login.totp)&&(yield this.contextMenusCreate({type:"normal",id:"copy-totp_"+t,parentId:"copy-totp",contexts:["all"],title:this.sanitizeContextMenuTitle(e)}))}))}sanitizeContextMenuTitle(e){return e.replace(/&/g,"&&")}fullSync(e=!1){return Hx(this,void 0,void 0,(function*(){const t=216e5,i=yield this.syncService.getLastSync();let n=21600001;null!=i&&(n=(new Date).getTime()-i.getTime()),e||n>=t?(yield this.syncService.fullSync(e),this.scheduleNextSync()):this.scheduleNextSync()}))}scheduleNextSync(){this.syncTimeout&&clearTimeout(this.syncTimeout),this.syncTimeout=setTimeout((()=>Hx(this,void 0,void 0,(function*(){return yield this.fullSync()}))),3e5)}contextMenusRemoveAll(){return new Promise((e=>{chrome.contextMenus.removeAll((()=>{e(),chrome.runtime.lastError}))}))}contextMenusCreate(e){return new Promise((t=>{chrome.contextMenus.create(e,(()=>{t(),chrome.runtime.lastError}))}))}actionSetIcon(e,t,i){return Hx(this,void 0,void 0,(function*(){if(!e||!e.setIcon)return;const n={path:{19:"images/icon19"+t+".png",38:"images/icon38"+t+".png"}};if(this.platformUtilsService.isFirefox())n.windowId=i,yield e.setIcon(n);else{if(!this.platformUtilsService.isSafari())return new Promise((t=>{e.setIcon(n,(()=>t()))}));e.setIcon(n)}}))}actionSetBadgeBackgroundColor(e){e&&e.setBadgeBackgroundColor&&e.setBadgeBackgroundColor({color:"#294e5f"})}browserActionSetBadgeText(e,t){chrome.browserAction&&chrome.browserAction.setBadgeText&&chrome.browserAction.setBadgeText({text:e,tabId:t})}sidebarActionSetBadgeText(e,t){if(this.sidebarAction)if(this.sidebarAction.setBadgeText)this.sidebarAction.setBadgeText({text:e,tabId:t});else if(this.sidebarAction.setTitle){let i="Bitwarden";e&&""!==e&&(i+=" ["+e+"]"),this.sidebarAction.setTitle({title:i,tabId:t})}}}class Wx{constructor(e){this._request=e}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}}class $x{download(e){const t=new Wx(e);if(Wt.isSafariApi){let i=null;i="text/plain"===t.blobOptions.type&&"string"==typeof e.blobData?e.blobData:nt.fromBufferToB64(e.blobData),LU.sendMessageToApp("downloadFile",JSON.stringify({blobData:i,blobOptions:e.blobOptions,fileName:e.fileName}),!0)}else if(navigator.msSaveOrOpenBlob)navigator.msSaveBlob(t.blob,e.fileName);else{const i=window.document.createElement("a");i.href=URL.createObjectURL(t.blob),i.download=e.fileName,window.document.body.appendChild(i),i.click(),window.document.body.removeChild(i)}}}$x.ɵfac=function(e){return new(e||$x)},$x.ɵprov=s.Yz7({token:$x,factory:$x.ɵfac});class Xx{send(e,t={}){const i=Object.assign({},{command:e},t);window.bitwardenBackgroundMessageListener(i)}}var eA=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class tA{constructor(e,t,i,n,s,o){this.platformUtilsService=e,this.i18nService=t,this.popupUtilsService=i,this.stateService=n,this.logService=s,this.themingService=o}init(){return()=>eA(this,void 0,void 0,(function*(){yield this.stateService.init(),this.popupUtilsService.inPopup(window)?window.screen.availHeight<600?window.document.body.classList.add("body-xs"):window.screen.availHeight<=800&&window.document.body.classList.add("body-sm"):window.document.body.classList.add("body-full");const e=window.document.documentElement;yield this.themingService.monitorThemeChanges(),e.classList.add("locale_"+this.i18nService.translationLocale),this.platformUtilsService.isChrome()&&navigator.platform.indexOf("Mac")>-1&&this.popupUtilsService.inPopup(window)&&(window.screenLeft<0||window.screenTop<0||window.screenLeft>window.screen.width||window.screenTop>window.screen.height)&&(e.classList.add("force_redraw"),this.logService.info("Force redraw is on"))}))}}tA.ɵfac=function(e){return new(e||tA)(s.LFG(Je),s.LFG(_e),s.LFG($t),s.LFG(js),s.LFG(Ct),s.LFG(Fa))},tA.ɵprov=s.Yz7({token:tA,factory:tA.ɵfac});class iA extends Le{constructor(){super(...arguments),this.homepage="tabs/current"}}iA.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(iA)))(t||iA)}}(),iA.ɵprov=s.Yz7({token:iA,factory:iA.ɵfac});const nA=function(e,t){return{"bwi-eye":e,"bwi-eye-slash":t}};class sA extends kU{}sA.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(sA)))(t||sA)}}(),sA.ɵcmp=s.Xpm({type:sA,selectors:[["ng-component"]],features:[s.qOj],decls:62,vars:25,consts:[["role","dialog","aria-modal","true",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],[1,"modal-content",3,"ngSubmit"],["form",""],[1,"modal-body"],[1,"box"],[1,"box-header"],[1,"box-content"],["appBoxRow","",1,"box-content-row","box-content-row-flex"],[1,"row-main"],["for","masterPassword"],["id","masterPassword","name","MasterPassword","required","","appAutofocus","",1,"monospaced",3,"type","ngModel","ngModelChange"],[1,"action-buttons"],["type","button","appStopClick","",1,"row-btn",3,"appA11yTitle","click"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"],[1,"box-footer"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0),s._uU(1,"\n "),s.TgZ(2,"div",1),s._uU(3,"\n "),s.TgZ(4,"form",2,3),s.NdJ("ngSubmit",(function(){return t.submit()})),s._uU(6,"\n "),s.TgZ(7,"div",4),s._uU(8,"\n "),s.TgZ(9,"div",5),s._uU(10,"\n "),s.TgZ(11,"h1",6),s._uU(12),s.ALo(13,"i18n"),s.qZA(),s._uU(14,"\n "),s.TgZ(15,"div",7),s._uU(16,"\n "),s.TgZ(17,"div",8),s._uU(18,"\n "),s.TgZ(19,"div",9),s._uU(20,"\n "),s.TgZ(21,"label",10),s._uU(22),s.ALo(23,"i18n"),s.qZA(),s._uU(24,"\n "),s.TgZ(25,"input",11),s.NdJ("ngModelChange",(function(e){return t.masterPassword=e})),s.qZA(),s._uU(26,"\n "),s.qZA(),s._uU(27,"\n "),s.TgZ(28,"div",12),s._uU(29,"\n "),s.TgZ(30,"button",13),s.NdJ("click",(function(){return t.togglePassword()})),s.ALo(31,"i18n"),s._uU(32,"\n "),s._UZ(33,"i",14),s._uU(34,"\n "),s.qZA(),s._uU(35,"\n "),s.qZA(),s._uU(36,"\n "),s.qZA(),s._uU(37,"\n "),s.qZA(),s._uU(38,"\n "),s.TgZ(39,"div",15),s._uU(40),s.ALo(41,"i18n"),s.qZA(),s._uU(42,"\n "),s.qZA(),s._uU(43,"\n "),s.qZA(),s._uU(44,"\n "),s.TgZ(45,"div",16),s._uU(46,"\n "),s.TgZ(47,"button",17),s._uU(48,"\n "),s.TgZ(49,"span"),s._uU(50),s.ALo(51,"i18n"),s.qZA(),s._uU(52,"\n "),s.qZA(),s._uU(53,"\n "),s.TgZ(54,"button",18),s._uU(55),s.ALo(56,"i18n"),s.qZA(),s._uU(57,"\n "),s.qZA(),s._uU(58,"\n "),s.qZA(),s._uU(59,"\n "),s.qZA(),s._uU(60,"\n"),s.qZA(),s._uU(61,"\n")),2&e&&(s.xp6(12),s.Oqu(s.lcZ(13,10,"passwordConfirmation")),s.xp6(10),s.Oqu(s.lcZ(23,12,"masterPass")),s.xp6(3),s.s9C("type",t.showPassword?"text":"password"),s.Q6J("ngModel",t.masterPassword),s.xp6(5),s.s9C("appA11yTitle",s.lcZ(31,14,"toggleVisibility")),s.uIk("aria-pressed",t.showPassword),s.xp6(3),s.Q6J("ngClass",s.WLB(22,nA,!t.showPassword,t.showPassword)),s.xp6(7),s.hij("\n ",s.lcZ(41,16,"passwordConfirmationDesc"),"\n "),s.xp6(10),s.Oqu(s.lcZ(51,18,"ok")),s.xp6(5),s.hij("\n ",s.lcZ(56,20,"cancel"),"\n "))},dependencies:[u.mk,ue._Y,ue.Fj,ue.JJ,ue.JL,ue.Q7,ue.On,ue.F,Ht,It,Xe,St,Ze],encapsulation:2});class oA extends PU{constructor(){super(...arguments),this.component=sA}}oA.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(oA)))(t||oA)}}(),oA.ɵprov=s.Yz7({token:oA,factory:oA.ɵfac});class rA extends Hb{constructor(e,t,i,n){super(t,i,n),this.mainSearchService=e}clearIndex(){throw new Error("Not available.")}indexCiphers(){throw new Error("Not available.")}getIndexForSearch(){return this.mainSearchService.getIndexForSearch()}}class aA extends Re{constructor(){super(...arguments),this.homepage="tabs/current"}}aA.ɵfac=function(){let e;return function(t){return(e||(e=s.n5z(aA)))(t||aA)}}(),aA.ɵprov=s.Yz7({token:aA,factory:aA.ɵfac});const lA=null==Wt.getBackgroundPage(),cA=lA?function(){const e=new jx(!0);return e.bootstrap(),e}():Wt.getBackgroundPage().bitwardenMain;function uA(e){return()=>cA?cA[e]:null}class dA{}dA.ɵfac=function(e){return new(e||dA)},dA.ɵmod=s.oAB({type:dA}),dA.ɵinj=s.cJS({providers:[tA,Fr,{provide:s.soG,useFactory:()=>uA("i18nService")().translationLocale,deps:[]},{provide:s.ip1,useFactory:e=>e.init(),deps:[tA],multi:!0},{provide:Le,useClass:iA},{provide:Re,useClass:aA},{provide:$t,useFactory:()=>new $t(lA)},{provide:qe,useFactory:()=>lA?new Xx:new ix},{provide:pn,useFactory:uA("twoFactorService"),deps:[]},{provide:Ie,useFactory:uA("authService"),deps:[]},{provide:jo,useFactory:(e,t,i)=>new rA(uA("searchService")(),e,t,i),deps:[Sc,Ct,_e]},{provide:Uc,useFactory:uA("auditService"),deps:[]},{provide:pv,useFactory:uA("fileUploadService"),deps:[]},{provide:Sc,useFactory:uA("cipherService"),deps:[]},{provide:Ft,useFactory:uA("cryptoFunctionService"),deps:[]},{provide:ba,useFactory:uA("folderService"),deps:[]},{provide:Sa,useFactory:uA("folderApiService"),deps:[]},{provide:xc,useFactory:uA("collectionService"),deps:[]},{provide:Ct,useFactory:uA("logService"),deps:[]},{provide:$e,useExisting:Ye},{provide:Ye,useFactory:uA("environmentService"),deps:[]},{provide:Ma,useFactory:uA("totpService"),deps:[]},{provide:tp,useFactory:uA("tokenService"),deps:[]},{provide:_e,useFactory:uA("i18nService"),deps:[]},{provide:zt,useFactory:uA("cryptoService"),deps:[]},{provide:jr,useFactory:uA("eventService"),deps:[]},{provide:Hi,useFactory:uA("policyService"),deps:[]},{provide:$i,useFactory:uA("policyApiService"),deps:[]},{provide:Je,useFactory:uA("platformUtilsService"),deps:[]},{provide:Dt,useFactory:uA("passwordGenerationService"),deps:[]},{provide:Tt,useFactory:uA("apiService"),deps:[]},{provide:bi,useFactory:uA("syncService"),deps:[]},{provide:yv,useFactory:uA("settingsService"),deps:[]},{provide:mv,useFactory:uA("storageService"),deps:[]},{provide:An,useFactory:uA("appIdService"),deps:[]},{provide:th,useFactory:uA("autofillService"),deps:[]},{provide:Hr,useFactory:uA("exportService"),deps:[]},{provide:Ks,useFactory:uA("sendService"),deps:[]},{provide:De,useFactory:uA("keyConnectorService"),deps:[]},{provide:Wr,useFactory:uA("userVerificationService"),deps:[]},{provide:Bt,useFactory:uA("vaultTimeoutSettingsService"),deps:[]},{provide:Kt,useFactory:uA("vaultTimeoutService"),deps:[]},{provide:gv,useFactory:uA("notificationsService"),deps:[]},{provide:Ct,useFactory:uA("logService"),deps:[]},{provide:Ac,useClass:oA},{provide:ta,useFactory:uA("organizationService"),deps:[]},{provide:ju,useFactory:()=>new ju(uA("stateService")(),uA("organizationService")(),uA("folderService")(),uA("cipherService")(),uA("collectionService")(),uA("policyService")()),deps:[]},{provide:vv,useFactory:uA("providerService"),deps:[]},{provide:jg,useFactory:uA("secureStorageService"),deps:[]},{provide:Hg,useFactory:uA("memoryStorageService")},{provide:js,useFactory:uA("stateService"),deps:[]},{provide:Hn,useFactory:uA("usernameGenerationService"),deps:[]},{provide:Mt,useExisting:js,deps:[]},{provide:$r,useClass:$x},{provide:Fa,useFactory:()=>new cv(uA("stateService")(),uA("platformUtilsService")().isSafari()?uA("backgroundWindow")():window,document)}],imports:[IU]}),(0,u.qS)(d.Z,"ar"),(0,u.qS)(h.Z,"az"),(0,u.qS)(p.Z,"be"),(0,u.qS)(g.Z,"bg"),(0,u.qS)(v.Z,"bn"),(0,u.qS)(y.Z,"bs"),(0,u.qS)(f.Z,"ca"),(0,u.qS)(m.Z,"cs"),(0,u.qS)(w.Z,"da"),(0,u.qS)(b.Z,"de"),(0,u.qS)(S.Z,"el"),(0,u.qS)(U.Z,"en-GB"),(0,u.qS)(x.Z,"en-IN"),(0,u.qS)(A.Z,"es"),(0,u.qS)(_.Z,"et"),(0,u.qS)(Z.Z,"eu"),(0,u.qS)(T.Z,"fa"),(0,u.qS)(C.Z,"fi"),(0,u.qS)(k.Z,"fil"),(0,u.qS)(O.Z,"fr"),(0,u.qS)(P.Z,"he"),(0,u.qS)(I.Z,"hi"),(0,u.qS)(q.Z,"hr"),(0,u.qS)(D.Z,"hu"),(0,u.qS)(M.Z,"id"),(0,u.qS)(F.Z,"it"),(0,u.qS)(N.Z,"ja"),(0,u.qS)(L.Z,"ka"),(0,u.qS)(E.Z,"km"),(0,u.qS)(R.Z,"kn"),(0,u.qS)(J.Z,"ko"),(0,u.qS)(Y.Z,"lt"),(0,u.qS)(z.Z,"lv"),(0,u.qS)(K.Z,"ml"),(0,u.qS)(B.Z,"nb"),(0,u.qS)(G.Z,"nl"),(0,u.qS)(Q.Z,"nn"),(0,u.qS)(V.Z,"pl"),(0,u.qS)(H.Z,"pt-BR"),(0,u.qS)(j.Z,"pt-PT"),(0,u.qS)(W.Z,"ro"),(0,u.qS)($.Z,"ru"),(0,u.qS)(X.Z,"si"),(0,u.qS)(ee.Z,"sk"),(0,u.qS)(te.Z,"sl"),(0,u.qS)(ie.Z,"sr"),(0,u.qS)(ne.Z,"sv"),(0,u.qS)(se.Z,"th"),(0,u.qS)(oe.Z,"tr"),(0,u.qS)(re.Z,"uk"),(0,u.qS)(ae.Z,"vi"),(0,u.qS)(le.Z,"zh-CN"),(0,u.qS)(ce.Z,"zh-TW");class hA{}hA.ɵfac=function(e){return new(e||hA)},hA.ɵmod=s.oAB({type:hA,bootstrap:[Qg]}),hA.ɵinj=s.cJS({providers:[u.H9,u.uU],imports:[o.rt,Dg,Ue.forRoot({maxOpened:2,autoDismiss:!0,closeButton:!0,positionClass:"toast-bottom-full-width"}),de.PW,n.b2,r._t,ue.u5,ke,a.xu,l.U8,ue.UX,c.Cl,dA]}),i(72658),(0,s.G48)(),n.q6().bootstrapModule(hA,{preserveWhitespaces:!0})},72658:(e,t,i)=>{"use strict";i.r(t)},95942:()=>{}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=t,e=[],n.O=(t,i,s,o)=>{if(!i){var r=1/0;for(u=0;u=o)&&Object.keys(n.O).every((e=>n.O[e](i[l])))?i.splice(l--,1):(a=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[i,s,o]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={347:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var s,o,[r,a,l]=i,c=0;if(r.some((t=>0!==e[t]))){for(s in a)n.o(a,s)&&(n.m[s]=a[s]);if(l)var u=l(n)}for(t&&t(i);cn(35192)));s=n.O(s)})(); //# sourceMappingURL=main.js.map