Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/display/placeholder",["module","exports","require","../../lib/codemirror"],(function(e,o,t){window,function(e){function o(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function t(e){o(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.style.direction=e.getOption("direction"),t.className="CodeMirror-placeholder CodeMirror-line-like";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),t.appendChild(r),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function r(e){n(e)&&t(e)}function i(e){var r=e.getWrapperElement(),i=n(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?t(e):o(e)}function n(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(n,l,a){var c=a&&a!=e.Init;if(l&&!c)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),e.on(n.getInputField(),"compositionupdate",n.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1;if(1==e.lineCount()){var i=e.getInputField();r="TEXTAREA"==i.nodeName?!e.getLine(0).length:!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)}r?t(e):o(e)}),20)}(n)}),i(n);else if(!l&&c){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),e.off(n.getInputField(),"compositionupdate",n.state.placeholderCompose),o(n);var p=n.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}l&&!n.hasFocus()&&r(n)}))}("object"==typeof o&&"object"==typeof e?t("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=placeholder.js.map