diff --git a/README.md b/README.md
index d241d7e..5f25f07 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,9 @@ Demo: http://cheton.github.io/infinite-tree
Yes | Yes | Yes| 8+ | Yes | Yes |
Need to include [es5-shim](https://github.com/es-shims/es5-shim#example-of-applying-es-compatability-shims-in-a-browser-project) polyfill for IE8
+## React Support
+Check out react-infinite-tree at https://github.com/cheton/react-infinite-tree.
+
## Notice
The project is under heavy development and a lot of things are changing. Stay tuned for further updates.
diff --git a/dist/infinite-tree.js b/dist/infinite-tree.js
index 6c7aedd..673cdd3 100644
--- a/dist/infinite-tree.js
+++ b/dist/infinite-tree.js
@@ -1,4 +1,4 @@
-/*! infinite-tree v0.8.1 | (c) 2016 Cheton Wu | MIT | https://github.com/cheton/infinite-tree */
+/*! infinite-tree v0.8.2 | (c) 2016 Cheton Wu | MIT | https://github.com/cheton/infinite-tree */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
@@ -731,8 +731,11 @@ return /******/ (function(modules) { // webpackBootstrap
_this5.appendChildNode(childNode, node);
});
- // Call openNode again
- _this5.openNode(node);
+ // Ensure the node has children to prevent from infinite loop
+ if (node.hasChildren()) {
+ // Call openNode again
+ _this5.openNode(node);
+ }
});
return false;
diff --git a/dist/infinite-tree.min.js b/dist/infinite-tree.min.js
index fa64af2..dc6d037 100644
--- a/dist/infinite-tree.min.js
+++ b/dist/infinite-tree.min.js
@@ -1,3 +1,3 @@
-/*! infinite-tree v0.8.1 | (c) 2016 Cheton Wu | MIT | https://github.com/cheton/infinite-tree */
-!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.InfiniteTree=factory():root.InfiniteTree=factory()}(this,function(){return function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _infiniteTree=__webpack_require__(1),_infiniteTree2=_interopRequireDefault(_infiniteTree);module.exports=_infiniteTree2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},_events=__webpack_require__(2),_events2=_interopRequireDefault(_events),_clusterize=__webpack_require__(3),_clusterize2=_interopRequireDefault(_clusterize),_flattree=__webpack_require__(4),_lookupTable=__webpack_require__(8),_lookupTable2=_interopRequireDefault(_lookupTable),_renderer=__webpack_require__(9),_helper=__webpack_require__(10),ensureNodeInstance=function(node){if(!(node instanceof _flattree.Node))throw new Error("The node must be a Node object.");return!0},InfiniteTree=function(_events$EventEmitter){function InfiniteTree(el,options){_classCallCheck(this,InfiniteTree);var _this=_possibleConstructorReturn(this,_events$EventEmitter.call(this));return _this.options={autoOpen:!1,droppable:!1,el:null,loadNodes:null,rowRenderer:_renderer.defaultRowRenderer,selectable:!0,shouldSelectNode:null},_this.state={openNodes:[],rootNode:null,selectedNode:null},_this.clusterize=null,_this.nodeTable=new _lookupTable2["default"],_this.nodes=[],_this.rows=[],_this.scrollElement=null,_this.contentElement=null,_this.dragoverElement=null,_this.contentListener={click:function(e){var itemTarget=null,handleToggler=!1;for((0,_helper.stopPropagation)(e),e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget.className.indexOf("tree-toggler")>=0&&(handleToggler=!0),itemTarget=itemTarget.parentElement;if(itemTarget){var id=itemTarget.getAttribute("aria-id"),node=_this.getNodeById(id);if(node)return handleToggler?void _this.toggleNode(node):void _this.selectNode(node)}},dragenter:function(e){var itemTarget=null;for(e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget=itemTarget.parentElement;if(itemTarget&&_this.dragoverElement!==itemTarget){if((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,!itemTarget.hasAttribute("droppable"))return;var canDrop=!itemTarget.getAttribute("droppable").match(/false/i);canDrop&&((0,_helper.addClass)(itemTarget,"highlight"),_this.dragoverElement=itemTarget)}},dragend:function(e){_this.dragoverElement&&((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null)},dragover:function(e){return(0,_helper.preventDefault)(e),e.dataTransfer.dropEffect="move",!1},drop:function(e){if((0,_helper.preventDefault)(e),_this.dragoverElement){var id=_this.dragoverElement.getAttribute("aria-id"),node=_this.getNodeById(id);(0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,_this.emit("dropNode",node,e)}}},(0,_helper.isDOMElement)(el)?options.el=el:options=el,_this.options=(0,_helper.extend)({},_this.options,options),_this.options.el?(_this.create(),options.data&&_this.loadData(options.data),_this):(console.error("Failed to initialize infinite-tree: el is not specified.",options),_possibleConstructorReturn(_this))}return _inherits(InfiniteTree,_events$EventEmitter),InfiniteTree.prototype.create=function(){var _this2=this;if(!this.options.el)throw new Error("The element option is not specified.");var scrollElement=document.createElement("div");scrollElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-scroll");var contentElement=document.createElement("div");contentElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-content"),scrollElement.appendChild(contentElement),this.options.el.appendChild(scrollElement),this.clusterize=new _clusterize2["default"]({tag:"div",rows:[],scrollElem:scrollElement,contentElem:contentElement,no_data_class:"infinite-tree-no-data",callbacks:{clusterWillChange:function(){},clusterChanged:function(){},scrollingProgress:function(progress){_this2.emit("scrollProgress",progress)}}}),this.scrollElement=scrollElement,this.contentElement=contentElement,(0,_helper.addEventListener)(this.contentElement,"click",this.contentListener.click),this.options.droppable&&((0,_helper.addEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.addEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.addEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.addEventListener)(this.contentElement,"drop",this.contentListener.drop))},InfiniteTree.prototype.destroy=function(){for((0,_helper.removeEventListener)(this.contentElement,"click",this.contentListener),this.options.droppable&&((0,_helper.removeEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.removeEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.removeEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.removeEventListener)(this.contentElement,"drop",this.contentListener.drop)),this.clear(),this.clusterize&&(this.clusterize.destroy(!0),this.clusterize=null);this.contentElement.firstChild;)this.contentElement.removeChild(this.contentElement.firstChild);for(;this.scrollElement.firstChild;)this.scrollElement.removeChild(this.scrollElement.firstChild);if(this.options.el)for(var containerElement=this.options.el;containerElement.firstChild;)containerElement.removeChild(containerElement.firstChild);this.contentElement=null,this.scrollElement=null},InfiniteTree.prototype.addChildNodes=function(newNodes,index,parentNode){var _this3=this;if(newNodes=[].concat(newNodes||[]),0===newNodes.length)return!1;"object"===("undefined"==typeof index?"undefined":_typeof(index))?(parentNode=index||this.state.rootNode,index=parentNode.children.length):parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),newNodes.forEach(function(newNode){newNode.parent=parentNode}),parentNode.children.splice.apply(parentNode.children,[index,0].concat(newNodes)),index=parentNode.children.indexOf(newNodes[0]);var deleteCount=parentNode.state.total,nodes=(0,_flattree.flatten)(parentNode.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this3.options.rowRenderer(node,_this3.options)});if(parentNode===this.state.rootNode)this.nodes=nodes,this.rows=rows;else{var parentOffset=this.nodes.indexOf(parentNode);parentOffset>=0&&(this.nodes.splice.apply(this.nodes,[parentOffset+1,deleteCount].concat(nodes)),this.rows.splice.apply(this.rows,[parentOffset+1,deleteCount].concat(rows)),this.rows[parentOffset]=this.options.rowRenderer(parentNode,this.options))}return parentNode.children.slice(index).forEach(function(childNode){_this3.flattenNode(childNode).forEach(function(node){void 0!==node.id&&_this3.nodeTable.set(node.id,node)})}),this.update(),!0},InfiniteTree.prototype.appendChildNode=function(newNode,parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);var index=parentNode.children.length,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.clear=function(){this.clusterize.clear(),this.nodeTable.clear(),this.nodes=[],this.rows=[],this.state.openNodes=[],this.state.rootNode=null,this.state.selectedNode=null},InfiniteTree.prototype.closeNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)<0)return!1;if(this.state.selectedNode&&this.state.selectedNode!==node){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex+1,rangeTo=nodeIndex+node.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(node)}node.state.open=!1;var openNodes=this.state.openNodes.filter(function(node){return node.hasChildren()&&node.state.open});this.state.openNodes=openNodes;for(var deleteCount=node.state.total,p=node;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return this.nodes.splice(nodeIndex+1,deleteCount),this.rows.splice(nodeIndex+1,deleteCount),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.emit("closeNode",node),this.update(),!0},InfiniteTree.prototype.flattenChildNodes=function(parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);for(var list=[],node=parentNode.getFirstChild();node;)if(list.push(node),node.hasChildren())node=node.getFirstChild();else{for(;null===node.getNextSibling()&&node.parent!==parentNode;)node=node.getParent();node=node.getNextSibling()}return list},InfiniteTree.prototype.flattenNode=function(node){return[node].concat(this.flattenChildNodes(node))},InfiniteTree.prototype.getChildNodes=function(parentNode){return parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),parentNode.children},InfiniteTree.prototype.getNodeById=function(id){var node=this.nodeTable.get(id);if(!node){if(node=this.nodes.filter(function(node){return node.id===id})[0],!node)return null;this.nodeTable.set(node.id,node)}return node},InfiniteTree.prototype.getOpenNodes=function(){return this.state.openNodes.slice()},InfiniteTree.prototype.getRootNode=function(){return this.state.rootNode},InfiniteTree.prototype.getSelectedNode=function(){return this.state.selectedNode},InfiniteTree.prototype.insertNodeAfter=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode)+1,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.insertNodeBefore=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode),newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.loadData=function(){var _this4=this,data=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.nodes=(0,_flattree.flatten)(data,{openAllNodes:this.options.autoOpen}),this.nodeTable.clear(),this.state.openNodes=this.nodes.filter(function(node){return node.hasChildren()&&node.state.open}),this.state.rootNode=function(){for(var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0];node&&null!==node.parent;)node=node.parent;return node}(this.nodes[0]),this.state.selectedNode=null,this.flattenChildNodes(this.state.rootNode).forEach(function(node){void 0!==node.id&&_this4.nodeTable.set(node.id,node)}),this.rows=this.nodes.map(function(node){return _this4.options.rowRenderer(node,_this4.options)}),this.update()},InfiniteTree.prototype.openNode=function(node){var _this5=this;ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)>=0)return!1;if(!node.hasChildren()&&node.loadOnDemand)return"function"!=typeof this.options.loadNodes?!1:(node.state.loading=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update(),this.options.loadNodes(node,function(err,nodes){node.state.loading=!1,_this5.rows[nodeIndex]=_this5.options.rowRenderer(node,_this5.options),_this5.update(),err||(nodes.forEach(function(childNode){_this5.appendChildNode(childNode,node)}),_this5.openNode(node))}),!1);node.state.open=!0;var openNodes=[node].concat(this.state.openNodes);this.state.openNodes=openNodes;var nodes=(0,_flattree.flatten)(node.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this5.options.rowRenderer(node,_this5.options)});return this.nodes.splice.apply(this.nodes,[nodeIndex+1,0].concat(nodes)),this.rows.splice.apply(this.rows,[nodeIndex+1,0].concat(rows)),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),nodes.length>0&&!this.nodeTable.get(nodes[0])&&nodes.forEach(function(node){void 0!==node.id&&_this5.nodeTable.set(node.id,node)}),this.emit("openNode",node),this.update(),!0},InfiniteTree.prototype.removeChildNodes=function(parentNode){var _this6=this;if(ensureNodeInstance(parentNode),0===parentNode.children.length)return!1;var parentNodeIndex=this.nodes.indexOf(parentNode);if(parentNodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=parentNodeIndex+1,rangeTo=parentNodeIndex+parentNode.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(parentNode)}parentNode.children=[],parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=parentNode.state.total,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return parentNodeIndex>=0&&(this.nodes.splice(parentNodeIndex+1,deleteCount),this.rows.splice(parentNodeIndex+1,deleteCount),this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var childNodes=_this6.flattenChildNodes(parentNode);_this6.state.openNodes=_this6.state.openNodes.filter(function(node){return childNodes.indexOf(node)<0}),childNodes.forEach(function(node){_this6.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.removeNode=function(node){var _this7=this;ensureNodeInstance(node);var parentNode=node.parent;if(!parentNode)return!1;var nodeIndex=this.nodes.indexOf(node),parentNodeIndex=this.nodes.indexOf(parentNode);if(nodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex,rangeTo=nodeIndex+node.state.total+1;if(selectedIndex>=rangeFrom&&rangeTo>=selectedIndex){var selectedNode=node.getNextSibling()||node.getPreviousSibling()||node.getParent();this.selectNode(selectedNode)}}parentNode.children.splice(parentNode.children.indexOf(node),1),parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=node.state.total+1,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return nodeIndex>=0&&(this.nodes.splice(nodeIndex,deleteCount),this.rows.splice(nodeIndex,deleteCount)),parentNodeIndex>=0&&(this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var nodes=_this7.flattenNode(node);_this7.state.openNodes=_this7.state.openNodes.filter(function(node){return nodes.indexOf(node)<0}),nodes.forEach(function(node){_this7.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.scrollToNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)return-1;if(!this.contentElement)return-1;var firstChild=this.contentElement.querySelectorAll(".tree-item")[0],rowHeight=firstChild&&firstChild.offsetHeight||0;return this.scrollTop(nodeIndex*rowHeight)},InfiniteTree.prototype.scrollTop=function(value){return this.scrollElement?(void 0!==value&&(this.scrollElement.scrollTop=Number(value)),this.scrollElement.scrollTop):0},InfiniteTree.prototype.selectNode=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],_options=this.options,selectable=_options.selectable,shouldSelectNode=_options.shouldSelectNode;if(!selectable)return!1;if("function"==typeof shouldSelectNode&&!shouldSelectNode(node))return!1;if(null===node){if(this.state.selectedNode){var selectedNode=this.state.selectedNode,selectedIndex=this.nodes.indexOf(selectedNode);return selectedNode.state.selected=!1,this.rows[selectedIndex]=this.options.rowRenderer(selectedNode,this.options),this.state.selectedNode=null,this.emit("selectNode",null),this.update(),!0}return!1}ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.selectedNode!==node&&(node.state.selected=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options)),this.state.selectedNode){var _selectedNode=this.state.selectedNode,_selectedIndex=this.nodes.indexOf(_selectedNode);_selectedNode.state.selected=!1,this.rows[_selectedIndex]=this.options.rowRenderer(_selectedNode,this.options)}return this.state.selectedNode!==node?(this.state.selectedNode=node,this.emit("selectNode",node)):(this.state.selectedNode=null,this.emit("selectNode",null)),this.update(),!0},InfiniteTree.prototype.toggleNode=function(node){this.state.openNodes.indexOf(node)>=0?this.closeNode(node):this.openNode(node)},InfiniteTree.prototype.toString=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],traverse=function traverse(node){var s="[";if(node&&node.children)for(var _loop=function(i){var list=[];s+="{",Object.keys(node).forEach(function(key){var value=node[key];if("parent"!==key)return"children"===key?void list.push('"'+key+'":'+traverse(node.children[i])):void("string"==typeof value||"object"===("undefined"==typeof value?"undefined":_typeof(value))?list.push('"'+key+'":'+JSON.stringify(value)):list.push('"'+key+'":'+value))}),s+=list.join(","),s=s+"}"+(i===node.children.length-1?"":",")},i=0;i=0&&(this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update())},InfiniteTree}(_events2["default"].EventEmitter);exports["default"]=InfiniteTree},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){!function(name,definition){module.exports=definition()}("Clusterize",function(){"use strict";function on(evt,element,fnc){return element.addEventListener?element.addEventListener(evt,fnc,!1):element.attachEvent("on"+evt,fnc)}function off(evt,element,fnc){return element.removeEventListener?element.removeEventListener(evt,fnc,!1):element.detachEvent("on"+evt,fnc)}function isArray(arr){return"[object Array]"===Object.prototype.toString.call(arr)}function getStyle(prop,elem){return window.getComputedStyle?window.getComputedStyle(elem)[prop]:elem.currentStyle[prop]}var ie=function(){for(var v=3,el=document.createElement("b"),all=el.all||[];el.innerHTML="",all[0];);return v>4?v:document.documentMode}(),is_mac=navigator.platform.toLowerCase().indexOf("mac")+1,Clusterize=function(data){if(!(this instanceof Clusterize))return new Clusterize(data);var self=this,defaults={item_height:0,block_height:0,rows_in_block:50,rows_in_cluster:0,cluster_height:0,blocks_in_cluster:4,tag:null,content_tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,callbacks:{},scroll_top:0};self.options={};for(var option,options=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","callbacks"],i=0;option=options[i];i++)self.options[option]="undefined"!=typeof data[option]&&null!=data[option]?data[option]:defaults[option];for(var elem,elems=["scroll","content"],i=0;elem=elems[i];i++)if(self[elem+"_elem"]=data[elem+"Id"]?document.getElementById(data[elem+"Id"]):data[elem+"Elem"],!self[elem+"_elem"])throw new Error("Error! Could not find "+elem+" element");self.content_elem.hasAttribute("tabindex")||self.content_elem.setAttribute("tabindex",0);var rows=isArray(data.rows)?data.rows:self.fetchMarkup(),cache={data:"",bottom:0},scroll_top=self.scroll_elem.scrollTop;self.exploreEnvironment(rows),self.insertToDOM(rows,cache),self.scroll_elem.scrollTop=scroll_top;var last_cluster=!1,scroll_debounce=0,pointer_events_set=!1,scrollEv=function(){is_mac&&(pointer_events_set||(self.content_elem.style.pointerEvents="none"),pointer_events_set=!0,clearTimeout(scroll_debounce),scroll_debounce=setTimeout(function(){self.content_elem.style.pointerEvents="auto",pointer_events_set=!1},50)),last_cluster!=(last_cluster=self.getClusterNum())&&self.insertToDOM(rows,cache),self.options.callbacks.scrollingProgress&&self.options.callbacks.scrollingProgress(self.getScrollProgress())},resize_debounce=0,resizeEv=function(){clearTimeout(resize_debounce),resize_debounce=setTimeout(self.refresh,100)};on("scroll",self.scroll_elem,scrollEv),on("resize",window,resizeEv),self.destroy=function(clean){off("scroll",self.scroll_elem,scrollEv),off("resize",window,resizeEv),self.html((clean?self.generateEmptyRow():rows).join(""))},self.refresh=function(){self.getRowsHeight(rows)&&self.update(rows)},self.update=function(new_rows){rows=isArray(new_rows)?new_rows:[];var scroll_top=self.scroll_elem.scrollTop;rows.length*self.options.item_height=ie&&!opts.tag&&(opts.tag=rows[0].match(/<([^>\s\/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&this.html(rows[0]+rows[0]+rows[0]),opts.tag||(opts.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(rows))},getRowsHeight:function(rows){var opts=this.options,prev_item_height=opts.item_height;if(opts.cluster_height=0,rows.length){var nodes=this.content_elem.children;return opts.item_height=nodes[Math.floor(nodes.length/2)].offsetHeight,"tr"==opts.tag&&"collapse"!=getStyle("borderCollapse",this.content_elem)&&(opts.item_height+=parseInt(getStyle("borderSpacing",this.content_elem))||0),opts.block_height=opts.item_height*opts.rows_in_block,opts.rows_in_cluster=opts.blocks_in_cluster*opts.rows_in_block,opts.cluster_height=opts.blocks_in_cluster*opts.block_height,prev_item_height!=opts.item_height}},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var opts=this.options;if(!opts.tag||!opts.show_no_data_row)return[];var td,empty_row=document.createElement(opts.tag),no_data_content=document.createTextNode(opts.no_data_text);return empty_row.className=opts.no_data_class,"tr"==opts.tag&&(td=document.createElement("td"),td.appendChild(no_data_content)),empty_row.appendChild(td||no_data_content),[empty_row.outerHTML]},generate:function(rows,cluster_num){var opts=this.options,rows_len=rows.length;if(rows_lentop_offset&&rows_above++;for(var i=items_start;items_end>i;i++)rows[i]&&this_cluster_rows.push(rows[i]);return{top_offset:top_offset,bottom_offset:bottom_offset,rows_above:rows_above,rows:this_cluster_rows}},renderExtraTag:function(class_name,height){var tag=document.createElement(this.options.tag),clusterize_prefix="clusterize-";return tag.className=[clusterize_prefix+"extra-row",clusterize_prefix+class_name].join(" "),height&&(tag.style.height=height+"px"),tag.outerHTML},insertToDOM:function(rows,cache){var data=this.generate(rows,this.getClusterNum()),this_cluster_rows=data.rows.join(""),this_cluster_content_changed=this.checkChanges("data",this_cluster_rows,cache),only_bottom_offset_changed=this.checkChanges("bottom",data.bottom_offset,cache),callbacks=this.options.callbacks,layout=[];this_cluster_content_changed?(data.top_offset&&(this.options.keep_parity&&layout.push(this.renderExtraTag("keep-parity")),layout.push(this.renderExtraTag("top-space",data.top_offset))),layout.push(this_cluster_rows),data.bottom_offset&&layout.push(this.renderExtraTag("bottom-space",data.bottom_offset)),callbacks.clusterWillChange&&callbacks.clusterWillChange(),this.html(layout.join("")),"ol"==this.options.content_tag&&this.content_elem.setAttribute("start",data.rows_above),callbacks.clusterChanged&&callbacks.clusterChanged()):only_bottom_offset_changed&&(this.content_elem.lastChild.style.height=data.bottom_offset+"px")},html:function(data){var content_elem=this.content_elem;if(ie&&9>=ie&&"tr"==this.options.tag){var last,div=document.createElement("div");for(div.innerHTML="
"+data+"
";last=content_elem.lastChild;)content_elem.removeChild(last);for(var rows_nodes=this.getChildNodes(div.firstChild.firstChild);rows_nodes.length;)content_elem.appendChild(rows_nodes.shift())}else content_elem.innerHTML=data;
+/*! infinite-tree v0.8.2 | (c) 2016 Cheton Wu | MIT | https://github.com/cheton/infinite-tree */
+!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.InfiniteTree=factory():root.InfiniteTree=factory()}(this,function(){return function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _infiniteTree=__webpack_require__(1),_infiniteTree2=_interopRequireDefault(_infiniteTree);module.exports=_infiniteTree2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},_events=__webpack_require__(2),_events2=_interopRequireDefault(_events),_clusterize=__webpack_require__(3),_clusterize2=_interopRequireDefault(_clusterize),_flattree=__webpack_require__(4),_lookupTable=__webpack_require__(8),_lookupTable2=_interopRequireDefault(_lookupTable),_renderer=__webpack_require__(9),_helper=__webpack_require__(10),ensureNodeInstance=function(node){if(!(node instanceof _flattree.Node))throw new Error("The node must be a Node object.");return!0},InfiniteTree=function(_events$EventEmitter){function InfiniteTree(el,options){_classCallCheck(this,InfiniteTree);var _this=_possibleConstructorReturn(this,_events$EventEmitter.call(this));return _this.options={autoOpen:!1,droppable:!1,el:null,loadNodes:null,rowRenderer:_renderer.defaultRowRenderer,selectable:!0,shouldSelectNode:null},_this.state={openNodes:[],rootNode:null,selectedNode:null},_this.clusterize=null,_this.nodeTable=new _lookupTable2["default"],_this.nodes=[],_this.rows=[],_this.scrollElement=null,_this.contentElement=null,_this.dragoverElement=null,_this.contentListener={click:function(e){var itemTarget=null,handleToggler=!1;for((0,_helper.stopPropagation)(e),e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget.className.indexOf("tree-toggler")>=0&&(handleToggler=!0),itemTarget=itemTarget.parentElement;if(itemTarget){var id=itemTarget.getAttribute("aria-id"),node=_this.getNodeById(id);if(node)return handleToggler?void _this.toggleNode(node):void _this.selectNode(node)}},dragenter:function(e){var itemTarget=null;for(e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget=itemTarget.parentElement;if(itemTarget&&_this.dragoverElement!==itemTarget){if((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,!itemTarget.hasAttribute("droppable"))return;var canDrop=!itemTarget.getAttribute("droppable").match(/false/i);canDrop&&((0,_helper.addClass)(itemTarget,"highlight"),_this.dragoverElement=itemTarget)}},dragend:function(e){_this.dragoverElement&&((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null)},dragover:function(e){return(0,_helper.preventDefault)(e),e.dataTransfer.dropEffect="move",!1},drop:function(e){if((0,_helper.preventDefault)(e),_this.dragoverElement){var id=_this.dragoverElement.getAttribute("aria-id"),node=_this.getNodeById(id);(0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,_this.emit("dropNode",node,e)}}},(0,_helper.isDOMElement)(el)?options.el=el:options=el,_this.options=(0,_helper.extend)({},_this.options,options),_this.options.el?(_this.create(),options.data&&_this.loadData(options.data),_this):(console.error("Failed to initialize infinite-tree: el is not specified.",options),_possibleConstructorReturn(_this))}return _inherits(InfiniteTree,_events$EventEmitter),InfiniteTree.prototype.create=function(){var _this2=this;if(!this.options.el)throw new Error("The element option is not specified.");var scrollElement=document.createElement("div");scrollElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-scroll");var contentElement=document.createElement("div");contentElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-content"),scrollElement.appendChild(contentElement),this.options.el.appendChild(scrollElement),this.clusterize=new _clusterize2["default"]({tag:"div",rows:[],scrollElem:scrollElement,contentElem:contentElement,no_data_class:"infinite-tree-no-data",callbacks:{clusterWillChange:function(){},clusterChanged:function(){},scrollingProgress:function(progress){_this2.emit("scrollProgress",progress)}}}),this.scrollElement=scrollElement,this.contentElement=contentElement,(0,_helper.addEventListener)(this.contentElement,"click",this.contentListener.click),this.options.droppable&&((0,_helper.addEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.addEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.addEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.addEventListener)(this.contentElement,"drop",this.contentListener.drop))},InfiniteTree.prototype.destroy=function(){for((0,_helper.removeEventListener)(this.contentElement,"click",this.contentListener),this.options.droppable&&((0,_helper.removeEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.removeEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.removeEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.removeEventListener)(this.contentElement,"drop",this.contentListener.drop)),this.clear(),this.clusterize&&(this.clusterize.destroy(!0),this.clusterize=null);this.contentElement.firstChild;)this.contentElement.removeChild(this.contentElement.firstChild);for(;this.scrollElement.firstChild;)this.scrollElement.removeChild(this.scrollElement.firstChild);if(this.options.el)for(var containerElement=this.options.el;containerElement.firstChild;)containerElement.removeChild(containerElement.firstChild);this.contentElement=null,this.scrollElement=null},InfiniteTree.prototype.addChildNodes=function(newNodes,index,parentNode){var _this3=this;if(newNodes=[].concat(newNodes||[]),0===newNodes.length)return!1;"object"===("undefined"==typeof index?"undefined":_typeof(index))?(parentNode=index||this.state.rootNode,index=parentNode.children.length):parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),newNodes.forEach(function(newNode){newNode.parent=parentNode}),parentNode.children.splice.apply(parentNode.children,[index,0].concat(newNodes)),index=parentNode.children.indexOf(newNodes[0]);var deleteCount=parentNode.state.total,nodes=(0,_flattree.flatten)(parentNode.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this3.options.rowRenderer(node,_this3.options)});if(parentNode===this.state.rootNode)this.nodes=nodes,this.rows=rows;else{var parentOffset=this.nodes.indexOf(parentNode);parentOffset>=0&&(this.nodes.splice.apply(this.nodes,[parentOffset+1,deleteCount].concat(nodes)),this.rows.splice.apply(this.rows,[parentOffset+1,deleteCount].concat(rows)),this.rows[parentOffset]=this.options.rowRenderer(parentNode,this.options))}return parentNode.children.slice(index).forEach(function(childNode){_this3.flattenNode(childNode).forEach(function(node){void 0!==node.id&&_this3.nodeTable.set(node.id,node)})}),this.update(),!0},InfiniteTree.prototype.appendChildNode=function(newNode,parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);var index=parentNode.children.length,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.clear=function(){this.clusterize.clear(),this.nodeTable.clear(),this.nodes=[],this.rows=[],this.state.openNodes=[],this.state.rootNode=null,this.state.selectedNode=null},InfiniteTree.prototype.closeNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)<0)return!1;if(this.state.selectedNode&&this.state.selectedNode!==node){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex+1,rangeTo=nodeIndex+node.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(node)}node.state.open=!1;var openNodes=this.state.openNodes.filter(function(node){return node.hasChildren()&&node.state.open});this.state.openNodes=openNodes;for(var deleteCount=node.state.total,p=node;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return this.nodes.splice(nodeIndex+1,deleteCount),this.rows.splice(nodeIndex+1,deleteCount),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.emit("closeNode",node),this.update(),!0},InfiniteTree.prototype.flattenChildNodes=function(parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);for(var list=[],node=parentNode.getFirstChild();node;)if(list.push(node),node.hasChildren())node=node.getFirstChild();else{for(;null===node.getNextSibling()&&node.parent!==parentNode;)node=node.getParent();node=node.getNextSibling()}return list},InfiniteTree.prototype.flattenNode=function(node){return[node].concat(this.flattenChildNodes(node))},InfiniteTree.prototype.getChildNodes=function(parentNode){return parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),parentNode.children},InfiniteTree.prototype.getNodeById=function(id){var node=this.nodeTable.get(id);if(!node){if(node=this.nodes.filter(function(node){return node.id===id})[0],!node)return null;this.nodeTable.set(node.id,node)}return node},InfiniteTree.prototype.getOpenNodes=function(){return this.state.openNodes.slice()},InfiniteTree.prototype.getRootNode=function(){return this.state.rootNode},InfiniteTree.prototype.getSelectedNode=function(){return this.state.selectedNode},InfiniteTree.prototype.insertNodeAfter=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode)+1,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.insertNodeBefore=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode),newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.loadData=function(){var _this4=this,data=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.nodes=(0,_flattree.flatten)(data,{openAllNodes:this.options.autoOpen}),this.nodeTable.clear(),this.state.openNodes=this.nodes.filter(function(node){return node.hasChildren()&&node.state.open}),this.state.rootNode=function(){for(var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0];node&&null!==node.parent;)node=node.parent;return node}(this.nodes[0]),this.state.selectedNode=null,this.flattenChildNodes(this.state.rootNode).forEach(function(node){void 0!==node.id&&_this4.nodeTable.set(node.id,node)}),this.rows=this.nodes.map(function(node){return _this4.options.rowRenderer(node,_this4.options)}),this.update()},InfiniteTree.prototype.openNode=function(node){var _this5=this;ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)>=0)return!1;if(!node.hasChildren()&&node.loadOnDemand)return"function"!=typeof this.options.loadNodes?!1:(node.state.loading=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update(),this.options.loadNodes(node,function(err,nodes){node.state.loading=!1,_this5.rows[nodeIndex]=_this5.options.rowRenderer(node,_this5.options),_this5.update(),err||(nodes.forEach(function(childNode){_this5.appendChildNode(childNode,node)}),node.hasChildren()&&_this5.openNode(node))}),!1);node.state.open=!0;var openNodes=[node].concat(this.state.openNodes);this.state.openNodes=openNodes;var nodes=(0,_flattree.flatten)(node.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this5.options.rowRenderer(node,_this5.options)});return this.nodes.splice.apply(this.nodes,[nodeIndex+1,0].concat(nodes)),this.rows.splice.apply(this.rows,[nodeIndex+1,0].concat(rows)),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),nodes.length>0&&!this.nodeTable.get(nodes[0])&&nodes.forEach(function(node){void 0!==node.id&&_this5.nodeTable.set(node.id,node)}),this.emit("openNode",node),this.update(),!0},InfiniteTree.prototype.removeChildNodes=function(parentNode){var _this6=this;if(ensureNodeInstance(parentNode),0===parentNode.children.length)return!1;var parentNodeIndex=this.nodes.indexOf(parentNode);if(parentNodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=parentNodeIndex+1,rangeTo=parentNodeIndex+parentNode.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(parentNode)}parentNode.children=[],parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=parentNode.state.total,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return parentNodeIndex>=0&&(this.nodes.splice(parentNodeIndex+1,deleteCount),this.rows.splice(parentNodeIndex+1,deleteCount),this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var childNodes=_this6.flattenChildNodes(parentNode);_this6.state.openNodes=_this6.state.openNodes.filter(function(node){return childNodes.indexOf(node)<0}),childNodes.forEach(function(node){_this6.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.removeNode=function(node){var _this7=this;ensureNodeInstance(node);var parentNode=node.parent;if(!parentNode)return!1;var nodeIndex=this.nodes.indexOf(node),parentNodeIndex=this.nodes.indexOf(parentNode);if(nodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex,rangeTo=nodeIndex+node.state.total+1;if(selectedIndex>=rangeFrom&&rangeTo>=selectedIndex){var selectedNode=node.getNextSibling()||node.getPreviousSibling()||node.getParent();this.selectNode(selectedNode)}}parentNode.children.splice(parentNode.children.indexOf(node),1),parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=node.state.total+1,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return nodeIndex>=0&&(this.nodes.splice(nodeIndex,deleteCount),this.rows.splice(nodeIndex,deleteCount)),parentNodeIndex>=0&&(this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var nodes=_this7.flattenNode(node);_this7.state.openNodes=_this7.state.openNodes.filter(function(node){return nodes.indexOf(node)<0}),nodes.forEach(function(node){_this7.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.scrollToNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)return-1;if(!this.contentElement)return-1;var firstChild=this.contentElement.querySelectorAll(".tree-item")[0],rowHeight=firstChild&&firstChild.offsetHeight||0;return this.scrollTop(nodeIndex*rowHeight)},InfiniteTree.prototype.scrollTop=function(value){return this.scrollElement?(void 0!==value&&(this.scrollElement.scrollTop=Number(value)),this.scrollElement.scrollTop):0},InfiniteTree.prototype.selectNode=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],_options=this.options,selectable=_options.selectable,shouldSelectNode=_options.shouldSelectNode;if(!selectable)return!1;if("function"==typeof shouldSelectNode&&!shouldSelectNode(node))return!1;if(null===node){if(this.state.selectedNode){var selectedNode=this.state.selectedNode,selectedIndex=this.nodes.indexOf(selectedNode);return selectedNode.state.selected=!1,this.rows[selectedIndex]=this.options.rowRenderer(selectedNode,this.options),this.state.selectedNode=null,this.emit("selectNode",null),this.update(),!0}return!1}ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.selectedNode!==node&&(node.state.selected=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options)),this.state.selectedNode){var _selectedNode=this.state.selectedNode,_selectedIndex=this.nodes.indexOf(_selectedNode);_selectedNode.state.selected=!1,this.rows[_selectedIndex]=this.options.rowRenderer(_selectedNode,this.options)}return this.state.selectedNode!==node?(this.state.selectedNode=node,this.emit("selectNode",node)):(this.state.selectedNode=null,this.emit("selectNode",null)),this.update(),!0},InfiniteTree.prototype.toggleNode=function(node){this.state.openNodes.indexOf(node)>=0?this.closeNode(node):this.openNode(node)},InfiniteTree.prototype.toString=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],traverse=function traverse(node){var s="[";if(node&&node.children)for(var _loop=function(i){var list=[];s+="{",Object.keys(node).forEach(function(key){var value=node[key];if("parent"!==key)return"children"===key?void list.push('"'+key+'":'+traverse(node.children[i])):void("string"==typeof value||"object"===("undefined"==typeof value?"undefined":_typeof(value))?list.push('"'+key+'":'+JSON.stringify(value)):list.push('"'+key+'":'+value))}),s+=list.join(","),s=s+"}"+(i===node.children.length-1?"":",")},i=0;i=0&&(this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update())},InfiniteTree}(_events2["default"].EventEmitter);exports["default"]=InfiniteTree},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){!function(name,definition){module.exports=definition()}("Clusterize",function(){"use strict";function on(evt,element,fnc){return element.addEventListener?element.addEventListener(evt,fnc,!1):element.attachEvent("on"+evt,fnc)}function off(evt,element,fnc){return element.removeEventListener?element.removeEventListener(evt,fnc,!1):element.detachEvent("on"+evt,fnc)}function isArray(arr){return"[object Array]"===Object.prototype.toString.call(arr)}function getStyle(prop,elem){return window.getComputedStyle?window.getComputedStyle(elem)[prop]:elem.currentStyle[prop]}var ie=function(){for(var v=3,el=document.createElement("b"),all=el.all||[];el.innerHTML="",all[0];);return v>4?v:document.documentMode}(),is_mac=navigator.platform.toLowerCase().indexOf("mac")+1,Clusterize=function(data){if(!(this instanceof Clusterize))return new Clusterize(data);var self=this,defaults={item_height:0,block_height:0,rows_in_block:50,rows_in_cluster:0,cluster_height:0,blocks_in_cluster:4,tag:null,content_tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,callbacks:{},scroll_top:0};self.options={};for(var option,options=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","callbacks"],i=0;option=options[i];i++)self.options[option]="undefined"!=typeof data[option]&&null!=data[option]?data[option]:defaults[option];for(var elem,elems=["scroll","content"],i=0;elem=elems[i];i++)if(self[elem+"_elem"]=data[elem+"Id"]?document.getElementById(data[elem+"Id"]):data[elem+"Elem"],!self[elem+"_elem"])throw new Error("Error! Could not find "+elem+" element");self.content_elem.hasAttribute("tabindex")||self.content_elem.setAttribute("tabindex",0);var rows=isArray(data.rows)?data.rows:self.fetchMarkup(),cache={data:"",bottom:0},scroll_top=self.scroll_elem.scrollTop;self.exploreEnvironment(rows),self.insertToDOM(rows,cache),self.scroll_elem.scrollTop=scroll_top;var last_cluster=!1,scroll_debounce=0,pointer_events_set=!1,scrollEv=function(){is_mac&&(pointer_events_set||(self.content_elem.style.pointerEvents="none"),pointer_events_set=!0,clearTimeout(scroll_debounce),scroll_debounce=setTimeout(function(){self.content_elem.style.pointerEvents="auto",pointer_events_set=!1},50)),last_cluster!=(last_cluster=self.getClusterNum())&&self.insertToDOM(rows,cache),self.options.callbacks.scrollingProgress&&self.options.callbacks.scrollingProgress(self.getScrollProgress())},resize_debounce=0,resizeEv=function(){clearTimeout(resize_debounce),resize_debounce=setTimeout(self.refresh,100)};on("scroll",self.scroll_elem,scrollEv),on("resize",window,resizeEv),self.destroy=function(clean){off("scroll",self.scroll_elem,scrollEv),off("resize",window,resizeEv),self.html((clean?self.generateEmptyRow():rows).join(""))},self.refresh=function(){self.getRowsHeight(rows)&&self.update(rows)},self.update=function(new_rows){rows=isArray(new_rows)?new_rows:[];var scroll_top=self.scroll_elem.scrollTop;rows.length*self.options.item_height=ie&&!opts.tag&&(opts.tag=rows[0].match(/<([^>\s\/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&this.html(rows[0]+rows[0]+rows[0]),opts.tag||(opts.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(rows))},getRowsHeight:function(rows){var opts=this.options,prev_item_height=opts.item_height;if(opts.cluster_height=0,rows.length){var nodes=this.content_elem.children;return opts.item_height=nodes[Math.floor(nodes.length/2)].offsetHeight,"tr"==opts.tag&&"collapse"!=getStyle("borderCollapse",this.content_elem)&&(opts.item_height+=parseInt(getStyle("borderSpacing",this.content_elem))||0),opts.block_height=opts.item_height*opts.rows_in_block,opts.rows_in_cluster=opts.blocks_in_cluster*opts.rows_in_block,opts.cluster_height=opts.blocks_in_cluster*opts.block_height,prev_item_height!=opts.item_height}},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var opts=this.options;if(!opts.tag||!opts.show_no_data_row)return[];var td,empty_row=document.createElement(opts.tag),no_data_content=document.createTextNode(opts.no_data_text);return empty_row.className=opts.no_data_class,"tr"==opts.tag&&(td=document.createElement("td"),td.appendChild(no_data_content)),empty_row.appendChild(td||no_data_content),[empty_row.outerHTML]},generate:function(rows,cluster_num){var opts=this.options,rows_len=rows.length;if(rows_lentop_offset&&rows_above++;for(var i=items_start;items_end>i;i++)rows[i]&&this_cluster_rows.push(rows[i]);return{top_offset:top_offset,bottom_offset:bottom_offset,rows_above:rows_above,rows:this_cluster_rows}},renderExtraTag:function(class_name,height){var tag=document.createElement(this.options.tag),clusterize_prefix="clusterize-";return tag.className=[clusterize_prefix+"extra-row",clusterize_prefix+class_name].join(" "),height&&(tag.style.height=height+"px"),tag.outerHTML},insertToDOM:function(rows,cache){var data=this.generate(rows,this.getClusterNum()),this_cluster_rows=data.rows.join(""),this_cluster_content_changed=this.checkChanges("data",this_cluster_rows,cache),only_bottom_offset_changed=this.checkChanges("bottom",data.bottom_offset,cache),callbacks=this.options.callbacks,layout=[];this_cluster_content_changed?(data.top_offset&&(this.options.keep_parity&&layout.push(this.renderExtraTag("keep-parity")),layout.push(this.renderExtraTag("top-space",data.top_offset))),layout.push(this_cluster_rows),data.bottom_offset&&layout.push(this.renderExtraTag("bottom-space",data.bottom_offset)),callbacks.clusterWillChange&&callbacks.clusterWillChange(),this.html(layout.join("")),"ol"==this.options.content_tag&&this.content_elem.setAttribute("start",data.rows_above),callbacks.clusterChanged&&callbacks.clusterChanged()):only_bottom_offset_changed&&(this.content_elem.lastChild.style.height=data.bottom_offset+"px")},html:function(data){var content_elem=this.content_elem;if(ie&&9>=ie&&"tr"==this.options.tag){var last,div=document.createElement("div");for(div.innerHTML="
"+data+"
";last=content_elem.lastChild;)content_elem.removeChild(last);for(var rows_nodes=this.getChildNodes(div.firstChild.firstChild);rows_nodes.length;)content_elem.appendChild(rows_nodes.shift())}else content_elem.innerHTML=data;
},getChildNodes:function(tag){for(var child_nodes=tag.children,nodes=[],i=0,ii=child_nodes.length;ii>i;i++)nodes.push(child_nodes[i]);return nodes},checkChanges:function(type,value,cache){var changed=value!=cache[type];return cache[type]=value,changed}},Clusterize})},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0,exports.Node=exports.flatten=void 0;var _flatten=__webpack_require__(5),_flatten2=_interopRequireDefault(_flatten),_node=__webpack_require__(7),_node2=_interopRequireDefault(_node);exports.flatten=_flatten2["default"],exports.Node=_node2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0;var _extend=__webpack_require__(6),_extend2=_interopRequireDefault(_extend),_node=__webpack_require__(7),_node2=_interopRequireDefault(_node),flatten=function flatten(){var nodes=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];nodes=[].concat(nodes);var flatten=[],stack=[],pool={lastChild:{}};options.openAllNodes=!!options.openAllNodes,options.openNodes=options.openNodes||[],options.throwOnError=!!options.throwOnError;var firstNode=nodes.length>0?nodes[0]:null,parentNode=firstNode?firstNode.parent:null;!parentNode||parentNode instanceof _node2["default"]||(parentNode=new _node2["default"](parentNode));var rootNode=parentNode||new _node2["default"]({label:"",parent:null,children:nodes,state:{depth:-1,open:!0,path:"",prefixMask:"",total:0}});if(rootNode===parentNode)for(var subtotal=rootNode.state.total||0,p=rootNode;p;){var _p$state=p.state,path=_p$state.path,_p$state$total=_p$state.total,total=void 0===_p$state$total?0:_p$state$total;if(p.isLastChild()&&path&&(pool.lastChild[path]=!0),p.state.total=total-subtotal,p.state.total<0){if(options.throwOnError)throw new Error("The node might have been corrupted: id="+JSON.stringify(p.id)+", state="+JSON.stringify(p.state));console&&console.log("Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s",JSON.stringify(p.id),JSON.stringify(p.label),p.parent,p.children,JSON.stringify(p.state))}p=p.parent}for(stack.push([rootNode,rootNode.state.depth,0]);stack.length>0;)for(var _stack$pop=stack.pop(),current=_stack$pop[0],depth=_stack$pop[1],index=_stack$pop[2],_loop=function(){var node=current.children[index];node instanceof _node2["default"]||(node=new _node2["default"](node)),node.parent=current,node.children=node.children||[],node.parent.children[index]=node;var path=current.state.path+"."+index,open=node.hasChildren()&&function(){var openAllNodes=options.openAllNodes,openNodes=options.openNodes;return openAllNodes?!0:openNodes.indexOf(node)>=0?!0:openNodes.indexOf(node.id)>=0}(),prefixMask=function(prefix){for(var mask="";prefix.length>0;)prefix=prefix.replace(/\.\d+$/,""),mask=!prefix||pool.lastChild[prefix]?"0"+mask:"1"+mask;return mask}(path);node.isLastChild()&&(pool.lastChild[path]=!0),node.state=(0,_extend2["default"])({},node.state,{depth:depth+1,open:open,path:path,prefixMask:prefixMask,total:0});for(var parentDidOpen=!0,_p=node;null!==_p.parent;){if(_p.parent.state.open===!1){parentDidOpen=!1;break}_p=_p.parent}if(parentDidOpen){flatten.push(node);for(var _p2=node;null!==_p2.parent;)_p2.parent.state.total++,_p2=_p2.parent}++index,node.hasChildren()&&(stack.push([current,depth,index]),index=0,depth+=1,current=node)};index1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];if(void 0===target||null===target)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(target),index=0;index0&&index>=0&&index0&&(node=this.children[0]),node},Node.prototype.getLastChild=function(){var node=null;return this.children.length>0&&(node=this.children[this.children.length-1]),node},Node.prototype.getNextSibling=function(){var node=null;if(this.parent){var index=this.parent.children.indexOf(this);index>=0&&index0&&index0},Node.prototype.isLastChild=function(){var hasNextSibling=this.getNextSibling();return!hasNextSibling},Node}();exports["default"]=Node},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var LookupTable=function(){function LookupTable(){_classCallCheck(this,LookupTable),this.data={}}return LookupTable.prototype.clear=function(){this.data={}},LookupTable.prototype.get=function(key){return this.data[key]},LookupTable.prototype.has=function(key){return void 0!==this.data[key]},LookupTable.prototype.set=function(key,value){return this.data[key]=value,value},LookupTable.prototype.unset=function(key){void 0!==this.data[key]&&delete this.data[key]},LookupTable}();exports["default"]=LookupTable},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.defaultRowRenderer=void 0;var _helper=__webpack_require__(10),defaultRowRenderer=function(node,treeOptions){var id=node.id,label=node.label,_node$loadOnDemand=node.loadOnDemand,loadOnDemand=void 0===_node$loadOnDemand?!1:_node$loadOnDemand,children=node.children,state=node.state,depth=state.depth,open=state.open,path=state.path,total=state.total,_state$selected=state.selected,selected=void 0===_state$selected?!1:_state$selected,childrenLength=Object.keys(children).length,more=node.hasChildren(),togglerContent="";more&&open&&(togglerContent="▼"),more&&!open&&(togglerContent="►"),!more&&loadOnDemand&&(togglerContent="►");var toggler=(0,_helper.buildHTML)("a",togglerContent,{"class":function(){return more&&open?(0,_helper.classNames)("tree-toggler"):more&&!open?(0,_helper.classNames)("tree-toggler","tree-closed"):!more&&loadOnDemand?(0,_helper.classNames)("tree-toggler","tree-closed"):""}()}),title=(0,_helper.buildHTML)("span",(0,_helper.quoteattr)(label),{"class":(0,_helper.classNames)("tree-title")}),treeNode=(0,_helper.buildHTML)("div",toggler+title,{"class":"tree-node",style:"margin-left: "+18*depth+"px"});return(0,_helper.buildHTML)("div",treeNode,{"aria-id":id,"aria-expanded":more&&open,"aria-depth":depth,"aria-path":path,"aria-selected":selected,"aria-children":childrenLength,"aria-total":total,"class":(0,_helper.classNames)("tree-item",{"tree-selected":selected}),droppable:!0})};exports.defaultRowRenderer=defaultRowRenderer},function(module,exports){"use strict";exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},extend=function(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];target=target||{};for(var index=0;index=0},addClass=function(el,className){if(!el)return"";if(!hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.concat(className).join(" ")}return el.className},removeClass=function(el,className){if(!el)return"";if(hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.filter(function(c){return c!==className}).join(" ")}return el.className},toggleClass=function(el,className){el&&(hasClass(el,className)?removeClass(el,className):addClass(el,className))},classNames=function classNames(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_len2>_key2;_key2++)args[_key2]=arguments[_key2];var classNames=[];return args.forEach(function(arg){Array.isArray(arg)?classNames=classNames.concat(arg):"object"===("undefined"==typeof arg?"undefined":_typeof(arg))?Object.keys(arg).forEach(function(className){var ok=arg[className];ok&&classNames.push(className)}):classNames.push(arg)}),classNames.join(" ")},isDOMElement=function(o){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?o instanceof HTMLElement:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&1===o.nodeType&&"string"==typeof o.nodeName},isDOMNode=function(o){return"object"===("undefined"==typeof Node?"undefined":_typeof(Node))?o instanceof Node:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName},quoteattr=function(s,preserveCR){return preserveCR=preserveCR?"
":"\n",(""+s).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">").replace(/\r\n/g,preserveCR).replace(/[\r\n]/g,preserveCR)},buildHTML=function buildHTML(tag,html,attrs){switch(tag){case"select":if("object"===("undefined"==typeof html?"undefined":_typeof(html))){var options=html||{};html="";for(var value in options)options.hasOwnProperty(value)&&(html+=buildHTML("option",options[value]||"",{value:value}))}break;default:"object"===("undefined"==typeof html?"undefined":_typeof(html))&&(attrs=html,html=void 0)}var h="<"+tag;for(var attr in attrs)attrs.hasOwnProperty(attr)&&"undefined"!=typeof attrs[attr]&&(h+=" "+attr+'="'+quoteattr(attrs[attr])+'"');return h+="undefined"!=typeof html?">"+html+""+tag+">":"/>"};exports.extend=extend,exports.preventDefault=preventDefault,exports.stopPropagation=stopPropagation,exports.dispatchEvent=dispatchEvent,exports.addEventListener=addEventListener,exports.removeEventListener=removeEventListener,exports.hasClass=hasClass,exports.addClass=addClass,exports.removeClass=removeClass,exports.toggleClass=toggleClass,exports.classNames=classNames,exports.isDOMElement=isDOMElement,exports.isDOMNode=isDOMNode,exports.quoteattr=quoteattr,exports.buildHTML=buildHTML}])});
\ No newline at end of file
diff --git a/examples/bundle.js b/examples/bundle.js
index b72c5a5..3cf8412 100644
--- a/examples/bundle.js
+++ b/examples/bundle.js
@@ -1,3 +1,3 @@
-!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _src=__webpack_require__(1),_src2=_interopRequireDefault(_src),_renderer=__webpack_require__(12),_renderer2=_interopRequireDefault(_renderer);__webpack_require__(13),__webpack_require__(17);for(var _helper=__webpack_require__(11),data=[],source='{"id":"","label":"","props":{"droppable":true},"children":[{"id":"alpha","label":"Alpha","props":{"droppable":true}},{"id":"bravo","label":"Bravo","props":{"droppable":true},"children":[{"id":"charlie","label":"Charlie","props":{"droppable":true},"children":[{"id":"delta","label":"Delta","props":{"droppable":true},"children":[{"id":"echo","label":"Echo","props":{"droppable":true}},{"id":"foxtrot","label":"Foxtrot","props":{"droppable":true}}]},{"id":"golf","label":"Golf","props":{"droppable":true}}]},{"id":"hotel","label":"Hotel","props":{"droppable":true},"children":[{"id":"india","label":"India","props":{"droppable":true},"children":[{"id":"juliet","label":"Juliet","props":{"droppable":true}}]}]},{"id":"kilo","label":"(Load On Demand) Kilo","loadOnDemand":true,"props":{"droppable":true}}]}]}',i=0;1e3>i;++i)data.push(JSON.parse(source.replace(/"(id|label)":"([^"]*)"/g,'"$1": "$2.'+i+'"')));var updatePreview=function(node){var el=document.querySelector("#preview");if(node){var o={id:node.id,label:node.label,children:node.children?node.children.length:0,parent:node.parent?node.parent.id:null,state:node.state};void 0!==node.loadOnDemand&&(o.loadOnDemand=node.loadOnDemand),el.innerHTML=JSON.stringify(o,null,2).replace(/\n/g," ").replace(/\s/g," ")}else el.innerHTML=""},tree=new _src2["default"](document.querySelector("#tree"),{autoOpen:!0,droppable:!0,loadNodes:function(parentNode,done){var suffix=parentNode.id.replace(/(\w)+/,""),nodes=[{id:"node1"+suffix,label:"Node 1"},{id:"node2"+suffix,label:"Node 2"}];setTimeout(function(){done(null,nodes)},1e3)},rowRenderer:_renderer2["default"],selectable:!0,shouldSelectNode:function(node){return!(!node||node===tree.getSelectedNode())}});tree.on("scrollProgress",function(progress){document.querySelector("#scrolling-progress").style.width=progress+"%"}),tree.on("update",function(){var node=tree.getSelectedNode();updatePreview(node)}),tree.on("openNode",function(node){console.log("openNode",node)}),tree.on("closeNode",function(node){console.log("closeNode",node)}),tree.on("dropNode",function(node,e){var source=e.dataTransfer.getData("text");console.log("Dragged an element "+JSON.stringify(source)+" and dropped to "+JSON.stringify(node.label)),document.querySelector("#dropped-result").innerHTML="Dropped to "+(0,_helper.quoteattr)(node.label)+""}),tree.on("selectNode",function(node){updatePreview(node)}),tree.loadData(data),tree.selectNode(tree.getChildNodes()[0]);var draggableElement=document.querySelector("#draggable-element");(0,_helper.addEventListener)(draggableElement,"selectstart",function(e){return(0,_helper.preventDefault)(e),(0,_helper.stopPropagation)(e),draggableElement.dragDrop(),!1}),(0,_helper.addEventListener)(draggableElement,"dragstart",function(e){e.dataTransfer.effectAllowed="move";var target=e.target||e.srcElement;e.dataTransfer.setData("text",target.id),document.querySelector("#dropped-result").innerHTML=""}),(0,_helper.addEventListener)(draggableElement,"dragend",function(e){}),window.tree=tree},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _infiniteTree=__webpack_require__(2),_infiniteTree2=_interopRequireDefault(_infiniteTree);module.exports=_infiniteTree2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},_events=__webpack_require__(3),_events2=_interopRequireDefault(_events),_clusterize=__webpack_require__(4),_clusterize2=_interopRequireDefault(_clusterize),_flattree=__webpack_require__(5),_lookupTable=__webpack_require__(9),_lookupTable2=_interopRequireDefault(_lookupTable),_renderer=__webpack_require__(10),_helper=__webpack_require__(11),ensureNodeInstance=function(node){if(!(node instanceof _flattree.Node))throw new Error("The node must be a Node object.");return!0},InfiniteTree=function(_events$EventEmitter){function InfiniteTree(el,options){_classCallCheck(this,InfiniteTree);var _this=_possibleConstructorReturn(this,_events$EventEmitter.call(this));return _this.options={autoOpen:!1,droppable:!1,el:null,loadNodes:null,rowRenderer:_renderer.defaultRowRenderer,selectable:!0,shouldSelectNode:null},_this.state={openNodes:[],rootNode:null,selectedNode:null},_this.clusterize=null,_this.nodeTable=new _lookupTable2["default"],_this.nodes=[],_this.rows=[],_this.scrollElement=null,_this.contentElement=null,_this.dragoverElement=null,_this.contentListener={click:function(e){var itemTarget=null,handleToggler=!1;for((0,_helper.stopPropagation)(e),e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget.className.indexOf("tree-toggler")>=0&&(handleToggler=!0),itemTarget=itemTarget.parentElement;if(itemTarget){var id=itemTarget.getAttribute("aria-id"),node=_this.getNodeById(id);if(node)return handleToggler?void _this.toggleNode(node):void _this.selectNode(node)}},dragenter:function(e){var itemTarget=null;for(e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget=itemTarget.parentElement;if(itemTarget&&_this.dragoverElement!==itemTarget){if((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,!itemTarget.hasAttribute("droppable"))return;var canDrop=!itemTarget.getAttribute("droppable").match(/false/i);canDrop&&((0,_helper.addClass)(itemTarget,"highlight"),_this.dragoverElement=itemTarget)}},dragend:function(e){_this.dragoverElement&&((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null)},dragover:function(e){return(0,_helper.preventDefault)(e),e.dataTransfer.dropEffect="move",!1},drop:function(e){if((0,_helper.preventDefault)(e),_this.dragoverElement){var id=_this.dragoverElement.getAttribute("aria-id"),node=_this.getNodeById(id);(0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,_this.emit("dropNode",node,e)}}},(0,_helper.isDOMElement)(el)?options.el=el:options=el,_this.options=(0,_helper.extend)({},_this.options,options),_this.options.el?(_this.create(),options.data&&_this.loadData(options.data),_this):(console.error("Failed to initialize infinite-tree: el is not specified.",options),_possibleConstructorReturn(_this))}return _inherits(InfiniteTree,_events$EventEmitter),InfiniteTree.prototype.create=function(){var _this2=this;if(!this.options.el)throw new Error("The element option is not specified.");var scrollElement=document.createElement("div");scrollElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-scroll");var contentElement=document.createElement("div");contentElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-content"),scrollElement.appendChild(contentElement),this.options.el.appendChild(scrollElement),this.clusterize=new _clusterize2["default"]({tag:"div",rows:[],scrollElem:scrollElement,contentElem:contentElement,no_data_class:"infinite-tree-no-data",callbacks:{clusterWillChange:function(){},clusterChanged:function(){},scrollingProgress:function(progress){_this2.emit("scrollProgress",progress)}}}),this.scrollElement=scrollElement,this.contentElement=contentElement,(0,_helper.addEventListener)(this.contentElement,"click",this.contentListener.click),this.options.droppable&&((0,_helper.addEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.addEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.addEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.addEventListener)(this.contentElement,"drop",this.contentListener.drop))},InfiniteTree.prototype.destroy=function(){for((0,_helper.removeEventListener)(this.contentElement,"click",this.contentListener),this.options.droppable&&((0,_helper.removeEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.removeEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.removeEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.removeEventListener)(this.contentElement,"drop",this.contentListener.drop)),this.clear(),this.clusterize&&(this.clusterize.destroy(!0),this.clusterize=null);this.contentElement.firstChild;)this.contentElement.removeChild(this.contentElement.firstChild);for(;this.scrollElement.firstChild;)this.scrollElement.removeChild(this.scrollElement.firstChild);if(this.options.el)for(var containerElement=this.options.el;containerElement.firstChild;)containerElement.removeChild(containerElement.firstChild);this.contentElement=null,this.scrollElement=null},InfiniteTree.prototype.addChildNodes=function(newNodes,index,parentNode){var _this3=this;if(newNodes=[].concat(newNodes||[]),0===newNodes.length)return!1;"object"===("undefined"==typeof index?"undefined":_typeof(index))?(parentNode=index||this.state.rootNode,index=parentNode.children.length):parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),newNodes.forEach(function(newNode){newNode.parent=parentNode}),parentNode.children.splice.apply(parentNode.children,[index,0].concat(newNodes)),index=parentNode.children.indexOf(newNodes[0]);var deleteCount=parentNode.state.total,nodes=(0,_flattree.flatten)(parentNode.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this3.options.rowRenderer(node,_this3.options)});if(parentNode===this.state.rootNode)this.nodes=nodes,this.rows=rows;else{var parentOffset=this.nodes.indexOf(parentNode);parentOffset>=0&&(this.nodes.splice.apply(this.nodes,[parentOffset+1,deleteCount].concat(nodes)),this.rows.splice.apply(this.rows,[parentOffset+1,deleteCount].concat(rows)),this.rows[parentOffset]=this.options.rowRenderer(parentNode,this.options))}return parentNode.children.slice(index).forEach(function(childNode){_this3.flattenNode(childNode).forEach(function(node){void 0!==node.id&&_this3.nodeTable.set(node.id,node)})}),this.update(),!0},InfiniteTree.prototype.appendChildNode=function(newNode,parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);var index=parentNode.children.length,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.clear=function(){this.clusterize.clear(),this.nodeTable.clear(),this.nodes=[],this.rows=[],this.state.openNodes=[],this.state.rootNode=null,this.state.selectedNode=null},InfiniteTree.prototype.closeNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)<0)return!1;if(this.state.selectedNode&&this.state.selectedNode!==node){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex+1,rangeTo=nodeIndex+node.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(node)}node.state.open=!1;var openNodes=this.state.openNodes.filter(function(node){return node.hasChildren()&&node.state.open});this.state.openNodes=openNodes;for(var deleteCount=node.state.total,p=node;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return this.nodes.splice(nodeIndex+1,deleteCount),this.rows.splice(nodeIndex+1,deleteCount),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.emit("closeNode",node),this.update(),!0},InfiniteTree.prototype.flattenChildNodes=function(parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);for(var list=[],node=parentNode.getFirstChild();node;)if(list.push(node),node.hasChildren())node=node.getFirstChild();else{for(;null===node.getNextSibling()&&node.parent!==parentNode;)node=node.getParent();node=node.getNextSibling()}return list},InfiniteTree.prototype.flattenNode=function(node){return[node].concat(this.flattenChildNodes(node))},InfiniteTree.prototype.getChildNodes=function(parentNode){return parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),parentNode.children},InfiniteTree.prototype.getNodeById=function(id){var node=this.nodeTable.get(id);if(!node){if(node=this.nodes.filter(function(node){return node.id===id})[0],!node)return null;this.nodeTable.set(node.id,node)}return node},InfiniteTree.prototype.getOpenNodes=function(){return this.state.openNodes.slice()},InfiniteTree.prototype.getRootNode=function(){return this.state.rootNode},InfiniteTree.prototype.getSelectedNode=function(){return this.state.selectedNode},InfiniteTree.prototype.insertNodeAfter=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode)+1,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.insertNodeBefore=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode),newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.loadData=function(){var _this4=this,data=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.nodes=(0,_flattree.flatten)(data,{openAllNodes:this.options.autoOpen}),this.nodeTable.clear(),this.state.openNodes=this.nodes.filter(function(node){return node.hasChildren()&&node.state.open}),this.state.rootNode=function(){for(var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0];node&&null!==node.parent;)node=node.parent;return node}(this.nodes[0]),this.state.selectedNode=null,this.flattenChildNodes(this.state.rootNode).forEach(function(node){void 0!==node.id&&_this4.nodeTable.set(node.id,node)}),this.rows=this.nodes.map(function(node){return _this4.options.rowRenderer(node,_this4.options)}),this.update()},InfiniteTree.prototype.openNode=function(node){var _this5=this;ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)>=0)return!1;if(!node.hasChildren()&&node.loadOnDemand)return"function"!=typeof this.options.loadNodes?!1:(node.state.loading=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update(),this.options.loadNodes(node,function(err,nodes){node.state.loading=!1,_this5.rows[nodeIndex]=_this5.options.rowRenderer(node,_this5.options),_this5.update(),err||(nodes.forEach(function(childNode){_this5.appendChildNode(childNode,node)}),_this5.openNode(node))}),!1);node.state.open=!0;var openNodes=[node].concat(this.state.openNodes);this.state.openNodes=openNodes;var nodes=(0,_flattree.flatten)(node.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this5.options.rowRenderer(node,_this5.options)});return this.nodes.splice.apply(this.nodes,[nodeIndex+1,0].concat(nodes)),this.rows.splice.apply(this.rows,[nodeIndex+1,0].concat(rows)),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),nodes.length>0&&!this.nodeTable.get(nodes[0])&&nodes.forEach(function(node){void 0!==node.id&&_this5.nodeTable.set(node.id,node)}),this.emit("openNode",node),this.update(),!0},InfiniteTree.prototype.removeChildNodes=function(parentNode){var _this6=this;if(ensureNodeInstance(parentNode),0===parentNode.children.length)return!1;var parentNodeIndex=this.nodes.indexOf(parentNode);if(parentNodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=parentNodeIndex+1,rangeTo=parentNodeIndex+parentNode.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(parentNode)}parentNode.children=[],parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=parentNode.state.total,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return parentNodeIndex>=0&&(this.nodes.splice(parentNodeIndex+1,deleteCount),this.rows.splice(parentNodeIndex+1,deleteCount),this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var childNodes=_this6.flattenChildNodes(parentNode);_this6.state.openNodes=_this6.state.openNodes.filter(function(node){return childNodes.indexOf(node)<0}),childNodes.forEach(function(node){_this6.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.removeNode=function(node){var _this7=this;ensureNodeInstance(node);var parentNode=node.parent;if(!parentNode)return!1;var nodeIndex=this.nodes.indexOf(node),parentNodeIndex=this.nodes.indexOf(parentNode);if(nodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex,rangeTo=nodeIndex+node.state.total+1;if(selectedIndex>=rangeFrom&&rangeTo>=selectedIndex){var selectedNode=node.getNextSibling()||node.getPreviousSibling()||node.getParent();this.selectNode(selectedNode)}}parentNode.children.splice(parentNode.children.indexOf(node),1),parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=node.state.total+1,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return nodeIndex>=0&&(this.nodes.splice(nodeIndex,deleteCount),this.rows.splice(nodeIndex,deleteCount)),parentNodeIndex>=0&&(this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var nodes=_this7.flattenNode(node);_this7.state.openNodes=_this7.state.openNodes.filter(function(node){return nodes.indexOf(node)<0}),nodes.forEach(function(node){_this7.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.scrollToNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)return-1;if(!this.contentElement)return-1;var firstChild=this.contentElement.querySelectorAll(".tree-item")[0],rowHeight=firstChild&&firstChild.offsetHeight||0;return this.scrollTop(nodeIndex*rowHeight)},InfiniteTree.prototype.scrollTop=function(value){return this.scrollElement?(void 0!==value&&(this.scrollElement.scrollTop=Number(value)),this.scrollElement.scrollTop):0},InfiniteTree.prototype.selectNode=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],_options=this.options,selectable=_options.selectable,shouldSelectNode=_options.shouldSelectNode;if(!selectable)return!1;if("function"==typeof shouldSelectNode&&!shouldSelectNode(node))return!1;if(null===node){if(this.state.selectedNode){var selectedNode=this.state.selectedNode,selectedIndex=this.nodes.indexOf(selectedNode);return selectedNode.state.selected=!1,this.rows[selectedIndex]=this.options.rowRenderer(selectedNode,this.options),this.state.selectedNode=null,this.emit("selectNode",null),this.update(),!0}return!1}ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.selectedNode!==node&&(node.state.selected=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options)),this.state.selectedNode){var _selectedNode=this.state.selectedNode,_selectedIndex=this.nodes.indexOf(_selectedNode);_selectedNode.state.selected=!1,this.rows[_selectedIndex]=this.options.rowRenderer(_selectedNode,this.options)}return this.state.selectedNode!==node?(this.state.selectedNode=node,this.emit("selectNode",node)):(this.state.selectedNode=null,this.emit("selectNode",null)),this.update(),!0},InfiniteTree.prototype.toggleNode=function(node){this.state.openNodes.indexOf(node)>=0?this.closeNode(node):this.openNode(node)},InfiniteTree.prototype.toString=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],traverse=function traverse(node){var s="[";if(node&&node.children)for(var _loop=function(i){var list=[];s+="{",Object.keys(node).forEach(function(key){var value=node[key];if("parent"!==key)return"children"===key?void list.push('"'+key+'":'+traverse(node.children[i])):void("string"==typeof value||"object"===("undefined"==typeof value?"undefined":_typeof(value))?list.push('"'+key+'":'+JSON.stringify(value)):list.push('"'+key+'":'+value))}),s+=list.join(","),s=s+"}"+(i===node.children.length-1?"":",")},i=0;i=0&&(this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update())},InfiniteTree}(_events2["default"].EventEmitter);exports["default"]=InfiniteTree},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){!function(name,definition){module.exports=definition()}("Clusterize",function(){"use strict";function on(evt,element,fnc){return element.addEventListener?element.addEventListener(evt,fnc,!1):element.attachEvent("on"+evt,fnc)}function off(evt,element,fnc){return element.removeEventListener?element.removeEventListener(evt,fnc,!1):element.detachEvent("on"+evt,fnc)}function isArray(arr){return"[object Array]"===Object.prototype.toString.call(arr)}function getStyle(prop,elem){return window.getComputedStyle?window.getComputedStyle(elem)[prop]:elem.currentStyle[prop]}var ie=function(){for(var v=3,el=document.createElement("b"),all=el.all||[];el.innerHTML="",all[0];);return v>4?v:document.documentMode}(),is_mac=navigator.platform.toLowerCase().indexOf("mac")+1,Clusterize=function(data){if(!(this instanceof Clusterize))return new Clusterize(data);var self=this,defaults={item_height:0,block_height:0,rows_in_block:50,rows_in_cluster:0,cluster_height:0,blocks_in_cluster:4,tag:null,content_tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,callbacks:{},scroll_top:0};self.options={};for(var option,options=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","callbacks"],i=0;option=options[i];i++)self.options[option]="undefined"!=typeof data[option]&&null!=data[option]?data[option]:defaults[option];for(var elem,elems=["scroll","content"],i=0;elem=elems[i];i++)if(self[elem+"_elem"]=data[elem+"Id"]?document.getElementById(data[elem+"Id"]):data[elem+"Elem"],!self[elem+"_elem"])throw new Error("Error! Could not find "+elem+" element");self.content_elem.hasAttribute("tabindex")||self.content_elem.setAttribute("tabindex",0);var rows=isArray(data.rows)?data.rows:self.fetchMarkup(),cache={data:"",bottom:0},scroll_top=self.scroll_elem.scrollTop;self.exploreEnvironment(rows),self.insertToDOM(rows,cache),self.scroll_elem.scrollTop=scroll_top;var last_cluster=!1,scroll_debounce=0,pointer_events_set=!1,scrollEv=function(){is_mac&&(pointer_events_set||(self.content_elem.style.pointerEvents="none"),pointer_events_set=!0,clearTimeout(scroll_debounce),scroll_debounce=setTimeout(function(){self.content_elem.style.pointerEvents="auto",pointer_events_set=!1},50)),last_cluster!=(last_cluster=self.getClusterNum())&&self.insertToDOM(rows,cache),self.options.callbacks.scrollingProgress&&self.options.callbacks.scrollingProgress(self.getScrollProgress())},resize_debounce=0,resizeEv=function(){clearTimeout(resize_debounce),resize_debounce=setTimeout(self.refresh,100)};on("scroll",self.scroll_elem,scrollEv),on("resize",window,resizeEv),self.destroy=function(clean){off("scroll",self.scroll_elem,scrollEv),off("resize",window,resizeEv),self.html((clean?self.generateEmptyRow():rows).join(""))},self.refresh=function(){self.getRowsHeight(rows)&&self.update(rows)},self.update=function(new_rows){rows=isArray(new_rows)?new_rows:[];var scroll_top=self.scroll_elem.scrollTop;rows.length*self.options.item_height=ie&&!opts.tag&&(opts.tag=rows[0].match(/<([^>\s\/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&this.html(rows[0]+rows[0]+rows[0]),opts.tag||(opts.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(rows))},getRowsHeight:function(rows){var opts=this.options,prev_item_height=opts.item_height;if(opts.cluster_height=0,rows.length){var nodes=this.content_elem.children;return opts.item_height=nodes[Math.floor(nodes.length/2)].offsetHeight,"tr"==opts.tag&&"collapse"!=getStyle("borderCollapse",this.content_elem)&&(opts.item_height+=parseInt(getStyle("borderSpacing",this.content_elem))||0),opts.block_height=opts.item_height*opts.rows_in_block,
-opts.rows_in_cluster=opts.blocks_in_cluster*opts.rows_in_block,opts.cluster_height=opts.blocks_in_cluster*opts.block_height,prev_item_height!=opts.item_height}},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var opts=this.options;if(!opts.tag||!opts.show_no_data_row)return[];var td,empty_row=document.createElement(opts.tag),no_data_content=document.createTextNode(opts.no_data_text);return empty_row.className=opts.no_data_class,"tr"==opts.tag&&(td=document.createElement("td"),td.appendChild(no_data_content)),empty_row.appendChild(td||no_data_content),[empty_row.outerHTML]},generate:function(rows,cluster_num){var opts=this.options,rows_len=rows.length;if(rows_lentop_offset&&rows_above++;for(var i=items_start;items_end>i;i++)rows[i]&&this_cluster_rows.push(rows[i]);return{top_offset:top_offset,bottom_offset:bottom_offset,rows_above:rows_above,rows:this_cluster_rows}},renderExtraTag:function(class_name,height){var tag=document.createElement(this.options.tag),clusterize_prefix="clusterize-";return tag.className=[clusterize_prefix+"extra-row",clusterize_prefix+class_name].join(" "),height&&(tag.style.height=height+"px"),tag.outerHTML},insertToDOM:function(rows,cache){var data=this.generate(rows,this.getClusterNum()),this_cluster_rows=data.rows.join(""),this_cluster_content_changed=this.checkChanges("data",this_cluster_rows,cache),only_bottom_offset_changed=this.checkChanges("bottom",data.bottom_offset,cache),callbacks=this.options.callbacks,layout=[];this_cluster_content_changed?(data.top_offset&&(this.options.keep_parity&&layout.push(this.renderExtraTag("keep-parity")),layout.push(this.renderExtraTag("top-space",data.top_offset))),layout.push(this_cluster_rows),data.bottom_offset&&layout.push(this.renderExtraTag("bottom-space",data.bottom_offset)),callbacks.clusterWillChange&&callbacks.clusterWillChange(),this.html(layout.join("")),"ol"==this.options.content_tag&&this.content_elem.setAttribute("start",data.rows_above),callbacks.clusterChanged&&callbacks.clusterChanged()):only_bottom_offset_changed&&(this.content_elem.lastChild.style.height=data.bottom_offset+"px")},html:function(data){var content_elem=this.content_elem;if(ie&&9>=ie&&"tr"==this.options.tag){var last,div=document.createElement("div");for(div.innerHTML="
"+data+"
";last=content_elem.lastChild;)content_elem.removeChild(last);for(var rows_nodes=this.getChildNodes(div.firstChild.firstChild);rows_nodes.length;)content_elem.appendChild(rows_nodes.shift())}else content_elem.innerHTML=data},getChildNodes:function(tag){for(var child_nodes=tag.children,nodes=[],i=0,ii=child_nodes.length;ii>i;i++)nodes.push(child_nodes[i]);return nodes},checkChanges:function(type,value,cache){var changed=value!=cache[type];return cache[type]=value,changed}},Clusterize})},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0,exports.Node=exports.flatten=void 0;var _flatten=__webpack_require__(6),_flatten2=_interopRequireDefault(_flatten),_node=__webpack_require__(8),_node2=_interopRequireDefault(_node);exports.flatten=_flatten2["default"],exports.Node=_node2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0;var _extend=__webpack_require__(7),_extend2=_interopRequireDefault(_extend),_node=__webpack_require__(8),_node2=_interopRequireDefault(_node),flatten=function flatten(){var nodes=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];nodes=[].concat(nodes);var flatten=[],stack=[],pool={lastChild:{}};options.openAllNodes=!!options.openAllNodes,options.openNodes=options.openNodes||[],options.throwOnError=!!options.throwOnError;var firstNode=nodes.length>0?nodes[0]:null,parentNode=firstNode?firstNode.parent:null;!parentNode||parentNode instanceof _node2["default"]||(parentNode=new _node2["default"](parentNode));var rootNode=parentNode||new _node2["default"]({label:"",parent:null,children:nodes,state:{depth:-1,open:!0,path:"",prefixMask:"",total:0}});if(rootNode===parentNode)for(var subtotal=rootNode.state.total||0,p=rootNode;p;){var _p$state=p.state,path=_p$state.path,_p$state$total=_p$state.total,total=void 0===_p$state$total?0:_p$state$total;if(p.isLastChild()&&path&&(pool.lastChild[path]=!0),p.state.total=total-subtotal,p.state.total<0){if(options.throwOnError)throw new Error("The node might have been corrupted: id="+JSON.stringify(p.id)+", state="+JSON.stringify(p.state));console&&console.log("Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s",JSON.stringify(p.id),JSON.stringify(p.label),p.parent,p.children,JSON.stringify(p.state))}p=p.parent}for(stack.push([rootNode,rootNode.state.depth,0]);stack.length>0;)for(var _stack$pop=stack.pop(),current=_stack$pop[0],depth=_stack$pop[1],index=_stack$pop[2],_loop=function(){var node=current.children[index];node instanceof _node2["default"]||(node=new _node2["default"](node)),node.parent=current,node.children=node.children||[],node.parent.children[index]=node;var path=current.state.path+"."+index,open=node.hasChildren()&&function(){var openAllNodes=options.openAllNodes,openNodes=options.openNodes;return openAllNodes?!0:openNodes.indexOf(node)>=0?!0:openNodes.indexOf(node.id)>=0}(),prefixMask=function(prefix){for(var mask="";prefix.length>0;)prefix=prefix.replace(/\.\d+$/,""),mask=!prefix||pool.lastChild[prefix]?"0"+mask:"1"+mask;return mask}(path);node.isLastChild()&&(pool.lastChild[path]=!0),node.state=(0,_extend2["default"])({},node.state,{depth:depth+1,open:open,path:path,prefixMask:prefixMask,total:0});for(var parentDidOpen=!0,_p=node;null!==_p.parent;){if(_p.parent.state.open===!1){parentDidOpen=!1;break}_p=_p.parent}if(parentDidOpen){flatten.push(node);for(var _p2=node;null!==_p2.parent;)_p2.parent.state.total++,_p2=_p2.parent}++index,node.hasChildren()&&(stack.push([current,depth,index]),index=0,depth+=1,current=node)};index1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];if(void 0===target||null===target)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(target),index=0;index0&&index>=0&&index0&&(node=this.children[0]),node},Node.prototype.getLastChild=function(){var node=null;return this.children.length>0&&(node=this.children[this.children.length-1]),node},Node.prototype.getNextSibling=function(){var node=null;if(this.parent){var index=this.parent.children.indexOf(this);index>=0&&index0&&index0},Node.prototype.isLastChild=function(){var hasNextSibling=this.getNextSibling();return!hasNextSibling},Node}();exports["default"]=Node},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var LookupTable=function(){function LookupTable(){_classCallCheck(this,LookupTable),this.data={}}return LookupTable.prototype.clear=function(){this.data={}},LookupTable.prototype.get=function(key){return this.data[key]},LookupTable.prototype.has=function(key){return void 0!==this.data[key]},LookupTable.prototype.set=function(key,value){return this.data[key]=value,value},LookupTable.prototype.unset=function(key){void 0!==this.data[key]&&delete this.data[key]},LookupTable}();exports["default"]=LookupTable},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.defaultRowRenderer=void 0;var _helper=__webpack_require__(11),defaultRowRenderer=function(node,treeOptions){var id=node.id,label=node.label,_node$loadOnDemand=node.loadOnDemand,loadOnDemand=void 0===_node$loadOnDemand?!1:_node$loadOnDemand,children=node.children,state=node.state,depth=state.depth,open=state.open,path=state.path,total=state.total,_state$selected=state.selected,selected=void 0===_state$selected?!1:_state$selected,childrenLength=Object.keys(children).length,more=node.hasChildren(),togglerContent="";more&&open&&(togglerContent="▼"),more&&!open&&(togglerContent="►"),!more&&loadOnDemand&&(togglerContent="►");var toggler=(0,_helper.buildHTML)("a",togglerContent,{"class":function(){return more&&open?(0,_helper.classNames)("tree-toggler"):more&&!open?(0,_helper.classNames)("tree-toggler","tree-closed"):!more&&loadOnDemand?(0,_helper.classNames)("tree-toggler","tree-closed"):""}()}),title=(0,_helper.buildHTML)("span",(0,_helper.quoteattr)(label),{"class":(0,_helper.classNames)("tree-title")}),treeNode=(0,_helper.buildHTML)("div",toggler+title,{"class":"tree-node",style:"margin-left: "+18*depth+"px"});return(0,_helper.buildHTML)("div",treeNode,{"aria-id":id,"aria-expanded":more&&open,"aria-depth":depth,"aria-path":path,"aria-selected":selected,"aria-children":childrenLength,"aria-total":total,"class":(0,_helper.classNames)("tree-item",{"tree-selected":selected}),droppable:!0})};exports.defaultRowRenderer=defaultRowRenderer},function(module,exports){"use strict";exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},extend=function(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];target=target||{};for(var index=0;index=0},addClass=function(el,className){if(!el)return"";if(!hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.concat(className).join(" ")}return el.className},removeClass=function(el,className){if(!el)return"";if(hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.filter(function(c){return c!==className}).join(" ")}return el.className},toggleClass=function(el,className){el&&(hasClass(el,className)?removeClass(el,className):addClass(el,className))},classNames=function classNames(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_len2>_key2;_key2++)args[_key2]=arguments[_key2];var classNames=[];return args.forEach(function(arg){Array.isArray(arg)?classNames=classNames.concat(arg):"object"===("undefined"==typeof arg?"undefined":_typeof(arg))?Object.keys(arg).forEach(function(className){var ok=arg[className];ok&&classNames.push(className)}):classNames.push(arg)}),classNames.join(" ")},isDOMElement=function(o){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?o instanceof HTMLElement:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&1===o.nodeType&&"string"==typeof o.nodeName},isDOMNode=function(o){return"object"===("undefined"==typeof Node?"undefined":_typeof(Node))?o instanceof Node:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName},quoteattr=function(s,preserveCR){return preserveCR=preserveCR?"
":"\n",(""+s).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">").replace(/\r\n/g,preserveCR).replace(/[\r\n]/g,preserveCR)},buildHTML=function buildHTML(tag,html,attrs){switch(tag){case"select":if("object"===("undefined"==typeof html?"undefined":_typeof(html))){var options=html||{};html="";for(var value in options)options.hasOwnProperty(value)&&(html+=buildHTML("option",options[value]||"",{value:value}))}break;default:"object"===("undefined"==typeof html?"undefined":_typeof(html))&&(attrs=html,html=void 0)}var h="<"+tag;for(var attr in attrs)attrs.hasOwnProperty(attr)&&"undefined"!=typeof attrs[attr]&&(h+=" "+attr+'="'+quoteattr(attrs[attr])+'"');return h+="undefined"!=typeof html?">"+html+""+tag+">":"/>"};exports.extend=extend,exports.preventDefault=preventDefault,exports.stopPropagation=stopPropagation,exports.dispatchEvent=dispatchEvent,exports.addEventListener=addEventListener,exports.removeEventListener=removeEventListener,exports.hasClass=hasClass,exports.addClass=addClass,exports.removeClass=removeClass,exports.toggleClass=toggleClass,exports.classNames=classNames,exports.isDOMElement=isDOMElement,exports.isDOMNode=isDOMNode,exports.quoteattr=quoteattr,exports.buildHTML=buildHTML},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _helper=__webpack_require__(11),rowRenderer=function(node,treeOptions){var id=node.id,label=node.label,_node$loadOnDemand=node.loadOnDemand,loadOnDemand=void 0===_node$loadOnDemand?!1:_node$loadOnDemand,children=node.children,state=node.state,_node$props=node.props,props=void 0===_node$props?{}:_node$props,droppable=treeOptions.droppable&&props.droppable,depth=state.depth,open=state.open,path=state.path,total=state.total,_state$loading=state.loading,loading=void 0===_state$loading?!1:_state$loading,_state$selected=state.selected,selected=void 0===_state$selected?!1:_state$selected,childrenLength=Object.keys(children).length,more=node.hasChildren(),togglerContent="";!more&&loadOnDemand&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-right")})),more&&open&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-bottom")})),more&&!open&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-right")}));var toggler=(0,_helper.buildHTML)("a",togglerContent,{"class":function(){return!more&&loadOnDemand?(0,_helper.classNames)("tree-toggler","tree-closed"):more&&open?(0,_helper.classNames)("tree-toggler"):more&&!open?(0,_helper.classNames)("tree-toggler","tree-closed"):""}()}),icon=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("tree-folder-icon","glyphicon",{"glyphicon-folder-open":more&&open},{"glyphicon-folder-close":more&&!open},{"glyphicon-file":!more})}),title=(0,_helper.buildHTML)("span",(0,_helper.quoteattr)(label),{"class":(0,_helper.classNames)("tree-title")}),loadingIcon=(0,_helper.buildHTML)("i","",{style:"margin-left: 5px","class":(0,_helper.classNames)({hidden:!loading},"glyphicon","glyphicon-refresh",{rotating:loading})}),count=(0,_helper.buildHTML)("span",childrenLength,{"class":"count"}),treeNode=(0,_helper.buildHTML)("div",toggler+icon+title+loadingIcon+count,{"class":"tree-node",style:"margin-left: "+18*depth+"px"}),treeNodeAttributes={"aria-id":id,"aria-expanded":more&&open,"aria-depth":depth,"aria-path":path,"aria-selected":selected,"aria-children":childrenLength,"aria-total":total,"class":(0,_helper.classNames)("tree-item",{"tree-selected":selected})};return droppable&&(treeNodeAttributes.droppable=!0),(0,_helper.buildHTML)("div",treeNode,treeNodeAttributes)};exports["default"]=rowRenderer},function(module,exports,__webpack_require__){var content=__webpack_require__(14);"string"==typeof content&&(content=[[module.id,content,""]]);__webpack_require__(16)(content,{});content.locals&&(module.exports=content.locals)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(15)(),exports.push([module.id,".infinite-tree-content{max-height:400px}.infinite-tree-scroll{overflow:auto}.infinite-tree-content{outline:0}.infinite-tree-content .tree-selected.tree-item,.infinite-tree-content .tree-selected.tree-item:hover{background:#deecfd;border:1px solid #06c}.infinite-tree-content .tree-item{border:1px solid transparent;cursor:default}.infinite-tree-content .tree-item:hover{background:#f2fdff}.infinite-tree-content .tree-item.highlight{border:1px dotted #ccc;background-color:#f5f6f7}.infinite-tree-content .tree-node{position:relative}.infinite-tree-content .tree-toggler{color:#666;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-tree-content .tree-toggler:hover{color:#333;text-decoration:none}.infinite-tree-content .tree-title{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-tree-no-data{text-align:center}",""])},function(module,exports){module.exports=function(){var list=[];return list.toString=function(){for(var result=[],i=0;i=0&&styleElementsInsertedAtTop.splice(idx,1)}function createStyleElement(options){var styleElement=document.createElement("style");return styleElement.type="text/css",insertStyleElement(options,styleElement),styleElement}function createLinkElement(options){var linkElement=document.createElement("link");return linkElement.rel="stylesheet",insertStyleElement(options,linkElement),linkElement}function addStyle(obj,options){var styleElement,update,remove;if(options.singleton){var styleIndex=singletonCounter++;styleElement=singletonElement||(singletonElement=createStyleElement(options)),update=applyToSingletonTag.bind(null,styleElement,styleIndex,!1),remove=applyToSingletonTag.bind(null,styleElement,styleIndex,!0)}else obj.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(styleElement=createLinkElement(options),update=updateLink.bind(null,styleElement),remove=function(){removeStyleElement(styleElement),styleElement.href&&URL.revokeObjectURL(styleElement.href)}):(styleElement=createStyleElement(options),update=applyToTag.bind(null,styleElement),remove=function(){removeStyleElement(styleElement)});return update(obj),function(newObj){if(newObj){if(newObj.css===obj.css&&newObj.media===obj.media&&newObj.sourceMap===obj.sourceMap)return;update(obj=newObj)}else remove()}}function applyToSingletonTag(styleElement,index,remove,obj){var css=remove?"":obj.css;if(styleElement.styleSheet)styleElement.styleSheet.cssText=replaceText(index,css);else{var cssNode=document.createTextNode(css),childNodes=styleElement.childNodes;childNodes[index]&&styleElement.removeChild(childNodes[index]),childNodes.length?styleElement.insertBefore(cssNode,childNodes[index]):styleElement.appendChild(cssNode)}}function applyToTag(styleElement,obj){var css=obj.css,media=obj.media;if(media&&styleElement.setAttribute("media",media),styleElement.styleSheet)styleElement.styleSheet.cssText=css;else{for(;styleElement.firstChild;)styleElement.removeChild(styleElement.firstChild);styleElement.appendChild(document.createTextNode(css))}}function updateLink(linkElement,obj){var css=obj.css,sourceMap=obj.sourceMap;sourceMap&&(css+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */");var blob=new Blob([css],{type:"text/css"}),oldSrc=linkElement.href;linkElement.href=URL.createObjectURL(blob),oldSrc&&URL.revokeObjectURL(oldSrc)}var stylesInDom={},memoize=function(fn){var memo;return function(){return"undefined"==typeof memo&&(memo=fn.apply(this,arguments)),memo}},isOldIE=memoize(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),getHeadElement=memoize(function(){return document.head||document.getElementsByTagName("head")[0]}),singletonElement=null,singletonCounter=0,styleElementsInsertedAtTop=[];module.exports=function(list,options){if("object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");options=options||{},"undefined"==typeof options.singleton&&(options.singleton=isOldIE()),"undefined"==typeof options.insertAt&&(options.insertAt="bottom");var styles=listToStyles(list);return addStylesToDom(styles,options),function(newList){for(var mayRemove=[],i=0;i","label":"","props":{"droppable":true},"children":[{"id":"alpha","label":"Alpha","props":{"droppable":true}},{"id":"bravo","label":"Bravo","props":{"droppable":true},"children":[{"id":"charlie","label":"Charlie","props":{"droppable":true},"children":[{"id":"delta","label":"Delta","props":{"droppable":true},"children":[{"id":"echo","label":"Echo","props":{"droppable":true}},{"id":"foxtrot","label":"Foxtrot","props":{"droppable":true}}]},{"id":"golf","label":"Golf","props":{"droppable":true}}]},{"id":"hotel","label":"Hotel","props":{"droppable":true},"children":[{"id":"india","label":"India","props":{"droppable":true},"children":[{"id":"juliet","label":"Juliet","props":{"droppable":true}}]}]},{"id":"kilo","label":"(Load On Demand) Kilo","loadOnDemand":true,"props":{"droppable":true}}]}]}',i=0;1e3>i;++i)data.push(JSON.parse(source.replace(/"(id|label)":"([^"]*)"/g,'"$1": "$2.'+i+'"')));var updatePreview=function(node){var el=document.querySelector("#preview");if(node){var o={id:node.id,label:node.label,children:node.children?node.children.length:0,parent:node.parent?node.parent.id:null,state:node.state};void 0!==node.loadOnDemand&&(o.loadOnDemand=node.loadOnDemand),el.innerHTML=JSON.stringify(o,null,2).replace(/\n/g," ").replace(/\s/g," ")}else el.innerHTML=""},tree=new _src2["default"](document.querySelector("#tree"),{autoOpen:!0,droppable:!0,loadNodes:function(parentNode,done){var suffix=parentNode.id.replace(/(\w)+/,""),nodes=[{id:"node1"+suffix,label:"Node 1"},{id:"node2"+suffix,label:"Node 2"}];setTimeout(function(){done(null,nodes)},1e3)},rowRenderer:_renderer2["default"],selectable:!0,shouldSelectNode:function(node){return!(!node||node===tree.getSelectedNode())}});tree.on("scrollProgress",function(progress){document.querySelector("#scrolling-progress").style.width=progress+"%"}),tree.on("update",function(){var node=tree.getSelectedNode();updatePreview(node)}),tree.on("openNode",function(node){console.log("openNode",node)}),tree.on("closeNode",function(node){console.log("closeNode",node)}),tree.on("dropNode",function(node,e){var source=e.dataTransfer.getData("text");console.log("Dragged an element "+JSON.stringify(source)+" and dropped to "+JSON.stringify(node.label)),document.querySelector("#dropped-result").innerHTML="Dropped to "+(0,_helper.quoteattr)(node.label)+""}),tree.on("selectNode",function(node){updatePreview(node)}),tree.loadData(data),tree.selectNode(tree.getChildNodes()[0]);var draggableElement=document.querySelector("#draggable-element");(0,_helper.addEventListener)(draggableElement,"selectstart",function(e){return(0,_helper.preventDefault)(e),(0,_helper.stopPropagation)(e),draggableElement.dragDrop(),!1}),(0,_helper.addEventListener)(draggableElement,"dragstart",function(e){e.dataTransfer.effectAllowed="move";var target=e.target||e.srcElement;e.dataTransfer.setData("text",target.id),document.querySelector("#dropped-result").innerHTML=""}),(0,_helper.addEventListener)(draggableElement,"dragend",function(e){}),window.tree=tree},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _infiniteTree=__webpack_require__(2),_infiniteTree2=_interopRequireDefault(_infiniteTree);module.exports=_infiniteTree2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},_events=__webpack_require__(3),_events2=_interopRequireDefault(_events),_clusterize=__webpack_require__(4),_clusterize2=_interopRequireDefault(_clusterize),_flattree=__webpack_require__(5),_lookupTable=__webpack_require__(9),_lookupTable2=_interopRequireDefault(_lookupTable),_renderer=__webpack_require__(10),_helper=__webpack_require__(11),ensureNodeInstance=function(node){if(!(node instanceof _flattree.Node))throw new Error("The node must be a Node object.");return!0},InfiniteTree=function(_events$EventEmitter){function InfiniteTree(el,options){_classCallCheck(this,InfiniteTree);var _this=_possibleConstructorReturn(this,_events$EventEmitter.call(this));return _this.options={autoOpen:!1,droppable:!1,el:null,loadNodes:null,rowRenderer:_renderer.defaultRowRenderer,selectable:!0,shouldSelectNode:null},_this.state={openNodes:[],rootNode:null,selectedNode:null},_this.clusterize=null,_this.nodeTable=new _lookupTable2["default"],_this.nodes=[],_this.rows=[],_this.scrollElement=null,_this.contentElement=null,_this.dragoverElement=null,_this.contentListener={click:function(e){var itemTarget=null,handleToggler=!1;for((0,_helper.stopPropagation)(e),e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget.className.indexOf("tree-toggler")>=0&&(handleToggler=!0),itemTarget=itemTarget.parentElement;if(itemTarget){var id=itemTarget.getAttribute("aria-id"),node=_this.getNodeById(id);if(node)return handleToggler?void _this.toggleNode(node):void _this.selectNode(node)}},dragenter:function(e){var itemTarget=null;for(e.target&&e.currentTarget?itemTarget=e.target!==e.currentTarget?e.target:null:e.srcElement&&(itemTarget=e.srcElement);itemTarget&&itemTarget.parentElement!==_this.contentElement;)itemTarget=itemTarget.parentElement;if(itemTarget&&_this.dragoverElement!==itemTarget){if((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,!itemTarget.hasAttribute("droppable"))return;var canDrop=!itemTarget.getAttribute("droppable").match(/false/i);canDrop&&((0,_helper.addClass)(itemTarget,"highlight"),_this.dragoverElement=itemTarget)}},dragend:function(e){_this.dragoverElement&&((0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null)},dragover:function(e){return(0,_helper.preventDefault)(e),e.dataTransfer.dropEffect="move",!1},drop:function(e){if((0,_helper.preventDefault)(e),_this.dragoverElement){var id=_this.dragoverElement.getAttribute("aria-id"),node=_this.getNodeById(id);(0,_helper.removeClass)(_this.dragoverElement,"highlight"),_this.dragoverElement=null,_this.emit("dropNode",node,e)}}},(0,_helper.isDOMElement)(el)?options.el=el:options=el,_this.options=(0,_helper.extend)({},_this.options,options),_this.options.el?(_this.create(),options.data&&_this.loadData(options.data),_this):(console.error("Failed to initialize infinite-tree: el is not specified.",options),_possibleConstructorReturn(_this))}return _inherits(InfiniteTree,_events$EventEmitter),InfiniteTree.prototype.create=function(){var _this2=this;if(!this.options.el)throw new Error("The element option is not specified.");var scrollElement=document.createElement("div");scrollElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-scroll");var contentElement=document.createElement("div");contentElement.className=(0,_helper.classNames)("infinite-tree","infinite-tree-content"),scrollElement.appendChild(contentElement),this.options.el.appendChild(scrollElement),this.clusterize=new _clusterize2["default"]({tag:"div",rows:[],scrollElem:scrollElement,contentElem:contentElement,no_data_class:"infinite-tree-no-data",callbacks:{clusterWillChange:function(){},clusterChanged:function(){},scrollingProgress:function(progress){_this2.emit("scrollProgress",progress)}}}),this.scrollElement=scrollElement,this.contentElement=contentElement,(0,_helper.addEventListener)(this.contentElement,"click",this.contentListener.click),this.options.droppable&&((0,_helper.addEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.addEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.addEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.addEventListener)(this.contentElement,"drop",this.contentListener.drop))},InfiniteTree.prototype.destroy=function(){for((0,_helper.removeEventListener)(this.contentElement,"click",this.contentListener),this.options.droppable&&((0,_helper.removeEventListener)(document,"dragend",this.contentListener.dragend),(0,_helper.removeEventListener)(this.contentElement,"dragenter",this.contentListener.dragenter),(0,_helper.removeEventListener)(this.contentElement,"dragover",this.contentListener.dragover),(0,_helper.removeEventListener)(this.contentElement,"drop",this.contentListener.drop)),this.clear(),this.clusterize&&(this.clusterize.destroy(!0),this.clusterize=null);this.contentElement.firstChild;)this.contentElement.removeChild(this.contentElement.firstChild);for(;this.scrollElement.firstChild;)this.scrollElement.removeChild(this.scrollElement.firstChild);if(this.options.el)for(var containerElement=this.options.el;containerElement.firstChild;)containerElement.removeChild(containerElement.firstChild);this.contentElement=null,this.scrollElement=null},InfiniteTree.prototype.addChildNodes=function(newNodes,index,parentNode){var _this3=this;if(newNodes=[].concat(newNodes||[]),0===newNodes.length)return!1;"object"===("undefined"==typeof index?"undefined":_typeof(index))?(parentNode=index||this.state.rootNode,index=parentNode.children.length):parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),newNodes.forEach(function(newNode){newNode.parent=parentNode}),parentNode.children.splice.apply(parentNode.children,[index,0].concat(newNodes)),index=parentNode.children.indexOf(newNodes[0]);var deleteCount=parentNode.state.total,nodes=(0,_flattree.flatten)(parentNode.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this3.options.rowRenderer(node,_this3.options)});if(parentNode===this.state.rootNode)this.nodes=nodes,this.rows=rows;else{var parentOffset=this.nodes.indexOf(parentNode);parentOffset>=0&&(this.nodes.splice.apply(this.nodes,[parentOffset+1,deleteCount].concat(nodes)),this.rows.splice.apply(this.rows,[parentOffset+1,deleteCount].concat(rows)),this.rows[parentOffset]=this.options.rowRenderer(parentNode,this.options))}return parentNode.children.slice(index).forEach(function(childNode){_this3.flattenNode(childNode).forEach(function(node){void 0!==node.id&&_this3.nodeTable.set(node.id,node)})}),this.update(),!0},InfiniteTree.prototype.appendChildNode=function(newNode,parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);var index=parentNode.children.length,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.clear=function(){this.clusterize.clear(),this.nodeTable.clear(),this.nodes=[],this.rows=[],this.state.openNodes=[],this.state.rootNode=null,this.state.selectedNode=null},InfiniteTree.prototype.closeNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)<0)return!1;if(this.state.selectedNode&&this.state.selectedNode!==node){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex+1,rangeTo=nodeIndex+node.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(node)}node.state.open=!1;var openNodes=this.state.openNodes.filter(function(node){return node.hasChildren()&&node.state.open});this.state.openNodes=openNodes;for(var deleteCount=node.state.total,p=node;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return this.nodes.splice(nodeIndex+1,deleteCount),this.rows.splice(nodeIndex+1,deleteCount),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.emit("closeNode",node),this.update(),!0},InfiniteTree.prototype.flattenChildNodes=function(parentNode){parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode);for(var list=[],node=parentNode.getFirstChild();node;)if(list.push(node),node.hasChildren())node=node.getFirstChild();else{for(;null===node.getNextSibling()&&node.parent!==parentNode;)node=node.getParent();node=node.getNextSibling()}return list},InfiniteTree.prototype.flattenNode=function(node){return[node].concat(this.flattenChildNodes(node))},InfiniteTree.prototype.getChildNodes=function(parentNode){return parentNode=parentNode||this.state.rootNode,ensureNodeInstance(parentNode),parentNode.children},InfiniteTree.prototype.getNodeById=function(id){var node=this.nodeTable.get(id);if(!node){if(node=this.nodes.filter(function(node){return node.id===id})[0],!node)return null;this.nodeTable.set(node.id,node)}return node},InfiniteTree.prototype.getOpenNodes=function(){return this.state.openNodes.slice()},InfiniteTree.prototype.getRootNode=function(){return this.state.rootNode},InfiniteTree.prototype.getSelectedNode=function(){return this.state.selectedNode},InfiniteTree.prototype.insertNodeAfter=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode)+1,newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.insertNodeBefore=function(newNode,referenceNode){ensureNodeInstance(referenceNode);var parentNode=referenceNode.getParent(),index=parentNode.children.indexOf(referenceNode),newNodes=[].concat(newNode||[]);return this.addChildNodes(newNodes,index,parentNode)},InfiniteTree.prototype.loadData=function(){var _this4=this,data=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.nodes=(0,_flattree.flatten)(data,{openAllNodes:this.options.autoOpen}),this.nodeTable.clear(),this.state.openNodes=this.nodes.filter(function(node){return node.hasChildren()&&node.state.open}),this.state.rootNode=function(){for(var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0];node&&null!==node.parent;)node=node.parent;return node}(this.nodes[0]),this.state.selectedNode=null,this.flattenChildNodes(this.state.rootNode).forEach(function(node){void 0!==node.id&&_this4.nodeTable.set(node.id,node)}),this.rows=this.nodes.map(function(node){return _this4.options.rowRenderer(node,_this4.options)}),this.update()},InfiniteTree.prototype.openNode=function(node){var _this5=this;ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.openNodes.indexOf(node)>=0)return!1;if(!node.hasChildren()&&node.loadOnDemand)return"function"!=typeof this.options.loadNodes?!1:(node.state.loading=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update(),this.options.loadNodes(node,function(err,nodes){node.state.loading=!1,_this5.rows[nodeIndex]=_this5.options.rowRenderer(node,_this5.options),_this5.update(),err||(nodes.forEach(function(childNode){_this5.appendChildNode(childNode,node)}),node.hasChildren()&&_this5.openNode(node))}),!1);node.state.open=!0;var openNodes=[node].concat(this.state.openNodes);this.state.openNodes=openNodes;var nodes=(0,_flattree.flatten)(node.children,{openNodes:this.state.openNodes}),rows=nodes.map(function(node){return _this5.options.rowRenderer(node,_this5.options)});return this.nodes.splice.apply(this.nodes,[nodeIndex+1,0].concat(nodes)),this.rows.splice.apply(this.rows,[nodeIndex+1,0].concat(rows)),this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),nodes.length>0&&!this.nodeTable.get(nodes[0])&&nodes.forEach(function(node){void 0!==node.id&&_this5.nodeTable.set(node.id,node)}),this.emit("openNode",node),this.update(),!0},InfiniteTree.prototype.removeChildNodes=function(parentNode){var _this6=this;if(ensureNodeInstance(parentNode),0===parentNode.children.length)return!1;var parentNodeIndex=this.nodes.indexOf(parentNode);if(parentNodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=parentNodeIndex+1,rangeTo=parentNodeIndex+parentNode.state.total;selectedIndex>=rangeFrom&&rangeTo>=selectedIndex&&this.selectNode(parentNode)}parentNode.children=[],parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=parentNode.state.total,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return parentNodeIndex>=0&&(this.nodes.splice(parentNodeIndex+1,deleteCount),this.rows.splice(parentNodeIndex+1,deleteCount),this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var childNodes=_this6.flattenChildNodes(parentNode);_this6.state.openNodes=_this6.state.openNodes.filter(function(node){return childNodes.indexOf(node)<0}),childNodes.forEach(function(node){_this6.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.removeNode=function(node){var _this7=this;ensureNodeInstance(node);var parentNode=node.parent;if(!parentNode)return!1;var nodeIndex=this.nodes.indexOf(node),parentNodeIndex=this.nodes.indexOf(parentNode);if(nodeIndex>=0&&this.state.selectedNode){var selectedIndex=this.nodes.indexOf(this.state.selectedNode),rangeFrom=nodeIndex,rangeTo=nodeIndex+node.state.total+1;if(selectedIndex>=rangeFrom&&rangeTo>=selectedIndex){var selectedNode=node.getNextSibling()||node.getPreviousSibling()||node.getParent();this.selectNode(selectedNode)}}parentNode.children.splice(parentNode.children.indexOf(node),1),parentNode.state.open=parentNode.state.open&&parentNode.children.length>0;for(var deleteCount=node.state.total+1,p=parentNode;null!==p;p=p.parent)p.state.total=p.state.total-deleteCount;return nodeIndex>=0&&(this.nodes.splice(nodeIndex,deleteCount),this.rows.splice(nodeIndex,deleteCount)),parentNodeIndex>=0&&(this.rows[parentNodeIndex]=this.options.rowRenderer(parentNode,this.options)),!function(){var nodes=_this7.flattenNode(node);_this7.state.openNodes=_this7.state.openNodes.filter(function(node){return nodes.indexOf(node)<0}),nodes.forEach(function(node){_this7.nodeTable.unset(node.id)})}(),this.update(),!0},InfiniteTree.prototype.scrollToNode=function(node){ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)return-1;if(!this.contentElement)return-1;var firstChild=this.contentElement.querySelectorAll(".tree-item")[0],rowHeight=firstChild&&firstChild.offsetHeight||0;return this.scrollTop(nodeIndex*rowHeight)},InfiniteTree.prototype.scrollTop=function(value){return this.scrollElement?(void 0!==value&&(this.scrollElement.scrollTop=Number(value)),this.scrollElement.scrollTop):0},InfiniteTree.prototype.selectNode=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],_options=this.options,selectable=_options.selectable,shouldSelectNode=_options.shouldSelectNode;if(!selectable)return!1;if("function"==typeof shouldSelectNode&&!shouldSelectNode(node))return!1;if(null===node){if(this.state.selectedNode){var selectedNode=this.state.selectedNode,selectedIndex=this.nodes.indexOf(selectedNode);return selectedNode.state.selected=!1,this.rows[selectedIndex]=this.options.rowRenderer(selectedNode,this.options),this.state.selectedNode=null,this.emit("selectNode",null),this.update(),!0}return!1}ensureNodeInstance(node);var nodeIndex=this.nodes.indexOf(node);if(0>nodeIndex)throw new Error("Invalid node index");if(this.state.selectedNode!==node&&(node.state.selected=!0,this.rows[nodeIndex]=this.options.rowRenderer(node,this.options)),this.state.selectedNode){var _selectedNode=this.state.selectedNode,_selectedIndex=this.nodes.indexOf(_selectedNode);_selectedNode.state.selected=!1,this.rows[_selectedIndex]=this.options.rowRenderer(_selectedNode,this.options)}return this.state.selectedNode!==node?(this.state.selectedNode=node,this.emit("selectNode",node)):(this.state.selectedNode=null,this.emit("selectNode",null)),this.update(),!0},InfiniteTree.prototype.toggleNode=function(node){this.state.openNodes.indexOf(node)>=0?this.closeNode(node):this.openNode(node)},InfiniteTree.prototype.toString=function(){var node=arguments.length<=0||void 0===arguments[0]?null:arguments[0],traverse=function traverse(node){var s="[";if(node&&node.children)for(var _loop=function(i){var list=[];s+="{",Object.keys(node).forEach(function(key){var value=node[key];if("parent"!==key)return"children"===key?void list.push('"'+key+'":'+traverse(node.children[i])):void("string"==typeof value||"object"===("undefined"==typeof value?"undefined":_typeof(value))?list.push('"'+key+'":'+JSON.stringify(value)):list.push('"'+key+'":'+value))}),s+=list.join(","),s=s+"}"+(i===node.children.length-1?"":",")},i=0;i=0&&(this.rows[nodeIndex]=this.options.rowRenderer(node,this.options),this.update())},InfiniteTree}(_events2["default"].EventEmitter);exports["default"]=InfiniteTree},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){!function(name,definition){module.exports=definition()}("Clusterize",function(){"use strict";function on(evt,element,fnc){return element.addEventListener?element.addEventListener(evt,fnc,!1):element.attachEvent("on"+evt,fnc)}function off(evt,element,fnc){return element.removeEventListener?element.removeEventListener(evt,fnc,!1):element.detachEvent("on"+evt,fnc)}function isArray(arr){return"[object Array]"===Object.prototype.toString.call(arr)}function getStyle(prop,elem){return window.getComputedStyle?window.getComputedStyle(elem)[prop]:elem.currentStyle[prop]}var ie=function(){for(var v=3,el=document.createElement("b"),all=el.all||[];el.innerHTML="",all[0];);return v>4?v:document.documentMode}(),is_mac=navigator.platform.toLowerCase().indexOf("mac")+1,Clusterize=function(data){if(!(this instanceof Clusterize))return new Clusterize(data);var self=this,defaults={item_height:0,block_height:0,rows_in_block:50,rows_in_cluster:0,cluster_height:0,blocks_in_cluster:4,tag:null,content_tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,callbacks:{},scroll_top:0};self.options={};for(var option,options=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","callbacks"],i=0;option=options[i];i++)self.options[option]="undefined"!=typeof data[option]&&null!=data[option]?data[option]:defaults[option];for(var elem,elems=["scroll","content"],i=0;elem=elems[i];i++)if(self[elem+"_elem"]=data[elem+"Id"]?document.getElementById(data[elem+"Id"]):data[elem+"Elem"],!self[elem+"_elem"])throw new Error("Error! Could not find "+elem+" element");self.content_elem.hasAttribute("tabindex")||self.content_elem.setAttribute("tabindex",0);var rows=isArray(data.rows)?data.rows:self.fetchMarkup(),cache={data:"",bottom:0},scroll_top=self.scroll_elem.scrollTop;self.exploreEnvironment(rows),self.insertToDOM(rows,cache),self.scroll_elem.scrollTop=scroll_top;var last_cluster=!1,scroll_debounce=0,pointer_events_set=!1,scrollEv=function(){is_mac&&(pointer_events_set||(self.content_elem.style.pointerEvents="none"),pointer_events_set=!0,clearTimeout(scroll_debounce),scroll_debounce=setTimeout(function(){self.content_elem.style.pointerEvents="auto",pointer_events_set=!1},50)),last_cluster!=(last_cluster=self.getClusterNum())&&self.insertToDOM(rows,cache),self.options.callbacks.scrollingProgress&&self.options.callbacks.scrollingProgress(self.getScrollProgress())},resize_debounce=0,resizeEv=function(){clearTimeout(resize_debounce),resize_debounce=setTimeout(self.refresh,100)};on("scroll",self.scroll_elem,scrollEv),on("resize",window,resizeEv),self.destroy=function(clean){off("scroll",self.scroll_elem,scrollEv),off("resize",window,resizeEv),self.html((clean?self.generateEmptyRow():rows).join(""))},self.refresh=function(){self.getRowsHeight(rows)&&self.update(rows)},self.update=function(new_rows){rows=isArray(new_rows)?new_rows:[];var scroll_top=self.scroll_elem.scrollTop;rows.length*self.options.item_height=ie&&!opts.tag&&(opts.tag=rows[0].match(/<([^>\s\/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&this.html(rows[0]+rows[0]+rows[0]),opts.tag||(opts.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(rows))},getRowsHeight:function(rows){var opts=this.options,prev_item_height=opts.item_height;if(opts.cluster_height=0,rows.length){var nodes=this.content_elem.children;return opts.item_height=nodes[Math.floor(nodes.length/2)].offsetHeight,"tr"==opts.tag&&"collapse"!=getStyle("borderCollapse",this.content_elem)&&(opts.item_height+=parseInt(getStyle("borderSpacing",this.content_elem))||0),
+opts.block_height=opts.item_height*opts.rows_in_block,opts.rows_in_cluster=opts.blocks_in_cluster*opts.rows_in_block,opts.cluster_height=opts.blocks_in_cluster*opts.block_height,prev_item_height!=opts.item_height}},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var opts=this.options;if(!opts.tag||!opts.show_no_data_row)return[];var td,empty_row=document.createElement(opts.tag),no_data_content=document.createTextNode(opts.no_data_text);return empty_row.className=opts.no_data_class,"tr"==opts.tag&&(td=document.createElement("td"),td.appendChild(no_data_content)),empty_row.appendChild(td||no_data_content),[empty_row.outerHTML]},generate:function(rows,cluster_num){var opts=this.options,rows_len=rows.length;if(rows_lentop_offset&&rows_above++;for(var i=items_start;items_end>i;i++)rows[i]&&this_cluster_rows.push(rows[i]);return{top_offset:top_offset,bottom_offset:bottom_offset,rows_above:rows_above,rows:this_cluster_rows}},renderExtraTag:function(class_name,height){var tag=document.createElement(this.options.tag),clusterize_prefix="clusterize-";return tag.className=[clusterize_prefix+"extra-row",clusterize_prefix+class_name].join(" "),height&&(tag.style.height=height+"px"),tag.outerHTML},insertToDOM:function(rows,cache){var data=this.generate(rows,this.getClusterNum()),this_cluster_rows=data.rows.join(""),this_cluster_content_changed=this.checkChanges("data",this_cluster_rows,cache),only_bottom_offset_changed=this.checkChanges("bottom",data.bottom_offset,cache),callbacks=this.options.callbacks,layout=[];this_cluster_content_changed?(data.top_offset&&(this.options.keep_parity&&layout.push(this.renderExtraTag("keep-parity")),layout.push(this.renderExtraTag("top-space",data.top_offset))),layout.push(this_cluster_rows),data.bottom_offset&&layout.push(this.renderExtraTag("bottom-space",data.bottom_offset)),callbacks.clusterWillChange&&callbacks.clusterWillChange(),this.html(layout.join("")),"ol"==this.options.content_tag&&this.content_elem.setAttribute("start",data.rows_above),callbacks.clusterChanged&&callbacks.clusterChanged()):only_bottom_offset_changed&&(this.content_elem.lastChild.style.height=data.bottom_offset+"px")},html:function(data){var content_elem=this.content_elem;if(ie&&9>=ie&&"tr"==this.options.tag){var last,div=document.createElement("div");for(div.innerHTML="
"+data+"
";last=content_elem.lastChild;)content_elem.removeChild(last);for(var rows_nodes=this.getChildNodes(div.firstChild.firstChild);rows_nodes.length;)content_elem.appendChild(rows_nodes.shift())}else content_elem.innerHTML=data},getChildNodes:function(tag){for(var child_nodes=tag.children,nodes=[],i=0,ii=child_nodes.length;ii>i;i++)nodes.push(child_nodes[i]);return nodes},checkChanges:function(type,value,cache){var changed=value!=cache[type];return cache[type]=value,changed}},Clusterize})},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0,exports.Node=exports.flatten=void 0;var _flatten=__webpack_require__(6),_flatten2=_interopRequireDefault(_flatten),_node=__webpack_require__(8),_node2=_interopRequireDefault(_node);exports.flatten=_flatten2["default"],exports.Node=_node2["default"]},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}exports.__esModule=!0;var _extend=__webpack_require__(7),_extend2=_interopRequireDefault(_extend),_node=__webpack_require__(8),_node2=_interopRequireDefault(_node),flatten=function flatten(){var nodes=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];nodes=[].concat(nodes);var flatten=[],stack=[],pool={lastChild:{}};options.openAllNodes=!!options.openAllNodes,options.openNodes=options.openNodes||[],options.throwOnError=!!options.throwOnError;var firstNode=nodes.length>0?nodes[0]:null,parentNode=firstNode?firstNode.parent:null;!parentNode||parentNode instanceof _node2["default"]||(parentNode=new _node2["default"](parentNode));var rootNode=parentNode||new _node2["default"]({label:"",parent:null,children:nodes,state:{depth:-1,open:!0,path:"",prefixMask:"",total:0}});if(rootNode===parentNode)for(var subtotal=rootNode.state.total||0,p=rootNode;p;){var _p$state=p.state,path=_p$state.path,_p$state$total=_p$state.total,total=void 0===_p$state$total?0:_p$state$total;if(p.isLastChild()&&path&&(pool.lastChild[path]=!0),p.state.total=total-subtotal,p.state.total<0){if(options.throwOnError)throw new Error("The node might have been corrupted: id="+JSON.stringify(p.id)+", state="+JSON.stringify(p.state));console&&console.log("Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s",JSON.stringify(p.id),JSON.stringify(p.label),p.parent,p.children,JSON.stringify(p.state))}p=p.parent}for(stack.push([rootNode,rootNode.state.depth,0]);stack.length>0;)for(var _stack$pop=stack.pop(),current=_stack$pop[0],depth=_stack$pop[1],index=_stack$pop[2],_loop=function(){var node=current.children[index];node instanceof _node2["default"]||(node=new _node2["default"](node)),node.parent=current,node.children=node.children||[],node.parent.children[index]=node;var path=current.state.path+"."+index,open=node.hasChildren()&&function(){var openAllNodes=options.openAllNodes,openNodes=options.openNodes;return openAllNodes?!0:openNodes.indexOf(node)>=0?!0:openNodes.indexOf(node.id)>=0}(),prefixMask=function(prefix){for(var mask="";prefix.length>0;)prefix=prefix.replace(/\.\d+$/,""),mask=!prefix||pool.lastChild[prefix]?"0"+mask:"1"+mask;return mask}(path);node.isLastChild()&&(pool.lastChild[path]=!0),node.state=(0,_extend2["default"])({},node.state,{depth:depth+1,open:open,path:path,prefixMask:prefixMask,total:0});for(var parentDidOpen=!0,_p=node;null!==_p.parent;){if(_p.parent.state.open===!1){parentDidOpen=!1;break}_p=_p.parent}if(parentDidOpen){flatten.push(node);for(var _p2=node;null!==_p2.parent;)_p2.parent.state.total++,_p2=_p2.parent}++index,node.hasChildren()&&(stack.push([current,depth,index]),index=0,depth+=1,current=node)};index1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];if(void 0===target||null===target)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(target),index=0;index0&&index>=0&&index0&&(node=this.children[0]),node},Node.prototype.getLastChild=function(){var node=null;return this.children.length>0&&(node=this.children[this.children.length-1]),node},Node.prototype.getNextSibling=function(){var node=null;if(this.parent){var index=this.parent.children.indexOf(this);index>=0&&index0&&index0},Node.prototype.isLastChild=function(){var hasNextSibling=this.getNextSibling();return!hasNextSibling},Node}();exports["default"]=Node},function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var LookupTable=function(){function LookupTable(){_classCallCheck(this,LookupTable),this.data={}}return LookupTable.prototype.clear=function(){this.data={}},LookupTable.prototype.get=function(key){return this.data[key]},LookupTable.prototype.has=function(key){return void 0!==this.data[key]},LookupTable.prototype.set=function(key,value){return this.data[key]=value,value},LookupTable.prototype.unset=function(key){void 0!==this.data[key]&&delete this.data[key]},LookupTable}();exports["default"]=LookupTable},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.defaultRowRenderer=void 0;var _helper=__webpack_require__(11),defaultRowRenderer=function(node,treeOptions){var id=node.id,label=node.label,_node$loadOnDemand=node.loadOnDemand,loadOnDemand=void 0===_node$loadOnDemand?!1:_node$loadOnDemand,children=node.children,state=node.state,depth=state.depth,open=state.open,path=state.path,total=state.total,_state$selected=state.selected,selected=void 0===_state$selected?!1:_state$selected,childrenLength=Object.keys(children).length,more=node.hasChildren(),togglerContent="";more&&open&&(togglerContent="▼"),more&&!open&&(togglerContent="►"),!more&&loadOnDemand&&(togglerContent="►");var toggler=(0,_helper.buildHTML)("a",togglerContent,{"class":function(){return more&&open?(0,_helper.classNames)("tree-toggler"):more&&!open?(0,_helper.classNames)("tree-toggler","tree-closed"):!more&&loadOnDemand?(0,_helper.classNames)("tree-toggler","tree-closed"):""}()}),title=(0,_helper.buildHTML)("span",(0,_helper.quoteattr)(label),{"class":(0,_helper.classNames)("tree-title")}),treeNode=(0,_helper.buildHTML)("div",toggler+title,{"class":"tree-node",style:"margin-left: "+18*depth+"px"});return(0,_helper.buildHTML)("div",treeNode,{"aria-id":id,"aria-expanded":more&&open,"aria-depth":depth,"aria-path":path,"aria-selected":selected,"aria-children":childrenLength,"aria-total":total,"class":(0,_helper.classNames)("tree-item",{"tree-selected":selected}),droppable:!0})};exports.defaultRowRenderer=defaultRowRenderer},function(module,exports){"use strict";exports.__esModule=!0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj},extend=function(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];target=target||{};for(var index=0;index=0},addClass=function(el,className){if(!el)return"";if(!hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.concat(className).join(" ")}return el.className},removeClass=function(el,className){if(!el)return"";if(hasClass(el,className)){var classes=el.className.split(" ");el.className=classes.filter(function(c){return c!==className}).join(" ")}return el.className},toggleClass=function(el,className){el&&(hasClass(el,className)?removeClass(el,className):addClass(el,className))},classNames=function classNames(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_len2>_key2;_key2++)args[_key2]=arguments[_key2];var classNames=[];return args.forEach(function(arg){Array.isArray(arg)?classNames=classNames.concat(arg):"object"===("undefined"==typeof arg?"undefined":_typeof(arg))?Object.keys(arg).forEach(function(className){var ok=arg[className];ok&&classNames.push(className)}):classNames.push(arg)}),classNames.join(" ")},isDOMElement=function(o){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?o instanceof HTMLElement:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&1===o.nodeType&&"string"==typeof o.nodeName},isDOMNode=function(o){return"object"===("undefined"==typeof Node?"undefined":_typeof(Node))?o instanceof Node:o&&"object"===("undefined"==typeof o?"undefined":_typeof(o))&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName},quoteattr=function(s,preserveCR){return preserveCR=preserveCR?"
":"\n",(""+s).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">").replace(/\r\n/g,preserveCR).replace(/[\r\n]/g,preserveCR)},buildHTML=function buildHTML(tag,html,attrs){switch(tag){case"select":if("object"===("undefined"==typeof html?"undefined":_typeof(html))){var options=html||{};html="";for(var value in options)options.hasOwnProperty(value)&&(html+=buildHTML("option",options[value]||"",{value:value}))}break;default:"object"===("undefined"==typeof html?"undefined":_typeof(html))&&(attrs=html,html=void 0)}var h="<"+tag;for(var attr in attrs)attrs.hasOwnProperty(attr)&&"undefined"!=typeof attrs[attr]&&(h+=" "+attr+'="'+quoteattr(attrs[attr])+'"');return h+="undefined"!=typeof html?">"+html+""+tag+">":"/>"};exports.extend=extend,exports.preventDefault=preventDefault,exports.stopPropagation=stopPropagation,exports.dispatchEvent=dispatchEvent,exports.addEventListener=addEventListener,exports.removeEventListener=removeEventListener,exports.hasClass=hasClass,exports.addClass=addClass,exports.removeClass=removeClass,exports.toggleClass=toggleClass,exports.classNames=classNames,exports.isDOMElement=isDOMElement,exports.isDOMNode=isDOMNode,exports.quoteattr=quoteattr,exports.buildHTML=buildHTML},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _helper=__webpack_require__(11),rowRenderer=function(node,treeOptions){var id=node.id,label=node.label,_node$loadOnDemand=node.loadOnDemand,loadOnDemand=void 0===_node$loadOnDemand?!1:_node$loadOnDemand,children=node.children,state=node.state,_node$props=node.props,props=void 0===_node$props?{}:_node$props,droppable=treeOptions.droppable&&props.droppable,depth=state.depth,open=state.open,path=state.path,total=state.total,_state$loading=state.loading,loading=void 0===_state$loading?!1:_state$loading,_state$selected=state.selected,selected=void 0===_state$selected?!1:_state$selected,childrenLength=Object.keys(children).length,more=node.hasChildren(),togglerContent="";!more&&loadOnDemand&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-right")})),more&&open&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-bottom")})),more&&!open&&(togglerContent=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("glyphicon","glyphicon-triangle-right")}));var toggler=(0,_helper.buildHTML)("a",togglerContent,{"class":function(){return!more&&loadOnDemand?(0,_helper.classNames)("tree-toggler","tree-closed"):more&&open?(0,_helper.classNames)("tree-toggler"):more&&!open?(0,_helper.classNames)("tree-toggler","tree-closed"):""}()}),icon=(0,_helper.buildHTML)("i","",{"class":(0,_helper.classNames)("tree-folder-icon","glyphicon",{"glyphicon-folder-open":more&&open},{"glyphicon-folder-close":more&&!open},{"glyphicon-file":!more})}),title=(0,_helper.buildHTML)("span",(0,_helper.quoteattr)(label),{"class":(0,_helper.classNames)("tree-title")}),loadingIcon=(0,_helper.buildHTML)("i","",{style:"margin-left: 5px","class":(0,_helper.classNames)({hidden:!loading},"glyphicon","glyphicon-refresh",{rotating:loading})}),count=(0,_helper.buildHTML)("span",childrenLength,{"class":"count"}),treeNode=(0,_helper.buildHTML)("div",toggler+icon+title+loadingIcon+count,{"class":"tree-node",style:"margin-left: "+18*depth+"px"}),treeNodeAttributes={"aria-id":id,"aria-expanded":more&&open,"aria-depth":depth,"aria-path":path,"aria-selected":selected,"aria-children":childrenLength,"aria-total":total,"class":(0,_helper.classNames)("tree-item",{"tree-selected":selected})};return droppable&&(treeNodeAttributes.droppable=!0),(0,_helper.buildHTML)("div",treeNode,treeNodeAttributes)};exports["default"]=rowRenderer},function(module,exports,__webpack_require__){var content=__webpack_require__(14);"string"==typeof content&&(content=[[module.id,content,""]]);__webpack_require__(16)(content,{});content.locals&&(module.exports=content.locals)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(15)(),exports.push([module.id,".infinite-tree-content{max-height:400px}.infinite-tree-scroll{overflow:auto}.infinite-tree-content{outline:0}.infinite-tree-content .tree-selected.tree-item,.infinite-tree-content .tree-selected.tree-item:hover{background:#deecfd;border:1px solid #06c}.infinite-tree-content .tree-item{border:1px solid transparent;cursor:default}.infinite-tree-content .tree-item:hover{background:#f2fdff}.infinite-tree-content .tree-item.highlight{border:1px dotted #ccc;background-color:#f5f6f7}.infinite-tree-content .tree-node{position:relative}.infinite-tree-content .tree-toggler{color:#666;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-tree-content .tree-toggler:hover{color:#333;text-decoration:none}.infinite-tree-content .tree-title{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-tree-no-data{text-align:center}",""])},function(module,exports){module.exports=function(){var list=[];return list.toString=function(){for(var result=[],i=0;i=0&&styleElementsInsertedAtTop.splice(idx,1)}function createStyleElement(options){var styleElement=document.createElement("style");return styleElement.type="text/css",insertStyleElement(options,styleElement),styleElement}function createLinkElement(options){var linkElement=document.createElement("link");return linkElement.rel="stylesheet",insertStyleElement(options,linkElement),linkElement}function addStyle(obj,options){var styleElement,update,remove;if(options.singleton){var styleIndex=singletonCounter++;styleElement=singletonElement||(singletonElement=createStyleElement(options)),update=applyToSingletonTag.bind(null,styleElement,styleIndex,!1),remove=applyToSingletonTag.bind(null,styleElement,styleIndex,!0)}else obj.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(styleElement=createLinkElement(options),update=updateLink.bind(null,styleElement),remove=function(){removeStyleElement(styleElement),styleElement.href&&URL.revokeObjectURL(styleElement.href)}):(styleElement=createStyleElement(options),update=applyToTag.bind(null,styleElement),remove=function(){removeStyleElement(styleElement)});return update(obj),function(newObj){if(newObj){if(newObj.css===obj.css&&newObj.media===obj.media&&newObj.sourceMap===obj.sourceMap)return;update(obj=newObj)}else remove()}}function applyToSingletonTag(styleElement,index,remove,obj){var css=remove?"":obj.css;if(styleElement.styleSheet)styleElement.styleSheet.cssText=replaceText(index,css);else{var cssNode=document.createTextNode(css),childNodes=styleElement.childNodes;childNodes[index]&&styleElement.removeChild(childNodes[index]),childNodes.length?styleElement.insertBefore(cssNode,childNodes[index]):styleElement.appendChild(cssNode)}}function applyToTag(styleElement,obj){var css=obj.css,media=obj.media;if(media&&styleElement.setAttribute("media",media),styleElement.styleSheet)styleElement.styleSheet.cssText=css;else{for(;styleElement.firstChild;)styleElement.removeChild(styleElement.firstChild);styleElement.appendChild(document.createTextNode(css))}}function updateLink(linkElement,obj){var css=obj.css,sourceMap=obj.sourceMap;sourceMap&&(css+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */");var blob=new Blob([css],{type:"text/css"}),oldSrc=linkElement.href;linkElement.href=URL.createObjectURL(blob),oldSrc&&URL.revokeObjectURL(oldSrc)}var stylesInDom={},memoize=function(fn){var memo;return function(){return"undefined"==typeof memo&&(memo=fn.apply(this,arguments)),memo}},isOldIE=memoize(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),getHeadElement=memoize(function(){return document.head||document.getElementsByTagName("head")[0]}),singletonElement=null,singletonCounter=0,styleElementsInsertedAtTop=[];module.exports=function(list,options){if("object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");options=options||{},"undefined"==typeof options.singleton&&(options.singleton=isOldIE()),"undefined"==typeof options.insertAt&&(options.insertAt="bottom");var styles=listToStyles(list);return addStylesToDom(styles,options),function(newList){for(var mayRemove=[],i=0;i').replace(/\\s/g, ' ');\n\t } else {\n\t el.innerHTML = '';\n\t }\n\t};\n\t\n\tvar tree = new _src2['default'](document.querySelector('#tree'), {\n\t autoOpen: true, // Defaults to false\n\t droppable: true, // Defaults to false\n\t loadNodes: function loadNodes(parentNode, done) {\n\t var suffix = parentNode.id.replace(/(\\w)+/, '');\n\t var nodes = [{\n\t id: 'node1' + suffix,\n\t label: 'Node 1'\n\t }, {\n\t id: 'node2' + suffix,\n\t label: 'Node 2'\n\t }];\n\t setTimeout(function () {\n\t done(null, nodes);\n\t }, 1000);\n\t },\n\t rowRenderer: _renderer2['default'],\n\t selectable: true, // Defaults to true\n\t shouldSelectNode: function shouldSelectNode(node) {\n\t // Defaults to null\n\t if (!node || node === tree.getSelectedNode()) {\n\t return false; // Prevent from deselecting the current node\n\t }\n\t return true;\n\t }\n\t});\n\t\n\ttree.on('scrollProgress', function (progress) {\n\t document.querySelector('#scrolling-progress').style.width = progress + '%';\n\t});\n\ttree.on('update', function () {\n\t var node = tree.getSelectedNode();\n\t updatePreview(node);\n\t});\n\ttree.on('openNode', function (node) {\n\t console.log('openNode', node);\n\t});\n\ttree.on('closeNode', function (node) {\n\t console.log('closeNode', node);\n\t});\n\ttree.on('dropNode', function (node, e) {\n\t var source = e.dataTransfer.getData('text');\n\t console.log('Dragged an element ' + JSON.stringify(source) + ' and dropped to ' + JSON.stringify(node.label));\n\t document.querySelector('#dropped-result').innerHTML = 'Dropped to ' + (0, _helper.quoteattr)(node.label) + '';\n\t});\n\ttree.on('selectNode', function (node) {\n\t updatePreview(node);\n\t});\n\t\n\ttree.loadData(data);\n\t\n\t// Select the first node\n\ttree.selectNode(tree.getChildNodes()[0]);\n\t\n\t// Draggable Element\n\tvar draggableElement = document.querySelector('#draggable-element');\n\t\n\t// http://stackoverflow.com/questions/5500615/internet-explorer-9-drag-and-drop-dnd\n\t(0, _helper.addEventListener)(draggableElement, 'selectstart', function (e) {\n\t (0, _helper.preventDefault)(e);\n\t (0, _helper.stopPropagation)(e);\n\t draggableElement.dragDrop();\n\t return false;\n\t});\n\t\n\t(0, _helper.addEventListener)(draggableElement, 'dragstart', function (e) {\n\t e.dataTransfer.effectAllowed = 'move';\n\t var target = e.target || e.srcElement;\n\t e.dataTransfer.setData('text', target.id);\n\t document.querySelector('#dropped-result').innerHTML = '';\n\t});\n\t\n\t(0, _helper.addEventListener)(draggableElement, 'dragend', function (e) {});\n\t\n\twindow.tree = tree;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _infiniteTree = __webpack_require__(2);\n\t\n\tvar _infiniteTree2 = _interopRequireDefault(_infiniteTree);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tmodule.exports = _infiniteTree2['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _events = __webpack_require__(3);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _clusterize = __webpack_require__(4);\n\t\n\tvar _clusterize2 = _interopRequireDefault(_clusterize);\n\t\n\tvar _flattree = __webpack_require__(5);\n\t\n\tvar _lookupTable = __webpack_require__(9);\n\t\n\tvar _lookupTable2 = _interopRequireDefault(_lookupTable);\n\t\n\tvar _renderer = __webpack_require__(10);\n\t\n\tvar _helper = __webpack_require__(11);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ensureNodeInstance = function ensureNodeInstance(node) {\n\t if (!(node instanceof _flattree.Node)) {\n\t throw new Error('The node must be a Node object.');\n\t }\n\t return true;\n\t};\n\t\n\tvar InfiniteTree = function (_events$EventEmitter) {\n\t _inherits(InfiniteTree, _events$EventEmitter);\n\t\n\t // Creates new InfiniteTree object.\n\t\n\t function InfiniteTree(el, options) {\n\t _classCallCheck(this, InfiniteTree);\n\t\n\t var _this = _possibleConstructorReturn(this, _events$EventEmitter.call(this));\n\t\n\t _this.options = {\n\t autoOpen: false,\n\t droppable: false,\n\t el: null,\n\t loadNodes: null,\n\t rowRenderer: _renderer.defaultRowRenderer,\n\t selectable: true,\n\t shouldSelectNode: null\n\t };\n\t _this.state = {\n\t openNodes: [],\n\t rootNode: null,\n\t selectedNode: null\n\t };\n\t _this.clusterize = null;\n\t _this.nodeTable = new _lookupTable2['default']();\n\t _this.nodes = [];\n\t _this.rows = [];\n\t _this.scrollElement = null;\n\t _this.contentElement = null;\n\t _this.dragoverElement = null;\n\t _this.contentListener = {\n\t 'click': function click(e) {\n\t var itemTarget = null;\n\t var handleToggler = false;\n\t\n\t (0, _helper.stopPropagation)(e);\n\t\n\t if (e.target && e.currentTarget) {\n\t itemTarget = e.target !== e.currentTarget ? e.target : null;\n\t } else if (e.srcElement) {\n\t // IE8\n\t itemTarget = e.srcElement;\n\t }\n\t\n\t while (itemTarget && itemTarget.parentElement !== _this.contentElement) {\n\t if (itemTarget.className.indexOf('tree-toggler') >= 0) {\n\t handleToggler = true;\n\t }\n\t itemTarget = itemTarget.parentElement;\n\t }\n\t\n\t if (!itemTarget) {\n\t return;\n\t }\n\t\n\t var id = itemTarget.getAttribute('aria-id');\n\t var node = _this.getNodeById(id);\n\t\n\t if (!node) {\n\t return;\n\t }\n\t\n\t // Click on the toggler to open/close a tree node\n\t if (handleToggler) {\n\t _this.toggleNode(node);\n\t return;\n\t }\n\t\n\t _this.selectNode(node);\n\t },\n\t // https://developer.mozilla.org/en-US/docs/Web/Events/dragenter\n\t // The dragenter event is fired when a dragged element or text selection enters a valid drop target.\n\t 'dragenter': function dragenter(e) {\n\t var itemTarget = null;\n\t\n\t if (e.target && e.currentTarget) {\n\t itemTarget = e.target !== e.currentTarget ? e.target : null;\n\t } else if (e.srcElement) {\n\t // IE8\n\t itemTarget = e.srcElement;\n\t }\n\t\n\t while (itemTarget && itemTarget.parentElement !== _this.contentElement) {\n\t itemTarget = itemTarget.parentElement;\n\t }\n\t\n\t if (!itemTarget) {\n\t return;\n\t }\n\t\n\t if (_this.dragoverElement !== itemTarget) {\n\t (0, _helper.removeClass)(_this.dragoverElement, 'highlight'); // remove 'highlight' class\n\t _this.dragoverElement = null;\n\t\n\t if (!itemTarget.hasAttribute('droppable')) {\n\t return;\n\t }\n\t\n\t var canDrop = !itemTarget.getAttribute('droppable').match(/false/i);\n\t if (canDrop) {\n\t (0, _helper.addClass)(itemTarget, 'highlight');\n\t _this.dragoverElement = itemTarget;\n\t }\n\t }\n\t },\n\t // https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n\t // The dragend event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).\n\t 'dragend': function dragend(e) {\n\t if (_this.dragoverElement) {\n\t (0, _helper.removeClass)(_this.dragoverElement, 'highlight'); // remove 'highlight' class\n\t _this.dragoverElement = null;\n\t }\n\t },\n\t // https://developer.mozilla.org/en-US/docs/Web/Events/dragover\n\t // The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds).\n\t 'dragover': function dragover(e) {\n\t (0, _helper.preventDefault)(e);\n\t e.dataTransfer.dropEffect = 'move';\n\t return false;\n\t },\n\t // https://developer.mozilla.org/en-US/docs/Web/Events/drop\n\t // The drop event is fired when an element or text selection is dropped on a valid drop target.\n\t 'drop': function drop(e) {\n\t // prevent default action (open as link for some elements)\n\t (0, _helper.preventDefault)(e);\n\t\n\t if (_this.dragoverElement) {\n\t var id = _this.dragoverElement.getAttribute('aria-id');\n\t var node = _this.getNodeById(id);\n\t\n\t (0, _helper.removeClass)(_this.dragoverElement, 'highlight');\n\t _this.dragoverElement = null;\n\t\n\t _this.emit('dropNode', node, e);\n\t }\n\t }\n\t };\n\t\n\t\n\t if ((0, _helper.isDOMElement)(el)) {\n\t options.el = el;\n\t } else {\n\t options = el;\n\t }\n\t\n\t // Assign options\n\t _this.options = (0, _helper.extend)({}, _this.options, options);\n\t\n\t if (!_this.options.el) {\n\t console.error('Failed to initialize infinite-tree: el is not specified.', options);\n\t return _possibleConstructorReturn(_this);\n\t }\n\t\n\t _this.create();\n\t\n\t // Load tree data if it's provided\n\t if (options.data) {\n\t _this.loadData(options.data);\n\t }\n\t return _this;\n\t }\n\t\n\t InfiniteTree.prototype.create = function create() {\n\t var _this2 = this;\n\t\n\t if (!this.options.el) {\n\t throw new Error('The element option is not specified.');\n\t }\n\t\n\t var scrollElement = document.createElement('div');\n\t scrollElement.className = (0, _helper.classNames)('infinite-tree', 'infinite-tree-scroll');\n\t var contentElement = document.createElement('div');\n\t contentElement.className = (0, _helper.classNames)('infinite-tree', 'infinite-tree-content');\n\t\n\t scrollElement.appendChild(contentElement);\n\t this.options.el.appendChild(scrollElement);\n\t\n\t this.clusterize = new _clusterize2['default']({\n\t tag: 'div',\n\t rows: [],\n\t scrollElem: scrollElement,\n\t contentElem: contentElement,\n\t no_data_class: 'infinite-tree-no-data',\n\t callbacks: {\n\t // Will be called right before replacing previous cluster with new one.\n\t clusterWillChange: function clusterWillChange() {},\n\t // Will be called right after replacing previous cluster with new one.\n\t clusterChanged: function clusterChanged() {},\n\t // Will be called on scrolling. Returns progress position.\n\t scrollingProgress: function scrollingProgress(progress) {\n\t _this2.emit('scrollProgress', progress);\n\t }\n\t }\n\t });\n\t\n\t this.scrollElement = scrollElement;\n\t this.contentElement = contentElement;\n\t\n\t (0, _helper.addEventListener)(this.contentElement, 'click', this.contentListener.click);\n\t if (this.options.droppable) {\n\t (0, _helper.addEventListener)(document, 'dragend', this.contentListener.dragend);\n\t (0, _helper.addEventListener)(this.contentElement, 'dragenter', this.contentListener.dragenter);\n\t (0, _helper.addEventListener)(this.contentElement, 'dragover', this.contentListener.dragover);\n\t (0, _helper.addEventListener)(this.contentElement, 'drop', this.contentListener.drop);\n\t }\n\t };\n\t\n\t InfiniteTree.prototype.destroy = function destroy() {\n\t (0, _helper.removeEventListener)(this.contentElement, 'click', this.contentListener);\n\t if (this.options.droppable) {\n\t (0, _helper.removeEventListener)(document, 'dragend', this.contentListener.dragend);\n\t (0, _helper.removeEventListener)(this.contentElement, 'dragenter', this.contentListener.dragenter);\n\t (0, _helper.removeEventListener)(this.contentElement, 'dragover', this.contentListener.dragover);\n\t (0, _helper.removeEventListener)(this.contentElement, 'drop', this.contentListener.drop);\n\t }\n\t\n\t this.clear();\n\t\n\t if (this.clusterize) {\n\t this.clusterize.destroy(true); // True to remove all data from the list\n\t this.clusterize = null;\n\t }\n\t\n\t // Remove all child nodes\n\t while (this.contentElement.firstChild) {\n\t this.contentElement.removeChild(this.contentElement.firstChild);\n\t }\n\t while (this.scrollElement.firstChild) {\n\t this.scrollElement.removeChild(this.scrollElement.firstChild);\n\t }\n\t if (this.options.el) {\n\t var containerElement = this.options.el;\n\t while (containerElement.firstChild) {\n\t containerElement.removeChild(containerElement.firstChild);\n\t }\n\t }\n\t this.contentElement = null;\n\t this.scrollElement = null;\n\t };\n\t // Adds an array of new child nodes to a parent node at the specified index.\n\t // * If the parent is null or undefined, inserts new childs at the specified index in the top-level.\n\t // * If the parent has children, the method adds the new child to it at the specified index.\n\t // * If the parent does not have children, the method adds the new child to the parent.\n\t // * If the index value is greater than or equal to the number of children in the parent, the method adds the child at the end of the children.\n\t // @param {Array} newNodes An array of new child nodes.\n\t // @param {number} [index] The 0-based index of where to insert the child node.\n\t // @param {Node} parentNode The Node object that defines the parent node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.addChildNodes = function addChildNodes(newNodes, index, parentNode) {\n\t var _this3 = this;\n\t\n\t newNodes = [].concat(newNodes || []); // Ensure array\n\t if (newNodes.length === 0) {\n\t return false;\n\t }\n\t\n\t if ((typeof index === 'undefined' ? 'undefined' : _typeof(index)) === 'object') {\n\t // The 'object' type might be Node or null\n\t parentNode = index || this.state.rootNode; // Defaults to rootNode if not specified\n\t index = parentNode.children.length;\n\t } else {\n\t parentNode = parentNode || this.state.rootNode; // Defaults to rootNode if not specified\n\t }\n\t\n\t ensureNodeInstance(parentNode);\n\t\n\t // Assign parent\n\t newNodes.forEach(function (newNode) {\n\t newNode.parent = parentNode;\n\t });\n\t\n\t // Insert new child node at the specified index\n\t parentNode.children.splice.apply(parentNode.children, [index, 0].concat(newNodes));\n\t\n\t // Get the index of the first new node within the array of child nodes\n\t index = parentNode.children.indexOf(newNodes[0]);\n\t\n\t var deleteCount = parentNode.state.total;\n\t var nodes = (0, _flattree.flatten)(parentNode.children, { openNodes: this.state.openNodes });\n\t var rows = nodes.map(function (node) {\n\t return _this3.options.rowRenderer(node, _this3.options);\n\t });\n\t\n\t if (parentNode === this.state.rootNode) {\n\t this.nodes = nodes;\n\t this.rows = rows;\n\t } else {\n\t var parentOffset = this.nodes.indexOf(parentNode);\n\t if (parentOffset >= 0) {\n\t // Update nodes & rows\n\t this.nodes.splice.apply(this.nodes, [parentOffset + 1, deleteCount].concat(nodes));\n\t this.rows.splice.apply(this.rows, [parentOffset + 1, deleteCount].concat(rows));\n\t\n\t // Update the row corresponding to the parent node\n\t this.rows[parentOffset] = this.options.rowRenderer(parentNode, this.options);\n\t }\n\t }\n\t\n\t // Update the lookup table with newly added nodes\n\t parentNode.children.slice(index).forEach(function (childNode) {\n\t _this3.flattenNode(childNode).forEach(function (node) {\n\t if (node.id !== undefined) {\n\t _this3.nodeTable.set(node.id, node);\n\t }\n\t });\n\t });\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Adds a new child node to the end of the list of children of a specified parent node.\n\t // * If the parent is null or undefined, inserts the child at the specified index in the top-level.\n\t // * If the parent has children, the method adds the child as the last child.\n\t // * If the parent does not have children, the method adds the child to the parent.\n\t // @param {Object} newNode The new child node.\n\t // @param {Node} parentNode The Node object that defines the parent node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.appendChildNode = function appendChildNode(newNode, parentNode) {\n\t // Defaults to rootNode if the parentNode is not specified\n\t parentNode = parentNode || this.state.rootNode;\n\t ensureNodeInstance(parentNode);\n\t var index = parentNode.children.length;\n\t var newNodes = [].concat(newNode || []); // Ensure array\n\t return this.addChildNodes(newNodes, index, parentNode);\n\t };\n\t // Clears the tree.\n\t\n\t\n\t InfiniteTree.prototype.clear = function clear() {\n\t this.clusterize.clear();\n\t this.nodeTable.clear();\n\t this.nodes = [];\n\t this.rows = [];\n\t this.state.openNodes = [];\n\t this.state.rootNode = null;\n\t this.state.selectedNode = null;\n\t };\n\t // Closes a node to hide its children.\n\t // @param {Node} node The Node object.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.closeNode = function closeNode(node) {\n\t ensureNodeInstance(node);\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t if (nodeIndex < 0) {\n\t throw new Error('Invalid node index');\n\t }\n\t\n\t // Check if the closeNode action can be performed\n\t if (this.state.openNodes.indexOf(node) < 0) {\n\t return false;\n\t }\n\t\n\t // Keep selected node unchanged if \"node\" is equal to \"this.state.selectedNode\"\n\t if (this.state.selectedNode && this.state.selectedNode !== node) {\n\t // row #0 - node.0 => parent node (total=4)\n\t // row #1 - node.0.0 => close this node; next selected node (total=2)\n\t // row #2 node.0.0.0 => selected node (total=0)\n\t // row #3 node.0.0.1\n\t // row #4 node.0.1\n\t var selectedIndex = this.nodes.indexOf(this.state.selectedNode);\n\t var rangeFrom = nodeIndex + 1;\n\t var rangeTo = nodeIndex + node.state.total;\n\t\n\t if (rangeFrom <= selectedIndex && selectedIndex <= rangeTo) {\n\t this.selectNode(node);\n\t }\n\t }\n\t\n\t node.state.open = false; // Set the open state to false\n\t var openNodes = this.state.openNodes.filter(function (node) {\n\t return node.hasChildren() && node.state.open;\n\t });\n\t this.state.openNodes = openNodes;\n\t\n\t var deleteCount = node.state.total;\n\t\n\t // Subtract the deleteCount for all ancestors (parent, grandparent, etc.) of the current node\n\t for (var p = node; p !== null; p = p.parent) {\n\t p.state.total = p.state.total - deleteCount;\n\t }\n\t\n\t // Update nodes & rows\n\t this.nodes.splice(nodeIndex + 1, deleteCount);\n\t this.rows.splice(nodeIndex + 1, deleteCount);\n\t\n\t // Update the row corresponding to the node\n\t this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);\n\t\n\t // Emit the 'closeNode' event\n\t this.emit('closeNode', node);\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Flattens all child nodes of a parent node by performing full tree traversal using child-parent link.\n\t // No recursion or stack is involved.\n\t // @param {Node} parentNode The Node object that defines the parent node.\n\t // @return {array} Returns an array of Node objects containing all the child nodes of the parent node.\n\t\n\t\n\t InfiniteTree.prototype.flattenChildNodes = function flattenChildNodes(parentNode) {\n\t // Defaults to rootNode if the parentNode is not specified\n\t parentNode = parentNode || this.state.rootNode;\n\t\n\t ensureNodeInstance(parentNode);\n\t\n\t var list = [];\n\t\n\t // Ignore parent node\n\t var node = parentNode.getFirstChild();\n\t while (node) {\n\t list.push(node);\n\t if (node.hasChildren()) {\n\t node = node.getFirstChild();\n\t } else {\n\t // find the parent level\n\t while (node.getNextSibling() === null && node.parent !== parentNode) {\n\t // use child-parent link to get to the parent level\n\t node = node.getParent();\n\t }\n\t\n\t // Get next sibling\n\t node = node.getNextSibling();\n\t }\n\t }\n\t\n\t return list;\n\t };\n\t // Flattens a node by performing full tree traversal using child-parent link.\n\t // No recursion or stack is involved.\n\t // @param {Node} node The Node object.\n\t // @return {array} Returns a flattened list of Node objects.\n\t\n\t\n\t InfiniteTree.prototype.flattenNode = function flattenNode(node) {\n\t return [node].concat(this.flattenChildNodes(node));\n\t };\n\t // Gets a list of child nodes.\n\t // @param {Node} [parentNode] The Node object that defines the parent node. If null or undefined, returns a list of top level nodes.\n\t // @return {array} Returns an array of Node objects containing all the child nodes of the parent node.\n\t\n\t\n\t InfiniteTree.prototype.getChildNodes = function getChildNodes(parentNode) {\n\t // Defaults to rootNode if the parentNode is not specified\n\t parentNode = parentNode || this.state.rootNode;\n\t\n\t ensureNodeInstance(parentNode);\n\t\n\t return parentNode.children;\n\t };\n\t // Gets a node by its unique id. This assumes that you have given the nodes in the data a unique id.\n\t // @param {string|number} id An unique node id. A null value will be returned if the id doesn't match.\n\t // @return {Node} Returns a node the matches the id, null otherwise.\n\t\n\t\n\t InfiniteTree.prototype.getNodeById = function getNodeById(id) {\n\t var node = this.nodeTable.get(id);\n\t if (!node) {\n\t // Find the first node that matches the id\n\t node = this.nodes.filter(function (node) {\n\t return node.id === id;\n\t })[0];\n\t if (!node) {\n\t return null;\n\t }\n\t this.nodeTable.set(node.id, node);\n\t }\n\t return node;\n\t };\n\t // Gets an array of open nodes.\n\t // @return {array} Returns an array of Node objects containing open nodes.\n\t\n\t\n\t InfiniteTree.prototype.getOpenNodes = function getOpenNodes() {\n\t // returns a shallow copy of an array into a new array object.\n\t return this.state.openNodes.slice();\n\t };\n\t // Gets the root node.\n\t // @return {Node} Returns the root node, or null if empty.\n\t\n\t\n\t InfiniteTree.prototype.getRootNode = function getRootNode() {\n\t return this.state.rootNode;\n\t };\n\t // Gets the selected node.\n\t // @return {Node} Returns the selected node, or null if not selected.\n\t\n\t\n\t InfiniteTree.prototype.getSelectedNode = function getSelectedNode() {\n\t return this.state.selectedNode;\n\t };\n\t // Inserts the specified node after the reference node.\n\t // @param {Object} newNode The new sibling node.\n\t // @param {Node} referenceNode The Node object that defines the reference node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.insertNodeAfter = function insertNodeAfter(newNode, referenceNode) {\n\t ensureNodeInstance(referenceNode);\n\t var parentNode = referenceNode.getParent();\n\t var index = parentNode.children.indexOf(referenceNode) + 1;\n\t var newNodes = [].concat(newNode || []); // Ensure array\n\t return this.addChildNodes(newNodes, index, parentNode);\n\t };\n\t // Inserts the specified node before the reference node.\n\t // @param {Object} newNode The new sibling node.\n\t // @param {Node} referenceNode The Node object that defines the reference node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.insertNodeBefore = function insertNodeBefore(newNode, referenceNode) {\n\t ensureNodeInstance(referenceNode);\n\t var parentNode = referenceNode.getParent();\n\t var index = parentNode.children.indexOf(referenceNode);\n\t var newNodes = [].concat(newNode || []); // Ensure array\n\t return this.addChildNodes(newNodes, index, parentNode);\n\t };\n\t // Loads data in the tree.\n\t // @param {object|array} data The data is an object or array of objects that defines the node.\n\t\n\t\n\t InfiniteTree.prototype.loadData = function loadData() {\n\t var _this4 = this;\n\t\n\t var data = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t\n\t this.nodes = (0, _flattree.flatten)(data, { openAllNodes: this.options.autoOpen });\n\t\n\t // Clear lookup table\n\t this.nodeTable.clear();\n\t\n\t this.state.openNodes = this.nodes.filter(function (node) {\n\t return node.hasChildren() && node.state.open;\n\t });\n\t this.state.rootNode = function () {\n\t var node = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\t\n\t // Finding the root node\n\t while (node && node.parent !== null) {\n\t node = node.parent;\n\t }\n\t return node;\n\t }(this.nodes[0]);\n\t this.state.selectedNode = null;\n\t\n\t // Update the lookup table with newly added nodes\n\t this.flattenChildNodes(this.state.rootNode).forEach(function (node) {\n\t if (node.id !== undefined) {\n\t _this4.nodeTable.set(node.id, node);\n\t }\n\t });\n\t\n\t // Update rows\n\t this.rows = this.nodes.map(function (node) {\n\t return _this4.options.rowRenderer(node, _this4.options);\n\t });\n\t\n\t // Updates list with new data\n\t this.update();\n\t };\n\t // Opens a node to display its children.\n\t // @param {Node} node The Node object.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.openNode = function openNode(node) {\n\t var _this5 = this;\n\t\n\t ensureNodeInstance(node);\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t if (nodeIndex < 0) {\n\t throw new Error('Invalid node index');\n\t }\n\t\n\t // Check if the openNode action can be performed\n\t if (this.state.openNodes.indexOf(node) >= 0) {\n\t return false;\n\t }\n\t\n\t if (!node.hasChildren() && node.loadOnDemand) {\n\t if (typeof this.options.loadNodes !== 'function') {\n\t return false;\n\t }\n\t\n\t // Set loading state to true\n\t node.state.loading = true;\n\t this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t this.options.loadNodes(node, function (err, nodes) {\n\t // Set loading state to false\n\t node.state.loading = false;\n\t _this5.rows[nodeIndex] = _this5.options.rowRenderer(node, _this5.options);\n\t\n\t // Updates list with new data\n\t _this5.update();\n\t\n\t if (err) {\n\t return;\n\t }\n\t\n\t // Append child nodes\n\t nodes.forEach(function (childNode) {\n\t _this5.appendChildNode(childNode, node);\n\t });\n\t\n\t // Call openNode again\n\t _this5.openNode(node);\n\t });\n\t\n\t return false;\n\t }\n\t\n\t node.state.open = true; // Set node.state.open to true\n\t var openNodes = [node].concat(this.state.openNodes); // the most recently used items first\n\t this.state.openNodes = openNodes;\n\t\n\t var nodes = (0, _flattree.flatten)(node.children, { openNodes: this.state.openNodes });\n\t var rows = nodes.map(function (node) {\n\t return _this5.options.rowRenderer(node, _this5.options);\n\t });\n\t\n\t // Update nodes & rows\n\t this.nodes.splice.apply(this.nodes, [nodeIndex + 1, 0].concat(nodes));\n\t this.rows.splice.apply(this.rows, [nodeIndex + 1, 0].concat(rows));\n\t\n\t // Update the row corresponding to the node\n\t this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);\n\t\n\t // Add all child nodes to the lookup table if the first child does not exist in the lookup table\n\t if (nodes.length > 0 && !this.nodeTable.get(nodes[0])) {\n\t nodes.forEach(function (node) {\n\t if (node.id !== undefined) {\n\t _this5.nodeTable.set(node.id, node);\n\t }\n\t });\n\t }\n\t\n\t // Emit the 'openNode' event\n\t this.emit('openNode', node);\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Removes all child nodes from a parent node.\n\t // @param {Node} parentNode The Node object that defines the parent node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.removeChildNodes = function removeChildNodes(parentNode) {\n\t var _this6 = this;\n\t\n\t ensureNodeInstance(parentNode);\n\t\n\t if (parentNode.children.length === 0) {\n\t return false;\n\t }\n\t\n\t var parentNodeIndex = this.nodes.indexOf(parentNode);\n\t\n\t // Update selected node\n\t if (parentNodeIndex >= 0 && this.state.selectedNode) {\n\t // row #0 - node.0 => parent node (total=4)\n\t // row #1 - node.0.0\n\t // row #2 node.0.0.0 => current selected node\n\t // row #3 node.0.0.1\n\t // row #4 node.0.1\n\t var selectedIndex = this.nodes.indexOf(this.state.selectedNode);\n\t var rangeFrom = parentNodeIndex + 1;\n\t var rangeTo = parentNodeIndex + parentNode.state.total;\n\t\n\t if (rangeFrom <= selectedIndex && selectedIndex <= rangeTo) {\n\t this.selectNode(parentNode);\n\t }\n\t }\n\t\n\t // Update parent node\n\t parentNode.children = [];\n\t parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;\n\t\n\t // Get the number of nodes to be removed\n\t var deleteCount = parentNode.state.total;\n\t\n\t // Subtract the deleteCount for all ancestors (parent, grandparent, etc.) of the current node\n\t for (var p = parentNode; p !== null; p = p.parent) {\n\t p.state.total = p.state.total - deleteCount;\n\t }\n\t\n\t if (parentNodeIndex >= 0) {\n\t // Update nodes & rows\n\t this.nodes.splice(parentNodeIndex + 1, deleteCount);\n\t this.rows.splice(parentNodeIndex + 1, deleteCount);\n\t\n\t // Update the row corresponding to the parent node\n\t this.rows[parentNodeIndex] = this.options.rowRenderer(parentNode, this.options);\n\t }\n\t\n\t {\n\t (function () {\n\t // Update open nodes and lookup table\n\t var childNodes = _this6.flattenChildNodes(parentNode);\n\t\n\t _this6.state.openNodes = _this6.state.openNodes.filter(function (node) {\n\t return childNodes.indexOf(node) < 0;\n\t });\n\t\n\t childNodes.forEach(function (node) {\n\t _this6.nodeTable.unset(node.id);\n\t });\n\t })();\n\t }\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Removes a node and all of its child nodes.\n\t // @param {Node} node The Node object.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.removeNode = function removeNode(node) {\n\t var _this7 = this;\n\t\n\t ensureNodeInstance(node);\n\t\n\t var parentNode = node.parent;\n\t if (!parentNode) {\n\t return false;\n\t }\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t var parentNodeIndex = this.nodes.indexOf(parentNode);\n\t\n\t // Update selected node\n\t if (nodeIndex >= 0 && this.state.selectedNode) {\n\t // row #0 - node.0 => parent node (total=4)\n\t // row #1 - node.0.0 => remove this node (total=2)\n\t // row #2 node.0.0.0 => current selected node (total=0)\n\t // row #3 node.0.0.1\n\t // row #4 node.0.1 => next selected node (total=0)\n\t var selectedIndex = this.nodes.indexOf(this.state.selectedNode);\n\t var rangeFrom = nodeIndex;\n\t var rangeTo = nodeIndex + node.state.total + 1;\n\t\n\t if (rangeFrom <= selectedIndex && selectedIndex <= rangeTo) {\n\t // Change the selected node in the following order:\n\t // 1. next sibling node\n\t // 2. previous sibling node\n\t // 3. parent node\n\t var selectedNode = node.getNextSibling() || node.getPreviousSibling() || node.getParent();\n\t this.selectNode(selectedNode);\n\t }\n\t }\n\t\n\t // Update parent node\n\t parentNode.children.splice(parentNode.children.indexOf(node), 1);\n\t parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;\n\t\n\t // Get the number of nodes to be removed\n\t var deleteCount = node.state.total + 1;\n\t\n\t // Subtract the deleteCount for all ancestors (parent, grandparent, etc.) of the current node\n\t for (var p = parentNode; p !== null; p = p.parent) {\n\t p.state.total = p.state.total - deleteCount;\n\t }\n\t\n\t if (nodeIndex >= 0) {\n\t // Update nodes & rows\n\t this.nodes.splice(nodeIndex, deleteCount);\n\t this.rows.splice(nodeIndex, deleteCount);\n\t }\n\t\n\t // Update the row corresponding to the parent node\n\t if (parentNodeIndex >= 0) {\n\t this.rows[parentNodeIndex] = this.options.rowRenderer(parentNode, this.options);\n\t }\n\t\n\t {\n\t (function () {\n\t // Update open nodes and lookup table\n\t var nodes = _this7.flattenNode(node);\n\t\n\t _this7.state.openNodes = _this7.state.openNodes.filter(function (node) {\n\t return nodes.indexOf(node) < 0;\n\t });\n\t\n\t nodes.forEach(function (node) {\n\t _this7.nodeTable.unset(node.id);\n\t });\n\t })();\n\t }\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Sets the current scroll position to this node.\n\t // @param {Node} node The Node object.\n\t // @return {number} Returns the vertical scroll position, or -1 on error.\n\t\n\t\n\t InfiniteTree.prototype.scrollToNode = function scrollToNode(node) {\n\t ensureNodeInstance(node);\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t if (nodeIndex < 0) {\n\t return -1;\n\t }\n\t if (!this.contentElement) {\n\t return -1;\n\t }\n\t // Get the offset height of the first child element that contains the \"tree-item\" class\n\t var firstChild = this.contentElement.querySelectorAll('.tree-item')[0];\n\t var rowHeight = firstChild && firstChild.offsetHeight || 0;\n\t return this.scrollTop(nodeIndex * rowHeight);\n\t };\n\t // Gets (or sets) the current vertical position of the scroll bar.\n\t // @param {number} [value] An integer that indicates the new position to set the scroll bar to.\n\t // @return {number} Returns the vertical scroll position.\n\t\n\t\n\t InfiniteTree.prototype.scrollTop = function scrollTop(value) {\n\t if (!this.scrollElement) {\n\t return 0;\n\t }\n\t if (value !== undefined) {\n\t this.scrollElement.scrollTop = Number(value);\n\t }\n\t return this.scrollElement.scrollTop;\n\t };\n\t // Selects a node.\n\t // @param {Node} node The Node object. If null or undefined, deselects the current node.\n\t // @return {boolean} Returns true on success, false otherwise.\n\t\n\t\n\t InfiniteTree.prototype.selectNode = function selectNode() {\n\t var node = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\t var _options = this.options;\n\t var selectable = _options.selectable;\n\t var shouldSelectNode = _options.shouldSelectNode;\n\t\n\t\n\t if (!selectable) {\n\t return false;\n\t }\n\t if (typeof shouldSelectNode === 'function' && !shouldSelectNode(node)) {\n\t return false;\n\t }\n\t\n\t if (node === null) {\n\t // Deselect the current node\n\t if (this.state.selectedNode) {\n\t var selectedNode = this.state.selectedNode;\n\t var selectedIndex = this.nodes.indexOf(selectedNode);\n\t\n\t selectedNode.state.selected = false;\n\t this.rows[selectedIndex] = this.options.rowRenderer(selectedNode, this.options);\n\t this.state.selectedNode = null;\n\t\n\t // Emit the 'selectNode' event\n\t this.emit('selectNode', null);\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t }\n\t\n\t return false;\n\t }\n\t\n\t ensureNodeInstance(node);\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t if (nodeIndex < 0) {\n\t throw new Error('Invalid node index');\n\t }\n\t\n\t // Select this node\n\t if (this.state.selectedNode !== node) {\n\t node.state.selected = true;\n\t\n\t // Update the row corresponding to the node\n\t this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);\n\t }\n\t\n\t // Deselect the current node\n\t if (this.state.selectedNode) {\n\t var _selectedNode = this.state.selectedNode;\n\t var _selectedIndex = this.nodes.indexOf(_selectedNode);\n\t _selectedNode.state.selected = false;\n\t this.rows[_selectedIndex] = this.options.rowRenderer(_selectedNode, this.options);\n\t }\n\t\n\t if (this.state.selectedNode !== node) {\n\t this.state.selectedNode = node;\n\t\n\t // Emit the 'selectNode' event\n\t this.emit('selectNode', node);\n\t } else {\n\t this.state.selectedNode = null;\n\t\n\t // Emit the 'selectNode' event\n\t this.emit('selectNode', null);\n\t }\n\t\n\t // Updates list with new data\n\t this.update();\n\t\n\t return true;\n\t };\n\t // Toggles a node to display or hide its children.\n\t // @param {Node} node The Node object.\n\t\n\t\n\t InfiniteTree.prototype.toggleNode = function toggleNode(node) {\n\t if (this.state.openNodes.indexOf(node) >= 0) {\n\t // close node\n\t this.closeNode(node);\n\t } else {\n\t // open node\n\t this.openNode(node);\n\t }\n\t };\n\t // Serializes the current state of a node to a JSON string.\n\t // @param {Node} node The Node object. If null, returns the whole tree.\n\t // @return {string} Returns a JSON string represented the tree.\n\t\n\t\n\t InfiniteTree.prototype.toString = function toString() {\n\t var node = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\t\n\t var traverse = function traverse(node) {\n\t var s = '[';\n\t if (node && node.children) {\n\t var _loop = function _loop(i) {\n\t var list = [];\n\t s = s + '{';\n\t Object.keys(node).forEach(function (key) {\n\t var value = node[key];\n\t if (key === 'parent') {\n\t // ignore parent\n\t return;\n\t }\n\t if (key === 'children') {\n\t // traverse child nodes\n\t list.push('\"' + key + '\":' + traverse(node.children[i]));\n\t return;\n\t }\n\t if (typeof value === 'string' || (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n\t list.push('\"' + key + '\":' + JSON.stringify(value));\n\t } else {\n\t // primitive types\n\t list.push('\"' + key + '\":' + value);\n\t }\n\t });\n\t s = s + list.join(',');\n\t s = s + '}' + (i === node.children.length - 1 ? '' : ',');\n\t };\n\t\n\t for (var i = 0; i < node.children.length; ++i) {\n\t _loop(i);\n\t }\n\t }\n\t s = s + ']';\n\t return s;\n\t };\n\t\n\t if (!node) {\n\t node = this.state.rootNode;\n\t }\n\t\n\t return traverse(node);\n\t };\n\t // Updates the tree.\n\t\n\t\n\t InfiniteTree.prototype.update = function update() {\n\t // Update the list with new data\n\t this.clusterize.update(this.rows);\n\t\n\t // Emit the 'update' event\n\t this.emit('update');\n\t };\n\t // Updates the data of a node.\n\t // @param {Node} node The Node object.\n\t // @param {Object} data The data object.\n\t\n\t\n\t InfiniteTree.prototype.updateNode = function updateNode(node, data) {\n\t ensureNodeInstance(node);\n\t\n\t // Clone a new one\n\t data = (0, _helper.extend)({}, data);\n\t\n\t // Ignore keys: children, parent, and state\n\t delete data.children;\n\t delete data.parent;\n\t delete data.state;\n\t\n\t node = (0, _helper.extend)(node, data);\n\t\n\t // Retrieve node index\n\t var nodeIndex = this.nodes.indexOf(node);\n\t if (nodeIndex >= 0) {\n\t // Update the row corresponding to the node\n\t this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);\n\t\n\t // Updates list with new data\n\t this.update();\n\t }\n\t };\n\t\n\t return InfiniteTree;\n\t}(_events2['default'].EventEmitter);\n\t\n\texports['default'] = InfiniteTree;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tfunction EventEmitter() {\n\t this._events = this._events || {};\n\t this._maxListeners = this._maxListeners || undefined;\n\t}\n\tmodule.exports = EventEmitter;\n\t\n\t// Backwards-compat with node 0.10.x\n\tEventEmitter.EventEmitter = EventEmitter;\n\t\n\tEventEmitter.prototype._events = undefined;\n\tEventEmitter.prototype._maxListeners = undefined;\n\t\n\t// By default EventEmitters will print a warning if more than 10 listeners are\n\t// added to it. This is a useful default which helps finding memory leaks.\n\tEventEmitter.defaultMaxListeners = 10;\n\t\n\t// Obviously not all Emitters should be limited to 10. This function allows\n\t// that to be increased. Set to zero for unlimited.\n\tEventEmitter.prototype.setMaxListeners = function(n) {\n\t if (!isNumber(n) || n < 0 || isNaN(n))\n\t throw TypeError('n must be a positive number');\n\t this._maxListeners = n;\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.emit = function(type) {\n\t var er, handler, len, args, i, listeners;\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // If there is no 'error' event listener then throw.\n\t if (type === 'error') {\n\t if (!this._events.error ||\n\t (isObject(this._events.error) && !this._events.error.length)) {\n\t er = arguments[1];\n\t if (er instanceof Error) {\n\t throw er; // Unhandled 'error' event\n\t }\n\t throw TypeError('Uncaught, unspecified \"error\" event.');\n\t }\n\t }\n\t\n\t handler = this._events[type];\n\t\n\t if (isUndefined(handler))\n\t return false;\n\t\n\t if (isFunction(handler)) {\n\t switch (arguments.length) {\n\t // fast cases\n\t case 1:\n\t handler.call(this);\n\t break;\n\t case 2:\n\t handler.call(this, arguments[1]);\n\t break;\n\t case 3:\n\t handler.call(this, arguments[1], arguments[2]);\n\t break;\n\t // slower\n\t default:\n\t args = Array.prototype.slice.call(arguments, 1);\n\t handler.apply(this, args);\n\t }\n\t } else if (isObject(handler)) {\n\t args = Array.prototype.slice.call(arguments, 1);\n\t listeners = handler.slice();\n\t len = listeners.length;\n\t for (i = 0; i < len; i++)\n\t listeners[i].apply(this, args);\n\t }\n\t\n\t return true;\n\t};\n\t\n\tEventEmitter.prototype.addListener = function(type, listener) {\n\t var m;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // To avoid recursion in the case that type === \"newListener\"! Before\n\t // adding it to the listeners, first emit \"newListener\".\n\t if (this._events.newListener)\n\t this.emit('newListener', type,\n\t isFunction(listener.listener) ?\n\t listener.listener : listener);\n\t\n\t if (!this._events[type])\n\t // Optimize the case of one listener. Don't need the extra array object.\n\t this._events[type] = listener;\n\t else if (isObject(this._events[type]))\n\t // If we've already got an array, just append.\n\t this._events[type].push(listener);\n\t else\n\t // Adding the second element, need to change to array.\n\t this._events[type] = [this._events[type], listener];\n\t\n\t // Check for listener leak\n\t if (isObject(this._events[type]) && !this._events[type].warned) {\n\t if (!isUndefined(this._maxListeners)) {\n\t m = this._maxListeners;\n\t } else {\n\t m = EventEmitter.defaultMaxListeners;\n\t }\n\t\n\t if (m && m > 0 && this._events[type].length > m) {\n\t this._events[type].warned = true;\n\t console.error('(node) warning: possible EventEmitter memory ' +\n\t 'leak detected. %d listeners added. ' +\n\t 'Use emitter.setMaxListeners() to increase limit.',\n\t this._events[type].length);\n\t if (typeof console.trace === 'function') {\n\t // not supported in IE 10\n\t console.trace();\n\t }\n\t }\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\t\n\tEventEmitter.prototype.once = function(type, listener) {\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t var fired = false;\n\t\n\t function g() {\n\t this.removeListener(type, g);\n\t\n\t if (!fired) {\n\t fired = true;\n\t listener.apply(this, arguments);\n\t }\n\t }\n\t\n\t g.listener = listener;\n\t this.on(type, g);\n\t\n\t return this;\n\t};\n\t\n\t// emits a 'removeListener' event iff the listener was removed\n\tEventEmitter.prototype.removeListener = function(type, listener) {\n\t var list, position, length, i;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events || !this._events[type])\n\t return this;\n\t\n\t list = this._events[type];\n\t length = list.length;\n\t position = -1;\n\t\n\t if (list === listener ||\n\t (isFunction(list.listener) && list.listener === listener)) {\n\t delete this._events[type];\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t\n\t } else if (isObject(list)) {\n\t for (i = length; i-- > 0;) {\n\t if (list[i] === listener ||\n\t (list[i].listener && list[i].listener === listener)) {\n\t position = i;\n\t break;\n\t }\n\t }\n\t\n\t if (position < 0)\n\t return this;\n\t\n\t if (list.length === 1) {\n\t list.length = 0;\n\t delete this._events[type];\n\t } else {\n\t list.splice(position, 1);\n\t }\n\t\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.removeAllListeners = function(type) {\n\t var key, listeners;\n\t\n\t if (!this._events)\n\t return this;\n\t\n\t // not listening for removeListener, no need to emit\n\t if (!this._events.removeListener) {\n\t if (arguments.length === 0)\n\t this._events = {};\n\t else if (this._events[type])\n\t delete this._events[type];\n\t return this;\n\t }\n\t\n\t // emit removeListener for all listeners on all events\n\t if (arguments.length === 0) {\n\t for (key in this._events) {\n\t if (key === 'removeListener') continue;\n\t this.removeAllListeners(key);\n\t }\n\t this.removeAllListeners('removeListener');\n\t this._events = {};\n\t return this;\n\t }\n\t\n\t listeners = this._events[type];\n\t\n\t if (isFunction(listeners)) {\n\t this.removeListener(type, listeners);\n\t } else if (listeners) {\n\t // LIFO order\n\t while (listeners.length)\n\t this.removeListener(type, listeners[listeners.length - 1]);\n\t }\n\t delete this._events[type];\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.listeners = function(type) {\n\t var ret;\n\t if (!this._events || !this._events[type])\n\t ret = [];\n\t else if (isFunction(this._events[type]))\n\t ret = [this._events[type]];\n\t else\n\t ret = this._events[type].slice();\n\t return ret;\n\t};\n\t\n\tEventEmitter.prototype.listenerCount = function(type) {\n\t if (this._events) {\n\t var evlistener = this._events[type];\n\t\n\t if (isFunction(evlistener))\n\t return 1;\n\t else if (evlistener)\n\t return evlistener.length;\n\t }\n\t return 0;\n\t};\n\t\n\tEventEmitter.listenerCount = function(emitter, type) {\n\t return emitter.listenerCount(type);\n\t};\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*! Clusterize.js - v0.16.0 - 2016-03-12\r\n\t* http://NeXTs.github.com/Clusterize.js/\r\n\t* Copyright (c) 2015 Denis Lukov; Licensed GPLv3 */\r\n\t\r\n\t;(function(name, definition) {\r\n\t if (true) module.exports = definition();\r\n\t else if (typeof define == 'function' && typeof define.amd == 'object') define(definition);\r\n\t else this[name] = definition();\r\n\t}('Clusterize', function() {\r\n\t \"use strict\"\r\n\t\r\n\t // detect ie9 and lower\r\n\t // https://gist.github.com/padolsey/527683#comment-786682\r\n\t var ie = (function(){\r\n\t for( var v = 3,\r\n\t el = document.createElement('b'),\r\n\t all = el.all || [];\r\n\t el.innerHTML = '',\r\n\t all[0];\r\n\t ){}\r\n\t return v > 4 ? v : document.documentMode;\r\n\t }()),\r\n\t is_mac = navigator.platform.toLowerCase().indexOf('mac') + 1;\r\n\t var Clusterize = function(data) {\r\n\t if( ! (this instanceof Clusterize))\r\n\t return new Clusterize(data);\r\n\t var self = this;\r\n\t\r\n\t var defaults = {\r\n\t item_height: 0,\r\n\t block_height: 0,\r\n\t rows_in_block: 50,\r\n\t rows_in_cluster: 0,\r\n\t cluster_height: 0,\r\n\t blocks_in_cluster: 4,\r\n\t tag: null,\r\n\t content_tag: null,\r\n\t show_no_data_row: true,\r\n\t no_data_class: 'clusterize-no-data',\r\n\t no_data_text: 'No data',\r\n\t keep_parity: true,\r\n\t callbacks: {},\r\n\t scroll_top: 0\r\n\t }\r\n\t\r\n\t // public parameters\r\n\t self.options = {};\r\n\t var options = ['rows_in_block', 'blocks_in_cluster', 'show_no_data_row', 'no_data_class', 'no_data_text', 'keep_parity', 'tag', 'callbacks'];\r\n\t for(var i = 0, option; option = options[i]; i++) {\r\n\t self.options[option] = typeof data[option] != 'undefined' && data[option] != null\r\n\t ? data[option]\r\n\t : defaults[option];\r\n\t }\r\n\t\r\n\t var elems = ['scroll', 'content'];\r\n\t for(var i = 0, elem; elem = elems[i]; i++) {\r\n\t self[elem + '_elem'] = data[elem + 'Id']\r\n\t ? document.getElementById(data[elem + 'Id'])\r\n\t : data[elem + 'Elem'];\r\n\t if( ! self[elem + '_elem'])\r\n\t throw new Error(\"Error! Could not find \" + elem + \" element\");\r\n\t }\r\n\t\r\n\t // tabindex forces the browser to keep focus on the scrolling list, fixes #11\r\n\t if( ! self.content_elem.hasAttribute('tabindex'))\r\n\t self.content_elem.setAttribute('tabindex', 0);\r\n\t\r\n\t // private parameters\r\n\t var rows = isArray(data.rows)\r\n\t ? data.rows\r\n\t : self.fetchMarkup(),\r\n\t cache = {data: '', bottom: 0},\r\n\t scroll_top = self.scroll_elem.scrollTop;\r\n\t\r\n\t // get row height\r\n\t self.exploreEnvironment(rows);\r\n\t\r\n\t // append initial data\r\n\t self.insertToDOM(rows, cache);\r\n\t\r\n\t // restore the scroll position\r\n\t self.scroll_elem.scrollTop = scroll_top;\r\n\t\r\n\t // adding scroll handler\r\n\t var last_cluster = false,\r\n\t scroll_debounce = 0,\r\n\t pointer_events_set = false,\r\n\t scrollEv = function() {\r\n\t // fixes scrolling issue on Mac #3\r\n\t if (is_mac) {\r\n\t if( ! pointer_events_set) self.content_elem.style.pointerEvents = 'none';\r\n\t pointer_events_set = true;\r\n\t clearTimeout(scroll_debounce);\r\n\t scroll_debounce = setTimeout(function () {\r\n\t self.content_elem.style.pointerEvents = 'auto';\r\n\t pointer_events_set = false;\r\n\t }, 50);\r\n\t }\r\n\t if (last_cluster != (last_cluster = self.getClusterNum()))\r\n\t self.insertToDOM(rows, cache);\r\n\t if (self.options.callbacks.scrollingProgress)\r\n\t self.options.callbacks.scrollingProgress(self.getScrollProgress());\r\n\t },\r\n\t resize_debounce = 0,\r\n\t resizeEv = function() {\r\n\t clearTimeout(resize_debounce);\r\n\t resize_debounce = setTimeout(self.refresh, 100);\r\n\t }\r\n\t on('scroll', self.scroll_elem, scrollEv);\r\n\t on('resize', window, resizeEv);\r\n\t\r\n\t // public methods\r\n\t self.destroy = function(clean) {\r\n\t off('scroll', self.scroll_elem, scrollEv);\r\n\t off('resize', window, resizeEv);\r\n\t self.html((clean ? self.generateEmptyRow() : rows).join(''));\r\n\t }\r\n\t self.refresh = function() {\r\n\t self.getRowsHeight(rows) && self.update(rows);\r\n\t }\r\n\t self.update = function(new_rows) {\r\n\t rows = isArray(new_rows)\r\n\t ? new_rows\r\n\t : [];\r\n\t var scroll_top = self.scroll_elem.scrollTop;\r\n\t // fixes #39\r\n\t if(rows.length * self.options.item_height < scroll_top) {\r\n\t self.scroll_elem.scrollTop = 0;\r\n\t last_cluster = 0;\r\n\t }\r\n\t self.insertToDOM(rows, cache);\r\n\t self.scroll_elem.scrollTop = scroll_top;\r\n\t }\r\n\t self.clear = function() {\r\n\t self.update([]);\r\n\t }\r\n\t self.getRowsAmount = function() {\r\n\t return rows.length;\r\n\t }\r\n\t self.getScrollProgress = function() {\r\n\t return this.options.scroll_top / (rows.length * this.options.item_height) * 100 || 0;\r\n\t }\r\n\t\r\n\t var add = function(where, _new_rows) {\r\n\t var new_rows = isArray(_new_rows)\r\n\t ? _new_rows\r\n\t : [];\r\n\t if( ! new_rows.length) return;\r\n\t rows = where == 'append'\r\n\t ? rows.concat(new_rows)\r\n\t : new_rows.concat(rows);\r\n\t self.insertToDOM(rows, cache);\r\n\t }\r\n\t self.append = function(rows) {\r\n\t add('append', rows);\r\n\t }\r\n\t self.prepend = function(rows) {\r\n\t add('prepend', rows);\r\n\t }\r\n\t }\r\n\t\r\n\t Clusterize.prototype = {\r\n\t constructor: Clusterize,\r\n\t // fetch existing markup\r\n\t fetchMarkup: function() {\r\n\t var rows = [], rows_nodes = this.getChildNodes(this.content_elem);\r\n\t while (rows_nodes.length) {\r\n\t rows.push(rows_nodes.shift().outerHTML);\r\n\t }\r\n\t return rows;\r\n\t },\r\n\t // get tag name, content tag name, tag height, calc cluster height\r\n\t exploreEnvironment: function(rows) {\r\n\t var opts = this.options;\r\n\t opts.content_tag = this.content_elem.tagName.toLowerCase();\r\n\t if( ! rows.length) return;\r\n\t if(ie && ie <= 9 && ! opts.tag) opts.tag = rows[0].match(/<([^>\\s/]*)/)[1].toLowerCase();\r\n\t if(this.content_elem.children.length <= 1) this.html(rows[0] + rows[0] + rows[0]);\r\n\t if( ! opts.tag) opts.tag = this.content_elem.children[0].tagName.toLowerCase();\r\n\t this.getRowsHeight(rows);\r\n\t },\r\n\t getRowsHeight: function(rows) {\r\n\t var opts = this.options,\r\n\t prev_item_height = opts.item_height;\r\n\t opts.cluster_height = 0\r\n\t if( ! rows.length) return;\r\n\t var nodes = this.content_elem.children;\r\n\t opts.item_height = nodes[Math.floor(nodes.length / 2)].offsetHeight;\r\n\t // consider table's border-spacing\r\n\t if(opts.tag == 'tr' && getStyle('borderCollapse', this.content_elem) != 'collapse')\r\n\t opts.item_height += parseInt(getStyle('borderSpacing', this.content_elem)) || 0;\r\n\t opts.block_height = opts.item_height * opts.rows_in_block;\r\n\t opts.rows_in_cluster = opts.blocks_in_cluster * opts.rows_in_block;\r\n\t opts.cluster_height = opts.blocks_in_cluster * opts.block_height;\r\n\t return prev_item_height != opts.item_height;\r\n\t },\r\n\t // get current cluster number\r\n\t getClusterNum: function () {\r\n\t this.options.scroll_top = this.scroll_elem.scrollTop;\r\n\t return Math.floor(this.options.scroll_top / (this.options.cluster_height - this.options.block_height)) || 0;\r\n\t },\r\n\t // generate empty row if no data provided\r\n\t generateEmptyRow: function() {\r\n\t var opts = this.options;\r\n\t if( ! opts.tag || ! opts.show_no_data_row) return [];\r\n\t var empty_row = document.createElement(opts.tag),\r\n\t no_data_content = document.createTextNode(opts.no_data_text), td;\r\n\t empty_row.className = opts.no_data_class;\r\n\t if(opts.tag == 'tr') {\r\n\t td = document.createElement('td');\r\n\t td.appendChild(no_data_content);\r\n\t }\r\n\t empty_row.appendChild(td || no_data_content);\r\n\t return [empty_row.outerHTML];\r\n\t },\r\n\t // generate cluster for current scroll position\r\n\t generate: function (rows, cluster_num) {\r\n\t var opts = this.options,\r\n\t rows_len = rows.length;\r\n\t if (rows_len < opts.rows_in_block) {\r\n\t return {\r\n\t top_offset: 0,\r\n\t bottom_offset: 0,\r\n\t rows_above: 0,\r\n\t rows: rows_len ? rows : this.generateEmptyRow()\r\n\t }\r\n\t }\r\n\t if( ! opts.cluster_height) {\r\n\t this.exploreEnvironment(rows);\r\n\t }\r\n\t var items_start = Math.max((opts.rows_in_cluster - opts.rows_in_block) * cluster_num, 0),\r\n\t items_end = items_start + opts.rows_in_cluster,\r\n\t top_offset = Math.max(items_start * opts.item_height, 0),\r\n\t bottom_offset = Math.max((rows_len - items_end) * opts.item_height, 0),\r\n\t this_cluster_rows = [],\r\n\t rows_above = items_start;\r\n\t if(top_offset < 1) {\r\n\t rows_above++;\r\n\t }\r\n\t for (var i = items_start; i < items_end; i++) {\r\n\t rows[i] && this_cluster_rows.push(rows[i]);\r\n\t }\r\n\t return {\r\n\t top_offset: top_offset,\r\n\t bottom_offset: bottom_offset,\r\n\t rows_above: rows_above,\r\n\t rows: this_cluster_rows\r\n\t }\r\n\t },\r\n\t renderExtraTag: function(class_name, height) {\r\n\t var tag = document.createElement(this.options.tag),\r\n\t clusterize_prefix = 'clusterize-';\r\n\t tag.className = [clusterize_prefix + 'extra-row', clusterize_prefix + class_name].join(' ');\r\n\t height && (tag.style.height = height + 'px');\r\n\t return tag.outerHTML;\r\n\t },\r\n\t // if necessary verify data changed and insert to DOM\r\n\t insertToDOM: function(rows, cache) {\r\n\t var data = this.generate(rows, this.getClusterNum()),\r\n\t this_cluster_rows = data.rows.join(''),\r\n\t this_cluster_content_changed = this.checkChanges('data', this_cluster_rows, cache),\r\n\t only_bottom_offset_changed = this.checkChanges('bottom', data.bottom_offset, cache),\r\n\t callbacks = this.options.callbacks,\r\n\t layout = [];\r\n\t\r\n\t if(this_cluster_content_changed) {\r\n\t if(data.top_offset) {\r\n\t this.options.keep_parity && layout.push(this.renderExtraTag('keep-parity'));\r\n\t layout.push(this.renderExtraTag('top-space', data.top_offset));\r\n\t }\r\n\t layout.push(this_cluster_rows);\r\n\t data.bottom_offset && layout.push(this.renderExtraTag('bottom-space', data.bottom_offset));\r\n\t callbacks.clusterWillChange && callbacks.clusterWillChange();\r\n\t this.html(layout.join(''));\r\n\t this.options.content_tag == 'ol' && this.content_elem.setAttribute('start', data.rows_above);\r\n\t callbacks.clusterChanged && callbacks.clusterChanged();\r\n\t } else if(only_bottom_offset_changed) {\r\n\t this.content_elem.lastChild.style.height = data.bottom_offset + 'px';\r\n\t }\r\n\t },\r\n\t // unfortunately ie <= 9 does not allow to use innerHTML for table elements, so make a workaround\r\n\t html: function(data) {\r\n\t var content_elem = this.content_elem;\r\n\t if(ie && ie <= 9 && this.options.tag == 'tr') {\r\n\t var div = document.createElement('div'), last;\r\n\t div.innerHTML = '
' + data + '
';\r\n\t while((last = content_elem.lastChild)) {\r\n\t content_elem.removeChild(last);\r\n\t }\r\n\t var rows_nodes = this.getChildNodes(div.firstChild.firstChild);\r\n\t while (rows_nodes.length) {\r\n\t content_elem.appendChild(rows_nodes.shift());\r\n\t }\r\n\t } else {\r\n\t content_elem.innerHTML = data;\r\n\t }\r\n\t },\r\n\t getChildNodes: function(tag) {\r\n\t var child_nodes = tag.children, nodes = [];\r\n\t for (var i = 0, ii = child_nodes.length; i < ii; i++) {\r\n\t nodes.push(child_nodes[i]);\r\n\t }\r\n\t return nodes;\r\n\t },\r\n\t checkChanges: function(type, value, cache) {\r\n\t var changed = value != cache[type];\r\n\t cache[type] = value;\r\n\t return changed;\r\n\t }\r\n\t }\r\n\t\r\n\t // support functions\r\n\t function on(evt, element, fnc) {\r\n\t return element.addEventListener ? element.addEventListener(evt, fnc, false) : element.attachEvent(\"on\" + evt, fnc);\r\n\t }\r\n\t function off(evt, element, fnc) {\r\n\t return element.removeEventListener ? element.removeEventListener(evt, fnc, false) : element.detachEvent(\"on\" + evt, fnc);\r\n\t }\r\n\t function isArray(arr) {\r\n\t return Object.prototype.toString.call(arr) === '[object Array]';\r\n\t }\r\n\t function getStyle(prop, elem) {\r\n\t return window.getComputedStyle ? window.getComputedStyle(elem)[prop] : elem.currentStyle[prop];\r\n\t }\r\n\t\r\n\t return Clusterize;\r\n\t}));\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\texports.Node = exports.flatten = undefined;\n\t\n\tvar _flatten = __webpack_require__(6);\n\t\n\tvar _flatten2 = _interopRequireDefault(_flatten);\n\t\n\tvar _node = __webpack_require__(8);\n\t\n\tvar _node2 = _interopRequireDefault(_node);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t// IE8 compatibility output\n\texports.flatten = _flatten2['default'];\n\texports.Node = _node2['default'];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _extend = __webpack_require__(7);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _node = __webpack_require__(8);\n\t\n\tvar _node2 = _interopRequireDefault(_node);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t// @param {object|array} nodes The tree nodes\n\t// @param {object} [options] The options object\n\t// @param {boolean} [options.openAllNodes] True to open all nodes. Defaults to false.\n\t// @param {array} [options.openNodes] An array that contains the ids of open nodes\n\t// @return {array}\n\tvar flatten = function flatten() {\n\t var nodes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t nodes = [].concat(nodes);\n\t\n\t var flatten = [];\n\t var stack = [];\n\t var pool = {\n\t lastChild: {}\n\t };\n\t\n\t options.openAllNodes = !!options.openAllNodes;\n\t options.openNodes = options.openNodes || [];\n\t options.throwOnError = !!options.throwOnError;\n\t\n\t {\n\t // root node\n\t var firstNode = nodes.length > 0 ? nodes[0] : null;\n\t var parentNode = firstNode ? firstNode.parent : null;\n\t if (parentNode && !(parentNode instanceof _node2['default'])) {\n\t parentNode = new _node2['default'](parentNode);\n\t }\n\t var rootNode = parentNode || new _node2['default']({ // defaults\n\t label: '',\n\t parent: null,\n\t children: nodes,\n\t state: {\n\t depth: -1,\n\t open: true, // always open\n\t path: '',\n\t prefixMask: '',\n\t total: 0\n\t }\n\t });\n\t\n\t if (rootNode === parentNode) {\n\t var subtotal = rootNode.state.total || 0;\n\t\n\t // Traversing up through its ancestors\n\t var p = rootNode;\n\t while (p) {\n\t var _p$state = p.state;\n\t var path = _p$state.path;\n\t var _p$state$total = _p$state.total;\n\t var total = _p$state$total === undefined ? 0 : _p$state$total;\n\t\n\t // Rebuild the lastChild pool\n\t\n\t if (p.isLastChild() && path) {\n\t pool.lastChild[path] = true;\n\t }\n\t\n\t // Subtract the number 'subtotal' from the total of the root node and all its ancestors\n\t p.state.total = total - subtotal;\n\t if (p.state.total < 0) {\n\t if (options.throwOnError) {\n\t throw new Error('The node might have been corrupted: id=' + JSON.stringify(p.id) + ', state=' + JSON.stringify(p.state));\n\t } else {\n\t console && console.log('Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s', JSON.stringify(p.id), JSON.stringify(p.label), p.parent, p.children, JSON.stringify(p.state));\n\t }\n\t }\n\t\n\t p = p.parent;\n\t }\n\t }\n\t\n\t stack.push([rootNode, rootNode.state.depth, 0]);\n\t }\n\t\n\t while (stack.length > 0) {\n\t var _stack$pop = stack.pop();\n\t\n\t var current = _stack$pop[0];\n\t var depth = _stack$pop[1];\n\t var index = _stack$pop[2];\n\t\n\t var _loop = function _loop() {\n\t var node = current.children[index];\n\t if (!(node instanceof _node2['default'])) {\n\t node = new _node2['default'](node);\n\t }\n\t node.parent = current;\n\t node.children = node.children || [];\n\t\n\t // Ensure parent.children[index] is equal to the current node\n\t node.parent.children[index] = node;\n\t\n\t var path = current.state.path + '.' + index;\n\t var open = node.hasChildren() && function () {\n\t var openAllNodes = options.openAllNodes;\n\t var openNodes = options.openNodes;\n\t\n\t if (openAllNodes) {\n\t return true;\n\t }\n\t // determine by node object\n\t if (openNodes.indexOf(node) >= 0) {\n\t return true;\n\t }\n\t // determine by node id\n\t if (openNodes.indexOf(node.id) >= 0) {\n\t return true;\n\t }\n\t return false;\n\t }();\n\t var prefixMask = function (prefix) {\n\t var mask = '';\n\t while (prefix.length > 0) {\n\t prefix = prefix.replace(/\\.\\d+$/, '');\n\t if (!prefix || pool.lastChild[prefix]) {\n\t mask = '0' + mask;\n\t } else {\n\t mask = '1' + mask;\n\t }\n\t }\n\t return mask;\n\t }(path);\n\t\n\t if (node.isLastChild()) {\n\t pool.lastChild[path] = true;\n\t }\n\t\n\t // This allows you to put extra information to node.state\n\t node.state = (0, _extend2['default'])({}, node.state, {\n\t depth: depth + 1,\n\t open: open,\n\t path: path,\n\t prefixMask: prefixMask,\n\t total: 0\n\t });\n\t\n\t var parentDidOpen = true;\n\t\n\t {\n\t // Check the open state from its ancestors\n\t var _p = node;\n\t while (_p.parent !== null) {\n\t if (_p.parent.state.open === false) {\n\t parentDidOpen = false;\n\t break;\n\t }\n\t _p = _p.parent;\n\t }\n\t }\n\t\n\t if (parentDidOpen) {\n\t // Push the node to flatten list only if all of its parent nodes have the open state set to true\n\t flatten.push(node);\n\t\n\t // Update the total number of visible child nodes\n\t var _p2 = node;\n\t while (_p2.parent !== null) {\n\t _p2.parent.state.total++;\n\t _p2 = _p2.parent;\n\t }\n\t }\n\t\n\t ++index;\n\t\n\t if (node.hasChildren()) {\n\t // Push back parent node to the stack that will be able to continue\n\t // the next iteration once all the child nodes of the current node\n\t // have been completely explored.\n\t stack.push([current, depth, index]);\n\t\n\t index = 0;\n\t depth = depth + 1;\n\t current = node;\n\t }\n\t };\n\t\n\t while (index < current.children.length) {\n\t _loop();\n\t }\n\t }\n\t\n\t return flatten;\n\t};\n\t\n\texports['default'] = flatten;\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\tvar extend = function extend(target) {\n\t for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t sources[_key - 1] = arguments[_key];\n\t }\n\t\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert undefined or null to object');\n\t }\n\t\n\t var output = Object(target);\n\t for (var index = 0; index < sources.length; index++) {\n\t var source = sources[index];\n\t if (source !== undefined && source !== null) {\n\t for (var key in source) {\n\t if (source.hasOwnProperty(key)) {\n\t output[key] = source[key];\n\t }\n\t }\n\t }\n\t }\n\t return output;\n\t};\n\t\n\texports['default'] = extend;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _extend = __webpack_require__(7);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Node = function () {\n\t function Node(node) {\n\t _classCallCheck(this, Node);\n\t\n\t this.id = null;\n\t this.label = '';\n\t this.parent = null;\n\t this.children = [];\n\t this.state = {};\n\t\n\t (0, _extend2['default'])(this, node);\n\t\n\t this.children = this.children || [];\n\t }\n\t // Gets a child node at the specified index.\n\t // @param {number} The index of the child node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getChildAt = function getChildAt(index) {\n\t var node = null;\n\t if (this.children.length > 0 && index >= 0 && index < this.children.length) {\n\t node = this.children[index];\n\t }\n\t return node;\n\t };\n\t // Gets the child nodes.\n\t // @return {array} Returns an array of objects that define the nodes.\n\t\n\t\n\t Node.prototype.getChildren = function getChildren() {\n\t return this.children;\n\t };\n\t // Gets the first child node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getFirstChild = function getFirstChild() {\n\t var node = null;\n\t if (this.children.length > 0) {\n\t node = this.children[0];\n\t }\n\t return node;\n\t };\n\t // Gets the last child node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getLastChild = function getLastChild() {\n\t var node = null;\n\t if (this.children.length > 0) {\n\t node = this.children[this.children.length - 1];\n\t }\n\t return node;\n\t };\n\t // Gets the next sibling node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getNextSibling = function getNextSibling() {\n\t var node = null;\n\t if (this.parent) {\n\t var index = this.parent.children.indexOf(this);\n\t if (index >= 0 && index < this.parent.children.length - 1) {\n\t node = this.parent.children[index + 1];\n\t }\n\t }\n\t return node;\n\t };\n\t // Gets the parent node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getParent = function getParent() {\n\t return this.parent;\n\t };\n\t // Gets the previous sibling node.\n\t // @return {object} Returns an object that defines the node, null otherwise.\n\t\n\t\n\t Node.prototype.getPreviousSibling = function getPreviousSibling() {\n\t var node = null;\n\t if (this.parent) {\n\t var index = this.parent.children.indexOf(this);\n\t if (index > 0 && index < this.parent.children.length) {\n\t node = this.parent.children[index - 1];\n\t }\n\t }\n\t return node;\n\t };\n\t // Checks whether this node has children.\n\t // @return {boolean} Returns true if the node has children, false otherwise.\n\t\n\t\n\t Node.prototype.hasChildren = function hasChildren() {\n\t return this.children.length > 0;\n\t };\n\t // Checks whether this node is the last child of its parent.\n\t // @return {boolean} Returns true if the node is the last child of its parent, false otherwise.\n\t\n\t\n\t Node.prototype.isLastChild = function isLastChild() {\n\t var hasNextSibling = this.getNextSibling();\n\t return !hasNextSibling;\n\t };\n\t\n\t return Node;\n\t}();\n\t\n\texports['default'] = Node;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar LookupTable = function () {\n\t function LookupTable() {\n\t _classCallCheck(this, LookupTable);\n\t\n\t this.data = {};\n\t }\n\t\n\t LookupTable.prototype.clear = function clear() {\n\t this.data = {};\n\t };\n\t\n\t LookupTable.prototype.get = function get(key) {\n\t return this.data[key];\n\t };\n\t\n\t LookupTable.prototype.has = function has(key) {\n\t return this.data[key] !== undefined;\n\t };\n\t\n\t LookupTable.prototype.set = function set(key, value) {\n\t this.data[key] = value;\n\t return value;\n\t };\n\t\n\t LookupTable.prototype.unset = function unset(key) {\n\t if (this.data[key] !== undefined) {\n\t delete this.data[key];\n\t }\n\t };\n\t\n\t return LookupTable;\n\t}();\n\t\n\texports[\"default\"] = LookupTable;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\texports.defaultRowRenderer = undefined;\n\t\n\tvar _helper = __webpack_require__(11);\n\t\n\tvar defaultRowRenderer = function defaultRowRenderer(node, treeOptions) {\n\t var id = node.id;\n\t var label = node.label;\n\t var _node$loadOnDemand = node.loadOnDemand;\n\t var loadOnDemand = _node$loadOnDemand === undefined ? false : _node$loadOnDemand;\n\t var children = node.children;\n\t var state = node.state;\n\t var depth = state.depth;\n\t var open = state.open;\n\t var path = state.path;\n\t var total = state.total;\n\t var _state$selected = state.selected;\n\t var selected = _state$selected === undefined ? false : _state$selected;\n\t\n\t var childrenLength = Object.keys(children).length;\n\t var more = node.hasChildren();\n\t\n\t var togglerContent = '';\n\t if (more && open) {\n\t togglerContent = '▼';\n\t }\n\t if (more && !open) {\n\t togglerContent = '►';\n\t }\n\t if (!more && loadOnDemand) {\n\t togglerContent = '►';\n\t }\n\t var toggler = (0, _helper.buildHTML)('a', togglerContent, {\n\t 'class': function () {\n\t if (more && open) {\n\t return (0, _helper.classNames)('tree-toggler');\n\t }\n\t if (more && !open) {\n\t return (0, _helper.classNames)('tree-toggler', 'tree-closed');\n\t }\n\t if (!more && loadOnDemand) {\n\t return (0, _helper.classNames)('tree-toggler', 'tree-closed');\n\t }\n\t return '';\n\t }()\n\t });\n\t var title = (0, _helper.buildHTML)('span', (0, _helper.quoteattr)(label), {\n\t 'class': (0, _helper.classNames)('tree-title')\n\t });\n\t var treeNode = (0, _helper.buildHTML)('div', toggler + title, {\n\t 'class': 'tree-node',\n\t 'style': 'margin-left: ' + depth * 18 + 'px'\n\t });\n\t\n\t return (0, _helper.buildHTML)('div', treeNode, {\n\t 'aria-id': id,\n\t 'aria-expanded': more && open,\n\t 'aria-depth': depth,\n\t 'aria-path': path,\n\t 'aria-selected': selected,\n\t 'aria-children': childrenLength,\n\t 'aria-total': total,\n\t 'class': (0, _helper.classNames)('tree-item', { 'tree-selected': selected }),\n\t 'droppable': true\n\t });\n\t};\n\t\n\texports.defaultRowRenderer = defaultRowRenderer;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar extend = function extend(target) {\n\t for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t sources[_key - 1] = arguments[_key];\n\t }\n\t\n\t target = target || {};\n\t for (var index = 0; index < sources.length; index++) {\n\t var obj = sources[index];\n\t if (!obj) {\n\t continue;\n\t }\n\t for (var key in obj) {\n\t if (obj.hasOwnProperty(key)) {\n\t target[key] = obj[key];\n\t }\n\t }\n\t }\n\t return target;\n\t};\n\t\n\tvar preventDefault = function preventDefault(e) {\n\t if (typeof e.preventDefault !== 'undefined') {\n\t e.preventDefault();\n\t } else {\n\t e.returnValue = false;\n\t }\n\t};\n\t\n\tvar stopPropagation = function stopPropagation(e) {\n\t if (typeof e.stopPropagation !== 'undefined') {\n\t e.stopPropagation();\n\t } else {\n\t e.cancelBubble = true;\n\t }\n\t};\n\t\n\t// http://blog.garstasio.com/you-dont-need-jquery/events/#sending-custom-events\n\tvar dispatchEvent = function dispatchEvent(el, eventType) {\n\t var evt = document.createEvent('Event');\n\t evt.initEvent(eventType, true, true); // can bubble, and is cancellable\n\t el.dispatchEvent(evt);\n\t};\n\t\n\t// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Compatibility\n\tvar addEventListener = function addEventListener(target, type, listener) {\n\t if (target.addEventListener) {\n\t // Standard\n\t target.addEventListener(type, listener, false);\n\t } else if (target.attachEvent) {\n\t // IE8\n\t // In Internet Explorer versions before IE 9, you have to use attachEvent rather than the standard addEventListener.\n\t target.attachEvent('on' + type, listener);\n\t }\n\t};\n\t\n\t// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\n\tvar removeEventListener = function removeEventListener(target, type, listener) {\n\t if (target.removeEventListener) {\n\t // Standard\n\t target.removeEventListener(type, listener, false);\n\t } else if (target.detachEvent) {\n\t // IE8\n\t // In Internet Explorer versions before IE 9, you have to use detachEvent rather than the standard removeEventListener.\n\t target.detachEvent('on' + type, listener);\n\t }\n\t};\n\t\n\tvar hasClass = function hasClass(el, className) {\n\t if (!el) {\n\t return false;\n\t }\n\t var classes = el.className.split(' ');\n\t return classes.indexOf(className) >= 0;\n\t};\n\t\n\tvar addClass = function addClass(el, className) {\n\t if (!el) {\n\t return '';\n\t }\n\t if (!hasClass(el, className)) {\n\t var classes = el.className.split(' ');\n\t el.className = classes.concat(className).join(' ');\n\t }\n\t return el.className;\n\t};\n\t\n\tvar removeClass = function removeClass(el, className) {\n\t if (!el) {\n\t return '';\n\t }\n\t if (hasClass(el, className)) {\n\t var classes = el.className.split(' ');\n\t el.className = classes.filter(function (c) {\n\t return c !== className;\n\t }).join(' ');\n\t }\n\t return el.className;\n\t};\n\t\n\tvar toggleClass = function toggleClass(el, className) {\n\t if (!el) {\n\t return;\n\t }\n\t if (hasClass(el, className)) {\n\t removeClass(el, className);\n\t } else {\n\t addClass(el, className);\n\t }\n\t};\n\t\n\tvar classNames = function classNames() {\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var classNames = [];\n\t args.forEach(function (arg) {\n\t if (Array.isArray(arg)) {\n\t classNames = classNames.concat(arg);\n\t } else if ((typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object') {\n\t Object.keys(arg).forEach(function (className) {\n\t var ok = arg[className];\n\t if (!!ok) {\n\t classNames.push(className);\n\t }\n\t });\n\t } else {\n\t classNames.push(arg);\n\t }\n\t });\n\t return classNames.join(' ');\n\t};\n\t\n\t// http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object\n\t\n\t//Returns true if it is a DOM element\n\tvar isDOMElement = function isDOMElement(o) {\n\t if ((typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === 'object') {\n\t return o instanceof HTMLElement;\n\t }\n\t return o && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && o.nodeType === 1 && typeof o.nodeName === 'string';\n\t};\n\t\n\t// Returns true if it is a DOM node\n\tvar isDOMNode = function isDOMNode(o) {\n\t if ((typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object') {\n\t return o instanceof Node;\n\t }\n\t return o && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string';\n\t};\n\t\n\tvar quoteattr = function quoteattr(s, preserveCR) {\n\t preserveCR = preserveCR ? '
' : '\\n';\n\t return ('' + s). /* Forces the conversion to string. */\n\t replace(/&/g, '&') /* This MUST be the 1st replacement. */\n\t .replace(/'/g, ''') /* The 4 other predefined entities, required. */\n\t .replace(/\"/g, '"').replace(//g, '>')\n\t /*\n\t * You may add other replacements here for HTML only\n\t * (but it's not necessary).\n\t * Or for XML, only if the named entities are defined in its DTD.\n\t */\n\t .replace(/\\r\\n/g, preserveCR) /* Must be before the next replacement. */\n\t .replace(/[\\r\\n]/g, preserveCR);\n\t};\n\t\n\t/**\n\t * Example #1:\n\t * =========================================================================\n\t * My Mail\n\t *\n\t * buildHTML('a', 'My Mail', {\n\t * id: 'mymail',\n\t * href: 'http://mymail.example.com'\n\t * });\n\t *\n\t * Example #2:\n\t * =========================================================================\n\t * \n\t *\n\t * buildHTML('input', {\n\t * id: 'myinput',\n\t * type: 'text',\n\t * value: 'myvalue'\n\t * });\n\t *\n\t */\n\tvar buildHTML = function buildHTML(tag, html, attrs) {\n\t switch (tag) {\n\t case 'select':\n\t if ((typeof html === 'undefined' ? 'undefined' : _typeof(html)) === 'object') {\n\t var options = html || {};\n\t html = '';\n\t for (var value in options) {\n\t if (!options.hasOwnProperty(value)) {\n\t continue;\n\t }\n\t html += buildHTML('option', options[value] || '', { value: value });\n\t }\n\t }\n\t break;\n\t\n\t default:\n\t if ((typeof html === 'undefined' ? 'undefined' : _typeof(html)) === 'object') {\n\t attrs = html;\n\t html = undefined;\n\t }\n\t break;\n\t }\n\t\n\t var h = '<' + tag;\n\t for (var attr in attrs) {\n\t if (!attrs.hasOwnProperty(attr)) {\n\t continue;\n\t }\n\t if (typeof attrs[attr] !== 'undefined') {\n\t h += ' ' + attr + '=\"' + quoteattr(attrs[attr]) + '\"';\n\t }\n\t }\n\t h += typeof html !== 'undefined' ? '>' + html + '' + tag + '>' : '/>';\n\t\n\t return h;\n\t};\n\t\n\texports.extend = extend;\n\texports.preventDefault = preventDefault;\n\texports.stopPropagation = stopPropagation;\n\texports.dispatchEvent = dispatchEvent;\n\texports.addEventListener = addEventListener;\n\texports.removeEventListener = removeEventListener;\n\texports.hasClass = hasClass;\n\texports.addClass = addClass;\n\texports.removeClass = removeClass;\n\texports.toggleClass = toggleClass;\n\texports.classNames = classNames;\n\texports.isDOMElement = isDOMElement;\n\texports.isDOMNode = isDOMNode;\n\texports.quoteattr = quoteattr;\n\texports.buildHTML = buildHTML;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _helper = __webpack_require__(11);\n\t\n\tvar rowRenderer = function rowRenderer(node, treeOptions) {\n\t var id = node.id;\n\t var label = node.label;\n\t var _node$loadOnDemand = node.loadOnDemand;\n\t var loadOnDemand = _node$loadOnDemand === undefined ? false : _node$loadOnDemand;\n\t var children = node.children;\n\t var state = node.state;\n\t var _node$props = node.props;\n\t var props = _node$props === undefined ? {} : _node$props;\n\t\n\t var droppable = treeOptions.droppable && props.droppable;\n\t var depth = state.depth;\n\t var open = state.open;\n\t var path = state.path;\n\t var total = state.total;\n\t var _state$loading = state.loading;\n\t var loading = _state$loading === undefined ? false : _state$loading;\n\t var _state$selected = state.selected;\n\t var selected = _state$selected === undefined ? false : _state$selected;\n\t\n\t var childrenLength = Object.keys(children).length;\n\t var more = node.hasChildren();\n\t\n\t var togglerContent = '';\n\t if (!more && loadOnDemand) {\n\t togglerContent = (0, _helper.buildHTML)('i', '', {\n\t 'class': (0, _helper.classNames)('glyphicon', 'glyphicon-triangle-right')\n\t });\n\t }\n\t if (more && open) {\n\t togglerContent = (0, _helper.buildHTML)('i', '', {\n\t 'class': (0, _helper.classNames)('glyphicon', 'glyphicon-triangle-bottom')\n\t });\n\t }\n\t if (more && !open) {\n\t togglerContent = (0, _helper.buildHTML)('i', '', {\n\t 'class': (0, _helper.classNames)('glyphicon', 'glyphicon-triangle-right')\n\t });\n\t }\n\t var toggler = (0, _helper.buildHTML)('a', togglerContent, {\n\t 'class': function () {\n\t if (!more && loadOnDemand) {\n\t return (0, _helper.classNames)('tree-toggler', 'tree-closed');\n\t }\n\t if (more && open) {\n\t return (0, _helper.classNames)('tree-toggler');\n\t }\n\t if (more && !open) {\n\t return (0, _helper.classNames)('tree-toggler', 'tree-closed');\n\t }\n\t return '';\n\t }()\n\t });\n\t\n\t var icon = (0, _helper.buildHTML)('i', '', {\n\t 'class': (0, _helper.classNames)('tree-folder-icon', 'glyphicon', { 'glyphicon-folder-open': more && open }, { 'glyphicon-folder-close': more && !open }, { 'glyphicon-file': !more })\n\t });\n\t var title = (0, _helper.buildHTML)('span', (0, _helper.quoteattr)(label), {\n\t 'class': (0, _helper.classNames)('tree-title')\n\t });\n\t var loadingIcon = (0, _helper.buildHTML)('i', '', {\n\t 'style': 'margin-left: 5px',\n\t 'class': (0, _helper.classNames)({ 'hidden': !loading }, 'glyphicon', 'glyphicon-refresh', { 'rotating': loading })\n\t });\n\t var count = (0, _helper.buildHTML)('span', childrenLength, {\n\t 'class': 'count'\n\t });\n\t var treeNode = (0, _helper.buildHTML)('div', toggler + icon + title + loadingIcon + count, {\n\t 'class': 'tree-node',\n\t 'style': 'margin-left: ' + depth * 18 + 'px'\n\t });\n\t\n\t var treeNodeAttributes = {\n\t 'aria-id': id,\n\t 'aria-expanded': more && open,\n\t 'aria-depth': depth,\n\t 'aria-path': path,\n\t 'aria-selected': selected,\n\t 'aria-children': childrenLength,\n\t 'aria-total': total,\n\t 'class': (0, _helper.classNames)('tree-item', { 'tree-selected': selected })\n\t };\n\t if (droppable) {\n\t treeNodeAttributes['droppable'] = true;\n\t }\n\t\n\t return (0, _helper.buildHTML)('div', treeNode, treeNodeAttributes);\n\t};\n\t\n\texports['default'] = rowRenderer;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// style-loader: Adds some css to the DOM by adding a
-