Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/display/panel",["module","exports","require","../../lib/codemirror"],(function(e,t,i){window,function(e){function t(e,t,i,r){this.cm=e,this.node=t,this.options=i,this.height=r,this.cleared=!1}function i(e,t){for(var i=t.nextSibling;i;i=i.nextSibling)if(i==e.getWrapperElement())return!0;return!1}e.defineExtension("addPanel",(function(e,r){r=r||{},this.state.panels||function(e){var t=e.getWrapperElement(),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(i.height),n=e.state.panels={setHeight:t.style.height,panels:[],wrapper:document.createElement("div")},o=e.hasFocus(),s=e.getScrollInfo();t.parentNode.insertBefore(n.wrapper,t),n.wrapper.appendChild(t),e.scrollTo(s.left,s.top),o&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,i){if(i||(i=n.wrapper.offsetHeight),n.setHeight=i,"number"!=typeof i){var o=/^(\d+\.?\d*)px$/.exec(i);o?i=Number(o[1]):(n.wrapper.style.height=i,i=n.wrapper.offsetHeight)}var s=i-n.panels.map((function(e){return e.node.getBoundingClientRect().height})).reduce((function(e,t){return e+t}),0);e._setSize(t,s),r=i})}(this);var n=this.state.panels,o=n.wrapper,s=this.getWrapperElement(),l=r.replace instanceof t&&!r.replace.cleared;r.after instanceof t&&!r.after.cleared?o.insertBefore(e,r.before.node.nextSibling):r.before instanceof t&&!r.before.cleared?o.insertBefore(e,r.before.node):l?(o.insertBefore(e,r.replace.node),r.replace.clear(!0)):"bottom"==r.position?o.appendChild(e):"before-bottom"==r.position?o.insertBefore(e,s.nextSibling):"after-top"==r.position?o.insertBefore(e,s):o.insertBefore(e,o.firstChild);var a=r&&r.height||e.offsetHeight,p=new t(this,e,r,a);return n.panels.push(p),this.setSize(),r.stable&&i(this,e)&&this.scrollTo(null,this.getScrollInfo().top+a),p})),t.prototype.clear=function(e){if(!this.cleared){this.cleared=!0;var t=this.cm.state.panels;t.panels.splice(t.panels.indexOf(this),1),this.cm.setSize(),this.options.stable&&i(this.cm,this.node)&&this.cm.scrollTo(null,this.cm.getScrollInfo().top-this.height),t.wrapper.removeChild(this.node),0!=t.panels.length||e||function(e){var t=e.state.panels;e.state.panels=null;var i=e.getWrapperElement(),r=e.hasFocus(),n=e.getScrollInfo();t.wrapper.parentNode.replaceChild(i,t.wrapper),e.scrollTo(n.left,n.top),r&&e.focus(),i.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}(this.cm)}},t.prototype.changed=function(){this.height=this.node.getBoundingClientRect().height,this.cm.setSize()}}("object"==typeof t&&"object"==typeof e?i("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=panel.js.map