text: (function(){BX.namespace("BX.Report.Analytics");BX.Report.Analytics.Page=function(t){this.scope=t.scope;this.menuScope=t.menuScope;this.changeBoardButtons=this.menuScope.querySelectorAll('[data-role="report-analytics-menu-item"]');this.contentContainer=this.scope.querySelector(".report-analytics-content");this.currentItem=this.menuScope.querySelector(".report-analytics-sidebar-submenu-item.report-analytics-sidebar-submenu-item-active");this.currentSelectedContainer=this.menuScope.querySelector(".report-analytics-sidebar-menu-item.report-analytics-sidebar-menu-item-active");this.pageTitle=document.getElementById("pagetitle");this.pageTitleWrap=document.querySelector(".pagetitle-wrap");this.pageControlsContainer=document.querySelector(".pagetitle-container.pagetitle-align-right-container");this.defaultBoardKey=t.defaultBoardKey;this.defaultBoardTitle=t.defaultBoardTitle;this.currentPageTitle=top.document.title;this.init()};BX.Report.Analytics.Page.prototype={init:function(){BX.addCustomEvent("SidePanel.Slider:onClose",function(){this.sliderCloseHandler()}.bind(this));top.document.title=this.defaultBoardTitle;this.changeBoardButtons.forEach(function(t){BX.bind(t,"click",this.handleItemClick.bind(this))}.bind(this));this.loader=new BX.Loader({size:80});top.onpopstate=this.handlerOnPopState.bind(this);this.openBoardWithKey(this.defaultBoardKey)},handleItemClick:function(t){t.preventDefault();var e=t.currentTarget;this.activateButton(t);var a=e.dataset.isExternal=="Y";if(a){this.openExternalUrl(e.dataset.externalUrl)}else{this.openBoardWithKey(e.dataset.reportBoardKey,e.href)}},openExternalUrl:function(t){BX.SidePanel.Instance.open(t,{cacheable:false})},openBoardWithKey:function(t,e){e=e||"";this.cleanPageContent();this.showLoader();BX.Report.VC.Core.abortAllRunningRequests();BX.Report.VC.Core.ajaxPost("analytics.getBoardComponentByKey",{data:{IFRAME:"Y",boardKey:t},analyticsLabel:{boardKey:t},onFullSuccess:function(a){this.hideLoader();if(e!=""){top.history.pushState(null,a.additionalParams.pageTitle,e);top.history.replaceState({reportBoardKey:t,href:e},a.additionalParams.pageTitle,e)}this.changePageTitle(a.additionalParams.pageTitle);this.changePageControls(a.additionalParams.pageControlsParams);BX.html(this.contentContainer,a.data)}.bind(this)})},cleanPageContent:function(){this.pageTitle.innerText="";this.pageControlsContainer.innerText="";BX.cleanNode(this.contentContainer);if(BX.Report.Dashboard){BX.Report.Dashboard.BoardRepository.destroyBoards()}if(BX.VisualConstructor&&BX.VisualConstructor.BoardRepository){BX.VisualConstructor.BoardRepository.destroyBoards()}},changePageControls:function(t){var e={};e.onFullSuccess=function(t){BX.html(this.pageControlsContainer,t.html)}.bind(this);BX.Report.VC.Core._successHandler(t,e)},changePageTitle:function(t){this.pageTitle.innerText=t;top.document.title=t},showLoader:function(){this.pageTitleWrap.style.display="none";var t=BX.create("img",{attrs:{src:"/bitrix/images/report/visualconstructor/preview/view-without-menu.svg",height:"1200px",width:"100%"}});this.contentContainer.appendChild(t)},hideLoader:function(){this.pageTitleWrap.style.display="block";this.loader.hide()},activateButton:function(t){var e=t.currentTarget;if(!this.currentItem){this.currentItem=e}this.currentItem.classList.remove("report-analytics-sidebar-submenu-item-active");this.currentItem=e;this.currentItem.classList.add("report-analytics-sidebar-submenu-item-active")},handlerOnPopState:function(t){var e=this.defaultBoardKey;if(t.state.reportBoardKey!==undefined){e=t.state.reportBoardKey}this.cleanPageContent();this.showLoader();BX.Report.VC.Core.ajaxPost("analytics.getBoardComponentByKey",{data:{IFRAME:"Y",boardKey:e},analyticsLabel:{boardKey:e},onFullSuccess:function(t){this.hideLoader();this.cleanPageContent();this.changePageTitle(t.additionalParams.pageTitle);this.changePageControls(t.additionalParams.pageControlsParams);BX.html(this.contentContainer,t.data)}.bind(this)})},sliderCloseHandler:function(){top.document.title=this.currentPageTitle}}})();
  //# sourceMappingURL=script.map.js