UNPKG

172 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lumino/algorithm"),require("@lumino/domutils"),require("@lumino/messaging"),require("@lumino/properties"),require("@lumino/signaling"),require("@lumino/dragdrop"),require("@lumino/coreutils"),require("@lumino/commands"),require("@lumino/virtualdom"),require("@lumino/disposable"),require("@lumino/keyboard")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm","@lumino/domutils","@lumino/messaging","@lumino/properties","@lumino/signaling","@lumino/dragdrop","@lumino/coreutils","@lumino/commands","@lumino/virtualdom","@lumino/disposable","@lumino/keyboard"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lumino_widgets={},e.lumino_algorithm,e.lumino_domutils,e.lumino_messaging,e.lumino_properties,e.lumino_signaling,e.lumino_dragdrop,e.lumino_coreutils,e.lumino_commands,e.lumino_virtualdom,e.lumino_disposable,e.lumino_keyboard)}(this,(function(e,t,i,n,o,r,s,a,d,h,c,l){"use strict";
2/*! *****************************************************************************
3 Copyright (c) Microsoft Corporation.
4
5 Permission to use, copy, modify, and/or distribute this software for any
6 purpose with or without fee is hereby granted.
7
8 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 PERFORMANCE OF THIS SOFTWARE.
15 ***************************************************************************** */var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var m=function(){return(m=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var f,g=function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1};e.BoxEngine=void 0,(f=e.BoxEngine||(e.BoxEngine={})).calc=function(e,t){var i=e.length;if(0===i)return t;for(var n=0,o=0,r=0,s=0,a=0,d=0;d<i;++d){var h=(y=e[d]).minSize,c=y.maxSize,l=y.sizeHint;y.done=!1,y.size=Math.max(h,Math.min(l,c)),r+=y.size,n+=h,o+=c,y.stretch>0&&(s+=y.stretch,a++)}if(t===r)return 0;if(t<=n){for(d=0;d<i;++d)(y=e[d]).size=y.minSize;return t-n}if(t>=o){for(d=0;d<i;++d)(y=e[d]).size=y.maxSize;return t-o}var u=.01,p=i;if(t<r){for(var m=r-t;a>0&&m>u;){var f=m,g=s;for(d=0;d<i;++d)if(!(y=e[d]).done&&0!==y.stretch){var v=y.stretch*f/g;y.size-v<=y.minSize?(m-=y.size-y.minSize,s-=y.stretch,y.size=y.minSize,y.done=!0,p--,a--):(m-=v,y.size-=v)}}for(;p>0&&m>u;)for(v=m/p,d=0;d<i;++d)(y=e[d]).done||(y.size-v<=y.minSize?(m-=y.size-y.minSize,y.size=y.minSize,y.done=!0,p--):(m-=v,y.size-=v))}else{for(m=t-r;a>0&&m>u;)for(f=m,g=s,d=0;d<i;++d)(y=e[d]).done||0===y.stretch||(v=y.stretch*f/g,y.size+v>=y.maxSize?(m-=y.maxSize-y.size,s-=y.stretch,y.size=y.maxSize,y.done=!0,p--,a--):(m-=v,y.size+=v));for(;p>0&&m>u;)for(v=m/p,d=0;d<i;++d){var y;(y=e[d]).done||(y.size+v>=y.maxSize?(m-=y.maxSize-y.size,y.size=y.maxSize,y.done=!0,p--):(m-=v,y.size+=v))}}return 0},f.adjust=function(e,t,i){0!==e.length&&0!==i&&(i>0?function(e,t,i){for(var n=0,o=0;o<=t;++o)n+=(h=e[o]).maxSize-h.size;for(var r=0,s=(o=t+1,e.length);o<s;++o)r+=(h=e[o]).size-h.minSize;var a=i=Math.min(i,n,r);for(o=t;o>=0&&a>0;--o)(c=(h=e[o]).maxSize-h.size)>=a?(h.sizeHint=h.size+a,a=0):(h.sizeHint=h.size+c,a-=c);var d=i;for(o=t+1,s=e.length;o<s&&d>0;++o){var h,c;(c=(h=e[o]).size-h.minSize)>=d?(h.sizeHint=h.size-d,d=0):(h.sizeHint=h.size-c,d-=c)}}(e,t,i):function(e,t,i){for(var n=0,o=t+1,r=e.length;o<r;++o)n+=(h=e[o]).maxSize-h.size;var s=0;for(o=0;o<=t;++o)s+=(h=e[o]).size-h.minSize;var a=i=Math.min(i,n,s);for(o=t+1,r=e.length;o<r&&a>0;++o)(c=(h=e[o]).maxSize-h.size)>=a?(h.sizeHint=h.size+a,a=0):(h.sizeHint=h.size+c,a-=c);var d=i;for(o=t;o>=0&&d>0;--o){var h,c;(c=(h=e[o]).size-h.minSize)>=d?(h.sizeHint=h.size-d,d=0):(h.sizeHint=h.size-c,d-=c)}}(e,t,-i))};var v,y,b=function(){function e(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new r.Signal(this),this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon?"string"==typeof e.icon?(this._icon=null,this._iconClass=e.icon):this._icon=e.icon:this._icon=null,void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.iconRenderer&&(this._icon=e.iconRenderer),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return null===this._icon?this.iconClass:this._icon},set:function(e){if("string"==typeof e)this._icon=null,this.iconClass=e;else{if(this._icon===e)return;this._icon=e,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(e){this.icon=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),e}();e.Widget=function(){function e(t){void 0===t&&(t={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new r.Signal(this),this._hiddenMode=e.HiddenMode.Display,this.node=v.createNode(t),this.addClass("lm-Widget"),this.addClass("p-Widget")}return e.prototype.dispose=function(){this.isDisposed||(this.setFlag(e.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&e.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),r.Signal.clearData(this),n.MessageLoop.clearData(this),o.AttachedProperty.clearData(this))},Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.testFlag(e.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAttached",{get:function(){return this.testFlag(e.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return this.testFlag(e.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.testFlag(e.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return v.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){if(this._hiddenMode!==t){switch(this._hiddenMode=t,t){case e.HiddenMode.Display:this.node.style.willChange="auto";break;case e.HiddenMode.Scale:this.node.style.willChange="transform"}this.isHidden&&(t===e.HiddenMode.Display?(this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden"),this.node.style.transform=""):(this.node.style.transform="scale(0)",this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")))}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(t&&this.contains(t))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var i=new e.ChildMessage("child-removed",this);n.MessageLoop.sendMessage(this._parent,i)}if(this._parent=t,this._parent&&!this._parent.isDisposed){i=new e.ChildMessage("child-added",this);n.MessageLoop.sendMessage(this._parent,i)}this.isDisposed||n.MessageLoop.sendMessage(this,e.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(t){if(this._layout!==t){if(this.testFlag(e.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(t.parent)throw new Error("Cannot change layout parent.");this._layout=t,t.parent=this}},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this._layout?this._layout.iter():t.empty()},e.prototype.contains=function(e){for(var t=e;t;t=t._parent)if(t===this)return!0;return!1},e.prototype.hasClass=function(e){return this.node.classList.contains(e)},e.prototype.addClass=function(e){this.node.classList.add(e)},e.prototype.removeClass=function(e){this.node.classList.remove(e)},e.prototype.toggleClass=function(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},e.prototype.update=function(){n.MessageLoop.postMessage(this,e.Msg.UpdateRequest)},e.prototype.fit=function(){n.MessageLoop.postMessage(this,e.Msg.FitRequest)},e.prototype.activate=function(){n.MessageLoop.postMessage(this,e.Msg.ActivateRequest)},e.prototype.close=function(){n.MessageLoop.sendMessage(this,e.Msg.CloseRequest)},e.prototype.show=function(){if(this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.BeforeShow),this.clearFlag(e.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this.hiddenMode===e.HiddenMode.Display?(this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")):this.node.style.transform="",!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.AfterShow),this.parent)){var t=new e.ChildMessage("child-shown",this);n.MessageLoop.sendMessage(this.parent,t)}},e.prototype.hide=function(){if(!this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.BeforeHide),this.setFlag(e.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this.hiddenMode===e.HiddenMode.Display?(this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden")):this.node.style.transform="scale(0)",!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.AfterHide),this.parent)){var t=new e.ChildMessage("child-hidden",this);n.MessageLoop.sendMessage(this.parent,t)}},e.prototype.setHidden=function(e){e?this.hide():this.show()},e.prototype.testFlag=function(e){return 0!=(this._flags&e)},e.prototype.setFlag=function(e){this._flags|=e},e.prototype.clearFlag=function(e){this._flags&=~e},e.prototype.processMessage=function(t){switch(t.type){case"resize":this.notifyLayout(t),this.onResize(t);break;case"update-request":this.notifyLayout(t),this.onUpdateRequest(t);break;case"fit-request":this.notifyLayout(t),this.onFitRequest(t);break;case"before-show":this.notifyLayout(t),this.onBeforeShow(t);break;case"after-show":this.setFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterShow(t);break;case"before-hide":this.notifyLayout(t),this.onBeforeHide(t);break;case"after-hide":this.clearFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterHide(t);break;case"before-attach":this.notifyLayout(t),this.onBeforeAttach(t);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(e.Flag.IsVisible),this.setFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterAttach(t);break;case"before-detach":this.notifyLayout(t),this.onBeforeDetach(t);break;case"after-detach":this.clearFlag(e.Flag.IsVisible),this.clearFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterDetach(t);break;case"activate-request":this.notifyLayout(t),this.onActivateRequest(t);break;case"close-request":this.notifyLayout(t),this.onCloseRequest(t);break;case"child-added":this.notifyLayout(t),this.onChildAdded(t);break;case"child-removed":this.notifyLayout(t),this.onChildRemoved(t);break;default:this.notifyLayout(t)}},e.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},e.prototype.onCloseRequest=function(t){this.parent?this.parent=null:this.isAttached&&e.detach(this)},e.prototype.onResize=function(e){},e.prototype.onUpdateRequest=function(e){},e.prototype.onFitRequest=function(e){},e.prototype.onActivateRequest=function(e){},e.prototype.onBeforeShow=function(e){},e.prototype.onAfterShow=function(e){},e.prototype.onBeforeHide=function(e){},e.prototype.onAfterHide=function(e){},e.prototype.onBeforeAttach=function(e){},e.prototype.onAfterAttach=function(e){},e.prototype.onBeforeDetach=function(e){},e.prototype.onAfterDetach=function(e){},e.prototype.onChildAdded=function(e){},e.prototype.onChildRemoved=function(e){},e}(),function(e){var t,i,o;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",(i=e.Flag||(e.Flag={}))[i.IsDisposed=1]="IsDisposed",i[i.IsAttached=2]="IsAttached",i[i.IsHidden=4]="IsHidden",i[i.IsVisible=8]="IsVisible",i[i.DisallowLayout=16]="DisallowLayout",(o=e.Msg||(e.Msg={})).BeforeShow=new n.Message("before-show"),o.AfterShow=new n.Message("after-show"),o.BeforeHide=new n.Message("before-hide"),o.AfterHide=new n.Message("after-hide"),o.BeforeAttach=new n.Message("before-attach"),o.AfterAttach=new n.Message("after-attach"),o.BeforeDetach=new n.Message("before-detach"),o.AfterDetach=new n.Message("after-detach"),o.ParentChanged=new n.Message("parent-changed"),o.UpdateRequest=new n.ConflatableMessage("update-request"),o.FitRequest=new n.ConflatableMessage("fit-request"),o.ActivateRequest=new n.ConflatableMessage("activate-request"),o.CloseRequest=new n.ConflatableMessage("close-request");var r=function(e){function t(t,i){var n=e.call(this,t)||this;return n.child=i,n}return p(t,e),t}(n.Message);e.ChildMessage=r;var s=function(e){function t(t,i){var n=e.call(this,"resize")||this;return n.width=t,n.height=i,n}return p(t,e),t}(n.Message);e.ResizeMessage=s,function(e){e.UnknownSize=new e(-1,-1)}(s=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,i,o){if(void 0===o&&(o=null),t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!i.isConnected)throw new Error("Host is not attached.");n.MessageLoop.sendMessage(t,e.Msg.BeforeAttach),i.insertBefore(t.node,o),n.MessageLoop.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");n.MessageLoop.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),n.MessageLoop.sendMessage(t,e.Msg.AfterDetach)}}(e.Widget||(e.Widget={})),function(e){e.titleProperty=new o.AttachedProperty({name:"title",create:function(e){return new b({owner:e})}}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(v||(v={})),e.Layout=function(){function i(e){void 0===e&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return i.prototype.dispose=function(){this._parent=null,this._disposed=!0,r.Signal.clearData(this),o.AttachedProperty.clearData(this)},Object.defineProperty(i.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),i.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}},i.prototype.init=function(){var e=this;t.each(this,(function(t){t.parent=e.parent}))},i.prototype.onResize=function(i){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e.Widget.ResizeMessage.UnknownSize)}))},i.prototype.onUpdateRequest=function(i){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e.Widget.ResizeMessage.UnknownSize)}))},i.prototype.onBeforeAttach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterAttach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeDetach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterDetach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeShow=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterShow=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeHide=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterHide=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},i.prototype.onFitRequest=function(e){},i.prototype.onChildShown=function(e){},i.prototype.onChildHidden=function(e){},i}(),(y=e.Layout||(e.Layout={})).getHorizontalAlignment=function(e){return _.horizontalAlignmentProperty.get(e)},y.setHorizontalAlignment=function(e,t){_.horizontalAlignmentProperty.set(e,t)},y.getVerticalAlignment=function(e){return _.verticalAlignmentProperty.get(e)},y.setVerticalAlignment=function(e,t){_.verticalAlignmentProperty.set(e,t)};var _,M=function(){function t(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var e=i.ElementExt.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},t.prototype.update=function(t,i,o,r){var s=Math.max(this._minWidth,Math.min(o,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(s<o)switch(e.Layout.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(o-s)/2;break;case"right":t+=o-s;break;default:throw"unreachable"}if(a<r)switch(e.Layout.getVerticalAlignment(this.widget)){case"top":break;case"center":i+=(r-a)/2;break;case"bottom":i+=r-a;break;default:throw"unreachable"}var d=!1,h=this.widget.node.style;if(this._top!==i&&(this._top=i,h.top=i+"px"),this._left!==t&&(this._left=t,h.left=t+"px"),this._width!==s&&(d=!0,this._width=s,h.width=s+"px"),this._height!==a&&(d=!0,this._height=a,h.height=a+"px"),d){var c=new e.Widget.ResizeMessage(s,a);n.MessageLoop.sendMessage(this.widget,c)}},t}();!function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new o.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:t}),e.verticalAlignmentProperty=new o.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:t})}(_||(_={}));var x,w=function(i){function o(){var e=null!==i&&i.apply(this,arguments)||this;return e._widgets=[],e}return p(o,i),o.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();i.prototype.dispose.call(this)},Object.defineProperty(o.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),o.prototype.iter=function(){return t.iter(this._widgets)},o.prototype.addWidget=function(e){this.insertWidget(this._widgets.length,e)},o.prototype.insertWidget=function(e,i){i.parent=this.parent;var n=this._widgets.indexOf(i),o=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return t.ArrayExt.insert(this._widgets,o,i),void(this.parent&&this.attachWidget(o,i));o===this._widgets.length&&o--,n!==o&&(t.ArrayExt.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,i))},o.prototype.removeWidget=function(e){this.removeWidgetAt(this._widgets.indexOf(e))},o.prototype.removeWidgetAt=function(e){var i=t.ArrayExt.removeAt(this._widgets,e);i&&this.parent&&this.detachWidget(e,i)},o.prototype.init=function(){var e=this;i.prototype.init.call(this),t.each(this,(function(t,i){e.attachWidget(i,t)}))},o.prototype.attachWidget=function(t,i){var o=this.parent.node.children[t];this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,o),this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.AfterAttach)},o.prototype.moveWidget=function(t,i,o){this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach);var r=this.parent.node.children[i];this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(o.node,r),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach)},o.prototype.detachWidget=function(t,i){this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.AfterDetach)},o}(e.Layout);!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(x||(x={}));var C,L,E=x;e.SplitLayout=function(o){function r(e){var t=o.call(this)||this;return t.widgetOffset=0,t._fixed=0,t._spacing=4,t._dirty=!1,t._hasNormedSizes=!1,t._sizers=[],t._items=[],t._handles=[],t._box=null,t._alignment="start",t._orientation="horizontal",t.renderer=e.renderer,void 0!==e.orientation&&(t._orientation=e.orientation),void 0!==e.alignment&&(t._alignment=e.alignment),void 0!==e.spacing&&(t._spacing=x.clampDimension(e.spacing)),t}return p(r,o),r.prototype.dispose=function(){t.each(this._items,(function(e){e.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"orientation",{get:function(){return this._orientation},set:function(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"alignment",{get:function(){return this._alignment},set:function(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spacing",{get:function(){return this._spacing},set:function(e){e=x.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),r.prototype.relativeSizes=function(){return L.normalize(this._sizers.map((function(e){return e.size})))},r.prototype.setRelativeSizes=function(e){for(var t=this._sizers.length,i=e.slice(0,t);i.length<t;)i.push(0);for(var n=L.normalize(i),o=0;o<t;++o){var r=this._sizers[o];r.sizeHint=n[o],r.size=n[o]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},r.prototype.moveHandle=function(t,i){var n,o=this._handles[t];if(o&&!o.classList.contains("lm-mod-hidden")&&0!==(n="horizontal"===this._orientation?i-o.offsetLeft:i-o.offsetTop)){for(var r=0,s=this._sizers;r<s.length;r++){var a=s[r];a.size>0&&(a.sizeHint=a.size)}e.BoxEngine.adjust(this._sizers,t,n),this.parent&&this.parent.update()}},r.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,o.prototype.init.call(this)},r.prototype.attachWidget=function(i,o){var r=new M(o),s=L.createHandle(this.renderer),a=L.averageSize(this._sizers),d=L.createSizer(a);t.ArrayExt.insert(this._items,i,r),t.ArrayExt.insert(this._sizers,i,d),t.ArrayExt.insert(this._handles,i,s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(o.node),this.parent.node.appendChild(s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.moveWidget=function(e,i,n){t.ArrayExt.move(this._items,e,i),t.ArrayExt.move(this._sizers,e,i),t.ArrayExt.move(this._handles,e,i),this.parent.fit()},r.prototype.detachWidget=function(i,o){var r=t.ArrayExt.removeAt(this._items,i),s=t.ArrayExt.removeAt(this._handles,i);t.ArrayExt.removeAt(this._sizers,i),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.node.removeChild(s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach),r.dispose(),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype.updateItemPosition=function(e,t,i,n,o,r,s){var a=this._items[e];if(!a.isHidden){var d=this._handles[e].style;t?(i+=this.widgetOffset,a.update(i,n,s,o),i+=s,d.top=n+"px",d.left=i+"px",d.width=this._spacing+"px",d.height=o+"px"):(n+=this.widgetOffset,a.update(i,n,r,s),n+=s,d.top=n+"px",d.left=i+"px",d.width=r+"px",d.height=this._spacing+"px")}},r.prototype._fit=function(){for(var t=0,o=-1,s=0,a=this._items.length;s<a;++s)this._items[s].isHidden?(this._handles[s].classList.add("lm-mod-hidden"),this._handles[s].classList.add("p-mod-hidden")):(this._handles[s].classList.remove("lm-mod-hidden"),this._handles[s].classList.remove("p-mod-hidden"),o=s,t++);-1!==o&&(this._handles[o].classList.add("lm-mod-hidden"),this._handles[o].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,t-1)+this.widgetOffset*this._items.length;var d="horizontal"===this._orientation,h=d?this._fixed:0,c=d?0:this._fixed;for(s=0,a=this._items.length;s<a;++s){var l=this._items[s],u=this._sizers[s];u.size>0&&(u.sizeHint=u.size),l.isHidden?(u.minSize=0,u.maxSize=0):(l.fit(),u.stretch=r.getStretch(l.widget),d?(u.minSize=l.minWidth,u.maxSize=l.maxWidth,h+=l.minWidth,c=Math.max(c,l.minHeight)):(u.minSize=l.minHeight,u.maxSize=l.maxHeight,c+=l.minHeight,h=Math.max(h,l.minWidth)))}var p=this._box=i.ElementExt.boxSizing(this.parent.node);h+=p.horizontalSum,c+=p.verticalSum;var m=this.parent.node.style;m.minWidth=h+"px",m.minHeight=c+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(t,n){this._dirty=!1;for(var o=0,r=0,s=this._items.length;r<s;++r)o+=+!this._items[r].isHidden;if(0!==o||0!==this.widgetOffset){t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var a=this._box.paddingTop,d=this._box.paddingLeft,h=t-this._box.horizontalSum,c=n-this._box.verticalSum,l=0,u=0,p="horizontal"===this._orientation;if(o>0){var m=void 0;if(m=p?Math.max(0,h-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var f=0,g=this._sizers;f<g.length;f++){g[f].sizeHint*=m}this._hasNormedSizes=!1}var v=e.BoxEngine.calc(this._sizers,m);if(v>0)switch(this._alignment){case"start":break;case"center":l=0,u=v/2;break;case"end":l=0,u=v;break;case"justify":l=v/o,u=0;break;default:throw"unreachable"}}for(r=0,s=this._items.length;r<s;++r){var y=this._items[r].isHidden?0:this._sizers[r].size+l;this.updateItemPosition(r,p,p?d+u:d,p?a:a+u,c,h,y);var b=this.widgetOffset+(this._handles[r].classList.contains("lm-mod-hidden")?0:this._spacing);p?d+=y+b:a+=y+b}}},r}(w),(C=e.SplitLayout||(e.SplitLayout={})).getStretch=function(e){return L.stretchProperty.get(e)},C.setStretch=function(e,t){L.stretchProperty.set(e,t)},function(t){t.stretchProperty=new o.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:function(t){t.parent&&t.parent.layout instanceof e.SplitLayout&&t.parent.fit()}}),t.createSizer=function(e){var t=new g;return t.sizeHint=Math.floor(e),t},t.createHandle=function(e){var t=e.createHandle();return t.style.position="absolute",t},t.averageSize=function(e){return e.reduce((function(e,t){return e+t.size}),0)/e.length||0},t.normalize=function(e){var t=e.length;if(0===t)return[];var i=e.reduce((function(e,t){return e+Math.abs(t)}),0);return 0===i?e.map((function(e){return 1/t})):e.map((function(e){return e/i}))}}(L||(L={}));var A,S=function(e){function i(t){var i=e.call(this,m(m({},t),{orientation:t.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=t.titleSpace||22,i}return p(i,e),Object.defineProperty(i.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(e){e=E.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),i.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,e.prototype.dispose.call(this))},i.prototype.updateTitle=function(e,t){var i=this._titles[e],n=i.classList.contains("lm-mod-expanded"),o=A.createTitle(this.renderer,t.title,n);this._titles[e]=o,this.parent.node.replaceChild(o,i)},i.prototype.attachWidget=function(i,n){var o=A.createTitle(this.renderer,n.title);t.ArrayExt.insert(this._titles,i,o),this.parent.node.appendChild(o),n.node.setAttribute("role","region"),n.node.setAttribute("aria-labelledby",o.id),e.prototype.attachWidget.call(this,i,n)},i.prototype.moveWidget=function(i,n,o){t.ArrayExt.move(this._titles,i,n),e.prototype.moveWidget.call(this,i,n,o)},i.prototype.detachWidget=function(i,n){var o=t.ArrayExt.removeAt(this._titles,i);this.parent.node.removeChild(o),e.prototype.detachWidget.call(this,i,n)},i.prototype.updateItemPosition=function(t,i,n,o,r,s,a){var d=this._titles[t].style;d.top=o+"px",d.left=n+"px",d.height=this.widgetOffset+"px",d.width=i?r+"px":s+"px",e.prototype.updateItemPosition.call(this,t,i,n,o,r,s,a)},i}(e.SplitLayout);!function(e){e.createTitle=function(e,t,i){void 0===i&&(i=!0);var n=e.createSectionTitle(t);return n.style.position="absolute",n.setAttribute("aria-label",t.label+" Section"),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",t.owner.id),i&&n.classList.add("lm-mod-expanded"),n}}(A||(A={}));var P,I,z,B,T,D,k,O,W,R,N,H=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=P.createLayout(t),i}return p(t,e),Object.defineProperty(t.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),t.prototype.addWidget=function(e){this.layout.addWidget(e)},t.prototype.insertWidget=function(e,t){this.layout.insertWidget(e,t)},t}(e.Widget);!function(e){e.createLayout=function(e){return e.layout||new w}}(P||(P={})),e.SplitPanel=function(e){function i(t){void 0===t&&(t={});var i=e.call(this,{layout:B.createLayout(t)})||this;return i._handleMoved=new r.Signal(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return p(i,e),i.prototype.dispose=function(){this._releaseMouse(),e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(e){this.layout.orientation=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(e){this.layout.alignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(e){this.layout.spacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),i.prototype.relativeSizes=function(){return this.layout.relativeSizes()},i.prototype.setRelativeSizes=function(e){this.layout.setRelativeSizes(e)},i.prototype.handleEvent=function(e){switch(e.type){case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointerdown":this._evtMouseDown(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},i.prototype.onBeforeAttach=function(e){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},i.prototype.onAfterDetach=function(e){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},i.prototype.onChildAdded=function(e){e.child.addClass("lm-SplitPanel-child"),e.child.addClass("p-SplitPanel-child"),this._releaseMouse()},i.prototype.onChildRemoved=function(e){e.child.removeClass("lm-SplitPanel-child"),e.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},i.prototype._evtKeyDown=function(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()},i.prototype._evtMouseDown=function(e){if(0===e.button){var i=this.layout,n=t.ArrayExt.findFirstIndex(i.handles,(function(t){return t.contains(e.target)}));if(-1!==n){var o;e.preventDefault(),e.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var r=i.handles[n],a=r.getBoundingClientRect();o="horizontal"===i.orientation?e.clientX-a.left:e.clientY-a.top;var d=window.getComputedStyle(r),h=s.Drag.overrideCursor(d.cursor);this._pressData={index:n,delta:o,override:h}}}},i.prototype._evtMouseMove=function(e){var t;e.preventDefault(),e.stopPropagation();var i=this.layout,n=this.node.getBoundingClientRect();t="horizontal"===i.orientation?e.clientX-n.left-this._pressData.delta:e.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)},i.prototype._evtMouseUp=function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())},i.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))},i}(H),I=e.SplitPanel||(e.SplitPanel={}),z=function(){function e(){}return e.prototype.createHandle=function(){var e=document.createElement("div");return e.className="lm-SplitPanel-handle",e.classList.add("p-SplitPanel-handle"),e},e}(),I.Renderer=z,I.defaultRenderer=new z,I.getStretch=function(t){return e.SplitLayout.getStretch(t)},I.setStretch=function(t,i){e.SplitLayout.setStretch(t,i)},function(t){t.createLayout=function(t){return t.layout||new e.SplitLayout({renderer:t.renderer||e.SplitPanel.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(B||(B={})),e.AccordionPanel=function(e){function i(t){void 0===t&&(t={});var i=e.call(this,m(m({},t),{layout:T.createLayout(t)}))||this;return i.addClass("lm-AccordionPanel"),i}return p(i,e),Object.defineProperty(i.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(e){this.layout.titleSpace=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),i.prototype.addWidget=function(t){e.prototype.addWidget.call(this,t),t.title.changed.connect(this._onTitleChanged,this)},i.prototype.insertWidget=function(t,i){e.prototype.insertWidget.call(this,t,i),i.title.changed.connect(this._onTitleChanged,this)},i.prototype.handleEvent=function(t){switch(e.prototype.handleEvent.call(this,t),t.type){case"click":this._evtClick(t);break;case"keydown":this._eventKeyDown(t)}},i.prototype.onBeforeAttach=function(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),e.prototype.onBeforeAttach.call(this,t)},i.prototype.onAfterDetach=function(t){e.prototype.onAfterDetach.call(this,t),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},i.prototype._onTitleChanged=function(e){var i=t.ArrayExt.findFirstIndex(this.widgets,(function(t){return t.contains(e.owner)}));i>=0&&(this.layout.updateTitle(i,e.owner),this.update())},i.prototype._evtClick=function(e){var i=e.target;if(i){var n=t.ArrayExt.findFirstIndex(this.titles,(function(e){return e.contains(i)}));if(n>=0){e.preventDefault(),e.stopPropagation();var o=this.titles[n],r=this.layout.widgets[n];r.isHidden?(o.classList.add("lm-mod-expanded"),o.setAttribute("aria-expanded","true"),r.show()):(o.classList.remove("lm-mod-expanded"),o.setAttribute("aria-expanded","false"),r.hide())}}},i.prototype._eventKeyDown=function(e){if(!e.defaultPrevented){var i=e.target,n=!1;if(i){var o=t.ArrayExt.findFirstIndex(this.titles,(function(e){return e.contains(i)}));if(o>=0){var r=e.keyCode.toString();if(e.key.match(/Space|Enter/)||r.match(/13|32/))i.click(),n=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){var s=e.key.match(/ArrowLeft|ArrowUp/)||r.match(/37|38/)?-1:1,a=this.titles.length,d=(o+a+s)%a;this.titles[d].focus(),n=!0}else"End"===e.key||"35"===r?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==e.key&&"36"!==r||(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}},i}(e.SplitPanel),function(t){var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.titleClassName="lm-AccordionPanel-title",t._titleID=0,t._titleKeys=new WeakMap,t}return p(t,e),t.prototype.createCollapseIcon=function(e){return document.createElement("span")},t.prototype.createSectionTitle=function(e){var t=document.createElement("h3");for(var i in t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName,t.title=e.caption,e.dataset)t.dataset[i]=e.dataset[i];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";var n=t.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=e.label,t},t.prototype.createTitleKey=function(e){var t=this._titleKeys.get(e);return void 0===t&&(t="title-key-"+this._titleID++,this._titleKeys.set(e,t)),t},t}(e.SplitPanel.Renderer);t.Renderer=i,t.defaultRenderer=new i}(e.AccordionPanel||(e.AccordionPanel={})),function(t){t.createLayout=function(t){return t.layout||new S({renderer:t.renderer||e.AccordionPanel.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(T||(T={})),e.BoxLayout=function(o){function r(e){void 0===e&&(e={});var t=o.call(this)||this;return t._fixed=0,t._spacing=4,t._dirty=!1,t._sizers=[],t._items=[],t._box=null,t._alignment="start",t._direction="top-to-bottom",void 0!==e.direction&&(t._direction=e.direction),void 0!==e.alignment&&(t._alignment=e.alignment),void 0!==e.spacing&&(t._spacing=E.clampDimension(e.spacing)),t}return p(r,o),r.prototype.dispose=function(){t.each(this._items,(function(e){e.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"direction",{get:function(){return this._direction},set:function(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"alignment",{get:function(){return this._alignment},set:function(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spacing",{get:function(){return this._spacing},set:function(e){e=E.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),r.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,o.prototype.init.call(this)},r.prototype.attachWidget=function(i,o){t.ArrayExt.insert(this._items,i,new M(o)),t.ArrayExt.insert(this._sizers,i,new g),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.moveWidget=function(e,i,n){t.ArrayExt.move(this._items,e,i),t.ArrayExt.move(this._sizers,e,i),this.parent.update()},r.prototype.detachWidget=function(i,o){var r=t.ArrayExt.removeAt(this._items,i);t.ArrayExt.removeAt(this._sizers,i),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach),r.dispose(),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype._fit=function(){for(var t=0,o=0,s=this._items.length;o<s;++o)t+=+!this._items[o].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var a=k.isHorizontal(this._direction),d=a?this._fixed:0,h=a?0:this._fixed;for(o=0,s=this._items.length;o<s;++o){var c=this._items[o],l=this._sizers[o];c.isHidden?(l.minSize=0,l.maxSize=0):(c.fit(),l.sizeHint=r.getSizeBasis(c.widget),l.stretch=r.getStretch(c.widget),a?(l.minSize=c.minWidth,l.maxSize=c.maxWidth,d+=c.minWidth,h=Math.max(h,c.minHeight)):(l.minSize=c.minHeight,l.maxSize=c.maxHeight,h+=c.minHeight,d=Math.max(d,c.minWidth)))}var u=this._box=i.ElementExt.boxSizing(this.parent.node);d+=u.horizontalSum,h+=u.verticalSum;var p=this.parent.node.style;p.minWidth=d+"px",p.minHeight=h+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(t,n){this._dirty=!1;for(var o=0,r=0,s=this._items.length;r<s;++r)o+=+!this._items[r].isHidden;if(0!==o){t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var a,d=this._box.paddingTop,h=this._box.paddingLeft,c=t-this._box.horizontalSum,l=n-this._box.verticalSum;switch(this._direction){case"left-to-right":a=e.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed));break;case"top-to-bottom":a=e.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed));break;case"right-to-left":a=e.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed)),h+=c;break;case"bottom-to-top":a=e.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed)),d+=l;break;default:throw"unreachable"}var u=0,p=0;if(a>0)switch(this._alignment){case"start":break;case"center":u=0,p=a/2;break;case"end":u=0,p=a;break;case"justify":u=a/o,p=0;break;default:throw"unreachable"}for(r=0,s=this._items.length;r<s;++r){var m=this._items[r];if(!m.isHidden){var f=this._sizers[r].size;switch(this._direction){case"left-to-right":m.update(h+p,d,f+u,l),h+=f+u+this._spacing;break;case"top-to-bottom":m.update(h,d+p,c,f+u),d+=f+u+this._spacing;break;case"right-to-left":m.update(h-p-f-u,d,f+u,l),h-=f+u+this._spacing;break;case"bottom-to-top":m.update(h,d-p-f-u,c,f+u),d-=f+u+this._spacing;break;default:throw"unreachable"}}}}},r}(w),(D=e.BoxLayout||(e.BoxLayout={})).getStretch=function(e){return k.stretchProperty.get(e)},D.setStretch=function(e,t){k.stretchProperty.set(e,t)},D.getSizeBasis=function(e){return k.sizeBasisProperty.get(e)},D.setSizeBasis=function(e,t){k.sizeBasisProperty.set(e,t)},function(t){function i(t){t.parent&&t.parent.layout instanceof e.BoxLayout&&t.parent.fit()}t.stretchProperty=new o.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:i}),t.sizeBasisProperty=new o.AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:i}),t.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},t.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(k||(k={})),e.BoxPanel=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,{layout:W.createLayout(t)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return p(t,e),Object.defineProperty(t.prototype,"direction",{get:function(){return this.layout.direction},set:function(e){this.layout.direction=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(e){this.layout.alignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(e){this.layout.spacing=e},enumerable:!0,configurable:!0}),t.prototype.onChildAdded=function(e){e.child.addClass("lm-BoxPanel-child"),e.child.addClass("p-BoxPanel-child")},t.prototype.onChildRemoved=function(e){e.child.removeClass("lm-BoxPanel-child"),e.child.removeClass("p-BoxPanel-child")},t}(H),(O=e.BoxPanel||(e.BoxPanel={})).getStretch=function(t){return e.BoxLayout.getStretch(t)},O.setStretch=function(t,i){e.BoxLayout.setStretch(t,i)},O.getSizeBasis=function(t){return e.BoxLayout.getSizeBasis(t)},O.setSizeBasis=function(t,i){e.BoxLayout.setSizeBasis(t,i)},function(t){t.createLayout=function(t){return t.layout||new e.BoxLayout(t)}}(W||(W={})),e.CommandPalette=function(n){function o(t){var i=n.call(this,{node:R.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("lm-CommandPalette"),i.addClass("p-CommandPalette"),i.setFlag(e.Widget.Flag.DisallowLayout),i.commands=t.commands,i.renderer=t.renderer||o.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return p(o,n),o.prototype.dispose=function(){this._items.length=0,this._results=null,n.prototype.dispose.call(this)},Object.defineProperty(o.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),o.prototype.addItem=function(e){var t=R.createItem(this.commands,e);return this._items.push(t),this.refresh(),t},o.prototype.addItems=function(e){var t=this,i=e.map((function(e){return R.createItem(t.commands,e)}));return i.forEach((function(e){return t._items.push(e)})),this.refresh(),i},o.prototype.removeItem=function(e){this.removeItemAt(this._items.indexOf(e))},o.prototype.removeItemAt=function(e){t.ArrayExt.removeAt(this._items,e)&&this.refresh()},o.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},o.prototype.refresh=function(){(this._results=null,""!==this.inputNode.value)?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none";this.update()},o.prototype.handleEvent=function(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},o.prototype.onBeforeAttach=function(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},o.prototype.onAfterDetach=function(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},o.prototype.onActivateRequest=function(e){if(this.isAttached){var t=this.inputNode;t.focus(),t.select()}},o.prototype.onUpdateRequest=function(e){var n=this.inputNode.value,o=this.contentNode,r=this._results;if(r||(r=this._results=R.search(this._items,n),this._activeIndex=n?t.ArrayExt.findFirstIndex(r,R.canActivate):-1),n||0!==r.length)if(n&&0===r.length){var s=this.renderer.renderEmptyMessage({query:n});h.VirtualDOM.render(s,o)}else{for(var a=this.renderer,d=this._activeIndex,c=new Array(r.length),l=0,u=r.length;l<u;++l){var p=r[l];if("header"===p.type){var m=p.indices,f=p.category;c[l]=a.renderHeader({category:f,indices:m})}else{var g=p.item,v=(m=p.indices,l===d);c[l]=a.renderItem({item:g,indices:m,active:v})}}if(h.VirtualDOM.render(c,o),d<0||d>=r.length)o.scrollTop=0;else{var y=o.children[d];i.ElementExt.scrollIntoViewIfNeeded(o,y)}}else h.VirtualDOM.render(null,o)},o.prototype._evtClick=function(e){if(0===e.button){if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();var i=t.ArrayExt.findFirstIndex(this.contentNode.children,(function(t){return t.contains(e.target)}));-1!==i&&(e.preventDefault(),e.stopPropagation(),this._execute(i))}},o.prototype._evtKeyDown=function(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}},o.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var e=this._activeIndex,i=this._results.length,n=e<i-1?e+1:0,o=0===n?i-1:n-1;this._activeIndex=t.ArrayExt.findFirstIndex(this._results,R.canActivate,n,o),this.update()}},o.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var e=this._activeIndex,i=this._results.length,n=e<=0?i-1:e-1,o=n===i-1?0:n+1;this._activeIndex=t.ArrayExt.findLastIndex(this._results,R.canActivate,n,o),this.update()}},o.prototype._execute=function(e){if(this._results){var t=this._results[e];if(t){if("header"===t.type){var i=this.inputNode;return i.value=t.category.toLowerCase()+" ",i.focus(),void this.refresh()}t.item.isEnabled&&(this.commands.execute(t.item.command,t.item.args),this.inputNode.value="",this.refresh())}}},o.prototype._toggleFocused=function(){var e=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",e),this.toggleClass("p-mod-focused",e)},o.prototype._onGenericChange=function(){this.refresh()},o}(e.Widget),function(e){var i=function(){function e(){}return e.prototype.renderHeader=function(e){var t=this.formatHeader(e);return h.h.li({className:"lm-CommandPalette-header p-CommandPalette-header"},t)},e.prototype.renderItem=function(e){var t=this.createItemClass(e),i=this.createItemDataset(e);return e.item.isToggleable?h.h.li({className:t,dataset:i,role:"checkbox","aria-checked":""+e.item.isToggled},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e)):h.h.li({className:t,dataset:i},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e))},e.prototype.renderEmptyMessage=function(e){var t=this.formatEmptyMessage(e);return h.h.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},t)},e.prototype.renderItemIcon=function(e){var t=this.createIconClass(e);return"string"==typeof e.item.icon?h.h.div({className:t},e.item.iconLabel):h.h.div({className:t},e.item.icon,e.item.iconLabel)},e.prototype.renderItemContent=function(e){return h.h.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(e),this.renderItemCaption(e))},e.prototype.renderItemLabel=function(e){var t=this.formatItemLabel(e);return h.h.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},t)},e.prototype.renderItemCaption=function(e){var t=this.formatItemCaption(e);return h.h.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},t)},e.prototype.renderItemShortcut=function(e){var t=this.formatItemShortcut(e);return h.h.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},t)},e.prototype.createItemClass=function(e){var t="lm-CommandPalette-item";t+=" p-CommandPalette-item",e.item.isEnabled||(t+=" lm-mod-disabled",t+=" p-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled",t+=" p-mod-toggled"),e.active&&(t+=" lm-mod-active",t+=" p-mod-active");var i=e.item.className;return i&&(t+=" "+i),t},e.prototype.createItemDataset=function(e){return m(m({},e.item.dataset),{command:e.item.command})},e.prototype.createIconClass=function(e){var t="lm-CommandPalette-itemIcon";t+=" p-CommandPalette-itemIcon";var i=e.item.iconClass;return i?t+" "+i:t},e.prototype.formatHeader=function(e){return e.indices&&0!==e.indices.length?t.StringExt.highlight(e.category,e.indices,h.h.mark):e.category},e.prototype.formatEmptyMessage=function(e){return"No commands found that match '"+e.query+"'"},e.prototype.formatItemShortcut=function(e){var t=e.item.keyBinding;return t?t.keys.map(d.CommandRegistry.formatKeystroke).join(", "):null},e.prototype.formatItemLabel=function(e){return e.indices&&0!==e.indices.length?t.StringExt.highlight(e.item.label,e.indices,h.h.mark):e.item.label},e.prototype.formatItemCaption=function(e){return e.item.caption},e}();e.Renderer=i,e.defaultRenderer=new i}(e.CommandPalette||(e.CommandPalette={})),function(e){function i(e,i){for(var n=e.category.toLowerCase(),o=n+" "+e.label.toLowerCase(),r=1/0,s=null,a=/\b\w/g;;){var d=a.exec(o);if(!d)break;var h=t.StringExt.matchSumOfDeltas(o,i,d.index);if(!h)break;h&&h.score<=r&&(r=h.score,s=h.indices)}if(!s||r===1/0)return null;for(var c=n.length+1,l=t.ArrayExt.lowerBound(s,c,(function(e,t){return e-t})),u=s.slice(0,l),p=s.slice(l),m=0,f=p.length;m<f;++m)p[m]-=c;return 0===u.length?{matchType:0,categoryIndices:null,labelIndices:p,score:r,item:e}:0===p.length?{matchType:1,categoryIndices:u,labelIndices:null,score:r,item:e}:{matchType:2,categoryIndices:u,labelIndices:p,score:r,item:e}}function n(e,t){var i=e.matchType-t.matchType;if(0!==i)return i;var n=e.score-t.score;if(0!==n)return n;var o=0,r=0;switch(e.matchType){case 0:o=e.labelIndices[0],r=t.labelIndices[0];break;case 1:case 2:o=e.categoryIndices[0],r=t.categoryIndices[0]}if(o!==r)return o-r;var s=e.item.category.localeCompare(t.item.category);if(0!==s)return s;var a=e.item.rank,d=t.item.rank;return a!==d?a<d?-1:1:e.item.label.localeCompare(t.item.label)}e.createNode=function(){var e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("input"),o=document.createElement("ul"),r=document.createElement("button");return t.className="lm-CommandPalette-search",i.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",r.className="lm-close-icon",o.className="lm-CommandPalette-content",t.classList.add("p-CommandPalette-search"),i.classList.add("p-CommandPalette-wrapper"),n.classList.add("p-CommandPalette-input"),o.classList.add("p-CommandPalette-content"),n.spellcheck=!1,i.appendChild(n),i.appendChild(r),t.appendChild(i),e.appendChild(t),e.appendChild(o),e},e.createItem=function(e,t){return new o(e,t)},e.search=function(e,o){var r=function(e,t){n=t,t=n.replace(/\s+/g,"").toLowerCase();var n;for(var o=[],r=0,s=e.length;r<s;++r){var a=e[r];if(a.isVisible)if(t){var d=i(a,t);d&&(a.isEnabled||(d.score+=1e3),o.push(d))}else o.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return o}(e,o);return r.sort(n),function(e){var i=new Array(e.length);t.ArrayExt.fill(i,!1);for(var n=[],o=0,r=e.length;o<r;++o)if(!i[o]){var s=e[o],a=s.item,d=s.categoryIndices,h=a.category;n.push({type:"header",category:h,indices:d});for(var c=o;c<r;++c)if(!i[c]){var l=e[c],u=l.item,p=l.labelIndices;u.category===h&&(n.push({type:"item",item:u,indices:p}),i[c]=!0)}}return n}(r)},e.canActivate=function(e){return"item"===e.type&&e.item.isEnabled};var o=function(){function e(e,t){this._commands=e,this.category=t.category.trim().replace(/\s+/g," "),this.command=t.command,this.args=t.args||a.JSONExt.emptyObject,this.rank=void 0!==t.rank?t.rank:1/0}return Object.defineProperty(e.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keyBinding",{get:function(){var e=this.command,i=this.args;return t.ArrayExt.findLastValue(this._commands.keyBindings,(function(t){return t.command===e&&a.JSONExt.deepEqual(t.args,i)}))||null},enumerable:!0,configurable:!0}),e}()}(R||(R={})),e.Menu=function(o){function s(t){var i=o.call(this,{node:N.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new r.Signal(i),i._menuRequested=new r.Signal(i),i.addClass("lm-Menu"),i.addClass("p-Menu"),i.setFlag(e.Widget.Flag.DisallowLayout),i.commands=t.commands,i.renderer=t.renderer||s.defaultRenderer,i}return p(s,o),s.prototype.dispose=function(){this.close(),this._items.length=0,o.prototype.dispose.call(this)},Object.defineProperty(s.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"rootMenu",{get:function(){for(var e=this;e._parentMenu;)e=e._parentMenu;return e},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"leafMenu",{get:function(){for(var e=this;e._childMenu;)e=e._childMenu;return e},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(e){this.activeIndex=e?this._items.indexOf(e):-1},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||N.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),s.prototype.activateNextItem=function(){var e=this._items.length,i=this._activeIndex,n=i<e-1?i+1:0,o=0===n?e-1:n-1;this.activeIndex=t.ArrayExt.findFirstIndex(this._items,N.canActivate,n,o)},s.prototype.activatePreviousItem=function(){var e=this._items.length,i=this._activeIndex,n=i<=0?e-1:i-1,o=n===e-1?0:n+1;this.activeIndex=t.ArrayExt.findLastIndex(this._items,N.canActivate,n,o)},s.prototype.triggerActiveItem=function(){if(this.isAttached){var e=this.activeItem;if(e)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==e.type){this.rootMenu.close();var t=e.command,i=e.args;this.commands.isEnabled(t,i)?this.commands.execute(t,i):console.log("Command '"+t+"' is disabled.")}else this._openChildMenu(!0)}},s.prototype.addItem=function(e){return this.insertItem(this._items.length,e)},s.prototype.insertItem=function(e,i){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(e,this._items.length)),o=N.createItem(this,i);return t.ArrayExt.insert(this._items,n,o),this.update(),o},s.prototype.removeItem=function(e){this.removeItemAt(this._items.indexOf(e))},s.prototype.removeItemAt=function(e){this.isAttached&&this.close(),this.activeIndex=-1,t.ArrayExt.removeAt(this._items,e)&&this.update()},s.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},s.prototype.open=function(e,t,i){if(void 0===i&&(i={}),!this.isAttached){var n=i.forceX||!1,o=i.forceY||!1;N.openRootMenu(this,e,t,n,o),this.activate()}},s.prototype.handleEvent=function(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},s.prototype.onBeforeAttach=function(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},s.prototype.onAfterDetach=function(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},s.prototype.onActivateRequest=function(e){this.isAttached&&this.node.focus()},s.prototype.onUpdateRequest=function(e){for(var t=this,i=this._items,n=this.renderer,o=this._activeIndex,r=N.computeCollapsed(i),s=new Array(i.length),a=function(e,a){var d=i[e],h=e===o,c=r[e];s[e]=n.renderItem({item:d,active:h,collapsed:c,onfocus:function(){t.activeIndex=e}})},d=0,c=i.length;d<c;++d)a(d);h.VirtualDOM.render(s,this.contentNode)},s.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());var i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),o.prototype.onCloseRequest.call(this,e)},s.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation();var t=e.keyCode;if(13!==t)if(27!==t)if(37!==t)if(38!==t)if(39!==t)if(40!==t){var i=l.getKeyboardLayout().keyForKeydownEvent(e);if(i){var n=this._activeIndex+1,o=N.findMnemonic(this._items,i,n);-1===o.index||o.multiple?-1!==o.index?this.activeIndex=o.index:-1!==o.auto&&(this.activeIndex=o.auto):(this.activeIndex=o.index,this.triggerActiveItem())}}else this.activateNextItem();else{var r=this.activeItem;r&&"submenu"===r.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next")}else this.activatePreviousItem();else this._parentMenu?this.close():this._menuRequested.emit("previous");else this.close();else this.triggerActiveItem()},s.prototype._evtMouseUp=function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())},s.prototype._evtMouseMove=function(e){var n=t.ArrayExt.findFirstIndex(this.contentNode.children,(function(t){return i.ElementExt.hitTest(t,e.clientX,e.clientY)}));if(n!==this._activeIndex){if(this.activeIndex=n,(n=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var o=this.activeItem;o&&"submenu"===o.type&&o.submenu&&this._startOpenTimer()}},s.prototype._evtMouseEnter=function(e){for(var t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex},s.prototype._evtMouseLeave=function(e){if(this._cancelOpenTimer(),this._childMenu){var t=e.clientX,n=e.clientY;i.ElementExt.hitTest(this._childMenu.node,t,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},s.prototype._evtMouseDown=function(e){this._parentMenu||(N.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())},s.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var i=this.activeItem;if(i&&"submenu"===i.type&&i.submenu){var o=i.submenu;if(o!==this._childMenu){this._closeChildMenu(),this._childMenu=o,this._childIndex=this._activeIndex,o._parentMenu=this,n.MessageLoop.sendMessage(this,e.Widget.Msg.UpdateRequest);var r=this.contentNode.children[this._activeIndex];N.openSubmenu(o,r),t&&(o.activeIndex=-1,o.activateNextItem()),o.activate()}}else this._closeChildMenu()},s.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},s.prototype._startOpenTimer=function(){var e=this;0===this._openTimerID&&(this._openTimerID=window.setTimeout((function(){e._openTimerID=0,e._openChildMenu()}),N.TIMER_DELAY))},s.prototype._startCloseTimer=function(){var e=this;0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((function(){e._closeTimerID=0,e._closeChildMenu()}),N.TIMER_DELAY))},s.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},s.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},s}(e.Widget),function(e){var t=function(){function e(){}return e.prototype.renderItem=function(e){var t=this.createItemClass(e),i=this.createItemDataset(e),n=this.createItemARIA(e);return h.h.li(m({className:t,dataset:i,tabindex:"0",onfocus:e.onfocus},n),this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))},e.prototype.renderIcon=function(e){var t=this.createIconClass(e);return"string"==typeof e.item.icon?h.h.div({className:t},e.item.iconLabel):h.h.div({className:t},e.item.icon,e.item.iconLabel)},e.prototype.renderLabel=function(e){var t=this.formatLabel(e);return h.h.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},t)},e.prototype.renderShortcut=function(e){var t=this.formatShortcut(e);return h.h.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},t)},e.prototype.renderSubmenu=function(e){return h.h.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},e.prototype.createItemClass=function(e){var t="lm-Menu-item";t+=" p-Menu-item",e.item.isEnabled||(t+=" lm-mod-disabled",t+=" p-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled",t+=" p-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden",t+=" p-mod-hidden"),e.active&&(t+=" lm-mod-active",t+=" p-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed",t+=" p-mod-collapsed");var i=e.item.className;return i&&(t+=" "+i),t},e.prototype.createItemDataset=function(e){var t=e.item,i=t.type,n=t.command,o=t.dataset;return m(m({},o),"command"===i?{type:i,command:n}:{type:i})},e.prototype.createIconClass=function(e){var t="lm-Menu-itemIcon";t+=" p-Menu-itemIcon";var i=e.item.iconClass;return i?t+" "+i:t},e.prototype.createItemARIA=function(e){var t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),t.role="menuitem"}return t},e.prototype.formatLabel=function(e){var t=e.item,i=t.label,n=t.mnemonic;if(n<0||n>=i.length)return i;var o=i.slice(0,n),r=i.slice(n+1),s=i[n];return[o,h.h.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},s),r]},e.prototype.formatShortcut=function(e){var t=e.item.keyBinding;return t?t.keys.map(d.CommandRegistry.formatKeystroke).join(", "):null},e}();e.Renderer=t,e.defaultRenderer=new t}(e.Menu||(e.Menu={})),function(o){function r(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}o.TIMER_DELAY=300,o.SUBMENU_OVERLAP=3,o.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",t.classList.add("p-Menu-content"),e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},o.canActivate=r,o.createItem=function(e,t){return new s(e.commands,t)},o.hitTestMenus=function(e,t,n){for(var o=e;o;o=o.childMenu)if(i.ElementExt.hitTest(o.node,t,n))return!0;return!1},o.computeCollapsed=function(e){var i=new Array(e.length);t.ArrayExt.fill(i,!1);for(var n=0,o=e.length;n<o;++n){if((a=e[n]).isVisible){if("separator"!==a.type)break;i[n]=!0}}for(var r=o-1;r>=0;--r){if((a=e[r]).isVisible){if("separator"!==a.type)break;i[r]=!0}}for(var s=!1;++n<r;){var a;(a=e[n]).isVisible&&("separator"!==a.type?s=!1:s?i[n]=!0:s=!0)}return i},o.openRootMenu=function(t,i,o,r,s){n.MessageLoop.sendMessage(t,e.Widget.Msg.UpdateRequest);var a=window.pageXOffset,d=window.pageYOffset,h=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=c-(s?o:0),u=t.node,p=u.style;p.top="",p.left="",p.width="",p.height="",p.visibility="hidden",p.maxHeight=l+"px",e.Widget.attach(t,document.body);var m=u.getBoundingClientRect(),f=m.width,g=m.height;!r&&i+f>a+h&&(i=a+h-f),!s&&o+g>d+c&&(o>d+c?o=d+c-g:o-=g),p.top=Math.max(0,o)+"px",p.left=Math.max(0,i)+"px",p.visibility=""},o.openSubmenu=function(t,r){n.MessageLoop.sendMessage(t,e.Widget.Msg.UpdateRequest);var s=window.pageXOffset,a=window.pageYOffset,d=document.documentElement.clientWidth,h=document.documentElement.clientHeight,c=h,l=t.node,u=l.style;u.top="",u.left="",u.width="",u.height="",u.visibility="hidden",u.maxHeight=c+"px",e.Widget.attach(t,document.body);var p=l.getBoundingClientRect(),m=p.width,f=p.height,g=i.ElementExt.boxSizing(t.node),v=r.getBoundingClientRect(),y=v.right-o.SUBMENU_OVERLAP;y+m>s+d&&(y=v.left+o.SUBMENU_OVERLAP-m);var b=v.top-g.borderTop-g.paddingTop;b+f>a+h&&(b=v.bottom+g.borderBottom+g.paddingBottom-f),u.top=Math.max(0,b)+"px",u.left=Math.max(0,y)+"px",u.visibility=""},o.findMnemonic=function(e,t,i){for(var n=-1,o=-1,s=!1,a=t.toUpperCase(),d=0,h=e.length;d<h;++d){var c=(d+i)%h,l=e[c];if(r(l)){var u=l.label;if(0!==u.length){var p=l.mnemonic;p>=0&&p<u.length?u[p].toUpperCase()===a&&(-1===n?n=c:s=!0):-1===o&&u[0].toUpperCase()===a&&(o=c)}}}return{index:n,multiple:s,auto:o}};var s=function(){function e(e,t){this._commands=e,this.type=t.type||"command",this.command=t.command||"",this.args=t.args||a.JSONExt.emptyObject,this.submenu=t.submenu||null}return Object.defineProperty(e.prototype,"label",{get:function(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mnemonic",{get:function(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return"command"===this.type?this._commands.icon(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconLabel",{get:function(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keyBinding",{get:function(){if("command"===this.type){var e=this.command,i=this.args;return t.ArrayExt.findLastValue(this._commands.keyBindings,(function(t){return t.command===e&&a.JSONExt.deepEqual(t.args,i)}))||null}return null},enumerable:!0,configurable:!0}),e}()}(N||(N={}));var j,q,F=function(){function i(t){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var i=t.groupByTarget,n=t.sortBySelector,o=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i}(t,["groupByTarget","sortBySelector"]);this.menu=new e.Menu(o),this._groupByTarget=!1!==i,this._sortBySelector=!1!==n}return i.prototype.addItem=function(e){var i=this,n=j.createItem(e,this._idTick++);return this._items.push(n),new c.DisposableDelegate((function(){t.ArrayExt.removeFirstOf(i._items,n)}))},i.prototype.open=function(e){var i=this;if(this.menu.clearItems(),0===this._items.length)return!1;var n=j.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);return!(!n||0===n.length)&&(t.each(n,(function(e){i.menu.addItem(e)})),this.menu.open(e.clientX,e.clientY),!0)},i}();!function(e){function t(e,t){var i=e.rank,n=t.rank;return i!==n?i<n?-1:1:e.id-t.id}function n(e,n){var o=i.Selector.calculateSpecificity(e.selector),r=i.Selector.calculateSpecificity(n.selector);return o!==r?r-o:t(e,n)}e.createItem=function(e,t){var n=function(e){if(-1!==e.indexOf(","))throw new Error("Selector cannot contain commas: "+e);if(!i.Selector.isValid(e))throw new Error("Invalid selector: "+e);return e}(e.selector),o=void 0!==e.rank?e.rank:1/0;return m(m({},e),{selector:n,rank:o,id:t})},e.matchItems=function(e,o,r,s){var a=o.target;if(!a)return null;var d=o.currentTarget;if(!d)return null;if(!(d.contains(a)||(a=document.elementFromPoint(o.clientX,o.clientY))&&d.contains(a)))return null;for(var h=[],c=e.slice();null!==a;){for(var l=[],u=0,p=c.length;u<p;++u){var m=c[u];m&&(i.Selector.matches(a,m.selector)&&(l.push(m),c[u]=null))}if(0!==l.length&&(r&&l.sort(s?n:t),h.push.apply(h,l)),a===d)break;a=a.parentElement}return r||h.sort(s?n:t),h}}(j||(j={})),e.TabBar=function(o){function a(t){void 0===t&&(t={});var i=o.call(this,{node:q.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._titlesEditable=!1,i._previousTitle=null,i._dragData=null,i._addButtonEnabled=!1,i._tabMoved=new r.Signal(i),i._currentChanged=new r.Signal(i),i._addRequested=new r.Signal(i),i._tabCloseRequested=new r.Signal(i),i._tabDetachRequested=new r.Signal(i),i._tabActivateRequested=new r.Signal(i),i.addClass("lm-TabBar"),i.addClass("p-TabBar"),i.contentNode.setAttribute("role","tablist"),i.setFlag(e.Widget.Flag.DisallowLayout),i._document=t.document||document,i.tabsMovable=t.tabsMovable||!1,i.titlesEditable=t.titlesEditable||!1,i.allowDeselect=t.allowDeselect||!1,i.addButtonEnabled=t.addButtonEnabled||!1,i.insertBehavior=t.insertBehavior||"select-tab-if-needed",i.name=t.name||"",i.orientation=t.orientation||"horizontal",i.removeBehavior=t.removeBehavior||"select-tab-after",i.renderer=t.renderer||a.defaultRenderer,i}return p(a,o),a.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,o.prototype.dispose.call(this)},Object.defineProperty(a.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(e){this._titlesEditable=e},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(e){this.currentIndex=e?this._titles.indexOf(e):-1},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex!==e){var t=this._currentIndex,i=this._titles[t]||null,n=e,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,currentTitle:o})}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"orientation",{get:function(){return this._orientation},set:function(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),a.prototype.addTab=function(e){return this.insertTab(this._titles.length,e)},a.prototype.insertTab=function(e,i){this._releaseMouse();var n=q.asTitle(i),o=this._titles.indexOf(n),r=Math.max(0,Math.min(e,this._titles.length));return-1===o?(t.ArrayExt.insert(this._titles,r,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(r,n),n):(r===this._titles.length&&r--,o===r||(t.ArrayExt.move(this._titles,o,r),this.update(),this._adjustCurrentForMove(o,r)),n)},a.prototype.removeTab=function(e){this.removeTabAt(this._titles.indexOf(e))},a.prototype.removeTabAt=function(e){this._releaseMouse();var i=t.ArrayExt.removeAt(this._titles,e);i&&(i.changed.disconnect(this._onTitleChanged,this),i===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,i))},a.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var e=0,t=this._titles;e<t.length;e++){t[e].changed.disconnect(this._onTitleChanged,this)}var i=this.currentIndex,n=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==i&&this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:-1,currentTitle:null})}},a.prototype.releaseMouse=function(){this._releaseMouse()},a.prototype.handleEvent=function(e){switch(e.type){case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointerdown":this._evtMouseDown(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},a.prototype.onBeforeAttach=function(e){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},a.prototype.onAfterDetach=function(e){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},a.prototype.onUpdateRequest=function(e){for(var t=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(t.length),r=0,s=t.length;r<s;++r){var a=t[r],d=a===n,c=d?s:s-r-1;o[r]=i.renderTab({title:a,current:d,zIndex:c})}h.VirtualDOM.render(o,this.contentNode)},a.prototype._evtDblClick=function(e){if(this.titlesEditable){var n=this.contentNode.children,o=t.ArrayExt.findFirstIndex(n,(function(t){return i.ElementExt.hitTest(t,e.clientX,e.clientY)}));if(-1!==o){var r=this.titles[o],s=n[o].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){var a=r.label||"",d=s.innerHTML;s.innerHTML="";var h=document.createElement("input");h.classList.add("lm-TabBar-tabInput"),h.value=a,s.appendChild(h);var c=function(){h.removeEventListener("blur",c),s.innerHTML=d};h.addEventListener("dblclick",(function(e){return e.stopPropagation()})),h.addEventListener("blur",c),h.addEventListener("keydown",(function(e){"Enter"===e.key?(""!==h.value&&(r.label=r.caption=h.value),c()):"Escape"===e.key&&c()})),h.select(),h.focus(),s.children.length>0&&s.children[0].focus()}}}},a.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this._releaseMouse()},a.prototype._evtMouseDown=function(e){if((0===e.button||1===e.button)&&!this._dragData){var n=this.addButtonEnabled&&this.addButtonNode.contains(e.target),o=this.contentNode.children,r=t.ArrayExt.findFirstIndex(o,(function(t){return i.ElementExt.hitTest(t,e.clientX,e.clientY)}));if((-1!==r||n)&&(e.preventDefault(),e.stopPropagation(),this._dragData={tab:o[r],index:r,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),1!==e.button&&!n)){var s=o[r].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===r?this.currentIndex=-1:this.currentIndex=r,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},a.prototype._evtMouseMove=function(e){var t=this._dragData;if(t){e.preventDefault(),e.stopPropagation();var i=this.contentNode.children;if(t.dragActive||q.dragExceeded(t,e)){if(!t.dragActive){var n=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=n.width,t.tabPressPos=t.pressX-n.left):(t.tabPos=t.tab.offsetTop,t.tabSize=n.height,t.tabPressPos=t.pressY-n.top),t.tabLayout=q.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=s.Drag.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&q.detachExceeded(t,e)){t.detachRequested=!0;var o=t.index,r=e.clientX,a=e.clientY,d=i[o],h=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:h,tab:d,clientX:r,clientY:a}),t.dragAborted)return}q.layoutTabs(i,t,e,this._orientation)}}},a.prototype._evtMouseUp=function(o){var r=this;if(0===o.button||1===o.button){var s=this._dragData;if(s){if(o.preventDefault(),o.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!s.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(o.target))return void this._addRequested.emit(void 0);var a=this.contentNode.children,d=t.ArrayExt.findFirstIndex(a,(function(e){return i.ElementExt.hitTest(e,o.clientX,o.clientY)}));if(d!==s.index)return;var h=this._titles[d];if(!h.closable)return;if(1===o.button)return void this._tabCloseRequested.emit({index:d,title:h});var c=a[d].querySelector(this.renderer.closeIconSelector);return c&&c.contains(o.target)?void this._tabCloseRequested.emit({index:d,title:h}):void 0}if(0===o.button){q.finalizeTabPosition(s,this._orientation),s.tab.classList.remove("lm-mod-dragging"),s.tab.classList.remove("p-mod-dragging");var l=q.parseTransitionDuration(s.tab);setTimeout((function(){if(!s.dragAborted){r._dragData=null,q.resetTabPositions(r.contentNode.children,r._orientation),s.override.dispose(),r.removeClass("lm-mod-dragging"),r.removeClass("p-mod-dragging");var i=s.index,o=s.targetIndex;-1!==o&&i!==o&&(t.ArrayExt.move(r._titles,i,o),r._adjustCurrentForMove(i,o),r._tabMoved.emit({fromIndex:i,toIndex:o,title:r._titles[o]}),n.MessageLoop.sendMessage(r,e.Widget.Msg.UpdateRequest))}}),l)}}}},a.prototype._releaseMouse=function(){var e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(q.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),e.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},a.prototype._adjustCurrentForInsert=function(e,t){var i=this.currentTitle,n=this._currentIndex,o=this.insertBehavior;if("select-tab"===o||"select-tab-if-needed"===o&&-1===n)return this._currentIndex=e,this._previousTitle=i,void this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:e,currentTitle:t});n>=e&&this._currentIndex++},a.prototype._adjustCurrentForMove=function(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex<e&&this._currentIndex>=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--},a.prototype._adjustCurrentForRemove=function(e,t){var i=this._currentIndex,n=this.removeBehavior;if(i===e){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});if("select-tab-after"===n)return this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===n)return this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===n)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}else i>e&&this._currentIndex--},a.prototype._onTitleChanged=function(e){this.update()},a}(e.Widget),function(e){var t=function(){function e(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return e.prototype.renderTab=function(e){var t=e.title.caption,i=this.createTabKey(e),n=i,o=this.createTabStyle(e),r=this.createTabClass(e),s=this.createTabDataset(e),a=this.createTabARIA(e);return e.title.closable?h.h.li(m({id:n,key:i,className:r,title:t,style:o,dataset:s},a),this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):h.h.li(m({id:n,key:i,className:r,title:t,style:o,dataset:s},a),this.renderIcon(e),this.renderLabel(e))},e.prototype.renderIcon=function(e){var t=e.title,i=this.createIconClass(e);return"string"==typeof t.icon?h.h.div({className:i},t.iconLabel):h.h.div({className:i},t.icon,t.iconLabel)},e.prototype.renderLabel=function(e){return h.h.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},e.title.label)},e.prototype.renderCloseIcon=function(e){return h.h.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},e.prototype.createTabKey=function(e){var t=this._tabKeys.get(e.title);return void 0===t&&(t="tab-key-"+this._tabID++,this._tabKeys.set(e.title,t)),t},e.prototype.createTabStyle=function(e){return{zIndex:""+e.zIndex}},e.prototype.createTabClass=function(e){var t="lm-TabBar-tab";return t+=" p-TabBar-tab",e.title.className&&(t+=" "+e.title.className),e.title.closable&&(t+=" lm-mod-closable",t+=" p-mod-closable"),e.current&&(t+=" lm-mod-current",t+=" p-mod-current"),t},e.prototype.createTabDataset=function(e){return e.title.dataset},e.prototype.createTabARIA=function(e){return{role:"tab","aria-selected":e.current.toString()}},e.prototype.createIconClass=function(e){var t="lm-TabBar-tabIcon";t+=" p-TabBar-tabIcon";var i=e.title.iconClass;return i?t+" "+i:t},e}();e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(e.TabBar||(e.TabBar={})),function(e){e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,e.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",t.classList.add("p-TabBar-content"),e.appendChild(t);var i=document.createElement("div");return i.className="lm-TabBar-addButton lm-mod-hidden",e.appendChild(i),e},e.asTitle=function(e){return e instanceof b?e:new b(e)},e.parseTransitionDuration=function(e){var t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)},e.snapTabLayout=function(e,t){for(var i=new Array(e.length),n=0,o=e.length;n<o;++n){var r=e[n],s=window.getComputedStyle(r);i[n]="horizontal"===t?{pos:r.offsetLeft,size:r.offsetWidth,margin:parseFloat(s.marginLeft)||0}:{pos:r.offsetTop,size:r.offsetHeight,margin:parseFloat(s.marginTop)||0}}return i},e.dragExceeded=function(t,i){var n=Math.abs(i.clientX-t.pressX),o=Math.abs(i.clientY-t.pressY);return n>=e.DRAG_THRESHOLD||o>=e.DRAG_THRESHOLD},e.detachExceeded=function(t,i){var n=t.contentRect;return i.clientX<n.left-e.DETACH_THRESHOLD||i.clientX>=n.right+e.DETACH_THRESHOLD||i.clientY<n.top-e.DETACH_THRESHOLD||i.clientY>=n.bottom+e.DETACH_THRESHOLD},e.layoutTabs=function(e,t,i,n){var o,r,s,a;"horizontal"===n?(o=t.pressX,r=i.clientX-t.contentRect.left,s=i.clientX,a=t.contentRect.width):(o=t.pressY,r=i.clientY-t.contentRect.top,s=i.clientY,a=t.contentRect.height);for(var d=t.index,h=r-t.tabPressPos,c=h+t.tabSize,l=0,u=e.length;l<u;++l){var p=void 0,m=t.tabLayout[l],f=m.pos+(m.size>>1);if(l<t.index&&h<f)p=t.tabSize+t.tabLayout[l+1].margin+"px",d=Math.min(d,l);else if(l>t.index&&c>f)p=-t.tabSize-m.margin+"px",d=Math.max(d,l);else if(l===t.index){var g=s-o,v=a-(t.tabPos+t.tabSize);p=Math.max(-t.tabPos,Math.min(g,v))+"px"}else p="";"horizontal"===n?e[l].style.left=p:e[l].style.top=p}t.targetIndex=d},e.finalizeTabPosition=function(e,t){var i,n;if(i="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)n=0;else if(e.targetIndex>e.index){n=(o=e.tabLayout[e.targetIndex]).pos+o.size-e.tabSize-e.tabPos}else{var o;n=(o=e.tabLayout[e.targetIndex]).pos-e.tabPos}var r=i-(e.tabPos+e.tabSize),s=Math.max(-e.tabPos,Math.min(n,r));"horizontal"===t?e.tab.style.left=s+"px":e.tab.style.top=s+"px"},e.resetTabPositions=function(e,i){t.each(e,(function(e){"horizontal"===i?e.style.left="":e.style.top=""}))}}(q||(q={}));var U,V,Y=function(o){function r(t){var i=o.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=t.renderer,void 0!==t.spacing&&(i._spacing=E.clampDimension(t.spacing)),i._document=t.document||document,i._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:e.Widget.HiddenMode.Display,i}return p(r,o),r.prototype.dispose=function(){var e=this.iter();this._items.forEach((function(e){e.dispose()})),this._box=null,this._root=null,this._items.clear(),t.each(e,(function(e){e.dispose()})),o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){var i=this;this._hiddenMode!==e&&(this._hiddenMode=e,t.each(this.tabBars(),(function(e){e.titles.length>1&&e.titles.forEach((function(e){e.owner.hiddenMode=i._hiddenMode}))})))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spacing",{get:function(){return this._spacing},set:function(e){e=E.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),r.prototype.iter=function(){return this._root?this._root.iterAllWidgets():t.empty()},r.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():t.empty()},r.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():t.empty()},r.prototype.tabBars=function(){return this._root?this._root.iterTabBars():t.empty()},r.prototype.handles=function(){return this._root?this._root.iterHandles():t.empty()},r.prototype.moveHandle=function(t,i,n){var o=t.classList.contains("lm-mod-hidden");if(o=o||t.classList.contains("p-mod-hidden"),this._root&&!o){var r,s=this._root.findSplitNode(t);if(s)0!==(r="horizontal"===s.node.orientation?i-t.offsetLeft:n-t.offsetTop)&&(s.node.holdSizes(),e.BoxEngine.adjust(s.node.sizers,s.index,r),this.parent&&this.parent.update())}},r.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},r.prototype.restoreLayout=function(e){var i,n=this,o=new Set;i=e.main?U.normalizeAreaConfig(e.main,o):null;var r=this.widgets(),s=this.tabBars(),a=this.handles();this._root=null,t.each(r,(function(e){o.has(e)||(e.parent=null)})),t.each(s,(function(e){e.dispose()})),t.each(a,(function(e){e.parentNode&&e.parentNode.removeChild(e)})),o.forEach((function(e){e.parent=n.parent})),this._root=i?U.realizeAreaConfig(i,{createTabBar:function(e){return n._createTabBar()},createHandle:function(){return n._createHandle()}},this._document):null,this.parent&&(o.forEach((function(e){n.attachWidget(e)})),this.parent.fit())},r.prototype.addWidget=function(e,t){void 0===t&&(t={});var i=t.ref||null,n=t.mode||"tab-after",o=null;if(this._root&&i&&(o=this._root.findTabNode(i)),i&&!o)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,i,o,!0);break;case"tab-before":this._insertTab(e,i,o,!1);break;case"split-top":this._insertSplit(e,i,o,"vertical",!1);break;case"split-left":this._insertSplit(e,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,o,"vertical",!0)}this.parent&&(this.attachWidget(e),this.parent.fit())},r.prototype.removeWidget=function(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())},r.prototype.hitTestTabAreas=function(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),o=e-n.left-this._box.borderLeft,r=t-n.top-this._box.borderTop,s=this._root.hitTestTabNodes(o,r);if(!s)return null;var a=s.tabBar,d=s.top,h=s.left,c=s.width,l=s.height,u=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom;return{tabBar:a,x:o,y:r,top:d,left:h,right:n.width-u-(h+c),bottom:n.height-p-(d+l),width:c,height:l}},r.prototype.init=function(){var e=this;o.prototype.init.call(this),t.each(this,(function(t){e.attachWidget(t)})),t.each(this.handles(),(function(t){e.parent.node.appendChild(t)})),this.parent.fit()},r.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new M(t)),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterAttach))},r.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterDetach);var i=this._items.get(t);i&&(this._items.delete(t),i.dispose())}},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype._removeWidget=function(i){if(this._root){var n=this._root.findTabNode(i);if(n)if(U.removeAria(i),n.tabBar.titles.length>1)n.tabBar.removeTab(i.title),this._hiddenMode===e.Widget.HiddenMode.Scale&&1==n.tabBar.titles.length&&(n.tabBar.titles[0].owner.hiddenMode=e.Widget.HiddenMode.Display);else if(n.tabBar.dispose(),this._root!==n){this._root.holdAllSizes();var o=n.parent;n.parent=null;var r=t.ArrayExt.removeFirstOf(o.children,n),s=t.ArrayExt.removeAt(o.handles,r);if(t.ArrayExt.removeAt(o.sizers,r),s.parentNode&&s.parentNode.removeChild(s),o.children.length>1)o.syncHandles();else{var a=o.parent;o.parent=null;var d=o.children[0],h=o.handles[0];if(o.children.length=0,o.handles.length=0,o.sizers.length=0,h.parentNode&&h.parentNode.removeChild(h),this._root===o)return d.parent=null,void(this._root=d);var c=a,l=c.children.indexOf(o);if(d instanceof U.TabLayoutNode)return d.parent=c,void(c.children[l]=d);var u=t.ArrayExt.removeAt(c.handles,l);t.ArrayExt.removeAt(c.children,l),t.ArrayExt.removeAt(c.sizers,l),u.parentNode&&u.parentNode.removeChild(u);for(var p=0,m=d.children.length;p<m;++p){var f=d.children[p],g=d.handles[p],v=d.sizers[p];t.ArrayExt.insert(c.children,l+p,f),t.ArrayExt.insert(c.handles,l+p,g),t.ArrayExt.insert(c.sizers,l+p,v),f.parent=c}d.children.length=0,d.handles.length=0,d.sizers.length=0,d.parent=null,c.syncHandles()}}else this._root=null}},r.prototype._insertTab=function(t,i,n,o){if(t!==i){if(!this._root){var r=new U.TabLayoutNode(this._createTabBar());return r.tabBar.addTab(t.title),this._root=r,void U.addAria(t,r.tabBar)}var s;if(n||(n=this._root.findFirstTabNode()),-1===n.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),s=i?n.tabBar.titles.indexOf(i.title):n.tabBar.currentIndex,this._hiddenMode===e.Widget.HiddenMode.Scale&&n.tabBar.titles.length>0){if(1==n.tabBar.titles.length)n.tabBar.titles[0].owner.hiddenMode=e.Widget.HiddenMode.Scale;t.hiddenMode=e.Widget.HiddenMode.Scale}else t.hiddenMode=e.Widget.HiddenMode.Display;n.tabBar.insertTab(s+(o?1:0),t.title),U.addAria(t,n.tabBar)}},r.prototype._insertSplit=function(e,i,n,o,r){if(e!==i||!n||1!==n.tabBar.titles.length){this._removeWidget(e);var s=new U.TabLayoutNode(this._createTabBar());if(s.tabBar.addTab(e.title),U.addAria(e,s.tabBar),this._root){if(!n||!n.parent){var a=this._splitRoot(o),d=r?a.children.length:0;a.normalizeSizes();var h=U.createSizer(n?1:U.GOLDEN_RATIO);return t.ArrayExt.insert(a.children,d,s),t.ArrayExt.insert(a.sizers,d,h),t.ArrayExt.insert(a.handles,d,this._createHandle()),s.parent=a,a.normalizeSizes(),void a.syncHandles()}var c=n.parent;if(c.orientation===o){var l=c.children.indexOf(n);c.normalizeSizes();var u=c.sizers[l].sizeHint/=2,p=l+(r?1:0);return t.ArrayExt.insert(c.children,p,s),t.ArrayExt.insert(c.sizers,p,U.createSizer(u)),t.ArrayExt.insert(c.handles,p,this._createHandle()),s.parent=c,void c.syncHandles()}var m=t.ArrayExt.removeFirstOf(c.children,n),f=new U.SplitLayoutNode(o);f.normalized=!0,f.children.push(n),f.sizers.push(U.createSizer(.5)),f.handles.push(this._createHandle()),n.parent=f;var g=r?1:0;t.ArrayExt.insert(f.children,g,s),t.ArrayExt.insert(f.sizers,g,U.createSizer(.5)),t.ArrayExt.insert(f.handles,g,this._createHandle()),s.parent=f,f.syncHandles(),t.ArrayExt.insert(c.children,m,f),f.parent=c}else this._root=s}},r.prototype._splitRoot=function(e){var t=this._root;if(t instanceof U.SplitLayoutNode&&t.orientation===e)return t;var i=this._root=new U.SplitLayoutNode(e);return t&&(i.children.push(t),i.sizers.push(U.createSizer(0)),i.handles.push(this._createHandle()),t.parent=i),i},r.prototype._fit=function(){var t=0,o=0;if(this._root){var r=this._root.fit(this._spacing,this._items);t=r.minWidth,o=r.minHeight}var s=this._box=i.ElementExt.boxSizing(this.parent.node);t+=s.horizontalSum,o+=s.verticalSum;var a=this.parent.node.style;a.minWidth=t+"px",a.minHeight=o+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(e,t){if(this._dirty=!1,this._root){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,r=e-this._box.horizontalSum,s=t-this._box.verticalSum;this._root.update(n,o,r,s,this._spacing,this._items)}},r.prototype._createTabBar=function(){var e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&(e.parent=this.parent,this.attachWidget(e)),e},r.prototype._createHandle=function(){var e=this.renderer.createHandle(),t=e.style;return t.position="absolute",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e},r}(e.Layout);!function(i){function n(e){var t=new g;return t.sizeHint=e,t.size=e,t}function o(e,i){return"tab-area"===e.type?function(e,i){if(0===e.widgets.length)return null;var n=[];if(t.each(e.widgets,(function(e){i.has(e)||(i.add(e),n.push(e))})),0===n.length)return null;var o=e.currentIndex;-1!==o&&(o<0||o>=n.length)&&(o=0);return{type:"tab-area",widgets:n,currentIndex:o}}(e,i):function(e,t){for(var i=e.orientation,n=[],r=[],s=0,a=e.children.length;s<a;++s){var d=o(e.children[s],t);d&&("tab-area"===d.type||d.orientation!==i?(n.push(d),r.push(Math.abs(e.sizes[s]||0))):(n.push.apply(n,d.children),r.push.apply(r,d.sizes)))}if(0===n.length)return null;if(1===n.length)return n[0];return{type:"split-area",orientation:i,children:n,sizes:r}}(e,i)}function r(e,o,d){return"tab-area"===e.type?function(e,n,o){var r=n.createTabBar(o);return t.each(e.widgets,(function(e){e.hide(),r.addTab(e.title),i.addAria(e,r)})),r.currentIndex=e.currentIndex,new s(r)}(e,o,d):function(e,i,o){var s=new a(e.orientation);return t.each(e.children,(function(t,a){var d=r(t,i,o),h=n(e.sizes[a]),c=i.createHandle();s.children.push(d),s.handles.push(c),s.sizers.push(h),d.parent=s})),s.syncHandles(),s.normalizeSizes(),s}(e,o,d)}i.GOLDEN_RATIO=.618,i.createSizer=n,i.normalizeAreaConfig=o,i.realizeAreaConfig=r;var s=function(){function i(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var t=new g,i=new g;t.stretch=0,i.stretch=1,this.tabBar=e,this.sizers=[t,i]}return Object.defineProperty(i.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),i.prototype.iterAllWidgets=function(){return t.chain(t.once(this.tabBar),this.iterUserWidgets())},i.prototype.iterUserWidgets=function(){return t.map(this.tabBar.titles,(function(e){return e.owner}))},i.prototype.iterSelectedWidgets=function(){var e=this.tabBar.currentTitle;return e?t.once(e.owner):t.empty()},i.prototype.iterTabBars=function(){return t.once(this.tabBar)},i.prototype.iterHandles=function(){return t.empty()},i.prototype.findTabNode=function(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null},i.prototype.findSplitNode=function(e){return null},i.prototype.findFirstTabNode=function(){return this},i.prototype.hitTestTabNodes=function(e,t){return e<this._left||e>=this._left+this._width||t<this._top||t>=this._top+this._height?null:this},i.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map((function(e){return e.owner})),currentIndex:this.tabBar.currentIndex}},i.prototype.holdAllSizes=function(){},i.prototype.fit=function(e,t){var i=0,n=0,o=t.get(this.tabBar),r=this.tabBar.currentTitle,s=r?t.get(r.owner):void 0,a=this.sizers,d=a[0],h=a[1];return o&&o.fit(),s&&s.fit(),o&&!o.isHidden?(i=Math.max(i,o.minWidth),n+=o.minHeight,d.minSize=o.minHeight,d.maxSize=o.maxHeight):(d.minSize=0,d.maxSize=0),s&&!s.isHidden?(i=Math.max(i,s.minWidth),n+=s.minHeight,h.minSize=s.minHeight,h.maxSize=1/0):(h.minSize=0,h.maxSize=1/0),{minWidth:i,minHeight:n,maxWidth:Infinity,maxHeight:Infinity}},i.prototype.update=function(t,i,n,o,r,s){this._top=i,this._left=t,this._width=n,this._height=o;var a=s.get(this.tabBar),d=this.tabBar.currentTitle,h=d?s.get(d.owner):void 0;if(e.BoxEngine.calc(this.sizers,o),a&&!a.isHidden){var c=this.sizers[0].size;a.update(t,i,n,c),i+=c}if(h&&!h.isHidden){c=this.sizers[1].size;h.update(t,i,n,c)}},i}();i.TabLayoutNode=s;var a=function(){function i(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}return i.prototype.iterAllWidgets=function(){var e=t.map(this.children,(function(e){return e.iterAllWidgets()}));return new t.ChainIterator(e)},i.prototype.iterUserWidgets=function(){var e=t.map(this.children,(function(e){return e.iterUserWidgets()}));return new t.ChainIterator(e)},i.prototype.iterSelectedWidgets=function(){var e=t.map(this.children,(function(e){return e.iterSelectedWidgets()}));return new t.ChainIterator(e)},i.prototype.iterTabBars=function(){var e=t.map(this.children,(function(e){return e.iterTabBars()}));return new t.ChainIterator(e)},i.prototype.iterHandles=function(){var e=t.map(this.children,(function(e){return e.iterHandles()}));return t.chain(this.handles,new t.ChainIterator(e))},i.prototype.findTabNode=function(e){for(var t=0,i=this.children.length;t<i;++t){var n=this.children[t].findTabNode(e);if(n)return n}return null},i.prototype.findSplitNode=function(e){var t=this.handles.indexOf(e);if(-1!==t)return{index:t,node:this};for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].findSplitNode(e);if(o)return o}return null},i.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},i.prototype.hitTestTabNodes=function(e,t){for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].hitTestTabNodes(e,t);if(o)return o}return null},i.prototype.createConfig=function(){var e=this.orientation,t=this.createNormalizedSizes();return{type:"split-area",orientation:e,children:this.children.map((function(e){return e.createConfig()})),sizes:t}},i.prototype.syncHandles=function(){var e=this;t.each(this.handles,(function(t,i){t.setAttribute("data-orientation",e.orientation),i===e.handles.length-1?(t.classList.add("lm-mod-hidden"),t.classList.add("p-mod-hidden")):(t.classList.remove("lm-mod-hidden"),t.classList.remove("p-mod-hidden"))}))},i.prototype.holdSizes=function(){t.each(this.sizers,(function(e){e.sizeHint=e.size}))},i.prototype.holdAllSizes=function(){t.each(this.children,(function(e){return e.holdAllSizes()})),this.holdSizes()},i.prototype.normalizeSizes=function(){var e=this.sizers.length;if(0!==e){this.holdSizes();var i=t.reduce(this.sizers,(function(e,t){return e+t.sizeHint}),0);0===i?t.each(this.sizers,(function(t){t.size=t.sizeHint=1/e})):t.each(this.sizers,(function(e){e.size=e.sizeHint/=i})),this.normalized=!0}},i.prototype.createNormalizedSizes=function(){var e=this.sizers.length;if(0===e)return[];var i=this.sizers.map((function(e){return e.size})),n=t.reduce(i,(function(e,t){return e+t}),0);return 0===n?t.each(i,(function(t,n){i[n]=1/e})):t.each(i,(function(e,t){i[t]=e/n})),i},i.prototype.fit=function(e,t){for(var i="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*e,o=i?n:0,r=i?0:n,s=0,a=this.children.length;s<a;++s){var d=this.children[s].fit(e,t);i?(r=Math.max(r,d.minHeight),o+=d.minWidth,this.sizers[s].minSize=d.minWidth):(o=Math.max(o,d.minWidth),r+=d.minHeight,this.sizers[s].minSize=d.minHeight)}return{minWidth:o,minHeight:r,maxWidth:Infinity,maxHeight:Infinity}},i.prototype.update=function(i,n,o,r,s,a){var d="horizontal"===this.orientation,h=Math.max(0,this.children.length-1)*s,c=Math.max(0,(d?o:r)-h);this.normalized&&(t.each(this.sizers,(function(e){e.sizeHint*=c})),this.normalized=!1),e.BoxEngine.calc(this.sizers,c);for(var l=0,u=this.children.length;l<u;++l){var p=this.children[l],m=this.sizers[l].size,f=this.handles[l].style;d?(p.update(i,n,m,r,s,a),i+=m,f.top=n+"px",f.left=i+"px",f.width=s+"px",f.height=r+"px",i+=s):(p.update(i,n,o,m,s,a),n+=m,f.top=n+"px",f.left=i+"px",f.width=o+"px",f.height=s+"px",n+=s)}},i}();i.SplitLayoutNode=a,i.addAria=function(t,i){t.node.setAttribute("role","tabpanel");var n=i.renderer;if(n instanceof e.TabBar.Renderer){var o=n.createTabKey({title:t.title,current:!1,zIndex:0});t.node.setAttribute("aria-labelledby",o)}},i.removeAria=function(e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby")}}(U||(U={})),e.DockPanel=function(o){function d(e){void 0===e&&(e={});var t=o.call(this)||this;t._drag=null,t._tabsMovable=!0,t._tabsConstrained=!1,t._addButtonEnabled=!1,t._pressData=null,t._layoutModified=new r.Signal(t),t._addRequested=new r.Signal(t),t.addClass("lm-DockPanel"),t.addClass("p-DockPanel"),t._document=e.document||document,t._mode=e.mode||"multiple-document",t._renderer=e.renderer||d.defaultRenderer,t._edges=e.edges||V.DEFAULT_EDGES,void 0!==e.tabsMovable&&(t._tabsMovable=e.tabsMovable),void 0!==e.tabsConstrained&&(t._tabsConstrained=e.tabsConstrained),void 0!==e.addButtonEnabled&&(t._addButtonEnabled=e.addButtonEnabled),t.dataset.mode=t._mode;var i={createTabBar:function(){return t._createTabBar()},createHandle:function(){return t._createHandle()}};return t.layout=new Y({document:t._document,renderer:i,spacing:e.spacing,hiddenMode:e.hiddenMode}),t.overlay=e.overlay||new d.Overlay,t.node.appendChild(t.overlay.node),t}return p(d,o),d.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),o.prototype.dispose.call(this)},Object.defineProperty(d.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(e){this.layout.hiddenMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(e){this.layout.spacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"mode",{get:function(){return this._mode},set:function(e){if(this._mode!==e){this._mode=e,this.dataset.mode=e;var i=this.layout;switch(e){case"multiple-document":t.each(i.tabBars(),(function(e){e.show()}));break;case"single-document":i.restoreLayout(V.createSingleDocumentConfig(this));break;default:throw"unreachable"}n.MessageLoop.postMessage(this,V.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(e){this._tabsMovable=e,t.each(this.tabBars(),(function(t){t.tabsMovable=e}))},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(e){this._tabsConstrained=e},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(e){this._addButtonEnabled=e,t.each(this.tabBars(),(function(t){t.addButtonEnabled=e}))},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),d.prototype.widgets=function(){return this.layout.widgets()},d.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},d.prototype.tabBars=function(){return this.layout.tabBars()},d.prototype.handles=function(){return this.layout.handles()},d.prototype.selectWidget=function(e){var i=t.find(this.tabBars(),(function(t){return-1!==t.titles.indexOf(e.title)}));if(!i)throw new Error("Widget is not contained in the dock panel.");i.currentTitle=e.title},d.prototype.activateWidget=function(e){this.selectWidget(e),e.activate()},d.prototype.saveLayout=function(){return this.layout.saveLayout()},d.prototype.restoreLayout=function(e){this._mode="multiple-document",this.layout.restoreLayout(e),(i.Platform.IS_EDGE||i.Platform.IS_IE)&&n.MessageLoop.flush(),n.MessageLoop.postMessage(this,V.LayoutModified)},d.prototype.addWidget=function(e,t){void 0===t&&(t={}),"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),n.MessageLoop.postMessage(this,V.LayoutModified)},d.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):o.prototype.processMessage.call(this,e)},d.prototype.handleEvent=function(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointerdown":this._evtMouseDown(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},d.prototype.onBeforeAttach=function(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},d.prototype.onAfterDetach=function(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},d.prototype.onChildAdded=function(e){V.isGeneratedTabBarProperty.get(e.child)||(e.child.addClass("lm-DockPanel-widget"),e.child.addClass("p-DockPanel-widget"))},d.prototype.onChildRemoved=function(e){V.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),e.child.removeClass("p-DockPanel-widget"),n.MessageLoop.postMessage(this,V.LayoutModified))},d.prototype._evtDragEnter=function(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())},d.prototype._evtDragLeave=function(e){e.preventDefault(),e.stopPropagation(),this.overlay.hide(1)},d.prototype._evtDragOver=function(e){e.preventDefault(),e.stopPropagation(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":e.dropAction=e.proposedAction},d.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var i=t.clientX,n=t.clientY,o=V.findDropTarget(this,i,n,this._edges),r=o.zone,s=o.target;if("invalid"!==r){var a=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"==typeof a){var d=a();if(d instanceof e.Widget)if(d.contains(this))t.dropAction="none";else{var h=s?V.getDropRef(s.tabBar):null;switch(r){case"root-all":this.addWidget(d);break;case"root-top":this.addWidget(d,{mode:"split-top"});break;case"root-left":this.addWidget(d,{mode:"split-left"});break;case"root-right":this.addWidget(d,{mode:"split-right"});break;case"root-bottom":this.addWidget(d,{mode:"split-bottom"});break;case"widget-all":this.addWidget(d,{mode:"tab-after",ref:h});break;case"widget-top":this.addWidget(d,{mode:"split-top",ref:h});break;case"widget-left":this.addWidget(d,{mode:"split-left",ref:h});break;case"widget-right":this.addWidget(d,{mode:"split-right",ref:h});break;case"widget-bottom":this.addWidget(d,{mode:"split-bottom",ref:h});break;case"widget-tab":this.addWidget(d,{mode:"tab-after",ref:h});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(d)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},d.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),n.MessageLoop.postMessage(this,V.LayoutModified))},d.prototype._evtMouseDown=function(e){if(0===e.button){var i=this.layout,n=e.target,o=t.find(i.handles(),(function(e){return e.contains(n)}));if(o){e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var r=o.getBoundingClientRect(),a=e.clientX-r.left,d=e.clientY-r.top,h=window.getComputedStyle(o),c=s.Drag.overrideCursor(h.cursor,this._document);this._pressData={handle:o,deltaX:a,deltaY:d,override:c}}}},d.prototype._evtMouseMove=function(e){if(this._pressData){e.preventDefault(),e.stopPropagation();var t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}},d.prototype._evtMouseUp=function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),n.MessageLoop.postMessage(this,V.LayoutModified))},d.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},d.prototype._showOverlay=function(e,t){var n,o,r,s,a=V.findDropTarget(this,e,t,this._edges),d=a.zone,h=a.target;if("invalid"===d)return this.overlay.hide(100),d;var c=i.ElementExt.boxSizing(this.node),l=this.node.getBoundingClientRect();switch(d){case"root-all":n=c.paddingTop,o=c.paddingLeft,r=c.paddingRight,s=c.paddingBottom;break;case"root-top":n=c.paddingTop,o=c.paddingLeft,r=c.paddingRight,s=l.height*V.GOLDEN_RATIO;break;case"root-left":n=c.paddingTop,o=c.paddingLeft,r=l.width*V.GOLDEN_RATIO,s=c.paddingBottom;break;case"root-right":n=c.paddingTop,o=l.width*V.GOLDEN_RATIO,r=c.paddingRight,s=c.paddingBottom;break;case"root-bottom":n=l.height*V.GOLDEN_RATIO,o=c.paddingLeft,r=c.paddingRight,s=c.paddingBottom;break;case"widget-all":n=h.top,o=h.left,r=h.right,s=h.bottom;break;case"widget-top":n=h.top,o=h.left,r=h.right,s=h.bottom+h.height/2;break;case"widget-left":n=h.top,o=h.left,r=h.right+h.width/2,s=h.bottom;break;case"widget-right":n=h.top,o=h.left+h.width/2,r=h.right,s=h.bottom;break;case"widget-bottom":n=h.top+h.height/2,o=h.left,r=h.right,s=h.bottom;break;case"widget-tab":var u=h.tabBar.node.getBoundingClientRect().height;n=h.top,o=h.left,r=h.right,s=h.bottom+h.height-u;break;default:throw"unreachable"}return this.overlay.show({top:n,left:o,right:r,bottom:s}),d},d.prototype._createTabBar=function(){var e=this._renderer.createTabBar(this._document);return V.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e},d.prototype._createHandle=function(){return this._renderer.createHandle()},d.prototype._onTabMoved=function(){n.MessageLoop.postMessage(this,V.LayoutModified)},d.prototype._onCurrentChanged=function(e,t){var o=t.previousTitle,r=t.currentTitle;o&&o.owner.hide(),r&&r.owner.show(),(i.Platform.IS_EDGE||i.Platform.IS_IE)&&n.MessageLoop.flush(),n.MessageLoop.postMessage(this,V.LayoutModified)},d.prototype._onTabAddRequested=function(e){this._addRequested.emit(e)},d.prototype._onTabActivateRequested=function(e,t){t.title.owner.activate()},d.prototype._onTabCloseRequested=function(e,t){t.title.owner.close()},d.prototype._onTabDetachRequested=function(e,t){var i=this;if(!this._drag){e.releaseMouse();var n=t.title,o=t.tab,r=t.clientX,d=t.clientY,h=new a.MimeData;h.setData("application/vnd.lumino.widget-factory",(function(){return n.owner}));var c=o.cloneNode(!0);this._drag=new s.Drag({document:this._document,mimeData:h,dragImage:c,proposedAction:"move",supportedActions:"move",source:this}),o.classList.add("lm-mod-hidden"),o.classList.add("p-mod-hidden");this._drag.start(r,d).then((function(){i._drag=null,o.classList.remove("lm-mod-hidden"),o.classList.remove("p-mod-hidden")}))}},d}(e.Widget),function(t){var i=function(){function e(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return e.prototype.show=function(e){var t=this.node.style;t.top=e.top+"px",t.left=e.left+"px",t.right=e.right+"px",t.bottom=e.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},e.prototype.hide=function(e){var t=this;if(!this._hidden)return e<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),void this.node.classList.add("p-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout((function(){t._timer=-1,t._hidden=!0,t.node.classList.add("lm-mod-hidden"),t.node.classList.add("p-mod-hidden")}),e)))},e}();t.Overlay=i;var n=function(){function t(){}return t.prototype.createTabBar=function(t){var i=new e.TabBar({document:t});return i.addClass("lm-DockPanel-tabBar"),i.addClass("p-DockPanel-tabBar"),i},t.prototype.createHandle=function(){var e=document.createElement("div");return e.className="lm-DockPanel-handle",e.classList.add("p-DockPanel-handle"),e},t}();t.Renderer=n,t.defaultRenderer=new n}(e.DockPanel||(e.DockPanel={})),function(e){e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new n.ConflatableMessage("layout-modified"),e.isGeneratedTabBarProperty=new o.AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}}),e.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};var i=t.toArray(e.widgets()),n=e.selectedWidgets().next(),o=n?i.indexOf(n):-1;return{main:{type:"tab-area",widgets:i,currentIndex:o}}},e.findDropTarget=function(e,t,n,o){if(!i.ElementExt.hitTest(e.node,t,n))return{zone:"invalid",target:null};var r=e.layout;if(r.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){var s=e.node.getBoundingClientRect(),a=t-s.left+1,d=n-s.top+1,h=s.right-t,c=s.bottom-n;switch(Math.min(d,h,c,a)){case d:if(d<o.top)return{zone:"root-top",target:null};break;case h:if(h<o.right)return{zone:"root-right",target:null};break;case c:if(c<o.bottom)return{zone:"root-bottom",target:null};break;case a:if(a<o.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var l=r.hitTestTabAreas(t,n);if(!l)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:l};var u=l.x-l.left+1,p=l.y-l.top+1,m=l.left+l.width-l.x,f=l.top+l.height-l.y;if(p<l.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:l};var g,v=Math.round(l.width/3),y=Math.round(l.height/3);if(u>v&&m>v&&p>y&&f>y)return{zone:"widget-all",target:l};switch(u/=v,p/=y,m/=v,f/=y,Math.min(u,p,m,f)){case u:g="widget-left";break;case p:g="widget-top";break;case m:g="widget-right";break;case f:g="widget-bottom";break;default:throw"unreachable"}return{zone:g,target:l}},e.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}}(V||(V={}));var X,K,G,J=function(){function e(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new r.Signal(this),this._currentChanged=new r.Signal(this)}return e.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,r.Signal.clearData(this),t.each(this._widgets,(function(t){t.node.removeEventListener("focus",e,!0),t.node.removeEventListener("blur",e,!0)})),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.focusNumber=function(e){var t=this._numbers.get(e);return void 0===t?-1:t},e.prototype.has=function(e){return this._numbers.has(e)},e.prototype.add=function(e){if(!this._numbers.has(e)){var t=e.node.contains(document.activeElement),i=t?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,i),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),t&&this._setWidgets(e,e)}},e.prototype.remove=function(e){var i=this;if(this._numbers.has(e)&&(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),t.ArrayExt.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var n=t.filter(this._widgets,(function(e){return-1!==i._numbers.get(e)})),o=t.max(n,(function(e,t){return i._numbers.get(e)-i._numbers.get(t)}))||null;this._setWidgets(o,null)}},e.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e)}},e.prototype._setWidgets=function(e,t){var i=this._currentWidget;this._currentWidget=e;var n=this._activeWidget;this._activeWidget=t,i!==e&&this._currentChanged.emit({oldValue:i,newValue:e}),n!==t&&this._activeChanged.emit({oldValue:n,newValue:t})},e.prototype._evtFocus=function(e){var t=this._nodes.get(e.currentTarget);t!==this._currentWidget&&this._numbers.set(t,this._counter++),this._setWidgets(t,t)},e.prototype._evtBlur=function(e){var i=this._nodes.get(e.currentTarget),n=e.relatedTarget;n&&(i.node.contains(n)||t.find(this._widgets,(function(e){return e.node.contains(n)})))||this._setWidgets(this._currentWidget,null)},e.prototype._onWidgetDisposed=function(e){this.remove(e)},e}();e.GridLayout=function(o){function r(e){void 0===e&&(e={});var t=o.call(this,e)||this;return t._dirty=!1,t._rowSpacing=4,t._columnSpacing=4,t._items=[],t._rowStarts=[],t._columnStarts=[],t._rowSizers=[new g],t._columnSizers=[new g],t._box=null,void 0!==e.rowCount&&K.reallocSizers(t._rowSizers,e.rowCount),void 0!==e.columnCount&&K.reallocSizers(t._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(t._rowSpacing=K.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(t._columnSpacing=K.clampValue(e.columnSpacing)),t}return p(r,o),r.prototype.dispose=function(){t.each(this._items,(function(e){var t=e.widget;e.dispose(),t.dispose()})),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(e){e!==this.rowCount&&(K.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(e){e!==this.columnCount&&(K.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(e){e=K.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(e){e=K.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),r.prototype.rowStretch=function(e){var t=this._rowSizers[e];return t?t.stretch:-1},r.prototype.setRowStretch=function(e,t){var i=this._rowSizers[e];i&&(t=K.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))},r.prototype.columnStretch=function(e){var t=this._columnSizers[e];return t?t.stretch:-1},r.prototype.setColumnStretch=function(e,t){var i=this._columnSizers[e];i&&(t=K.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))},r.prototype.iter=function(){return t.map(this._items,(function(e){return e.widget}))},r.prototype.addWidget=function(e){-1===t.ArrayExt.findFirstIndex(this._items,(function(t){return t.widget===e}))&&(this._items.push(new M(e)),this.parent&&this.attachWidget(e))},r.prototype.removeWidget=function(e){var i=t.ArrayExt.findFirstIndex(this._items,(function(t){return t.widget===e}));if(-1!==i){var n=t.ArrayExt.removeAt(this._items,i);this.parent&&this.detachWidget(e),n.dispose()}},r.prototype.init=function(){var e=this;o.prototype.init.call(this),t.each(this,(function(t){e.attachWidget(t)}))},r.prototype.attachWidget=function(t){this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.detachWidget=function(t){this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterDetach),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype._fit=function(){for(var t=0,o=this.rowCount;t<o;++t)this._rowSizers[t].minSize=0;for(t=0,o=this.columnCount;t<o;++t)this._columnSizers[t].minSize=0;var s=this._items.filter((function(e){return!e.isHidden}));for(t=0,o=s.length;t<o;++t)s[t].fit();var a=this.rowCount-1,d=this.columnCount-1;s.sort(K.rowSpanCmp);for(t=0,o=s.length;t<o;++t){var h=s[t],c=r.getCellConfig(h.widget),l=Math.min(c.row,a),u=Math.min(c.row+c.rowSpan-1,a);K.distributeMin(this._rowSizers,l,u,h.minHeight)}s.sort(K.columnSpanCmp);for(t=0,o=s.length;t<o;++t){h=s[t],c=r.getCellConfig(h.widget);var p=Math.min(c.column,d),m=Math.min(c.column+c.columnSpan-1,d);K.distributeMin(this._columnSizers,p,m,h.minWidth)}if("set-no-constraint"!==this.fitPolicy){var f=a*this._rowSpacing,g=d*this._columnSpacing;for(t=0,o=this.rowCount;t<o;++t)f+=this._rowSizers[t].minSize;for(t=0,o=this.columnCount;t<o;++t)g+=this._columnSizers[t].minSize;var v=this._box=i.ElementExt.boxSizing(this.parent.node);g+=v.horizontalSum,f+=v.verticalSum;var y=this.parent.node.style;y.minWidth=g+"px",y.minHeight=f+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)}else n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(t,n){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var o=this._box.paddingTop,s=this._box.paddingLeft,a=t-this._box.horizontalSum,d=n-this._box.verticalSum,h=this.rowCount-1,c=this.columnCount-1,l=h*this._rowSpacing,u=c*this._columnSpacing;e.BoxEngine.calc(this._rowSizers,Math.max(0,d-l)),e.BoxEngine.calc(this._columnSizers,Math.max(0,a-u));for(var p=0,m=o,f=this.rowCount;p<f;++p)this._rowStarts[p]=m,m+=this._rowSizers[p].size+this._rowSpacing;for(p=0,m=s,f=this.columnCount;p<f;++p)this._columnStarts[p]=m,m+=this._columnSizers[p].size+this._columnSpacing;for(p=0,f=this._items.length;p<f;++p){var g=this._items[p];if(!g.isHidden){var v=r.getCellConfig(g.widget),y=Math.min(v.row,h),b=Math.min(v.column,c),_=Math.min(v.row+v.rowSpan-1,h),M=Math.min(v.column+v.columnSpan-1,c),x=this._columnStarts[b],w=this._rowStarts[y],C=this._columnStarts[M]+this._columnSizers[M].size-x,L=this._rowStarts[_]+this._rowSizers[_].size-w;g.update(x,w,C,L)}}},r}(e.Layout),(X=e.GridLayout||(e.GridLayout={})).getCellConfig=function(e){return K.cellConfigProperty.get(e)},X.setCellConfig=function(e,t){K.cellConfigProperty.set(e,K.normalizeConfig(t))},function(t){t.cellConfigProperty=new o.AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof e.GridLayout&&t.parent.fit()}}),t.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},t.clampValue=function(e){return Math.max(0,Math.floor(e))},t.rowSpanCmp=function(e,i){var n=t.cellConfigProperty.get(e.widget),o=t.cellConfigProperty.get(i.widget);return n.rowSpan-o.rowSpan},t.columnSpanCmp=function(e,i){var n=t.cellConfigProperty.get(e.widget),o=t.cellConfigProperty.get(i.widget);return n.columnSpan-o.columnSpan},t.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.length<t;)e.push(new g);e.length>t&&(e.length=t)},t.distributeMin=function(e,t,i,n){if(!(i<t))if(t!==i){for(var o=0,r=t;r<=i;++r)o+=e[r].minSize;if(!(o>=n)){var s=(n-o)/(i-t+1);for(r=t;r<=i;++r)e[r].minSize+=s}}else{var a=e[t];a.minSize=Math.max(a.minSize,n)}}}(K||(K={})),e.MenuBar=function(o){function r(t){void 0===t&&(t={});var i=o.call(this,{node:G.createNode()})||this;return i._activeIndex=-1,i._menus=[],i._childMenu=null,i.addClass("lm-MenuBar"),i.addClass("p-MenuBar"),i.setFlag(e.Widget.Flag.DisallowLayout),i.renderer=t.renderer||r.defaultRenderer,i._forceItemsPosition=t.forceItemsPosition||{forceX:!0,forceY:!0},i}return p(r,o),r.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(e){this.activeIndex=e?this._menus.indexOf(e):-1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){(e<0||e>=this._menus.length)&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),r.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},r.prototype.addMenu=function(e){this.insertMenu(this._menus.length,e)},r.prototype.insertMenu=function(e,i){this._closeChildMenu();var n=this._menus.indexOf(i),o=Math.max(0,Math.min(e,this._menus.length));if(-1===n)return t.ArrayExt.insert(this._menus,o,i),i.addClass("lm-MenuBar-menu"),i.addClass("p-MenuBar-menu"),i.aboutToClose.connect(this._onMenuAboutToClose,this),i.menuRequested.connect(this._onMenuMenuRequested,this),i.title.changed.connect(this._onTitleChanged,this),void this.update();o===this._menus.length&&o--,n!==o&&(t.ArrayExt.move(this._menus,n,o),this.update())},r.prototype.removeMenu=function(e){this.removeMenuAt(this._menus.indexOf(e))},r.prototype.removeMenuAt=function(e){this._closeChildMenu();var i=t.ArrayExt.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),i.removeClass("p-MenuBar-menu"),this.update())},r.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var e=0,t=this._menus;e<t.length;e++){var i=t[e];i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),i.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},r.prototype.handleEvent=function(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},r.prototype.onBeforeAttach=function(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},r.prototype.onAfterDetach=function(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},r.prototype.onActivateRequest=function(e){this.isAttached&&this.node.focus()},r.prototype.onUpdateRequest=function(e){for(var t=this,i=this._menus,n=this.renderer,o=this._activeIndex,r=new Array(i.length),s=function(e,s){var a=i[e].title,d=e===o;d&&0==i[e].items.length&&(d=!1),r[e]=n.renderItem({title:a,active:d,onfocus:function(){t.activeIndex=e}})},a=0,d=i.length;a<d;++a)s(a);h.VirtualDOM.render(r,this.contentNode)},r.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation();var t=e.keyCode;if(13!==t&&38!==t&&40!==t){if(27===t)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==t)if(39!==t){var i=l.getKeyboardLayout().keyForKeydownEvent(e);if(i){var n=this._activeIndex+1,o=G.findMnemonic(this._menus,i,n);-1===o.index||o.multiple?-1!==o.index?this.activeIndex=o.index:-1!==o.auto&&(this.activeIndex=o.auto):(this.activeIndex=o.index,this.openActiveMenu())}}else{r=this._activeIndex,s=this._menus.length;this.activeIndex=r===s-1?0:r+1}else{var r=this._activeIndex,s=this._menus.length;this.activeIndex=0===r?s-1:r-1}}else this.openActiveMenu()},r.prototype._evtMouseDown=function(e){if(i.ElementExt.hitTest(this.node,e.clientX,e.clientY)){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();var n=t.ArrayExt.findFirstIndex(this.contentNode.children,(function(t){return i.ElementExt.hitTest(t,e.clientX,e.clientY)}));-1!==n?0===e.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=n):(this.activeIndex=n,this._openChildMenu())):this._closeChildMenu()}},r.prototype._evtMouseMove=function(e){var n=t.ArrayExt.findFirstIndex(this.contentNode.children,(function(t){return i.ElementExt.hitTest(t,e.clientX,e.clientY)}));n!==this._activeIndex&&(-1===n&&this._childMenu||(this.activeIndex=n,this._childMenu&&this._openChildMenu()))},r.prototype._evtMouseLeave=function(e){this._childMenu||(this.activeIndex=-1)},r.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var i=this._childMenu;if(i!==t){this._childMenu=t,i?i.close():(this.addClass("lm-mod-active"),this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),n.MessageLoop.sendMessage(this,e.Widget.Msg.UpdateRequest);var o=this.contentNode.children[this._activeIndex].getBoundingClientRect(),r=o.left,s=o.bottom;t.items.length>0&&t.open(r,s,this._forceItemsPosition)}}else this._closeChildMenu()},r.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}},r.prototype._onMenuAboutToClose=function(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},r.prototype._onMenuMenuRequested=function(e,t){if(e===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(t){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=0===i?n-1:i-1}this.openActiveMenu()}},r.prototype._onTitleChanged=function(){this.update()},r}(e.Widget),function(e){var t=function(){function e(){}return e.prototype.renderItem=function(e){var t=this.createItemClass(e),i=this.createItemDataset(e),n=this.createItemARIA(e);return h.h.li(m({className:t,dataset:i,tabindex:"0",onfocus:e.onfocus},n),this.renderIcon(e),this.renderLabel(e))},e.prototype.renderIcon=function(e){var t=this.createIconClass(e);return"string"==typeof e.title.icon?h.h.div({className:t},e.title.iconLabel):h.h.div({className:t},e.title.icon,e.title.iconLabel)},e.prototype.renderLabel=function(e){var t=this.formatLabel(e);return h.h.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},t)},e.prototype.createItemClass=function(e){var t="lm-MenuBar-item";return t+=" p-MenuBar-item",e.title.className&&(t+=" "+e.title.className),e.active&&(t+=" lm-mod-active",t+=" p-mod-active"),t},e.prototype.createItemDataset=function(e){return e.title.dataset},e.prototype.createItemARIA=function(e){return{role:"menuitem","aria-haspopup":"true"}},e.prototype.createIconClass=function(e){var t="lm-MenuBar-itemIcon";t+=" p-MenuBar-itemIcon";var i=e.title.iconClass;return i?t+" "+i:t},e.prototype.formatLabel=function(e){var t=e.title,i=t.label,n=t.mnemonic;if(n<0||n>=i.length)return i;var o=i.slice(0,n),r=i.slice(n+1),s=i[n];return[o,h.h.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},s),r]},e}();e.Renderer=t,e.defaultRenderer=new t}(e.MenuBar||(e.MenuBar={})),function(e){e.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",t.classList.add("p-MenuBar-content"),e.appendChild(t),t.setAttribute("role","menubar"),e.tabIndex=0,t.tabIndex=0,e},e.findMnemonic=function(e,t,i){for(var n=-1,o=-1,r=!1,s=t.toUpperCase(),a=0,d=e.length;a<d;++a){var h=(a+i)%d,c=e[h].title;if(0!==c.label.length){var l=c.mnemonic;l>=0&&l<c.label.length?c.label[l].toUpperCase()===s&&(-1===n?n=h:r=!0):-1===o&&c.label[0].toUpperCase()===s&&(o=h)}}return{index:n,multiple:r,auto:o}}}(G||(G={}));var Q,Z=function(t){function n(n){void 0===n&&(n={});var o=t.call(this,{node:Q.createNode()})||this;return o._onRepeat=function(){if(o._repeatTimer=-1,o._pressData){var e=o._pressData.part;if("thumb"!==e){o._repeatTimer=window.setTimeout(o._onRepeat,20);var t=o._pressData.mouseX,n=o._pressData.mouseY;if("decrement"!==e)if("increment"!==e){if("track"===e){if(!i.ElementExt.hitTest(o.trackNode,t,n))return;var r=o.thumbNode;if(i.ElementExt.hitTest(r,t,n))return;var s=r.getBoundingClientRect(),a=void 0;return a="horizontal"===o._orientation?t<s.left?"decrement":"increment":n<s.top?"decrement":"increment",void o._pageRequested.emit(a)}}else{if(!i.ElementExt.hitTest(o.incrementNode,t,n))return;o._stepRequested.emit("increment")}else{if(!i.ElementExt.hitTest(o.decrementNode,t,n))return;o._stepRequested.emit("decrement")}}}},o._value=0,o._page=10,o._maximum=100,o._repeatTimer=-1,o._pressData=null,o._thumbMoved=new r.Signal(o),o._stepRequested=new r.Signal(o),o._pageRequested=new r.Signal(o),o.addClass("lm-ScrollBar"),o.addClass("p-ScrollBar"),o.setFlag(e.Widget.Flag.DisallowLayout),o._orientation=n.orientation||"vertical",o.dataset.orientation=o._orientation,void 0!==n.maximum&&(o._maximum=Math.max(0,n.maximum)),void 0!==n.page&&(o._page=Math.max(0,n.page)),void 0!==n.value&&(o._value=Math.max(0,Math.min(n.value,o._maximum))),o}return p(n,t),Object.defineProperty(n.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"orientation",{get:function(){return this._orientation},set:function(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){e=Math.max(0,Math.min(e,this._maximum)),this._value!==e&&(this._value=e,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},set:function(e){e=Math.max(0,e),this._page!==e&&(this._page=e,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maximum",{get:function(){return this._maximum},set:function(e){e=Math.max(0,e),this._maximum!==e&&(this._maximum=e,this._value=Math.min(this._value,e),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),n.prototype.handleEvent=function(e){switch(e.type){case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},n.prototype.onBeforeAttach=function(e){this.node.addEventListener("mousedown",this),this.update()},n.prototype.onAfterDetach=function(e){this.node.removeEventListener("mousedown",this),this._releaseMouse()},n.prototype.onUpdateRequest=function(e){var t=100*this._value/this._maximum,i=100*this._page/(this._page+this._maximum);t=Math.max(0,Math.min(t,100)),i=Math.max(0,Math.min(i,100));var n=this.thumbNode.style;"horizontal"===this._orientation?(n.top="",n.height="",n.left=t+"%",n.width=i+"%",n.transform="translate("+-t+"%, 0%)"):(n.left="",n.width="",n.top=t+"%",n.height=i+"%",n.transform="translate(0%, "+-t+"%)")},n.prototype._evtKeyDown=function(e){if(e.preventDefault(),e.stopPropagation(),27===e.keyCode){var t=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==t&&this._moveThumb(t)}},n.prototype._evtMouseDown=function(e){if(0===e.button&&(this.activate(),!this._pressData)){var t=Q.findPart(this,e.target);if(t){e.preventDefault(),e.stopPropagation();var i=s.Drag.overrideCursor("default");if(this._pressData={part:t,override:i,delta:-1,value:-1,mouseX:e.clientX,mouseY:e.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===t){var n=this.thumbNode,o=n.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=e.clientX-o.left:this._pressData.delta=e.clientY-o.top,n.classList.add("lm-mod-active"),n.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===t){o=this.thumbNode.getBoundingClientRect();var r=void 0;return r="horizontal"===this._orientation?e.clientX<o.left?"decrement":"increment":e.clientY<o.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._pageRequested.emit(r)}return"decrement"===t?(this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._stepRequested.emit("decrement")):"increment"===t?(this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._stepRequested.emit("increment")):void 0}}},n.prototype._evtMouseMove=function(e){if(this._pressData&&(e.preventDefault(),e.stopPropagation(),this._pressData.mouseX=e.clientX,this._pressData.mouseY=e.clientY,"thumb"===this._pressData.part)){var t,i,n=this.thumbNode.getBoundingClientRect(),o=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(t=e.clientX-o.left-this._pressData.delta,i=o.width-n.width):(t=e.clientY-o.top-this._pressData.delta,i=o.height-n.height);var r=0===i?0:t*this._maximum/i;this._moveThumb(r)}},n.prototype._evtMouseUp=function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())},n.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},n.prototype._moveThumb=function(e){e=Math.max(0,Math.min(e,this._maximum)),this._value!==e&&(this._value=e,this.update(),this._thumbMoved.emit(e))},n}(e.Widget);!function(e){e.createNode=function(){var e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div");return t.className="lm-ScrollBar-button",i.className="lm-ScrollBar-button",t.dataset.action="decrement",i.dataset.action="increment",n.className="lm-ScrollBar-track",o.className="lm-ScrollBar-thumb",t.classList.add("p-ScrollBar-button"),i.classList.add("p-ScrollBar-button"),n.classList.add("p-ScrollBar-track"),o.classList.add("p-ScrollBar-thumb"),n.appendChild(o),e.appendChild(t),e.appendChild(n),e.appendChild(i),e},e.findPart=function(e,t){return e.thumbNode.contains(t)?"thumb":e.trackNode.contains(t)?"track":e.decrementNode.contains(t)?"decrement":e.incrementNode.contains(t)?"increment":null}}(Q||(Q={}));var $,ee=function(i){function o(){var e=null!==i&&i.apply(this,arguments)||this;return e._widget=null,e}return p(o,i),o.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}i.prototype.dispose.call(this)},Object.defineProperty(o.prototype,"widget",{get:function(){return this._widget},set:function(e){e&&(e.parent=this.parent),this._widget!==e&&(this._widget&&this._widget.dispose(),this._widget=e,this.parent&&e&&this.attachWidget(e))},enumerable:!0,configurable:!0}),o.prototype.iter=function(){return this._widget?t.once(this._widget):t.empty()},o.prototype.removeWidget=function(e){this._widget===e&&(this._widget=null,this.parent&&this.detachWidget(e))},o.prototype.init=function(){var e=this;i.prototype.init.call(this),t.each(this,(function(t){e.attachWidget(t)}))},o.prototype.attachWidget=function(t){this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterAttach)},o.prototype.detachWidget=function(t){this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&n.MessageLoop.sendMessage(t,e.Widget.Msg.AfterDetach)},o}(e.Layout),te=function(o){function r(t){void 0===t&&(t={});var i=o.call(this,t)||this;return i._dirty=!1,i._items=[],i._box=null,i._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:e.Widget.HiddenMode.Display,i}return p(r,o),Object.defineProperty(r.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){var t=this;this._hiddenMode!==e&&(this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach((function(e){e.hiddenMode=t._hiddenMode})))},enumerable:!0,configurable:!0}),r.prototype.dispose=function(){t.each(this._items,(function(e){e.dispose()})),this._box=null,this._items.length=0,o.prototype.dispose.call(this)},r.prototype.attachWidget=function(i,o){this._hiddenMode===e.Widget.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=e.Widget.HiddenMode.Scale),o.hiddenMode=e.Widget.HiddenMode.Scale):o.hiddenMode=e.Widget.HiddenMode.Display,t.ArrayExt.insert(this._items,i,new M(o)),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.moveWidget=function(e,i,n){t.ArrayExt.move(this._items,e,i),this.parent.update()},r.prototype.detachWidget=function(i,o){var r=t.ArrayExt.removeAt(this._items,i);this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach),r.widget.node.style.zIndex="",this._hiddenMode===e.Widget.HiddenMode.Scale&&(o.hiddenMode=e.Widget.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=e.Widget.HiddenMode.Display)),r.dispose(),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype._fit=function(){for(var t=0,o=0,r=0,s=this._items.length;r<s;++r){var a=this._items[r];a.isHidden||(a.fit(),t=Math.max(t,a.minWidth),o=Math.max(o,a.minHeight))}var d=this._box=i.ElementExt.boxSizing(this.parent.node);t+=d.horizontalSum,o+=d.verticalSum;var h=this.parent.node.style;h.minWidth=t+"px",h.minHeight=o+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(e,t){this._dirty=!1;for(var n=0,o=0,r=this._items.length;o<r;++o)n+=+!this._items[o].isHidden;if(0!==n){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var s=this._box.paddingTop,a=this._box.paddingLeft,d=e-this._box.horizontalSum,h=t-this._box.verticalSum;for(o=0,r=this._items.length;o<r;++o){var c=this._items[o];c.isHidden||(c.widget.node.style.zIndex=""+o,c.update(a,s,d,h))}}},r}(w),ie=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,{layout:$.createLayout(t)})||this;return i._widgetRemoved=new r.Signal(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return p(t,e),Object.defineProperty(t.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(e){this.layout.hiddenMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),t.prototype.onChildAdded=function(e){e.child.addClass("lm-StackedPanel-child"),e.child.addClass("p-StackedPanel-child")},t.prototype.onChildRemoved=function(e){e.child.removeClass("lm-StackedPanel-child"),e.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(e.child)},t}(H);!function(e){e.createLayout=function(e){return e.layout||new te}}($||($={}));var ne,oe=function(t){function o(i){void 0===i&&(i={});var n=t.call(this)||this;n._currentChanged=new r.Signal(n),n._addRequested=new r.Signal(n),n.addClass("lm-TabPanel"),n.addClass("p-TabPanel"),n.tabBar=new e.TabBar(i),n.tabBar.addClass("lm-TabPanel-tabBar"),n.stackedPanel=new ie,n.stackedPanel.addClass("lm-TabPanel-stackedPanel"),n.tabBar.addClass("p-TabPanel-tabBar"),n.stackedPanel.addClass("p-TabPanel-stackedPanel"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.tabBar.addRequested.connect(n._onTabAddRequested,n),n.stackedPanel.widgetRemoved.connect(n._onWidgetRemoved,n),n._tabPlacement=i.tabPlacement||"top";var o=ne.directionFromPlacement(n._tabPlacement),s=ne.orientationFromPlacement(n._tabPlacement);n.tabBar.orientation=s,n.tabBar.dataset.placement=n._tabPlacement;var a=new e.BoxLayout({direction:o,spacing:0});return e.BoxLayout.setStretch(n.tabBar,0),e.BoxLayout.setStretch(n.stackedPanel,1),a.addWidget(n.tabBar),a.addWidget(n.stackedPanel),n.layout=a,n}return p(o,t),Object.defineProperty(o.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(e){this.tabBar.currentIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"currentWidget",{get:function(){var e=this.tabBar.currentTitle;return e?e.owner:null},set:function(e){this.tabBar.currentTitle=e?e.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(e){this.tabBar.tabsMovable=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(e){this.tabBar.addButtonEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(e){if(this._tabPlacement!==e){this._tabPlacement=e;var t=ne.directionFromPlacement(e),i=ne.orientationFromPlacement(e);this.tabBar.orientation=i,this.tabBar.dataset.placement=e,this.layout.direction=t}},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),o.prototype.addWidget=function(e){this.insertWidget(this.widgets.length,e)},o.prototype.insertWidget=function(t,i){i!==this.currentWidget&&i.hide(),this.stackedPanel.insertWidget(t,i),this.tabBar.insertTab(t,i.title),i.node.setAttribute("role","tabpanel");var n=this.tabBar.renderer;if(n instanceof e.TabBar.Renderer){var o=n.createTabKey({title:i.title,current:!1,zIndex:0});i.node.setAttribute("aria-labelledby",o)}},o.prototype._onCurrentChanged=function(e,t){var o=t.previousIndex,r=t.previousTitle,s=t.currentIndex,a=t.currentTitle,d=r?r.owner:null,h=a?a.owner:null;d&&d.hide(),h&&h.show(),this._currentChanged.emit({previousIndex:o,previousWidget:d,currentIndex:s,currentWidget:h}),(i.Platform.IS_EDGE||i.Platform.IS_IE)&&n.MessageLoop.flush()},o.prototype._onTabAddRequested=function(e,t){this._addRequested.emit(e)},o.prototype._onTabActivateRequested=function(e,t){t.title.owner.activate()},o.prototype._onTabCloseRequested=function(e,t){t.title.owner.close()},o.prototype._onTabMoved=function(e,t){this.stackedPanel.insertWidget(t.toIndex,t.title.owner)},o.prototype._onWidgetRemoved=function(e,t){t.node.removeAttribute("role"),t.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(t.title)},o}(e.Widget);!function(e){e.orientationFromPlacement=function(e){return t[e]},e.directionFromPlacement=function(e){return i[e]};var t={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},i={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(ne||(ne={})),e.AccordionLayout=S,e.BoxSizer=g,e.ContextMenu=F,e.DockLayout=Y,e.FocusTracker=J,e.LayoutItem=M,e.Panel=H,e.PanelLayout=w,e.ScrollBar=Z,e.SingletonLayout=ee,e.StackedLayout=te,e.StackedPanel=ie,e.TabPanel=oe,e.Title=b,Object.defineProperty(e,"__esModule",{value:!0})}));
16//# sourceMappingURL=index.min.js.map
\No newline at end of file