import{c as b,h as O}from"./codemirror.es2-5884f31a.js";var T=Object.defineProperty,g=(p,m)=>T(p,"name",{value:m,configurable:!0});function C(p,m){for(var o=0;o<m.length;o++){const c=m[o];if(typeof c!="string"&&!Array.isArray(c)){for(const s in c)if(s!=="default"&&!(s in p)){const u=Object.getOwnPropertyDescriptor(c,s);u&&Object.defineProperty(p,s,u.get?u:{enumerable:!0,get:()=>c[s]})}}}return Object.freeze(Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}))}g(C,"_mergeNamespaces");var k={exports:{}};(function(p,m){(function(o){o(b())})(function(o){function c(u,l,e){var r=u.getWrapperElement(),a;return a=r.appendChild(document.createElement("div")),e?a.className="CodeMirror-dialog CodeMirror-dialog-bottom":a.className="CodeMirror-dialog CodeMirror-dialog-top",typeof l=="string"?a.innerHTML=l:a.appendChild(l),o.addClass(r,"dialog-opened"),a}g(c,"dialogDiv");function s(u,l){u.state.currentNotificationClose&&u.state.currentNotificationClose(),u.state.currentNotificationClose=l}g(s,"closeNotification"),o.defineExtension("openDialog",function(u,l,e){e||(e={}),s(this,null);var r=c(this,u,e.bottom),a=!1,f=this;function i(t){if(typeof t=="string")n.value=t;else{if(a)return;a=!0,o.rmClass(r.parentNode,"dialog-opened"),r.parentNode.removeChild(r),f.focus(),e.onClose&&e.onClose(r)}}g(i,"close");var n=r.getElementsByTagName("input")[0],d;return n?(n.focus(),e.value&&(n.value=e.value,e.selectValueOnOpen!==!1&&n.select()),e.onInput&&o.on(n,"input",function(t){e.onInput(t,n.value,i)}),e.onKeyUp&&o.on(n,"keyup",function(t){e.onKeyUp(t,n.value,i)}),o.on(n,"keydown",function(t){e&&e.onKeyDown&&e.onKeyDown(t,n.value,i)||((t.keyCode==27||e.closeOnEnter!==!1&&t.keyCode==13)&&(n.blur(),o.e_stop(t),i()),t.keyCode==13&&l(n.value,t))}),e.closeOnBlur!==!1&&o.on(r,"focusout",function(t){t.relatedTarget!==null&&i()})):(d=r.getElementsByTagName("button")[0])&&(o.on(d,"click",function(){i(),f.focus()}),e.closeOnBlur!==!1&&o.on(d,"blur",i),d.focus()),i}),o.defineExtension("openConfirm",function(u,l,e){s(this,null);var r=c(this,u,e&&e.bottom),a=r.getElementsByTagName("button"),f=!1,i=this,n=1;function d(){f||(f=!0,o.rmClass(r.parentNode,"dialog-opened"),r.parentNode.removeChild(r),i.focus())}g(d,"close"),a[0].focus();for(var t=0;t<a.length;++t){var v=a[t];(function(y){o.on(v,"click",function(N){o.e_preventDefault(N),d(),y&&y(i)})})(l[t]),o.on(v,"blur",function(){--n,setTimeout(function(){n<=0&&d()},200)}),o.on(v,"focus",function(){++n})}}),o.defineExtension("openNotification",function(u,l){s(this,i);var e=c(this,u,l&&l.bottom),r=!1,a,f=l&&typeof l.duration<"u"?l.duration:5e3;function i(){r||(r=!0,clearTimeout(a),o.rmClass(e.parentNode,"dialog-opened"),e.parentNode.removeChild(e))}return g(i,"close"),o.on(e,"click",function(n){o.e_preventDefault(n),i()}),f&&(a=setTimeout(i,f)),i})})})();var h=k.exports;const E=O(h),x=C({__proto__:null,default:E},[h]);export{h as a,x as d};
