var Ae=Object.defineProperty,pe=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var ue=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var z=(e,t,E)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:E}):e[t]=E,j=(e,t)=>{for(var E in t||(t={}))ue.call(t,E)&&z(e,E,t[E]);if(X)for(var E of X(t))me.call(t,E)&&z(e,E,t[E]);return e},$=(e,t)=>pe(e,Le(t));import{A as m}from"./Api.a196f191.js";import{_ as he}from"./codemirror.415b9f22.js";import{a1 as Me,a2 as y,a3 as Ue,a4 as fe,a5 as ge,a6 as ee,a7 as b,a8 as De,a9 as Pe,aa as ke,ab as Fe,ac as ye,ad as be,ae as We,af as ve,ag as Ge,ah as Ke,ai as Be,aj as Ve,ak as He,x as Je,r as we,a as Ye,y as Qe,o as xe,t as _e,s as Ze,p as qe,d as Xe,e as M,f as U,h as f,i as u,F as W,E as v,q as ze,k as G}from"./vendor.42638b6b.js";import{n as F}from"./assert.dbc0392f.js";import"./index.99723322.js";const g={dbs:m.create("/dbs","get"),tableMetadata:m.create("/dbs/{id}/t-metadata","get"),columnMetadata:m.create("/dbs/{id}/c-metadata","get"),hintTables:m.create("/dbs/{id}/hint-tables","get"),selectData:m.create("/dbs/{id}/select","get"),saveSql:m.create("/dbs/{id}/sql","post"),getSql:m.create("/dbs/{id}/sql","get"),lsFile:m.create("/devops/machines/files/{fileId}/ls","get"),rmFile:m.create("/devops/machines/files/{fileId}/rm","delete"),uploadFile:m.create("/devops/machines/files/upload","post"),fileContent:m.create("/devops/machines/files/{fileId}/cat","get"),updateFileContent:m.create("/devops/machines/files/{id}","put"),addConf:m.create("/devops/machines/{machineId}/files","post"),delConf:m.create("/devops/machines/files/{id}","delete")};var pE=`/* ambiance theme for codemirror */

/* Color scheme */

.cm-s-ambiance .cm-header { color: blue; }
.cm-s-ambiance .cm-quote { color: #24C2C7; }

.cm-s-ambiance .cm-keyword { color: #cda869; }
.cm-s-ambiance .cm-atom { color: #CF7EA9; }
.cm-s-ambiance .cm-number { color: #78CF8A; }
.cm-s-ambiance .cm-def { color: #aac6e3; }
.cm-s-ambiance .cm-variable { color: #ffb795; }
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
.cm-s-ambiance .cm-variable-3, .cm-s-ambiance .cm-type { color: #faded3; }
.cm-s-ambiance .cm-property { color: #eed1b3; }
.cm-s-ambiance .cm-operator { color: #fa8d6a; }
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
.cm-s-ambiance .cm-string { color: #8f9d6a; }
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
.cm-s-ambiance .cm-meta { color: #D2A8A1; }
.cm-s-ambiance .cm-qualifier { color: yellow; }
.cm-s-ambiance .cm-builtin { color: #9999cc; }
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
.cm-s-ambiance .cm-tag { color: #fee4ff; }
.cm-s-ambiance .cm-attribute { color: #9B859D; }
.cm-s-ambiance .cm-hr { color: pink; }
.cm-s-ambiance .cm-link { color: #F4C20B; }
.cm-s-ambiance .cm-special { color: #FF9D00; }
.cm-s-ambiance .cm-error { color: #AF2018; }

.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }

.cm-s-ambiance div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
.cm-s-ambiance .CodeMirror-line::selection, .cm-s-ambiance .CodeMirror-line > span::selection, .cm-s-ambiance .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-ambiance .CodeMirror-line::-moz-selection, .cm-s-ambiance .CodeMirror-line > span::-moz-selection, .cm-s-ambiance .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }

/* Editor styling */

.cm-s-ambiance.CodeMirror {
  line-height: 1.40em;
  color: #E6E1DC;
  background-color: #202020;
  -webkit-box-shadow: inset 0 0 10px black;
  -moz-box-shadow: inset 0 0 10px black;
  box-shadow: inset 0 0 10px black;
}

.cm-s-ambiance .CodeMirror-gutters {
  background: #3D3D3D;
  border-right: 1px solid #4D4D4D;
  box-shadow: 0 10px 20px black;
}

.cm-s-ambiance .CodeMirror-linenumber {
  text-shadow: 0px 1px 1px #4d4d4d;
  color: #111;
  padding: 0 5px;
}

.cm-s-ambiance .CodeMirror-guttermarker { color: #aaa; }
.cm-s-ambiance .CodeMirror-guttermarker-subtle { color: #111; }

.cm-s-ambiance .CodeMirror-cursor { border-left: 1px solid #7991E8; }

.cm-s-ambiance .CodeMirror-activeline-background {
  background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);
}

.cm-s-ambiance.CodeMirror,
.cm-s-ambiance .CodeMirror-gutters {
  background-image: url("data:image/png;base64, ");
}
`,LE=`/*

    Name:       Base16 Default Light
    Author:     Chris Kempson (http://chriskempson.com)

    CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
    Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

.cm-s-base16-light.CodeMirror { background: #f5f5f5; color: #202020; }
.cm-s-base16-light div.CodeMirror-selected { background: #e0e0e0; }
.cm-s-base16-light .CodeMirror-line::selection, .cm-s-base16-light .CodeMirror-line > span::selection, .cm-s-base16-light .CodeMirror-line > span > span::selection { background: #e0e0e0; }
.cm-s-base16-light .CodeMirror-line::-moz-selection, .cm-s-base16-light .CodeMirror-line > span::-moz-selection, .cm-s-base16-light .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; }
.cm-s-base16-light .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; }
.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; }
.cm-s-base16-light .CodeMirror-linenumber { color: #b0b0b0; }
.cm-s-base16-light .CodeMirror-cursor { border-left: 1px solid #505050; }

.cm-s-base16-light span.cm-comment { color: #8f5536; }
.cm-s-base16-light span.cm-atom { color: #aa759f; }
.cm-s-base16-light span.cm-number { color: #aa759f; }

.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute { color: #90a959; }
.cm-s-base16-light span.cm-keyword { color: #ac4142; }
.cm-s-base16-light span.cm-string { color: #f4bf75; }

.cm-s-base16-light span.cm-variable { color: #90a959; }
.cm-s-base16-light span.cm-variable-2 { color: #6a9fb5; }
.cm-s-base16-light span.cm-def { color: #d28445; }
.cm-s-base16-light span.cm-bracket { color: #202020; }
.cm-s-base16-light span.cm-tag { color: #ac4142; }
.cm-s-base16-light span.cm-link { color: #aa759f; }
.cm-s-base16-light span.cm-error { background: #ac4142; color: #505050; }

.cm-s-base16-light .CodeMirror-activeline-background { background: #DDDCDC; }
.cm-s-base16-light .CodeMirror-matchingbracket { color: #f5f5f5 !important; background-color: #6A9FB5 !important}
`,K={exports:{}},B={exports:{}},D={exports:{}},je=Me,$e=y,et=Ue,tt="[object String]";function rt(e){return typeof e=="string"||!$e(e)&&et(e)&&je(e)==tt}var Et=rt,at=fe,te=1/0,nt=17976931348623157e292;function ot(e){if(!e)return e===0?e:0;if(e=at(e),e===te||e===-te){var t=e<0?-1:1;return t*nt}return e===e?e:0}var st=ot,it=st;function Tt(e){var t=it(e),E=t%1;return t===t?E?t-E:t:0}var re=Tt;function Rt(e,t){for(var E=-1,l=e==null?0:e.length,N=Array(l);++E<l;)N[E]=t(e[E],E,e);return N}var Ee=Rt,lt=Ee;function Nt(e,t){return lt(t,function(E){return e[E]})}var ct=Nt,Ct=ct,St=ge;function It(e){return e==null?[]:Ct(e,St(e))}var Ot=It,dt=ee,At=b,pt=Et,Lt=re,ut=Ot,mt=Math.max;function ht(e,t,E,l){e=At(e)?e:ut(e),E=E&&!l?Lt(E):0;var N=e.length;return E<0&&(E=mt(N+E,0)),pt(e)?E<=N&&e.indexOf(t,E)>-1:!!N&&dt(e,t,E)>-1}var Mt=ht,ae=De,Ut=Ee,ft=y,gt=Pe,Dt=1/0,ne=ae?ae.prototype:void 0,oe=ne?ne.toString:void 0;function se(e){if(typeof e=="string")return e;if(ft(e))return Ut(e,se)+"";if(gt(e))return oe?oe.call(e):"";var t=e+"";return t=="0"&&1/e==-Dt?"-0":t}var ie=se;function Pt(e,t,E){var l=-1,N=e.length;t<0&&(t=-t>N?0:N+t),E=E>N?N:E,E<0&&(E+=N),N=t>E?0:E-t>>>0,t>>>=0;for(var S=Array(N);++l<N;)S[l]=e[l+t];return S}var kt=Pt,Ft=kt;function yt(e,t,E){var l=e.length;return E=E===void 0?l:E,!t&&E>=l?e:Ft(e,t,E)}var bt=yt,Wt=ee;function vt(e,t){for(var E=e.length;E--&&Wt(t,e[E],0)>-1;);return E}var Gt=vt;function Kt(e){return e.split("")}var Bt=Kt,Vt="\\ud800-\\udfff",Ht="\\u0300-\\u036f",Jt="\\ufe20-\\ufe2f",wt="\\u20d0-\\u20ff",Yt=Ht+Jt+wt,Qt="\\ufe0e\\ufe0f",xt="\\u200d",_t=RegExp("["+xt+Vt+Yt+Qt+"]");function Zt(e){return _t.test(e)}var qt=Zt,Te="\\ud800-\\udfff",Xt="\\u0300-\\u036f",zt="\\ufe20-\\ufe2f",jt="\\u20d0-\\u20ff",$t=Xt+zt+jt,er="\\ufe0e\\ufe0f",tr="["+Te+"]",V="["+$t+"]",H="\\ud83c[\\udffb-\\udfff]",rr="(?:"+V+"|"+H+")",Re="[^"+Te+"]",le="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Er="\\u200d",ce=rr+"?",Ce="["+er+"]?",ar="(?:"+Er+"(?:"+[Re,le,Ne].join("|")+")"+Ce+ce+")*",nr=Ce+ce+ar,or="(?:"+[Re+V+"?",V,le,Ne,tr].join("|")+")",sr=RegExp(H+"(?="+H+")|"+or+nr,"g");function ir(e){return e.match(sr)||[]}var Tr=ir,Rr=Bt,lr=qt,Nr=Tr;function cr(e){return lr(e)?Nr(e):Rr(e)}var Cr=cr,Sr=ie;function Ir(e){return e==null?"":Sr(e)}var J=Ir,Or=ie,dr=bt,Ar=Gt,Se=Cr,pr=J,Lr=ke;function ur(e,t,E){if(e=pr(e),e&&(E||t===void 0))return e.slice(0,Lr(e)+1);if(!e||!(t=Or(t)))return e;var l=Se(e),N=Ar(l,Se(t))+1;return dr(l,0,N).join("")}var mr=ur,k={exports:{}};(function(e,t){t.__esModule=!0,t.default={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOPLEVEL:"reserved-toplevel",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"},e.exports=t.default})(k,k.exports);var w={exports:{}},hr=9007199254740991,Mr=Math.floor;function Ur(e,t){var E="";if(!e||t<1||t>hr)return E;do t%2&&(E+=e),t=Mr(t/2),t&&(e+=e);while(t);return E}var fr=Ur,gr=Fe,Dr=b,Pr=ye,kr=be;function Fr(e,t,E){if(!kr(E))return!1;var l=typeof t;return(l=="number"?Dr(E)&&Pr(t,E.length):l=="string"&&t in E)?gr(E[t],e):!1}var yr=Fr,br=fr,Wr=yr,vr=re,Gr=J;function Kr(e,t,E){return(E?Wr(e,t,E):t===void 0)?t=1:t=vr(t),br(Gr(e),t)}var Br=Kr;function Vr(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Hr=Vr;(function(e,t){t.__esModule=!0;var E=Br,l=A(E),N=Hr,S=A(N);function A(a){return a&&a.__esModule?a:{default:a}}function R(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}var c="top-level",p="block-level",O=function(){function a(o){R(this,a),this.indent=o||"  ",this.indentTypes=[]}return a.prototype.getIndent=function(){return(0,l.default)(this.indent,this.indentTypes.length)},a.prototype.increaseToplevel=function(){this.indentTypes.push(c)},a.prototype.increaseBlockLevel=function(){this.indentTypes.push(p)},a.prototype.decreaseTopLevel=function(){(0,S.default)(this.indentTypes)===c&&this.indentTypes.pop()},a.prototype.decreaseBlockLevel=function(){for(;this.indentTypes.length>0;){var r=this.indentTypes.pop();if(r!==c)break}},a}();t.default=O,e.exports=t.default})(w,w.exports);var Y={exports:{}};(function(e,t){t.__esModule=!0;var E=k.exports,l=N(E);function N(c){return c&&c.__esModule?c:{default:c}}function S(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}var A=50,R=function(){function c(){S(this,c),this.level=0}return c.prototype.beginIfPossible=function(O,a){this.level===0&&this.isInlineBlock(O,a)?this.level=1:this.level>0?this.level++:this.level=0},c.prototype.end=function(){this.level--},c.prototype.isActive=function(){return this.level>0},c.prototype.isInlineBlock=function(O,a){for(var o=0,r=0,n=a;n<O.length;n++){var T=O[n];if(o+=T.value.length,o>A)return!1;if(T.type===l.default.OPEN_PAREN)r++;else if(T.type===l.default.CLOSE_PAREN&&(r--,r===0))return!0;if(this.isForbiddenToken(T))return!1}return!1},c.prototype.isForbiddenToken=function(O){var a=O.type,o=O.value;return a===l.default.RESERVED_TOPLEVEL||a===l.default.RESERVED_NEWLINE||a===l.default.COMMENT||a===l.default.BLOCK_COMMENT||o===";"},c}();t.default=R,e.exports=t.default})(Y,Y.exports);var Q={exports:{}};(function(e,t){t.__esModule=!0;function E(N,S){if(!(N instanceof S))throw new TypeError("Cannot call a class as a function")}var l=function(){function N(S){E(this,N),this.params=S,this.index=0}return N.prototype.get=function(A){var R=A.key,c=A.value;return this.params?R?this.params[R]:this.params[this.index++]:c},N}();t.default=l,e.exports=t.default})(Q,Q.exports),function(e,t){t.__esModule=!0;var E=Mt,l=n(E),N=mr,S=n(N),A=k.exports,R=n(A),c=w.exports,p=n(c),O=Y.exports,a=n(O),o=Q.exports,r=n(o);function n(C){return C&&C.__esModule?C:{default:C}}function T(C,L){if(!(C instanceof L))throw new TypeError("Cannot call a class as a function")}var I=function(){function C(L,i){T(this,C),this.cfg=L||{},this.indentation=new p.default(this.cfg.indent),this.inlineBlock=new a.default,this.params=new r.default(this.cfg.params),this.tokenizer=i,this.previousReservedWord={},this.tokens=[],this.index=0}return C.prototype.format=function(i){this.tokens=this.tokenizer.tokenize(i);var s=this.getFormattedQueryFromTokens();return s.trim()},C.prototype.getFormattedQueryFromTokens=function(){var i=this,s="";return this.tokens.forEach(function(d,de){i.index=de,d.type===R.default.WHITESPACE||(d.type===R.default.LINE_COMMENT?s=i.formatLineComment(d,s):d.type===R.default.BLOCK_COMMENT?s=i.formatBlockComment(d,s):d.type===R.default.RESERVED_TOPLEVEL?(s=i.formatToplevelReservedWord(d,s),i.previousReservedWord=d):d.type===R.default.RESERVED_NEWLINE?(s=i.formatNewlineReservedWord(d,s),i.previousReservedWord=d):d.type===R.default.RESERVED?(s=i.formatWithSpaces(d,s),i.previousReservedWord=d):d.type===R.default.OPEN_PAREN?s=i.formatOpeningParentheses(d,s):d.type===R.default.CLOSE_PAREN?s=i.formatClosingParentheses(d,s):d.type===R.default.PLACEHOLDER?s=i.formatPlaceholder(d,s):d.value===","?s=i.formatComma(d,s):d.value===":"?s=i.formatWithSpaceAfter(d,s):d.value==="."?s=i.formatWithoutSpaces(d,s):d.value===";"?s=i.formatQuerySeparator(d,s):s=i.formatWithSpaces(d,s))}),s},C.prototype.formatLineComment=function(i,s){return this.addNewline(s+i.value)},C.prototype.formatBlockComment=function(i,s){return this.addNewline(this.addNewline(s)+this.indentComment(i.value))},C.prototype.indentComment=function(i){return i.replace(/\n/g,`
`+this.indentation.getIndent())},C.prototype.formatToplevelReservedWord=function(i,s){return this.indentation.decreaseTopLevel(),s=this.addNewline(s),this.indentation.increaseToplevel(),s+=this.equalizeWhitespace(i.value),this.addNewline(s)},C.prototype.formatNewlineReservedWord=function(i,s){return this.addNewline(s)+this.equalizeWhitespace(i.value)+" "},C.prototype.equalizeWhitespace=function(i){return i.replace(/\s+/g," ")},C.prototype.formatOpeningParentheses=function(i,s){var d=[R.default.WHITESPACE,R.default.OPEN_PAREN,R.default.LINE_COMMENT];return(0,l.default)(d,this.previousToken().type)||(s=(0,S.default)(s)),s+=i.value,this.inlineBlock.beginIfPossible(this.tokens,this.index),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),s=this.addNewline(s)),s},C.prototype.formatClosingParentheses=function(i,s){return this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(i,s)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(i,this.addNewline(s)))},C.prototype.formatPlaceholder=function(i,s){return s+this.params.get(i)+" "},C.prototype.formatComma=function(i,s){return s=this.trimTrailingWhitespace(s)+i.value+" ",this.inlineBlock.isActive()||/^LIMIT$/i.test(this.previousReservedWord.value)?s:this.addNewline(s)},C.prototype.formatWithSpaceAfter=function(i,s){return this.trimTrailingWhitespace(s)+i.value+" "},C.prototype.formatWithoutSpaces=function(i,s){return this.trimTrailingWhitespace(s)+i.value},C.prototype.formatWithSpaces=function(i,s){return s+i.value+" "},C.prototype.formatQuerySeparator=function(i,s){return this.trimTrailingWhitespace(s)+i.value+`
`},C.prototype.addNewline=function(i){return(0,S.default)(i)+`
`+this.indentation.getIndent()},C.prototype.trimTrailingWhitespace=function(i){return this.previousNonWhitespaceToken().type===R.default.LINE_COMMENT?(0,S.default)(i)+`
`:(0,S.default)(i)},C.prototype.previousNonWhitespaceToken=function(){for(var i=1;this.previousToken(i).type===R.default.WHITESPACE;)i++;return this.previousToken(i)},C.prototype.previousToken=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return this.tokens[this.index-i]||{}},C}();t.default=I,e.exports=t.default}(D,D.exports);var P={exports:{}},Jr=We,wr=ve,Yr=Ge,Qr=y,xr=b,_r=Ke.exports,Zr=Be,qr=Ve,Xr="[object Map]",zr="[object Set]",jr=Object.prototype,$r=jr.hasOwnProperty;function eE(e){if(e==null)return!0;if(xr(e)&&(Qr(e)||typeof e=="string"||typeof e.splice=="function"||_r(e)||qr(e)||Yr(e)))return!e.length;var t=wr(e);if(t==Xr||t==zr)return!e.size;if(Zr(e))return!Jr(e).length;for(var E in e)if($r.call(e,E))return!1;return!0}var tE=eE,rE=J,Ie=/[\\^$.*+?()[\]{}|]/g,EE=RegExp(Ie.source);function aE(e){return e=rE(e),e&&EE.test(e)?e.replace(Ie,"\\$&"):e}var nE=aE;(function(e,t){t.__esModule=!0;var E=tE,l=c(E),N=nE,S=c(N),A=k.exports,R=c(A);function c(a){return a&&a.__esModule?a:{default:a}}function p(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}var O=function(){function a(o){p(this,a),this.WHITESPACE_REGEX=/^(\s+)/,this.NUMBER_REGEX=/^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/,this.OPERATOR_REGEX=/^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/,this.BLOCK_COMMENT_REGEX=/^(\/\*[^]*?(?:\*\/|$))/,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(o.lineCommentTypes),this.RESERVED_TOPLEVEL_REGEX=this.createReservedWordRegex(o.reservedToplevelWords),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(o.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(o.reservedWords),this.WORD_REGEX=this.createWordRegex(o.specialWordChars),this.STRING_REGEX=this.createStringRegex(o.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(o.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(o.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(o.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(o.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(o.namedPlaceholderTypes,this.createStringPattern(o.stringTypes))}return a.prototype.createLineCommentRegex=function(r){return new RegExp("^((?:"+r.map(function(n){return(0,S.default)(n)}).join("|")+`).*?(?:
|$))`)},a.prototype.createReservedWordRegex=function(r){var n=r.join("|").replace(/ /g,"\\s+");return new RegExp("^("+n+")\\b","i")},a.prototype.createWordRegex=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new RegExp("^([\\w"+r.join("")+"]+)")},a.prototype.createStringRegex=function(r){return new RegExp("^("+this.createStringPattern(r)+")")},a.prototype.createStringPattern=function(r){var n={"``":"((`[^`]*($|`))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return r.map(function(T){return n[T]}).join("|")},a.prototype.createParenRegex=function(r){var n=this;return new RegExp("^("+r.map(function(T){return n.escapeParen(T)}).join("|")+")","i")},a.prototype.escapeParen=function(r){return r.length===1?(0,S.default)(r):"\\b"+r+"\\b"},a.prototype.createPlaceholderRegex=function(r,n){if((0,l.default)(r))return!1;var T=r.map(S.default).join("|");return new RegExp("^((?:"+T+")(?:"+n+"))")},a.prototype.tokenize=function(r){for(var n=[],T=void 0;r.length;)T=this.getNextToken(r,T),r=r.substring(T.value.length),n.push(T);return n},a.prototype.getNextToken=function(r,n){return this.getWhitespaceToken(r)||this.getCommentToken(r)||this.getStringToken(r)||this.getOpenParenToken(r)||this.getCloseParenToken(r)||this.getPlaceholderToken(r)||this.getNumberToken(r)||this.getReservedWordToken(r,n)||this.getWordToken(r)||this.getOperatorToken(r)},a.prototype.getWhitespaceToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.WHITESPACE,regex:this.WHITESPACE_REGEX})},a.prototype.getCommentToken=function(r){return this.getLineCommentToken(r)||this.getBlockCommentToken(r)},a.prototype.getLineCommentToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})},a.prototype.getBlockCommentToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})},a.prototype.getStringToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.STRING,regex:this.STRING_REGEX})},a.prototype.getOpenParenToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})},a.prototype.getCloseParenToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})},a.prototype.getPlaceholderToken=function(r){return this.getIdentNamedPlaceholderToken(r)||this.getStringNamedPlaceholderToken(r)||this.getIndexedPlaceholderToken(r)},a.prototype.getIdentNamedPlaceholderToken=function(r){return this.getPlaceholderTokenWithKey({input:r,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:function(T){return T.slice(1)}})},a.prototype.getStringNamedPlaceholderToken=function(r){var n=this;return this.getPlaceholderTokenWithKey({input:r,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:function(I){return n.getEscapedPlaceholderKey({key:I.slice(2,-1),quoteChar:I.slice(-1)})}})},a.prototype.getIndexedPlaceholderToken=function(r){return this.getPlaceholderTokenWithKey({input:r,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:function(T){return T.slice(1)}})},a.prototype.getPlaceholderTokenWithKey=function(r){var n=r.input,T=r.regex,I=r.parseKey,C=this.getTokenOnFirstMatch({input:n,regex:T,type:R.default.PLACEHOLDER});return C&&(C.key=I(C.value)),C},a.prototype.getEscapedPlaceholderKey=function(r){var n=r.key,T=r.quoteChar;return n.replace(new RegExp((0,S.default)("\\")+T,"g"),T)},a.prototype.getNumberToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.NUMBER,regex:this.NUMBER_REGEX})},a.prototype.getOperatorToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.OPERATOR,regex:this.OPERATOR_REGEX})},a.prototype.getReservedWordToken=function(r,n){if(!(n&&n.value&&n.value==="."))return this.getToplevelReservedToken(r)||this.getNewlineReservedToken(r)||this.getPlainReservedToken(r)},a.prototype.getToplevelReservedToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.RESERVED_TOPLEVEL,regex:this.RESERVED_TOPLEVEL_REGEX})},a.prototype.getNewlineReservedToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})},a.prototype.getPlainReservedToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.RESERVED,regex:this.RESERVED_PLAIN_REGEX})},a.prototype.getWordToken=function(r){return this.getTokenOnFirstMatch({input:r,type:R.default.WORD,regex:this.WORD_REGEX})},a.prototype.getTokenOnFirstMatch=function(r){var n=r.input,T=r.type,I=r.regex,C=n.match(I);if(C)return{type:T,value:C[1]}},a}();t.default=O,e.exports=t.default})(P,P.exports),function(e,t){t.__esModule=!0;var E=D.exports,l=A(E),N=P.exports,S=A(N);function A(r){return r&&r.__esModule?r:{default:r}}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var c=["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],p=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UPDATE","VALUES","WHERE"],O=["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"],a=void 0,o=function(){function r(n){R(this,r),this.cfg=n}return r.prototype.format=function(T){return a||(a=new S.default({reservedWords:c,reservedToplevelWords:p,reservedNewlineWords:O,stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]})),new l.default(this.cfg,a).format(T)},r}();t.default=o,e.exports=t.default}(B,B.exports);var x={exports:{}};(function(e,t){t.__esModule=!0;var E=D.exports,l=A(E),N=P.exports,S=A(N);function A(r){return r&&r.__esModule?r:{default:r}}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var c=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],p=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],O=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],a=void 0,o=function(){function r(n){R(this,r),this.cfg=n}return r.prototype.format=function(T){return a||(a=new S.default({reservedWords:c,reservedToplevelWords:p,reservedNewlineWords:O,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new l.default(this.cfg,a).format(T)},r}();t.default=o,e.exports=t.default})(x,x.exports);var _={exports:{}};(function(e,t){t.__esModule=!0;var E=D.exports,l=A(E),N=P.exports,S=A(N);function A(r){return r&&r.__esModule?r:{default:r}}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var c=["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUS","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],p=["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UNION ALL","UNION","UPDATE","VALUES","WHERE"],O=["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],a=void 0,o=function(){function r(n){R(this,r),this.cfg=n}return r.prototype.format=function(T){return a||(a=new S.default({reservedWords:c,reservedToplevelWords:p,reservedNewlineWords:O,stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]})),new l.default(this.cfg,a).format(T)},r}();t.default=o,e.exports=t.default})(_,_.exports);var Z={exports:{}};(function(e,t){t.__esModule=!0;var E=D.exports,l=A(E),N=P.exports,S=A(N);function A(r){return r&&r.__esModule?r:{default:r}}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var c=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],p=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],O=["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],a=void 0,o=function(){function r(n){R(this,r),this.cfg=n}return r.prototype.format=function(T){return a||(a=new S.default({reservedWords:c,reservedToplevelWords:p,reservedNewlineWords:O,stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new l.default(this.cfg,a).format(T)},r}();t.default=o,e.exports=t.default})(Z,Z.exports),function(e,t){t.__esModule=!0;var E=B.exports,l=O(E),N=x.exports,S=O(N),A=_.exports,R=O(A),c=Z.exports,p=O(c);function O(a){return a&&a.__esModule?a:{default:a}}t.default={format:function(o,r){switch(r=r||{},r.language){case"db2":return new l.default(r).format(o);case"n1ql":return new S.default(r).format(o);case"pl/sql":return new R.default(r).format(o);case"sql":case void 0:return new p.default(r).format(o);default:throw Error("Unsupported SQL dialect: "+r.language)}}},e.exports=t.default}(K,K.exports);var Oe=He(K.exports),q=Je({name:"SelectData",components:{codemirror:he},setup(){const e=we(null),t=Ye({dbs:[],tables:[],dbId:"",tableName:"",tableMetadata:[],columnMetadata:[],sql:"",selectRes:{tableColumn:[],data:[]},params:{pageNum:1,pageSize:10},cmOptions:{tabSize:4,mode:"text/x-sql",lineNumbers:!0,line:!0,indentWithTabs:!0,smartIndent:!0,theme:"base16-light",autofocus:!0,extraKeys:{Tab:"autocomplete"},hintOptions:{completeSingle:!1,tables:{}}}}),E=Qe(()=>e.value.coder),l=n=>"mysql";xe(()=>{r()});const N=(n,T)=>{/^[a-zA-Z]/.test(T.text[0])&&a()},S=async()=>{F(t.dbId,"\u8BF7\u5148\u9009\u62E9\u6570\u636E\u5E93");let n=A();F(n,"\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");const T=await g.selectData.request({id:t.dbId,selectSql:n});let I,C;T.length>0?(I=Object.keys(T[0]),C=T):(I=[],C=[]),t.selectRes.tableColumn=I,t.selectRes.data=C},A=()=>{let n=E.value.getSelection();return n==""&&(n=t.sql),n},R=async()=>{F(t.sql,"sql\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),F(t.dbId,"\u8BF7\u5148\u9009\u62E9\u6570\u636E\u5E93"),await g.saveSql.request({id:t.dbId,sql:t.sql,type:1}),Ze.success("\u4FDD\u5B58\u6210\u529F")},c=n=>{!n||(p(),g.tableMetadata.request({id:n}).then(T=>{t.tableMetadata=T,t.tableMetadata.length>0&&(t.tableName=t.tableMetadata[0].tableName,O(t.tableName))}),g.hintTables.request({id:t.dbId}).then(T=>{t.cmOptions.hintOptions.tables=T}),g.getSql.request({id:n,type:1}).then(T=>{T&&(t.sql=T.sql)}))},p=()=>{t.tableName="",t.tableMetadata=[],t.columnMetadata=[],t.selectRes.data=[],t.selectRes.tableColumn=[],t.sql=""},O=async n=>{n!=""&&(t.columnMetadata=await g.columnMetadata.request({id:t.dbId,tableName:n}))},a=()=>{E.value.showHint()},o=()=>{let n=E.value.getSelection();n!=""?E.value.replaceSelection(Oe.format(n)):E.value.setValue(Oe.format(t.sql))},r=async()=>{const n=await g.dbs.request(t.params);t.dbs=n.list};return $(j({},_e(t)),{cmEditor:e,dbTypeName:l,inputRead:N,changeTable:O,runSql:S,saveSql:R,changeDb:c,clearDb:p,formatSql:o})}}),uE=`.codesql[data-v-5bb0869b] {
  font-size: 10pt;
  font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
}`;const h=ze();qe("data-v-5bb0869b");const oE={class:"toolbar"},sE={class:"fl"},iE={class:"toolbar"},TE={class:"fl"},RE=G("\u6267\u884C"),lE=G("\u683C\u5F0F\u5316"),NE=G("\u4FDD\u5B58");Xe();const cE=h((e,t,E,l,N,S)=>{const A=M("el-option"),R=M("el-select"),c=M("el-button"),p=M("codemirror"),O=M("el-aside"),a=M("el-header"),o=M("el-table-column"),r=M("el-table"),n=M("el-main"),T=M("el-container");return U(),f("div",null,[u("div",oE,[u("div",sE,[u(R,{size:"small",modelValue:e.dbId,"onUpdate:modelValue":t[1]||(t[1]=I=>e.dbId=I),placeholder:"\u8BF7\u9009\u62E9\u6570\u636E\u5E93",onChange:e.changeDb,onClear:e.clearDb,clearable:"",filterable:""},{default:h(()=>[(U(!0),f(W,null,v(e.dbs,I=>(U(),f(A,{key:I.id,label:`${I.name} [${e.dbTypeName(I.type)}]`,value:I.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange","onClear"])])]),u(T,{style:{height:"50%",border:"1px solid #eee","margin-top":"1px"}},{default:h(()=>[u(O,{width:"70%",style:{"background-color":"rgb(238, 241, 246)"}},{default:h(()=>[u("div",iE,[u("div",TE,[u(c,{onClick:e.runSql,type:"success",icon:"el-icon-video-play",size:"mini",plain:""},{default:h(()=>[RE]),_:1},8,["onClick"]),u(c,{onClick:e.formatSql,type:"primary",icon:"el-icon-magic-stick",size:"mini",plain:""},{default:h(()=>[lE]),_:1},8,["onClick"]),u(c,{onClick:e.saveSql,type:"primary",icon:"el-icon-document-add",size:"mini",plain:""},{default:h(()=>[NE]),_:1},8,["onClick"])])]),u(p,{class:"codesql",ref:"cmEditor",language:"sql",modelValue:e.sql,"onUpdate:modelValue":t[2]||(t[2]=I=>e.sql=I),options:e.cmOptions},null,8,["modelValue","options"])]),_:1}),u(T,{style:{"margin-left":"2px"}},{default:h(()=>[u(a,{style:{"text-align":"left",height:"45px","font-size":"12px",padding:"0px"}},{default:h(()=>[u(R,{modelValue:e.tableName,"onUpdate:modelValue":t[3]||(t[3]=I=>e.tableName=I),placeholder:"\u8BF7\u9009\u62E9\u8868",onChange:e.changeTable,clearable:"",filterable:"",style:{width:"99%"}},{default:h(()=>[(U(!0),f(W,null,v(e.tableMetadata,I=>(U(),f(A,{key:I.tableName,label:I.tableName+(I.tableComment!=""?`\u3010${I.tableComment}\u3011`:""),value:I.tableName},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),u(n,{style:{padding:"0px",height:"100%",overflow:"hidden"}},{default:h(()=>[u(r,{data:e.columnMetadata,height:"100%",size:"mini"},{default:h(()=>[u(o,{prop:"columnName",label:"\u540D\u79F0","show-overflow-tooltip":""}),u(o,{prop:"columnType",label:"\u7C7B\u578B","show-overflow-tooltip":""}),u(o,{prop:"columnComment",label:"\u5907\u6CE8","show-overflow-tooltip":""})]),_:1},8,["data"])]),_:1})]),_:1})]),_:1}),u(r,{style:{"margin-top":"1px"},data:e.selectRes.data,size:"mini","max-height":"300",stripe:"",border:""},{default:h(()=>[(U(!0),f(W,null,v(e.selectRes.tableColumn,I=>(U(),f(o,{"min-width":"92",align:"center",key:I,prop:I,label:I,"show-overflow-tooltip":""},null,8,["prop","label"]))),128))]),_:1},8,["data"])])});q.render=cE,q.__scopeId="data-v-5bb0869b";export default q;
