(function(){"use strict";BX.namespace("BX.UI");BX.UI.AccessRights.Section=function(t){this.id=t.id?t.id:null;this.headSection=t.headSection?t.headSection:null;this.title=t.title;this.rights=t.rights?t.rights:[];this.userGroups=t.userGroups?t.userGroups:[];this.grid=t.grid?t.grid:null;this.layout={title:null,headColumn:null,columns:null,content:null,earLeft:null,earRight:null};this.scroll=0;this.earTimer=null;this.earLeftTimer=null;this.earRightTimer=null;this.columns=[];this.bindEvents()};BX.UI.AccessRights.Section.prototype={bindEvents:function(){BX.addCustomEvent("AccessRights.Section:scrollLeft",function(t){if(this.title!==t.title){this.getColumnsContainer().scrollLeft=t.getScroll()}t.adjustEars();BX.PopupMenu.destroy("ui-access-rights-column-item-popup-variables")}.bind(this));BX.addCustomEvent("AccessRights.Section:scrollRight",function(t){if(this.title!==t.title){this.getColumnsContainer().scrollLeft=t.getScroll()}t.adjustEars();BX.PopupMenu.destroy("ui-access-rights-column-item-popup-variables")}.bind(this));BX.bind(window,"resize",this.adjustEars.bind(this))},getGrid:function(){return this.grid},addColumn:function(t){if(!t){return}var e=Object.assign({},t);e.userGroup=t;var i=this.getColumn(e);this.layout.columns.appendChild(i.render());this.columns.push(i)},removeColumn:function(t){if(!t){return}for(var e=0;e0;var s=t.scrollWidth>Math.round(e+t.offsetWidth);this.getContentContainer().classList[i?"add":"remove"]("ui-access-rights-section-ear-left-shown");this.getContentContainer().classList[s?"add":"remove"]("ui-access-rights-section-ear-right-shown")},scrollToRight:function(t,e){var i=20;t?i=2:null;this.earTimer=setInterval(function(){this.getColumnsContainer().scrollLeft+=10;if(t){t<=this.getColumnsContainer().scrollLeft?this.stopAutoScroll():null}}.bind(this),i);if(e==="stop"){setTimeout(function(){clearTimeout(this.earTimer);this.getGrid().unlock()}.bind(this),t*2)}},scrollToLeft:function(){this.earTimer=setInterval(function(){this.getColumnsContainer().scrollLeft-=10}.bind(this),20)},stopAutoScroll:function(){clearInterval(this.earTimer);BX.onCustomEvent(window,"BX.UI.AccessRights.Grid:stopAutoScroll",this)},adjustScroll:function(){if(this.scrollthis.getColumnsContainer().scrollLeft){this.scroll=this.getColumnsContainer().scrollLeft;BX.onCustomEvent("AccessRights.Section:scrollLeft",[this])}},getScroll:function(){return this.scroll},render:function(){var t=BX.create("div",{props:{className:"ui-access-rights-section"},children:[this.title?this.getTitle():null,this.getMainContainer()]});this.addHeadColumn();var e=document.createDocumentFragment();for(var i=0;i