flexlayout-react 0.7.3 → 0.7.4

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.
Files changed (86) hide show
  1. package/ChangeLog.txt +4 -0
  2. package/declarations/view/Icons.d.ts +1 -0
  3. package/dist/flexlayout.js +96 -184
  4. package/dist/flexlayout_min.js +1 -1
  5. package/lib/Attribute.js +12 -17
  6. package/lib/Attribute.js.map +1 -1
  7. package/lib/AttributeDefinitions.js +44 -53
  8. package/lib/AttributeDefinitions.js.map +1 -1
  9. package/lib/DockLocation.js +41 -46
  10. package/lib/DockLocation.js.map +1 -1
  11. package/lib/DragDrop.js +55 -60
  12. package/lib/DragDrop.js.map +1 -1
  13. package/lib/DropInfo.js +3 -8
  14. package/lib/DropInfo.js.map +1 -1
  15. package/lib/I18nLabel.js +2 -5
  16. package/lib/I18nLabel.js.map +1 -1
  17. package/lib/Orientation.js +11 -16
  18. package/lib/Orientation.js.map +1 -1
  19. package/lib/PopupMenu.js +24 -28
  20. package/lib/PopupMenu.js.map +1 -1
  21. package/lib/Rect.js +35 -41
  22. package/lib/Rect.js.map +1 -1
  23. package/lib/Types.js +2 -5
  24. package/lib/Types.js.map +1 -1
  25. package/lib/index.js +22 -38
  26. package/lib/index.js.map +1 -1
  27. package/lib/model/Action.js +3 -8
  28. package/lib/model/Action.js.map +1 -1
  29. package/lib/model/Actions.js +68 -75
  30. package/lib/model/Actions.js.map +1 -1
  31. package/lib/model/BorderNode.js +183 -206
  32. package/lib/model/BorderNode.js.map +1 -1
  33. package/lib/model/BorderSet.js +44 -55
  34. package/lib/model/BorderSet.js.map +1 -1
  35. package/lib/model/ICloseType.js +2 -5
  36. package/lib/model/ICloseType.js.map +1 -1
  37. package/lib/model/IDraggable.js +1 -2
  38. package/lib/model/IDropTarget.js +1 -2
  39. package/lib/model/IJsonModel.js +1 -2
  40. package/lib/model/Model.js +217 -232
  41. package/lib/model/Model.js.map +1 -1
  42. package/lib/model/Node.js +87 -94
  43. package/lib/model/Node.js.map +1 -1
  44. package/lib/model/RowNode.js +204 -250
  45. package/lib/model/RowNode.js.map +1 -1
  46. package/lib/model/SplitterNode.js +35 -57
  47. package/lib/model/SplitterNode.js.map +1 -1
  48. package/lib/model/TabNode.js +100 -124
  49. package/lib/model/TabNode.js.map +1 -1
  50. package/lib/model/TabSetNode.js +176 -199
  51. package/lib/model/TabSetNode.js.map +1 -1
  52. package/lib/model/Utils.js +20 -26
  53. package/lib/model/Utils.js.map +1 -1
  54. package/lib/view/BorderButton.js +45 -49
  55. package/lib/view/BorderButton.js.map +1 -1
  56. package/lib/view/BorderTabSet.js +57 -61
  57. package/lib/view/BorderTabSet.js.map +1 -1
  58. package/lib/view/ErrorBoundary.js +15 -37
  59. package/lib/view/ErrorBoundary.js.map +1 -1
  60. package/lib/view/FloatingWindow.js +43 -56
  61. package/lib/view/FloatingWindow.js.map +1 -1
  62. package/lib/view/FloatingWindowTab.js +12 -16
  63. package/lib/view/FloatingWindowTab.js.map +1 -1
  64. package/lib/view/Icons.js +7 -15
  65. package/lib/view/Icons.js.map +1 -1
  66. package/lib/view/Layout.js +392 -449
  67. package/lib/view/Layout.js.map +1 -1
  68. package/lib/view/Splitter.js +53 -57
  69. package/lib/view/Splitter.js.map +1 -1
  70. package/lib/view/Tab.js +31 -35
  71. package/lib/view/Tab.js.map +1 -1
  72. package/lib/view/TabButton.js +46 -50
  73. package/lib/view/TabButton.js.map +1 -1
  74. package/lib/view/TabButtonStamp.js +11 -15
  75. package/lib/view/TabButtonStamp.js.map +1 -1
  76. package/lib/view/TabFloating.js +30 -34
  77. package/lib/view/TabFloating.js.map +1 -1
  78. package/lib/view/TabOverflowHook.js +46 -50
  79. package/lib/view/TabOverflowHook.js.map +1 -1
  80. package/lib/view/TabSet.js +93 -106
  81. package/lib/view/TabSet.js.map +1 -1
  82. package/lib/view/Utils.js +11 -17
  83. package/lib/view/Utils.js.map +1 -1
  84. package/package.json +1 -1
  85. package/src/view/FloatingWindow.tsx +5 -1
  86. package/src/view/Layout.tsx +1 -5
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.FlexLayout=e(require("react"),require("react-dom")):t.FlexLayout=e(t.React,t.ReactDOM)}(self,((t,e)=>(()=>{"use strict";var i={453:(t,e,i)=>{var o;i.r(e),i.d(e,{NIL:()=>w,parse:()=>g,stringify:()=>c,v1:()=>f,v3:()=>O,v4:()=>L,v5:()=>D,validate:()=>s,version:()=>B});var n=new Uint8Array(16);function r(){if(!o&&!(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(n)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(t){return"string"==typeof t&&a.test(t)};for(var d=[],l=0;l<256;++l)d.push((l+256).toString(16).substr(1));const c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(d[t[e+0]]+d[t[e+1]]+d[t[e+2]]+d[t[e+3]]+"-"+d[t[e+4]]+d[t[e+5]]+"-"+d[t[e+6]]+d[t[e+7]]+"-"+d[t[e+8]]+d[t[e+9]]+"-"+d[t[e+10]]+d[t[e+11]]+d[t[e+12]]+d[t[e+13]]+d[t[e+14]]+d[t[e+15]]).toLowerCase();if(!s(i))throw TypeError("Stringified UUID is invalid");return i};var u,h,_=0,p=0;const f=function(t,e,i){var o=e&&i||0,n=e||new Array(16),a=(t=t||{}).node||u,s=void 0!==t.clockseq?t.clockseq:h;if(null==a||null==s){var d=t.random||(t.rng||r)();null==a&&(a=u=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==s&&(s=h=16383&(d[6]<<8|d[7]))}var l=void 0!==t.msecs?t.msecs:Date.now(),f=void 0!==t.nsecs?t.nsecs:p+1,g=l-_+(f-p)/1e4;if(g<0&&void 0===t.clockseq&&(s=s+1&16383),(g<0||l>_)&&void 0===t.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_=l,p=f,h=s;var T=(1e4*(268435455&(l+=122192928e5))+f)%4294967296;n[o++]=T>>>24&255,n[o++]=T>>>16&255,n[o++]=T>>>8&255,n[o++]=255&T;var v=l/4294967296*1e4&268435455;n[o++]=v>>>8&255,n[o++]=255&v,n[o++]=v>>>24&15|16,n[o++]=v>>>16&255,n[o++]=s>>>8|128,n[o++]=255&s;for(var b=0;b<6;++b)n[o+b]=a[b];return e||c(n)},g=function(t){if(!s(t))throw TypeError("Invalid UUID");var e,i=new Uint8Array(16);return i[0]=(e=parseInt(t.slice(0,8),16))>>>24,i[1]=e>>>16&255,i[2]=e>>>8&255,i[3]=255&e,i[4]=(e=parseInt(t.slice(9,13),16))>>>8,i[5]=255&e,i[6]=(e=parseInt(t.slice(14,18),16))>>>8,i[7]=255&e,i[8]=(e=parseInt(t.slice(19,23),16))>>>8,i[9]=255&e,i[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,i[11]=e/4294967296&255,i[12]=e>>>24&255,i[13]=e>>>16&255,i[14]=e>>>8&255,i[15]=255&e,i};function T(t,e,i){function o(t,o,n,r){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],i=0;i<t.length;++i)e.push(t.charCodeAt(i));return e}(t)),"string"==typeof o&&(o=g(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+t.length);if(a.set(o),a.set(t,o.length),(a=i(a))[6]=15&a[6]|e,a[8]=63&a[8]|128,n){r=r||0;for(var s=0;s<16;++s)n[r+s]=a[s];return n}return c(a)}try{o.name=t}catch(t){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}function v(t){return 14+(t+64>>>9<<4)+1}function b(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function E(t,e,i,o,n,r){return b((a=b(b(e,t),b(o,r)))<<(s=n)|a>>>32-s,i);var a,s}function y(t,e,i,o,n,r,a){return E(e&i|~e&o,t,e,n,r,a)}function m(t,e,i,o,n,r,a){return E(e&o|i&~o,t,e,n,r,a)}function A(t,e,i,o,n,r,a){return E(e^i^o,t,e,n,r,a)}function S(t,e,i,o,n,r,a){return E(i^(e|~o),t,e,n,r,a)}const O=T("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)}return function(t){for(var e=[],i=32*t.length,o="0123456789abcdef",n=0;n<i;n+=8){var r=t[n>>5]>>>n%32&255,a=parseInt(o.charAt(r>>>4&15)+o.charAt(15&r),16);e.push(a)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[v(e)-1]=e;for(var i=1732584193,o=-271733879,n=-1732584194,r=271733878,a=0;a<t.length;a+=16){var s=i,d=o,l=n,c=r;i=y(i,o,n,r,t[a],7,-680876936),r=y(r,i,o,n,t[a+1],12,-389564586),n=y(n,r,i,o,t[a+2],17,606105819),o=y(o,n,r,i,t[a+3],22,-1044525330),i=y(i,o,n,r,t[a+4],7,-176418897),r=y(r,i,o,n,t[a+5],12,1200080426),n=y(n,r,i,o,t[a+6],17,-1473231341),o=y(o,n,r,i,t[a+7],22,-45705983),i=y(i,o,n,r,t[a+8],7,1770035416),r=y(r,i,o,n,t[a+9],12,-1958414417),n=y(n,r,i,o,t[a+10],17,-42063),o=y(o,n,r,i,t[a+11],22,-1990404162),i=y(i,o,n,r,t[a+12],7,1804603682),r=y(r,i,o,n,t[a+13],12,-40341101),n=y(n,r,i,o,t[a+14],17,-1502002290),i=m(i,o=y(o,n,r,i,t[a+15],22,1236535329),n,r,t[a+1],5,-165796510),r=m(r,i,o,n,t[a+6],9,-1069501632),n=m(n,r,i,o,t[a+11],14,643717713),o=m(o,n,r,i,t[a],20,-373897302),i=m(i,o,n,r,t[a+5],5,-701558691),r=m(r,i,o,n,t[a+10],9,38016083),n=m(n,r,i,o,t[a+15],14,-660478335),o=m(o,n,r,i,t[a+4],20,-405537848),i=m(i,o,n,r,t[a+9],5,568446438),r=m(r,i,o,n,t[a+14],9,-1019803690),n=m(n,r,i,o,t[a+3],14,-187363961),o=m(o,n,r,i,t[a+8],20,1163531501),i=m(i,o,n,r,t[a+13],5,-1444681467),r=m(r,i,o,n,t[a+2],9,-51403784),n=m(n,r,i,o,t[a+7],14,1735328473),i=A(i,o=m(o,n,r,i,t[a+12],20,-1926607734),n,r,t[a+5],4,-378558),r=A(r,i,o,n,t[a+8],11,-2022574463),n=A(n,r,i,o,t[a+11],16,1839030562),o=A(o,n,r,i,t[a+14],23,-35309556),i=A(i,o,n,r,t[a+1],4,-1530992060),r=A(r,i,o,n,t[a+4],11,1272893353),n=A(n,r,i,o,t[a+7],16,-155497632),o=A(o,n,r,i,t[a+10],23,-1094730640),i=A(i,o,n,r,t[a+13],4,681279174),r=A(r,i,o,n,t[a],11,-358537222),n=A(n,r,i,o,t[a+3],16,-722521979),o=A(o,n,r,i,t[a+6],23,76029189),i=A(i,o,n,r,t[a+9],4,-640364487),r=A(r,i,o,n,t[a+12],11,-421815835),n=A(n,r,i,o,t[a+15],16,530742520),i=S(i,o=A(o,n,r,i,t[a+2],23,-995338651),n,r,t[a],6,-198630844),r=S(r,i,o,n,t[a+7],10,1126891415),n=S(n,r,i,o,t[a+14],15,-1416354905),o=S(o,n,r,i,t[a+5],21,-57434055),i=S(i,o,n,r,t[a+12],6,1700485571),r=S(r,i,o,n,t[a+3],10,-1894986606),n=S(n,r,i,o,t[a+10],15,-1051523),o=S(o,n,r,i,t[a+1],21,-2054922799),i=S(i,o,n,r,t[a+8],6,1873313359),r=S(r,i,o,n,t[a+15],10,-30611744),n=S(n,r,i,o,t[a+6],15,-1560198380),o=S(o,n,r,i,t[a+13],21,1309151649),i=S(i,o,n,r,t[a+4],6,-145523070),r=S(r,i,o,n,t[a+11],10,-1120210379),n=S(n,r,i,o,t[a+2],15,718787259),o=S(o,n,r,i,t[a+9],21,-343485551),i=b(i,s),o=b(o,d),n=b(n,l),r=b(r,c)}return[i,o,n,r]}(function(t){if(0===t.length)return[];for(var e=8*t.length,i=new Uint32Array(v(e)),o=0;o<e;o+=8)i[o>>5]|=(255&t[o/8])<<o%32;return i}(t),8*t.length))})),L=function(t,e,i){var o=(t=t||{}).random||(t.rng||r)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){i=i||0;for(var n=0;n<16;++n)e[i+n]=o[n];return e}return c(o)};function R(t,e,i,o){switch(t){case 0:return e&i^~e&o;case 1:case 3:return e^i^o;case 2:return e&i^e&o^i&o}}function N(t,e){return t<<e|t>>>32-e}const D=T("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var o=unescape(encodeURIComponent(t));t=[];for(var n=0;n<o.length;++n)t.push(o.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var r=t.length/4+2,a=Math.ceil(r/16),s=new Array(a),d=0;d<a;++d){for(var l=new Uint32Array(16),c=0;c<16;++c)l[c]=t[64*d+4*c]<<24|t[64*d+4*c+1]<<16|t[64*d+4*c+2]<<8|t[64*d+4*c+3];s[d]=l}s[a-1][14]=8*(t.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(t.length-1)&4294967295;for(var u=0;u<a;++u){for(var h=new Uint32Array(80),_=0;_<16;++_)h[_]=s[u][_];for(var p=16;p<80;++p)h[p]=N(h[p-3]^h[p-8]^h[p-14]^h[p-16],1);for(var f=i[0],g=i[1],T=i[2],v=i[3],b=i[4],E=0;E<80;++E){var y=Math.floor(E/20),m=N(f,5)+R(y,g,T,v)+b+e[y]+h[E]>>>0;b=v,v=T,T=N(g,30)>>>0,g=f,f=m}i[0]=i[0]+f>>>0,i[1]=i[1]+g>>>0,i[2]=i[2]+T>>>0,i[3]=i[3]+v>>>0,i[4]=i[4]+b>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]})),w="00000000-0000-0000-0000-000000000000",B=function(t){if(!s(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},92:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;var i=function(){function t(t,e,i,o){this.name=t,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=o,this.required=!1,this.fixed=!1,this.type="any"}return t.prototype.setType=function(t){return this.type=t,this},t.prototype.setRequired=function(){return this.required=!0,this},t.prototype.setFixed=function(){return this.fixed=!0,this},t.NUMBER="number",t.STRING="string",t.BOOLEAN="boolean",t}();e.Attribute=i},99:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeDefinitions=void 0;var o=i(92),n=function(){function t(){this.attributes=[],this.nameToAttribute={}}return t.prototype.addWithAll=function(t,e,i,n){var r=new o.Attribute(t,e,i,n);return this.attributes.push(r),this.nameToAttribute[t]=r,r},t.prototype.addInherited=function(t,e){return this.addWithAll(t,e,void 0,!1)},t.prototype.add=function(t,e,i){return this.addWithAll(t,void 0,e,i)},t.prototype.getAttributes=function(){return this.attributes},t.prototype.getModelName=function(t){var e=this.nameToAttribute[t];if(void 0!==e)return e.modelName},t.prototype.toJson=function(t,e){for(var i=0,o=this.attributes;i<o.length;i++){var n=o[i],r=e[n.name];(n.alwaysWriteJson||r!==n.defaultValue)&&(t[n.name]=r)}},t.prototype.fromJson=function(t,e){for(var i=0,o=this.attributes;i<o.length;i++){var n=o[i],r=t[n.name];e[n.name]=void 0===r?n.defaultValue:r}},t.prototype.update=function(t,e){for(var i=0,o=this.attributes;i<o.length;i++){var n=o[i];if(t.hasOwnProperty(n.name)){var r=t[n.name];void 0===r?delete e[n.name]:e[n.name]=r}}},t.prototype.setDefaults=function(t){for(var e=0,i=this.attributes;e<i.length;e++){var o=i[e];t[o.name]=o.defaultValue}},t.prototype.toTypescriptInterface=function(t,e){var i=[],o=this.attributes.sort((function(t,e){return t.name.localeCompare(e.name)}));i.push("export interface I"+t+"Attributes {");for(var n=0;n<o.length;n++){var r=o[n],a=r.type,s=void 0,d=r,l=void 0;void 0!==d.defaultValue?s=d.defaultValue:void 0!==d.modelName&&void 0!==e&&void 0!==e.nameToAttribute[d.modelName]&&(l=d.modelName,s=(d=e.nameToAttribute[d.modelName]).defaultValue,a=d.type);var c=JSON.stringify(s),u=d.required||d.fixed?"":"?";if(r.fixed)i.push("\t"+r.name+": "+c+";");else{var h=(void 0!==s?"default: "+c:"")+(void 0!==l?" - inherited from global "+l:"");i.push("\t"+r.name+u+": "+a+";"+(h.length>0?" // "+h:""))}}return i.push("}"),i.join("\n")},t}();e.AttributeDefinitions=n},95:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DockLocation=void 0;var o=i(327),n=i(359),r=function(){function t(e,i,o){this._name=e,this._orientation=i,this._indexPlus=o,t.values[this._name]=this}return t.getByName=function(e){return t.values[e]},t.getLocation=function(e,i,o){if(i=(i-e.x)/e.width,o=(o-e.y)/e.height,i>=.25&&i<.75&&o>=.25&&o<.75)return t.CENTER;var n=o>=1-i;return o>=i?n?t.BOTTOM:t.LEFT:n?t.RIGHT:t.TOP},t.prototype.getName=function(){return this._name},t.prototype.getOrientation=function(){return this._orientation},t.prototype.getDockRect=function(e){return this===t.TOP?new n.Rect(e.x,e.y,e.width,e.height/2):this===t.BOTTOM?new n.Rect(e.x,e.getBottom()-e.height/2,e.width,e.height/2):this===t.LEFT?new n.Rect(e.x,e.y,e.width/2,e.height):this===t.RIGHT?new n.Rect(e.getRight()-e.width/2,e.y,e.width/2,e.height):e.clone()},t.prototype.split=function(e,i){return this===t.TOP?{start:new n.Rect(e.x,e.y,e.width,i),end:new n.Rect(e.x,e.y+i,e.width,e.height-i)}:this===t.LEFT?{start:new n.Rect(e.x,e.y,i,e.height),end:new n.Rect(e.x+i,e.y,e.width-i,e.height)}:this===t.RIGHT?{start:new n.Rect(e.getRight()-i,e.y,i,e.height),end:new n.Rect(e.x,e.y,e.width-i,e.height)}:{start:new n.Rect(e.x,e.getBottom()-i,e.width,i),end:new n.Rect(e.x,e.y,e.width,e.height-i)}},t.prototype.reflect=function(){return this===t.TOP?t.BOTTOM:this===t.LEFT?t.RIGHT:this===t.RIGHT?t.LEFT:t.TOP},t.prototype.toString=function(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"},t.values={},t.TOP=new t("top",o.Orientation.VERT,0),t.BOTTOM=new t("bottom",o.Orientation.VERT,1),t.LEFT=new t("left",o.Orientation.HORZ,0),t.RIGHT=new t("right",o.Orientation.HORZ,1),t.CENTER=new t("center",o.Orientation.VERT,0),t}();e.DockLocation=r},241:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DragDrop=void 0;var o=i(359),n=!("undefined"==typeof window||!window.document||!window.document.createElement),r=function(){function t(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,n&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}return t.prototype.addGlass=function(t){var e;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),null===(e=this._document.defaultView)||void 0===e||e.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)},t.prototype.resizeGlass=function(){o.Rect.fromElement(this._rootElement).positionElement(this._glass,"fixed")},t.prototype.hideGlass=function(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),null===(t=this._document.defaultView)||void 0===t||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))},t.prototype._updateGlassCursor=function(){var t;this._glass.style.cursor=null!==(t=this._glassCursorOverride)&&void 0!==t?t:this._defaultGlassCursor},t.prototype._setDefaultGlassCursor=function(t){this._defaultGlassCursor=t,this._updateGlassCursor()},t.prototype.setGlassCursorOverride=function(t){this._glassCursorOverride=t,this._updateGlassCursor()},t.prototype.startDrag=function(t,e,i,o,n,r,a,s,d){if(!(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500)){this._lastEvent=t,this._document=s||window.document,this._rootElement=d||this._document.body;var l=this._getLocationEvent(t);this.addGlass(n),this._dragging&&console.warn("this._dragging true on startDrag should never happen"),t?(this._startX=l.clientX,this._startY=l.clientY,window.matchMedia&&!window.matchMedia("(pointer: fine)").matches||this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=e,this._fDragMove=i,this._fDragEnd=o,this._fDragCancel=n,this._fClick=r,this._fDblClick=a,this._active=!0,"dragenter"===(null==t?void 0:t.type)?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}},t.prototype.isDragging=function(){return this._dragging},t.prototype.isActive=function(){return this._active},t.prototype.toString=function(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"},t.prototype._onKeyPress=function(t){27===t.keyCode&&this._onDragCancel()},t.prototype._onDragCancel=function(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),void 0!==this._fDragCancel&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1},t.prototype._getLocationEvent=function(t){var e=t;return t&&t.touches&&(e=t.touches[0]),e},t.prototype._getLocationEventEnd=function(t){var e=t;return t.changedTouches&&(e=t.changedTouches[0]),e},t.prototype._stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},t.prototype._preventDefault=function(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t},t.prototype._onMouseMove=function(t){this._lastEvent=t;var e=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-e.clientX)>5||Math.abs(this._startY-e.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(e),!1},t.prototype._onMouseUp=function(t){this._lastEvent=t;var e=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-e.clientX)<=5&&Math.abs(this._startY-e.clientY)<=5){var i=!1,o=(new Date).getTime();Math.abs(this._clickX-e.clientX)<=5&&Math.abs(this._clickY-e.clientY)<=5&&o-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),i=!0),!i&&this._fClick&&this._fClick(t),this._lastClick=o,this._clickX=e.clientX,this._clickY=e.clientY}return!1},t.prototype._onDragEnter=function(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1},t.prototype._onDragLeave=function(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1},t.instance=new t,t}();e.DragDrop=r},34:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DropInfo=void 0;e.DropInfo=function(t,e,i,o,n){this.node=t,this.rect=e,this.location=i,this.index=o,this.className=n}},306:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.I18nLabel=void 0,(i=e.I18nLabel||(e.I18nLabel={})).Close_Tab="Close",i.Close_Tabset="Close tabset",i.Move_Tab="Move: ",i.Move_Tabset="Move tabset",i.Maximize="Maximize tabset",i.Restore="Restore tabset",i.Float_Tab="Show selected tab in floating window",i.Overflow_Menu_Tooltip="Hidden tabs",i.Floating_Window_Message="This panel is shown in a floating window",i.Floating_Window_Show_Window="Show window",i.Floating_Window_Dock_Window="Dock window",i.Error_rendering_component="Error rendering component"},327:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Orientation=void 0;var i=function(){function t(t){this._name=t}return t.flip=function(e){return e===t.HORZ?t.VERT:t.HORZ},t.prototype.getName=function(){return this._name},t.prototype.toString=function(){return this._name},t.HORZ=new t("horz"),t.VERT=new t("vert"),t}();e.Orientation=i},119:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.showPopup=void 0;var o=i(899),n=i(241),r=i(398),a=i(176);e.showPopup=function(t,e,i,a,d,l){var c=a.getRootDiv(),u=a.getClassName,h=t.ownerDocument,_=t.getBoundingClientRect(),p=c.getBoundingClientRect(),f=h.createElement("div");f.className=u(r.CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),_.left<p.left+p.width/2?f.style.left=_.left-p.left+"px":f.style.right=p.right-_.right+"px",_.top<p.top+p.height/2?f.style.top=_.top-p.top+"px":f.style.bottom=p.bottom-_.bottom+"px",n.DragDrop.instance.addGlass((function(){return g()})),n.DragDrop.instance.setGlassCursorOverride("default"),c.appendChild(f);var g=function(){a.hidePortal(),n.DragDrop.instance.hideGlass(),c.removeChild(f),f.removeEventListener("mousedown",T),h.removeEventListener("mousedown",v)},T=function(t){t.stopPropagation()},v=function(t){g()};f.addEventListener("mousedown",T),h.addEventListener("mousedown",v),a.showPortal(o.createElement(s,{currentDocument:h,onSelect:i,onHide:g,items:e,classNameMapper:u,layout:a,iconFactory:d,titleFactory:l}),f)};var s=function(t){var e=t.items,i=t.onHide,n=t.onSelect,s=t.classNameMapper,d=t.layout,l=t.iconFactory,c=t.titleFactory,u=e.map((function(t,e){return o.createElement("div",{key:t.index,className:s(r.CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+e,onClick:function(e){return function(t,e){n(t),i(),e.stopPropagation()}(t,e)},title:t.node.getHelpText()},t.node.getModel().isLegacyOverflowMenu()?t.node._getNameForOverflowMenu():o.createElement(a.TabButtonStamp,{node:t.node,layout:d,iconFactory:l,titleFactory:c}))}));return o.createElement("div",{className:s(r.CLASSES.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},u)}},359:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;var o=i(327),n=function(){function t(t,e,i,o){this.x=t,this.y=e,this.width=i,this.height=o}return t.empty=function(){return new t(0,0,0,0)},t.fromElement=function(e){var i=e.getBoundingClientRect();return new t(i.x,i.y,i.width,i.height)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},t.prototype.getBottom=function(){return this.y+this.height},t.prototype.getRight=function(){return this.x+this.width},t.prototype.getCenter=function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},t.prototype.positionElement=function(t,e){this.styleWithPosition(t.style,e)},t.prototype.styleWithPosition=function(t,e){return void 0===e&&(e="absolute"),t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t},t.prototype.contains=function(t,e){return this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom()},t.prototype.removeInsets=function(e){return new t(this.x+e.left,this.y+e.top,Math.max(0,this.width-e.left-e.right),Math.max(0,this.height-e.top-e.bottom))},t.prototype.centerInRect=function(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2},t.prototype._getSize=function(t){var e=this.width;return t===o.Orientation.VERT&&(e=this.height),e},t.prototype.toString=function(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"},t}();e.Rect=n},398:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.CLASSES=void 0,(i=e.CLASSES||(e.CLASSES={})).FLEXLAYOUT__BORDER="flexlayout__border",i.FLEXLAYOUT__BORDER_="flexlayout__border_",i.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",i.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",i.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",i.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",i.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",i.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",i.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",i.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",i.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",i.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",i.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",i.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",i.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",i.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",i.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",i.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",i.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",i.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",i.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",i.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",i.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",i.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",i.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",i.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",i.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",i.FLEXLAYOUT__LAYOUT="flexlayout__layout",i.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",i.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",i.FLEXLAYOUT__SPLITTER="flexlayout__splitter",i.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",i.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",i.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",i.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",i.FLEXLAYOUT__TAB="flexlayout__tab",i.FLEXLAYOUT__TABSET="flexlayout__tabset",i.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",i.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",i.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",i.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",i.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",i.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",i.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",i.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",i.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",i.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",i.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",i.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",i.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",i.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",i.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",i.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",i.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",i.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",i.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",i.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",i.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",i.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",i.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",i.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",i.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",i.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",i.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",i.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",i.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",i.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",i.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",i.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",i.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",i.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",i.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"},607:function(t,e,i){var o=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,o,n)}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||o(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(175),e),n(i(987),e),n(i(920),e),n(i(907),e),n(i(271),e),n(i(138),e),n(i(23),e),n(i(865),e),n(i(229),e),n(i(627),e),n(i(103),e),n(i(179),e),n(i(618),e),n(i(275),e),n(i(657),e),n(i(95),e),n(i(241),e),n(i(34),e),n(i(306),e),n(i(327),e),n(i(359),e),n(i(398),e)},987:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0;e.Action=function(t,e){this.type=t,this.data=e}},920:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Actions=void 0;var o=i(987),n=function(){function t(){}return t.addNode=function(e,i,n,r,a){return new o.Action(t.ADD_NODE,{json:e,toNode:i,location:n.getName(),index:r,select:a})},t.moveNode=function(e,i,n,r,a){return new o.Action(t.MOVE_NODE,{fromNode:e,toNode:i,location:n.getName(),index:r,select:a})},t.deleteTab=function(e){return new o.Action(t.DELETE_TAB,{node:e})},t.deleteTabset=function(e){return new o.Action(t.DELETE_TABSET,{node:e})},t.renameTab=function(e,i){return new o.Action(t.RENAME_TAB,{node:e,text:i})},t.selectTab=function(e){return new o.Action(t.SELECT_TAB,{tabNode:e})},t.setActiveTabset=function(e){return new o.Action(t.SET_ACTIVE_TABSET,{tabsetNode:e})},t.adjustSplit=function(e){var i=e.node1Id,n=e.node2Id;return new o.Action(t.ADJUST_SPLIT,{node1:i,weight1:e.weight1,pixelWidth1:e.pixelWidth1,node2:n,weight2:e.weight2,pixelWidth2:e.pixelWidth2})},t.adjustBorderSplit=function(e,i){return new o.Action(t.ADJUST_BORDER_SPLIT,{node:e,pos:i})},t.maximizeToggle=function(e){return new o.Action(t.MAXIMIZE_TOGGLE,{node:e})},t.updateModelAttributes=function(e){return new o.Action(t.UPDATE_MODEL_ATTRIBUTES,{json:e})},t.updateNodeAttributes=function(e,i){return new o.Action(t.UPDATE_NODE_ATTRIBUTES,{node:e,json:i})},t.floatTab=function(e){return new o.Action(t.FLOAT_TAB,{node:e})},t.unFloatTab=function(e){return new o.Action(t.UNFLOAT_TAB,{node:e})},t.ADD_NODE="FlexLayout_AddNode",t.MOVE_NODE="FlexLayout_MoveNode",t.DELETE_TAB="FlexLayout_DeleteTab",t.DELETE_TABSET="FlexLayout_DeleteTabset",t.RENAME_TAB="FlexLayout_RenameTab",t.SELECT_TAB="FlexLayout_SelectTab",t.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",t.ADJUST_SPLIT="FlexLayout_AdjustSplit",t.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",t.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",t.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",t.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",t.FLOAT_TAB="FlexLayout_FloatTab",t.UNFLOAT_TAB="FlexLayout_UnFloatTab",t}();e.Actions=n},907:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.BorderNode=void 0;var r=i(92),a=i(99),s=i(95),d=i(34),l=i(327),c=i(359),u=i(398),h=i(103),_=i(618),p=i(275),f=i(494),g=function(t){function e(i,o,n){var r=t.call(this,n)||this;return r._adjustedSize=0,r._calculatedBorderBarSize=0,r._location=i,r._drawChildren=[],r._attributes.id="border_".concat(i.getName()),e._attributeDefinitions.fromJson(o,r._attributes),n._addNode(r),r}return n(e,t),e._fromJson=function(t,i){var o=new e(s.DockLocation.getByName(t.location),t,i);return t.children&&(o._children=t.children.map((function(t){var e=p.TabNode._fromJson(t,i);return e._setParent(o),e}))),o},e._createAttributeDefinitions=function(){var t=new a.AttributeDefinitions;return t.add("type",e.TYPE,!0).setType(r.Attribute.STRING).setFixed(),t.add("selected",-1).setType(r.Attribute.NUMBER),t.add("show",!0).setType(r.Attribute.BOOLEAN),t.add("config",void 0).setType("any"),t.addInherited("barSize","borderBarSize").setType(r.Attribute.NUMBER),t.addInherited("enableDrop","borderEnableDrop").setType(r.Attribute.BOOLEAN),t.addInherited("className","borderClassName").setType(r.Attribute.STRING),t.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(r.Attribute.BOOLEAN),t.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(r.Attribute.BOOLEAN),t.addInherited("size","borderSize").setType(r.Attribute.NUMBER),t.addInherited("minSize","borderMinSize").setType(r.Attribute.NUMBER),t.addInherited("enableAutoHide","borderEnableAutoHide").setType(r.Attribute.BOOLEAN),t},e.prototype.getLocation=function(){return this._location},e.prototype.getTabHeaderRect=function(){return this._tabHeaderRect},e.prototype.getRect=function(){return this._tabHeaderRect},e.prototype.getContentRect=function(){return this._contentRect},e.prototype.isEnableDrop=function(){return this._getAttr("enableDrop")},e.prototype.isAutoSelectTab=function(t){return null==t&&(t=-1!==this.getSelected()),t?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")},e.prototype.getClassName=function(){return this._getAttr("className")},e.prototype.calcBorderBarSize=function(t){var e=this._getAttr("barSize");this._calculatedBorderBarSize=0!==e?e:t.borderBarSize},e.prototype.getBorderBarSize=function(){return this._calculatedBorderBarSize},e.prototype.getSize=function(){var t=this._getAttr("size"),e=this.getSelected();if(-1===e)return t;var i=this._children[e],o=this._location._orientation===l.Orientation.HORZ?i._getAttr("borderWidth"):i._getAttr("borderHeight");return-1===o?t:o},e.prototype.getMinSize=function(){return this._getAttr("minSize")},e.prototype.getSelected=function(){return this._attributes.selected},e.prototype.getSelectedNode=function(){if(-1!==this.getSelected())return this._children[this.getSelected()]},e.prototype.getOrientation=function(){return this._location.getOrientation()},e.prototype.getConfig=function(){return this._attributes.config},e.prototype.isMaximized=function(){return!1},e.prototype.isShowing=function(){return!(!this._attributes.show||this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&0===this._children.length)},e.prototype.isAutoHide=function(){return this._getAttr("enableAutoHide")},e.prototype._setSelected=function(t){this._attributes.selected=t},e.prototype._setSize=function(t){var e=this.getSelected();if(-1===e)this._attributes.size=t;else{var i=this._children[e];-1===(this._location._orientation===l.Orientation.HORZ?i._getAttr("borderWidth"):i._getAttr("borderHeight"))?this._attributes.size=t:this._location._orientation===l.Orientation.HORZ?i._setBorderWidth(t):i._setBorderHeight(t)}},e.prototype._updateAttrs=function(t){e._attributeDefinitions.update(t,this._attributes)},e.prototype._getDrawChildren=function(){return this._drawChildren},e.prototype._setAdjustedSize=function(t){this._adjustedSize=t},e.prototype._getAdjustedSize=function(){return this._adjustedSize},e.prototype._layoutBorderOuter=function(t,e){this.calcBorderBarSize(e);var i=this._location.split(t,this.getBorderBarSize());return this._tabHeaderRect=i.start,i.end},e.prototype._layoutBorderInner=function(t,e){this._drawChildren=[];var i=this._location,o=i.split(t,this._adjustedSize+this._model.getSplitterSize()),n=i.reflect().split(o.start,this._model.getSplitterSize());this._contentRect=n.end;for(var r=0;r<this._children.length;r++){var a=this._children[r];a._layout(this._contentRect,e),a._setVisible(r===this.getSelected()),this._drawChildren.push(a)}if(-1===this.getSelected())return t;var s=new _.SplitterNode(this._model);return s._setParent(this),s._setRect(n.start),this._drawChildren.push(s),o.end},e.prototype._remove=function(t){var e=this._removeChild(t);-1!==this.getSelected()&&(0,f.adjustSelectedIndex)(this,e)},e.prototype.canDrop=function(t,e,i){if(t.getType()===p.TabNode.TYPE){var o,n=s.DockLocation.CENTER;if(this._tabHeaderRect.contains(e,i)){if(this._location._orientation===l.Orientation.VERT)if(this._children.length>0){for(var r=(T=this._children[0].getTabRect()).y,a=T.height,h=this._tabHeaderRect.x,_=0,f=0;f<this._children.length;f++){if(_=(T=this._children[f].getTabRect()).x+T.width/2,e>=h&&e<_){var g=new c.Rect(T.x-2,r,3,a);o=new d.DropInfo(this,g,n,f,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}h=_}null==o&&(g=new c.Rect(T.getRight()-2,r,3,a),o=new d.DropInfo(this,g,n,this._children.length,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT))}else g=new c.Rect(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18),o=new d.DropInfo(this,g,n,0,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);else if(this._children.length>0){var T,v=(T=this._children[0].getTabRect()).x,b=T.width;for(h=this._tabHeaderRect.y,_=0,f=0;f<this._children.length;f++){if(_=(T=this._children[f].getTabRect()).y+T.height/2,i>=h&&i<_){g=new c.Rect(v,T.y-2,b,3),o=new d.DropInfo(this,g,n,f,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}h=_}null==o&&(g=new c.Rect(v,T.getBottom()-2,b,3),o=new d.DropInfo(this,g,n,this._children.length,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT))}else g=new c.Rect(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3),o=new d.DropInfo(this,g,n,0,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);if(!t._canDockInto(t,o))return}else if(-1!==this.getSelected()&&this._contentRect.contains(e,i)&&(g=this._contentRect,o=new d.DropInfo(this,g,n,-1,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT),!t._canDockInto(t,o)))return;return o}},e.prototype.drop=function(t,i,o,n){var r=0,a=t.getParent();void 0!==a&&(r=a._removeChild(t),a!==this&&a instanceof e&&a.getSelected()===r?a._setSelected(-1):(0,f.adjustSelectedIndex)(a,r)),t.getType()===p.TabNode.TYPE&&a===this&&r<o&&o>0&&o--;var s=o;-1===s&&(s=this._children.length),t.getType()===p.TabNode.TYPE&&this._addChild(t,s),(n||!1!==n&&this.isAutoSelectTab())&&this._setSelected(s),this._model._tidy()},e.prototype.toJson=function(){var t={};return e._attributeDefinitions.toJson(t,this._attributes),t.location=this._location.getName(),t.children=this._children.map((function(t){return t.toJson()})),t},e.prototype._getSplitterBounds=function(t,e){void 0===e&&(e=!1);var i=[0,0],o=e?this.getMinSize():0,n=this._model._getOuterInnerRects().outer,r=this._model._getOuterInnerRects().inner,a=this._model.getRoot();return this._location===s.DockLocation.TOP?(i[0]=n.y+o,i[1]=Math.max(i[0],r.getBottom()-t.getHeight()-a.getMinHeight())):this._location===s.DockLocation.LEFT?(i[0]=n.x+o,i[1]=Math.max(i[0],r.getRight()-t.getWidth()-a.getMinWidth())):this._location===s.DockLocation.BOTTOM?(i[1]=n.getBottom()-t.getHeight()-o,i[0]=Math.min(i[1],r.y+a.getMinHeight())):this._location===s.DockLocation.RIGHT&&(i[1]=n.getRight()-t.getWidth()-o,i[0]=Math.min(i[1],r.x+a.getMinWidth())),i},e.prototype._calculateSplit=function(t,e){var i=this._getSplitterBounds(t);return this._location===s.DockLocation.BOTTOM||this._location===s.DockLocation.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])},e.prototype._getAttributeDefinitions=function(){return e._attributeDefinitions},e.getAttributeDefinitions=function(){return e._attributeDefinitions},e.TYPE="border",e._attributeDefinitions=e._createAttributeDefinitions(),e}(h.Node);e.BorderNode=g},271:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BorderSet=void 0;var o=i(327),n=i(907),r=function(){function t(t){this._model=t,this._borders=[]}return t._fromJson=function(e,i){var o=new t(i);return o._borders=e.map((function(t){return n.BorderNode._fromJson(t,i)})),o},t.prototype.getBorders=function(){return this._borders},t.prototype._forEachNode=function(t){for(var e=0,i=this._borders;e<i.length;e++){var o=i[e];t(o,0);for(var n=0,r=o.getChildren();n<r.length;n++)r[n]._forEachNode(t,1)}},t.prototype._toJson=function(){return this._borders.map((function(t){return t.toJson()}))},t.prototype._layoutBorder=function(t,e){for(var i=t.outer,n=this._model.getRoot(),r=Math.max(0,i.height-n.getMinHeight()),a=Math.max(0,i.width-n.getMinWidth()),s=0,d=0,l=0,c=0,u=this._borders.filter((function(t){return t.isShowing()})),h=0,_=u;h<_.length;h++){(E=_[h])._setAdjustedSize(E.getSize());var p=-1!==E.getSelected();E.getLocation().getOrientation()===o.Orientation.HORZ?(d+=E.getBorderBarSize(),p&&(a-=this._model.getSplitterSize(),d+=E.getSize(),c+=E.getSize())):(s+=E.getBorderBarSize(),p&&(r-=this._model.getSplitterSize(),s+=E.getSize(),l+=E.getSize()))}for(var f=0,g=!1;d>a&&c>0||s>r&&l>0;){if(-1!==(E=u[f]).getSelected()){var T=E._getAdjustedSize();d>a&&c>0&&E.getLocation().getOrientation()===o.Orientation.HORZ&&T>0&&T>E.getMinSize()?(E._setAdjustedSize(T-1),d--,c--,g=!0):s>r&&l>0&&E.getLocation().getOrientation()===o.Orientation.VERT&&T>0&&T>E.getMinSize()&&(E._setAdjustedSize(T-1),s--,l--,g=!0)}if(0==(f=(f+1)%u.length)){if(!g)break;g=!1}}for(var v=0,b=u;v<b.length;v++){var E=b[v];t.outer=E._layoutBorderOuter(t.outer,e)}t.inner=t.outer;for(var y=0,m=u;y<m.length;y++)E=m[y],t.inner=E._layoutBorderInner(t.inner,e);return t},t.prototype._findDropTargetNode=function(t,e,i){for(var o=0,n=this._borders;o<n.length;o++){var r=n[o];if(r.isShowing()){var a=r.canDrop(t,e,i);if(void 0!==a)return a}}},t}();e.BorderSet=r},138:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.ICloseType=void 0,(i=e.ICloseType||(e.ICloseType={}))[i.Visible=1]="Visible",i[i.Always=2]="Always",i[i.Selected=3]="Selected"},23:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},865:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},229:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},627:function(t,e,i){var o=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;var n=i(453),r=i(92),a=i(99),s=i(95),d=i(327),l=i(359),c=i(920),u=i(907),h=i(271),_=i(179),p=i(275),f=i(657),g=i(494),T=function(){function t(){this._borderRects={inner:l.Rect.empty(),outer:l.Rect.empty()},this._attributes={},this._idMap={},this._borders=new h.BorderSet(this),this._pointerFine=!0,this._showHiddenBorder=s.DockLocation.CENTER}return t.fromJson=function(e){var i=new t;return t._attributeDefinitions.fromJson(e.global,i._attributes),e.borders&&(i._borders=h.BorderSet._fromJson(e.borders,i)),i._root=_.RowNode._fromJson(e.layout,i),i._tidy(),i},t._createAttributeDefinitions=function(){var t=new a.AttributeDefinitions;return t.add("legacyOverflowMenu",!1).setType(r.Attribute.BOOLEAN),t.add("splitterSize",-1).setType(r.Attribute.NUMBER),t.add("splitterExtra",0).setType(r.Attribute.NUMBER),t.add("enableEdgeDock",!0).setType(r.Attribute.BOOLEAN),t.add("rootOrientationVertical",!1).setType(r.Attribute.BOOLEAN),t.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("enableUseVisibility",!1).setType(r.Attribute.BOOLEAN),t.add("tabEnableClose",!0).setType(r.Attribute.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnableFloat",!1).setType(r.Attribute.BOOLEAN),t.add("tabEnableDrag",!0).setType(r.Attribute.BOOLEAN),t.add("tabEnableRename",!0).setType(r.Attribute.BOOLEAN),t.add("tabClassName",void 0).setType(r.Attribute.STRING),t.add("tabIcon",void 0).setType(r.Attribute.STRING),t.add("tabEnableRenderOnDemand",!0).setType(r.Attribute.BOOLEAN),t.add("tabDragSpeed",.3).setType(r.Attribute.NUMBER),t.add("tabBorderWidth",-1).setType(r.Attribute.NUMBER),t.add("tabBorderHeight",-1).setType(r.Attribute.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetEnableClose",!1).setType(r.Attribute.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(r.Attribute.STRING),t.add("tabSetClassNameHeader",void 0).setType(r.Attribute.STRING),t.add("tabSetEnableTabStrip",!0).setType(r.Attribute.BOOLEAN),t.add("tabSetHeaderHeight",0).setType(r.Attribute.NUMBER),t.add("tabSetTabStripHeight",0).setType(r.Attribute.NUMBER),t.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabSetMinWidth",0).setType(r.Attribute.NUMBER),t.add("tabSetMinHeight",0).setType(r.Attribute.NUMBER),t.add("borderSize",200).setType(r.Attribute.NUMBER),t.add("borderMinSize",0).setType(r.Attribute.NUMBER),t.add("borderBarSize",0).setType(r.Attribute.NUMBER),t.add("borderEnableDrop",!0).setType(r.Attribute.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(r.Attribute.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(r.Attribute.BOOLEAN),t.add("borderClassName",void 0).setType(r.Attribute.STRING),t.add("borderEnableAutoHide",!1).setType(r.Attribute.BOOLEAN),t},t.prototype._setChangeListener=function(t){this._changeListener=t},t.prototype.getActiveTabset=function(){return this._activeTabSet&&this.getNodeById(this._activeTabSet.getId())?this._activeTabSet:void 0},t.prototype._getShowHiddenBorder=function(){return this._showHiddenBorder},t.prototype._setShowHiddenBorder=function(t){this._showHiddenBorder=t},t.prototype._setActiveTabset=function(t){this._activeTabSet=t},t.prototype.getMaximizedTabset=function(){return this._maximizedTabSet},t.prototype._setMaximizedTabset=function(t){this._maximizedTabSet=t},t.prototype.getRoot=function(){return this._root},t.prototype.isRootOrientationVertical=function(){return this._attributes.rootOrientationVertical},t.prototype.isUseVisibility=function(){return this._attributes.enableUseVisibility},t.prototype.getBorderSet=function(){return this._borders},t.prototype._getOuterInnerRects=function(){return this._borderRects},t.prototype._getPointerFine=function(){return this._pointerFine},t.prototype._setPointerFine=function(t){this._pointerFine=t},t.prototype.visitNodes=function(t){this._borders._forEachNode(t),this._root._forEachNode(t,0)},t.prototype.getNodeById=function(t){return this._idMap[t]},t.prototype.doAction=function(t){var e=void 0;switch(t.type){case c.Actions.ADD_NODE:var i=new p.TabNode(this,t.data.json,!0);((n=this._idMap[t.data.toNode])instanceof f.TabSetNode||n instanceof u.BorderNode||n instanceof _.RowNode)&&(n.drop(i,s.DockLocation.getByName(t.data.location),t.data.index,t.data.select),e=i);break;case c.Actions.MOVE_NODE:var n,r=this._idMap[t.data.fromNode];(r instanceof p.TabNode||r instanceof f.TabSetNode)&&((n=this._idMap[t.data.toNode])instanceof f.TabSetNode||n instanceof u.BorderNode||n instanceof _.RowNode)&&n.drop(r,s.DockLocation.getByName(t.data.location),t.data.index,t.data.select);break;case c.Actions.DELETE_TAB:(m=this._idMap[t.data.node])instanceof p.TabNode&&m._delete();break;case c.Actions.DELETE_TABSET:if((m=this._idMap[t.data.node])instanceof f.TabSetNode){for(var a=o([],m.getChildren(),!0),d=0;d<a.length;d++){var l=a[d];l.isEnableClose()&&l._delete()}0===m.getChildren().length&&m._delete(),this._tidy()}break;case c.Actions.FLOAT_TAB:(m=this._idMap[t.data.node])instanceof p.TabNode&&(m._setFloating(!0),(0,g.adjustSelectedIndexAfterFloat)(m));break;case c.Actions.UNFLOAT_TAB:(m=this._idMap[t.data.node])instanceof p.TabNode&&(m._setFloating(!1),(0,g.adjustSelectedIndexAfterDock)(m));break;case c.Actions.RENAME_TAB:(m=this._idMap[t.data.node])instanceof p.TabNode&&m._setName(t.data.text);break;case c.Actions.SELECT_TAB:var h=this._idMap[t.data.tabNode];if(h instanceof p.TabNode){var T=h.getParent(),v=T.getChildren().indexOf(h);T instanceof u.BorderNode?T.getSelected()===v?T._setSelected(-1):T._setSelected(v):T instanceof f.TabSetNode&&(T.getSelected()!==v&&T._setSelected(v),this._activeTabSet=T)}break;case c.Actions.SET_ACTIVE_TABSET:var b=this._idMap[t.data.tabsetNode];b instanceof f.TabSetNode&&(this._activeTabSet=b);break;case c.Actions.ADJUST_SPLIT:var E=this._idMap[t.data.node1],y=this._idMap[t.data.node2];(E instanceof f.TabSetNode||E instanceof _.RowNode)&&(y instanceof f.TabSetNode||y instanceof _.RowNode)&&(this._adjustSplitSide(E,t.data.weight1,t.data.pixelWidth1),this._adjustSplitSide(y,t.data.weight2,t.data.pixelWidth2));break;case c.Actions.ADJUST_BORDER_SPLIT:(m=this._idMap[t.data.node])instanceof u.BorderNode&&m._setSize(t.data.pos);break;case c.Actions.MAXIMIZE_TOGGLE:(m=this._idMap[t.data.node])instanceof f.TabSetNode&&(m===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=m,this._activeTabSet=m));break;case c.Actions.UPDATE_MODEL_ATTRIBUTES:this._updateAttrs(t.data.json);break;case c.Actions.UPDATE_NODE_ATTRIBUTES:var m;(m=this._idMap[t.data.node])._updateAttrs(t.data.json)}return this._updateIdMap(),void 0!==this._changeListener&&this._changeListener(),e},t.prototype._updateIdMap=function(){var t=this;this._idMap={},this.visitNodes((function(e){return t._idMap[e.getId()]=e}))},t.prototype._adjustSplitSide=function(t,e,i){t._setWeight(e),null!=t.getWidth()&&t.getOrientation()===d.Orientation.VERT?t._updateAttrs({width:i}):null!=t.getHeight()&&t.getOrientation()===d.Orientation.HORZ&&t._updateAttrs({height:i})},t.prototype.toJson=function(){var e={};return t._attributeDefinitions.toJson(e,this._attributes),this.visitNodes((function(t){t._fireEvent("save",void 0)})),{global:e,borders:this._borders._toJson(),layout:this._root.toJson()}},t.prototype.getSplitterSize=function(){var t=this._attributes.splitterSize;return-1===t&&(t=this._pointerFine?8:12),t},t.prototype.isLegacyOverflowMenu=function(){return this._attributes.legacyOverflowMenu},t.prototype.getSplitterExtra=function(){return this._attributes.splitterExtra},t.prototype.isEnableEdgeDock=function(){return this._attributes.enableEdgeDock},t.prototype._addNode=function(t){var e=t.getId();if(void 0!==this._idMap[e])throw new Error("Error: each node must have a unique id, duplicate id:".concat(t.getId()));"splitter"!==t.getType()&&(this._idMap[e]=t)},t.prototype._layout=function(t,e){var i;return this._borderRects=this._borders._layoutBorder({outer:t,inner:t},e),t=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),null===(i=this._root)||void 0===i||i.calcMinSize(),this._root._layout(t,e),t},t.prototype._findDropTargetNode=function(t,e,i){var o=this._root._findDropTargetNode(t,e,i);return void 0===o&&(o=this._borders._findDropTargetNode(t,e,i)),o},t.prototype._tidy=function(){this._root._tidy()},t.prototype._updateAttrs=function(e){t._attributeDefinitions.update(e,this._attributes)},t.prototype._nextUniqueId=function(){return"#"+(0,n.v4)()},t.prototype._getAttribute=function(t){return this._attributes[t]},t.prototype.setOnAllowDrop=function(t){this._onAllowDrop=t},t.prototype._getOnAllowDrop=function(){return this._onAllowDrop},t.prototype.setOnCreateTabSet=function(t){this._onCreateTabSet=t},t.prototype._getOnCreateTabSet=function(){return this._onCreateTabSet},t.toTypescriptInterfaces=function(){console.log(t._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(_.RowNode.getAttributeDefinitions().toTypescriptInterface("Row",t._attributeDefinitions)),console.log(f.TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet",t._attributeDefinitions)),console.log(p.TabNode.getAttributeDefinitions().toTypescriptInterface("Tab",t._attributeDefinitions)),console.log(u.BorderNode.getAttributeDefinitions().toTypescriptInterface("Border",t._attributeDefinitions))},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t._attributeDefinitions=t._createAttributeDefinitions(),t}();e.Model=T},103:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;var o=i(95),n=i(327),r=i(359),a=function(){function t(t){this._dirty=!1,this._tempSize=0,this._model=t,this._attributes={},this._children=[],this._fixed=!1,this._rect=r.Rect.empty(),this._visible=!1,this._listeners={}}return t.prototype.getId=function(){var t=this._attributes.id;return void 0!==t||(t=this._model._nextUniqueId(),this._setId(t)),t},t.prototype.getModel=function(){return this._model},t.prototype.getType=function(){return this._attributes.type},t.prototype.getParent=function(){return this._parent},t.prototype.getChildren=function(){return this._children},t.prototype.getRect=function(){return this._rect},t.prototype.isVisible=function(){return this._visible},t.prototype.getOrientation=function(){return void 0===this._parent?this._model.isRootOrientationVertical()?n.Orientation.VERT:n.Orientation.HORZ:n.Orientation.flip(this._parent.getOrientation())},t.prototype.setEventListener=function(t,e){this._listeners[t]=e},t.prototype.removeEventListener=function(t){delete this._listeners[t]},t.prototype._setId=function(t){this._attributes.id=t},t.prototype._fireEvent=function(t,e){void 0!==this._listeners[t]&&this._listeners[t](e)},t.prototype._getAttr=function(t){var e=this._attributes[t];if(void 0===e){var i=this._getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this._model._getAttribute(i))}return e},t.prototype._forEachNode=function(t,e){t(this,e),e++;for(var i=0,o=this._children;i<o.length;i++)o[i]._forEachNode(t,e)},t.prototype._setVisible=function(t){t!==this._visible&&(this._fireEvent("visibility",{visible:t}),this._visible=t)},t.prototype._getDrawChildren=function(){return this._children},t.prototype._setParent=function(t){this._parent=t},t.prototype._setRect=function(t){this._rect=t},t.prototype._setWeight=function(t){this._attributes.weight=t},t.prototype._setSelected=function(t){this._attributes.selected=t},t.prototype._isFixed=function(){return this._fixed},t.prototype._layout=function(t,e){this._rect=t},t.prototype._findDropTargetNode=function(t,e,i){var o;if(this._rect.contains(e,i))if(void 0!==this._model.getMaximizedTabset())o=this._model.getMaximizedTabset().canDrop(t,e,i);else if(void 0===(o=this.canDrop(t,e,i))&&0!==this._children.length)for(var n=0,r=this._children;n<r.length&&void 0===(o=r[n]._findDropTargetNode(t,e,i));n++);return o},t.prototype.canDrop=function(t,e,i){},t.prototype._canDockInto=function(t,e){if(null!=e){if(e.location===o.DockLocation.CENTER&&!1===e.node.isEnableDrop())return!1;if(e.location===o.DockLocation.CENTER&&"tabset"===t.getType()&&void 0!==t.getName())return!1;if(e.location!==o.DockLocation.CENTER&&!1===e.node.isEnableDivide())return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(t,e)}return!0},t.prototype._removeChild=function(t){var e=this._children.indexOf(t);return-1!==e&&this._children.splice(e,1),this._dirty=!0,e},t.prototype._addChild=function(t,e){return null!=e?this._children.splice(e,0,t):(this._children.push(t),e=this._children.length-1),t._parent=this,this._dirty=!0,e},t.prototype._removeAll=function(){this._children=[],this._dirty=!0},t.prototype._styleWithPosition=function(t){return null==t&&(t={}),this._rect.styleWithPosition(t)},t.prototype._getTempSize=function(){return this._tempSize},t.prototype._setTempSize=function(t){this._tempSize=t},t.prototype.isEnableDivide=function(){return!0},t.prototype._toAttributeString=function(){return JSON.stringify(this._attributes,void 0,"\t")},t}();e.Node=a},179:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.RowNode=void 0;var a=i(92),s=i(99),d=i(95),l=i(34),c=i(327),u=i(359),h=i(398),_=i(907),p=i(103),f=i(618),g=i(657),T=function(t){function e(i,o){var n=t.call(this,i)||this;return n._dirty=!0,n._drawChildren=[],n._minHeight=0,n._minWidth=0,e._attributeDefinitions.fromJson(o,n._attributes),i._addNode(n),n}return n(e,t),e._fromJson=function(t,i){var o=new e(i,t);if(null!=t.children)for(var n=0,r=t.children;n<r.length;n++){var a=r[n];if(a.type===g.TabSetNode.TYPE){var s=g.TabSetNode._fromJson(a,i);o._addChild(s)}else s=e._fromJson(a,i),o._addChild(s)}return o},e._createAttributeDefinitions=function(){var t=new s.AttributeDefinitions;return t.add("type",e.TYPE,!0).setType(a.Attribute.STRING).setFixed(),t.add("id",void 0).setType(a.Attribute.STRING),t.add("weight",100).setType(a.Attribute.NUMBER),t.add("width",void 0).setType(a.Attribute.NUMBER),t.add("height",void 0).setType(a.Attribute.NUMBER),t},e.prototype.getWeight=function(){return this._attributes.weight},e.prototype.getWidth=function(){return this._getAttr("width")},e.prototype.getHeight=function(){return this._getAttr("height")},e.prototype._setWeight=function(t){this._attributes.weight=t},e.prototype._layout=function(e,i){t.prototype._layout.call(this,e,i);for(var o=this._rect._getSize(this.getOrientation()),n=0,r=0,a=0,s=0,d=this._getDrawChildren(),l=0,h=d;l<h.length;l++){var _=(M=h[l])._getPrefSize(this.getOrientation());M._isFixed()?void 0!==_&&(r+=_):void 0===_?n+=M.getWeight():(a+=_,s+=M.getWeight())}var p=!1,g=o-r-a;g<0&&(g=o-r,p=!0,n+=s);for(var T=0,v=0,b=0,E=d;b<E.length;b++){if(_=(M=E[b])._getPrefSize(this.getOrientation()),M._isFixed())void 0!==_&&M._setTempSize(_);else if(null==_||p){if(0===n)M._setTempSize(0);else{var y=M.getMinSize(this.getOrientation()),m=Math.floor(g*(M.getWeight()/n));M._setTempSize(Math.max(y,m))}v+=M._getTempSize()}else M._setTempSize(_);T+=M._getTempSize()}if(v>0){for(;T<o;)for(var A=0,S=d;A<S.length;A++)(M=S[A])instanceof f.SplitterNode||(_=M._getPrefSize(this.getOrientation()),!M._isFixed()&&(void 0===_||p)&&T<o&&(M._setTempSize(M._getTempSize()+1),T++));for(;T>o;){for(var O=!1,L=0,R=d;L<R.length;L++)(M=R[L])instanceof f.SplitterNode||(y=M.getMinSize(this.getOrientation()),(m=M._getTempSize())>y&&T>o&&(M._setTempSize(M._getTempSize()-1),T--,O=!0));if(!O)break}for(;T>o;){O=!1;for(var N=0,D=d;N<D.length;N++)(M=D[N])instanceof f.SplitterNode||(m=M._getTempSize())>0&&T>o&&(M._setTempSize(M._getTempSize()-1),T--,O=!0);if(!O)break}}for(var w=0,B=0,C=d;B<C.length;B++){var M=C[B];this.getOrientation()===c.Orientation.HORZ?M._layout(new u.Rect(this._rect.x+w,this._rect.y,M._getTempSize(),this._rect.height),i):M._layout(new u.Rect(this._rect.x,this._rect.y+w,this._rect.width,M._getTempSize()),i),w+=M._getTempSize()}return!0},e.prototype._getSplitterBounds=function(t,e){void 0===e&&(e=!1);var i=[0,0],o=this._getDrawChildren(),n=o.indexOf(t),r=o[n-1],a=o[n+1];if(this.getOrientation()===c.Orientation.HORZ){var s=e?r.getMinWidth():0,d=e?a.getMinWidth():0;i[0]=r.getRect().x+s,i[1]=a.getRect().getRight()-t.getWidth()-d}else s=e?r.getMinHeight():0,d=e?a.getMinHeight():0,i[0]=r.getRect().y+s,i[1]=a.getRect().getBottom()-t.getHeight()-d;return i},e.prototype._calculateSplit=function(t,e){var i,o=this._getDrawChildren(),n=o.indexOf(t),r=this._getSplitterBounds(t),a=o[n-1].getWeight()+o[n+1].getWeight(),s=Math.max(0,e-r[0]),d=Math.max(0,r[1]-e);if(s+d>0){var l=s*a/(s+d),c=d*a/(s+d);i={node1Id:o[n-1].getId(),weight1:l,pixelWidth1:s,node2Id:o[n+1].getId(),weight2:c,pixelWidth2:d}}return i},e.prototype._getDrawChildren=function(){if(this._dirty){this._drawChildren=[];for(var t=0;t<this._children.length;t++){var e=this._children[t];if(0!==t){var i=new f.SplitterNode(this._model);i._setParent(this),this._drawChildren.push(i)}this._drawChildren.push(e)}this._dirty=!1}return this._drawChildren},e.prototype.getMinSize=function(t){return t===c.Orientation.HORZ?this.getMinWidth():this.getMinHeight()},e.prototype.getMinWidth=function(){return this._minWidth},e.prototype.getMinHeight=function(){return this._minHeight},e.prototype.calcMinSize=function(){this._minHeight=0,this._minWidth=0;for(var t=!0,i=0,o=this._children;i<o.length;i++){var n=o[i];n instanceof e&&n.calcMinSize(),this.getOrientation()===c.Orientation.VERT?(this._minHeight+=n.getMinHeight(),t||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,n.getMinWidth())):(this._minWidth+=n.getMinWidth(),t||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,n.getMinHeight())),t=!1}},e.prototype._tidy=function(){for(var t=0;t<this._children.length;)if((_=this._children[t])instanceof e){_._tidy();var i=_.getChildren();if(0===i.length)this._removeChild(_);else if(1===i.length){var o=i[0];if(this._removeChild(_),o instanceof e){for(var n=0,a=o.getChildren(),s=0,d=a;s<d.length;s++)n+=(c=d[s]).getWeight();for(var l=0;l<a.length;l++){var c;(c=a[l])._setWeight(_.getWeight()*c.getWeight()/n),this._addChild(c,t+l)}}else o._setWeight(_.getWeight()),this._addChild(o,t)}else t++}else _ instanceof g.TabSetNode&&0===_.getChildren().length&&_.isEnableDeleteWhenEmpty()?(this._removeChild(_),_===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):t++;if(this===this._model.getRoot()&&0===this._children.length){var u=this._model._getOnCreateTabSet(),h=u?u():{};h=r(r({},h),{selected:-1});var _=new g.TabSetNode(this._model,h);this._model._setActiveTabset(_),this._addChild(_)}},e.prototype.canDrop=function(t,e,i){var o,n=i-this._rect.y,r=e-this._rect.x,a=this._rect.width,s=this._rect.height,c=50;if(this._model.isEnableEdgeDock()&&void 0===this._parent){if(e<this._rect.x+10&&n>s/2-c&&n<s/2+c)(_=(u=d.DockLocation.LEFT).getDockRect(this._rect)).width=_.width/2,o=new l.DropInfo(this,_,u,-1,h.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE);else if(e>this._rect.getRight()-10&&n>s/2-c&&n<s/2+c)(_=(u=d.DockLocation.RIGHT).getDockRect(this._rect)).width=_.width/2,_.x+=_.width,o=new l.DropInfo(this,_,u,-1,h.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE);else if(i<this._rect.y+10&&r>a/2-c&&r<a/2+c)(_=(u=d.DockLocation.TOP).getDockRect(this._rect)).height=_.height/2,o=new l.DropInfo(this,_,u,-1,h.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE);else if(i>this._rect.getBottom()-10&&r>a/2-c&&r<a/2+c){var u,_;(_=(u=d.DockLocation.BOTTOM).getDockRect(this._rect)).height=_.height/2,_.y+=_.height,o=new l.DropInfo(this,_,u,-1,h.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==o&&!t._canDockInto(t,o))return}return o},e.prototype.drop=function(t,i,o){var n,r=i,a=t.getParent();if(a&&a._removeChild(t),void 0!==a&&a.getType()===g.TabSetNode.TYPE&&a._setSelected(0),void 0!==a&&a.getType()===_.BorderNode.TYPE&&a._setSelected(-1),t instanceof g.TabSetNode)n=t;else{var s=this._model._getOnCreateTabSet();(n=new g.TabSetNode(this._model,s?s(t):{}))._addChild(t)}var l=this._children.reduce((function(t,e){return t+e.getWeight()}),0);0===l&&(l=100),n._setWeight(l/3);var c=!this._model.isRootOrientationVertical();if(c&&r===d.DockLocation.LEFT||!c&&r===d.DockLocation.TOP)this._addChild(n,0);else if(c&&r===d.DockLocation.RIGHT||!c&&r===d.DockLocation.BOTTOM)this._addChild(n);else if(c&&r===d.DockLocation.TOP||!c&&r===d.DockLocation.LEFT){var u=new e(this._model,{});(T=new e(this._model,{}))._setWeight(75),n._setWeight(25);for(var h=0,p=this._children;h<p.length;h++){var f=p[h];T._addChild(f)}this._removeAll(),u._addChild(n),u._addChild(T),this._addChild(u)}else if(c&&r===d.DockLocation.BOTTOM||!c&&r===d.DockLocation.RIGHT){var T;u=new e(this._model,{}),(T=new e(this._model,{}))._setWeight(75),n._setWeight(25);for(var v=0,b=this._children;v<b.length;v++)f=b[v],T._addChild(f);this._removeAll(),u._addChild(T),u._addChild(n),this._addChild(u)}this._model._setActiveTabset(n),this._model._tidy()},e.prototype.toJson=function(){var t={};e._attributeDefinitions.toJson(t,this._attributes),t.children=[];for(var i=0,o=this._children;i<o.length;i++){var n=o[i];t.children.push(n.toJson())}return t},e.prototype.isEnableDrop=function(){return!0},e.prototype._getPrefSize=function(t){var e=this.getWidth();return t===c.Orientation.VERT&&(e=this.getHeight()),e},e.prototype._getAttributeDefinitions=function(){return e._attributeDefinitions},e.prototype._updateAttrs=function(t){e._attributeDefinitions.update(t,this._attributes)},e.getAttributeDefinitions=function(){return e._attributeDefinitions},e.TYPE="row",e._attributeDefinitions=e._createAttributeDefinitions(),e}(p.Node);e.RowNode=T},618:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.SplitterNode=void 0;var r=i(99),a=i(327),s=function(t){function e(i){var o=t.call(this,i)||this;return o._fixed=!0,o._attributes.type=e.TYPE,i._addNode(o),o}return n(e,t),e.prototype.getWidth=function(){return this._model.getSplitterSize()},e.prototype.getMinWidth=function(){return this.getOrientation()===a.Orientation.VERT?this._model.getSplitterSize():0},e.prototype.getHeight=function(){return this._model.getSplitterSize()},e.prototype.getMinHeight=function(){return this.getOrientation()===a.Orientation.HORZ?this._model.getSplitterSize():0},e.prototype.getMinSize=function(t){return t===a.Orientation.HORZ?this.getMinWidth():this.getMinHeight()},e.prototype.getWeight=function(){return 0},e.prototype._setWeight=function(t){},e.prototype._getPrefSize=function(t){return this._model.getSplitterSize()},e.prototype._updateAttrs=function(t){},e.prototype._getAttributeDefinitions=function(){return new r.AttributeDefinitions},e.prototype.toJson=function(){},e.TYPE="splitter",e}(i(103).Node);e.SplitterNode=s},275:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.TabNode=void 0;var r=i(92),a=i(99),s=function(t){function e(i,o,n){void 0===n&&(n=!0);var r=t.call(this,i)||this;return r._extra={},e._attributeDefinitions.fromJson(o,r._attributes),!0===n&&i._addNode(r),r}return n(e,t),e._fromJson=function(t,i,o){return void 0===o&&(o=!0),new e(i,t,o)},e._createAttributeDefinitions=function(){var t=new a.AttributeDefinitions;return t.add("type",e.TYPE,!0).setType(r.Attribute.STRING),t.add("id",void 0).setType(r.Attribute.STRING),t.add("name","[Unnamed Tab]").setType(r.Attribute.STRING),t.add("altName",void 0).setType(r.Attribute.STRING),t.add("helpText",void 0).setType(r.Attribute.STRING),t.add("component",void 0).setType(r.Attribute.STRING),t.add("config",void 0).setType("any"),t.add("floating",!1).setType(r.Attribute.BOOLEAN),t.addInherited("enableClose","tabEnableClose").setType(r.Attribute.BOOLEAN),t.addInherited("closeType","tabCloseType").setType("ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(r.Attribute.BOOLEAN),t.addInherited("enableRename","tabEnableRename").setType(r.Attribute.BOOLEAN),t.addInherited("className","tabClassName").setType(r.Attribute.STRING),t.addInherited("icon","tabIcon").setType(r.Attribute.STRING),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(r.Attribute.BOOLEAN),t.addInherited("enableFloat","tabEnableFloat").setType(r.Attribute.BOOLEAN),t.addInherited("borderWidth","tabBorderWidth").setType(r.Attribute.NUMBER),t.addInherited("borderHeight","tabBorderHeight").setType(r.Attribute.NUMBER),t},e.prototype.getWindow=function(){return this._window},e.prototype.getTabRect=function(){return this._tabRect},e.prototype._setTabRect=function(t){this._tabRect=t},e.prototype._setRenderedName=function(t){this._renderedName=t},e.prototype._getNameForOverflowMenu=function(){var t=this._getAttr("altName");return void 0!==t?t:this._renderedName},e.prototype.getName=function(){return this._getAttr("name")},e.prototype.getHelpText=function(){return this._getAttr("helpText")},e.prototype.getComponent=function(){return this._getAttr("component")},e.prototype.getConfig=function(){return this._attributes.config},e.prototype.getExtraData=function(){return this._extra},e.prototype.isFloating=function(){return this._getAttr("floating")},e.prototype.getIcon=function(){return this._getAttr("icon")},e.prototype.isEnableClose=function(){return this._getAttr("enableClose")},e.prototype.getCloseType=function(){return this._getAttr("closeType")},e.prototype.isEnableFloat=function(){return this._getAttr("enableFloat")},e.prototype.isEnableDrag=function(){return this._getAttr("enableDrag")},e.prototype.isEnableRename=function(){return this._getAttr("enableRename")},e.prototype.getClassName=function(){return this._getAttr("className")},e.prototype.isEnableRenderOnDemand=function(){return this._getAttr("enableRenderOnDemand")},e.prototype._setName=function(t){this._attributes.name=t,this._window&&this._window.document&&(this._window.document.title=t)},e.prototype._setFloating=function(t){this._attributes.floating=t},e.prototype._layout=function(t,e){t.equals(this._rect)||this._fireEvent("resize",{rect:t}),this._rect=t},e.prototype._delete=function(){this._parent._remove(this),this._fireEvent("close",{})},e.prototype.toJson=function(){var t={};return e._attributeDefinitions.toJson(t,this._attributes),t},e.prototype._updateAttrs=function(t){e._attributeDefinitions.update(t,this._attributes)},e.prototype._getAttributeDefinitions=function(){return e._attributeDefinitions},e.prototype._setWindow=function(t){this._window=t},e.prototype._setBorderWidth=function(t){this._attributes.borderWidth=t},e.prototype._setBorderHeight=function(t){this._attributes.borderHeight=t},e.getAttributeDefinitions=function(){return e._attributeDefinitions},e.TYPE="tab",e._attributeDefinitions=e._createAttributeDefinitions(),e}(i(103).Node);e.TabNode=s},657:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.TabSetNode=void 0;var r=i(92),a=i(99),s=i(95),d=i(34),l=i(327),c=i(359),u=i(398),h=i(907),_=i(103),p=i(179),f=i(275),g=i(494),T=function(t){function e(i,o){var n=t.call(this,i)||this;return e._attributeDefinitions.fromJson(o,n._attributes),i._addNode(n),n._calculatedTabBarHeight=0,n._calculatedHeaderBarHeight=0,n}return n(e,t),e._fromJson=function(t,i){var o=new e(i,t);if(null!=t.children)for(var n=0,r=t.children;n<r.length;n++){var a=r[n],s=f.TabNode._fromJson(a,i);o._addChild(s)}return 0===o._children.length&&o._setSelected(-1),t.maximized&&!0===t.maximized&&i._setMaximizedTabset(o),t.active&&!0===t.active&&i._setActiveTabset(o),o},e._createAttributeDefinitions=function(){var t=new a.AttributeDefinitions;return t.add("type",e.TYPE,!0).setType(r.Attribute.STRING).setFixed(),t.add("id",void 0).setType(r.Attribute.STRING),t.add("weight",100).setType(r.Attribute.NUMBER),t.add("width",void 0).setType(r.Attribute.NUMBER),t.add("height",void 0).setType(r.Attribute.NUMBER),t.add("selected",0).setType(r.Attribute.NUMBER),t.add("name",void 0).setType(r.Attribute.STRING),t.add("config",void 0).setType("any"),t.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),t.addInherited("enableDrop","tabSetEnableDrop"),t.addInherited("enableDrag","tabSetEnableDrag"),t.addInherited("enableDivide","tabSetEnableDivide"),t.addInherited("enableMaximize","tabSetEnableMaximize"),t.addInherited("enableClose","tabSetEnableClose"),t.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),t.addInherited("classNameHeader","tabSetClassNameHeader"),t.addInherited("enableTabStrip","tabSetEnableTabStrip"),t.addInherited("borderInsets","tabSetBorderInsets"),t.addInherited("marginInsets","tabSetMarginInsets"),t.addInherited("minWidth","tabSetMinWidth"),t.addInherited("minHeight","tabSetMinHeight"),t.addInherited("headerHeight","tabSetHeaderHeight"),t.addInherited("tabStripHeight","tabSetTabStripHeight"),t.addInherited("tabLocation","tabSetTabLocation"),t.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(r.Attribute.BOOLEAN),t},e.prototype.getName=function(){return this._getAttr("name")},e.prototype.getSelected=function(){var t=this._attributes.selected;return void 0!==t?t:-1},e.prototype.getSelectedNode=function(){var t=this.getSelected();if(-1!==t)return this._children[t]},e.prototype.getWeight=function(){return this._getAttr("weight")},e.prototype.getWidth=function(){return this._getAttr("width")},e.prototype.getMinWidth=function(){return this._getAttr("minWidth")},e.prototype.getHeight=function(){return this._getAttr("height")},e.prototype.getMinHeight=function(){return this._getAttr("minHeight")},e.prototype.getMinSize=function(t){return t===l.Orientation.HORZ?this.getMinWidth():this.getMinHeight()},e.prototype.getConfig=function(){return this._attributes.config},e.prototype.isMaximized=function(){return this._model.getMaximizedTabset()===this},e.prototype.isActive=function(){return this._model.getActiveTabset()===this},e.prototype.isEnableDeleteWhenEmpty=function(){return this._getAttr("enableDeleteWhenEmpty")},e.prototype.isEnableDrop=function(){return this._getAttr("enableDrop")},e.prototype.isEnableDrag=function(){return this._getAttr("enableDrag")},e.prototype.isEnableDivide=function(){return this._getAttr("enableDivide")},e.prototype.isEnableMaximize=function(){return this._getAttr("enableMaximize")},e.prototype.isEnableClose=function(){return this._getAttr("enableClose")},e.prototype.canMaximize=function(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset()===this||this.getParent()!==this.getModel().getRoot()||1!==this.getModel().getRoot().getChildren().length)},e.prototype.isEnableTabStrip=function(){return this._getAttr("enableTabStrip")},e.prototype.isAutoSelectTab=function(){return this._getAttr("autoSelectTab")},e.prototype.getClassNameTabStrip=function(){return this._getAttr("classNameTabStrip")},e.prototype.getClassNameHeader=function(){return this._getAttr("classNameHeader")},e.prototype.calculateHeaderBarHeight=function(t){var e=this._getAttr("headerHeight");this._calculatedHeaderBarHeight=0!==e?e:t.headerBarSize},e.prototype.calculateTabBarHeight=function(t){var e=this._getAttr("tabStripHeight");this._calculatedTabBarHeight=0!==e?e:t.tabBarSize},e.prototype.getHeaderHeight=function(){return this._calculatedHeaderBarHeight},e.prototype.getTabStripHeight=function(){return this._calculatedTabBarHeight},e.prototype.getTabLocation=function(){return this._getAttr("tabLocation")},e.prototype._setWeight=function(t){this._attributes.weight=t},e.prototype._setSelected=function(t){this._attributes.selected=t},e.prototype.canDrop=function(t,e,i){var o;if(t===this){var n=s.DockLocation.CENTER,r=this._tabHeaderRect;o=new d.DropInfo(this,r,n,-1,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(e,i))n=s.DockLocation.CENTER,void 0===this._model.getMaximizedTabset()&&(n=s.DockLocation.getLocation(this._contentRect,e,i)),r=n.getDockRect(this._rect),o=new d.DropInfo(this,r,n,-1,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);else if(null!=this._tabHeaderRect&&this._tabHeaderRect.contains(e,i)){var a=void 0,l=void 0,h=void 0;if(0===this._children.length)l=(a=this._tabHeaderRect.clone()).y+3,h=a.height-4,a.width=2;else{var _=this._children[0];l=(a=_.getTabRect()).y,h=a.height;for(var p=this._tabHeaderRect.x,f=0,g=0;g<this._children.length;g++){if(f=(a=(_=this._children[g]).getTabRect()).x+a.width/2,e>=p&&e<f){n=s.DockLocation.CENTER,r=new c.Rect(a.x-2,l,3,h),o=new d.DropInfo(this,r,n,g,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}p=f}}null==o&&(n=s.DockLocation.CENTER,r=new c.Rect(a.getRight()-2,l,3,h),o=new d.DropInfo(this,r,n,this._children.length,u.CLASSES.FLEXLAYOUT__OUTLINE_RECT))}if(t._canDockInto(t,o))return o},e.prototype._layout=function(t,e){this.calculateHeaderBarHeight(e),this.calculateTabBarHeight(e),this.isMaximized()&&(t=this._model.getRoot().getRect()),t=t.removeInsets(this._getAttr("marginInsets")),this._rect=t,t=t.removeInsets(this._getAttr("borderInsets"));var i=0,o=0;void 0!==this.getName()&&(i+=this._calculatedHeaderBarHeight,o+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&("top"===this.getTabLocation()?this._tabHeaderRect=new c.Rect(t.x,t.y+i,t.width,this._calculatedTabBarHeight):this._tabHeaderRect=new c.Rect(t.x,t.y+t.height-this._calculatedTabBarHeight,t.width,this._calculatedTabBarHeight),o+=this._calculatedTabBarHeight,"top"===this.getTabLocation()&&(i+=this._calculatedTabBarHeight)),this._contentRect=new c.Rect(t.x,t.y+i,t.width,t.height-o);for(var n=0;n<this._children.length;n++){var r=this._children[n];r._layout(this._contentRect,e),r._setVisible(n===this.getSelected())}},e.prototype._delete=function(){this._parent._removeChild(this)},e.prototype._remove=function(t){var e=this._removeChild(t);this._model._tidy(),(0,g.adjustSelectedIndex)(this,e)},e.prototype.drop=function(t,i,o,n){var r=i;if(this!==t){var a=t.getParent(),d=0;if(void 0!==a&&(d=a._removeChild(t),a instanceof h.BorderNode&&a.getSelected()===d?a._setSelected(-1):(0,g.adjustSelectedIndex)(a,d)),t.getType()===f.TabNode.TYPE&&a===this&&d<o&&o>0&&o--,r===s.DockLocation.CENTER){var l=o;if(-1===l&&(l=this._children.length),t.getType()===f.TabNode.TYPE)this._addChild(t,l),(n||!1!==n&&this.isAutoSelectTab())&&this._setSelected(l);else for(var c=0;c<t.getChildren().length;c++){var u=t.getChildren()[c];this._addChild(u,l),l++}this._model._setActiveTabset(this)}else{var _=void 0;if(t instanceof f.TabNode){var T=this._model._getOnCreateTabSet();(_=new e(this._model,T?T(t):{}))._addChild(t),a=_}else _=t;var v=this._parent,b=v.getChildren().indexOf(this);if(v.getOrientation()===r._orientation)_._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),v._addChild(_,b+r._indexPlus);else{var E=new p.RowNode(this._model,{});E._setWeight(this.getWeight()),E._addChild(this),this._setWeight(50),_._setWeight(50),E._addChild(_,r._indexPlus),v._removeChild(this),v._addChild(E,b)}this._model._setActiveTabset(_)}this._model._tidy()}},e.prototype.toJson=function(){var t={};return e._attributeDefinitions.toJson(t,this._attributes),t.children=this._children.map((function(t){return t.toJson()})),this.isActive()&&(t.active=!0),this.isMaximized()&&(t.maximized=!0),t},e.prototype._updateAttrs=function(t){e._attributeDefinitions.update(t,this._attributes)},e.prototype._getAttributeDefinitions=function(){return e._attributeDefinitions},e.prototype._getPrefSize=function(t){var e=this.getWidth();return t===l.Orientation.VERT&&(e=this.getHeight()),e},e.getAttributeDefinitions=function(){return e._attributeDefinitions},e.TYPE="tabset",e._attributeDefinitions=e._createAttributeDefinitions(),e}(_.Node);e.TabSetNode=T},494:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.adjustSelectedIndex=e.adjustSelectedIndexAfterDock=e.adjustSelectedIndexAfterFloat=void 0;var o=i(657),n=i(907);e.adjustSelectedIndexAfterFloat=function(t){var e=t.getParent();if(null!==e)if(e instanceof o.TabSetNode){for(var i=!1,r=0,a=e.getChildren(),s=0;s<a.length;s++){var d=a[s];if(d===t)i=!0;else if(!d.isFloating()&&(r=s,i))break}e._setSelected(r)}else e instanceof n.BorderNode&&e._setSelected(-1)},e.adjustSelectedIndexAfterDock=function(t){var e=t.getParent();if(null!==e&&(e instanceof o.TabSetNode||e instanceof n.BorderNode))for(var i=e.getChildren(),r=0;r<i.length;r++)if(i[r]===t)return void e._setSelected(r)},e.adjustSelectedIndex=function(t,e){if(void 0!==t&&(t.getType()===o.TabSetNode.TYPE||t.getType()===n.BorderNode.TYPE)){var i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t._setSelected(t.getChildren().length-1):e<i?t._setSelected(i-1):e>i||t._setSelected(-1))}}},898:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BorderButton=void 0;var o=i(899),n=i(306),r=i(920),a=i(359),s=i(138),d=i(398),l=i(258);e.BorderButton=function(t){var e=t.layout,i=t.node,c=t.selected,u=t.border,h=t.iconFactory,_=t.titleFactory,p=t.icons,f=t.path,g=o.useRef(null),T=o.useRef(null),v=function(t){(0,l.isAuxMouseEvent)(t)||e.getEditingTab()||e.dragStart(t,void 0,i,i.isEnableDrag(),E,y)},b=function(t){(0,l.isAuxMouseEvent)(t)&&e.auxMouseClick(i,t)},E=function(){e.doAction(r.Actions.selectTab(i.getId()))},y=function(t){},m=function(t){t.stopPropagation()};o.useLayoutEffect((function(){A(),e.getEditingTab()===i&&T.current.select()}));var A=function(){var t=e.getDomRect(),o=g.current.getBoundingClientRect();i._setTabRect(new a.Rect(o.left-t.left,o.top-t.top,o.width,o.height))},S=function(t){t.stopPropagation()},O=e.getClassName,L=O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON_+u);L+=c?" "+O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==i.getClassName()&&(L+=" "+i.getClassName());var R=(0,l.getRenderStateEx)(e,i,h,_),N=R.content?o.createElement("div",{className:O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},R.content):null,D=R.leading?o.createElement("div",{className:O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)},R.leading):null;if(e.getEditingTab()===i&&(N=o.createElement("input",{ref:T,className:O(d.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":f+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:function(t){27===t.keyCode?e.setEditingTab(void 0):13===t.keyCode&&(e.setEditingTab(void 0),e.doAction(r.Actions.renameTab(i.getId(),t.target.value)))},onMouseDown:S,onTouchStart:S})),i.isEnableClose()){var w=e.i18nName(n.I18nLabel.Close_Tab);R.buttons.push(o.createElement("div",{key:"close","data-layout-path":f+"/button/close",title:w,className:O(d.CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:m,onClick:function(t){var o;o=i.getCloseType(),c||o===s.ICloseType.Always||o===s.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches?e.doAction(r.Actions.deleteTab(i.getId())):E()},onTouchStart:m},"function"==typeof p.close?p.close(i):p.close))}return o.createElement("div",{ref:g,"data-layout-path":f,className:L,onMouseDown:v,onClick:b,onAuxClick:b,onContextMenu:function(t){e.showContextMenu(i,t)},onTouchStart:v,title:i.getHelpText()},D,N,R.buttons)}},851:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BorderTabSet=void 0;var o=i(899),n=i(95),r=i(898),a=i(119),s=i(920),d=i(306),l=i(953),c=i(327),u=i(398),h=i(258);e.BorderTabSet=function(t){for(var e=t.border,i=t.layout,_=t.iconFactory,p=t.titleFactory,f=t.icons,g=t.path,T=o.useRef(null),v=o.useRef(null),b=o.useRef(null),E=(0,l.useTabOverflow)(e,c.Orientation.flip(e.getOrientation()),T,b),y=E.selfRef,m=E.position,A=E.userControlledLeft,S=E.hiddenTabs,O=E.onMouseWheel,L=function(t){(0,h.isAuxMouseEvent)(t)&&i.auxMouseClick(e,t)},R=function(t){t.stopPropagation()},N=function(t){i.doAction(s.Actions.selectTab(t.node.getId())),A.current=!1},D=i.getClassName,w=e.getTabHeaderRect().styleWithPosition({}),B=[],C=function(t){var n=e.getSelected()===t,a=e.getChildren()[t];B.push(o.createElement(r.BorderButton,{layout:i,border:e.getLocation().getName(),node:a,path:g+"/tb"+t,key:a.getId(),selected:n,iconFactory:_,titleFactory:p,icons:f})),t<e.getChildren().length-1&&B.push(o.createElement("div",{key:"divider"+t,className:D(u.CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))},M=0;M<e.getChildren().length;M++)C(M);var x=D(u.CLASSES.FLEXLAYOUT__BORDER)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_+e.getLocation().getName());void 0!==e.getClassName()&&(x+=" "+e.getClassName());var I,U=[],F={headerContent:void 0,buttons:U,stickyButtons:[],headerButtons:[]};if(i.customizeTabSet(e,F),U=F.buttons,S.length>0){var z,P=i.i18nName(d.I18nLabel.Overflow_Menu_Tooltip);z="function"==typeof f.more?f.more(e,S):o.createElement(o.Fragment,null,f.more,o.createElement("div",{className:D(u.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},S.length)),U.push(o.createElement("button",{key:"overflowbutton",ref:v,className:D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+e.getLocation().getName()),title:P,onClick:function(t){var o=i.getShowOverflowMenu();if(void 0!==o)o(e,t,S,N);else{var n=v.current;(0,a.showPopup)(n,S,N,i,_,p)}t.stopPropagation()},onMouseDown:R,onTouchStart:R},z))}var Y=e.getSelected();if(-1!==Y){var H=e.getChildren()[Y];if(void 0!==H&&i.isSupportsPopout()&&H.isEnableFloat()&&!H.isFloating()){var X=i.i18nName(d.I18nLabel.Float_Tab);U.push(o.createElement("button",{key:"float",title:X,className:D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:function(t){var o=e.getChildren()[e.getSelected()];void 0!==o&&i.doAction(s.Actions.floatTab(o.getId())),t.stopPropagation()},onMouseDown:R,onTouchStart:R},"function"==typeof f.popout?f.popout(H):f.popout))}}I=o.createElement("div",{key:"toolbar",ref:T,className:D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+e.getLocation().getName())},U),w=i.styleFont(w);var k,W=e.getBorderBarSize()-1;return k=e.getLocation()===n.DockLocation.LEFT?{right:W,height:W,top:m}:e.getLocation()===n.DockLocation.RIGHT?{left:W,height:W,top:m}:{height:W,left:m},o.createElement("div",{ref:y,dir:"ltr",style:w,className:x,"data-layout-path":g,onClick:L,onAuxClick:L,onContextMenu:function(t){i.showContextMenu(e,t)},onWheel:O},o.createElement("div",{style:{height:W},className:D(u.CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_INNER_+e.getLocation().getName())},o.createElement("div",{style:k,className:D(u.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+D(u.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+e.getLocation().getName())},B)),I)}},680:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=void 0;var r=i(899),a=i(398),s=function(t){function e(e){var i=t.call(this,e)||this;return i.state={hasError:!1},i}return n(e,t),e.getDerivedStateFromError=function(t){return{hasError:!0}},e.prototype.componentDidCatch=function(t,e){console.debug(t),console.debug(e)},e.prototype.render=function(){return this.state.hasError?r.createElement("div",{className:a.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},r.createElement("div",{className:a.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children},e}(r.Component);e.ErrorBoundary=s},633:function(t,e,i){var o=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.FloatingWindow=void 0;var n=i(899),r=i(994),a=i(398);e.FloatingWindow=function(t){var e=t.title,i=t.id,s=t.url,d=t.rect,l=t.onCloseWindow,c=t.onSetWindow,u=t.children,h=n.useRef(null),_=n.useState(void 0),p=_[0],f=_[1];return n.useLayoutEffect((function(){var t=d,n=Array.from(window.document.styleSheets).reduce((function(t,e){var i=void 0;try{i=e.cssRules}catch(t){}try{return o(o([],t,!0),[{href:e.href,type:e.type,rules:i?Array.from(i).map((function(t){return t.cssText})):null}],!1)}catch(e){return t}}),[]);return h.current=window.open(s,i,"left=".concat(t.x,",top=").concat(t.y,",width=").concat(t.width,",height=").concat(t.height)),null!==h.current?(c(i,h.current),window.addEventListener("beforeunload",(function(){h.current&&(h.current.close(),h.current=null)})),h.current.addEventListener("load",(function(){var t=h.current.document;t.title=e;var o=t.createElement("div");o.className=a.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(o),function(t,e){for(var i=t.head,o=[],n=function(e){if(e.href){var n=t.createElement("link");n.type=e.type,n.rel="stylesheet",n.href=e.href,i.appendChild(n),o.push(new Promise((function(t,e){n.onload=function(){return t(!0)}})))}else if(e.rules){for(var r=t.createElement("style"),a=0,s=e.rules;a<s.length;a++){var d=s[a];r.appendChild(t.createTextNode(d))}i.appendChild(r)}},r=0,a=e;r<a.length;r++)n(a[r]);return Promise.all(o)}(t,n).then((function(){f(o)})),h.current.addEventListener("beforeunload",(function(){l(i)}))}))):(console.warn("Unable to open window ".concat(s)),l(i)),function(){setTimeout((function(){h.current&&(h.current.close(),h.current=null)}),0)}}),[]),void 0!==p?(0,r.createPortal)(u,p):null}},544:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FloatingWindowTab=void 0;var o=i(899),n=i(680),r=i(306),a=i(899),s=i(398);e.FloatingWindowTab=function(t){var e=t.layout,i=t.node,d=t.factory,l=e.getClassName,c=d(i);return o.createElement("div",{className:l(s.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_TAB)},o.createElement(n.ErrorBoundary,{message:t.layout.i18nName(r.I18nLabel.Error_rendering_component)},o.createElement(a.Fragment,null,c)))}},679:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RestoreIcon=e.PopoutIcon=e.OverflowIcon=e.MaximizeIcon=e.CloseIcon=void 0;var o=i(899),n={width:"1em",height:"1em",display:"flex",alignItems:"center"};e.CloseIcon=function(){return o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:n,viewBox:"0 0 24 24"},o.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),o.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))},e.MaximizeIcon=function(){return o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:n,viewBox:"0 0 24 24",fill:"var(--color-icon)"},o.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),o.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},e.OverflowIcon=function(){return o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:n,viewBox:"0 0 24 24",fill:"var(--color-icon)"},o.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),o.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))},e.PopoutIcon=function(){return o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:n,viewBox:"0 0 20 20",fill:"var(--color-icon)"},o.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),o.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))},e.RestoreIcon=function(){return o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:n,viewBox:"0 0 24 24",fill:"var(--color-icon)"},o.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),o.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}},175:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(t,e)},function(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}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},a=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.Layout=void 0;var s=i(899),d=i(994),l=i(95),c=i(241),u=i(920),h=i(907),_=i(618),p=i(275),f=i(657),g=i(359),T=i(398),v=i(851),b=i(487),E=i(301),y=i(159),m=i(633),A=i(544),S=i(578),O=i(327),L=i(679),R=i(176),N={close:s.createElement(L.CloseIcon,null),closeTabset:s.createElement(L.CloseIcon,null),popout:s.createElement(L.PopoutIcon,null),maximize:s.createElement(L.MaximizeIcon,null),restore:s.createElement(L.RestoreIcon,null),more:s.createElement(L.OverflowIcon,null)},D="undefined"!=typeof window&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),w="undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!D,B=function(t){function e(e){var i=t.call(this,e)||this;return i.firstMove=!1,i.dragRectRendered=!0,i.dragDivText=void 0,i.edgeRectLength=100,i.edgeRectWidth=10,i.onModelChange=function(){i.forceUpdate(),i.props.onModelChange&&i.props.onModelChange(i.props.model)},i.updateRect=function(t){void 0===t&&(t=i.getDomRect());var e=new g.Rect(0,0,t.width,t.height);e.equals(i.state.rect)||0===e.width||0===e.height||i.setState({rect:e})},i.updateLayoutMetrics=function(){if(i.findHeaderBarSizeRef.current){var t=i.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==i.state.calculatedHeaderBarSize&&i.setState({calculatedHeaderBarSize:t})}if(i.findTabBarSizeRef.current){var e=i.findTabBarSizeRef.current.getBoundingClientRect().height;e!==i.state.calculatedTabBarSize&&i.setState({calculatedTabBarSize:e})}if(i.findBorderBarSizeRef.current){var o=i.findBorderBarSizeRef.current.getBoundingClientRect().height;o!==i.state.calculatedBorderBarSize&&i.setState({calculatedBorderBarSize:o})}},i.getClassName=function(t){return void 0===i.props.classNameMapper?t:i.props.classNameMapper(t)},i.onCloseWindow=function(t){i.doAction(u.Actions.unFloatTab(t));try{i.props.model.getNodeById(t)._setWindow(void 0)}catch(t){}},i.onSetWindow=function(t,e){i.props.model.getNodeById(t)._setWindow(e)},i.onCancelAdd=function(){var t,e;i.selfRef.current.removeChild(i.dragDiv),i.dragDiv=void 0,i.hidePortal(),null!=i.fnNewNodeDropped&&(i.fnNewNodeDropped(),i.fnNewNodeDropped=void 0);try{null===(e=null===(t=i.customDrop)||void 0===t?void 0:t.invalidated)||void 0===e||e.call(t)}catch(t){console.error(t)}c.DragDrop.instance.hideGlass(),i.newTabJson=void 0,i.customDrop=void 0},i.onCancelDrag=function(t){var e,o;if(t){var n=i.selfRef.current;try{n.removeChild(i.outlineDiv)}catch(t){}try{n.removeChild(i.dragDiv)}catch(t){}i.dragDiv=void 0,i.hidePortal(),i.setState({showEdges:!1}),null!=i.fnNewNodeDropped&&(i.fnNewNodeDropped(),i.fnNewNodeDropped=void 0);try{null===(o=null===(e=i.customDrop)||void 0===e?void 0:e.invalidated)||void 0===o||o.call(e)}catch(t){console.error(t)}c.DragDrop.instance.hideGlass(),i.newTabJson=void 0,i.customDrop=void 0}i.setState({showHiddenBorder:l.DockLocation.CENTER})},i.onDragDivMouseDown=function(t){t.preventDefault(),i.dragStart(t,i.dragDivText,p.TabNode._fromJson(i.newTabJson,i.props.model,!1),!0,void 0,void 0)},i.dragStart=function(t,e,o,n,r,a){n?(i.dragNode=o,i.dragDivText=e,c.DragDrop.instance.startDrag(t,i.onDragStart,i.onDragMove,i.onDragEnd,i.onCancelDrag,r,a,i.currentDocument,i.selfRef.current)):c.DragDrop.instance.startDrag(t,void 0,void 0,void 0,void 0,r,a,i.currentDocument,i.selfRef.current)},i.dragRectRender=function(t,e,o,n){var r;if(void 0!==t?r=s.createElement("div",{style:{whiteSpace:"pre"}},t.replace("<br>","\n")):e&&e instanceof p.TabNode&&(r=s.createElement(R.TabButtonStamp,{node:e,layout:i,iconFactory:i.props.iconFactory,titleFactory:i.props.titleFactory})),void 0!==i.props.onRenderDragRect){var a=i.props.onRenderDragRect(r,e,o);void 0!==a&&(r=a)}i.dragDiv.style.visibility="hidden",i.dragRectRendered=!1,i.showPortal(s.createElement(C,{onRendered:function(){i.dragRectRendered=!0,null==n||n()}},r),i.dragDiv)},i.showPortal=function(t,e){var o=(0,d.createPortal)(t,e);i.setState({portal:o})},i.hidePortal=function(){i.setState({portal:void 0})},i.onDragStart=function(){i.dropInfo=void 0,i.customDrop=void 0;var t=i.selfRef.current;return i.outlineDiv=i.currentDocument.createElement("div"),i.outlineDiv.className=i.getClassName(T.CLASSES.FLEXLAYOUT__OUTLINE_RECT),i.outlineDiv.style.visibility="hidden",t.appendChild(i.outlineDiv),null==i.dragDiv&&(i.dragDiv=i.currentDocument.createElement("div"),i.dragDiv.className=i.getClassName(T.CLASSES.FLEXLAYOUT__DRAG_RECT),i.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),i.dragRectRender(i.dragDivText,i.dragNode,i.newTabJson),t.appendChild(i.dragDiv)),void 0===i.props.model.getMaximizedTabset()&&i.setState({showEdges:!0}),void 0!==i.dragNode&&i.dragNode instanceof p.TabNode&&void 0!==i.dragNode.getTabRect()&&i.dragNode.getTabRect().positionElement(i.outlineDiv),i.firstMove=!0,!0},i.onDragMove=function(t){if(!1===i.firstMove){var e=i.props.model._getAttribute("tabDragSpeed");i.outlineDiv.style.transition="top ".concat(e,"s, left ").concat(e,"s, width ").concat(e,"s, height ").concat(e,"s")}i.firstMove=!1;var o=i.selfRef.current.getBoundingClientRect(),n={x:t.clientX-o.left,y:t.clientY-o.top};i.checkForBorderToShow(n.x,n.y);var r=i.dragDiv.getBoundingClientRect(),a=n.x-r.width/2;a+r.width>o.width&&(a=o.width-r.width),a=Math.max(0,a),i.dragDiv.style.left=a+"px",i.dragDiv.style.top=n.y+5+"px",i.dragRectRendered&&"hidden"===i.dragDiv.style.visibility&&(i.dragDiv.style.visibility="visible");var s=i.props.model._findDropTargetNode(i.dragNode,n.x,n.y);s&&(i.props.onTabDrag?i.handleCustomTabDrag(s,n,t):(i.dropInfo=s,i.outlineDiv.className=i.getClassName(s.className),s.rect.positionElement(i.outlineDiv),i.outlineDiv.style.visibility="visible"))},i.onDragEnd=function(t){var e=i.selfRef.current;if(e.removeChild(i.outlineDiv),e.removeChild(i.dragDiv),i.dragDiv=void 0,i.hidePortal(),i.setState({showEdges:!1}),c.DragDrop.instance.hideGlass(),i.dropInfo)if(i.customDrop){i.newTabJson=void 0;try{var o=i.customDrop;(0,o.callback)(o.dragging,o.over,o.x,o.y,o.location),null!=i.fnNewNodeDropped&&(i.fnNewNodeDropped(),i.fnNewNodeDropped=void 0)}catch(t){console.error(t)}}else if(void 0!==i.newTabJson){var n=i.doAction(u.Actions.addNode(i.newTabJson,i.dropInfo.node.getId(),i.dropInfo.location,i.dropInfo.index));null!=i.fnNewNodeDropped&&(i.fnNewNodeDropped(n,t),i.fnNewNodeDropped=void 0),i.newTabJson=void 0}else void 0!==i.dragNode&&i.doAction(u.Actions.moveNode(i.dragNode.getId(),i.dropInfo.node.getId(),i.dropInfo.location,i.dropInfo.index));i.setState({showHiddenBorder:l.DockLocation.CENTER})},i.props.model._setChangeListener(i.onModelChange),i.tabIds=[],i.selfRef=s.createRef(),i.findHeaderBarSizeRef=s.createRef(),i.findTabBarSizeRef=s.createRef(),i.findBorderBarSizeRef=s.createRef(),i.supportsPopout=void 0!==e.supportsPopout?e.supportsPopout:w,i.popoutURL=e.popoutURL?e.popoutURL:"popout.html",i.icons=r(r({},N),e.icons),i.firstRender=!0,i.state={rect:new g.Rect(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:l.DockLocation.CENTER,showEdges:!1},i.onDragEnter=i.onDragEnter.bind(i),i}return n(e,t),e.prototype.styleFont=function(t){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(t.fontStyle=this.props.font.style),this.props.font.weight&&(t.fontWeight=this.props.font.weight)),t},e.prototype.doAction=function(t){if(void 0!==this.props.onAction){var e=this.props.onAction(t);return void 0!==e?this.props.model.doAction(e):void 0}return this.props.model.doAction(t)},e.prototype.componentDidMount=function(){var t=this;this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver((function(e){t.updateRect(e[0].contentRect)})),this.resizeObserver.observe(this.selfRef.current)},e.prototype.componentDidUpdate=function(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)},e.prototype.getCurrentDocument=function(){return this.currentDocument},e.prototype.getDomRect=function(){return this.selfRef.current.getBoundingClientRect()},e.prototype.getRootDiv=function(){return this.selfRef.current},e.prototype.isSupportsPopout=function(){return this.supportsPopout},e.prototype.isRealtimeResize=function(){var t;return null!==(t=this.props.realtimeResize)&&void 0!==t&&t},e.prototype.onTabDrag=function(){for(var t,e,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return null===(e=(t=this.props).onTabDrag)||void 0===e?void 0:e.call.apply(e,a([t],i,!1))},e.prototype.getPopoutURL=function(){return this.popoutURL},e.prototype.componentWillUnmount=function(){var t;null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.selfRef.current)},e.prototype.setEditingTab=function(t){this.setState({editingTab:t})},e.prototype.getEditingTab=function(){return this.state.editingTab},e.prototype.render=function(){if(this.firstRender)return this.firstRender=!1,s.createElement("div",{ref:this.selfRef,className:this.getClassName(T.CLASSES.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);var t=[],e=[],i=[],o={},n=[],r={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,r),this.renderBorder(this.props.model.getBorderSet(),t,o,i,n),this.renderChildren("",this.props.model.getRoot(),e,o,i,n);for(var a=[],d={},l=0,c=this.tabIds;l<c.length;l++){var u=c[l];o[u]&&(a.push(u),d[u]=u)}this.tabIds=a;for(var h=0,_=Object.keys(o);h<_.length;h++)d[u=_[h]]||this.tabIds.push(u);var p=[];if(this.state.showEdges){var f=this.centerRect,g=this.edgeRectLength,v=this.edgeRectWidth,b=this.edgeRectLength/2,E=this.getClassName(T.CLASSES.FLEXLAYOUT__EDGE_RECT),y=50;p.push(s.createElement("div",{key:"North",style:{top:f.y,left:f.x+f.width/2-b,width:g,height:v,borderBottomLeftRadius:y,borderBottomRightRadius:y},className:E})),p.push(s.createElement("div",{key:"West",style:{top:f.y+f.height/2-b,left:f.x,width:v,height:g,borderTopRightRadius:y,borderBottomRightRadius:y},className:E})),p.push(s.createElement("div",{key:"South",style:{top:f.y+f.height-v,left:f.x+f.width/2-b,width:g,height:v,borderTopLeftRadius:y,borderTopRightRadius:y},className:E})),p.push(s.createElement("div",{key:"East",style:{top:f.y+f.height/2-b,left:f.x+f.width-v,width:v,height:g,borderTopLeftRadius:y,borderBottomLeftRadius:y},className:E}))}return s.createElement("div",{ref:this.selfRef,className:this.getClassName(T.CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},e,this.tabIds.map((function(t){return o[t]})),t,n,p,i,this.metricsElements(),this.state.portal)},e.prototype.metricsElements=function(){var t=this.styleFont({visibility:"hidden"});return s.createElement(s.Fragment,null,s.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:t,className:this.getClassName(T.CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),s.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:t,className:this.getClassName(T.CLASSES.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),s.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:t,className:this.getClassName(T.CLASSES.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))},e.prototype.renderBorder=function(t,e,i,o,n){for(var r=0,a=t.getBorders();r<a.length;r++){var d=a[r],l="/border/".concat(d.getLocation().getName());if(d.isShowing()){e.push(s.createElement(v.BorderTabSet,{key:"border_".concat(d.getLocation().getName()),path:l,border:d,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));for(var c=0,u=0,h=0,f=d._getDrawChildren();h<f.length;h++){var g=f[h];if(g instanceof _.SplitterNode){var T=l+"/s";n.push(s.createElement(b.Splitter,{key:g.getId(),layout:this,node:g,path:T}))}else if(g instanceof p.TabNode)if(T=l+"/t"+u++,this.supportsPopout&&g.isFloating()){var y=this._getScreenRect(g);o.push(s.createElement(m.FloatingWindow,{key:g.getId(),url:this.popoutURL,rect:y,title:g.getName(),id:g.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},s.createElement(A.FloatingWindowTab,{layout:this,node:g,factory:this.props.factory}))),i[g.getId()]=s.createElement(S.TabFloating,{key:g.getId(),layout:this,path:T,node:g,selected:c===d.getSelected()})}else i[g.getId()]=s.createElement(E.Tab,{key:g.getId(),layout:this,path:T,node:g,selected:c===d.getSelected(),factory:this.props.factory});c++}}}},e.prototype.renderChildren=function(t,e,i,o,n,r){for(var a=0,d=0,l=0,c=0,u=e._getDrawChildren();c<u.length;c++){var h=u[c];if(h instanceof _.SplitterNode){var g=t+"/s"+a++;r.push(s.createElement(b.Splitter,{key:h.getId(),layout:this,path:g,node:h}))}else if(h instanceof f.TabSetNode)g=t+"/ts"+l++,i.push(s.createElement(y.TabSet,{key:h.getId(),layout:this,path:g,node:h,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(g,h,i,o,n,r);else if(h instanceof p.TabNode){g=t+"/t"+d++;var T=h.getParent().getChildren()[h.getParent().getSelected()];if(void 0===T&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&h.isFloating()){var v=this._getScreenRect(h);n.push(s.createElement(m.FloatingWindow,{key:h.getId(),url:this.popoutURL,rect:v,title:h.getName(),id:h.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},s.createElement(A.FloatingWindowTab,{layout:this,node:h,factory:this.props.factory}))),o[h.getId()]=s.createElement(S.TabFloating,{key:h.getId(),layout:this,path:g,node:h,selected:h===T})}else o[h.getId()]=s.createElement(E.Tab,{key:h.getId(),layout:this,path:g,node:h,selected:h===T,factory:this.props.factory})}else g=t+(h.getOrientation()===O.Orientation.HORZ?"/r":"/c")+l++,this.renderChildren(g,h,i,o,n,r)}},e.prototype._getScreenRect=function(t){var e=t.getRect().clone(),i=this.selfRef.current.getBoundingClientRect(),o=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),n=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return e.x=e.x+i.x+this.currentWindow.screenX+n,e.y=e.y+i.y+this.currentWindow.screenY+o,e},e.prototype.addTabToTabSet=function(t,e){void 0!==this.props.model.getNodeById(t)&&this.doAction(u.Actions.addNode(e,t,l.DockLocation.CENTER,-1))},e.prototype.addTabToActiveTabSet=function(t){var e=this.props.model.getActiveTabset();void 0!==e&&this.doAction(u.Actions.addNode(t,e.getId(),l.DockLocation.CENTER,-1))},e.prototype.addTabWithDragAndDrop=function(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,this.dragStart(void 0,t,p.TabNode._fromJson(e,this.props.model,!1),!0,void 0,void 0)},e.prototype.moveTabWithDragAndDrop=function(t,e){this.dragStart(void 0,e,t,!0,void 0,void 0)},e.prototype.addTabWithDragAndDropIndirect=function(t,e,i){var o=this;this.fnNewNodeDropped=i,this.newTabJson=e,c.DragDrop.instance.addGlass(this.onCancelAdd),this.dragDivText=t,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(T.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,(function(){if(o.dragDiv){o.dragDiv.style.visibility="visible";var t=o.dragDiv.getBoundingClientRect(),e=new g.Rect(0,0,null==t?void 0:t.width,null==t?void 0:t.height);e.centerInRect(o.state.rect),o.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),o.dragDiv.style.left=e.x+"px",o.dragDiv.style.top=e.y+"px"}})),this.selfRef.current.appendChild(this.dragDiv)},e.prototype.handleCustomTabDrag=function(t,e,i){var o,n,r,a=this,s=null===(o=this.customDrop)||void 0===o?void 0:o.invalidated,d=null===(n=this.customDrop)||void 0===n?void 0:n.callback;this.customDrop=void 0;var l=this.newTabJson||(this.dragNode instanceof p.TabNode?this.dragNode:void 0);if(l&&(t.node instanceof f.TabSetNode||t.node instanceof h.BorderNode)&&-1===t.index){var u=t.node.getSelectedNode(),_=null==u?void 0:u.getRect();if(u&&(null==_?void 0:_.contains(e.x,e.y))){var v=void 0;try{var b=this.onTabDrag(l,u,e.x-_.x,e.y-_.y,t.location,(function(){return a.onDragMove(i)}));b&&(v={rect:new g.Rect(b.x+_.x,b.y+_.y,b.width,b.height),callback:b.callback,invalidated:b.invalidated,dragging:l,over:u,x:e.x-_.x,y:e.y-_.y,location:t.location,cursor:b.cursor})}catch(t){console.error(t)}(null==v?void 0:v.callback)===d&&(s=void 0),this.customDrop=v}}this.dropInfo=t,this.outlineDiv.className=this.getClassName(this.customDrop?T.CLASSES.FLEXLAYOUT__OUTLINE_RECT:t.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):t.rect.positionElement(this.outlineDiv),c.DragDrop.instance.setGlassCursorOverride(null===(r=this.customDrop)||void 0===r?void 0:r.cursor),this.outlineDiv.style.visibility="visible";try{null==s||s()}catch(t){console.error(t)}},e.prototype.onDragEnter=function(t){if(!c.DragDrop.instance.isDragging()){var e=this.props.onExternalDrag(t);e&&(this.fnNewNodeDropped=e.onDrop,this.newTabJson=e.json,this.dragStart(t,e.dragText,p.TabNode._fromJson(e.json,this.props.model,!1),!0,void 0,void 0))}},e.prototype.checkForBorderToShow=function(t,e){var i=this.props.model._getOuterInnerRects().outer,o=i.getCenter(),n=this.edgeRectWidth,r=this.edgeRectLength/2,a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===l.DockLocation.CENTER&&(e>o.y-r&&e<o.y+r||t>o.x-r&&t<o.x+r)&&(a=!0);var s=l.DockLocation.CENTER;a||(t<=i.x+n?s=l.DockLocation.LEFT:t>=i.getRight()-n?s=l.DockLocation.RIGHT:e<=i.y+n?s=l.DockLocation.TOP:e>=i.getBottom()-n&&(s=l.DockLocation.BOTTOM)),s!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:s})},e.prototype.maximize=function(t){this.doAction(u.Actions.maximizeToggle(t.getId()))},e.prototype.customizeTab=function(t,e){this.props.onRenderTab&&this.props.onRenderTab(t,e)},e.prototype.customizeTabSet=function(t,e){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,e)},e.prototype.i18nName=function(t,e){var i;return this.props.i18nMapper&&(i=this.props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i},e.prototype.getOnRenderFloatingTabPlaceholder=function(){return this.props.onRenderFloatingTabPlaceholder},e.prototype.getShowOverflowMenu=function(){return this.props.onShowOverflowMenu},e.prototype.getTabSetPlaceHolderCallback=function(){return this.props.onTabSetPlaceHolder},e.prototype.showContextMenu=function(t,e){this.props.onContextMenu&&this.props.onContextMenu(t,e)},e.prototype.auxMouseClick=function(t,e){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,e)},e}(s.Component);e.Layout=B;var C=function(t){return s.useEffect((function(){var e;null===(e=t.onRendered)||void 0===e||e.call(t)}),[t]),s.createElement(s.Fragment,null,t.children)}},487:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Splitter=void 0;var o=i(899),n=i(241),r=i(920),a=i(907),s=i(327),d=i(398);e.Splitter=function(t){var e=t.layout,i=t.node,l=t.path,c=o.useRef([]),u=o.useRef(void 0),h=i.getParent(),_=function(t){n.DragDrop.instance.setGlassCursorOverride(i.getOrientation()===s.Orientation.HORZ?"ns-resize":"ew-resize"),n.DragDrop.instance.startDrag(t,f,g,v,p,void 0,void 0,e.getCurrentDocument(),e.getRootDiv()),c.current=h._getSplitterBounds(i,!0);var o=e.getRootDiv();u.current=e.getCurrentDocument().createElement("div"),u.current.style.position="absolute",u.current.className=e.getClassName(d.CLASSES.FLEXLAYOUT__SPLITTER_DRAG),u.current.style.cursor=i.getOrientation()===s.Orientation.HORZ?"ns-resize":"ew-resize";var r=i.getRect();i.getOrientation()===s.Orientation.VERT&&r.width<2?r.width=2:i.getOrientation()===s.Orientation.HORZ&&r.height<2&&(r.height=2),r.positionElement(u.current),o.appendChild(u.current)},p=function(t){e.getRootDiv().removeChild(u.current)},f=function(){return!0},g=function(t){var o=e.getDomRect(),n=t.clientX-o.left,r=t.clientY-o.top;u&&(i.getOrientation()===s.Orientation.HORZ?u.current.style.top=b(r-4)+"px":u.current.style.left=b(n-4)+"px"),e.isRealtimeResize()&&T()},T=function(){var t=0;if(u&&(t=i.getOrientation()===s.Orientation.HORZ?u.current.offsetTop:u.current.offsetLeft),h instanceof a.BorderNode){var o=h._calculateSplit(i,t);e.doAction(r.Actions.adjustBorderSplit(i.getParent().getId(),o))}else{var n=h._calculateSplit(i,t);void 0!==n&&e.doAction(r.Actions.adjustSplit(n))}},v=function(){T(),e.getRootDiv().removeChild(u.current)},b=function(t){var e=c.current,i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},E=e.getClassName,y=i.getRect(),m=y.styleWithPosition({cursor:i.getOrientation()===s.Orientation.HORZ?"ns-resize":"ew-resize"}),A=E(d.CLASSES.FLEXLAYOUT__SPLITTER)+" "+E(d.CLASSES.FLEXLAYOUT__SPLITTER_+i.getOrientation().getName());h instanceof a.BorderNode?A+=" "+E(d.CLASSES.FLEXLAYOUT__SPLITTER_BORDER):void 0!==i.getModel().getMaximizedTabset()&&(m.display="none");var S=i.getModel().getSplitterExtra();if(0===S)return o.createElement("div",{style:m,"data-layout-path":l,className:A,onTouchStart:_,onMouseDown:_});var O=y.clone();O.x=0,O.y=0,i.getOrientation()===s.Orientation.VERT?O.width+=S:O.height+=S;var L=O.styleWithPosition({cursor:i.getOrientation()===s.Orientation.HORZ?"ns-resize":"ew-resize"}),R=E(d.CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return o.createElement("div",{style:m,"data-layout-path":l,className:A},o.createElement("div",{style:L,className:R,onTouchStart:_,onMouseDown:_}))}},301:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tab=void 0;var o=i(899),n=i(899),r=i(920),a=i(657),s=i(398),d=i(680),l=i(306),c=i(907),u=i(258);e.Tab=function(t){var e=t.layout,i=t.selected,h=t.node,_=t.factory,p=t.path,f=o.useState(!t.node.isEnableRenderOnDemand()||t.selected),g=f[0],T=f[1];o.useLayoutEffect((function(){!g&&i&&T(!0)}));var v,b=function(){var t=h.getParent();t.getType()===a.TabSetNode.TYPE&&(t.isActive()||e.doAction(r.Actions.setActiveTabset(t.getId())))},E=e.getClassName,y=h.getModel().isUseVisibility(),m=h.getParent(),A=h._styleWithPosition();i||(0,u.hideElement)(A,y),m instanceof a.TabSetNode&&(void 0===h.getModel().getMaximizedTabset()||m.isMaximized()||(0,u.hideElement)(A,y)),g&&(v=_(h));var S=E(s.CLASSES.FLEXLAYOUT__TAB);return m instanceof c.BorderNode&&(S+=" "+E(s.CLASSES.FLEXLAYOUT__TAB_BORDER),S+=" "+E(s.CLASSES.FLEXLAYOUT__TAB_BORDER_+m.getLocation().getName())),o.createElement("div",{className:S,"data-layout-path":p,onMouseDown:b,onTouchStart:b,style:A},o.createElement(d.ErrorBoundary,{message:t.layout.i18nName(l.I18nLabel.Error_rendering_component)},o.createElement(n.Fragment,null,v)))}},625:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TabButton=void 0;var o=i(899),n=i(306),r=i(920),a=i(359),s=i(138),d=i(398),l=i(258);e.TabButton=function(t){var e=t.layout,i=t.node,c=t.selected,u=t.iconFactory,h=t.titleFactory,_=t.icons,p=t.path,f=o.useRef(null),g=o.useRef(null),T=function(t){(0,l.isAuxMouseEvent)(t)||e.getEditingTab()||e.dragStart(t,void 0,i,i.isEnableDrag(),b,E)},v=function(t){(0,l.isAuxMouseEvent)(t)&&e.auxMouseClick(i,t)},b=function(){e.doAction(r.Actions.selectTab(i.getId()))},E=function(t){i.isEnableRename()&&y()},y=function(){e.setEditingTab(i),e.getCurrentDocument().body.addEventListener("mousedown",m),e.getCurrentDocument().body.addEventListener("touchstart",m)},m=function(t){t.target!==g.current&&(e.getCurrentDocument().body.removeEventListener("mousedown",m),e.getCurrentDocument().body.removeEventListener("touchstart",m),e.setEditingTab(void 0))},A=function(t){t.stopPropagation()};o.useLayoutEffect((function(){S(),e.getEditingTab()===i&&g.current.select()}));var S=function(){var t=e.getDomRect(),o=f.current.getBoundingClientRect();i._setTabRect(new a.Rect(o.left-t.left,o.top-t.top,o.width,o.height))},O=function(t){t.stopPropagation()},L=e.getClassName,R=i.getParent(),N=d.CLASSES.FLEXLAYOUT__TAB_BUTTON,D=L(N);D+=" "+L(N+"_"+R.getTabLocation()),D+=c?" "+L(N+"--selected"):" "+L(N+"--unselected"),void 0!==i.getClassName()&&(D+=" "+i.getClassName());var w=(0,l.getRenderStateEx)(e,i,u,h),B=w.content?o.createElement("div",{className:L(d.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},w.content):null,C=w.leading?o.createElement("div",{className:L(d.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},w.leading):null;if(e.getEditingTab()===i&&(B=o.createElement("input",{ref:g,className:L(d.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":p+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:function(t){27===t.keyCode?e.setEditingTab(void 0):13===t.keyCode&&(e.setEditingTab(void 0),e.doAction(r.Actions.renameTab(i.getId(),t.target.value)))},onMouseDown:O,onTouchStart:O})),i.isEnableClose()){var M=e.i18nName(n.I18nLabel.Close_Tab);w.buttons.push(o.createElement("div",{key:"close","data-layout-path":p+"/button/close",title:M,className:L(d.CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:A,onClick:function(t){var o;o=i.getCloseType(),c||o===s.ICloseType.Always||o===s.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches?e.doAction(r.Actions.deleteTab(i.getId())):b()},onTouchStart:A},"function"==typeof _.close?_.close(i):_.close))}return o.createElement("div",{ref:f,"data-layout-path":p,className:D,onMouseDown:T,onClick:v,onAuxClick:v,onContextMenu:function(t){e.showContextMenu(i,t)},onTouchStart:T,title:i.getHelpText()},C,B,w.buttons)}},176:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TabButtonStamp=void 0;var o=i(899),n=i(398),r=i(258);e.TabButtonStamp=function(t){var e=t.layout,i=t.node,a=t.iconFactory,s=t.titleFactory,d=o.useRef(null),l=e.getClassName,c=l(n.CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP),u=(0,r.getRenderStateEx)(e,i,a,s),h=u.content?o.createElement("div",{className:l(n.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},u.content):i._getNameForOverflowMenu(),_=u.leading?o.createElement("div",{className:l(n.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},u.leading):null;return o.createElement("div",{ref:d,className:c,title:i.getHelpText()},_,h)}},578:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TabFloating=void 0;var o=i(899),n=i(920),r=i(657),a=i(398),s=i(306),d=i(258);e.TabFloating=function(t){var e=t.layout,i=t.selected,l=t.node,c=t.path,u=function(){l.getWindow()&&l.getWindow().focus()},h=function(){e.doAction(n.Actions.unFloatTab(l.getId()))},_=function(){var t=l.getParent();t.getType()===r.TabSetNode.TYPE&&(t.isActive()||e.doAction(n.Actions.setActiveTabset(t.getId())))},p=e.getClassName,f=l.getParent(),g=l._styleWithPosition();i||(0,d.hideElement)(g,l.getModel().isUseVisibility()),f instanceof r.TabSetNode&&(void 0===l.getModel().getMaximizedTabset()||f.isMaximized()||(0,d.hideElement)(g,l.getModel().isUseVisibility()));var T=e.i18nName(s.I18nLabel.Floating_Window_Message),v=e.i18nName(s.I18nLabel.Floating_Window_Show_Window),b=e.i18nName(s.I18nLabel.Floating_Window_Dock_Window),E=e.getOnRenderFloatingTabPlaceholder();return E?o.createElement("div",{className:p(a.CLASSES.FLEXLAYOUT__TAB_FLOATING),onMouseDown:_,onTouchStart:_,style:g},E(h,u)):o.createElement("div",{className:p(a.CLASSES.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":c,onMouseDown:_,onTouchStart:_,style:g},o.createElement("div",{className:p(a.CLASSES.FLEXLAYOUT__TAB_FLOATING_INNER)},o.createElement("div",null,T),o.createElement("div",null,o.createElement("a",{href:"#",onClick:function(t){t.preventDefault(),u()}},v)),o.createElement("div",null,o.createElement("a",{href:"#",onClick:function(t){t.preventDefault(),h()}},b))))}},953:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useTabOverflow=void 0;var o=i(899),n=i(359),r=i(657),a=i(327);e.useTabOverflow=function(t,e,i,s){var d=o.useRef(!0),l=o.useRef(!1),c=o.useRef(new n.Rect(0,0,0,0)),u=o.useRef(null),h=o.useState(0),_=h[0],p=h[1],f=o.useRef(!1),g=o.useState([]),T=g[0],v=g[1],b=o.useRef(0);o.useLayoutEffect((function(){f.current=!1}),[t.getSelectedNode(),t.getRect().width,t.getRect().height]),o.useLayoutEffect((function(){S()})),o.useEffect((function(){var t=u.current;return t.addEventListener("wheel",E,{passive:!1}),function(){t.removeEventListener("wheel",E)}}),[]);var E=function(t){t.preventDefault()},y=function(t){return e===a.Orientation.HORZ?t.x:t.y},m=function(t){return e===a.Orientation.HORZ?t.getRight():t.getBottom()},A=function(t){return e===a.Orientation.HORZ?t.width:t.height},S=function(){!0===d.current&&(l.current=!1);var e=t instanceof r.TabSetNode?t.getRect():t.getTabHeaderRect(),o=t.getChildren()[t.getChildren().length-1],n=null===s.current?0:A(s.current.getBoundingClientRect());if(!0===d.current||0===b.current&&0!==T.length||e.width!==c.current.width||e.height!==c.current.height){b.current=T.length,c.current=e;var a=!(t instanceof r.TabSetNode)||!0===t.isEnableTabStrip(),u=m(e)-n;if(null!==i.current&&(u-=A(i.current.getBoundingClientRect())),a&&t.getChildren().length>0){if(0===T.length&&0===_&&m(o.getTabRect())+2<u)return;var h=0,g=t.getSelectedNode();if(g&&!f.current){var E=g.getTabRect(),S=y(E)-2,O=m(E)+2;A(E)+4>=u-y(e)?h=y(e)-S:(O>u||S<y(e))&&(S<y(e)&&(h=y(e)-S),O+h>u&&(h=u-O))}for(var L=Math.max(0,u-(m(o.getTabRect())+2+h)),R=Math.min(0,_+h+L),N=R-_,D=[],w=0;w<t.getChildren().length;w++){var B=t.getChildren()[w];(y(B.getTabRect())+N<y(e)||m(B.getTabRect())+N>u)&&D.push({node:B,index:w})}D.length>0&&(l.current=!0),d.current=!1,v(D),p(R)}}else d.current=!0};return{selfRef:u,position:_,userControlledLeft:f,hiddenTabs:T,onMouseWheel:function(t){var e=0;e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY,1===t.deltaMode&&(e*=40),p(_+e),f.current=!0,t.stopPropagation()},tabsTruncated:l.current}}},159:function(t,e,i){var o=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.TabSet=void 0;var n=i(899),r=i(306),a=i(920),s=i(119),d=i(625),l=i(953),c=i(327),u=i(398),h=i(258);e.TabSet=function(t){var e=t.node,i=t.layout,_=t.iconFactory,p=t.titleFactory,f=t.icons,g=t.path,T=n.useRef(null),v=n.useRef(null),b=n.useRef(null),E=n.useRef(null),y=(0,l.useTabOverflow)(e,c.Orientation.HORZ,T,E),m=y.selfRef,A=y.position,S=y.userControlledLeft,O=y.hiddenTabs,L=y.onMouseWheel,R=y.tabsTruncated,N=function(t){i.doAction(a.Actions.selectTab(t.node.getId())),S.current=!1},D=function(t){if(!(0,h.isAuxMouseEvent)(t)){var o=e.getName();if(o=void 0===o?"":": "+o,i.doAction(a.Actions.setActiveTabset(e.getId())),!i.getEditingTab()){var n=i.i18nName(r.I18nLabel.Move_Tabset,o);void 0!==e.getModel().getMaximizedTabset()?i.dragStart(t,n,e,!1,(function(t){}),M):i.dragStart(t,n,e,e.isEnableDrag(),(function(t){}),M)}}},w=function(t){(0,h.isAuxMouseEvent)(t)&&i.auxMouseClick(e,t)},B=function(t){i.showContextMenu(e,t)},C=function(t){t.stopPropagation()},M=function(t){e.canMaximize()&&i.maximize(e)},x=i.getClassName;null!==b.current&&0!==b.current.scrollLeft&&(b.current.scrollLeft=0);var I=e.getSelectedNode(),U=e._styleWithPosition();void 0===e.getModel().getMaximizedTabset()||e.isMaximized()||(0,h.hideElement)(U,e.getModel().isUseVisibility());var F=[];if(e.isEnableTabStrip())for(var z=0;z<e.getChildren().length;z++){var P=e.getChildren()[z],Y=e.getSelected()===z;F.push(n.createElement(d.TabButton,{layout:i,node:P,path:g+"/tb"+z,key:P.getId(),selected:Y,iconFactory:_,titleFactory:p,icons:f})),z<e.getChildren().length-1&&F.push(n.createElement("div",{key:"divider"+z,className:x(u.CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}var H=void 0!==e.getName(),X=[],k=[],W=[],j={headerContent:e.getName(),stickyButtons:X,buttons:k,headerButtons:W};i.customizeTabSet(e,j);var G,V,J,Z=j.headerContent;if(k=j.buttons,W=j.headerButtons,(X=j.stickyButtons).length>0&&(R?k=o(o([],X,!0),k,!0):F.push(n.createElement("div",{ref:E,key:"sticky_buttons_container",onMouseDown:C,onTouchStart:C,onDragStart:function(t){t.preventDefault()},className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},X))),O.length>0){var q,K=i.i18nName(r.I18nLabel.Overflow_Menu_Tooltip);q="function"==typeof f.more?f.more(e,O):n.createElement(n.Fragment,null,f.more,n.createElement("div",{className:x(u.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},O.length)),k.push(n.createElement("button",{key:"overflowbutton","data-layout-path":g+"/button/overflow",ref:v,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+x(u.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:K,onClick:function(t){var o=i.getShowOverflowMenu();if(void 0!==o)o(e,t,O,N);else{var n=v.current;(0,s.showPopup)(n,O,N,i,_,p)}t.stopPropagation()},onMouseDown:C,onTouchStart:C},q))}if(void 0!==I&&i.isSupportsPopout()&&I.isEnableFloat()&&!I.isFloating()){var $=i.i18nName(r.I18nLabel.Float_Tab);k.push(n.createElement("button",{key:"float","data-layout-path":g+"/button/float",title:$,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:function(t){void 0!==I&&i.doAction(a.Actions.floatTab(I.getId())),t.stopPropagation()},onMouseDown:C,onTouchStart:C},"function"==typeof f.popout?f.popout(I):f.popout))}if(e.canMaximize()){var Q=i.i18nName(r.I18nLabel.Restore),tt=i.i18nName(r.I18nLabel.Maximize);(H?W:k).push(n.createElement("button",{key:"max","data-layout-path":g+"/button/max",title:e.isMaximized()?Q:tt,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(e.isMaximized()?"max":"min")),onClick:function(t){e.canMaximize()&&i.maximize(e),t.stopPropagation()},onMouseDown:C,onTouchStart:C},e.isMaximized()?"function"==typeof f.restore?f.restore(e):f.restore:"function"==typeof f.maximize?f.maximize(e):f.maximize))}if(!e.isMaximized()&&e.isEnableClose()){var et=i.i18nName(r.I18nLabel.Close_Tabset);(H?W:k).push(n.createElement("button",{key:"close","data-layout-path":g+"/button/close",title:et,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:function(t){i.doAction(a.Actions.deleteTabset(e.getId())),t.stopPropagation()},onMouseDown:C,onTouchStart:C},"function"==typeof f.closeTabset?f.closeTabset(e):f.closeTabset))}G=n.createElement("div",{key:"toolbar",ref:T,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:C,onTouchStart:C,onDragStart:function(t){t.preventDefault()}},k);var it=x(u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==e.getClassNameTabStrip()&&(it+=" "+e.getClassNameTabStrip()),it+=" "+u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+e.getTabLocation(),e.isActive()&&!H&&(it+=" "+x(u.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&!H&&(it+=" "+x(u.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),H){var ot=n.createElement("div",{key:"toolbar",ref:T,className:x(u.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:C,onTouchStart:C,onDragStart:function(t){t.preventDefault()}},W),nt=x(u.CLASSES.FLEXLAYOUT__TABSET_HEADER);e.isActive()&&(nt+=" "+x(u.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&(nt+=" "+x(u.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),void 0!==e.getClassNameHeader()&&(nt+=" "+e.getClassNameHeader()),V=n.createElement("div",{className:nt,style:{height:e.getHeaderHeight()+"px"},"data-layout-path":g+"/header",onMouseDown:D,onContextMenu:B,onClick:w,onAuxClick:w,onTouchStart:D},n.createElement("div",{className:x(u.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT)},Z),ot)}var rt={height:e.getTabStripHeight()+"px"};J=n.createElement("div",{className:it,style:rt,"data-layout-path":g+"/tabstrip",onMouseDown:D,onContextMenu:B,onClick:w,onAuxClick:w,onTouchStart:D},n.createElement("div",{ref:b,className:x(u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+x(u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+e.getTabLocation())},n.createElement("div",{style:{left:A},className:x(u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+x(u.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+e.getTabLocation())},F)),G),U=i.styleFont(U);var at=void 0;if(0===e.getChildren().length){var st=i.getTabSetPlaceHolderCallback();st&&(at=st(e))}var dt,lt=n.createElement("div",{className:x(u.CLASSES.FLEXLAYOUT__TABSET_CONTENT)},at);return dt="top"===e.getTabLocation()?n.createElement(n.Fragment,null,V,J,lt):n.createElement(n.Fragment,null,V,lt,J),n.createElement("div",{ref:m,dir:"ltr","data-layout-path":g,style:U,className:x(u.CLASSES.FLEXLAYOUT__TABSET),onWheel:L},dt)}},258:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAuxMouseEvent=e.hideElement=e.getRenderStateEx=void 0;var o=i(899);e.getRenderStateEx=function(t,e,i,n){var r=i?i(e):void 0,a=e.getName(),s=e.getName();if(void 0!==n){var d=n(e);void 0!==d&&("string"==typeof d?(a=d,s=d):void 0!==d.titleContent?(a=d.titleContent,s=d.name):a=d)}void 0===r&&void 0!==e.getIcon()&&(r=o.createElement("img",{style:{width:"1em",height:"1em"},src:e.getIcon(),alt:"leadingContent"}));var l={leading:r,content:a,name:s,buttons:[]};return t.customizeTab(e,l),e._setRenderedName(l.name),l},e.hideElement=function(t,e){e?t.visibility="hidden":t.display="none"},e.isAuxMouseEvent=function(t){var e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}},899:e=>{e.exports=t},994:t=>{t.exports=e}},o={};function n(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return i[t].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(607)})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.FlexLayout=e(require("react"),require("react-dom")):t.FlexLayout=e(t.React,t.ReactDOM)}(self,((t,e)=>(()=>{"use strict";var i={899:e=>{e.exports=t},994:t=>{t.exports=e}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var o=s[t]={exports:{}};return i[t](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Action:()=>l,Actions:()=>h,BorderNode:()=>y,BorderSet:()=>Z,CLASSES:()=>g,DockLocation:()=>r,DragDrop:()=>d,DropInfo:()=>u,I18nLabel:()=>T,ICloseType:()=>p,Layout:()=>V,Model:()=>st,Node:()=>E,Orientation:()=>i,Rect:()=>s,RowNode:()=>b,SplitterNode:()=>m,TabNode:()=>f,TabSetNode:()=>v});var t=n(899),e=n(994);class i{constructor(t){this._name=t}static flip(t){return t===i.HORZ?i.VERT:i.HORZ}getName(){return this._name}toString(){return this._name}}i.HORZ=new i("horz"),i.VERT=new i("vert");class s{constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}static empty(){return new s(0,0,0,0)}static fromElement(t){let{x:e,y:i,width:n,height:o}=t.getBoundingClientRect();return new s(e,i,n,o)}clone(){return new s(this.x,this.y,this.width,this.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,e){this.styleWithPosition(t.style,e)}styleWithPosition(t,e="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t}contains(t,e){return this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom()}removeInsets(t){return new s(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let e=this.width;return t===i.VERT&&(e=this.height),e}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}class r{constructor(t,e,i){this._name=t,this._orientation=e,this._indexPlus=i,r.values[this._name]=this}static getByName(t){return r.values[t]}static getLocation(t,e,i){if(e=(e-t.x)/t.width,i=(i-t.y)/t.height,e>=.25&&e<.75&&i>=.25&&i<.75)return r.CENTER;const s=i>=1-e;return i>=e?s?r.BOTTOM:r.LEFT:s?r.RIGHT:r.TOP}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(t){return this===r.TOP?new s(t.x,t.y,t.width,t.height/2):this===r.BOTTOM?new s(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===r.LEFT?new s(t.x,t.y,t.width/2,t.height):this===r.RIGHT?new s(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,e){return this===r.TOP?{start:new s(t.x,t.y,t.width,e),end:new s(t.x,t.y+e,t.width,t.height-e)}:this===r.LEFT?{start:new s(t.x,t.y,e,t.height),end:new s(t.x+e,t.y,t.width-e,t.height)}:this===r.RIGHT?{start:new s(t.getRight()-e,t.y,e,t.height),end:new s(t.x,t.y,t.width-e,t.height)}:{start:new s(t.x,t.getBottom()-e,t.width,e),end:new s(t.x,t.y,t.width,t.height-e)}}reflect(){return this===r.TOP?r.BOTTOM:this===r.LEFT?r.RIGHT:this===r.RIGHT?r.LEFT:r.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}r.values={},r.TOP=new r("top",i.VERT,0),r.BOTTOM=new r("bottom",i.VERT,1),r.LEFT=new r("left",i.HORZ,0),r.RIGHT=new r("right",i.HORZ,1),r.CENTER=new r("center",i.VERT,0);const a=!("undefined"==typeof window||!window.document||!window.document.createElement);class d{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,a&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(t){var e;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),null===(e=this._document.defaultView)||void 0===e||e.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)}resizeGlass(){s.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),null===(t=this._document.defaultView)||void 0===t||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var t;this._glass.style.cursor=null!==(t=this._glassCursorOverride)&&void 0!==t?t:this._defaultGlassCursor}_setDefaultGlassCursor(t){this._defaultGlassCursor=t,this._updateGlassCursor()}setGlassCursorOverride(t){this._glassCursorOverride=t,this._updateGlassCursor()}startDrag(t,e,i,s,n,o,r,a,d){if(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500)return;this._lastEvent=t,this._document=a||window.document,this._rootElement=d||this._document.body;const l=this._getLocationEvent(t);this.addGlass(n),this._dragging&&console.warn("this._dragging true on startDrag should never happen"),t?(this._startX=l.clientX,this._startY=l.clientY,window.matchMedia&&!window.matchMedia("(pointer: fine)").matches||this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=e,this._fDragMove=i,this._fDragEnd=s,this._fDragCancel=n,this._fClick=o,this._fDblClick=r,this._active=!0,"dragenter"===(null==t?void 0:t.type)?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(t){27===t.keyCode&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),void 0!==this._fDragCancel&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(t){let e=t;return t&&t.touches&&(e=t.touches[0]),e}_getLocationEventEnd(t){let e=t;return t.changedTouches&&(e=t.changedTouches[0]),e}_stopPropagation(t){t.stopPropagation&&t.stopPropagation()}_preventDefault(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t}_onMouseMove(t){this._lastEvent=t;const e=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-e.clientX)>5||Math.abs(this._startY-e.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(e),!1}_onMouseUp(t){this._lastEvent=t;const e=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-e.clientX)<=5&&Math.abs(this._startY-e.clientY)<=5){let i=!1;const s=(new Date).getTime();Math.abs(this._clickX-e.clientX)<=5&&Math.abs(this._clickY-e.clientY)<=5&&s-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),i=!0),!i&&this._fClick&&this._fClick(t),this._lastClick=s,this._clickX=e.clientX,this._clickY=e.clientY}return!1}_onDragEnter(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1}_onDragLeave(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}d.instance=new d;class l{constructor(t,e){this.type=t,this.data=e}}class h{static addNode(t,e,i,s,n){return new l(h.ADD_NODE,{json:t,toNode:e,location:i.getName(),index:s,select:n})}static moveNode(t,e,i,s,n){return new l(h.MOVE_NODE,{fromNode:t,toNode:e,location:i.getName(),index:s,select:n})}static deleteTab(t){return new l(h.DELETE_TAB,{node:t})}static deleteTabset(t){return new l(h.DELETE_TABSET,{node:t})}static renameTab(t,e){return new l(h.RENAME_TAB,{node:t,text:e})}static selectTab(t){return new l(h.SELECT_TAB,{tabNode:t})}static setActiveTabset(t){return new l(h.SET_ACTIVE_TABSET,{tabsetNode:t})}static adjustSplit(t){const e=t.node1Id,i=t.node2Id;return new l(h.ADJUST_SPLIT,{node1:e,weight1:t.weight1,pixelWidth1:t.pixelWidth1,node2:i,weight2:t.weight2,pixelWidth2:t.pixelWidth2})}static adjustBorderSplit(t,e){return new l(h.ADJUST_BORDER_SPLIT,{node:t,pos:e})}static maximizeToggle(t){return new l(h.MAXIMIZE_TOGGLE,{node:t})}static updateModelAttributes(t){return new l(h.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,e){return new l(h.UPDATE_NODE_ATTRIBUTES,{node:t,json:e})}static floatTab(t){return new l(h.FLOAT_TAB,{node:t})}static unFloatTab(t){return new l(h.UNFLOAT_TAB,{node:t})}}h.ADD_NODE="FlexLayout_AddNode",h.MOVE_NODE="FlexLayout_MoveNode",h.DELETE_TAB="FlexLayout_DeleteTab",h.DELETE_TABSET="FlexLayout_DeleteTabset",h.RENAME_TAB="FlexLayout_RenameTab",h.SELECT_TAB="FlexLayout_SelectTab",h.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",h.ADJUST_SPLIT="FlexLayout_AdjustSplit",h.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",h.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",h.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",h.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",h.FLOAT_TAB="FlexLayout_FloatTab",h.UNFLOAT_TAB="FlexLayout_UnFloatTab";class _{constructor(t,e,i,s){this.name=t,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=s,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}_.NUMBER="number",_.STRING="string",_.BOOLEAN="boolean";class c{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(t,e,i,s){const n=new _(t,e,i,s);return this.attributes.push(n),this.nameToAttribute[t]=n,n}addInherited(t,e){return this.addWithAll(t,e,void 0,!1)}add(t,e,i){return this.addWithAll(t,void 0,e,i)}getAttributes(){return this.attributes}getModelName(t){const e=this.nameToAttribute[t];if(void 0!==e)return e.modelName}toJson(t,e){for(const i of this.attributes){const s=e[i.name];(i.alwaysWriteJson||s!==i.defaultValue)&&(t[i.name]=s)}}fromJson(t,e){for(const i of this.attributes){const s=t[i.name];e[i.name]=void 0===s?i.defaultValue:s}}update(t,e){for(const i of this.attributes)if(t.hasOwnProperty(i.name)){const s=t[i.name];void 0===s?delete e[i.name]:e[i.name]=s}}setDefaults(t){for(const e of this.attributes)t[e.name]=e.defaultValue}toTypescriptInterface(t,e){const i=[],s=this.attributes.sort(((t,e)=>t.name.localeCompare(e.name)));i.push("export interface I"+t+"Attributes {");for(let t=0;t<s.length;t++){const n=s[t];let o,r,a=n.type,d=n;void 0!==d.defaultValue?o=d.defaultValue:void 0!==d.modelName&&void 0!==e&&void 0!==e.nameToAttribute[d.modelName]&&(r=d.modelName,d=e.nameToAttribute[d.modelName],o=d.defaultValue,a=d.type);let l=JSON.stringify(o);const h=d.required||d.fixed?"":"?";if(n.fixed)i.push("\t"+n.name+": "+l+";");else{const t=(void 0!==o?"default: "+l:"")+(void 0!==r?" - inherited from global "+r:"");i.push("\t"+n.name+h+": "+a+";"+(t.length>0?" // "+t:""))}}return i.push("}"),i.join("\n")}}class u{constructor(t,e,i,s,n){this.node=t,this.rect=e,this.location=i,this.index=s,this.className=n}}var g,T,p;!function(t){t.FLEXLAYOUT__BORDER="flexlayout__border",t.FLEXLAYOUT__BORDER_="flexlayout__border_",t.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",t.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",t.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",t.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",t.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",t.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",t.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",t.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",t.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",t.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",t.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",t.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",t.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",t.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",t.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",t.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",t.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",t.FLEXLAYOUT__LAYOUT="flexlayout__layout",t.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",t.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",t.FLEXLAYOUT__SPLITTER="flexlayout__splitter",t.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",t.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",t.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",t.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",t.FLEXLAYOUT__TAB="flexlayout__tab",t.FLEXLAYOUT__TABSET="flexlayout__tabset",t.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",t.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",t.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",t.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",t.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",t.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",t.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",t.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",t.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",t.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",t.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",t.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",t.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",t.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",t.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",t.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",t.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",t.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",t.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",t.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",t.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",t.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",t.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",t.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",t.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",t.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",t.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(g||(g={}));class E{constructor(t){this._dirty=!1,this._tempSize=0,this._model=t,this._attributes={},this._children=[],this._fixed=!1,this._rect=s.empty(),this._visible=!1,this._listeners={}}getId(){let t=this._attributes.id;return void 0!==t||(t=this._model._nextUniqueId(),this._setId(t)),t}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return void 0===this._parent?this._model.isRootOrientationVertical()?i.VERT:i.HORZ:i.flip(this._parent.getOrientation())}setEventListener(t,e){this._listeners[t]=e}removeEventListener(t){delete this._listeners[t]}_setId(t){this._attributes.id=t}_fireEvent(t,e){void 0!==this._listeners[t]&&this._listeners[t](e)}_getAttr(t){let e=this._attributes[t];if(void 0===e){const i=this._getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this._model._getAttribute(i))}return e}_forEachNode(t,e){t(this,e),e++;for(const i of this._children)i._forEachNode(t,e)}_setVisible(t){t!==this._visible&&(this._fireEvent("visibility",{visible:t}),this._visible=t)}_getDrawChildren(){return this._children}_setParent(t){this._parent=t}_setRect(t){this._rect=t}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}_isFixed(){return this._fixed}_layout(t,e){this._rect=t}_findDropTargetNode(t,e,i){let s;if(this._rect.contains(e,i))if(void 0!==this._model.getMaximizedTabset())s=this._model.getMaximizedTabset().canDrop(t,e,i);else if(s=this.canDrop(t,e,i),void 0===s&&0!==this._children.length)for(const n of this._children)if(s=n._findDropTargetNode(t,e,i),void 0!==s)break;return s}canDrop(t,e,i){}_canDockInto(t,e){if(null!=e){if(e.location===r.CENTER&&!1===e.node.isEnableDrop())return!1;if(e.location===r.CENTER&&"tabset"===t.getType()&&void 0!==t.getName())return!1;if(e.location!==r.CENTER&&!1===e.node.isEnableDivide())return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(t,e)}return!0}_removeChild(t){const e=this._children.indexOf(t);return-1!==e&&this._children.splice(e,1),this._dirty=!0,e}_addChild(t,e){return null!=e?this._children.splice(e,0,t):(this._children.push(t),e=this._children.length-1),t._parent=this,this._dirty=!0,e}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(t){return null==t&&(t={}),this._rect.styleWithPosition(t)}_getTempSize(){return this._tempSize}_setTempSize(t){this._tempSize=t}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0,"\t")}}class m extends E{constructor(t){super(t),this._fixed=!0,this._attributes.type=m.TYPE,t._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===i.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===i.HORZ?this._model.getSplitterSize():0}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(t){}_getPrefSize(t){return this._model.getSplitterSize()}_updateAttrs(t){}_getAttributeDefinitions(){return new c}toJson(){}}m.TYPE="splitter";class f extends E{constructor(t,e,i=!0){super(t),this._extra={},f._attributeDefinitions.fromJson(e,this._attributes),!0===i&&t._addNode(this)}static _fromJson(t,e,i=!0){return new f(e,t,i)}static _createAttributeDefinitions(){const t=new c;return t.add("type",f.TYPE,!0).setType(_.STRING),t.add("id",void 0).setType(_.STRING),t.add("name","[Unnamed Tab]").setType(_.STRING),t.add("altName",void 0).setType(_.STRING),t.add("helpText",void 0).setType(_.STRING),t.add("component",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.add("floating",!1).setType(_.BOOLEAN),t.addInherited("enableClose","tabEnableClose").setType(_.BOOLEAN),t.addInherited("closeType","tabCloseType").setType("ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(_.BOOLEAN),t.addInherited("enableRename","tabEnableRename").setType(_.BOOLEAN),t.addInherited("className","tabClassName").setType(_.STRING),t.addInherited("icon","tabIcon").setType(_.STRING),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(_.BOOLEAN),t.addInherited("enableFloat","tabEnableFloat").setType(_.BOOLEAN),t.addInherited("borderWidth","tabBorderWidth").setType(_.NUMBER),t.addInherited("borderHeight","tabBorderHeight").setType(_.NUMBER),t}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(t){this._tabRect=t}_setRenderedName(t){this._renderedName=t}_getNameForOverflowMenu(){const t=this._getAttr("altName");return void 0!==t?t:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(t){this._attributes.name=t,this._window&&this._window.document&&(this._window.document.title=t)}_setFloating(t){this._attributes.floating=t}_layout(t,e){t.equals(this._rect)||this._fireEvent("resize",{rect:t}),this._rect=t}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const t={};return f._attributeDefinitions.toJson(t,this._attributes),t}_updateAttrs(t){f._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return f._attributeDefinitions}_setWindow(t){this._window=t}_setBorderWidth(t){this._attributes.borderWidth=t}_setBorderHeight(t){this._attributes.borderHeight=t}static getAttributeDefinitions(){return f._attributeDefinitions}}f.TYPE="tab",f._attributeDefinitions=f._createAttributeDefinitions();class b extends E{constructor(t,e){super(t),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,b._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this)}static _fromJson(t,e){const i=new b(e,t);if(null!=t.children)for(const s of t.children)if(s.type===v.TYPE){const t=v._fromJson(s,e);i._addChild(t)}else{const t=b._fromJson(s,e);i._addChild(t)}return i}static _createAttributeDefinitions(){const t=new c;return t.add("type",b.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(t){this._attributes.weight=t}_layout(t,e){super._layout(t,e);const n=this._rect._getSize(this.getOrientation());let o=0,r=0,a=0,d=0;const l=this._getDrawChildren();for(const t of l){const e=t._getPrefSize(this.getOrientation());t._isFixed()?void 0!==e&&(r+=e):void 0===e?o+=t.getWeight():(a+=e,d+=t.getWeight())}let h=!1,_=n-r-a;_<0&&(_=n-r,h=!0,o+=d);let c=0,u=0;for(const t of l){const e=t._getPrefSize(this.getOrientation());if(t._isFixed())void 0!==e&&t._setTempSize(e);else if(null==e||h){if(0===o)t._setTempSize(0);else{const e=t.getMinSize(this.getOrientation()),i=Math.floor(_*(t.getWeight()/o));t._setTempSize(Math.max(e,i))}u+=t._getTempSize()}else t._setTempSize(e);c+=t._getTempSize()}if(u>0){for(;c<n;)for(const t of l)if(!(t instanceof m)){const e=t._getPrefSize(this.getOrientation());!t._isFixed()&&(void 0===e||h)&&c<n&&(t._setTempSize(t._getTempSize()+1),c++)}for(;c>n;){let t=!1;for(const e of l)if(!(e instanceof m)){const i=e.getMinSize(this.getOrientation());e._getTempSize()>i&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0)}if(!t)break}for(;c>n;){let t=!1;for(const e of l)e instanceof m||e._getTempSize()>0&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0);if(!t)break}}let g=0;for(const t of l)this.getOrientation()===i.HORZ?t._layout(new s(this._rect.x+g,this._rect.y,t._getTempSize(),this._rect.height),e):t._layout(new s(this._rect.x,this._rect.y+g,this._rect.width,t._getTempSize()),e),g+=t._getTempSize();return!0}_getSplitterBounds(t,e=!1){const s=[0,0],n=this._getDrawChildren(),o=n.indexOf(t),r=n[o-1],a=n[o+1];if(this.getOrientation()===i.HORZ){const i=e?r.getMinWidth():0,n=e?a.getMinWidth():0;s[0]=r.getRect().x+i,s[1]=a.getRect().getRight()-t.getWidth()-n}else{const i=e?r.getMinHeight():0,n=e?a.getMinHeight():0;s[0]=r.getRect().y+i,s[1]=a.getRect().getBottom()-t.getHeight()-n}return s}_calculateSplit(t,e){let i;const s=this._getDrawChildren(),n=s.indexOf(t),o=this._getSplitterBounds(t),r=s[n-1].getWeight()+s[n+1].getWeight(),a=Math.max(0,e-o[0]),d=Math.max(0,o[1]-e);if(a+d>0){const t=a*r/(a+d),e=d*r/(a+d);i={node1Id:s[n-1].getId(),weight1:t,pixelWidth1:a,node2Id:s[n+1].getId(),weight2:e,pixelWidth2:d}}return i}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let t=0;t<this._children.length;t++){const e=this._children[t];if(0!==t){const t=new m(this._model);t._setParent(this),this._drawChildren.push(t)}this._drawChildren.push(e)}this._dirty=!1}return this._drawChildren}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}calcMinSize(){this._minHeight=0,this._minWidth=0;let t=!0;for(const e of this._children){const s=e;s instanceof b&&s.calcMinSize(),this.getOrientation()===i.VERT?(this._minHeight+=s.getMinHeight(),t||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,s.getMinWidth())):(this._minWidth+=s.getMinWidth(),t||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,s.getMinHeight())),t=!1}}_tidy(){let t=0;for(;t<this._children.length;){const e=this._children[t];if(e instanceof b){e._tidy();const i=e.getChildren();if(0===i.length)this._removeChild(e);else if(1===i.length){const s=i[0];if(this._removeChild(e),s instanceof b){let i=0;const n=s.getChildren();for(const t of n)i+=t.getWeight();for(let s=0;s<n.length;s++){const o=n[s];o._setWeight(e.getWeight()*o.getWeight()/i),this._addChild(o,t+s)}}else s._setWeight(e.getWeight()),this._addChild(s,t)}else t++}else e instanceof v&&0===e.getChildren().length&&e.isEnableDeleteWhenEmpty()?(this._removeChild(e),e===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):t++}if(this===this._model.getRoot()&&0===this._children.length){const t=this._model._getOnCreateTabSet();let e=t?t():{};e=Object.assign(Object.assign({},e),{selected:-1});const i=new v(this._model,e);this._model._setActiveTabset(i),this._addChild(i)}}canDrop(t,e,i){const s=i-this._rect.y,n=e-this._rect.x,o=this._rect.width,a=this._rect.height,d=50;let l;if(this._model.isEnableEdgeDock()&&void 0===this._parent){if(e<this._rect.x+10&&s>a/2-d&&s<a/2+d){const t=r.LEFT,e=t.getDockRect(this._rect);e.width=e.width/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(e>this._rect.getRight()-10&&s>a/2-d&&s<a/2+d){const t=r.RIGHT,e=t.getDockRect(this._rect);e.width=e.width/2,e.x+=e.width,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i<this._rect.y+10&&n>o/2-d&&n<o/2+d){const t=r.TOP,e=t.getDockRect(this._rect);e.height=e.height/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i>this._rect.getBottom()-10&&n>o/2-d&&n<o/2+d){const t=r.BOTTOM,e=t.getDockRect(this._rect);e.height=e.height/2,e.y+=e.height,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==l&&!t._canDockInto(t,l))return}return l}drop(t,e,i){const s=e,n=t.getParent();let o;if(n&&n._removeChild(t),void 0!==n&&n.getType()===v.TYPE&&n._setSelected(0),void 0!==n&&n.getType()===y.TYPE&&n._setSelected(-1),t instanceof v)o=t;else{const e=this._model._getOnCreateTabSet();o=new v(this._model,e?e(t):{}),o._addChild(t)}let a=this._children.reduce(((t,e)=>t+e.getWeight()),0);0===a&&(a=100),o._setWeight(a/3);const d=!this._model.isRootOrientationVertical();if(d&&s===r.LEFT||!d&&s===r.TOP)this._addChild(o,0);else if(d&&s===r.RIGHT||!d&&s===r.BOTTOM)this._addChild(o);else if(d&&s===r.TOP||!d&&s===r.LEFT){const t=new b(this._model,{}),e=new b(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(o),t._addChild(e),this._addChild(t)}else if(d&&s===r.BOTTOM||!d&&s===r.RIGHT){const t=new b(this._model,{}),e=new b(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(e),t._addChild(o),this._addChild(t)}this._model._setActiveTabset(o),this._model._tidy()}toJson(){const t={};b._attributeDefinitions.toJson(t,this._attributes),t.children=[];for(const e of this._children)t.children.push(e.toJson());return t}isEnableDrop(){return!0}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}_getAttributeDefinitions(){return b._attributeDefinitions}_updateAttrs(t){b._attributeDefinitions.update(t,this._attributes)}static getAttributeDefinitions(){return b._attributeDefinitions}}b.TYPE="row",b._attributeDefinitions=b._createAttributeDefinitions();class v extends E{constructor(t,e){super(t),v._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}static _fromJson(t,e){const i=new v(e,t);if(null!=t.children)for(const s of t.children){const t=f._fromJson(s,e);i._addChild(t)}return 0===i._children.length&&i._setSelected(-1),t.maximized&&!0===t.maximized&&e._setMaximizedTabset(i),t.active&&!0===t.active&&e._setActiveTabset(i),i}static _createAttributeDefinitions(){const t=new c;return t.add("type",v.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t.add("selected",0).setType(_.NUMBER),t.add("name",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),t.addInherited("enableDrop","tabSetEnableDrop"),t.addInherited("enableDrag","tabSetEnableDrag"),t.addInherited("enableDivide","tabSetEnableDivide"),t.addInherited("enableMaximize","tabSetEnableMaximize"),t.addInherited("enableClose","tabSetEnableClose"),t.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),t.addInherited("classNameHeader","tabSetClassNameHeader"),t.addInherited("enableTabStrip","tabSetEnableTabStrip"),t.addInherited("borderInsets","tabSetBorderInsets"),t.addInherited("marginInsets","tabSetMarginInsets"),t.addInherited("minWidth","tabSetMinWidth"),t.addInherited("minHeight","tabSetMinHeight"),t.addInherited("headerHeight","tabSetHeaderHeight"),t.addInherited("tabStripHeight","tabSetTabStripHeight"),t.addInherited("tabLocation","tabSetTabLocation"),t.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(_.BOOLEAN),t}getName(){return this._getAttr("name")}getSelected(){const t=this._attributes.selected;return void 0!==t?t:-1}getSelectedNode(){const t=this.getSelected();if(-1!==t)return this._children[t]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset()===this||this.getParent()!==this.getModel().getRoot()||1!==this.getModel().getRoot().getChildren().length)}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(t){const e=this._getAttr("headerHeight");this._calculatedHeaderBarHeight=0!==e?e:t.headerBarSize}calculateTabBarHeight(t){const e=this._getAttr("tabStripHeight");this._calculatedTabBarHeight=0!==e?e:t.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}canDrop(t,e,i){let n;if(t===this){const t=r.CENTER,e=this._tabHeaderRect;n=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(e,i)){let t=r.CENTER;void 0===this._model.getMaximizedTabset()&&(t=r.getLocation(this._contentRect,e,i));const s=t.getDockRect(this._rect);n=new u(this,s,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this._tabHeaderRect&&this._tabHeaderRect.contains(e,i)){let t,i,o;if(0===this._children.length)t=this._tabHeaderRect.clone(),i=t.y+3,o=t.height-4,t.width=2;else{let a=this._children[0];t=a.getTabRect(),i=t.y,o=t.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(a=this._children[h],t=a.getTabRect(),l=t.x+t.width/2,e>=d&&e<l){const e=r.CENTER,a=new s(t.x-2,i,3,o);n=new u(this,a,e,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}}if(null==n){const e=r.CENTER,a=new s(t.getRight()-2,i,3,o);n=new u(this,a,e,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}if(t._canDockInto(t,n))return n}_layout(t,e){this.calculateHeaderBarHeight(e),this.calculateTabBarHeight(e),this.isMaximized()&&(t=this._model.getRoot().getRect()),t=t.removeInsets(this._getAttr("marginInsets")),this._rect=t,t=t.removeInsets(this._getAttr("borderInsets"));let i=0,n=0;void 0!==this.getName()&&(i+=this._calculatedHeaderBarHeight,n+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&("top"===this.getTabLocation()?this._tabHeaderRect=new s(t.x,t.y+i,t.width,this._calculatedTabBarHeight):this._tabHeaderRect=new s(t.x,t.y+t.height-this._calculatedTabBarHeight,t.width,this._calculatedTabBarHeight),n+=this._calculatedTabBarHeight,"top"===this.getTabLocation()&&(i+=this._calculatedTabBarHeight)),this._contentRect=new s(t.x,t.y+i,t.width,t.height-n);for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected())}}_delete(){this._parent._removeChild(this)}_remove(t){const e=this._removeChild(t);this._model._tidy(),O(this,e)}drop(t,e,i,s){const n=e;if(this===t)return;let o=t.getParent(),a=0;if(void 0!==o&&(a=o._removeChild(t),o instanceof y&&o.getSelected()===a?o._setSelected(-1):O(o,a)),t.getType()===f.TYPE&&o===this&&a<i&&i>0&&i--,n===r.CENTER){let e=i;if(-1===e&&(e=this._children.length),t.getType()===f.TYPE)this._addChild(t,e),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(e);else for(let i=0;i<t.getChildren().length;i++){const s=t.getChildren()[i];this._addChild(s,e),e++}this._model._setActiveTabset(this)}else{let e;if(t instanceof f){const i=this._model._getOnCreateTabSet();e=new v(this._model,i?i(t):{}),e._addChild(t),o=e}else e=t;const i=this._parent,s=i.getChildren().indexOf(this);if(i.getOrientation()===n._orientation)e._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),i._addChild(e,s+n._indexPlus);else{const t=new b(this._model,{});t._setWeight(this.getWeight()),t._addChild(this),this._setWeight(50),e._setWeight(50),t._addChild(e,n._indexPlus),i._removeChild(this),i._addChild(t,s)}this._model._setActiveTabset(e)}this._model._tidy()}toJson(){const t={};return v._attributeDefinitions.toJson(t,this._attributes),t.children=this._children.map((t=>t.toJson())),this.isActive()&&(t.active=!0),this.isMaximized()&&(t.maximized=!0),t}_updateAttrs(t){v._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return v._attributeDefinitions}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}static getAttributeDefinitions(){return v._attributeDefinitions}}function O(t,e){if(void 0!==t&&(t.getType()===v.TYPE||t.getType()===y.TYPE)){const i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t._setSelected(t.getChildren().length-1):e<i?t._setSelected(i-1):e>i||t._setSelected(-1))}}v.TYPE="tabset",v._attributeDefinitions=v._createAttributeDefinitions();class y extends E{constructor(t,e,i){super(i),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=t,this._drawChildren=[],this._attributes.id=`border_${t.getName()}`,y._attributeDefinitions.fromJson(e,this._attributes),i._addNode(this)}static _fromJson(t,e){const i=r.getByName(t.location),s=new y(i,t,e);return t.children&&(s._children=t.children.map((t=>{const i=f._fromJson(t,e);return i._setParent(s),i}))),s}static _createAttributeDefinitions(){const t=new c;return t.add("type",y.TYPE,!0).setType(_.STRING).setFixed(),t.add("selected",-1).setType(_.NUMBER),t.add("show",!0).setType(_.BOOLEAN),t.add("config",void 0).setType("any"),t.addInherited("barSize","borderBarSize").setType(_.NUMBER),t.addInherited("enableDrop","borderEnableDrop").setType(_.BOOLEAN),t.addInherited("className","borderClassName").setType(_.STRING),t.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(_.BOOLEAN),t.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(_.BOOLEAN),t.addInherited("size","borderSize").setType(_.NUMBER),t.addInherited("minSize","borderMinSize").setType(_.NUMBER),t.addInherited("enableAutoHide","borderEnableAutoHide").setType(_.BOOLEAN),t}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(t){return null==t&&(t=-1!==this.getSelected()),t?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(t){const e=this._getAttr("barSize");this._calculatedBorderBarSize=0!==e?e:t.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const t=this._getAttr("size"),e=this.getSelected();if(-1===e)return t;{const s=this._children[e],n=this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight");return-1===n?t:n}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(-1!==this.getSelected())return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return!(!this._attributes.show||this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&0===this._children.length)}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(t){this._attributes.selected=t}_setSize(t){const e=this.getSelected();if(-1===e)this._attributes.size=t;else{const s=this._children[e];-1===(this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight"))?this._attributes.size=t:this._location._orientation===i.HORZ?s._setBorderWidth(t):s._setBorderHeight(t)}}_updateAttrs(t){y._attributeDefinitions.update(t,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(t){this._adjustedSize=t}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(t,e){this.calcBorderBarSize(e);const i=this._location.split(t,this.getBorderBarSize());return this._tabHeaderRect=i.start,i.end}_layoutBorderInner(t,e){this._drawChildren=[];const i=this._location,s=i.split(t,this._adjustedSize+this._model.getSplitterSize()),n=i.reflect().split(s.start,this._model.getSplitterSize());this._contentRect=n.end;for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected()),this._drawChildren.push(i)}if(-1===this.getSelected())return t;{const t=new m(this._model);return t._setParent(this),t._setRect(n.start),this._drawChildren.push(t),s.end}}_remove(t){const e=this._removeChild(t);-1!==this.getSelected()&&O(this,e)}canDrop(t,e,n){if(t.getType()!==f.TYPE)return;let o;const a=r.CENTER;if(this._tabHeaderRect.contains(e,n)){if(this._location._orientation===i.VERT)if(this._children.length>0){let t=this._children[0],i=t.getTabRect();const n=i.y,r=i.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],i=t.getTabRect(),l=i.x+i.width/2,e>=d&&e<l){const t=new s(i.x-2,n,3,r);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i.getRight()-2,n,3,r);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._children.length>0){let t=this._children[0],e=t.getTabRect();const i=e.x,r=e.width;let d=this._tabHeaderRect.y,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],e=t.getTabRect(),l=e.y+e.height/2,n>=d&&n<l){const t=new s(i,e.y-2,r,3);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i,e.getBottom()-2,r,3);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}if(!t._canDockInto(t,o))return}else if(-1!==this.getSelected()&&this._contentRect.contains(e,n)){const e=this._contentRect;if(o=new u(this,e,a,-1,g.FLEXLAYOUT__OUTLINE_RECT),!t._canDockInto(t,o))return}return o}drop(t,e,i,s){let n=0;const o=t.getParent();void 0!==o&&(n=o._removeChild(t),o!==this&&o instanceof y&&o.getSelected()===n?o._setSelected(-1):O(o,n)),t.getType()===f.TYPE&&o===this&&n<i&&i>0&&i--;let r=i;-1===r&&(r=this._children.length),t.getType()===f.TYPE&&this._addChild(t,r),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(r),this._model._tidy()}toJson(){const t={};return y._attributeDefinitions.toJson(t,this._attributes),t.location=this._location.getName(),t.children=this._children.map((t=>t.toJson())),t}_getSplitterBounds(t,e=!1){const i=[0,0],s=e?this.getMinSize():0,n=this._model._getOuterInnerRects().outer,o=this._model._getOuterInnerRects().inner,a=this._model.getRoot();return this._location===r.TOP?(i[0]=n.y+s,i[1]=Math.max(i[0],o.getBottom()-t.getHeight()-a.getMinHeight())):this._location===r.LEFT?(i[0]=n.x+s,i[1]=Math.max(i[0],o.getRight()-t.getWidth()-a.getMinWidth())):this._location===r.BOTTOM?(i[1]=n.getBottom()-t.getHeight()-s,i[0]=Math.min(i[1],o.y+a.getMinHeight())):this._location===r.RIGHT&&(i[1]=n.getRight()-t.getWidth()-s,i[0]=Math.min(i[1],o.x+a.getMinWidth())),i}_calculateSplit(t,e){const i=this._getSplitterBounds(t);return this._location===r.BOTTOM||this._location===r.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])}_getAttributeDefinitions(){return y._attributeDefinitions}static getAttributeDefinitions(){return y._attributeDefinitions}}function R(e,i,s,n){let o=s?s(i):void 0,r=i.getName(),a=i.getName();if(void 0!==n){const t=n(i);void 0!==t&&("string"==typeof t?(r=t,a=t):void 0!==t.titleContent?(r=t.titleContent,a=t.name):r=t)}void 0===o&&void 0!==i.getIcon()&&(o=t.createElement("img",{style:{width:"1em",height:"1em"},src:i.getIcon(),alt:"leadingContent"}));const d={leading:o,content:r,name:a,buttons:[]};return e.customizeTab(i,d),i._setRenderedName(d.name),d}function A(t,e){e?t.visibility="hidden":t.display="none"}function L(t){let e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}y.TYPE="border",y._attributeDefinitions=y._createAttributeDefinitions(),function(t){t.Close_Tab="Close",t.Close_Tabset="Close tabset",t.Move_Tab="Move: ",t.Move_Tabset="Move tabset",t.Maximize="Maximize tabset",t.Restore="Restore tabset",t.Float_Tab="Show selected tab in floating window",t.Overflow_Menu_Tooltip="Hidden tabs",t.Floating_Window_Message="This panel is shown in a floating window",t.Floating_Window_Show_Window="Show window",t.Floating_Window_Dock_Window="Dock window",t.Error_rendering_component="Error rendering component"}(T||(T={})),function(t){t[t.Visible=1]="Visible",t[t.Always=2]="Always",t[t.Selected=3]="Selected"}(p||(p={}));const N=e=>{const{layout:i,node:n,selected:o,border:r,iconFactory:a,titleFactory:d,icons:l,path:_}=e,c=t.useRef(null),u=t.useRef(null),E=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),f,b)},m=t=>{L(t)&&i.auxMouseClick(n,t)},f=()=>{i.doAction(h.selectTab(n.getId()))},b=t=>{},v=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):f()},O=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{y(),i.getEditingTab()===n&&u.current.select()}));const y=()=>{const t=i.getDomRect(),e=c.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},A=t=>{t.stopPropagation()},N=i.getClassName;let S=N(g.FLEXLAYOUT__BORDER_BUTTON)+" "+N(g.FLEXLAYOUT__BORDER_BUTTON_+r);S+=o?" "+N(g.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+N(g.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==n.getClassName()&&(S+=" "+n.getClassName());const D=R(i,n,a,d);let B=D.content?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},D.content):null;const w=D.leading?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_LEADING)},D.leading):null;if(i.getEditingTab()===n&&(B=t.createElement("input",{ref:u,className:N(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":_+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:A,onTouchStart:A})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);D.buttons.push(t.createElement("div",{key:"close","data-layout-path":_+"/button/close",title:e,className:N(g.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:O,onClick:v,onTouchStart:O},"function"==typeof l.close?l.close(n):l.close))}return t.createElement("div",{ref:c,"data-layout-path":_,className:S,onMouseDown:E,onClick:m,onAuxClick:m,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:E,title:n.getHelpText()},w,B,D.buttons)},S=e=>{const{layout:i,node:s,iconFactory:n,titleFactory:o}=e,r=t.useRef(null),a=i.getClassName;let d=a(g.FLEXLAYOUT__TAB_BUTTON_STAMP);const l=R(i,s,n,o);let h=l.content?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},l.content):s._getNameForOverflowMenu();const _=l.leading?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},l.leading):null;return t.createElement("div",{ref:r,className:d,title:s.getHelpText()},_,h)};function D(e,i,s,n,o,r){const a=n.getRootDiv(),l=n.getClassName,h=e.ownerDocument,_=e.getBoundingClientRect(),c=a.getBoundingClientRect(),u=h.createElement("div");u.className=l(g.FLEXLAYOUT__POPUP_MENU_CONTAINER),_.left<c.left+c.width/2?u.style.left=_.left-c.left+"px":u.style.right=c.right-_.right+"px",_.top<c.top+c.height/2?u.style.top=_.top-c.top+"px":u.style.bottom=c.bottom-_.bottom+"px",d.instance.addGlass((()=>T())),d.instance.setGlassCursorOverride("default"),a.appendChild(u);const T=()=>{n.hidePortal(),d.instance.hideGlass(),a.removeChild(u),u.removeEventListener("mousedown",p),h.removeEventListener("mousedown",E)},p=t=>{t.stopPropagation()},E=t=>{T()};u.addEventListener("mousedown",p),h.addEventListener("mousedown",E),n.showPortal(t.createElement(B,{currentDocument:h,onSelect:s,onHide:T,items:i,classNameMapper:l,layout:n,iconFactory:o,titleFactory:r}),u)}const B=e=>{const{items:i,onHide:s,onSelect:n,classNameMapper:o,layout:r,iconFactory:a,titleFactory:d}=e,l=i.map(((e,i)=>t.createElement("div",{key:e.index,className:o(g.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+i,onClick:t=>((t,e)=>{n(t),s(),e.stopPropagation()})(e,t),title:e.node.getHelpText()},e.node.getModel().isLegacyOverflowMenu()?e.node._getNameForOverflowMenu():t.createElement(S,{node:e.node,layout:r,iconFactory:a,titleFactory:d}))));return t.createElement("div",{className:o(g.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},l)},w=(e,n,o,r)=>{const a=t.useRef(!0),d=t.useRef(!1),l=t.useRef(new s(0,0,0,0)),h=t.useRef(null),[_,c]=t.useState(0),u=t.useRef(!1),[g,T]=t.useState([]),p=t.useRef(0);t.useLayoutEffect((()=>{u.current=!1}),[e.getSelectedNode(),e.getRect().width,e.getRect().height]),t.useLayoutEffect((()=>{O()})),t.useEffect((()=>{const t=h.current;return t.addEventListener("wheel",E,{passive:!1}),()=>{t.removeEventListener("wheel",E)}}),[]);const E=t=>{t.preventDefault()},m=t=>n===i.HORZ?t.x:t.y,f=t=>n===i.HORZ?t.getRight():t.getBottom(),b=t=>n===i.HORZ?t.width:t.height,O=()=>{!0===a.current&&(d.current=!1);const t=e instanceof v?e.getRect():e.getTabHeaderRect();let i=e.getChildren()[e.getChildren().length-1];const s=null===r.current?0:b(r.current.getBoundingClientRect());if(!0===a.current||0===p.current&&0!==g.length||t.width!==l.current.width||t.height!==l.current.height){p.current=g.length,l.current=t;const n=!(e instanceof v)||!0===e.isEnableTabStrip();let r=f(t)-s;if(null!==o.current&&(r-=b(o.current.getBoundingClientRect())),n&&e.getChildren().length>0){if(0===g.length&&0===_&&f(i.getTabRect())+2<r)return;let s=0;const n=e.getSelectedNode();if(n&&!u.current){const e=n.getTabRect(),i=m(e)-2,o=f(e)+2;b(e)+4>=r-m(t)?s=m(t)-i:(o>r||i<m(t))&&(i<m(t)&&(s=m(t)-i),o+s>r&&(s=r-o))}const o=Math.max(0,r-(f(i.getTabRect())+2+s)),l=Math.min(0,_+s+o),h=l-_,p=[];for(let i=0;i<e.getChildren().length;i++){const s=e.getChildren()[i];(m(s.getTabRect())+h<m(t)||f(s.getTabRect())+h>r)&&p.push({node:s,index:i})}p.length>0&&(d.current=!0),a.current=!1,T(p),c(l)}}else a.current=!0};return{selfRef:h,position:_,userControlledLeft:u,hiddenTabs:g,onMouseWheel:t=>{let e=0;e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY,1===t.deltaMode&&(e*=40),c(_+e),u.current=!0,t.stopPropagation()},tabsTruncated:d.current}},C=e=>{const{border:s,layout:n,iconFactory:o,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:f,onMouseWheel:b}=w(s,i.flip(s.getOrientation()),_,u),v=t=>{L(t)&&n.auxMouseClick(s,t)},O=t=>{t.stopPropagation()},y=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,f,R):D(c.current,f,R,n,o,a),t.stopPropagation()},R=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},A=t=>{const e=s.getChildren()[s.getSelected()];void 0!==e&&n.doAction(h.floatTab(e.getId())),t.stopPropagation()},S=n.getClassName;let B=s.getTabHeaderRect().styleWithPosition({});const C=[],M=e=>{let i=s.getSelected()===e,r=s.getChildren()[e];C.push(t.createElement(N,{layout:n,border:s.getLocation().getName(),node:r,path:l+"/tb"+e,key:r.getId(),selected:i,iconFactory:o,titleFactory:a,icons:d})),e<s.getChildren().length-1&&C.push(t.createElement("div",{key:"divider"+e,className:S(g.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let t=0;t<s.getChildren().length;t++)M(t);let x=S(g.FLEXLAYOUT__BORDER)+" "+S(g.FLEXLAYOUT__BORDER_+s.getLocation().getName());void 0!==s.getClassName()&&(x+=" "+s.getClassName());let U=[];const I={headerContent:void 0,buttons:U,stickyButtons:[],headerButtons:[]};let F;if(n.customizeTabSet(s,I),U=I.buttons,f.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof d.more?d.more(s,f):t.createElement(t.Fragment,null,d.more,t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},f.length)),U.push(t.createElement("button",{key:"overflowbutton",ref:c,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+s.getLocation().getName()),title:e,onClick:y,onMouseDown:O,onTouchStart:O},i))}const z=s.getSelected();if(-1!==z){const e=s.getChildren()[z];if(void 0!==e&&n.isSupportsPopout()&&e.isEnableFloat()&&!e.isFloating()){const i=n.i18nName(T.Float_Tab);U.push(t.createElement("button",{key:"float",title:i,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:A,onMouseDown:O,onTouchStart:O},"function"==typeof d.popout?d.popout(e):d.popout))}}F=t.createElement("div",{key:"toolbar",ref:_,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_+s.getLocation().getName())},U),B=n.styleFont(B);let Y={};const H=s.getBorderBarSize()-1;return Y=s.getLocation()===r.LEFT?{right:H,height:H,top:E}:s.getLocation()===r.RIGHT?{left:H,height:H,top:E}:{height:H,left:E},t.createElement("div",{ref:p,dir:"ltr",style:B,className:x,"data-layout-path":l,onClick:v,onAuxClick:v,onContextMenu:t=>{n.showContextMenu(s,t)},onWheel:b},t.createElement("div",{style:{height:H},className:S(g.FLEXLAYOUT__BORDER_INNER)+" "+S(g.FLEXLAYOUT__BORDER_INNER_+s.getLocation().getName())},t.createElement("div",{style:Y,className:S(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+S(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+s.getLocation().getName())},C)),F)},M=e=>{const{layout:s,node:n,path:o}=e,r=t.useRef([]),a=t.useRef(void 0),l=n.getParent(),_=t=>{d.instance.setGlassCursorOverride(n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"),d.instance.startDrag(t,u,T,E,c,void 0,void 0,s.getCurrentDocument(),s.getRootDiv()),r.current=l._getSplitterBounds(n,!0);const e=s.getRootDiv();a.current=s.getCurrentDocument().createElement("div"),a.current.style.position="absolute",a.current.className=s.getClassName(g.FLEXLAYOUT__SPLITTER_DRAG),a.current.style.cursor=n.getOrientation()===i.HORZ?"ns-resize":"ew-resize";const o=n.getRect();n.getOrientation()===i.VERT&&o.width<2?o.width=2:n.getOrientation()===i.HORZ&&o.height<2&&(o.height=2),o.positionElement(a.current),e.appendChild(a.current)},c=t=>{s.getRootDiv().removeChild(a.current)},u=()=>!0,T=t=>{const e=s.getDomRect(),o=t.clientX-e.left,r=t.clientY-e.top;a&&(n.getOrientation()===i.HORZ?a.current.style.top=m(r-4)+"px":a.current.style.left=m(o-4)+"px"),s.isRealtimeResize()&&p()},p=()=>{let t=0;if(a&&(t=n.getOrientation()===i.HORZ?a.current.offsetTop:a.current.offsetLeft),l instanceof y){const e=l._calculateSplit(n,t);s.doAction(h.adjustBorderSplit(n.getParent().getId(),e))}else{const e=l._calculateSplit(n,t);void 0!==e&&s.doAction(h.adjustSplit(e))}},E=()=>{p(),s.getRootDiv().removeChild(a.current)},m=t=>{const e=r.current;let i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},f=s.getClassName;let b=n.getRect();const v=b.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"});let O=f(g.FLEXLAYOUT__SPLITTER)+" "+f(g.FLEXLAYOUT__SPLITTER_+n.getOrientation().getName());l instanceof y?O+=" "+f(g.FLEXLAYOUT__SPLITTER_BORDER):void 0!==n.getModel().getMaximizedTabset()&&(v.display="none");const R=n.getModel().getSplitterExtra();if(0===R)return t.createElement("div",{style:v,"data-layout-path":o,className:O,onTouchStart:_,onMouseDown:_});{let e=b.clone();e.x=0,e.y=0,n.getOrientation()===i.VERT?e.width+=R:e.height+=R;const s=e.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"}),r=f(g.FLEXLAYOUT__SPLITTER_EXTRA);return t.createElement("div",{style:v,"data-layout-path":o,className:O},t.createElement("div",{style:s,className:r,onTouchStart:_,onMouseDown:_}))}};class x extends t.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){console.debug(t),console.debug(e)}render(){return this.state.hasError?t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}const U=e=>{const{layout:i,selected:s,node:n,factory:o,path:r}=e,[a,d]=t.useState(!e.node.isEnableRenderOnDemand()||e.selected);t.useLayoutEffect((()=>{!a&&s&&d(!0)}));const l=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},_=i.getClassName,c=n.getModel().isUseVisibility(),u=n.getParent(),p=n._styleWithPosition();let E;s||A(p,c),u instanceof v&&(void 0===n.getModel().getMaximizedTabset()||u.isMaximized()||A(p,c)),a&&(E=o(n));let m=_(g.FLEXLAYOUT__TAB);return u instanceof y&&(m+=" "+_(g.FLEXLAYOUT__TAB_BORDER),m+=" "+_(g.FLEXLAYOUT__TAB_BORDER_+u.getLocation().getName())),t.createElement("div",{className:m,"data-layout-path":r,onMouseDown:l,onTouchStart:l,style:p},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,E)))},I=e=>{const{layout:i,node:n,selected:o,iconFactory:r,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),m,f)},E=t=>{L(t)&&i.auxMouseClick(n,t)},m=()=>{i.doAction(h.selectTab(n.getId()))},f=t=>{n.isEnableRename()&&b()},b=()=>{i.setEditingTab(n),i.getCurrentDocument().body.addEventListener("mousedown",v),i.getCurrentDocument().body.addEventListener("touchstart",v)},v=t=>{t.target!==c.current&&(i.getCurrentDocument().body.removeEventListener("mousedown",v),i.getCurrentDocument().body.removeEventListener("touchstart",v),i.setEditingTab(void 0))},O=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):m()},y=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{A(),i.getEditingTab()===n&&c.current.select()}));const A=()=>{const t=i.getDomRect(),e=_.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},N=t=>{t.stopPropagation()},S=i.getClassName,D=n.getParent();let B=g.FLEXLAYOUT__TAB_BUTTON,w=S(B);w+=" "+S(B+"_"+D.getTabLocation()),w+=o?" "+S(B+"--selected"):" "+S(B+"--unselected"),void 0!==n.getClassName()&&(w+=" "+n.getClassName());const C=R(i,n,r,a);let M=C.content?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},C.content):null;const x=C.leading?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},C.leading):null;if(i.getEditingTab()===n&&(M=t.createElement("input",{ref:c,className:S(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":l+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:N,onTouchStart:N})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);C.buttons.push(t.createElement("div",{key:"close","data-layout-path":l+"/button/close",title:e,className:S(g.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:y,onClick:O,onTouchStart:y},"function"==typeof d.close?d.close(n):d.close))}return t.createElement("div",{ref:_,"data-layout-path":l,className:w,onMouseDown:u,onClick:E,onAuxClick:E,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:u,title:n.getHelpText()},x,M,C.buttons)},F=e=>{const{node:s,layout:n,iconFactory:o,titleFactory:r,icons:a,path:d}=e,l=t.useRef(null),_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:f,onMouseWheel:b,tabsTruncated:v}=w(s,i.HORZ,l,u),O=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,f,y):D(_.current,f,y,n,o,r),t.stopPropagation()},y=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},R=t=>{if(!L(t)){let e=s.getName();if(e=void 0===e?"":": "+e,n.doAction(h.setActiveTabset(s.getId())),!n.getEditingTab()){const i=n.i18nName(T.Move_Tabset,e);void 0!==s.getModel().getMaximizedTabset()?n.dragStart(t,i,s,!1,(t=>{}),U):n.dragStart(t,i,s,s.isEnableDrag(),(t=>{}),U)}}},N=t=>{L(t)&&n.auxMouseClick(s,t)},S=t=>{n.showContextMenu(s,t)},B=t=>{t.stopPropagation()},C=t=>{s.canMaximize()&&n.maximize(s),t.stopPropagation()},M=t=>{n.doAction(h.deleteTabset(s.getId())),t.stopPropagation()},x=t=>{void 0!==z&&n.doAction(h.floatTab(z.getId())),t.stopPropagation()},U=t=>{s.canMaximize()&&n.maximize(s)},F=n.getClassName;null!==c.current&&0!==c.current.scrollLeft&&(c.current.scrollLeft=0);const z=s.getSelectedNode();let Y=s._styleWithPosition();void 0===s.getModel().getMaximizedTabset()||s.isMaximized()||A(Y,s.getModel().isUseVisibility());const H=[];if(s.isEnableTabStrip())for(let e=0;e<s.getChildren().length;e++){const i=s.getChildren()[e];let l=s.getSelected()===e;H.push(t.createElement(I,{layout:n,node:i,path:d+"/tb"+e,key:i.getId(),selected:l,iconFactory:o,titleFactory:r,icons:a})),e<s.getChildren().length-1&&H.push(t.createElement("div",{key:"divider"+e,className:F(g.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}const X=void 0!==s.getName();let W=[],P=[],k=[];const G={headerContent:s.getName(),stickyButtons:W,buttons:P,headerButtons:k};n.customizeTabSet(s,G);const V=G.headerContent;let J,Z,j;if(W=G.stickyButtons,P=G.buttons,k=G.headerButtons,W.length>0&&(v?P=[...W,...P]:H.push(t.createElement("div",{ref:u,key:"sticky_buttons_container",onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()},className:F(g.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},W))),f.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof a.more?a.more(s,f):t.createElement(t.Fragment,null,a.more,t.createElement("div",{className:F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},f.length)),P.push(t.createElement("button",{key:"overflowbutton","data-layout-path":d+"/button/overflow",ref:_,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:e,onClick:O,onMouseDown:B,onTouchStart:B},i))}if(void 0!==z&&n.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const e=n.i18nName(T.Float_Tab);P.push(t.createElement("button",{key:"float","data-layout-path":d+"/button/float",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:x,onMouseDown:B,onTouchStart:B},"function"==typeof a.popout?a.popout(z):a.popout))}if(s.canMaximize()){const e=n.i18nName(T.Restore),i=n.i18nName(T.Maximize);(X?k:P).push(t.createElement("button",{key:"max","data-layout-path":d+"/button/max",title:s.isMaximized()?e:i,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(s.isMaximized()?"max":"min")),onClick:C,onMouseDown:B,onTouchStart:B},s.isMaximized()?"function"==typeof a.restore?a.restore(s):a.restore:"function"==typeof a.maximize?a.maximize(s):a.maximize))}if(!s.isMaximized()&&s.isEnableClose()){const e=n.i18nName(T.Close_Tabset);(X?k:P).push(t.createElement("button",{key:"close","data-layout-path":d+"/button/close",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:M,onMouseDown:B,onTouchStart:B},"function"==typeof a.closeTabset?a.closeTabset(s):a.closeTabset))}J=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},P);let q=F(g.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==s.getClassNameTabStrip()&&(q+=" "+s.getClassNameTabStrip()),q+=" "+g.FLEXLAYOUT__TABSET_TABBAR_OUTER_+s.getTabLocation(),s.isActive()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),X){const e=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},k);let i=F(g.FLEXLAYOUT__TABSET_HEADER);s.isActive()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),void 0!==s.getClassNameHeader()&&(i+=" "+s.getClassNameHeader()),Z=t.createElement("div",{className:i,style:{height:s.getHeaderHeight()+"px"},"data-layout-path":d+"/header",onMouseDown:R,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:R},t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_HEADER_CONTENT)},V),e)}const $={height:s.getTabStripHeight()+"px"};j=t.createElement("div",{className:q,style:$,"data-layout-path":d+"/tabstrip",onMouseDown:R,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:R},t.createElement("div",{ref:c,className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_+s.getTabLocation())},t.createElement("div",{style:{left:E},className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+s.getTabLocation())},H)),J),Y=n.styleFont(Y);var K=void 0;if(0===s.getChildren().length){const t=n.getTabSetPlaceHolderCallback();t&&(K=t(s))}const Q=t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_CONTENT)},K);var tt;return tt="top"===s.getTabLocation()?t.createElement(t.Fragment,null,Z,j,Q):t.createElement(t.Fragment,null,Z,Q,j),t.createElement("div",{ref:p,dir:"ltr","data-layout-path":d,style:Y,className:F(g.FLEXLAYOUT__TABSET),onWheel:b},tt)},z=i=>{const{title:s,id:n,url:o,rect:r,onCloseWindow:a,onSetWindow:d,children:l}=i,h=t.useRef(null),_=t.useRef(null),[c,u]=t.useState(void 0);return t.useLayoutEffect((()=>{_.current&&clearTimeout(_.current);const t=r,e=Array.from(window.document.styleSheets).reduce(((t,e)=>{let i;try{i=e.cssRules}catch(t){}try{return[...t,{href:e.href,type:e.type,rules:i?Array.from(i).map((t=>t.cssText)):null}]}catch(e){return t}}),[]);return h.current=window.open(o,n,`left=${t.x},top=${t.y},width=${t.width},height=${t.height}`),null!==h.current?(d(n,h.current),window.addEventListener("beforeunload",(()=>{h.current&&(h.current.close(),h.current=null)})),h.current.addEventListener("load",(()=>{const t=h.current.document;t.title=s;const i=t.createElement("div");i.className=g.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(i),function(t,e){const i=t.head,s=[];for(const n of e)if(n.href){const e=t.createElement("link");e.type=n.type,e.rel="stylesheet",e.href=n.href,i.appendChild(e),s.push(new Promise(((t,i)=>{e.onload=()=>t(!0)})))}else if(n.rules){const e=t.createElement("style");for(const i of n.rules)e.appendChild(t.createTextNode(i));i.appendChild(e)}return Promise.all(s)}(t,e).then((()=>{u(i)})),h.current.addEventListener("beforeunload",(()=>{a(n)}))}))):(console.warn(`Unable to open window ${o}`),a(n)),()=>{_.current=setTimeout((()=>{h.current&&(h.current.close(),h.current=null)}),0)}}),[]),void 0!==c?(0,e.createPortal)(l,c):null},Y=e=>{const{layout:i,node:s,factory:n}=e,o=i.getClassName,r=n(s);return t.createElement("div",{className:o(g.FLEXLAYOUT__FLOATING_WINDOW_TAB)},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,r)))},H=e=>{const{layout:i,selected:s,node:n,path:o}=e,r=()=>{n.getWindow()&&n.getWindow().focus()},a=()=>{i.doAction(h.unFloatTab(n.getId()))},d=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},l=i.getClassName,_=n.getParent(),c=n._styleWithPosition();s||A(c,n.getModel().isUseVisibility()),_ instanceof v&&(void 0===n.getModel().getMaximizedTabset()||_.isMaximized()||A(c,n.getModel().isUseVisibility()));const u=i.i18nName(T.Floating_Window_Message),p=i.i18nName(T.Floating_Window_Show_Window),E=i.i18nName(T.Floating_Window_Dock_Window),m=i.getOnRenderFloatingTabPlaceholder();return m?t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),onMouseDown:d,onTouchStart:d,style:c},m(a,r)):t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":o,onMouseDown:d,onTouchStart:d,style:c},t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING_INNER)},t.createElement("div",null,u),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),r()}},p)),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a()}},E))))},X={width:"1em",height:"1em",display:"flex",alignItems:"center"},W=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),t.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),P={close:t.createElement(W,null),closeTabset:t.createElement(W,null),popout:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 20 20",fill:"var(--color-icon)"},t.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),t.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))),null),maximize:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))),null),restore:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))),null),more:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))),null)},k="undefined"!=typeof window&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),G="undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!k;class V extends t.Component{constructor(i){super(i),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=()=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model)},this.updateRect=(t=this.getDomRect())=>{const e=new s(0,0,t.width,t.height);e.equals(this.state.rect)||0===e.width||0===e.height||this.setState({rect:e})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const t=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:t})}if(this.findTabBarSizeRef.current){const t=this.findTabBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:t})}if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.getClassName=t=>void 0===this.props.classNameMapper?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(h.unFloatTab(t));try{this.props.model.getNodeById(t)._setWindow(void 0)}catch(t){}},this.onSetWindow=(t,e)=>{this.props.model.getNodeById(t)._setWindow(e)},this.onCancelAdd=()=>{var t,e;this.selfRef.current.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(e=null===(t=this.customDrop)||void 0===t?void 0:t.invalidated)||void 0===e||e.call(t)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=t=>{var e,i;if(t){const t=this.selfRef.current;try{t.removeChild(this.outlineDiv)}catch(t){}try{t.removeChild(this.dragDiv)}catch(t){}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(i=null===(e=this.customDrop)||void 0===e?void 0:e.invalidated)||void 0===i||i.call(e)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:r.CENTER})},this.onDragDivMouseDown=t=>{t.preventDefault(),this.dragStart(t,this.dragDivText,f._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(t,e,i,s,n,o)=>{s?(this.dragNode=i,this.dragDivText=e,d.instance.startDrag(t,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,n,o,this.currentDocument,this.selfRef.current)):d.instance.startDrag(t,void 0,void 0,void 0,void 0,n,o,this.currentDocument,this.selfRef.current)},this.dragRectRender=(e,i,s,n)=>{let o;if(void 0!==e?o=t.createElement("div",{style:{whiteSpace:"pre"}},e.replace("<br>","\n")):i&&i instanceof f&&(o=t.createElement(S,{node:i,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),void 0!==this.props.onRenderDragRect){const t=this.props.onRenderDragRect(o,i,s);void 0!==t&&(o=t)}this.dragDiv.style.visibility="hidden",this.dragRectRendered=!1,this.showPortal(t.createElement(J,{onRendered:()=>{this.dragRectRendered=!0,null==n||n()}},o),this.dragDiv)},this.showPortal=(t,i)=>{const s=(0,e.createPortal)(t,i);this.setState({portal:s})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{this.dropInfo=void 0,this.customDrop=void 0;const t=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(g.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",t.appendChild(this.outlineDiv),null==this.dragDiv&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),t.appendChild(this.dragDiv)),void 0===this.props.model.getMaximizedTabset()&&this.setState({showEdges:!0}),void 0!==this.dragNode&&this.dragNode instanceof f&&void 0!==this.dragNode.getTabRect()&&this.dragNode.getTabRect().positionElement(this.outlineDiv),this.firstMove=!0,!0},this.onDragMove=t=>{if(!1===this.firstMove){const t=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${t}s, left ${t}s, width ${t}s, height ${t}s`}this.firstMove=!1;const e=this.selfRef.current.getBoundingClientRect(),i={x:t.clientX-e.left,y:t.clientY-e.top};this.checkForBorderToShow(i.x,i.y);const s=this.dragDiv.getBoundingClientRect();let n=i.x-s.width/2;n+s.width>e.width&&(n=e.width-s.width),n=Math.max(0,n),this.dragDiv.style.left=n+"px",this.dragDiv.style.top=i.y+5+"px",this.dragRectRendered&&"hidden"===this.dragDiv.style.visibility&&(this.dragDiv.style.visibility="visible");let o=this.props.model._findDropTargetNode(this.dragNode,i.x,i.y);o&&(this.props.onTabDrag?this.handleCustomTabDrag(o,i,t):(this.dropInfo=o,this.outlineDiv.className=this.getClassName(o.className),o.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))},this.onDragEnd=t=>{const e=this.selfRef.current;if(e.removeChild(this.outlineDiv),e.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),d.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:t,dragging:e,over:i,x:s,y:n,location:o}=this.customDrop;t(e,i,s,n,o),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(t){console.error(t)}}else if(void 0!==this.newTabJson){const e=this.doAction(h.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(e,t),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else void 0!==this.dragNode&&this.doAction(h.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:r.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=t.createRef(),this.findHeaderBarSizeRef=t.createRef(),this.findTabBarSizeRef=t.createRef(),this.findBorderBarSizeRef=t.createRef(),this.supportsPopout=void 0!==i.supportsPopout?i.supportsPopout:G,this.popoutURL=i.popoutURL?i.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},P),i.icons),this.state={rect:new s(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:r.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(t){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(t.fontStyle=this.props.font.style),this.props.font.weight&&(t.fontWeight=this.props.font.weight)),t}doAction(t){if(void 0!==this.props.onAction){const e=this.props.onAction(t);return void 0!==e?this.props.model.doAction(e):void 0}return this.props.model.doAction(t)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver((t=>{this.updateRect(t[0].contentRect)})),this.resizeObserver.observe(this.selfRef.current)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var t;return null!==(t=this.props.realtimeResize)&&void 0!==t&&t}onTabDrag(...t){var e,i;return null===(i=(e=this.props).onTabDrag)||void 0===i?void 0:i.call(e,...t)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var t;null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.selfRef.current)}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const e=[],i=[],s=[],n={},o=[],r={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,r),this.renderBorder(this.props.model.getBorderSet(),e,n,s,o),this.renderChildren("",this.props.model.getRoot(),i,n,s,o);const a=[],d={};for(const t of this.tabIds)n[t]&&(a.push(t),d[t]=t);this.tabIds=a;for(const t of Object.keys(n))d[t]||this.tabIds.push(t);const l=[];if(this.state.showEdges){const e=this.centerRect,i=this.edgeRectLength,s=this.edgeRectWidth,n=this.edgeRectLength/2,o=this.getClassName(g.FLEXLAYOUT__EDGE_RECT),r=50;l.push(t.createElement("div",{key:"North",style:{top:e.y,left:e.x+e.width/2-n,width:i,height:s,borderBottomLeftRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"West",style:{top:e.y+e.height/2-n,left:e.x,width:s,height:i,borderTopRightRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"South",style:{top:e.y+e.height-s,left:e.x+e.width/2-n,width:i,height:s,borderTopLeftRadius:r,borderTopRightRadius:r},className:o})),l.push(t.createElement("div",{key:"East",style:{top:e.y+e.height/2-n,left:e.x+e.width-s,width:s,height:i,borderTopLeftRadius:r,borderBottomLeftRadius:r},className:o}))}return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},i,this.tabIds.map((t=>n[t])),e,o,l,s,this.metricsElements(),this.state.portal)}metricsElements(){const e=this.styleFont({visibility:"hidden"});return t.createElement(t.Fragment,null,t.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),t.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),t.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(e,i,s,n,o){for(const r of e.getBorders()){const e=`/border/${r.getLocation().getName()}`;if(r.isShowing()){i.push(t.createElement(C,{key:`border_${r.getLocation().getName()}`,path:e,border:r,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const a=r._getDrawChildren();let d=0,l=0;for(const i of a){if(i instanceof m){let s=e+"/s";o.push(t.createElement(M,{key:i.getId(),layout:this,node:i,path:s}))}else if(i instanceof f){let o=e+"/t"+l++;if(this.supportsPopout&&i.isFloating()){const e=this._getScreenRect(i);n.push(t.createElement(z,{key:i.getId(),url:this.popoutURL,rect:e,title:i.getName(),id:i.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:i,factory:this.props.factory}))),s[i.getId()]=t.createElement(H,{key:i.getId(),layout:this,path:o,node:i,selected:d===r.getSelected()})}else s[i.getId()]=t.createElement(U,{key:i.getId(),layout:this,path:o,node:i,selected:d===r.getSelected(),factory:this.props.factory})}d++}}}}renderChildren(e,s,n,o,r,a){const d=s._getDrawChildren();let l=0,h=0,_=0;for(const s of d)if(s instanceof m){const i=e+"/s"+l++;a.push(t.createElement(M,{key:s.getId(),layout:this,path:i,node:s}))}else if(s instanceof v){const i=e+"/ts"+_++;n.push(t.createElement(F,{key:s.getId(),layout:this,path:i,node:s,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(i,s,n,o,r,a)}else if(s instanceof f){const i=e+"/t"+h++,n=s.getParent().getChildren()[s.getParent().getSelected()];if(void 0===n&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&s.isFloating()){const e=this._getScreenRect(s);r.push(t.createElement(z,{key:s.getId(),url:this.popoutURL,rect:e,title:s.getName(),id:s.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:s,factory:this.props.factory}))),o[s.getId()]=t.createElement(H,{key:s.getId(),layout:this,path:i,node:s,selected:s===n})}else o[s.getId()]=t.createElement(U,{key:s.getId(),layout:this,path:i,node:s,selected:s===n,factory:this.props.factory})}else{const t=e+(s.getOrientation()===i.HORZ?"/r":"/c")+_++;this.renderChildren(t,s,n,o,r,a)}}_getScreenRect(t){const e=t.getRect().clone(),i=this.selfRef.current.getBoundingClientRect(),s=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),n=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return e.x=e.x+i.x+this.currentWindow.screenX+n,e.y=e.y+i.y+this.currentWindow.screenY+s,e}addTabToTabSet(t,e){void 0!==this.props.model.getNodeById(t)&&this.doAction(h.addNode(e,t,r.CENTER,-1))}addTabToActiveTabSet(t){const e=this.props.model.getActiveTabset();void 0!==e&&this.doAction(h.addNode(t,e.getId(),r.CENTER,-1))}addTabWithDragAndDrop(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,this.dragStart(void 0,t,f._fromJson(e,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(t,e){this.dragStart(void 0,e,t,!0,void 0,void 0)}addTabWithDragAndDropIndirect(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,d.instance.addGlass(this.onCancelAdd),this.dragDivText=t,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,(()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const t=this.dragDiv.getBoundingClientRect(),e=new s(0,0,null==t?void 0:t.width,null==t?void 0:t.height);e.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=e.x+"px",this.dragDiv.style.top=e.y+"px"}})),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(t,e,i){var n,o,r;let a=null===(n=this.customDrop)||void 0===n?void 0:n.invalidated;const l=null===(o=this.customDrop)||void 0===o?void 0:o.callback;this.customDrop=void 0;const h=this.newTabJson||(this.dragNode instanceof f?this.dragNode:void 0);if(h&&(t.node instanceof v||t.node instanceof y)&&-1===t.index){const n=t.node.getSelectedNode(),o=null==n?void 0:n.getRect();if(n&&(null==o?void 0:o.contains(e.x,e.y))){let r;try{const a=this.onTabDrag(h,n,e.x-o.x,e.y-o.y,t.location,(()=>this.onDragMove(i)));a&&(r={rect:new s(a.x+o.x,a.y+o.y,a.width,a.height),callback:a.callback,invalidated:a.invalidated,dragging:h,over:n,x:e.x-o.x,y:e.y-o.y,location:t.location,cursor:a.cursor})}catch(t){console.error(t)}(null==r?void 0:r.callback)===l&&(a=void 0),this.customDrop=r}}this.dropInfo=t,this.outlineDiv.className=this.getClassName(this.customDrop?g.FLEXLAYOUT__OUTLINE_RECT:t.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):t.rect.positionElement(this.outlineDiv),d.instance.setGlassCursorOverride(null===(r=this.customDrop)||void 0===r?void 0:r.cursor),this.outlineDiv.style.visibility="visible";try{null==a||a()}catch(t){console.error(t)}}onDragEnter(t){if(d.instance.isDragging())return;const e=this.props.onExternalDrag(t);e&&(this.fnNewNodeDropped=e.onDrop,this.newTabJson=e.json,this.dragStart(t,e.dragText,f._fromJson(e.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(t,e){const i=this.props.model._getOuterInnerRects().outer,s=i.getCenter(),n=this.edgeRectWidth,o=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===r.CENTER&&(e>s.y-o&&e<s.y+o||t>s.x-o&&t<s.x+o)&&(a=!0);let d=r.CENTER;a||(t<=i.x+n?d=r.LEFT:t>=i.getRight()-n?d=r.RIGHT:e<=i.y+n?d=r.TOP:e>=i.getBottom()-n&&(d=r.BOTTOM)),d!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:d})}maximize(t){this.doAction(h.maximizeToggle(t.getId()))}customizeTab(t,e){this.props.onRenderTab&&this.props.onRenderTab(t,e)}customizeTabSet(t,e){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,e)}i18nName(t,e){let i;return this.props.i18nMapper&&(i=this.props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(t,e){this.props.onContextMenu&&this.props.onContextMenu(t,e)}auxMouseClick(t,e){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,e)}}const J=e=>(t.useEffect((()=>{var t;null===(t=e.onRendered)||void 0===t||t.call(e)}),[e]),t.createElement(t.Fragment,null,e.children));class Z{constructor(t){this._model=t,this._borders=[]}static _fromJson(t,e){const i=new Z(e);return i._borders=t.map((t=>y._fromJson(t,e))),i}getBorders(){return this._borders}_forEachNode(t){for(const e of this._borders){t(e,0);for(const i of e.getChildren())i._forEachNode(t,1)}}_toJson(){return this._borders.map((t=>t.toJson()))}_layoutBorder(t,e){const s=t.outer,n=this._model.getRoot();let o=Math.max(0,s.height-n.getMinHeight()),r=Math.max(0,s.width-n.getMinWidth()),a=0,d=0,l=0,h=0;const _=this._borders.filter((t=>t.isShowing()));for(const t of _){t._setAdjustedSize(t.getSize());const e=-1!==t.getSelected();t.getLocation().getOrientation()===i.HORZ?(d+=t.getBorderBarSize(),e&&(r-=this._model.getSplitterSize(),d+=t.getSize(),h+=t.getSize())):(a+=t.getBorderBarSize(),e&&(o-=this._model.getSplitterSize(),a+=t.getSize(),l+=t.getSize()))}let c=0,u=!1;for(;d>r&&h>0||a>o&&l>0;){const t=_[c];if(-1!==t.getSelected()){const e=t._getAdjustedSize();d>r&&h>0&&t.getLocation().getOrientation()===i.HORZ&&e>0&&e>t.getMinSize()?(t._setAdjustedSize(e-1),d--,h--,u=!0):a>o&&l>0&&t.getLocation().getOrientation()===i.VERT&&e>0&&e>t.getMinSize()&&(t._setAdjustedSize(e-1),a--,l--,u=!0)}if(c=(c+1)%_.length,0===c){if(!u)break;u=!1}}for(const i of _)t.outer=i._layoutBorderOuter(t.outer,e);t.inner=t.outer;for(const i of _)t.inner=i._layoutBorderInner(t.inner,e);return t}_findDropTargetNode(t,e,i){for(const s of this._borders)if(s.isShowing()){const n=s.canDrop(t,e,i);if(void 0!==n)return n}}}var j,q=new Uint8Array(16);function $(){if(!j&&!(j="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return j(q)}const K=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Q=function(t){return"string"==typeof t&&K.test(t)};for(var tt=[],et=0;et<256;++et)tt.push((et+256).toString(16).substr(1));const it=function(t,e,i){var s=(t=t||{}).random||(t.rng||$)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){i=i||0;for(var n=0;n<16;++n)e[i+n]=s[n];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(tt[t[e+0]]+tt[t[e+1]]+tt[t[e+2]]+tt[t[e+3]]+"-"+tt[t[e+4]]+tt[t[e+5]]+"-"+tt[t[e+6]]+tt[t[e+7]]+"-"+tt[t[e+8]]+tt[t[e+9]]+"-"+tt[t[e+10]]+tt[t[e+11]]+tt[t[e+12]]+tt[t[e+13]]+tt[t[e+14]]+tt[t[e+15]]).toLowerCase();if(!Q(i))throw TypeError("Stringified UUID is invalid");return i}(s)};class st{constructor(){this._borderRects={inner:s.empty(),outer:s.empty()},this._attributes={},this._idMap={},this._borders=new Z(this),this._pointerFine=!0,this._showHiddenBorder=r.CENTER}static fromJson(t){const e=new st;return st._attributeDefinitions.fromJson(t.global,e._attributes),t.borders&&(e._borders=Z._fromJson(t.borders,e)),e._root=b._fromJson(t.layout,e),e._tidy(),e}static _createAttributeDefinitions(){const t=new c;return t.add("legacyOverflowMenu",!1).setType(_.BOOLEAN),t.add("splitterSize",-1).setType(_.NUMBER),t.add("splitterExtra",0).setType(_.NUMBER),t.add("enableEdgeDock",!0).setType(_.BOOLEAN),t.add("rootOrientationVertical",!1).setType(_.BOOLEAN),t.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("enableUseVisibility",!1).setType(_.BOOLEAN),t.add("tabEnableClose",!0).setType(_.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnableFloat",!1).setType(_.BOOLEAN),t.add("tabEnableDrag",!0).setType(_.BOOLEAN),t.add("tabEnableRename",!0).setType(_.BOOLEAN),t.add("tabClassName",void 0).setType(_.STRING),t.add("tabIcon",void 0).setType(_.STRING),t.add("tabEnableRenderOnDemand",!0).setType(_.BOOLEAN),t.add("tabDragSpeed",.3).setType(_.NUMBER),t.add("tabBorderWidth",-1).setType(_.NUMBER),t.add("tabBorderHeight",-1).setType(_.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(_.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(_.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(_.BOOLEAN),t.add("tabSetEnableClose",!1).setType(_.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(_.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(_.STRING),t.add("tabSetClassNameHeader",void 0).setType(_.STRING),t.add("tabSetEnableTabStrip",!0).setType(_.BOOLEAN),t.add("tabSetHeaderHeight",0).setType(_.NUMBER),t.add("tabSetTabStripHeight",0).setType(_.NUMBER),t.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabSetMinWidth",0).setType(_.NUMBER),t.add("tabSetMinHeight",0).setType(_.NUMBER),t.add("borderSize",200).setType(_.NUMBER),t.add("borderMinSize",0).setType(_.NUMBER),t.add("borderBarSize",0).setType(_.NUMBER),t.add("borderEnableDrop",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(_.BOOLEAN),t.add("borderClassName",void 0).setType(_.STRING),t.add("borderEnableAutoHide",!1).setType(_.BOOLEAN),t}_setChangeListener(t){this._changeListener=t}getActiveTabset(){return this._activeTabSet&&this.getNodeById(this._activeTabSet.getId())?this._activeTabSet:void 0}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(t){this._showHiddenBorder=t}_setActiveTabset(t){this._activeTabSet=t}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(t){this._maximizedTabSet=t}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(t){this._pointerFine=t}visitNodes(t){this._borders._forEachNode(t),this._root._forEachNode(t,0)}getNodeById(t){return this._idMap[t]}doAction(t){let e;switch(t.type){case h.ADD_NODE:{const i=new f(this,t.data.json,!0),s=this._idMap[t.data.toNode];(s instanceof v||s instanceof y||s instanceof b)&&(s.drop(i,r.getByName(t.data.location),t.data.index,t.data.select),e=i);break}case h.MOVE_NODE:{const e=this._idMap[t.data.fromNode];if(e instanceof f||e instanceof v){const i=this._idMap[t.data.toNode];(i instanceof v||i instanceof y||i instanceof b)&&i.drop(e,r.getByName(t.data.location),t.data.index,t.data.select)}break}case h.DELETE_TAB:{const e=this._idMap[t.data.node];e instanceof f&&e._delete();break}case h.DELETE_TABSET:{const e=this._idMap[t.data.node];if(e instanceof v){const t=[...e.getChildren()];for(let e=0;e<t.length;e++){const i=t[e];i.isEnableClose()&&i._delete()}0===e.getChildren().length&&e._delete(),this._tidy()}break}case h.FLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof f&&(e._setFloating(!0),function(t){const e=t.getParent();if(null!==e)if(e instanceof v){let i=!1,s=0;const n=e.getChildren();for(let e=0;e<n.length;e++){const o=n[e];if(o===t)i=!0;else if(!o.isFloating()&&(s=e,i))break}e._setSelected(s)}else e instanceof y&&e._setSelected(-1)}(e));break}case h.UNFLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof f&&(e._setFloating(!1),function(t){const e=t.getParent();if(null!==e&&(e instanceof v||e instanceof y)){const i=e.getChildren();for(let s=0;s<i.length;s++)if(i[s]===t)return void e._setSelected(s)}}(e));break}case h.RENAME_TAB:{const e=this._idMap[t.data.node];e instanceof f&&e._setName(t.data.text);break}case h.SELECT_TAB:{const e=this._idMap[t.data.tabNode];if(e instanceof f){const t=e.getParent(),i=t.getChildren().indexOf(e);t instanceof y?t.getSelected()===i?t._setSelected(-1):t._setSelected(i):t instanceof v&&(t.getSelected()!==i&&t._setSelected(i),this._activeTabSet=t)}break}case h.SET_ACTIVE_TABSET:{const e=this._idMap[t.data.tabsetNode];e instanceof v&&(this._activeTabSet=e);break}case h.ADJUST_SPLIT:{const e=this._idMap[t.data.node1],i=this._idMap[t.data.node2];(e instanceof v||e instanceof b)&&(i instanceof v||i instanceof b)&&(this._adjustSplitSide(e,t.data.weight1,t.data.pixelWidth1),this._adjustSplitSide(i,t.data.weight2,t.data.pixelWidth2));break}case h.ADJUST_BORDER_SPLIT:{const e=this._idMap[t.data.node];e instanceof y&&e._setSize(t.data.pos);break}case h.MAXIMIZE_TOGGLE:{const e=this._idMap[t.data.node];e instanceof v&&(e===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=e,this._activeTabSet=e));break}case h.UPDATE_MODEL_ATTRIBUTES:this._updateAttrs(t.data.json);break;case h.UPDATE_NODE_ATTRIBUTES:this._idMap[t.data.node]._updateAttrs(t.data.json)}return this._updateIdMap(),void 0!==this._changeListener&&this._changeListener(),e}_updateIdMap(){this._idMap={},this.visitNodes((t=>this._idMap[t.getId()]=t))}_adjustSplitSide(t,e,s){t._setWeight(e),null!=t.getWidth()&&t.getOrientation()===i.VERT?t._updateAttrs({width:s}):null!=t.getHeight()&&t.getOrientation()===i.HORZ&&t._updateAttrs({height:s})}toJson(){const t={};return st._attributeDefinitions.toJson(t,this._attributes),this.visitNodes((t=>{t._fireEvent("save",void 0)})),{global:t,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let t=this._attributes.splitterSize;return-1===t&&(t=this._pointerFine?8:12),t}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(t){const e=t.getId();if(void 0!==this._idMap[e])throw new Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);"splitter"!==t.getType()&&(this._idMap[e]=t)}_layout(t,e){var i;return this._borderRects=this._borders._layoutBorder({outer:t,inner:t},e),t=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),null===(i=this._root)||void 0===i||i.calcMinSize(),this._root._layout(t,e),t}_findDropTargetNode(t,e,i){let s=this._root._findDropTargetNode(t,e,i);return void 0===s&&(s=this._borders._findDropTargetNode(t,e,i)),s}_tidy(){this._root._tidy()}_updateAttrs(t){st._attributeDefinitions.update(t,this._attributes)}_nextUniqueId(){return"#"+it()}_getAttribute(t){return this._attributes[t]}setOnAllowDrop(t){this._onAllowDrop=t}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(t){this._onCreateTabSet=t}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(st._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(b.getAttributeDefinitions().toTypescriptInterface("Row",st._attributeDefinitions)),console.log(v.getAttributeDefinitions().toTypescriptInterface("TabSet",st._attributeDefinitions)),console.log(f.getAttributeDefinitions().toTypescriptInterface("Tab",st._attributeDefinitions)),console.log(y.getAttributeDefinitions().toTypescriptInterface("Border",st._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}st._attributeDefinitions=st._createAttributeDefinitions()})(),o})()));