text: (function(){"use strict";BX.namespace("BX.Grid");BX.Grid.SettingsWindowColumn=function(t,e){this.node=null;this.label=null;this.checkbox=null;this.editButton=null;this.settings=null;this.parent=null;this.default=null;this.defaultTitle=null;this.state=null;this.lastTitle=null;this.init(t,e)};BX.Grid.SettingsWindowColumn.prototype={init:function(t,e){this.parent=t;this.node=e;try{this.lastTitle=e.querySelector("label").innerText.trim()}catch(t){}this.updateState();BX.bind(this.getEditButton(),"click",BX.proxy(this.onEditButtonClick,this))},onEditButtonClick:function(t){t.stopPropagation();this.isEditEnabled()?this.disableEdit():this.enableEdit()},setState:function(t){this.state=t},getState:function(){return this.state},updateState:function(){this.setState({selected:this.isSelected(),title:this.getTitle()})},restoreState:function(){var t=this.getState();t.selected?this.select():this.unselect();this.setTitle(t.title)},getId:function(){return this.getNode().dataset.name},getTitle:function(){return this.getLabel().innerText},setTitle:function(t){this.getLabel().innerText=!!t&&t!=="undefined"?t:this.getDefaultTitle()},isEdited:function(){return this.getTitle()!==this.getDefaultTitle()},getSettings:function(){if(this.settings===null){var t=this.parent.getParam("DEFAULT_COLUMNS");this.settings=this.getId()in t?t[this.getId()]:{}}return this.settings},isDefault:function(){if(this.default===null){var t=this.getSettings();this.default="default"in t?t.default:false}return this.default},restore:function(){this.isDefault()?this.select():this.unselect();this.setTitle(this.getDefaultTitle());this.disableEdit();this.updateState()},getDefaultTitle:function(){if(this.defaultTitle===null){var t=this.getSettings();this.defaultTitle="name"in t?t.name:this.lastTitle}return this.defaultTitle},getNode:function(){return this.node},getLabel:function(){if(this.label===null){this.label=BX.Grid.Utils.getByTag(this.getNode(),"label",true)}return this.label},getCheckbox:function(){if(this.checkbox===null){this.checkbox=BX.Grid.Utils.getBySelector(this.getNode(),'input[type="checkbox"]',true)}return this.checkbox},getEditButton:function(){if(this.editButton===null){this.editButton=BX.Grid.Utils.getByClass(this.getNode(),this.parent.settings.get("classSettingsWindowColumnEditButton"),true)}return this.editButton},enableEdit:function(){this.getLabel().contentEditable=true;this.getCheckbox().disabled=true;this.adjustCaret()},disableEdit:function(){this.getLabel().contentEditable=false;this.getCheckbox().disabled=false},isEditEnabled:function(){return this.getLabel().isContentEditable},isSelected:function(){return this.getCheckbox().checked},select:function(){this.getCheckbox().checked=true},unselect:function(){this.getCheckbox().checked=false},adjustCaret:function(){var t=document.createRange();var e=window.getSelection();var i=this.getLabel().innerText.length;var n=this.getLabel().childNodes;var s=n[n.length-1];t.setStart(s,i);t.setEnd(s,i);t.collapse(true);e.removeAllRanges();e.addRange(t);BX.fireEvent(this.getNode(),"focus")}}})();