1import{c as Ie}from"./chunk-LRA3XYUF.js";import{R as u,S as me,g as y,w}from"./chunk-T7T6P52W.js";import{$a as I,Ab as l,D as U,Fb as V,Fc as B,Gb as G,Hb as Y,I as b,Uc as pe,Vc as g,X as ne,Y as N,_a as O,aa as H,ac as fe,bc as ve,ca as $,ea as W,eb as c,ja as x,ka as ae,la as ce,lb as _,mb as de,nb as he,oa as ue,p as F,sa as M,sb as le,ub as ge,xb as k,yb as z,zb as Se}from"./chunk-DFRNRTGQ.js";import{Aa as s,Ba as C,Db as re,Q as te,Sd as oe,T as j,Ya as P,d as Q,de as L,m as q,n as R,oa as ie,q as ee,u as E,v as D,vd as se,wb as m,xa as a,ya as p}from"./chunk-XMJHK5Z6.js";import{a as Z,g as J,h as v}from"./chunk-2GKL4NPU.js";var qe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:function(i){let r=null;return i?r=new(i||e):r=s(U),r},providedIn:"root"})}}return e})(),Te="asm_enabled",Ae=(()=>{class e{constructor(t,i,r,n){this.location=t,this.winRef=i,this.launchDialogService=r,this.featureModules=n}load(){this.isEnabled()&&this.addUi()}isEnabled(){return this.isLaunched()&&!this.isUsedBefore()&&this.winRef.localStorage&&this.winRef.localStorage.setItem(Te,"true"),this.isLaunched()||this.isUsedBefore()||this.isEmulateInURL()}isLaunched(){let t=this.location.path().split("?")[1];return!!t&&t.split("&").includes("asm=true")}isEmulateInURL(){return this.location.path().indexOf("assisted-service/emulate?")>0}isUsedBefore(){return this.winRef.localStorage?this.winRef.localStorage.getItem(Te)==="true":!1}addUi(){this.featureModules.resolveFeature("asm").subscribe(()=>this.launchDialogService.launch(u.ASM))}static{this.\u0275fac=function(i){return new(i||e)(s(se),s(H),s(me),s(pe))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Le=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=m({type:e})}static{this.\u0275inj=p({providers:[{provide:re,useFactory:Ue,deps:[Ae],multi:!0}],imports:[oe,w]})}}return e})();function Ue(e){return()=>{e.load()}}var T=(function(e){return e.START_SESSION="START_SESSION",e.ORDER_HISTORY="ORDER_HISTORY",e.ACTIVE_CART="ACTIVE_CART",e.CUSTOMER_360="CUSTOMER_360",e})(T||{}),be={asm:{agentSessionTimer:{startingDelayInSeconds:600},customerSearch:{maxResults:20},asmSessionSupport:{enabled:!1},customerList:{pageSize:5,showAvatar:!0,columns:[{headerLocalizationKey:"asm.customerList.tableHeader.customer",renderer:e=>e?.name??"",actionType:T.START_SESSION},{headerLocalizationKey:"asm.customerList.tableHeader.email",renderer:e=>e?.uid??""},{headerLocalizationKey:"asm.customerList.tableHeader.phone",renderer:e=>e?.defaultAddress?.phone??""},{headerLocalizationKey:"asm.customerList.tableHeader.account",renderer:e=>e?.orgUnit?.name??""},{headerLocalizationKey:"asm.customerList.tableHeader.activeCart",icon:{symbol:y.CART,captionLocalizationKey:"asm.customerList.tableHeader.viewActiveCart"},actionType:T.ACTIVE_CART},{headerLocalizationKey:"asm.customerList.tableHeader.orders",icon:{symbol:y.C360_INVOICE,captionLocalizationKey:"asm.customerList.tableHeader.viewOrders"},actionType:T.ORDER_HISTORY},{headerLocalizationKey:"asm.customerList.tableHeader.customer360",icon:{symbol:y.C360_CIRCLE_USER,captionLocalizationKey:"asm.customerList.tableHeader.viewCustomer360"},actionType:T.CUSTOMER_360}]},userIdHttpHeader:{enable:!0},createCustomer:{enable:!0}}},Me=(()=>{class e{constructor(t,i,r){this.config=t,this.userIdService=i,this.userIdConstants=r,this.userIdHeader="sap-commerce-cloud-user-id",this.uniqueUserIdConstants=new Set(Object.values(r))}intercept(t,i){if(!this.config.asm?.userIdHttpHeader?.enable)return i.handle(t);let r=t.context.get(fe),n;if(typeof r.sendUserIdAsHeader=="string")n=R(r.sendUserIdAsHeader);else if(r.sendUserIdAsHeader)n=this.userIdService.takeUserId().pipe(E(o=>this.uniqueUserIdConstants.has(o)?void 0:o));else return i.handle(t);return n.pipe(te(o=>{if(o){let h=t.clone({headers:t.headers.set(this.userIdHeader,o)});return i.handle(h)}else return i.handle(t)}))}static{this.\u0275fac=function(i){return new(i||e)(s(U),s(O),s(ve))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),d=(function(e){return e.CSAgent="CSAgent",e.User="User",e})(d||{}),K=(()=>{class e extends I{constructor(){super(...arguments),this._tokenTarget$=new Q(d.User)}getTokenTarget(){return this._tokenTarget$}setTokenTarget(t){this._tokenTarget$.next(t)}getEmulatedUserToken(){return this.emulatedUserToken}setEmulatedUserToken(t){this.emulatedUserToken=t}switchTokenTargetToCSAgent(){this._tokenTarget$.next(d.CSAgent)}switchTokenTargetToUser(){this._tokenTarget$.next(d.User)}clearEmulatedUserToken(){this.emulatedUserToken=void 0}static{this.\u0275fac=(()=>{let t;return function(r){return(t||(t=P(e)))(r||e)}})()}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Re=(()=>{class e{constructor(t,i,r,n,o,h){this.authService=t,this.authStorageService=i,this.userIdService=r,this.oAuthLibWrapperService=n,this.store=o,this.userAccountFacade=h}authorizeCustomerSupportAgent(t,i){return v(this,null,function*(){let r,n;this.userAccountFacade.get().subscribe(o=>n=o?.customerId).unsubscribe(),this.authStorageService.getToken().subscribe(o=>r=o).unsubscribe(),this.authStorageService.switchTokenTargetToCSAgent();try{yield this.oAuthLibWrapperService.authorizeWithPasswordFlow(t,i),this.store.dispatch(new c.Logout),n!==void 0&&r!==void 0?(this.userIdService.setUserId(n),this.authStorageService.setEmulatedUserToken(r),this.store.dispatch(new c.Login)):(this.userIdService.setUserId(N),this.authStorageService.clearEmulatedUserToken())}catch(o){this.authStorageService.switchTokenTargetToUser()}})}authorizeCustomerSupportAgentWhenUseCodeFlow(){return v(this,null,function*(){let t,i;this.userAccountFacade.get().subscribe(r=>i=r?.customerId).unsubscribe(),this.authStorageService.getToken().subscribe(r=>t=r).unsubscribe(),this.authStorageService.switchTokenTargetToCSAgent();try{yield this.oAuthLibWrapperService.initLoginFlow(),this.store.dispatch(new c.Logout),i!==void 0&&t!==void 0?(this.userIdService.setUserId(i),this.authStorageService.setEmulatedUserToken(t),this.store.dispatch(new c.Login)):(this.userIdService.setUserId(N),this.authStorageService.clearEmulatedUserToken())}catch(r){this.authStorageService.switchTokenTargetToUser()}})}startCustomerEmulationSession(t){this.authStorageService.clearEmulatedUserToken(),this.store.dispatch(new c.Logout),this.userIdService.setUserId(t),this.store.dispatch(new c.Login)}isCustomerSupportAgentLoggedIn(){return D([this.authStorageService.getToken(),this.authStorageService.getTokenTarget()]).pipe(E(([t,i])=>!!(t?.access_token&&i===d.CSAgent)))}isCustomerEmulated(){return this.userIdService.isEmulated()}getCustomerSupportAgentTokenLoading(){return R(!1)}logoutCustomerSupportAgent(){return v(this,null,function*(){let t=this.authStorageService.getEmulatedUserToken(),i;this.userIdService.isEmulated().subscribe(r=>i=r).unsubscribe(),yield this.oAuthLibWrapperService.revokeAndLogout(),this.store.dispatch({type:"[Auth] Logout Customer Support Agent"}),this.authStorageService.setTokenTarget(d.User),i&&t?(this.store.dispatch(new c.Logout),this.authStorageService.setToken(t),this.userIdService.setUserId(ne),this.authStorageService.clearEmulatedUserToken(),this.store.dispatch(new c.Login)):this.authService.logout()})}static{this.\u0275fac=function(i){return new(i||e)(s(l),s(K),s(O),s(_),s(F),s(Ie))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Oe=(()=>{class e extends Y{constructor(t,i,r,n,o,h,S,f){super(t,i,n,o,S,h,f),this.authService=t,this.authStorageService=i,this.csAgentAuthService=r,this.oAuthLibWrapperService=n,this.routingService=o,this.globalMessageService=h,this.occEndpointsService=S,this.authRedirectService=f}shouldAddAuthorizationHeader(t){return super.shouldAddAuthorizationHeader(t)||this.isCSAgentTokenRequest(t)}shouldCatchError(t){return super.shouldCatchError(t)||this.isCSAgentTokenRequest(t)}
1alterRequest(t,i){let r=!!this.getAuthorizationHeader(t),n=this.isCSAgentTokenRequest(t),o=super.alterRequest(t,i);return!r&&n?(o=t.clone({setHeaders:Z({},this.createAuthorizationHeader(i))}),W.removeHeader($,o)):o}isCSAgentTokenRequest(t){return!!W.getInterceptorParam($,t.headers)}handleExpiredRefreshToken(){this.csAgentAuthService.isCustomerSupportAgentLoggedIn().pipe(j(1)).subscribe(t=>{t?(this.authService.setLogoutProgress(!0),this.csAgentAuthService.logoutCustomerSupportAgent(),this.globalMessageService.add({key:"asm.csagentTokenExpired"},V.MSG_TYPE_ERROR)):super.handleExpiredRefreshToken()})}static{this.\u0275fac=function(i){return new(i||e)(s(l),s(I),s(Re),s(_),s(k),s(G),s(M),s(z))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),_e=(()=>{class e extends l{constructor(t,i,r,n,o,h,S,f){super(t,i,r,n,o,S,f),this.store=t,this.userIdService=i,this.oAuthLibWrapperService=r,this.authStorageService=n,this.authRedirectService=o,this.globalMessageService=h,this.routingService=S,this.authMultisiteIsolationService=f}canUserLogin(){let t,i;return this.authStorageService.getToken().subscribe(r=>i=r).unsubscribe(),this.authStorageService.getTokenTarget().subscribe(r=>t=r).unsubscribe(),!(i?.access_token&&t===d.CSAgent)}warnAboutLoggedCSAgent(){this.globalMessageService.add({key:"asm.auth.agentLoggedInError"},V.MSG_TYPE_ERROR)}loginWithCredentials(t,i){return v(this,null,function*(){this.canUserLogin()?yield J(e.prototype,this,"loginWithCredentials").call(this,t,i):this.warnAboutLoggedCSAgent()})}loginWithRedirect(){return this.canUserLogin()?(super.loginWithRedirect(),!0):(this.warnAboutLoggedCSAgent(),!1)}coreLogout(){return ee(this.userIdService.isEmulated().pipe(j(1),ie(t=>t?(this.authStorageService.clearEmulatedUserToken(),this.userIdService.clearUserId(),this.store.dispatch(new c.Logout),R(!0)):q(super.coreLogout()))))}isUserLoggedIn(){return D([this.authStorageService.getToken(),this.userIdService.isEmulated(),this.authStorageService.getTokenTarget()]).pipe(E(([t,i,r])=>!!t?.access_token&&(r===d.User||r===d.CSAgent&&i)))}static{this.\u0275fac=function(i){return new(i||e)(s(F),s(O),s(_),s(K),s(z),s(G),s(k),s(Se))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ke=(()=>{class e extends B{constructor(){super(...arguments),this.config=C(le),this.urlParsingService=C(ge),this.csAgentAuthService=C(Re)}isUrlProtected(t){let i=!1;return this.csAgentAuthService.isCustomerSupportAgentLoggedIn().subscribe(r=>i=r).unsubscribe(),i?!1:super.isUrlProtected(t)}static{this.\u0275fac=(()=>{let t;return function(r){return(t||(t=P(e)))(r||e)}})()}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),et=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=m({type:e})}static{this.\u0275inj=p({providers:[b(be),{provide:I,useExisting:K},{provide:l,useExisting:_e},{provide:Y,useExisting:Oe},{provide:B,useExisting:ke},{provide:L,useExisting:Me,multi:!0}],imports:[Le]})}}return e})(),A="asm",tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>g({facade:e,feature:A,methods:["bindCart"]}),providedIn:"root"})}}return e})(),it=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>g({facade:e,feature:A,methods:["createCustomer"]}),providedIn:"root"})}}return e})(),rt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>g({facade:e,feature:A,methods:["getCustomerLists","getCustomerListsState","customerListCustomersSearch","getCustomerListCustomersSearchResults","getCustomerListCustomersSearchResultsLoading","customerListCustomersSearchReset","getCustomerListCustomersSearchResultsError"]}),providedIn:"root"})}}return e})(),st={FORBIDDEN:"forbidden"};u.ASM_CUSTOMER_LIST="ASM_CUSTOMER_LIST";u.ASM_BIND_CART="ASM_BIND_CART";u.ASM_SAVE_CART="ASM_SAVE_CART";u.ASM_SWITCH_CUSTOMER="ASM_SWITCH_CUSTOMER";u.ASM_CREATE_CUSTOMER_FORM="ASM_CREATE_CUSTOMER_FORM";var ot=(()=>{class e{constructor(t,i,r){this.routingService=t,this.winRef=i,this.asmEnablerService=r,this.searchParams=new URLSearchParams(this.winRef?.location?.search)}isEmulateInURL(){return this.asmEnablerService?.isEmulateInURL()||!1}getSearchParameter(t){return this.searchParams.get(t)??void 0}handleNavigation(t=this.getParamsInUrl()){t.cartType==="active"?this.routingService.go({cxRoute:"cart"}):t.cartType==="saved"&&t.cartId?this.routingService.go("my-account/saved-cart/"+t.cartId):t.orderId?this.routingService.go({cxRoute:"orderDetails",params:{code:t.orderId}}):t.ticketId&&this.routingService.go({cxRoute:"supportTicketDetails",params:{ticketCode:t.ticketId}})}getParamsInUrl(){let t={customerId:this.getSearchParameter("customerId"),orderId:this.getSearchParameter("orderId"),ticketId:this.getSearchParameter("ticketId"),cartId:this.getSearchParameter("cartId"),cartType:this.getSearchParameter("cartType")};return Object.fromEntries(Object.entries(t).filter(([i,r])=>!!r))}static{this.\u0275fac=function(i){return new(i||e)(s(k),s(H),s(Ae))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var X="asmCustomer360",ye="asmCustomer360Core",we=(()=>{class e{constructor(t,i,r,n){this.languageService=t,this.currencyService=i,this.occEndpoints=r,this.config=n,this.activeLang=x(this.config,ae),this.activeCurr=x(this.config,ce),this.languageService.getActive().subscribe(o=>this.activeLang=o),this.currencyService.getActive().subscribe(o=>{this.activeCurr=o})}intercept(t,i){return t.url.includes(this.occEndpoints.getBaseUrl({prefix:!1,baseSite:!1}))&&t.url.includes("/assistedservicewebservices/")&&(t=t.clone({setParams:{lang:this.activeLang??"",curr:this.activeCurr??""}})),i.handle(t)}static{this.\u0275fac=function(i){return new(i||e)(s(he),s(de),s(M),s(ue))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),lt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=m({type:e})}static{this.\u0275inj=p({providers:[b({featureModules:{[X]:{depen
1dencies:[A]},[ye]:X}}),{provide:L,useExisting:we,multi:!0}],imports:[w]})}}return e})(),gt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>g({facade:e,feature:X,methods:["get360Data"]}),providedIn:"root"})}}return e})();var De=(function(e){return e.REVIEW_LIST="c360ReviewList",e.STORE_LOCATION="c360StoreLocation",e.PRODUCT_INTEREST_LIST="c360CustomerProductInterestList",e.SUPPORT_TICKET_LIST="c360TicketList",e.CUSTOMER_PROFILE="c360CustomerProfile",e.ACTIVE_CART="c360Cart",e.SAVED_CART="c360SavedCart",e.OVERVIEW="c360Overview",e.ACTIVITY_LIST="c360ActivityList",e.COUPON_LIST="c360CouponList",e.PROMOTION_LIST="c360PromotionList",e.CUSTOMER_COUPON_LIST="c360CustomerCouponList",e})(De||{}),je=(function(e){return e.VISA="visa",e.MASTER="master",e.MASTERCARD_EUROCARD="mastercard_eurocard",e.DINERS="diners",e.AMEX="amex",e})(je||{}),Pe=(function(e){return e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.HOME="Home",e.END="End",e.PAGE_DOWN="PageDown",e.PAGE_UP="PageUp",e})(Pe||{}),Fe=(function(e){return e.NAVIGATE="NAVIGATE",e})(Fe||{});u.ASM_CUSTOMER_360="ASM_CUSTOMER_360";export{qe as a,Te as b,Ae as c,T as d,K as e,Re as f,et as g,A as h,tt as i,it as j,rt as k,st as l,ot as m,X as n,lt as o,gt as p,De as q,je as r,Pe as s,Fe as t};
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.