Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/dialog/dialog",["module","exports","require","../../lib/codemirror"],(function(e,o,n){window,function(e){function o(o,n,t){var i=o.getWrapperElement(),r=i.appendChild(document.createElement("div"));return r.className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?r.innerHTML=n:r.appendChild(n),e.addClass(i,"dialog-opened"),r}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",(function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),a=!1,l=this;function c(o){if("string"==typeof o)s.value=o;else{if(a)return;a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),l.focus(),r.onClose&&r.onClose(u)}}var d,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",(function(e){r.onInput(e,s.value,c)})),r.onKeyUp&&e.on(s,"keyup",(function(e){r.onKeyUp(e,s.value,c)})),e.on(s,"keydown",(function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,c)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),c()),13==o.keyCode&&i(s.value,o))})),!1!==r.closeOnBlur&&e.on(u,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(d=u.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),l.focus()})),!1!==r.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),a=u.getElementsByTagName("button"),l=!1,c=this,d=1;function s(){l||(l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),c.focus())}a[0].focus();for(var f=0;f<a.length;++f){var p=a[f];!function(o){e.on(p,"click",(function(n){e.e_preventDefault(n),s(),o&&o(c)}))}(i[f]),e.on(p,"blur",(function(){--d,setTimeout((function(){d<=0&&s()}),200)})),e.on(p,"focus",(function(){++d}))}})),e.defineExtension("openNotification",(function(t,i){n(this,c);var r,u=o(this,t,i&&i.bottom),a=!1,l=i&&void 0!==i.duration?i.duration:5e3;function c(){a||(a=!0,clearTimeout(r),e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u))}return e.on(u,"click",(function(o){e.e_preventDefault(o),c()})),l&&(r=setTimeout(c,l)),c}))}("object"==typeof o&&"object"==typeof e?n("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=dialog.js.map