PageSourceSearch

https://www.ernestjones.co.uk/scripts/chunk-V3KEVQ64.js

js ernestjones.co.uk collected 2026-09-26 03:03:45 UTC 13,361 bytes, 1 lines download raw bytes

1import{c as ge}from"./chunk-B7NBARZN.js";import{$ as le,_ as h,g as L,y as he}from"./chunk-WFKL35DD.js";import{Aa as O,Ab as v,C as w,Ca as D,Ea as H,Fd as de,Gd as b,Hb as c,Ic as ce,Jc as ue,Qa as re,Sb as se,Ub as oe,Xb as E,ac as R,ca as A,cc as F,dc as ne,ec as l,ga as te,ic as P,j as ee,jc as $,kc as ae,lc as N,od as x,wa as ie,xa as _,zb as C}from"./chunk-DM3NC7AB.js";import{Ea as a,Fa as k,Ia as s,Ja as I,Oe as X,T as q,X as y,ac as j,e as G,fb as M,mc as J,n as V,o as p,pe as Q,s as Y,ta as Z,w as T,x as U}from"./chunk-WVBH4ZDA.js";import{a as B,g as K,h as f}from"./chunk-YDOXD4O3.js";var xe=(()=>{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(A),r},providedIn:"root"})}}return e})(),Se="asm_enabled",ve=(()=>{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(Se,"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(Se)==="true":!1}addUi(){this.featureModules.resolveFeature("asm").subscribe(()=>this.launchDialogService.launch(h.ASM))}static{this.\u0275fac=function(i){return new(i||e)(s(Q),s(O),s(le),s(de))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),pe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=j({type:e})}static{this.\u0275inj=k({providers:[{provide:J,useFactory:Te,deps:[ve],multi:!0}],imports:[X,he]})}}return e})();function Te(e){return()=>{e.load()}}var m=(function(e){return e.START_SESSION="START_SESSION",e.ORDER_HISTORY="ORDER_HISTORY",e.ACTIVE_CART="ACTIVE_CART",e.CUSTOMER_360="CUSTOMER_360",e})(m||{}),Ie={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:m.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:L.CART,captionLocalizationKey:"asm.customerList.tableHeader.viewActiveCart"},actionType:m.ACTIVE_CART},{headerLocalizationKey:"asm.customerList.tableHeader.orders",icon:{symbol:L.C360_INVOICE,captionLocalizationKey:"asm.customerList.tableHeader.viewOrders"},actionType:m.ORDER_HISTORY},{headerLocalizationKey:"asm.customerList.tableHeader.customer360",icon:{symbol:L.C360_CIRCLE_USER,captionLocalizationKey:"asm.customerList.tableHeader.viewCustomer360"},actionType:m.CUSTOMER_360}]},userIdHttpHeader:{enable:!0},createCustomer:{enable:!0}}},Ae=(()=>{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(ce),n;if(typeof r.sendUserIdAsHeader=="string")n=p(r.sendUserIdAsHeader);else if(r.sendUserIdAsHeader)n=this.userIdService.takeUserId().pipe(T(o=>this.uniqueUserIdConstants.has(o)?void 0:o));else return i.handle(t);return n.pipe(q(o=>{if(o){let d=t.clone({headers:t.headers.set(this.userIdHeader,o)});return i.handle(d)}else return i.handle(t)}))}static{this.\u0275fac=function(i){return new(i||e)(s(A),s(C),s(ue))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),u=(function(e){return e.CSAgent="CSAgent",e.User="User",e})(u||{}),z=(()=>{class e extends v{constructor(){super(...arguments),this._tokenTarget$=new G(u.User)}getTokenTarget(){return this._tokenTarget$}setTokenTarget(t){this._tokenTarget$.next(t)}getEmulatedUserToken(){return this.emulatedUserToken}setEmulatedUserToken(t){this.emulatedUserToken=t}switchTokenTargetToCSAgent(){this._tokenTarget$.next(u.CSAgent)}switchTokenTargetToUser(){this._tokenTarget$.next(u.User)}clearEmulatedUserToken(){this.emulatedUserToken=void 0}static{this.\u0275fac=(()=>{let t;return function(r){return(t||(t=M(e)))(r||e)}})()}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),me=(()=>{class e{constructor(t,i,r,n,o,d){this.authService=t,this.authStorageService=i,this.userIdService=r,this.oAuthLibWrapperService=n,this.store=o,this.userAccountFacade=d}authorizeCustomerSupportAgent(t,i){return f(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(_),this.authStorageService.clearEmulatedUserToken())}catch(o){this.authStorageService.switchTokenTargetToUser()}})}authorizeCustomerSupportAgentWhenUseCodeFlow(){return f(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(_),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 U([this.authStorageService.getToken(),this.authStorageService.getTokenTarget()]).pipe(T(([t,i])=>!!(t?.access_token&&i===u.CSAgent)))}isCustomerEmulated(){return this.userIdService.isEmulated()}getCustomerSupportAgentTokenLoading(){return p(!1)}logoutCustomerSupportAgent(){return f(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(u.User),i&&t?(this.store.dispatch(new c.Logout),this.authStorageService.setToken(t),this.userIdService.setUserId(ie),this.authStorageService.clearEmulatedUserToken(),this.store.dispatch(new c.Login)):this.authService.logout()})}static{this.\u0275fac=function(i){return new(i||e)(s(l),s(z),s(C),s(E),s(w),s(ge))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),fe=(()=>{class e extends N{constructor(t,i,r,n,o,d,g,S){super(t,i,n,o,g,d,S),this.authService=t,this.authStorageService=i,this.csAgentAuthService=r,this.oAuthLibWrapperService=n,this.routingService=o,this.globalMessageService=d,this.occEndpointsService=g,this.authRedirectService=S}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:B({},this.createAuthorizationHeader(i))}),H.removeHeader(D,o)):o}isCSAgentTokenRequest(t){return!!H.getInterceptorParam(D,t.headers)}handleExpiredRefreshToken(){this.csAgentAuthService.isCustomerSupportAgentLoggedIn().pipe(y(1)).subscribe(t=>{t?(this.authService.setLogoutProgress(!0),this.csAgentAuthService.logoutCustomerSupportAgent(),this.globalMessageService.add({key:"asm.csagentTokenExpired"},$.MSG_TYPE_ERROR)):super.handleExpiredRefreshToken()})}static{this.\u0275fac=function(i){return new(i||e)(s(l),s(v),s(me),s(E),s(R),s(P),s(re),s(F))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Ce=(()=>{class e extends l{constructor(t,i,r,n,o,d,g,S){super(t,i,r,n,o,g,S),this.store=t,this.userIdService=i,this.oAuthLibWrapperService=r,this.authStorageService=n,this.authRedirectService=o,this.globalMessageService=d,this.routingService=g,this.authMultisiteIsolationService=S}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===u.CSAgent)}warnAboutLoggedCSAgent(){this.globalMessageService.add({key:"asm.auth.agentLoggedInError"},$.MSG_TYPE_ERROR)}loginWithCredentials(t,i){return f(this,null,function*(){this.canUserLogin()?yield K(e.prototype,this,"loginWithCredentials").call(this,t,i):this.warnAboutLoggedCSAgent()})}loginWithRedirect(){return this.canUserLogin()?(super.loginWithRedirect(),!0):(this.warnAboutLoggedCSAgent(),!1)}coreLogout(){return Y(this.userIdService.isEmulated().pipe(y(1),Z(t=>t?(this.authStorageService.clearEmulatedUserToken(),this.userIdService.clearUserId(),this.store.dispatch(new c.Logout),p(!0)):V(super.coreLogout()))))}isUserLoggedIn(){return U([this.authStorageService.getToken(),this.userIdService.isEmulated(),this.authStorageService.getTokenTarget()]).pipe(T(([t,i,r])=>!!t?.access_token&&(r===u.User||r===u.CSAgent&&i)))}static{this.\u0275fac=function(i){return new(i||e)(s(w),s(C),s(E),s(z),s(F),s(P),s(R),s(ne))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Ee=(()=>{class e extends x{constructor(){super(...arguments),this.config=I(se),this.urlParsingService=I(oe),this.csAgentAuthService=I(me)}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=M(e)))(r||e)}})()}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ze=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=j({type:e})}static{this.\u0275inj=k({providers:[te(Ie),{provide:v,useExisting:z},{provide:l,useExisting:Ce},{provide:N,useExisting:fe},{provide:ae,useExisting:fe},{provide:x,useExisting:Ee},{provide:ee,useExisting:Ae,multi:!0}],imports:[pe]})}}return e})(),W="asm",We=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>b({facade:e,feature:W,methods:["bindCart"]}),providedIn:"root"})}}return e})(),Be=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>b({facade:e,feature:W,methods:["createCustomer"]}),providedIn:"root"})}}return e})(),Ke=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>b({facade:e,feature:W,methods:["getCustomerLists","getCustomerListsState","customerListCustomersSearch","getCustomerListCustomersSearchResults","getCustomerListCustomersSearchResultsLoading","customerListCustomersSearchReset","getCustomerListCustomersSearchResultsError"]}),providedIn:"root"})}}return e})(),Ge={FORBIDDEN:"forbidden"};h.ASM_CUSTOMER_LIST="ASM_CUSTOMER_LIST";h.ASM_BIND_CART="ASM_BIND_CART";h.ASM_SAVE_CART="ASM_SAVE_CART";h.ASM_SWITCH_CUSTOMER="ASM_SWITCH_CUSTOMER";h.ASM_CREATE_CUSTOMER_FORM="ASM_CREATE_CUSTOMER_FORM";var Ve=(()=>{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(R),s(O),s(ve))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{xe as a,Se as b,ve as c,m as d,z as e,me as f,ze as g,W as h,We as i,Be as j,Ke as k,Ge as l,Ve as m};

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.