var U=(a,h)=>()=>(h||a((h={exports:{}}).exports,h),h.exports);var W=U(q=>{/*! taboverride v4.0.3 | https://github.com/wjbryant/taboverride
(c) 2015 Bill Bryant | http://opensource.org/licenses/mit */(function(a){"use strict";var h;typeof q=="object"?a(q):typeof define=="function"&&define.amd?define(["exports"],a):(h=window.tabOverride={},a(h))})(function(a){"use strict";function h(e,i){var r,t,n,d=["alt","ctrl","meta","shift"],o=e.length,c=!0;for(r=0;o>r;r+=1)if(!i[e[r]]){c=!1;break}if(c)for(r=0;r<d.length;r+=1){if(n=d[r]+"Key",i[n])if(o){for(c=!1,t=0;o>t;t+=1)if(n===e[t]){c=!0;break}}else c=!1;if(!c)break}return c}function N(e,i){return e===b&&h(J,i)}function j(e,i){return e===k&&h(Q,i)}function B(e,i){return function(r,t){var n,d="";if(arguments.length){if(typeof r=="number"&&(e(r),i.length=0,t&&t.length))for(n=0;n<t.length;n+=1)i.push(t[n]+"Key");return this}for(n=0;n<i.length;n+=1)d+=i[n].slice(0,-3)+"+";return d+e()}}function F(e){e=e||event;var i,r,t,n,d,o,c,f,l,u,m,g,v,y,K,L,D,R,s=e.currentTarget||e.srcElement,p=e.keyCode,S="character";if((!s.nodeName||s.nodeName.toLowerCase()==="textarea")&&(p===b||p===k||p===13&&w)){if(A=!1,t=s.value,f=s.scrollTop,typeof s.selectionStart=="number")l=s.selectionStart,u=s.selectionEnd,m=t.slice(l,u);else{if(!x.selection)return;n=x.selection.createRange(),m=n.text,d=n.duplicate(),d.moveToElementText(s),d.setEndPoint("EndToEnd",n),u=d.text.length,l=u-m.length,V>1?(o=t.slice(0,l).split(O).length-1,c=m.split(O).length-1):o=c=0}if(p===b||p===k)if(i=E,r=i.length,y=0,K=0,L=0,l!==u&&m.indexOf(`
`)!==-1)if(g=l===0||t.charAt(l-1)===`
`?l:t.lastIndexOf(`
`,l-1)+1,u===t.length||t.charAt(u)===`
`?v=u:t.charAt(u-1)===`
`?v=u-1:(v=t.indexOf(`
`,u),v===-1&&(v=t.length)),N(p,e))y=1,s.value=t.slice(0,g)+i+t.slice(g,v).replace(/\n/g,function(){return y+=1,`
`+i})+t.slice(v),n?(n.collapse(),n.moveEnd(S,u+y*r-c-o),n.moveStart(S,l+r-o),n.select()):(s.selectionStart=l+r,s.selectionEnd=u+y*r,s.scrollTop=f);else{if(!j(p,e))return;t.slice(g).indexOf(i)===0&&(g===l?m=m.slice(r):L=r,K=r),s.value=t.slice(0,g)+t.slice(g+L,l)+m.replace(new RegExp(`
`+i,"g"),function(){return y+=1,`
`})+t.slice(u),n?(n.collapse(),n.moveEnd(S,u-K-y*r-c-o),n.moveStart(S,l-L-o),n.select()):(s.selectionStart=l-L,s.selectionEnd=u-K-y*r)}else if(N(p,e))n?(n.text=i,n.select()):(s.value=t.slice(0,l)+i+t.slice(u),s.selectionEnd=s.selectionStart=l+r,s.scrollTop=f);else{if(!j(p,e))return;t.slice(l-r).indexOf(i)===0&&(s.value=t.slice(0,l-r)+t.slice(l),n?(n.move(S,l-r-o),n.select()):(s.selectionEnd=s.selectionStart=l-r,s.scrollTop=f))}else if(w){if(l===0||t.charAt(l-1)===`
`||(g=t.lastIndexOf(`
`,l-1)+1,v=t.indexOf(`
`,l),v===-1&&(v=t.length),D=t.slice(g,v).match(/^[ \t]*/)[0],R=D.length,g+R>l))return void(A=!0);n?(n.text=`
`+D,n.select()):(s.value=t.slice(0,l)+`
`+D+t.slice(u),s.selectionEnd=s.selectionStart=l+V+R,s.scrollTop=f)}return e.preventDefault?void e.preventDefault():(e.returnValue=!1,!1)}}function M(e){e=e||event;var i=e.keyCode;if(N(i,e)||j(i,e)||i===13&&w&&!A){if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}function T(e,i){var r,t=C[e]||[],n=t.length;for(r=0;n>r;r+=1)t[r].apply(null,i)}function P(e){function i(o){for(r=0;d>r;r+=1)o(e[r].type,e[r].handler)}var r,t,n,d=e.length;return x.addEventListener?(t=function(o){i(function(c,f){o.removeEventListener(c,f,!1)})},n=function(o){t(o),i(function(c,f){o.addEventListener(c,f,!1)})}):x.attachEvent&&(t=function(o){i(function(c,f){o.detachEvent("on"+c,f)})},n=function(o){t(o),i(function(c,f){o.attachEvent("on"+c,f)})}),{add:n,remove:t}}function G(e){T("addListeners",[e]),I.add(e)}function H(e){T("removeListeners",[e]),I.remove(e)}var I,O,V,x=window.document,E="	",b=9,k=9,J=[],Q=["shiftKey"],w=!0,A=!1,z=x.createElement("textarea"),C={};I=P([{type:"keydown",handler:F},{type:"keypress",handler:M}]),z.value=`
`,O=z.value,V=O.length,z=null,a.utils={executeExtensions:T,isValidModifierKeyCombo:h,createListeners:P,addListeners:G,removeListeners:H},a.handlers={keydown:F,keypress:M},a.addExtension=function(e,i){return e&&typeof e=="string"&&typeof i=="function"&&(C[e]||(C[e]=[]),C[e].push(i)),this},a.set=function(e,i){var r,t,n,d,o,c,f;if(e)for(r=arguments.length<2||i,t=e,n=t.length,typeof n!="number"&&(t=[t],n=1),r?(d=G,o="true"):(d=H,o=""),c=0;n>c;c+=1)f=t[c],f&&f.nodeName&&f.nodeName.toLowerCase()==="textarea"&&(T("set",[f,r]),f.setAttribute("data-taboverride-enabled",o),d(f));return this},a.tabSize=function(e){var i;if(arguments.length){if(e&&typeof e=="number"&&e>0)for(E="",i=0;e>i;i+=1)E+=" ";else E="	";return this}return E==="	"?0:E.length},a.autoIndent=function(e){return arguments.length?(w=!!e,this):w},a.tabKey=B(function(e){return arguments.length?void(b=e):b},J),a.untabKey=B(function(e){return arguments.length?void(k=e):k},Q)})});export default W();
