var gisAppLib= gisAppLib || {}; !function(e,o){var t={};o(t),e.bodyScrollLock=t}(gisAppLib,function(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=!1;if("undefined"!=typeof window){var e={get passive(){t=!0}};window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}function d(o){return s.some(function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(o))})}function l(e){var o=e||window.event;return!!d(o.target)||(1c)return!1;var d=a.indexOf(";",c+1);return d=0>d?a.length:d,a.slice(c+m,d)},setCookie:function(a){b.cookie=l+"="+a}};var o=a._LTracker,p=new d;if(o&&o.length){var q=0,r=o.length;for(q=0;r>q;q++)p.push(o[q])}a._LTracker=p,a.LogglyTracker=d}(window,document); //# sourceMappingURL=loggly.tracker-2.1.min.map var gisAppLib= gisAppLib || {}; !function(n,e){n.postRobot=e()}(gisAppLib,(function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(r,o,function(e){return n[e]}.bind(null,o));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return{}.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){"use strict";function r(n){return"[object RegExp]"==={}.toString.call(n)}t.r(e),t.d(e,"Promise",(function(){return A})),t.d(e,"TYPES",(function(){return Zn})),t.d(e,"ProxyWindow",(function(){return En})),t.d(e,"setup",(function(){return Kn})),t.d(e,"destroy",(function(){return Yn})),t.d(e,"serializeMessage",(function(){return Bn})),t.d(e,"deserializeMessage",(function(){return Jn})),t.d(e,"createProxyWindow",(function(){return Hn})),t.d(e,"toProxyWindow",(function(){return Un})),t.d(e,"on",(function(){return Ln})),t.d(e,"once",(function(){return qn})),t.d(e,"send",(function(){return Fn})),t.d(e,"markWindowKnown",(function(){return ln})),t.d(e,"cleanUpWindow",(function(){return $n})),t.d(e,"bridge",(function(){}));var o="Call was rejected by callee.\r\n";function i(n){return void 0===n&&(n=window),"about:"===n.location.protocol}function a(n){if(void 0===n&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function u(n){if(void 0===n&&(n=window),n&&!a(n))try{return n.opener}catch(n){}}function c(n){try{return!0}catch(n){}return!1}function s(n){void 0===n&&(n=window);var e=n.location;if(!e)throw new Error("Can not read window location");var t=e.protocol;if(!t)throw new Error("Can not read window protocol");if("file:"===t)return"file://";if("about:"===t){var r=a(n);return r&&c()?s(r):"about://"}var o=e.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function f(n){void 0===n&&(n=window);var e=s(n);return e&&n.mockDomain&&0===n.mockDomain.indexOf("mock:")?n.mockDomain:e}function d(n){if(!function(n){try{if(n===window)return!0}catch(n){}try{var e=Object.getOwnPropertyDescriptor(n,"location");if(e&&!1===e.enumerable)return!1}catch(n){}try{if(i(n)&&c())return!0}catch(n){}try{if(s(n)===s(window))return!0}catch(n){}return!1}(n))return!1;try{if(n===window)return!0;if(i(n)&&c())return!0;if(f(window)===f(n))return!0}catch(n){}return!1}function l(n){if(!d(n))throw new Error("Expected window to be same domain");return n}function h(n,e){if(!n||!e)return!1;var t=a(e);return t?t===n:-1!==function(n){var e=[];try{for(;n.parent!==n;)e.push(n.parent),n=n.parent}catch(n){}return e}(e).indexOf(n)}function w(n){var e,t,r=[];try{e=n.frames}catch(t){e=n}try{t=e.length}catch(n){}if(0===t)return r;if(t){for(var o=0;o>>0)+"__",function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,e={};return Object.freeze(e),n.set(e,"__testvalue__"),"__testvalue__"===n.get(e)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}var e=n.prototype;return e._cleanupClosedWindows=function(){for(var n=this.weakmap,e=this.keys,t=0;t=3)return"stringifyError stack overflow";try{if(!n)return"";if("string"==typeof n)return n;if(n instanceof Error){var t=n&&n.stack,r=n&&n.message;if(t&&r)return-1!==t.indexOf(r)?t:r+"\n"+t;if(t)return t;if(r)return r}return n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}catch(n){return"Error while stringifying error: "+H(n,e+1)}}function U(n){return"string"==typeof n?n:n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}function K(n){return"[object RegExp]"==={}.toString.call(n)}function Y(n,e,t){if(n.hasOwnProperty(e))return n[e];var r=t();return n[e]=r,r}function Z(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function $(){return Boolean(document.body)&&"complete"===document.readyState}function G(){return Boolean(document.body)&&"interactive"===document.readyState}F.clear=function(){q=L},F((function(n){if(Object.values)return Object.values(n);var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(n[t]);return e})),Error,F((function(){return new A((function(n){if($()||G())return n();var e=setInterval((function(){if($()||G())return clearInterval(e),n()}),10)}))}));var Q="undefined"!=typeof document?document.currentScript:null,V=F((function(){if(Q)return Q;if(Q=function(){try{var n=function(){try{throw new Error("_")}catch(n){return n.stack||""}}(),e=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),t=e&&e[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r { ... }":"<"+typeof n+">"})).join(", ")+") failed\n\n")+n.stack),n}))})).then((function(n){return{result:n,id:o,name:i}}))}))}));var c=t.__id__||M();n=En.unwrap(n);var s=t.__name__||t.name||r;return"string"==typeof s&&"function"==typeof s.indexOf&&0===s.indexOf("anonymous::")&&(s=s.replace("anonymous::",r+"::")),En.isProxyWindow(n)?(xn(c,t,s,n,e),n.awaitWindow().then((function(n){xn(c,t,s,n,e)}))):xn(c,t,s,n,e),pn("cross_domain_function",{id:c,name:s})}function kn(n,e,t,r){var o,i=r.on,a=r.send;return function(n,e){void 0===e&&(e=yn);var t=JSON.stringify(n,(function(n){var t=this[n];if(hn(this))return t;var r=wn(t);if(!r)return t;var o=e[r]||vn[r];return o?o(t,n):t}));return void 0===t?"undefined":t}(t,((o={}).promise=function(t,r){return function(n,e,t,r,o){return pn("cross_domain_zalgo_promise",{then:jn(n,e,(function(n,e){return t.then(n,e)}),r,{on:o.on,send:o.send})})}(n,e,t,r,{on:i,send:a})},o.function=function(t,r){return jn(n,e,t,r,{on:i,send:a})},o.object=function(n){return _(n)||En.isProxyWindow(n)?pn("cross_domain_window",En.serialize(n,{send:a})):n},o))}function On(n,e,t,r){var o,i=r.send;return function(n,e){if(void 0===e&&(e=_n),"undefined"!==n)return JSON.parse(n,(function(n,t){if(hn(this))return t;var r,o;if(hn(t)?(r=t.__type__,o=t.__val__):(r=wn(t),o=t),!r)return o;var i=e[r]||gn[r];return i?i(o,n):o}))}(t,((o={}).cross_domain_zalgo_promise=function(n){return function(n,e,t){return new A(t.then)}(0,0,n)},o.cross_domain_function=function(t){return function(n,e,t,r){var o=t.id,i=t.name,a=r.send,u=function(t){function r(){var u=arguments;return En.toProxyWindow(n,{send:a}).awaitWindow().then((function(n){var c=Sn(n,o);if(c&&c.val!==r)return c.val.apply({source:window,origin:f()},u);var s=[].slice.call(u);return t.fireAndForget?a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!0}):a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!1}).then((function(n){return n.data.result}))})).catch((function(n){throw n}))}return void 0===t&&(t={}),r.__name__=i,r.__origin__=e,r.__source__=n,r.__id__=o,r.origin=e,r},c=u();return c.fireAndForget=u({fireAndForget:!0}),c}(n,e,t,{send:i})},o.cross_domain_window=function(n){return En.deserialize(n,{send:i})},o))}var Pn={};function An(n,e,t,r){var o=r.on,i=r.send;return A.try((function(){var r=un().getOrSet(n,(function(){return{}}));return r.buffer=r.buffer||[],r.buffer.push(t),r.flush=r.flush||A.flush().then((function(){if(v(n))throw new Error("Window is closed");var t,a=kn(n,e,((t={}).__post_robot_10_0_44__=r.buffer||[],t),{on:o,send:i});delete r.buffer;for(var u=Object.keys(Pn),c=[],s=0;s=c.oneToOneEngagement.reshowDuration)&&c.oneToOneEngagement&&c.oneToOneEngagement.enabled&&function(e){if(autoPlayService.isAutoPlaySetup()||!e)return;autoPlayService.setupAutoplay(e,T,{playerInitialize:function(){t.hide()},playerClicked:function(){"replay_engagement"==e.autoPlayType?replayCtrl.playReplay(e):"call"==e.autoPlayType&&(autoPlayService.storeAutoPlayReshowTimestamp(e),callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.STANDARD}))},playerDismissed:function(){window.dispatchEvent(new GisCustomEvent("gisUIClosed")),t.show()},playerPlay:function(){("call"==e.autoPlayType||"replay_engagement"==e.autoPlayType&&e.config.announcementChannel.enabled)&&autoPlayService.storeAutoPlayReshowTimestamp(e)}})}(function(e){var n=c.oneToOneEngagement,t=stateService.getOneToOneAutoPlay();{if(n.src.serviceIntro&&t&&t.config.ctaAutoPlay.enabled&&(!v(t)||p(t)))return t;if(n.src.replay&&e)return e.autoPlayType="replay_engagement",e}return null}(e))}function f(n){t.setMode('replay',n,c.persistentCta,!1),I(function(){var e=deviceInfoService.isMobileDevice()?A.ctaSize:'Large';eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.BROADCAST_REPLAY_CTA_CLICK,{ctaSize:e}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_REPLAY_CTA_CLICK,{ctaSize:e}),n.config.announcementChannel.enabled&&autoPlayService.storeAutoPlayReshowTimestamp(n),replayCtrl.playReplay(n)}),n.config.ctaAutoPlay.enabled&&(autoPlayService.isAutoPlaySetup()||autoPlayService.setupAutoplay(n,T,{playerInitialize:function(){t.hide()},playerClicked:function(){replayCtrl.playReplay(n)},playerDismissed:function(){window.dispatchEvent(new GisCustomEvent("gisUIClosed")),t.show()},playerPlay:function(){n.config.announcementChannel.enabled&&autoPlayService.storeAutoPlayReshowTimestamp(n)}}))}function v(e){var n=clientStorageService.getItem(clientStorageService.storageKeys.VIDEO_VIEWED);return n&&n[e.id]}function p(e){var n=e.config,t=clientStorageService.getItem(clientStorageService.storageKeys.VIDEO_VIEWED);return t&&t[e.id]&&n.announcementChannel.reshow.enabled&&utilitiesService.dateDifferenceInDays(Date.parse(t[e.id]),new Date)>=n.announcementChannel.reshow.reshowDuration}return t="tab"===e?ctaTabDOMProc:ctaRoundelDOMProc,{init:function(){window.addEventListener("gisUIClosed",function(e){stateService.setUIActive(!1),!pollingService.isPollingTimeExpiredForEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING)&&c.persistentCta&&(pollingService.subscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,GISAPP.Sym_Sys.clerkIsAvailable,GISAPP.Sym_Sys.clerkIsNotAvailable),pollingService.startPollingEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING)),e.detail&&e.detail.action===GIS_CONSTANTS.ACTIONS.BROADCAST_SCREEN_CLOSED?gisService.getBroadcasts(null,"broadcastCallback"):n()}),window.addEventListener("gisUIOpen",function(e){stateService.setUIActive(!0),d(),autoPlayService.destroyAutoPlay()})},updateCTA:n,showCTA:_,hideCTA:d,setOnClick:I}};GISAPP.broadcastCtrl=function(callCtrl,serverInjectionService,activityLoggerService,gaService,browserInfoService,deviceInfoService,stateService,eventLoggerService,retailerFunctionalityCtrl,hlsCtrl,chatInputDOMProc,broadcastDOMProc,callUserService,pageUnloadService,utilitiesService,gisService,emailSubmitComponent,preCallScreen,uiUtilitiesService,modalComponent,modalContentComponent,clientStorageService,buttonComponent,contactCaptureCtrl,GIS_CONSTANTS,pollingService,gisPlayerScreen,shopStreamService,urlUtilitiesService,callService){'use strict';var e,a,o,n,i,l,s,A,r,E,S,T,u={},c={},C={NAVIGATE:"navigate"},I=!1,_=!1,t="AVAILABLE",d="UNAVAILABLE",N="NONE",O=N,L=0,D=!1,g=!1,B=!1,f=!1;function R(e,t,n){pollingService.registerPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING,{poll:gisService.getBroadcastsEvent,pollArguments:[utilitiesService.utf8ToBase64(t),null,"broadcastCallback"],pollWithOnSuccessAndFailure:!1,interval:n||null}),pollingService.subscribe(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING,function(){},function(){}),pollingService.startPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING),D=!0}function V(){pollingService.stopPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING),pollingService.events.scheduledBroadcastPolling=null,D=!1}function m(){u.broadcastContactCaptureData={broadcastId:c.id,viewDuration:W()||0},gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_DURATION,{duration:W()})}function p(){serverInjectionService.getSystemConfig().oneToOneCta.broadcast&&i.config.oneToOneInBroadcast&&(pollingService.subscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,v,P),pollingService.startPollingEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING))}function v(){if(O!==t){O=t;var e=serverInjectionService.getSystemConfig();stateService.setClerkAvailability(!0),b(e.persistentCta,!0)}}function P(){if(O!==d){O=d;var e=serverInjectionService.getSystemConfig();stateService.setClerkAvailability(!1),b(e.persistentCta,!1)}}function b(e,t){broadcastDOMProc.setOneToOneCtaOnBroadcast(e,t);var n=(performance.now()-window.gisProfilingStartTime).toFixed(3);t?(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST,{timeElapsed:n}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST)):!t&&e&&(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST_UNAVAILABLE,{timeElapsed:n}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST_UNAVAILABLE)),function(t){if(!t||'function'!=typeof t)return;broadcastDOMProc.setOnCtaClickEvent(function(e){t(e)})}(function(e){callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.STANDARD},e),t?(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_CLICK_FROM_BROADCAST,{channelId:i.channelId}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_CLICK_FROM_BROADCAST)):(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_CLICK_UNAVAILABLE_ON_BROADCAST,{channelId:i.channelId}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_CLICK_UNAVAILABLE_ON_BROADCAST)),_||callService.isRedirectJourney()?stateService.setCallUUID(null):broadcastDOMProc.hide()})}function U(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_USER_DURATION,{viewDuration:W(),callUUID:y(),broadcastId:i.id,shopStreamType:"broadcast",channelId:i.channelId})}function G(){e?broadcastDOMProc.stopVideo():(hlsCtrl.destroy(),c=null)}function y(){return c&&c.callUUID?c.callUUID:""}function w(){utilitiesService.supportsHLS()&&!utilitiesService.supportsMediaSource()?(broadcastDOMProc.getVideoElement().src=c.urls[0],H()):(hlsCtrl.registerOnManifestParsed(H),hlsCtrl.registerOnErrorFunction(Y),hlsCtrl.loadHls(Q))}function h(){var e=(new Date).getTime();L+=e-s}function W(){return((new Date).getTime()-l-L)/1e3}function K(e){var t=serverInjectionService.getSystemConfig();if(stateService.setCurrentPhase(stateService.phase.BROADCAST_END),I||h(),m(),pageUnloadService.unregisterFunction(K),a=0,G(),chatInputDOMProc.dispose(),stateService.setCallStartTime(0),o&&o(),stateService.setCurrentPhase(stateService.phase.READY),t&&t.captureInfo&&t.captureInfo.views&&!0===t.captureInfo.views.broadcast&&"object"==typeof e&&"click"===e.type&&1<=u.broadcastContactCaptureData.viewDuration){var n=clientStorageService.getItem(clientStorageService.storageKeys.BROADCAST_CONTACT_CAPTURE)||{};n&&!n[u.broadcastContactCaptureData.broadcastId]&&contactCaptureCtrl.init("broadcast",u.broadcastContactCaptureData)}stateService.setCallUUID(null),O=N,t.oneToOneCta.broadcast&&i.config.oneToOneInBroadcast&&pollingService.unSubscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,v,P),pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),U(),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_ACTIONS.CLOSED,{url:urlUtilitiesService.getUrlWithoutParamsWithLimit(500),broadcastId:i.id,callUUID:stateService.getCallUUID()}),L=0,s=l=null,I=!1,deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement()}function H(){deviceInfoService.isMobileDevice()?broadcastDOMProc.setOnClickPlay(M):M()}function M(){stateService.setCallStartTime((new Date).getTime()),broadcastDOMProc.playVideo(),stateService.setCurrentPhase(stateService.phase.BROADCAST_PLAYING)}function k(){s=(new Date).getTime(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PAUSE_BUTTON_CLICKED,{callUUID:y(),shopStreamType:"broadcast",videoPauseTime:broadcastDOMProc.getVideoElement().currentTime}),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement(),I=!1}function Y(e){e.type===Hls.ErrorTypes.NETWORK_ERROR?F():e.fatal&&pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING)}function F(){c?gisService.isBroadcastActiveByBroadcastId(c.id,"GISAPP.broadcastCtrl.broadcastHasEnded",function(){broadcastDOMProc.hide()}):broadcastDOMProc.hide()}function Q(e){e&&hlsCtrl.playUrl(broadcastDOMProc.getVideoElement(),c.urls[0])}function X(){a=(new Date).getTime(),l||(l=a),s&&h(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PLAY_BUTTON_CLICKED,{callUUID:y(),shopStreamType:"broadcast",videoPlayTime:broadcastDOMProc.getVideoElement().currentTime,channelId:i.channelId}),I||(I=!0,pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.setIntervalOnVideoElement(F))}return shopStreamService.isShopStreamEnabled()&&(broadcastDOMProc=new gisPlayerScreen({onPlay:X,onPause:k})),broadcastDOMProc.onVideoPlay(X),broadcastDOMProc.onVideoPause(k),{playBroadcast:function(e,t){return stateService.setCurrentPhase(stateService.phase.BROADCAST_START),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),D&&V(),g&&(g=!1),c&&G(),e?(i=c=e,t&&(o=t),stateService.setCallUUID(y()),!shopStreamService.isChatTypeQuestion(c)&&shopStreamService.isShopStreamEnabled()||callUserService.add(c.type),function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_ACTIONS.SHOWN,{url:urlUtilitiesService.getUrlWithoutParamsWithLimit(500),broadcastId:i.id,callUUID:stateService.getCallUUID()});var e=serverInjectionService.getSystemConfig().oneToOneCta.broadcast&&i.config.oneToOneInBroadcast;shopStreamService.isShopStreamEnabled()?broadcastDOMProc.show(e,i):broadcastDOMProc.show(),broadcastDOMProc.setOnClickClose(K),function(){var e=serverInjectionService.getSystemConfig(),t=e.goToShopBtn;t&&t.url&&broadcastDOMProc.setOnClickShop(function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK+eventLoggerService.GIS_ACTIONS.CLICKED,{url:t.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK_CLICK,{url:t.url}),window.open(t.url,t.redirect===C.NAVIGATE?'_self':'_blank')});var n=e.specificPageBtn;n&&n.url&&broadcastDOMProc.setOnClickSpecificShop(function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:n.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK2_CLICK,{url:n.url}),window.open(n.url,n.redirect===C.NAVIGATE?'_self':'_blank')}),broadcastDOMProc.setOnClickRetailerCustomButton(function(){activityLoggerService.logBroadcastLink2Click("RetailerCustomButton"),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:"RetailerCustomButton"}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK2_CLICK,{url:"RetailerCustomButton"})});var a=c.config?c.config:null;a&&a.button1&&broadcastDOMProc.setupExtraButton(1,a.button1.label,function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.EXTRABTN1+eventLoggerService.GIS_ACTIONS.CLICKED,{url:a.button1.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_EXTRABTN1_CLICK,{url:a.button1.url}),window.open(a.button1.url,a.button1.redirect===C.NAVIGATE?'_self':'_blank')}),a&&a.button2&&broadcastDOMProc.setupExtraButton(2,a.button2.label,function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.EXTRABTN2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:a.button2.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_EXTRABTN2_CLICK,{url:a.button2.url}),window.open(a.button2.url,a.button2.redirect===C.NAVIGATE?'_self':'_blank')})}(),p(),i&&1==i.status&&w()}(),pageUnloadService.registerFunction(K),pollingService.registerPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING,{poll:U,pollArguments:[]},!0),pollingService.subscribe(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING,function(){},function(){}),0):-1},startDirectLinkBroadcast:function(){var e=utilitiesService.getUrlParamsLowerCase()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM],t=utilitiesService.getUrlParamsLowerCase()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM],n=e||t;if(utilitiesService.isEncodedUri(n)&&(n=decodeURIComponent(n)),null!=n||""!=n)if(e)gisService.getBroadcasts(utilitiesService.utf8ToBase64(n),"broadcastCallback");else if(t){var a=utilitiesService.getUrlParamsLowerCase().giskey;utilitiesService.isEncodedUri(a)&&(a=decodeURIComponent(a)),gisService.getBroadcastsEvent(utilitiesService.utf8ToBase64(n),a?utilitiesService.utf8ToBase64(a):null,"broadcastCallback")}},broadcastHasEnded:function(e){e||(hlsCtrl.destroy(),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement(),broadcastDOMProc.broadcastEnded(),'function'==typeof n&&n())},setupEmbedBroadcast:function(e,t){if(pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),_=!0,c&&G(),!e)return-1;i=c=e,t&&(n=t),stateService.setCallUUID(y()),callUserService.add(e.type),p(),w(),pageUnloadService.registerFunction(m)},getBroadcastView:function(){var e=broadcastDOMProc.getView();return uiUtilitiesService.removeClass(e,'gis-modal-wrap'),e},pauseVideo:function(){broadcastDOMProc.pauseVideo()},playVideo:function(){broadcastDOMProc.playVideo()},toggleMute:function(){broadcastDOMProc.toggleMute()},showNoBroadcastView:function(e){var t,n,a=utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM];shopStreamService.isShopStreamEnabled()&&a&&e&&e.broadcastEventHoldTimeStamp&&(n=a,(t=e).status===GIS_CONSTANTS.BROADCAST_STATUS.BROADCAST_CREATED?(A&&A.getTime()!==new Date(t.broadcastEventHoldTimeStamp).getTime()&&(broadcastDOMProc.updateTimeOnHoldingScreen(new Date(t.broadcastEventHoldTimeStamp)),clearTimeout(r),V()),A=new Date(t.broadcastEventHoldTimeStamp),function e(t,n){if(i=new Date,(E=new Date(A)).setMinutes(A.getMinutes()-10),i.getTime()=E.getTime()&&o.getTime()<=S.getTime()){if(D&&B)return;R(0,n),f=!(B=!0)}else if(a=new Date,(T=new Date(A)).setMinutes(A.getMinutes()+25),a.getTime()>=S.getTime()&&a.getTime()<=T.getTime()){if(D&&f)return;D&&B&&V(),R(0,n,3e4),f=!(B=!1)}else(new Date).getTime()>T.getTime()&&D&&(V(),clearTimeout(r),f=B=!1);var a,o,i}(t,n)):t.status===GIS_CONSTANTS.BROADCAST_STATUS.BROADCAST_ENDED&&D&&V()),g||(stateService.setCurrentPhase(stateService.phase.NO_BROADCAST_AVAILABLE),g=!0,i=e,broadcastDOMProc.show(!1,i))}}};GISAPP.callCtrl=function(logService,serverInjectionService,stateService,mediaService,browserInfoService,activityLoggerService,systemInfoService,uiUtilitiesService,gisService,otService,callUserService,gaService,pageUnloadService,utilitiesService,callDOMProc,preCallScreen,surveyScreen,modalComponent,eventLoggerService,overrideService,callService,GIS_CONSTANTS,bookingService,callScreen,streamService,chatLogoutService,addToCartService,addAPersonService,clientStorageService){'use strict';var o,e,i,n,t={},d="callCtrl",E=!1,A=serverInjectionService.getSystemConfig().skipMicShare,a=serverInjectionService.getSystemConfig().isNewCallScreen||serverInjectionService.getSystemConfig().oneToOne.isShopStreamCall.enabled,s=0,l=0,C=!0,c=function(e,t,i){};t.addProductToBasket=c;var r,T,S,I,_,g,L,otSession,otPublisher,u=null,N=!1,D=browserInfoService.isChrome()?'https://support.google.com/chrome/answer/2693767?hl=en':'https://support.mozilla.org/en-US/questions/1168156',h=GIS_CONSTANTS.CALL_STATUS.NOT_CONNECTED,y=[],v=!1,O=!1,M=!1,V=!1,f=!1,m=!1,p=!1,R=0,P=0,Y=!0,b={},U=!1,w={mic:{isMute:A,onClick:Le},speaker:{isMute:E,onClick:ue},cameraToggle:{isMute:Y,onClick:Me,isEnabled:serverInjectionService.getSystemConfig().oneToOne.twoWayVideo.enabled},cameraSwitch:{isMute:!1,onClick:Ve},onLeaveButtonClick:H};function k(e,t){if(window.dispatchEvent(new GisCustomEvent("gisCallInitiated")),stateService.getCurrentPhase()===stateService.phase.READY||stateService.getCurrentPhase()===stateService.phase.EMBED_CALL_INITIATED){stateService.getCanceledOnConnectingScreen()&&stateService.setCallInitiatedWhileCanceling(!0),stateService.setCurrentPhase(stateService.phase.CALL_INITIATING),ie();var i=e&&"string"==typeof e?e:stateService.getRoutingKey();stateService.setActiveCallRoutingKey(i),T=utilitiesService.isDirectCall()?GIS_CONSTANTS.CALL_TYPES.DIRECT:GIS_CONSTANTS.CALL_TYPES.STANDARD,gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_MADE,{CallType:T}),systemInfoService.requiresSSLCall()?gisService.getSecurityToken("gisCallbacks.onSecurityTokenReceived"):(utilitiesService.isMeeting()?gisService.initiateMeetingCall("gisCallbacks.onCallInitiation",T,n):addAPersonService.isAddAPersonCall()?W(t.data):gisService.initiateCall("gisCallbacks.onCallInitiation",T),r&&clearTimeout(r),r=setTimeout(Ne,4e4))}else logService.warn(d,"Tried to initiate call procedure when phase is "+stateService.getCurrentPhase())}function G(){r&&clearTimeout(r),uiUtilitiesService.redirectToHttp(),stateService.setCallUUID(""),stateService.setActiveCallRoutingKey(""),h=GIS_CONSTANTS.CALL_STATUS.NOT_CONNECTED,ve(),"function"==typeof _&&_()}function W(t){logService.debug(d,"Call initiation received",stateService.getCallUUID());try{if(stateService.getCallUUID()||stateService.getCurrentPhase()!==stateService.phase.CALL_INITIATING)return void logService.warn(d,"Received call initiation but call has already been initiated or has been canceled");stateService.setCurrentPhase(stateService.phase.CALL_INITIATED),t.callUUID&&stateService.setCallUUID(t.callUUID),t.sessionId&&stateService.setSessionId(t.sessionId),t.token&&stateService.setToken(t.token),t.sessionId&&t.sessionId,t.apiKey&&(e=t.apiKey),t.surveyId&&(i=t.surveyId),t.apiKey&&stateService.setTokBoxApiKey(e),clearTimeout(r),r=null,callUserService.add("call"),ne()}catch(e){logService.error(d,"Exception on server callback, onCallInitiation.",e,{callId:t.callUUID})}}function B(e,t,i,n,o,a,s,l,C,c){C&&'string'==typeof C&&(C=JSON.parse(C));try{if(ye(t))return;callDOMProc.setupClerkProfile(n,o),gisService.getSurveyQuestions(a),logService.log(d,"Session Connected"),h=GIS_CONSTANTS.CALL_STATUS.CONNECTED,stateService.setCurrentPhase(stateService.phase.IN_CALL),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ACCEPTED),utilitiesService.isDirectCall()?gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.DIRECT_CALL):gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.STANDARD_CALL),u=new Date,c||(g.hide(!0),callDOMProc.show({isMicSetupRequired:serverInjectionService.getSystemConfig().skipMicShare,isBookingCall:utilitiesService.isMeeting(),isArchivingEnabled:U})),callDOMProc.changeMicIcon(A),callDOMProc.changeSpeakerIcon(E),(utilitiesService.isMeeting()&&bookingService.isTwoWayVideoCallEnabled()||!utilitiesService.isMeeting()&&callService.isTwoWayVideoCall()&&b.video.isAllowed)&&(callDOMProc.setOnCameraSwitch(Ve),callDOMProc.setOnCamClick(Me),callDOMProc.changeCamIcon(Y)),callDOMProc.hideMicShareOverlay(),activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_UI_LOADED);var r={routingKey:stateService.getRoutingKey()};C&&(r.routing=C),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.CALL+eventLoggerService.GIS_ACTIONS.SHOWN,r),callDOMProc.displayControls(),serverInjectionService.getSystemConfig().skipMicShare&&setTimeout(function(){otPublisher.getPublisher()||se()},3e3),callDOMProc.setOnMicClick(Le),callDOMProc.setOnSpeakerClick(ue),callDOMProc.setOnEndCallClick(H),callDOMProc.setOnHelpUnblockClick(function(){window.open(D,'_blank')}),Te()}catch(e){logService.error(d,"Exception on server callback, postConnect.",e)}}function H(){m=!0,utilitiesService.isMeeting()&&activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.BOOKING_CUSTOMER_LEFT),stateService.setCurrentPhase(stateService.phase.CALL_END),h===GIS_CONSTANTS.CALL_STATUS.CONNECTED&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_DISCONNECTED_BY_CONSUMER),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ENDED,{CallEndReason:GIS_CONSTANTS.CALL_END_REASONS.CONSUMER})),h===GIS_CONSTANTS.CALL_STATUS.CONNECTING&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_CONNECTING_CANCELLED),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CONNECTING_CANCELLED)),Oe(),callDOMProc.destroyEventListeners()}callDOMProc=a?new callScreen(w):callDOMProc,pageUnloadService.registerFunction(function(){switch(h){case GIS_CONSTANTS.CALL_STATUS.CONNECTING:setTimeout(function(){activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_ABORT_BY_CONSUMER),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ABORTED)},0);break;case GIS_CONSTANTS.CALL_STATUS.CONNECTED:setTimeout(function(){activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_ENDPOINTS.CALL_FINISHED_PAGE_UNLOAD),stateService.getChatInitialized()&&chatLogoutService.logout()},0)}}),window.addEventListener("orientationchange",function(){otPublisher.getPublisher()&&setTimeout(function(){callDOMProc.changeVideoDimension(callDOMProc.getMainVideoStreamId())},2e3)},!1),overrideService.override(d,t),t.addProductToBasket!==c&&addToCartService.overrideATC(t.addProductToBasket);var K=function(e){h!==GIS_CONSTANTS.CALL_STATUS.CONNECTING||f||(f=!0,utilitiesService.isMeeting()||addAPersonService.isAddAPersonCall()?B(0,stateService.getCallUUID(),0,null,null,i,0,0,null,!0):gisService.connectCall(stateService.getCallUUID(),stateService.getRoutingKey(),o,stateService.getPageMetadata()),window.dispatchEvent(new GisCustomEvent("gisCallConnecting")),g.getChild().setConnecting(N))},F=function(e){"CONSUMER"===JSON.parse(e.stream.connection.data).userType&&stateService.addStreamToConsumerMap(e.stream.connection.id),'camera'===e.stream.videoType&&l++,s++,e&&e.stream&&(e.stream.connection&&(otService.log('streamCreated - connectionId: '+e.stream.connection.connectionId),otService.log('streamCreated - connectionData: '+e.stream.connection.data)),function(e){if(e.connection.connectionId===otSession.getConnection().connectionId)return;var t=callDOMProc.addStream(e),otSubscriber=otSession.subscribe(e,t.id,{showControls:!1,width:"100%",height:"100%"});otSubscriber.setVideoDisableWarningHandler(function(){callDOMProc.showPoorConnectionMessage()}),otSubscriber.setVideoDisableWarningLiftedHandler(function(){callDOMProc.hidePoorConnectionMessage()}),otSubscriber.setVideoDisabledHandler(function(e){'quality'===e.reason&&callDOMProc.showVideoDisabledMessage()}),otSubscriber.setVideoEnabledHandler(function(){callDOMProc.hideVideoDisabledMessage()}),E?otSubscriber.setAudioVolume(0):otSubscriber.setAudioVolume(100);callDOMProc.changeVideoDimension(e.streamId)}(e.stream)),O||(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_CLERK_STREAM_RECEIVED),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CLERK_STREAM_RECEIVED),O=!0,v&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_ENDPOINTS.CALL_STARTED),De())),callDOMProc.hideCallStatusDialog(),(utilitiesService.isMeeting()&&bookingService.isTwoWayVideoCallEnabled()||!utilitiesService.isMeeting()&&callService.isTwoWayVideoCall())&&callDOMProc.setupTapToFocus(),callDOMProc.hideCallController(),callDOMProc.setCallControllerAnimation(),callDOMProc.updateConnectionCount(l),he(e.stream)},J=function(e){"CONSUMER"===JSON.parse(e.stream.connection.data).userType&&stateService.removeStreamFromConsumerMap(e.stream.connection.id),1<=s&&(callDOMProc.removeVideoWhenClerkLeave(e.stream.id),callDOMProc.changeVideoDimension(callDOMProc.getMainVideoStreamId())),'camera'===e.stream.videoType&&l--,s--,callDOMProc.updateConnectionCount(l)},x=function(e){"hasVideo"===e.changedProperty&&(1Waiting for the host to start call.";var i=document.createElement('div');i.innerHTML="
Please Wait...",i.id='loading-gis-v3-button',i.className='loading-gis-v3-button',i.style.display='flex';var l=document.getElementById('gis-v3-button');l.classList.add('gis-hideAll'),l.classList.add('gis-v3-dc-btn'),e.parentNode.insertBefore(i,e.nextSibling),e.parentNode.insertBefore(t,e.nextSibling)}}return{init:function(){c()},clerkIsNotAvailable:function(e){try{var t="";if(e&&(t=e.code),t==r)return clearTimeout(i),void callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.DIRECT,isInvalidUrl:!0});if(t==a)return eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_USER_BLOCKED,{referrer:document.referrer||""}),void clearTimeout(i);'true'===serverInjectionService.isAutoStartDirectCallEnabled()?(o||d(),s()):(o||d(),s(),i=setTimeout(c,3e3))}catch(e){n.error(l,"Exception while processing directCall clerkIsNotAvailable Response.",e)}},clerkIsAvailable:function(){o||d();try{'true'!==serverInjectionService.isAutoStartDirectCallEnabled()||utilitiesService.isHttpsPageRedirected()?(function(){if(null!==document.getElementById("loading-gis-v3-button")){var e=document.getElementById('loading-gis-v3-button');e.remove()}if(null!==document.getElementById("loading-gis-v3-wait-text")){var t=document.getElementById('loading-gis-v3-wait-text');t.remove()}if(null==document.getElementById("gis-v3-button'")){var i=document.getElementById('gis-v3-button');i.classList.add('gis-v3-dc-btn'),i.classList.remove('gis-hideAll')}}(),i=setTimeout(c,3e3)):callCtrl.initiateCallProcedure()}catch(e){n.error(l,"Exception on directCall server callback, clerkIsAvailable.",e)}}}};GISAPP.embedCtrl=function(broadcastCtrl,chatInputDOMProc,stateService,overrideService,uiUtilitiesService,globalObjectService,pollingService){var a,s,n,e={},i=!1;e.LOGTAG='embedCtrl';var t="";function d(){globalObjectService.getWindow().dispatchEvent(new GisCustomEvent('GisBroadcastEnded',{detail:{broadcastView:s,chatView:n}}))}return e.init=function(){pollingService.subscribe(pollingService.BASE_EVENTS.BROADCAST_POLLING,function(){},function(){}),pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),s=broadcastCtrl.getBroadcastView(),n=chatInputDOMProc.render(),uiUtilitiesService.addClass(s.querySelector('#gis-broadcast-video'),'gis-embed'),uiUtilitiesService.addClass(s.querySelector('.gis-modal-content.broadcast-video'),'gis-embed'),uiUtilitiesService.addClass(s,'gis-embed'),uiUtilitiesService.addClass(n,'gis-embed'),globalObjectService.getWindow().addEventListener("gisUIClosed",function(e){stateService.setUIActive(!1),stateService.getCurrentPhase()!==stateService.phase.IN_CALL&&stateService.getCurrentPhase()!==stateService.phase.CALL_END&&(stateService.setCallUUID(a.callUUID),stateService.setCurrentPhase(t)),broadcastCtrl.playVideo()}),globalObjectService.getWindow().addEventListener("gisUIOpen",function(e){stateService.setUIActive(!0),broadcastCtrl.pauseVideo(),stateService.getCurrentPhase()!==stateService.phase.IN_CALL&&stateService.getCurrentPhase()!==stateService.phase.CALL_END&&(stateService.setCallUUID(null),t=stateService.getCurrentPhase(),stateService.setCurrentPhase(stateService.phase.EMBED_CALL_INITIATED))})},e._isEmbed=function(){return!1},overrideService.override(e.LOGTAG,e),{init:e.init,isEmbed:e._isEmbed,startBroadcast:function(e){var t=e.broadcasts;0!==t.length&&(a=function(e){for(var t=0;t ',onclick:function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()?D('carousel','carousel'):T.showLeftBottomContainer(),l.updateControlType("normal"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_OPENED)},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()||T.hideLeftBottomContainer(),l.updateControlType("compact"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_HIDDEN)},stateTransition:"on"}},order:20,defaultState:"off"}}),d=u.render(),l.addSideControls(d));var e;(utilitiesService.isMeeting()&&(bookingService.isMultiParticipantEnabled()||bookingService.isAddAPersonEnabled())||!utilitiesService.isMeeting()&&callService.isAddAPersonEnabled())&&(e=new controlButtonComponent({config:{states:{on:{image:'',onclick:function(){var e=new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA,payload:{type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA_TYPES.ADD_A_PERSON},popUpContainer:c.querySelector('#gis-ss-player-popup'),isMultiParty:utilitiesService.isMeeting()&&bookingService.isMultiParticipantEnabled(),isOneToOneCall:!utilitiesService.isMeeting()});e.render(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.ADD_A_PERSON_BUTTON_CLICKED,{isMultiParty:bookingService.isMultiParticipantEnabled(),isAddAPerson:bookingService.isAddAPersonEnabled(),isOneToOneCall:!utilitiesService.isMeeting()})},stateTransition:"on",style:""}},order:20,defaultState:"on"}}).render(),l.addSideControls(e))}(),callService.isShopStreamCallProductCarouselEnabled()&&(uiUtilitiesService.removeClass(M.querySelector('#gis-ss-carousel-content'),'gis-ss-hide'),p=carouselService.getCarouselComponentView({scrollEvent:eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SCROLLED}),carouselService.updateOrientation("horizontal","horizontal"),uiUtilitiesService.addClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.addTileToCarousel({customTile:!0,image:'',title:serverInjectionService.getLabels().product_tile_recommended_label}),T.setupLeftBottomContainer(p),carouselService.addTileToCarouselCallback(function(e,t){if(carouselService.getSliderInstance().slideToEnd(),c.querySelector("#gis-ss-left-bottom-pane").classList.contains('gis-ss-hide')){if(deviceInfoService.isMobileDevice()&&t.isRecommendedByClerk)return;d.click()}}),callService.isInCallChatEnabled()?function(){if(!deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||!callService.isShopStreamCallEnabled()||!callService.isShopStreamCallProductCarouselEnabled()||!callService.isInCallChatEnabled())return;m=!0;var e=M.querySelector('#gis-ss-right-pane');uiUtilitiesService.addClass(e,'gis-toggle-enabled');var t=uiUtilitiesService.processView(serverInjectionService.getViews().shopStreamChatCarouselToggle);b(t);var i=t.querySelector('#gis-ss-chat-tab');i.querySelector('#gis-ss-tab-text-chat').innerHTML=serverInjectionService.getLabels().oto_chat_toggle_label;var s=t.querySelector('#gis-ss-carousel-tab'),n=s.querySelector('#gis-ss-tab-text-carousel');n.innerHTML=serverInjectionService.getLabels().oto_carousel_toggle_label+' ',n.innerHTML=n.innerHTML+'('+(carouselService.getTiles().length-1)+')',carouselService.addTileToCarouselCallback(function(){n.querySelector('#gis-ss-carousel-count').innerHTML='('+(carouselService.getTiles().length-1)+')'}),e.insertBefore(t,e.firstChild),s.onclick=L,i.onclick=v}():function(){if(!deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||!callService.isShopStreamCallProductCarouselEnabled())return;var e=M.querySelector('#gis-ss-right-pane'),t=uiUtilitiesService.processView(serverInjectionService.getViews().shopStreamChatCarouselToggle);b(t),uiUtilitiesService.addClass(t.querySelector('#gis-ss-wrapper-tab'),'gis-ss-hide'),e.insertBefore(t,e.firstChild)}())),uiUtilitiesService.showModal(M),e.isArchivingEnabled?s.showRecordingTooltip():s.hideRecordingTooltip(),s.setUserProfileInfo({userDisplayName:o,userImageName:a}),E()}function E(){stateService.getInputAlignment()===GIS_CONSTANTS.INPUT_ALIGNMENT.RTL&&uiUtilitiesService.addClass(M.querySelector('#gis-cs-user-form-input'),'gis-rtl')}function b(e){e.querySelector('#gis-ss-chat-close-btn').onclick=function(){m?'off'===u.getCurrentState().stateTransition?D(!1,'carousel'):(u.updateState(null,"off"),D(!1,'chat')):D(!1,!1)}}function w(){uiUtilitiesService.removeClassOnList(M.querySelectorAll('.gis-ss-rightpane-tab'),'gis-ss-active-tab'),uiUtilitiesService.removeClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-chat-active'),uiUtilitiesService.removeClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-carousel-active'),''}function v(){w(),uiUtilitiesService.addClass(M.querySelector('.gis-ss-chat-tab'),'gis-ss-active-tab'),uiUtilitiesService.addClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-chat-active'),'chat',C&&C()}function L(){w(),uiUtilitiesService.addClass(M.querySelector('.gis-ss-carousel-tab'),'gis-ss-active-tab'),uiUtilitiesService.addClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-carousel-active'),'carousel'}function O(e){e.match(/landscape/)?uiUtilitiesService.addClass(c.querySelector("#gis-ss-left-bottom-pane"),'gis-ss-hide'):uiUtilitiesService.removeClass(c.querySelector("#gis-ss-left-bottom-pane"),'gis-ss-hide'),carouselService.refresh()}function N(){}function A(e){return'none'===globalObjectService.getWindow().getComputedStyle(e).display}var V=utilitiesService.callOncePerSession(function(){callService.isInCallChatEnabled()&&(callService.isShopStreamCallEnabled()?(uiUtilitiesService.removeClass(M.querySelector('#gis-ss-chat-content'),"gis-ss-hide"),P=new controlButtonComponent({config:{states:{on:{image:' ',onclick:function(){D('chat','chat')},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){D(!1,'chat')},stateTransition:"on"}},order:10,defaultState:"off"}}),(e=P.render()).setAttribute('id',"gis-shop-Stream-Chat-Control"),l.addSideControls(e),H()):function(){var e=M.querySelector('#gis-cs-container');e.style.display='flex',e.style['flex-direction']='row';var t=uiUtilitiesService.createElementWithAttributes('img','','init-chat-icon');t.src=uiUtilitiesService.getImageUrl('init_chat_icon.png',!0);var i=uiUtilitiesService.createElementWithAttributes('div',_,_);i.append(t),callService.getElementReference(M,'#gis-cs-right-pane').style.display='none';var s=uiUtilitiesService.createElementWithAttributes('span',I,I,'display: none');i.append(s),M.querySelector('#gis-cs-left-pane').append(i),H()}(),E())},stateService.getCallUUID);var q=utilitiesService.once(function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(T.showLeftBottomContainer(),function(e,t){var i=globalObjectService.getWindow().matchMedia(e);try{i.addEventListener('change',t)}catch(e){try{i.addListener(t)}catch(e){console.error(e)}}return i}("(orientation: portrait)",function(e){e.matches?O('portrait'):O('landscape')}).matches?O('portrait'):O('landscape'))});function D(e,t){e?(uiUtilitiesService.removeClass(c.querySelector(".gis-shop-stream-right-chat-compact"),"gis-rightpane-disabled"),T.showRightContainer(),callService.isShopStreamCallProductCarouselEnabled()&&deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(M.querySelector('.gis-ss-carousel-content').appendChild(p),carouselService.updateOrientation('mobile','horizontal mobile'),uiUtilitiesService.removeClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.refresh()),'string'==typeof e&&m&&('carousel'===e?M.querySelector('#gis-ss-carousel-tab').click():M.querySelector('#gis-ss-chat-tab').click()),t&&'carousel'===t?u.updateState(null,"on",!0):(C(),P.updateState(null,"on",!0))):('',uiUtilitiesService.addClass(c.querySelector(".gis-shop-stream-right-chat-compact"),"gis-rightpane-disabled"),T.hideRightContainer(),callService.isShopStreamCallProductCarouselEnabled()&&deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(T.setupLeftBottomContainer(p),carouselService.updateOrientation('horizontal','horizontal'),uiUtilitiesService.addClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.refresh()),t&&'carousel'===t?u.updateState(null,"off",!0):t&&'chat'===t?P.updateState(null,"off",!0):(u&&u.updateState(null,"off",!0),P&&P.updateState(null,"off",!0)))}function R(e){var t=document.querySelector(callService.getElementReference(null,'#gis-cs-right-pane',!0));stateService.getChatInitialized()||(callService.isShopStreamCallEnabled()&&(t=t.querySelector('#gis-ss-chat-content')),chatLoadService.loadChatInIframe(t,Z,e),stateService.setChatInitialized(!0)),uiUtilitiesService.show(callService.getElementReference(null,'#gis-cs-right-pane',!0).replace("#",""))}function U(e,t,i,s,n,a){var o=M.querySelector('.'+_);GIS_CONSTANTS.CHAT.CURRENT_NUM_OF_USERS<=GIS_CONSTANTS.CHAT.MAX_NUM_OF_USERS?(C=function(e,t,i,s,n,a){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.ONE_TO_ONE_CHAT_BUTTON_CLICKED),GISAPP.chatUserNameService.isNameConfigured()?R(!1):GISAPP.chatUserNameService.openEnterUserForm(e,t,i,s,n,null,a,Z),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_ONE_TO_ONE)}.bind(null,e,t,i,s,n,a),o&&(o.onclick=C)):o.addEventListener('click',x)}function H(e){var o=callService.getElementReference(M,'#gis-cs-right-pane');M.querySelector('#gis-user-title')||(o.querySelector('.gis-ss-chat-content')?o.querySelector('.gis-ss-chat-content'):o).appendChild((new chatUserFormComponent).render());var t,i,s,n,a,l=o.getAttribute('id'),r=M.querySelector('#gis-user-title'),c=M.querySelector('#gis-user-secondary-title'),C=M.querySelector('#gis-cs-user-error-msg'),d=M.querySelector('#gis-cs-user-form-input'),u=M.querySelector('#gis-cs-submit-user-form-btn'),g=M.querySelector('.'+_),h=M.querySelector('#gis-cs-user-form-container').getAttribute('id'),p=u.getAttribute('id'),S=d.getAttribute('id'),f=C.getAttribute('id'),m=g?g.getAttribute('id'):null,y=serverInjectionService.getLabels().chat_userName_title,E=serverInjectionService.getLabels().chat_userName_instructions,b=serverInjectionService.getLabels().chat_userName_firstInput,w=serverInjectionService.getLabels().chat_joinChat_button,v=serverInjectionService.getLabels().chat_userName_secondary_title;r.innerHTML=y,c.innerHTML=v,C.innerHTML=E,d.innerHTML=b,u.innerHTML=w,callService.isShopStreamCallEnabled()||globalObjectService.getWindow().addEventListener('messageReceived',function(e){var t,i,s,n,a;e.detail[0].sender.uid!==stateService.getCallUserUUID()&&(t=e,i=I,s=o,n=M.querySelector('#'+I),a=0,A(s)&&A(n)&&uiUtilitiesService.show(i,'flex'),t.detail.forEach(function(e){'text'===e.type&&a++}),n.innerHTML=a)}),e?(t=l,i=h,s=p,n=S,a=f,callService.isShopStreamCallEnabled()&&(T.showRightContainer(),P.updateState(P.states,"on",!0)),GISAPP.chatUserNameService.isNameConfigured()?R(!0):GISAPP.chatUserNameService.openEnterUserForm(t,i,s,n,null,"signal:CHAT_INITIATED",a,Z)):U(l,h,p,S,m,f)}function x(){logService.debug(f,'Amount of users reached its limitations')}function Z(){stateService.getChatInitialized()&&(callService.isShopStreamCallEnabled()?e?e.onclick():document.getElementById("gis-shop-Stream-Chat-Control").onclick():uiUtilitiesService.hide(callService.getElementReference(null,'#gis-cs-right-pane',!0).replace("#",""))),callService.isShopStreamCallEnabled()||(uiUtilitiesService.show(_,'flex'),uiUtilitiesService.hide(I),stateService.setUpdateMessageId(!0))}function k(e,t){a=e,o=t}function B(){callService.isShopStreamCallEnabled()?T.showFullScreen():(M.querySelector('#gis-cs-left-pane').style.width='100%',M.querySelector('#gis-cs-left-pane').style.height='100%',M.querySelector('#gis-cs-container').classList.add('fullScreen-pane')),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.GIS_CHAT_FULL_SCREEN))}function G(){callService.isShopStreamCallEnabled()?T.hideFullScreen():(M.querySelector('#gis-cs-left-pane').style.removeProperty('width'),M.querySelector('#gis-cs-left-pane').style.removeProperty('height'),M.querySelector('#gis-cs-container').classList.contains('fullScreen-pane')&&M.querySelector('#gis-cs-container').classList.remove('fullScreen-pane')),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.GIS_CHAT_NORMAL_SCREEN))}function F(){g.updateState(null,"off",!0)}return{render:y,show:function(e){y(e)},hide:function(){s.destroy(),uiUtilitiesService.removeNode(M),uiUtilitiesService.hideModal()},enableChat:R,setOnMicClick:N,setOnSpeakerClick:N,setOnEndCallClick:N,setOnHelpUnblockClick:N,changeMicIcon:N,changeSpeakerIcon:N,setupClerkProfile:k,updateMessage:N,hideMicShareOverlay:N,displayControls:N,disableChat:Z,enableControlSlide:N,updateOverlayTo:N,overlayStages:N,showNoVideoImage:function(e){s.showNoVideoImage(e)},hideNoVideoImage:function(e){s.hideNoVideoImage(e)},showReconnectingMessage:function(){s.showReconnectingMessage()},showDisconnectedMessage:function(e){s.showDisconnectedMessage(e)},updateCallScreenOverlayStatus:function(){s.updateCallScreenOverlayStatus()},hideCallStatusDialog:function(){s.hideCallStatusDialog()},setPublishedVideo:function(e){return s.addVideo(e)},disableCamMuteMuteBtn:N,setOnCamClick:function(){s.setCameraToggle()},setOnCameraSwitch:function(){s.setOnCameraSwitch()},changeCamIcon:N,setupTapToFocus:N,hideCallController:N,setCallControllerAnimation:N,destroyEventListeners:N,showRecordingTooltip:function(){s&&s.showRecordingTooltip()},hideRecordingTooltip:function(){s&&s.hideRecordingTooltip()},updateConnectionCount:function(e){s.updateConnectionCount(e)},hideVideoOfClerk:N,showVideoOfClerk:N,addStream:function(e){V(),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.NORMAL_SCREEN));var t=JSON.parse(e.connection.data);return t.isIVREnabled&&function(e){if(S=M.querySelector('#gis-dial-pad-main-container'),uiUtilitiesService.hasChildNodes(S))n.showDialPad();else if(n=new dialPadComponent({resetDialPadZIndex:function(){S.style.zIndex='1'},sessionId:stateService.getSessionId(),connectionId:e,onCloseCallback:callService.isShopStreamCallEnabled()?F:N}),S.style.display='block',S.style.zIndex='11',S.appendChild(n.render()),callService.isShopStreamCallEnabled())g=new controlButtonComponent({config:{states:{on:{image:' ',onclick:function(){n.showDialPad(),S.style.display='block',S.style.zIndex='11',uiUtilitiesService.addClass(i,'gis-ivrActive')},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){n.hideDialPad(),S.style.display='none',S.style.zIndex='1',uiUtilitiesService.removeClass(i,'gis-ivrActive')},stateTransition:"on"}},order:20,defaultState:"on"}}),h=g.render(),l.addSideControls(h);else{var t=M.querySelector('#gis-dial-pad-icon');t.style.display='flex',t.onclick=function(){n.showDialPad(),S.style.zIndex='11',uiUtilitiesService.addClass(i,'gis-ivrActive')}}}(e.connection.connectionId),"CLERK"===t.userType&&t.publisher?(k(t.publisher.imgName,t.publisher.displayName),s.setUserProfileInfo({userDisplayName:o,userImageName:a})):"CONSUMER"===t.userType&&(k(null,s.getDisplayNameFromStream(e)),s.setUserProfileInfo({userDisplayName:s.getDisplayNameFromStream(e),userImageName:null})),s.addStream(e)},getMainVideoStreamId:function(){return s.getMainVideoStreamId()},removeVideoWhenClerkLeave:function(e){s.removeVideoWhenClerkLeave(e)},changeVideoDimension:function(e){s.changeVideoDimension(e)},setSubscriberVideoState:N,showSignalMessage:function(e,t,i){var s=JSON.parse(e.data),n=JSON.parse(e.from.data).publisher,a={data:s,onAccept:t,onReject:i,exit:function(){r.style.display='none',r.innerHTML=''},clerkImageURL:uiUtilitiesService.getClerkImageUrl(n.imgName||'clerk-default'),clerkName:n.displayName};if(callService.isShopStreamCallEnabled()&&callService.isShopStreamCallProductCarouselEnabled())a.type=GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA_TYPES.SHARED,a.data.id=a.data.productCode,a.data.onAccept=a.onAccept,new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA,payload:a,popUpContainer:c.querySelector('#gis-ss-player-popup')}).render(),q();else{var o=new addToBasketRequestComponent(a);if(r.innerHTML='',r.appendChild(o.render()),callService.isShopStreamCallEnabled()&&!callService.isShopStreamCallProductCarouselEnabled()){var l=r.children[0];uiUtilitiesService.addClass(l,"gis-ss-carousel-prompt"),l.style.background="white",l.style.height="auto",l.style.padding="15px 0",l.style.top="0",l.style.display="flex",l.style.flexDirection="column",l.style.bottom="auto",uiUtilitiesService.removeClass(r,"gis-ss-hide")}else r.style.animation='1s gis-call-signal-container-show forwards';r.style.display='block'}},showAssistantIsJoining:function(){s.showAssistantIsJoining()},showConnectingToLobby:function(){s.showConnectingToLobby()},showWaitingForAssistant:function(){s.showWaitingForAssistant()},setCallStatus:function(e){s.setCallStatus(e)},showPoorConnectionMessage:function(){s.showPoorConnectionMessage()},showVideoDisabledMessage:function(){s.showVideoDisabledMessage()},hideVideoDisabledMessage:function(){s.hideVideoDisabledMessage()},hidePoorConnectionMessage:function(){s.hidePoorConnectionMessage()},checkChatInitiationType:H,addRecommendedProduct:function(e){if(callService.isShopStreamCallEnabled()&&callService.isShopStreamCallProductCarouselEnabled()&&(carouselService.addTileToCarousel(e),deviceInfoService.isMobileDevice())){var t=carouselService.getTileFromCarousel(e.productCode).render();t&&(new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.INFO,payload:{type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.INFO_TYPES.CAROUSEL_PROMPT},popUpContainer:c.querySelector('#gis-ss-player-popup'),productTile:t}).render(),q())}}}}};GISAPP.connectingScreen=function(systemInfoService,logService,gisService,uiUtilitiesService,serverInjectionService,deviceInfoService,validationUtilitiesService,eventLoggerService,emailSubmitComponent,buttonComponent,stateService,overrideService,modalVideoComponent,modalContentComponent,bookingService){return function(t){'use strict';var o={};function e(n,e,t){o.components.contentContainer.subviews.connectingFooter.style.display='none',uiUtilitiesService.appendView(o.components.contentContainer.subviews.contentContainer,t),o.components.contentContainer.subviews.mainText.innerHTML=n,o.components.contentContainer.subviews.secondaryText.innerHTML=e}return o.components={},o.LOGTAG="connectingScreen",o.props=t,o.serverInjectionService=serverInjectionService,o.labels=o.serverInjectionService.getLabels(),o.awaitingPhase=!1,o.isNoClerkAvailableShown=!1,o.isSubmissionInProgress=!1,o.connectingVideo="/connecting.mp4",o.EVENT_LOGTAG=eventLoggerService.GIS_VIEWS.CONNECTING,o.render=function(){return o.isNoClerkAvailableShown=!1,o.view=uiUtilitiesService.processView(" ",{},!0),o.videoContainer=new modalVideoComponent({video:o.connectingVideo}),o.components.videoContainer=o.videoContainer.render(),uiUtilitiesService.appendView(o.view,o.components.videoContainer),o.components.contentContainer=new modalContentComponent({enterAnimation:"fullscreen",mainText:{text:o.labels.connecting_v2_mainText1},connectingScreenDisclaimerText:o.labels.connectingScreen_v2_disclaimer}),uiUtilitiesService.appendView(o.view,o.components.contentContainer.render()),uiUtilitiesService.addClass(o.components.contentContainer.subviews.connectingFooter,'gis-connectingv3-footer'),uiUtilitiesService.removeClass(o.components.contentContainer.subviews.connectingFooter,'gis-hide'),t.hideFooter&&t.hideFooter(),t.extendOnClose(o._hide),o.components.contentContainer.subviews.mainText.style.fontWeight="400",o.components.contentContainer.subviews.mainText.style.fontSize="16px",o.components.contentContainer.subviews.mainText.style.fontStyle="normal",o.components.contentContainer.subviews.mainText.style.lineHeight="19px",o.components.contentContainer.subviews.mainText.style.letterSpacing="0px",o.components.contentContainer.subviews.mainText.style.textAlign="center",deviceInfoService.isMobileDevice()&&(o.components.videoContainer.style.width="100vw",o.components.contentContainer.subviews.content.style.bottom="0"),setTimeout(function(){o.components.videoContainer.style.display="block"},2e3),setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",setTimeout(function(){t.extraProps&&t.extraProps.noClerkAvailable?o._setNoClerkAvailableUI():(o.awaitingPhase=!0,o._setConnectingUI(),o.components.contentContainer.setup({mainText:{text:o.labels.connecting_v2_mainText2},topImage:"connecting.svg",connectingScreenDisclaimerText:o.labels.connectingScreen_v2_disclaimer}),o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards",uiUtilitiesService.addClass(o.components.contentContainer.subviews.topImage,"gis-rotate"))},1500)},6e3),o.view},o.setNoClerkAvailable=function(){o.isNoClerkAvailableShown=!0,o.awaitingPhase?(clearTimeout(o.animationTimeout),o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o._setNoClerkAvailableUI()},1500)):(t.extraProps||(t.extraProps={}),t.extraProps.noClerkAvailable=!0);var n=o.serverInjectionService.getSystemConfig();n&&n.noOneAvailableBlock&&n.noOneAvailableBlock.enable&&(GISAPP.noClerkAvailableScreenShown=!0)},o._setConnectingUI=function(){o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.innerHTML=o.labels.connecting_v2_mainText3,o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards",eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.RESPECT_MESSAGE_DISPLAYED_ON_CONNECTING_SCREEN),o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.innerHTML=o.labels.connecting_v2_mainText4,o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards"},1500)},7e3)},1500)},7e3)},o._setNoClerkAvailableUI=function(){o.EVENT_LOGTAG=eventLoggerService.GIS_VIEWS.NO_CLERK_AVAILABLE;var n=o.serverInjectionService.getSystemConfig();bookingService.isBookingEnabled()?(o.button=new buttonComponent({buttonLabel:serverInjectionService.getLabels().schedule_booking_button_label,onClick:function(){t.extraProps.setBookingWidget()},eventName:o.EVENT_LOGTAG+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,buttonClass:"gis-secondary-button"}),e(o.labels.connecting_v2_noClerk_booking_mainText,o.labels.connecting_v2_noClerk_booking_secondaryText,o.button.render())):n&&n.captureInfo&&n.captureInfo.views&&!0===n.captureInfo.views.clerkUnavailable?(o.emailTextBox=new emailSubmitComponent({textBoxPlaceHolder:o.labels.noClerkAvailableScreen_emailFieldLabel,textBoxLabel:o.labels.noClerkAvailableScreen_emailErrorLabel,buttonClick:o._submitContact}),e(o.labels.connecting_v2_noClerkCaptureInfo_mainText,o.labels.connecting_v2_noClerkCaptureInfo_secondaryText,o.emailTextBox.render())):(o.button=new buttonComponent({buttonLabel:o.labels.connecting_v2_noClerk_buttonLabel,onClick:t.closeButton.onclick}),e(o.labels.connecting_v2_noClerk_mainText,o.labels.connecting_v2_noClerk_secondaryText,o.button.render())),o.components.contentContainer.subviews.secondaryText.style.visibility="hidden",o.components.contentContainer.subviews.secondaryText.style.display="block",o.components.contentContainer.subviews.topImage.style.display="none",o.components.contentContainer.subviews.mainText.style.animation="2s gis-fade-in forwards",o.components.contentContainer.subviews.secondaryText.style.animation="2s gis-fade-in forwards",o.components.contentContainer.subviews.secondaryText.style.visibility="visible",o.components.contentContainer.subviews.mainText.style.fontWeight="700",o.components.contentContainer.subviews.mainText.style.fontSize="20px",o.components.contentContainer.subviews.mainText.style.fontStyle="normal",o.components.contentContainer.subviews.mainText.style.lineHeight="23px",o.components.contentContainer.subviews.mainText.style.letterSpacing="0px",o.components.contentContainer.subviews.mainText.style.textAlign="center",eventLoggerService.logEvent(o.EVENT_LOGTAG+eventLoggerService.GIS_ACTIONS.SHOWN,{routingKey:stateService.getRoutingKey()})},o._submitContact=function(){if(!o.isSubmissionInProgress){o.isSubmissionInProgress=!0,o.emailTextBox.disableButton();var n={source:"connecting-v2",contact:{email:o.emailTextBox.getText().toLowerCase().trim()}},e=btoa(JSON.stringify(n));gisService.submitContactDetails(e,function(){o.isSubmissionInProgress=!1,o.emailTextBox.enableButton(),t.closeButton.onclick()},function(){o.isSubmissionInProgress=!1,logService.error(o.LOGTAG,"Error on submitting contact info from ConnectingV2."),o.emailTextBox.enableButton(),o.emailTextBox.showError("Failed to submit email address.")})}},o._hide=function(){eventLoggerService.logEvent(o.EVENT_LOGTAG+eventLoggerService.GIS_ACTIONS.CLOSED,{routingKey:stateService.getRoutingKey()}),o.isSubmissionInProgress=!1,o.emailTextBox&&o.emailTextBox.enableButton(),stateService.setCanceledOnConnectingScreen(!0),t.ctrlFunctions.endCall()},overrideService.override(o.LOGTAG,o),{render:o.render,setNoClerkAvailable:o.setNoClerkAvailable}}};GISAPP.gisPlayerScreen=function(serverInjectionService,globalObjectService,logService,GIS_CONSTANTS,stateService,uiUtilitiesService,videoPlayerComponent,deviceInfoService,shopStreamVideoHeaderComponent,eventService,ctaComponent,chatInputDOMProc,chatLoadService,clientStorageService,iframeService,sliderComponent,productCarouselTileComponent,gisService,shopStreamService,utilitiesService,eventLoggerService,layoutService,productPopupComponent,carouselService,addToCartService,systemInfoService){return function(e){var l,S,m,t,s,n,a,i,o,r,c,d,g,u,h,y,C,p,v,b,f,T,E,_,O,A,I,L,N,P,D,M,R,H,U,w,q=!1,k=!1,V='gisPlayerScreen',x=globalObjectService.getWindow().screen,F=[],B=[],z={BROADCAST_FOUND:0,BROADCAST_NOT_FOUND:1,INVALID_ALIAS:2},W=serverInjectionService.getLabels().mobile_product_toggle_label,G=serverInjectionService.getUiConfig(),Q=serverInjectionService.getSystemConfig(),Y=Q.shopStream,K=!1,j=!1,J={},X=!1,Z=!1,$=!1;function ee(){j=!1,S=uiUtilitiesService.processView(serverInjectionService.getViews().gisPlayerView,{}),r=S.querySelector('#gis-player-close-button-container'),c=S.querySelector('#gis-player-close-button'),A=S.querySelector('#gis-mobile-portrait-player-header'),o=S.querySelector('#gis-player-video-header'),n=S.querySelector('#gis-player-video-container'),t=S.querySelector('#gis-player-right-pane'),i=S.querySelector('#gis-player-left-pane'),P=carouselService.getCarouselComponentView({hiddenArrowsLogic:function(){return deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()&&layoutService.getOrientation().match(/portrait/)}}),(s=S.querySelector('#gis-product-carousel-container')).appendChild(P),a=S.querySelector('#gis-player-container'),u=S.querySelector('#gis-player-secondary-cta-container'),y=S.querySelector('#gis-player-chat-container'),v=S.querySelector('#gis-player-overlay-message'),stateService.getInputAlignment()===GIS_CONSTANTS.INPUT_ALIGNMENT.RTL&&uiUtilitiesService.addClass(v,'gis-rtl'),gisCallbacks.productsForBroadcastCallback=ne,T=new videoPlayerComponent({width:'100%',height:'100%',onFullScreen:me,initialScreen:be,onChatClick:de,onProductClick:ge,onPlay:e.onPlay,onPause:e.onPause}),l=T.render(),$=deviceInfoService.isMobileDevice()||j?(T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),Z=!1):(Z=!!shopStreamService.isChatEnabledForShopStream(m)||(T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),!1),!!shopStreamService.isProductCarouselEnabledForShopStream()||(T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),!1)),Ne(),C=l.querySelector('#gis-vc-chat'),p=l.querySelector('#gis-vc-product'),h=S.querySelector('#gis-player-cta-container'),d=S.querySelector('#gis-player-cta'),(deviceInfoService.isMobileDevice()||j)&&(Ae(),uiUtilitiesService.addClass(o,'gis-mobile'),uiUtilitiesService.addClass(s,'gis-hide'),ae()),deviceInfoService.isMobileDevice()&&layoutService.applyIf(ce.bind(null,'landscape'),ce.bind(null,'portrait'),[function(){return layoutService.getOrientation().match(/landscape/)}]),c.onclick=we,layoutService.resizeCallback(he),layoutService.resizeCallback(Ce),deviceInfoService.isIPad()?layoutService.orientationChangeCallback(ie.bind(null,!1),!0):deviceInfoService.isMobileDevice()||layoutService.resizeCallback(ie.bind(null,!1),!0),n.appendChild(l),f=S.querySelector('#gis-video'),uiUtilitiesService.showModal(S),function(){var e=S.querySelector('#gis-user-title'),i=S.querySelector('#gis-user-secondary-title'),t=S.querySelector('#gis-user-error-msg'),s=S.querySelector('#gis-user-form-input'),a=S.querySelector('#gis-submit-user-form-btn'),o=S.querySelector('#gis-player-right-pane').getAttribute('id'),l=S.querySelector('#gis-user-form-container').getAttribute('id'),n=a.getAttribute('id'),r=s.getAttribute('id'),c=t.getAttribute('id'),d=serverInjectionService.getLabels().chat_userName_title,g=serverInjectionService.getLabels().chat_userName_secondary_title,u=serverInjectionService.getLabels().chat_userName_firstInput,h=serverInjectionService.getLabels().chat_joinChat_button;if(e.innerHTML=d,i.innerHTML=g,s.innerHTML=u,a.innerHTML=h,!shopStreamService.isChatEnabledForShopStream(m))return uiUtilitiesService.addClass(y,'gis-hide');deviceInfoService.isMobileDevice()&&!deviceInfoService.isIos()&&(s.addEventListener('focus',function(){K=!0}),s.addEventListener('blur',function(){K=!1,pe()}));if(shopStreamService.isChatEnabledForShopStream(m)){var C=m.config&&m.config.chat&&m.config.chat.type||Y.chat.type;if('question'===C)y.appendChild(((p=chatInputDOMProc.render()).querySelector('#gis-convo').style.height='auto',p.querySelector('#gis-broadcast-close').style.display='none',p.style.width='100%',p));else{if('group'!==C)return uiUtilitiesService.addClass(y,'gis-hide');GISAPP.chatUserNameService.isNameConfigured()?chatLoadService.loadChatInIframe(y,T.callChatButtonOnClick,!0):GISAPP.chatUserNameService.openEnterUserForm(o,l,n,r,null,null,c,T.callChatButtonOnClick),globalObjectService.getWindow().addEventListener('messageReceived',function(e){var i,t;e.detail[0].sender.uid!==stateService.getCallUserUUID()&&(i=e,t=0,y.className.match(/gis-hide/)&&T.showMessageIndicator(),i.detail.forEach(function(e){'text'===e.type&&t++}),T.updateMessageIndicatorCounter(t))})}deviceInfoService.isMobileDevice()||eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_SHOP_STREAM)}var p}(),shopStreamService.isProductCarouselEnabledForShopStream()?m&&gisService.getProductsForBroadcast(m.id,'gisCallbacks.productsForBroadcastCallback'):uiUtilitiesService.addClass(s,'gis-hide'),ue(),Ne(),h=S.querySelector('#gis-player-cta-container'),d=S.querySelector('#gis-player-cta'),Te(),Re(),uiUtilitiesService.enableBodyScroll(),gisAppLib.bodyScrollLock.disableBodyScroll(S),uiUtilitiesService.hasClass(s,"gis-hide")||eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SHOWN_ON_SHOP_STREAM),H=new productPopupComponent({type:null,payload:null,popUpContainer:S.querySelector('#gis-ss-player-popup'),labels:{product_details_popup_label:serverInjectionService.getLabels().product_popup_details_label,product_popup_view_details_label:serverInjectionService.getLabels().product_popup_more_info_label},repeatableATC:!0}),eventService.subscribe(GIS_CONSTANTS.EVENT_NAMES.SHOW_PRODUCT_DETAILS_POPUP,H.triggerDetailsPopup),deviceInfoService.isIPad()?(layoutService.applyIf(function(){layoutService.applyFullScreenHeight(S)},function(){layoutService.removeFullScreenHeight(S)},[se]),uiUtilitiesService.addClass(a,'gis-ipad-landscape')):layoutService.applyIf(function(){layoutService.applyFullScreenHeight(S)},function(){layoutService.removeFullScreenHeight(S)},[{selector:"<",breakpoint:{type:null,maxWidth:1025}},se]),ie(!0)}function ie(e){var i=layoutService.getWindowSize();deviceInfoService.isIPad()?layoutService.getOrientation().match(/portrait/)&&i.WIDTH<1025&&!j?te(!0,e):layoutService.getOrientation().match(/landscape/)&&1024i.WIDTH&&j&&i.WIDTH<1025&&layoutService.getOrientation().match(/landscape/)&&!X&&(te(!(X=!0),e),setTimeout(function(){X=!1},2e3)):deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||(i.WIDTH<1025&&!j?te(!0,e):1025<=i.WIDTH&&j&&te(!1,e))}function te(e,i){(!i||i&&e||i&&!e&&deviceInfoService.isIPad())&&((j=e)?(uiUtilitiesService.removeClass(a,'gis-ipad-landscape'),uiUtilitiesService.addClass(a,'gis-ipad-portrait'),T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),uiUtilitiesService.addClass(o,'gis-mobile'),uiUtilitiesService.addClass(s,'gis-hide'),Pe(),Ae(),T.setupUiForMobile(),ae(),uiUtilitiesService.removeClass(t,'gis-hide'),he(),ue()):(uiUtilitiesService.removeClass(a,'gis-ipad-portrait'),deviceInfoService.isIPad()&&uiUtilitiesService.addClass(a,'gis-ipad-landscape'),ae(),shopStreamService.isChatEnabledForShopStream(m)&&Z?(T.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),C.classList.contains('gis-disabled')?T.internalToggleChat(!1):uiUtilitiesService.removeClass(t,'gis-hide')):T.internalToggleChat(!1),shopStreamService.isProductCarouselEnabledForShopStream()&&$?(T.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),p.classList.contains('gis-disabled')?T.internalToggleProduct(!1):uiUtilitiesService.removeClass(s,'gis-hide'),he()):T.internalToggleProduct(!1),uiUtilitiesService.removeClass(o,'gis-mobile'),Ie(),De(),J&&J.showAvailabilityIndicator&&J.isAvailable&&(Te(),Ee(J.showAvailabilityIndicator,J.isAvailable)),J&&J.onclick&&Ue(J.onclick),Se(),T.setupUiForDesktop(),ue(),carouselService.refresh()),q&&me())}function se(){return q}function ae(){D=S.querySelector("#gis-chat-carousel-toggle-container"),M=S.querySelector("#gis-chat-toggle"),R=S.querySelector("#gis-product-toggle"),deviceInfoService.isMobileDevice()||j?(shopStreamService.isProductCarouselEnabledForShopStream()&&(uiUtilitiesService.removeNode(s),t.appendChild(s)),shopStreamService.isProductCarouselEnabledForShopStream()&&0!==F.length&&shopStreamService.isChatEnabledForShopStream(m)?(uiUtilitiesService.removeClass(D,'gis-hide'),uiUtilitiesService.addClass(t,"gis-toggle-exists"),W||(W=serverInjectionService.getLabels().mobile_product_toggle_label),M.innerHTML=serverInjectionService.getLabels().mobile_chat_toggle_label,R.innerHTML=W,uiUtilitiesService.addClass(D,"gis-enabled"),M.addEventListener("click",function(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_CHAT_BUTTON_CLICKED),oe()}),R.addEventListener("click",function(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PRODUCT_CAROUSEL_BUTTON_CLICKED),le()})):uiUtilitiesService.removeClass(D,"gis-enabled"),shopStreamService.isChatEnabledForShopStream(m)?oe():shopStreamService.isProductCarouselEnabledForShopStream()&&le()):(shopStreamService.isProductCarouselEnabledForShopStream()&&he(),uiUtilitiesService.removeClass(D,"gis-enabled"),uiUtilitiesService.removeClass(t,"gis-toggle-exists"),T.internalToggleProduct(!0),T.internalToggleChat(!0))}function oe(){uiUtilitiesService.removeClass(R,"gis-active"),uiUtilitiesService.addClass(s,"gis-hide"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_HIDDEN_ON_SHOP_STREAM),uiUtilitiesService.removeClass(y,"gis-hide"),uiUtilitiesService.addClass(M,"gis-active"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_SHOP_STREAM)}function le(){uiUtilitiesService.removeClass(M,"gis-active"),uiUtilitiesService.addClass(y,"gis-hide"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_HIDDEN_ON_SHOP_STREAM),uiUtilitiesService.removeClass(s,"gis-hide"),uiUtilitiesService.addClass(R,"gis-active"),b&&(deviceInfoService.isMobileDevice()||j)&&gisAppLib.bodyScrollLock.disableBodyScroll(b),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SHOWN_ON_SHOP_STREAM)}function ne(e){if(0===e.productCarousel.length)return uiUtilitiesService.addClass(s,'gis-hide'),$=!(!deviceInfoService.isMobileDevice()&&!j)||(T.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),uiUtilitiesService.removeNode(p),!1),void ue();var i;"none"===p.style.display||deviceInfoService.isMobileDevice()||j||(T.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),$=!0),uiUtilitiesService.removeClass(s,'gis-hide'),ue(),i=function(e){var i=e.productCarousel;i.forEach(function(e){e.id=e.productSku,e.onAccept=addToCartService.onAddToBasketTriggered.bind(null,e)}),F=i,(deviceInfoService.isMobileDevice()||j)&&ae();return F&&0",s.style.lineHeight=s.height+"px",t.addEventListener('click',o.bind(null,fe)),v.addEventListener('click',o.bind(null,e)),v.style.pointerEvents="none",s.appendChild(a),U.appendChild(s)}function Re(){var e=stateService.getBroadcastResponse().status,i=void 0===e||e==z.BROADCAST_FOUND;if((utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM]||utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM]||10==m.status)&&(!i||!(utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM]&&10!=m.status||utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM]&&1==m.status))){var t=S.querySelector('#gis-player-overlay-message'),s=S.querySelector('#gis-player-msg-title'),a=S.querySelector('#gis-player-msg-subtitle');L=S.querySelector('#gis-player-msg-text'),deviceInfoService.isMobileDevice()||j?(uiUtilitiesService.addClass(s,'gis-mobile'),uiUtilitiesService.addClass(a,'gis-mobile'),uiUtilitiesService.addClass(L,'gis-mobile'),shopStreamService.isChatTypeQuestion(m)&&chatInputDOMProc.disableChat(),a.style.fontSize='11px'):m&&10===m.status?(C&&(C.style.zIndex=2),p&&(p.style.zIndex=2)):($&&T.internalToggleProduct(!1),Z&&T.internalToggleChat(!1)),f.src&&(f.src='',l.querySelector('#gis-vc-play').onclick()),f.style.background='#37373E',uiUtilitiesService.removeClass(t,'gis-hide'),n.querySelector('#gis-video-controls-container').style.pointerEvents="none",U&&uiUtilitiesService.addClass(U,'gis-hide');var o=function(e){var i={firstText:'',secondText:'',thirdText:''},t=serverInjectionService.getLabels();if(e==z.BROADCAST_NOT_FOUND)i.firstText=t.broadcastViewer_broadcastNotFoundText1,i.secondText=t.broadcastViewer_broadcastNotFoundText2;else if(e==z.INVALID_ALIAS)i.firstText=t.broadcastViewer_invalidBroadcastUrlText1,i.secondText=t.broadcastViewer_invalidBroadcastUrlText2;else if(e==z.BROADCAST_FOUND&&10==m.status)i.firstText=t.broadcastViewer_broadcastEventEnded1,i.secondText=t.broadcastViewer_broadcastEventEnded2;else if(e==z.BROADCAST_FOUND&&0==m.status){i.firstText=t.broadcastViewer_broadcastEventToBegin,i.secondText=m.name;var s=new Date(m.broadcastEventHoldTimeStamp);i.thirdText=He(s)}return i}(e);e==z.BROADCAST_NOT_FOUND||e==z.INVALID_ALIAS?(uiUtilitiesService.addClass(a,'gis-content-align'),a.innerHTML=o.firstText+'
'+o.secondText):(s.innerHTML=o.firstText,a.innerHTML=o.secondText,L.innerHTML=o.thirdText)}}function He(e){var i='';return i+=e.toLocaleDateString('en-US',{weekday:'long'})+', ',i+=e.toLocaleDateString('en-US',{month:'short'})+' ',i+=e.toLocaleDateString('en-US',{day:'numeric'})+', ',i+=e.toLocaleTimeString('en-US',{hour:'2-digit',minute:'2-digit'})}function Ue(i){g&&'function'==typeof i&&(J.onclick=i,h&&(h.onclick=function(e){i.call(this,e)}),u.onclick=function(e){i.call(this,e)})}function we(e){q&&be(),k=!1,O&&O(e),x.orientation&&x.orientation.removeEventListener('change',re),T.dispose(),uiUtilitiesService.clearView(uiUtilitiesService.getInnerPanel()),uiUtilitiesService.hideModal(!1,GIS_CONSTANTS.ACTIONS.BROADCAST_SCREEN_CLOSED),uiUtilitiesService.enableBodyScroll(),F=[],delete gisCallbacks.productsForBroadcastCallback,eventService.unsubscribe(GIS_CONSTANTS.EVENT_NAMES.SHOW_PRODUCT_DETAILS_POPUP,H.triggerDetailsPopup)}return{show:function(e,i){k=e,m=i,ee()},hide:we,setOnClickClose:function(e){S&&(Oe(),e&&'function'==typeof e&&(O=e))},setOnClickPlay:function(e){e()},setOnClickShop:fe,setOnClickSpecificShop:fe,setOnClickRetailerCustomButton:fe,getVideoElement:function(){return l.querySelector('video')},playVideo:function(){T.play(Me)},pauseVideo:function(){T.pause()},toggleMute:fe,stopVideo:fe,onVideoPlay:fe,onVideoPause:fe,setupExtraButton:fe,broadcastEnded:function(){m.status=10,Re()},setOneToOneCtaOnBroadcast:Ee,showOneToOneCtaOnBroadcast:_e,hideOneToOneCtaOnBroadcast:Oe,setOneToOneCtaOnReplay:Ee,showOneToOneCtaOnReplay:_e,hideOneToOneCtaOnReplay:Oe,setOnCtaClickEvent:Ue,getView:function(){return l},setVideoSrc:function(e){l.querySelector('source').src=e},setPlayer:function(e){T.setPlayer(e)},updateTimeOnHoldingScreen:function(e){L.innerHTML=He(e)},setIntervalOnVideoElement:function(i){var t=l.querySelector('#gis-video'),s=t.currentTime,a=0;I&&clearInterval(I),I=setInterval(function(){var e=t.currentTime;Math.trunc(e)!=Math.trunc(s)?(s=e,a=0):a+=1,10Have an iRobot product already? Contact Customer Care.",button:{label:"Join Call",image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:"Please Wait...",onclick:c.connectClick,eventName:eventLoggerService.GIS_VIEWS.DIRECT_CALL+eventLoggerService.GIS_VIEWS.DIRECT_CALL_BTN,eventData:{source:"directCall"},buttonClass:"gis-humanized"}}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.invalidDirectCallScreen=function(){l=eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",uiUtilitiesService.addClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer=new modalImageComponent({mainImage:{filename:"direct-call-broken-link.png",width:"100%",backgroundSize:"cover"}}),c.subviews.imageContainer=c.components.imageContainer.render(),c.components.imageContainer.setImageToFullCover(),c.components.contentContainer=new modalContentComponent({mainText:{text:"Sorry, your Live Video Link is invalid.",class:"gis-humanized"},secondaryText:"
Check if you have correctly entered the complete invite URL.
Contact your in-store associate to request a new link.
",linkText:"What is this?",footerText:"Have an iRobot product already? Contact Customer Care.",button:{label:"OK",eventName:eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL+eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL_BTN,eventData:{source:"directCall"},onclick:a.closeButton.onclick,buttonClass:"gis-humanized"}}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.browserUnsupported=function(){l=eventLoggerService.GIS_VIEWS.BROWSER_UNSUPPORTED,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.showFooter(),uiUtilitiesService.removeClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer.setup({mainImage:{filename:"unsupported-browser.png",backgroundSize:"80%"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Your browser doesn't support this experience"},secondaryText:"Open the page in an up to date supported browser and start again.",button:{label:"Got it",onclick:a.closeButton.onclick}}),a.hideInfoButton(),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.noMic=function(){l=eventLoggerService.GIS_VIEWS.NO_MIC,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.showFooter(),uiUtilitiesService.removeClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer.setup({mainImage:{filename:"No-Mic-Detected.png"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Your mic isn't
connected"},secondaryText:"Check your mic is connected [USB / Bluetooth], turned on, and unmuted, then start again.",button:{label:"Got it",onclick:a.closeButton.onclick}}),a.hideInfoButton(),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setConnecting=function(e){l=eventLoggerService.GIS_VIEWS.CONNECTING,2===serverInjectionService.getUiConfig().micSetupVersion?(n=e,c.components.contentContainer2&&(c.components.contentContainer2.setup({centerImage:{filename:"mic_ok.png",height:deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()?"100px":"160px"},secondaryText:"Microphone enabled"}),c.components.contentContainer2.components.button2.hide()),c.timeouts.push(setTimeout(function(){a.steps&&a.steps.hide(),a.setTitle(""),a.updateChild(connectingScreen,{noClerkAvailable:n,setBookingWidget:c.setBookingWidget})},2e3))):a.updateChild(connectingScreen,{noClerkAvailable:n,setBookingWidget:c.setBookingWidget}),a.hideInfoButton(),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN,{routingKey:stateService.getRoutingKey()})},c.setNoClerkAvailable=function(){n=!0},c.micBlocked=function(){l=eventLoggerService.GIS_VIEWS.MIC_BLOCKED,c.subviews.split1.style.width="",c.subviews.split1.style.height="",c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.setTitle(""),c.components.imageContainer.setup({mainImage:{filename:"mic-denied.png"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Oops, you blocked your microphone"},secondaryText:"To talk to us you need to unblock your mic via address bar or settings.",button:{label:"OK",onclick:a.closeButton.onclick}}),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),a.hideInfoButton(),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.meetingConnectScreenWaiting=function(e){l=eventLoggerService.GIS_VIEWS.MEETING_CONNECT;var n=new Date(e.data.startTime),t=serverInjectionService.getLabels(),i=[{text:t.meetingScreen_Title,type:"title"},{text:t.meetingScreen_subMainText,type:"subTitle"},{text:t.meetingScreen_infoText,type:"subTitle"},{value:r(),type:"other"},{label:t.meetingScreen_connectBtnLabel,image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:t.meetingScreen_waiting,onClick:c.connectClick,eventName:eventLoggerService.GIS_VIEWS.MEETING_CONNECT+eventLoggerService.GIS_VIEWS.MEETING_CONNECT_BTN,eventData:{source:"meetingCall"},buttonClass:"gis-humanized",type:"button"},{text:t.meetingScreen_startTimeText+" "+utilitiesService.getFormattedTime(n),type:"subTitle"},{text:t.meetingScreen_startDateText+" "+utilitiesService.getFormattedDate(n),type:"subTitle"}];m(l,"meeting-connect-image.png",i);var o=new Date((new Date).setMinutes((new Date).getMinutes()+3));if(oHave an iRobot product already? Contact Customer Care.",button:{label:"Join Call",image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:"Please Wait...",onclick:function(){c.connectClick(e)},eventName:eventLoggerService.GIS_VIEWS.ADD_A_PERSON_VIEW+eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_BUTTON,eventData:{source:"addAPersonCall"},buttonClass:"gis-humanized"}}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setCallEndedScreenForAddAPerson=function(){addAPersonService.addAPersonEndCallScreenShown(),l=eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_VIEW,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="";var e={mainText:{text:serverInjectionService.getLabels().add_a_person_call_has_ended_main_text,class:"gis-humanized"},mainSubText:serverInjectionService.getLabels().add_a_person_call_has_ended_sub_main_text,button:{label:serverInjectionService.getLabels().add_a_person_start_new_call_button_text,image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:serverInjectionService.getLabels().directCallScreen_v3_waiting,onclick:c.connectClick,eventName:eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_VIEW+eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_BUTTON,eventData:{source:"standard"},buttonClass:"gis-humanized"}};bookingService.isBookingEnabled()?(serverInjectionService.getUiConfig().supportInfoLink&&a.showInfoButton(),e.secondaryButton={label:serverInjectionService.getLabels().schedule_booking_button_label,onclick:c.setBookingWidget,eventName:eventLoggerService.GIS_VIEWS.CONNECT+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,eventData:{source:"standard"},class:"gis-secondary-button"}):e.linkText=serverInjectionService.getLabels().support_info_text;uiUtilitiesService.addClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer=new modalImageComponent({mainImage:{filename:"call-has-ended-connect-screen.jpg",width:"100%",backgroundSize:"cover"}}),c.subviews.imageContainer=c.components.imageContainer.render(),c.components.imageContainer.setImageToFullCover(),c.components.contentContainer=new modalContentComponent(e),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),deviceInfoService.isMobileDevice()?(c.components.contentContainer.subviews.mainSubText.style.paddingTop="23px",c.components.contentContainer.subviews.mainSubText.style.paddingBottom="34px"):(c.components.contentContainer.subviews.mainSubText.style.paddingTop="37px",c.components.contentContainer.subviews.mainSubText.style.paddingBottom="147px"),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setMeetingMissed=function(){l=eventLoggerService.GIS_VIEWS.MEETING_MISSED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_missedText,type:"subTitle"},{value:r(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:l+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(l,"meeting-connect-image.png",n)},c.setMeetingEnded=function(){l=eventLoggerService.GIS_VIEWS.MEETING_ENDED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_ended,type:"title"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:l+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(l,"meeting-connect-image.png",n)},c.setMeetingCancelled=function(){l=eventLoggerService.GIS_VIEWS.MEETING_CANCELED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_canceledText,type:"subTitle"},{value:r(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:l+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(l,"meeting-connect-image.png",n)},c.setBookingWidget=function(){var e=l;if(l=eventLoggerService.GIS_VIEWS.BOOKING,bookingService.isOpenBookingWidgetInNewTab())bookingService.openBookingPage();else{a.hideFooter(),a.hideInfoButton(),a.hideCloseButton();var n=a.modalContainer.querySelector("#gis-modal-content"),t=uiUtilitiesService.processView(serverInjectionService.getViews().bookingWidgetView,{},!1);uiUtilitiesService.clearView(n),n.appendChild(t);var i=t.querySelector("#gis-booking-widget-back-button-container");e?(t.querySelector('#gis-booking-widget-back-button-message').innerText=serverInjectionService.getLabels().bookingWidget_back_button_message,i.onclick=function(){switch(uiUtilitiesService.clearView(n),n.appendChild(c.render().querySelector('#gis-splitLayout')),a.showCloseButton(),e){case eventLoggerService.GIS_VIEWS.CONNECT:c.setHumanizedConnectScreen();break;case eventLoggerService.GIS_VIEWS.CLERK_UNAVAILABLE_CONNECT:c.setClerkUnavailableConnectScreen();break;case eventLoggerService.GIS_VIEWS.MEETING_CANCELED:c.setMeetingCancelled();break;case eventLoggerService.GIS_VIEWS.MEETING_ENDED:c.setMeetingEnded();break;case eventLoggerService.GIS_VIEWS.MEETING_MISSED:c.setMeetingMissed();break;case eventLoggerService.GIS_VIEWS.MEETING_ERROR:c.setMeetingSomethingWrong();break;case eventLoggerService.GIS_VIEWS.CONNECTING:c.setHumanizedConnectScreen()}}):i.style.visibility='hidden',t.querySelector("#gis-booking-widget-close-button-container").onclick=function(){a.hide()},iframeService.initializeSourceLessIframeWithScriptInjection('gis-booking-widget',t.querySelector('#gis-booking-widget-body'),bookingService.getScheduleCallButtonUrl(),{isSrc:!0,isCrossCommunication:!1}),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)}},c.setInformationScreen=function(e){l=eventLoggerService.GIS_VIEWS.ADD_A_PERSON_SESSION_IS_FULL_VIEW,a.hideFooter(),a.hideInfoButton(),a.hideCloseButton();var n=a.modalContainer.querySelector("#gis-modal-content"),t=uiUtilitiesService.processView(serverInjectionService.getViews().informationView,{},!1);uiUtilitiesService.clearView(n),n.appendChild(t),t.querySelector('#gis-connectv3-mainText').innerText=e,t.querySelector("#gis-information-close-button-container").onclick=function(){a.hide()},eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setMeetingSomethingWrong=function(){l=eventLoggerService.GIS_VIEWS.MEETING_ERROR;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_somethingWentWrongText,type:"subTitle"},{value:r(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:l+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(l,"meeting-connect-image.png",n)},c._hide=function(){c.timeouts=uiUtilitiesService.clearTimeouts(c.timeouts),eventLoggerService.logEvent(l+eventLoggerService.GIS_ACTIONS.CLOSED),stateService.getCurrentPhase!==stateService.phase.READY&&c.props.ctrlFunctions.handlePostCallEvents()},c.connectClick=function(e){if(bookingService.isAddAPersonEnabled()&&utilitiesService.isMeeting()||addAPersonService.isAddAPersonCall()&&callService.isAddAPersonEnabled()){var n=otService.initSession(stateService.getTokBoxApiKey(),stateService.getSessionId(),function(e){e&&logService.error("PRE-CALL-SCREEN","Error on initiating OT session",e)}),i=0,o=0;n.setConnectionCreatedHandler(function(e){var n=JSON.parse(e.connection.data),t=n&&n.userType;o++,'CONSUMER'===t&&i++}),n.connect(stateService.getToken(),function(){}),setTimeout(function(){n.off(),n.disconnect(),3