text: (self.webpackChunkorchardcore_apis_graphql=self.webpackChunkorchardcore_apis_graphql||[]).push([[292],{5292:(e,o,n)=>{!function(e){function o(o,n,t){var i,r=o.getWrapperElement();return(i=r.appendChild(document.createElement("div"))).className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(r,"dialog-opened"),i}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)d.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 s,d=u.getElementsByTagName("input")[0];return d?(d.focus(),r.value&&(d.value=r.value,!1!==r.selectValueOnOpen&&d.select()),r.onInput&&e.on(d,"input",(function(e){r.onInput(e,d.value,c)})),r.onKeyUp&&e.on(d,"keyup",(function(e){r.onKeyUp(e,d.value,c)})),e.on(d,"keydown",(function(o){r&&r.onKeyDown&&r.onKeyDown(o,d.value,c)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(d.blur(),e.e_stop(o),c()),13==o.keyCode&&i(d.value,o))})),!1!==r.closeOnBlur&&e.on(u,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(s=u.getElementsByTagName("button")[0])&&(e.on(s,"click",(function(){c(),l.focus()})),!1!==r.closeOnBlur&&e.on(s,"blur",c),s.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,s=1;function d(){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),d(),o&&o(c)}))}(i[f]),e.on(p,"blur",(function(){--s,setTimeout((function(){s<=0&&d()}),200)})),e.on(p,"focus",(function(){++s}))}})),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}))}(n(4631))}}]);