1import{e as w}from"./chunk-L7T3VYHM.js";import{b as R,l as C}from"./chunk-RXO5FOGF.js";import{a as L}from"./chunk-SHD7ZT4O.js";import{c as b,n as p}from"./chunk-BZRY3WX3.js";import{gb as A}from"./chunk-NGFOYMLE.js";import{a as U}from"./chunk-FCZ6MCLW.js";import{n as E}from"./chunk-44NWIEBJ.js";import{f as N}from"./chunk-ABACGHJ4.js";import{g as I}from"./chunk-GDB2PFOH.js";import{H as d,Me as y,R as h,d as g,p as c,sa as v,v as u,va as t,w as f}from"./chunk-ZIECK5QA.js";import{m as S}from"./chunk-3JMZ37NM.js";var O="onlineRegisterUser",V=(()=>{let o=class o{constructor(e,i,r,n,s,a,m,P){this.cmsService=e,this.membershipSetupService=i,this.routingService=r,this.configService=n,this.loggerFactory=s,this.windowRef=a,this.sessionStorageService=m,this.identityService=P,this.registeredUser=new g(null),this.registeredCountryName=new g(""),this.registeredCountryUrl=new g(""),this.registeredPassword="",this.windowRef.isBrowser()&&this.registeredUser.next(this.sessionStorageService.retrieve(O)),this.registeredUser$=this.registeredUser.asObservable(),this.registeredCountryName$=this.registeredCountryName.asObservable(),this.registeredCountryUrl$=this.registeredCountryUrl.asObservable(),this.logger=this.loggerFactory.getLogger("SipOnlineRegisterService")}completeOnlineRegistration(e,i,r){r&&(this.registeredCountryName.next(r.countryName),this.registeredCountryUrl.next(r.countryUrl)),this.sessionStorageService.store(O,e),this.registeredUser.next(e),this.registeredPassword=i;let n=b.ONLINE_REGISTER_CONFIRMATION,s={addressSuccess:(e?.defaultAddress?.postalCode?.length>0).toString()},a=new URLSearchParams(s).toString(),m=`${n}?${a}`;this.routingService.goByUrl(m,{replaceUrl:!0}).then()}getRegisteredUserMembershipImage(){return f([this.registeredUser$.pipe(d(e=>!!e)),this.membershipSetupService.getProductImages()]).pipe(u(([e,i])=>{let r=i.images.find(n=>n.key===e.memberType);return r?{code:r.value.code,src:r.value.url,url:r.value.url,altText:r.value.altText,mime:r.value.mime}:null}))}isOnlineRegisterPage(){return this.cmsService.getCurrentPage().pipe(d(e=>!!e),u(e=>(e.pageId?.endsWith(p.PAGE_ID_SUFFIX_ONLINE)??!1)||(e.label?.endsWith(p.PAGE_ID_SUFFIX_ONLINE)??!1)))}autoLogin(){return S(this,null,function*(){if(!(yield this.configService.getBooleanConfig(E).pipe(h(1)).toPromise()))return!1;let e=this.registeredUser.value?.memberEmail,i=this.registeredPassword;if(!e||!i)return this.logger.error("Auto-login: Enabled but user credentials are missing"),!1;try{yield this.identityService.loginWithCredentials(e,i,{suppressLoginErrorMessage:!0,absolutelyDoNotRedirect:!0})}catch{this.logger.warn("Auto-login: failed to log in with credentials")}return yield this.identityService.isUserLoggedIn().pipe(h(1)).toPromise()})}getMembershipImageFromContentStack(e,i){if(!i)return c(null);let r=w(e?.registration_confirmation,"card_images_settings"),s=(Array.isArray(r.images)?r.images:[])?.find(a=>a.key===i);return s?.value?.url?c({src:s.value.url,url:s.value.url,altText:s.value.altText??""}):c(null)}};o.\u0275fac=function(i){return new(i||o)(t(L),t(R),t(U),t(N),t(I),t(y),t(A),t(C))},o.\u0275prov=v({token:o,factory:o.\u0275fac,providedIn:"root"});let l=o;return l})();export{V as a};
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.