aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2018-05-15 22:21:16 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2018-05-15 22:21:16 -0500
commit2f3c66512cae56aa50f705d4669ce64d69e7ad26 (patch)
tree6fe4048442ce2a9fff7f65c6d08cafd551a80292 /webAO
parent5685e2b1714c8d85e505e9eccee549723773aaab (diff)
Some more layout fixes
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.css11
-rw-r--r--webAO/ui.b.js2
-rw-r--r--webAO/ui.js3
3 files changed, 11 insertions, 5 deletions
diff --git a/webAO/client.css b/webAO/client.css
index 87ff868..d5d8e75 100644
--- a/webAO/client.css
+++ b/webAO/client.css
@@ -213,6 +213,7 @@ img {
border: 1px solid #555555;
border-style: solid;
box-sizing: border-box;
+ margin: auto;
}
#client_chatlog {
@@ -269,10 +270,8 @@ img {
width: 99%;
/* margin-top: 20px; */
/*! height: 50%; */
- position: relative;
- background-color: #ff0000;
- /* resize: vertical; */
- width: auto;
+ background-color: #222;
+ color: white;
}
#client_bars {
@@ -286,6 +285,10 @@ img {
.slider {
padding-right: 4px;
+ width: 80%;
+ align-self: center;
+ margin-left: auto;
+ margin-right: auto;
}
.client_defense {
diff --git a/webAO/ui.b.js b/webAO/ui.b.js
index 7fa8600..293f227 100644
--- a/webAO/ui.b.js
+++ b/webAO/ui.b.js
@@ -1 +1 @@
-!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){var n,i,o,r,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};"undefined"==typeof self||self,r=function(){var e=Math.min,t=Math.floor,n=Math.max;return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=67)}([function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){t.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(100));t.default=function(){function e(e,t){for(var n,o=0;o<t.length;o++)(n=t[o]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,i.default)(e,n.key,n)}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}function o(){}function r(e){return"function"==typeof u.default?(0,u.default)(e):(o.prototype=e,new o)}function s(e){var t=location.hash.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null}function a(e,t){if(!(t instanceof Array))throw new Error("Haystack is not an Array");if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0;var l=i(n(17)),c=i(n(109)),u=i(n(55));t.F=o,t.getTouchEvent=function(e){return $.zepto?e.touches?e.targetTouches[0]:e:e.originalEvent&&e.originalEvent.touches?e.originalEvent.touches[0]:e},t.extend=function(e,t){e.prototype=r(t.prototype),e.prototype.contructor=e},t.createObject=r,t.objectKeys=function(e){var t,n;if("function"==typeof c.default)return(0,c.default)(e);for(n in t=[],e)t.push(n);return t},t.getHashValue=s,t.getQueryStringParam=function(e){if(window.location.hash)return s(e);if(!window.location.search)return null;var t,n,i=window.location.search.substr(1).split("&"),o={};for(n=0;n<i.length;n++)o[(t=i[n].split("="))[0]]=t[1];return o[e]||null},t.copy=function(e,t){for(var n in t)e[n]=t[n];return e},t.animFrame=function(e){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)})(function(){e()})},t.indexOf=a,t.fnBind=function(e,t,n){if(void 0!==Function.prototype.bind)return Function.prototype.bind.apply(e,[t].concat(n||[]));var i=function i(){var o=(n||[]).concat(Array.prototype.slice.call(arguments,0));return this instanceof i?void e.apply(this,o):e.apply(t,o)};return i.prototype=e.prototype,i},t.removeFromArray=function(e,t){var n=a(e,t);if(-1===n)throw new Error("Can't remove item from array. Item is not in the array");t.splice(n,1)},t.now=function(){return"function"==typeof Date.now?Date.now():(new Date).getTime()},t.getUniqueId=function(){return(1e15*Math.random()).toString(36).replace(".","")},t.filterXss=function(e,t){var n=e.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return!0===t?n:n.replace(/>/g,"&gt;").replace(/</g,"&lt;")},t.stripTags=function(e){return $.trim(e.replace(/(<([^>]+)>)/gi,""))},t.isFunction="function"!=typeof/./&&"object"!=("undefined"==typeof Int8Array?"undefined":(0,l.default)(Int8Array))?function(e){return"function"==typeof e||!1}:function(e){return"[object Function]"===toString.call(e)}},function(e,t,n){e.exports={default:n(98),__esModule:!0}},function(e,t,n){t.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(17));t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(n(103)),r=i(n(55)),s=i(n(17));t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,s.default)(t)));e.prototype=(0,r.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e){var t=e.exports={version:"2.5.6"};"number"==typeof __e&&(__e=t)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_EVENT=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=n(2),r=t.ALL_EVENT="__all";t.default=function e(){(0,i.default)(this,e),this._mSubscriptions={},this._mSubscriptions[r]=[],this.on=function(e,t,n){if(!(0,o.isFunction)(t))throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:n})},this.emit=function(e){var t,n,i;i=Array.prototype.slice.call(arguments,1);var o=this._mSubscriptions[e];if(o)for(o=o.slice(),t=0;t<o.length;t++)n=o[t].ctx||{},o[t].fn.apply(n,i);i.unshift(e);var s=this._mSubscriptions[r].slice();for(t=0;t<s.length;t++)n=s[t].ctx||{},s[t].fn.apply(n,i)},this.unbind=function(e,t,n){if(!this._mSubscriptions[e])throw new Error("No subscribtions to unsubscribe for event "+e);var i,o=!1;for(i=0;i<this._mSubscriptions[e].length;i++)t&&this._mSubscriptions[e][i].fn!==t||n&&n!==this._mSubscriptions[e][i].ctx||(this._mSubscriptions[e].splice(i,1),o=!0);if(0==o)throw new Error("Nothing to unbind for "+e)},this.off=this.unbind,this.trigger=this.emit}},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){var i=n(18),o=n(45),r=n(29),s=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(i(e),t=r(t,!0),i(n),o)try{return s(e,t,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},function(e,t,n){var i=n(8),o=n(6),r=n(44),s=n(13),a=n(11),l="prototype",c=function e(t,n,c){var u,h,d,f=t&e.F,p=t&e.G,m=t&e.S,g=t&e.P,y=t&e.B,v=t&e.W,_=p?o:o[n]||(o[n]={}),b=_[l],w=p?i:m?i[n]:(i[n]||{})[l];for(u in p&&(c=n),c)(h=!f&&w&&void 0!==w[u])&&a(_,u)||(d=h?w[u]:c[u],_[u]=p&&"function"!=typeof w[u]?c[u]:y&&h?r(d,i):v&&w[u]==d?function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t[l]=e[l],t}(d):g&&"function"==typeof d?r(Function.call,d):d,g&&((_.virtual||(_.virtual={}))[u]=d,t&e.R&&b&&!b[u]&&s(b,u,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var i=n(9),o=n(22);e.exports=n(10)?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e){e.exports=function(e){return"object"==(void 0===e?"undefined":s(e))?null!==e:"function"==typeof e}},function(e,t,n){var i=n(79),o=n(28);e.exports=function(e){return i(o(e))}},function(e,t,n){var i=n(33)("wks"),o=n(24),r=n(8).Symbol,s="function"==typeof r;(e.exports=function(e){return i[e]||(i[e]=s&&r[e]||(s?r:o)("Symbol."+e))}).store=i},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(n(72)),r=i(n(88)),a="function"==typeof r.default&&"symbol"==s(o.default)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":s(e)};t.default="function"==typeof r.default&&"symbol"===a(o.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":a(e)}},function(e,t,n){var i=n(14);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=n(7),u=i(c),h=i(n(58)),d=i(n(41)),f=i(n(59)),p=i(n(112)),m=n(2),g=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return s.config=s._extendItemNode(n),s.type=n.type,s.contentItems=[],s.parent=i,s.isInitialised=!1,s.isMaximised=!1,s.isRoot=!1,s.isRow=!1,s.isColumn=!1,s.isStack=!1,s.isComponent=!1,s.layoutManager=e,s._pendingEventPropagations={},s._throttledEvents=["stateChanged"],s.on(c.ALL_EVENT,s._propagateEvent,s),n.content&&s._createContentItems(n),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"setSize",value:function(){throw new Error("Abstract Method")}},{key:"callDownwards",value:function(e,t,n,i){var o;for(!0!==n&&!0!==i&&this[e].apply(this,t||[]),o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,n);!0===n&&!0!==i&&this[e].apply(this,t||[])}},{key:"removeChild",value:function(e,t){var n=(0,m.indexOf)(e,this.contentItems);if(-1===n)throw new Error("Can't remove child item. Unknown content item");!0!==t&&this.contentItems[n]._$destroy(),this.contentItems.splice(n,1),this.config.content.splice(n,1),0<this.contentItems.length?this.callDownwards("setSize"):!(this instanceof d.default)&&!0===this.config.isClosable&&this.parent.removeChild(this)}},{key:"undisplayChild",value:function(e){if(-1===(0,m.indexOf)(e,this.contentItems))throw new Error("Can't remove child item. Unknown content item");this instanceof d.default||!0!==this.config.isClosable||this.parent.undisplayChild(this)}},{key:"addChild",value:function(e,t){void 0===t&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init()}},{key:"replaceChild",value:function(e,t,n){t=this.layoutManager._$normalizeContentItem(t);var i=(0,m.indexOf)(e,this.contentItems),o=e.element[0].parentNode;if(-1===i)throw new Error("Can't replace child. oldChild is not child of this");o.replaceChild(t.element[0],e.element[0]),!0===n&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,this.isStack&&(this.header.tabs[i].contentItem=t),!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init(),this.callDownwards("setSize")}},{key:"remove",value:function(){this.parent.removeChild(this)}},{key:"popout",value:function(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}},{key:"toggleMaximise",value:function(e){e&&e.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}},{key:"select",value:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}},{key:"deselect",value:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}},{key:"setTitle",value:function(e){this.config.title=e,this.emit("titleChanged",e),this.emit("stateChanged")}},{key:"hasId",value:function(e){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===e:this.config.id instanceof Array?-1!==(0,m.indexOf)(e,this.config.id):void 0)}},{key:"addId",value:function(e){this.hasId(e)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}},{key:"removeId",value:function(e){if(!this.hasId(e))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var t=(0,m.indexOf)(e,this.config.id);this.config.id.splice(t,1)}}},{key:"getItemsByFilter",value:function(e){var t=[];return function n(i){for(var o=0;o<i.contentItems.length;o++)!0===e(i.contentItems[o])&&t.push(i.contentItems[o]),n(i.contentItems[o])}(this),t}},{key:"getItemsById",value:function(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?-1!==(0,m.indexOf)(e,t.config.id):t.config.id===e})}},{key:"getItemsByType",value:function(e){return this._$getItemsByProperty("type",e)}},{key:"getComponentsByName",value:function(e){var t,n=this._$getItemsByProperty("componentName",e),i=[];for(t=0;t<n.length;t++)i.push(n[t].instance);return i}},{key:"_$getItemsByProperty",value:function(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}},{key:"_$setParent",value:function(e){this.parent=e}},{key:"_$highlightDropZone",value:function(e,t,n){this.layoutManager.dropTargetIndicator.highlightArea(n)}},{key:"_$onDrop",value:function(e){this.addChild(e)}},{key:"_$hide",value:function(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}},{key:"_$show",value:function(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}},{key:"_callOnActiveComponents",value:function(e){var t,n,i=this.getItemsByType("stack");for(n=0;n<i.length;n++)(t=i[n].getActiveContentItem())&&t.isComponent&&t.container[e]()}},{key:"_$destroy",value:function(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}},{key:"_$getArea",value:function(e){var t=(e=e||this.element).offset(),n=e.width(),i=e.height();return{x1:t.left,y1:t.top,x2:t.left+n,y2:t.top+i,surface:n*i,contentItem:this}}},{key:"_$init",value:function(){var e;for(this.setSize(),e=0;e<this.contentItems.length;e++)this.childElementContainer.append(this.contentItems[e].element);this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}},{key:"emitBubblingEvent",value:function(e){var t=new h.default(e,this);this.emit(e,t)}},{key:"_createContentItems",value:function(e){var t,n;if(!(e.content instanceof Array))throw new f.default("content must be an Array",e);for(n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}},{key:"_extendItemNode",value:function(e){for(var t in p.default)void 0===e[t]&&(e[t]=p.default[t]);return e}},{key:"_propagateEvent",value:function(e,t){t instanceof h.default&&!1===t.isPropagationStopped&&!0===this.isInitialised&&(!1===this.isRoot&&this.parent?this.parent.emit.apply(this.parent,Array.prototype.slice.call(arguments,0)):this._scheduleEventPropagationToLayoutManager(e,t))}},{key:"_scheduleEventPropagationToLayoutManager",value:function(e,t){-1===(0,m.indexOf)(e,this._throttledEvents)?this.layoutManager.emit(e,t.origin):!0!==this._pendingEventPropagations[e]&&(this._pendingEventPropagations[e]=!0,(0,m.animFrame)((0,m.fnBind)(this._propagateEventToLayoutManager,this,[e,t])))}},{key:"_propagateEventToLayoutManager",value:function(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}]),t}(u.default);t.default=g},function(e){e.exports=!0},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(48),o=n(34);e.exports=Object.keys||function(e){return i(e,o)}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(3)),a=r(o(0)),l=r(o(1)),c=r(o(4)),u=r(o(5)),h=r(o(20)),d=r(o(42)),f=r(o(113)),p=o(2),m=function(e){function i(e,t,n,o){(0,a.default)(this,i);var r=(0,c.default)(this,(i.__proto__||(0,s.default)(i)).call(this,t,n,o));return r.isRow=!e,r.isColumn=e,r.element=$('<div class="lm_item lm_'+(e?"column":"row")+'"></div>'),r.childElementContainer=r.element,r._splitterSize=t.config.dimensions.borderWidth,r._splitterGrabSize=t.config.dimensions.borderGrabWidth,r._isColumn=e,r._dimension=e?"height":"width",r._splitter=[],r._splitterPosition=null,r._splitterMinPosition=null,r._splitterMaxPosition=null,r}var o=Math.round;return(0,u.default)(i,e),(0,l.default)(i,[{key:"addChild",value:function(e,t,i){var o,r,s,a;if(e=this.layoutManager._$normalizeContentItem(e,this),void 0===t&&(t=this.contentItems.length),0<this.contentItems.length?(a=this._createSplitter(n(0,t-1)).element,0<t?(this.contentItems[t-1].element.after(a),a.after(e.element),this._isDocked(t-1)&&(this._splitter[t-1].element.hide(),this._splitter[t].element.show())):(this.contentItems[0].element.before(a),a.before(e.element))):this.childElementContainer.append(e.element),h.default.prototype.addChild.call(this,e,t),o=1/this.contentItems.length*100,!0!==i){for(s=0;s<this.contentItems.length;s++)this.contentItems[s]===e?e.config[this._dimension]=o:(r=this.contentItems[s].config[this._dimension]*=(100-o)/100,this.contentItems[s].config[this._dimension]=r);this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking()}else this.emitBubblingEvent("stateChanged")}},{key:"undisplayChild",value:function(e){var t,i=e.config[this._dimension],o=(0,p.indexOf)(e,this.contentItems),r=n(o-1,0);if(-1===o)throw new Error("Can't undisplay child. ContentItem is not child of this Row or Column");this._splitter[r]&&(this._splitter[r].element.hide(),this._splitter.splice(r,1)),r<this._splitter.length&&this._isDocked(r)&&this._splitter[r].element.hide();var s=this._isDocked();for(t=0;t<this.contentItems.length;t++)this.contentItems[t]===e?this.contentItems[t].config[this._dimension]=0:this._isDocked(t)||(this.contentItems[t].config[this._dimension]+=i/(this.contentItems.length-1-s));this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"removeChild",value:function(e,t){var i,o,r=e.config[this._dimension],s=(0,p.indexOf)(e,this.contentItems),a=n(s-1,0);if(-1===s)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),a<this._splitter.length&&this._isDocked(a)&&this._splitter[a].element.hide();var l=this._isDocked();for(i=0;i<this.contentItems.length;i++)this.contentItems[i]!==e&&(this._isDocked(i)||(this.contentItems[i].config[this._dimension]+=r/(this.contentItems.length-1-l)));h.default.prototype.removeChild.call(this,e,t),1===this.contentItems.length&&!0===this.config.isClosable?(o=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,o,!0),this._validateDocking(this.parent)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking())}},{key:"replaceChild",value:function(e,t){var n=e.config[this._dimension];h.default.prototype.replaceChild.call(this,e,t),t.config[this._dimension]=n,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"setSize",value:function(){0<this.contentItems.length&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}},{key:"dock",value:function(e,t,i){if(1===this.contentItems.length)throw new Error("Can't dock child when it single");var o=e.config[this._dimension],r=this.layoutManager.config.dimensions.headerHeight,s=(0,p.indexOf)(e,this.contentItems),a=n(s-1,0);if(-1===s)throw new Error("Can't dock child. ContentItem is not child of this Row or Column");var l,c=e._docker&&e._docker.docked;if(void 0===t||t!=c){if(c){for(this._splitter[a].element.show(),l=0;l<this.contentItems.length;l++){var u=e._docker.size;this.contentItems[l]===e?e.config[this._dimension]=u:(itemSize=this.contentItems[l].config[this._dimension]*=(100-u)/100,this.contentItems[l].config[this._dimension]=itemSize)}e._docker={docked:!1}}else{if(2>this.contentItems.length-this._isDocked())throw new Error("Can't dock child when it is last in "+this.config.type);var h={column:{first:"top",last:"bottom"},row:{first:"left",last:"right"}}[this.config.type][s?"last":"first"];e.header.position()!=h&&e.header.position(h),this._splitter[a]&&this._splitter[a].element.hide();var d=this._isDocked();for(l=0;l<this.contentItems.length;l++)this.contentItems[l]===e?this.contentItems[l].config[this._dimension]=0:this._isDocked(l)||(this.contentItems[l].config[this._dimension]+=o/(this.contentItems.length-1-d));e._docker={dimension:this._dimension,size:o,realSize:e.element[this._dimension]()-r,docked:!0},i&&e.childElementContainer[this._dimension](0)}e.element.toggleClass("lm_docked",e._docker.docked),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking()}}},{key:"_$init",value:function(){if(!0!==this.isInitialised){var e;for(h.default.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element);for(e=0;e<this.contentItems.length;e++)this.contentItems[e]._header&&this.contentItems[e]._header.docked&&this.dock(this.contentItems[e],!0,!0)}}},{key:"_setAbsoluteSizes",value:function(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)0<t.additionalPixel-e&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}},{key:"_calculateAbsoluteSizes",value:function(){var e,n,i=(this.contentItems.length-1)*this._splitterSize,o=this.layoutManager.config.dimensions.headerHeight,r=this.element.width(),s=this.element.height(),a=0,l=[];for(this._isColumn?s-=i:r-=i,e=0;e<this.contentItems.length;e++)this._isDocked(e)&&(this._isColumn?s-=o-this._splitterSize:r-=o-this._splitterSize);for(e=0;e<this.contentItems.length;e++)n=this._isColumn?t(s*(this.contentItems[e].config.height/100)):t(r*(this.contentItems[e].config.width/100)),this._isDocked(e)&&(n=o),a+=n,l.push(n);return{itemSizes:l,additionalPixel:t((this._isColumn?s:r)-a),totalWidth:r,totalHeight:s}}},{key:"_calculateRelativeSizes",value:function(){var e,t=0,n=[],i=this._isColumn?"height":"width";for(e=0;e<this.contentItems.length;e++)void 0===this.contentItems[e].config[i]?n.push(this.contentItems[e]):t+=this.contentItems[e].config[i];if(100!==o(t))if(100>o(t)&&0<n.length){for(e=0;e<n.length;e++)n[e].config[i]=(100-t)/n.length;this._respectMinItemWidth()}else{if(100<o(t))for(e=0;e<n.length;e++)n[e].config[i]=50,t+=50;for(e=0;e<this.contentItems.length;e++)this.contentItems[e].config[i]=this.contentItems[e].config[i]/t*100;this._respectMinItemWidth()}else this._respectMinItemWidth()}},{key:"_respectMinItemWidth",value:function(){var e,t,n,i=this.layoutManager.config.dimensions&&this.layoutManager.config.dimensions.minItemWidth||0,r=null,s=[],a=0,l=0,c=0,u=0,h=[];if(!(this._isColumn||!i||1>=this.contentItems.length)){r=this._calculateAbsoluteSizes();for(var d=0;d<this.contentItems.length;d++)this.contentItems[d],(u=r.itemSizes[d])<i?(l+=i-u,n={width:i}):(a+=u-i,n={width:u},s.push(n)),h.push(n);if(!(0==l||l>a)){for(e=l/a,c=l,d=0;d<s.length;d++)n=s[d],c-=t=o((n.width-i)*e),n.width-=t;for(0!==c&&(h[h.length-1].width-=c),d=0;d<this.contentItems.length;d++)this.contentItems[d].config.width=h[d].width/r.totalWidth*100}}}},{key:"_createSplitter",value:function(e){var t;return(t=new f.default(this._isColumn,this._splitterSize,this._splitterGrabSize)).on("drag",(0,p.fnBind)(this._onSplitterDrag,this,[t]),this),t.on("dragStop",(0,p.fnBind)(this._onSplitterDragStop,this,[t]),this),t.on("dragStart",(0,p.fnBind)(this._onSplitterDragStart,this,[t]),this),this._splitter.splice(e,0,t),t}},{key:"_getItemsForSplitter",value:function(e){var t=(0,p.indexOf)(e,this._splitter);return{before:this.contentItems[t],after:this.contentItems[t+1]}}},{key:"_isDocked",value:function(e){if(void 0===e){for(var t=0,n=0;n<this.contentItems.length;++n)this._isDocked(n)&&t++;return t}return e<this.contentItems.length?this.contentItems[e]._docker&&this.contentItems[e]._docker.docked:void 0}},{key:"_validateDocking",value:function(e){for(var t=1<(e=e||this).contentItems.length-e._isDocked(),n=0;n<e.contentItems.length;++n)e.contentItems[n]instanceof d.default&&(e.contentItems[n].header._setDockable(e._isDocked(n)||t),e.contentItems[n].header._$setClosable(t))}},{key:"_getMinimumDimensions",value:function(e){for(var t=0,i=0,o=0;o<e.length;++o)t=n(e[o].minWidth||0,t),i=n(e[o].minHeight||0,i);return{horizontal:t,vertical:i}}},{key:"_onSplitterDragStart",value:function(e){var t=this._getItemsForSplitter(e),n=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],i=this._getMinimumDimensions(t.before.config.content),o=this._isColumn?i.vertical:i.horizontal,r=this._getMinimumDimensions(t.after.config.content),s=this._isColumn?r.vertical:r.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(t.before.element[this._dimension]()-(o||n)),this._splitterMaxPosition=t.after.element[this._dimension]()-(s||n)}},{key:"_onSplitterDrag",value:function(e,t,n){var i=this._isColumn?n:t;i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}},{key:"_onSplitterDragStop",value:function(e){var t=this._getItemsForSplitter(e),n=t.before.element[this._dimension](),i=t.after.element[this._dimension](),o=(this._splitterPosition+n)/(n+i),r=t.before.config[this._dimension]+t.after.config[this._dimension];t.before.config[this._dimension]=o*r,t.after.config[this._dimension]=(1-o)*r,e.element.css({top:0,left:0}),(0,p.animFrame)((0,p.fnBind)(this.callDownwards,this,["setSize"]))}}]),i}(h.default);i.default=m},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=n(2),h=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.timeout=null,i._eElement=$(e),i._oDocument=$(document),i._eBody=$(document.body),i._nButtonCode=n||0,i._nDelay=200,i._nDistance=10,i._nX=0,i._nY=0,i._nOriginalX=0,i._nOriginalY=0,i._bDragging=!1,i._fMove=(0,u.fnBind)(i.onMouseMove,i),i._fUp=(0,u.fnBind)(i.onMouseUp,i),i._fDown=(0,u.fnBind)(i.onMouseDown,i),i._eElement.on("mousedown touchstart",i._fDown),i}return(0,l.default)(t,e),(0,s.default)(t,[{key:"destroy",value:function(){this._eElement.unbind("mousedown touchstart",this._fDown),this._oDocument.unbind("mouseup touchend",this._fUp),this._eElement=null,this._oDocument=null,this._eBody=null}},{key:"onMouseDown",value:function(e){if(e.preventDefault(),0==e.button||"touchstart"===e.type){var t=this._getCoordinates(e);this._nOriginalX=t.x,this._nOriginalY=t.y,this._oDocument.on("mousemove touchmove",this._fMove),this._oDocument.one("mouseup touchend",this._fUp),this._timeout=setTimeout((0,u.fnBind)(this._startDrag,this),this._nDelay)}}},{key:"onMouseMove",value:function(e){var t=Math.abs;if(null!=this._timeout){e.preventDefault();var n=this._getCoordinates(e);this._nX=n.x-this._nOriginalX,this._nY=n.y-this._nOriginalY,!1===this._bDragging&&(t(this._nX)>this._nDistance||t(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}},{key:"onMouseUp",value:function(e){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)))}},{key:"_startDrag",value:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}},{key:"_getCoordinates",value:function(e){return{x:(e=(0,u.getTouchEvent)(e)).pageX,y:e.pageY}}}]),t}(c.default);t.default=h},function(e){var n=Math.ceil;e.exports=function(e){return isNaN(e=+e)?0:(0<e?t:n)(e)}},function(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var i=n(14);e.exports=function(e,t){if(!i(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!i(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e){e.exports={}},function(e,t,n){var i=n(18),o=n(78),r=n(34),s=n(32)("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=n(46)("iframe"),i=r.length;for(t.style.display="none",n(83).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;i--;)delete c[l][r[i]];return c()};e.exports=Object.create||function(e,t){var n;return null===e?n=c():(a[l]=i(e),n=new a,a[l]=null,n[s]=e),void 0===t?n:o(n,t)}},function(e,t,n){var i=n(33)("keys"),o=n(24);e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var i=n(6),o=n(8),r="__core-js_shared__",s=o[r]||(o[r]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0===t?{}:t)})("versions",[]).push({version:i.version,mode:n(21)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var i=n(9).f,o=n(11),r=n(16)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,r)&&i(e,r,{configurable:!0,value:t})}},function(e,t,n){var i=n(28);e.exports=function(e){return Object(i(e))}},function(e,t,n){t.f=n(16)},function(e,t,n){var i=n(8),o=n(6),r=n(21),s=n(37),a=n(9).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(17)),r=i(n(0)),s=i(n(1)),a=n(2),l=function(){function e(){if((0,r.default)(this,e),this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],36<this._keys.length)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]}return(0,s.default)(e,[{key:"minifyConfig",value:function(e){var t={};return this._nextLevel(e,t,"_min"),t}},{key:"unminifyConfig",value:function(e){var t={};return this._nextLevel(e,t,"_max"),t}},{key:"_nextLevel",value:function(e,t,n){var i,r;for(i in e)e instanceof Array&&(i=parseInt(i,10)),e.hasOwnProperty(i)&&(r=this[n](i,this._keys),"object"===(0,o.default)(e[i])?(t[r]=e[i]instanceof Array?[]:{},this._nextLevel(e[i],t[r],n)):t[r]=this[n](e[i],this._values))}},{key:"_min",value:function(e,t){if("string"==typeof e&&1===e.length)return"___"+e;var n=(0,a.indexOf)(e,t);return-1===n?e:n.toString(36)}},{key:"_max",value:function(e,t){return"string"==typeof e&&1===e.length?t[parseInt(e,36)]:"string"==typeof e&&"___"===e.substr(0,3)?e[3]:e}}]),e}();t.default=l},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(20)),u=i(n(25)),h=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n,null));return s.isRoot=!0,s.type="root",s.element=$('<div class="lm_goldenlayout lm_item lm_root"></div>'),s.childElementContainer=s.element,s._containerElement=i,s._containerElement.append(s.element),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"addChild",value:function(e){if(0<this.contentItems.length)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),c.default.prototype.addChild.call(this,e),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"setSize",value:function(e,t){e=void 0===e?this._containerElement.width():e,t=void 0===t?this._containerElement.height():t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}},{key:"_$highlightDropZone",value:function(){this.layoutManager.tabDropPlaceholder.remove(),c.default.prototype._$highlightDropZone.apply(this,arguments)}},{key:"_$onDrop",value:function(e,t){var n;if(e.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this))._$init(),n.addChild(e),e=n),this.contentItems.length){var i="x"==t.side[0]?"row":"column",o="x"==t.side[0]?"width":"height",r="2"==t.side[1],s=this.contentItems[0];if(s instanceof u.default&&s.type==i){var a=s.contentItems[r?0:s.contentItems.length-1];s.addChild(e,r?0:void 0,!0),a.config[o]*=.5,e.config[o]=a.config[o],s.callDownwards("setSize")}else{var l=this.layoutManager.createContentItem({type:i},this);this.replaceChild(s,l),l.addChild(e,r?0:void 0,!0),l.addChild(s,r?void 0:0,!0),s.config[o]=50,e.config[o]=50,l.callDownwards("setSize")}}else this.addChild(e)}}]),t}(c.default);t.default=h},function(t,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(3)),a=r(o(0)),l=r(o(1)),c=r(o(4)),u=r(o(5)),h=r(o(20)),d=r(o(25)),f=r(o(60)),p=o(2),m=function(t){function i(e,t,n){(0,a.default)(this,i);var o=(0,c.default)(this,(i.__proto__||(0,s.default)(i)).call(this,e,t,n));o.element=$('<div class="lm_item lm_stack"></div>'),o._activeContentItem=null;var r=e.config;return o._header={show:!0===r.settings.hasHeaders&&!1!==t.hasHeaders,popout:r.settings.showPopoutIcon&&r.labels.popout,maximise:r.settings.showMaximiseIcon&&r.labels.maximise,close:r.settings.showCloseIcon&&r.labels.close,minimise:r.labels.minimise},r.header&&(0,p.copy)(o._header,r.header),t.header&&(0,p.copy)(o._header,t.header),t.content&&t.content[0]&&t.content[0].header&&(0,p.copy)(o._header,t.content[0].header),o._dropZones={},o._dropSegment=null,o._contentAreaDimensions=null,o._dropIndex=null,o.isStack=!0,o.childElementContainer=$('<div class="lm_items"></div>'),o.header=new f.default(e,o),o.element.on("mouseleave mouseenter",(0,p.fnBind)(function(e){this._docker&&this._docker.docked&&this.childElementContainer[this._docker.dimension]("mouseenter"==e.type?this._docker.realSize:0)},o)),o.element.append(o.header.element),o.element.append(o.childElementContainer),o._setupHeaderPosition(),o._$validateClosability(),o}return(0,u.default)(i,t),(0,l.default)(i,[{key:"dock",value:function(e){this._header.dock&&this.parent instanceof d.default&&this.parent.dock(this,e)}},{key:"setSize",value:function(){if("none"!==this.element.css("display")){var e=this._docker&&this._docker.docked,t={width:this.element.width(),height:this.element.height()};this._header.show&&(t[this._sided?"width":"height"]-=this.layoutManager.config.dimensions.headerHeight),e&&(t[this._docker.dimension]=this._docker.realSize),e&&"height"!=this._docker.dimension||this.childElementContainer.width(t.width),e&&"width"!=this._docker.dimension||this.childElementContainer.height(t.height);for(var n=0;n<this.contentItems.length;n++)this.contentItems[n].element.width(t.width),this.contentItems[n].element.height(t.height);this.emit("resize"),this.emitBubblingEvent("stateChanged")}}},{key:"_$init",value:function(){var e,t;if(!0!==this.isInitialised){for(h.default.prototype._$init.call(this),e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(0<this.contentItems.length){if(!(t=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}},{key:"setActiveContentItem",value:function(e){if(-1===(0,p.indexOf)(e,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}},{key:"getActiveContentItem",value:function(){return this.header.activeContentItem}},{key:"addChild",value:function(e,t){t>this.contentItems.length&&(t-=1),e=this.layoutManager._$normalizeContentItem(e,this),h.default.prototype.addChild.call(this,e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.parent instanceof d.default&&this.parent._validateDocking(),this.emitBubblingEvent("stateChanged")}},{key:"removeChild",value:function(e,t){var i=(0,p.indexOf)(e,this.contentItems);h.default.prototype.removeChild.call(this,e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(0<this.contentItems.length?this.setActiveContentItem(this.contentItems[n(i-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.parent instanceof d.default&&this.parent._validateDocking(),this.emitBubblingEvent("stateChanged")}},{key:"undisplayChild",value:function(e){if(1<this.contentItems.length){var t=(0,p.indexOf)(e,this.contentItems);e._$hide&&e._$hide(),this.setActiveContentItem(this.contentItems[0===t?t+1:t-1])}else h.default.prototype.undisplayChild.call(this,e),this.parent instanceof d.default&&this.parent._validateDocking();this.emitBubblingEvent("stateChanged")}},{key:"_$validateClosability",value:function(){var e,t,n;for(e=this.header._isClosable(),n=0,t=this.contentItems.length;n<t&&e;n++)e=this.contentItems[n].config.isClosable;this.header._$setClosable(e)}},{key:"_$destroy",value:function(){h.default.prototype._$destroy.call(this),this.header._$destroy(),this.element.off("mouseenter mouseleave")}},{key:"_$onDrop",value:function(e){if("header"===this._dropSegment)return this._resetHeaderDropZone(),void this.addChild(e,this._dropIndex);if("body"!==this._dropSegment){var t,n,i,o="top"===this._dropSegment||"bottom"===this._dropSegment,r="left"===this._dropSegment||"right"===this._dropSegment,s="top"===this._dropSegment||"left"===this._dropSegment,a=o&&this.parent.isColumn||r&&this.parent.isRow,l=o?"column":"row",c=o?"height":"width";e.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this))._$init(),n.addChild(e),e=n),a?(t=(0,p.indexOf)(this,this.parent.contentItems),this.parent.addChild(e,s?t:t+1,!0),this.config[c]*=.5,e.config[c]=this.config[c],this.parent.callDownwards("setSize")):(l=o?"column":"row",i=this.layoutManager.createContentItem({type:l},this),this.parent.replaceChild(this,i),i.addChild(e,s?0:void 0,!0),i.addChild(this,s?void 0:0,!0),this.config[c]=50,e.config[c]=50,i.callDownwards("setSize")),this.parent._validateDocking()}else this.addChild(e)}},{key:"_$highlightDropZone",value:function(e,t){var n,i;for(n in this._contentAreaDimensions)if((i=this._contentAreaDimensions[n].hoverArea).x1<e&&i.x2>e&&i.y1<t&&i.y2>t)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?t:e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))}},{key:"_$getArea",value:function(){if("none"===this.element.css("display"))return null;var e=h.default.prototype._$getArea,t=e.call(this,this.header.element),n=e.call(this,this.childElementContainer),i=n.x2-n.x1,o=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?t:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},e.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*i,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*i,y1:n.y1,x2:n.x1+.75*i,y2:n.y1+.5*o},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*o}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*i,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*i,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*i,y1:n.y1+.5*o,x2:n.x1+.75*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*o,x2:n.x2,y2:n.y2}},e.call(this,this.element))}},{key:"_highlightHeaderDropZone",value:function(t){var n,i,o,r,s,a,l,c,u=this.header.tabs.length,h=!1;if(0===u)return l=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:l.left,x2:l.left+100,y1:l.top+this.header.element.height()-20,y2:l.top+this.header.element.height()});for(n=0;n<u;n++)if(s=(i=this.header.tabs[n].element).offset(),this._sided?(r=s.top,o=s.left,c=i.height()):(r=s.left,o=s.top,c=i.width()),t>r&&t<r+c){h=!0;break}if(!(0==h&&t<r)){if(t<r+c/2?(this._dropIndex=n,i.before(this.layoutManager.tabDropPlaceholder)):(this._dropIndex=e(n+1,u),i.after(this.layoutManager.tabDropPlaceholder)),this._sided){var d=this.layoutManager.tabDropPlaceholder.offset().top;return void this.layoutManager.dropTargetIndicator.highlightArea({x1:o,x2:o+i.innerHeight(),y1:d,y2:d+this.layoutManager.tabDropPlaceholder.width()})}a=this.layoutManager.tabDropPlaceholder.offset().left,this.layoutManager.dropTargetIndicator.highlightArea({x1:a,x2:a+this.layoutManager.tabDropPlaceholder.width(),y1:o,y2:o+i.innerHeight()})}}},{key:"_resetHeaderDropZone",value:function(){this.layoutManager.tabDropPlaceholder.remove()}},{key:"toggleMaximise",value:function(e){this.isMaximised||this.dock(!1),h.default.prototype.toggleMaximise.call(this,e)}},{key:"_setupHeaderPosition",value:function(){var e=0<=["right","left","bottom"].indexOf(this._header.show)&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=e,this._sided=0<=["right","left"].indexOf(this._side),this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var t=0<=["right","bottom"].indexOf(this._side)?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}},{key:"_highlightBodyDropZone",value:function(e){var t=this._contentAreaDimensions[e].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(t),this._dropSegment=e}}]),i}(h.default);i.default=m},function(e,t,n){var i=n(21),o=n(12),r=n(47),s=n(13),a=n(30),l=n(77),c=n(35),u=n(50),h=n(16)("iterator"),d=!([].keys&&"next"in[].keys()),f="keys",p="values",m=function(){return this};e.exports=function(e,t,n,g,y,v,_){l(n,t,g);var b,w,x,k=function(e){return!d&&e in $?$[e]:function(){return new n(this,e)}},I=t+" Iterator",C=y==p,S=!1,$=e.prototype,E=$[h]||$["@@iterator"]||y&&$[y],M=E||k(y),T=y?C?k("entries"):M:void 0,P="Array"==t&&$.entries||E;if(P&&((x=u(P.call(new e)))!==Object.prototype&&x.next&&(c(x,I,!0),!i&&"function"!=typeof x[h]&&s(x,h,m))),C&&E&&E.name!==p&&(S=!0,M=function(){return E.call(this)}),(!i||_)&&(d||S||!$[h])&&s($,h,M),a[t]=M,a[I]=m,y)if(b={values:C?M:k(p),keys:v?M:k(f),entries:T},_)for(w in b)w in $||r($,w,b[w]);else o(o.P+o.F*(d||S),t,b);return b}},function(e,t,n){var i=n(76);e.exports=function(e,t,n){return i(e),void 0===t?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,i){return e.call(t,n,i)}:3===n?function(n,i,o){return e.call(t,n,i,o)}:function(){return e.apply(t,arguments)}}},function(e,t,n){e.exports=!n(10)&&!n(19)(function(){return 7!=Object.defineProperty(n(46)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(14),o=n(8).document,r=i(o)&&i(o.createElement);e.exports=function(e){return r?o.createElement(e):{}}},function(e,t,n){e.exports=n(13)},function(e,t,n){var i=n(11),o=n(15),r=n(80)(!1),s=n(32)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),l=0,c=[];for(n in a)n!=s&&i(a,n)&&c.push(n);for(;t.length>l;)i(a,n=t[l++])&&(~r(c,n)||c.push(n));return c}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var i=n(11),o=n(36),r=n(32)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),i(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var i=n(48),o=n(34).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},function(e,t,n){var i=n(39),o=n(22),r=n(15),s=n(29),a=n(11),l=n(45),c=Object.getOwnPropertyDescriptor;t.f=n(10)?c:function(e,t){if(e=r(e),t=s(t,!0),l)try{return c(e,t)}catch(t){}return a(e,t)?o(!i.f.call(e,t),e[t]):void 0}},function(e,t,n){var i=n(12),o=n(6),r=n(19);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),i(i.S+i.F*r(function(){n(1)}),"Object",s)}},function(e,t,n){e.exports={default:n(107),__esModule:!0}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n){(0,o.default)(this,e),this._reactComponent=null,this._originalComponentWillUpdate=null,this._container=t,this._initialState=n,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}return(0,r.default)(e,[{key:"_render",value:function(){this._reactComponent=ReactDOM.render(this._getReactComponent(),this._container.getElement()[0]),this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this),this._container.getState()&&this._reactComponent.setState(this._container.getState())}},{key:"_destroy",value:function(){ReactDOM.unmountComponentAtNode(this._container.getElement()[0]),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}},{key:"_onUpdate",value:function(e,t){this._container.setState(t),this._originalComponentWillUpdate.call(this._reactComponent,e,t)}},{key:"_getReactClass",value:function(){var e,t=this._container._config.component;if(!t)throw new Error("No react component name. type: react-component needs a field `component`");if(!(e=this._container.layoutManager.getComponent(t)))throw new Error('React component "'+t+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return e}},{key:"_getReactComponent",value:function(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container},t=$.extend(e,this._container._config.props);return React.createElement(this._reactClass,t)}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=n(7),u=i(c),h=n(2),d=function(e){function t(e){(0,r.default)(this,t);var n=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return n._layoutManager=e,n._dontPropagateToParent=null,n._childEventSource=null,n.on(c.ALL_EVENT,(0,h.fnBind)(n._onEventFromThis,n)),n._boundOnEventFromChild=(0,h.fnBind)(n._onEventFromChild,n),$(window).on("gl_child_event",n._boundOnEventFromChild),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"_onEventFromThis",value:function(){var e=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&e[0]!==this._dontPropagateToParent&&this._propagateToParent(e),this._propagateToChildren(e),this._dontPropagateToParent=null,this._childEventSource=null}},{key:"_$onEventFromParent",value:function(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}},{key:"_onEventFromChild",value:function(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}},{key:"_propagateToParent",value:function(e){var t,n="gl_child_event";document.createEvent?(t=window.opener.document.createEvent("HTMLEvents")).initEvent(n,!0,!0):(t=window.opener.document.createEventObject()).eventType=n,t.eventName=n,t.__glArgs=e,t.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(t):window.opener.fireEvent("on"+t.eventType,t)}},{key:"_propagateToChildren",value:function(e){var t,n;for(n=0;n<this._layoutManager.openPopouts.length;n++)(t=this._layoutManager.openPopouts[n].getGlInstance())&&t!==this._childEventSource&&t.eventHub._$onEventFromParent(e)}},{key:"destroy",value:function(){$(window).off("gl_child_event",this._boundOnEventFromChild)}}]),t}(u.default);t.default=d},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n){(0,o.default)(this,e),this.name=t,this.origin=n,this.isPropagationStopped=!1}return(0,r.default)(e,[{key:"stopPropagation",value:function(){this.isPropagationStopped=!0}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(4)),a=i(n(5)),l=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,s.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.name="Configuration Error",i.message=e,i.node=n,i}return(0,a.default)(t,e),t}(Error);t.default=l,l.prototype=new Error},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=i(n(61)),h=i(n(63)),d=n(2),f=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.layoutManager=e,i.element=$('<div class="lm_header"><ul class="lm_tabs"></ul><ul class="lm_controls"></ul><ul class="lm_tabdropdown_list"></ul></div>'),!0===i.layoutManager.config.settings.selectionEnabled&&(i.element.addClass("lm_selectable"),i.element.on("click touchstart",(0,d.fnBind)(i._onHeaderClick,i))),i.tabsContainer=i.element.find(".lm_tabs"),i.tabDropdownContainer=i.element.find(".lm_tabdropdown_list"),i.tabDropdownContainer.hide(),i.controlsContainer=i.element.find(".lm_controls"),i.parent=n,i.parent.on("resize",i._updateTabSizes,i),i.tabs=[],i.activeContentItem=null,i.closeButton=null,i.dockButton=null,i.tabDropdownButton=null,i.hideAdditionalTabsDropdown=(0,d.fnBind)(i._hideAdditionalTabsDropdown,i),$(document).mouseup(i.hideAdditionalTabsDropdown),i._lastVisibleTabIndex=-1,i._tabControlOffset=i.layoutManager.config.settings.tabControlOffset,i._createControls(),i}return(0,l.default)(t,e),(0,s.default)(t,[{key:"createTab",value:function(e,t){var n,i;for(i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===e)return;return n=new u.default(this,e),0===this.tabs.length?(this.tabs.push(n),void this.tabsContainer.append(n.element)):(void 0===t&&(t=this.tabs.length),0<t?this.tabs[t-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(t,0,n),void this._updateTabSizes())}},{key:"removeTab",value:function(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e)return this.tabs[t]._$destroy(),void this.tabs.splice(t,1);throw new Error("contentItem is not controlled by this header")}},{key:"setActiveContentItem",value:function(e){var t,n,i,o;for(t=0;t<this.tabs.length;t++)i=this.tabs[t].contentItem===e,this.tabs[t].setActive(i),!0===i&&(this.activeContentItem=e,this.parent.config.activeItemIndex=t);if(this.layoutManager.config.settings.reorderOnTabMenuClick&&-1!==this._lastVisibleTabIndex&&this.parent.config.activeItemIndex>this._lastVisibleTabIndex){for(o=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;0<n;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=o,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}},{key:"position",value:function(e){var t=this.parent._header.show;if(this.parent._docker&&this.parent._docker.docked)throw new Error("Can't change header position in docked stack");return t&&!this.parent._side&&(t="top"),void 0!==e&&this.parent._header.show!=e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}},{key:"_$setClosable",value:function(e){return this._canDestroy=e||1<this.tabs.length,this.closeButton&&this._isClosable()&&(this.closeButton.element[e?"show":"hide"](),!0)}},{key:"_setDockable",value:function(e){return this.dockButton&&this.parent._header&&this.parent._header.dock&&(this.dockButton.element.toggle(!!e),!0)}},{key:"_$destroy",value:function(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();$(document).off("mouseup",this.hideAdditionalTabsDropdown),this.element.remove()}},{key:"_getHeaderSetting",value:function(e){if(e in this.parent._header)return this.parent._header[e]}},{key:"_createControls",value:function(){var e,t,n,i,o,r,s,a,l;if(l=(0,d.fnBind)(this._showAdditionalTabsDropdown,this),a=this.layoutManager.config.labels.tabDropdown,this.tabDropdownButton=new h.default(this,a,"lm_tabdropdown",l),this.tabDropdownButton.element.hide(),this.parent._header&&this.parent._header.dock){var c=(0,d.fnBind)(this.parent.dock,this.parent);n=this._getHeaderSetting("dock"),this.dockButton=new h.default(this,n,"lm_dock",c)}this._getHeaderSetting("popout")&&(t=(0,d.fnBind)(this._onPopoutClick,this),n=this._getHeaderSetting("popout"),new h.default(this,n,"lm_popout",t)),this._getHeaderSetting("maximise")&&(r=(0,d.fnBind)(this.parent.toggleMaximise,this.parent),i=this._getHeaderSetting("maximise"),o=this._getHeaderSetting("minimise"),s=new h.default(this,i,"lm_maximise",r),this.parent.on("maximised",function(){s.element.attr("title",o)}),this.parent.on("minimised",function(){s.element.attr("title",i)})),this._isClosable()&&(e=(0,d.fnBind)(this.parent.remove,this.parent),n=this._getHeaderSetting("close"),this.closeButton=new h.default(this,n,"lm_close",e))}},{key:"_showAdditionalTabsDropdown",value:function(){this.tabDropdownContainer.show()}},{key:"_hideAdditionalTabsDropdown",value:function(){this.tabDropdownContainer.hide()}},{key:"_isClosable",value:function(){return this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon}},{key:"_onPopoutClick",value:function(){!0===this.layoutManager.config.settings.popoutWholeStack?this.parent.popout():this.activeContentItem.popout()}},{key:"_onHeaderClick",value:function(e){e.target===this.element[0]&&this.parent.select()}},{key:"_updateTabSizes",value:function(e){if(0!==this.tabs.length){this.tabDropdownButton.element.toggle(!0===e);var t=function(e){return e?"width":"height"};this.element.css(t(!this.parent._sided),""),this.element[t(this.parent._sided)](this.layoutManager.config.dimensions.headerHeight);var n,i,o,r,s=this.element.outerWidth()-this.controlsContainer.outerWidth()-this._tabControlOffset,a=0,l=0,c=0,u=this.layoutManager.config.settings.tabOverlapAllowance,h=!1,d=this.activeContentItem?this.tabs.indexOf(this.activeContentItem.tab):0,f=this.tabs[d];for(this.parent._sided&&(s=this.element.outerHeight()-this.controlsContainer.outerHeight()-this._tabControlOffset),this._lastVisibleTabIndex=-1,i=0;i<this.tabs.length;i++)if(n=this.tabs[i].element,this.tabsContainer.append(n),a+=n.outerWidth()+parseInt(n.css("margin-right"),10),(l=d<=i?a:a+f.element.outerWidth()+parseInt(f.element.css("margin-right"),10))>s){if(h)i===d&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((c=0<d&&d<=i?(l-s)/(i-1):(l-s)/i)<u){for(o=0;o<=i;o++)r=o!==d&&0!==o?"-"+c+"px":"",this.tabs[o].element.css({"z-index":i-o,"margin-left":r});this._lastVisibleTabIndex=i,this.tabsContainer.append(n)}else h=!0;if(h&&i!==d){if(!e)return void this._updateTabSizes(!0);n.css({"z-index":"auto","margin-left":""}),this.tabDropdownContainer.append(n)}}else this._lastVisibleTabIndex=i,n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n)}}}]),t}(c.default);t.default=f},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=i(n(62)),l=n(2),c=function(){function e(t,n){(0,o.default)(this,e),this.header=t,this.contentItem=n,this.element=$('<li class="lm_tab"><i class="lm_left"></i><span class="lm_title"></span><div class="lm_close_tab"></div><i class="lm_right"></i></li>'),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[n.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(n.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===n.config.reorderEnabled&&(this._dragListener=new s.default(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=(0,l.fnBind)(this._onTabClick,this),this._onCloseClickFn=(0,l.fnBind)(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}return(0,r.default)(e,[{key:"setTitle",value:function(e){this.element.attr("title",(0,l.stripTags)(e)),this.titleElement.html(e)}},{key:"setActive",value:function(e){e===this.isActive||(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}},{key:"_$destroy",value:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()}},{key:"_onDragStart",value:function(e,t){return this.header._canDestroy?(!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),void new a.default(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)):null}},{key:"_onTabClick",value:function(e){if(0===e.button||"touchstart"===e.type){var t=this.header.parent.getActiveContentItem();this.contentItem!==t&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===e.button&&this.contentItem.config.isClosable&&this._onCloseClick(e)}},{key:"_onCloseClick",value:function(e){e.stopPropagation(),this.header._canDestroy&&this.header.parent.removeChild(this.contentItem)}},{key:"_onCloseMousedown",value:function(e){e.stopPropagation()}}]),e}();t.default=c},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=n(2),h=function(e){function t(e,n,i,s,l,c){(0,r.default)(this,t);var h=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));h._dragListener=i,h._layoutManager=s,h._contentItem=l,h._originalParent=c,h._area=null,h._lastValidArea=null,h._dragListener.on("drag",h._onDrag,h),h._dragListener.on("dragStop",h._onDrop,h),h.element=$('<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>'),c&&c._side&&(h._sided=c._sided,h.element.addClass("lm_"+c._side),0<=["right","bottom"].indexOf(c._side)&&h.element.find(".lm_content").after(h.element.find(".lm_header"))),h.element.css({left:e,top:n}),h.element.find(".lm_tab").attr("title",(0,u.stripTags)(h._contentItem.config.title)),h.element.find(".lm_title").html(h._contentItem.config.title),h.childElementContainer=h.element.find(".lm_content"),h.childElementContainer.append(l.element),h._undisplayTree(),h._layoutManager._$calculateItemAreas(),h._setDimensions(),$(document.body).append(h.element);var d=h._layoutManager.container.offset();return h._minX=d.left,h._minY=d.top,h._maxX=h._layoutManager.container.width()+h._minX,h._maxY=h._layoutManager.container.height()+h._minY,h._width=h.element.width(),h._height=h.element.height(),h._setDropPosition(e,n),h}return(0,l.default)(t,e),(0,s.default)(t,[{key:"_onDrag",value:function(e,t,n){var i=(n=(0,u.getTouchEvent)(n)).pageX,o=n.pageY;(i>this._minX&&i<this._maxX&&o>this._minY&&o<this._maxY||!0!==this._layoutManager.config.settings.constrainDragToContainer)&&this._setDropPosition(i,o)}},{key:"_setDropPosition",value:function(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),null!==this._area&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}},{key:"_onDrop",value:function(){this._updateTree(),this._layoutManager.dropTargetIndicator.hide(),null===this._area?null===this._lastValidArea?this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy():this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._area.contentItem._$onDrop(this._contentItem,this._area),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}},{key:"_undisplayTree",value:function(){this._contentItem.parent&&this._contentItem.parent.undisplayChild(this._contentItem)}},{key:"_updateTree",value:function(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(this)}},{key:"_setDimensions",value:function(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}]),t}(c.default);t.default=h},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n,i,r){(0,o.default)(this,e),this._header=t,this.element=$('<li class="'+i+'" title="'+n+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)}return(0,r.default)(e,[{key:"_$destroy",value:function(){this.element.off(),this.element.remove()}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(20)),u=i(n(65)),h=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n,i)),l=e.getComponent(s.config.componentName),c=$.extend(!0,{},s.config.componentState||{});return c.componentName=s.config.componentName,s.componentName=s.config.componentName,""===s.config.title&&(s.config.title=s.config.componentName),s.isComponent=!0,s.container=new u.default(s.config,s,e),s.instance=new l(s.container,c),s.element=s.container._element,s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"close",value:function(){this.parent.removeChild(this)}},{key:"setSize",value:function(){"none"!==this.element.css("display")&&this.container._$setSize(this.element.width(),this.element.height())}},{key:"_$init",value:function(){c.default.prototype._$init.call(this),this.container.emit("open")}},{key:"_$hide",value:function(){this.container.hide(),c.default.prototype._$hide.call(this)}},{key:"_$show",value:function(){this.container.show(),c.default.prototype._$show.call(this)}},{key:"_$shown",value:function(){this.container.shown(),c.default.prototype._$shown.call(this)}},{key:"_$destroy",value:function(){this.container.emit("destroy",this),c.default.prototype._$destroy.call(this)}},{key:"_$getArea",value:function(){return null}}]),t}(c.default);t.default=h},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return s.width=null,s.height=null,s.title=e.componentName,s.parent=n,s.layoutManager=i,s.isHidden=!1,s._config=e,s._element=$('<div class="lm_item_container"><div class="lm_content"></div></div>'),s._contentElement=s._element.find(".lm_content"),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"getElement",value:function(){return this._contentElement}},{key:"hide",value:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()}},{key:"show",value:function(){this.emit("show"),this.isHidden=!1,this._element.show(),(0!=this.height||0!=this.width)&&this.emit("shown")}},{key:"setSize",value:function(e,t){for(var n,i,o,r,s=this.parent,a=this;!s.isColumn&&!s.isRow;)if(a=s,(s=s.parent).isRoot)return!1;for(n=("height"===(i=s.isColumn?"height":"width")?t:e)/(this[i]*(1/(a.config[i]/100)))*100,o=(a.config[i]-n)/(s.contentItems.length-1),r=0;r<s.contentItems.length;r++)s.contentItems[r]===a?s.contentItems[r].config[i]=n:s.contentItems[r].config[i]+=o;return s.callDownwards("setSize"),!0}},{key:"close",value:function(){this._config.isClosable&&(this.emit("close"),this.parent.close())}},{key:"getState",value:function(){return this._config.componentState}},{key:"extendState",value:function(e){this.setState($.extend(!0,this.getState(),e))}},{key:"setState",value:function(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}},{key:"setTitle",value:function(e){this.parent.setTitle(e)}},{key:"_$setSize",value:function(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,$.zepto?this._contentElement.width(e):this._contentElement.outerWidth(e),$.zepto?this._contentElement.height(t):this._contentElement.outerHeight(t),this.emit("resize"))}}]),t}(i(n(7)).default);t.default=c},function(e,n,i){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(i(114)),s=o(i(3)),a=o(i(0)),l=o(i(1)),c=o(i(4)),u=o(i(5)),h=o(i(7)),d=o(i(40)),f=i(2),p=function(e){function n(e,t,i,o,r){(0,a.default)(this,n);var l=(0,c.default)(this,(n.__proto__||(0,s.default)(n)).call(this));return l.isInitialised=!1,l._config=e,l._dimensions=t,l._parentId=i,l._indexInParent=o,l._layoutManager=r,l._popoutWindow=null,l._id=null,l._createWindow(),l}return(0,u.default)(n,e),(0,l.default)(n,[{key:"toConfig",value:function(){if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:this.getGlInstance().width,height:this.getGlInstance().height,left:this._popoutWindow.screenX||this._popoutWindow.screenLeft,top:this._popoutWindow.screenY||this._popoutWindow.screenTop},content:this.getGlInstance().toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}},{key:"getGlInstance",value:function(){return this._popoutWindow.__glInstance}},{key:"getWindow",value:function(){return this._popoutWindow}},{key:"close",value:function(){if(this.getGlInstance())this.getGlInstance()._$closeWindow();else try{this.getWindow().close()}catch(e){}}},{key:"popIn",value:function(){var e,t;this._indexInParent;this._parentId&&(e=$.extend(!0,{},this.getGlInstance().toConfig()).content[0],!(t=this._layoutManager.root.getItemsById(this._parentId)[0])&&(t=0<this._layoutManager.root.contentItems.length?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),t.addChild(e,this._indexInParent),this.close()}},{key:"_createWindow",value:function(){var e,n=this._createUrl(),i=t(1e6*Math.random()).toString(36),o=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(n,i,o),this._popoutWindow)$(this._popoutWindow).on("load",(0,f.fnBind)(this._positionWindow,this)).on("unload beforeunload",(0,f.fnBind)(this._onClose,this)),e=setInterval((0,f.fnBind)(function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(e))},this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}}},{key:"_serializeWindowOptions",value:function(e){var t,n=[];for(t in e)n.push(t+"="+e[t]);return n.join(",")}},{key:"_createUrl",value:function(){var e,t={content:this._config},n="gl-window-config-"+(0,f.getUniqueId)();t=(new d.default).minifyConfig(t);try{localStorage.setItem(n,(0,r.default)(t))}catch(n){throw new Error("Error while writing to localStorage "+n.toString())}return 1===(e=document.location.href.split("?")).length?e[0]+"?gl-window="+n:document.location.href+"&gl-window="+n}},{key:"_positionWindow",value:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()}},{key:"_onInitialised",value:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")}},{key:"_onClose",value:function(){setTimeout((0,f.fnBind)(this.emit,this,["closed"]),50)}}]),n}(h.default);n.default=p},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=n(68),o=(n.n(i),n(69)),r=(n.n(o),n(70)),s=(n.n(r),n(71)),a=n.n(s);n.d(t,"default",function(){return a.a});var l=n(65),c=n.n(l);n.d(t,"ItemContainer",function(){return c.a});var u=n(66),h=n.n(u);n.d(t,"BrowserPopout",function(){return h.a});var d=n(60),f=n.n(d);n.d(t,"Header",function(){return f.a});var p=n(63),m=n.n(p);n.d(t,"HeaderButton",function(){return m.a});var g=n(61),y=n.n(g);n.d(t,"Tab",function(){return y.a});var v=n(64),_=n.n(v);n.d(t,"Component",function(){return _.a});var b=n(41),w=n.n(b);n.d(t,"Root",function(){return w.a});var x=n(25),k=n.n(x);n.d(t,"RowOrColumn",function(){return k.a});var I=n(42),C=n.n(I);n.d(t,"Stack",function(){return C.a});var S=n(58),$=n.n(S);n.d(t,"BubblingEvent",function(){return $.a});var E=n(40),M=n.n(E);n.d(t,"ConfigMinifier",function(){return M.a});var T=n(26),P=n.n(T);n.d(t,"DragListener",function(){return P.a});var D=n(7),j=n.n(D);n.d(t,"EventEmitter",function(){return j.a});var A=n(57),O=n.n(A);n.d(t,"EventHub",function(){return O.a});var z=n(56),N=n.n(z);n.d(t,"ReactComponentHandler",function(){return N.a}),n(120),n(123)},function(){},function(){},function(){},function(e,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(17)),a=r(o(3)),l=r(o(0)),c=r(o(1)),u=r(o(4)),h=r(o(5)),d=r(o(7)),f=r(o(56)),p=r(o(40)),m=r(o(57)),g=r(o(41)),y=r(o(25)),v=r(o(42)),_=r(o(64)),b=r(o(20)),w=r(o(66)),x=r(o(116)),k=r(o(117)),I=r(o(118)),C=r(o(59)),S=r(o(119)),E=o(2),M=function(e){function i(e,t){if((0,l.default)(this,i),!$){var n="jQuery is missing as dependency for GoldenLayout. ";throw n+='Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to ',n+="your paths when using RequireJS/AMD",new Error(n)}var o=(0,u.default)(this,(i.__proto__||(0,a.default)(i)).call(this));return o.isInitialised=!1,o._isFullPage=!1,o._resizeTimeoutId=null,o._components={"lm-react-component":f.default},o._itemAreas=[],o._resizeFunction=(0,E.fnBind)(o._onResize,o),o._unloadFunction=(0,E.fnBind)(o._onUnload,o),o._maximisedItem=null,o._maximisePlaceholder=$('<div class="lm_maximise_place"></div>'),o._creationTimeoutPassed=!1,o._subWindowsCreated=!1,o._dragSources=[],o._updatingColumnsResponsive=!1,o._firstLoad=!0,o.width=null,o.height=null,o.root=null,o.openPopouts=[],o.selectedItem=null,o.isSubWindow=!1,o.eventHub=new m.default(o),o.config=o._createConfig(e),o.container=t,o.dropTargetIndicator=null,o.transitionIndicator=null,o.tabDropPlaceholder=$('<div class="lm_drop_tab_placeholder"></div>'),!0===o.isSubWindow&&$("body").css("visibility","hidden"),o._typeToItem={column:(0,E.fnBind)(y.default,o,[!0]),row:(0,E.fnBind)(y.default,o,[!1]),stack:v.default,component:_.default},o}return(0,h.default)(i,e),(0,c.default)(i,[{key:"minifyConfig",value:function(e){return(new p.default).minifyConfig(e)}},{key:"unminifyConfig",value:function(e){return(new p.default).unminifyConfig(e)}},{key:"registerComponent",value:function(e,t){if("function"!=typeof t)throw new Error("Please register a constructor function");if(void 0!==this._components[e])throw new Error("Component "+e+" is already registered");this._components[e]=t}},{key:"toConfig",value:function(e){var t,n,i;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof b.default))throw new Error("Root must be a ContentItem");for((t={settings:(0,E.copy)({},this.config.settings),dimensions:(0,E.copy)({},this.config.dimensions),labels:(0,E.copy)({},this.config.labels)}).content=[],(n=function(e,t){var i,o;for(i in t.config)"content"!==i&&(e[i]=t.config[i]);if(t.contentItems.length)for(e.content=[],o=0;o<t.contentItems.length;o++)e.content[o]={},n(e.content[o],t.contentItems[o])})(t,e?{contentItems:[e]}:this.root),this._$reconcilePopoutWindows(),t.openPopouts=[],i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":null,t}},{key:"getComponent",value:function(e){if(void 0===this._components[e])throw new C.default('Unknown component "'+e+'"');return this._components[e]}},{key:"init",value:function(){return!1===this._subWindowsCreated&&(this._createSubWindows(),this._subWindowsCreated=!0),"loading"===document.readyState||null===document.body?void $(document).ready((0,E.fnBind)(this.init,this)):!0===this.isSubWindow&&!1===this._creationTimeoutPassed?(setTimeout((0,E.fnBind)(this.init,this),7),void(this._creationTimeoutPassed=!0)):(!0===this.isSubWindow&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new k.default(this.container),this.transitionIndicator=new I.default,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),void this.emit("initialised"))}},{key:"updateSize",value:function(e,t){2===arguments.length?(this.width=e,this.height=t):(this.width=this.container.width(),this.height=this.container.height()),!0===this.isInitialised&&(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem&&(this._maximisedItem.element.width(this.container.width()),this._maximisedItem.element.height(this.container.height()),this._maximisedItem.callDownwards("setSize")),this._adjustColumnsResponsive())}},{key:"destroy",value:function(){!1===this.isInitialised||(this._onUnload(),$(window).off("resize",this._resizeFunction),$(window).off("unload beforeunload",this._unloadFunction),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),this.dropTargetIndicator.destroy(),this.transitionIndicator.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(e){e._dragListener.destroy(),e._element=null,e._itemConfig=null,e._dragListener=null}),this._dragSources=[])}},{key:"createContentItem",value:function(e,t){var n;if("string"!=typeof e.type)throw new C.default("Missing parameter 'type'",e);if("react-component"===e.type&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw n="Unknown type '"+e.type+"'. Valid types are "+(0,E.objectKeys)(this._typeToItem).join(","),new C.default(n);return"component"!==e.type||t instanceof v.default||!t||!0===this.isSubWindow&&t instanceof g.default||(e={type:"stack",width:e.width,height:e.height,content:[e]}),new this._typeToItem[e.type](this,e,t)}},{key:"createPopout",value:function(e,t,n,i){var o,r,s,a,l,c,u=e,h=e instanceof b.default,d=this;if(n=n||null,h){for(u=this.toConfig(e).content,n=(0,E.getUniqueId)(),a=e.parent,l=e;1===a.contentItems.length&&!a.isRoot;)a=a.parent,l=l.parent;a.addId(n),isNaN(i)&&(i=(0,E.indexOf)(l,a.contentItems))}else u instanceof Array||(u=[u]);return!t&&h&&(o=window.screenX||window.screenLeft,r=window.screenY||window.screenTop,t={left:o+(s=e.element.offset()).left,top:r+s.top,width:e.element.width(),height:e.element.height()}),t||h||(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),h&&e.remove(),(c=new w.default(u,t,n,i,this)).on("initialised",function(){d.emit("windowOpened",c)}),c.on("closed",function(){d._$reconcilePopoutWindows()}),this.openPopouts.push(c),c}},{key:"createDragSource",value:function(e,t){this.config.settings.constrainDragToContainer=!1;var n=new x.default($(e),t,this);return this._dragSources.push(n),n}},{key:"selectItem",value:function(e,t){if(!0!==this.config.settings.selectionEnabled)throw new Error("Please set selectionEnabled to true to use this feature");e===this.selectedItem||(null!==this.selectedItem&&this.selectedItem.deselect(),e&&!0!==t&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}},{key:"_$maximiseItem",value:function(e){null!==this._maximisedItem&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width(this.container.width()),e.element.height(this.container.height()),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}},{key:"_$minimiseItem",value:function(e){e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),e.parent.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}},{key:"_$closeWindow",value:function(){window.setTimeout(function(){window.close()},1)}},{key:"_$getArea",value:function(e,t){var n,i,o=1/0,r=null;for(n=0;n<this._itemAreas.length;n++)e>(i=this._itemAreas[n]).x1&&e<i.x2&&t>i.y1&&t<i.y2&&o>i.surface&&(o=i.surface,r=i);return r}},{key:"_$createRootItemAreas",value:function(){var e={y2:0,x2:0,y1:"y2",x1:"x2"};for(var t in e){var n=this.root._$getArea();n.side=t,n[t]=e[t]?n[e[t]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}}},{key:"_$calculateItemAreas",value:function(){var e,t,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),e=0;e<n.length;e++)if(n[e].isStack){if(null===(t=n[e]._$getArea()))continue;if(t instanceof Array)this._itemAreas=this._itemAreas.concat(t);else{this._itemAreas.push(t);var i={};(0,E.copy)(i,t),(0,E.copy)(i,t.contentItem._contentAreaDimensions.header.highlightArea),i.surface=(i.x2-i.x1)*(i.y2-i.y1),this._itemAreas.push(i)}}}else this._itemAreas.push(this.root._$getArea())}},{key:"_$normalizeContentItem",value:function(e,t){if(!e)throw new Error("No content item defined");if((0,E.isFunction)(e)&&(e=e()),e instanceof b.default)return e;if($.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t);return n.callDownwards("_$init"),n}throw new Error("Invalid contentItem")}},{key:"_$reconcilePopoutWindows",value:function(){var e,t=[];for(e=0;e<this.openPopouts.length;e++)!1===this.openPopouts[e].getWindow().closed?t.push(this.openPopouts[e]):this.emit("windowClosed",this.openPopouts[e]);this.openPopouts.length!==t.length&&(this.emit("stateChanged"),this.openPopouts=t)}},{key:"_getAllContentItems",value:function(){var e=[];return function t(n){if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])}(this.root),e}},{key:"_bindEvents",value:function(){this._isFullPage&&$(window).resize(this._resizeFunction),$(window).on("unload beforeunload",this._unloadFunction)}},{key:"_onResize",value:function(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=setTimeout((0,E.fnBind)(this.updateSize,this),100)}},{key:"_createConfig",value:function(e){var t=(0,E.getQueryStringParam)("gl-window");return t&&(this.isSubWindow=!0,e=localStorage.getItem(t),e=JSON.parse(e),e=(new p.default).unminifyConfig(e),localStorage.removeItem(t)),function e(t){for(var n in t)"props"!=n&&"object"===(0,s.default)(t[n])?e(t[n]):"type"==n&&"react-component"===t[n]&&(t.type="component",t.componentName="lm-react-component")}(e=$.extend(!0,{},S.default,e)),!1===e.settings.hasHeaders&&(e.dimensions.headerHeight=0),e}},{key:"_adjustToWindowMode",value:function(){var e=$('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');e.click((0,E.fnBind)(function(){this.emit("popIn")},this)),document.title=(0,E.stripTags)(this.config.content[0].title),$("head").append($("body link, body style, template, .gl_keep")),this.container=$("body").html("").css("visibility","visible").append(e),document.body.offsetHeight,window.__glInstance=this}},{key:"_createSubWindows",value:function(){var e,t;for(e=0;e<this.config.openPopouts.length;e++)t=this.config.openPopouts[e],this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}},{key:"_setContainer",value:function(){var e=$(this.container||"body");if(0===e.length)throw new Error("GoldenLayout container not found");if(1<e.length)throw new Error("GoldenLayout more than one container element specified");e[0]===document.body&&(this._isFullPage=!0,$("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}},{key:"_create",value:function(e){var t;if(!(e.content instanceof Array))throw t=void 0===e.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new C.default(t,e);if(1<e.content.length)throw t="Top level content can't contain more then one element.",new C.default(t,e);this.root=new g.default(this,{content:e.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===e.maximisedItemId&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}},{key:"_onUnload",value:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}},{key:"_adjustColumnsResponsive",value:function(){if(this._useResponsiveLayout()&&!this._updatingColumnsResponsive&&this.config.dimensions&&this.config.dimensions.minItemWidth&&0!==this.root.contentItems.length&&this.root.contentItems[0].isRow){this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(1>=e)){var i=this.config.dimensions.minItemWidth;if(!(e*i<=this.width)){this._updatingColumnsResponsive=!0;for(var o,r=n(t(this.width/i),1),s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<e-r;l++)o=s.contentItems[s.contentItems.length-1],this._addChildContentItemsToContainer(a,o);this._updatingColumnsResponsive=!1}}}else this._firstLoad=!1}},{key:"_useResponsiveLayout",value:function(){return this.config.settings&&("always"==this.config.settings.responsiveMode||"onload"==this.config.settings.responsiveMode&&this._firstLoad)}},{key:"_addChildContentItemsToContainer",value:function(e,t){"stack"===t.type?t.contentItems.forEach(function(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach((0,E.fnBind)(function(t){this._addChildContentItemsToContainer(e,t)},this))}},{key:"_findAllStackContainers",value:function(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}},{key:"_findAllStackContainersRecursive",value:function(e,t){t.contentItems.forEach((0,E.fnBind)(function(t){"stack"==t.type?e.push(t):!t.isComponent&&this._findAllStackContainersRecursive(e,t)},this))}}]),i}(d.default);i.default=M},function(e,t,n){e.exports={default:n(73),__esModule:!0}},function(e,t,n){n(74),n(84),e.exports=n(37).f("iterator")},function(e,t,n){var i=n(75)(!0);n(43)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var i=n(27),o=n(28);e.exports=function(e){return function(t,n){var r,s,a=o(t)+"",l=i(n),c=a.length;return 0>l||l>=c?e?"":void 0:55296>(r=a.charCodeAt(l))||56319<r||l+1===c||56320>(s=a.charCodeAt(l+1))||57343<s?e?a.charAt(l):r:e?a.slice(l,l+2):s-56320+(r-55296<<10)+65536}}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(31),o=n(22),r=n(35),s={};n(13)(s,n(16)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(s,{next:o(1,n)}),r(e,t+" Iterator")}},function(e,t,n){var i=n(9),o=n(18),r=n(23);e.exports=n(10)?Object.defineProperties:function(e,t){o(e);for(var n,s=r(t),a=s.length,l=0;a>l;)i.f(e,n=s[l++],t[n]);return e}},function(e,t,n){var i=n(49);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(15),o=n(81),r=n(82);e.exports=function(e){return function(t,n,s){var a,l=i(t),c=o(l.length),u=r(s,c);if(e&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(t,n,i){var o=i(27);t.exports=function(t){return 0<t?e(o(t),9007199254740991):0}},function(t,i,o){var r=o(27);t.exports=function(t,i){return 0>(t=r(t))?n(t+i,0):e(t,i)}},function(e,t,n){var i=n(8).document;e.exports=i&&i.documentElement},function(e,t,n){n(85);for(var i=n(8),o=n(13),r=n(30),s=n(16)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var c=a[l],u=i[c],h=u&&u.prototype;h&&!h[s]&&o(h,s,c),r[c]=r.Array}},function(e,t,n){var i=n(86),o=n(87),r=n(30),s=n(15);e.exports=n(43)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(e){e.exports=function(){}},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(89),__esModule:!0}},function(e,t,n){n(90),n(95),n(96),n(97),e.exports=n(6).Symbol},function(e,t,n){var i=n(8),o=n(11),r=n(10),a=n(12),l=n(47),c=n(91).KEY,u=n(19),h=n(33),d=n(35),f=n(24),p=n(16),m=n(37),g=n(38),y=n(92),v=n(93),_=n(18),b=n(14),w=n(15),x=n(29),k=n(22),I=n(31),C=n(94),S=n(53),$=n(9),E=n(23),M=S.f,T=$.f,P=C.f,D=i.Symbol,j=i.JSON,A=j&&j.stringify,O="prototype",z=p("_hidden"),N=p("toPrimitive"),L={}.propertyIsEnumerable,F=h("symbol-registry"),B=h("symbols"),R=h("op-symbols"),W=Object[O],H="function"==typeof D,Z=i.QObject,G=!Z||!Z[O]||!Z[O].findChild,q=r&&u(function(){return 7!=I(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=M(W,t);i&&delete W[t],T(e,t,n),i&&e!==W&&T(W,t,i)}:T,V=function(e){var t=B[e]=I(D[O]);return t._k=e,t},U=H&&"symbol"==s(D.iterator)?function(e){return"symbol"==(void 0===e?"undefined":s(e))}:function(e){return e instanceof D},X=function e(t,n,i){return t===W&&e(R,n,i),_(t),n=x(n,!0),_(i),o(B,n)?(i.enumerable?(o(t,z)&&t[z][n]&&(t[z][n]=!1),i=I(i,{enumerable:k(0,!1)})):(!o(t,z)&&T(t,z,k(1,{})),t[z][n]=!0),q(t,n,i)):T(t,n,i)},Y=function(e,t){_(e);for(var n,i=y(t=w(t)),o=0,r=i.length;r>o;)X(e,n=i[o++],t[n]);return e},J=function(e){var t=L.call(this,e=x(e,!0));return!(this===W&&o(B,e)&&!o(R,e))&&(!(t||!o(this,e)||!o(B,e)||o(this,z)&&this[z][e])||t)},Q=function(e,t){if(e=w(e),t=x(t,!0),e!==W||!o(B,t)||o(R,t)){var n=M(e,t);return n&&o(B,t)&&!(o(e,z)&&e[z][t])&&(n.enumerable=!0),n}},K=function(e){for(var t,n=P(w(e)),i=[],r=0;n.length>r;)o(B,t=n[r++])||t==z||t==c||i.push(t);return i},ee=function(e){for(var t,n=e===W,i=P(n?R:w(e)),r=[],s=0;i.length>s;)o(B,t=i[s++])&&(!n||o(W,t))&&r.push(B[t]);return r};H||(l((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var e=f(0<arguments.length?arguments[0]:void 0);return r&&G&&q(W,e,{configurable:!0,set:function t(n){this===W&&t.call(R,n),o(this,z)&&o(this[z],e)&&(this[z][e]=!1),q(this,e,k(1,n))}}),V(e)})[O],"toString",function(){return this._k}),S.f=Q,$.f=X,n(52).f=C.f=K,n(39).f=J,n(51).f=ee,r&&!n(21)&&l(W,"propertyIsEnumerable",J,!0),m.f=function(e){return V(p(e))}),a(a.G+a.W+a.F*!H,{Symbol:D});for(var te=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],ne=0;te.length>ne;)p(te[ne++]);for(var ie=E(p.store),oe=0;ie.length>oe;)g(ie[oe++]);a(a.S+a.F*!H,"Symbol",{for:function(e){return o(F,e+="")?F[e]:F[e]=D(e)},keyFor:function(e){if(!U(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){G=!0},useSimple:function(){G=!1}}),a(a.S+a.F*!H,"Object",{create:function(e,t){return void 0===t?I(e):Y(I(e),t)},defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:K,getOwnPropertySymbols:ee}),j&&a(a.S+a.F*(!H||u(function(){var e=D();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t=i[1],(b(t)||void 0!==e)&&!U(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!U(t))return t}),i[1]=t,A.apply(j,i)}}),D[O][N]||n(13)(D[O],N,D[O].valueOf),d(D,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},function(e,t,n){var i=n(24)("meta"),o=n(14),r=n(11),a=n(9).f,l=0,c=Object.isExtensible||function(){return!0},u=!n(19)(function(){return c(Object.preventExtensions({}))}),h=function(e){a(e,i,{value:{i:"O"+ ++l,w:{}}})},d=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==(void 0===e?"undefined":s(e))?e:("string"==typeof e?"S":"P")+e;if(!r(e,i)){if(!c(e))return"F";if(!t)return"E";h(e)}return e[i].i},getWeak:function(e,t){if(!r(e,i)){if(!c(e))return!0;if(!t)return!1;h(e)}return e[i].w},onFreeze:function(e){return u&&d.NEED&&c(e)&&!r(e,i)&&h(e),e}}},function(e,t,n){var i=n(23),o=n(51),r=n(39);e.exports=function(e){var t=i(e),n=o.f;if(n)for(var s,a=n(e),l=r.f,c=0;a.length>c;)l.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,n){var i=n(49);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var i=n(15),o=n(52).f,r={}.toString,a="object"==("undefined"==typeof window?"undefined":s(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(i(e))}},function(){},function(e,t,n){n(38)("asyncIterator")},function(e,t,n){n(38)("observable")},function(e,t,n){n(99),e.exports=n(6).Object.getPrototypeOf},function(e,t,n){var i=n(36),o=n(50);n(54)("getPrototypeOf",function(){return function(e){return o(i(e))}})},function(e,t,n){e.exports={default:n(101),__esModule:!0}},function(e,t,n){n(102);var i=n(6).Object;e.exports=function(e,t,n){return i.defineProperty(e,t,n)}},function(e,t,n){var i=n(12);i(i.S+i.F*!n(10),"Object",{defineProperty:n(9).f})},function(e,t,n){e.exports={default:n(104),__esModule:!0}},function(e,t,n){n(105),e.exports=n(6).Object.setPrototypeOf},function(e,t,n){var i=n(12);i(i.S,"Object",{setPrototypeOf:n(106).set})},function(e,t,n){var i=n(14),o=n(18),r=function(e,t){if(o(e),!i(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,i){try{(i=n(44)(Function.call,n(53).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return r(e,n),t?e.__proto__=n:i(e,n),e}}({},!1):void 0),check:r}},function(e,t,n){n(108);var i=n(6).Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){var i=n(12);i(i.S,"Object",{create:n(31)})},function(e,t,n){e.exports={default:n(110),__esModule:!0}},function(e,t,n){n(111),e.exports=n(6).Object.keys},function(e,t,n){var i=n(36),o=n(23);n(54)("keys",function(){return function(e){return o(i(e))}})},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={isClosable:!0,reorderEnabled:!0,title:""}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=function(){function e(t,n,i){(0,o.default)(this,e),this._isVertical=t,this._size=n,this._grabSize=i<n?n:i,this.element=this._createElement(),this._dragListener=new s.default(this.element)}return(0,r.default)(e,[{key:"on",value:function(e,t,n){this._dragListener.on(e,t,n)}},{key:"_$destroy",value:function(){this.element.remove()}},{key:"_createElement",value:function(){var e=$('<div class="lm_drag_handle"></div>'),t=$('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}]),e}();t.default=a},function(e,t,n){e.exports={default:n(115),__esModule:!0}},function(e,t,n){var i=n(6),o=i.JSON||(i.JSON={stringify:JSON.stringify});e.exports=function(){return o.stringify.apply(o,arguments)}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=i(n(62)),l=n(2),c=function(){function e(t,n,i){(0,o.default)(this,e),this._element=t,this._itemConfig=n,this._layoutManager=i,this._dragListener=null,this._createDragListener()}return(0,r.default)(e,[{key:"_createDragListener",value:function(){null!==this._dragListener&&this._dragListener.destroy(),this._dragListener=new s.default(this._element),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this)}},{key:"_onDragStart",value:function(e,t){var n=this._itemConfig;(0,l.isFunction)(n)&&(n=n());var i=this._layoutManager._$normalizeContentItem($.extend(!0,{},n)),o=new a.default(e,t,this._dragListener,this._layoutManager,i,null);this._layoutManager.transitionIndicator.transitionElements(this._element,o.element)}}]),e}();t.default=c},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(){(0,o.default)(this,e),this.element=$('<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>'),$(document.body).append(this.element)}return(0,r.default)(e,[{key:"destroy",value:function(){this.element.remove()}},{key:"highlight",value:function(e,t,n,i){this.highlightArea({x1:e,y1:t,x2:n,y2:i})}},{key:"highlightArea",value:function(e){this.element.css({left:e.x1,top:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}).show()}},{key:"hide",value:function(){this.element.hide()}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=n(2),a=function(){function e(){(0,o.default)(this,e),this._element=$('<div class="lm_transition_indicator"></div>'),$(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null}return(0,r.default)(e,[{key:"destroy",value:function(){this._element.remove()}},{key:"transitionElements",value:function(){}},{key:"_nextAnimationFrame",value:function(){var e,t=this._measure(this._toElement),n=((0,s.now)()-this._animationStartTime)/this._totalAnimationDuration,i={};if(1<=n)this._element.hide();else{for(e in t.opacity=0,this._fromDimensions)i[e]=this._fromDimensions[e]+(t[e]-this._fromDimensions[e])*n;this._element.css(i),(0,s.animFrame)((0,s.fnBind)(this._nextAnimationFrame,this))}}},{key:"_measure",value:function(e){var t=e.offset();return{left:t.left,top:t.top,width:e.outerWidth(),height:e.outerHeight()}}}]),e}();t.default=a},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,reorderOnTabMenuClick:!0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:15,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"close",maximise:"maximise",minimise:"minimise",popout:"open in new window",popin:"pop in",tabDropdown:"additional tabs"}}},function(e,t,n){n(121)(n(122))},function(e){e.exports=function(e){function t(e){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",e)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(e):"undefined"==typeof eval?t("EvalError: No eval function available"):eval.call(null,e)}catch(e){t(e)}}},function(e){e.exports="/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */\n(function(global, factory) {\n if (typeof define === 'function' && define.amd)\n define(function() { return factory(global) })\n else\n factory(global)\n}(this, function(window) {\n var Zepto = (function() {\n var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n document = window.document,\n elementDisplay = {}, classCache = {},\n cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n rootNodeRE = /^(?:body|html)$/i,\n capitalRE = /([A-Z])/g,\n\n // special attributes that should be get/set via method calls\n methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n table = document.createElement('table'),\n tableRow = document.createElement('tr'),\n containers = {\n 'tr': document.createElement('tbody'),\n 'tbody': table, 'thead': table, 'tfoot': table,\n 'td': tableRow, 'th': tableRow,\n '*': document.createElement('div')\n },\n readyRE = /complete|loaded|interactive/,\n simpleSelectorRE = /^[\\w-]*$/,\n class2type = {},\n toString = class2type.toString,\n zepto = {},\n camelize, uniq,\n tempParent = document.createElement('div'),\n propMap = {\n 'tabindex': 'tabIndex',\n 'readonly': 'readOnly',\n 'for': 'htmlFor',\n 'class': 'className',\n 'maxlength': 'maxLength',\n 'cellspacing': 'cellSpacing',\n 'cellpadding': 'cellPadding',\n 'rowspan': 'rowSpan',\n 'colspan': 'colSpan',\n 'usemap': 'useMap',\n 'frameborder': 'frameBorder',\n 'contenteditable': 'contentEditable'\n },\n isArray = Array.isArray ||\n function(object){ return object instanceof Array }\n\n zepto.matches = function(element, selector) {\n if (!selector || !element || element.nodeType !== 1) return false\n var matchesSelector = element.matches || element.webkitMatchesSelector ||\n element.mozMatchesSelector || element.oMatchesSelector ||\n element.matchesSelector\n if (matchesSelector) return matchesSelector.call(element, selector)\n // fall back to performing a selector:\n var match, parent = element.parentNode, temp = !parent\n if (temp) (parent = tempParent).appendChild(element)\n match = ~zepto.qsa(parent, selector).indexOf(element)\n temp && tempParent.removeChild(element)\n return match\n }\n\n function type(obj) {\n return obj == null ? String(obj) :\n class2type[toString.call(obj)] || \"object\"\n }\n\n function isFunction(value) { return type(value) == \"function\" }\n function isWindow(obj) { return obj != null && obj == obj.window }\n function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n function isObject(obj) { return type(obj) == \"object\" }\n function isPlainObject(obj) {\n return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n }\n\n function likeArray(obj) {\n var length = !!obj && 'length' in obj && obj.length,\n type = $.type(obj)\n\n return 'function' != type && !isWindow(obj) && (\n 'array' == type || length === 0 ||\n (typeof length == 'number' && length > 0 && (length - 1) in obj)\n )\n }\n\n function compact(array) { return filter.call(array, function(item){ return item != null }) }\n function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n function dasherize(str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase()\n }\n uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n function classRE(name) {\n return name in classCache ?\n classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n }\n\n function maybeAddPx(name, value) {\n return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n }\n\n function defaultDisplay(nodeName) {\n var element, display\n if (!elementDisplay[nodeName]) {\n element = document.createElement(nodeName)\n document.body.appendChild(element)\n display = getComputedStyle(element, '').getPropertyValue(\"display\")\n element.parentNode.removeChild(element)\n display == \"none\" && (display = \"block\")\n elementDisplay[nodeName] = display\n }\n return elementDisplay[nodeName]\n }\n\n function children(element) {\n return 'children' in element ?\n slice.call(element.children) :\n $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n }\n\n function Z(dom, selector) {\n var i, len = dom ? dom.length : 0\n for (i = 0; i < len; i++) this[i] = dom[i]\n this.length = len\n this.selector = selector || ''\n }\n\n // `$.zepto.fragment` takes a html string and an optional tag name\n // to generate DOM nodes from the given html string.\n // The generated DOM nodes are returned as an array.\n // This function can be overridden in plugins for example to make\n // it compatible with browsers that don't support the DOM fully.\n zepto.fragment = function(html, name, properties) {\n var dom, nodes, container\n\n // A special case optimization for a single tag\n if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n if (!dom) {\n if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n if (!(name in containers)) name = '*'\n\n container = containers[name]\n container.innerHTML = '' + html\n dom = $.each(slice.call(container.childNodes), function(){\n container.removeChild(this)\n })\n }\n\n if (isPlainObject(properties)) {\n nodes = $(dom)\n $.each(properties, function(key, value) {\n if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n else nodes.attr(key, value)\n })\n }\n\n return dom\n }\n\n // `$.zepto.Z` swaps out the prototype of the given `dom` array\n // of nodes with `$.fn` and thus supplying all the Zepto functions\n // to the array. This method can be overridden in plugins.\n zepto.Z = function(dom, selector) {\n return new Z(dom, selector)\n }\n\n // `$.zepto.isZ` should return `true` if the given object is a Zepto\n // collection. This method can be overridden in plugins.\n zepto.isZ = function(object) {\n return object instanceof zepto.Z\n }\n\n // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n // takes a CSS selector and an optional context (and handles various\n // special cases).\n // This method can be overridden in plugins.\n zepto.init = function(selector, context) {\n var dom\n // If nothing given, return an empty Zepto collection\n if (!selector) return zepto.Z()\n // Optimize for string selectors\n else if (typeof selector == 'string') {\n selector = selector.trim()\n // If it's a html fragment, create nodes from it\n // Note: In both Chrome 21 and Firefox 15, DOM error 12\n // is thrown if the fragment doesn't begin with <\n if (selector[0] == '<' && fragmentRE.test(selector))\n dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // If it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // If a function is given, call it when the DOM is ready\n else if (isFunction(selector)) return $(document).ready(selector)\n // If a Zepto collection is given, just return it\n else if (zepto.isZ(selector)) return selector\n else {\n // normalize array if an array of nodes is given\n if (isArray(selector)) dom = compact(selector)\n // Wrap DOM nodes.\n else if (isObject(selector))\n dom = [selector], selector = null\n // If it's a html fragment, create nodes from it\n else if (fragmentRE.test(selector))\n dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // And last but no least, if it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // create a new Zepto collection from the nodes found\n return zepto.Z(dom, selector)\n }\n\n // `$` will be the base `Zepto` object. When calling this\n // function just call `$.zepto.init, which makes the implementation\n // details of selecting nodes and creating Zepto collections\n // patchable in plugins.\n $ = function(selector, context){\n return zepto.init(selector, context)\n }\n\n function extend(target, source, deep) {\n for (key in source)\n if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n target[key] = {}\n if (isArray(source[key]) && !isArray(target[key]))\n target[key] = []\n extend(target[key], source[key], deep)\n }\n else if (source[key] !== undefined) target[key] = source[key]\n }\n\n // Copy all but undefined properties from one or more\n // objects to the `target` object.\n $.extend = function(target){\n var deep, args = slice.call(arguments, 1)\n if (typeof target == 'boolean') {\n deep = target\n target = args.shift()\n }\n args.forEach(function(arg){ extend(target, arg, deep) })\n return target\n }\n\n // `$.zepto.qsa` is Zepto's CSS selector implementation which\n // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n // This method can be overridden in plugins.\n zepto.qsa = function(element, selector){\n var found,\n maybeID = selector[0] == '#',\n maybeClass = !maybeID && selector[0] == '.',\n nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n isSimple = simpleSelectorRE.test(nameOnly)\n return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n slice.call(\n isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n element.getElementsByTagName(selector) : // Or a tag\n element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n )\n }\n\n function filtered(nodes, selector) {\n return selector == null ? $(nodes) : $(nodes).filter(selector)\n }\n\n $.contains = document.documentElement.contains ?\n function(parent, node) {\n return parent !== node && parent.contains(node)\n } :\n function(parent, node) {\n while (node && (node = node.parentNode))\n if (node === parent) return true\n return false\n }\n\n function funcArg(context, arg, idx, payload) {\n return isFunction(arg) ? arg.call(context, idx, payload) : arg\n }\n\n function setAttribute(node, name, value) {\n value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n }\n\n // access className property while respecting SVGAnimatedString\n function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }\n\n // \"true\" => true\n // \"false\" => false\n // \"null\" => null\n // \"42\" => 42\n // \"42.5\" => 42.5\n // \"08\" => \"08\"\n // JSON => parse if valid\n // String => self\n function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }\n\n $.type = type\n $.isFunction = isFunction\n $.isWindow = isWindow\n $.isArray = isArray\n $.isPlainObject = isPlainObject\n\n $.isEmptyObject = function(obj) {\n var name\n for (name in obj) return false\n return true\n }\n\n $.isNumeric = function(val) {\n var num = Number(val), type = typeof val\n return val != null && type != 'boolean' &&\n (type != 'string' || val.length) &&\n !isNaN(num) && isFinite(num) || false\n }\n\n $.inArray = function(elem, array, i){\n return emptyArray.indexOf.call(array, elem, i)\n }\n\n $.camelCase = camelize\n $.trim = function(str) {\n return str == null ? \"\" : String.prototype.trim.call(str)\n }\n\n // plugin compatibility\n $.uuid = 0\n $.support = { }\n $.expr = { }\n $.noop = function() {}\n\n $.map = function(elements, callback){\n var value, values = [], i, key\n if (likeArray(elements))\n for (i = 0; i < elements.length; i++) {\n value = callback(elements[i], i)\n if (value != null) values.push(value)\n }\n else\n for (key in elements) {\n value = callback(elements[key], key)\n if (value != null) values.push(value)\n }\n return flatten(values)\n }\n\n $.each = function(elements, callback){\n var i, key\n if (likeArray(elements)) {\n for (i = 0; i < elements.length; i++)\n if (callback.call(elements[i], i, elements[i]) === false) return elements\n } else {\n for (key in elements)\n if (callback.call(elements[key], key, elements[key]) === false) return elements\n }\n\n return elements\n }\n\n $.grep = function(elements, callback){\n return filter.call(elements, callback)\n }\n\n if (window.JSON) $.parseJSON = JSON.parse\n\n // Populate the class2type map\n $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n })\n\n // Define methods that will be available on all\n // Zepto collections\n $.fn = {\n constructor: zepto.Z,\n length: 0,\n\n // Because a collection acts like an array\n // copy over these useful array functions.\n forEach: emptyArray.forEach,\n reduce: emptyArray.reduce,\n push: emptyArray.push,\n sort: emptyArray.sort,\n splice: emptyArray.splice,\n indexOf: emptyArray.indexOf,\n concat: function(){\n var i, value, args = []\n for (i = 0; i < arguments.length; i++) {\n value = arguments[i]\n args[i] = zepto.isZ(value) ? value.toArray() : value\n }\n return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n },\n\n // `map` and `slice` in the jQuery API work differently\n // from their array counterparts\n map: function(fn){\n return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n },\n slice: function(){\n return $(slice.apply(this, arguments))\n },\n\n ready: function(callback){\n // need to check if document.body exists for IE as that browser reports\n // document ready when it hasn't yet created the body element\n if (readyRE.test(document.readyState) && document.body) callback($)\n else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n return this\n },\n get: function(idx){\n return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n },\n toArray: function(){ return this.get() },\n size: function(){\n return this.length\n },\n remove: function(){\n return this.each(function(){\n if (this.parentNode != null)\n this.parentNode.removeChild(this)\n })\n },\n each: function(callback){\n emptyArray.every.call(this, function(el, idx){\n return callback.call(el, idx, el) !== false\n })\n return this\n },\n filter: function(selector){\n if (isFunction(selector)) return this.not(this.not(selector))\n return $(filter.call(this, function(element){\n return zepto.matches(element, selector)\n }))\n },\n add: function(selector,context){\n return $(uniq(this.concat($(selector,context))))\n },\n is: function(selector){\n return this.length > 0 && zepto.matches(this[0], selector)\n },\n not: function(selector){\n var nodes=[]\n if (isFunction(selector) && selector.call !== undefined)\n this.each(function(idx){\n if (!selector.call(this,idx)) nodes.push(this)\n })\n else {\n var excludes = typeof selector == 'string' ? this.filter(selector) :\n (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n this.forEach(function(el){\n if (excludes.indexOf(el) < 0) nodes.push(el)\n })\n }\n return $(nodes)\n },\n has: function(selector){\n return this.filter(function(){\n return isObject(selector) ?\n $.contains(this, selector) :\n $(this).find(selector).size()\n })\n },\n eq: function(idx){\n return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n },\n first: function(){\n var el = this[0]\n return el && !isObject(el) ? el : $(el)\n },\n last: function(){\n var el = this[this.length - 1]\n return el && !isObject(el) ? el : $(el)\n },\n find: function(selector){\n var result, $this = this\n if (!selector) result = $()\n else if (typeof selector == 'object')\n result = $(selector).filter(function(){\n var node = this\n return emptyArray.some.call($this, function(parent){\n return $.contains(parent, node)\n })\n })\n else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n else result = this.map(function(){ return zepto.qsa(this, selector) })\n return result\n },\n closest: function(selector, context){\n var nodes = [], collection = typeof selector == 'object' && $(selector)\n this.each(function(_, node){\n while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n node = node !== context && !isDocument(node) && node.parentNode\n if (node && nodes.indexOf(node) < 0) nodes.push(node)\n })\n return $(nodes)\n },\n parents: function(selector){\n var ancestors = [], nodes = this\n while (nodes.length > 0)\n nodes = $.map(nodes, function(node){\n if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n ancestors.push(node)\n return node\n }\n })\n return filtered(ancestors, selector)\n },\n parent: function(selector){\n return filtered(uniq(this.pluck('parentNode')), selector)\n },\n children: function(selector){\n return filtered(this.map(function(){ return children(this) }), selector)\n },\n contents: function() {\n return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n },\n siblings: function(selector){\n return filtered(this.map(function(i, el){\n return filter.call(children(el.parentNode), function(child){ return child!==el })\n }), selector)\n },\n empty: function(){\n return this.each(function(){ this.innerHTML = '' })\n },\n // `pluck` is borrowed from Prototype.js\n pluck: function(property){\n return $.map(this, function(el){ return el[property] })\n },\n show: function(){\n return this.each(function(){\n this.style.display == \"none\" && (this.style.display = '')\n if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n this.style.display = defaultDisplay(this.nodeName)\n })\n },\n replaceWith: function(newContent){\n return this.before(newContent).remove()\n },\n wrap: function(structure){\n var func = isFunction(structure)\n if (this[0] && !func)\n var dom = $(structure).get(0),\n clone = dom.parentNode || this.length > 1\n\n return this.each(function(index){\n $(this).wrapAll(\n func ? structure.call(this, index) :\n clone ? dom.cloneNode(true) : dom\n )\n })\n },\n wrapAll: function(structure){\n if (this[0]) {\n $(this[0]).before(structure = $(structure))\n var children\n // drill down to the inmost element\n while ((children = structure.children()).length) structure = children.first()\n $(structure).append(this)\n }\n return this\n },\n wrapInner: function(structure){\n var func = isFunction(structure)\n return this.each(function(index){\n var self = $(this), contents = self.contents(),\n dom = func ? structure.call(this, index) : structure\n contents.length ? contents.wrapAll(dom) : self.append(dom)\n })\n },\n unwrap: function(){\n this.parent().each(function(){\n $(this).replaceWith($(this).children())\n })\n return this\n },\n clone: function(){\n return this.map(function(){ return this.cloneNode(true) })\n },\n hide: function(){\n return this.css(\"display\", \"none\")\n },\n toggle: function(setting){\n return this.each(function(){\n var el = $(this)\n ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n })\n },\n prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n html: function(html){\n return 0 in arguments ?\n this.each(function(idx){\n var originHtml = this.innerHTML\n $(this).empty().append( funcArg(this, html, idx, originHtml) )\n }) :\n (0 in this ? this[0].innerHTML : null)\n },\n text: function(text){\n return 0 in arguments ?\n this.each(function(idx){\n var newText = funcArg(this, text, idx, this.textContent)\n this.textContent = newText == null ? '' : ''+newText\n }) :\n (0 in this ? this.pluck('textContent').join(\"\") : null)\n },\n attr: function(name, value){\n var result\n return (typeof name == 'string' && !(1 in arguments)) ?\n (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n this.each(function(idx){\n if (this.nodeType !== 1) return\n if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n })\n },\n removeAttr: function(name){\n return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n setAttribute(this, attribute)\n }, this)})\n },\n prop: function(name, value){\n name = propMap[name] || name\n return (1 in arguments) ?\n this.each(function(idx){\n this[name] = funcArg(this, value, idx, this[name])\n }) :\n (this[0] && this[0][name])\n },\n removeProp: function(name){\n name = propMap[name] || name\n return this.each(function(){ delete this[name] })\n },\n data: function(name, value){\n var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n var data = (1 in arguments) ?\n this.attr(attrName, value) :\n this.attr(attrName)\n\n return data !== null ? deserializeValue(data) : undefined\n },\n val: function(value){\n if (0 in arguments) {\n if (value == null) value = \"\"\n return this.each(function(idx){\n this.value = funcArg(this, value, idx, this.value)\n })\n } else {\n return this[0] && (this[0].multiple ?\n $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n this[0].value)\n }\n },\n offset: function(coordinates){\n if (coordinates) return this.each(function(index){\n var $this = $(this),\n coords = funcArg(this, coordinates, index, $this.offset()),\n parentOffset = $this.offsetParent().offset(),\n props = {\n top: coords.top - parentOffset.top,\n left: coords.left - parentOffset.left\n }\n\n if ($this.css('position') == 'static') props['position'] = 'relative'\n $this.css(props)\n })\n if (!this.length) return null\n if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n return {top: 0, left: 0}\n var obj = this[0].getBoundingClientRect()\n return {\n left: obj.left + window.pageXOffset,\n top: obj.top + window.pageYOffset,\n width: Math.round(obj.width),\n height: Math.round(obj.height)\n }\n },\n css: function(property, value){\n if (arguments.length < 2) {\n var element = this[0]\n if (typeof property == 'string') {\n if (!element) return\n return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n } else if (isArray(property)) {\n if (!element) return\n var props = {}\n var computedStyle = getComputedStyle(element, '')\n $.each(property, function(_, prop){\n props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n })\n return props\n }\n }\n\n var css = ''\n if (type(property) == 'string') {\n if (!value && value !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(property)) })\n else\n css = dasherize(property) + \":\" + maybeAddPx(property, value)\n } else {\n for (key in property)\n if (!property[key] && property[key] !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(key)) })\n else\n css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n }\n\n return this.each(function(){ this.style.cssText += ';' + css })\n },\n index: function(element){\n return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n },\n hasClass: function(name){\n if (!name) return false\n return emptyArray.some.call(this, function(el){\n return this.test(className(el))\n }, classRE(name))\n },\n addClass: function(name){\n if (!name) return this\n return this.each(function(idx){\n if (!('className' in this)) return\n classList = []\n var cls = className(this), newName = funcArg(this, name, idx, cls)\n newName.split(/\\s+/g).forEach(function(klass){\n if (!$(this).hasClass(klass)) classList.push(klass)\n }, this)\n classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n })\n },\n removeClass: function(name){\n return this.each(function(idx){\n if (!('className' in this)) return\n if (name === undefined) return className(this, '')\n classList = className(this)\n funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n classList = classList.replace(classRE(klass), \" \")\n })\n className(this, classList.trim())\n })\n },\n toggleClass: function(name, when){\n if (!name) return this\n return this.each(function(idx){\n var $this = $(this), names = funcArg(this, name, idx, className(this))\n names.split(/\\s+/g).forEach(function(klass){\n (when === undefined ? !$this.hasClass(klass) : when) ?\n $this.addClass(klass) : $this.removeClass(klass)\n })\n })\n },\n scrollTop: function(value){\n if (!this.length) return\n var hasScrollTop = 'scrollTop' in this[0]\n if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n return this.each(hasScrollTop ?\n function(){ this.scrollTop = value } :\n function(){ this.scrollTo(this.scrollX, value) })\n },\n scrollLeft: function(value){\n if (!this.length) return\n var hasScrollLeft = 'scrollLeft' in this[0]\n if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n return this.each(hasScrollLeft ?\n function(){ this.scrollLeft = value } :\n function(){ this.scrollTo(value, this.scrollY) })\n },\n position: function() {\n if (!this.length) return\n\n var elem = this[0],\n // Get *real* offsetParent\n offsetParent = this.offsetParent(),\n // Get correct offsets\n offset = this.offset(),\n parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n // Subtract element margins\n // note: when an element has margin: auto the offsetLeft and marginLeft\n // are the same in Safari causing offset.left to incorrectly be 0\n offset.top -= parseFloat( $(elem).css('margin-top') ) || 0\n offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n // Add offsetParent borders\n parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n // Subtract the two offsets\n return {\n top: offset.top - parentOffset.top,\n left: offset.left - parentOffset.left\n }\n },\n offsetParent: function() {\n return this.map(function(){\n var parent = this.offsetParent || document.body\n while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n parent = parent.offsetParent\n return parent\n })\n }\n }\n\n // for now\n $.fn.detach = $.fn.remove\n\n // Generate the `width` and `height` functions\n ;['width', 'height'].forEach(function(dimension){\n var dimensionProperty =\n dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n $.fn[dimension] = function(value){\n var offset, el = this[0]\n if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n (offset = this.offset()) && offset[dimension]\n else return this.each(function(idx){\n el = $(this)\n el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n })\n }\n })\n\n function traverseNode(node, fun) {\n fun(node)\n for (var i = 0, len = node.childNodes.length; i < len; i++)\n traverseNode(node.childNodes[i], fun)\n }\n\n // Generate the `after`, `prepend`, `before`, `append`,\n // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n adjacencyOperators.forEach(function(operator, operatorIndex) {\n var inside = operatorIndex % 2 //=> prepend, append\n\n $.fn[operator] = function(){\n // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n var argType, nodes = $.map(arguments, function(arg) {\n var arr = []\n argType = type(arg)\n if (argType == \"array\") {\n arg.forEach(function(el) {\n if (el.nodeType !== undefined) return arr.push(el)\n else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n arr = arr.concat(zepto.fragment(el))\n })\n return arr\n }\n return argType == \"object\" || arg == null ?\n arg : zepto.fragment(arg)\n }),\n parent, copyByClone = this.length > 1\n if (nodes.length < 1) return this\n\n return this.each(function(_, target){\n parent = inside ? target : target.parentNode\n\n // convert all methods to a \"before\" operation\n target = operatorIndex == 0 ? target.nextSibling :\n operatorIndex == 1 ? target.firstChild :\n operatorIndex == 2 ? target :\n null\n\n var parentInDocument = $.contains(document.documentElement, parent)\n\n nodes.forEach(function(node){\n if (copyByClone) node = node.cloneNode(true)\n else if (!parent) return $(node).remove()\n\n parent.insertBefore(node, target)\n if (parentInDocument) traverseNode(node, function(el){\n if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n (!el.type || el.type === 'text/javascript') && !el.src){\n var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n target['eval'].call(target, el.innerHTML)\n }\n })\n })\n })\n }\n\n // after => insertAfter\n // prepend => prependTo\n // before => insertBefore\n // append => appendTo\n $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n $(html)[operator](this)\n return this\n }\n })\n\n zepto.Z.prototype = Z.prototype = $.fn\n\n // Export internal API functions in the `$.zepto` namespace\n zepto.uniq = uniq\n zepto.deserializeValue = deserializeValue\n $.zepto = zepto\n\n return $\n})()\n\nwindow.Zepto = Zepto\nwindow.$ === undefined && (window.$ = Zepto)\n\n;(function($){\n var _zid = 1, undefined,\n slice = Array.prototype.slice,\n isFunction = $.isFunction,\n isString = function(obj){ return typeof obj == 'string' },\n handlers = {},\n specialEvents={},\n focusinSupported = 'onfocusin' in window,\n focus = { focus: 'focusin', blur: 'focusout' },\n hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n function zid(element) {\n return element._zid || (element._zid = _zid++)\n }\n function findHandlers(element, event, fn, selector) {\n event = parse(event)\n if (event.ns) var matcher = matcherFor(event.ns)\n return (handlers[zid(element)] || []).filter(function(handler) {\n return handler\n && (!event.e || handler.e == event.e)\n && (!event.ns || matcher.test(handler.ns))\n && (!fn || zid(handler.fn) === zid(fn))\n && (!selector || handler.sel == selector)\n })\n }\n function parse(event) {\n var parts = ('' + event).split('.')\n return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n }\n function matcherFor(ns) {\n return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n }\n\n function eventCapture(handler, captureSetting) {\n return handler.del &&\n (!focusinSupported && (handler.e in focus)) ||\n !!captureSetting\n }\n\n function realEvent(type) {\n return hover[type] || (focusinSupported && focus[type]) || type\n }\n\n function add(element, events, fn, data, selector, delegator, capture){\n var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n events.split(/\\s/).forEach(function(event){\n if (event == 'ready') return $(document).ready(fn)\n var handler = parse(event)\n handler.fn = fn\n handler.sel = selector\n // emulate mouseenter, mouseleave\n if (handler.e in hover) fn = function(e){\n var related = e.relatedTarget\n if (!related || (related !== this && !$.contains(this, related)))\n return handler.fn.apply(this, arguments)\n }\n handler.del = delegator\n var callback = delegator || fn\n handler.proxy = function(e){\n e = compatible(e)\n if (e.isImmediatePropagationStopped()) return\n e.data = data\n var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n if (result === false) e.preventDefault(), e.stopPropagation()\n return result\n }\n handler.i = set.length\n set.push(handler)\n if ('addEventListener' in element)\n element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n }\n function remove(element, events, fn, selector, capture){\n var id = zid(element)\n ;(events || '').split(/\\s/).forEach(function(event){\n findHandlers(element, event, fn, selector).forEach(function(handler){\n delete handlers[id][handler.i]\n if ('removeEventListener' in element)\n element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n })\n }\n\n $.event = { add: add, remove: remove }\n\n $.proxy = function(fn, context) {\n var args = (2 in arguments) && slice.call(arguments, 2)\n if (isFunction(fn)) {\n var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n proxyFn._zid = zid(fn)\n return proxyFn\n } else if (isString(context)) {\n if (args) {\n args.unshift(fn[context], fn)\n return $.proxy.apply(null, args)\n } else {\n return $.proxy(fn[context], fn)\n }\n } else {\n throw new TypeError(\"expected function\")\n }\n }\n\n $.fn.bind = function(event, data, callback){\n return this.on(event, data, callback)\n }\n $.fn.unbind = function(event, callback){\n return this.off(event, callback)\n }\n $.fn.one = function(event, selector, data, callback){\n return this.on(event, selector, data, callback, 1)\n }\n\n var returnTrue = function(){return true},\n returnFalse = function(){return false},\n ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n eventMethods = {\n preventDefault: 'isDefaultPrevented',\n stopImmediatePropagation: 'isImmediatePropagationStopped',\n stopPropagation: 'isPropagationStopped'\n }\n\n function compatible(event, source) {\n if (source || !event.isDefaultPrevented) {\n source || (source = event)\n\n $.each(eventMethods, function(name, predicate) {\n var sourceMethod = source[name]\n event[name] = function(){\n this[predicate] = returnTrue\n return sourceMethod && sourceMethod.apply(source, arguments)\n }\n event[predicate] = returnFalse\n })\n\n event.timeStamp || (event.timeStamp = Date.now())\n\n if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n 'returnValue' in source ? source.returnValue === false :\n source.getPreventDefault && source.getPreventDefault())\n event.isDefaultPrevented = returnTrue\n }\n return event\n }\n\n function createProxy(event) {\n var key, proxy = { originalEvent: event }\n for (key in event)\n if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n return compatible(proxy, event)\n }\n\n $.fn.delegate = function(selector, event, callback){\n return this.on(event, selector, callback)\n }\n $.fn.undelegate = function(selector, event, callback){\n return this.off(event, selector, callback)\n }\n\n $.fn.live = function(event, callback){\n $(document.body).delegate(this.selector, event, callback)\n return this\n }\n $.fn.die = function(event, callback){\n $(document.body).undelegate(this.selector, event, callback)\n return this\n }\n\n $.fn.on = function(event, selector, data, callback, one){\n var autoRemove, delegator, $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.on(type, selector, data, fn, one)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = data, data = selector, selector = undefined\n if (callback === undefined || data === false)\n callback = data, data = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(_, element){\n if (one) autoRemove = function(e){\n remove(element, e.type, callback)\n return callback.apply(this, arguments)\n }\n\n if (selector) delegator = function(e){\n var evt, match = $(e.target).closest(selector, element).get(0)\n if (match && match !== element) {\n evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n }\n }\n\n add(element, event, callback, data, selector, delegator || autoRemove)\n })\n }\n $.fn.off = function(event, selector, callback){\n var $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.off(type, selector, fn)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = selector, selector = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(){\n remove(this, event, callback, selector)\n })\n }\n\n $.fn.trigger = function(event, args){\n event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n event._args = args\n return this.each(function(){\n // handle focus(), blur() by calling them directly\n if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n // items in the collection might not be DOM elements\n else if ('dispatchEvent' in this) this.dispatchEvent(event)\n else $(this).triggerHandler(event, args)\n })\n }\n\n // triggers event handlers on current element just as if an event occurred,\n // doesn't trigger an actual event, doesn't bubble\n $.fn.triggerHandler = function(event, args){\n var e, result\n this.each(function(i, element){\n e = createProxy(isString(event) ? $.Event(event) : event)\n e._args = args\n e.target = element\n $.each(findHandlers(element, event.type || event), function(i, handler){\n result = handler.proxy(e)\n if (e.isImmediatePropagationStopped()) return false\n })\n })\n return result\n }\n\n // shortcut methods for `.bind(event, fn)` for each event type\n ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n 'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n $.fn[event] = function(callback) {\n return (0 in arguments) ?\n this.bind(event, callback) :\n this.trigger(event)\n }\n })\n\n $.Event = function(type, props) {\n if (!isString(type)) props = type, type = props.type\n var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n event.initEvent(type, bubbles, true)\n return compatible(event)\n }\n\n})(Zepto)\n\n;(function($){\n var jsonpID = +new Date(),\n document = window.document,\n key,\n name,\n rscript = /<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\n scriptTypeRE = /^(?:text|application)\\/javascript/i,\n xmlTypeRE = /^(?:text|application)\\/xml/i,\n jsonType = 'application/json',\n htmlType = 'text/html',\n blankRE = /^\\s*$/,\n originAnchor = document.createElement('a')\n\n originAnchor.href = window.location.href\n\n // trigger a custom event and return false if it was cancelled\n function triggerAndReturn(context, eventName, data) {\n var event = $.Event(eventName)\n $(context).trigger(event, data)\n return !event.isDefaultPrevented()\n }\n\n // trigger an Ajax \"global\" event\n function triggerGlobal(settings, context, eventName, data) {\n if (settings.global) return triggerAndReturn(context || document, eventName, data)\n }\n\n // Number of active Ajax requests\n $.active = 0\n\n function ajaxStart(settings) {\n if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')\n }\n function ajaxStop(settings) {\n if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')\n }\n\n // triggers an extra global event \"ajaxBeforeSend\" that's like \"ajaxSend\" but cancelable\n function ajaxBeforeSend(xhr, settings) {\n var context = settings.context\n if (settings.beforeSend.call(context, xhr, settings) === false ||\n triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)\n return false\n\n triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])\n }\n function ajaxSuccess(data, xhr, settings, deferred) {\n var context = settings.context, status = 'success'\n settings.success.call(context, data, status, xhr)\n if (deferred) deferred.resolveWith(context, [data, status, xhr])\n triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])\n ajaxComplete(status, xhr, settings)\n }\n // type: \"timeout\", \"error\", \"abort\", \"parsererror\"\n function ajaxError(error, type, xhr, settings, deferred) {\n var context = settings.context\n settings.error.call(context, xhr, type, error)\n if (deferred) deferred.rejectWith(context, [xhr, type, error])\n triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])\n ajaxComplete(type, xhr, settings)\n }\n // status: \"success\", \"notmodified\", \"error\", \"timeout\", \"abort\", \"parsererror\"\n function ajaxComplete(status, xhr, settings) {\n var context = settings.context\n settings.complete.call(context, xhr, status)\n triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])\n ajaxStop(settings)\n }\n\n function ajaxDataFilter(data, type, settings) {\n if (settings.dataFilter == empty) return data\n var context = settings.context\n return settings.dataFilter.call(context, data, type)\n }\n\n // Empty function, used as default callback\n function empty() {}\n\n $.ajaxJSONP = function(options, deferred){\n if (!('type' in options)) return $.ajax(options)\n\n var _callbackName = options.jsonpCallback,\n callbackName = ($.isFunction(_callbackName) ?\n _callbackName() : _callbackName) || ('Zepto' + (jsonpID++)),\n script = document.createElement('script'),\n originalCallback = window[callbackName],\n responseData,\n abort = function(errorType) {\n $(script).triggerHandler('error', errorType || 'abort')\n },\n xhr = { abort: abort }, abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n $(script).on('load error', function(e, errorType){\n clearTimeout(abortTimeout)\n $(script).off().remove()\n\n if (e.type == 'error' || !responseData) {\n ajaxError(null, errorType || 'error', xhr, options, deferred)\n } else {\n ajaxSuccess(responseData[0], xhr, options, deferred)\n }\n\n window[callbackName] = originalCallback\n if (responseData && $.isFunction(originalCallback))\n originalCallback(responseData[0])\n\n originalCallback = responseData = undefined\n })\n\n if (ajaxBeforeSend(xhr, options) === false) {\n abort('abort')\n return xhr\n }\n\n window[callbackName] = function(){\n responseData = arguments\n }\n\n script.src = options.url.replace(/\\?(.+)=\\?/, '?$1=' + callbackName)\n document.head.appendChild(script)\n\n if (options.timeout > 0) abortTimeout = setTimeout(function(){\n abort('timeout')\n }, options.timeout)\n\n return xhr\n }\n\n $.ajaxSettings = {\n // Default type of request\n type: 'GET',\n // Callback that is executed before request\n beforeSend: empty,\n // Callback that is executed if the request succeeds\n success: empty,\n // Callback that is executed the the server drops error\n error: empty,\n // Callback that is executed on request complete (both: error and success)\n complete: empty,\n // The context for the callbacks\n context: null,\n // Whether to trigger \"global\" Ajax events\n global: true,\n // Transport\n xhr: function () {\n return new window.XMLHttpRequest()\n },\n // MIME types mapping\n // IIS returns Javascript as \"application/x-javascript\"\n accepts: {\n script: 'text/javascript, application/javascript, application/x-javascript',\n json: jsonType,\n xml: 'application/xml, text/xml',\n html: htmlType,\n text: 'text/plain'\n },\n // Whether the request is to another domain\n crossDomain: false,\n // Default timeout\n timeout: 0,\n // Whether data should be serialized to string\n processData: true,\n // Whether the browser should be allowed to cache GET responses\n cache: true,\n //Used to handle the raw response data of XMLHttpRequest.\n //This is a pre-filtering function to sanitize the response.\n //The sanitized response should be returned\n dataFilter: empty\n }\n\n function mimeToDataType(mime) {\n if (mime) mime = mime.split(';', 2)[0]\n return mime && ( mime == htmlType ? 'html' :\n mime == jsonType ? 'json' :\n scriptTypeRE.test(mime) ? 'script' :\n xmlTypeRE.test(mime) && 'xml' ) || 'text'\n }\n\n function appendQuery(url, query) {\n if (query == '') return url\n return (url + '&' + query).replace(/[&?]{1,2}/, '?')\n }\n\n // serialize payload and append it to the URL for GET requests\n function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }\n\n $.ajax = function(options){\n var settings = $.extend({}, options || {}),\n deferred = $.Deferred && $.Deferred(),\n urlAnchor, hashIndex\n for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]\n\n ajaxStart(settings)\n\n if (!settings.crossDomain) {\n urlAnchor = document.createElement('a')\n urlAnchor.href = settings.url\n // cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049\n urlAnchor.href = urlAnchor.href\n settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host)\n }\n\n if (!settings.url) settings.url = window.location.toString()\n if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex)\n serializeData(settings)\n\n var dataType = settings.dataType, hasPlaceholder = /\\?.+=\\?/.test(settings.url)\n if (hasPlaceholder) dataType = 'jsonp'\n\n if (settings.cache === false || (\n (!options || options.cache !== true) &&\n ('script' == dataType || 'jsonp' == dataType)\n ))\n settings.url = appendQuery(settings.url, '_=' + Date.now())\n\n if ('jsonp' == dataType) {\n if (!hasPlaceholder)\n settings.url = appendQuery(settings.url,\n settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?')\n return $.ajaxJSONP(settings, deferred)\n }\n\n var mime = settings.accepts[dataType],\n headers = { },\n setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },\n protocol = /^([\\w-]+:)\\/\\//.test(settings.url) ? RegExp.$1 : window.location.protocol,\n xhr = settings.xhr(),\n nativeSetHeader = xhr.setRequestHeader,\n abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest')\n setHeader('Accept', mime || '*/*')\n if (mime = settings.mimeType || mime) {\n if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]\n xhr.overrideMimeType && xhr.overrideMimeType(mime)\n }\n if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))\n setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')\n\n if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name])\n xhr.setRequestHeader = setHeader\n\n xhr.onreadystatechange = function(){\n if (xhr.readyState == 4) {\n xhr.onreadystatechange = empty\n clearTimeout(abortTimeout)\n var result, error = false\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {\n dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))\n\n if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob')\n result = xhr.response\n else {\n result = xhr.responseText\n\n try {\n // http://perfectionkills.com/global-eval-what-are-the-options/\n // sanitize response accordingly if data filter callback provided\n result = ajaxDataFilter(result, dataType, settings)\n if (dataType == 'script') (1,eval)(result)\n else if (dataType == 'xml') result = xhr.responseXML\n else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)\n } catch (e) { error = e }\n\n if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred)\n }\n\n ajaxSuccess(result, xhr, settings, deferred)\n } else {\n ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred)\n }\n }\n }\n\n if (ajaxBeforeSend(xhr, settings) === false) {\n xhr.abort()\n ajaxError(null, 'abort', xhr, settings, deferred)\n return xhr\n }\n\n var async = 'async' in settings ? settings.async : true\n xhr.open(settings.type, settings.url, async, settings.username, settings.password)\n\n if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]\n\n for (name in headers) nativeSetHeader.apply(xhr, headers[name])\n\n if (settings.timeout > 0) abortTimeout = setTimeout(function(){\n xhr.onreadystatechange = empty\n xhr.abort()\n ajaxError(null, 'timeout', xhr, settings, deferred)\n }, settings.timeout)\n\n // avoid sending empty string (#319)\n xhr.send(settings.data ? settings.data : null)\n return xhr\n }\n\n // handle optional data/success arguments\n function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }\n\n $.get = function(/* url, data, success, dataType */){\n return $.ajax(parseArguments.apply(null, arguments))\n }\n\n $.post = function(/* url, data, success, dataType */){\n var options = parseArguments.apply(null, arguments)\n options.type = 'POST'\n return $.ajax(options)\n }\n\n $.getJSON = function(/* url, data, success */){\n var options = parseArguments.apply(null, arguments)\n options.dataType = 'json'\n return $.ajax(options)\n }\n\n $.fn.load = function(url, data, success){\n if (!this.length) return this\n var self = this, parts = url.split(/\\s/), selector,\n options = parseArguments(url, data, success),\n callback = options.success\n if (parts.length > 1) options.url = parts[0], selector = parts[1]\n options.success = function(response){\n self.html(selector ?\n $('<div>').html(response.replace(rscript, \"\")).find(selector)\n : response)\n callback && callback.apply(self, arguments)\n }\n $.ajax(options)\n return this\n }\n\n var escape = encodeURIComponent\n\n function serialize(params, obj, traditional, scope){\n var type, array = $.isArray(obj), hash = $.isPlainObject(obj)\n $.each(obj, function(key, value) {\n type = $.type(value)\n if (scope) key = traditional ? scope :\n scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']'\n // handle data in serializeArray() format\n if (!scope && array) params.add(value.name, value.value)\n // recurse into nested objects\n else if (type == \"array\" || (!traditional && type == \"object\"))\n serialize(params, value, traditional, key)\n else params.add(key, value)\n })\n }\n\n $.param = function(obj, traditional){\n var params = []\n params.add = function(key, value) {\n if ($.isFunction(value)) value = value()\n if (value == null) value = \"\"\n this.push(escape(key) + '=' + escape(value))\n }\n serialize(params, obj, traditional)\n return params.join('&').replace(/%20/g, '+')\n }\n})(Zepto)\n\n;(function($){\n $.fn.serializeArray = function() {\n var name, type, result = [],\n add = function(value) {\n if (value.forEach) return value.forEach(add)\n result.push({ name: name, value: value })\n }\n if (this[0]) $.each(this[0].elements, function(_, field){\n type = field.type, name = field.name\n if (name && field.nodeName.toLowerCase() != 'fieldset' &&\n !field.disabled && type != 'submit' && type != 'reset' && type != 'button' && type != 'file' &&\n ((type != 'radio' && type != 'checkbox') || field.checked))\n add($(field).val())\n })\n return result\n }\n\n $.fn.serialize = function(){\n var result = []\n this.serializeArray().forEach(function(elm){\n result.push(encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value))\n })\n return result.join('&')\n }\n\n $.fn.submit = function(callback) {\n if (0 in arguments) this.bind('submit', callback)\n else if (this.length) {\n var event = $.Event('submit')\n this.eq(0).trigger(event)\n if (!event.isDefaultPrevented()) this.get(0).submit()\n }\n return this\n }\n\n})(Zepto)\n\n;(function(){\n // getComputedStyle shouldn't freak out when called\n // without a valid element as argument\n try {\n getComputedStyle(undefined)\n } catch(e) {\n var nativeGetComputedStyle = getComputedStyle\n window.getComputedStyle = function(element, pseudoElement){\n try {\n return nativeGetComputedStyle(element, pseudoElement)\n } catch(e) {\n return null\n }\n }\n }\n})()\n return Zepto\n}))\n"},function(){!function(e){e.expr={":":{}},e.support={},e.fn.clone=function(){var t=e();return this.each(function(){t.push(this.cloneNode(!0))}),t},["Left","Top"].forEach(function(t,n){function i(e){return function(e){return e&&"object"==(void 0===e?"undefined":s(e))&&"setInterval"in e}(e)?e:!(9!==e.nodeType)&&(e.defaultView||e.parentWindow)}var o="scroll"+t;e.fn[o]=function(t){var r,s;return void 0===t?(r=this[0])?(s=i(r))?"pageXOffset"in s?s[n?"pageYOffset":"pageXOffset"]:s.document.documentElement[o]||s.document.body[o]:r[o]:null:void this.each(function(){if(s=i(this)){var r=n?e(s).scrollLeft():t,a=n?t:e(s).scrollTop();s.scrollTo(r,a)}else this[o]=t})}}),["width","height"].forEach(function(t){var n=t.replace(/./,function(e){return e[0].toUpperCase()});e.fn["inner"+n]=function(e){var n=this;if(n){var i=n[t]();return{width:["left","right"],height:["top","bottom"]}[t].forEach(function(t){i+=parseInt(n.css("padding-"+t),10),e&&(i+=parseInt(n.css("margin-"+t),10))}),i}return null},e.fn["outer"+n]=function(e){var n=this;if(n){var i=n[t]();return{width:["left","right"],height:["top","bottom"]}[t].forEach(function(t){e&&(i+=parseInt(n.css("margin-"+t),10))}),i}return null}}),e.proxy=function(t,n){if("string"==typeof n){var i=t[n];n=t,t=i}if(e.isFunction(t)){var o=Array.prototype.slice.call(arguments,2),r=function(){return t.apply(n,o.concat(Array.prototype.slice.call(arguments)))};return r.guid=t.guid=t.guid||r.guid||e.guid++,r}};var t=String.prototype.trim;e.trim=function(e,n){return!n&&t?t.call(e):(n=defaultToWhiteSpace(n),e.replace(new RegExp("^["+n+"]+|["+n+"]+$","g"),""))};var n=/^(?:body|html)$/i;e.fn.position=function(){if(!this[0])return null;var t=this[0],i=this.offsetParent(),o=this.offset(),r=n.test(i[0].nodeName)?{top:0,left:0}:i.offset();return o.top-=parseFloat(e(t).css("margin-top"))||0,o.left-=parseFloat(e(t).css("margin-left"))||0,r.top+=parseFloat(e(i[0]).css("border-top-width"))||0,r.left+=parseFloat(e(i[0]).css("border-left-width"))||0,{top:o.top-r.top,left:o.left-r.left}},e.fn.offsetParent=function(){var t=e();return this.each(function(){for(var i=this.offsetParent||document.body;i&&!n.test(i.nodeName)&&"static"===e(i).css("position");)i=i.offsetParent;t.push(i)}),t}}(Zepto)}])},"object"==s(t)&&"object"==s(e)?e.exports=r():(i=[],void 0===(o="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=o))}).call(this,n(0)(e))},function(e,t,n){"use strict";var i,o=n(1);var r=new((i=o)&&i.__esModule?i:{default:i}).default({settings:{showPopoutIcon:!1,showCloseIcon:!1},content:[{type:"row",content:[{type:"column",width:40,content:[{type:"component",componentName:"template",title:"Game",componentState:{id:"client_wrapper"}},{type:"component",title:"Miscellaneous",height:5,componentName:"template",componentState:{id:"misc"}}]},{type:"column",content:[{type:"stack",height:60,content:[{type:"component",title:"Server chat",componentName:"template",componentState:{id:"ooc"}},{type:"component",title:"Log",componentName:"template",componentState:{id:"log"}}]},{type:"row",content:[{type:"component",title:"Music",componentName:"template",componentState:{id:"music"}},{type:"component",title:"Settings",componentName:"template",componentState:{id:"client_settings"}}]}]}]}]});r.registerComponent("template",function(e,t){var n=document.querySelector("#"+t.id);e.getElement().html(n.content)}),r.init()}]); \ No newline at end of file
+!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){var n,i,o,r,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};"undefined"==typeof self||self,r=function(){var e=Math.min,t=Math.floor,n=Math.max;return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=67)}([function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){t.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(100));t.default=function(){function e(e,t){for(var n,o=0;o<t.length;o++)(n=t[o]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,i.default)(e,n.key,n)}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}function o(){}function r(e){return"function"==typeof u.default?(0,u.default)(e):(o.prototype=e,new o)}function s(e){var t=location.hash.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null}function a(e,t){if(!(t instanceof Array))throw new Error("Haystack is not an Array");if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0;var l=i(n(17)),c=i(n(109)),u=i(n(55));t.F=o,t.getTouchEvent=function(e){return $.zepto?e.touches?e.targetTouches[0]:e:e.originalEvent&&e.originalEvent.touches?e.originalEvent.touches[0]:e},t.extend=function(e,t){e.prototype=r(t.prototype),e.prototype.contructor=e},t.createObject=r,t.objectKeys=function(e){var t,n;if("function"==typeof c.default)return(0,c.default)(e);for(n in t=[],e)t.push(n);return t},t.getHashValue=s,t.getQueryStringParam=function(e){if(window.location.hash)return s(e);if(!window.location.search)return null;var t,n,i=window.location.search.substr(1).split("&"),o={};for(n=0;n<i.length;n++)o[(t=i[n].split("="))[0]]=t[1];return o[e]||null},t.copy=function(e,t){for(var n in t)e[n]=t[n];return e},t.animFrame=function(e){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)})(function(){e()})},t.indexOf=a,t.fnBind=function(e,t,n){if(void 0!==Function.prototype.bind)return Function.prototype.bind.apply(e,[t].concat(n||[]));var i=function i(){var o=(n||[]).concat(Array.prototype.slice.call(arguments,0));return this instanceof i?void e.apply(this,o):e.apply(t,o)};return i.prototype=e.prototype,i},t.removeFromArray=function(e,t){var n=a(e,t);if(-1===n)throw new Error("Can't remove item from array. Item is not in the array");t.splice(n,1)},t.now=function(){return"function"==typeof Date.now?Date.now():(new Date).getTime()},t.getUniqueId=function(){return(1e15*Math.random()).toString(36).replace(".","")},t.filterXss=function(e,t){var n=e.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return!0===t?n:n.replace(/>/g,"&gt;").replace(/</g,"&lt;")},t.stripTags=function(e){return $.trim(e.replace(/(<([^>]+)>)/gi,""))},t.isFunction="function"!=typeof/./&&"object"!=("undefined"==typeof Int8Array?"undefined":(0,l.default)(Int8Array))?function(e){return"function"==typeof e||!1}:function(e){return"[object Function]"===toString.call(e)}},function(e,t,n){e.exports={default:n(98),__esModule:!0}},function(e,t,n){t.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(17));t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(n(103)),r=i(n(55)),s=i(n(17));t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,s.default)(t)));e.prototype=(0,r.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e){var t=e.exports={version:"2.5.6"};"number"==typeof __e&&(__e=t)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_EVENT=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=n(2),r=t.ALL_EVENT="__all";t.default=function e(){(0,i.default)(this,e),this._mSubscriptions={},this._mSubscriptions[r]=[],this.on=function(e,t,n){if(!(0,o.isFunction)(t))throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:n})},this.emit=function(e){var t,n,i;i=Array.prototype.slice.call(arguments,1);var o=this._mSubscriptions[e];if(o)for(o=o.slice(),t=0;t<o.length;t++)n=o[t].ctx||{},o[t].fn.apply(n,i);i.unshift(e);var s=this._mSubscriptions[r].slice();for(t=0;t<s.length;t++)n=s[t].ctx||{},s[t].fn.apply(n,i)},this.unbind=function(e,t,n){if(!this._mSubscriptions[e])throw new Error("No subscribtions to unsubscribe for event "+e);var i,o=!1;for(i=0;i<this._mSubscriptions[e].length;i++)t&&this._mSubscriptions[e][i].fn!==t||n&&n!==this._mSubscriptions[e][i].ctx||(this._mSubscriptions[e].splice(i,1),o=!0);if(0==o)throw new Error("Nothing to unbind for "+e)},this.off=this.unbind,this.trigger=this.emit}},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){var i=n(18),o=n(45),r=n(29),s=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(i(e),t=r(t,!0),i(n),o)try{return s(e,t,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},function(e,t,n){var i=n(8),o=n(6),r=n(44),s=n(13),a=n(11),l="prototype",c=function e(t,n,c){var u,h,d,f=t&e.F,p=t&e.G,m=t&e.S,g=t&e.P,y=t&e.B,v=t&e.W,_=p?o:o[n]||(o[n]={}),b=_[l],w=p?i:m?i[n]:(i[n]||{})[l];for(u in p&&(c=n),c)(h=!f&&w&&void 0!==w[u])&&a(_,u)||(d=h?w[u]:c[u],_[u]=p&&"function"!=typeof w[u]?c[u]:y&&h?r(d,i):v&&w[u]==d?function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t[l]=e[l],t}(d):g&&"function"==typeof d?r(Function.call,d):d,g&&((_.virtual||(_.virtual={}))[u]=d,t&e.R&&b&&!b[u]&&s(b,u,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var i=n(9),o=n(22);e.exports=n(10)?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e){e.exports=function(e){return"object"==(void 0===e?"undefined":s(e))?null!==e:"function"==typeof e}},function(e,t,n){var i=n(79),o=n(28);e.exports=function(e){return i(o(e))}},function(e,t,n){var i=n(33)("wks"),o=n(24),r=n(8).Symbol,s="function"==typeof r;(e.exports=function(e){return i[e]||(i[e]=s&&r[e]||(s?r:o)("Symbol."+e))}).store=i},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(n(72)),r=i(n(88)),a="function"==typeof r.default&&"symbol"==s(o.default)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":s(e)};t.default="function"==typeof r.default&&"symbol"===a(o.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":a(e)}},function(e,t,n){var i=n(14);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=n(7),u=i(c),h=i(n(58)),d=i(n(41)),f=i(n(59)),p=i(n(112)),m=n(2),g=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return s.config=s._extendItemNode(n),s.type=n.type,s.contentItems=[],s.parent=i,s.isInitialised=!1,s.isMaximised=!1,s.isRoot=!1,s.isRow=!1,s.isColumn=!1,s.isStack=!1,s.isComponent=!1,s.layoutManager=e,s._pendingEventPropagations={},s._throttledEvents=["stateChanged"],s.on(c.ALL_EVENT,s._propagateEvent,s),n.content&&s._createContentItems(n),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"setSize",value:function(){throw new Error("Abstract Method")}},{key:"callDownwards",value:function(e,t,n,i){var o;for(!0!==n&&!0!==i&&this[e].apply(this,t||[]),o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,n);!0===n&&!0!==i&&this[e].apply(this,t||[])}},{key:"removeChild",value:function(e,t){var n=(0,m.indexOf)(e,this.contentItems);if(-1===n)throw new Error("Can't remove child item. Unknown content item");!0!==t&&this.contentItems[n]._$destroy(),this.contentItems.splice(n,1),this.config.content.splice(n,1),0<this.contentItems.length?this.callDownwards("setSize"):!(this instanceof d.default)&&!0===this.config.isClosable&&this.parent.removeChild(this)}},{key:"undisplayChild",value:function(e){if(-1===(0,m.indexOf)(e,this.contentItems))throw new Error("Can't remove child item. Unknown content item");this instanceof d.default||!0!==this.config.isClosable||this.parent.undisplayChild(this)}},{key:"addChild",value:function(e,t){void 0===t&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init()}},{key:"replaceChild",value:function(e,t,n){t=this.layoutManager._$normalizeContentItem(t);var i=(0,m.indexOf)(e,this.contentItems),o=e.element[0].parentNode;if(-1===i)throw new Error("Can't replace child. oldChild is not child of this");o.replaceChild(t.element[0],e.element[0]),!0===n&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,this.isStack&&(this.header.tabs[i].contentItem=t),!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init(),this.callDownwards("setSize")}},{key:"remove",value:function(){this.parent.removeChild(this)}},{key:"popout",value:function(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}},{key:"toggleMaximise",value:function(e){e&&e.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}},{key:"select",value:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}},{key:"deselect",value:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}},{key:"setTitle",value:function(e){this.config.title=e,this.emit("titleChanged",e),this.emit("stateChanged")}},{key:"hasId",value:function(e){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===e:this.config.id instanceof Array?-1!==(0,m.indexOf)(e,this.config.id):void 0)}},{key:"addId",value:function(e){this.hasId(e)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}},{key:"removeId",value:function(e){if(!this.hasId(e))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var t=(0,m.indexOf)(e,this.config.id);this.config.id.splice(t,1)}}},{key:"getItemsByFilter",value:function(e){var t=[];return function n(i){for(var o=0;o<i.contentItems.length;o++)!0===e(i.contentItems[o])&&t.push(i.contentItems[o]),n(i.contentItems[o])}(this),t}},{key:"getItemsById",value:function(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?-1!==(0,m.indexOf)(e,t.config.id):t.config.id===e})}},{key:"getItemsByType",value:function(e){return this._$getItemsByProperty("type",e)}},{key:"getComponentsByName",value:function(e){var t,n=this._$getItemsByProperty("componentName",e),i=[];for(t=0;t<n.length;t++)i.push(n[t].instance);return i}},{key:"_$getItemsByProperty",value:function(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}},{key:"_$setParent",value:function(e){this.parent=e}},{key:"_$highlightDropZone",value:function(e,t,n){this.layoutManager.dropTargetIndicator.highlightArea(n)}},{key:"_$onDrop",value:function(e){this.addChild(e)}},{key:"_$hide",value:function(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}},{key:"_$show",value:function(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}},{key:"_callOnActiveComponents",value:function(e){var t,n,i=this.getItemsByType("stack");for(n=0;n<i.length;n++)(t=i[n].getActiveContentItem())&&t.isComponent&&t.container[e]()}},{key:"_$destroy",value:function(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}},{key:"_$getArea",value:function(e){var t=(e=e||this.element).offset(),n=e.width(),i=e.height();return{x1:t.left,y1:t.top,x2:t.left+n,y2:t.top+i,surface:n*i,contentItem:this}}},{key:"_$init",value:function(){var e;for(this.setSize(),e=0;e<this.contentItems.length;e++)this.childElementContainer.append(this.contentItems[e].element);this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}},{key:"emitBubblingEvent",value:function(e){var t=new h.default(e,this);this.emit(e,t)}},{key:"_createContentItems",value:function(e){var t,n;if(!(e.content instanceof Array))throw new f.default("content must be an Array",e);for(n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}},{key:"_extendItemNode",value:function(e){for(var t in p.default)void 0===e[t]&&(e[t]=p.default[t]);return e}},{key:"_propagateEvent",value:function(e,t){t instanceof h.default&&!1===t.isPropagationStopped&&!0===this.isInitialised&&(!1===this.isRoot&&this.parent?this.parent.emit.apply(this.parent,Array.prototype.slice.call(arguments,0)):this._scheduleEventPropagationToLayoutManager(e,t))}},{key:"_scheduleEventPropagationToLayoutManager",value:function(e,t){-1===(0,m.indexOf)(e,this._throttledEvents)?this.layoutManager.emit(e,t.origin):!0!==this._pendingEventPropagations[e]&&(this._pendingEventPropagations[e]=!0,(0,m.animFrame)((0,m.fnBind)(this._propagateEventToLayoutManager,this,[e,t])))}},{key:"_propagateEventToLayoutManager",value:function(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}]),t}(u.default);t.default=g},function(e){e.exports=!0},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(48),o=n(34);e.exports=Object.keys||function(e){return i(e,o)}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(3)),a=r(o(0)),l=r(o(1)),c=r(o(4)),u=r(o(5)),h=r(o(20)),d=r(o(42)),f=r(o(113)),p=o(2),m=function(e){function i(e,t,n,o){(0,a.default)(this,i);var r=(0,c.default)(this,(i.__proto__||(0,s.default)(i)).call(this,t,n,o));return r.isRow=!e,r.isColumn=e,r.element=$('<div class="lm_item lm_'+(e?"column":"row")+'"></div>'),r.childElementContainer=r.element,r._splitterSize=t.config.dimensions.borderWidth,r._splitterGrabSize=t.config.dimensions.borderGrabWidth,r._isColumn=e,r._dimension=e?"height":"width",r._splitter=[],r._splitterPosition=null,r._splitterMinPosition=null,r._splitterMaxPosition=null,r}var o=Math.round;return(0,u.default)(i,e),(0,l.default)(i,[{key:"addChild",value:function(e,t,i){var o,r,s,a;if(e=this.layoutManager._$normalizeContentItem(e,this),void 0===t&&(t=this.contentItems.length),0<this.contentItems.length?(a=this._createSplitter(n(0,t-1)).element,0<t?(this.contentItems[t-1].element.after(a),a.after(e.element),this._isDocked(t-1)&&(this._splitter[t-1].element.hide(),this._splitter[t].element.show())):(this.contentItems[0].element.before(a),a.before(e.element))):this.childElementContainer.append(e.element),h.default.prototype.addChild.call(this,e,t),o=1/this.contentItems.length*100,!0!==i){for(s=0;s<this.contentItems.length;s++)this.contentItems[s]===e?e.config[this._dimension]=o:(r=this.contentItems[s].config[this._dimension]*=(100-o)/100,this.contentItems[s].config[this._dimension]=r);this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking()}else this.emitBubblingEvent("stateChanged")}},{key:"undisplayChild",value:function(e){var t,i=e.config[this._dimension],o=(0,p.indexOf)(e,this.contentItems),r=n(o-1,0);if(-1===o)throw new Error("Can't undisplay child. ContentItem is not child of this Row or Column");this._splitter[r]&&(this._splitter[r].element.hide(),this._splitter.splice(r,1)),r<this._splitter.length&&this._isDocked(r)&&this._splitter[r].element.hide();var s=this._isDocked();for(t=0;t<this.contentItems.length;t++)this.contentItems[t]===e?this.contentItems[t].config[this._dimension]=0:this._isDocked(t)||(this.contentItems[t].config[this._dimension]+=i/(this.contentItems.length-1-s));this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"removeChild",value:function(e,t){var i,o,r=e.config[this._dimension],s=(0,p.indexOf)(e,this.contentItems),a=n(s-1,0);if(-1===s)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),a<this._splitter.length&&this._isDocked(a)&&this._splitter[a].element.hide();var l=this._isDocked();for(i=0;i<this.contentItems.length;i++)this.contentItems[i]!==e&&(this._isDocked(i)||(this.contentItems[i].config[this._dimension]+=r/(this.contentItems.length-1-l)));h.default.prototype.removeChild.call(this,e,t),1===this.contentItems.length&&!0===this.config.isClosable?(o=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,o,!0),this._validateDocking(this.parent)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking())}},{key:"replaceChild",value:function(e,t){var n=e.config[this._dimension];h.default.prototype.replaceChild.call(this,e,t),t.config[this._dimension]=n,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"setSize",value:function(){0<this.contentItems.length&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}},{key:"dock",value:function(e,t,i){if(1===this.contentItems.length)throw new Error("Can't dock child when it single");var o=e.config[this._dimension],r=this.layoutManager.config.dimensions.headerHeight,s=(0,p.indexOf)(e,this.contentItems),a=n(s-1,0);if(-1===s)throw new Error("Can't dock child. ContentItem is not child of this Row or Column");var l,c=e._docker&&e._docker.docked;if(void 0===t||t!=c){if(c){for(this._splitter[a].element.show(),l=0;l<this.contentItems.length;l++){var u=e._docker.size;this.contentItems[l]===e?e.config[this._dimension]=u:(itemSize=this.contentItems[l].config[this._dimension]*=(100-u)/100,this.contentItems[l].config[this._dimension]=itemSize)}e._docker={docked:!1}}else{if(2>this.contentItems.length-this._isDocked())throw new Error("Can't dock child when it is last in "+this.config.type);var h={column:{first:"top",last:"bottom"},row:{first:"left",last:"right"}}[this.config.type][s?"last":"first"];e.header.position()!=h&&e.header.position(h),this._splitter[a]&&this._splitter[a].element.hide();var d=this._isDocked();for(l=0;l<this.contentItems.length;l++)this.contentItems[l]===e?this.contentItems[l].config[this._dimension]=0:this._isDocked(l)||(this.contentItems[l].config[this._dimension]+=o/(this.contentItems.length-1-d));e._docker={dimension:this._dimension,size:o,realSize:e.element[this._dimension]()-r,docked:!0},i&&e.childElementContainer[this._dimension](0)}e.element.toggleClass("lm_docked",e._docker.docked),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"),this._validateDocking()}}},{key:"_$init",value:function(){if(!0!==this.isInitialised){var e;for(h.default.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element);for(e=0;e<this.contentItems.length;e++)this.contentItems[e]._header&&this.contentItems[e]._header.docked&&this.dock(this.contentItems[e],!0,!0)}}},{key:"_setAbsoluteSizes",value:function(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)0<t.additionalPixel-e&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}},{key:"_calculateAbsoluteSizes",value:function(){var e,n,i=(this.contentItems.length-1)*this._splitterSize,o=this.layoutManager.config.dimensions.headerHeight,r=this.element.width(),s=this.element.height(),a=0,l=[];for(this._isColumn?s-=i:r-=i,e=0;e<this.contentItems.length;e++)this._isDocked(e)&&(this._isColumn?s-=o-this._splitterSize:r-=o-this._splitterSize);for(e=0;e<this.contentItems.length;e++)n=this._isColumn?t(s*(this.contentItems[e].config.height/100)):t(r*(this.contentItems[e].config.width/100)),this._isDocked(e)&&(n=o),a+=n,l.push(n);return{itemSizes:l,additionalPixel:t((this._isColumn?s:r)-a),totalWidth:r,totalHeight:s}}},{key:"_calculateRelativeSizes",value:function(){var e,t=0,n=[],i=this._isColumn?"height":"width";for(e=0;e<this.contentItems.length;e++)void 0===this.contentItems[e].config[i]?n.push(this.contentItems[e]):t+=this.contentItems[e].config[i];if(100!==o(t))if(100>o(t)&&0<n.length){for(e=0;e<n.length;e++)n[e].config[i]=(100-t)/n.length;this._respectMinItemWidth()}else{if(100<o(t))for(e=0;e<n.length;e++)n[e].config[i]=50,t+=50;for(e=0;e<this.contentItems.length;e++)this.contentItems[e].config[i]=this.contentItems[e].config[i]/t*100;this._respectMinItemWidth()}else this._respectMinItemWidth()}},{key:"_respectMinItemWidth",value:function(){var e,t,n,i=this.layoutManager.config.dimensions&&this.layoutManager.config.dimensions.minItemWidth||0,r=null,s=[],a=0,l=0,c=0,u=0,h=[];if(!(this._isColumn||!i||1>=this.contentItems.length)){r=this._calculateAbsoluteSizes();for(var d=0;d<this.contentItems.length;d++)this.contentItems[d],(u=r.itemSizes[d])<i?(l+=i-u,n={width:i}):(a+=u-i,n={width:u},s.push(n)),h.push(n);if(!(0==l||l>a)){for(e=l/a,c=l,d=0;d<s.length;d++)n=s[d],c-=t=o((n.width-i)*e),n.width-=t;for(0!==c&&(h[h.length-1].width-=c),d=0;d<this.contentItems.length;d++)this.contentItems[d].config.width=h[d].width/r.totalWidth*100}}}},{key:"_createSplitter",value:function(e){var t;return(t=new f.default(this._isColumn,this._splitterSize,this._splitterGrabSize)).on("drag",(0,p.fnBind)(this._onSplitterDrag,this,[t]),this),t.on("dragStop",(0,p.fnBind)(this._onSplitterDragStop,this,[t]),this),t.on("dragStart",(0,p.fnBind)(this._onSplitterDragStart,this,[t]),this),this._splitter.splice(e,0,t),t}},{key:"_getItemsForSplitter",value:function(e){var t=(0,p.indexOf)(e,this._splitter);return{before:this.contentItems[t],after:this.contentItems[t+1]}}},{key:"_isDocked",value:function(e){if(void 0===e){for(var t=0,n=0;n<this.contentItems.length;++n)this._isDocked(n)&&t++;return t}return e<this.contentItems.length?this.contentItems[e]._docker&&this.contentItems[e]._docker.docked:void 0}},{key:"_validateDocking",value:function(e){for(var t=1<(e=e||this).contentItems.length-e._isDocked(),n=0;n<e.contentItems.length;++n)e.contentItems[n]instanceof d.default&&(e.contentItems[n].header._setDockable(e._isDocked(n)||t),e.contentItems[n].header._$setClosable(t))}},{key:"_getMinimumDimensions",value:function(e){for(var t=0,i=0,o=0;o<e.length;++o)t=n(e[o].minWidth||0,t),i=n(e[o].minHeight||0,i);return{horizontal:t,vertical:i}}},{key:"_onSplitterDragStart",value:function(e){var t=this._getItemsForSplitter(e),n=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],i=this._getMinimumDimensions(t.before.config.content),o=this._isColumn?i.vertical:i.horizontal,r=this._getMinimumDimensions(t.after.config.content),s=this._isColumn?r.vertical:r.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(t.before.element[this._dimension]()-(o||n)),this._splitterMaxPosition=t.after.element[this._dimension]()-(s||n)}},{key:"_onSplitterDrag",value:function(e,t,n){var i=this._isColumn?n:t;i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}},{key:"_onSplitterDragStop",value:function(e){var t=this._getItemsForSplitter(e),n=t.before.element[this._dimension](),i=t.after.element[this._dimension](),o=(this._splitterPosition+n)/(n+i),r=t.before.config[this._dimension]+t.after.config[this._dimension];t.before.config[this._dimension]=o*r,t.after.config[this._dimension]=(1-o)*r,e.element.css({top:0,left:0}),(0,p.animFrame)((0,p.fnBind)(this.callDownwards,this,["setSize"]))}}]),i}(h.default);i.default=m},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=n(2),h=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.timeout=null,i._eElement=$(e),i._oDocument=$(document),i._eBody=$(document.body),i._nButtonCode=n||0,i._nDelay=200,i._nDistance=10,i._nX=0,i._nY=0,i._nOriginalX=0,i._nOriginalY=0,i._bDragging=!1,i._fMove=(0,u.fnBind)(i.onMouseMove,i),i._fUp=(0,u.fnBind)(i.onMouseUp,i),i._fDown=(0,u.fnBind)(i.onMouseDown,i),i._eElement.on("mousedown touchstart",i._fDown),i}return(0,l.default)(t,e),(0,s.default)(t,[{key:"destroy",value:function(){this._eElement.unbind("mousedown touchstart",this._fDown),this._oDocument.unbind("mouseup touchend",this._fUp),this._eElement=null,this._oDocument=null,this._eBody=null}},{key:"onMouseDown",value:function(e){if(e.preventDefault(),0==e.button||"touchstart"===e.type){var t=this._getCoordinates(e);this._nOriginalX=t.x,this._nOriginalY=t.y,this._oDocument.on("mousemove touchmove",this._fMove),this._oDocument.one("mouseup touchend",this._fUp),this._timeout=setTimeout((0,u.fnBind)(this._startDrag,this),this._nDelay)}}},{key:"onMouseMove",value:function(e){var t=Math.abs;if(null!=this._timeout){e.preventDefault();var n=this._getCoordinates(e);this._nX=n.x-this._nOriginalX,this._nY=n.y-this._nOriginalY,!1===this._bDragging&&(t(this._nX)>this._nDistance||t(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}},{key:"onMouseUp",value:function(e){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)))}},{key:"_startDrag",value:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}},{key:"_getCoordinates",value:function(e){return{x:(e=(0,u.getTouchEvent)(e)).pageX,y:e.pageY}}}]),t}(c.default);t.default=h},function(e){var n=Math.ceil;e.exports=function(e){return isNaN(e=+e)?0:(0<e?t:n)(e)}},function(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var i=n(14);e.exports=function(e,t){if(!i(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!i(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e){e.exports={}},function(e,t,n){var i=n(18),o=n(78),r=n(34),s=n(32)("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=n(46)("iframe"),i=r.length;for(t.style.display="none",n(83).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;i--;)delete c[l][r[i]];return c()};e.exports=Object.create||function(e,t){var n;return null===e?n=c():(a[l]=i(e),n=new a,a[l]=null,n[s]=e),void 0===t?n:o(n,t)}},function(e,t,n){var i=n(33)("keys"),o=n(24);e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var i=n(6),o=n(8),r="__core-js_shared__",s=o[r]||(o[r]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0===t?{}:t)})("versions",[]).push({version:i.version,mode:n(21)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var i=n(9).f,o=n(11),r=n(16)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,r)&&i(e,r,{configurable:!0,value:t})}},function(e,t,n){var i=n(28);e.exports=function(e){return Object(i(e))}},function(e,t,n){t.f=n(16)},function(e,t,n){var i=n(8),o=n(6),r=n(21),s=n(37),a=n(9).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(17)),r=i(n(0)),s=i(n(1)),a=n(2),l=function(){function e(){if((0,r.default)(this,e),this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],36<this._keys.length)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]}return(0,s.default)(e,[{key:"minifyConfig",value:function(e){var t={};return this._nextLevel(e,t,"_min"),t}},{key:"unminifyConfig",value:function(e){var t={};return this._nextLevel(e,t,"_max"),t}},{key:"_nextLevel",value:function(e,t,n){var i,r;for(i in e)e instanceof Array&&(i=parseInt(i,10)),e.hasOwnProperty(i)&&(r=this[n](i,this._keys),"object"===(0,o.default)(e[i])?(t[r]=e[i]instanceof Array?[]:{},this._nextLevel(e[i],t[r],n)):t[r]=this[n](e[i],this._values))}},{key:"_min",value:function(e,t){if("string"==typeof e&&1===e.length)return"___"+e;var n=(0,a.indexOf)(e,t);return-1===n?e:n.toString(36)}},{key:"_max",value:function(e,t){return"string"==typeof e&&1===e.length?t[parseInt(e,36)]:"string"==typeof e&&"___"===e.substr(0,3)?e[3]:e}}]),e}();t.default=l},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(20)),u=i(n(25)),h=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n,null));return s.isRoot=!0,s.type="root",s.element=$('<div class="lm_goldenlayout lm_item lm_root"></div>'),s.childElementContainer=s.element,s._containerElement=i,s._containerElement.append(s.element),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"addChild",value:function(e){if(0<this.contentItems.length)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),c.default.prototype.addChild.call(this,e),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}},{key:"setSize",value:function(e,t){e=void 0===e?this._containerElement.width():e,t=void 0===t?this._containerElement.height():t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}},{key:"_$highlightDropZone",value:function(){this.layoutManager.tabDropPlaceholder.remove(),c.default.prototype._$highlightDropZone.apply(this,arguments)}},{key:"_$onDrop",value:function(e,t){var n;if(e.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this))._$init(),n.addChild(e),e=n),this.contentItems.length){var i="x"==t.side[0]?"row":"column",o="x"==t.side[0]?"width":"height",r="2"==t.side[1],s=this.contentItems[0];if(s instanceof u.default&&s.type==i){var a=s.contentItems[r?0:s.contentItems.length-1];s.addChild(e,r?0:void 0,!0),a.config[o]*=.5,e.config[o]=a.config[o],s.callDownwards("setSize")}else{var l=this.layoutManager.createContentItem({type:i},this);this.replaceChild(s,l),l.addChild(e,r?0:void 0,!0),l.addChild(s,r?void 0:0,!0),s.config[o]=50,e.config[o]=50,l.callDownwards("setSize")}}else this.addChild(e)}}]),t}(c.default);t.default=h},function(t,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(3)),a=r(o(0)),l=r(o(1)),c=r(o(4)),u=r(o(5)),h=r(o(20)),d=r(o(25)),f=r(o(60)),p=o(2),m=function(t){function i(e,t,n){(0,a.default)(this,i);var o=(0,c.default)(this,(i.__proto__||(0,s.default)(i)).call(this,e,t,n));o.element=$('<div class="lm_item lm_stack"></div>'),o._activeContentItem=null;var r=e.config;return o._header={show:!0===r.settings.hasHeaders&&!1!==t.hasHeaders,popout:r.settings.showPopoutIcon&&r.labels.popout,maximise:r.settings.showMaximiseIcon&&r.labels.maximise,close:r.settings.showCloseIcon&&r.labels.close,minimise:r.labels.minimise},r.header&&(0,p.copy)(o._header,r.header),t.header&&(0,p.copy)(o._header,t.header),t.content&&t.content[0]&&t.content[0].header&&(0,p.copy)(o._header,t.content[0].header),o._dropZones={},o._dropSegment=null,o._contentAreaDimensions=null,o._dropIndex=null,o.isStack=!0,o.childElementContainer=$('<div class="lm_items"></div>'),o.header=new f.default(e,o),o.element.on("mouseleave mouseenter",(0,p.fnBind)(function(e){this._docker&&this._docker.docked&&this.childElementContainer[this._docker.dimension]("mouseenter"==e.type?this._docker.realSize:0)},o)),o.element.append(o.header.element),o.element.append(o.childElementContainer),o._setupHeaderPosition(),o._$validateClosability(),o}return(0,u.default)(i,t),(0,l.default)(i,[{key:"dock",value:function(e){this._header.dock&&this.parent instanceof d.default&&this.parent.dock(this,e)}},{key:"setSize",value:function(){if("none"!==this.element.css("display")){var e=this._docker&&this._docker.docked,t={width:this.element.width(),height:this.element.height()};this._header.show&&(t[this._sided?"width":"height"]-=this.layoutManager.config.dimensions.headerHeight),e&&(t[this._docker.dimension]=this._docker.realSize),e&&"height"!=this._docker.dimension||this.childElementContainer.width(t.width),e&&"width"!=this._docker.dimension||this.childElementContainer.height(t.height);for(var n=0;n<this.contentItems.length;n++)this.contentItems[n].element.width(t.width),this.contentItems[n].element.height(t.height);this.emit("resize"),this.emitBubblingEvent("stateChanged")}}},{key:"_$init",value:function(){var e,t;if(!0!==this.isInitialised){for(h.default.prototype._$init.call(this),e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(0<this.contentItems.length){if(!(t=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}},{key:"setActiveContentItem",value:function(e){if(-1===(0,p.indexOf)(e,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}},{key:"getActiveContentItem",value:function(){return this.header.activeContentItem}},{key:"addChild",value:function(e,t){t>this.contentItems.length&&(t-=1),e=this.layoutManager._$normalizeContentItem(e,this),h.default.prototype.addChild.call(this,e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.parent instanceof d.default&&this.parent._validateDocking(),this.emitBubblingEvent("stateChanged")}},{key:"removeChild",value:function(e,t){var i=(0,p.indexOf)(e,this.contentItems);h.default.prototype.removeChild.call(this,e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(0<this.contentItems.length?this.setActiveContentItem(this.contentItems[n(i-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.parent instanceof d.default&&this.parent._validateDocking(),this.emitBubblingEvent("stateChanged")}},{key:"undisplayChild",value:function(e){if(1<this.contentItems.length){var t=(0,p.indexOf)(e,this.contentItems);e._$hide&&e._$hide(),this.setActiveContentItem(this.contentItems[0===t?t+1:t-1])}else h.default.prototype.undisplayChild.call(this,e),this.parent instanceof d.default&&this.parent._validateDocking();this.emitBubblingEvent("stateChanged")}},{key:"_$validateClosability",value:function(){var e,t,n;for(e=this.header._isClosable(),n=0,t=this.contentItems.length;n<t&&e;n++)e=this.contentItems[n].config.isClosable;this.header._$setClosable(e)}},{key:"_$destroy",value:function(){h.default.prototype._$destroy.call(this),this.header._$destroy(),this.element.off("mouseenter mouseleave")}},{key:"_$onDrop",value:function(e){if("header"===this._dropSegment)return this._resetHeaderDropZone(),void this.addChild(e,this._dropIndex);if("body"!==this._dropSegment){var t,n,i,o="top"===this._dropSegment||"bottom"===this._dropSegment,r="left"===this._dropSegment||"right"===this._dropSegment,s="top"===this._dropSegment||"left"===this._dropSegment,a=o&&this.parent.isColumn||r&&this.parent.isRow,l=o?"column":"row",c=o?"height":"width";e.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this))._$init(),n.addChild(e),e=n),a?(t=(0,p.indexOf)(this,this.parent.contentItems),this.parent.addChild(e,s?t:t+1,!0),this.config[c]*=.5,e.config[c]=this.config[c],this.parent.callDownwards("setSize")):(l=o?"column":"row",i=this.layoutManager.createContentItem({type:l},this),this.parent.replaceChild(this,i),i.addChild(e,s?0:void 0,!0),i.addChild(this,s?void 0:0,!0),this.config[c]=50,e.config[c]=50,i.callDownwards("setSize")),this.parent._validateDocking()}else this.addChild(e)}},{key:"_$highlightDropZone",value:function(e,t){var n,i;for(n in this._contentAreaDimensions)if((i=this._contentAreaDimensions[n].hoverArea).x1<e&&i.x2>e&&i.y1<t&&i.y2>t)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?t:e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))}},{key:"_$getArea",value:function(){if("none"===this.element.css("display"))return null;var e=h.default.prototype._$getArea,t=e.call(this,this.header.element),n=e.call(this,this.childElementContainer),i=n.x2-n.x1,o=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?t:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},e.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*i,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*i,y1:n.y1,x2:n.x1+.75*i,y2:n.y1+.5*o},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*o}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*i,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*i,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*i,y1:n.y1+.5*o,x2:n.x1+.75*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*o,x2:n.x2,y2:n.y2}},e.call(this,this.element))}},{key:"_highlightHeaderDropZone",value:function(t){var n,i,o,r,s,a,l,c,u=this.header.tabs.length,h=!1;if(0===u)return l=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:l.left,x2:l.left+100,y1:l.top+this.header.element.height()-20,y2:l.top+this.header.element.height()});for(n=0;n<u;n++)if(s=(i=this.header.tabs[n].element).offset(),this._sided?(r=s.top,o=s.left,c=i.height()):(r=s.left,o=s.top,c=i.width()),t>r&&t<r+c){h=!0;break}if(!(0==h&&t<r)){if(t<r+c/2?(this._dropIndex=n,i.before(this.layoutManager.tabDropPlaceholder)):(this._dropIndex=e(n+1,u),i.after(this.layoutManager.tabDropPlaceholder)),this._sided){var d=this.layoutManager.tabDropPlaceholder.offset().top;return void this.layoutManager.dropTargetIndicator.highlightArea({x1:o,x2:o+i.innerHeight(),y1:d,y2:d+this.layoutManager.tabDropPlaceholder.width()})}a=this.layoutManager.tabDropPlaceholder.offset().left,this.layoutManager.dropTargetIndicator.highlightArea({x1:a,x2:a+this.layoutManager.tabDropPlaceholder.width(),y1:o,y2:o+i.innerHeight()})}}},{key:"_resetHeaderDropZone",value:function(){this.layoutManager.tabDropPlaceholder.remove()}},{key:"toggleMaximise",value:function(e){this.isMaximised||this.dock(!1),h.default.prototype.toggleMaximise.call(this,e)}},{key:"_setupHeaderPosition",value:function(){var e=0<=["right","left","bottom"].indexOf(this._header.show)&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=e,this._sided=0<=["right","left"].indexOf(this._side),this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var t=0<=["right","bottom"].indexOf(this._side)?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}},{key:"_highlightBodyDropZone",value:function(e){var t=this._contentAreaDimensions[e].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(t),this._dropSegment=e}}]),i}(h.default);i.default=m},function(e,t,n){var i=n(21),o=n(12),r=n(47),s=n(13),a=n(30),l=n(77),c=n(35),u=n(50),h=n(16)("iterator"),d=!([].keys&&"next"in[].keys()),f="keys",p="values",m=function(){return this};e.exports=function(e,t,n,g,y,v,_){l(n,t,g);var b,w,x,k=function(e){return!d&&e in $?$[e]:function(){return new n(this,e)}},I=t+" Iterator",C=y==p,S=!1,$=e.prototype,E=$[h]||$["@@iterator"]||y&&$[y],M=E||k(y),T=y?C?k("entries"):M:void 0,P="Array"==t&&$.entries||E;if(P&&((x=u(P.call(new e)))!==Object.prototype&&x.next&&(c(x,I,!0),!i&&"function"!=typeof x[h]&&s(x,h,m))),C&&E&&E.name!==p&&(S=!0,M=function(){return E.call(this)}),(!i||_)&&(d||S||!$[h])&&s($,h,M),a[t]=M,a[I]=m,y)if(b={values:C?M:k(p),keys:v?M:k(f),entries:T},_)for(w in b)w in $||r($,w,b[w]);else o(o.P+o.F*(d||S),t,b);return b}},function(e,t,n){var i=n(76);e.exports=function(e,t,n){return i(e),void 0===t?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,i){return e.call(t,n,i)}:3===n?function(n,i,o){return e.call(t,n,i,o)}:function(){return e.apply(t,arguments)}}},function(e,t,n){e.exports=!n(10)&&!n(19)(function(){return 7!=Object.defineProperty(n(46)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(14),o=n(8).document,r=i(o)&&i(o.createElement);e.exports=function(e){return r?o.createElement(e):{}}},function(e,t,n){e.exports=n(13)},function(e,t,n){var i=n(11),o=n(15),r=n(80)(!1),s=n(32)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),l=0,c=[];for(n in a)n!=s&&i(a,n)&&c.push(n);for(;t.length>l;)i(a,n=t[l++])&&(~r(c,n)||c.push(n));return c}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var i=n(11),o=n(36),r=n(32)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),i(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var i=n(48),o=n(34).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},function(e,t,n){var i=n(39),o=n(22),r=n(15),s=n(29),a=n(11),l=n(45),c=Object.getOwnPropertyDescriptor;t.f=n(10)?c:function(e,t){if(e=r(e),t=s(t,!0),l)try{return c(e,t)}catch(t){}return a(e,t)?o(!i.f.call(e,t),e[t]):void 0}},function(e,t,n){var i=n(12),o=n(6),r=n(19);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),i(i.S+i.F*r(function(){n(1)}),"Object",s)}},function(e,t,n){e.exports={default:n(107),__esModule:!0}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n){(0,o.default)(this,e),this._reactComponent=null,this._originalComponentWillUpdate=null,this._container=t,this._initialState=n,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}return(0,r.default)(e,[{key:"_render",value:function(){this._reactComponent=ReactDOM.render(this._getReactComponent(),this._container.getElement()[0]),this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this),this._container.getState()&&this._reactComponent.setState(this._container.getState())}},{key:"_destroy",value:function(){ReactDOM.unmountComponentAtNode(this._container.getElement()[0]),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}},{key:"_onUpdate",value:function(e,t){this._container.setState(t),this._originalComponentWillUpdate.call(this._reactComponent,e,t)}},{key:"_getReactClass",value:function(){var e,t=this._container._config.component;if(!t)throw new Error("No react component name. type: react-component needs a field `component`");if(!(e=this._container.layoutManager.getComponent(t)))throw new Error('React component "'+t+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return e}},{key:"_getReactComponent",value:function(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container},t=$.extend(e,this._container._config.props);return React.createElement(this._reactClass,t)}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=n(7),u=i(c),h=n(2),d=function(e){function t(e){(0,r.default)(this,t);var n=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return n._layoutManager=e,n._dontPropagateToParent=null,n._childEventSource=null,n.on(c.ALL_EVENT,(0,h.fnBind)(n._onEventFromThis,n)),n._boundOnEventFromChild=(0,h.fnBind)(n._onEventFromChild,n),$(window).on("gl_child_event",n._boundOnEventFromChild),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"_onEventFromThis",value:function(){var e=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&e[0]!==this._dontPropagateToParent&&this._propagateToParent(e),this._propagateToChildren(e),this._dontPropagateToParent=null,this._childEventSource=null}},{key:"_$onEventFromParent",value:function(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}},{key:"_onEventFromChild",value:function(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}},{key:"_propagateToParent",value:function(e){var t,n="gl_child_event";document.createEvent?(t=window.opener.document.createEvent("HTMLEvents")).initEvent(n,!0,!0):(t=window.opener.document.createEventObject()).eventType=n,t.eventName=n,t.__glArgs=e,t.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(t):window.opener.fireEvent("on"+t.eventType,t)}},{key:"_propagateToChildren",value:function(e){var t,n;for(n=0;n<this._layoutManager.openPopouts.length;n++)(t=this._layoutManager.openPopouts[n].getGlInstance())&&t!==this._childEventSource&&t.eventHub._$onEventFromParent(e)}},{key:"destroy",value:function(){$(window).off("gl_child_event",this._boundOnEventFromChild)}}]),t}(u.default);t.default=d},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n){(0,o.default)(this,e),this.name=t,this.origin=n,this.isPropagationStopped=!1}return(0,r.default)(e,[{key:"stopPropagation",value:function(){this.isPropagationStopped=!0}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(4)),a=i(n(5)),l=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,s.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.name="Configuration Error",i.message=e,i.node=n,i}return(0,a.default)(t,e),t}(Error);t.default=l,l.prototype=new Error},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=i(n(61)),h=i(n(63)),d=n(2),f=function(e){function t(e,n){(0,r.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return i.layoutManager=e,i.element=$('<div class="lm_header"><ul class="lm_tabs"></ul><ul class="lm_controls"></ul><ul class="lm_tabdropdown_list"></ul></div>'),!0===i.layoutManager.config.settings.selectionEnabled&&(i.element.addClass("lm_selectable"),i.element.on("click touchstart",(0,d.fnBind)(i._onHeaderClick,i))),i.tabsContainer=i.element.find(".lm_tabs"),i.tabDropdownContainer=i.element.find(".lm_tabdropdown_list"),i.tabDropdownContainer.hide(),i.controlsContainer=i.element.find(".lm_controls"),i.parent=n,i.parent.on("resize",i._updateTabSizes,i),i.tabs=[],i.activeContentItem=null,i.closeButton=null,i.dockButton=null,i.tabDropdownButton=null,i.hideAdditionalTabsDropdown=(0,d.fnBind)(i._hideAdditionalTabsDropdown,i),$(document).mouseup(i.hideAdditionalTabsDropdown),i._lastVisibleTabIndex=-1,i._tabControlOffset=i.layoutManager.config.settings.tabControlOffset,i._createControls(),i}return(0,l.default)(t,e),(0,s.default)(t,[{key:"createTab",value:function(e,t){var n,i;for(i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===e)return;return n=new u.default(this,e),0===this.tabs.length?(this.tabs.push(n),void this.tabsContainer.append(n.element)):(void 0===t&&(t=this.tabs.length),0<t?this.tabs[t-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(t,0,n),void this._updateTabSizes())}},{key:"removeTab",value:function(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e)return this.tabs[t]._$destroy(),void this.tabs.splice(t,1);throw new Error("contentItem is not controlled by this header")}},{key:"setActiveContentItem",value:function(e){var t,n,i,o;for(t=0;t<this.tabs.length;t++)i=this.tabs[t].contentItem===e,this.tabs[t].setActive(i),!0===i&&(this.activeContentItem=e,this.parent.config.activeItemIndex=t);if(this.layoutManager.config.settings.reorderOnTabMenuClick&&-1!==this._lastVisibleTabIndex&&this.parent.config.activeItemIndex>this._lastVisibleTabIndex){for(o=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;0<n;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=o,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}},{key:"position",value:function(e){var t=this.parent._header.show;if(this.parent._docker&&this.parent._docker.docked)throw new Error("Can't change header position in docked stack");return t&&!this.parent._side&&(t="top"),void 0!==e&&this.parent._header.show!=e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}},{key:"_$setClosable",value:function(e){return this._canDestroy=e||1<this.tabs.length,this.closeButton&&this._isClosable()&&(this.closeButton.element[e?"show":"hide"](),!0)}},{key:"_setDockable",value:function(e){return this.dockButton&&this.parent._header&&this.parent._header.dock&&(this.dockButton.element.toggle(!!e),!0)}},{key:"_$destroy",value:function(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();$(document).off("mouseup",this.hideAdditionalTabsDropdown),this.element.remove()}},{key:"_getHeaderSetting",value:function(e){if(e in this.parent._header)return this.parent._header[e]}},{key:"_createControls",value:function(){var e,t,n,i,o,r,s,a,l;if(l=(0,d.fnBind)(this._showAdditionalTabsDropdown,this),a=this.layoutManager.config.labels.tabDropdown,this.tabDropdownButton=new h.default(this,a,"lm_tabdropdown",l),this.tabDropdownButton.element.hide(),this.parent._header&&this.parent._header.dock){var c=(0,d.fnBind)(this.parent.dock,this.parent);n=this._getHeaderSetting("dock"),this.dockButton=new h.default(this,n,"lm_dock",c)}this._getHeaderSetting("popout")&&(t=(0,d.fnBind)(this._onPopoutClick,this),n=this._getHeaderSetting("popout"),new h.default(this,n,"lm_popout",t)),this._getHeaderSetting("maximise")&&(r=(0,d.fnBind)(this.parent.toggleMaximise,this.parent),i=this._getHeaderSetting("maximise"),o=this._getHeaderSetting("minimise"),s=new h.default(this,i,"lm_maximise",r),this.parent.on("maximised",function(){s.element.attr("title",o)}),this.parent.on("minimised",function(){s.element.attr("title",i)})),this._isClosable()&&(e=(0,d.fnBind)(this.parent.remove,this.parent),n=this._getHeaderSetting("close"),this.closeButton=new h.default(this,n,"lm_close",e))}},{key:"_showAdditionalTabsDropdown",value:function(){this.tabDropdownContainer.show()}},{key:"_hideAdditionalTabsDropdown",value:function(){this.tabDropdownContainer.hide()}},{key:"_isClosable",value:function(){return this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon}},{key:"_onPopoutClick",value:function(){!0===this.layoutManager.config.settings.popoutWholeStack?this.parent.popout():this.activeContentItem.popout()}},{key:"_onHeaderClick",value:function(e){e.target===this.element[0]&&this.parent.select()}},{key:"_updateTabSizes",value:function(e){if(0!==this.tabs.length){this.tabDropdownButton.element.toggle(!0===e);var t=function(e){return e?"width":"height"};this.element.css(t(!this.parent._sided),""),this.element[t(this.parent._sided)](this.layoutManager.config.dimensions.headerHeight);var n,i,o,r,s=this.element.outerWidth()-this.controlsContainer.outerWidth()-this._tabControlOffset,a=0,l=0,c=0,u=this.layoutManager.config.settings.tabOverlapAllowance,h=!1,d=this.activeContentItem?this.tabs.indexOf(this.activeContentItem.tab):0,f=this.tabs[d];for(this.parent._sided&&(s=this.element.outerHeight()-this.controlsContainer.outerHeight()-this._tabControlOffset),this._lastVisibleTabIndex=-1,i=0;i<this.tabs.length;i++)if(n=this.tabs[i].element,this.tabsContainer.append(n),a+=n.outerWidth()+parseInt(n.css("margin-right"),10),(l=d<=i?a:a+f.element.outerWidth()+parseInt(f.element.css("margin-right"),10))>s){if(h)i===d&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((c=0<d&&d<=i?(l-s)/(i-1):(l-s)/i)<u){for(o=0;o<=i;o++)r=o!==d&&0!==o?"-"+c+"px":"",this.tabs[o].element.css({"z-index":i-o,"margin-left":r});this._lastVisibleTabIndex=i,this.tabsContainer.append(n)}else h=!0;if(h&&i!==d){if(!e)return void this._updateTabSizes(!0);n.css({"z-index":"auto","margin-left":""}),this.tabDropdownContainer.append(n)}}else this._lastVisibleTabIndex=i,n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n)}}}]),t}(c.default);t.default=f},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=i(n(62)),l=n(2),c=function(){function e(t,n){(0,o.default)(this,e),this.header=t,this.contentItem=n,this.element=$('<li class="lm_tab"><i class="lm_left"></i><span class="lm_title"></span><div class="lm_close_tab"></div><i class="lm_right"></i></li>'),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[n.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(n.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===n.config.reorderEnabled&&(this._dragListener=new s.default(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=(0,l.fnBind)(this._onTabClick,this),this._onCloseClickFn=(0,l.fnBind)(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}return(0,r.default)(e,[{key:"setTitle",value:function(e){this.element.attr("title",(0,l.stripTags)(e)),this.titleElement.html(e)}},{key:"setActive",value:function(e){e===this.isActive||(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}},{key:"_$destroy",value:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()}},{key:"_onDragStart",value:function(e,t){return this.header._canDestroy?(!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),void new a.default(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)):null}},{key:"_onTabClick",value:function(e){if(0===e.button||"touchstart"===e.type){var t=this.header.parent.getActiveContentItem();this.contentItem!==t&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===e.button&&this.contentItem.config.isClosable&&this._onCloseClick(e)}},{key:"_onCloseClick",value:function(e){e.stopPropagation(),this.header._canDestroy&&this.header.parent.removeChild(this.contentItem)}},{key:"_onCloseMousedown",value:function(e){e.stopPropagation()}}]),e}();t.default=c},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(7)),u=n(2),h=function(e){function t(e,n,i,s,l,c){(0,r.default)(this,t);var h=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));h._dragListener=i,h._layoutManager=s,h._contentItem=l,h._originalParent=c,h._area=null,h._lastValidArea=null,h._dragListener.on("drag",h._onDrag,h),h._dragListener.on("dragStop",h._onDrop,h),h.element=$('<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>'),c&&c._side&&(h._sided=c._sided,h.element.addClass("lm_"+c._side),0<=["right","bottom"].indexOf(c._side)&&h.element.find(".lm_content").after(h.element.find(".lm_header"))),h.element.css({left:e,top:n}),h.element.find(".lm_tab").attr("title",(0,u.stripTags)(h._contentItem.config.title)),h.element.find(".lm_title").html(h._contentItem.config.title),h.childElementContainer=h.element.find(".lm_content"),h.childElementContainer.append(l.element),h._undisplayTree(),h._layoutManager._$calculateItemAreas(),h._setDimensions(),$(document.body).append(h.element);var d=h._layoutManager.container.offset();return h._minX=d.left,h._minY=d.top,h._maxX=h._layoutManager.container.width()+h._minX,h._maxY=h._layoutManager.container.height()+h._minY,h._width=h.element.width(),h._height=h.element.height(),h._setDropPosition(e,n),h}return(0,l.default)(t,e),(0,s.default)(t,[{key:"_onDrag",value:function(e,t,n){var i=(n=(0,u.getTouchEvent)(n)).pageX,o=n.pageY;(i>this._minX&&i<this._maxX&&o>this._minY&&o<this._maxY||!0!==this._layoutManager.config.settings.constrainDragToContainer)&&this._setDropPosition(i,o)}},{key:"_setDropPosition",value:function(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),null!==this._area&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}},{key:"_onDrop",value:function(){this._updateTree(),this._layoutManager.dropTargetIndicator.hide(),null===this._area?null===this._lastValidArea?this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy():this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._area.contentItem._$onDrop(this._contentItem,this._area),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}},{key:"_undisplayTree",value:function(){this._contentItem.parent&&this._contentItem.parent.undisplayChild(this._contentItem)}},{key:"_updateTree",value:function(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(this)}},{key:"_setDimensions",value:function(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}]),t}(c.default);t.default=h},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(t,n,i,r){(0,o.default)(this,e),this._header=t,this.element=$('<li class="'+i+'" title="'+n+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)}return(0,r.default)(e,[{key:"_$destroy",value:function(){this.element.off(),this.element.remove()}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=i(n(20)),u=i(n(65)),h=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n,i)),l=e.getComponent(s.config.componentName),c=$.extend(!0,{},s.config.componentState||{});return c.componentName=s.config.componentName,s.componentName=s.config.componentName,""===s.config.title&&(s.config.title=s.config.componentName),s.isComponent=!0,s.container=new u.default(s.config,s,e),s.instance=new l(s.container,c),s.element=s.container._element,s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"close",value:function(){this.parent.removeChild(this)}},{key:"setSize",value:function(){"none"!==this.element.css("display")&&this.container._$setSize(this.element.width(),this.element.height())}},{key:"_$init",value:function(){c.default.prototype._$init.call(this),this.container.emit("open")}},{key:"_$hide",value:function(){this.container.hide(),c.default.prototype._$hide.call(this)}},{key:"_$show",value:function(){this.container.show(),c.default.prototype._$show.call(this)}},{key:"_$shown",value:function(){this.container.shown(),c.default.prototype._$shown.call(this)}},{key:"_$destroy",value:function(){this.container.emit("destroy",this),c.default.prototype._$destroy.call(this)}},{key:"_$getArea",value:function(){return null}}]),t}(c.default);t.default=h},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(0)),s=i(n(1)),a=i(n(4)),l=i(n(5)),c=function(e){function t(e,n,i){(0,r.default)(this,t);var s=(0,a.default)(this,(t.__proto__||(0,o.default)(t)).call(this));return s.width=null,s.height=null,s.title=e.componentName,s.parent=n,s.layoutManager=i,s.isHidden=!1,s._config=e,s._element=$('<div class="lm_item_container"><div class="lm_content"></div></div>'),s._contentElement=s._element.find(".lm_content"),s}return(0,l.default)(t,e),(0,s.default)(t,[{key:"getElement",value:function(){return this._contentElement}},{key:"hide",value:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()}},{key:"show",value:function(){this.emit("show"),this.isHidden=!1,this._element.show(),(0!=this.height||0!=this.width)&&this.emit("shown")}},{key:"setSize",value:function(e,t){for(var n,i,o,r,s=this.parent,a=this;!s.isColumn&&!s.isRow;)if(a=s,(s=s.parent).isRoot)return!1;for(n=("height"===(i=s.isColumn?"height":"width")?t:e)/(this[i]*(1/(a.config[i]/100)))*100,o=(a.config[i]-n)/(s.contentItems.length-1),r=0;r<s.contentItems.length;r++)s.contentItems[r]===a?s.contentItems[r].config[i]=n:s.contentItems[r].config[i]+=o;return s.callDownwards("setSize"),!0}},{key:"close",value:function(){this._config.isClosable&&(this.emit("close"),this.parent.close())}},{key:"getState",value:function(){return this._config.componentState}},{key:"extendState",value:function(e){this.setState($.extend(!0,this.getState(),e))}},{key:"setState",value:function(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}},{key:"setTitle",value:function(e){this.parent.setTitle(e)}},{key:"_$setSize",value:function(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,$.zepto?this._contentElement.width(e):this._contentElement.outerWidth(e),$.zepto?this._contentElement.height(t):this._contentElement.outerHeight(t),this.emit("resize"))}}]),t}(i(n(7)).default);t.default=c},function(e,n,i){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(i(114)),s=o(i(3)),a=o(i(0)),l=o(i(1)),c=o(i(4)),u=o(i(5)),h=o(i(7)),d=o(i(40)),f=i(2),p=function(e){function n(e,t,i,o,r){(0,a.default)(this,n);var l=(0,c.default)(this,(n.__proto__||(0,s.default)(n)).call(this));return l.isInitialised=!1,l._config=e,l._dimensions=t,l._parentId=i,l._indexInParent=o,l._layoutManager=r,l._popoutWindow=null,l._id=null,l._createWindow(),l}return(0,u.default)(n,e),(0,l.default)(n,[{key:"toConfig",value:function(){if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:this.getGlInstance().width,height:this.getGlInstance().height,left:this._popoutWindow.screenX||this._popoutWindow.screenLeft,top:this._popoutWindow.screenY||this._popoutWindow.screenTop},content:this.getGlInstance().toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}},{key:"getGlInstance",value:function(){return this._popoutWindow.__glInstance}},{key:"getWindow",value:function(){return this._popoutWindow}},{key:"close",value:function(){if(this.getGlInstance())this.getGlInstance()._$closeWindow();else try{this.getWindow().close()}catch(e){}}},{key:"popIn",value:function(){var e,t;this._indexInParent;this._parentId&&(e=$.extend(!0,{},this.getGlInstance().toConfig()).content[0],!(t=this._layoutManager.root.getItemsById(this._parentId)[0])&&(t=0<this._layoutManager.root.contentItems.length?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),t.addChild(e,this._indexInParent),this.close()}},{key:"_createWindow",value:function(){var e,n=this._createUrl(),i=t(1e6*Math.random()).toString(36),o=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(n,i,o),this._popoutWindow)$(this._popoutWindow).on("load",(0,f.fnBind)(this._positionWindow,this)).on("unload beforeunload",(0,f.fnBind)(this._onClose,this)),e=setInterval((0,f.fnBind)(function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(e))},this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}}},{key:"_serializeWindowOptions",value:function(e){var t,n=[];for(t in e)n.push(t+"="+e[t]);return n.join(",")}},{key:"_createUrl",value:function(){var e,t={content:this._config},n="gl-window-config-"+(0,f.getUniqueId)();t=(new d.default).minifyConfig(t);try{localStorage.setItem(n,(0,r.default)(t))}catch(n){throw new Error("Error while writing to localStorage "+n.toString())}return 1===(e=document.location.href.split("?")).length?e[0]+"?gl-window="+n:document.location.href+"&gl-window="+n}},{key:"_positionWindow",value:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()}},{key:"_onInitialised",value:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")}},{key:"_onClose",value:function(){setTimeout((0,f.fnBind)(this.emit,this,["closed"]),50)}}]),n}(h.default);n.default=p},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=n(68),o=(n.n(i),n(69)),r=(n.n(o),n(70)),s=(n.n(r),n(71)),a=n.n(s);n.d(t,"default",function(){return a.a});var l=n(65),c=n.n(l);n.d(t,"ItemContainer",function(){return c.a});var u=n(66),h=n.n(u);n.d(t,"BrowserPopout",function(){return h.a});var d=n(60),f=n.n(d);n.d(t,"Header",function(){return f.a});var p=n(63),m=n.n(p);n.d(t,"HeaderButton",function(){return m.a});var g=n(61),y=n.n(g);n.d(t,"Tab",function(){return y.a});var v=n(64),_=n.n(v);n.d(t,"Component",function(){return _.a});var b=n(41),w=n.n(b);n.d(t,"Root",function(){return w.a});var x=n(25),k=n.n(x);n.d(t,"RowOrColumn",function(){return k.a});var I=n(42),C=n.n(I);n.d(t,"Stack",function(){return C.a});var S=n(58),$=n.n(S);n.d(t,"BubblingEvent",function(){return $.a});var E=n(40),M=n.n(E);n.d(t,"ConfigMinifier",function(){return M.a});var T=n(26),P=n.n(T);n.d(t,"DragListener",function(){return P.a});var D=n(7),j=n.n(D);n.d(t,"EventEmitter",function(){return j.a});var A=n(57),O=n.n(A);n.d(t,"EventHub",function(){return O.a});var z=n(56),N=n.n(z);n.d(t,"ReactComponentHandler",function(){return N.a}),n(120),n(123)},function(){},function(){},function(){},function(e,i,o){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var s=r(o(17)),a=r(o(3)),l=r(o(0)),c=r(o(1)),u=r(o(4)),h=r(o(5)),d=r(o(7)),f=r(o(56)),p=r(o(40)),m=r(o(57)),g=r(o(41)),y=r(o(25)),v=r(o(42)),_=r(o(64)),b=r(o(20)),w=r(o(66)),x=r(o(116)),k=r(o(117)),I=r(o(118)),C=r(o(59)),S=r(o(119)),E=o(2),M=function(e){function i(e,t){if((0,l.default)(this,i),!$){var n="jQuery is missing as dependency for GoldenLayout. ";throw n+='Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to ',n+="your paths when using RequireJS/AMD",new Error(n)}var o=(0,u.default)(this,(i.__proto__||(0,a.default)(i)).call(this));return o.isInitialised=!1,o._isFullPage=!1,o._resizeTimeoutId=null,o._components={"lm-react-component":f.default},o._itemAreas=[],o._resizeFunction=(0,E.fnBind)(o._onResize,o),o._unloadFunction=(0,E.fnBind)(o._onUnload,o),o._maximisedItem=null,o._maximisePlaceholder=$('<div class="lm_maximise_place"></div>'),o._creationTimeoutPassed=!1,o._subWindowsCreated=!1,o._dragSources=[],o._updatingColumnsResponsive=!1,o._firstLoad=!0,o.width=null,o.height=null,o.root=null,o.openPopouts=[],o.selectedItem=null,o.isSubWindow=!1,o.eventHub=new m.default(o),o.config=o._createConfig(e),o.container=t,o.dropTargetIndicator=null,o.transitionIndicator=null,o.tabDropPlaceholder=$('<div class="lm_drop_tab_placeholder"></div>'),!0===o.isSubWindow&&$("body").css("visibility","hidden"),o._typeToItem={column:(0,E.fnBind)(y.default,o,[!0]),row:(0,E.fnBind)(y.default,o,[!1]),stack:v.default,component:_.default},o}return(0,h.default)(i,e),(0,c.default)(i,[{key:"minifyConfig",value:function(e){return(new p.default).minifyConfig(e)}},{key:"unminifyConfig",value:function(e){return(new p.default).unminifyConfig(e)}},{key:"registerComponent",value:function(e,t){if("function"!=typeof t)throw new Error("Please register a constructor function");if(void 0!==this._components[e])throw new Error("Component "+e+" is already registered");this._components[e]=t}},{key:"toConfig",value:function(e){var t,n,i;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof b.default))throw new Error("Root must be a ContentItem");for((t={settings:(0,E.copy)({},this.config.settings),dimensions:(0,E.copy)({},this.config.dimensions),labels:(0,E.copy)({},this.config.labels)}).content=[],(n=function(e,t){var i,o;for(i in t.config)"content"!==i&&(e[i]=t.config[i]);if(t.contentItems.length)for(e.content=[],o=0;o<t.contentItems.length;o++)e.content[o]={},n(e.content[o],t.contentItems[o])})(t,e?{contentItems:[e]}:this.root),this._$reconcilePopoutWindows(),t.openPopouts=[],i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":null,t}},{key:"getComponent",value:function(e){if(void 0===this._components[e])throw new C.default('Unknown component "'+e+'"');return this._components[e]}},{key:"init",value:function(){return!1===this._subWindowsCreated&&(this._createSubWindows(),this._subWindowsCreated=!0),"loading"===document.readyState||null===document.body?void $(document).ready((0,E.fnBind)(this.init,this)):!0===this.isSubWindow&&!1===this._creationTimeoutPassed?(setTimeout((0,E.fnBind)(this.init,this),7),void(this._creationTimeoutPassed=!0)):(!0===this.isSubWindow&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new k.default(this.container),this.transitionIndicator=new I.default,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),void this.emit("initialised"))}},{key:"updateSize",value:function(e,t){2===arguments.length?(this.width=e,this.height=t):(this.width=this.container.width(),this.height=this.container.height()),!0===this.isInitialised&&(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem&&(this._maximisedItem.element.width(this.container.width()),this._maximisedItem.element.height(this.container.height()),this._maximisedItem.callDownwards("setSize")),this._adjustColumnsResponsive())}},{key:"destroy",value:function(){!1===this.isInitialised||(this._onUnload(),$(window).off("resize",this._resizeFunction),$(window).off("unload beforeunload",this._unloadFunction),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),this.dropTargetIndicator.destroy(),this.transitionIndicator.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(e){e._dragListener.destroy(),e._element=null,e._itemConfig=null,e._dragListener=null}),this._dragSources=[])}},{key:"createContentItem",value:function(e,t){var n;if("string"!=typeof e.type)throw new C.default("Missing parameter 'type'",e);if("react-component"===e.type&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw n="Unknown type '"+e.type+"'. Valid types are "+(0,E.objectKeys)(this._typeToItem).join(","),new C.default(n);return"component"!==e.type||t instanceof v.default||!t||!0===this.isSubWindow&&t instanceof g.default||(e={type:"stack",width:e.width,height:e.height,content:[e]}),new this._typeToItem[e.type](this,e,t)}},{key:"createPopout",value:function(e,t,n,i){var o,r,s,a,l,c,u=e,h=e instanceof b.default,d=this;if(n=n||null,h){for(u=this.toConfig(e).content,n=(0,E.getUniqueId)(),a=e.parent,l=e;1===a.contentItems.length&&!a.isRoot;)a=a.parent,l=l.parent;a.addId(n),isNaN(i)&&(i=(0,E.indexOf)(l,a.contentItems))}else u instanceof Array||(u=[u]);return!t&&h&&(o=window.screenX||window.screenLeft,r=window.screenY||window.screenTop,t={left:o+(s=e.element.offset()).left,top:r+s.top,width:e.element.width(),height:e.element.height()}),t||h||(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),h&&e.remove(),(c=new w.default(u,t,n,i,this)).on("initialised",function(){d.emit("windowOpened",c)}),c.on("closed",function(){d._$reconcilePopoutWindows()}),this.openPopouts.push(c),c}},{key:"createDragSource",value:function(e,t){this.config.settings.constrainDragToContainer=!1;var n=new x.default($(e),t,this);return this._dragSources.push(n),n}},{key:"selectItem",value:function(e,t){if(!0!==this.config.settings.selectionEnabled)throw new Error("Please set selectionEnabled to true to use this feature");e===this.selectedItem||(null!==this.selectedItem&&this.selectedItem.deselect(),e&&!0!==t&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}},{key:"_$maximiseItem",value:function(e){null!==this._maximisedItem&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width(this.container.width()),e.element.height(this.container.height()),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}},{key:"_$minimiseItem",value:function(e){e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),e.parent.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}},{key:"_$closeWindow",value:function(){window.setTimeout(function(){window.close()},1)}},{key:"_$getArea",value:function(e,t){var n,i,o=1/0,r=null;for(n=0;n<this._itemAreas.length;n++)e>(i=this._itemAreas[n]).x1&&e<i.x2&&t>i.y1&&t<i.y2&&o>i.surface&&(o=i.surface,r=i);return r}},{key:"_$createRootItemAreas",value:function(){var e={y2:0,x2:0,y1:"y2",x1:"x2"};for(var t in e){var n=this.root._$getArea();n.side=t,n[t]=e[t]?n[e[t]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}}},{key:"_$calculateItemAreas",value:function(){var e,t,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),e=0;e<n.length;e++)if(n[e].isStack){if(null===(t=n[e]._$getArea()))continue;if(t instanceof Array)this._itemAreas=this._itemAreas.concat(t);else{this._itemAreas.push(t);var i={};(0,E.copy)(i,t),(0,E.copy)(i,t.contentItem._contentAreaDimensions.header.highlightArea),i.surface=(i.x2-i.x1)*(i.y2-i.y1),this._itemAreas.push(i)}}}else this._itemAreas.push(this.root._$getArea())}},{key:"_$normalizeContentItem",value:function(e,t){if(!e)throw new Error("No content item defined");if((0,E.isFunction)(e)&&(e=e()),e instanceof b.default)return e;if($.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t);return n.callDownwards("_$init"),n}throw new Error("Invalid contentItem")}},{key:"_$reconcilePopoutWindows",value:function(){var e,t=[];for(e=0;e<this.openPopouts.length;e++)!1===this.openPopouts[e].getWindow().closed?t.push(this.openPopouts[e]):this.emit("windowClosed",this.openPopouts[e]);this.openPopouts.length!==t.length&&(this.emit("stateChanged"),this.openPopouts=t)}},{key:"_getAllContentItems",value:function(){var e=[];return function t(n){if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])}(this.root),e}},{key:"_bindEvents",value:function(){this._isFullPage&&$(window).resize(this._resizeFunction),$(window).on("unload beforeunload",this._unloadFunction)}},{key:"_onResize",value:function(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=setTimeout((0,E.fnBind)(this.updateSize,this),100)}},{key:"_createConfig",value:function(e){var t=(0,E.getQueryStringParam)("gl-window");return t&&(this.isSubWindow=!0,e=localStorage.getItem(t),e=JSON.parse(e),e=(new p.default).unminifyConfig(e),localStorage.removeItem(t)),function e(t){for(var n in t)"props"!=n&&"object"===(0,s.default)(t[n])?e(t[n]):"type"==n&&"react-component"===t[n]&&(t.type="component",t.componentName="lm-react-component")}(e=$.extend(!0,{},S.default,e)),!1===e.settings.hasHeaders&&(e.dimensions.headerHeight=0),e}},{key:"_adjustToWindowMode",value:function(){var e=$('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');e.click((0,E.fnBind)(function(){this.emit("popIn")},this)),document.title=(0,E.stripTags)(this.config.content[0].title),$("head").append($("body link, body style, template, .gl_keep")),this.container=$("body").html("").css("visibility","visible").append(e),document.body.offsetHeight,window.__glInstance=this}},{key:"_createSubWindows",value:function(){var e,t;for(e=0;e<this.config.openPopouts.length;e++)t=this.config.openPopouts[e],this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}},{key:"_setContainer",value:function(){var e=$(this.container||"body");if(0===e.length)throw new Error("GoldenLayout container not found");if(1<e.length)throw new Error("GoldenLayout more than one container element specified");e[0]===document.body&&(this._isFullPage=!0,$("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}},{key:"_create",value:function(e){var t;if(!(e.content instanceof Array))throw t=void 0===e.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new C.default(t,e);if(1<e.content.length)throw t="Top level content can't contain more then one element.",new C.default(t,e);this.root=new g.default(this,{content:e.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===e.maximisedItemId&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}},{key:"_onUnload",value:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}},{key:"_adjustColumnsResponsive",value:function(){if(this._useResponsiveLayout()&&!this._updatingColumnsResponsive&&this.config.dimensions&&this.config.dimensions.minItemWidth&&0!==this.root.contentItems.length&&this.root.contentItems[0].isRow){this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(1>=e)){var i=this.config.dimensions.minItemWidth;if(!(e*i<=this.width)){this._updatingColumnsResponsive=!0;for(var o,r=n(t(this.width/i),1),s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<e-r;l++)o=s.contentItems[s.contentItems.length-1],this._addChildContentItemsToContainer(a,o);this._updatingColumnsResponsive=!1}}}else this._firstLoad=!1}},{key:"_useResponsiveLayout",value:function(){return this.config.settings&&("always"==this.config.settings.responsiveMode||"onload"==this.config.settings.responsiveMode&&this._firstLoad)}},{key:"_addChildContentItemsToContainer",value:function(e,t){"stack"===t.type?t.contentItems.forEach(function(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach((0,E.fnBind)(function(t){this._addChildContentItemsToContainer(e,t)},this))}},{key:"_findAllStackContainers",value:function(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}},{key:"_findAllStackContainersRecursive",value:function(e,t){t.contentItems.forEach((0,E.fnBind)(function(t){"stack"==t.type?e.push(t):!t.isComponent&&this._findAllStackContainersRecursive(e,t)},this))}}]),i}(d.default);i.default=M},function(e,t,n){e.exports={default:n(73),__esModule:!0}},function(e,t,n){n(74),n(84),e.exports=n(37).f("iterator")},function(e,t,n){var i=n(75)(!0);n(43)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var i=n(27),o=n(28);e.exports=function(e){return function(t,n){var r,s,a=o(t)+"",l=i(n),c=a.length;return 0>l||l>=c?e?"":void 0:55296>(r=a.charCodeAt(l))||56319<r||l+1===c||56320>(s=a.charCodeAt(l+1))||57343<s?e?a.charAt(l):r:e?a.slice(l,l+2):s-56320+(r-55296<<10)+65536}}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(31),o=n(22),r=n(35),s={};n(13)(s,n(16)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(s,{next:o(1,n)}),r(e,t+" Iterator")}},function(e,t,n){var i=n(9),o=n(18),r=n(23);e.exports=n(10)?Object.defineProperties:function(e,t){o(e);for(var n,s=r(t),a=s.length,l=0;a>l;)i.f(e,n=s[l++],t[n]);return e}},function(e,t,n){var i=n(49);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(15),o=n(81),r=n(82);e.exports=function(e){return function(t,n,s){var a,l=i(t),c=o(l.length),u=r(s,c);if(e&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(t,n,i){var o=i(27);t.exports=function(t){return 0<t?e(o(t),9007199254740991):0}},function(t,i,o){var r=o(27);t.exports=function(t,i){return 0>(t=r(t))?n(t+i,0):e(t,i)}},function(e,t,n){var i=n(8).document;e.exports=i&&i.documentElement},function(e,t,n){n(85);for(var i=n(8),o=n(13),r=n(30),s=n(16)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var c=a[l],u=i[c],h=u&&u.prototype;h&&!h[s]&&o(h,s,c),r[c]=r.Array}},function(e,t,n){var i=n(86),o=n(87),r=n(30),s=n(15);e.exports=n(43)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(e){e.exports=function(){}},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(89),__esModule:!0}},function(e,t,n){n(90),n(95),n(96),n(97),e.exports=n(6).Symbol},function(e,t,n){var i=n(8),o=n(11),r=n(10),a=n(12),l=n(47),c=n(91).KEY,u=n(19),h=n(33),d=n(35),f=n(24),p=n(16),m=n(37),g=n(38),y=n(92),v=n(93),_=n(18),b=n(14),w=n(15),x=n(29),k=n(22),I=n(31),C=n(94),S=n(53),$=n(9),E=n(23),M=S.f,T=$.f,P=C.f,D=i.Symbol,j=i.JSON,A=j&&j.stringify,O="prototype",z=p("_hidden"),N=p("toPrimitive"),L={}.propertyIsEnumerable,F=h("symbol-registry"),B=h("symbols"),R=h("op-symbols"),W=Object[O],H="function"==typeof D,Z=i.QObject,G=!Z||!Z[O]||!Z[O].findChild,q=r&&u(function(){return 7!=I(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=M(W,t);i&&delete W[t],T(e,t,n),i&&e!==W&&T(W,t,i)}:T,V=function(e){var t=B[e]=I(D[O]);return t._k=e,t},U=H&&"symbol"==s(D.iterator)?function(e){return"symbol"==(void 0===e?"undefined":s(e))}:function(e){return e instanceof D},X=function e(t,n,i){return t===W&&e(R,n,i),_(t),n=x(n,!0),_(i),o(B,n)?(i.enumerable?(o(t,z)&&t[z][n]&&(t[z][n]=!1),i=I(i,{enumerable:k(0,!1)})):(!o(t,z)&&T(t,z,k(1,{})),t[z][n]=!0),q(t,n,i)):T(t,n,i)},Y=function(e,t){_(e);for(var n,i=y(t=w(t)),o=0,r=i.length;r>o;)X(e,n=i[o++],t[n]);return e},J=function(e){var t=L.call(this,e=x(e,!0));return!(this===W&&o(B,e)&&!o(R,e))&&(!(t||!o(this,e)||!o(B,e)||o(this,z)&&this[z][e])||t)},Q=function(e,t){if(e=w(e),t=x(t,!0),e!==W||!o(B,t)||o(R,t)){var n=M(e,t);return n&&o(B,t)&&!(o(e,z)&&e[z][t])&&(n.enumerable=!0),n}},K=function(e){for(var t,n=P(w(e)),i=[],r=0;n.length>r;)o(B,t=n[r++])||t==z||t==c||i.push(t);return i},ee=function(e){for(var t,n=e===W,i=P(n?R:w(e)),r=[],s=0;i.length>s;)o(B,t=i[s++])&&(!n||o(W,t))&&r.push(B[t]);return r};H||(l((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var e=f(0<arguments.length?arguments[0]:void 0);return r&&G&&q(W,e,{configurable:!0,set:function t(n){this===W&&t.call(R,n),o(this,z)&&o(this[z],e)&&(this[z][e]=!1),q(this,e,k(1,n))}}),V(e)})[O],"toString",function(){return this._k}),S.f=Q,$.f=X,n(52).f=C.f=K,n(39).f=J,n(51).f=ee,r&&!n(21)&&l(W,"propertyIsEnumerable",J,!0),m.f=function(e){return V(p(e))}),a(a.G+a.W+a.F*!H,{Symbol:D});for(var te=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],ne=0;te.length>ne;)p(te[ne++]);for(var ie=E(p.store),oe=0;ie.length>oe;)g(ie[oe++]);a(a.S+a.F*!H,"Symbol",{for:function(e){return o(F,e+="")?F[e]:F[e]=D(e)},keyFor:function(e){if(!U(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){G=!0},useSimple:function(){G=!1}}),a(a.S+a.F*!H,"Object",{create:function(e,t){return void 0===t?I(e):Y(I(e),t)},defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:K,getOwnPropertySymbols:ee}),j&&a(a.S+a.F*(!H||u(function(){var e=D();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t=i[1],(b(t)||void 0!==e)&&!U(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!U(t))return t}),i[1]=t,A.apply(j,i)}}),D[O][N]||n(13)(D[O],N,D[O].valueOf),d(D,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},function(e,t,n){var i=n(24)("meta"),o=n(14),r=n(11),a=n(9).f,l=0,c=Object.isExtensible||function(){return!0},u=!n(19)(function(){return c(Object.preventExtensions({}))}),h=function(e){a(e,i,{value:{i:"O"+ ++l,w:{}}})},d=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==(void 0===e?"undefined":s(e))?e:("string"==typeof e?"S":"P")+e;if(!r(e,i)){if(!c(e))return"F";if(!t)return"E";h(e)}return e[i].i},getWeak:function(e,t){if(!r(e,i)){if(!c(e))return!0;if(!t)return!1;h(e)}return e[i].w},onFreeze:function(e){return u&&d.NEED&&c(e)&&!r(e,i)&&h(e),e}}},function(e,t,n){var i=n(23),o=n(51),r=n(39);e.exports=function(e){var t=i(e),n=o.f;if(n)for(var s,a=n(e),l=r.f,c=0;a.length>c;)l.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,n){var i=n(49);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var i=n(15),o=n(52).f,r={}.toString,a="object"==("undefined"==typeof window?"undefined":s(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(i(e))}},function(){},function(e,t,n){n(38)("asyncIterator")},function(e,t,n){n(38)("observable")},function(e,t,n){n(99),e.exports=n(6).Object.getPrototypeOf},function(e,t,n){var i=n(36),o=n(50);n(54)("getPrototypeOf",function(){return function(e){return o(i(e))}})},function(e,t,n){e.exports={default:n(101),__esModule:!0}},function(e,t,n){n(102);var i=n(6).Object;e.exports=function(e,t,n){return i.defineProperty(e,t,n)}},function(e,t,n){var i=n(12);i(i.S+i.F*!n(10),"Object",{defineProperty:n(9).f})},function(e,t,n){e.exports={default:n(104),__esModule:!0}},function(e,t,n){n(105),e.exports=n(6).Object.setPrototypeOf},function(e,t,n){var i=n(12);i(i.S,"Object",{setPrototypeOf:n(106).set})},function(e,t,n){var i=n(14),o=n(18),r=function(e,t){if(o(e),!i(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,i){try{(i=n(44)(Function.call,n(53).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return r(e,n),t?e.__proto__=n:i(e,n),e}}({},!1):void 0),check:r}},function(e,t,n){n(108);var i=n(6).Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){var i=n(12);i(i.S,"Object",{create:n(31)})},function(e,t,n){e.exports={default:n(110),__esModule:!0}},function(e,t,n){n(111),e.exports=n(6).Object.keys},function(e,t,n){var i=n(36),o=n(23);n(54)("keys",function(){return function(e){return o(i(e))}})},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={isClosable:!0,reorderEnabled:!0,title:""}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=function(){function e(t,n,i){(0,o.default)(this,e),this._isVertical=t,this._size=n,this._grabSize=i<n?n:i,this.element=this._createElement(),this._dragListener=new s.default(this.element)}return(0,r.default)(e,[{key:"on",value:function(e,t,n){this._dragListener.on(e,t,n)}},{key:"_$destroy",value:function(){this.element.remove()}},{key:"_createElement",value:function(){var e=$('<div class="lm_drag_handle"></div>'),t=$('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}]),e}();t.default=a},function(e,t,n){e.exports={default:n(115),__esModule:!0}},function(e,t,n){var i=n(6),o=i.JSON||(i.JSON={stringify:JSON.stringify});e.exports=function(){return o.stringify.apply(o,arguments)}},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=i(n(26)),a=i(n(62)),l=n(2),c=function(){function e(t,n,i){(0,o.default)(this,e),this._element=t,this._itemConfig=n,this._layoutManager=i,this._dragListener=null,this._createDragListener()}return(0,r.default)(e,[{key:"_createDragListener",value:function(){null!==this._dragListener&&this._dragListener.destroy(),this._dragListener=new s.default(this._element),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this)}},{key:"_onDragStart",value:function(e,t){var n=this._itemConfig;(0,l.isFunction)(n)&&(n=n());var i=this._layoutManager._$normalizeContentItem($.extend(!0,{},n)),o=new a.default(e,t,this._dragListener,this._layoutManager,i,null);this._layoutManager.transitionIndicator.transitionElements(this._element,o.element)}}]),e}();t.default=c},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=function(){function e(){(0,o.default)(this,e),this.element=$('<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>'),$(document.body).append(this.element)}return(0,r.default)(e,[{key:"destroy",value:function(){this.element.remove()}},{key:"highlight",value:function(e,t,n,i){this.highlightArea({x1:e,y1:t,x2:n,y2:i})}},{key:"highlightArea",value:function(e){this.element.css({left:e.x1,top:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}).show()}},{key:"hide",value:function(){this.element.hide()}}]),e}();t.default=s},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),s=n(2),a=function(){function e(){(0,o.default)(this,e),this._element=$('<div class="lm_transition_indicator"></div>'),$(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null}return(0,r.default)(e,[{key:"destroy",value:function(){this._element.remove()}},{key:"transitionElements",value:function(){}},{key:"_nextAnimationFrame",value:function(){var e,t=this._measure(this._toElement),n=((0,s.now)()-this._animationStartTime)/this._totalAnimationDuration,i={};if(1<=n)this._element.hide();else{for(e in t.opacity=0,this._fromDimensions)i[e]=this._fromDimensions[e]+(t[e]-this._fromDimensions[e])*n;this._element.css(i),(0,s.animFrame)((0,s.fnBind)(this._nextAnimationFrame,this))}}},{key:"_measure",value:function(e){var t=e.offset();return{left:t.left,top:t.top,width:e.outerWidth(),height:e.outerHeight()}}}]),e}();t.default=a},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,reorderOnTabMenuClick:!0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:15,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"close",maximise:"maximise",minimise:"minimise",popout:"open in new window",popin:"pop in",tabDropdown:"additional tabs"}}},function(e,t,n){n(121)(n(122))},function(e){e.exports=function(e){function t(e){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",e)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(e):"undefined"==typeof eval?t("EvalError: No eval function available"):eval.call(null,e)}catch(e){t(e)}}},function(e){e.exports="/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */\n(function(global, factory) {\n if (typeof define === 'function' && define.amd)\n define(function() { return factory(global) })\n else\n factory(global)\n}(this, function(window) {\n var Zepto = (function() {\n var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n document = window.document,\n elementDisplay = {}, classCache = {},\n cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n rootNodeRE = /^(?:body|html)$/i,\n capitalRE = /([A-Z])/g,\n\n // special attributes that should be get/set via method calls\n methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n table = document.createElement('table'),\n tableRow = document.createElement('tr'),\n containers = {\n 'tr': document.createElement('tbody'),\n 'tbody': table, 'thead': table, 'tfoot': table,\n 'td': tableRow, 'th': tableRow,\n '*': document.createElement('div')\n },\n readyRE = /complete|loaded|interactive/,\n simpleSelectorRE = /^[\\w-]*$/,\n class2type = {},\n toString = class2type.toString,\n zepto = {},\n camelize, uniq,\n tempParent = document.createElement('div'),\n propMap = {\n 'tabindex': 'tabIndex',\n 'readonly': 'readOnly',\n 'for': 'htmlFor',\n 'class': 'className',\n 'maxlength': 'maxLength',\n 'cellspacing': 'cellSpacing',\n 'cellpadding': 'cellPadding',\n 'rowspan': 'rowSpan',\n 'colspan': 'colSpan',\n 'usemap': 'useMap',\n 'frameborder': 'frameBorder',\n 'contenteditable': 'contentEditable'\n },\n isArray = Array.isArray ||\n function(object){ return object instanceof Array }\n\n zepto.matches = function(element, selector) {\n if (!selector || !element || element.nodeType !== 1) return false\n var matchesSelector = element.matches || element.webkitMatchesSelector ||\n element.mozMatchesSelector || element.oMatchesSelector ||\n element.matchesSelector\n if (matchesSelector) return matchesSelector.call(element, selector)\n // fall back to performing a selector:\n var match, parent = element.parentNode, temp = !parent\n if (temp) (parent = tempParent).appendChild(element)\n match = ~zepto.qsa(parent, selector).indexOf(element)\n temp && tempParent.removeChild(element)\n return match\n }\n\n function type(obj) {\n return obj == null ? String(obj) :\n class2type[toString.call(obj)] || \"object\"\n }\n\n function isFunction(value) { return type(value) == \"function\" }\n function isWindow(obj) { return obj != null && obj == obj.window }\n function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n function isObject(obj) { return type(obj) == \"object\" }\n function isPlainObject(obj) {\n return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n }\n\n function likeArray(obj) {\n var length = !!obj && 'length' in obj && obj.length,\n type = $.type(obj)\n\n return 'function' != type && !isWindow(obj) && (\n 'array' == type || length === 0 ||\n (typeof length == 'number' && length > 0 && (length - 1) in obj)\n )\n }\n\n function compact(array) { return filter.call(array, function(item){ return item != null }) }\n function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n function dasherize(str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase()\n }\n uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n function classRE(name) {\n return name in classCache ?\n classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n }\n\n function maybeAddPx(name, value) {\n return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n }\n\n function defaultDisplay(nodeName) {\n var element, display\n if (!elementDisplay[nodeName]) {\n element = document.createElement(nodeName)\n document.body.appendChild(element)\n display = getComputedStyle(element, '').getPropertyValue(\"display\")\n element.parentNode.removeChild(element)\n display == \"none\" && (display = \"block\")\n elementDisplay[nodeName] = display\n }\n return elementDisplay[nodeName]\n }\n\n function children(element) {\n return 'children' in element ?\n slice.call(element.children) :\n $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n }\n\n function Z(dom, selector) {\n var i, len = dom ? dom.length : 0\n for (i = 0; i < len; i++) this[i] = dom[i]\n this.length = len\n this.selector = selector || ''\n }\n\n // `$.zepto.fragment` takes a html string and an optional tag name\n // to generate DOM nodes from the given html string.\n // The generated DOM nodes are returned as an array.\n // This function can be overridden in plugins for example to make\n // it compatible with browsers that don't support the DOM fully.\n zepto.fragment = function(html, name, properties) {\n var dom, nodes, container\n\n // A special case optimization for a single tag\n if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n if (!dom) {\n if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n if (!(name in containers)) name = '*'\n\n container = containers[name]\n container.innerHTML = '' + html\n dom = $.each(slice.call(container.childNodes), function(){\n container.removeChild(this)\n })\n }\n\n if (isPlainObject(properties)) {\n nodes = $(dom)\n $.each(properties, function(key, value) {\n if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n else nodes.attr(key, value)\n })\n }\n\n return dom\n }\n\n // `$.zepto.Z` swaps out the prototype of the given `dom` array\n // of nodes with `$.fn` and thus supplying all the Zepto functions\n // to the array. This method can be overridden in plugins.\n zepto.Z = function(dom, selector) {\n return new Z(dom, selector)\n }\n\n // `$.zepto.isZ` should return `true` if the given object is a Zepto\n // collection. This method can be overridden in plugins.\n zepto.isZ = function(object) {\n return object instanceof zepto.Z\n }\n\n // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n // takes a CSS selector and an optional context (and handles various\n // special cases).\n // This method can be overridden in plugins.\n zepto.init = function(selector, context) {\n var dom\n // If nothing given, return an empty Zepto collection\n if (!selector) return zepto.Z()\n // Optimize for string selectors\n else if (typeof selector == 'string') {\n selector = selector.trim()\n // If it's a html fragment, create nodes from it\n // Note: In both Chrome 21 and Firefox 15, DOM error 12\n // is thrown if the fragment doesn't begin with <\n if (selector[0] == '<' && fragmentRE.test(selector))\n dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // If it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // If a function is given, call it when the DOM is ready\n else if (isFunction(selector)) return $(document).ready(selector)\n // If a Zepto collection is given, just return it\n else if (zepto.isZ(selector)) return selector\n else {\n // normalize array if an array of nodes is given\n if (isArray(selector)) dom = compact(selector)\n // Wrap DOM nodes.\n else if (isObject(selector))\n dom = [selector], selector = null\n // If it's a html fragment, create nodes from it\n else if (fragmentRE.test(selector))\n dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n // If there's a context, create a collection on that context first, and select\n // nodes from there\n else if (context !== undefined) return $(context).find(selector)\n // And last but no least, if it's a CSS selector, use it to select nodes.\n else dom = zepto.qsa(document, selector)\n }\n // create a new Zepto collection from the nodes found\n return zepto.Z(dom, selector)\n }\n\n // `$` will be the base `Zepto` object. When calling this\n // function just call `$.zepto.init, which makes the implementation\n // details of selecting nodes and creating Zepto collections\n // patchable in plugins.\n $ = function(selector, context){\n return zepto.init(selector, context)\n }\n\n function extend(target, source, deep) {\n for (key in source)\n if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n target[key] = {}\n if (isArray(source[key]) && !isArray(target[key]))\n target[key] = []\n extend(target[key], source[key], deep)\n }\n else if (source[key] !== undefined) target[key] = source[key]\n }\n\n // Copy all but undefined properties from one or more\n // objects to the `target` object.\n $.extend = function(target){\n var deep, args = slice.call(arguments, 1)\n if (typeof target == 'boolean') {\n deep = target\n target = args.shift()\n }\n args.forEach(function(arg){ extend(target, arg, deep) })\n return target\n }\n\n // `$.zepto.qsa` is Zepto's CSS selector implementation which\n // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n // This method can be overridden in plugins.\n zepto.qsa = function(element, selector){\n var found,\n maybeID = selector[0] == '#',\n maybeClass = !maybeID && selector[0] == '.',\n nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n isSimple = simpleSelectorRE.test(nameOnly)\n return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n slice.call(\n isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n element.getElementsByTagName(selector) : // Or a tag\n element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n )\n }\n\n function filtered(nodes, selector) {\n return selector == null ? $(nodes) : $(nodes).filter(selector)\n }\n\n $.contains = document.documentElement.contains ?\n function(parent, node) {\n return parent !== node && parent.contains(node)\n } :\n function(parent, node) {\n while (node && (node = node.parentNode))\n if (node === parent) return true\n return false\n }\n\n function funcArg(context, arg, idx, payload) {\n return isFunction(arg) ? arg.call(context, idx, payload) : arg\n }\n\n function setAttribute(node, name, value) {\n value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n }\n\n // access className property while respecting SVGAnimatedString\n function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }\n\n // \"true\" => true\n // \"false\" => false\n // \"null\" => null\n // \"42\" => 42\n // \"42.5\" => 42.5\n // \"08\" => \"08\"\n // JSON => parse if valid\n // String => self\n function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }\n\n $.type = type\n $.isFunction = isFunction\n $.isWindow = isWindow\n $.isArray = isArray\n $.isPlainObject = isPlainObject\n\n $.isEmptyObject = function(obj) {\n var name\n for (name in obj) return false\n return true\n }\n\n $.isNumeric = function(val) {\n var num = Number(val), type = typeof val\n return val != null && type != 'boolean' &&\n (type != 'string' || val.length) &&\n !isNaN(num) && isFinite(num) || false\n }\n\n $.inArray = function(elem, array, i){\n return emptyArray.indexOf.call(array, elem, i)\n }\n\n $.camelCase = camelize\n $.trim = function(str) {\n return str == null ? \"\" : String.prototype.trim.call(str)\n }\n\n // plugin compatibility\n $.uuid = 0\n $.support = { }\n $.expr = { }\n $.noop = function() {}\n\n $.map = function(elements, callback){\n var value, values = [], i, key\n if (likeArray(elements))\n for (i = 0; i < elements.length; i++) {\n value = callback(elements[i], i)\n if (value != null) values.push(value)\n }\n else\n for (key in elements) {\n value = callback(elements[key], key)\n if (value != null) values.push(value)\n }\n return flatten(values)\n }\n\n $.each = function(elements, callback){\n var i, key\n if (likeArray(elements)) {\n for (i = 0; i < elements.length; i++)\n if (callback.call(elements[i], i, elements[i]) === false) return elements\n } else {\n for (key in elements)\n if (callback.call(elements[key], key, elements[key]) === false) return elements\n }\n\n return elements\n }\n\n $.grep = function(elements, callback){\n return filter.call(elements, callback)\n }\n\n if (window.JSON) $.parseJSON = JSON.parse\n\n // Populate the class2type map\n $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n })\n\n // Define methods that will be available on all\n // Zepto collections\n $.fn = {\n constructor: zepto.Z,\n length: 0,\n\n // Because a collection acts like an array\n // copy over these useful array functions.\n forEach: emptyArray.forEach,\n reduce: emptyArray.reduce,\n push: emptyArray.push,\n sort: emptyArray.sort,\n splice: emptyArray.splice,\n indexOf: emptyArray.indexOf,\n concat: function(){\n var i, value, args = []\n for (i = 0; i < arguments.length; i++) {\n value = arguments[i]\n args[i] = zepto.isZ(value) ? value.toArray() : value\n }\n return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n },\n\n // `map` and `slice` in the jQuery API work differently\n // from their array counterparts\n map: function(fn){\n return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n },\n slice: function(){\n return $(slice.apply(this, arguments))\n },\n\n ready: function(callback){\n // need to check if document.body exists for IE as that browser reports\n // document ready when it hasn't yet created the body element\n if (readyRE.test(document.readyState) && document.body) callback($)\n else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n return this\n },\n get: function(idx){\n return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n },\n toArray: function(){ return this.get() },\n size: function(){\n return this.length\n },\n remove: function(){\n return this.each(function(){\n if (this.parentNode != null)\n this.parentNode.removeChild(this)\n })\n },\n each: function(callback){\n emptyArray.every.call(this, function(el, idx){\n return callback.call(el, idx, el) !== false\n })\n return this\n },\n filter: function(selector){\n if (isFunction(selector)) return this.not(this.not(selector))\n return $(filter.call(this, function(element){\n return zepto.matches(element, selector)\n }))\n },\n add: function(selector,context){\n return $(uniq(this.concat($(selector,context))))\n },\n is: function(selector){\n return this.length > 0 && zepto.matches(this[0], selector)\n },\n not: function(selector){\n var nodes=[]\n if (isFunction(selector) && selector.call !== undefined)\n this.each(function(idx){\n if (!selector.call(this,idx)) nodes.push(this)\n })\n else {\n var excludes = typeof selector == 'string' ? this.filter(selector) :\n (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n this.forEach(function(el){\n if (excludes.indexOf(el) < 0) nodes.push(el)\n })\n }\n return $(nodes)\n },\n has: function(selector){\n return this.filter(function(){\n return isObject(selector) ?\n $.contains(this, selector) :\n $(this).find(selector).size()\n })\n },\n eq: function(idx){\n return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n },\n first: function(){\n var el = this[0]\n return el && !isObject(el) ? el : $(el)\n },\n last: function(){\n var el = this[this.length - 1]\n return el && !isObject(el) ? el : $(el)\n },\n find: function(selector){\n var result, $this = this\n if (!selector) result = $()\n else if (typeof selector == 'object')\n result = $(selector).filter(function(){\n var node = this\n return emptyArray.some.call($this, function(parent){\n return $.contains(parent, node)\n })\n })\n else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n else result = this.map(function(){ return zepto.qsa(this, selector) })\n return result\n },\n closest: function(selector, context){\n var nodes = [], collection = typeof selector == 'object' && $(selector)\n this.each(function(_, node){\n while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n node = node !== context && !isDocument(node) && node.parentNode\n if (node && nodes.indexOf(node) < 0) nodes.push(node)\n })\n return $(nodes)\n },\n parents: function(selector){\n var ancestors = [], nodes = this\n while (nodes.length > 0)\n nodes = $.map(nodes, function(node){\n if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n ancestors.push(node)\n return node\n }\n })\n return filtered(ancestors, selector)\n },\n parent: function(selector){\n return filtered(uniq(this.pluck('parentNode')), selector)\n },\n children: function(selector){\n return filtered(this.map(function(){ return children(this) }), selector)\n },\n contents: function() {\n return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n },\n siblings: function(selector){\n return filtered(this.map(function(i, el){\n return filter.call(children(el.parentNode), function(child){ return child!==el })\n }), selector)\n },\n empty: function(){\n return this.each(function(){ this.innerHTML = '' })\n },\n // `pluck` is borrowed from Prototype.js\n pluck: function(property){\n return $.map(this, function(el){ return el[property] })\n },\n show: function(){\n return this.each(function(){\n this.style.display == \"none\" && (this.style.display = '')\n if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n this.style.display = defaultDisplay(this.nodeName)\n })\n },\n replaceWith: function(newContent){\n return this.before(newContent).remove()\n },\n wrap: function(structure){\n var func = isFunction(structure)\n if (this[0] && !func)\n var dom = $(structure).get(0),\n clone = dom.parentNode || this.length > 1\n\n return this.each(function(index){\n $(this).wrapAll(\n func ? structure.call(this, index) :\n clone ? dom.cloneNode(true) : dom\n )\n })\n },\n wrapAll: function(structure){\n if (this[0]) {\n $(this[0]).before(structure = $(structure))\n var children\n // drill down to the inmost element\n while ((children = structure.children()).length) structure = children.first()\n $(structure).append(this)\n }\n return this\n },\n wrapInner: function(structure){\n var func = isFunction(structure)\n return this.each(function(index){\n var self = $(this), contents = self.contents(),\n dom = func ? structure.call(this, index) : structure\n contents.length ? contents.wrapAll(dom) : self.append(dom)\n })\n },\n unwrap: function(){\n this.parent().each(function(){\n $(this).replaceWith($(this).children())\n })\n return this\n },\n clone: function(){\n return this.map(function(){ return this.cloneNode(true) })\n },\n hide: function(){\n return this.css(\"display\", \"none\")\n },\n toggle: function(setting){\n return this.each(function(){\n var el = $(this)\n ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n })\n },\n prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n html: function(html){\n return 0 in arguments ?\n this.each(function(idx){\n var originHtml = this.innerHTML\n $(this).empty().append( funcArg(this, html, idx, originHtml) )\n }) :\n (0 in this ? this[0].innerHTML : null)\n },\n text: function(text){\n return 0 in arguments ?\n this.each(function(idx){\n var newText = funcArg(this, text, idx, this.textContent)\n this.textContent = newText == null ? '' : ''+newText\n }) :\n (0 in this ? this.pluck('textContent').join(\"\") : null)\n },\n attr: function(name, value){\n var result\n return (typeof name == 'string' && !(1 in arguments)) ?\n (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n this.each(function(idx){\n if (this.nodeType !== 1) return\n if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n })\n },\n removeAttr: function(name){\n return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n setAttribute(this, attribute)\n }, this)})\n },\n prop: function(name, value){\n name = propMap[name] || name\n return (1 in arguments) ?\n this.each(function(idx){\n this[name] = funcArg(this, value, idx, this[name])\n }) :\n (this[0] && this[0][name])\n },\n removeProp: function(name){\n name = propMap[name] || name\n return this.each(function(){ delete this[name] })\n },\n data: function(name, value){\n var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n var data = (1 in arguments) ?\n this.attr(attrName, value) :\n this.attr(attrName)\n\n return data !== null ? deserializeValue(data) : undefined\n },\n val: function(value){\n if (0 in arguments) {\n if (value == null) value = \"\"\n return this.each(function(idx){\n this.value = funcArg(this, value, idx, this.value)\n })\n } else {\n return this[0] && (this[0].multiple ?\n $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n this[0].value)\n }\n },\n offset: function(coordinates){\n if (coordinates) return this.each(function(index){\n var $this = $(this),\n coords = funcArg(this, coordinates, index, $this.offset()),\n parentOffset = $this.offsetParent().offset(),\n props = {\n top: coords.top - parentOffset.top,\n left: coords.left - parentOffset.left\n }\n\n if ($this.css('position') == 'static') props['position'] = 'relative'\n $this.css(props)\n })\n if (!this.length) return null\n if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n return {top: 0, left: 0}\n var obj = this[0].getBoundingClientRect()\n return {\n left: obj.left + window.pageXOffset,\n top: obj.top + window.pageYOffset,\n width: Math.round(obj.width),\n height: Math.round(obj.height)\n }\n },\n css: function(property, value){\n if (arguments.length < 2) {\n var element = this[0]\n if (typeof property == 'string') {\n if (!element) return\n return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n } else if (isArray(property)) {\n if (!element) return\n var props = {}\n var computedStyle = getComputedStyle(element, '')\n $.each(property, function(_, prop){\n props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n })\n return props\n }\n }\n\n var css = ''\n if (type(property) == 'string') {\n if (!value && value !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(property)) })\n else\n css = dasherize(property) + \":\" + maybeAddPx(property, value)\n } else {\n for (key in property)\n if (!property[key] && property[key] !== 0)\n this.each(function(){ this.style.removeProperty(dasherize(key)) })\n else\n css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n }\n\n return this.each(function(){ this.style.cssText += ';' + css })\n },\n index: function(element){\n return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n },\n hasClass: function(name){\n if (!name) return false\n return emptyArray.some.call(this, function(el){\n return this.test(className(el))\n }, classRE(name))\n },\n addClass: function(name){\n if (!name) return this\n return this.each(function(idx){\n if (!('className' in this)) return\n classList = []\n var cls = className(this), newName = funcArg(this, name, idx, cls)\n newName.split(/\\s+/g).forEach(function(klass){\n if (!$(this).hasClass(klass)) classList.push(klass)\n }, this)\n classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n })\n },\n removeClass: function(name){\n return this.each(function(idx){\n if (!('className' in this)) return\n if (name === undefined) return className(this, '')\n classList = className(this)\n funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n classList = classList.replace(classRE(klass), \" \")\n })\n className(this, classList.trim())\n })\n },\n toggleClass: function(name, when){\n if (!name) return this\n return this.each(function(idx){\n var $this = $(this), names = funcArg(this, name, idx, className(this))\n names.split(/\\s+/g).forEach(function(klass){\n (when === undefined ? !$this.hasClass(klass) : when) ?\n $this.addClass(klass) : $this.removeClass(klass)\n })\n })\n },\n scrollTop: function(value){\n if (!this.length) return\n var hasScrollTop = 'scrollTop' in this[0]\n if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n return this.each(hasScrollTop ?\n function(){ this.scrollTop = value } :\n function(){ this.scrollTo(this.scrollX, value) })\n },\n scrollLeft: function(value){\n if (!this.length) return\n var hasScrollLeft = 'scrollLeft' in this[0]\n if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n return this.each(hasScrollLeft ?\n function(){ this.scrollLeft = value } :\n function(){ this.scrollTo(value, this.scrollY) })\n },\n position: function() {\n if (!this.length) return\n\n var elem = this[0],\n // Get *real* offsetParent\n offsetParent = this.offsetParent(),\n // Get correct offsets\n offset = this.offset(),\n parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n // Subtract element margins\n // note: when an element has margin: auto the offsetLeft and marginLeft\n // are the same in Safari causing offset.left to incorrectly be 0\n offset.top -= parseFloat( $(elem).css('margin-top') ) || 0\n offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n // Add offsetParent borders\n parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n // Subtract the two offsets\n return {\n top: offset.top - parentOffset.top,\n left: offset.left - parentOffset.left\n }\n },\n offsetParent: function() {\n return this.map(function(){\n var parent = this.offsetParent || document.body\n while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n parent = parent.offsetParent\n return parent\n })\n }\n }\n\n // for now\n $.fn.detach = $.fn.remove\n\n // Generate the `width` and `height` functions\n ;['width', 'height'].forEach(function(dimension){\n var dimensionProperty =\n dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n $.fn[dimension] = function(value){\n var offset, el = this[0]\n if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n (offset = this.offset()) && offset[dimension]\n else return this.each(function(idx){\n el = $(this)\n el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n })\n }\n })\n\n function traverseNode(node, fun) {\n fun(node)\n for (var i = 0, len = node.childNodes.length; i < len; i++)\n traverseNode(node.childNodes[i], fun)\n }\n\n // Generate the `after`, `prepend`, `before`, `append`,\n // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n adjacencyOperators.forEach(function(operator, operatorIndex) {\n var inside = operatorIndex % 2 //=> prepend, append\n\n $.fn[operator] = function(){\n // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n var argType, nodes = $.map(arguments, function(arg) {\n var arr = []\n argType = type(arg)\n if (argType == \"array\") {\n arg.forEach(function(el) {\n if (el.nodeType !== undefined) return arr.push(el)\n else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n arr = arr.concat(zepto.fragment(el))\n })\n return arr\n }\n return argType == \"object\" || arg == null ?\n arg : zepto.fragment(arg)\n }),\n parent, copyByClone = this.length > 1\n if (nodes.length < 1) return this\n\n return this.each(function(_, target){\n parent = inside ? target : target.parentNode\n\n // convert all methods to a \"before\" operation\n target = operatorIndex == 0 ? target.nextSibling :\n operatorIndex == 1 ? target.firstChild :\n operatorIndex == 2 ? target :\n null\n\n var parentInDocument = $.contains(document.documentElement, parent)\n\n nodes.forEach(function(node){\n if (copyByClone) node = node.cloneNode(true)\n else if (!parent) return $(node).remove()\n\n parent.insertBefore(node, target)\n if (parentInDocument) traverseNode(node, function(el){\n if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n (!el.type || el.type === 'text/javascript') && !el.src){\n var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n target['eval'].call(target, el.innerHTML)\n }\n })\n })\n })\n }\n\n // after => insertAfter\n // prepend => prependTo\n // before => insertBefore\n // append => appendTo\n $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n $(html)[operator](this)\n return this\n }\n })\n\n zepto.Z.prototype = Z.prototype = $.fn\n\n // Export internal API functions in the `$.zepto` namespace\n zepto.uniq = uniq\n zepto.deserializeValue = deserializeValue\n $.zepto = zepto\n\n return $\n})()\n\nwindow.Zepto = Zepto\nwindow.$ === undefined && (window.$ = Zepto)\n\n;(function($){\n var _zid = 1, undefined,\n slice = Array.prototype.slice,\n isFunction = $.isFunction,\n isString = function(obj){ return typeof obj == 'string' },\n handlers = {},\n specialEvents={},\n focusinSupported = 'onfocusin' in window,\n focus = { focus: 'focusin', blur: 'focusout' },\n hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n function zid(element) {\n return element._zid || (element._zid = _zid++)\n }\n function findHandlers(element, event, fn, selector) {\n event = parse(event)\n if (event.ns) var matcher = matcherFor(event.ns)\n return (handlers[zid(element)] || []).filter(function(handler) {\n return handler\n && (!event.e || handler.e == event.e)\n && (!event.ns || matcher.test(handler.ns))\n && (!fn || zid(handler.fn) === zid(fn))\n && (!selector || handler.sel == selector)\n })\n }\n function parse(event) {\n var parts = ('' + event).split('.')\n return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n }\n function matcherFor(ns) {\n return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n }\n\n function eventCapture(handler, captureSetting) {\n return handler.del &&\n (!focusinSupported && (handler.e in focus)) ||\n !!captureSetting\n }\n\n function realEvent(type) {\n return hover[type] || (focusinSupported && focus[type]) || type\n }\n\n function add(element, events, fn, data, selector, delegator, capture){\n var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n events.split(/\\s/).forEach(function(event){\n if (event == 'ready') return $(document).ready(fn)\n var handler = parse(event)\n handler.fn = fn\n handler.sel = selector\n // emulate mouseenter, mouseleave\n if (handler.e in hover) fn = function(e){\n var related = e.relatedTarget\n if (!related || (related !== this && !$.contains(this, related)))\n return handler.fn.apply(this, arguments)\n }\n handler.del = delegator\n var callback = delegator || fn\n handler.proxy = function(e){\n e = compatible(e)\n if (e.isImmediatePropagationStopped()) return\n e.data = data\n var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n if (result === false) e.preventDefault(), e.stopPropagation()\n return result\n }\n handler.i = set.length\n set.push(handler)\n if ('addEventListener' in element)\n element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n }\n function remove(element, events, fn, selector, capture){\n var id = zid(element)\n ;(events || '').split(/\\s/).forEach(function(event){\n findHandlers(element, event, fn, selector).forEach(function(handler){\n delete handlers[id][handler.i]\n if ('removeEventListener' in element)\n element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n })\n })\n }\n\n $.event = { add: add, remove: remove }\n\n $.proxy = function(fn, context) {\n var args = (2 in arguments) && slice.call(arguments, 2)\n if (isFunction(fn)) {\n var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n proxyFn._zid = zid(fn)\n return proxyFn\n } else if (isString(context)) {\n if (args) {\n args.unshift(fn[context], fn)\n return $.proxy.apply(null, args)\n } else {\n return $.proxy(fn[context], fn)\n }\n } else {\n throw new TypeError(\"expected function\")\n }\n }\n\n $.fn.bind = function(event, data, callback){\n return this.on(event, data, callback)\n }\n $.fn.unbind = function(event, callback){\n return this.off(event, callback)\n }\n $.fn.one = function(event, selector, data, callback){\n return this.on(event, selector, data, callback, 1)\n }\n\n var returnTrue = function(){return true},\n returnFalse = function(){return false},\n ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n eventMethods = {\n preventDefault: 'isDefaultPrevented',\n stopImmediatePropagation: 'isImmediatePropagationStopped',\n stopPropagation: 'isPropagationStopped'\n }\n\n function compatible(event, source) {\n if (source || !event.isDefaultPrevented) {\n source || (source = event)\n\n $.each(eventMethods, function(name, predicate) {\n var sourceMethod = source[name]\n event[name] = function(){\n this[predicate] = returnTrue\n return sourceMethod && sourceMethod.apply(source, arguments)\n }\n event[predicate] = returnFalse\n })\n\n event.timeStamp || (event.timeStamp = Date.now())\n\n if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n 'returnValue' in source ? source.returnValue === false :\n source.getPreventDefault && source.getPreventDefault())\n event.isDefaultPrevented = returnTrue\n }\n return event\n }\n\n function createProxy(event) {\n var key, proxy = { originalEvent: event }\n for (key in event)\n if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n return compatible(proxy, event)\n }\n\n $.fn.delegate = function(selector, event, callback){\n return this.on(event, selector, callback)\n }\n $.fn.undelegate = function(selector, event, callback){\n return this.off(event, selector, callback)\n }\n\n $.fn.live = function(event, callback){\n $(document.body).delegate(this.selector, event, callback)\n return this\n }\n $.fn.die = function(event, callback){\n $(document.body).undelegate(this.selector, event, callback)\n return this\n }\n\n $.fn.on = function(event, selector, data, callback, one){\n var autoRemove, delegator, $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.on(type, selector, data, fn, one)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = data, data = selector, selector = undefined\n if (callback === undefined || data === false)\n callback = data, data = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(_, element){\n if (one) autoRemove = function(e){\n remove(element, e.type, callback)\n return callback.apply(this, arguments)\n }\n\n if (selector) delegator = function(e){\n var evt, match = $(e.target).closest(selector, element).get(0)\n if (match && match !== element) {\n evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n }\n }\n\n add(element, event, callback, data, selector, delegator || autoRemove)\n })\n }\n $.fn.off = function(event, selector, callback){\n var $this = this\n if (event && !isString(event)) {\n $.each(event, function(type, fn){\n $this.off(type, selector, fn)\n })\n return $this\n }\n\n if (!isString(selector) && !isFunction(callback) && callback !== false)\n callback = selector, selector = undefined\n\n if (callback === false) callback = returnFalse\n\n return $this.each(function(){\n remove(this, event, callback, selector)\n })\n }\n\n $.fn.trigger = function(event, args){\n event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n event._args = args\n return this.each(function(){\n // handle focus(), blur() by calling them directly\n if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n // items in the collection might not be DOM elements\n else if ('dispatchEvent' in this) this.dispatchEvent(event)\n else $(this).triggerHandler(event, args)\n })\n }\n\n // triggers event handlers on current element just as if an event occurred,\n // doesn't trigger an actual event, doesn't bubble\n $.fn.triggerHandler = function(event, args){\n var e, result\n this.each(function(i, element){\n e = createProxy(isString(event) ? $.Event(event) : event)\n e._args = args\n e.target = element\n $.each(findHandlers(element, event.type || event), function(i, handler){\n result = handler.proxy(e)\n if (e.isImmediatePropagationStopped()) return false\n })\n })\n return result\n }\n\n // shortcut methods for `.bind(event, fn)` for each event type\n ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n 'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n $.fn[event] = function(callback) {\n return (0 in arguments) ?\n this.bind(event, callback) :\n this.trigger(event)\n }\n })\n\n $.Event = function(type, props) {\n if (!isString(type)) props = type, type = props.type\n var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n event.initEvent(type, bubbles, true)\n return compatible(event)\n }\n\n})(Zepto)\n\n;(function($){\n var jsonpID = +new Date(),\n document = window.document,\n key,\n name,\n rscript = /<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\n scriptTypeRE = /^(?:text|application)\\/javascript/i,\n xmlTypeRE = /^(?:text|application)\\/xml/i,\n jsonType = 'application/json',\n htmlType = 'text/html',\n blankRE = /^\\s*$/,\n originAnchor = document.createElement('a')\n\n originAnchor.href = window.location.href\n\n // trigger a custom event and return false if it was cancelled\n function triggerAndReturn(context, eventName, data) {\n var event = $.Event(eventName)\n $(context).trigger(event, data)\n return !event.isDefaultPrevented()\n }\n\n // trigger an Ajax \"global\" event\n function triggerGlobal(settings, context, eventName, data) {\n if (settings.global) return triggerAndReturn(context || document, eventName, data)\n }\n\n // Number of active Ajax requests\n $.active = 0\n\n function ajaxStart(settings) {\n if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')\n }\n function ajaxStop(settings) {\n if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')\n }\n\n // triggers an extra global event \"ajaxBeforeSend\" that's like \"ajaxSend\" but cancelable\n function ajaxBeforeSend(xhr, settings) {\n var context = settings.context\n if (settings.beforeSend.call(context, xhr, settings) === false ||\n triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)\n return false\n\n triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])\n }\n function ajaxSuccess(data, xhr, settings, deferred) {\n var context = settings.context, status = 'success'\n settings.success.call(context, data, status, xhr)\n if (deferred) deferred.resolveWith(context, [data, status, xhr])\n triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])\n ajaxComplete(status, xhr, settings)\n }\n // type: \"timeout\", \"error\", \"abort\", \"parsererror\"\n function ajaxError(error, type, xhr, settings, deferred) {\n var context = settings.context\n settings.error.call(context, xhr, type, error)\n if (deferred) deferred.rejectWith(context, [xhr, type, error])\n triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])\n ajaxComplete(type, xhr, settings)\n }\n // status: \"success\", \"notmodified\", \"error\", \"timeout\", \"abort\", \"parsererror\"\n function ajaxComplete(status, xhr, settings) {\n var context = settings.context\n settings.complete.call(context, xhr, status)\n triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])\n ajaxStop(settings)\n }\n\n function ajaxDataFilter(data, type, settings) {\n if (settings.dataFilter == empty) return data\n var context = settings.context\n return settings.dataFilter.call(context, data, type)\n }\n\n // Empty function, used as default callback\n function empty() {}\n\n $.ajaxJSONP = function(options, deferred){\n if (!('type' in options)) return $.ajax(options)\n\n var _callbackName = options.jsonpCallback,\n callbackName = ($.isFunction(_callbackName) ?\n _callbackName() : _callbackName) || ('Zepto' + (jsonpID++)),\n script = document.createElement('script'),\n originalCallback = window[callbackName],\n responseData,\n abort = function(errorType) {\n $(script).triggerHandler('error', errorType || 'abort')\n },\n xhr = { abort: abort }, abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n $(script).on('load error', function(e, errorType){\n clearTimeout(abortTimeout)\n $(script).off().remove()\n\n if (e.type == 'error' || !responseData) {\n ajaxError(null, errorType || 'error', xhr, options, deferred)\n } else {\n ajaxSuccess(responseData[0], xhr, options, deferred)\n }\n\n window[callbackName] = originalCallback\n if (responseData && $.isFunction(originalCallback))\n originalCallback(responseData[0])\n\n originalCallback = responseData = undefined\n })\n\n if (ajaxBeforeSend(xhr, options) === false) {\n abort('abort')\n return xhr\n }\n\n window[callbackName] = function(){\n responseData = arguments\n }\n\n script.src = options.url.replace(/\\?(.+)=\\?/, '?$1=' + callbackName)\n document.head.appendChild(script)\n\n if (options.timeout > 0) abortTimeout = setTimeout(function(){\n abort('timeout')\n }, options.timeout)\n\n return xhr\n }\n\n $.ajaxSettings = {\n // Default type of request\n type: 'GET',\n // Callback that is executed before request\n beforeSend: empty,\n // Callback that is executed if the request succeeds\n success: empty,\n // Callback that is executed the the server drops error\n error: empty,\n // Callback that is executed on request complete (both: error and success)\n complete: empty,\n // The context for the callbacks\n context: null,\n // Whether to trigger \"global\" Ajax events\n global: true,\n // Transport\n xhr: function () {\n return new window.XMLHttpRequest()\n },\n // MIME types mapping\n // IIS returns Javascript as \"application/x-javascript\"\n accepts: {\n script: 'text/javascript, application/javascript, application/x-javascript',\n json: jsonType,\n xml: 'application/xml, text/xml',\n html: htmlType,\n text: 'text/plain'\n },\n // Whether the request is to another domain\n crossDomain: false,\n // Default timeout\n timeout: 0,\n // Whether data should be serialized to string\n processData: true,\n // Whether the browser should be allowed to cache GET responses\n cache: true,\n //Used to handle the raw response data of XMLHttpRequest.\n //This is a pre-filtering function to sanitize the response.\n //The sanitized response should be returned\n dataFilter: empty\n }\n\n function mimeToDataType(mime) {\n if (mime) mime = mime.split(';', 2)[0]\n return mime && ( mime == htmlType ? 'html' :\n mime == jsonType ? 'json' :\n scriptTypeRE.test(mime) ? 'script' :\n xmlTypeRE.test(mime) && 'xml' ) || 'text'\n }\n\n function appendQuery(url, query) {\n if (query == '') return url\n return (url + '&' + query).replace(/[&?]{1,2}/, '?')\n }\n\n // serialize payload and append it to the URL for GET requests\n function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }\n\n $.ajax = function(options){\n var settings = $.extend({}, options || {}),\n deferred = $.Deferred && $.Deferred(),\n urlAnchor, hashIndex\n for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]\n\n ajaxStart(settings)\n\n if (!settings.crossDomain) {\n urlAnchor = document.createElement('a')\n urlAnchor.href = settings.url\n // cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049\n urlAnchor.href = urlAnchor.href\n settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host)\n }\n\n if (!settings.url) settings.url = window.location.toString()\n if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex)\n serializeData(settings)\n\n var dataType = settings.dataType, hasPlaceholder = /\\?.+=\\?/.test(settings.url)\n if (hasPlaceholder) dataType = 'jsonp'\n\n if (settings.cache === false || (\n (!options || options.cache !== true) &&\n ('script' == dataType || 'jsonp' == dataType)\n ))\n settings.url = appendQuery(settings.url, '_=' + Date.now())\n\n if ('jsonp' == dataType) {\n if (!hasPlaceholder)\n settings.url = appendQuery(settings.url,\n settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?')\n return $.ajaxJSONP(settings, deferred)\n }\n\n var mime = settings.accepts[dataType],\n headers = { },\n setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },\n protocol = /^([\\w-]+:)\\/\\//.test(settings.url) ? RegExp.$1 : window.location.protocol,\n xhr = settings.xhr(),\n nativeSetHeader = xhr.setRequestHeader,\n abortTimeout\n\n if (deferred) deferred.promise(xhr)\n\n if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest')\n setHeader('Accept', mime || '*/*')\n if (mime = settings.mimeType || mime) {\n if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]\n xhr.overrideMimeType && xhr.overrideMimeType(mime)\n }\n if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))\n setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')\n\n if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name])\n xhr.setRequestHeader = setHeader\n\n xhr.onreadystatechange = function(){\n if (xhr.readyState == 4) {\n xhr.onreadystatechange = empty\n clearTimeout(abortTimeout)\n var result, error = false\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {\n dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))\n\n if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob')\n result = xhr.response\n else {\n result = xhr.responseText\n\n try {\n // http://perfectionkills.com/global-eval-what-are-the-options/\n // sanitize response accordingly if data filter callback provided\n result = ajaxDataFilter(result, dataType, settings)\n if (dataType == 'script') (1,eval)(result)\n else if (dataType == 'xml') result = xhr.responseXML\n else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)\n } catch (e) { error = e }\n\n if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred)\n }\n\n ajaxSuccess(result, xhr, settings, deferred)\n } else {\n ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred)\n }\n }\n }\n\n if (ajaxBeforeSend(xhr, settings) === false) {\n xhr.abort()\n ajaxError(null, 'abort', xhr, settings, deferred)\n return xhr\n }\n\n var async = 'async' in settings ? settings.async : true\n xhr.open(settings.type, settings.url, async, settings.username, settings.password)\n\n if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]\n\n for (name in headers) nativeSetHeader.apply(xhr, headers[name])\n\n if (settings.timeout > 0) abortTimeout = setTimeout(function(){\n xhr.onreadystatechange = empty\n xhr.abort()\n ajaxError(null, 'timeout', xhr, settings, deferred)\n }, settings.timeout)\n\n // avoid sending empty string (#319)\n xhr.send(settings.data ? settings.data : null)\n return xhr\n }\n\n // handle optional data/success arguments\n function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }\n\n $.get = function(/* url, data, success, dataType */){\n return $.ajax(parseArguments.apply(null, arguments))\n }\n\n $.post = function(/* url, data, success, dataType */){\n var options = parseArguments.apply(null, arguments)\n options.type = 'POST'\n return $.ajax(options)\n }\n\n $.getJSON = function(/* url, data, success */){\n var options = parseArguments.apply(null, arguments)\n options.dataType = 'json'\n return $.ajax(options)\n }\n\n $.fn.load = function(url, data, success){\n if (!this.length) return this\n var self = this, parts = url.split(/\\s/), selector,\n options = parseArguments(url, data, success),\n callback = options.success\n if (parts.length > 1) options.url = parts[0], selector = parts[1]\n options.success = function(response){\n self.html(selector ?\n $('<div>').html(response.replace(rscript, \"\")).find(selector)\n : response)\n callback && callback.apply(self, arguments)\n }\n $.ajax(options)\n return this\n }\n\n var escape = encodeURIComponent\n\n function serialize(params, obj, traditional, scope){\n var type, array = $.isArray(obj), hash = $.isPlainObject(obj)\n $.each(obj, function(key, value) {\n type = $.type(value)\n if (scope) key = traditional ? scope :\n scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']'\n // handle data in serializeArray() format\n if (!scope && array) params.add(value.name, value.value)\n // recurse into nested objects\n else if (type == \"array\" || (!traditional && type == \"object\"))\n serialize(params, value, traditional, key)\n else params.add(key, value)\n })\n }\n\n $.param = function(obj, traditional){\n var params = []\n params.add = function(key, value) {\n if ($.isFunction(value)) value = value()\n if (value == null) value = \"\"\n this.push(escape(key) + '=' + escape(value))\n }\n serialize(params, obj, traditional)\n return params.join('&').replace(/%20/g, '+')\n }\n})(Zepto)\n\n;(function($){\n $.fn.serializeArray = function() {\n var name, type, result = [],\n add = function(value) {\n if (value.forEach) return value.forEach(add)\n result.push({ name: name, value: value })\n }\n if (this[0]) $.each(this[0].elements, function(_, field){\n type = field.type, name = field.name\n if (name && field.nodeName.toLowerCase() != 'fieldset' &&\n !field.disabled && type != 'submit' && type != 'reset' && type != 'button' && type != 'file' &&\n ((type != 'radio' && type != 'checkbox') || field.checked))\n add($(field).val())\n })\n return result\n }\n\n $.fn.serialize = function(){\n var result = []\n this.serializeArray().forEach(function(elm){\n result.push(encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value))\n })\n return result.join('&')\n }\n\n $.fn.submit = function(callback) {\n if (0 in arguments) this.bind('submit', callback)\n else if (this.length) {\n var event = $.Event('submit')\n this.eq(0).trigger(event)\n if (!event.isDefaultPrevented()) this.get(0).submit()\n }\n return this\n }\n\n})(Zepto)\n\n;(function(){\n // getComputedStyle shouldn't freak out when called\n // without a valid element as argument\n try {\n getComputedStyle(undefined)\n } catch(e) {\n var nativeGetComputedStyle = getComputedStyle\n window.getComputedStyle = function(element, pseudoElement){\n try {\n return nativeGetComputedStyle(element, pseudoElement)\n } catch(e) {\n return null\n }\n }\n }\n})()\n return Zepto\n}))\n"},function(){!function(e){e.expr={":":{}},e.support={},e.fn.clone=function(){var t=e();return this.each(function(){t.push(this.cloneNode(!0))}),t},["Left","Top"].forEach(function(t,n){function i(e){return function(e){return e&&"object"==(void 0===e?"undefined":s(e))&&"setInterval"in e}(e)?e:!(9!==e.nodeType)&&(e.defaultView||e.parentWindow)}var o="scroll"+t;e.fn[o]=function(t){var r,s;return void 0===t?(r=this[0])?(s=i(r))?"pageXOffset"in s?s[n?"pageYOffset":"pageXOffset"]:s.document.documentElement[o]||s.document.body[o]:r[o]:null:void this.each(function(){if(s=i(this)){var r=n?e(s).scrollLeft():t,a=n?t:e(s).scrollTop();s.scrollTo(r,a)}else this[o]=t})}}),["width","height"].forEach(function(t){var n=t.replace(/./,function(e){return e[0].toUpperCase()});e.fn["inner"+n]=function(e){var n=this;if(n){var i=n[t]();return{width:["left","right"],height:["top","bottom"]}[t].forEach(function(t){i+=parseInt(n.css("padding-"+t),10),e&&(i+=parseInt(n.css("margin-"+t),10))}),i}return null},e.fn["outer"+n]=function(e){var n=this;if(n){var i=n[t]();return{width:["left","right"],height:["top","bottom"]}[t].forEach(function(t){e&&(i+=parseInt(n.css("margin-"+t),10))}),i}return null}}),e.proxy=function(t,n){if("string"==typeof n){var i=t[n];n=t,t=i}if(e.isFunction(t)){var o=Array.prototype.slice.call(arguments,2),r=function(){return t.apply(n,o.concat(Array.prototype.slice.call(arguments)))};return r.guid=t.guid=t.guid||r.guid||e.guid++,r}};var t=String.prototype.trim;e.trim=function(e,n){return!n&&t?t.call(e):(n=defaultToWhiteSpace(n),e.replace(new RegExp("^["+n+"]+|["+n+"]+$","g"),""))};var n=/^(?:body|html)$/i;e.fn.position=function(){if(!this[0])return null;var t=this[0],i=this.offsetParent(),o=this.offset(),r=n.test(i[0].nodeName)?{top:0,left:0}:i.offset();return o.top-=parseFloat(e(t).css("margin-top"))||0,o.left-=parseFloat(e(t).css("margin-left"))||0,r.top+=parseFloat(e(i[0]).css("border-top-width"))||0,r.left+=parseFloat(e(i[0]).css("border-left-width"))||0,{top:o.top-r.top,left:o.left-r.left}},e.fn.offsetParent=function(){var t=e();return this.each(function(){for(var i=this.offsetParent||document.body;i&&!n.test(i.nodeName)&&"static"===e(i).css("position");)i=i.offsetParent;t.push(i)}),t}}(Zepto)}])},"object"==s(t)&&"object"==s(e)?e.exports=r():(i=[],void 0===(o="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=o))}).call(this,n(0)(e))},function(e,t,n){"use strict";var i,o=n(1);var r=new((i=o)&&i.__esModule?i:{default:i}).default({settings:{showPopoutIcon:!1,showCloseIcon:!1},dimensions:{minItemHeight:40},content:[{type:"row",content:[{type:"column",width:40,content:[{type:"component",componentName:"template",title:"Game",componentState:{id:"client_wrapper"}},{type:"component",title:"Miscellaneous",height:5,componentName:"template",componentState:{id:"misc"}}]},{type:"column",content:[{type:"stack",height:60,content:[{type:"component",title:"Server chat",componentName:"template",componentState:{id:"ooc"}},{type:"component",title:"Log",componentName:"template",componentState:{id:"log"}}]},{type:"row",content:[{type:"component",title:"Music",componentName:"template",componentState:{id:"music"}},{type:"component",title:"Settings",componentName:"template",componentState:{id:"client_settings"}}]}]}]}]});r.registerComponent("template",function(e,t){var n=document.querySelector("#"+t.id);e.getElement().html(n.content)}),r.init()}]); \ No newline at end of file
diff --git a/webAO/ui.js b/webAO/ui.js
index 25e466a..2d41783 100644
--- a/webAO/ui.js
+++ b/webAO/ui.js
@@ -5,6 +5,9 @@ var config = {
showPopoutIcon: false,
showCloseIcon: false
},
+ dimensions: {
+ minItemHeight: 40
+ },
content: [
{
type: "row",