PageSourceSearch

https://nettbank.bnbank.no/ebank/web/9235/chunk-NwMYGxnR.js

js bnbank.no collected 2026-09-24 09:48:54 UTC 119,756 bytes, 2 lines download raw bytes

1import {m,p as p$1}from'./chunk-C8j9Zyib.js';import {Q,J,f,k as ke,V as V$3,Z}from'./chunk-DRuHffIF.js';import {r}from'./chunk-B3Gtb_bQ.js';import {V as V$4}from'./chunk-BzoCgg9v.js';import {m as m$1}from'./chunk-BzZkZDtr.js';import {L,G}from'./chunk-Ch6V68he.js';import {V,H,Q as Q$1}from'./chunk-T3vBxKw0.js';import {a as t,k as n,A as c,o}from'./chunk-SDcs1xql.js';import {f as d,r as l,aa as a,ab as n$1}from'./chunk-BdMK6VUw.js';import {x as my,O as Oc,b3 as ii,d3 as r8,bj as Cu,d5 as No$1,dm as t8,F as we,bh as _e,bx as Ro$1,cb as fN,cg as U8,dG as vO,bk as g6,bl as Ga,c8 as H8,c9 as Bf,ca as Pf,bb as xu,bf as BO,e3 as Bn$1,e5 as a8,dH as o8,eo as QI,ep as qI,e4 as x8,bG as sB,fN as Qi,fr as B6,i3 as p8,e1 as JI,e2 as Ls,bg as m0,bV as K6,i4 as w0,i5 as S0,i6 as k0,ak as aa,f1 as Xv,_ as _f,eM as Sf,cV as B,t as de$1,X,da as lo$1,ej as Zt,w as we$1,ci as CI,j as Sa,m as mI,D,d as E$1,cS as Je,y as yI,P as qT,br as Te,fc as Eu,bT as hi,bU as ig,fk as V6,fl as H6,fm as j6,bp as f6,bq as m6,bM as Ys,a2 as ye,a6 as mC,ab as gC,cU as jt,cW as Ml,du as Kc,L as Do$1,aS as V$1,E as E$2,dr as Er$1,cF as eR,cH as co$1,cI as Ch,cM as j,cN as u,d4 as vI,cX as X3,cY as uo,cZ as Nl,c_ as fu,c$ as Pa,d0 as gu,d1 as on,d2 as sI,a3 as Ms,ad as c_,a5 as rd,aM as N_,a4 as ky,d6 as tT,c2 as qy,c3 as HC,aa as mb,a8 as Ry,b$ as T_,bv as R_,d7 as nT,aN as cd,cl as A,cq as Ws,cr as W8,cs as G8,bK as p,ba as cv,cj as H$1,bI as Qe,b6 as K$1,M as S$1,V as V$2,ed as E8,eS as Cr$1,eu as f8,dL as yI$1,dM as i8,ef as y8,hC as k8,fy as R$,e0 as vn,f6 as Ol,bP as og,bQ as TO,bR as X8,bS as Z8,fO as Yy,fP as VC,gW as Ie,eR as oR,i7 as h8,dc as Y9,A as D$1,d_ as ea,fR as BI,f0 as M,i8 as PI,bB as X9,bz as Nf,i9 as u8,ia as c8,dg as D_,hX as i,ib as _u,aL as RC,dP as QT,ft as x$,c1 as CC,e as ep,b_,$ as $N,h as he,J as da,v as vM,p as pi,aw as F$1,dC as q,dD as G$1,dV as vc,dz as E$3,cn as X$1,W,dF as mi,be as na,N as N$1,dE as Ro$2,c5 as Be$1,K as j$1,dA as J$1,dW as os,c6 as yh,c7 as vh,bY as IC,bZ as EC,cv as yC,c0 as wy,dR as vC}from'./chunk-hxK0xzc4.js';import {s}from'./chunk-D1g3129g.js';import {e as C,T}from'./chunk-CWBrHG4i.js';import {E,S,F,N}from'./main-UKM7BIED.js';import'./chunk-DROiOONM.js';$N();he();da();vM();vM();pi();F$1();vM();vM();var Rt=class i{constructor(e){this.logService=e;}filterCompanies(e){return e.filter(t=>!!t.links?.placementAccountOrders)}handleError(e,t){this.logService.error(`SavingsAccountComponent: Error while getting ${t}`,e.message);}static{this.\u0275fac=function(t){return new(t||i)(de$1(f))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};q();vM();G$1();vc();var Ke=class i extends E$3{constructor(t,o){super();this.dsObservable=t;this.DS=o;this.dsNames=["corporateAdminAccount"];}fetch(){return this.DS.findAll("corporateAdminAccount")}fromCache(t,o){return o}static{this.\u0275fac=function(o){return new(o||i)(de$1(J$1),de$1(os))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};var Rr={accountInfo:{accountNumber:"",accountAlias:"",accountId:""},agreementCustomers:[],agreementAccounts:[],showSpinner:false,showSummarySpinner:false},Ze=class i extends V({protectedState:false},Q$1(Rr)){constructor(t,o,l){super();this.agreementCustomersService=t;this.savingsAccountCreateService=o;this.agreementAccountsService=l;this.loadAgreementCustomers=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementCustomersService.get().pipe(G({next:t=>{H(this,{agreementCustomers:this.savingsAccountCreateService.filterCompanies(t),showSpinner:false});},error:t=>{this.savingsAccountCreateService.handleError(t,"agreement customers"),H(this,{showSpinner:false});}})))));this.loadAgreementAccounts=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementAccountsService.get().pipe(G({next:t=>{H(this,{agreementAccounts:t,showSpinner:false});},error:t=>{this.savingsAccountCreateService.handleError(t,"agreement accounts"),H(this,{showSpinner:false});}})))));}storeAccountInfo(t){H(this,{accountInfo:t});}showLoadingSpinner(t){H(this,{showSpinner:t});}static{this.\u0275fac=function(o){return new(o||i)(de$1(J),de$1(Rt),de$1(Ke))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};X$1();da();he();$N();var hn=class i{constructor(e,t,o){this.savingsAccountStore=e;this.urlService=t;this.router=o;this.dataUsers=D(c);}
1ngOnInit(){this.loadAgreementAccounts(),this.getCurrentUserId();}copy(){let e=this.findAgreementAccount();this.router.navigate(["page/corporate-admin/copy-account-rights/step2"],{queryParams:{selectedAccountId:e.id}});}redirectToAccountRights(){let e=this.savingsAccountStore.accountInfo().accountNumber;this.router.navigate(["page/account-rights"],{queryParams:{account:e,hideUnassigned:true}});}loadAgreementAccounts(){this.savingsAccountStore.loadAgreementAccounts();}findAgreementAccount(){return this.savingsAccountStore.agreementAccounts().find(e=>e.accountNumber===this.savingsAccountStore.accountInfo().accountNumber)}getCurrentUserId(){this.dataUsers.get().subscribe(e=>{this.setUserAdministrationLink(e.userId);});}setUserAdministrationLink(e){this.userAdministrationLink=this.urlService.getUrl("URL.PAGE.ACCOUNT_RIGHTS_AND_PERMISSIONS",{userId:e});}static{this.\u0275fac=function(t){return new(t||i)(Do$1(Ze),Do$1(A),Do$1(V$1))};}static{this.\u0275cmp=qT({type:i,selectors:[["savings-account-created-summary"]],standalone:false,decls:18,vars:12,consts:[[1,"summary-page"],[3,"titleText","hideTitle"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],[1,"ebank-button-container"],[3,"buttonClick","disabled"]],template:function(t,o){t&1&&(Ms(0,"section",0)(1,"ebank-description-list-section",1),N_(2,"translate"),Ms(3,"div",2)(4,"dt",3),c_(5,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),Ms(6,"dd",4),c_(7),rd()(),Ms(8,"div",2)(9,"dt",3),c_(10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NUMBER"),rd(),Ms(11,"dd",4),c_(12),N_(13,"accountNumberFormat"),rd()()(),Ms(14,"div",5)(15,"ebank-button",6),qy("buttonClick",function(){return o.redirectToAccountRights()}),c_(16),N_(17,"translate"),rd()()()),t&2&&(mb(),Ry("titleText",R_(2,6,"PAGE.ACCOUNT_ORDERING.LIST_TITLE"))("hideTitle",true),mb(6),cv(o.savingsAccountStore.accountInfo().accountAlias),mb(5),cv(R_(13,8,o.savingsAccountStore.accountInfo().accountNumber)),mb(3),Ry("disabled",o.savingsAccountStore.showSpinner()),mb(),cd(" ",R_(17,10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_RIGHTS.BUTTON")," "));},dependencies:[Te,_e,U8,Ws,W8,G8,ye,p],encapsulation:2,changeDetection:1});}};vM();function Kn(){return [{type:"Spending",link:"URL.PAGE.SPENDING_ACCOUNT",title:"PAGE.ACCOUNT_ORDERING.SPENDING_ACCOUNT.TITLE",description:"PAGE.ACCOUNT_ORDERING.SPENDING_ACCOUNT.DESCRIPTION"},{type:"Savings",link:"URL.PAGE.SAVINGS_ACCOUNT",title:"PAGE.ACCOUNT_ORDERING.SAVINGS_ACCOUNT.TITLE",description:"PAGE.ACCOUNT_ORDERING.SAVINGS_ACCOUNT.DESCRIPTION"},{type:"ClientGeneral",link:"URL.PAGE.CLIENT_ACCOUNT_GENERAL",title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_GENERAL.TITLE",description:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_GENERAL.DESCRIPTION"},{type:"ClientImprest",link:"URL.PAGE.CLIENT_ACCOUNT_IMPREST",title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_IMPREST.TITLE",description:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_IMPREST.DESCRIPTION"},{type:"Deposit",link:"URL.PAGE.DEPOSIT_ACCOUNT",title:"PAGE.ACCOUNT_ORDERING.DEPOSIT_ACCOUNT.TITLE",description:"PAGE.ACCOUNT_ORDERING.DEPOSIT_ACCOUNT.DESCRIPTION"}]}pi();vM();var Xe=class i{constructor(e){this.dataUserAccessRights=e;}checkIfUserHasAccessRights(){return this.dataUserAccessRights.get().pipe(Zt(1),we$1(e=>e.administrator))}checkCpsAccountAccessRights(){let e=["order_client_account","order_client_individual_account","order_client_imprest_account","order_corporate_account","order_placement_account","basic_rental_deposit","full_rental_deposit"];return this.dataUserAccessRights.get().pipe(Zt(1),we$1(t=>{let o=e.filter(l=>l in t&&t[l]===true);return o.length>0?o:[]}))}static{this.\u0275fac=function(t){return new(t||i)(de$1(o))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};pi();pi();F$1();vM();vM();var Nt=class i{constructor(e){this.logService=e;}filterCompanies(e){return e.filter(t=>!!t.links?.clientAccountOrders)}handleError(e,t){this.logService.error(`ClientAccountComponent: Error while getting ${t}`,e.message);}static{this.\u0275fac=function(t){return new(t||i)(de$1(f))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};var Ir={accountInfo:{accountNumber:"",accountAlias:"",accountId:""},agreementCustomers:[],agreementAccounts:[],publicCountries:[],beneficialOwners:[],accountWithBeneficialOwnersInfo:null,shouldKeepBeneficialOwnersData:false,showSpinner:false},K=class i extends V({protectedState:false},Q$1(Ir)){constructor(t,o,l,f,O){super();this.agreementCustomersService=t;this.clientAccountCreateService=o;this.agreementAccountsService=l;this.dataPublicCountryService=f;this.publicCountriesToListPipe=O;this.loadAgreementCustomers=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementCustomersService.get().pipe(G({next:t=>{H(this,{agreementCustomers:this.clientAccountCreateService.filterCompanies(t),showSpinner:false});},error:t=>{this.clientAccountCreateService.handleError(t,"agreement customers"),H(this,{showSpinner:false});}})))));this.loadAgreementAccounts=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementAccountsService.get().pipe(G({next:t=>{H(this,{agreementAccounts:t,showSpinner:false});},error:t=>{this.clientAccountCreateService.handleError(t,"agreement accounts"),H(this,{showSpinner:false});}})))));this.loadPublicCountries=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.dataPublicCountryService.get().pipe(G({next:t=>{H(this,{publicCountries:this.publicCountriesToListPipe.transform(t),showSpinner:false});},error:t=>{this.clientAccountCreateService.handleError(t,"public countries"),H(this,{showSpinner:false});}})))));}storeAccountInfo(t){H(this,{accountInfo:t});}storeBeneficialOwner(t){H(this,{beneficialOwners:[...this.beneficialOwners(),t]});}storeBeneficialOwners(t){H(this,{beneficialOwners:[...t]});}removeBeneficialOwner(t){H(this,{beneficialOwners:this.beneficialOwners().filter((o,l)=>l!==t)});}resetBeneficialOwnersSummaryData(){H(this,{beneficialOwners:[],accountWithBeneficialOwnersInfo:null,shouldKeepBeneficialOwnersData:false});}storeClientAccountWithBeneficialOwnersInfo(t){H(this,{accountWithBeneficialOwnersInfo:E(E({},this.accountWithBeneficialOwnersInfo()??{}),t)});}setShouldKeepBeneficialOwnersData(t){H(this,{shouldKeepBeneficialOwnersData:t});}showLoadingSpinner(t){H(this,{showSpinner:t});}static{this.\u0275fac=function(o){return new(o||i)(de$1(J),de$1(Nt),de$1(Ke),de$1(a),de$1(n$1))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};W();vM();he();$N();var wr=(i,e)=>e.type;function Pr(i,e){if(i&1&&(Ms(0,"ebank-link-panel",3),N_(1,"sbUrl"),Ms(2,"ebank-template-basic")(3,"ebank-template-basic-title"),c_(4),N_(5,"translate"),rd(),Ms(6,"ebank-template-basic-text"),c_(7),N_(8,"translate"),rd()()()),i&2){let t=RC().$implicit;Ry("url",R_(1,3,t.link)),mb(4),cv(R_(5,5,t.title)),mb(3),cv(R_(8,7,t.description));}}function Lr(i,e){i&1&&wy(0,Pr,9,9,"ebank-link-panel",4);}function Ur(i,e){if(i&1&&(Ms(0,"ebank-panel-list",2),IC(1,Lr,1,0,"ebank-link-panel",3,wr),rd(),ky(3,"ebank-s
1pinner",0)),i&2){let t=RC();mb(),EC(t.accountTypes),mb(2),Ry("loading",t.depositAuthorizationCheckInProgress());}}function Gr(i,e){if(i&1&&ky(0,"ebank-spinner",0),i&2){let t=RC();Ry("loading",t.depositAuthorizationCheckInProgress());}}function Br(i,e){i&1&&(Ms(0,"ebank-page-alert",1)(1,"ebank-page-alert-header",5),c_(2,"PAGE.ACCOUNT_ORDERING_SHARED.NO_ACCOUNT_TYPES"),rd()());}var On=class i{constructor(){this.accountTypes=Kn();this.accountTypesAvailableForUser={Spending:false,Savings:false,ClientGeneral:false,ClientImprest:false,Deposit:false};this.userRoles=[];this.accountOrderingConfigService=D(m);this.accountOrderingAccessRightsService=D(Xe);this.dataEbankCorporateCompaniesService=D(m$1);this.clientAccountStore=D(K);this.logger=D(E$1);this.depositAuthorizationCheckInProgress=Je(false);}ngOnInit(){this.checkUserAccessRights(),this.clientAccountStore.resetBeneficialOwnersSummaryData();}checkUserAccessRights(){this.accountOrderingAccessRightsService.checkCpsAccountAccessRights().subscribe({next:e=>{this.userRoles=e,this.setAccountTypesVisibilityFromBankConfig(),this.setAccountTypesVisibilityBasedOnUserRoles(),this.addDepositAccountIfAuthorized(),this.checkAndSetBeneficialOwnersLink();},error:e=>{this.userRoles=[],this.logger.error("Something wrong happened while get access rights",e);}});}setAccountTypesVisibilityFromBankConfig(){this.accountTypes=this.accountTypes.filter(e=>this.accountOrderingConfigService.config.accountTypesVisibility[e.type]);}setAccountTypesVisibilityBasedOnUserRoles(){this.userRoles.includes("order_client_account")&&(this.accountTypesAvailableForUser.ClientGeneral=true),this.userRoles.includes("order_client_imprest_account")&&(this.accountTypesAvailableForUser.ClientImprest=true),this.userRoles.includes("order_corporate_account")&&(this.accountTypesAvailableForUser.Spending=true),this.userRoles.includes("order_placement_account")&&(this.accountTypesAvailableForUser.Savings=true),this.accountTypes=this.accountTypes.filter(e=>this.accountTypesAvailableForUser[e.type]);}addDepositAccountIfAuthorized(){return S(this,null,function*(){let e=this.accountOrderingConfigService.config.accountTypesVisibility.Deposit===true,t=this.userRoles.includes("basic_rental_deposit")&&this.userRoles.includes("full_rental_deposit");if(e&&t)try{this.depositAuthorizationCheckInProgress.set(!0),(yield yI(this.dataEbankCorporateCompaniesService.get({external_shortname:"391"}))).length>0&&(this.accountTypesAvailableForUser.Deposit=!0,this.accountTypes=[...this.accountTypes,Kn().find(f=>f.type==="Deposit")]);}catch(o){this.logger.error("Something wrong happened while checking cps rdsa service access rights",o);}finally{this.depositAuthorizationCheckInProgress.set(false);}})}checkAndSetBeneficialOwnersLink(){let e=this.accountTypes.find(o=>o.type==="ClientGeneral"),t=this.accountTypes.find(o=>o.type==="ClientImprest");e&&this.accountOrderingConfigService.config.clientAccountBeneficialOwnersEnabled&&(e.link="URL.PAGE.CLIENT_ACCOUNT_BENEFICIAL_OWNERS"),t&&this.accountOrderingConfigService.config.clientAccountBeneficialOwnersEnabled&&(t.link="URL.PAGE.CLIENT_ACCOUNT_IMPREST_BENEFICIAL_OWNERS");}static{this.\u0275fac=function(t){return new(t||i)};}
1static{this.\u0275cmp=qT({type:i,selectors:[["account-ordering"]],standalone:false,decls:3,vars:1,consts:[[3,"loading"],["level","error"],["groupHeadingId","heading-id"],[3,"url"],[3,"url",4,"ebankPanelList"],["translate",""]],template:function(t,o){t&1&&mC(0,Ur,4,1)(1,Gr,1,1,"ebank-spinner",0)(2,Br,3,0,"ebank-page-alert",1),t&2&&gC(o.accountTypes.length>0?0:o.depositAuthorizationCheckInProgress()?1:2);},dependencies:[Te,Eu,hi,ig,V6,H6,j6,f6,m6,Ys,ye,n],encapsulation:2,changeDetection:1});}};vM();mi();vM();pi();F$1();vM();vM();var Dt=class i{constructor(e){this.logService=e;}filterCompanies(e){return e.filter(t=>!!t.links?.corporateAccountOrders)}handleError(e,t){this.logService.error(`SpendingAccountComponent: Error while getting ${t}`,e.message);}static{this.\u0275fac=function(t){return new(t||i)(de$1(f))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};var Fr={accountInfo:{accountNumber:"",accountAlias:"",accountId:""},agreementCustomers:[],agreementAccounts:[],showSpinner:false,showSummarySpinner:false},et=class i extends V({protectedState:false},Q$1(Fr)){constructor(t,o,l){super();this.agreementCustomersService=t;this.spendingAccountCreateService=o;this.agreementAccountsService=l;this.loadAgreementCustomers=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementCustomersService.get().pipe(G({next:t=>{H(this,{agreementCustomers:this.spendingAccountCreateService.filterCompanies(t),showSpinner:false});},error:t=>{this.spendingAccountCreateService.handleError(t,"agreement customers"),H(this,{showSpinner:false});}})))));this.loadAgreementAccounts=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementAccountsService.get().pipe(G({next:t=>{H(this,{agreementAccounts:t,showSpinner:false});},error:t=>{this.spendingAccountCreateService.handleError(t,"agreement accounts"),H(this,{showSpinner:false});}})))));}storeAccountInfo(t){H(this,{accountInfo:t});}showLoadingSpinner(t){H(this,{showSpinner:t});}showSummaryLoadingSpinner(t){H(this,{showSummarySpinner:t});}static{this.\u0275fac=function(o){return new(o||i)(de$1(J),de$1(Dt),de$1(Ke))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};na();vM();na();var Tt=class i{constructor(e){this.formBuilder=e;this.spendingAccountForm=this.formBuilder.group({accountAlias:["",[lo$1.required,lo$1.pattern("^(?!\\s*$).+"),lo$1.maxLength(25)]],ownerCustomerNumber:""});}get form(){return this.spendingAccountForm}get accountAliasControl(){return this.spendingAccountForm.controls.accountAlias}markControlsAsDirty(){this.accountAliasControl.markAsTouched(),this.accountAliasControl.markAsDirty();}resetForm(){this.spendingAccountForm.reset();}static{this.\u0275fac=function(t){return new(t||i)(de$1(oR))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};vM();G$1();vc();var yt=class i{constructor(e,t){this.dsObservable=e;this.DS=t;this.dsNames=["accountOrderingSpendingAccount"];}create(e,t){return this.DS.create("accountOrderingSpendingAccount",e,{params:{target_url:t}})}confirm(e){return this.restoreCreatedAccount(e).confirm()}restoreCreatedAccount(e){return this.DS.definitions.accountOrderingSpendingAccount.inject?.(e)}static{this.\u0275fac=function(t){return new(t||i)(de$1(J$1),de$1(os))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};da();N$1();Ro$2();na();he();$N();vM();var Be=class i{transform(e){return {label:e}}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275pipe=QT({name:"labelMap",type:i,pure:true,standalone:false});}};var Hr=i=>[i],Wr="account-ordering.spending-account.create",Rn=class i{constructor(e,t,o,l,f,O){this.spendingAccountStore=e;this.spendingAccountFormService=t;this.spendingAccountDataService=o;this.router=l;this.alert=f;this.documentSigningResume=O;this.LabelMap=r;this.spendingAccountForm=this.spendingAccountFormService.form;this.resumeReady=Je(false);this.showLoadingSpinner=jt(()=>this.spendingAccountStore.showSpinner()||(this.spendingAccountResume?.isActive()??false));this.spendingAccountResume=this.documentSigningResume.connect({actionId:Wr,ready:this.resumeReady,replay:U=>S(this,null,function*(){yield this.confirmSpendingAccount(U);})}),Ml(()=>{let U=this.spendingAccountResume?.state();U&&this.hydrateResumeState(U);}),Ml(()=>{let U=this.spendingAccountResume?.error();U&&this.handleRuntimeResumeError(U);});}get accountAliasControl(){return this.spendingAccountForm.controls.accountAlias}get ownerCustomerControl(){return this.spendingAccountForm.controls.ownerCustomerNumber}ngOnInit(){this.loadAgreementCustomers(),this.resetAccountInfoState();}ngOnDestroy(){this.spendingAccountResume?.destroy();}createAndConfirmSpendingAccount(){return S(this,null,function*(){if(this.spendingAccountFormService.markControl
1sAsDirty(),this.spendingAccountForm.invalid)return;this.resumeReady.set(false),this.spendingAccountStore.showLoadingSpinner(true);let e={ownerCustomerNumber:this.ownerCustomerControl.value.customerNumber,accountAlias:this.accountAliasControl.value};try{yield this.spendingAccountResume?.run(l=>S(this,[l],function*({openSigning:t,redirectUrl:o}){let f=yield this.spendingAccountDataService.create(e,o),O=f.links.signingUrl?.href;if(!O)throw new Error("Missing signing URL for spending account create response");yield t({signUrl:O,state:this.buildResumeState(f)});}));}catch(t){this.spendingAccountStore.showLoadingSpinner(false),this.spendingAccountResume?.error()!==t&&!Kc(t)&&(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during account creation",t));}finally{this.resumeReady.set(false);}})}confirmSpendingAccount(e){return S(this,null,function*(){try{let t=yield this.spendingAccountDataService.confirm(e.createdAccount);this.spendingAccountStore.storeAccountInfo({accountId:t.id||e.createdAccount.id||"",accountAlias:t.accountAlias,accountNumber:t.accountNumber||""}),yield this.router.navigate(["page","account-ordering","spending-account-created-summary"]);}finally{this.spendingAccountStore.showLoadingSpinner(false);}})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for spending account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.spendingAccountResume?.shouldReplay()??false;this.spendingAccountDataService.restoreCreatedAccount(e.createdAccount),this.accountAliasControl.setValue(e.createdAccount.accountAlias),this.ownerCustomerControl.setValue(e.createdAccount.ownerCustomerNumber),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.spendingAccountStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during spending account signing resume",e)),this.spendingAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e;return JSON.parse(JSON.stringify(t))}loadAgreementCustomers(){this.spendingAccountStore.agreementCustomers().length||this.spendingAccountStore.loadAgreementCustomers();}resetAccountInfoState(){this.spendingAccountFormService.resetForm();}static{this.\u0275fac=function(t){return new(t||i)(Do$1(et),Do$1(Tt),Do$1(yt),Do$1(V$1),Do$1(E$2),Do$1(Er$1))};}
1static{this.\u0275cmp=qT({type:i,selectors:[["spending-account-create"]],standalone:false,decls:28,vars:20,consts:[["accountAliasRef","ebankControl"],[3,"loading"],[3,"formGroup"],["translate",""],["id","spendingAccountAgreementCustomers","formControlName","ownerCustomerNumber",3,"isLoading","options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["formControlName","accountAlias"],["validation","required",3,"control"],["validation","pattern",3,"control"],["validation","maxlength",3,"control"],[3,"buttonClick","disabled"]],template:function(t,o){if(t&1&&(Ms(0,"section")(1,"ebank-spinner",1)(2,"form",2)(3,"ebank-form-field")(4,"ebank-label",3),c_(5,"PAGE.ACCOUNT_ORDERING_SHARED.SELECT_COMPANY"),rd(),Ms(6,"ebank-simple-selector",4),N_(7,"translate"),ky(8,"ebank-option-template",5),N_(9,"labelMap"),rd(),tT(),rd(),Ms(10,"ebank-form-field")(11,"ebank-label",3),c_(12,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),ky(13,"ebank-input-field",6,0),tT(),Ms(15,"ebank-form-error-wrapper")(16,"ebank-form-error",7)(17,"span",3),c_(18,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(19,"ebank-form-error",8)(20,"span",3),c_(21,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(22,"ebank-form-error",9)(23,"span",3),c_(24,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()()()()(),Ms(25,"ebank-button",10),qy("buttonClick",function(){return o.createAndConfirmSpendingAccount()}),c_(26),N_(27,"translate"),rd()()()),t&2){let l=HC(14);mb(),Ry("loading",o.showLoadingSpinner()),mb(),Ry("formGroup",o.spendingAccountForm),mb(4),Ry("isLoading",o.showLoadingSpinner())("options",o.spendingAccountStore.agreementCustomers())("searchAttributes",T_(18,Hr,o.LabelMap.Name))("titleOnMobile",R_(7,12,"PAGE.ACCOUNT_ORDERING_SHARED.SELECT_COMPANY")),nT(),mb(2),Ry("labelMap",R_(9,14,o.LabelMap.Name)),mb(5),nT(),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(3),Ry("disabled",o.showLoadingSpinner()),mb(),cd(" ",R_(27,16,"PAGE.ACCOUNT_ORDERING_SHARED.CREATE")," ");}},dependencies:[eR,co$1,Ch,j,u,Te,vI,X3,uo,Nl,fu,Pa,gu,on,sI,No$1,t8,_e,Ys,ye,Be],encapsulation:2,changeDetection:1});}};vM();mi();vM();na();vM();na();var _t=class i{constructor(e){this.formBuilder=e;this.savingsAccountForm=this.formBuilder.group({accountAlias:["",[lo$1.required,lo$1.pattern("^(?!\\s*$).+"),lo$1.maxLength(25)]],ownerCustomerNumber:""});}get form(){return this.savingsAccountForm}get accountAliasControl(){return this.savingsAccountForm.controls.accountAlias}markControlsAsDirty(){this.accountAliasControl.markAsTouched(),this.accountAliasControl.markAsDirty();}resetForm(){this.savingsAccountForm.reset();}static{this.\u0275fac=function(t){return new(t||i)(de$1(oR))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};vM();G$1();vc();var It=class i{constructor(e,t){this.dsObservable=e;this.DS=t;this.dsNames=["accountOrderingSavingsAccount"];}create(e,t){return this.DS.create("accountOrderingSavingsAccount",e,{params:{target_url:t}})}confirm(e){return this.restoreCreatedAccount(e).confirm()}restoreCreatedAccount(e){return this.DS.definitions.accountOrderingSavingsAccount.inject?.(e)}static{this.\u0275fac=function(t){return new(t||i)(de$1(J$1),de$1(os))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};da();N$1();Ro$2();na();he();$N();var $r=i=>[i],Jr="account-ordering.savings-account.create",yn=class i{constructor(e,t,o,l,f,O){this.savingsAccountStore=e;this.savingAccountFormService=t;this.savingsAccountDataService=o;this.router=l;this.alert=f;this.documentSigningResume=O;this.LabelMap=r;this.savingsAccountForm=this.savingAccountFormService.form;this.resumeReady=Je(false);this.showLoadingSpinner=jt(()=>this.savingsAccountStore.showSpinner()||(this.savingsAccountResume?.isActive()??false));this.savingsAccountResume=this.documentSigningResume.connect({actionId:Jr,ready:this.resumeReady,replay:U=>S(this,null,function*(){yield this.confirmSavingsAccount(U);})}),Ml(()=>{let U=this.savingsAccountResume?.state();U&&this.hydrateResumeState(U);}),Ml(()=>{let U=this.savingsAccountResume?.error();U&&this.handleRuntimeResumeError(U);});}get accountAliasControl(){return this.savingsAccountForm.controls.accountAlias}get ownerCustomerControl(){return this.savingsAccountForm.controls.ownerCustomerNumber}ngOnInit(){this.loadAgreementCustomers(),this.resetAccountInfoState();}ngOnDestroy(){this.savingsAccountResume?.destroy();}createAndConfirmSavingsAccount(){return S(this,null,function*(){if(this.savingAccountFormService.markControl
1sAsDirty(),this.savingsAccountForm.invalid)return;this.resumeReady.set(false),this.savingsAccountStore.showLoadingSpinner(true);let e={ownerCustomerNumber:this.ownerCustomerControl.value?.customerNumber,accountAlias:this.accountAliasControl.value};try{yield this.savingsAccountResume?.run(l=>S(this,[l],function*({openSigning:t,redirectUrl:o}){let f=yield this.savingsAccountDataService.create(e,o),O=f.links.signingUrl?.href;if(!O)throw new Error("Missing signing URL for savings account create response");yield t({signUrl:O,state:this.buildResumeState(f)});}));}catch(t){this.savingsAccountStore.showLoadingSpinner(false),this.savingsAccountResume?.error()!==t&&!Kc(t)&&(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during account creation",t));}finally{this.resumeReady.set(false);}})}confirmSavingsAccount(e){return S(this,null,function*(){try{let t=yield this.savingsAccountDataService.confirm(e.createdAccount);this.savingsAccountStore.storeAccountInfo({accountId:t.id||e.createdAccount.id||"",accountAlias:t.accountAlias,accountNumber:t.accountNumber||""}),yield this.router.navigate(["page","account-ordering","savings-account-created-summary"]);}finally{this.savingsAccountStore.showLoadingSpinner(false);}})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for savings account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.savingsAccountResume?.shouldReplay()??false;this.savingsAccountDataService.restoreCreatedAccount(e.createdAccount),this.accountAliasControl.setValue(e.createdAccount.accountAlias),this.ownerCustomerControl.setValue(e.createdAccount.ownerCustomerNumber),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.savingsAccountStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during savings account signing resume",e)),this.savingsAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e;return JSON.parse(JSON.stringify(t))}loadAgreementCustomers(){this.savingsAccountStore.agreementCustomers().length||this.savingsAccountStore.loadAgreementCustomers();}resetAccountInfoState(){this.savingAccountFormService.resetForm();}static{this.\u0275fac=function(t){return new(t||i)(Do$1(Ze),Do$1(_t),Do$1(It),Do$1(V$1),Do$1(E$2),Do$1(Er$1))};}
1static{this.\u0275cmp=qT({type:i,selectors:[["savings-account"]],standalone:false,decls:28,vars:20,consts:[["accountAliasRef","ebankControl"],[3,"loading"],[3,"formGroup"],["translate",""],["id","savingAccountAgreementCustomers","formControlName","ownerCustomerNumber",3,"isLoading","options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["formControlName","accountAlias"],["validation","required",3,"control"],["validation","pattern",3,"control"],["validation","maxlength",3,"control"],[3,"buttonClick","disabled"]],template:function(t,o){if(t&1&&(Ms(0,"section")(1,"ebank-spinner",1)(2,"form",2)(3,"ebank-form-field")(4,"ebank-label",3),c_(5,"PAGE.ACCOUNT_ORDERING_SHARED.SELECT_COMPANY"),rd(),Ms(6,"ebank-simple-selector",4),N_(7,"translate"),ky(8,"ebank-option-template",5),N_(9,"labelMap"),rd(),tT(),rd(),Ms(10,"ebank-form-field")(11,"ebank-label",3),c_(12,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),ky(13,"ebank-input-field",6,0),tT(),Ms(15,"ebank-form-error-wrapper")(16,"ebank-form-error",7)(17,"span",3),c_(18,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(19,"ebank-form-error",8)(20,"span",3),c_(21,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(22,"ebank-form-error",9)(23,"span",3),c_(24,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()()()()(),Ms(25,"ebank-button",10),qy("buttonClick",function(){return o.createAndConfirmSavingsAccount()}),c_(26),N_(27,"translate"),rd()()()),t&2){let l=HC(14);mb(),Ry("loading",o.showLoadingSpinner()),mb(),Ry("formGroup",o.savingsAccountForm),mb(4),Ry("isLoading",o.showLoadingSpinner())("options",o.savingsAccountStore.agreementCustomers())("searchAttributes",T_(18,$r,o.LabelMap.Name))("titleOnMobile",R_(7,12,"PAGE.ACCOUNT_ORDERING_SHARED.SELECT_COMPANY")),nT(),mb(2),Ry("labelMap",R_(9,14,o.LabelMap.Name)),mb(5),nT(),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(3),Ry("disabled",o.showLoadingSpinner()),mb(),cd(" ",R_(27,16,"PAGE.ACCOUNT_ORDERING_SHARED.CREATE")," ");}},dependencies:[eR,co$1,Ch,j,u,Te,vI,X3,uo,Nl,fu,Pa,gu,on,sI,No$1,t8,_e,Ys,ye,Be],encapsulation:2,changeDetection:1});}};vM();pi();na();var tt="KLIENT ";Be$1();mi();vM();na();vM();na();$N();var Bt="^(?!\\s*$)[^!@#$%^&*]+$",pr="^.{7}(?!\\s*$).+",nt=class i{constructor(e,t){this.formBuilder=e;this.phoneValidatorService=t;this.clientAccountForm=this.formBuilder.group({accountAlias:["",[lo$1.pattern(pr),lo$1.maxLength(25)]],ownerCustomerNumber:["",lo$1.required],separateClientAccount:false,clientInfo:this.formBuilder.group({missingBirth:false,clientName:["",[lo$1.required,lo$1.pattern(Bt),lo$1.maxLength(100)]],organizationNumber:["",[lo$1.required,lo$1.pattern(/^\d{9}$|^\d{11}$/)]],dateOfBirth:["",lo$1.required],phoneNumber:["",[lo$1.required,this.phoneValidatorService.phoneFieldValidator()]],placeOfBirth:["",[lo$1.pattern(Bt),lo$1.maxLength(50)]],citizenship:["",lo$1.required],gender:["",lo$1.required],email:["",[lo$1.required,d()]]})});this.clientAccountWithBeneficialOwnersForm=this.formBuilder.group({accountAlias:["",[lo$1.pattern(pr),lo$1.maxLength(25)]],ownerCustomerNumber:["",lo$1.required],separateClientAccount:false,separateAccountType:[""]});this.beneficialOwnerPrivateForm=this.formBuilder.group({ssn:["",[lo$1.required,lo$1.pattern(/^\d{11}$/)]],firstName:["",[lo$1.required,lo$1.pattern(Bt),lo$1.maxLength(100)]],lastName:["",[lo$1.required,lo$1.pattern(Bt),lo$1.maxLength(100)]],isCorporateCustomer:false});this.beneficialOwnerCorporateForm=this.formBuilder.group({organizationNumber:["",[lo$1.required,lo$1.pattern(/^\d{9}$/)]],companyName:["",[lo$1.required,lo$1.pattern(Bt),lo$1.maxLength(100)]],isCorporateCustomer:true});}get formClientAccountBasic(){return this.clientAccountForm}get formWithBeneficialOwners(){return this.clientAccountWithBeneficialOwnersForm}get formBeneficialOwnerPrivate(){return this.beneficialOwnerPrivateForm}get formBeneficialOwnerCorporate(){return this.beneficialOwnerCorporateForm}get accountAliasControl(){return this.clientAccountForm.controls.accountAlias}markAccountAliasControlsAsDirty(){this.accountAliasControl.markAsTouched(),this.accountAliasControl.markAsDirty();}resetForm(){this.clientAccountForm.reset();}resetClientAccountWithBeneficialOwnersForm(){this.clientAccountWithBeneficialOwnersForm.reset();}static{this.\u0275fac=function(t){return new(t||i)(de$1(oR),de$1(E8))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};vM();G$1();vc();var it=class i{constructor(e,t){this.dsObservable=e;this.DS=t;this.dsNames=["accountOrderingClientAccount"];}create(e,t){return this.DS.create("accountOrderingClientAccount",e,{params:{target_url:t}})}confirm(e){return this.restoreCreatedAccount(e).confirm()}restoreCreatedAccount(e){return this.DS.definitions.accountOrderingClientAccount.inject?.(e)}static{this.\u0275fac=function(t){return new(t||i)(de$1(J$1),de$1(os))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};da();j$1();he();N$1();T();$N();Ro$2();na();
1var Cr=i=>[i];function Kr(i,e){if(i&1&&(Ms(0,"ebank-form-field")(1,"ebank-label",11),c_(2,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ORGANISATION_NUMBER_OR_SSN "),rd(),ky(3,"ebank-input-field",28,6),tT(),Ms(5,"ebank-form-error-wrapper")(6,"ebank-form-error",16)(7,"span",11),c_(8,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_NUMBER"),rd()(),Ms(9,"ebank-form-error",14)(10,"span",11),c_(11,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()()),i&2){let t=HC(4);mb(3),nT(),mb(3),Ry("control",t),mb(3),Ry("control",t);}}function Zr(i,e){if(i&1&&(Ms(0,"ebank-form-field")(1,"ebank-label",11),c_(2,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BIRTH_DATE"),rd(),Ms(3,"ebank-sub-label"),c_(4,"dd.mm.yyyy"),rd(),ky(5,"ebank-date-picker",29,7),tT(),Ms(7,"ebank-form-error-wrapper")(8,"ebank-form-error",14)(9,"span",11),c_(10,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),Ms(11,"ebank-form-field")(12,"ebank-label",11),c_(13,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BIRTH_PLACE"),rd(),ky(14,"ebank-input-field",30,8),tT(),Ms(16,"ebank-form-error-wrapper")(17,"ebank-form-error",16)(18,"span",11),c_(19,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_BIRTHPLACE"),rd()(),Ms(20,"ebank-form-error",17)(21,"span",11),c_(22,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_BIRTHPLACE"),rd()(),Ms(23,"ebank-form-error",14)(24,"span",11),c_(25,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),Ms(26,"ebank-form-field")(27,"ebank-label",11),c_(28,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.CITIZENSHIP"),rd(),Ms(29,"ebank-simple-selector",31),N_(30,"translate"),ky(31,"ebank-option-template",13),N_(32,"labelMap"),rd(),tT(),rd(),Ms(33,"ebank-form-field")(34,"ebank-label",11),c_(35,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEX"),rd(),Ms(36,"ebank-simple-selector",32),N_(37,"translate"),ky(38,"ebank-option-template",13),N_(39,"labelMap"),rd(),tT(),rd()),i&2){let t=HC(6),o=HC(15),l=RC(2);mb(5),nT(),mb(3),Ry("control",t),mb(6),nT(),mb(3),Ry("control",o),mb(3),Ry("control",o),mb(3),Ry("control",o),mb(6),Ry("allowEmpty",true)("searchAttributes",T_(22,Cr,l.LabelMap.ValueText))("options",l.clientAccountStore.publicCountries())("titleOnMobile",R_(30,14,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.CITIZENSHIP")),nT(),mb(2),Ry("labelMap",R_(32,16,l.LabelMap.ValueText)),mb(5),Ry("allowEmpty",true)("disableSearch",true)("options",l.genderOptions)("titleOnMobile",R_(37,18,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEX")),nT(),mb(2),Ry("labelMap",R_(39,20,l.LabelMap.Title));}}function Xr(i,e){if(i&1&&(Ms(0,"div",20)(1,"ebank-form-field")(2,"ebank-label",11),c_(3,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.CLIENT_COMPANY_NAME"),rd(),ky(4,"ebank-input-field",22,3),tT(),Ms(6,"ebank-form-error-wrapper")(7,"ebank-form-error",16)(8,"span",11),c_(9,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_CLIENT_NAME"),rd()(),Ms(10,"ebank-form-error",17)(11,"span",11),c_(12,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_CLIENT_NAME"),rd()(),Ms(13,"ebank-form-error",14)(14,"span",11),c_(15,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),mC(16,Kr,12,2,"ebank-form-field"),Ms(17,"ebank-checkbox-field",23),c_(18),N_(19,"translate"),rd(),tT(),mC(20,Zr,40,24),Ms(21,"ebank-form-field")(22,"ebank-label",11),c_(23,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.PHONE_NUMBER"),rd(),ky(24,"ebank-phone-field",24,4),tT(),ky(26,"ebank-phone-field-errors",25),Ms(27,"ebank-form-error-wrapper")(28,"ebank-form-error",14)(29,"span",11),c_(30,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),Ms(31,"ebank-form-field")(32,"ebank-label",11),c_(33,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.EMAIL"),rd(),ky(34,"ebank-input-field",26,5),tT(),Ms(36,"ebank-form-error-wrapper")(37,"ebank-form-error",27)(38,"span",11),c_(39,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_EMAIL"),rd()(),Ms(40,"ebank-form-error",14)(41,"span",11),c_(42,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()()()),i&2){let t=HC(5),o=HC(25),l=HC(35),f=RC();mb(4),nT(),mb(3),Ry("control",t),mb(3),Ry("control",t),mb(3),Ry("control",t),mb(3),gC(f.missingBirthControl.value?-1:16),mb(),nT(),mb(),cd(" ",R_(19,10,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.MISSING_BIRTH")," "),mb(2),gC(f.missingBirthControl.value?20:-1),mb(4),nT(),mb(2),Ry("control",o),mb(2),Ry("control",o),mb(6),nT(),mb(3),Ry("control",l),mb(3),Ry("control",l);}}var dr="^(?!\\s*$)[^!@#$%^&*]+$",eo="account-ordering.client-account.create",_n=class i{constructor(e,t,o,l,f,O,U,xt,Vn,Ft,Mt){this.clientAccountStore=e;this.clientAccountFormService=t;this.clientAccountDataService=o;this.router=l;this.route=f;this.routeDataService=O;this.translateService=U;this.alert=xt;this.phoneNumberService=Vn;this.phoneValidatorService=Ft;this.documentSigningResume=Mt;this.genderOptions=[{title:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FEMALE"),value:"female"},{title:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.MALE"),value:"male"}];this.LabelMap=r;this.clientAccountForm=this.clientAccountFormService.formClientAccountBasic;this.resumeReady=Je(false);this.showLoadingSpinner=jt(()=>this.clientAccountStore.showSpinner()||(this.clientAccountResume?.isActive()??false));this.imprestType=Je(false);this.subscription=new H$1;this.clientAccountResume=this.documentSigningResume.connect({actionId:eo,ready:this.resumeReady,replay:Ce=>S(this,null,function*(){yield this.confirmClientAccount(Ce);})}),Ml(()=>{let Ce=this.clientAccountResume?.state();Ce&&this.hydrateResumeState(Ce);}),Ml(()=>{let Ce=this.clientAccountResume?.error();Ce&&this.handleRuntimeResumeError(Ce);});}get accountAliasControl(){return this.clientAccountForm.controls.accountAlias}get ownerCustomerControl(){return this.clientAccountForm.controls.ownerCustomerNumber}get separateClientAccountControl(){return this.clientAccountForm.controls.separateClientAccount}get missingBirthControl(){return this.clientInfoGroup.get("missingBirth")}get clientInfoGroup(){return this.clientAccountForm.controls.clientInfo}ngOnInit(){this.setSubscriptions(),this.loadInitialData(),this.resetAccountInfoState();}ngOnDestroy(){this.subscription.unsubscribe(),this.clientAccountResume?.destroy();}createAndConfirmClientAccount(){return S(this,null,function*(){if(!this.checkFormValuesAndValidity())return;this.resumeReady.set(false),this.clientAccountStore.showLoadingSpinner(true);let e={ownerCustomerNumber:this.ownerCustomerControl.value?.customerNumber,accountAlias:this.accountAliasControl.value,type:this.imprestType()?"client_imprest_standard":"client_standard"};if(this.separateClientAccountControl.value){e.type=this.imprestType()?"client_imprest_separate":"client_separate";let t=this.clientInfoGroup.get("phoneNumber").value;e.clientInfo={clientName:this.clientInfoGroup.get("clientName").value.trim(),cin:this.clientInfoGroup.get("organizationNumber").value,phoneNumber:this.phoneNumberService.parse(t).parsedPhoneNumber.number,email:this.clientInfoGroup.get("email").value};}this.missingBirthControl.value&&(delete e.clientInfo.cin,e.clientInfo.dateOfBirth=Qe(this.clientInfoGroup.get("dateOfBirth").value).format("YYYY-MM-DD"),e.clientInfo.placeOfBirth=this.clientInfoGroup.get("placeOfBirth").value.trim(),e.clientInfo.countryCode=this.clientInfoGroup.get("citizenship").value?.value,e.clientInfo.gender=this.clientInfoGroup.get("gender").value?.value);try{yield this.clientAccountResume?.run(l=>S(this,[l],function*({openSigning:t,redirectUrl:o}){let f=yield this.clientAccountDataService.create(e,o),O=f.links.signingUrl?.href;if(!O)throw new Error("Missing signing URL for client account create response");yield t({signUrl:O,state:this.buildResumeState(f)});}));}catch(t){this.clientAccountStore.showLoadingSpinner(false),this.clientAccountResume?.error()!==t&&!Kc(t)&&(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during account creation",t));}finally{this.resumeReady.set(false);}})}confirmClientAccount(e){return S(this,null,function*(){try{let t=yield this.clientAccountDataService.confirm(e.createdAccount);this.clientAccountStore.storeAccountInfo({accountId:t.id||e.createdAccount.id||"",accountAlias:t.accountAlias,accountNumber:t.accountNumber||""}),yield this.router.navigate(["page","account-ordering","client-account-created-summary"]);}finally{this.clientAccountStore.showLoadingSpinner(false);}})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for client account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.clientAccountResume?.shouldReplay()??false;this.clientAccountDataService.restoreCreatedAccount(e.createdAccount),this.accountAliasControl.setValue(e.createdAccount.accountAlias),this.ownerCustomerControl.setValue(e.createdAccount.ownerCustomerNumber),this.separateClientAccountControl.setValue(e.createdAccount.separateClientAccount),this.clientInfoGroup.setValue(e.createdAccount.clientInfo),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.clientAccountStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during client account signing resume",e)),this.clientAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e;return JSON.parse(JSON.stringify(t))}loadInitialData(){this.clientAccountStore.agreementCustomers().length||this.clientAccountStore.loadAgreementCustomers(),this.clientAccountStore.publicCountries().length||this.clientAccountStore.loadPublicCountries();}setSubscriptions(){this.subscription.add(this.route.queryParams.subscribe(e=>{this.imprestType.set(e.imprestType==="true"),this.imprestType()&&this.routeDataService.addData({title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_IMPREST.TITLE"});})),this.subscription.add(this.accountAliasControl.valueChanges.subscribe(e=>{this.checkAndKeepClientAccountDefaultValue(e);})),this.subscription.add(this.separateClientAccountControl.valueChanges.subscribe(e=>{e?(this.clientInfoGroup.get("clientName").setValidators([lo$1.required,lo$1.pattern(dr),lo$1.maxLength(100)]),this.clientInfoGroup.get("organizationNumber").setValidators([lo$1.required,lo$1.pattern(/^\d{9}$|^\d{11}$/)]),this.clientInfoGroup.get("phoneNumber").setValidators([lo$1.required,this.phoneValidatorService.ph
1oneFieldValidator()]),this.clientInfoGroup.get("email").setValidators([lo$1.required,d()])):(this.clearAndResetClientInfoField("clientName"),this.clearAndResetClientInfoField("organizationNumber"),this.clearAndResetClientInfoField("phoneNumber"),this.clearAndResetClientInfoField("email"));})),this.subscription.add(this.missingBirthControl.valueChanges.subscribe(e=>{e?(this.clearAndResetClientInfoField("organizationNumber"),this.clientInfoGroup.get("dateOfBirth").setValidators([lo$1.required]),this.clientInfoGroup.get("placeOfBirth").setValidators([lo$1.required,lo$1.pattern(dr),lo$1.maxLength(50)]),this.clientInfoGroup.get("citizenship").setValidators([lo$1.required]),this.clientInfoGroup.get("gender").setValidators([lo$1.required])):(this.clearAndResetClientInfoField("placeOfBirth"),this.clearAndResetClientInfoField("dateOfBirth"),this.clearAndResetClientInfoField("citizenship"),this.clearAndResetClientInfoField("gender"));}));}checkAndKeepClientAccountDefaultValue(e){e.substring(0,tt.length)!==tt&&this.accountAliasControl.setValue(tt);}resetAccountInfoState(){this.clientAccountFormService.resetForm();}checkFormValuesAndValidity(){return this.accountAliasControl.markAsTouched(),this.accountAliasControl.markAsDirty(),this.separateClientAccountControl.value&&(this.setDirtyAndTouchedStateForClientGroup("clientName"),this.setDirtyAndTouchedStateForClientGroup("organizationNumber"),this.setDirtyAndTouchedStateForClientGroup("phoneNumber"),this.setDirtyAndTouchedStateForClientGroup("email")),this.missingBirthControl.value&&(this.setDirtyAndTouchedStateForClientGroup("dateOfBirth"),this.setDirtyAndTouchedStateForClientGroup("placeOfBirth"),this.setDirtyAndTouchedStateForClientGroup("citizenship"),this.setDirtyAndTouchedStateForClientGroup("gender")),!this.clientAccountForm.invalid}setDirtyAndTouchedStateForClientGroup(e){this.clientInfoGroup.get(e).markAsTouched(),this.clientInfoGroup.get(e).markAsDirty();}clearAndResetClientInfoField(e){this.clientInfoGroup.get(e).setValue(""),this.clientInfoGroup.get(e).setErrors(null),this.clientInfoGroup.get(e).clearValidators();}static{this.\u0275fac=function(t){return new(t||i)(Do$1(K),Do$1(nt),Do$1(it),Do$1(V$1),Do$1(K$1),Do$1(S$1),Do$1(V$2),Do$1(E$2),Do$1(C),Do$1(E8),Do$1(Er$1))};}
1static{this.\u0275cmp=qT({type:i,selectors:[["client-account-create"]],standalone:false,decls:39,vars:28,consts:[["ownerCustomerNumberRef","ebankControl"],["accountAliasRef","ebankControl"],["textInfo",""],["clientNameRef","ebankControl"],["phoneFieldRef","ebankControl"],["emailField","ebankControl"],["organizationNumberRef","ebankControl"],["dateOfBirthControl","ebankControl"],["placeOfBirthRef","ebankControl"],[3,"loading"],[3,"formGroup"],["translate",""],["id","savingAccountAgreementCustomers","formControlName","ownerCustomerNumber",3,"isLoading","options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["validation","required",3,"control"],["formControlName","accountAlias"],["validation","pattern",3,"control"],["validation","maxlength",3,"control"],["formControlName","separateClientAccount"],[3,"content"],["formGroupName","clientInfo"],[3,"buttonClick","disabled"],["formControlName","clientName"],["formControlName","missingBirth"],["formControlName","phoneNumber"],[3,"control"],["formControlName","email"],["validation","email",3,"control"],["formControlName","organizationNumber"],["formControlName","dateOfBirth"],["formControlName","placeOfBirth"],["id","citizenship","formControlName","citizenship",3,"allowEmpty","searchAttributes","options","titleOnMobile"],["id","gender","formControlName","gender",3,"allowEmpty","disableSearch","options","titleOnMobile"]],template:function(t,o){if(t&1&&(Ms(0,"section")(1,"ebank-spinner",9)(2,"form",10)(3,"ebank-form-field")(4,"ebank-label",11),c_(5,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SELECT_COMPANY"),rd(),Ms(6,"ebank-simple-selector",12,0),N_(8,"translate"),ky(9,"ebank-option-template",13),N_(10,"labelMap"),rd(),tT(),Ms(11,"ebank-form-error-wrapper")(12,"ebank-form-error",14)(13,"span",11),c_(14,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),Ms(15,"ebank-form-field")(16,"ebank-label",11),c_(17,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),ky(18,"ebank-input-field",15,1),tT(),Ms(20,"ebank-form-error-wrapper")(21,"ebank-form-error",16)(22,"span",11),c_(23,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(24,"ebank-form-error",17)(25,"span",11),c_(26,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()()()(),Ms(27,"ebank-checkbox-field",18),c_(28),N_(29,"translate"),rd(),tT(),ky(30,"ebank-help-button",19),Ms(31,"ebank-help-button-content",null,2),c_(33),N_(34,"translate"),rd(),mC(35,Xr,43,12,"div",20),rd(),Ms(36,"ebank-button",21),qy("buttonClick",function(){return o.createAndConfirmClientAccount()}),c_(37),N_(38,"translate"),rd()()()),t&2){let l=HC(7),f=HC(19),O=HC(32);mb(),Ry("loading",o.showLoadingSpinner()),mb(),Ry("formGroup",o.clientAccountForm),mb(4),Ry("isLoading",o.showLoadingSpinner())("options",o.clientAccountStore.agreementCustomers())("searchAttributes",T_(26,Cr,o.LabelMap.Name))("titleOnMobile",R_(8,16,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SELECT_COMPANY")),nT(),mb(3),Ry("labelMap",R_(10,18,o.LabelMap.Name)),mb(3),Ry("control",l),mb(6),nT(),mb(3),Ry("control",f),mb(3),Ry("control",f),mb(3),nT(),mb(),cd(" ",R_(29,20,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT")," "),mb(2),Ry("content",O),mb(3),cd(" ",R_(34,22,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT_HELP")," "),mb(2),gC(o.separateClientAccountControl.value?35:-1),mb(),Ry("disabled",o.showLoadingSpinner()),mb(),cd(" ",R_(38,24,"PAGE.ACCOUNT_ORDERING_SHARED.CREATE")," ");}},dependencies:[eR,co$1,Ch,j,u,Te,vI,X3,uo,Nl,Cr$1,fu,Pa,gu,on,sI,f8,No$1,t8,_e,Ys,Bn$1,yI$1,i8,QI,y8,k8,ye,Be],encapsulation:2,changeDetection:1});}};vM();he();$N();var In=class i{constructor(){}static{this.\u0275fac=function(t){return new(t||i)};}
1static{this.\u0275cmp=qT({type:i,selectors:[["account-ordering-page-error"]],standalone:false,decls:3,vars:0,consts:[["level","error"],["translate",""]],template:function(t,o){t&1&&(Ms(0,"ebank-page-alert",0)(1,"ebank-page-alert-header",1),c_(2,"PAGE.ACCOUNT_ORDERING_SHARED.ERROR_AUTH"),rd()());},dependencies:[Te,f6,m6],encapsulation:2,changeDetection:1});}};pi();vM();da();W();N$1();he();var de=class i{constructor(e,t,o,l,f){this.router=e;this.accessRightsService=t;this.log=o;this.alert=l;this.translateService=f;}canActivate(e,t){return this.hasAccessRights().pipe(we$1(o=>o?true:(this.navigateToFullPageError(),false)))}navigateToFullPageError(){this.router.navigate(["/page/account-ordering/page-error"]);}hasAccessRights(){return CI([this.accessRightsService.checkIfUserHasAccessRights(),this.accessRightsService.checkCpsAccountAccessRights()]).pipe(we$1(([e,t])=>!!e&&Array.isArray(t)&&t.length>0),Sa(e=>this.handleError(e,"Something went wrong while getting access rights","PAGE.ACCOUNT_ORDERING_SHARED.ERROR_AUTH")))}handleError(e,t,o){return this.log.error(t,e),this.alert.error(this.translateService.instant(o)),mI(()=>e)}static{this.\u0275fac=function(t){return new(t||i)(de$1(V$1),de$1(Xe),de$1(E$1),de$1(E$2),de$1(V$2))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"any"});}};vM();X$1();da();vM();he();$N();var kn=class i{constructor(){this.spendingAccountStore=D(et);this.dataUsers=D(c);this.urlService=D(A);this.router=D(V$1);}ngOnInit(){this.loadAgreementAccounts(),this.getCurrentUserId();}copy(){let e=this.findAgreementAccount();this.router.navigate(["page/corporate-admin/copy-account-rights/step2"],{queryParams:{selectedAccountId:e.id}});}redirectToAccountRights(){let e=this.spendingAccountStore.accountInfo().accountNumber;this.router.navigate(["page/account-rights"],{queryParams:{account:e,hideUnassigned:true}});}loadAgreementAccounts(){this.spendingAccountStore.loadAgreementAccounts();}findAgreementAccount(){return this.spendingAccountStore.agreementAccounts().find(e=>e.accountNumber===this.spendingAccountStore.accountInfo().accountNumber)}getCurrentUserId(){this.dataUsers.get().subscribe(e=>{this.setUserAdministrationLink(e.userId);});}setUserAdministrationLink(e){this.userAdministrationLink=this.urlService.getUrl("URL.PAGE.ACCOUNT_RIGHTS_AND_PERMISSIONS",{userId:e});}static{this.\u0275fac=function(t){return new(t||i)};}
1static{this.\u0275cmp=qT({type:i,selectors:[["spending-account-created-summary"]],standalone:false,decls:18,vars:12,consts:[[1,"summary-page"],[3,"titleText","hideTitle"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],[1,"ebank-button-container"],[3,"buttonClick","disabled"]],template:function(t,o){t&1&&(Ms(0,"section",0)(1,"ebank-description-list-section",1),N_(2,"translate"),Ms(3,"div",2)(4,"dt",3),c_(5,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),Ms(6,"dd",4),c_(7),rd()(),Ms(8,"div",2)(9,"dt",3),c_(10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NUMBER"),rd(),Ms(11,"dd",4),c_(12),N_(13,"accountNumberFormat"),rd()()(),Ms(14,"div",5)(15,"ebank-button",6),qy("buttonClick",function(){return o.redirectToAccountRights()}),c_(16),N_(17,"translate"),rd()()()),t&2&&(mb(),Ry("titleText",R_(2,6,"PAGE.ACCOUNT_ORDERING.LIST_TITLE"))("hideTitle",true),mb(6),cv(o.spendingAccountStore.accountInfo().accountAlias),mb(5),cv(R_(13,8,o.spendingAccountStore.accountInfo().accountNumber)),mb(3),Ry("disabled",o.spendingAccountStore.showSpinner()),mb(),cd(" ",R_(17,10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_RIGHTS.BUTTON")," "));},dependencies:[Te,_e,U8,Ws,W8,G8,ye,p],encapsulation:2,changeDetection:1});}};vM();vM();X$1();da();he();$N();var wn=class i{constructor(e,t,o){this.clientAccountStore=e;this.urlService=t;this.router=o;this.dataUsers=D(c);}ngOnInit(){this.loadAgreementAccounts(),this.getCurrentUserId();}copy(){let e=this.findAgreementAccount();this.router.navigate(["page/corporate-admin/copy-account-rights/step2"],{queryParams:{selectedAccountId:e.id}});}redirectToAccountRights(){let e=this.clientAccountStore.accountInfo().accountNumber;this.router.navigate(["page/account-rights"],{queryParams:{account:e,hideUnassigned:true}});}loadAgreementAccounts(){this.clientAccountStore.loadAgreementAccounts();}findAgreementAccount(){return this.clientAccountStore.agreementAccounts().find(e=>e.accountNumber===this.clientAccountStore.accountInfo().accountNumber)}getCurrentUserId(){this.dataUsers.get().subscribe(e=>{this.setUserAdministrationLink(e.userId);});}setUserAdministrationLink(e){this.userAdministrationLink=this.urlService.getUrl("URL.PAGE.ACCOUNT_RIGHTS_AND_PERMISSIONS",{userId:e});}static{this.\u0275fac=function(t){return new(t||i)(Do$1(K),Do$1(A),Do$1(V$1))};}
1static{this.\u0275cmp=qT({type:i,selectors:[["client-account-created-summary"]],standalone:false,decls:18,vars:12,consts:[[1,"summary-page"],[3,"titleText","hideTitle"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],[1,"ebank-button-container"],[3,"buttonClick","disabled"]],template:function(t,o){t&1&&(Ms(0,"section",0)(1,"ebank-description-list-section",1),N_(2,"translate"),Ms(3,"div",2)(4,"dt",3),c_(5,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),Ms(6,"dd",4),c_(7),rd()(),Ms(8,"div",2)(9,"dt",3),c_(10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NUMBER"),rd(),Ms(11,"dd",4),c_(12),N_(13,"accountNumberFormat"),rd()()(),Ms(14,"div",5)(15,"ebank-button",6),qy("buttonClick",function(){return o.redirectToAccountRights()}),c_(16),N_(17,"translate"),rd()()()),t&2&&(mb(),Ry("titleText",R_(2,6,"PAGE.ACCOUNT_ORDERING.LIST_TITLE"))("hideTitle",true),mb(6),cv(o.clientAccountStore.accountInfo().accountAlias),mb(5),cv(R_(13,8,o.clientAccountStore.accountInfo().accountNumber)),mb(3),Ry("disabled",o.clientAccountStore.showSpinner()),mb(),cd(" ",R_(17,10,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_RIGHTS.BUTTON")," "));},dependencies:[Te,_e,U8,Ws,W8,G8,ye,p],encapsulation:2,changeDetection:1});}};vM();na();da();$N();he();var fr=N(ep());Be$1();j$1();vM();G$1();vc();var Pn=class i{constructor(e,t){this.dsObservable=e;this.DS=t;this.dsNames=["accountOrderingDepositAccount"];}create(e,t,o){return this.DS.create("accountOrderingDepositAccount",{order:e,file:t},{headers:{Location:o},params:{target_url:o},transformRequest:l=>{let f=new FormData;return l.file&&f.append("rental_agreement",t,t.name),f.append("order",new Blob([JSON.stringify(e)],{type:"application/json"}),"order.json"),f}})}confirm(e){return this.restoreCreatedAccount(e).confirm()}restoreCreatedAccount(e){return this.DS.definitions.accountOrderingDepositAccount.inject?.(e)}static{this.\u0275fac=function(t){return new(t||i)(de$1(J$1),de$1(os))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};T();pi();F$1();vM();var to={accountInfo:{accountNumber:"",accountId:""},agreementCustomers:[],showSpinner:false},kt=class i extends V({protectedState:false},Q$1(to)){constructor(t,o){super();this.agreementCustomersService=t;this.rdsaCreateService=o;this.loadAgreementCustomers=L(Xv(B(),Sf(()=>H(this,{showSpinner:true})),_f(()=>this.agreementCustomersService.get().pipe(G({next:t=>{H(this,{agreementCustomers:this.rdsaCreateService.filterCompanies(t),showSpinner:false});},error:t=>{this.rdsaCreateService.handleError(t,"agreement customers"),H(this,{showSpinner:false});}})))));}storeAccountInfo(t){H(this,{accountInfo:t});}showLoadingSpinner(t){H(this,{showSpinner:t});}static{this.\u0275fac=function(o){return new(o||i)(de$1(J),de$1(V$3))};}static{this.\u0275prov=X({token:i,factory:i.\u0275fac,providedIn:"root"});}};vM();var Ln=class i{transform(e){return {label:e}}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275pipe=QT({name:"labelMap",type:i,pure:true});}};Ro$2();mi();N$1();vM();he();$N();na();var no=i=>[i],io=()=>["pdf","application/pdf"];function ro(i,e){i&1&&(Ms(0,"ebank-empty-state")(1,"ebank-empty-state-description"),c_(2),N_(3,"translate"),rd()()),i&2&&(mb(2),cd(" ",R_(3,1,"PAGE.RDSA.NO_COMPANIES_FOUND")," "));}function oo(i,e){if(i&1){let t=CC();Ms(0,"form",14)(1,"ebank-form-field")(2,"ebank-label",15),c_(3,"PAGE.RDSA.NEW.COMPANY_ACCOUNT"),rd(),Ms(4,"ebank-simple-selector",16,0),N_(6,"translate"),ky(7,"ebank-option-template",17),N_(8,"labelMap"),rd(),tT(),Ms(9,"ebank-form-error-wrapper")(10,"ebank-form-error",18)(11,"span",15),c_(12,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()()()(),Ms(13,"h2",19),c_(14,"PAGE.RDSA.ABOUT_TENANT"),rd(),Ms(15,"ebank-form-field")(16,"ebank-label"),c_(17),N_(18,"translate"),rd(),ky(19,"ebank-input-field",20,1),tT(),Ms(21,"ebank-form-error-wrapper")(22,"ebank-form-error",18)(23,"span",15),c_(24,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(25,"ebank-form-error",21)(26,"span",15),c_(27,"PAGE.RDSA.NAME.PATTERN"),rd()(),Ms(28,"ebank-form-error",22)(29,"span",15),c_(30,"PAGE.RDSA.NAME.PATTERN"),rd()()()(),Ms(31,"ebank-form-field")(32,"ebank-label"),c_(33),N_(34,"translate"),rd(),ky(35,"ebank-input-field",23,2),tT(),Ms(37,"ebank-form-error-wrapper")(38,"ebank-form-error",18)(39,"span",15),c_(40,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(41,"ebank-form-error",21)(42,"span",15),c_(43,"PAGE.RDSA.NAME.PATTERN"),rd()(),Ms(44,"ebank-form-error",22)(45,"span",15),c_(46,"PAGE.RDSA.NAME.PATTERN"),rd()()()(),Ms(47,"ebank-form-field")(48,"ebank-label"),c_(49),N_(50,"translate"),rd(),ky(51,"ebank-input-field",24,3),tT(),Ms(53,"ebank-form-error-wrapper")(54,"ebank-form-error",18)(55,"span",15),c_(56,"PAGE.RDSA.SSN.REQUIRED"),rd()(),Ms(57,"ebank-form-error",25)(58,"span",15),c_(59,"PAGE.RDSA.SSN.MINLENGTH"),rd()(),Ms(60,"ebank-form-error",22)(61,"span",15),c_(62,"PAGE.RDSA.SSN.MAXLENGTH"),rd()(),Ms(63,"ebank-form-error",26)(64,"span",15),c_(65,"PAGE.RDSA.SSN.PID"),rd()()()(),Ms(66,"ebank-form-field")(67,"ebank-label"),c_(68),N_(69,"translate"),rd(),ky(70,"ebank-phone-field",27,4),tT(),Ms(72,"ebank-form-error-wrapper")(73,"ebank-form-error",18)(74,"span",15),c_(75,"MODULE.VALIDATION.MOBILE.REQUIRED"),rd()(),Ms(76,"ebank-form-error",28)(77,"span",15),c_(78,"PAGE.RDSA.VALIDATION.PHONE_FIELD.MIN_LENGTH"),rd()(),Ms(79,"ebank-form-error",29)(80,"span",15),c_(81,"PAGE.RDSA.VALIDATION.PHONE_FIELD.MAX_LENGTH"),rd()(),Ms(82,"ebank-form-error",30)(83,"span",15),c_(84,"PAGE.RDSA.VALIDATION.PHONE_FIELD.INVALID_
1NUMBER"),rd()()()(),Ms(85,"ebank-form-field")(86,"ebank-label"),c_(87),N_(88,"translate"),rd(),ky(89,"ebank-input-field",31,5),tT(),Ms(91,"ebank-form-error-wrapper")(92,"ebank-form-error",18)(93,"span",15),c_(94,"MODULE.VALIDATION.EMAILFIELD.REQUIRED"),rd()(),Ms(95,"ebank-form-error",32)(96,"span",15),c_(97,"MODULE.VALIDATION.EMAILFIELD.EMAIL"),rd()()()(),Ms(98,"h2",19),c_(99,"PAGE.RDSA.ABOUT_PROPERTY"),rd(),Ms(100,"ebank-form-field")(101,"ebank-label"),c_(102),N_(103,"translate"),rd(),ky(104,"ebank-input-field",33,6),tT(),Ms(106,"ebank-form-error-wrapper")(107,"ebank-form-error",18)(108,"span",15),c_(109,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(110,"ebank-form-error",21)(111,"span",15),c_(112,"PAGE.RDSA.ADDRESS.PATTERN"),rd()(),Ms(113,"ebank-form-error",22)(114,"span",15),c_(115,"PAGE.RDSA.ADDRESS.PATTERN"),rd()()()(),Ms(116,"ebank-form-field")(117,"ebank-label"),c_(118),N_(119,"translate"),rd(),ky(120,"ebank-input-field",34,7),tT(),Ms(122,"ebank-form-error-wrapper")(123,"ebank-form-error",21)(124,"span",15),c_(125,"PAGE.RDSA.APARTMENT_NUMBER.PATTERN"),rd()(),Ms(126,"ebank-form-error",22)(127,"span",15),c_(128,"PAGE.RDSA.APARTMENT_NUMBER.PATTERN"),rd()()()(),Ms(129,"ebank-form-field")(130,"ebank-label"),c_(131),N_(132,"translate"),rd(),ky(133,"ebank-input-field",35,8),tT(),Ms(135,"ebank-form-error-wrapper")(136,"ebank-form-error",18)(137,"span",15),c_(138,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(139,"ebank-form-error",21)(140,"span",15),c_(141,"PAGE.RDSA.ZIP_CODE.PATTERN"),rd()(),Ms(142,"ebank-form-error",22)(143,"span",15),c_(144,"PAGE.RDSA.ZIP_CODE.PATTERN"),rd()()()(),Ms(145,"ebank-form-field")(146,"ebank-label"),c_(147),N_(148,"translate"),rd(),ky(149,"ebank-input-field",36,9),tT(),Ms(151,"ebank-form-error-wrapper")(152,"ebank-form-error",18)(153,"span",15),c_(154,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(155,"ebank-form-error",21)(156,"span",15),c_(157,"PAGE.RDSA.POST_OFFICE.PATTERN"),rd()(),Ms(158,"ebank-form-error",22)(159,"span",15),c_(160,"PAGE.RDSA.POST_OFFICE.PATTERN"),rd()()()(),Ms(161,"ebank-form-field")(162,"ebank-label",15),c_(163,"PAGE.RDSA.NEW.UPLOAD"),rd(),ky(164,"ebank-upload-file",37,10),tT(),ky(166,"ebank-upload-file-errors",38),Ms(167,"ebank-form-error-wrapper")(168,"ebank-form-error",18)(169,"span",15),c_(170,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()()()(),Ms(171,"ebank-form-field")(172,"ebank-label",15),c_(173,"PAGE.RDSA.NEW.DATE"),rd(),Ms(174,"ebank-sub-label",15),c_(175,"PAGE.RDSA.NEW.DATE.SUBLABEL"),rd(),ky(176,"ebank-date-picker",39,11),N_(178,"translate"),tT(),Ms(179,"ebank-form-error-wrapper")(180,"ebank-form-error",18)(181,"span",15),c_(182,"PAGE.RDSA.VALIDATION.REQUIRED"),rd()(),Ms(183,"ebank-form-error",40)(184,"span",15),c_(185,"PAGE.RDSA.NEW.DATE.INVALID_DATE"),rd()()()(),Ms(186,"h2",19),c_(187,"PAGE.RDSA.DEPOSIT_AMOUNT"),rd(),Ms(188,"ebank-form-field")(189,"ebank-label",15),c_(190,"PAGE.RDSA.NEW.AMOUNT"),rd(),ky(191,"ebank-amount-field",41,12),tT(),Ms(193,"ebank-form-error-wrapper")(194,"ebank-form-error",18)(195,"span",15),c_(196,"PAGE.RDSA.AMOUNT.REQUIRED"),rd()(),Ms(197,"ebank-form-error",42)(198,"span",15),c_(199,"PAGE.RDSA.AMOUNT.ERROR"),rd()(),Ms(200,"ebank-form-error",21)(201,"span",15),c_(202,"PAGE.RDSA.AMOUNT.ERROR"),rd()(),Ms(203,"ebank-form-error",43)(204,"span",15),c_(205,"PAGE.RDSA.AMOUNT.ERROR"),rd()(),Ms(206,"ebank-form-error",22)(207,"span",15),c_(208,"PAGE.RDSA.AMOUNT.INVALID_RANGE"),rd()()()(),Ms(209,"ebank-checkbox-field",44),c_(210),N_(211,"translate"),rd(),tT(),Ms(212,"ebank-action-row")(213,"ebank-button",45),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.cancel())}),Ms(214,"span",15),c_(215,"PAGE.RDSA.NEW.BUTTON.CANCEL"),rd()(),Ms(216,"ebank-button",46),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.order())}),Ms(217,"span",15),c_(218,"PAGE.RDSA.NEW.BUTTON.ORDER"),rd()()()();}if(i&2){let t=HC(5),o=HC(20),l=HC(36),f=HC(52),O=HC(71),U=HC(90),xt=HC(105),Vn=HC(121),Ft=HC(134),Mt=HC(150),Ce=HC(165),Xn=HC(177),Pt=HC(192),rt=RC();Ry("formGroup",rt.newAccountForm),mb(4),Ry("options",rt.rdsaCreateStore.agreementCustomers())("searchAttributes",T_(85,no,rt.LabelMap.Name))("titleOnMobile",R_(6,59,"PAGE.RDSA.NEW.COMPANY_ACCOUNT")),nT(),mb(3),Ry("labelMap",R_(8,61,rt.LabelMap.Name)),mb(3),Ry("control",t),mb(7),cv(R_(18,63,"PAGE.RDSA.NEW.FIRST_NAME")),mb(2),nT(),mb(3),Ry("control",o),mb(3),Ry("control",o),mb(3),Ry("control",o),mb(5),cv(R_(34,65,"PAGE.RDSA.NEW.SURNAME")),mb(2),nT(),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(3),Ry("control",l),mb(5),cv(R_(50,67,"PAGE.RDSA.NEW.SSN")),mb(2),nT(),mb(3),Ry("control",f),mb(3),Ry("control",f),mb(3),Ry("control",f),mb(3),Ry("control",f),mb(5),cv(R_(69,69,"PAGE.RDSA.PHONE")),mb(2),nT(),mb(3),Ry("control",O),mb(3),Ry("control",O),mb(3),Ry("control",O),mb(3),Ry("control",O),mb(5),cv(R_(88,71,"PAGE.RDSA.EMAIL")),mb(2),nT(),mb(3),Ry("control",U),mb(3),Ry("control",U),mb(7),cv(R_(103,73,"PAGE.RDSA.NEW.ADDRESS")),mb(2),nT(),mb(3),Ry("control",xt),mb(3),Ry("control",xt),mb(3),Ry("control",xt),mb(5),cv(R_(119,75,"PAGE.RDSA.APARTMENT_NUMBER")),mb(2),nT(),mb(3),Ry("control",Vn),mb(3),Ry("control",Vn),mb(5),cv(R_(132,77,"PAGE.RDSA.NEW.ZIP_CODE")),mb(2),nT(),mb(3),Ry("control",Ft),mb(3),Ry("control",Ft),mb(3),Ry("control",Ft),mb(5),cv(R_(148,79,"PAGE.RDSA.NEW.POST_OFFICE")),mb(2),nT(),mb(3),Ry("control",Mt),mb(3),Ry("control",Mt),mb(3),Ry("control",Mt),mb(6),Ry("fileTypes",b_(87,io))("maxFileSize",rt.MAX_UPLOAD_FILE_SIZE)("multiple",false),nT(),mb(2),Ry("control",Ce),mb(2),Ry("control",Ce),mb(8),Ry("max",rt.maxDate)("titleOnMobile",R_(178,81,"PAGE.RDSA.NEW.DATE")),nT(),mb(4),Ry("control",Xn),mb(3),Ry("control",Xn),mb(8),Ry("maxlength",19),nT(),mb(3),Ry("control",Pt),mb(3),Ry("control",Pt),mb(3),Ry("control",Pt),mb(3),Ry("control",Pt),mb(3),Ry("control",Pt),mb(3),nT(),mb(),cv(R_(211,83,"PAGE.RDSA.NEW.CHECKBOX.CONFIRM")),mb(6),Ry("disabled",rt.rdsaCreateStore.showSpinner());}}var ao="account-ordering.rds-account.create",Un=class i$1{constructor(){this.formBuilder=D(oR);this.fileValidator=D(h8);this.alert=D(E$2);this.router=D(V$1);this.routeDataService=D(S$1);this.translateService=D(V$2);this.dialog=D(Y9);this.pidValidator=D(l);this.phoneValidator=D(E8);this.rdsaCreateService=D(V$3);this.dataService=D(Pn);this.phoneNumberService=D(C);this.rdsaStore=D(Z);this.documentSigningResume=D(Er$1);this.MAX_UPLOAD_FILE_SIZE=10485760;this.chars="\xE6\xF8\xE5\xC6\xD8\xC5\xC1\xE1\xC0\xE0\xC4\xE4\xC3\xE3\xC7\xE7\xC9\xE9\xC8\xE8\xCA\xEA\xCB\xEB\xD1\xF1\xD4\xF4\xD2\xF2\xD3\xF3\xD5\xF5\xD6\xF6\xDC\xFC\xDB\xFB\xD9\xF9\xDA\xFA";this.LabelMap=r;this.rdsaCreateStore=D(kt);this.newAccountForm=this.formBuilder.group({companyAccount:[null,[lo$1.required]],firstName:["",[lo$1.required,lo$1.maxLength(30),lo$1.pattern(new RegExp(`^[a-zA-Z${this.chars} -]+$`))]],surname:["",[lo$1.required,lo$1.maxLength(30),lo$1.pattern(new RegExp(`^[a-zA-Z${this.chars} -]+$`))]],ssn:["",[lo$1.required,lo$1.minLength(11),lo$1.maxLength(11),this.pidValidator.validatePid]],phone:[null,[lo$1.required,this.phoneValidator.phoneFieldValidator()]],email:["",[lo$1.required,d()]],address:["",[lo$1.required,lo$1.maxLength(100),lo$1.pattern(new RegExp(`^[a-zA-Z0-9${this.chars} .,/-]+$`))]],apartmentNumber:[void 0,[lo$1.maxLength(10),lo$1.pattern(new RegExp(`^[a-zA-Z0-9${this.chars} .,/-]+$`))]],zipCode:["",[lo$1.required,lo$1.maxLength(4),lo$1.pattern(/^[0-9]+$/)]],postOffice:["",[lo$1.required,lo$1.maxLength(50),lo$1.pattern(new RegExp(`^[a-zA-Z0-9${this.chars} .,/-]+$`))]],uploadFile:[null,[this.fileValidator.uploadFileValidator(["pdf"],this.MAX_UPLOAD_FILE_SIZE,this.MAX_UPLOAD_FILE_SIZE,1)]],date:[new Date,[lo$1.required]],amount:["",[lo$1.required,lo$1.pattern(/^[0-9.,\s]+$/),s(),V$4(.01)]],confirmed:[false,[lo$1.requiredTrue]]});this.resumeReady=Je(false);this.showLoadingSpinner=jt(()=>this.rdsaCreateStore.showSpinner()||(this.spendingAccountResume?.isActive()??false));this.maxDate=new Date;this.spendingAccountResume=this.documentSigningResume.connect({actionId:ao,ready:this.resumeReady,replay:e=>S(this,null,function*(){yield this.confirmRDSAccount(e);})}),Ml(()=>{let e=this.spendingAccountResume?.state();e&&this.hydrateResumeState(e);}),Ml(()=>{let e=this.spendingAccountResume?.error();e&&this.handleRuntimeResumeError(e);});}
1ngOnInit(){this.pointBreadcrumbToPreviousUrl(),this.manageDateControlErrors(),this.loadCompanyAccounts();}ngOnDestroy(){this.spendingAccountResume?.destroy();}pointBreadcrumbToPreviousUrl(){this.routeDataService.getPreviousUrl().includes("account-ordering")&&this.routeDataService.addData({breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering"});}loadCompanyAccounts(){this.rdsaCreateStore.agreementCustomers().length||this.rdsaCreateStore.loadAgreementCustomers();}manageDateControlErrors(){this.newAccountForm.controls.date.valueChanges.subscribe(e=>{e?e&&!(0, fr.isDate)(e)?this.newAccountForm.controls.date.setErrors({invalidDate:true}):e.getTime()>this.maxDate.getTime()?this.newAccountForm.controls.date.setErrors({invalidDate:true}):this.newAccountForm.controls.date.setErrors(null):this.newAccountForm.controls.date.setErrors({required:true});});}cancel(){this.dialog.open({title:this.translateService.instant("PAGE.RDSA.NEW.CONFIRMATION_MODAL.TITLE"),content:this.translateService.instant("PAGE.RDSA.NEW.CONFIRMATION_MODAL.DESC"),cancel:{label:this.translateService.instant("PAGE.RDSA.NEW.CONFIRMATION_MODAL.CANCEL")},confirm:{label:this.translateService.instant("PAGE.RDSA.NEW.CONFIRMATION_MODAL.ACTION"),style:"primary-danger",onClick:()=>{this.router.navigate(["page","rental-deposit-security-accounts"]);}}});}order(){return S(this,null,function*(){if(!this.checkFormValuesAndValidity())return;let e=this.newAccountForm.value,t={ownerCustomerNumber:e.companyAccount.customerNumber,depositAmount:parseFloat(e.amount.toString()),currencyCode:"NOK",tenantInfo:{firstName:e.firstName.trim(),lastName:e.surname.trim(),cin:e.ssn,phoneNumber:this.phoneNumberService.parse({number:e.phone.number.toString(),countryCode:e.phone.countryCode?.toString()}).parsedPhoneNumber.number,email:e.email},rentalInfo:{address:{streetAddress:e.address.trim(),postalCode:e.zipCode.trim(),postalAddress:e.postOffice.trim(),section:e.apartmentNumber?.trim(),countryCode:"NO"},rentalAgreementDate:Qe(e.date).format("YYYY-MM-DD")}};this.resumeReady.set(false),this.rdsaCreateStore.showLoadingSpinner(true);try{yield this.spendingAccountResume?.run(f=>S(this,[f],function*({openSigning:o,redirectUrl:l}){let O=yield this.dataService.create(t,e.uploadFile[0],l),U=O.links.signingUrl?.href;if(!U)throw new Error("Missing signing URL for spending account create response");yield o({signUrl:U,state:this.buildResumeState(O)});}));}catch(o){this.rdsaCreateStore.showLoadingSpinner(false),this.spendingAccountResume?.error()!==o&&!Kc(o)&&(this.rdsaCreateService.handleError(o,"rdsaccountorders"),this.rdsaCreateStore.showLoadingSpinner(false));}finally{this.resumeReady.set(false);}})}confirmRDSAccount(e){return S(this,null,function*(){try{let t=yield this.dataService.confirm(e.createdAccount);this.rdsaCreateStore.storeAccountInfo({accountId:t.id||e.createdAccount.id||"",accountNumber:t.accountNumber||""}),yield this.router.navigate(["page","account-ordering","rental-deposit-security-accounts-created-summary"]);}finally{this.rdsaCreateStore.showLoadingSpinner(false),this.rdsaStore.resetState();}})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for RDS account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.spendingAccountResume?.shouldReplay()??false;this.dataService.restoreCreatedAccount(e.createdAccount),this.rdsaCreateStore.showLoadingSpinner(true),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.rdsaCreateStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during spending account signing resume",e)),this.spendingAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e;return JSON.parse(JSON.stringify(t))}checkFormValuesAndValidity(){return this.markEachFormControlAsTouchedAndDirty(),this.setUploadFileControlErrorOnMissingFile(),!this.newAccountForm.invalid}markEachFormControlAsTouchedAndDirty(){Object.values(this.newAccountForm.controls).forEac
1h(e=>{e.markAsTouched(),e.markAsDirty();});}setUploadFileControlErrorOnMissingFile(){this.newAccountForm.value.uploadFile===null&&this.newAccountForm.controls.uploadFile.setErrors({required:true});}static{this.\u0275fac=function(t){return new(t||i$1)};}static{this.\u0275cmp=qT({type:i$1,selectors:[["release-deposit-account"]],features:[D_([{provide:_u,useFactory:e=>e.getTranslations({uploadFileAriaLabel:"EBANKUI.CONFIG.UPLOAD_FILE.ARIA_LABEL",uploadFileAreaText:"PAGE.RDSA.UPLOAD_FILE.AREA_TEXT",uploadFileInputText:"EBANKUI.CONFIG.UPLOAD_FILE.INPUT_TEXT",validationMessages:{fileType:"EBANKUI.CONFIG.UPLOAD_FILE.INVALID_FILE_TYPE.VALIDATION",maxFileSize:"EBANKUI.CONFIG.UPLOAD_FILE.MAX_FILE_SIZE.VALIDATION",maxTotalSize:"EBANKUI.CONFIG.UPLOAD_FILE.MAX_TOTAL_SIZE.VALIDATION",duplicate:"EBANKUI.CONFIG.UPLOAD_FILE.DUPLICATE.VALIDATION",multipleValidationErrors:"EBANKUI.CONFIG.UPLOAD_FILE.MULTIPLE_ERRORS.VALIDATION",maxFilesAllowed:"EBANKUI.CONFIG.UPLOAD_FILE.MAX_FILES_ALLOWED.VALIDATION"}}),deps:[i]}])],decls:4,vars:2,consts:[["ownerCustomerNumberRef","ebankControl"],["firstNameCtrl","ebankControl"],["surnameCtrl","ebankControl"],["ssnCtrl","ebankControl"],["phoneControl","ebankControl"],["emailControl","ebankControl"],["addressControl","ebankControl"],["apartmentNumber","ebankControl"],["zipCodeControl","ebankControl"],["postOfficeControl","ebankControl"],["uploadFileControl","ebankControl"],["dateEbankControl","ebankControl"],["amountCtrl","ebankControl"],[3,"loading"],["id","newAccountForm",1,"ebank-form","ebank-form-input",3,"formGroup"],["translate",""],["formControlName","companyAccount","id","companyAccount",3,"options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["validation","required",3,"control"],["translate","",1,"ebank-title-h2"],["formControlName","firstName"],["validation","pattern",3,"control"],["validation","maxlength",3,"control"],["formControlName","surname"],["formControlName","ssn"],["validation","minlength",3,"control"],["validation","pid",3,"control"],["formControlName","phone"],["validation","minLength",3,"control"],["validation","maxLength",3,"control"],["validation","invalidPhoneNumber",3,"control"],["formControlName","email"],["validation","email",3,"control"],["formControlName","address"],["formControlName","apartmentNumber"],["formControlName","zipCode"],["formControlName","postOffice"],["formControlName","uploadFile",3,"fileTypes","maxFileSize","multiple"],[3,"control"],["id","date","formControlName","date",3,"max","titleOnMobile"],["validation","invalidDate",3,"control"],["id","amount","formControlName","amount",3,"maxlength"],["validation","number",3,"control"],["validation","minValue",3,"control"],["formControlName","confirmed"],["buttonStyle","tertiary",3,"buttonClick"],[3,"buttonClick","disabled"]],template:function(t,o){t&1&&(Ms(0,"section")(1,"ebank-spinner",13),mC(2,ro,4,3,"ebank-empty-state")(3,oo,219,88,"form",14),rd()()),t&2&&(mb(),Ry("loading",o.rdsaCreateStore.showSpinner()),mb(),gC(o.rdsaCreateStore.agreementCustomers().length===0?2:3));},dependencies:[we,Te,D$1,Cu,X3,eR,co$1,Ch,ea,uo,Nl,fu,Pa,gu,on,sI,f8,vI,No$1,BI,_e,QI,t8,M,j,u,Bn$1,PI,m0,y8,Ys,X9,Nf,u8,c8,ye,Ln],encapsulation:2,changeDetection:1});}};vM();he();$N();da();vM();he();var Gn=class i{constructor(){this.router=D(V$1);this.store=D(kt);}navigateToNewDeposit(){this.router.navigate(["page","account-ordering","rental-deposit-security-accounts"]);}static{this.\u0275fac=function(t){return new(t||i)};}
1static{this.\u0275cmp=qT({type:i,selectors:[["release-deposit-account"]],decls:10,vars:8,consts:[[3,"titleText","hideTitle"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],[3,"buttonClick"]],template:function(t,o){t&1&&(Ms(0,"ebank-description-list-section",0),N_(1,"translate"),Ms(2,"div",1)(3,"dt",2),c_(4,"PAGE.RDSA.ACCOUNT_NUMBER"),rd(),Ms(5,"dd",3),c_(6),rd()()(),Ms(7,"ebank-button",4),qy("buttonClick",function(){return o.navigateToNewDeposit()}),c_(8),N_(9,"translate"),rd()),t&2&&(Ry("titleText",R_(1,4,"PAGE.RDSA.NEW.SUCCESS.HEADER"))("hideTitle",true),mb(6),cv(o.store.accountInfo.accountNumber()),mb(2),cd(" ",R_(9,6,"PAGE.RDSA.NEW.SUCCESS.BUTTON.ADD"),`
2`));},dependencies:[we,Te,G8,Ws,W8,U8,D$1,Cu,_e,ye],encapsulation:2,changeDetection:1});}};vM();he();na();pi();N$1();da();W();j$1();Ro$2();mi();vM();na();he();$N();vM();he();vM();he();$N();var co=["dialog"],Bn=class i{constructor(){this.dialog=R$("dialog");this.deleteConfirmed=x$();this.translateService=D(V$2);this.title=this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.DELETE_HEADER");}openDialog(){this.dialog()?.open();}deleteBeneficialOwner(){this.deleteConfirmed.emit();}static{this.\u0275fac=function(t){return new(t||i)};}
2static{this.\u0275cmp=qT({type:i,selectors:[["client-account-beneficial-owners-delete-dialog"]],viewQuery:function(t,o){t&1&&Yy(o.dialog,co,5),t&2&&VC();},outputs:{deleteConfirmed:"deleteConfirmed"},standalone:false,decls:12,vars:9,consts:[["dialog",""],[3,"cancelEvent","title","closeOnBackdropClick","disableBottomSheet"],["translate",""],["buttonStyle","tertiary",3,"buttonClick"],["buttonStyle","tertiary-danger",3,"buttonClick"]],template:function(t,o){if(t&1){let l=CC();Ms(0,"ebank-dialog-alert",1,0),qy("cancelEvent",function(){yh(l);let O=HC(1);return vh(O.close())}),Ms(2,"ebank-dialog-content")(3,"p",2),c_(4,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.DELETE_WARNING"),rd()(),Ms(5,"ebank-dialog-actions")(6,"ebank-button",3),qy("buttonClick",function(){yh(l);let O=HC(1);return vh(O.close())}),c_(7),N_(8,"translate"),rd(),Ms(9,"ebank-button",4),qy("buttonClick",function(){yh(l);let O=HC(1);return o.deleteBeneficialOwner(),vh(O.close())}),c_(10),N_(11,"translate"),rd()()();}t&2&&(Ry("title",o.title)("closeOnBackdropClick",false)("disableBottomSheet",true),mb(7),cv(R_(8,5,"PAGE.ACCOUNT_ORDERING_SHARED.CANCEL")),mb(3),cd(" ",R_(11,7,"PAGE.ACCOUNT_ORDERING_SHARED.DELETE")," "));},dependencies:[Te,_e,w0,S0,k0,ye],encapsulation:2});}};vM();he();vM();he();$N();var lo=["dialog"],wt=class i{constructor(){this.dialog=R$("dialog");this.cancelConfirmed=x$();this.translateService=D(V$2);this.title=this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.CANCEL_HEADER");}openDialog(){this.dialog()?.open();}cancelDialog(e){e.close();}cancelAccountCreating(){this.cancelConfirmed.emit();}static{this.\u0275fac=function(t){return new(t||i)};}
2static{this.\u0275cmp=qT({type:i,selectors:[["client-account-beneficial-owners-cancel-dialog"]],viewQuery:function(t,o){t&1&&Yy(o.dialog,lo,5),t&2&&VC();},outputs:{cancelConfirmed:"cancelConfirmed"},standalone:false,decls:12,vars:9,consts:[["dialog",""],[3,"cancelEvent","title","closeOnBackdropClick","disableBottomSheet"],["translate",""],["buttonStyle","tertiary",3,"buttonClick"],["buttonStyle","tertiary-danger",3,"buttonClick"]],template:function(t,o){if(t&1){let l=CC();Ms(0,"ebank-dialog-alert",1,0),qy("cancelEvent",function(){yh(l);let O=HC(1);return vh(o.cancelDialog(O))}),Ms(2,"ebank-dialog-content")(3,"p",2),c_(4,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.CANCEL_WARNING"),rd()(),Ms(5,"ebank-dialog-actions")(6,"ebank-button",3),qy("buttonClick",function(){yh(l);let O=HC(1);return vh(o.cancelDialog(O))}),c_(7),N_(8,"translate"),rd(),Ms(9,"ebank-button",4),qy("buttonClick",function(){yh(l);let O=HC(1);return o.cancelAccountCreating(),vh(O.close())}),c_(10),N_(11,"translate"),rd()()();}t&2&&(Ry("title",o.title)("closeOnBackdropClick",false)("disableBottomSheet",true),mb(7),cv(R_(8,5,"PAGE.ACCOUNT_ORDERING_SHARED.CANCEL")),mb(3),cd(" ",R_(11,7,"PAGE.ACCOUNT_ORDERING_SHARED.DELETE")," "));},dependencies:[Te,_e,w0,S0,k0,ye],encapsulation:2});}};var mo=["deleteDialog"],po=["cancelDialog"],Ao=i=>[i];function Co(i,e){if(i&1){let t=CC();Ms(0,"ebank-expandable-panel")(1,"ebank-expandable-panel-header"),ky(2,"ebank-template-payment",31),rd(),Ms(3,"ebank-expandable-panel-content")(4,"ebank-button",32),qy("buttonClick",function(){yh(t);let l=RC().$index,f=RC(3);return vh(f.openDeleteDialog(l))}),c_(5),N_(6,"translate"),rd()()();}if(i&2){let t=RC().$implicit,o=RC(3);mb(2),Ry("recipientName",o.getBeneficialOwnerDisplayName(t))("amount",o.getBeneficialOwnerCustomerNumber(t)),mb(3),cd(" ",R_(6,3,"PAGE.ACCOUNT_ORDERING_SHARED.DELETE")," ");}}function fo(i,e){i&1&&wy(0,Co,7,5,"ebank-expandable-panel",30);}function go(i,e){if(i&1&&(Ms(0,"ebank-panel-list",27)(1,"ebank-expandable-panel-container"),IC(2,fo,1,0,"ebank-expandable-panel",null,yC),rd()()),i&2){let t=RC(2);mb(2),EC(t.clientAccountStore.beneficialOwners());}}function So(i,e){if(i&1&&(Ms(0,"ebank-radio-button",34)(1,"ebank-template-basic")(2,"ebank-template-basic-text"),c_(3),rd()()()),i&2){let t=e.$implicit;Ry("value",t.value),mb(3),cd(" ",t.label," ");}}function Eo(i,e){if(i&1&&(Ms(0,"form",12)(1,"ebank-form-field")(2,"ebank-label",13),c_(3," PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.ORGANISATION_NUMBER "),rd(),ky(4,"ebank-input-field",37,6),tT(),Ms(6,"ebank-form-error-wrapper")(7,"ebank-form-error",16)(8,"span",13),c_(9,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()(),Ms(10,"ebank-form-error",18)(11,"span",13),c_(12,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_NUMBER"),rd()()()(),Ms(13,"ebank-form-field")(14,"ebank-label",13),c_(15," PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.COMPANY_NAME "),rd(),ky(16,"ebank-input-field",38,7),tT(),Ms(18,"ebank-form-error-wrapper")(19,"ebank-form-error",16)(20,"span",13),c_(21,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()(),Ms(22,"ebank-form-error",18)(23,"span",13),c_(24,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_CLIENT_NAME"),rd()()()()()),i&2){let t=HC(5),o=HC(17),l=RC(3);Ry("formGroup",l.beneficialOwnerCorporateForm),mb(4),nT(),mb(3),Ry("control",t),mb(3),Ry("control",t),mb(6),nT(),mb(3),Ry("control",o),mb(3),Ry("control",o);}}function bo(i,e){if(i&1&&(Ms(0,"form",12)(1,"ebank-form-field")(2,"ebank-label",13),c_(3," PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.SSN "),rd(),ky(4,"ebank-input-field",39,8),tT(),Ms(6,"ebank-form-error-wrapper")(7,"ebank-form-error",16)(8,"span",13),c_(9,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()(),Ms(10,"ebank-form-error",18)(11,"span",13),c_(12,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_NUMBER"),rd()()()(),Ms(13,"ebank-form-field")(14,"ebank-label",13),c_(15," PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.FIRST_NAME "),rd(),ky(16,"ebank-input-field",40,9),tT(),Ms(18,"ebank-form-error-wrapper")(19,"ebank-form-error",16)(20,"span",13),c_(21,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()(),Ms(22,"ebank-form-error",18)(23,"span",13),c_(24,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVA
2LID_CLIENT_NAME"),rd()()()(),Ms(25,"ebank-form-field")(26,"ebank-label",13),c_(27," PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.LAST_NAME "),rd(),ky(28,"ebank-input-field",41,10),tT(),Ms(30,"ebank-form-error-wrapper")(31,"ebank-form-error",16)(32,"span",13),c_(33,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()(),Ms(34,"ebank-form-error",18)(35,"span",13),c_(36,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.INVALID_CLIENT_NAME"),rd()()()()()),i&2){let t=HC(5),o=HC(17),l=HC(29),f=RC(3);Ry("formGroup",f.beneficialOwnerPrivateForm),mb(4),nT(),mb(3),Ry("control",t),mb(3),Ry("control",t),mb(6),nT(),mb(3),Ry("control",o),mb(3),Ry("control",o),mb(6),nT(),mb(3),Ry("control",l),mb(3),Ry("control",l);}}function ho(i,e){if(i&1){let t=CC();Ms(0,"ebank-form-section")(1,"ebank-radio-button-group",33),IC(2,So,4,2,"ebank-radio-button",34,vC),rd(),tT(),mC(4,Eo,25,5,"form",12)(5,bo,37,7,"form",12),Ms(6,"ebank-action-row")(7,"ebank-button",35),qy("buttonClick",function(){yh(t);let l=RC(2);return vh(l.validateAndCreateBeneficialOwner())}),c_(8),N_(9,"translate"),rd(),Ms(10,"ebank-button",36),qy("buttonClick",function(){yh(t);let l=RC(2);return vh(l.hideAndResetBeneficialOwnerForm())}),c_(11),N_(12,"translate"),rd()()();}if(i&2){let t=RC(2);mb(),Ry("formControl",t.customerCategoryControl),nT(),mb(),EC(t.customerCategories),mb(2),gC(t.isCorporateCustomer()?4:5),mb(3),Ry("disabled",t.clientAccountStore.showSpinner()),mb(),cd(" ",R_(9,5,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ADD_BENEFICIAL_OWNER")," "),mb(3),cd(" ",R_(12,7,"PAGE.ACCOUNT_ORDERING_SHARED.CANCEL")," ");}}function Oo(i,e){if(i&1){let t=CC();Ms(0,"ebank-button",42),qy("buttonClick",function(){yh(t);let l=RC(2);return vh(l.showAddBeneficialOwnerForm(true))}),c_(1),N_(2,"translate"),rd();}i&2&&(mb(),cd(" ",R_(2,1,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ADD_BENEFICIAL_OWNER")," "));}function vo(i,e){if(i&1){let t=CC();Ms(0,"ebank-form-field")(1,"ebank-label",13),c_(2,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT_TYPE"),rd(),Ms(3,"ebank-simple-selector",25,5),N_(5,"translate"),ky(6,"ebank-option-template",15),N_(7,"labelMap"),rd(),tT(),Ms(8,"ebank-form-error-wrapper")(9,"ebank-form-error",16)(10,"span",13),c_(11,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),ky(12,"ebank-lead-block",26),mC(13,go,4,0,"ebank-panel-list",27),mC(14,ho,13,9,"ebank-form-section"),mC(15,Oo,3,3,"ebank-button",28),Ms(16,"ebank-button",29),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.checkAndRedirectToSummaryPage())}),c_(17),N_(18,"translate"),rd();}if(i&2){let t=HC(4),o=RC();mb(3),Ry("allowEmpty",true)("disableSearch",true)("options",o.separateAccountTypesOptions)("titleOnMobile",R_(5,12,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT_TYPE")),nT(),mb(3),Ry("labelMap",R_(7,14,o.LabelMap.Title)),mb(3),Ry("control",t),mb(3),Ry("titleText",o.addBeneficialOwnerTitle),mb(),gC(o.clientAccountStore.beneficialOwners().length>0?13:-1),mb(),gC(o.addBeneficialOwnerFormVisible()?14:-1),mb(),gC(o.addBeneficialOwnerFormVisible()?-1:15),mb(),Ry("disabled",o.clientAccountStore.showSpinner()||o.clientAccountWithBeneficialOwnersForm.invalid||o.nextBtnDisabled()),mb(),cd(" ",R_(18,16,"PAGE.ACCOUNT_ORDERING_SHARED.NEXT")," ");}}function Ro(i,e){if(i&1){let t=CC();Ms(0,"ebank-button",29),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.createAndConfirmClientAccount())}),c_(1),N_(2,"translate"),rd();}if(i&2){let t=RC();Ry("disabled",t.clientAccountStore.showSpinner()),mb(),cd(" ",R_(2,2,"PAGE.ACCOUNT_ORDERING_SHARED.CREATE")," ");}}var No="account-ordering.client-account-beneficial-owners.create",xn=class i{constructor(){this.deleteDialog=R$("deleteDialog");this.cancelDialog=R$("cancelDialog");this.clientAccountStore=D(K);this.clientAccountDataService=D(it);this.beneficialOwnersDataService=D(p$1);this.translateService=D(V$2);this.router=D(V$1);this.route=D(K$1);this.routeDataService=D(S$1);this.alert=D(E$2);this.log=D(E$1);this.clientAccountFormService=D(nt);this.documentSigningResume=D(Er$1);this.imprestType=Je(false);this.addBeneficialOwnerTitle=this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ADD_BENEFICIAL_OWNER");this.isCorporateCustomer=Je(false);this.addBeneficialOwnerFormVisible=Je(false);this.nextBtnDisabled=Je(true);this.selectedBeneficialOwnerIndex=Je(null);this.separateAccountTypesOptions=[{title:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.BANKRUPT"),value:"bankrupt"},{title:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.DEATH"),value:"death"},{title:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.OTHER"),value:"other"}];this.LabelMap=r;this.customerCategories=[{label:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.CUSTOMER_CATEGORY.PRIVATE"),value:"private"},{label:this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.CUSTOMER_CATEGORY.CORPORATE"),value:"corporate"}];this.clientAccountWithBeneficialOwnersForm=this.clientAccountFormService.formWithBeneficialOwners;this.beneficialOwnerPrivateForm=this.clientAccountFormService.formBeneficialOwnerPrivate;this.beneficialOwnerCorporateForm=this.clientAccountFormService.formBeneficialOwnerCorporate;this.customerCategoryControl=new vn("private",{nonNullable:true});this.resumeReady=Je(false);this.allowNavigationWithoutLeaveWarning=false;this.showLoadingSpinner=jt(()=>this.clientAccountStore.showSpinner()||(this.clientAccountResume?.isActive()??false));this.subscription=new H$1;this.clientAccountResume=this.documentSigningResume.connect({actionId:No,ready:this.resumeReady,replay:e=>S(this,null,function*(){yield this.confirmClientAccount(e);})}),Ml(()=>{let e=this.clientAccountResume?.state();e&&this.hydrateResumeState(e);}),Ml(()=>{let e=this.clientAccountResume?.error();e&&this.handleRuntimeResumeError(e);});}get accountAliasControl(){return this.clientAccountWithBeneficialOwnersForm.controls.accountAlias}get ownerCustomerControl(){return this.clientAccountWithBeneficialOwnersForm.controls.ownerCustomerNumber}get separateClientAccountControl(){return this.clientAccountWithBeneficialOwnersForm.controls.separateClientAccount}get separateAccountTypeControl(){return this.clientAccountWithBeneficialOwnersForm.controls.separateAccountType}ngOnInit(){this.setSubscriptions(),this.loadInitialData(),this.checkAndResetFormsDataOnInit(),this.resetBeneficialOwnersForms();}ngOnDestroy(){this.subscription.unsubscribe(),this.clientAccountResume?.destroy();}showAddBeneficialOwnerForm(e){this.addBeneficialOwnerFormVisible.set(e);}hideAndResetBeneficialOwnerForm(){this.addBeneficialOwnerFormVisible.set(false),this.resetBeneficialOwnersForms();}validateAndCreateBeneficialOwner(){return S(this,null,function*(){if(this.isCorporateCustomer()){if(!this.checkBeneficialOwnerCorporateValueAndValidity())return}else if(!this.checkBeneficialOwnerPrivateValueAndValidity())return;let e=this.getOwnerCustomerForBeneficialOwnerCreation();if(!e)return;let t=this.isCorporateCustomer()?F(E({},this.beneficialOwnerCorporateForm.getRawValue()),{isCorporateCustomer:true}):F(E({},this.beneficialOwnerPrivateForm.getRawValue()),{isCorporateCustomer:false}),o=this.mapBeneficialOwnerToValidatePayload(t);try{this.clientAccountStore.showLoadingSpinner(!0),yield this.beneficialOwnersDataService.validate(o);}catch(f){this.clientAccountStore.showLoadingSpinner(false),this.log.error("Error during beneficial owner validation",f),this.alert.error("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.VALIDATE_ERROR");return}let l=this.createBeneficialOwnerCreatePayload(o,e);try{yield this.beneficialOwnersDataService.create(l),this.clientAccountStore.storeBeneficialOwner(t),this.addBeneficialOwnerFormVisible.set(!1),this.nextBtnDisabled.set(this.noBeneficialOwnerAdded()),this.resetBeneficialOwnersForms(),this.clientAccountStore.showLoadingSpinner(!1),this.alert.success("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.ADD_SUCCESS");}catch(f){this.clientAccountStore.showLoadingSpinner(false),this.log.error("Error during beneficial owner creation",f),this.alert.error("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.ADD_ERROR");}})}openDeleteDialog(e){this.selectedBeneficialOwnerIndex.set(e),this.deleteDialog()?.openDialog();}deleteBeneficialOwner(){let e=this.selectedBeneficialOwnerIndex();e!==null&&(this.clientAccountStore.removeBeneficialOwner(e),this.selectedBeneficialOwnerIndex.set(null),this.checkAndSetNextBtnDisabledBasedOnSeparateAccountType(this.separateAccountTypeControl.value?.value));}checkAndRedirectToSummaryPage(){if(!this.checkFormValuesAndValidity())return;let e=this.ownerCustomerControl.value,t={accountAlias:this.accountAliasControl.value,accountType:this.imprestType()?"client_imprest_separate":"client_separate",separateAccountType:this.separateAccountTypeControl.value.value,accountOwnerName:e?.name??"",accountOwnerNumber:e?.customerNumber??""};this.clientAccountStore.storeClientAccountWithBeneficialOwnersInfo(t),this.allowNavigationWithoutLeaveWarning=true,this.router.navigate(["page","account-ordering","client-account-beneficial-owners-created-summary"]);}createAndConfirmClientAccount(){return S(this,null,function*(){if(!this.checkFormValuesAndValidity())return;this.resumeReady.set(false),this.clientAccountStore.showLoadingSpinner(true);let e={ownerCustomerNumber:this.ownerCustomerControl.value?.customerNumber,accountAlias:this.accountAliasControl.value,type:this.imprestType()?"client_imprest_standard":"client_standard"};try{yield this.clientAccountResume?.run(l=>S(this,[l],function*({openSigning:t,redirectUrl:o}){let f=yield this.clientAccountDataService.create(e,o),O=f.links.signingUrl?.href;if(!O)throw new Error("Missing signing URL for client account create response");yield t({signUrl:O,state:this.buildResumeState(f)});}));}catch(t){this.clientAccountStore.showLoadingSpinner(false),this.clientAccountResume?.error()!==t&&!Kc(t)&&(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),this.log.error("Error during account confirmation",t));}finally{this.resumeReady.set(false);}})}confirmClientAccount(e){return S(this,null,function*(){try{let t=yield this.clientAccountDataService.confirm(e.createdAccount);this.clientAccountStore.storeAccountInfo({accountId:t.id||e.createdAccount.id||"",accountAlias:t.accountAlias,accountNumber:t.accountNumber||""}),this.allowNavigationWithoutLeaveWarning=!0,yield this.router.navigate(["page","account-ordering","client-account-created-summary"]);}finally{this.clientAccountStore.showLoadingSpinner(false);}})}canDeactivate(e){return this.allowNavigationWithoutLeaveWarning?(this.allowNavigationWithoutLeaveWarning=false,true):(this.showLoadingSpinner()||(this.blockedNavigationTargetUrl=e,this.cancelDialog()?.openDialog()),false)}confirmBlockedNavigation(){return S(this,null,function*(){let e=this.resolveBlockedNavigationTargetUrl(this.blockedNavigationTargetUrl);
2if(this.blockedNavigationTargetUrl=void 0,this.clientAccountResume?.reset(),this.clientAccountStore.resetBeneficialOwnersSummaryData(),this.clientAccountStore.setShouldKeepBeneficialOwnersData(false),this.allowNavigationWithoutLeaveWarning=true,this.router.url===e){yield this.router.navigateByUrl(e,{skipLocationChange:true});return}yield this.router.navigateByUrl(e);})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for client account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.clientAccountResume?.shouldReplay()??false;this.clientAccountDataService.restoreCreatedAccount(e.createdAccount),this.accountAliasControl.setValue(e.createdAccount.accountAlias),this.ownerCustomerControl.setValue(e.createdAccount.ownerCustomerNumber),this.separateClientAccountControl.setValue(e.createdAccount.separateClientAccount),this.separateAccountTypeControl.setValue(e.createdAccount.separateAccountType),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.clientAccountStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during client account signing resume",e)),this.clientAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e;return JSON.parse(JSON.stringify(t))}getBeneficialOwnerDisplayName(e){if(this.isCorporateBeneficialOwner(e))return e.companyName;let t=e;return `${t.firstName} ${t.lastName}`}getBeneficialOwnerCustomerNumber(e){let t=this.isCorporateBeneficialOwner(e)?e.organizationNumber:e.ssn;return this.isPrivateBeneficialOwner(e)?this.maskCustomerNumber(t):t}maskCustomerNumber(e){return `${e.slice(0,e.length-5)}${"*".repeat(5)}`}loadInitialData(){this.clientAccountStore.agreementCustomers().length||this.clientAccountStore.loadAgreementCustomers();}setSubscriptions(){this.subscription.add(this.route.queryParams.subscribe(e=>{this.imprestType.set(e.imprestType==="true"),this.imprestType()&&this.routeDataService.addData({title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_IMPREST.TITLE"});})),this.subscription.add(this.accountAliasControl.valueChanges.subscribe(e=>{this.checkAndKeepClientAccountDefaultValue(e);})),this.subscription.add(this.separateClientAccountControl.valueChanges.subscribe(e=>{e?this.separateAccountTypeControl.setValidators([lo$1.required]):this.separateAccountTypeControl.removeValidators([lo$1.required]),this.separateAccountTypeControl.updateValueAndValidity();})),this.subscription.add(this.separateAccountTypeControl.valueChanges.subscribe(e=>{if(!e){this.nextBtnDisabled.set(true);return}let t=e.value;this.checkAndSetNextBtnDisabledBasedOnSeparateAccountType(t);})),this.subscription.add(this.customerCategoryControl.valueChanges.subscribe(e=>{this.isCorporateCustomer.set(e==="corporate");}));}checkAndResetFormsDataOnInit(){if(this.clientAccountStore.shouldKeepBeneficialOwnersData())this.restoreFormsDataFromStore();else {this.clientAccountFormService.resetClientAccountWithBeneficialOwnersForm(),this.clientAccountStore.resetBeneficialOwnersSummaryData();return}let e=this.separateAccountTypeControl.value?.value;if(e){let t=this.separateAccountTypesOptions.find(o=>o.value===e)??null;this.separateAccountTypeControl.setValue(t);}}resetBeneficialOwnersForms(){this.beneficialOwnerCorporateForm.reset({organizationNumber:"",companyName:"",isCorporateCustomer:true}),this.beneficialOwnerPrivateForm.reset({ssn:"",firstName:"",lastName:"",isCorporateCustomer:false});}restoreFormsDataFromStore(){let e=this.clientAccountStore.accountWithBeneficialOwnersInfo();if(e&&(this.accountAliasControl.setValue(e.accountAlias??""),this.separateClientAccountControl.setValue(e.separateAccountType!==void 0),e.separateAccountType)){let t=this.separateAccountTypesOptions.find(o=>o.value===e.separateAccountType)??null;this.separateAccountTypeControl.setValue(t);}}checkAndKeepClientAccountDefaultValue(e){e.substring(0,tt.length)!==tt&&this.accountAliasControl.setValue(tt);}checkFormValuesAndValidity(){return this.accountAliasControl.markAsTouched(),this.accountAliasControl.markAsDirty(),this.separateClientAccountControl.value?(this.separateAccountTypeControl.setValidators([lo$1.required]),this.separateAccountTypeControl.markAsTouched(),this.separateAccountTypeControl.markAsDirty()):this.separateAccountTypeControl.clearValidators(),this.clientAccountWithBeneficialOwnersForm.valid}checkBeneficialOwnerPrivateValueAndValidity(){return this.beneficialOwnerPrivateForm.controls.ssn.markAsTouched(),this.beneficialOwnerPrivateForm.controls.ssn.markAsDirty(),this.beneficialOwnerPrivateForm.controls.firstName.markAsTouched(),this.beneficialOwnerPrivateForm.controls.firstName.markAsDirty(),this.beneficialOwnerPrivateForm.controls.lastName.markAsTouched(),this.beneficialOwnerPrivateForm.controls.lastName.markAsDirty(),this.beneficialOwnerPrivateForm.valid}checkBeneficialOwnerCorporateValueAndValidity(){return this.beneficialOwnerCorporateForm.controls.organizationNumber.markAsTouched(),this.beneficialOwnerCorporateForm.controls.organizationNumber.markAsDirty(),this.beneficialOwnerCorporateForm.controls.companyName.markAsTouched(),this.beneficialOwnerCorporateForm.controls.companyName.markAsDirty(),this.beneficialOwnerCorporateForm.valid}noBeneficialOwnerAdded(){return this.clientAccountStore.beneficialOwners().length===0}createBeneficialOwnerCreatePayload(e,t){return {customerIdentificationNumber:e.customerIdentificationNumber,ownerCustomerNumber:t.customerNumber??"",customerType:e.customerType}}getOwnerCustomerForBeneficialOwnerCreation(){this.ownerCustomerControl.markAsTouched(),this.ownerCustomerControl.markAsDirty(),this.ownerCustomerControl.updateValueAndValidity();let e=this.ownerCustomerControl.value;return e?.customerNumber?e:null}mapBeneficialOwnerToValidatePayload(e){return this.isCorporateBeneficialOwner(e)?{customerIdentificationNumber:e.organizationNumber,companyName:e.companyName,customerType:"company"}:{customerIdentificationNumber:e.ssn,firstName:e.firstName,lastName:e.lastName,customerType:"private"}}isCorporateBeneficialOwner(e){return e.isCorporateCustomer}isPrivateBeneficialOwner(e){return !e.isCorporateCustomer}checkAndSetNextBtnDisabledBasedOnSeparateAccountType(e){switch(e){case "bankrupt":case "death":this.nextBtnDisabled.set(false);break;case "other":this.nextBtnDisabled.set(this.noBeneficialOwnerAdded());break;default:this.nextBtnDisabled.set(true);}}resolveBlockedNavigationTargetUrl(e){return e?e.startsWith("/")?e:e.startsWith("page/")?`/${e}
2`:e.startsWith("account-ordering")?`/page/${e}`:"/page/account-ordering":"/page/account-ordering"}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=qT({type:i,selectors:[["client-account-beneficial-owners-create"]],viewQuery:function(t,o){t&1&&Yy(o.deleteDialog,mo,5)(o.cancelDialog,po,5),t&2&&VC(2);},standalone:false,decls:41,vars:24,consts:[["ownerCustomerNumberRef","ebankControl"],["accountAliasRef","ebankControl"],["textInfo",""],["deleteDialog",""],["cancelDialog",""],["separateAccountTypeRef","ebankControl"],["organizationNumberRef","ebankControl"],["companyNameRef","ebankControl"],["ssnRef","ebankControl"],["firstNameRef","ebankControl"],["lastNameRef","ebankControl"],[3,"loading"],[3,"formGroup"],["translate",""],["id","savingAccountAgreementCustomers","formControlName","ownerCustomerNumber",3,"isLoading","options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["validation","required",3,"control"],["formControlName","accountAlias"],["validation","pattern",3,"control"],["validation","maxlength",3,"control"],["formControlName","separateClientAccount"],[3,"content"],[3,"disabled"],[3,"deleteConfirmed"],[3,"cancelConfirmed"],["id","separateAccountType","formControlName","separateAccountType",3,"allowEmpty","disableSearch","options","titleOnMobile"],["level","2",3,"titleText"],["groupHeadingId","heading-id"],["buttonStyle","secondary","spacing","standalone"],[3,"buttonClick","disabled"],[4,"ebankPanelList"],[3,"recipientName","amount"],["buttonStyle","tertiary-danger",3,"buttonClick"],[3,"formControl"],[3,"value"],["buttonStyle","primary",3,"buttonClick","disabled"],["buttonStyle","tertiary",3,"buttonClick"],["formControlName","organizationNumber"],["formControlName","companyName"],["formControlName","ssn"],["formControlName","firstName"],["formControlName","lastName"],["buttonStyle","secondary","spacing","standalone",3,"buttonClick"]],template:function(t,o){if(t&1&&(Ms(0,"section")(1,"ebank-spinner",11)(2,"form",12)(3,"ebank-form-field")(4,"ebank-label",13),c_(5,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SELECT_COMPANY"),rd(),Ms(6,"ebank-simple-selector",14,0),N_(8,"translate"),ky(9,"ebank-option-template",15),N_(10,"labelMap"),rd(),tT(),Ms(11,"ebank-form-error-wrapper")(12,"ebank-form-error",16)(13,"span",13),c_(14,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.FIELD_REQUIRED"),rd()()()(),Ms(15,"ebank-form-field")(16,"ebank-label",13),c_(17,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),ky(18,"ebank-input-field",17,1),tT(),Ms(20,"ebank-form-error-wrapper")(21,"ebank-form-error",18)(22,"span",13),c_(23,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()(),Ms(24,"ebank-form-error",19)(25,"span",13),c_(26,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME_LENGTH.ERROR"),rd()()()(),Ms(27,"ebank-checkbox-field",20),c_(28),N_(29,"translate"),rd(),tT(),ky(30,"ebank-help-button",21),Ms(31,"ebank-help-button-content",null,2),c_(33),N_(34,"translate"),rd(),mC(35,vo,19,18)(36,Ro,3,4,"ebank-button",22),rd()()(),Ms(37,"client-account-beneficial-owners-delete-dialog",23,3),qy("deleteConfirmed",function(){return o.deleteBeneficialOwner()}),rd(),Ms(39,"client-account-beneficial-owners-cancel-dialog",24,4),qy("cancelConfirmed",function(){return o.confirmBlockedNavigation()}),rd()),t&2){let l=HC(7),f=HC(19),O=HC(32);mb(),Ry("loading",o.showLoadingSpinner()),mb(),Ry("formGroup",o.clientAccountWithBeneficialOwnersForm),mb(4),Ry("isLoading",o.showLoadingSpinner())("options",o.clientAccountStore.agreementCustomers())("searchAttributes",T_(22,Ao,o.LabelMap.Name))("titleOnMobile",R_(8,14,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SELECT_COMPANY")),nT(),mb(3),Ry("labelMap",R_(10,16,o.LabelMap.Name)),mb(3),Ry("control",l),mb(6),nT(),mb(3),Ry("control",f),mb(3),Ry("control",f),mb(3),nT(),mb(),cd(" ",R_(29,18,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT")," "),mb(2),Ry("content",O),mb(3),cd(" ",R_(34,20,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT_HELP")," "),mb(2),gC(o.separateClientAccountControl.value?35:36);}},dependencies:[eR,co$1,Ch,j,u,Te,vI,X3,Ol,uo,Nl,fu,Pa,gu,on,sI,No$1,t8,_e,og,TO,X8,Z8,hi,ig,V6,H6,Ys,Bn$1,yI$1,i8,sB,p8,JI,Ls,m0,K6,Bn,wt,ye,Be],encapsulation:2});}};vM();da();he();N$1();W();j$1();Ro$2();mi();vM();he();$N();var Do=["cancelDialog"];function To(i,e){i&1&&(c_(0),N_(1,"translate")),i&2&&cd(" ",R_(1,1,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.CREATE_WITH_BENEFICIAL_OWNERS.INFO")," ");}function yo(i,e){i&1&&(c_(0),N_(1,"translate")),i&2&&cd(" ",R_(1,1,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNER.CREATE_WITHOUT_BENEFICIAL_OWNERS.INFO")," ");}function _o(i,e){if(i&1&&(Ms(0,"ebank-information-area")(1,"ebank-information-area-custom-template"),mC(2,To,2,3)(3,yo,2,3),rd()()),i&2){let t=RC();mb(2),gC(t.clientAccountStore.beneficialOwners().length>0?2:3);}}function Io(i,e){if(i&1&&(Ms(0,"div",3)(1,"dt",4),c_(2,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NUMBER"),rd(),Ms(3,"dd",5),c_(4),N_(5,"accountNumberFormat"),rd()()),i&2){let t=RC();
2mb(4),cd(" ",R_(5,1,t.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountNumber)," ");}}function ko(i,e){if(i&1&&(Ms(0,"div",3)(1,"dt",10),c_(2),rd(),Ms(3,"dd",5),c_(4),rd()()),i&2){let t=e.$implicit,o=RC(2);mb(2),cv(o.getBeneficialOwnerDisplayName(t)),mb(2),cv(o.getBeneficialOwnerCustomerNumber(t));}}function wo(i,e){if(i&1&&(ky(0,"ebank-lead-block",9),Ms(1,"ebank-description-list-section",2),N_(2,"translate"),IC(3,ko,5,2,"div",3,yC),rd()),i&2){let t=RC();Ry("titleText",t.beneficialOwnersTitle),mb(),Ry("titleText",R_(2,3,"PAGE.ACCOUNT_ORDERING.LIST_TITLE"))("hideTitle",true),mb(2),EC(t.clientAccountStore.beneficialOwners());}}function Po(i,e){if(i&1){let t=CC();Ms(0,"ebank-button",11),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.redirectToAccountRights())}),c_(1),N_(2,"translate"),rd();}if(i&2){let t=RC();Ry("disabled",t.showLoadingSpinner()),mb(),cd(" ",R_(2,2,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_RIGHTS.BUTTON")," ");}}function Lo(i,e){if(i&1){let t=CC();Ms(0,"ebank-action-row")(1,"ebank-button",12),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.createAndConfirmClientAccount())}),c_(2),N_(3,"translate"),rd(),Ms(4,"ebank-button",13),qy("buttonClick",function(){yh(t);let l=RC();return vh(l.openCancelDialog())}),c_(5),N_(6,"translate"),rd()();}if(i&2){let t=RC();mb(),Ry("disabled",t.showLoadingSpinner()),mb(),cd(" ",R_(3,4,"PAGE.ACCOUNT_ORDERING_SHARED.CREATE")," "),mb(2),Ry("disabled",t.showLoadingSpinner()),mb(),cd(" ",R_(6,6,"PAGE.ACCOUNT_ORDERING_SHARED.CANCEL")," ");}}var Uo="account-ordering.client-account-beneficial-owners-summary.create",Fn=class i{constructor(){this.cancelDialog=R$("cancelDialog");this.clientAccountStore=D(K);this.clientAccountDataService=D(it);this.router=D(V$1);this.routeDataService=D(S$1);this.translateService=D(V$2);this.alert=D(E$2);this.log=D(E$1);this.documentSigningResume=D(Er$1);this.beneficialOwnersTitle=this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.BENEFICIAL_OWNERS");this.resumeReady=Je(false);this.showLoadingSpinner=jt(()=>this.clientAccountStore.showSpinner()||(this.clientAccountResume?.isActive()??false));this.clientAccountResume=this.documentSigningResume.connect({actionId:Uo,ready:this.resumeReady,replay:e=>S(this,null,function*(){yield this.confirmClientAccount(e);})}),Ml(()=>{let e=this.clientAccountResume?.state();e&&Ie(()=>this.hydrateResumeState(e));}),Ml(()=>{let e=this.clientAccountResume?.error();e&&this.handleRuntimeResumeError(e);}),Ml(()=>{this.clientAccountResume?.status()==="idle"&&Ie(()=>this.checkIfExistSummaryData());});}get isFinalSummary(){return this.hasCompletedSummaryData()}ngOnDestroy(){this.clientAccountResume?.destroy();}createAndConfirmClientAccount(){return S(this,null,function*(){this.clientAccountStore.showLoadingSpinner(true);let e=this.clientAccountStore.accountWithBeneficialOwnersInfo();if(!e?.accountOwnerNumber||!e.accountAlias){this.clientAccountStore.showLoadingSpinner(false),this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR");return}this.resumeReady.set(false);let t={ownerCustomerNumber:e.accountOwnerNumber,accountAlias:e.accountAlias,type:e.accountType};try{yield this.clientAccountResume?.run(f=>S(this,[f],function*({openSigning:o,redirectUrl:l}){let O=yield this.clientAccountDataService.create(t,l),U=O.links.signingUrl?.href;if(!U)throw new Error("Missing signing URL for client account create response");yield o({signUrl:U,state:this.buildResumeState(O)});}));}catch(o){this.clientAccountStore.showLoadingSpinner(false),this.clientAccountResume?.error()!==o&&!Kc(o)&&(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),this.log.error("Error during account confirmation",o));}finally{this.resumeReady.set(false);}})}confirmClientAccount(e){return S(this,null,function*(){try{let t=yield this.clientAccountDataService.confirm(e.createdAccount);this.clientAccountStore.storeClientAccountWithBeneficialOwnersInfo({accountId:t.id||e.createdAccount.id||"",accountAlias:t.accountAlias,accountNumber:t.accountNumber||""});}finally{this.applyFinalRoutingSummaryState(),this.setShouldKeepBeneficialOwnersData(false),this.clientAccountStore.showLoadingSpinner(false);}})}buildResumeState(e){if(!e.links.completeOrder?.href)throw new Error("Missing completeOrder link for client account create response");return {createdAccount:this.toResumeCreatedAccount(e)}}hydrateResumeState(e){let t=this.clientAccountResume?.shouldReplay()??false;this.clientAccountDataService.restoreCreatedAccount(e.createdAccount),this.clientAccountStore.storeClientAccountWithBeneficialOwnersInfo({separateAccountType:e.createdAccount.separateAccountType,accountOwnerName:e.createdAccount.ownerCustomerName||"",accountType:e.createdAccount.accountType}),this.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountAlias||this.clientAccountStore.storeClientAccountWithBeneficialOwnersInfo({accountAlias:e.createdAccount.accountAlias});let o=e.createdAccount.beneficialOwners??[];o.length>0&&this.clientAccountStore.storeBeneficialOwners(o),this.applyBackRoutingState(),this.setShouldKeepBeneficialOwnersData(true),this.resumeReady.set(t);}handleRuntimeResumeError(e){this.clientAccountStore.showLoadingSpinner(false),Kc(e)||(this.alert.error("PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_CREATED.ERROR"),console.error("Error during client account signing resume",e)),this.clientAccountResume?.reset(),this.resumeReady.set(false);}toResumeCreatedAccount(e){let t=e.toJSON?.()??e,o=JSON.parse(JSON.stringify(t)),l=this.clientAccountStore.accountWithBeneficialOwnersInfo();return o.separateAccountType=l?.separateAccountType,o.ownerCustomerName=l?.accountOwnerName,o.accountType=l?.accountType,o.beneficialOwners=this.clientAccountStore.beneficialOwners(),o}getSeparateAccountName(e){switch(e){case "bankrupt":return this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.BANKRUPT");case "death":return this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.DEATH");case "other":return this.translateService.instant("PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_TYPE.OTHER");default:return ""}}redirectToAccountOrdering(){this.router.navigate(["/page/account-ordering"]);}redirectToAccountRights(){let e=this.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountNumber;this.router.navigate(["page/account-rights"],{queryParams:{account:e,hideUnassigned:true}});}getBackBreadcrumbQueryParams(){return {imprestType:this.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountType==="client_imprest_separate"}}getBeneficialOwnerDisplayName(e){if(e.isCorporateCustomer)return e.companyName;let t=e;return `${t.firstName} ${t.lastName}`}getBeneficialOwnerCustomerNumber(e){let t=e.isCorporateCustomer?e.organizationNumber:e.ssn;return e.isCorporateCustomer?t:this.maskCustomerNumber(t)}openCancelDialog(){this.cancelDialog()?.openDialog();}cancelAccountCreating(){this.setShouldKeepBeneficialOwnersData(false),this.redirectToAccountOrdering();}maskCustomerNumber(e){return `${e.slice(0,e.length-5)}${"*".repeat(5)}`}checkIfExistSummaryData(){if(!this.clientAccountStore.accountWithBeneficialOwnersInfo()){this.redirectToAccountOrdering();return}this.applyBackRoutingState(),this.setShouldKeepBeneficialOwnersData(true);}applyBackRoutingState(){this.routeDataService.addData({breadcrumbPath:"account-ordering/client-account-beneficial-owners",breadcrumbQueryParams:this.getBackBreadcrumbQueryParams()});}applyFinalRoutingSummaryState(){this.routeDataService.addData({title:"PAGE.ACCOUNT_ORDERING_SHARED.CREATED_SUMMARY.TITLE",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering"});}hasCompletedSummaryData(e=this.clientAccountStore.accountWithBeneficialOwnersInfo()){return !!e?.accountNumber||!!e?.accountId}setShouldKeepBeneficialOwnersData(e){this.clientAccountStore.setShouldKeepBeneficialOwnersData(e);}static{this.\u0275fac=function(t){return new(t||i)};}
2static{this.\u0275cmp=qT({type:i,selectors:[["client-account-beneficial-owners-created-summary"]],viewQuery:function(t,o){t&1&&Yy(o.cancelDialog,Do,5),t&2&&VC();},standalone:false,decls:26,vars:11,consts:[["cancelDialog",""],[1,"summary-page"],[3,"titleText","hideTitle"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],[1,"ebank-button-container"],[3,"disabled"],[3,"cancelConfirmed"],["level","2",3,"titleText"],["ebankDescriptionListTerm",""],[3,"buttonClick","disabled"],["buttonStyle","primary",3,"buttonClick","disabled"],["buttonStyle","tertiary",3,"buttonClick","disabled"]],template:function(t,o){t&1&&(Ms(0,"section",1),mC(1,_o,4,1,"ebank-information-area"),Ms(2,"ebank-description-list-section",2),N_(3,"translate"),Ms(4,"div",3)(5,"dt",4),c_(6,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.ACCOUNT_OWNER"),rd(),Ms(7,"dd",5),c_(8),rd()(),Ms(9,"div",3)(10,"dt",4),c_(11,"PAGE.ACCOUNT_ORDERING_SHARED.ACCOUNT_NAME"),rd(),Ms(12,"dd",5),c_(13),rd()(),Ms(14,"div",3)(15,"dt",4),c_(16,"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT.SEPARATE_ACCOUNT_TYPE"),rd(),Ms(17,"dd",5),c_(18),rd()(),mC(19,Io,6,3,"div",3),rd(),mC(20,wo,5,5),Ms(21,"div",6),mC(22,Po,3,4,"ebank-button",7)(23,Lo,7,8,"ebank-action-row"),rd()(),Ms(24,"client-account-beneficial-owners-cancel-dialog",8,0),qy("cancelConfirmed",function(){return o.cancelAccountCreating()}),rd()),t&2&&(mb(),gC(o.isFinalSummary?-1:1),mb(),Ry("titleText",R_(3,9,"PAGE.ACCOUNT_ORDERING.LIST_TITLE"))("hideTitle",true),mb(6),cv(o.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountOwnerName),mb(5),cv(o.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountAlias),mb(5),cd(" ",o.getSeparateAccountName(o.clientAccountStore.accountWithBeneficialOwnersInfo()?.separateAccountType)," "),mb(),gC(o.clientAccountStore.accountWithBeneficialOwnersInfo()?.accountNumber?19:-1),mb(),gC(o.clientAccountStore.beneficialOwners().length>0?20:-1),mb(2),gC(o.isFinalSummary?22:23));},dependencies:[Te,_e,U8,Ws,W8,G8,H8,Pf,sB,m0,wt,ye,p],encapsulation:2});}};var Sr=(i,e,t,o)=>i.canDeactivate(o?.url);vM();var Go=[{path:"",pathMatch:"full",component:On,data:{name:"account-ordering",title:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",ebankuiPage:"half"},canActivate:[de]},{path:"spending-account",component:Rn,data:{title:"PAGE.ACCOUNT_ORDERING.SPENDING_ACCOUNT.NEW_TITLE",name:"account-ordering-spending-account",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"spending-account-created-summary",component:kn,data:{title:"PAGE.ACCOUNT_ORDERING_SHARED.CREATED_SUMMARY.TITLE",name:"spending-account-created-summary",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"savings-account",component:yn,data:{title:"PAGE.ACCOUNT_ORDERING.SAVINGS_ACCOUNT.NEW_TITLE",name:"account-ordering-savings-account",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"savings-account-created-summary",component:hn,data:{title:"PAGE.ACCOUNT_ORDERING_SHARED.CREATED_SUMMARY.TITLE",name:"savings-account-created-summary",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"client-account",component:_n,data:{title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_GENERAL.TITLE",name:"account-ordering-client-account",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"client-account-beneficial-owners",component:xn,data:{title:"PAGE.ACCOUNT_ORDERING.CLIENT_ACCOUNT_GENERAL.TITLE",name:"account-ordering-client-account-beneficial-owners",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de],canDeactivate:[Sr]},{path:"client-account-beneficial-owners-created-summary",component:Fn,data:{title:"PAGE.ACCOUNT_ORDERING_SHARED.ORDER_ACCOUNT",name:"account-ordering-client-account-beneficial-owners-created-summary",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.BACK",breadcrumbPath:"account-ordering/client-account-beneficial-owners",breadcrumbQueryParams:{imprestType:false},ebankuiPage:"half"},canActivate:[de]},{path:"client-account-created-summary",component:wn,data:{title:"PAGE.ACCOUNT_ORDERING_SHARED.CREATED_SUMMARY.TITLE",name:"client-account-created-summary",breadcrumbLabel:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE",breadcrumbPath:"account-ordering",ebankuiPage:"half"},canActivate:[de]},{path:"rental-deposit-security-accounts",component:Un,data:{title:"PAGE.RDSA.NEW.HEADER",name:"account-ordering-rdsa",ebankuiPage:"half",breadcrumbLabel:"PAGE.RDSA.BREADCRUMB",breadcrumbPath:"rental-deposit-security-accounts"},canActivate:[ke]},{path:"rental-deposit-security-accounts-created-summary",component:Gn,data:{title:"PAGE.RDSA.NEW.SUCCESS.HEADER",name:"rdsa-created-summary",ebankuiPage:"half",breadcrumbLabel:"PAGE.RDSA.BREADCRUMB",breadcrumbPath:"rental-deposit-security-accounts"}},{path:"page-error",component:In,data:{name:"account-ordering-full-page-error",ebankuiPage:"medium ebankui-alert-page",title:"PAGE.ACCOUNT_ORDERING_SHARED.TITLE"}}],Mn=class i{static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275mod=my({type:i});}static{this.\u0275inj=Oc({imports:[aa.forChild(Go),aa]});}};$N();vM();var Er=class i{static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275mod=my({type:i});}static{this.\u0275inj=Oc({providers:[Ze,et,K,Rt,Dt,Nt,_t,Tt,nt,J,Xe,f,It,yt],imports:[ii,Mn,r8,Cu,No$1,t8,we,_e,Ro$1,fN,U8,vO,g6,Ga,H8,Bf,Pf,t,xu,BO,Bn$1,a8,o8,QI,qI,x8,sB,Q,Qi,B6,p8,JI,Ls,m0,K6,w0,S0,k0]});}}
2;export{Er as AccountOrderingModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.