var elc_ecomm;(()=>{"use strict";var e,r,t,i,n,s,o={"./src/service-setup/diContainer.ts":(e,r,t)=>{t.r(r),t.d(r,{diContainer:()=>u,getServiceBusController:()=>d,serviceNames:()=>l});const i=ElcRuntime.HypoContainer;class n{constructor(){this.uriEncodeParams=(e={})=>Object.keys(e).map((r=>[r,e[r]].map(encodeURIComponent).join("="))).join("&")}changeLocation(e,r={},t=!1){let i=this.uriEncodeParams(r);i=i&&`?${i}`;const n=`${e}${i}`;if(!t&&(0===e.indexOf("http")||0===e.indexOf("www")))return void window.location.assign(n);const s=`${location.origin}${n}`;window.location.assign(s)}}var s=t("@estee/elc-service-bus"),o=Object.defineProperty,a=Object.getOwnPropertyDescriptor;class c{constructor(e){this.ecommStore=e,this.changeLocation=e=>{return r=this,t=null,i=function*(){this.ecommStore.changeLocation(e.redirectUrl)},new Promise(((e,n)=>{var s=e=>{try{a(i.next(e))}catch(r){n(r)}},o=e=>{try{a(i.throw(e))}catch(r){n(r)}},a=r=>r.done?e(r.value):Promise.resolve(r.value).then(s,o);a((i=i.apply(r,t)).next())}));var r,t,i}}}((e,r,t,i)=>{for(var n,s=i>1?void 0:i?a(r,t):r,c=e.length-1;c>=0;c--)(n=e[c])&&(s=(i?n(r,t,s):n(s))||s);i&&s&&o(r,t,s)})([(0,s.on)(s.events.CHANGE_LOCATION)],c.prototype,"changeLocation",2);const l={serviceBusController:"SERVICE_BUS_CONTROLLER",ecommStore:"ECOMM_STORE"},u=new i.Container;u.register(l.ecommStore,(()=>new n)).register(l.serviceBusController,(e=>new c(e.get(l.ecommStore))));const d=()=>{u.get(l.serviceBusController)}},"./node_modules/odiff/odiff.js":e=>{e.exports=function(e,t){var i=[];return r(e,t,i,[]),i};var r=function(e,a,c,l){var u;if(!(e===a||Number.isNaN(e)&&Number.isNaN(a)))if(e instanceof Array&&a instanceof Array){for(var d=e.length-1,h=a.length-1;d>=0&&h>=0;)if(n(e[d],a[h]))d--,h--;else{for(var v=t(n,e,a,d,h,0,0),m=d,f=h;m>v.a&&f>v.b;)if(i(e[m],a[f]))r(e[m],a[f],c,l.concat([m])),m--,f--;else{var g=t(i,e,a,m,f,v.a+1,v.b+1),p=m-g.a,y=f-g.b;1===p&&1===y?S(c,l.concat(g.a+1),a[g.b+1]):1===p&&2===y?(k(c,l,g.a+2,a.slice(g.b+2,f+1)),S(c,l.concat(g.a+1),a[g.b+1])):2===p&&1===y?(O(c,l,g.a+2,1,e),S(c,l.concat(g.a+1),a[g.b+1])):2===p&&2===y?(S(c,l.concat(g.a+2),a[g.b+2]),S(c,l.concat(g.a+1),a[g.b+1])):(p>0&&O(c,l,g.a+1,p,e),y>0&&k(c,l,g.a+1,a.slice(g.b+1,f+1))),m=g.a,f=g.b}m>v.a?O(c,l,m,m-v.a,e):f>v.b&&k(c,l,m+1,a.slice(v.b+1,f+1)),d=v.a,h=v.b}d>=0?O(c,l,0,d+1,e):h>=0&&k(c,l,0,a.slice(0,h+1))}else if(e instanceof Date&&a instanceof Date)e.getTime()!==a.getTime()&&S(c,l,a);else if(e instanceof Object&&a instanceof Object){var b=o(s(Object.keys(e)),s(Object.keys(a)));for(var w in b){var _=l.concat([w]);w in e&&!(w in a)?(u=_,c.push({type:"unset",path:u})):r(e[w],a[w],c,_)}}else S(c,l,a);function S(e,r,t){e.push({type:"set",path:r,val:t})}function O(e,r,t,i,n){var s=t?t-i+1:0;e.push({type:"rm",path:r,index:s,num:i,vals:n.slice(s,s+i)})}function k(e,r,t,i){e.push({type:"add",path:r,index:t,vals:i})}};function t(e,r,t,i,n,s,o){for(var a=i-s,c=n-o,l=Math.max(a,c),u=1;u<=l;u++){var d=r[i-u],h=t[n-u];if(u<=c&&u<=a&&e(d,h))return{a:i-u,b:n-u};for(var v=0;v=2&&i>t||i===e.length)return!1;i++}return!0}if(e instanceof Object){if(!(r instanceof Object))return!1;var c=o(s(Object.keys(e)),s(Object.keys(r))),l=Object.keys(c).length;t=l/10,i=0;for(var u in c){if(!n(e[u],r[u])){if(i>=2&&i>t||i+1===l)return!1;i++}}return!0}return e===r||Number.isNaN(e)&&Number.isNaN(r)}function n(e,r){if(e instanceof Array){if(!(r instanceof Array))return!1;if(e.length!==r.length)return!1;for(var t=0;t{var i=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof elc_service_config_manager)return e();t.l("http://localhost:8000/fe-elc-service-config-manager/build/bundle.js",(t=>{if("undefined"!=typeof elc_service_config_manager)return e();var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;i.message="Loading script failed.\n("+n+": "+s+")",i.name="ScriptExternalLoadError",i.type=n,i.request=s,r(i)}),"elc_service_config_manager")})).then((()=>elc_service_config_manager))},"webpack/container/reference/elc_service_session_mgmt":(e,r,t)=>{var i=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof elc_service_session_mgmt)return e();t.l("http://localhost:8000/fe-elc-service-session-mgmt/build/bundle.js",(t=>{if("undefined"!=typeof elc_service_session_mgmt)return e();var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;i.message="Loading script failed.\n("+n+": "+s+")",i.name="ScriptExternalLoadError",i.type=n,i.request=s,r(i)}),"elc_service_session_mgmt")})).then((()=>elc_service_session_mgmt))},"webpack/container/reference/elc_service_translations":(e,r,t)=>{var i=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof elc_service_translations)return e();t.l("http://localhost:8000/fe-elc-service-translations/build/bundle.js",(t=>{if("undefined"!=typeof elc_service_translations)return e();var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;i.message="Loading script failed.\n("+n+": "+s+")",i.name="ScriptExternalLoadError",i.type=n,i.request=s,r(i)}),"elc_service_translations")})).then((()=>elc_service_translations))},"@estee/elc-service-bus":e=>{e.exports=ElcServiceBus}},a={};function c(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={exports:{}};return o[e](t,t.exports,c),t.exports}c.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(t,i){if(1&i&&(t=this(t)),8&i)return t;if("object"==typeof t&&t){if(4&i&&t.__esModule)return t;if(16&i&&"function"==typeof t.then)return t}var n=Object.create(null);c.r(n);var s={};e=e||[null,r({}),r([]),r(r)];for(var o=2&i&&t;"object"==typeof o&&!~e.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>t[e]));return s.default=()=>t,c.d(n,s),n},c.d=(e,r)=>{for(var t in r)c.o(r,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((r,t)=>(c.f[t](e,r),r)),[])),c.u=e=>e+"."+{webpack_container_remote_elc_service_translations_diContainer:"448e70459660338b2af4",webpack_container_remote_elc_service_config_manager_diContainer:"ee25f92161f53a35ec40",webpack_container_remote_elc_service_session_mgmt_diContainer:"aa5ae6a8722f9f061714"}[e]+".bundle.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},i="elc-ecomm:",c.l=(e,r,n,s)=>{if(t[e])t[e].push(r);else{var o,a;if(void 0!==n)for(var l=document.getElementsByTagName("script"),u=0;u{o.onerror=o.onload=null,clearTimeout(v);var n=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(i))),r)return r(i)},v=setTimeout(h.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=h.bind(null,o.onerror),o.onload=h.bind(null,o.onload),a&&document.head.appendChild(o)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n={webpack_container_remote_elc_service_translations_diContainer:["webpack/container/remote/elc_service_translations/diContainer"],webpack_container_remote_elc_service_config_manager_diContainer:["webpack/container/remote/elc_service_config_manager/diContainer"],webpack_container_remote_elc_service_session_mgmt_diContainer:["webpack/container/remote/elc_service_session_mgmt/diContainer"]},s={"webpack/container/remote/elc_service_translations/diContainer":["default","./diContainer","webpack/container/reference/elc_service_translations"],"webpack/container/remote/elc_service_config_manager/diContainer":["default","./diContainer","webpack/container/reference/elc_service_config_manager"],"webpack/container/remote/elc_service_session_mgmt/diContainer":["default","./diContainer","webpack/container/reference/elc_service_session_mgmt"]},c.f.remotes=(e,r)=>{c.o(n,e)&&n[e].forEach((e=>{var t=c.R;t||(t=[]);var i=s[e];if(!(t.indexOf(i)>=0)){if(t.push(i),i.p)return r.push(i.p);var n=r=>{r||(r=new Error("Container missing")),"string"==typeof r.message&&(r.message+='\nwhile loading "'+i[1]+'" from '+i[2]),c.m[e]=()=>{throw r},i.p=0},o=(e,t,s,o,a,c)=>{try{var l=e(t,s);if(!l||!l.then)return a(l,o,c);var u=l.then((e=>a(e,o)),n);if(!c)return u;r.push(i.p=u)}catch(d){n(d)}},a=(e,r,n)=>o(r.get,i[1],t,0,l,n),l=r=>{i.p=1,c.m[e]=e=>{e.exports=r()}};o(c,i[2],0,0,((e,r,t)=>e?o(c.I,i[0],0,e,a,t):n()),1)}}))},(()=>{c.S={};var e={},r={};c.I=(t,i)=>{i||(i=[]);var n=r[t];if(n||(n=r[t]={}),!(i.indexOf(n)>=0)){if(i.push(n),e[t])return e[t];c.o(c.S,t)||(c.S[t]={});c.S[t];var s=e=>{var r=e=>{return r="Initialization of sharing external failed: "+e,"undefined"!=typeof console&&console.warn&&console.warn(r);var r};try{var n=c(e);if(!n)return;var s=e=>e&&e.init&&e.init(c.S[t],i);if(n.then)return o.push(n.then(s,r));var a=s(n);if(a&&a.then)return o.push(a.catch(r))}catch(l){r(l)}},o=[];if("default"===t)s("webpack/container/reference/elc_service_translations"),s("webpack/container/reference/elc_service_config_manager"),s("webpack/container/reference/elc_service_session_mgmt");return o.length?e[t]=Promise.all(o).then((()=>e[t]=1)):e[t]=1}}})(),(()=>{var e;c.g.importScripts&&(e=c.g.location+"");var r=c.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={elc_ecomm:0};c.f.j=(r,t)=>{var i=c.o(e,r)?e[r]:void 0;if(0!==i)if(i)t.push(i[2]);else if("elc_ecomm"==r){var n=new Promise(((t,n)=>i=e[r]=[t,n]));t.push(i[2]=n);var s=c.p+c.u(r),o=new Error;c.l(s,(t=>{if(c.o(e,r)&&(0!==(i=e[r])&&(e[r]=void 0),i)){var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;o.message="Loading chunk "+r+" failed.\n("+n+": "+s+")",o.name="ChunkLoadError",o.type=n,o.request=s,i[1](o)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var i,n,[s,o,a]=t,l=0;if(s.some((r=>0!==e[r]))){for(i in o)c.o(o,i)&&(c.m[i]=o[i]);if(a)a(c)}for(r&&r(t);l{var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;"object"==typeof self&&(self.self,self);const i="undefined"==typeof window?c.g:window;var n;(e=>{function r(e){document.cookie=`${e}=; Max-Age=-99999999;`}function t(e,r,t){let i="";if(t){i=`; expires=${("number"==typeof t?new Date(Date.now()+24*t*60*60*1e3):t).toUTCString()}`}document.cookie=`${e}=${r||""}${i};path=/`}function i(e){const r=`${e}=`,t=document.cookie.split(";");for(let i=0;i{const i=n(e);t!==i&&(t=i,r(i))}),2e3)}})(n||(n={}));const s=(e,r="")=>{return t=(e=>(i.serviceInfo=i.serviceInfo||{},i.ServiceRegistry=i.ServiceRegistry||{},i.serviceInfo[e]||i.ServiceRegistry[e]))(e),t&&t.version||r;var t},o=ElcRuntime.ELCLogger;var a=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));i.ServiceRegistry=i.ServiceRegistry||{};const l=()=>a(void 0,null,(function*(){}));class u{constructor(e,r,t=null){this.name=e,this.version=r,this.serviceInitializer=t,this.isStarted=!1}static setViews(e,r,t,n){i.ServiceRegistry[e]={name:r,version:t,views:n,isStarted:!0}}initializeService(e){return a(this,null,(function*(){try{const r=this.serviceInitializer||l;yield r(e),this.isStarted=!0}catch(r){this.logger.error({message:`Could not start service ${this.name}`,triggerType:o.TriggerType.render,payload:{error:r,context:{serviceRegistry:i.ServiceRegistry}}})}finally{this.isStarted=!0}}))}start(e){return this.startPromise||this.isStarted||(this.logger=this.logger||new o.ELCLogger({serviceName:this.name,environment:e.env||i.env,buid:e.businessUnitId||i.buid,serviceVersion:this.version}),this.startPromise=this.initializeService(e)),this.startPromise}}var d=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));function h(){return i.ServiceRegistry||{}}function v(e){return e.isStarted}function m(e){return Boolean(e.isLazy)}function f(e){return Boolean(e.views)}function g(e){const r=Object.values(h()).find(function(e){return r=>f(r)?r.views.includes(e):r.getView(e)}(e));if(!r)throw new Error(`Service wasn't found for view ${e}`);return r}function p(e,r){return d(this,null,(function*(){return(yield i[e].get(`./${r}`))()}))}var y=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));class b{constructor(e,r={}){this.logger=e,this.appConfig=r,this.beforeEmit=(e,r,t)=>y(this,null,(function*(){yield this.maybeStartService("events")(e),t(e,r)})),this.beforeQuery=(e,r,t)=>y(this,null,(function*(){return yield this.maybeStartService("queries")(e),t(e,r)})),this.maybeStartService=e=>r=>y(this,null,(function*(){const t=Object.values(h()).find((t=>{if(m(t)&&!v(t)){return-1!==t[e].indexOf(r)}return!1}));if(t&&t.name){const i=`Starting ${t.name} service due to ${r} ${"queries"===e?"query":"event"}!`;this.logger.info({message:i,triggerType:o.TriggerType.render}),yield t.start(this.appConfig)}}))}load(){i.GlobalServiceBus.applyHook((()=>({beforeEmit:this.beforeEmit,beforeQuery:this.beforeQuery})))}}var w=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));class _{constructor(e,r){this.viewName=e,this.logger=r,this.federatedView=null,this.view=null,this.isServiceUpdated=!1,this.logError=(e,r)=>{this.logger.error({message:e,triggerType:o.TriggerType.render,payload:{error:r,context:{serviceRegistry:h()}}})},this.loadModule=e=>w(this,null,(function*(){const r=e.component.load||e.component;return(yield r()).default})),this.loadAndSaveModule=()=>w(this,null,(function*(){try{if(!this.view)throw new Error(`Load view before requesting module ${this.viewName}`);const e=this.service,r=yield this.loadModule(this.view);e.setViewInCache(this.viewName,r)}catch(e){this.logError(`Error with module: ${this.viewName}`,e)}})),this.getView=()=>{try{const e=this.service;this.view=e.getView(this.viewName)}catch(e){this.logError(`Error getting the view: ${this.viewName}`,e),this.view=null}},this.startNeededServices=()=>w(this,null,(function*(){this.isServiceUpdated||(yield i.ViewsManager.startLazyServices()),v(this.service)||(yield i.ViewsManager.startService(this.service))})),this.loadComponent=()=>w(this,null,(function*(){try{this.service&&(yield this.startNeededServices(),this.service.getView?(this.getView(),yield this.loadAndSaveModule()):this.federatedView=(yield p(this.service.name,this.viewName)).default)}catch(e){this.logError(`Error trying to load the component - ${this.viewName}`,e)}}));try{this.service=g(e),this.isServiceUpdated=f(this.service);const{lazyServicesStarted:r}=i.ViewsManager;v(this.service)&&(this.isServiceUpdated||!this.isServiceUpdated&&r)&&this.service.getView&&this.getView()}catch(t){this.logError(`ViewManager for view: (${e}) fail to initialize`,t)}}get module(){const e=this.service;return this.view&&e&&e.getViewFromCache?e.getViewFromCache(this.viewName):this.federatedView}get controllerFromView(){return this.view&&this.view.viewController&&this.view.viewController()||null}}var S=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));const O=["ecomm","translation","config","sign"];class k{constructor(e,r,t){this.servicesConfig=e,this.lazyServicesStarted=!1,this.views=new Map,this.isServiceExcluded=e=>{const r=e.toLowerCase();return O.some((e=>r.includes(e)))},this.getNonStartedServices=()=>{const e=Object.keys(h());return Object.values(h()).filter(((r,t)=>{let i=!1;const n=r&&r.name||e[t];try{i=!v(r)&&m(r)&&!this.isServiceExcluded(n)}catch(s){this.logger.error({message:`Fail filtering service - ${n}`,triggerType:o.TriggerType.render,payload:{error:s,context:{serviceRegistry:h(),service:r}}})}return i}))},this.logger=new o.ELCLogger({serviceName:r,serviceVersion:t,environment:i.env,buid:i.buid})}getViewManager(e){let r=this.views.get(e);return r||(r=new _(e,this.logger),this.views.set(e,r)),r}startService(e){return S(this,null,(function*(){const{GlobalServiceBus:r,ServiceBusTopics:t}=i;try{yield e.start(this.servicesConfig),r.emit(t.events.SERVICE_STARTED,{serviceName:e.name})}catch(n){this.logger.error({triggerType:o.TriggerType.render,message:`Error starting the service [${e.name}]`,payload:{error:n}})}}))}startLazyServices(){return S(this,null,(function*(){if(!this.lazyServicesStarted){const e=this.getNonStartedServices();for(const r of e)yield this.startService(r);this.lazyServicesStarted=!0}}))}}var C=c("@estee/elc-service-bus");class T{constructor(e){this.logger=e,this.emptyFunction=e=>(...r)=>{this.logger.warning({triggerType:o.TriggerType.other,message:`Function ${e} was not found on root.BOOMR`,payload:{context:{mPulse:i.BOOMR,arguments:JSON.stringify(r)}}})},this.sendMetric=(...e)=>{var r;return((null==(r=i.BOOMR)?void 0:r.sendMetric)||this.emptyFunction("sendMetric"))(...e)},this.sendMetrics=(...e)=>{var r;return((null==(r=i.BOOMR)?void 0:r.sendMetrics)||this.emptyFunction("sendMetrics"))(...e)},this.sendTimer=(...e)=>{var r;return((null==(r=i.BOOMR)?void 0:r.sendTimer)||this.emptyFunction("sendTimer"))(...e)},this.sendTimers=(...e)=>{var r;return((null==(r=i.BOOMR)?void 0:r.sendTimers)||this.emptyFunction("sendTimers"))(...e)}}}class E{constructor(e,r){this.startMark=e=>{try{performance.mark(`${this.serviceViewName}_${e}`)}catch(r){this.logger.error({message:`[${this.serviceViewName}]: ${r}`,triggerType:o.TriggerType.other,payload:{error:r}})}},this.endMark=e=>{try{if(performance.getEntriesByName(e)){const r=`${this.serviceViewName}_${e}`,t=`${r}_end`;performance.mark(t);const i=performance.measure(`${this.serviceViewName}_measure_${e}`,r,t);return this.logger.info({triggerType:o.TriggerType.other,message:`Performance measure between (${r}) and (${t})`,payload:{context:i?i.toJSON():"measurement API not available",serviceName:this.serviceViewName}}),this.clearMark(r),i}}catch(r){this.logger.warning({message:`[${this.serviceViewName}]: ${r}`,triggerType:o.TriggerType.other,payload:{error:r}})}},this.clearMark=e=>{performance.clearMarks(e),performance.clearMarks(`${e}_end`)},this.logger=e,this.serviceViewName=r}}const j=ElcRuntime.React;c("./node_modules/odiff/odiff.js"),Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;j.Component;var M=Object.defineProperty,x=Object.defineProperties,N=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,R=(e,r,t)=>r in e?M(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;const $=e=>{const r=r=>{const t=e[r];return"string"==typeof t?Number(t):t},t=r("sessionExpiredStartTime"),i=r("sessionExpiredTimeout"),n=r("costLimit"),s=r("maxQuantity"),o=r("threeInstallmentsLimit"),a=r("sixInstallmentsLimit"),c=e.defaultDomain;return l=((e,r)=>{for(var t in r||(r={}))L.call(r,t)&&R(e,t,r[t]);if(P)for(var t of P(r))I.call(r,t)&&R(e,t,r[t]);return e})({},e),x(l,N({sessionExpiredStartTime:t,sessionExpiredTimeout:i,costLimit:n,maxQuantity:s,threeInstallmentsLimit:o,sixInstallmentsLimit:a,baseUrl:c}));var l};var V=c("./src/service-setup/diContainer.ts"),A=Object.defineProperty,B=Object.defineProperties,z=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,U=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,F=Reflect.get,G=(e,r,t)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))D.call(r,t)&&G(e,t,r[t]);if(H)for(var t of H(r))q.call(r,t)&&G(e,t,r[t]);return e},J=(e,r)=>B(e,z(r)),W=(e,r,t)=>new Promise(((i,n)=>{var s=e=>{try{a(t.next(e))}catch(r){n(r)}},o=e=>{try{a(t.throw(e))}catch(r){n(r)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((t=t.apply(e,r)).next())}));const{name:K,version:X}={branchName:"release/3.6",commitHash:"c804413a0676e74341e74629afc8cbff70d092b1",version:"3.6.0",name:"elc-ecomm"};class Y extends u{constructor(e=V.getServiceBusController){super(K,X),this.onStartService=e,this.register=()=>{console.warn("This method has been deprecated.")},this.startWrapper=e=>W(this,null,(function*(){const r="ecomm_service_start";this.performanceMarker.startMark(r),i.env=i.env||e.env||"",i.buid=i.buid||e.businessUnitId||"";const t=yield this.initialize(e);yield this.onStartService(e),this.setupHttpTransport(t.defaultDomain,t.clientId),yield this.bootstrap(t),this.performanceMarker.endMark(r),yield this.initializeComponentRenderer()})),this.initialize=e=>W(this,null,(function*(){const r="ecomm_initialize";this.performanceMarker.startMark(r),i.GlobalServiceBus.applyHook(C.ServiceBusLogHook);const t=$(e);new b(this.logger,t).load(),i.ViewsManager=new k(t,K,X);const n=Array.from(document.querySelectorAll("script")).map((e=>e.src)).filter((e=>-1!==e.indexOf(t.cdnPath))).some((e=>e.split("@").length>1))?"@":"/";var a,c;return i.replaceSrc=i.replaceSrc||(e=>{const r=e.indexOf("elc-"),i=e.indexOf("pg-"),s=r>-1?r:i,o=e.slice(s),[a,c]=o.split("/"),l=t.services[a];return`${t.cdnPath}/${a}${n}${l}/${c}`}),i.onerror=(a=e.siteUrl,c=this.logger,(e,r,t,i,n)=>{const l={context:{siteUrl:a,url:r,line:t,column:i},error:n,serviceName:"",serviceVersion:""};try{const e=new URL(r).pathname.split("@"),t=(u=e[0]).includes("js-repo")?u.replace("/integration.js-repo/","").replace("/qa.js-repo/","").replace("/js-repo/",""):"drupal";l.serviceName=t,l.serviceVersion=s(t,e.length>1?e[1]:"")}catch(d){l.serviceName="unknown/external"}var u;return c.error({triggerType:o.TriggerType.runtimeError,payload:l,message:e}),!1}),this.performanceMarker.endMark(r),t})),this.setupHttpTransport=(e,r)=>{i.HttpTransport.setBaseUrl(e),i.HttpTransport.addGlobalHeaders({"Business-Unit":i.buid,ClientId:r||"stardust-fe-client"})},this.startMandatoryServices=e=>W(this,null,(function*(){try{const r="start_service_translations";this.performanceMarker.startMark(r),yield this.isTranslationsLoaded();const t=yield c.e("webpack_container_remote_elc_service_translations_diContainer").then(c.t.bind(c,"webpack/container/remote/elc_service_translations/diContainer",23));yield t.serviceStarter(e),this.performanceMarker.endMark(r);const i="start_service_config_manager";this.performanceMarker.startMark(i),yield this.isConfigManagerLoaded();const n=yield c.e("webpack_container_remote_elc_service_config_manager_diContainer").then(c.t.bind(c,"webpack/container/remote/elc_service_config_manager/diContainer",23));yield n.serviceStarter(e),this.performanceMarker.endMark(i)}catch(r){this.logger.error({triggerType:o.TriggerType.runtimeError,message:r.message})}})),this.initializeComponentRenderer=()=>W(this,null,(function*(){try{if(!(yield this.isComponentRendererLoaded()))throw new Error("Error loading ComponentRenderer");yield i.ComponentRenderer.init()}catch(e){this.logger.error({triggerType:o.TriggerType.render,message:e.message})}})),this.bootstrap=e=>W(this,null,(function*(){try{const r="start_session_mgmt";this.performanceMarker.startMark(r),yield this.isSessionMgmtLoaded();const t=yield c.e("webpack_container_remote_elc_service_session_mgmt_diContainer").then(c.t.bind(c,"webpack/container/remote/elc_service_session_mgmt/diContainer",23));yield t.serviceStarter(e),this.performanceMarker.endMark(r),yield this.startMandatoryServices(e),(0,C.emit)(C.events.ECOMM_STARTED);const i="start_services";this.performanceMarker.startMark(i),yield this.startServices(e),this.performanceMarker.endMark(i)}catch(r){this.logger.error({message:null==r?void 0:r.message,payload:{error:r},triggerType:o.TriggerType.render})}})),this.startServices=e=>W(this,null,(function*(){const r=Object.keys(i.ServiceRegistry).filter((e=>e!==this.name&&!i.ServiceRegistry[e].isLazy&&!i.ServiceRegistry[e].isStarted));for(const t of r){const r=i.ServiceRegistry&&i.ServiceRegistry[t];r&&!r.isStarted&&(yield r.start(e),(0,C.emit)(C.events.SERVICE_STARTED,{serviceName:t}))}})),this.isAssetLoaded=e=>{var r;return Boolean(null==(r=null==e?void 0:e.succeeded)?void 0:r.length)},this.isServiceBusLoaded=()=>this.checkIfAssetHasLoaded("service-bus",(()=>Boolean(i.GlobalServiceBus))),this.isTranslationsLoaded=()=>this.checkIfAssetHasLoaded("translations",(()=>!0)),this.isConfigManagerLoaded=()=>this.checkIfAssetHasLoaded("config-manager",(()=>!0)),this.isSessionMgmtLoaded=()=>this.checkIfAssetHasLoaded("session-mgmt",(()=>!0)),this.isComponentRendererLoaded=()=>this.checkIfAssetHasLoaded("component-renderer",(()=>Boolean(i.ComponentRenderer))),this.checkIfAssetHasLoaded=(e,r)=>{var t;const n=i.jsRepoAssets;if(!n)return r();const s=null==(t=Object.entries(n).find((([r])=>r.includes(e))))?void 0:t[1];return!!s&&(!!this.isAssetLoaded(s)||(()=>new Promise((e=>{const r=setInterval((()=>{var t;return this.isAssetLoaded(s)?(clearInterval(r),e(!0)):(n.maxRetries||3)===(null==(t=null==s?void 0:s.failed)?void 0:t.length)?(clearInterval(r),e(!1)):void 0}),50)}))))},this.initializeServiceVersions()}start(e){return W(this,null,(function*(){this.logger=new o.ELCLogger({serviceName:K,serviceVersion:X,environment:i.env||e.env,buid:i.buid||e.businessUnitId}),this.performanceMarker=new E(this.logger,K),i.mPulse=new T(this.logger);if(yield this.isServiceBusLoaded())return this.serviceInitializer=this.serviceInitializer||this.startWrapper,(r=Y.prototype,t=this,n="start",F(U(r),n,t)).call(this,e);var r,t,n;this.logger.error({triggerType:o.TriggerType.runtimeError,message:"Error loading ServiceBus chunks, can't start the rest of the services"})}))}initializeServiceVersions(){i.getServiceVersions=()=>{const e=i.serviceInfo,r=Object.keys(e).reduce(((r,t)=>J(Q({},r),{[t]:e[t].version})),{}),t=Object.keys(i.ServiceRegistry).reduce(((e,r)=>{const t=i.ServiceRegistry[r].version;return t?J(Q({},e),{[r]:t}):e}),{}),n=Q(Q({},t),r),s=Object.keys(n).reduce(((r,t)=>{const i=e[t]||{},s=i.branchName||"",o=i.commitHash||"";return J(Q({},r),{[t]:{version:n[t],branchName:s,commitHash:o}})}),{});console.table(s)}}}(n=>{const s=n,{name:o}=s,a=((i,n)=>{var s={};for(var o in i)r.call(i,o)&&n.indexOf(o)<0&&(s[o]=i[o]);if(null!=i&&e)for(var o of e(i))n.indexOf(o)<0&&t.call(i,o)&&(s[o]=i[o]);return s})(s,["name"]);i.serviceInfo=i.serviceInfo||{},i.serviceInfo[o]=a})({branchName:"release/3.6",commitHash:"c804413a0676e74341e74629afc8cbff70d092b1",version:"3.6.0",name:"elc-ecomm"});const{name:Z,version:ee}={branchName:"release/3.6",commitHash:"c804413a0676e74341e74629afc8cbff70d092b1",version:"3.6.0",name:"elc-ecomm"};Y.setViews(Z,Z.replace(/-/g,"_"),ee,[]),i.EcommApp=Y})(),l=v,u={"./diContainer":()=>Promise.resolve().then((()=>()=>c("./src/service-setup/diContainer.ts")))},d=(e,r)=>(c.R=r,r=c.o(u,e)?u[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),c.R=void 0,r),h=(e,r)=>{if(c.S){var t="default",i=c.S[t];if(i&&i!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return c.S[t]=e,c.I(t,r)}},c.d(l,{get:()=>d,init:()=>h}),elc_ecomm=v})(); //# sourceMappingURL=bundle.js.map