@hpcc-js/phosphor 2.16.2 → 2.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -58,5 +58,5 @@ var tt=function(t,e){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof A
58
58
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
59
59
  PERFORMANCE OF THIS SOFTWARE.
60
60
  ***************************************************************************** */
61
- var st=function(t,e){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},st(t,e)};function at(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var dt=function(){return dt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dt.apply(this,arguments)};var ct,ht=function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1};!function(t){t.calc=function(t,e){var i=t.length;if(0===i)return e;for(var n=0,o=0,r=0,s=0,a=0,d=0;d<i;++d){var c=(y=t[d]).minSize,h=y.maxSize,l=y.sizeHint;y.done=!1,y.size=Math.max(c,Math.min(l,h)),r+=y.size,n+=c,o+=h,y.stretch>0&&(s+=y.stretch,a++)}if(e===r)return 0;if(e<=n){for(d=0;d<i;++d){(y=t[d]).size=y.minSize}return e-n}if(e>=o){for(d=0;d<i;++d){(y=t[d]).size=y.maxSize}return e-o}var u=.01,p=i;if(e<r){for(var f=r-e;a>0&&f>u;){var m=f,g=s;for(d=0;d<i;++d){if(!(y=t[d]).done&&0!==y.stretch){var v=y.stretch*m/g;y.size-v<=y.minSize?(f-=y.size-y.minSize,s-=y.stretch,y.size=y.minSize,y.done=!0,p--,a--):(f-=v,y.size-=v)}}}for(;p>0&&f>u;)for(v=f/p,d=0;d<i;++d){(y=t[d]).done||(y.size-v<=y.minSize?(f-=y.size-y.minSize,y.size=y.minSize,y.done=!0,p--):(f-=v,y.size-=v))}}else{for(f=e-r;a>0&&f>u;)for(m=f,g=s,d=0;d<i;++d){if(!(y=t[d]).done&&0!==y.stretch){v=y.stretch*m/g;y.size+v>=y.maxSize?(f-=y.maxSize-y.size,s-=y.stretch,y.size=y.maxSize,y.done=!0,p--,a--):(f-=v,y.size+=v)}}for(;p>0&&f>u;)for(v=f/p,d=0;d<i;++d){var y;(y=t[d]).done||(y.size+v>=y.maxSize?(f-=y.maxSize-y.size,y.size=y.maxSize,y.done=!0,p--):(f-=v,y.size+=v))}}return 0},t.adjust=function(t,e,i){0!==t.length&&0!==i&&(i>0?function(t,e,i){for(var n=0,o=0;o<=e;++o){n+=(c=t[o]).maxSize-c.size}for(var r=0,s=(o=e+1,t.length);o<s;++o){r+=(c=t[o]).size-c.minSize}var a=i=Math.min(i,n,r);for(o=e;o>=0&&a>0;--o){(h=(c=t[o]).maxSize-c.size)>=a?(c.sizeHint=c.size+a,a=0):(c.sizeHint=c.size+h,a-=h)}var d=i;for(o=e+1,s=t.length;o<s&&d>0;++o){var c,h;(h=(c=t[o]).size-c.minSize)>=d?(c.sizeHint=c.size-d,d=0):(c.sizeHint=c.size-h,d-=h)}}(t,e,i):function(t,e,i){for(var n=0,o=e+1,r=t.length;o<r;++o){n+=(c=t[o]).maxSize-c.size}var s=0;for(o=0;o<=e;++o){s+=(c=t[o]).size-c.minSize}var a=i=Math.min(i,n,s);for(o=e+1,r=t.length;o<r&&a>0;++o){(h=(c=t[o]).maxSize-c.size)>=a?(c.sizeHint=c.size+a,a=0):(c.sizeHint=c.size+h,a-=h)}var d=i;for(o=e;o>=0&&d>0;--o){var c,h;(h=(c=t[o]).size-c.minSize)>=d?(c.sizeHint=c.size-d,d=0):(c.sizeHint=c.size-h,d-=h)}}(t,e,-i))}}(ct||(ct={}));var lt,ut=function(){function t(t){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new S(this),this._isDisposed=!1,this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon?"string"==typeof t.icon?(this._icon=null,this._iconClass=t.icon):this._icon=t.icon:this._icon=null,void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.iconRenderer&&(this._icon=t.iconRenderer),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return null===this._icon?this.iconClass:this._icon},set:function(t){if("string"==typeof t)this._icon=null,this.iconClass=t;else{if(this._icon===t)return;this._icon=t,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(t){this.icon=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,S.clearData(this))},t}(),pt=function(){function t(e){void 0===e&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new S(this),this._hiddenMode=t.HiddenMode.Display,this.node=lt.createNode(e),this.addClass("lm-Widget"),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),S.clearData(this),Y.clearData(this),J.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return lt.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){if(this._hiddenMode!==e){switch(this._hiddenMode=e,e){case t.HiddenMode.Display:this.node.style.willChange="auto";break;case t.HiddenMode.Scale:this.node.style.willChange="transform"}this.isHidden&&(e===t.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(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var i=new t.ChildMessage("child-removed",this);Y.sendMessage(this._parent,i)}if(this._parent=e,this._parent&&!this._parent.isDisposed){i=new t.ChildMessage("child-added",this);Y.sendMessage(this._parent,i)}this.isDisposed||Y.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():d()},t.prototype.contains=function(t){for(var e=t;e;e=e._parent)if(e===this)return!0;return!1},t.prototype.hasClass=function(t){return this.node.classList.contains(t)},t.prototype.addClass=function(t){this.node.classList.add(t)},t.prototype.removeClass=function(t){this.node.classList.remove(t)},t.prototype.toggleClass=function(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)},t.prototype.update=function(){Y.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){Y.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){Y.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){Y.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this.hiddenMode===t.HiddenMode.Display?(this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")):this.node.style.transform="",!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);Y.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this.hiddenMode===t.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||Y.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);Y.sendMessage(this.parent,e)}},t.prototype.setHidden=function(t){t?this.hide():this.show()},t.prototype.testFlag=function(t){return 0!=(this._flags&t)},t.prototype.setFlag=function(t){this._flags|=t},t.prototype.clearFlag=function(t){this._flags&=~t},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}},t.prototype.notifyLayout=function(t){this._layout&&this._layout.processParentMessage(t)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(t){},t.prototype.onUpdateRequest=function(t){},t.prototype.onFitRequest=function(t){},t.prototype.onActivateRequest=function(t){},t.prototype.onBeforeShow=function(t){},t.prototype.onAfterShow=function(t){},t.prototype.onBeforeHide=function(t){},t.prototype.onAfterHide=function(t){},t.prototype.onBeforeAttach=function(t){},t.prototype.onAfterAttach=function(t){},t.prototype.onBeforeDetach=function(t){},t.prototype.onAfterDetach=function(t){},t.prototype.onChildAdded=function(t){},t.prototype.onChildRemoved=function(t){},t}();!function(t){var e,i,n;(e=t.HiddenMode||(t.HiddenMode={}))[e.Display=0]="Display",e[e.Scale=1]="Scale",(i=t.Flag||(t.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",(n=t.Msg||(t.Msg={})).BeforeShow=new X("before-show"),n.AfterShow=new X("after-show"),n.BeforeHide=new X("before-hide"),n.AfterHide=new X("after-hide"),n.BeforeAttach=new X("before-attach"),n.AfterAttach=new X("after-attach"),n.BeforeDetach=new X("before-detach"),n.AfterDetach=new X("after-detach"),n.ParentChanged=new X("parent-changed"),n.UpdateRequest=new G("update-request"),n.FitRequest=new G("fit-request"),n.ActivateRequest=new G("activate-request"),n.CloseRequest=new G("close-request");var o=function(t){function e(e,i){var n=t.call(this,e)||this;return n.child=i,n}return at(e,t),e}(X);t.ChildMessage=o;var r=function(t){function e(e,i){var n=t.call(this,"resize")||this;return n.width=e,n.height=i,n}return at(e,t),e}(X);t.ResizeMessage=r,function(t){t.UnknownSize=new t(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,i,n){if(void 0===n&&(n=null),e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw new Error("Widget is already attached.");if(!i.isConnected)throw new Error("Host is not attached.");Y.sendMessage(e,t.Msg.BeforeAttach),i.insertBefore(e.node,n),Y.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw new Error("Widget is not attached.");Y.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),Y.sendMessage(e,t.Msg.AfterDetach)}}(pt||(pt={})),function(t){t.titleProperty=new J({name:"title",create:function(t){return new ut({owner:t})}}),t.createNode=function(t){return t.node||document.createElement(t.tag||"div")}}(lt||(lt={}));var ft=function(){function t(t){void 0===t&&(t={}),this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,S.clearData(this),J.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){var e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}},t.prototype.init=function(){var t=this;o(this,(function(e){e.parent=t.parent}))},t.prototype.onResize=function(t){o(this,(function(t){Y.sendMessage(t,pt.ResizeMessage.UnknownSize)}))},t.prototype.onUpdateRequest=function(t){o(this,(function(t){Y.sendMessage(t,pt.ResizeMessage.UnknownSize)}))},t.prototype.onBeforeAttach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onAfterAttach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onBeforeDetach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onAfterDetach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onBeforeShow=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onAfterShow=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onBeforeHide=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onAfterHide=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onChildRemoved=function(t){this.removeWidget(t.child)},t.prototype.onFitRequest=function(t){},t.prototype.onChildShown=function(t){},t.prototype.onChildHidden=function(t){},t}();!function(t){t.getHorizontalAlignment=function(t){return mt.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){mt.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return mt.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){mt.verticalAlignmentProperty.set(t,e)}}(ft||(ft={}));var mt,gt=function(){function t(t){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=t,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.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 t=E.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight},t.prototype.update=function(t,e,i,n){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o<i)switch(ft.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(i-o)/2;break;case"right":t+=i-o;break;default:throw"unreachable"}if(r<n)switch(ft.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(n-r)/2;break;case"bottom":e+=n-r;break;default:throw"unreachable"}var s=!1,a=this.widget.node.style;if(this._top!==e&&(this._top=e,a.top=e+"px"),this._left!==t&&(this._left=t,a.left=t+"px"),this._width!==o&&(s=!0,this._width=o,a.width=o+"px"),this._height!==r&&(s=!0,this._height=r,a.height=r+"px"),s){var d=new pt.ResizeMessage(o,r);Y.sendMessage(this.widget,d)}},t}();!function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new J({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new J({name:"verticalAlignment",create:function(){return"top"},changed:e})}(mt||(mt={}));var vt,yt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgets=[],e}return at(e,t),e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return n(this._widgets)},e.prototype.addWidget=function(t){this.insertWidget(this._widgets.length,t)},e.prototype.insertWidget=function(t,e){e.parent=this.parent;var n=this._widgets.indexOf(e),o=Math.max(0,Math.min(t,this._widgets.length));if(-1===n)return i.insert(this._widgets,o,e),void(this.parent&&this.attachWidget(o,e));o===this._widgets.length&&o--,n!==o&&(i.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,e))},e.prototype.removeWidget=function(t){this.removeWidgetAt(this._widgets.indexOf(t))},e.prototype.removeWidgetAt=function(t){var e=i.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t,i){e.attachWidget(i,t)}))},e.prototype.attachWidget=function(t,e){var i=this.parent.node.children[t];this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,i),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach)},e.prototype.moveWidget=function(t,e,i){this.parent.isAttached&&Y.sendMessage(i,pt.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Y.sendMessage(i,pt.Msg.AfterDetach);var n=this.parent.node.children[e];this.parent.isAttached&&Y.sendMessage(i,pt.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&Y.sendMessage(i,pt.Msg.AfterAttach)},e.prototype.detachWidget=function(t,e){this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach)},e}(ft);!function(t){t.clampDimension=function(t){return Math.max(0,Math.floor(t))}}(vt||(vt={}));var bt,_t=vt,wt=function(t){function e(e){var i=t.call(this)||this;return i.widgetOffset=0,i._fixed=0,i._spacing=4,i._dirty=!1,i._hasNormedSizes=!1,i._sizers=[],i._items=[],i._handles=[],i._box=null,i._alignment="start",i._orientation="horizontal",i.renderer=e.renderer,void 0!==e.orientation&&(i._orientation=e.orientation),void 0!==e.alignment&&(i._alignment=e.alignment),void 0!==e.spacing&&(i._spacing=vt.clampDimension(e.spacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=vt.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.absoluteSizes=function(){return this._sizers.map((function(t){return t.size}))},e.prototype.relativeSizes=function(){return bt.normalize(this._sizers.map((function(t){return t.size})))},e.prototype.setRelativeSizes=function(t,e){void 0===e&&(e=!0);for(var i=this._sizers.length,n=t.slice(0,i);n.length<i;)n.push(0);for(var o=bt.normalize(n),r=0;r<i;++r){var s=this._sizers[r];s.sizeHint=o[r],s.size=o[r]}this._hasNormedSizes=!0,e&&this.parent&&this.parent.update()},e.prototype.moveHandle=function(t,e){var i,n=this._handles[t];if(n&&!n.classList.contains("lm-mod-hidden")&&0!==(i="horizontal"===this._orientation?e-n.offsetLeft:e-n.offsetTop)){for(var o=0,r=this._sizers;o<r.length;o++){var s=r[o];s.size>0&&(s.sizeHint=s.size)}ct.adjust(this._sizers,t,i),this.parent&&this.parent.update()}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){var n=new gt(e),o=bt.createHandle(this.renderer),r=bt.averageSize(this._sizers),s=bt.createSizer(r);i.insert(this._items,t,n),i.insert(this._sizers,t,s),i.insert(this._handles,t,o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),i.move(this._sizers,t,e),i.move(this._handles,t,e),this.parent.fit()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t),o=i.removeAt(this._handles,t);i.removeAt(this._sizers,t),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype.updateItemPosition=function(t,e,i,n,o,r,s){var a=this._items[t];if(!a.isHidden){var d=this._handles[t].style;e?(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")}},e.prototype._fit=function(){for(var t=0,i=-1,n=0,o=this._items.length;n<o;++n)this._items[n].isHidden?(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].classList.add("p-mod-hidden")):(this._handles[n].classList.remove("lm-mod-hidden"),this._handles[n].classList.remove("p-mod-hidden"),i=n,t++);-1!==i&&(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,t-1)+this.widgetOffset*this._items.length;var r="horizontal"===this._orientation,s=r?this._fixed:0,a=r?0:this._fixed;for(n=0,o=this._items.length;n<o;++n){var d=this._items[n],c=this._sizers[n];c.size>0&&(c.sizeHint=c.size),d.isHidden?(c.minSize=0,c.maxSize=0):(d.fit(),c.stretch=e.getStretch(d.widget),r?(c.minSize=d.minWidth,c.maxSize=d.maxWidth,s+=d.minWidth,a=Math.max(a,d.minHeight)):(c.minSize=d.minHeight,c.maxSize=d.maxHeight,a+=d.minHeight,s=Math.max(s,d.minWidth)))}var h=this._box=E.boxSizing(this.parent.node);s+=h.horizontalSum,a+=h.verticalSum;var l=this.parent.node.style;l.minWidth=s+"px",l.minHeight=a+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i||0!==this.widgetOffset){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r=this._box.paddingTop,s=this._box.paddingLeft,a=t-this._box.horizontalSum,d=e-this._box.verticalSum,c=0,h=0,l="horizontal"===this._orientation;if(i>0){var u=void 0;if(u=l?Math.max(0,a-this._fixed):Math.max(0,d-this._fixed),this._hasNormedSizes){for(var p=0,f=this._sizers;p<f.length;p++){f[p].sizeHint*=u}this._hasNormedSizes=!1}var m=ct.calc(this._sizers,u);if(m>0)switch(this._alignment){case"start":break;case"center":c=0,h=m/2;break;case"end":c=0,h=m;break;case"justify":c=m/i,h=0;break;default:throw"unreachable"}}for(n=0,o=this._items.length;n<o;++n){var g=this._items[n].isHidden?0:this._sizers[n].size+c;this.updateItemPosition(n,l,l?s+h:s,l?r:r+h,d,a,g);var v=this.widgetOffset+(this._handles[n].classList.contains("lm-mod-hidden")?0:this._spacing);l?s+=g+v:r+=g+v}}},e}(yt);!function(t){t.getStretch=function(t){return bt.stretchProperty.get(t)},t.setStretch=function(t,e){bt.stretchProperty.set(t,e)}}(wt||(wt={})),function(t){t.stretchProperty=new J({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:function(t){t.parent&&t.parent.layout instanceof wt&&t.parent.fit()}}),t.createSizer=function(t){var e=new ht;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){var e=t.createHandle();return e.style.position="absolute",e},t.averageSize=function(t){return t.reduce((function(t,e){return t+e.size}),0)/t.length||0},t.normalize=function(t){var e=t.length;if(0===e)return[];var i=t.reduce((function(t,e){return t+Math.abs(e)}),0);return 0===i?t.map((function(t){return 1/e})):t.map((function(t){return t/i}))}}(bt||(bt={}));var xt,Mt=function(t){function e(e){var i=t.call(this,dt(dt({},e),{orientation:e.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=e.titleSpace||22,i}return at(e,t),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(t){t=_t.clampDimension(t),this.widgetOffset!==t&&(this.widgetOffset=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,t.prototype.dispose.call(this))},e.prototype.updateTitle=function(t,e){var i=this._titles[t],n=i.classList.contains("lm-mod-expanded"),o=xt.createTitle(this.renderer,e.title,n);this._titles[t]=o,this.parent.node.replaceChild(o,i)},e.prototype.attachWidget=function(e,n){var o=xt.createTitle(this.renderer,n.title);i.insert(this._titles,e,o),this.parent.node.appendChild(o),n.node.setAttribute("role","region"),n.node.setAttribute("aria-labelledby",o.id),t.prototype.attachWidget.call(this,e,n)},e.prototype.moveWidget=function(e,n,o){i.move(this._titles,e,n),t.prototype.moveWidget.call(this,e,n,o)},e.prototype.detachWidget=function(e,n){var o=i.removeAt(this._titles,e);this.parent.node.removeChild(o),t.prototype.detachWidget.call(this,e,n)},e.prototype.updateItemPosition=function(e,i,n,o,r,s,a){var d=this._titles[e].style;d.top=o+"px",d.left=n+"px",d.height=this.widgetOffset+"px",d.width=i?r+"px":s+"px",t.prototype.updateItemPosition.call(this,e,i,n,o,r,s,a)},e}(wt);!function(t){t.createTitle=function(t,e,i){void 0===i&&(i=!0);var n=t.createSectionTitle(e);return n.style.position="absolute",n.setAttribute("aria-label",e.label+" Section"),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",e.owner.id),i&&n.classList.add("lm-mod-expanded"),n}}(xt||(xt={}));var Ct,zt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=Ct.createLayout(e),i}return at(e,t),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.layout.addWidget(t)},e.prototype.insertWidget=function(t,e){this.layout.insertWidget(t,e)},e}(pt);!function(t){t.createLayout=function(t){return t.layout||new yt}}(Ct||(Ct={}));var St,Pt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:St.createLayout(e)})||this;return i._handleMoved=new S(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(t){this.layout.orientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(t,e){void 0===e&&(e=!0),this.layout.setRelativeSizes(t,e)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){t.child.addClass("lm-SplitPanel-child"),t.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-SplitPanel-child"),t.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(t){this._pressData&&(t.preventDefault(),t.stopPropagation()),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=i.findFirstIndex(e.handles,(function(e){return e.contains(t.target)}));if(-1!==n){var o;t.preventDefault(),t.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=e.handles[n],s=r.getBoundingClientRect();o="horizontal"===e.orientation?t.clientX-s.left:t.clientY-s.top;var a=window.getComputedStyle(r),d=$.overrideCursor(a.cursor);this._pressData={index:n,delta:o,override:d}}}},e.prototype._evtMouseMove=function(t){var e;t.preventDefault(),t.stopPropagation();var i=this.layout,n=this.node.getBoundingClientRect();e="horizontal"===i.orientation?t.clientX-n.left-this._pressData.delta:t.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,e)},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.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))},e}(zt);!function(t){var e=function(){function t(){}return t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="lm-SplitPanel-handle",t.classList.add("p-SplitPanel-handle"),t},t}();t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return wt.getStretch(t)},t.setStretch=function(t,e){wt.setStretch(t,e)}}(Pt||(Pt={})),function(t){t.createLayout=function(t){return t.layout||new wt({renderer:t.renderer||Pt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(St||(St={}));var At,It=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,dt(dt({},e),{layout:At.createLayout(e)}))||this;return i._widgetSizesCache=new WeakMap,i.addClass("lm-AccordionPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(t){this.layout.titleSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(e){t.prototype.addWidget.call(this,e),e.title.changed.connect(this._onTitleChanged,this)},e.prototype.collapse=function(t){var e=this.layout.widgets[t];e&&!e.isHidden&&this._toggleExpansion(t)},e.prototype.expand=function(t){var e=this.layout.widgets[t];e&&e.isHidden&&this._toggleExpansion(t)},e.prototype.insertWidget=function(e,i){t.prototype.insertWidget.call(this,e,i),i.title.changed.connect(this._onTitleChanged,this)},e.prototype.handleEvent=function(e){switch(t.prototype.handleEvent.call(this,e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}},e.prototype.onBeforeAttach=function(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),t.prototype.onBeforeAttach.call(this,e)},e.prototype.onAfterDetach=function(e){t.prototype.onAfterDetach.call(this,e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},e.prototype._onTitleChanged=function(t){var e=i.findFirstIndex(this.widgets,(function(e){return e.contains(t.owner)}));e>=0&&(this.layout.updateTitle(e,t.owner),this.update())},e.prototype._computeWidgetSize=function(t){var e=this.layout,i=e.widgets[t];if(i){var n=i.isHidden,o=e.absoluteSizes(),r=(n?-1:1)*this.spacing,s=o.reduce((function(t,e){return t+e})),a=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n}(o);if(n){var d=this._widgetSizesCache.get(i);if(!d)return;a[t]+=d,-1===(c=a.map((function(t){return t-d>0})).lastIndexOf(!0))?a.forEach((function(e,i){i!==t&&(a[i]-=o[i]/s*(d-r))})):a[c]-=d-r}else{var c,h=o[t];if(this._widgetSizesCache.set(i,h),a[t]=0,-1===(c=a.map((function(t){return t>0})).lastIndexOf(!0)))return;a[c]=o[c]+h+r}return a.map((function(t){return t/(s+r)}))}},e.prototype._evtClick=function(t){var e=t.target;if(e){var n=i.findFirstIndex(this.titles,(function(t){return t.contains(e)}));n>=0&&(t.preventDefault(),t.stopPropagation(),this._toggleExpansion(n))}},e.prototype._eventKeyDown=function(t){if(!t.defaultPrevented){var e=t.target,n=!1;if(e){var o=i.findFirstIndex(this.titles,(function(t){return t.contains(e)}));if(o>=0){var r=t.keyCode.toString();if(t.key.match(/Space|Enter/)||r.match(/13|32/))e.click(),n=!0;else if("horizontal"===this.orientation?t.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):t.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){var s=t.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"===t.key||"35"===r?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==t.key&&"36"!==r||(this.titles[0].focus(),n=!0)}n&&t.preventDefault()}}},e.prototype._toggleExpansion=function(t){var e=this.titles[t],i=this.layout.widgets[t],n=this._computeWidgetSize(t);n&&this.setRelativeSizes(n,!1),i.isHidden?(e.classList.add("lm-mod-expanded"),e.setAttribute("aria-expanded","true"),i.show()):(e.classList.remove("lm-mod-expanded"),e.setAttribute("aria-expanded","false"),i.hide())},e}(Pt);!function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.titleClassName="lm-AccordionPanel-title",e._titleID=0,e._titleKeys=new WeakMap,e}return at(e,t),e.prototype.createCollapseIcon=function(t){return document.createElement("span")},e.prototype.createSectionTitle=function(t){var e=document.createElement("h3");for(var i in e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.id=this.createTitleKey(t),e.className=this.titleClassName,e.title=t.caption,t.dataset)e.dataset[i]=t.dataset[i];e.appendChild(this.createCollapseIcon(t)).className="lm-AccordionPanel-titleCollapser";var n=e.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=t.label,e},e.prototype.createTitleKey=function(t){var e=this._titleKeys.get(t);return void 0===e&&(e="title-key-"+this._titleID++,this._titleKeys.set(t,e)),e},e}(Pt.Renderer);t.Renderer=e,t.defaultRenderer=new e}(It||(It={})),function(t){t.createLayout=function(t){return t.layout||new Mt({renderer:t.renderer||It.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(At||(At={}));var Tt,Lt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._sizers=[],i._items=[],i._box=null,i._alignment="start",i._direction="top-to-bottom",void 0!==e.direction&&(i._direction=e.direction),void 0!==e.alignment&&(i._alignment=e.alignment),void 0!==e.spacing&&(i._spacing=_t.clampDimension(e.spacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=_t.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){i.insert(this._items,t,new gt(e)),i.insert(this._sizers,t,new ht),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),i.move(this._sizers,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t);i.removeAt(this._sizers,t),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,i=0,n=this._items.length;i<n;++i)t+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var o=Tt.isHorizontal(this._direction),r=o?this._fixed:0,s=o?0:this._fixed;for(i=0,n=this._items.length;i<n;++i){var a=this._items[i],d=this._sizers[i];a.isHidden?(d.minSize=0,d.maxSize=0):(a.fit(),d.sizeHint=e.getSizeBasis(a.widget),d.stretch=e.getStretch(a.widget),o?(d.minSize=a.minWidth,d.maxSize=a.maxWidth,r+=a.minWidth,s=Math.max(s,a.minHeight)):(d.minSize=a.minHeight,d.maxSize=a.maxHeight,s+=a.minHeight,r=Math.max(r,a.minWidth)))}var c=this._box=E.boxSizing(this.parent.node);r+=c.horizontalSum,s+=c.verticalSum;var h=this.parent.node.style;h.minWidth=r+"px",h.minHeight=s+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r,s=this._box.paddingTop,a=this._box.paddingLeft,d=t-this._box.horizontalSum,c=e-this._box.verticalSum;switch(this._direction){case"left-to-right":r=ct.calc(this._sizers,Math.max(0,d-this._fixed));break;case"top-to-bottom":r=ct.calc(this._sizers,Math.max(0,c-this._fixed));break;case"right-to-left":r=ct.calc(this._sizers,Math.max(0,d-this._fixed)),a+=d;break;case"bottom-to-top":r=ct.calc(this._sizers,Math.max(0,c-this._fixed)),s+=c;break;default:throw"unreachable"}var h=0,l=0;if(r>0)switch(this._alignment){case"start":break;case"center":h=0,l=r/2;break;case"end":h=0,l=r;break;case"justify":h=r/i,l=0;break;default:throw"unreachable"}for(n=0,o=this._items.length;n<o;++n){var u=this._items[n];if(!u.isHidden){var p=this._sizers[n].size;switch(this._direction){case"left-to-right":u.update(a+l,s,p+h,c),a+=p+h+this._spacing;break;case"top-to-bottom":u.update(a,s+l,d,p+h),s+=p+h+this._spacing;break;case"right-to-left":u.update(a-l-p-h,s,p+h,c),a-=p+h+this._spacing;break;case"bottom-to-top":u.update(a,s-l-p-h,d,p+h),s-=p+h+this._spacing;break;default:throw"unreachable"}}}}},e}(yt);!function(t){t.getStretch=function(t){return Tt.stretchProperty.get(t)},t.setStretch=function(t,e){Tt.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return Tt.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){Tt.sizeBasisProperty.set(t,e)}}(Lt||(Lt={})),function(t){function e(t){t.parent&&t.parent.layout instanceof Lt&&t.parent.fit()}t.stretchProperty=new J({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.sizeBasisProperty=new J({name:"sizeBasis",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(Tt||(Tt={}));var Et,Bt,kt,Dt,Ot=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:Et.createLayout(e)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(t){this.layout.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("lm-BoxPanel-child"),t.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-BoxPanel-child"),t.child.removeClass("p-BoxPanel-child")},e}(zt);!function(t){t.getStretch=function(t){return Lt.getStretch(t)},t.setStretch=function(t,e){Lt.setStretch(t,e)},t.getSizeBasis=function(t){return Lt.getSizeBasis(t)},t.setSizeBasis=function(t,e){Lt.setSizeBasis(t,e)}}(Ot||(Ot={})),function(t){t.createLayout=function(t){return t.layout||new Lt(t)}}(Et||(Et={})),t.CommandPalette=function(t){function e(i){var n=t.call(this,{node:Dt.createNode()})||this;return n._activeIndex=-1,n._items=[],n._results=null,n.addClass("lm-CommandPalette"),n.addClass("p-CommandPalette"),n.setFlag(pt.Flag.DisallowLayout),n.commands=i.commands,n.renderer=i.renderer||e.defaultRenderer,n.commands.commandChanged.connect(n._onGenericChange,n),n.commands.keyBindingChanged.connect(n._onGenericChange,n),n}return at(e,t),e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(t){var e=Dt.createItem(this.commands,t);return this._items.push(e),this.refresh(),e},e.prototype.addItems=function(t){var e=this,i=t.map((function(t){return Dt.createItem(e.commands,t)}));return i.forEach((function(t){return e._items.push(t)})),this.refresh(),i},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){i.removeAt(this._items,t)&&this.refresh()},e.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},e.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()},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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)},e.prototype.onActivateRequest=function(t){if(this.isAttached){var e=this.inputNode;e.focus(),e.select()}},e.prototype.onUpdateRequest=function(t){var e=this.inputNode.value,n=this.contentNode,o=this._results;if(o||(o=this._results=Dt.search(this._items,e),this._activeIndex=e?i.findFirstIndex(o,Dt.canActivate):-1),e||0!==o.length)if(e&&0===o.length){var r=this.renderer.renderEmptyMessage({query:e});et.render(r,n)}else{for(var s=this.renderer,a=this._activeIndex,d=new Array(o.length),c=0,h=o.length;c<h;++c){var l=o[c];if("header"===l.type){var u=l.indices,p=l.category;d[c]=s.renderHeader({category:p,indices:u})}else{var f=l.item,m=(u=l.indices,c===a);d[c]=s.renderItem({item:f,indices:u,active:m})}}if(et.render(d,n),a<0||a>=o.length)n.scrollTop=0;else{var g=n.children[a];E.scrollIntoViewIfNeeded(n,g)}}else et.render(null,n)},e.prototype._evtClick=function(t){if(0===t.button){if(t.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();var e=i.findFirstIndex(this.contentNode.children,(function(e){return e.contains(t.target)}));-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}},e.prototype._evtKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}},e.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<e-1?t+1:0,o=0===n?e-1:n-1;this._activeIndex=i.findFirstIndex(this._results,Dt.canActivate,n,o),this.update()}},e.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<=0?e-1:t-1,o=n===e-1?0:n+1;this._activeIndex=i.findLastIndex(this._results,Dt.canActivate,n,o),this.update()}},e.prototype._execute=function(t){if(this._results){var e=this._results[t];if(e){if("header"===e.type){var i=this.inputNode;return i.value=e.category.toLowerCase()+" ",i.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var t=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",t),this.toggleClass("p-mod-focused",t)},e.prototype._onGenericChange=function(){this.refresh()},e}(pt),Bt=t.CommandPalette||(t.CommandPalette={}),kt=function(){function e(){}return e.prototype.renderHeader=function(t){var e=this.formatHeader(t);return rt.li({className:"lm-CommandPalette-header p-CommandPalette-header"},e)},e.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t);return t.item.isToggleable?rt.li({className:e,dataset:i,role:"checkbox","aria-checked":""+t.item.isToggled},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t)):rt.li({className:e,dataset:i},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))},e.prototype.renderEmptyMessage=function(t){var e=this.formatEmptyMessage(t);return rt.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},e)},e.prototype.renderItemIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.item.icon?rt.div({className:e},t.item.iconLabel):rt.div({className:e},t.item.icon,t.item.iconLabel)},e.prototype.renderItemContent=function(t){return rt.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))},e.prototype.renderItemLabel=function(t){var e=this.formatItemLabel(t);return rt.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},e)},e.prototype.renderItemCaption=function(t){var e=this.formatItemCaption(t);return rt.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},e)},e.prototype.renderItemShortcut=function(t){var e=this.formatItemShortcut(t);return rt.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},e)},e.prototype.createItemClass=function(t){var e="lm-CommandPalette-item";e+=" p-CommandPalette-item",t.item.isEnabled||(e+=" lm-mod-disabled",e+=" p-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled",e+=" p-mod-toggled"),t.active&&(e+=" lm-mod-active",e+=" p-mod-active");var i=t.item.className;return i&&(e+=" "+i),e},e.prototype.createItemDataset=function(t){return dt(dt({},t.item.dataset),{command:t.item.command})},e.prototype.createIconClass=function(t){var e="lm-CommandPalette-itemIcon";e+=" p-CommandPalette-itemIcon";var i=t.item.iconClass;return i?e+" "+i:e},e.prototype.formatHeader=function(t){return t.indices&&0!==t.indices.length?y.highlight(t.category,t.indices,rt.mark):t.category},e.prototype.formatEmptyMessage=function(t){return"No commands found that match '"+t.query+"'"},e.prototype.formatItemShortcut=function(e){var i=e.item.keyBinding;return i?i.keys.map(t.CommandRegistry.formatKeystroke).join(", "):null},e.prototype.formatItemLabel=function(t){return t.indices&&0!==t.indices.length?y.highlight(t.item.label,t.indices,rt.mark):t.item.label},e.prototype.formatItemCaption=function(t){return t.item.caption},e}(),Bt.Renderer=kt,Bt.defaultRenderer=new kt,function(t){function e(t,e){for(var n=t.category.toLowerCase(),o=n+" "+t.label.toLowerCase(),r=1/0,s=null,a=/\b\w/g;;){var d=a.exec(o);if(!d)break;var c=y.matchSumOfDeltas(o,e,d.index);if(!c)break;c&&c.score<=r&&(r=c.score,s=c.indices)}if(!s||r===1/0)return null;for(var h=n.length+1,l=i.lowerBound(s,h,(function(t,e){return t-e})),u=s.slice(0,l),p=s.slice(l),f=0,m=p.length;f<m;++f)p[f]-=h;return 0===u.length?{matchType:0,categoryIndices:null,labelIndices:p,score:r,item:t}:0===p.length?{matchType:1,categoryIndices:u,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:u,labelIndices:p,score:r,item:t}}function n(t,e){var i=t.matchType-e.matchType;if(0!==i)return i;var n=t.score-e.score;if(0!==n)return n;var o=0,r=0;switch(t.matchType){case 0:o=t.labelIndices[0],r=e.labelIndices[0];break;case 1:case 2:o=t.categoryIndices[0],r=e.categoryIndices[0]}if(o!==r)return o-r;var s=t.item.category.localeCompare(e.item.category);if(0!==s)return s;var a=t.item.rank,d=e.item.rank;return a!==d?a<d?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),i=document.createElement("div"),n=document.createElement("input"),o=document.createElement("ul"),r=document.createElement("button");return e.className="lm-CommandPalette-search",i.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",r.className="lm-close-icon",o.className="lm-CommandPalette-content",e.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),e.appendChild(i),t.appendChild(e),t.appendChild(o),t},t.createItem=function(t,e){return new o(t,e)},t.search=function(t,o){var r=function(t,i){n=i,i=n.replace(/\s+/g,"").toLowerCase();var n;for(var o=[],r=0,s=t.length;r<s;++r){var a=t[r];if(a.isVisible)if(i){var d=e(a,i);d&&(a.isEnabled||(d.score+=1e3),o.push(d))}else o.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return o}(t,o);return r.sort(n),function(t){var e=new Array(t.length);i.fill(e,!1);for(var n=[],o=0,r=t.length;o<r;++o)if(!e[o]){var s=t[o],a=s.item,d=s.categoryIndices,c=a.category;n.push({type:"header",category:c,indices:d});for(var h=o;h<r;++h)if(!e[h]){var l=t[h],u=l.item,p=l.labelIndices;u.category===c&&(n.push({type:"item",item:u,indices:p}),e[h]=!0)}}return n}(r)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};var o=function(){function t(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||b.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}return Object.defineProperty(t.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){var t=this.command,e=this.args;return i.findLastValue(this._commands.keyBindings,(function(i){return i.command===t&&b.deepEqual(i.args,e)}))||null},enumerable:!0,configurable:!0}),t}()}(Dt||(Dt={}));var Rt,Nt=function(t){function e(i){var n=t.call(this,{node:Rt.createNode()})||this;return n._childIndex=-1,n._activeIndex=-1,n._openTimerID=0,n._closeTimerID=0,n._items=[],n._childMenu=null,n._parentMenu=null,n._aboutToClose=new S(n),n._menuRequested=new S(n),n.addClass("lm-Menu"),n.addClass("p-Menu"),n.setFlag(pt.Flag.DisallowLayout),n.commands=i.commands,n.renderer=i.renderer||e.defaultRenderer,n}return at(e,t),e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var t=this;t._parentMenu;)t=t._parentMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var t=this;t._childMenu;)t=t._childMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._items.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||Rt.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var t=this._items.length,e=this._activeIndex,n=e<t-1?e+1:0,o=0===n?t-1:n-1;this.activeIndex=i.findFirstIndex(this._items,Rt.canActivate,n,o)},e.prototype.activatePreviousItem=function(){var t=this._items.length,e=this._activeIndex,n=e<=0?t-1:e-1,o=n===t-1?0:n+1;this.activeIndex=i.findLastIndex(this._items,Rt.canActivate,n,o)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var t=this.activeItem;if(t)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==t.type){this.rootMenu.close();var e=t.command,i=t.args;this.commands.isEnabled(e,i)?this.commands.execute(e,i):console.log("Command '"+e+"' is disabled.")}else this._openChildMenu(!0)}},e.prototype.addItem=function(t){return this.insertItem(this._items.length,t)},e.prototype.insertItem=function(t,e){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(t,this._items.length)),o=Rt.createItem(this,e);return i.insert(this._items,n,o),this.update(),o},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){this.isAttached&&this.close(),this.activeIndex=-1,i.removeAt(this._items,t)&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},e.prototype.open=function(t,e,i){if(void 0===i&&(i={}),!this.isAttached){var n=i.forceX||!1,o=i.forceY||!1;Rt.openRootMenu(this,t,e,n,o),this.activate()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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)},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this,i=this._items,n=this.renderer,o=this._activeIndex,r=Rt.computeCollapsed(i),s=new Array(i.length),a=function(t,a){var d=i[t],c=t===o,h=r[t];s[t]=n.renderItem({item:d,active:c,collapsed:h,onfocus:function(){e.activeIndex=t}})},d=0,c=i.length;d<c;++d)a(d);et.render(s,this.contentNode)},e.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var i=this._childMenu;i&&(this._childIndex=-1,this._childMenu=null,i._parentMenu=null,i.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,e)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e)if(27!==e)if(37!==e)if(38!==e)if(39!==e)if(40!==e){var i=R().keyForKeydownEvent(t);if(i){var n=this._activeIndex+1,o=Rt.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()},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(t){var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(e!==this._activeIndex){if(this.activeIndex=e,(e=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}},e.prototype._evtMouseEnter=function(t){for(var e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex},e.prototype._evtMouseLeave=function(t){if(this._cancelOpenTimer(),this._childMenu){var e=t.clientX,i=t.clientY;E.hitTest(this._childMenu.node,e,i)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},e.prototype._evtMouseDown=function(t){this._parentMenu||(Rt.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())},e.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var e=this.activeItem;if(e&&"submenu"===e.type&&e.submenu){var i=e.submenu;if(i!==this._childMenu){this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,Y.sendMessage(this,pt.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex];Rt.openSubmenu(i,n),t&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var t=this;0===this._openTimerID&&(this._openTimerID=window.setTimeout((function(){t._openTimerID=0,t._openChildMenu()}),Rt.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var t=this;0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((function(){t._closeTimerID=0,t._closeChildMenu()}),Rt.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(pt);!function(e){var i=function(){function e(){}return e.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return rt.li(dt({className:e,dataset:i,tabindex:"0",onfocus:t.onfocus},n),this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))},e.prototype.renderIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.item.icon?rt.div({className:e},t.item.iconLabel):rt.div({className:e},t.item.icon,t.item.iconLabel)},e.prototype.renderLabel=function(t){var e=this.formatLabel(t);return rt.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},e)},e.prototype.renderShortcut=function(t){var e=this.formatShortcut(t);return rt.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},e)},e.prototype.renderSubmenu=function(t){return rt.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},e.prototype.createItemClass=function(t){var e="lm-Menu-item";e+=" p-Menu-item",t.item.isEnabled||(e+=" lm-mod-disabled",e+=" p-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled",e+=" p-mod-toggled"),t.item.isVisible||(e+=" lm-mod-hidden",e+=" p-mod-hidden"),t.active&&(e+=" lm-mod-active",e+=" p-mod-active"),t.collapsed&&(e+=" lm-mod-collapsed",e+=" p-mod-collapsed");var i=t.item.className;return i&&(e+=" "+i),e},e.prototype.createItemDataset=function(t){var e=t.item,i=e.type,n=e.command,o=e.dataset;return dt(dt({},o),"command"===i?{type:i,command:n}:{type:i})},e.prototype.createIconClass=function(t){var e="lm-Menu-itemIcon";e+=" p-Menu-itemIcon";var i=t.item.iconClass;return i?e+" "+i:e},e.prototype.createItemARIA=function(t){var e={};switch(t.item.type){case"separator":e.role="presentation";break;case"submenu":e["aria-haspopup"]="true",t.item.isEnabled||(e["aria-disabled"]="true");break;default:t.item.isEnabled||(e["aria-disabled"]="true"),e.role="menuitem"}return e},e.prototype.formatLabel=function(t){var e=t.item,i=e.label,n=e.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,rt.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},s),r]},e.prototype.formatShortcut=function(e){var i=e.item.keyBinding;return i?i.keys.map(t.CommandRegistry.formatKeystroke).join(", "):null},e}();e.Renderer=i,e.defaultRenderer=new i}(Nt||(Nt={})),function(t){function e(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-Menu-content",e.classList.add("p-Menu-content"),t.appendChild(e),e.setAttribute("role","menu"),t.tabIndex=0,t},t.canActivate=e,t.createItem=function(t,e){return new n(t.commands,e)},t.hitTestMenus=function(t,e,i){for(var n=t;n;n=n.childMenu)if(E.hitTest(n.node,e,i))return!0;return!1},t.computeCollapsed=function(t){var e=new Array(t.length);i.fill(e,!1);for(var n=0,o=t.length;n<o;++n){if((a=t[n]).isVisible){if("separator"!==a.type)break;e[n]=!0}}for(var r=o-1;r>=0;--r){if((a=t[r]).isVisible){if("separator"!==a.type)break;e[r]=!0}}for(var s=!1;++n<r;){var a;(a=t[n]).isVisible&&("separator"!==a.type?s=!1:s?e[n]=!0:s=!0)}return e},t.openRootMenu=function(t,e,i,n,o){Y.sendMessage(t,pt.Msg.UpdateRequest);var r=window.pageXOffset,s=window.pageYOffset,a=document.documentElement.clientWidth,d=document.documentElement.clientHeight,c=d-(o?i:0),h=t.node,l=h.style;l.top="",l.left="",l.width="",l.height="",l.visibility="hidden",l.maxHeight=c+"px",pt.attach(t,document.body);var u=h.getBoundingClientRect(),p=u.width,f=u.height;!n&&e+p>r+a&&(e=r+a-p),!o&&i+f>s+d&&(i>s+d?i=s+d-f:i-=f),l.top=Math.max(0,i)+"px",l.left=Math.max(0,e)+"px",l.visibility=""},t.openSubmenu=function(e,i){Y.sendMessage(e,pt.Msg.UpdateRequest);var n=window.pageXOffset,o=window.pageYOffset,r=document.documentElement.clientWidth,s=document.documentElement.clientHeight,a=s,d=e.node,c=d.style;c.top="",c.left="",c.width="",c.height="",c.visibility="hidden",c.maxHeight=a+"px",pt.attach(e,document.body);var h=d.getBoundingClientRect(),l=h.width,u=h.height,p=E.boxSizing(e.node),f=i.getBoundingClientRect(),m=f.right-t.SUBMENU_OVERLAP;m+l>n+r&&(m=f.left+t.SUBMENU_OVERLAP-l);var g=f.top-p.borderTop-p.paddingTop;g+u>o+s&&(g=f.bottom+p.borderBottom+p.paddingBottom-u),c.top=Math.max(0,g)+"px",c.left=Math.max(0,m)+"px",c.visibility=""},t.findMnemonic=function(t,i,n){for(var o=-1,r=-1,s=!1,a=i.toUpperCase(),d=0,c=t.length;d<c;++d){var h=(d+n)%c,l=t[h];if(e(l)){var u=l.label;if(0!==u.length){var p=l.mnemonic;p>=0&&p<u.length?u[p].toUpperCase()===a&&(-1===o?o=h:s=!0):-1===r&&u[0].toUpperCase()===a&&(r=h)}}}return{index:o,multiple:s,auto:r}};var n=function(){function t(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||b.emptyObject,this.submenu=e.submenu||null}return Object.defineProperty(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.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(t.prototype,"keyBinding",{get:function(){if("command"===this.type){var t=this.command,e=this.args;return i.findLastValue(this._commands.keyBindings,(function(i){return i.command===t&&b.deepEqual(i.args,e)}))||null}return null},enumerable:!0,configurable:!0}),t}()}(Rt||(Rt={}));var jt,Wt=function(){function t(t){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var e=t.groupByTarget,i=t.sortBySelector,n=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}(t,["groupByTarget","sortBySelector"]);this.menu=new Nt(n),this._groupByTarget=!1!==e,this._sortBySelector=!1!==i}return t.prototype.addItem=function(t){var e=this,n=jt.createItem(t,this._idTick++);return this._items.push(n),new I((function(){i.removeFirstOf(e._items,n)}))},t.prototype.open=function(t){var e=this;if(this.menu.clearItems(),0===this._items.length)return!1;var i=jt.matchItems(this._items,t,this._groupByTarget,this._sortBySelector);return!(!i||0===i.length)&&(o(i,(function(t){e.menu.addItem(t)})),this.menu.open(t.clientX,t.clientY),!0)},t}();!function(t){function e(t,e){var i=t.rank,n=e.rank;return i!==n?i<n?-1:1:t.id-e.id}function i(t,i){var n=k.calculateSpecificity(t.selector),o=k.calculateSpecificity(i.selector);return n!==o?o-n:e(t,i)}t.createItem=function(t,e){var i=function(t){if(-1!==t.indexOf(","))throw new Error("Selector cannot contain commas: "+t);if(!k.isValid(t))throw new Error("Invalid selector: "+t);return t}(t.selector),n=void 0!==t.rank?t.rank:1/0;return dt(dt({},t),{selector:i,rank:n,id:e})},t.matchItems=function(t,n,o,r){var s=n.target;if(!s)return null;var a=n.currentTarget;if(!a)return null;if(!(a.contains(s)||(s=document.elementFromPoint(n.clientX,n.clientY))&&a.contains(s)))return null;for(var d=[],c=t.slice();null!==s;){for(var h=[],l=0,u=c.length;l<u;++l){var p=c[l];p&&(k.matches(s,p.selector)&&(h.push(p),c[l]=null))}if(0!==h.length&&(o&&h.sort(r?i:e),d.push.apply(d,h)),s===a)break;s=s.parentElement}return o||d.sort(r?i:e),d}}(jt||(jt={}));var Ht,Ft=function(t){function e(i){void 0===i&&(i={});var n=t.call(this,{node:Ht.createNode()})||this;return n._currentIndex=-1,n._titles=[],n._titlesEditable=!1,n._previousTitle=null,n._dragData=null,n._addButtonEnabled=!1,n._tabMoved=new S(n),n._currentChanged=new S(n),n._addRequested=new S(n),n._tabCloseRequested=new S(n),n._tabDetachRequested=new S(n),n._tabActivateRequested=new S(n),n.addClass("lm-TabBar"),n.addClass("p-TabBar"),n.contentNode.setAttribute("role","tablist"),n.setFlag(pt.Flag.DisallowLayout),n._document=i.document||document,n.tabsMovable=i.tabsMovable||!1,n.titlesEditable=i.titlesEditable||!1,n.allowDeselect=i.allowDeselect||!1,n.addButtonEnabled=i.addButtonEnabled||!1,n.insertBehavior=i.insertBehavior||"select-tab-if-needed",n.name=i.name||"",n.orientation=i.orientation||"horizontal",n.removeBehavior=i.removeBehavior||"select-tab-after",n.renderer=i.renderer||e.defaultRenderer,n}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(t){this._titlesEditable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(t){this.currentIndex=t?this._titles.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex!==t){var e=this._currentIndex,i=this._titles[e]||null,n=t,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:i,currentIndex:n,currentTitle:o})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t,t?this.contentNode.setAttribute("aria-label",t):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.contentNode.setAttribute("aria-orientation",t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(t){this._addButtonEnabled!==t&&(this._addButtonEnabled=t,t?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(t){return this.insertTab(this._titles.length,t)},e.prototype.insertTab=function(t,e){this._releaseMouse();var n=Ht.asTitle(e),o=this._titles.indexOf(n),r=Math.max(0,Math.min(t,this._titles.length));return-1===o?(i.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||(i.move(this._titles,o,r),this.update(),this._adjustCurrentForMove(o,r)),n)},e.prototype.removeTab=function(t){this.removeTabAt(this._titles.indexOf(t))},e.prototype.removeTabAt=function(t){this._releaseMouse();var e=i.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))},e.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var t=0,e=this._titles;t<e.length;t++){e[t].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})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"dblclick":this._evtDblClick(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){for(var e=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(e.length),r=0,s=e.length;r<s;++r){var a=e[r],d=a===n,c=d?s:s-r-1;o[r]=i.renderTab({title:a,current:d,zIndex:c})}et.render(o,this.contentNode)},e.prototype._evtDblClick=function(t){if(this.titlesEditable){var e=this.contentNode.children,n=i.findFirstIndex(e,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(-1!==n){var o=this.titles[n],r=e[n].querySelector(".lm-TabBar-tabLabel");if(r&&r.contains(t.target)){var s=o.label||"",a=r.innerHTML;r.innerHTML="";var d=document.createElement("input");d.classList.add("lm-TabBar-tabInput"),d.value=s,r.appendChild(d);var c=function(){d.removeEventListener("blur",c),r.innerHTML=a};d.addEventListener("dblclick",(function(t){return t.stopPropagation()})),d.addEventListener("blur",c),d.addEventListener("keydown",(function(t){"Enter"===t.key?(""!==d.value&&(o.label=o.caption=d.value),c()):"Escape"===t.key&&c()})),d.select(),d.focus(),r.children.length>0&&r.children[0].focus()}}}},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if((0===t.button||1===t.button)&&!this._dragData){var e=this.addButtonEnabled&&this.addButtonNode.contains(t.target),n=this.contentNode.children,o=i.findFirstIndex(n,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if((-1!==o||e)&&(t.preventDefault(),t.stopPropagation(),this._dragData={tab:n[o],index:o,pressX:t.clientX,pressY:t.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!==t.button&&!e)){var r=n[o].querySelector(this.renderer.closeIconSelector);r&&r.contains(t.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===o?this.currentIndex=-1:this.currentIndex=o,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(t){var e=this._dragData;if(e){t.preventDefault(),t.stopPropagation();var i=this.contentNode.children;if(e.dragActive||Ht.dragExceeded(e,t)){if(!e.dragActive){var n=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=n.width,e.tabPressPos=e.pressX-n.left):(e.tabPos=e.tab.offsetTop,e.tabSize=n.height,e.tabPressPos=e.pressY-n.top),e.tabLayout=Ht.snapTabLayout(i,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=$.overrideCursor("default"),e.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),e.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&Ht.detachExceeded(e,t)){e.detachRequested=!0;var o=e.index,r=t.clientX,s=t.clientY,a=i[o],d=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:d,tab:a,clientX:r,clientY:s}),e.dragAborted)return}Ht.layoutTabs(i,e,t,this._orientation)}}},e.prototype._evtMouseUp=function(t){var e=this;if(0===t.button||1===t.button){var n=this._dragData;if(n){if(t.preventDefault(),t.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),!n.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(t.target))return void this._addRequested.emit(void 0);var o=this.contentNode.children,r=i.findFirstIndex(o,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(r!==n.index)return;var s=this._titles[r];if(!s.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:r,title:s});var a=o[r].querySelector(this.renderer.closeIconSelector);return a&&a.contains(t.target)?void this._tabCloseRequested.emit({index:r,title:s}):void 0}if(0===t.button){Ht.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("lm-mod-dragging"),n.tab.classList.remove("p-mod-dragging");var d=Ht.parseTransitionDuration(n.tab);setTimeout((function(){if(!n.dragAborted){e._dragData=null,Ht.resetTabPositions(e.contentNode.children,e._orientation),n.override.dispose(),e.removeClass("lm-mod-dragging"),e.removeClass("p-mod-dragging");var t=n.index,o=n.targetIndex;-1!==o&&t!==o&&(i.move(e._titles,t,o),e._adjustCurrentForMove(t,o),e._tabMoved.emit({fromIndex:t,toIndex:o,title:e._titles[o]}),Y.sendMessage(e,pt.Msg.UpdateRequest))}}),d)}}}},e.prototype._releaseMouse=function(){var t=this._dragData;t&&(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),t.dragAborted=!0,t.dragActive&&(Ht.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),t.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(t,e){var i=this.currentTitle,n=this._currentIndex,o=this.insertBehavior;if("select-tab"===o||"select-tab-if-needed"===o&&-1===n)return this._currentIndex=t,this._previousTitle=i,void this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:t,currentTitle:e});n>=t&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(t,e){var i=this._currentIndex,n=this.removeBehavior;if(i===t){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null});if("select-tab-after"===n)return this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===n)return this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,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(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}else i>t&&this._currentIndex--},e.prototype._onTitleChanged=function(t){this.update()},e}(pt);!function(t){var e=function(){function t(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return t.prototype.renderTab=function(t){var e=t.title.caption,i=this.createTabKey(t),n=i,o=this.createTabStyle(t),r=this.createTabClass(t),s=this.createTabDataset(t),a=this.createTabARIA(t);return t.title.closable?rt.li(dt({id:n,key:i,className:r,title:e,style:o,dataset:s},a),this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t)):rt.li(dt({id:n,key:i,className:r,title:e,style:o,dataset:s},a),this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=t.title,i=this.createIconClass(t);return"string"==typeof e.icon?rt.div({className:i},e.iconLabel):rt.div({className:i},e.icon,e.iconLabel)},t.prototype.renderLabel=function(t){return rt.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},t.title.label)},t.prototype.renderCloseIcon=function(t){return rt.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},t.prototype.createTabKey=function(t){var e=this._tabKeys.get(t.title);return void 0===e&&(e="tab-key-"+this._tabID++,this._tabKeys.set(t.title,e)),e},t.prototype.createTabStyle=function(t){return{zIndex:""+t.zIndex}},t.prototype.createTabClass=function(t){var e="lm-TabBar-tab";return e+=" p-TabBar-tab",t.title.className&&(e+=" "+t.title.className),t.title.closable&&(e+=" lm-mod-closable",e+=" p-mod-closable"),t.current&&(e+=" lm-mod-current",e+=" p-mod-current"),e},t.prototype.createTabDataset=function(t){return t.title.dataset},t.prototype.createTabARIA=function(t){return{role:"tab","aria-selected":t.current.toString()}},t.prototype.createIconClass=function(t){var e="lm-TabBar-tabIcon";e+=" p-TabBar-tabIcon";var i=t.title.iconClass;return i?e+" "+i:e},t}();t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"}(Ft||(Ft={})),function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");e.setAttribute("role","tablist"),e.className="lm-TabBar-content",e.classList.add("p-TabBar-content"),t.appendChild(e);var i=document.createElement("div");return i.className="lm-TabBar-addButton lm-mod-hidden",t.appendChild(i),t},t.asTitle=function(t){return t instanceof ut?t:new ut(t)},t.parseTransitionDuration=function(t){var e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){for(var i=new Array(t.length),n=0,o=t.length;n<o;++n){var r=t[n],s=window.getComputedStyle(r);i[n]="horizontal"===e?{pos:r.offsetLeft,size:r.offsetWidth,margin:parseFloat(s.marginLeft)||0}:{pos:r.offsetTop,size:r.offsetHeight,margin:parseFloat(s.marginTop)||0}}return i},t.dragExceeded=function(e,i){var n=Math.abs(i.clientX-e.pressX),o=Math.abs(i.clientY-e.pressY);return n>=t.DRAG_THRESHOLD||o>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,i){var n=e.contentRect;return i.clientX<n.left-t.DETACH_THRESHOLD||i.clientX>=n.right+t.DETACH_THRESHOLD||i.clientY<n.top-t.DETACH_THRESHOLD||i.clientY>=n.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,i,n){var o,r,s,a;"horizontal"===n?(o=e.pressX,r=i.clientX-e.contentRect.left,s=i.clientX,a=e.contentRect.width):(o=e.pressY,r=i.clientY-e.contentRect.top,s=i.clientY,a=e.contentRect.height);for(var d=e.index,c=r-e.tabPressPos,h=c+e.tabSize,l=0,u=t.length;l<u;++l){var p=void 0,f=e.tabLayout[l],m=f.pos+(f.size>>1);if(l<e.index&&c<m)p=e.tabSize+e.tabLayout[l+1].margin+"px",d=Math.min(d,l);else if(l>e.index&&h>m)p=-e.tabSize-f.margin+"px",d=Math.max(d,l);else if(l===e.index){var g=s-o,v=a-(e.tabPos+e.tabSize);p=Math.max(-e.tabPos,Math.min(g,v))+"px"}else p="";"horizontal"===n?t[l].style.left=p:t[l].style.top=p}e.targetIndex=d},t.finalizeTabPosition=function(t,e){var i,n;if(i="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)n=0;else if(t.targetIndex>t.index){n=(o=t.tabLayout[t.targetIndex]).pos+o.size-t.tabSize-t.tabPos}else{var o;n=(o=t.tabLayout[t.targetIndex]).pos-t.tabPos}var r=i-(t.tabPos+t.tabSize),s=Math.max(-t.tabPos,Math.min(n,r));"horizontal"===e?t.tab.style.left=s+"px":t.tab.style.top=s+"px"},t.resetTabPositions=function(t,e){o(t,(function(t){"horizontal"===e?t.style.left="":t.style.top=""}))}}(Ht||(Ht={}));var qt,Kt=function(t){function e(e){var i=t.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=e.renderer,void 0!==e.spacing&&(i._spacing=_t.clampDimension(e.spacing)),i._document=e.document||document,i._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:pt.HiddenMode.Display,i}return at(e,t),e.prototype.dispose=function(){var e=this.iter();this._items.forEach((function(t){t.dispose()})),this._box=null,this._root=null,this._items.clear(),o(e,(function(t){t.dispose()})),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){var e=this;this._hiddenMode!==t&&(this._hiddenMode=t,o(this.tabBars(),(function(t){t.titles.length>1&&t.titles.forEach((function(t){t.owner.hiddenMode=e._hiddenMode}))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=_t.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():d()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():d()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():d()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():d()},e.prototype.handles=function(){return this._root?this._root.iterHandles():d()},e.prototype.moveHandle=function(t,e,i){var n=t.classList.contains("lm-mod-hidden");if(n=n||t.classList.contains("p-mod-hidden"),this._root&&!n){var o,r=this._root.findSplitNode(t);if(r)0!==(o="horizontal"===r.node.orientation?e-t.offsetLeft:i-t.offsetTop)&&(r.node.holdSizes(),ct.adjust(r.node.sizers,r.index,o),this.parent&&this.parent.update())}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(t){var e,i=this,n=new Set;e=t.main?qt.normalizeAreaConfig(t.main,n):null;var r=this.widgets(),s=this.tabBars(),a=this.handles();this._root=null,o(r,(function(t){n.has(t)||(t.parent=null)})),o(s,(function(t){t.dispose()})),o(a,(function(t){t.parentNode&&t.parentNode.removeChild(t)})),n.forEach((function(t){t.parent=i.parent})),this._root=e?qt.realizeAreaConfig(e,{createTabBar:function(t){return i._createTabBar()},createHandle:function(){return i._createHandle()}},this._document):null,this.parent&&(n.forEach((function(t){i.attachWidget(t)})),this.parent.fit())},e.prototype.addWidget=function(t,e){void 0===e&&(e={});var i=e.ref||null,n=e.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(t.parent=this.parent,n){case"tab-after":this._insertTab(t,i,o,!0);break;case"tab-before":this._insertTab(t,i,o,!1);break;case"split-top":this._insertSplit(t,i,o,"vertical",!1);break;case"split-left":this._insertSplit(t,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(t,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,i,o,"vertical",!0)}this.parent&&(this.attachWidget(t),this.parent.fit())},e.prototype.removeWidget=function(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())},e.prototype.hitTestTabAreas=function(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=E.boxSizing(this.parent.node));var i=this.parent.node.getBoundingClientRect(),n=t-i.left-this._box.borderLeft,o=e-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,o);if(!r)return null;var s=r.tabBar,a=r.top,d=r.left,c=r.width,h=r.height,l=this._box.borderLeft+this._box.borderRight,u=this._box.borderTop+this._box.borderBottom;return{tabBar:s,x:n,y:o,top:a,left:d,right:i.width-l-(d+c),bottom:i.height-u-(a+h),width:c,height:h}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)})),o(this.handles(),(function(t){e.parent.node.appendChild(t)})),this.parent.fit()},e.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new gt(t)),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach))},e.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach);var e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(t){if(this._root){var e=this._root.findTabNode(t);if(e)if(qt.removeAria(t),e.tabBar.titles.length>1)e.tabBar.removeTab(t.title),this._hiddenMode===pt.HiddenMode.Scale&&1==e.tabBar.titles.length&&(e.tabBar.titles[0].owner.hiddenMode=pt.HiddenMode.Display);else if(e.tabBar.dispose(),this._root!==e){this._root.holdAllSizes();var n=e.parent;e.parent=null;var o=i.removeFirstOf(n.children,e),r=i.removeAt(n.handles,o);if(i.removeAt(n.sizers,o),r.parentNode&&r.parentNode.removeChild(r),n.children.length>1)n.syncHandles();else{var s=n.parent;n.parent=null;var a=n.children[0],d=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,d.parentNode&&d.parentNode.removeChild(d),this._root===n)return a.parent=null,void(this._root=a);var c=s,h=c.children.indexOf(n);if(a instanceof qt.TabLayoutNode)return a.parent=c,void(c.children[h]=a);var l=i.removeAt(c.handles,h);i.removeAt(c.children,h),i.removeAt(c.sizers,h),l.parentNode&&l.parentNode.removeChild(l);for(var u=0,p=a.children.length;u<p;++u){var f=a.children[u],m=a.handles[u],g=a.sizers[u];i.insert(c.children,h+u,f),i.insert(c.handles,h+u,m),i.insert(c.sizers,h+u,g),f.parent=c}a.children.length=0,a.handles.length=0,a.sizers.length=0,a.parent=null,c.syncHandles()}}else this._root=null}},e.prototype._insertTab=function(t,e,i,n){if(t!==e){if(!this._root){var o=new qt.TabLayoutNode(this._createTabBar());return o.tabBar.addTab(t.title),this._root=o,void qt.addAria(t,o.tabBar)}var r;if(i||(i=this._root.findFirstTabNode()),-1===i.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),r=e?i.tabBar.titles.indexOf(e.title):i.tabBar.currentIndex,this._hiddenMode===pt.HiddenMode.Scale&&i.tabBar.titles.length>0){if(1==i.tabBar.titles.length)i.tabBar.titles[0].owner.hiddenMode=pt.HiddenMode.Scale;t.hiddenMode=pt.HiddenMode.Scale}else t.hiddenMode=pt.HiddenMode.Display;i.tabBar.insertTab(r+(n?1:0),t.title),qt.addAria(t,i.tabBar)}},e.prototype._insertSplit=function(t,e,n,o,r){if(t!==e||!n||1!==n.tabBar.titles.length){this._removeWidget(t);var s=new qt.TabLayoutNode(this._createTabBar());if(s.tabBar.addTab(t.title),qt.addAria(t,s.tabBar),this._root){if(!n||!n.parent){var a=this._splitRoot(o),d=r?a.children.length:0;a.normalizeSizes();var c=qt.createSizer(n?1:qt.GOLDEN_RATIO);return i.insert(a.children,d,s),i.insert(a.sizers,d,c),i.insert(a.handles,d,this._createHandle()),s.parent=a,a.normalizeSizes(),void a.syncHandles()}var h=n.parent;if(h.orientation===o){var l=h.children.indexOf(n);h.normalizeSizes();var u=h.sizers[l].sizeHint/=2,p=l+(r?1:0);return i.insert(h.children,p,s),i.insert(h.sizers,p,qt.createSizer(u)),i.insert(h.handles,p,this._createHandle()),s.parent=h,void h.syncHandles()}var f=i.removeFirstOf(h.children,n),m=new qt.SplitLayoutNode(o);m.normalized=!0,m.children.push(n),m.sizers.push(qt.createSizer(.5)),m.handles.push(this._createHandle()),n.parent=m;var g=r?1:0;i.insert(m.children,g,s),i.insert(m.sizers,g,qt.createSizer(.5)),i.insert(m.handles,g,this._createHandle()),s.parent=m,m.syncHandles(),i.insert(h.children,f,m),m.parent=h}else this._root=s}},e.prototype._splitRoot=function(t){var e=this._root;if(e instanceof qt.SplitLayoutNode&&e.orientation===t)return e;var i=this._root=new qt.SplitLayoutNode(t);return e&&(i.children.push(e),i.sizers.push(qt.createSizer(0)),i.handles.push(this._createHandle()),e.parent=i),i},e.prototype._fit=function(){var t=0,e=0;if(this._root){var i=this._root.fit(this._spacing,this._items);t=i.minWidth,e=i.minHeight}var n=this._box=E.boxSizing(this.parent.node);t+=n.horizontalSum,e+=n.verticalSum;var o=this.parent.node.style;o.minWidth=t+"px",o.minHeight=e+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){if(this._dirty=!1,this._root){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var i=this._box.paddingTop,n=this._box.paddingLeft,o=t-this._box.horizontalSum,r=e-this._box.verticalSum;this._root.update(i,n,o,r,this._spacing,this._items)}},e.prototype._createTabBar=function(){var t=this.renderer.createTabBar(this._document);return t.orientation="horizontal",this.parent&&(t.parent=this.parent,this.attachWidget(t)),t},e.prototype._createHandle=function(){var t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t},e}(ft);!function(t){function e(t){var e=new ht;return e.sizeHint=t,e.size=t,e}function i(t,e){var n;return n="tab-area"===t.type?function(t,e){if(0===t.widgets.length)return null;var i=[];if(o(t.widgets,(function(t){e.has(t)||(e.add(t),i.push(t))})),0===i.length)return null;var n=t.currentIndex;-1!==n&&(n<0||n>=i.length)&&(n=0);return{type:"tab-area",widgets:i,currentIndex:n}}(t,e):function(t,e){for(var n=t.orientation,o=[],r=[],s=0,a=t.children.length;s<a;++s){var d=i(t.children[s],e);d&&("tab-area"===d.type||d.orientation!==n?(o.push(d),r.push(Math.abs(t.sizes[s]||0))):(o.push.apply(o,d.children),r.push.apply(r,d.sizes)))}if(0===o.length)return null;if(1===o.length)return o[0];return{type:"split-area",orientation:n,children:o,sizes:r}}(t,e),n}function n(i,s,a){var d;return d="tab-area"===i.type?function(e,i,n){var s=i.createTabBar(n);return o(e.widgets,(function(e){e.hide(),s.addTab(e.title),t.addAria(e,s)})),s.currentIndex=e.currentIndex,new r(s)}(i,s,a):function(t,i,r){var s=new c(t.orientation);return o(t.children,(function(o,a){var d=n(o,i,r),c=e(t.sizes[a]),h=i.createHandle();s.children.push(d),s.handles.push(h),s.sizers.push(c),d.parent=s})),s.syncHandles(),s.normalizeSizes(),s}(i,s,a),d}t.GOLDEN_RATIO=.618,t.createSizer=e,t.normalizeAreaConfig=i,t.realizeAreaConfig=n;var r=function(){function t(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var e=new ht,i=new ht;e.stretch=0,i.stretch=1,this.tabBar=t,this.sizers=[e,i]}return Object.defineProperty(t.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.iterAllWidgets=function(){return s(g(this.tabBar),this.iterUserWidgets())},t.prototype.iterUserWidgets=function(){return u(this.tabBar.titles,(function(t){return t.owner}))},t.prototype.iterSelectedWidgets=function(){var t=this.tabBar.currentTitle;return t?g(t.owner):d()},t.prototype.iterTabBars=function(){return g(this.tabBar)},t.prototype.iterHandles=function(){return d()},t.prototype.findTabNode=function(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null},t.prototype.findSplitNode=function(t){return null},t.prototype.findFirstTabNode=function(){return this},t.prototype.hitTestTabNodes=function(t,e){return t<this._left||t>=this._left+this._width||e<this._top||e>=this._top+this._height?null:this},t.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map((function(t){return t.owner})),currentIndex:this.tabBar.currentIndex}},t.prototype.holdAllSizes=function(){},t.prototype.fit=function(t,e){var i=0,n=0,o=e.get(this.tabBar),r=this.tabBar.currentTitle,s=r?e.get(r.owner):void 0,a=this.sizers,d=a[0],c=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,c.minSize=s.minHeight,c.maxSize=1/0):(c.minSize=0,c.maxSize=1/0),{minWidth:i,minHeight:n,maxWidth:Infinity,maxHeight:Infinity}},t.prototype.update=function(t,e,i,n,o,r){this._top=e,this._left=t,this._width=i,this._height=n;var s=r.get(this.tabBar),a=this.tabBar.currentTitle,d=a?r.get(a.owner):void 0;if(ct.calc(this.sizers,n),s&&!s.isHidden){var c=this.sizers[0].size;s.update(t,e,i,c),e+=c}if(d&&!d.isHidden){c=this.sizers[1].size;d.update(t,e,i,c)}},t}();t.TabLayoutNode=r;var c=function(){function t(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}return t.prototype.iterAllWidgets=function(){var t=u(this.children,(function(t){return t.iterAllWidgets()}));return new a(t)},t.prototype.iterUserWidgets=function(){var t=u(this.children,(function(t){return t.iterUserWidgets()}));return new a(t)},t.prototype.iterSelectedWidgets=function(){var t=u(this.children,(function(t){return t.iterSelectedWidgets()}));return new a(t)},t.prototype.iterTabBars=function(){var t=u(this.children,(function(t){return t.iterTabBars()}));return new a(t)},t.prototype.iterHandles=function(){var t=u(this.children,(function(t){return t.iterHandles()}));return s(this.handles,new a(t))},t.prototype.findTabNode=function(t){for(var e=0,i=this.children.length;e<i;++e){var n=this.children[e].findTabNode(t);if(n)return n}return null},t.prototype.findSplitNode=function(t){var e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].findSplitNode(t);if(o)return o}return null},t.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},t.prototype.hitTestTabNodes=function(t,e){for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].hitTestTabNodes(t,e);if(o)return o}return null},t.prototype.createConfig=function(){var t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map((function(t){return t.createConfig()})),sizes:e}},t.prototype.syncHandles=function(){var t=this;o(this.handles,(function(e,i){e.setAttribute("data-orientation",t.orientation),i===t.handles.length-1?(e.classList.add("lm-mod-hidden"),e.classList.add("p-mod-hidden")):(e.classList.remove("lm-mod-hidden"),e.classList.remove("p-mod-hidden"))}))},t.prototype.holdSizes=function(){o(this.sizers,(function(t){t.sizeHint=t.size}))},t.prototype.holdAllSizes=function(){o(this.children,(function(t){return t.holdAllSizes()})),this.holdSizes()},t.prototype.normalizeSizes=function(){var t=this.sizers.length;if(0!==t){this.holdSizes();var e=m(this.sizers,(function(t,e){return t+e.sizeHint}),0);o(this.sizers,0===e?function(e){e.size=e.sizeHint=1/t}:function(t){t.size=t.sizeHint/=e}),this.normalized=!0}},t.prototype.createNormalizedSizes=function(){var t=this.sizers.length;if(0===t)return[];var e=this.sizers.map((function(t){return t.size})),i=m(e,(function(t,e){return t+e}),0);return o(e,0===i?function(i,n){e[n]=1/t}:function(t,n){e[n]=t/i}),e},t.prototype.fit=function(t,e){for(var i="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*t,o=i?n:0,r=i?0:n,s=0,a=this.children.length;s<a;++s){var d=this.children[s].fit(t,e);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}},t.prototype.update=function(t,e,i,n,r,s){var a="horizontal"===this.orientation,d=Math.max(0,this.children.length-1)*r,c=Math.max(0,(a?i:n)-d);this.normalized&&(o(this.sizers,(function(t){t.sizeHint*=c})),this.normalized=!1),ct.calc(this.sizers,c);for(var h=0,l=this.children.length;h<l;++h){var u=this.children[h],p=this.sizers[h].size,f=this.handles[h].style;a?(u.update(t,e,p,n,r,s),t+=p,f.top=e+"px",f.left=t+"px",f.width=r+"px",f.height=n+"px",t+=r):(u.update(t,e,i,p,r,s),e+=p,f.top=e+"px",f.left=t+"px",f.width=i+"px",f.height=r+"px",e+=r)}},t}();t.SplitLayoutNode=c,t.addAria=function(t,e){t.node.setAttribute("role","tabpanel");var i=e.renderer;if(i instanceof Ft.Renderer){var n=i.createTabKey({title:t.title,current:!1,zIndex:0});t.node.setAttribute("aria-labelledby",n)}},t.removeAria=function(t){t.node.removeAttribute("role"),t.node.removeAttribute("aria-labelledby")}}(qt||(qt={}));var Vt,Ut=function(t){function e(i){void 0===i&&(i={});var n=t.call(this)||this;n._drag=null,n._tabsMovable=!0,n._tabsConstrained=!1,n._addButtonEnabled=!1,n._pressData=null,n._layoutModified=new S(n),n._addRequested=new S(n),n.addClass("lm-DockPanel"),n.addClass("p-DockPanel"),n._document=i.document||document,n._mode=i.mode||"multiple-document",n._renderer=i.renderer||e.defaultRenderer,n._edges=i.edges||Vt.DEFAULT_EDGES,void 0!==i.tabsMovable&&(n._tabsMovable=i.tabsMovable),void 0!==i.tabsConstrained&&(n._tabsConstrained=i.tabsConstrained),void 0!==i.addButtonEnabled&&(n._addButtonEnabled=i.addButtonEnabled),n.dataset.mode=n._mode;var o={createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}};return n.layout=new Kt({document:n._document,renderer:o,spacing:i.spacing,hiddenMode:i.hiddenMode}),n.overlay=i.overlay||new e.Overlay,n.node.appendChild(n.overlay.node),n}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(t){this.layout.hiddenMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(t){if(this._mode!==t){this._mode=t,this.dataset.mode=t;var e=this.layout;switch(t){case"multiple-document":o(e.tabBars(),(function(t){t.show()}));break;case"single-document":e.restoreLayout(Vt.createSingleDocumentConfig(this));break;default:throw"unreachable"}Y.postMessage(this,Vt.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(t){this._tabsMovable=t,o(this.tabBars(),(function(e){e.tabsMovable=t}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(t){this._tabsConstrained=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(t){this._addButtonEnabled=t,o(this.tabBars(),(function(e){e.addButtonEnabled=t}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(t){var e=l(this.tabBars(),(function(e){return-1!==e.titles.indexOf(t.title)}));if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title},e.prototype.activateWidget=function(t){this.selectWidget(t),t.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(t){this._mode="multiple-document",this.layout.restoreLayout(t),(B.IS_EDGE||B.IS_IE)&&Y.flush(),Y.postMessage(this,Vt.LayoutModified)},e.prototype.addWidget=function(t,e){void 0===e&&(e={}),"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),Y.postMessage(this,Vt.LayoutModified)},e.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,e)},e.prototype.handleEvent=function(t){switch(t.type){case"lm-dragenter":this._evtDragEnter(t);break;case"lm-dragleave":this._evtDragLeave(t);break;case"lm-dragover":this._evtDragOver(t);break;case"lm-drop":this._evtDrop(t);break;case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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()},e.prototype.onChildAdded=function(t){Vt.isGeneratedTabBarProperty.get(t.child)||(t.child.addClass("lm-DockPanel-widget"),t.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(t){Vt.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("lm-DockPanel-widget"),t.child.removeClass("p-DockPanel-widget"),Y.postMessage(this,Vt.LayoutModified))},e.prototype._evtDragEnter=function(t){t.mimeData.hasData("application/vnd.lumino.widget-factory")&&(t.preventDefault(),t.stopPropagation())},e.prototype._evtDragLeave=function(t){t.preventDefault(),t.stopPropagation(),this.overlay.hide(1)},e.prototype._evtDragOver=function(t){t.preventDefault(),t.stopPropagation(),this._tabsConstrained&&t.source!==this||"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":t.dropAction=t.proposedAction},e.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var e=t.clientX,i=t.clientY,n=Vt.findDropTarget(this,e,i,this._edges),o=n.zone,r=n.target;if("invalid"!==o){var s=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"==typeof s){var a=s();if(a instanceof pt)if(a.contains(this))t.dropAction="none";else{var d=r?Vt.getDropRef(r.tabBar):null;switch(o){case"root-all":this.addWidget(a);break;case"root-top":this.addWidget(a,{mode:"split-top"});break;case"root-left":this.addWidget(a,{mode:"split-left"});break;case"root-right":this.addWidget(a,{mode:"split-right"});break;case"root-bottom":this.addWidget(a,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(a,{mode:"tab-after",ref:d});break;case"widget-top":this.addWidget(a,{mode:"split-top",ref:d});break;case"widget-left":this.addWidget(a,{mode:"split-left",ref:d});break;case"widget-right":this.addWidget(a,{mode:"split-right",ref:d});break;case"widget-bottom":this.addWidget(a,{mode:"split-bottom",ref:d});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(a)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),Y.postMessage(this,Vt.LayoutModified))},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,i=t.target,n=l(e.handles(),(function(t){return t.contains(i)}));if(n){t.preventDefault(),t.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 o=n.getBoundingClientRect(),r=t.clientX-o.left,s=t.clientY-o.top,a=window.getComputedStyle(n),d=$.overrideCursor(a.cursor,this._document);this._pressData={handle:n,deltaX:r,deltaY:s,override:d}}}},e.prototype._evtMouseMove=function(t){if(this._pressData){t.preventDefault(),t.stopPropagation();var e=this.node.getBoundingClientRect(),i=t.clientX-e.left-this._pressData.deltaX,n=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),Y.postMessage(this,Vt.LayoutModified))},e.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))},e.prototype._showOverlay=function(t,e){var i,n,o,r,s=Vt.findDropTarget(this,t,e,this._edges),a=s.zone,d=s.target;if("invalid"===a)return this.overlay.hide(100),a;var c=E.boxSizing(this.node),h=this.node.getBoundingClientRect();switch(a){case"root-all":i=c.paddingTop,n=c.paddingLeft,o=c.paddingRight,r=c.paddingBottom;break;case"root-top":i=c.paddingTop,n=c.paddingLeft,o=c.paddingRight,r=h.height*Vt.GOLDEN_RATIO;break;case"root-left":i=c.paddingTop,n=c.paddingLeft,o=h.width*Vt.GOLDEN_RATIO,r=c.paddingBottom;break;case"root-right":i=c.paddingTop,n=h.width*Vt.GOLDEN_RATIO,o=c.paddingRight,r=c.paddingBottom;break;case"root-bottom":i=h.height*Vt.GOLDEN_RATIO,n=c.paddingLeft,o=c.paddingRight,r=c.paddingBottom;break;case"widget-all":i=d.top,n=d.left,o=d.right,r=d.bottom;break;case"widget-top":i=d.top,n=d.left,o=d.right,r=d.bottom+d.height/2;break;case"widget-left":i=d.top,n=d.left,o=d.right+d.width/2,r=d.bottom;break;case"widget-right":i=d.top,n=d.left+d.width/2,o=d.right,r=d.bottom;break;case"widget-bottom":i=d.top+d.height/2,n=d.left,o=d.right,r=d.bottom;break;case"widget-tab":var l=d.tabBar.node.getBoundingClientRect().height;i=d.top,n=d.left,o=d.right,r=d.bottom+d.height-l;break;default:throw"unreachable"}return this.overlay.show({top:i,left:n,right:o,bottom:r}),a},e.prototype._createTabBar=function(){var t=this._renderer.createTabBar(this._document);return Vt.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=this._tabsMovable,t.allowDeselect=!1,t.addButtonEnabled=this._addButtonEnabled,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t.addRequested.connect(this._onTabAddRequested,this),t},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){Y.postMessage(this,Vt.LayoutModified)},e.prototype._onCurrentChanged=function(t,e){var i=e.previousTitle,n=e.currentTitle;i&&i.owner.hide(),n&&n.owner.show(),(B.IS_EDGE||B.IS_IE)&&Y.flush(),Y.postMessage(this,Vt.LayoutModified)},e.prototype._onTabAddRequested=function(t){this._addRequested.emit(t)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabDetachRequested=function(t,e){var i=this;if(!this._drag){t.releaseMouse();var n=e.title,o=e.tab,r=e.clientX,s=e.clientY,a=new M;a.setData("application/vnd.lumino.widget-factory",(function(){return n.owner}));var d=o.cloneNode(!0);this._drag=new $({document:this._document,mimeData:a,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),o.classList.add("lm-mod-hidden"),o.classList.add("p-mod-hidden");this._drag.start(r,s).then((function(){i._drag=null,o.classList.remove("lm-mod-hidden"),o.classList.remove("p-mod-hidden")}))}},e}(pt);!function(t){var e=function(){function t(){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 t.prototype.show=function(t){var e=this.node.style;e.top=t.top+"px",e.left=t.left+"px",e.right=t.right+"px",e.bottom=t.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"))},t.prototype.hide=function(t){var e=this;if(!this._hidden)return t<=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(){e._timer=-1,e._hidden=!0,e.node.classList.add("lm-mod-hidden"),e.node.classList.add("p-mod-hidden")}),t)))},t}();t.Overlay=e;var i=function(){function t(){}return t.prototype.createTabBar=function(t){var e=new Ft({document:t});return e.addClass("lm-DockPanel-tabBar"),e.addClass("p-DockPanel-tabBar"),e},t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="lm-DockPanel-handle",t.classList.add("p-DockPanel-handle"),t},t}();t.Renderer=i,t.defaultRenderer=new i}(Ut||(Ut={})),function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new G("layout-modified"),t.isGeneratedTabBarProperty=new J({name:"isGeneratedTabBar",create:function(){return!1}}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};var e=function(t){for(var e,i=0,o=[],r=n(t);void 0!==(e=r.next());)o[i++]=e;return o}(t.widgets()),i=t.selectedWidgets().next(),o=i?e.indexOf(i):-1;return{main:{type:"tab-area",widgets:e,currentIndex:o}}},t.findDropTarget=function(t,e,i,n){if(!E.hitTest(t.node,e,i))return{zone:"invalid",target:null};var o=t.layout;if(o.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){var r=t.node.getBoundingClientRect(),s=e-r.left+1,a=i-r.top+1,d=r.right-e,c=r.bottom-i;switch(Math.min(a,d,c,s)){case a:if(a<n.top)return{zone:"root-top",target:null};break;case d:if(d<n.right)return{zone:"root-right",target:null};break;case c:if(c<n.bottom)return{zone:"root-bottom",target:null};break;case s:if(s<n.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var h=o.hitTestTabAreas(e,i);if(!h)return{zone:"invalid",target:null};if("single-document"===t.mode)return{zone:"widget-all",target:h};var l=h.x-h.left+1,u=h.y-h.top+1,p=h.left+h.width-h.x,f=h.top+h.height-h.y;if(u<h.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:h};var m,g=Math.round(h.width/3),v=Math.round(h.height/3);if(l>g&&p>g&&u>v&&f>v)return{zone:"widget-all",target:h};switch(l/=g,u/=v,p/=g,f/=v,Math.min(l,u,p,f)){case l:m="widget-left";break;case u:m="widget-top";break;case p:m="widget-right";break;case f:m="widget-bottom";break;default:throw"unreachable"}return{zone:m,target:h}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(Vt||(Vt={})),function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new S(this),this._currentChanged=new S(this)}t.prototype.dispose=function(){var t=this;this._counter<0||(this._counter=-1,S.clearData(this),o(this._widgets,(function(e){e.node.removeEventListener("focus",t,!0),e.node.removeEventListener("blur",t,!0)})),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(t){var e=this._numbers.get(t);return void 0===e?-1:e},t.prototype.has=function(t){return this._numbers.has(t)},t.prototype.add=function(t){if(!this._numbers.has(t)){var e=t.node.contains(document.activeElement),i=e?this._counter++:-1;this._widgets.push(t),this._numbers.set(t,i),this._nodes.set(t.node,t),t.node.addEventListener("focus",this,!0),t.node.addEventListener("blur",this,!0),t.disposed.connect(this._onWidgetDisposed,this),e&&this._setWidgets(t,t)}},t.prototype.remove=function(t){var e=this;if(this._numbers.has(t)&&(t.disposed.disconnect(this._onWidgetDisposed,this),t.node.removeEventListener("focus",this,!0),t.node.removeEventListener("blur",this,!0),i.removeFirstOf(this._widgets,t),this._nodes.delete(t.node),this._numbers.delete(t),this._currentWidget===t)){var o,r,s=function(t,e){var i=n(t),o=i.next();if(void 0!==o){for(var r=o;void 0!==(o=i.next());)e(o,r)>0&&(r=o);return r}}((o=this._widgets,r=function(t){return-1!==e._numbers.get(t)},new h(n(o),r)),(function(t,i){return e._numbers.get(t)-e._numbers.get(i)}))||null;this._setWidgets(s,null)}},t.prototype.handleEvent=function(t){switch(t.type){case"focus":this._evtFocus(t);break;case"blur":this._evtBlur(t)}},t.prototype._setWidgets=function(t,e){var i=this._currentWidget;this._currentWidget=t;var n=this._activeWidget;this._activeWidget=e,i!==t&&this._currentChanged.emit({oldValue:i,newValue:t}),n!==e&&this._activeChanged.emit({oldValue:n,newValue:e})},t.prototype._evtFocus=function(t){var e=this._nodes.get(t.currentTarget);e!==this._currentWidget&&this._numbers.set(e,this._counter++),this._setWidgets(e,e)},t.prototype._evtBlur=function(t){var e=this._nodes.get(t.currentTarget),i=t.relatedTarget;i&&(e.node.contains(i)||l(this._widgets,(function(t){return t.node.contains(i)})))||this._setWidgets(this._currentWidget,null)},t.prototype._onWidgetDisposed=function(t){this.remove(t)}}();var Yt,Xt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i._dirty=!1,i._rowSpacing=4,i._columnSpacing=4,i._items=[],i._rowStarts=[],i._columnStarts=[],i._rowSizers=[new ht],i._columnSizers=[new ht],i._box=null,void 0!==e.rowCount&&Yt.reallocSizers(i._rowSizers,e.rowCount),void 0!==e.columnCount&&Yt.reallocSizers(i._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(i._rowSpacing=Yt.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(i._columnSpacing=Yt.clampValue(e.columnSpacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){var e=t.widget;t.dispose(),e.dispose()})),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(t){t!==this.rowCount&&(Yt.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(t){t!==this.columnCount&&(Yt.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(t){t=Yt.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(t){t=Yt.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(t){var e=this._rowSizers[t];return e?e.stretch:-1},e.prototype.setRowStretch=function(t,e){var i=this._rowSizers[t];i&&(e=Yt.clampValue(e),i.stretch!==e&&(i.stretch=e,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(t){var e=this._columnSizers[t];return e?e.stretch:-1},e.prototype.setColumnStretch=function(t,e){var i=this._columnSizers[t];i&&(e=Yt.clampValue(e),i.stretch!==e&&(i.stretch=e,this.parent&&this.parent.update()))},e.prototype.iter=function(){return u(this._items,(function(t){return t.widget}))},e.prototype.addWidget=function(t){-1===i.findFirstIndex(this._items,(function(e){return e.widget===t}))&&(this._items.push(new gt(t)),this.parent&&this.attachWidget(t))},e.prototype.removeWidget=function(t){var e=i.findFirstIndex(this._items,(function(e){return e.widget===t}));if(-1!==e){var n=i.removeAt(this._items,e);this.parent&&this.detachWidget(t),n.dispose()}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)}))},e.prototype.attachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,i=this.rowCount;t<i;++t)this._rowSizers[t].minSize=0;for(t=0,i=this.columnCount;t<i;++t)this._columnSizers[t].minSize=0;var n=this._items.filter((function(t){return!t.isHidden}));for(t=0,i=n.length;t<i;++t)n[t].fit();var o=this.rowCount-1,r=this.columnCount-1;n.sort(Yt.rowSpanCmp);for(t=0,i=n.length;t<i;++t){var s=n[t],a=e.getCellConfig(s.widget),d=Math.min(a.row,o),c=Math.min(a.row+a.rowSpan-1,o);Yt.distributeMin(this._rowSizers,d,c,s.minHeight)}n.sort(Yt.columnSpanCmp);for(t=0,i=n.length;t<i;++t){s=n[t],a=e.getCellConfig(s.widget);var h=Math.min(a.column,r),l=Math.min(a.column+a.columnSpan-1,r);Yt.distributeMin(this._columnSizers,h,l,s.minWidth)}if("set-no-constraint"!==this.fitPolicy){var u=o*this._rowSpacing,p=r*this._columnSpacing;for(t=0,i=this.rowCount;t<i;++t)u+=this._rowSizers[t].minSize;for(t=0,i=this.columnCount;t<i;++t)p+=this._columnSizers[t].minSize;var f=this._box=E.boxSizing(this.parent.node);p+=f.horizontalSum,u+=f.verticalSum;var m=this.parent.node.style;m.minWidth=p+"px",m.minHeight=u+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)}else Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,i){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,r=t-this._box.horizontalSum,s=i-this._box.verticalSum,a=this.rowCount-1,d=this.columnCount-1,c=a*this._rowSpacing,h=d*this._columnSpacing;ct.calc(this._rowSizers,Math.max(0,s-c)),ct.calc(this._columnSizers,Math.max(0,r-h));for(var l=0,u=n,p=this.rowCount;l<p;++l)this._rowStarts[l]=u,u+=this._rowSizers[l].size+this._rowSpacing;for(l=0,u=o,p=this.columnCount;l<p;++l)this._columnStarts[l]=u,u+=this._columnSizers[l].size+this._columnSpacing;for(l=0,p=this._items.length;l<p;++l){var f=this._items[l];if(!f.isHidden){var m=e.getCellConfig(f.widget),g=Math.min(m.row,a),v=Math.min(m.column,d),y=Math.min(m.row+m.rowSpan-1,a),b=Math.min(m.column+m.columnSpan-1,d),_=this._columnStarts[v],w=this._rowStarts[g],x=this._columnStarts[b]+this._columnSizers[b].size-_,M=this._rowStarts[y]+this._rowSizers[y].size-w;f.update(_,w,x,M)}}},e}(ft);!function(t){t.getCellConfig=function(t){return Yt.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){Yt.cellConfigProperty.set(t,Yt.normalizeConfig(e))}}(Xt||(Xt={})),function(t){t.cellConfigProperty=new J({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof Xt&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},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(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new ht);t.length>e&&(t.length=e)},t.distributeMin=function(t,e,i,n){if(!(i<e))if(e!==i){for(var o=0,r=e;r<=i;++r)o+=t[r].minSize;if(!(o>=n)){var s=(n-o)/(i-e+1);for(r=e;r<=i;++r)t[r].minSize+=s}}else{var a=t[e];a.minSize=Math.max(a.minSize,n)}}}(Yt||(Yt={}));var Gt,Zt,Jt=function(t){function e(i){void 0===i&&(i={});var n=t.call(this,{node:Gt.createNode()})||this;return n._activeIndex=-1,n._menus=[],n._childMenu=null,n.addClass("lm-MenuBar"),n.addClass("p-MenuBar"),n.setFlag(pt.Flag.DisallowLayout),n.renderer=i.renderer||e.defaultRenderer,n._forceItemsPosition=i.forceItemsPosition||{forceX:!0,forceY:!0},n}return at(e,t),e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._menus.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._menus.length)&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(t){this.insertMenu(this._menus.length,t)},e.prototype.insertMenu=function(t,e){this._closeChildMenu();var n=this._menus.indexOf(e),o=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return i.insert(this._menus,o,e),e.addClass("lm-MenuBar-menu"),e.addClass("p-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void this.update();o===this._menus.length&&o--,n!==o&&(i.move(this._menus,n,o),this.update())},e.prototype.removeMenu=function(t){this.removeMenuAt(this._menus.indexOf(t))},e.prototype.removeMenuAt=function(t){this._closeChildMenu();var e=i.removeAt(this._menus,t);e&&(e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu"),e.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var t=0,e=this._menus;t<e.length;t++){var i=e[t];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()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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()},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this,i=this._menus,n=this.renderer,o=this._activeIndex,r=new Array(i.length),s=function(t,s){var a=i[t].title,d=t===o;d&&0==i[t].items.length&&(d=!1),r[t]=n.renderItem({title:a,active:d,onfocus:function(){e.activeIndex=t}})},a=0,d=i.length;a<d;++a)s(a);et.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e&&38!==e&&40!==e){if(27===e)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==e)if(39!==e){var i=R().keyForKeydownEvent(t);if(i){var n=this._activeIndex+1,o=Gt.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()},e.prototype._evtMouseDown=function(t){if(E.hitTest(this.node,t.clientX,t.clientY)){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));-1!==e?0===t.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=e):(this.activeIndex=e,this._openChildMenu())):this._closeChildMenu()}},e.prototype._evtMouseMove=function(t){var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));e!==this._activeIndex&&(-1===e&&this._childMenu||(this.activeIndex=e,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(t){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var e=this._childMenu;if(e!==t){this._childMenu=t,e?e.close():(this.addClass("lm-mod-active"),this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),Y.sendMessage(this,pt.Msg.UpdateRequest);var i=this.contentNode.children[this._activeIndex].getBoundingClientRect(),n=i.left,o=i.bottom;t.items.length>0&&t.open(n,o,this._forceItemsPosition)}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(t){t===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(t,e){if(t===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(e){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=0===i?n-1:i-1}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(pt);!function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return rt.li(dt({className:e,dataset:i,tabindex:"0",onfocus:t.onfocus},n),this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.title.icon?rt.div({className:e},t.title.iconLabel):rt.div({className:e},t.title.icon,t.title.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return rt.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},e)},t.prototype.createItemClass=function(t){var e="lm-MenuBar-item";return e+=" p-MenuBar-item",t.title.className&&(e+=" "+t.title.className),t.active&&(e+=" lm-mod-active",e+=" p-mod-active"),e},t.prototype.createItemDataset=function(t){return t.title.dataset},t.prototype.createItemARIA=function(t){return{role:"menuitem","aria-haspopup":"true"}},t.prototype.createIconClass=function(t){var e="lm-MenuBar-itemIcon";e+=" p-MenuBar-itemIcon";var i=t.title.iconClass;return i?e+" "+i:e},t.prototype.formatLabel=function(t){var e=t.title,i=e.label,n=e.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,rt.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},s),r]},t}();t.Renderer=e,t.defaultRenderer=new e}(Jt||(Jt={})),function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-MenuBar-content",e.classList.add("p-MenuBar-content"),t.appendChild(e),e.setAttribute("role","menubar"),t.tabIndex=0,e.tabIndex=0,t},t.findMnemonic=function(t,e,i){for(var n=-1,o=-1,r=!1,s=e.toUpperCase(),a=0,d=t.length;a<d;++a){var c=(a+i)%d,h=t[c].title;if(0!==h.label.length){var l=h.mnemonic;l>=0&&l<h.label.length?h.label[l].toUpperCase()===s&&(-1===n?n=c:r=!0):-1===o&&h.label[0].toUpperCase()===s&&(o=c)}}return{index:n,multiple:r,auto:o}}}(Gt||(Gt={})),function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{node:Zt.createNode()})||this;return i._onRepeat=function(){if(i._repeatTimer=-1,i._pressData){var t=i._pressData.part;if("thumb"!==t){i._repeatTimer=window.setTimeout(i._onRepeat,20);var e=i._pressData.mouseX,n=i._pressData.mouseY;if("decrement"!==t)if("increment"!==t){if("track"===t){if(!E.hitTest(i.trackNode,e,n))return;var o=i.thumbNode;if(E.hitTest(o,e,n))return;var r=o.getBoundingClientRect(),s=void 0;return s="horizontal"===i._orientation?e<r.left?"decrement":"increment":n<r.top?"decrement":"increment",void i._pageRequested.emit(s)}}else{if(!E.hitTest(i.incrementNode,e,n))return;i._stepRequested.emit("increment")}else{if(!E.hitTest(i.decrementNode,e,n))return;i._stepRequested.emit("decrement")}}}},i._value=0,i._page=10,i._maximum=100,i._repeatTimer=-1,i._pressData=null,i._thumbMoved=new S(i),i._stepRequested=new S(i),i._pageRequested=new S(i),i.addClass("lm-ScrollBar"),i.addClass("p-ScrollBar"),i.setFlag(pt.Flag.DisallowLayout),i._orientation=e.orientation||"vertical",i.dataset.orientation=i._orientation,void 0!==e.maximum&&(i._maximum=Math.max(0,e.maximum)),void 0!==e.page&&(i._page=Math.max(0,e.page)),void 0!==e.value&&(i._value=Math.max(0,Math.min(e.value,i._maximum))),i}at(e,t),Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(t){t=Math.max(0,t),this._page!==t&&(this._page=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){t=Math.max(0,t),this._maximum!==t&&(this._maximum=t,this._value=Math.min(this._value,t),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){var e=100*this._value/this._maximum,i=100*this._page/(this._page+this._maximum);e=Math.max(0,Math.min(e,100)),i=Math.max(0,Math.min(i,100));var n=this.thumbNode.style;"horizontal"===this._orientation?(n.top="",n.height="",n.left=e+"%",n.width=i+"%",n.transform="translate("+-e+"%, 0%)"):(n.left="",n.width="",n.top=e+"%",n.height=i+"%",n.transform="translate(0%, "+-e+"%)")},e.prototype._evtKeyDown=function(t){if(t.preventDefault(),t.stopPropagation(),27===t.keyCode){var e=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==e&&this._moveThumb(e)}},e.prototype._evtMouseDown=function(t){if(0===t.button&&(this.activate(),!this._pressData)){var e=Zt.findPart(this,t.target);if(e){t.preventDefault(),t.stopPropagation();var i=$.overrideCursor("default");if(this._pressData={part:e,override:i,delta:-1,value:-1,mouseX:t.clientX,mouseY:t.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===e){var n=this.thumbNode,o=n.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=t.clientX-o.left:this._pressData.delta=t.clientY-o.top,n.classList.add("lm-mod-active"),n.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===e){o=this.thumbNode.getBoundingClientRect();var r=void 0;return r="horizontal"===this._orientation?t.clientX<o.left?"decrement":"increment":t.clientY<o.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._pageRequested.emit(r)}return"decrement"===e?(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"===e?(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}}},e.prototype._evtMouseMove=function(t){if(this._pressData&&(t.preventDefault(),t.stopPropagation(),this._pressData.mouseX=t.clientX,this._pressData.mouseY=t.clientY,"thumb"===this._pressData.part)){var e,i,n=this.thumbNode.getBoundingClientRect(),o=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(e=t.clientX-o.left-this._pressData.delta,i=o.width-n.width):(e=t.clientY-o.top-this._pressData.delta,i=o.height-n.height);var r=0===i?0:e*this._maximum/i;this._moveThumb(r)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.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"))},e.prototype._moveThumb=function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update(),this._thumbMoved.emit(t))}}(pt),function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div");return e.className="lm-ScrollBar-button",i.className="lm-ScrollBar-button",e.dataset.action="decrement",i.dataset.action="increment",n.className="lm-ScrollBar-track",o.className="lm-ScrollBar-thumb",e.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),t.appendChild(e),t.appendChild(n),t.appendChild(i),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(Zt||(Zt={})),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widget=null,e}at(e,t),e.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){t&&(t.parent=this.parent),this._widget!==t&&(this._widget&&this._widget.dispose(),this._widget=t,this.parent&&t&&this.attachWidget(t))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?g(this._widget):d()},e.prototype.removeWidget=function(t){this._widget===t&&(this._widget=null,this.parent&&this.detachWidget(t))},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)}))},e.prototype.attachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach)},e.prototype.detachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach)}}(ft);var Qt,$t=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i._dirty=!1,i._items=[],i._box=null,i._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:pt.HiddenMode.Display,i}return at(e,t),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){var e=this;this._hiddenMode!==t&&(this._hiddenMode=t,this.widgets.length>1&&this.widgets.forEach((function(t){t.hiddenMode=e._hiddenMode})))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(t,e){this._hiddenMode===pt.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=pt.HiddenMode.Scale),e.hiddenMode=pt.HiddenMode.Scale):e.hiddenMode=pt.HiddenMode.Display,i.insert(this._items,t,new gt(e)),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t);this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===pt.HiddenMode.Scale&&(e.hiddenMode=pt.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=pt.HiddenMode.Display)),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,e=0,i=0,n=this._items.length;i<n;++i){var o=this._items[i];o.isHidden||(o.fit(),t=Math.max(t,o.minWidth),e=Math.max(e,o.minHeight))}var r=this._box=E.boxSizing(this.parent.node);t+=r.horizontalSum,e+=r.verticalSum;var s=this.parent.node.style;s.minWidth=t+"px",s.minHeight=e+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r=this._box.paddingTop,s=this._box.paddingLeft,a=t-this._box.horizontalSum,d=e-this._box.verticalSum;for(n=0,o=this._items.length;n<o;++n){var c=this._items[n];c.isHidden||(c.widget.node.style.zIndex=""+n,c.update(s,r,a,d))}}},e}(yt),te=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:Qt.createLayout(e)})||this;return i._widgetRemoved=new S(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(t){this.layout.hiddenMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("lm-StackedPanel-child"),t.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-StackedPanel-child"),t.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(t.child)},e}(zt);!function(t){t.createLayout=function(t){return t.layout||new $t}}(Qt||(Qt={}));var ee,ie=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;i._currentChanged=new S(i),i._addRequested=new S(i),i.addClass("lm-TabPanel"),i.addClass("p-TabPanel"),i.tabBar=new Ft(e),i.tabBar.addClass("lm-TabPanel-tabBar"),i.stackedPanel=new te,i.stackedPanel.addClass("lm-TabPanel-stackedPanel"),i.tabBar.addClass("p-TabPanel-tabBar"),i.stackedPanel.addClass("p-TabPanel-stackedPanel"),i.tabBar.tabMoved.connect(i._onTabMoved,i),i.tabBar.currentChanged.connect(i._onCurrentChanged,i),i.tabBar.tabCloseRequested.connect(i._onTabCloseRequested,i),i.tabBar.tabActivateRequested.connect(i._onTabActivateRequested,i),i.tabBar.addRequested.connect(i._onTabAddRequested,i),i.stackedPanel.widgetRemoved.connect(i._onWidgetRemoved,i),i._tabPlacement=e.tabPlacement||"top";var n=ee.directionFromPlacement(i._tabPlacement),o=ee.orientationFromPlacement(i._tabPlacement);i.tabBar.orientation=o,i.tabBar.dataset.placement=i._tabPlacement;var r=new Lt({direction:n,spacing:0});return Lt.setStretch(i.tabBar,0),Lt.setStretch(i.stackedPanel,1),r.addWidget(i.tabBar),r.addWidget(i.stackedPanel),i.layout=r,i}return at(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(t){this.tabBar.currentIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(t){this.tabBar.addButtonEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(t){if(this._tabPlacement!==t){this._tabPlacement=t;var e=ee.directionFromPlacement(t),i=ee.orientationFromPlacement(t);this.tabBar.orientation=i,this.tabBar.dataset.placement=t,this.layout.direction=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.stackedPanel.insertWidget(t,e),this.tabBar.insertTab(t,e.title),e.node.setAttribute("role","tabpanel");var i=this.tabBar.renderer;if(i instanceof Ft.Renderer){var n=i.createTabKey({title:e.title,current:!1,zIndex:0});e.node.setAttribute("aria-labelledby",n)}},e.prototype._onCurrentChanged=function(t,e){var i=e.previousIndex,n=e.previousTitle,o=e.currentIndex,r=e.currentTitle,s=n?n.owner:null,a=r?r.owner:null;s&&s.hide(),a&&a.show(),this._currentChanged.emit({previousIndex:i,previousWidget:s,currentIndex:o,currentWidget:a}),(B.IS_EDGE||B.IS_IE)&&Y.flush()},e.prototype._onTabAddRequested=function(t,e){this._addRequested.emit(t)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.stackedPanel.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(e.title)},e}(pt);function ne(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}!function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return i[t]};var e={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"}}(ee||(ee={}));ne(".lm-Widget,.p-Widget{box-sizing:border-box;cursor:default;overflow:hidden;position:relative}.lm-Widget.lm-mod-hidden,.p-Widget.p-mod-hidden{display:none!important}");ne('.lm-CommandPalette,.p-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-CommandPalette-search,.p-CommandPalette-search{flex:0 0 auto}.lm-CommandPalette-content,.p-CommandPalette-content{flex:1 1 auto;list-style-type:none;margin:0;min-height:0;overflow:auto;padding:0}.lm-CommandPalette-header,.p-CommandPalette-header{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lm-CommandPalette-item,.p-CommandPalette-item{display:flex;flex-direction:row}.lm-CommandPalette-itemIcon,.p-CommandPalette-itemIcon{flex:0 0 auto}.lm-CommandPalette-itemContent,.p-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.lm-CommandPalette-itemShortcut,.p-CommandPalette-itemShortcut{flex:0 0 auto}.lm-CommandPalette-itemLabel,.p-CommandPalette-itemLabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lm-close-icon{background-color:transparent;border:1px solid transparent;bottom:0;cursor:pointer;display:none;margin:auto;outline:0;padding:7px 0;position:absolute;right:3%;top:0;vertical-align:middle;z-index:1}.lm-close-icon:after{color:#000;content:"X";cursor:pointer;display:block;font-size:12px;font-weight:400;height:15px;text-align:center;width:15px}');ne('.lm-DockPanel,.lm-DockPanel-widget,.p-DockPanel,.p-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar,.p-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle,.p-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden,.p-DockPanel-handle.p-mod-hidden{display:none!important}.lm-DockPanel-handle:after,.p-DockPanel-handle:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.lm-DockPanel-handle[data-orientation=horizontal],.p-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical],.p-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after,.p-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translateX(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after,.p-DockPanel-handle[data-orientation=vertical]:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-DockPanel-overlay,.p-DockPanel-overlay{box-sizing:border-box;pointer-events:none;z-index:3}.lm-DockPanel-overlay.lm-mod-hidden,.p-DockPanel-overlay.p-mod-hidden{display:none!important}');ne(".lm-Menu,.p-Menu{outline:none;overflow-x:hidden;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:10000}.lm-Menu-content,.p-Menu-content{display:table;list-style-type:none;margin:0;padding:0}.lm-Menu-item,.p-Menu-item{display:table-row}.lm-Menu-item.lm-mod-collapsed,.lm-Menu-item.lm-mod-hidden,.p-Menu-item.p-mod-collapsed,.p-Menu-item.p-mod-hidden{display:none!important}.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon,.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.lm-Menu-itemLabel,.p-Menu-itemLabel{display:table-cell;text-align:left}.lm-Menu-itemShortcut,.p-Menu-itemShortcut{display:table-cell;text-align:right}");ne(".lm-MenuBar,.p-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-MenuBar-content,.p-MenuBar-content{display:flex;flex-direction:row;list-style-type:none;margin:0;padding:0}.lm-MenuBar-item,.p--MenuBar-item{box-sizing:border-box}.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel,.p-MenuBar-itemIcon,.p-MenuBar-itemLabel{display:inline-block}");ne(".lm-ScrollBar,.p-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-ScrollBar[data-orientation=horizontal],.p-ScrollBar[data-orientation=horizontal]{flex-direction:row}.lm-ScrollBar[data-orientation=vertical],.p-ScrollBar[data-orientation=vertical]{flex-direction:column}.lm-ScrollBar-button,.p-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.lm-ScrollBar-track,.p-ScrollBar-track{box-sizing:border-box;flex:1 1 auto;overflow:hidden;position:relative}.lm-ScrollBar-thumb,.p-ScrollBar-thumb{box-sizing:border-box;position:absolute}");ne('.lm-SplitPanel-child,.p-SplitPanel-child{z-index:0}.lm-SplitPanel-handle,.p-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden,.p-SplitPanel-handle.p-mod-hidden{display:none!important}.lm-SplitPanel-handle:after,.p-SplitPanel-handle:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle,.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle,.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after,.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after{left:50%;min-width:8px;transform:translateX(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after,.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after{min-height:8px;top:50%;transform:translateY(-50%)}');ne(".lm-TabBar,.p-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-TabBar[data-orientation=horizontal],.p-TabBar[data-orientation=horizontal]{align-items:flex-end;flex-direction:row}.lm-TabBar[data-orientation=vertical],.p-TabBar[data-orientation=vertical]{align-items:flex-end;flex-direction:column}.lm-TabBar-content,.p-TabBar-content{display:flex;flex:1 1 auto;list-style-type:none;margin:0;padding:0}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content,.p-TabBar[data-orientation=horizontal]>.p-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content,.p-TabBar[data-orientation=vertical]>.p-TabBar-content{flex-direction:column}.lm-TabBar-tab,.p-TabBar-tab{box-sizing:border-box;display:flex;flex-direction:row;overflow:hidden;touch-action:none}.lm-TabBar-tabCloseIcon,.lm-TabBar-tabIcon,.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon{flex:0 0 auto}.lm-TabBar-tabLabel,.p-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{box-sizing:border-box;user-select:all;width:100%}.lm-TabBar-addButton.lm-mod-hidden,.lm-TabBar-tab.lm-mod-hidden,.p-TabBar-tab.p-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab,.p-TabBar.p-mod-dragging .p-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab,.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab{left:0;transition:left .15s ease}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab,.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab{top:0;transition:top .15s ease}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging,.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{background:inherit;box-sizing:border-box;user-select:all;width:100%}");ne(".lm-TabPanel-tabBar,.p-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel,.p-TabPanel-stackedPanel{z-index:0}");var oe=function(t,e){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},oe(t,e)};function re(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}oe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var se=function(){return se=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},se.apply(this,arguments)};function ae(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}var de,ce;ae(".phosphor_WidgetAdapter{background:#fff;border-bottom:1px solid silver;border-left:1px solid silver;border-right:1px solid silver;min-height:64px;min-width:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px 0 rgba(0,0,0,.2),1px 1px 2px rgba(0,0,0,.2)}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}"),t.Msg=void 0,de=t.Msg||(t.Msg={}),ce=function(t){function e(e){var i=t.call(this,"wa-activate-request")||this;return i._wa=e,i}return re(e,t),Object.defineProperty(e.prototype,"wa",{get:function(){return this._wa},enumerable:!1,configurable:!0}),e.prototype.conflate=function(t){return this._wa=t.wa,!0},e}(G),de.WAActivateRequest=ce;var he=function(i){function n(t,n,o,r,s){void 0===o&&(o={}),void 0===r&&(r=!1),void 0===s&&(s={});var a=i.call(this)||this;return a.lparam={},a.padding=0,a._width=0,a._height=0,a._owner=t,a._element=e.select(a.node),a.addClass("phosphor_WidgetAdapter"),a.title.label="",a.title.closable=!!r,a.title.caption="Long description for: ".concat(name),a._ext=s,a._closable="boolean"==typeof r?{canClose:function(t,e){return r}}:r,n instanceof e.Widget?a._widget=n.target(a.node):a._widgetLayout=n,a.lparam=o,a}return re(n,i),Object.defineProperty(n.prototype,"widget",{get:function(){return this._widget},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputNode",{get:function(){return this.node.getElementsByTagName("input")[0]},enumerable:!1,configurable:!0}),n.prototype.resizeAndRender=function(){this._widget&&(e.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-2*this.padding-2,height:this._height-2*this.padding-2}).lazyRender())},n.prototype.onActivateRequest=function(e){i.prototype.onActivateRequest.call(this,e),this._widget&&this.resizeAndRender(),this._owner&&Y.postMessage(this._owner,new t.Msg.WAActivateRequest(this))},n.prototype.onResize=function(t){i.prototype.onResize.call(this,t),this.node&&null!==this.node.offsetParent&&t.width>=0&&t.height>=0?(this._width=t.width,this._height=t.height,this.resizeAndRender()):this._widgetLayout},n.prototype.onCloseRequest=function(t){this._closable.canClose(this._widget,this)&&this.dispose()},n}(pt),le=function(t){function e(e){return t.apply(this,e)||this}return re(e,t),e.create=function(){return Object.create(e.prototype)},e.prototype.watchRendered=function(t,e){if(e)var i=this.map((function(t){return{wa:t,w:t.widget,rc:t.widget.renderCount()}})),n=setInterval((function(){(function(){for(var t=0,e=i;t<e.length;t++){var n=e[t];if(n.wa.isVisible&&n.rc>=n.w.renderCount())return!1}return!0})()&&(clearInterval(n),e(t))}),20)},e}(Array),ue=function(t){function e(){return t.call(this)||this}return re(e,t),e.prototype.createTabBar=function(){var e=t.prototype.createTabBar.call(this);return e.tabsMovable=this._owner.tabsMovable,e},e}(Ut.Renderer),pe=function(t){function e(e){void 0===e&&(e={});var i=this;return e.renderer=e.renderer||new ue,(i=t.call(this,e)||this)._renderer instanceof ue&&(i._renderer._owner=i),i._content=le.create(),i._contentMap={},i}return re(e,t),e.prototype.appendContent=function(t){this._content.push(t),this._contentMap[t.widget.id()]=t},e.prototype.removeContent=function(t){var e=this._content.indexOf(t);e>=0&&this._content.splice(e,1),delete this._contentMap[t.widget.id()],t.dispose()},e.prototype.content=function(){return this._content},e.prototype.serializeWidget=function(t){if(t instanceof he)try{return{__id:t.widget.id()}}catch(t){return{exception:{message:t.message,stack:t.stack}}}return null},e.prototype.deserializeWidget=function(t){var e=this._contentMap[t.__id];return e||(e=new he(void 0,t)),e},e.prototype.serializeITabAreaConfig=function(t,e){var i=this;return se(se({},t),{widgets:t.widgets.map((function(t){return e?i.deserializeWidget(t):i.serializeWidget(t)}))})},e.prototype.serializeISplitAreaConfig=function(t,e){var i=this;return se(se({},t),{children:t.children.map((function(t){return i.serializeAreaConfig(t,e)}))})},e.prototype.serializeAreaConfig=function(t,e){if(t)switch(t.type){case"tab-area":return this.serializeITabAreaConfig(t,e);case"split-area":return this.serializeISplitAreaConfig(t,e)}},e.prototype.saveLayout=function(){return{main:this.serializeAreaConfig(t.prototype.saveLayout.call(this).main,!1)}},e.prototype.restoreLayout=function(e){return t.prototype.restoreLayout.call(this,{main:this.serializeAreaConfig(e.main,!0)})},e}(Ut);ae('.p-DockPanel-overlay{background:hsla(0,0%,100%,.6);border:1px dashed #000;transition-duration:.15s;transition-property:top,left,right,bottom;transition-timing-function:ease}.p-TabBar{max-height:24px;min-height:24px}.p-TabBar-content{align-items:flex-end;min-height:0;min-width:0}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid silver}.p-TabBar-tab{background:#e5e5e5;border:1px solid silver;border-bottom:none;flex:0 1 125px;font:12px Helvetica,Arial,sans-serif;line-height:20px;margin-left:-1px;max-height:20px;min-height:20px;min-width:35px;padding:0 10px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{max-height:23px;min-height:23px;transform:translateY(1px)}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon,.p-TabBar-tabLabel{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"\\f00d";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{border:none;box-shadow:1px 1px 2px rgba(0,0,0,.3);max-height:23px;min-height:23px;min-width:125px;transform:translateX(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{max-height:1px!important;min-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}');var fe=function(t){function i(){var e=t.call(this)||this;return e._dock=new pe({mode:"multiple-document"}),e._layoutObj=null,e._tag="div",e._dock.id="p"+e.id(),Y.installMessageHook(e,e),e}return re(i,t),i.prototype.getWidgetAdapter=function(t){var e=null;return this._dock.content().some((function(i){return i.widget===t&&(e=i,!0)})),e},i.prototype.addWidget=function(t,e,i,n,o){void 0===i&&(i="split-right");var r={mode:i,ref:this.getWidgetAdapter(n)},s=new he(this,t,{},o);return s.title.label=e,s.padding=8,this._dock.addWidget(s,r),this._dock.appendContent(s),this._dock.tabsMovable=!0,this},i.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);return e&&(t.target(null),this._dock.removeContent(e)),this},i.prototype.isVisible=function(t){return this.getWidgetAdapter(t).isVisible},i.prototype.widgetAdapters=function(){return this._dock.content()},i.prototype.widgets=function(){return this._dock.content().map((function(t){return t.widget}))},i.prototype.layout=function(t){return arguments.length?(this._dock.restoreLayout(t),this):this._dock.saveLayout()},i.prototype.layoutObj=function(t){return this._layoutObj=t,this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._pPlaceholder=i.append("div"),pt.attach(this._dock,this._pPlaceholder.node())},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","auto"),i.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach((function(t){return t.render()}))},i.prototype.exit=function(e,i){var n=this;(function(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))})([],this.widgets(),!0).forEach((function(t){return n.removeWidget(t)})),t.prototype.exit.call(this,e,i)},i.prototype.render=function(i){var n=this,o=this;return null!==this._layoutObj&&(this.layout(this._layoutObj),this.layoutObj(null)),t.prototype.render.call(this,(function(t){n._dock.content().watchRendered(n,i),n._dock.update(),setTimeout((function(){var t=n.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar"),i=!1;t.each((function(){var t=e.select(this),n=t.node().childNodes[0].childNodes.length,r=o.hideSingleTabs()&&1===n;r!==t.classed("hide")&&(t.classed("hide",r),i=!0)})),i&&n._dock.fit()}),0)}))},i.prototype.refit=function(){this._dock.fit()},i.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},i.prototype.processMessage=function(t){if("wa-activate-request"===t.type){var e=t.wa,i=e.widget;this._prevActive!==i&&(this._prevActive=i,this.childActivation(i,e))}},i.prototype.childActivation=function(t,e){},i.prototype.active=function(){return this._prevActive},i}(e.HTMLWidget);fe.prototype._class+=" phosphor_DockPanel",fe.prototype.publish("hideSingleTabs",!1,"boolean");var me=function(t){function e(e){void 0===e&&(e="vertical");var i=t.call(this)||this;return i.content=le.create(),i._split=new Pt({orientation:e}),i._tag="div",i._split.id="p"+i.id(),i}return re(e,t),e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some((function(i){return i.widget===t&&(e=i,!0)})),e},e.prototype.addWidget=function(t){var e=new he(this,t);return this._split.addWidget(e),this.content.push(e),this},e.prototype.relativeSizes=function(t){return arguments.length?(this._split.setRelativeSizes(t),this):this._split.relativeSizes()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),pt.attach(this._split,e)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,(function(t){i.content.watchRendered(i,e),i._split.update()}))},e}(e.HTMLWidget);me.prototype._class+=" phosphor_SplitPanel";var ge=function(t){function e(){var e=t.call(this)||this;return e._tab=new ie({tabPlacement:"top"}),e.content=le.create(),e._tag="div",e._tab.id="p"+e.id(),e}return re(e,t),e.prototype.getWidget=function(t){if(t instanceof he)return t.widget},e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some((function(i){return i.widget===t&&(e=i,!0)})),e},e.prototype.addWidget=function(t,e,i){void 0===i&&(i={}),this._prevActive||(this._prevActive=t);var n=new he(this,t,void 0,void 0,i);return n.title.label=e,n.padding=8,this._tab.addWidget(n),this.content.push(n),this},e.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);if(e){var i=this.content.indexOf(e);i>=0&&this.content.splice(i,1),t.target(null),e.dispose()}return this},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),pt.attach(this._tab,e)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,(function(t){i.content.watchRendered(i,e),i._tab.update()}))},e.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},e.prototype.processMessage=function(t){if("wa-activate-request"===t.type){var e=t.wa.widget;this._prevActive!==e&&(this._prevActive=e,this.childActivation(e))}},e.prototype.childActivation=function(t){},e.prototype.active=function(t){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(t),this):this.getWidget(this._tab.currentWidget)},e}(e.HTMLWidget);ge.prototype._class+=" phosphor_TabPanel",t.BUILD_VERSION="2.104.5",t.ContextMenu=Wt,t.DockPanel=fe,t.PKG_NAME="@hpcc-js/phosphor",t.PKG_VERSION="2.16.2",t.SplitPanel=me,t.TabPanel=ge,t.WidgetAdapter=he,t.WidgetAdapterArray=le,Object.defineProperty(t,"__esModule",{value:!0})}));
61
+ var st=function(t,e){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},st(t,e)};function at(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var dt=function(){return dt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dt.apply(this,arguments)};var ct,ht=function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1};!function(t){t.calc=function(t,e){var i=t.length;if(0===i)return e;for(var n=0,o=0,r=0,s=0,a=0,d=0;d<i;++d){var c=(y=t[d]).minSize,h=y.maxSize,l=y.sizeHint;y.done=!1,y.size=Math.max(c,Math.min(l,h)),r+=y.size,n+=c,o+=h,y.stretch>0&&(s+=y.stretch,a++)}if(e===r)return 0;if(e<=n){for(d=0;d<i;++d){(y=t[d]).size=y.minSize}return e-n}if(e>=o){for(d=0;d<i;++d){(y=t[d]).size=y.maxSize}return e-o}var u=.01,p=i;if(e<r){for(var f=r-e;a>0&&f>u;){var m=f,g=s;for(d=0;d<i;++d){if(!(y=t[d]).done&&0!==y.stretch){var v=y.stretch*m/g;y.size-v<=y.minSize?(f-=y.size-y.minSize,s-=y.stretch,y.size=y.minSize,y.done=!0,p--,a--):(f-=v,y.size-=v)}}}for(;p>0&&f>u;)for(v=f/p,d=0;d<i;++d){(y=t[d]).done||(y.size-v<=y.minSize?(f-=y.size-y.minSize,y.size=y.minSize,y.done=!0,p--):(f-=v,y.size-=v))}}else{for(f=e-r;a>0&&f>u;)for(m=f,g=s,d=0;d<i;++d){if(!(y=t[d]).done&&0!==y.stretch){v=y.stretch*m/g;y.size+v>=y.maxSize?(f-=y.maxSize-y.size,s-=y.stretch,y.size=y.maxSize,y.done=!0,p--,a--):(f-=v,y.size+=v)}}for(;p>0&&f>u;)for(v=f/p,d=0;d<i;++d){var y;(y=t[d]).done||(y.size+v>=y.maxSize?(f-=y.maxSize-y.size,y.size=y.maxSize,y.done=!0,p--):(f-=v,y.size+=v))}}return 0},t.adjust=function(t,e,i){0!==t.length&&0!==i&&(i>0?function(t,e,i){for(var n=0,o=0;o<=e;++o){n+=(c=t[o]).maxSize-c.size}for(var r=0,s=(o=e+1,t.length);o<s;++o){r+=(c=t[o]).size-c.minSize}var a=i=Math.min(i,n,r);for(o=e;o>=0&&a>0;--o){(h=(c=t[o]).maxSize-c.size)>=a?(c.sizeHint=c.size+a,a=0):(c.sizeHint=c.size+h,a-=h)}var d=i;for(o=e+1,s=t.length;o<s&&d>0;++o){var c,h;(h=(c=t[o]).size-c.minSize)>=d?(c.sizeHint=c.size-d,d=0):(c.sizeHint=c.size-h,d-=h)}}(t,e,i):function(t,e,i){for(var n=0,o=e+1,r=t.length;o<r;++o){n+=(c=t[o]).maxSize-c.size}var s=0;for(o=0;o<=e;++o){s+=(c=t[o]).size-c.minSize}var a=i=Math.min(i,n,s);for(o=e+1,r=t.length;o<r&&a>0;++o){(h=(c=t[o]).maxSize-c.size)>=a?(c.sizeHint=c.size+a,a=0):(c.sizeHint=c.size+h,a-=h)}var d=i;for(o=e;o>=0&&d>0;--o){var c,h;(h=(c=t[o]).size-c.minSize)>=d?(c.sizeHint=c.size-d,d=0):(c.sizeHint=c.size-h,d-=h)}}(t,e,-i))}}(ct||(ct={}));var lt,ut=function(){function t(t){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new S(this),this._isDisposed=!1,this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon?"string"==typeof t.icon?(this._icon=null,this._iconClass=t.icon):this._icon=t.icon:this._icon=null,void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.iconRenderer&&(this._icon=t.iconRenderer),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return null===this._icon?this.iconClass:this._icon},set:function(t){if("string"==typeof t)this._icon=null,this.iconClass=t;else{if(this._icon===t)return;this._icon=t,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(t){this.icon=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,S.clearData(this))},t}(),pt=function(){function t(e){void 0===e&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new S(this),this._hiddenMode=t.HiddenMode.Display,this.node=lt.createNode(e),this.addClass("lm-Widget"),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),S.clearData(this),Y.clearData(this),J.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return lt.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){if(this._hiddenMode!==e){switch(this._hiddenMode=e,e){case t.HiddenMode.Display:this.node.style.willChange="auto";break;case t.HiddenMode.Scale:this.node.style.willChange="transform"}this.isHidden&&(e===t.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(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var i=new t.ChildMessage("child-removed",this);Y.sendMessage(this._parent,i)}if(this._parent=e,this._parent&&!this._parent.isDisposed){i=new t.ChildMessage("child-added",this);Y.sendMessage(this._parent,i)}this.isDisposed||Y.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():d()},t.prototype.contains=function(t){for(var e=t;e;e=e._parent)if(e===this)return!0;return!1},t.prototype.hasClass=function(t){return this.node.classList.contains(t)},t.prototype.addClass=function(t){this.node.classList.add(t)},t.prototype.removeClass=function(t){this.node.classList.remove(t)},t.prototype.toggleClass=function(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)},t.prototype.update=function(){Y.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){Y.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){Y.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){Y.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this.hiddenMode===t.HiddenMode.Display?(this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")):this.node.style.transform="",!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);Y.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||Y.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this.hiddenMode===t.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||Y.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);Y.sendMessage(this.parent,e)}},t.prototype.setHidden=function(t){t?this.hide():this.show()},t.prototype.testFlag=function(t){return 0!=(this._flags&t)},t.prototype.setFlag=function(t){this._flags|=t},t.prototype.clearFlag=function(t){this._flags&=~t},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}},t.prototype.notifyLayout=function(t){this._layout&&this._layout.processParentMessage(t)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(t){},t.prototype.onUpdateRequest=function(t){},t.prototype.onFitRequest=function(t){},t.prototype.onActivateRequest=function(t){},t.prototype.onBeforeShow=function(t){},t.prototype.onAfterShow=function(t){},t.prototype.onBeforeHide=function(t){},t.prototype.onAfterHide=function(t){},t.prototype.onBeforeAttach=function(t){},t.prototype.onAfterAttach=function(t){},t.prototype.onBeforeDetach=function(t){},t.prototype.onAfterDetach=function(t){},t.prototype.onChildAdded=function(t){},t.prototype.onChildRemoved=function(t){},t}();!function(t){var e,i,n;(e=t.HiddenMode||(t.HiddenMode={}))[e.Display=0]="Display",e[e.Scale=1]="Scale",(i=t.Flag||(t.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",(n=t.Msg||(t.Msg={})).BeforeShow=new X("before-show"),n.AfterShow=new X("after-show"),n.BeforeHide=new X("before-hide"),n.AfterHide=new X("after-hide"),n.BeforeAttach=new X("before-attach"),n.AfterAttach=new X("after-attach"),n.BeforeDetach=new X("before-detach"),n.AfterDetach=new X("after-detach"),n.ParentChanged=new X("parent-changed"),n.UpdateRequest=new G("update-request"),n.FitRequest=new G("fit-request"),n.ActivateRequest=new G("activate-request"),n.CloseRequest=new G("close-request");var o=function(t){function e(e,i){var n=t.call(this,e)||this;return n.child=i,n}return at(e,t),e}(X);t.ChildMessage=o;var r=function(t){function e(e,i){var n=t.call(this,"resize")||this;return n.width=e,n.height=i,n}return at(e,t),e}(X);t.ResizeMessage=r,function(t){t.UnknownSize=new t(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,i,n){if(void 0===n&&(n=null),e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw new Error("Widget is already attached.");if(!i.isConnected)throw new Error("Host is not attached.");Y.sendMessage(e,t.Msg.BeforeAttach),i.insertBefore(e.node,n),Y.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw new Error("Widget is not attached.");Y.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),Y.sendMessage(e,t.Msg.AfterDetach)}}(pt||(pt={})),function(t){t.titleProperty=new J({name:"title",create:function(t){return new ut({owner:t})}}),t.createNode=function(t){return t.node||document.createElement(t.tag||"div")}}(lt||(lt={}));var ft=function(){function t(t){void 0===t&&(t={}),this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,S.clearData(this),J.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){var e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}},t.prototype.init=function(){var t=this;o(this,(function(e){e.parent=t.parent}))},t.prototype.onResize=function(t){o(this,(function(t){Y.sendMessage(t,pt.ResizeMessage.UnknownSize)}))},t.prototype.onUpdateRequest=function(t){o(this,(function(t){Y.sendMessage(t,pt.ResizeMessage.UnknownSize)}))},t.prototype.onBeforeAttach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onAfterAttach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onBeforeDetach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onAfterDetach=function(t){o(this,(function(e){Y.sendMessage(e,t)}))},t.prototype.onBeforeShow=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onAfterShow=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onBeforeHide=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onAfterHide=function(t){o(this,(function(e){e.isHidden||Y.sendMessage(e,t)}))},t.prototype.onChildRemoved=function(t){this.removeWidget(t.child)},t.prototype.onFitRequest=function(t){},t.prototype.onChildShown=function(t){},t.prototype.onChildHidden=function(t){},t}();!function(t){t.getHorizontalAlignment=function(t){return mt.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){mt.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return mt.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){mt.verticalAlignmentProperty.set(t,e)}}(ft||(ft={}));var mt,gt=function(){function t(t){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=t,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.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 t=E.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight},t.prototype.update=function(t,e,i,n){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o<i)switch(ft.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(i-o)/2;break;case"right":t+=i-o;break;default:throw"unreachable"}if(r<n)switch(ft.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(n-r)/2;break;case"bottom":e+=n-r;break;default:throw"unreachable"}var s=!1,a=this.widget.node.style;if(this._top!==e&&(this._top=e,a.top=e+"px"),this._left!==t&&(this._left=t,a.left=t+"px"),this._width!==o&&(s=!0,this._width=o,a.width=o+"px"),this._height!==r&&(s=!0,this._height=r,a.height=r+"px"),s){var d=new pt.ResizeMessage(o,r);Y.sendMessage(this.widget,d)}},t}();!function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new J({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new J({name:"verticalAlignment",create:function(){return"top"},changed:e})}(mt||(mt={}));var vt,yt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgets=[],e}return at(e,t),e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return n(this._widgets)},e.prototype.addWidget=function(t){this.insertWidget(this._widgets.length,t)},e.prototype.insertWidget=function(t,e){e.parent=this.parent;var n=this._widgets.indexOf(e),o=Math.max(0,Math.min(t,this._widgets.length));if(-1===n)return i.insert(this._widgets,o,e),void(this.parent&&this.attachWidget(o,e));o===this._widgets.length&&o--,n!==o&&(i.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,e))},e.prototype.removeWidget=function(t){this.removeWidgetAt(this._widgets.indexOf(t))},e.prototype.removeWidgetAt=function(t){var e=i.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t,i){e.attachWidget(i,t)}))},e.prototype.attachWidget=function(t,e){var i=this.parent.node.children[t];this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,i),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach)},e.prototype.moveWidget=function(t,e,i){this.parent.isAttached&&Y.sendMessage(i,pt.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Y.sendMessage(i,pt.Msg.AfterDetach);var n=this.parent.node.children[e];this.parent.isAttached&&Y.sendMessage(i,pt.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&Y.sendMessage(i,pt.Msg.AfterAttach)},e.prototype.detachWidget=function(t,e){this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach)},e}(ft);!function(t){t.clampDimension=function(t){return Math.max(0,Math.floor(t))}}(vt||(vt={}));var bt,_t=vt,wt=function(t){function e(e){var i=t.call(this)||this;return i.widgetOffset=0,i._fixed=0,i._spacing=4,i._dirty=!1,i._hasNormedSizes=!1,i._sizers=[],i._items=[],i._handles=[],i._box=null,i._alignment="start",i._orientation="horizontal",i.renderer=e.renderer,void 0!==e.orientation&&(i._orientation=e.orientation),void 0!==e.alignment&&(i._alignment=e.alignment),void 0!==e.spacing&&(i._spacing=vt.clampDimension(e.spacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=vt.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.absoluteSizes=function(){return this._sizers.map((function(t){return t.size}))},e.prototype.relativeSizes=function(){return bt.normalize(this._sizers.map((function(t){return t.size})))},e.prototype.setRelativeSizes=function(t,e){void 0===e&&(e=!0);for(var i=this._sizers.length,n=t.slice(0,i);n.length<i;)n.push(0);for(var o=bt.normalize(n),r=0;r<i;++r){var s=this._sizers[r];s.sizeHint=o[r],s.size=o[r]}this._hasNormedSizes=!0,e&&this.parent&&this.parent.update()},e.prototype.moveHandle=function(t,e){var i,n=this._handles[t];if(n&&!n.classList.contains("lm-mod-hidden")&&0!==(i="horizontal"===this._orientation?e-n.offsetLeft:e-n.offsetTop)){for(var o=0,r=this._sizers;o<r.length;o++){var s=r[o];s.size>0&&(s.sizeHint=s.size)}ct.adjust(this._sizers,t,i),this.parent&&this.parent.update()}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){var n=new gt(e),o=bt.createHandle(this.renderer),r=bt.averageSize(this._sizers),s=bt.createSizer(r);i.insert(this._items,t,n),i.insert(this._sizers,t,s),i.insert(this._handles,t,o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),i.move(this._sizers,t,e),i.move(this._handles,t,e),this.parent.fit()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t),o=i.removeAt(this._handles,t);i.removeAt(this._sizers,t),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(o),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype.updateItemPosition=function(t,e,i,n,o,r,s){var a=this._items[t];if(!a.isHidden){var d=this._handles[t].style;e?(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")}},e.prototype._fit=function(){for(var t=0,i=-1,n=0,o=this._items.length;n<o;++n)this._items[n].isHidden?(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].classList.add("p-mod-hidden")):(this._handles[n].classList.remove("lm-mod-hidden"),this._handles[n].classList.remove("p-mod-hidden"),i=n,t++);-1!==i&&(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,t-1)+this.widgetOffset*this._items.length;var r="horizontal"===this._orientation,s=r?this._fixed:0,a=r?0:this._fixed;for(n=0,o=this._items.length;n<o;++n){var d=this._items[n],c=this._sizers[n];c.size>0&&(c.sizeHint=c.size),d.isHidden?(c.minSize=0,c.maxSize=0):(d.fit(),c.stretch=e.getStretch(d.widget),r?(c.minSize=d.minWidth,c.maxSize=d.maxWidth,s+=d.minWidth,a=Math.max(a,d.minHeight)):(c.minSize=d.minHeight,c.maxSize=d.maxHeight,a+=d.minHeight,s=Math.max(s,d.minWidth)))}var h=this._box=E.boxSizing(this.parent.node);s+=h.horizontalSum,a+=h.verticalSum;var l=this.parent.node.style;l.minWidth=s+"px",l.minHeight=a+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i||0!==this.widgetOffset){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r=this._box.paddingTop,s=this._box.paddingLeft,a=t-this._box.horizontalSum,d=e-this._box.verticalSum,c=0,h=0,l="horizontal"===this._orientation;if(i>0){var u=void 0;if(u=l?Math.max(0,a-this._fixed):Math.max(0,d-this._fixed),this._hasNormedSizes){for(var p=0,f=this._sizers;p<f.length;p++){f[p].sizeHint*=u}this._hasNormedSizes=!1}var m=ct.calc(this._sizers,u);if(m>0)switch(this._alignment){case"start":break;case"center":c=0,h=m/2;break;case"end":c=0,h=m;break;case"justify":c=m/i,h=0;break;default:throw"unreachable"}}for(n=0,o=this._items.length;n<o;++n){var g=this._items[n].isHidden?0:this._sizers[n].size+c;this.updateItemPosition(n,l,l?s+h:s,l?r:r+h,d,a,g);var v=this.widgetOffset+(this._handles[n].classList.contains("lm-mod-hidden")?0:this._spacing);l?s+=g+v:r+=g+v}}},e}(yt);!function(t){t.getStretch=function(t){return bt.stretchProperty.get(t)},t.setStretch=function(t,e){bt.stretchProperty.set(t,e)}}(wt||(wt={})),function(t){t.stretchProperty=new J({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:function(t){t.parent&&t.parent.layout instanceof wt&&t.parent.fit()}}),t.createSizer=function(t){var e=new ht;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){var e=t.createHandle();return e.style.position="absolute",e},t.averageSize=function(t){return t.reduce((function(t,e){return t+e.size}),0)/t.length||0},t.normalize=function(t){var e=t.length;if(0===e)return[];var i=t.reduce((function(t,e){return t+Math.abs(e)}),0);return 0===i?t.map((function(t){return 1/e})):t.map((function(t){return t/i}))}}(bt||(bt={}));var xt,Mt=function(t){function e(e){var i=t.call(this,dt(dt({},e),{orientation:e.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=e.titleSpace||22,i}return at(e,t),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(t){t=_t.clampDimension(t),this.widgetOffset!==t&&(this.widgetOffset=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,t.prototype.dispose.call(this))},e.prototype.updateTitle=function(t,e){var i=this._titles[t],n=i.classList.contains("lm-mod-expanded"),o=xt.createTitle(this.renderer,e.title,n);this._titles[t]=o,this.parent.node.replaceChild(o,i)},e.prototype.attachWidget=function(e,n){var o=xt.createTitle(this.renderer,n.title);i.insert(this._titles,e,o),this.parent.node.appendChild(o),n.node.setAttribute("role","region"),n.node.setAttribute("aria-labelledby",o.id),t.prototype.attachWidget.call(this,e,n)},e.prototype.moveWidget=function(e,n,o){i.move(this._titles,e,n),t.prototype.moveWidget.call(this,e,n,o)},e.prototype.detachWidget=function(e,n){var o=i.removeAt(this._titles,e);this.parent.node.removeChild(o),t.prototype.detachWidget.call(this,e,n)},e.prototype.updateItemPosition=function(e,i,n,o,r,s,a){var d=this._titles[e].style;d.top=o+"px",d.left=n+"px",d.height=this.widgetOffset+"px",d.width=i?r+"px":s+"px",t.prototype.updateItemPosition.call(this,e,i,n,o,r,s,a)},e}(wt);!function(t){t.createTitle=function(t,e,i){void 0===i&&(i=!0);var n=t.createSectionTitle(e);return n.style.position="absolute",n.setAttribute("aria-label",e.label+" Section"),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",e.owner.id),i&&n.classList.add("lm-mod-expanded"),n}}(xt||(xt={}));var Ct,zt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=Ct.createLayout(e),i}return at(e,t),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.layout.addWidget(t)},e.prototype.insertWidget=function(t,e){this.layout.insertWidget(t,e)},e}(pt);!function(t){t.createLayout=function(t){return t.layout||new yt}}(Ct||(Ct={}));var St,Pt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:St.createLayout(e)})||this;return i._handleMoved=new S(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(t){this.layout.orientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(t,e){void 0===e&&(e=!0),this.layout.setRelativeSizes(t,e)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){t.child.addClass("lm-SplitPanel-child"),t.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-SplitPanel-child"),t.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(t){this._pressData&&(t.preventDefault(),t.stopPropagation()),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=i.findFirstIndex(e.handles,(function(e){return e.contains(t.target)}));if(-1!==n){var o;t.preventDefault(),t.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=e.handles[n],s=r.getBoundingClientRect();o="horizontal"===e.orientation?t.clientX-s.left:t.clientY-s.top;var a=window.getComputedStyle(r),d=$.overrideCursor(a.cursor);this._pressData={index:n,delta:o,override:d}}}},e.prototype._evtMouseMove=function(t){var e;t.preventDefault(),t.stopPropagation();var i=this.layout,n=this.node.getBoundingClientRect();e="horizontal"===i.orientation?t.clientX-n.left-this._pressData.delta:t.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,e)},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.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))},e}(zt);!function(t){var e=function(){function t(){}return t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="lm-SplitPanel-handle",t.classList.add("p-SplitPanel-handle"),t},t}();t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return wt.getStretch(t)},t.setStretch=function(t,e){wt.setStretch(t,e)}}(Pt||(Pt={})),function(t){t.createLayout=function(t){return t.layout||new wt({renderer:t.renderer||Pt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(St||(St={}));var At,It=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,dt(dt({},e),{layout:At.createLayout(e)}))||this;return i._widgetSizesCache=new WeakMap,i.addClass("lm-AccordionPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(t){this.layout.titleSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(e){t.prototype.addWidget.call(this,e),e.title.changed.connect(this._onTitleChanged,this)},e.prototype.collapse=function(t){var e=this.layout.widgets[t];e&&!e.isHidden&&this._toggleExpansion(t)},e.prototype.expand=function(t){var e=this.layout.widgets[t];e&&e.isHidden&&this._toggleExpansion(t)},e.prototype.insertWidget=function(e,i){t.prototype.insertWidget.call(this,e,i),i.title.changed.connect(this._onTitleChanged,this)},e.prototype.handleEvent=function(e){switch(t.prototype.handleEvent.call(this,e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}},e.prototype.onBeforeAttach=function(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),t.prototype.onBeforeAttach.call(this,e)},e.prototype.onAfterDetach=function(e){t.prototype.onAfterDetach.call(this,e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},e.prototype._onTitleChanged=function(t){var e=i.findFirstIndex(this.widgets,(function(e){return e.contains(t.owner)}));e>=0&&(this.layout.updateTitle(e,t.owner),this.update())},e.prototype._computeWidgetSize=function(t){var e=this.layout,i=e.widgets[t];if(i){var n=i.isHidden,o=e.absoluteSizes(),r=(n?-1:1)*this.spacing,s=o.reduce((function(t,e){return t+e})),a=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n}(o);if(n){var d=this._widgetSizesCache.get(i);if(!d)return;a[t]+=d,-1===(c=a.map((function(t){return t-d>0})).lastIndexOf(!0))?a.forEach((function(e,i){i!==t&&(a[i]-=o[i]/s*(d-r))})):a[c]-=d-r}else{var c,h=o[t];if(this._widgetSizesCache.set(i,h),a[t]=0,-1===(c=a.map((function(t){return t>0})).lastIndexOf(!0)))return;a[c]=o[c]+h+r}return a.map((function(t){return t/(s+r)}))}},e.prototype._evtClick=function(t){var e=t.target;if(e){var n=i.findFirstIndex(this.titles,(function(t){return t.contains(e)}));n>=0&&(t.preventDefault(),t.stopPropagation(),this._toggleExpansion(n))}},e.prototype._eventKeyDown=function(t){if(!t.defaultPrevented){var e=t.target,n=!1;if(e){var o=i.findFirstIndex(this.titles,(function(t){return t.contains(e)}));if(o>=0){var r=t.keyCode.toString();if(t.key.match(/Space|Enter/)||r.match(/13|32/))e.click(),n=!0;else if("horizontal"===this.orientation?t.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):t.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){var s=t.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"===t.key||"35"===r?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==t.key&&"36"!==r||(this.titles[0].focus(),n=!0)}n&&t.preventDefault()}}},e.prototype._toggleExpansion=function(t){var e=this.titles[t],i=this.layout.widgets[t],n=this._computeWidgetSize(t);n&&this.setRelativeSizes(n,!1),i.isHidden?(e.classList.add("lm-mod-expanded"),e.setAttribute("aria-expanded","true"),i.show()):(e.classList.remove("lm-mod-expanded"),e.setAttribute("aria-expanded","false"),i.hide())},e}(Pt);!function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.titleClassName="lm-AccordionPanel-title",e._titleID=0,e._titleKeys=new WeakMap,e}return at(e,t),e.prototype.createCollapseIcon=function(t){return document.createElement("span")},e.prototype.createSectionTitle=function(t){var e=document.createElement("h3");for(var i in e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.id=this.createTitleKey(t),e.className=this.titleClassName,e.title=t.caption,t.dataset)e.dataset[i]=t.dataset[i];e.appendChild(this.createCollapseIcon(t)).className="lm-AccordionPanel-titleCollapser";var n=e.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=t.label,e},e.prototype.createTitleKey=function(t){var e=this._titleKeys.get(t);return void 0===e&&(e="title-key-"+this._titleID++,this._titleKeys.set(t,e)),e},e}(Pt.Renderer);t.Renderer=e,t.defaultRenderer=new e}(It||(It={})),function(t){t.createLayout=function(t){return t.layout||new Mt({renderer:t.renderer||It.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(At||(At={}));var Tt,Lt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._sizers=[],i._items=[],i._box=null,i._alignment="start",i._direction="top-to-bottom",void 0!==e.direction&&(i._direction=e.direction),void 0!==e.alignment&&(i._alignment=e.alignment),void 0!==e.spacing&&(i._spacing=_t.clampDimension(e.spacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=_t.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){i.insert(this._items,t,new gt(e)),i.insert(this._sizers,t,new ht),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),i.move(this._sizers,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t);i.removeAt(this._sizers,t),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,i=0,n=this._items.length;i<n;++i)t+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var o=Tt.isHorizontal(this._direction),r=o?this._fixed:0,s=o?0:this._fixed;for(i=0,n=this._items.length;i<n;++i){var a=this._items[i],d=this._sizers[i];a.isHidden?(d.minSize=0,d.maxSize=0):(a.fit(),d.sizeHint=e.getSizeBasis(a.widget),d.stretch=e.getStretch(a.widget),o?(d.minSize=a.minWidth,d.maxSize=a.maxWidth,r+=a.minWidth,s=Math.max(s,a.minHeight)):(d.minSize=a.minHeight,d.maxSize=a.maxHeight,s+=a.minHeight,r=Math.max(r,a.minWidth)))}var c=this._box=E.boxSizing(this.parent.node);r+=c.horizontalSum,s+=c.verticalSum;var h=this.parent.node.style;h.minWidth=r+"px",h.minHeight=s+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r,s=this._box.paddingTop,a=this._box.paddingLeft,d=t-this._box.horizontalSum,c=e-this._box.verticalSum;switch(this._direction){case"left-to-right":r=ct.calc(this._sizers,Math.max(0,d-this._fixed));break;case"top-to-bottom":r=ct.calc(this._sizers,Math.max(0,c-this._fixed));break;case"right-to-left":r=ct.calc(this._sizers,Math.max(0,d-this._fixed)),a+=d;break;case"bottom-to-top":r=ct.calc(this._sizers,Math.max(0,c-this._fixed)),s+=c;break;default:throw"unreachable"}var h=0,l=0;if(r>0)switch(this._alignment){case"start":break;case"center":h=0,l=r/2;break;case"end":h=0,l=r;break;case"justify":h=r/i,l=0;break;default:throw"unreachable"}for(n=0,o=this._items.length;n<o;++n){var u=this._items[n];if(!u.isHidden){var p=this._sizers[n].size;switch(this._direction){case"left-to-right":u.update(a+l,s,p+h,c),a+=p+h+this._spacing;break;case"top-to-bottom":u.update(a,s+l,d,p+h),s+=p+h+this._spacing;break;case"right-to-left":u.update(a-l-p-h,s,p+h,c),a-=p+h+this._spacing;break;case"bottom-to-top":u.update(a,s-l-p-h,d,p+h),s-=p+h+this._spacing;break;default:throw"unreachable"}}}}},e}(yt);!function(t){t.getStretch=function(t){return Tt.stretchProperty.get(t)},t.setStretch=function(t,e){Tt.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return Tt.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){Tt.sizeBasisProperty.set(t,e)}}(Lt||(Lt={})),function(t){function e(t){t.parent&&t.parent.layout instanceof Lt&&t.parent.fit()}t.stretchProperty=new J({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.sizeBasisProperty=new J({name:"sizeBasis",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(Tt||(Tt={}));var Et,Bt,kt,Dt,Ot=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:Et.createLayout(e)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(t){this.layout.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("lm-BoxPanel-child"),t.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-BoxPanel-child"),t.child.removeClass("p-BoxPanel-child")},e}(zt);!function(t){t.getStretch=function(t){return Lt.getStretch(t)},t.setStretch=function(t,e){Lt.setStretch(t,e)},t.getSizeBasis=function(t){return Lt.getSizeBasis(t)},t.setSizeBasis=function(t,e){Lt.setSizeBasis(t,e)}}(Ot||(Ot={})),function(t){t.createLayout=function(t){return t.layout||new Lt(t)}}(Et||(Et={})),t.CommandPalette=function(t){function e(i){var n=t.call(this,{node:Dt.createNode()})||this;return n._activeIndex=-1,n._items=[],n._results=null,n.addClass("lm-CommandPalette"),n.addClass("p-CommandPalette"),n.setFlag(pt.Flag.DisallowLayout),n.commands=i.commands,n.renderer=i.renderer||e.defaultRenderer,n.commands.commandChanged.connect(n._onGenericChange,n),n.commands.keyBindingChanged.connect(n._onGenericChange,n),n}return at(e,t),e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(t){var e=Dt.createItem(this.commands,t);return this._items.push(e),this.refresh(),e},e.prototype.addItems=function(t){var e=this,i=t.map((function(t){return Dt.createItem(e.commands,t)}));return i.forEach((function(t){return e._items.push(t)})),this.refresh(),i},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){i.removeAt(this._items,t)&&this.refresh()},e.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},e.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()},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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)},e.prototype.onActivateRequest=function(t){if(this.isAttached){var e=this.inputNode;e.focus(),e.select()}},e.prototype.onUpdateRequest=function(t){var e=this.inputNode.value,n=this.contentNode,o=this._results;if(o||(o=this._results=Dt.search(this._items,e),this._activeIndex=e?i.findFirstIndex(o,Dt.canActivate):-1),e||0!==o.length)if(e&&0===o.length){var r=this.renderer.renderEmptyMessage({query:e});et.render(r,n)}else{for(var s=this.renderer,a=this._activeIndex,d=new Array(o.length),c=0,h=o.length;c<h;++c){var l=o[c];if("header"===l.type){var u=l.indices,p=l.category;d[c]=s.renderHeader({category:p,indices:u})}else{var f=l.item,m=(u=l.indices,c===a);d[c]=s.renderItem({item:f,indices:u,active:m})}}if(et.render(d,n),a<0||a>=o.length)n.scrollTop=0;else{var g=n.children[a];E.scrollIntoViewIfNeeded(n,g)}}else et.render(null,n)},e.prototype._evtClick=function(t){if(0===t.button){if(t.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();var e=i.findFirstIndex(this.contentNode.children,(function(e){return e.contains(t.target)}));-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}},e.prototype._evtKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}},e.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<e-1?t+1:0,o=0===n?e-1:n-1;this._activeIndex=i.findFirstIndex(this._results,Dt.canActivate,n,o),this.update()}},e.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<=0?e-1:t-1,o=n===e-1?0:n+1;this._activeIndex=i.findLastIndex(this._results,Dt.canActivate,n,o),this.update()}},e.prototype._execute=function(t){if(this._results){var e=this._results[t];if(e){if("header"===e.type){var i=this.inputNode;return i.value=e.category.toLowerCase()+" ",i.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var t=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",t),this.toggleClass("p-mod-focused",t)},e.prototype._onGenericChange=function(){this.refresh()},e}(pt),Bt=t.CommandPalette||(t.CommandPalette={}),kt=function(){function e(){}return e.prototype.renderHeader=function(t){var e=this.formatHeader(t);return rt.li({className:"lm-CommandPalette-header p-CommandPalette-header"},e)},e.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t);return t.item.isToggleable?rt.li({className:e,dataset:i,role:"checkbox","aria-checked":""+t.item.isToggled},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t)):rt.li({className:e,dataset:i},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))},e.prototype.renderEmptyMessage=function(t){var e=this.formatEmptyMessage(t);return rt.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},e)},e.prototype.renderItemIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.item.icon?rt.div({className:e},t.item.iconLabel):rt.div({className:e},t.item.icon,t.item.iconLabel)},e.prototype.renderItemContent=function(t){return rt.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))},e.prototype.renderItemLabel=function(t){var e=this.formatItemLabel(t);return rt.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},e)},e.prototype.renderItemCaption=function(t){var e=this.formatItemCaption(t);return rt.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},e)},e.prototype.renderItemShortcut=function(t){var e=this.formatItemShortcut(t);return rt.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},e)},e.prototype.createItemClass=function(t){var e="lm-CommandPalette-item";e+=" p-CommandPalette-item",t.item.isEnabled||(e+=" lm-mod-disabled",e+=" p-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled",e+=" p-mod-toggled"),t.active&&(e+=" lm-mod-active",e+=" p-mod-active");var i=t.item.className;return i&&(e+=" "+i),e},e.prototype.createItemDataset=function(t){return dt(dt({},t.item.dataset),{command:t.item.command})},e.prototype.createIconClass=function(t){var e="lm-CommandPalette-itemIcon";e+=" p-CommandPalette-itemIcon";var i=t.item.iconClass;return i?e+" "+i:e},e.prototype.formatHeader=function(t){return t.indices&&0!==t.indices.length?y.highlight(t.category,t.indices,rt.mark):t.category},e.prototype.formatEmptyMessage=function(t){return"No commands found that match '"+t.query+"'"},e.prototype.formatItemShortcut=function(e){var i=e.item.keyBinding;return i?i.keys.map(t.CommandRegistry.formatKeystroke).join(", "):null},e.prototype.formatItemLabel=function(t){return t.indices&&0!==t.indices.length?y.highlight(t.item.label,t.indices,rt.mark):t.item.label},e.prototype.formatItemCaption=function(t){return t.item.caption},e}(),Bt.Renderer=kt,Bt.defaultRenderer=new kt,function(t){function e(t,e){for(var n=t.category.toLowerCase(),o=n+" "+t.label.toLowerCase(),r=1/0,s=null,a=/\b\w/g;;){var d=a.exec(o);if(!d)break;var c=y.matchSumOfDeltas(o,e,d.index);if(!c)break;c&&c.score<=r&&(r=c.score,s=c.indices)}if(!s||r===1/0)return null;for(var h=n.length+1,l=i.lowerBound(s,h,(function(t,e){return t-e})),u=s.slice(0,l),p=s.slice(l),f=0,m=p.length;f<m;++f)p[f]-=h;return 0===u.length?{matchType:0,categoryIndices:null,labelIndices:p,score:r,item:t}:0===p.length?{matchType:1,categoryIndices:u,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:u,labelIndices:p,score:r,item:t}}function n(t,e){var i=t.matchType-e.matchType;if(0!==i)return i;var n=t.score-e.score;if(0!==n)return n;var o=0,r=0;switch(t.matchType){case 0:o=t.labelIndices[0],r=e.labelIndices[0];break;case 1:case 2:o=t.categoryIndices[0],r=e.categoryIndices[0]}if(o!==r)return o-r;var s=t.item.category.localeCompare(e.item.category);if(0!==s)return s;var a=t.item.rank,d=e.item.rank;return a!==d?a<d?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),i=document.createElement("div"),n=document.createElement("input"),o=document.createElement("ul"),r=document.createElement("button");return e.className="lm-CommandPalette-search",i.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",r.className="lm-close-icon",o.className="lm-CommandPalette-content",e.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),e.appendChild(i),t.appendChild(e),t.appendChild(o),t},t.createItem=function(t,e){return new o(t,e)},t.search=function(t,o){var r=function(t,i){n=i,i=n.replace(/\s+/g,"").toLowerCase();var n;for(var o=[],r=0,s=t.length;r<s;++r){var a=t[r];if(a.isVisible)if(i){var d=e(a,i);d&&(a.isEnabled||(d.score+=1e3),o.push(d))}else o.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return o}(t,o);return r.sort(n),function(t){var e=new Array(t.length);i.fill(e,!1);for(var n=[],o=0,r=t.length;o<r;++o)if(!e[o]){var s=t[o],a=s.item,d=s.categoryIndices,c=a.category;n.push({type:"header",category:c,indices:d});for(var h=o;h<r;++h)if(!e[h]){var l=t[h],u=l.item,p=l.labelIndices;u.category===c&&(n.push({type:"item",item:u,indices:p}),e[h]=!0)}}return n}(r)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};var o=function(){function t(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||b.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}return Object.defineProperty(t.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){var t=this.command,e=this.args;return i.findLastValue(this._commands.keyBindings,(function(i){return i.command===t&&b.deepEqual(i.args,e)}))||null},enumerable:!0,configurable:!0}),t}()}(Dt||(Dt={}));var Rt,Nt=function(t){function e(i){var n=t.call(this,{node:Rt.createNode()})||this;return n._childIndex=-1,n._activeIndex=-1,n._openTimerID=0,n._closeTimerID=0,n._items=[],n._childMenu=null,n._parentMenu=null,n._aboutToClose=new S(n),n._menuRequested=new S(n),n.addClass("lm-Menu"),n.addClass("p-Menu"),n.setFlag(pt.Flag.DisallowLayout),n.commands=i.commands,n.renderer=i.renderer||e.defaultRenderer,n}return at(e,t),e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var t=this;t._parentMenu;)t=t._parentMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var t=this;t._childMenu;)t=t._childMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._items.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||Rt.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var t=this._items.length,e=this._activeIndex,n=e<t-1?e+1:0,o=0===n?t-1:n-1;this.activeIndex=i.findFirstIndex(this._items,Rt.canActivate,n,o)},e.prototype.activatePreviousItem=function(){var t=this._items.length,e=this._activeIndex,n=e<=0?t-1:e-1,o=n===t-1?0:n+1;this.activeIndex=i.findLastIndex(this._items,Rt.canActivate,n,o)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var t=this.activeItem;if(t)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==t.type){this.rootMenu.close();var e=t.command,i=t.args;this.commands.isEnabled(e,i)?this.commands.execute(e,i):console.log("Command '"+e+"' is disabled.")}else this._openChildMenu(!0)}},e.prototype.addItem=function(t){return this.insertItem(this._items.length,t)},e.prototype.insertItem=function(t,e){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(t,this._items.length)),o=Rt.createItem(this,e);return i.insert(this._items,n,o),this.update(),o},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){this.isAttached&&this.close(),this.activeIndex=-1,i.removeAt(this._items,t)&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},e.prototype.open=function(t,e,i){if(void 0===i&&(i={}),!this.isAttached){var n=i.forceX||!1,o=i.forceY||!1;Rt.openRootMenu(this,t,e,n,o),this.activate()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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)},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this,i=this._items,n=this.renderer,o=this._activeIndex,r=Rt.computeCollapsed(i),s=new Array(i.length),a=function(t,a){var d=i[t],c=t===o,h=r[t];s[t]=n.renderItem({item:d,active:c,collapsed:h,onfocus:function(){e.activeIndex=t}})},d=0,c=i.length;d<c;++d)a(d);et.render(s,this.contentNode)},e.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var i=this._childMenu;i&&(this._childIndex=-1,this._childMenu=null,i._parentMenu=null,i.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,e)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e)if(27!==e)if(37!==e)if(38!==e)if(39!==e)if(40!==e){var i=R().keyForKeydownEvent(t);if(i){var n=this._activeIndex+1,o=Rt.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()},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(t){var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(e!==this._activeIndex){if(this.activeIndex=e,(e=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}},e.prototype._evtMouseEnter=function(t){for(var e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex},e.prototype._evtMouseLeave=function(t){if(this._cancelOpenTimer(),this._childMenu){var e=t.clientX,i=t.clientY;E.hitTest(this._childMenu.node,e,i)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},e.prototype._evtMouseDown=function(t){this._parentMenu||(Rt.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())},e.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var e=this.activeItem;if(e&&"submenu"===e.type&&e.submenu){var i=e.submenu;if(i!==this._childMenu){this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,Y.sendMessage(this,pt.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex];Rt.openSubmenu(i,n),t&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var t=this;0===this._openTimerID&&(this._openTimerID=window.setTimeout((function(){t._openTimerID=0,t._openChildMenu()}),Rt.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var t=this;0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((function(){t._closeTimerID=0,t._closeChildMenu()}),Rt.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(pt);!function(e){var i=function(){function e(){}return e.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return rt.li(dt({className:e,dataset:i,tabindex:"0",onfocus:t.onfocus},n),this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))},e.prototype.renderIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.item.icon?rt.div({className:e},t.item.iconLabel):rt.div({className:e},t.item.icon,t.item.iconLabel)},e.prototype.renderLabel=function(t){var e=this.formatLabel(t);return rt.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},e)},e.prototype.renderShortcut=function(t){var e=this.formatShortcut(t);return rt.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},e)},e.prototype.renderSubmenu=function(t){return rt.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},e.prototype.createItemClass=function(t){var e="lm-Menu-item";e+=" p-Menu-item",t.item.isEnabled||(e+=" lm-mod-disabled",e+=" p-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled",e+=" p-mod-toggled"),t.item.isVisible||(e+=" lm-mod-hidden",e+=" p-mod-hidden"),t.active&&(e+=" lm-mod-active",e+=" p-mod-active"),t.collapsed&&(e+=" lm-mod-collapsed",e+=" p-mod-collapsed");var i=t.item.className;return i&&(e+=" "+i),e},e.prototype.createItemDataset=function(t){var e=t.item,i=e.type,n=e.command,o=e.dataset;return dt(dt({},o),"command"===i?{type:i,command:n}:{type:i})},e.prototype.createIconClass=function(t){var e="lm-Menu-itemIcon";e+=" p-Menu-itemIcon";var i=t.item.iconClass;return i?e+" "+i:e},e.prototype.createItemARIA=function(t){var e={};switch(t.item.type){case"separator":e.role="presentation";break;case"submenu":e["aria-haspopup"]="true",t.item.isEnabled||(e["aria-disabled"]="true");break;default:t.item.isEnabled||(e["aria-disabled"]="true"),e.role="menuitem"}return e},e.prototype.formatLabel=function(t){var e=t.item,i=e.label,n=e.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,rt.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},s),r]},e.prototype.formatShortcut=function(e){var i=e.item.keyBinding;return i?i.keys.map(t.CommandRegistry.formatKeystroke).join(", "):null},e}();e.Renderer=i,e.defaultRenderer=new i}(Nt||(Nt={})),function(t){function e(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-Menu-content",e.classList.add("p-Menu-content"),t.appendChild(e),e.setAttribute("role","menu"),t.tabIndex=0,t},t.canActivate=e,t.createItem=function(t,e){return new n(t.commands,e)},t.hitTestMenus=function(t,e,i){for(var n=t;n;n=n.childMenu)if(E.hitTest(n.node,e,i))return!0;return!1},t.computeCollapsed=function(t){var e=new Array(t.length);i.fill(e,!1);for(var n=0,o=t.length;n<o;++n){if((a=t[n]).isVisible){if("separator"!==a.type)break;e[n]=!0}}for(var r=o-1;r>=0;--r){if((a=t[r]).isVisible){if("separator"!==a.type)break;e[r]=!0}}for(var s=!1;++n<r;){var a;(a=t[n]).isVisible&&("separator"!==a.type?s=!1:s?e[n]=!0:s=!0)}return e},t.openRootMenu=function(t,e,i,n,o){Y.sendMessage(t,pt.Msg.UpdateRequest);var r=window.pageXOffset,s=window.pageYOffset,a=document.documentElement.clientWidth,d=document.documentElement.clientHeight,c=d-(o?i:0),h=t.node,l=h.style;l.top="",l.left="",l.width="",l.height="",l.visibility="hidden",l.maxHeight=c+"px",pt.attach(t,document.body);var u=h.getBoundingClientRect(),p=u.width,f=u.height;!n&&e+p>r+a&&(e=r+a-p),!o&&i+f>s+d&&(i>s+d?i=s+d-f:i-=f),l.top=Math.max(0,i)+"px",l.left=Math.max(0,e)+"px",l.visibility=""},t.openSubmenu=function(e,i){Y.sendMessage(e,pt.Msg.UpdateRequest);var n=window.pageXOffset,o=window.pageYOffset,r=document.documentElement.clientWidth,s=document.documentElement.clientHeight,a=s,d=e.node,c=d.style;c.top="",c.left="",c.width="",c.height="",c.visibility="hidden",c.maxHeight=a+"px",pt.attach(e,document.body);var h=d.getBoundingClientRect(),l=h.width,u=h.height,p=E.boxSizing(e.node),f=i.getBoundingClientRect(),m=f.right-t.SUBMENU_OVERLAP;m+l>n+r&&(m=f.left+t.SUBMENU_OVERLAP-l);var g=f.top-p.borderTop-p.paddingTop;g+u>o+s&&(g=f.bottom+p.borderBottom+p.paddingBottom-u),c.top=Math.max(0,g)+"px",c.left=Math.max(0,m)+"px",c.visibility=""},t.findMnemonic=function(t,i,n){for(var o=-1,r=-1,s=!1,a=i.toUpperCase(),d=0,c=t.length;d<c;++d){var h=(d+n)%c,l=t[h];if(e(l)){var u=l.label;if(0!==u.length){var p=l.mnemonic;p>=0&&p<u.length?u[p].toUpperCase()===a&&(-1===o?o=h:s=!0):-1===r&&u[0].toUpperCase()===a&&(r=h)}}}return{index:o,multiple:s,auto:r}};var n=function(){function t(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||b.emptyObject,this.submenu=e.submenu||null}return Object.defineProperty(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.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(t.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.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(t.prototype,"keyBinding",{get:function(){if("command"===this.type){var t=this.command,e=this.args;return i.findLastValue(this._commands.keyBindings,(function(i){return i.command===t&&b.deepEqual(i.args,e)}))||null}return null},enumerable:!0,configurable:!0}),t}()}(Rt||(Rt={}));var jt,Wt=function(){function t(t){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var e=t.groupByTarget,i=t.sortBySelector,n=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}(t,["groupByTarget","sortBySelector"]);this.menu=new Nt(n),this._groupByTarget=!1!==e,this._sortBySelector=!1!==i}return t.prototype.addItem=function(t){var e=this,n=jt.createItem(t,this._idTick++);return this._items.push(n),new I((function(){i.removeFirstOf(e._items,n)}))},t.prototype.open=function(t){var e=this;if(this.menu.clearItems(),0===this._items.length)return!1;var i=jt.matchItems(this._items,t,this._groupByTarget,this._sortBySelector);return!(!i||0===i.length)&&(o(i,(function(t){e.menu.addItem(t)})),this.menu.open(t.clientX,t.clientY),!0)},t}();!function(t){function e(t,e){var i=t.rank,n=e.rank;return i!==n?i<n?-1:1:t.id-e.id}function i(t,i){var n=k.calculateSpecificity(t.selector),o=k.calculateSpecificity(i.selector);return n!==o?o-n:e(t,i)}t.createItem=function(t,e){var i=function(t){if(-1!==t.indexOf(","))throw new Error("Selector cannot contain commas: "+t);if(!k.isValid(t))throw new Error("Invalid selector: "+t);return t}(t.selector),n=void 0!==t.rank?t.rank:1/0;return dt(dt({},t),{selector:i,rank:n,id:e})},t.matchItems=function(t,n,o,r){var s=n.target;if(!s)return null;var a=n.currentTarget;if(!a)return null;if(!(a.contains(s)||(s=document.elementFromPoint(n.clientX,n.clientY))&&a.contains(s)))return null;for(var d=[],c=t.slice();null!==s;){for(var h=[],l=0,u=c.length;l<u;++l){var p=c[l];p&&(k.matches(s,p.selector)&&(h.push(p),c[l]=null))}if(0!==h.length&&(o&&h.sort(r?i:e),d.push.apply(d,h)),s===a)break;s=s.parentElement}return o||d.sort(r?i:e),d}}(jt||(jt={}));var Ht,Ft=function(t){function e(i){void 0===i&&(i={});var n=t.call(this,{node:Ht.createNode()})||this;return n._currentIndex=-1,n._titles=[],n._titlesEditable=!1,n._previousTitle=null,n._dragData=null,n._addButtonEnabled=!1,n._tabMoved=new S(n),n._currentChanged=new S(n),n._addRequested=new S(n),n._tabCloseRequested=new S(n),n._tabDetachRequested=new S(n),n._tabActivateRequested=new S(n),n.addClass("lm-TabBar"),n.addClass("p-TabBar"),n.contentNode.setAttribute("role","tablist"),n.setFlag(pt.Flag.DisallowLayout),n._document=i.document||document,n.tabsMovable=i.tabsMovable||!1,n.titlesEditable=i.titlesEditable||!1,n.allowDeselect=i.allowDeselect||!1,n.addButtonEnabled=i.addButtonEnabled||!1,n.insertBehavior=i.insertBehavior||"select-tab-if-needed",n.name=i.name||"",n.orientation=i.orientation||"horizontal",n.removeBehavior=i.removeBehavior||"select-tab-after",n.renderer=i.renderer||e.defaultRenderer,n}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(t){this._titlesEditable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(t){this.currentIndex=t?this._titles.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex!==t){var e=this._currentIndex,i=this._titles[e]||null,n=t,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:i,currentIndex:n,currentTitle:o})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t,t?this.contentNode.setAttribute("aria-label",t):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.contentNode.setAttribute("aria-orientation",t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(t){this._addButtonEnabled!==t&&(this._addButtonEnabled=t,t?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(t){return this.insertTab(this._titles.length,t)},e.prototype.insertTab=function(t,e){this._releaseMouse();var n=Ht.asTitle(e),o=this._titles.indexOf(n),r=Math.max(0,Math.min(t,this._titles.length));return-1===o?(i.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||(i.move(this._titles,o,r),this.update(),this._adjustCurrentForMove(o,r)),n)},e.prototype.removeTab=function(t){this.removeTabAt(this._titles.indexOf(t))},e.prototype.removeTabAt=function(t){this._releaseMouse();var e=i.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))},e.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var t=0,e=this._titles;t<e.length;t++){e[t].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})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"dblclick":this._evtDblClick(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){for(var e=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(e.length),r=0,s=e.length;r<s;++r){var a=e[r],d=a===n,c=d?s:s-r-1;o[r]=i.renderTab({title:a,current:d,zIndex:c})}et.render(o,this.contentNode)},e.prototype._evtDblClick=function(t){if(this.titlesEditable){var e=this.contentNode.children,n=i.findFirstIndex(e,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(-1!==n){var o=this.titles[n],r=e[n].querySelector(".lm-TabBar-tabLabel");if(r&&r.contains(t.target)){var s=o.label||"",a=r.innerHTML;r.innerHTML="";var d=document.createElement("input");d.classList.add("lm-TabBar-tabInput"),d.value=s,r.appendChild(d);var c=function(){d.removeEventListener("blur",c),r.innerHTML=a};d.addEventListener("dblclick",(function(t){return t.stopPropagation()})),d.addEventListener("blur",c),d.addEventListener("keydown",(function(t){"Enter"===t.key?(""!==d.value&&(o.label=o.caption=d.value),c()):"Escape"===t.key&&c()})),d.select(),d.focus(),r.children.length>0&&r.children[0].focus()}}}},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if((0===t.button||1===t.button)&&!this._dragData){var e=this.addButtonEnabled&&this.addButtonNode.contains(t.target),n=this.contentNode.children,o=i.findFirstIndex(n,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if((-1!==o||e)&&(t.preventDefault(),t.stopPropagation(),this._dragData={tab:n[o],index:o,pressX:t.clientX,pressY:t.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!==t.button&&!e)){var r=n[o].querySelector(this.renderer.closeIconSelector);r&&r.contains(t.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===o?this.currentIndex=-1:this.currentIndex=o,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(t){var e=this._dragData;if(e){t.preventDefault(),t.stopPropagation();var i=this.contentNode.children;if(e.dragActive||Ht.dragExceeded(e,t)){if(!e.dragActive){var n=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=n.width,e.tabPressPos=e.pressX-n.left):(e.tabPos=e.tab.offsetTop,e.tabSize=n.height,e.tabPressPos=e.pressY-n.top),e.tabLayout=Ht.snapTabLayout(i,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=$.overrideCursor("default"),e.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),e.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&Ht.detachExceeded(e,t)){e.detachRequested=!0;var o=e.index,r=t.clientX,s=t.clientY,a=i[o],d=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:d,tab:a,clientX:r,clientY:s}),e.dragAborted)return}Ht.layoutTabs(i,e,t,this._orientation)}}},e.prototype._evtMouseUp=function(t){var e=this;if(0===t.button||1===t.button){var n=this._dragData;if(n){if(t.preventDefault(),t.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),!n.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(t.target))return void this._addRequested.emit(void 0);var o=this.contentNode.children,r=i.findFirstIndex(o,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));if(r!==n.index)return;var s=this._titles[r];if(!s.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:r,title:s});var a=o[r].querySelector(this.renderer.closeIconSelector);return a&&a.contains(t.target)?void this._tabCloseRequested.emit({index:r,title:s}):void 0}if(0===t.button){Ht.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("lm-mod-dragging"),n.tab.classList.remove("p-mod-dragging");var d=Ht.parseTransitionDuration(n.tab);setTimeout((function(){if(!n.dragAborted){e._dragData=null,Ht.resetTabPositions(e.contentNode.children,e._orientation),n.override.dispose(),e.removeClass("lm-mod-dragging"),e.removeClass("p-mod-dragging");var t=n.index,o=n.targetIndex;-1!==o&&t!==o&&(i.move(e._titles,t,o),e._adjustCurrentForMove(t,o),e._tabMoved.emit({fromIndex:t,toIndex:o,title:e._titles[o]}),Y.sendMessage(e,pt.Msg.UpdateRequest))}}),d)}}}},e.prototype._releaseMouse=function(){var t=this._dragData;t&&(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),t.dragAborted=!0,t.dragActive&&(Ht.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),t.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(t,e){var i=this.currentTitle,n=this._currentIndex,o=this.insertBehavior;if("select-tab"===o||"select-tab-if-needed"===o&&-1===n)return this._currentIndex=t,this._previousTitle=i,void this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:t,currentTitle:e});n>=t&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(t,e){var i=this._currentIndex,n=this.removeBehavior;if(i===t){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null});if("select-tab-after"===n)return this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===n)return this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,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(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}else i>t&&this._currentIndex--},e.prototype._onTitleChanged=function(t){this.update()},e}(pt);!function(t){var e=function(){function t(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return t.prototype.renderTab=function(t){var e=t.title.caption,i=this.createTabKey(t),n=i,o=this.createTabStyle(t),r=this.createTabClass(t),s=this.createTabDataset(t),a=this.createTabARIA(t);return t.title.closable?rt.li(dt({id:n,key:i,className:r,title:e,style:o,dataset:s},a),this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t)):rt.li(dt({id:n,key:i,className:r,title:e,style:o,dataset:s},a),this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=t.title,i=this.createIconClass(t);return"string"==typeof e.icon?rt.div({className:i},e.iconLabel):rt.div({className:i},e.icon,e.iconLabel)},t.prototype.renderLabel=function(t){return rt.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},t.title.label)},t.prototype.renderCloseIcon=function(t){return rt.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},t.prototype.createTabKey=function(t){var e=this._tabKeys.get(t.title);return void 0===e&&(e="tab-key-"+this._tabID++,this._tabKeys.set(t.title,e)),e},t.prototype.createTabStyle=function(t){return{zIndex:""+t.zIndex}},t.prototype.createTabClass=function(t){var e="lm-TabBar-tab";return e+=" p-TabBar-tab",t.title.className&&(e+=" "+t.title.className),t.title.closable&&(e+=" lm-mod-closable",e+=" p-mod-closable"),t.current&&(e+=" lm-mod-current",e+=" p-mod-current"),e},t.prototype.createTabDataset=function(t){return t.title.dataset},t.prototype.createTabARIA=function(t){return{role:"tab","aria-selected":t.current.toString()}},t.prototype.createIconClass=function(t){var e="lm-TabBar-tabIcon";e+=" p-TabBar-tabIcon";var i=t.title.iconClass;return i?e+" "+i:e},t}();t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"}(Ft||(Ft={})),function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");e.setAttribute("role","tablist"),e.className="lm-TabBar-content",e.classList.add("p-TabBar-content"),t.appendChild(e);var i=document.createElement("div");return i.className="lm-TabBar-addButton lm-mod-hidden",t.appendChild(i),t},t.asTitle=function(t){return t instanceof ut?t:new ut(t)},t.parseTransitionDuration=function(t){var e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){for(var i=new Array(t.length),n=0,o=t.length;n<o;++n){var r=t[n],s=window.getComputedStyle(r);i[n]="horizontal"===e?{pos:r.offsetLeft,size:r.offsetWidth,margin:parseFloat(s.marginLeft)||0}:{pos:r.offsetTop,size:r.offsetHeight,margin:parseFloat(s.marginTop)||0}}return i},t.dragExceeded=function(e,i){var n=Math.abs(i.clientX-e.pressX),o=Math.abs(i.clientY-e.pressY);return n>=t.DRAG_THRESHOLD||o>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,i){var n=e.contentRect;return i.clientX<n.left-t.DETACH_THRESHOLD||i.clientX>=n.right+t.DETACH_THRESHOLD||i.clientY<n.top-t.DETACH_THRESHOLD||i.clientY>=n.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,i,n){var o,r,s,a;"horizontal"===n?(o=e.pressX,r=i.clientX-e.contentRect.left,s=i.clientX,a=e.contentRect.width):(o=e.pressY,r=i.clientY-e.contentRect.top,s=i.clientY,a=e.contentRect.height);for(var d=e.index,c=r-e.tabPressPos,h=c+e.tabSize,l=0,u=t.length;l<u;++l){var p=void 0,f=e.tabLayout[l],m=f.pos+(f.size>>1);if(l<e.index&&c<m)p=e.tabSize+e.tabLayout[l+1].margin+"px",d=Math.min(d,l);else if(l>e.index&&h>m)p=-e.tabSize-f.margin+"px",d=Math.max(d,l);else if(l===e.index){var g=s-o,v=a-(e.tabPos+e.tabSize);p=Math.max(-e.tabPos,Math.min(g,v))+"px"}else p="";"horizontal"===n?t[l].style.left=p:t[l].style.top=p}e.targetIndex=d},t.finalizeTabPosition=function(t,e){var i,n;if(i="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)n=0;else if(t.targetIndex>t.index){n=(o=t.tabLayout[t.targetIndex]).pos+o.size-t.tabSize-t.tabPos}else{var o;n=(o=t.tabLayout[t.targetIndex]).pos-t.tabPos}var r=i-(t.tabPos+t.tabSize),s=Math.max(-t.tabPos,Math.min(n,r));"horizontal"===e?t.tab.style.left=s+"px":t.tab.style.top=s+"px"},t.resetTabPositions=function(t,e){o(t,(function(t){"horizontal"===e?t.style.left="":t.style.top=""}))}}(Ht||(Ht={}));var qt,Kt=function(t){function e(e){var i=t.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=e.renderer,void 0!==e.spacing&&(i._spacing=_t.clampDimension(e.spacing)),i._document=e.document||document,i._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:pt.HiddenMode.Display,i}return at(e,t),e.prototype.dispose=function(){var e=this.iter();this._items.forEach((function(t){t.dispose()})),this._box=null,this._root=null,this._items.clear(),o(e,(function(t){t.dispose()})),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){var e=this;this._hiddenMode!==t&&(this._hiddenMode=t,o(this.tabBars(),(function(t){t.titles.length>1&&t.titles.forEach((function(t){t.owner.hiddenMode=e._hiddenMode}))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=_t.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():d()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():d()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():d()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():d()},e.prototype.handles=function(){return this._root?this._root.iterHandles():d()},e.prototype.moveHandle=function(t,e,i){var n=t.classList.contains("lm-mod-hidden");if(n=n||t.classList.contains("p-mod-hidden"),this._root&&!n){var o,r=this._root.findSplitNode(t);if(r)0!==(o="horizontal"===r.node.orientation?e-t.offsetLeft:i-t.offsetTop)&&(r.node.holdSizes(),ct.adjust(r.node.sizers,r.index,o),this.parent&&this.parent.update())}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(t){var e,i=this,n=new Set;e=t.main?qt.normalizeAreaConfig(t.main,n):null;var r=this.widgets(),s=this.tabBars(),a=this.handles();this._root=null,o(r,(function(t){n.has(t)||(t.parent=null)})),o(s,(function(t){t.dispose()})),o(a,(function(t){t.parentNode&&t.parentNode.removeChild(t)})),n.forEach((function(t){t.parent=i.parent})),this._root=e?qt.realizeAreaConfig(e,{createTabBar:function(t){return i._createTabBar()},createHandle:function(){return i._createHandle()}},this._document):null,this.parent&&(n.forEach((function(t){i.attachWidget(t)})),this.parent.fit())},e.prototype.addWidget=function(t,e){void 0===e&&(e={});var i=e.ref||null,n=e.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(t.parent=this.parent,n){case"tab-after":this._insertTab(t,i,o,!0);break;case"tab-before":this._insertTab(t,i,o,!1);break;case"split-top":this._insertSplit(t,i,o,"vertical",!1);break;case"split-left":this._insertSplit(t,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(t,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,i,o,"vertical",!0)}this.parent&&(this.attachWidget(t),this.parent.fit())},e.prototype.removeWidget=function(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())},e.prototype.hitTestTabAreas=function(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=E.boxSizing(this.parent.node));var i=this.parent.node.getBoundingClientRect(),n=t-i.left-this._box.borderLeft,o=e-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,o);if(!r)return null;var s=r.tabBar,a=r.top,d=r.left,c=r.width,h=r.height,l=this._box.borderLeft+this._box.borderRight,u=this._box.borderTop+this._box.borderBottom;return{tabBar:s,x:n,y:o,top:a,left:d,right:i.width-l-(d+c),bottom:i.height-u-(a+h),width:c,height:h}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)})),o(this.handles(),(function(t){e.parent.node.appendChild(t)})),this.parent.fit()},e.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new gt(t)),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach))},e.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach);var e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(t){if(this._root){var e=this._root.findTabNode(t);if(e)if(qt.removeAria(t),e.tabBar.titles.length>1)e.tabBar.removeTab(t.title),this._hiddenMode===pt.HiddenMode.Scale&&1==e.tabBar.titles.length&&(e.tabBar.titles[0].owner.hiddenMode=pt.HiddenMode.Display);else if(e.tabBar.dispose(),this._root!==e){this._root.holdAllSizes();var n=e.parent;e.parent=null;var o=i.removeFirstOf(n.children,e),r=i.removeAt(n.handles,o);if(i.removeAt(n.sizers,o),r.parentNode&&r.parentNode.removeChild(r),n.children.length>1)n.syncHandles();else{var s=n.parent;n.parent=null;var a=n.children[0],d=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,d.parentNode&&d.parentNode.removeChild(d),this._root===n)return a.parent=null,void(this._root=a);var c=s,h=c.children.indexOf(n);if(a instanceof qt.TabLayoutNode)return a.parent=c,void(c.children[h]=a);var l=i.removeAt(c.handles,h);i.removeAt(c.children,h),i.removeAt(c.sizers,h),l.parentNode&&l.parentNode.removeChild(l);for(var u=0,p=a.children.length;u<p;++u){var f=a.children[u],m=a.handles[u],g=a.sizers[u];i.insert(c.children,h+u,f),i.insert(c.handles,h+u,m),i.insert(c.sizers,h+u,g),f.parent=c}a.children.length=0,a.handles.length=0,a.sizers.length=0,a.parent=null,c.syncHandles()}}else this._root=null}},e.prototype._insertTab=function(t,e,i,n){if(t!==e){if(!this._root){var o=new qt.TabLayoutNode(this._createTabBar());return o.tabBar.addTab(t.title),this._root=o,void qt.addAria(t,o.tabBar)}var r;if(i||(i=this._root.findFirstTabNode()),-1===i.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),r=e?i.tabBar.titles.indexOf(e.title):i.tabBar.currentIndex,this._hiddenMode===pt.HiddenMode.Scale&&i.tabBar.titles.length>0){if(1==i.tabBar.titles.length)i.tabBar.titles[0].owner.hiddenMode=pt.HiddenMode.Scale;t.hiddenMode=pt.HiddenMode.Scale}else t.hiddenMode=pt.HiddenMode.Display;i.tabBar.insertTab(r+(n?1:0),t.title),qt.addAria(t,i.tabBar)}},e.prototype._insertSplit=function(t,e,n,o,r){if(t!==e||!n||1!==n.tabBar.titles.length){this._removeWidget(t);var s=new qt.TabLayoutNode(this._createTabBar());if(s.tabBar.addTab(t.title),qt.addAria(t,s.tabBar),this._root){if(!n||!n.parent){var a=this._splitRoot(o),d=r?a.children.length:0;a.normalizeSizes();var c=qt.createSizer(n?1:qt.GOLDEN_RATIO);return i.insert(a.children,d,s),i.insert(a.sizers,d,c),i.insert(a.handles,d,this._createHandle()),s.parent=a,a.normalizeSizes(),void a.syncHandles()}var h=n.parent;if(h.orientation===o){var l=h.children.indexOf(n);h.normalizeSizes();var u=h.sizers[l].sizeHint/=2,p=l+(r?1:0);return i.insert(h.children,p,s),i.insert(h.sizers,p,qt.createSizer(u)),i.insert(h.handles,p,this._createHandle()),s.parent=h,void h.syncHandles()}var f=i.removeFirstOf(h.children,n),m=new qt.SplitLayoutNode(o);m.normalized=!0,m.children.push(n),m.sizers.push(qt.createSizer(.5)),m.handles.push(this._createHandle()),n.parent=m;var g=r?1:0;i.insert(m.children,g,s),i.insert(m.sizers,g,qt.createSizer(.5)),i.insert(m.handles,g,this._createHandle()),s.parent=m,m.syncHandles(),i.insert(h.children,f,m),m.parent=h}else this._root=s}},e.prototype._splitRoot=function(t){var e=this._root;if(e instanceof qt.SplitLayoutNode&&e.orientation===t)return e;var i=this._root=new qt.SplitLayoutNode(t);return e&&(i.children.push(e),i.sizers.push(qt.createSizer(0)),i.handles.push(this._createHandle()),e.parent=i),i},e.prototype._fit=function(){var t=0,e=0;if(this._root){var i=this._root.fit(this._spacing,this._items);t=i.minWidth,e=i.minHeight}var n=this._box=E.boxSizing(this.parent.node);t+=n.horizontalSum,e+=n.verticalSum;var o=this.parent.node.style;o.minWidth=t+"px",o.minHeight=e+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){if(this._dirty=!1,this._root){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var i=this._box.paddingTop,n=this._box.paddingLeft,o=t-this._box.horizontalSum,r=e-this._box.verticalSum;this._root.update(i,n,o,r,this._spacing,this._items)}},e.prototype._createTabBar=function(){var t=this.renderer.createTabBar(this._document);return t.orientation="horizontal",this.parent&&(t.parent=this.parent,this.attachWidget(t)),t},e.prototype._createHandle=function(){var t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t},e}(ft);!function(t){function e(t){var e=new ht;return e.sizeHint=t,e.size=t,e}function i(t,e){var n;return n="tab-area"===t.type?function(t,e){if(0===t.widgets.length)return null;var i=[];if(o(t.widgets,(function(t){e.has(t)||(e.add(t),i.push(t))})),0===i.length)return null;var n=t.currentIndex;-1!==n&&(n<0||n>=i.length)&&(n=0);return{type:"tab-area",widgets:i,currentIndex:n}}(t,e):function(t,e){for(var n=t.orientation,o=[],r=[],s=0,a=t.children.length;s<a;++s){var d=i(t.children[s],e);d&&("tab-area"===d.type||d.orientation!==n?(o.push(d),r.push(Math.abs(t.sizes[s]||0))):(o.push.apply(o,d.children),r.push.apply(r,d.sizes)))}if(0===o.length)return null;if(1===o.length)return o[0];return{type:"split-area",orientation:n,children:o,sizes:r}}(t,e),n}function n(i,s,a){var d;return d="tab-area"===i.type?function(e,i,n){var s=i.createTabBar(n);return o(e.widgets,(function(e){e.hide(),s.addTab(e.title),t.addAria(e,s)})),s.currentIndex=e.currentIndex,new r(s)}(i,s,a):function(t,i,r){var s=new c(t.orientation);return o(t.children,(function(o,a){var d=n(o,i,r),c=e(t.sizes[a]),h=i.createHandle();s.children.push(d),s.handles.push(h),s.sizers.push(c),d.parent=s})),s.syncHandles(),s.normalizeSizes(),s}(i,s,a),d}t.GOLDEN_RATIO=.618,t.createSizer=e,t.normalizeAreaConfig=i,t.realizeAreaConfig=n;var r=function(){function t(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var e=new ht,i=new ht;e.stretch=0,i.stretch=1,this.tabBar=t,this.sizers=[e,i]}return Object.defineProperty(t.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.iterAllWidgets=function(){return s(g(this.tabBar),this.iterUserWidgets())},t.prototype.iterUserWidgets=function(){return u(this.tabBar.titles,(function(t){return t.owner}))},t.prototype.iterSelectedWidgets=function(){var t=this.tabBar.currentTitle;return t?g(t.owner):d()},t.prototype.iterTabBars=function(){return g(this.tabBar)},t.prototype.iterHandles=function(){return d()},t.prototype.findTabNode=function(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null},t.prototype.findSplitNode=function(t){return null},t.prototype.findFirstTabNode=function(){return this},t.prototype.hitTestTabNodes=function(t,e){return t<this._left||t>=this._left+this._width||e<this._top||e>=this._top+this._height?null:this},t.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map((function(t){return t.owner})),currentIndex:this.tabBar.currentIndex}},t.prototype.holdAllSizes=function(){},t.prototype.fit=function(t,e){var i=0,n=0,o=e.get(this.tabBar),r=this.tabBar.currentTitle,s=r?e.get(r.owner):void 0,a=this.sizers,d=a[0],c=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,c.minSize=s.minHeight,c.maxSize=1/0):(c.minSize=0,c.maxSize=1/0),{minWidth:i,minHeight:n,maxWidth:Infinity,maxHeight:Infinity}},t.prototype.update=function(t,e,i,n,o,r){this._top=e,this._left=t,this._width=i,this._height=n;var s=r.get(this.tabBar),a=this.tabBar.currentTitle,d=a?r.get(a.owner):void 0;if(ct.calc(this.sizers,n),s&&!s.isHidden){var c=this.sizers[0].size;s.update(t,e,i,c),e+=c}if(d&&!d.isHidden){c=this.sizers[1].size;d.update(t,e,i,c)}},t}();t.TabLayoutNode=r;var c=function(){function t(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}return t.prototype.iterAllWidgets=function(){var t=u(this.children,(function(t){return t.iterAllWidgets()}));return new a(t)},t.prototype.iterUserWidgets=function(){var t=u(this.children,(function(t){return t.iterUserWidgets()}));return new a(t)},t.prototype.iterSelectedWidgets=function(){var t=u(this.children,(function(t){return t.iterSelectedWidgets()}));return new a(t)},t.prototype.iterTabBars=function(){var t=u(this.children,(function(t){return t.iterTabBars()}));return new a(t)},t.prototype.iterHandles=function(){var t=u(this.children,(function(t){return t.iterHandles()}));return s(this.handles,new a(t))},t.prototype.findTabNode=function(t){for(var e=0,i=this.children.length;e<i;++e){var n=this.children[e].findTabNode(t);if(n)return n}return null},t.prototype.findSplitNode=function(t){var e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].findSplitNode(t);if(o)return o}return null},t.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},t.prototype.hitTestTabNodes=function(t,e){for(var i=0,n=this.children.length;i<n;++i){var o=this.children[i].hitTestTabNodes(t,e);if(o)return o}return null},t.prototype.createConfig=function(){var t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map((function(t){return t.createConfig()})),sizes:e}},t.prototype.syncHandles=function(){var t=this;o(this.handles,(function(e,i){e.setAttribute("data-orientation",t.orientation),i===t.handles.length-1?(e.classList.add("lm-mod-hidden"),e.classList.add("p-mod-hidden")):(e.classList.remove("lm-mod-hidden"),e.classList.remove("p-mod-hidden"))}))},t.prototype.holdSizes=function(){o(this.sizers,(function(t){t.sizeHint=t.size}))},t.prototype.holdAllSizes=function(){o(this.children,(function(t){return t.holdAllSizes()})),this.holdSizes()},t.prototype.normalizeSizes=function(){var t=this.sizers.length;if(0!==t){this.holdSizes();var e=m(this.sizers,(function(t,e){return t+e.sizeHint}),0);o(this.sizers,0===e?function(e){e.size=e.sizeHint=1/t}:function(t){t.size=t.sizeHint/=e}),this.normalized=!0}},t.prototype.createNormalizedSizes=function(){var t=this.sizers.length;if(0===t)return[];var e=this.sizers.map((function(t){return t.size})),i=m(e,(function(t,e){return t+e}),0);return o(e,0===i?function(i,n){e[n]=1/t}:function(t,n){e[n]=t/i}),e},t.prototype.fit=function(t,e){for(var i="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*t,o=i?n:0,r=i?0:n,s=0,a=this.children.length;s<a;++s){var d=this.children[s].fit(t,e);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}},t.prototype.update=function(t,e,i,n,r,s){var a="horizontal"===this.orientation,d=Math.max(0,this.children.length-1)*r,c=Math.max(0,(a?i:n)-d);this.normalized&&(o(this.sizers,(function(t){t.sizeHint*=c})),this.normalized=!1),ct.calc(this.sizers,c);for(var h=0,l=this.children.length;h<l;++h){var u=this.children[h],p=this.sizers[h].size,f=this.handles[h].style;a?(u.update(t,e,p,n,r,s),t+=p,f.top=e+"px",f.left=t+"px",f.width=r+"px",f.height=n+"px",t+=r):(u.update(t,e,i,p,r,s),e+=p,f.top=e+"px",f.left=t+"px",f.width=i+"px",f.height=r+"px",e+=r)}},t}();t.SplitLayoutNode=c,t.addAria=function(t,e){t.node.setAttribute("role","tabpanel");var i=e.renderer;if(i instanceof Ft.Renderer){var n=i.createTabKey({title:t.title,current:!1,zIndex:0});t.node.setAttribute("aria-labelledby",n)}},t.removeAria=function(t){t.node.removeAttribute("role"),t.node.removeAttribute("aria-labelledby")}}(qt||(qt={}));var Vt,Ut=function(t){function e(i){void 0===i&&(i={});var n=t.call(this)||this;n._drag=null,n._tabsMovable=!0,n._tabsConstrained=!1,n._addButtonEnabled=!1,n._pressData=null,n._layoutModified=new S(n),n._addRequested=new S(n),n.addClass("lm-DockPanel"),n.addClass("p-DockPanel"),n._document=i.document||document,n._mode=i.mode||"multiple-document",n._renderer=i.renderer||e.defaultRenderer,n._edges=i.edges||Vt.DEFAULT_EDGES,void 0!==i.tabsMovable&&(n._tabsMovable=i.tabsMovable),void 0!==i.tabsConstrained&&(n._tabsConstrained=i.tabsConstrained),void 0!==i.addButtonEnabled&&(n._addButtonEnabled=i.addButtonEnabled),n.dataset.mode=n._mode;var o={createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}};return n.layout=new Kt({document:n._document,renderer:o,spacing:i.spacing,hiddenMode:i.hiddenMode}),n.overlay=i.overlay||new e.Overlay,n.node.appendChild(n.overlay.node),n}return at(e,t),e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(t){this.layout.hiddenMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(t){if(this._mode!==t){this._mode=t,this.dataset.mode=t;var e=this.layout;switch(t){case"multiple-document":o(e.tabBars(),(function(t){t.show()}));break;case"single-document":e.restoreLayout(Vt.createSingleDocumentConfig(this));break;default:throw"unreachable"}Y.postMessage(this,Vt.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(t){this._tabsMovable=t,o(this.tabBars(),(function(e){e.tabsMovable=t}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(t){this._tabsConstrained=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(t){this._addButtonEnabled=t,o(this.tabBars(),(function(e){e.addButtonEnabled=t}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(t){var e=l(this.tabBars(),(function(e){return-1!==e.titles.indexOf(t.title)}));if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title},e.prototype.activateWidget=function(t){this.selectWidget(t),t.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(t){this._mode="multiple-document",this.layout.restoreLayout(t),(B.IS_EDGE||B.IS_IE)&&Y.flush(),Y.postMessage(this,Vt.LayoutModified)},e.prototype.addWidget=function(t,e){void 0===e&&(e={}),"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),Y.postMessage(this,Vt.LayoutModified)},e.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,e)},e.prototype.handleEvent=function(t){switch(t.type){case"lm-dragenter":this._evtDragEnter(t);break;case"lm-dragleave":this._evtDragLeave(t);break;case"lm-dragover":this._evtDragOver(t);break;case"lm-drop":this._evtDrop(t);break;case"mousedown":case"pointerdown":this._evtMouseDown(t);break;case"mousemove":case"pointermove":this._evtMouseMove(t);break;case"mouseup":case"pointerup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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()},e.prototype.onChildAdded=function(t){Vt.isGeneratedTabBarProperty.get(t.child)||(t.child.addClass("lm-DockPanel-widget"),t.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(t){Vt.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("lm-DockPanel-widget"),t.child.removeClass("p-DockPanel-widget"),Y.postMessage(this,Vt.LayoutModified))},e.prototype._evtDragEnter=function(t){t.mimeData.hasData("application/vnd.lumino.widget-factory")&&(t.preventDefault(),t.stopPropagation())},e.prototype._evtDragLeave=function(t){t.preventDefault(),t.stopPropagation(),this.overlay.hide(1)},e.prototype._evtDragOver=function(t){t.preventDefault(),t.stopPropagation(),this._tabsConstrained&&t.source!==this||"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":t.dropAction=t.proposedAction},e.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var e=t.clientX,i=t.clientY,n=Vt.findDropTarget(this,e,i,this._edges),o=n.zone,r=n.target;if("invalid"!==o){var s=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"==typeof s){var a=s();if(a instanceof pt)if(a.contains(this))t.dropAction="none";else{var d=r?Vt.getDropRef(r.tabBar):null;switch(o){case"root-all":this.addWidget(a);break;case"root-top":this.addWidget(a,{mode:"split-top"});break;case"root-left":this.addWidget(a,{mode:"split-left"});break;case"root-right":this.addWidget(a,{mode:"split-right"});break;case"root-bottom":this.addWidget(a,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(a,{mode:"tab-after",ref:d});break;case"widget-top":this.addWidget(a,{mode:"split-top",ref:d});break;case"widget-left":this.addWidget(a,{mode:"split-left",ref:d});break;case"widget-right":this.addWidget(a,{mode:"split-right",ref:d});break;case"widget-bottom":this.addWidget(a,{mode:"split-bottom",ref:d});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(a)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),Y.postMessage(this,Vt.LayoutModified))},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,i=t.target,n=l(e.handles(),(function(t){return t.contains(i)}));if(n){t.preventDefault(),t.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 o=n.getBoundingClientRect(),r=t.clientX-o.left,s=t.clientY-o.top,a=window.getComputedStyle(n),d=$.overrideCursor(a.cursor,this._document);this._pressData={handle:n,deltaX:r,deltaY:s,override:d}}}},e.prototype._evtMouseMove=function(t){if(this._pressData){t.preventDefault(),t.stopPropagation();var e=this.node.getBoundingClientRect(),i=t.clientX-e.left-this._pressData.deltaX,n=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),Y.postMessage(this,Vt.LayoutModified))},e.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))},e.prototype._showOverlay=function(t,e){var i,n,o,r,s=Vt.findDropTarget(this,t,e,this._edges),a=s.zone,d=s.target;if("invalid"===a)return this.overlay.hide(100),a;var c=E.boxSizing(this.node),h=this.node.getBoundingClientRect();switch(a){case"root-all":i=c.paddingTop,n=c.paddingLeft,o=c.paddingRight,r=c.paddingBottom;break;case"root-top":i=c.paddingTop,n=c.paddingLeft,o=c.paddingRight,r=h.height*Vt.GOLDEN_RATIO;break;case"root-left":i=c.paddingTop,n=c.paddingLeft,o=h.width*Vt.GOLDEN_RATIO,r=c.paddingBottom;break;case"root-right":i=c.paddingTop,n=h.width*Vt.GOLDEN_RATIO,o=c.paddingRight,r=c.paddingBottom;break;case"root-bottom":i=h.height*Vt.GOLDEN_RATIO,n=c.paddingLeft,o=c.paddingRight,r=c.paddingBottom;break;case"widget-all":i=d.top,n=d.left,o=d.right,r=d.bottom;break;case"widget-top":i=d.top,n=d.left,o=d.right,r=d.bottom+d.height/2;break;case"widget-left":i=d.top,n=d.left,o=d.right+d.width/2,r=d.bottom;break;case"widget-right":i=d.top,n=d.left+d.width/2,o=d.right,r=d.bottom;break;case"widget-bottom":i=d.top+d.height/2,n=d.left,o=d.right,r=d.bottom;break;case"widget-tab":var l=d.tabBar.node.getBoundingClientRect().height;i=d.top,n=d.left,o=d.right,r=d.bottom+d.height-l;break;default:throw"unreachable"}return this.overlay.show({top:i,left:n,right:o,bottom:r}),a},e.prototype._createTabBar=function(){var t=this._renderer.createTabBar(this._document);return Vt.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=this._tabsMovable,t.allowDeselect=!1,t.addButtonEnabled=this._addButtonEnabled,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t.addRequested.connect(this._onTabAddRequested,this),t},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){Y.postMessage(this,Vt.LayoutModified)},e.prototype._onCurrentChanged=function(t,e){var i=e.previousTitle,n=e.currentTitle;i&&i.owner.hide(),n&&n.owner.show(),(B.IS_EDGE||B.IS_IE)&&Y.flush(),Y.postMessage(this,Vt.LayoutModified)},e.prototype._onTabAddRequested=function(t){this._addRequested.emit(t)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabDetachRequested=function(t,e){var i=this;if(!this._drag){t.releaseMouse();var n=e.title,o=e.tab,r=e.clientX,s=e.clientY,a=new M;a.setData("application/vnd.lumino.widget-factory",(function(){return n.owner}));var d=o.cloneNode(!0);this._drag=new $({document:this._document,mimeData:a,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),o.classList.add("lm-mod-hidden"),o.classList.add("p-mod-hidden");this._drag.start(r,s).then((function(){i._drag=null,o.classList.remove("lm-mod-hidden"),o.classList.remove("p-mod-hidden")}))}},e}(pt);!function(t){var e=function(){function t(){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 t.prototype.show=function(t){var e=this.node.style;e.top=t.top+"px",e.left=t.left+"px",e.right=t.right+"px",e.bottom=t.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"))},t.prototype.hide=function(t){var e=this;if(!this._hidden)return t<=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(){e._timer=-1,e._hidden=!0,e.node.classList.add("lm-mod-hidden"),e.node.classList.add("p-mod-hidden")}),t)))},t}();t.Overlay=e;var i=function(){function t(){}return t.prototype.createTabBar=function(t){var e=new Ft({document:t});return e.addClass("lm-DockPanel-tabBar"),e.addClass("p-DockPanel-tabBar"),e},t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="lm-DockPanel-handle",t.classList.add("p-DockPanel-handle"),t},t}();t.Renderer=i,t.defaultRenderer=new i}(Ut||(Ut={})),function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new G("layout-modified"),t.isGeneratedTabBarProperty=new J({name:"isGeneratedTabBar",create:function(){return!1}}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};var e=function(t){for(var e,i=0,o=[],r=n(t);void 0!==(e=r.next());)o[i++]=e;return o}(t.widgets()),i=t.selectedWidgets().next(),o=i?e.indexOf(i):-1;return{main:{type:"tab-area",widgets:e,currentIndex:o}}},t.findDropTarget=function(t,e,i,n){if(!E.hitTest(t.node,e,i))return{zone:"invalid",target:null};var o=t.layout;if(o.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){var r=t.node.getBoundingClientRect(),s=e-r.left+1,a=i-r.top+1,d=r.right-e,c=r.bottom-i;switch(Math.min(a,d,c,s)){case a:if(a<n.top)return{zone:"root-top",target:null};break;case d:if(d<n.right)return{zone:"root-right",target:null};break;case c:if(c<n.bottom)return{zone:"root-bottom",target:null};break;case s:if(s<n.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var h=o.hitTestTabAreas(e,i);if(!h)return{zone:"invalid",target:null};if("single-document"===t.mode)return{zone:"widget-all",target:h};var l=h.x-h.left+1,u=h.y-h.top+1,p=h.left+h.width-h.x,f=h.top+h.height-h.y;if(u<h.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:h};var m,g=Math.round(h.width/3),v=Math.round(h.height/3);if(l>g&&p>g&&u>v&&f>v)return{zone:"widget-all",target:h};switch(l/=g,u/=v,p/=g,f/=v,Math.min(l,u,p,f)){case l:m="widget-left";break;case u:m="widget-top";break;case p:m="widget-right";break;case f:m="widget-bottom";break;default:throw"unreachable"}return{zone:m,target:h}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(Vt||(Vt={})),function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new S(this),this._currentChanged=new S(this)}t.prototype.dispose=function(){var t=this;this._counter<0||(this._counter=-1,S.clearData(this),o(this._widgets,(function(e){e.node.removeEventListener("focus",t,!0),e.node.removeEventListener("blur",t,!0)})),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(t){var e=this._numbers.get(t);return void 0===e?-1:e},t.prototype.has=function(t){return this._numbers.has(t)},t.prototype.add=function(t){if(!this._numbers.has(t)){var e=t.node.contains(document.activeElement),i=e?this._counter++:-1;this._widgets.push(t),this._numbers.set(t,i),this._nodes.set(t.node,t),t.node.addEventListener("focus",this,!0),t.node.addEventListener("blur",this,!0),t.disposed.connect(this._onWidgetDisposed,this),e&&this._setWidgets(t,t)}},t.prototype.remove=function(t){var e=this;if(this._numbers.has(t)&&(t.disposed.disconnect(this._onWidgetDisposed,this),t.node.removeEventListener("focus",this,!0),t.node.removeEventListener("blur",this,!0),i.removeFirstOf(this._widgets,t),this._nodes.delete(t.node),this._numbers.delete(t),this._currentWidget===t)){var o,r,s=function(t,e){var i=n(t),o=i.next();if(void 0!==o){for(var r=o;void 0!==(o=i.next());)e(o,r)>0&&(r=o);return r}}((o=this._widgets,r=function(t){return-1!==e._numbers.get(t)},new h(n(o),r)),(function(t,i){return e._numbers.get(t)-e._numbers.get(i)}))||null;this._setWidgets(s,null)}},t.prototype.handleEvent=function(t){switch(t.type){case"focus":this._evtFocus(t);break;case"blur":this._evtBlur(t)}},t.prototype._setWidgets=function(t,e){var i=this._currentWidget;this._currentWidget=t;var n=this._activeWidget;this._activeWidget=e,i!==t&&this._currentChanged.emit({oldValue:i,newValue:t}),n!==e&&this._activeChanged.emit({oldValue:n,newValue:e})},t.prototype._evtFocus=function(t){var e=this._nodes.get(t.currentTarget);e!==this._currentWidget&&this._numbers.set(e,this._counter++),this._setWidgets(e,e)},t.prototype._evtBlur=function(t){var e=this._nodes.get(t.currentTarget),i=t.relatedTarget;i&&(e.node.contains(i)||l(this._widgets,(function(t){return t.node.contains(i)})))||this._setWidgets(this._currentWidget,null)},t.prototype._onWidgetDisposed=function(t){this.remove(t)}}();var Yt,Xt=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i._dirty=!1,i._rowSpacing=4,i._columnSpacing=4,i._items=[],i._rowStarts=[],i._columnStarts=[],i._rowSizers=[new ht],i._columnSizers=[new ht],i._box=null,void 0!==e.rowCount&&Yt.reallocSizers(i._rowSizers,e.rowCount),void 0!==e.columnCount&&Yt.reallocSizers(i._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(i._rowSpacing=Yt.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(i._columnSpacing=Yt.clampValue(e.columnSpacing)),i}return at(e,t),e.prototype.dispose=function(){o(this._items,(function(t){var e=t.widget;t.dispose(),e.dispose()})),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(t){t!==this.rowCount&&(Yt.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(t){t!==this.columnCount&&(Yt.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(t){t=Yt.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(t){t=Yt.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(t){var e=this._rowSizers[t];return e?e.stretch:-1},e.prototype.setRowStretch=function(t,e){var i=this._rowSizers[t];i&&(e=Yt.clampValue(e),i.stretch!==e&&(i.stretch=e,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(t){var e=this._columnSizers[t];return e?e.stretch:-1},e.prototype.setColumnStretch=function(t,e){var i=this._columnSizers[t];i&&(e=Yt.clampValue(e),i.stretch!==e&&(i.stretch=e,this.parent&&this.parent.update()))},e.prototype.iter=function(){return u(this._items,(function(t){return t.widget}))},e.prototype.addWidget=function(t){-1===i.findFirstIndex(this._items,(function(e){return e.widget===t}))&&(this._items.push(new gt(t)),this.parent&&this.attachWidget(t))},e.prototype.removeWidget=function(t){var e=i.findFirstIndex(this._items,(function(e){return e.widget===t}));if(-1!==e){var n=i.removeAt(this._items,e);this.parent&&this.detachWidget(t),n.dispose()}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)}))},e.prototype.attachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,i=this.rowCount;t<i;++t)this._rowSizers[t].minSize=0;for(t=0,i=this.columnCount;t<i;++t)this._columnSizers[t].minSize=0;var n=this._items.filter((function(t){return!t.isHidden}));for(t=0,i=n.length;t<i;++t)n[t].fit();var o=this.rowCount-1,r=this.columnCount-1;n.sort(Yt.rowSpanCmp);for(t=0,i=n.length;t<i;++t){var s=n[t],a=e.getCellConfig(s.widget),d=Math.min(a.row,o),c=Math.min(a.row+a.rowSpan-1,o);Yt.distributeMin(this._rowSizers,d,c,s.minHeight)}n.sort(Yt.columnSpanCmp);for(t=0,i=n.length;t<i;++t){s=n[t],a=e.getCellConfig(s.widget);var h=Math.min(a.column,r),l=Math.min(a.column+a.columnSpan-1,r);Yt.distributeMin(this._columnSizers,h,l,s.minWidth)}if("set-no-constraint"!==this.fitPolicy){var u=o*this._rowSpacing,p=r*this._columnSpacing;for(t=0,i=this.rowCount;t<i;++t)u+=this._rowSizers[t].minSize;for(t=0,i=this.columnCount;t<i;++t)p+=this._columnSizers[t].minSize;var f=this._box=E.boxSizing(this.parent.node);p+=f.horizontalSum,u+=f.verticalSum;var m=this.parent.node.style;m.minWidth=p+"px",m.minHeight=u+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)}else Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,i){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,r=t-this._box.horizontalSum,s=i-this._box.verticalSum,a=this.rowCount-1,d=this.columnCount-1,c=a*this._rowSpacing,h=d*this._columnSpacing;ct.calc(this._rowSizers,Math.max(0,s-c)),ct.calc(this._columnSizers,Math.max(0,r-h));for(var l=0,u=n,p=this.rowCount;l<p;++l)this._rowStarts[l]=u,u+=this._rowSizers[l].size+this._rowSpacing;for(l=0,u=o,p=this.columnCount;l<p;++l)this._columnStarts[l]=u,u+=this._columnSizers[l].size+this._columnSpacing;for(l=0,p=this._items.length;l<p;++l){var f=this._items[l];if(!f.isHidden){var m=e.getCellConfig(f.widget),g=Math.min(m.row,a),v=Math.min(m.column,d),y=Math.min(m.row+m.rowSpan-1,a),b=Math.min(m.column+m.columnSpan-1,d),_=this._columnStarts[v],w=this._rowStarts[g],x=this._columnStarts[b]+this._columnSizers[b].size-_,M=this._rowStarts[y]+this._rowSizers[y].size-w;f.update(_,w,x,M)}}},e}(ft);!function(t){t.getCellConfig=function(t){return Yt.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){Yt.cellConfigProperty.set(t,Yt.normalizeConfig(e))}}(Xt||(Xt={})),function(t){t.cellConfigProperty=new J({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof Xt&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},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(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new ht);t.length>e&&(t.length=e)},t.distributeMin=function(t,e,i,n){if(!(i<e))if(e!==i){for(var o=0,r=e;r<=i;++r)o+=t[r].minSize;if(!(o>=n)){var s=(n-o)/(i-e+1);for(r=e;r<=i;++r)t[r].minSize+=s}}else{var a=t[e];a.minSize=Math.max(a.minSize,n)}}}(Yt||(Yt={}));var Gt,Zt,Jt=function(t){function e(i){void 0===i&&(i={});var n=t.call(this,{node:Gt.createNode()})||this;return n._activeIndex=-1,n._menus=[],n._childMenu=null,n.addClass("lm-MenuBar"),n.addClass("p-MenuBar"),n.setFlag(pt.Flag.DisallowLayout),n.renderer=i.renderer||e.defaultRenderer,n._forceItemsPosition=i.forceItemsPosition||{forceX:!0,forceY:!0},n}return at(e,t),e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._menus.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._menus.length)&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(t){this.insertMenu(this._menus.length,t)},e.prototype.insertMenu=function(t,e){this._closeChildMenu();var n=this._menus.indexOf(e),o=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return i.insert(this._menus,o,e),e.addClass("lm-MenuBar-menu"),e.addClass("p-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void this.update();o===this._menus.length&&o--,n!==o&&(i.move(this._menus,n,o),this.update())},e.prototype.removeMenu=function(t){this.removeMenuAt(this._menus.indexOf(t))},e.prototype.removeMenuAt=function(t){this._closeChildMenu();var e=i.removeAt(this._menus,t);e&&(e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu"),e.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var t=0,e=this._menus;t<e.length;t++){var i=e[t];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()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){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)},e.prototype.onAfterDetach=function(t){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()},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this,i=this._menus,n=this.renderer,o=this._activeIndex,r=new Array(i.length),s=function(t,s){var a=i[t].title,d=t===o;d&&0==i[t].items.length&&(d=!1),r[t]=n.renderItem({title:a,active:d,onfocus:function(){e.activeIndex=t}})},a=0,d=i.length;a<d;++a)s(a);et.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e&&38!==e&&40!==e){if(27===e)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==e)if(39!==e){var i=R().keyForKeydownEvent(t);if(i){var n=this._activeIndex+1,o=Gt.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()},e.prototype._evtMouseDown=function(t){if(E.hitTest(this.node,t.clientX,t.clientY)){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));-1!==e?0===t.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=e):(this.activeIndex=e,this._openChildMenu())):this._closeChildMenu()}},e.prototype._evtMouseMove=function(t){var e=i.findFirstIndex(this.contentNode.children,(function(e){return E.hitTest(e,t.clientX,t.clientY)}));e!==this._activeIndex&&(-1===e&&this._childMenu||(this.activeIndex=e,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(t){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var e=this._childMenu;if(e!==t){this._childMenu=t,e?e.close():(this.addClass("lm-mod-active"),this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),Y.sendMessage(this,pt.Msg.UpdateRequest);var i=this.contentNode.children[this._activeIndex].getBoundingClientRect(),n=i.left,o=i.bottom;t.items.length>0&&t.open(n,o,this._forceItemsPosition)}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(t){t===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(t,e){if(t===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(e){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=0===i?n-1:i-1}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(pt);!function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return rt.li(dt({className:e,dataset:i,tabindex:"0",onfocus:t.onfocus},n),this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return"string"==typeof t.title.icon?rt.div({className:e},t.title.iconLabel):rt.div({className:e},t.title.icon,t.title.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return rt.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},e)},t.prototype.createItemClass=function(t){var e="lm-MenuBar-item";return e+=" p-MenuBar-item",t.title.className&&(e+=" "+t.title.className),t.active&&(e+=" lm-mod-active",e+=" p-mod-active"),e},t.prototype.createItemDataset=function(t){return t.title.dataset},t.prototype.createItemARIA=function(t){return{role:"menuitem","aria-haspopup":"true"}},t.prototype.createIconClass=function(t){var e="lm-MenuBar-itemIcon";e+=" p-MenuBar-itemIcon";var i=t.title.iconClass;return i?e+" "+i:e},t.prototype.formatLabel=function(t){var e=t.title,i=e.label,n=e.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,rt.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},s),r]},t}();t.Renderer=e,t.defaultRenderer=new e}(Jt||(Jt={})),function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-MenuBar-content",e.classList.add("p-MenuBar-content"),t.appendChild(e),e.setAttribute("role","menubar"),t.tabIndex=0,e.tabIndex=0,t},t.findMnemonic=function(t,e,i){for(var n=-1,o=-1,r=!1,s=e.toUpperCase(),a=0,d=t.length;a<d;++a){var c=(a+i)%d,h=t[c].title;if(0!==h.label.length){var l=h.mnemonic;l>=0&&l<h.label.length?h.label[l].toUpperCase()===s&&(-1===n?n=c:r=!0):-1===o&&h.label[0].toUpperCase()===s&&(o=c)}}return{index:n,multiple:r,auto:o}}}(Gt||(Gt={})),function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{node:Zt.createNode()})||this;return i._onRepeat=function(){if(i._repeatTimer=-1,i._pressData){var t=i._pressData.part;if("thumb"!==t){i._repeatTimer=window.setTimeout(i._onRepeat,20);var e=i._pressData.mouseX,n=i._pressData.mouseY;if("decrement"!==t)if("increment"!==t){if("track"===t){if(!E.hitTest(i.trackNode,e,n))return;var o=i.thumbNode;if(E.hitTest(o,e,n))return;var r=o.getBoundingClientRect(),s=void 0;return s="horizontal"===i._orientation?e<r.left?"decrement":"increment":n<r.top?"decrement":"increment",void i._pageRequested.emit(s)}}else{if(!E.hitTest(i.incrementNode,e,n))return;i._stepRequested.emit("increment")}else{if(!E.hitTest(i.decrementNode,e,n))return;i._stepRequested.emit("decrement")}}}},i._value=0,i._page=10,i._maximum=100,i._repeatTimer=-1,i._pressData=null,i._thumbMoved=new S(i),i._stepRequested=new S(i),i._pageRequested=new S(i),i.addClass("lm-ScrollBar"),i.addClass("p-ScrollBar"),i.setFlag(pt.Flag.DisallowLayout),i._orientation=e.orientation||"vertical",i.dataset.orientation=i._orientation,void 0!==e.maximum&&(i._maximum=Math.max(0,e.maximum)),void 0!==e.page&&(i._page=Math.max(0,e.page)),void 0!==e.value&&(i._value=Math.max(0,Math.min(e.value,i._maximum))),i}at(e,t),Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(t){t=Math.max(0,t),this._page!==t&&(this._page=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){t=Math.max(0,t),this._maximum!==t&&(this._maximum=t,this._value=Math.min(this._value,t),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){var e=100*this._value/this._maximum,i=100*this._page/(this._page+this._maximum);e=Math.max(0,Math.min(e,100)),i=Math.max(0,Math.min(i,100));var n=this.thumbNode.style;"horizontal"===this._orientation?(n.top="",n.height="",n.left=e+"%",n.width=i+"%",n.transform="translate("+-e+"%, 0%)"):(n.left="",n.width="",n.top=e+"%",n.height=i+"%",n.transform="translate(0%, "+-e+"%)")},e.prototype._evtKeyDown=function(t){if(t.preventDefault(),t.stopPropagation(),27===t.keyCode){var e=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==e&&this._moveThumb(e)}},e.prototype._evtMouseDown=function(t){if(0===t.button&&(this.activate(),!this._pressData)){var e=Zt.findPart(this,t.target);if(e){t.preventDefault(),t.stopPropagation();var i=$.overrideCursor("default");if(this._pressData={part:e,override:i,delta:-1,value:-1,mouseX:t.clientX,mouseY:t.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===e){var n=this.thumbNode,o=n.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=t.clientX-o.left:this._pressData.delta=t.clientY-o.top,n.classList.add("lm-mod-active"),n.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===e){o=this.thumbNode.getBoundingClientRect();var r=void 0;return r="horizontal"===this._orientation?t.clientX<o.left?"decrement":"increment":t.clientY<o.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._pageRequested.emit(r)}return"decrement"===e?(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"===e?(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}}},e.prototype._evtMouseMove=function(t){if(this._pressData&&(t.preventDefault(),t.stopPropagation(),this._pressData.mouseX=t.clientX,this._pressData.mouseY=t.clientY,"thumb"===this._pressData.part)){var e,i,n=this.thumbNode.getBoundingClientRect(),o=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(e=t.clientX-o.left-this._pressData.delta,i=o.width-n.width):(e=t.clientY-o.top-this._pressData.delta,i=o.height-n.height);var r=0===i?0:e*this._maximum/i;this._moveThumb(r)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.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"))},e.prototype._moveThumb=function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update(),this._thumbMoved.emit(t))}}(pt),function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div");return e.className="lm-ScrollBar-button",i.className="lm-ScrollBar-button",e.dataset.action="decrement",i.dataset.action="increment",n.className="lm-ScrollBar-track",o.className="lm-ScrollBar-thumb",e.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),t.appendChild(e),t.appendChild(n),t.appendChild(i),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(Zt||(Zt={})),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widget=null,e}at(e,t),e.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){t&&(t.parent=this.parent),this._widget!==t&&(this._widget&&this._widget.dispose(),this._widget=t,this.parent&&t&&this.attachWidget(t))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?g(this._widget):d()},e.prototype.removeWidget=function(t){this._widget===t&&(this._widget=null,this.parent&&this.detachWidget(t))},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o(this,(function(t){e.attachWidget(t)}))},e.prototype.attachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterAttach)},e.prototype.detachWidget=function(t){this.parent.isAttached&&Y.sendMessage(t,pt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Y.sendMessage(t,pt.Msg.AfterDetach)}}(ft);var Qt,$t=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i._dirty=!1,i._items=[],i._box=null,i._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:pt.HiddenMode.Display,i}return at(e,t),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){var e=this;this._hiddenMode!==t&&(this._hiddenMode=t,this.widgets.length>1&&this.widgets.forEach((function(t){t.hiddenMode=e._hiddenMode})))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){o(this._items,(function(t){t.dispose()})),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(t,e){this._hiddenMode===pt.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=pt.HiddenMode.Scale),e.hiddenMode=pt.HiddenMode.Scale):e.hiddenMode=pt.HiddenMode.Display,i.insert(this._items,t,new gt(e)),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){i.move(this._items,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=i.removeAt(this._items,t);this.parent.isAttached&&Y.sendMessage(e,pt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Y.sendMessage(e,pt.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===pt.HiddenMode.Scale&&(e.hiddenMode=pt.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=pt.HiddenMode.Display)),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,e=0,i=0,n=this._items.length;i<n;++i){var o=this._items[i];o.isHidden||(o.fit(),t=Math.max(t,o.minWidth),e=Math.max(e,o.minHeight))}var r=this._box=E.boxSizing(this.parent.node);t+=r.horizontalSum,e+=r.verticalSum;var s=this.parent.node.style;s.minWidth=t+"px",s.minHeight=e+"px",this._dirty=!0,this.parent.parent&&Y.sendMessage(this.parent.parent,pt.Msg.FitRequest),this._dirty&&Y.sendMessage(this.parent,pt.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var i=0,n=0,o=this._items.length;n<o;++n)i+=+!this._items[n].isHidden;if(0!==i){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=E.boxSizing(this.parent.node));var r=this._box.paddingTop,s=this._box.paddingLeft,a=t-this._box.horizontalSum,d=e-this._box.verticalSum;for(n=0,o=this._items.length;n<o;++n){var c=this._items[n];c.isHidden||(c.widget.node.style.zIndex=""+n,c.update(s,r,a,d))}}},e}(yt),te=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,{layout:Qt.createLayout(e)})||this;return i._widgetRemoved=new S(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return at(e,t),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(t){this.layout.hiddenMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("lm-StackedPanel-child"),t.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("lm-StackedPanel-child"),t.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(t.child)},e}(zt);!function(t){t.createLayout=function(t){return t.layout||new $t}}(Qt||(Qt={}));var ee,ie=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;i._currentChanged=new S(i),i._addRequested=new S(i),i.addClass("lm-TabPanel"),i.addClass("p-TabPanel"),i.tabBar=new Ft(e),i.tabBar.addClass("lm-TabPanel-tabBar"),i.stackedPanel=new te,i.stackedPanel.addClass("lm-TabPanel-stackedPanel"),i.tabBar.addClass("p-TabPanel-tabBar"),i.stackedPanel.addClass("p-TabPanel-stackedPanel"),i.tabBar.tabMoved.connect(i._onTabMoved,i),i.tabBar.currentChanged.connect(i._onCurrentChanged,i),i.tabBar.tabCloseRequested.connect(i._onTabCloseRequested,i),i.tabBar.tabActivateRequested.connect(i._onTabActivateRequested,i),i.tabBar.addRequested.connect(i._onTabAddRequested,i),i.stackedPanel.widgetRemoved.connect(i._onWidgetRemoved,i),i._tabPlacement=e.tabPlacement||"top";var n=ee.directionFromPlacement(i._tabPlacement),o=ee.orientationFromPlacement(i._tabPlacement);i.tabBar.orientation=o,i.tabBar.dataset.placement=i._tabPlacement;var r=new Lt({direction:n,spacing:0});return Lt.setStretch(i.tabBar,0),Lt.setStretch(i.stackedPanel,1),r.addWidget(i.tabBar),r.addWidget(i.stackedPanel),i.layout=r,i}return at(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(t){this.tabBar.currentIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(t){this.tabBar.addButtonEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(t){if(this._tabPlacement!==t){this._tabPlacement=t;var e=ee.directionFromPlacement(t),i=ee.orientationFromPlacement(t);this.tabBar.orientation=i,this.tabBar.dataset.placement=t,this.layout.direction=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.stackedPanel.insertWidget(t,e),this.tabBar.insertTab(t,e.title),e.node.setAttribute("role","tabpanel");var i=this.tabBar.renderer;if(i instanceof Ft.Renderer){var n=i.createTabKey({title:e.title,current:!1,zIndex:0});e.node.setAttribute("aria-labelledby",n)}},e.prototype._onCurrentChanged=function(t,e){var i=e.previousIndex,n=e.previousTitle,o=e.currentIndex,r=e.currentTitle,s=n?n.owner:null,a=r?r.owner:null;s&&s.hide(),a&&a.show(),this._currentChanged.emit({previousIndex:i,previousWidget:s,currentIndex:o,currentWidget:a}),(B.IS_EDGE||B.IS_IE)&&Y.flush()},e.prototype._onTabAddRequested=function(t,e){this._addRequested.emit(t)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.stackedPanel.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(e.title)},e}(pt);function ne(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}!function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return i[t]};var e={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"}}(ee||(ee={}));ne(".lm-Widget,.p-Widget{box-sizing:border-box;cursor:default;overflow:hidden;position:relative}.lm-Widget.lm-mod-hidden,.p-Widget.p-mod-hidden{display:none!important}");ne('.lm-CommandPalette,.p-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-CommandPalette-search,.p-CommandPalette-search{flex:0 0 auto}.lm-CommandPalette-content,.p-CommandPalette-content{flex:1 1 auto;list-style-type:none;margin:0;min-height:0;overflow:auto;padding:0}.lm-CommandPalette-header,.p-CommandPalette-header{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lm-CommandPalette-item,.p-CommandPalette-item{display:flex;flex-direction:row}.lm-CommandPalette-itemIcon,.p-CommandPalette-itemIcon{flex:0 0 auto}.lm-CommandPalette-itemContent,.p-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.lm-CommandPalette-itemShortcut,.p-CommandPalette-itemShortcut{flex:0 0 auto}.lm-CommandPalette-itemLabel,.p-CommandPalette-itemLabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lm-close-icon{background-color:transparent;border:1px solid transparent;bottom:0;cursor:pointer;display:none;margin:auto;outline:0;padding:7px 0;position:absolute;right:3%;top:0;vertical-align:middle;z-index:1}.lm-close-icon:after{color:#000;content:"X";cursor:pointer;display:block;font-size:12px;font-weight:400;height:15px;text-align:center;width:15px}');ne('.lm-DockPanel,.lm-DockPanel-widget,.p-DockPanel,.p-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar,.p-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle,.p-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden,.p-DockPanel-handle.p-mod-hidden{display:none!important}.lm-DockPanel-handle:after,.p-DockPanel-handle:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.lm-DockPanel-handle[data-orientation=horizontal],.p-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical],.p-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after,.p-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translateX(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after,.p-DockPanel-handle[data-orientation=vertical]:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-DockPanel-overlay,.p-DockPanel-overlay{box-sizing:border-box;pointer-events:none;z-index:3}.lm-DockPanel-overlay.lm-mod-hidden,.p-DockPanel-overlay.p-mod-hidden{display:none!important}');ne(".lm-Menu,.p-Menu{outline:none;overflow-x:hidden;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:10000}.lm-Menu-content,.p-Menu-content{display:table;list-style-type:none;margin:0;padding:0}.lm-Menu-item,.p-Menu-item{display:table-row}.lm-Menu-item.lm-mod-collapsed,.lm-Menu-item.lm-mod-hidden,.p-Menu-item.p-mod-collapsed,.p-Menu-item.p-mod-hidden{display:none!important}.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon,.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.lm-Menu-itemLabel,.p-Menu-itemLabel{display:table-cell;text-align:left}.lm-Menu-itemShortcut,.p-Menu-itemShortcut{display:table-cell;text-align:right}");ne(".lm-MenuBar,.p-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-MenuBar-content,.p-MenuBar-content{display:flex;flex-direction:row;list-style-type:none;margin:0;padding:0}.lm-MenuBar-item,.p--MenuBar-item{box-sizing:border-box}.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel,.p-MenuBar-itemIcon,.p-MenuBar-itemLabel{display:inline-block}");ne(".lm-ScrollBar,.p-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-ScrollBar[data-orientation=horizontal],.p-ScrollBar[data-orientation=horizontal]{flex-direction:row}.lm-ScrollBar[data-orientation=vertical],.p-ScrollBar[data-orientation=vertical]{flex-direction:column}.lm-ScrollBar-button,.p-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.lm-ScrollBar-track,.p-ScrollBar-track{box-sizing:border-box;flex:1 1 auto;overflow:hidden;position:relative}.lm-ScrollBar-thumb,.p-ScrollBar-thumb{box-sizing:border-box;position:absolute}");ne('.lm-SplitPanel-child,.p-SplitPanel-child{z-index:0}.lm-SplitPanel-handle,.p-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden,.p-SplitPanel-handle.p-mod-hidden{display:none!important}.lm-SplitPanel-handle:after,.p-SplitPanel-handle:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle,.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle,.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after,.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after{left:50%;min-width:8px;transform:translateX(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after,.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after{min-height:8px;top:50%;transform:translateY(-50%)}');ne(".lm-TabBar,.p-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-TabBar[data-orientation=horizontal],.p-TabBar[data-orientation=horizontal]{align-items:flex-end;flex-direction:row}.lm-TabBar[data-orientation=vertical],.p-TabBar[data-orientation=vertical]{align-items:flex-end;flex-direction:column}.lm-TabBar-content,.p-TabBar-content{display:flex;flex:1 1 auto;list-style-type:none;margin:0;padding:0}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content,.p-TabBar[data-orientation=horizontal]>.p-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content,.p-TabBar[data-orientation=vertical]>.p-TabBar-content{flex-direction:column}.lm-TabBar-tab,.p-TabBar-tab{box-sizing:border-box;display:flex;flex-direction:row;overflow:hidden;touch-action:none}.lm-TabBar-tabCloseIcon,.lm-TabBar-tabIcon,.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon{flex:0 0 auto}.lm-TabBar-tabLabel,.p-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{box-sizing:border-box;user-select:all;width:100%}.lm-TabBar-addButton.lm-mod-hidden,.lm-TabBar-tab.lm-mod-hidden,.p-TabBar-tab.p-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab,.p-TabBar.p-mod-dragging .p-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab,.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab{left:0;transition:left .15s ease}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab,.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab{top:0;transition:top .15s ease}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging,.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{background:inherit;box-sizing:border-box;user-select:all;width:100%}");ne(".lm-TabPanel-tabBar,.p-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel,.p-TabPanel-stackedPanel{z-index:0}");var oe=function(t,e){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},oe(t,e)};function re(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}oe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var se=function(){return se=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},se.apply(this,arguments)};function ae(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}var de,ce;ae(".phosphor_WidgetAdapter{background:#fff;border-bottom:1px solid silver;border-left:1px solid silver;border-right:1px solid silver;min-height:64px;min-width:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px 0 rgba(0,0,0,.2),1px 1px 2px rgba(0,0,0,.2)}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}"),t.Msg=void 0,de=t.Msg||(t.Msg={}),ce=function(t){function e(e){var i=t.call(this,"wa-activate-request")||this;return i._wa=e,i}return re(e,t),Object.defineProperty(e.prototype,"wa",{get:function(){return this._wa},enumerable:!1,configurable:!0}),e.prototype.conflate=function(t){return this._wa=t.wa,!0},e}(G),de.WAActivateRequest=ce;var he=function(i){function n(t,n,o,r,s){void 0===o&&(o={}),void 0===r&&(r=!1),void 0===s&&(s={});var a=i.call(this)||this;return a.lparam={},a.padding=0,a._width=0,a._height=0,a._owner=t,a._element=e.select(a.node),a.addClass("phosphor_WidgetAdapter"),a.title.label="",a.title.closable=!!r,a.title.caption="Long description for: ".concat(name),a._ext=s,a._closable="boolean"==typeof r?{canClose:function(t,e){return r}}:r,n instanceof e.Widget?a._widget=n.target(a.node):a._widgetLayout=n,a.lparam=o,a}return re(n,i),Object.defineProperty(n.prototype,"widget",{get:function(){return this._widget},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputNode",{get:function(){return this.node.getElementsByTagName("input")[0]},enumerable:!1,configurable:!0}),n.prototype.resizeAndRender=function(){this._widget&&(e.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-2*this.padding-2,height:this._height-2*this.padding-2}).lazyRender())},n.prototype.onActivateRequest=function(e){i.prototype.onActivateRequest.call(this,e),this._widget&&this.resizeAndRender(),this._owner&&Y.postMessage(this._owner,new t.Msg.WAActivateRequest(this))},n.prototype.onResize=function(t){i.prototype.onResize.call(this,t),this.node&&null!==this.node.offsetParent&&t.width>=0&&t.height>=0?(this._width=t.width,this._height=t.height,this.resizeAndRender()):this._widgetLayout},n.prototype.onCloseRequest=function(t){this._closable.canClose(this._widget,this)&&this.dispose()},n}(pt),le=function(t){function e(e){return t.apply(this,e)||this}return re(e,t),e.create=function(){return Object.create(e.prototype)},e.prototype.watchRendered=function(t,e){if(e)var i=this.map((function(t){return{wa:t,w:t.widget,rc:t.widget.renderCount()}})),n=setInterval((function(){(function(){for(var t=0,e=i;t<e.length;t++){var n=e[t];if(n.wa.isVisible&&n.rc>=n.w.renderCount())return!1}return!0})()&&(clearInterval(n),e(t))}),20)},e}(Array),ue=function(t){function e(){return t.call(this)||this}return re(e,t),e.prototype.createTabBar=function(){var e=t.prototype.createTabBar.call(this);return e.tabsMovable=this._owner.tabsMovable,e},e}(Ut.Renderer),pe=function(t){function e(e){void 0===e&&(e={});var i=this;return e.renderer=e.renderer||new ue,(i=t.call(this,e)||this)._renderer instanceof ue&&(i._renderer._owner=i),i._content=le.create(),i._contentMap={},i}return re(e,t),e.prototype.appendContent=function(t){this._content.push(t),this._contentMap[t.widget.id()]=t},e.prototype.removeContent=function(t){var e=this._content.indexOf(t);e>=0&&this._content.splice(e,1),delete this._contentMap[t.widget.id()],t.dispose()},e.prototype.content=function(){return this._content},e.prototype.serializeWidget=function(t){if(t instanceof he)try{return{__id:t.widget.id()}}catch(t){return{exception:{message:t.message,stack:t.stack}}}return null},e.prototype.deserializeWidget=function(t){var e=this._contentMap[t.__id];return e||(e=new he(void 0,t)),e},e.prototype.serializeITabAreaConfig=function(t,e){var i=this;return se(se({},t),{widgets:t.widgets.map((function(t){return e?i.deserializeWidget(t):i.serializeWidget(t)}))})},e.prototype.serializeISplitAreaConfig=function(t,e){var i=this;return se(se({},t),{children:t.children.map((function(t){return i.serializeAreaConfig(t,e)}))})},e.prototype.serializeAreaConfig=function(t,e){if(t)switch(t.type){case"tab-area":return this.serializeITabAreaConfig(t,e);case"split-area":return this.serializeISplitAreaConfig(t,e)}},e.prototype.saveLayout=function(){return{main:this.serializeAreaConfig(t.prototype.saveLayout.call(this).main,!1)}},e.prototype.restoreLayout=function(e){return t.prototype.restoreLayout.call(this,{main:this.serializeAreaConfig(e.main,!0)})},e}(Ut);ae('.p-DockPanel-overlay{background:hsla(0,0%,100%,.6);border:1px dashed #000;transition-duration:.15s;transition-property:top,left,right,bottom;transition-timing-function:ease}.p-TabBar{max-height:24px;min-height:24px}.p-TabBar-content{align-items:flex-end;min-height:0;min-width:0}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid silver}.p-TabBar-tab{background:#e5e5e5;border:1px solid silver;border-bottom:none;flex:0 1 125px;font:12px Helvetica,Arial,sans-serif;line-height:20px;margin-left:-1px;max-height:20px;min-height:20px;min-width:35px;padding:0 10px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{max-height:23px;min-height:23px;transform:translateY(1px)}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon,.p-TabBar-tabLabel{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"\\f00d";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{border:none;box-shadow:1px 1px 2px rgba(0,0,0,.3);max-height:23px;min-height:23px;min-width:125px;transform:translateX(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{max-height:1px!important;min-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}');var fe=function(t){function i(){var e=t.call(this)||this;return e._dock=new pe({mode:"multiple-document"}),e._layoutObj=null,e._tag="div",e._dock.id="p"+e.id(),Y.installMessageHook(e,e),e}return re(i,t),i.prototype.getWidgetAdapter=function(t){var e=null;return this._dock.content().some((function(i){return i.widget===t&&(e=i,!0)})),e},i.prototype.addWidget=function(t,e,i,n,o){void 0===i&&(i="split-right");var r={mode:i,ref:this.getWidgetAdapter(n)},s=new he(this,t,{},o);return s.title.label=e,s.padding=8,this._dock.addWidget(s,r),this._dock.appendContent(s),this._dock.tabsMovable=!0,this},i.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);return e&&(t.target(null),this._dock.removeContent(e)),this},i.prototype.isVisible=function(t){return this.getWidgetAdapter(t).isVisible},i.prototype.widgetAdapters=function(){return this._dock.content()},i.prototype.widgets=function(){return this._dock.content().map((function(t){return t.widget}))},i.prototype.layout=function(t){return arguments.length?(this._dock.restoreLayout(t),this):this._dock.saveLayout()},i.prototype.layoutObj=function(t){return this._layoutObj=t,this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._pPlaceholder=i.append("div"),pt.attach(this._dock,this._pPlaceholder.node())},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","auto"),i.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach((function(t){return t.render()}))},i.prototype.exit=function(e,i){var n=this;(function(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))})([],this.widgets(),!0).forEach((function(t){return n.removeWidget(t)})),t.prototype.exit.call(this,e,i)},i.prototype.render=function(i){var n=this,o=this;return null!==this._layoutObj&&(this.layout(this._layoutObj),this.layoutObj(null)),t.prototype.render.call(this,(function(t){n._dock.content().watchRendered(n,i),n._dock.update(),setTimeout((function(){var t=n.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar"),i=!1;t.each((function(){var t=e.select(this),n=t.node().childNodes[0].childNodes.length,r=o.hideSingleTabs()&&1===n;r!==t.classed("hide")&&(t.classed("hide",r),i=!0)})),i&&n._dock.fit()}),0)}))},i.prototype.refit=function(){this._dock.fit()},i.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},i.prototype.processMessage=function(t){if("wa-activate-request"===t.type){var e=t.wa,i=e.widget;this._prevActive!==i&&(this._prevActive=i,this.childActivation(i,e))}},i.prototype.childActivation=function(t,e){},i.prototype.active=function(){return this._prevActive},i}(e.HTMLWidget);fe.prototype._class+=" phosphor_DockPanel",fe.prototype.publish("hideSingleTabs",!1,"boolean");var me=function(t){function e(e){void 0===e&&(e="vertical");var i=t.call(this)||this;return i.content=le.create(),i._split=new Pt({orientation:e}),i._tag="div",i._split.id="p"+i.id(),i}return re(e,t),e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some((function(i){return i.widget===t&&(e=i,!0)})),e},e.prototype.addWidget=function(t){var e=new he(this,t);return this._split.addWidget(e),this.content.push(e),this},e.prototype.relativeSizes=function(t){return arguments.length?(this._split.setRelativeSizes(t),this):this._split.relativeSizes()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),pt.attach(this._split,e)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,(function(t){i.content.watchRendered(i,e),i._split.update()}))},e}(e.HTMLWidget);me.prototype._class+=" phosphor_SplitPanel";var ge=function(t){function e(){var e=t.call(this)||this;return e._tab=new ie({tabPlacement:"top"}),e.content=le.create(),e._tag="div",e._tab.id="p"+e.id(),e}return re(e,t),e.prototype.getWidget=function(t){if(t instanceof he)return t.widget},e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some((function(i){return i.widget===t&&(e=i,!0)})),e},e.prototype.addWidget=function(t,e,i){void 0===i&&(i={}),this._prevActive||(this._prevActive=t);var n=new he(this,t,void 0,void 0,i);return n.title.label=e,n.padding=8,this._tab.addWidget(n),this.content.push(n),this},e.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);if(e){var i=this.content.indexOf(e);i>=0&&this.content.splice(i,1),t.target(null),e.dispose()}return this},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),pt.attach(this._tab,e)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,(function(t){i.content.watchRendered(i,e),i._tab.update()}))},e.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},e.prototype.processMessage=function(t){if("wa-activate-request"===t.type){var e=t.wa.widget;this._prevActive!==e&&(this._prevActive=e,this.childActivation(e))}},e.prototype.childActivation=function(t){},e.prototype.active=function(t){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(t),this):this.getWidget(this._tab.currentWidget)},e}(e.HTMLWidget);ge.prototype._class+=" phosphor_TabPanel",t.BUILD_VERSION="2.104.7",t.ContextMenu=Wt,t.DockPanel=fe,t.PKG_NAME="@hpcc-js/phosphor",t.PKG_VERSION="2.16.3",t.SplitPanel=me,t.TabPanel=ge,t.WidgetAdapter=he,t.WidgetAdapterArray=le,Object.defineProperty(t,"__esModule",{value:!0})}));
62
62
  //# sourceMappingURL=index.min.js.map