UNPKG

queryflow

Version:

Compose is an Open source SQL Query Editor Toolkit for Databases/Warehouses

1 lines 7.98 MB
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ComposeEditorWebComponent=e():n.ComposeEditorWebComponent=e()}(self,(function(){return(()=>{var __webpack_modules__={7332:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _tokenTypes = _interopRequireDefault(__webpack_require__(9163));\n\nvar _Indentation = _interopRequireDefault(__webpack_require__(3626));\n\nvar _InlineBlock = _interopRequireDefault(__webpack_require__(8939));\n\nvar _Params = _interopRequireDefault(__webpack_require__(1534));\n\nvar _utils = __webpack_require__(9789);\n\nvar _token = __webpack_require__(6414);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar Formatter = /*#__PURE__*/function () {\n /**\n * @param {Object} cfg\n * @param {String} cfg.language\n * @param {String} cfg.indent\n * @param {Boolean} cfg.uppercase\n * @param {Integer} cfg.linesBetweenQueries\n * @param {Boolean} cfg.indentQuerySeparator\n * @param {Object} cfg.params\n */\n function Formatter(cfg) {\n _classCallCheck(this, Formatter);\n\n this.cfg = cfg;\n this.indentation = new _Indentation["default"](this.cfg.indent);\n this.inlineBlock = new _InlineBlock["default"]();\n this.params = new _Params["default"](this.cfg.params);\n this.previousReservedToken = {};\n this.tokens = [];\n this.index = 0;\n }\n /**\n * SQL Tokenizer for this formatter, provided by subclasses.\n */\n\n\n _createClass(Formatter, [{\n key: "tokenizer",\n value: function tokenizer() {\n throw new Error(\'tokenizer() not implemented by subclass\');\n }\n /**\n * Reprocess and modify a token based on parsed context.\n *\n * @param {Object} token The token to modify\n * @param {String} token.type\n * @param {String} token.value\n * @return {Object} new token or the original\n * @return {String} token.type\n * @return {String} token.value\n */\n\n }, {\n key: "tokenOverride",\n value: function tokenOverride(token) {\n // subclasses can override this to modify tokens during formatting\n return token;\n }\n /**\n * Formats whitespace in a SQL string to make it easier to read.\n *\n * @param {String} query The SQL query string\n * @return {String} formatted query\n */\n\n }, {\n key: "format",\n value: function format(query) {\n this.tokens = this.tokenizer().tokenize(query);\n var formattedQuery = this.getFormattedQueryFromTokens();\n return formattedQuery.trim();\n }\n }, {\n key: "getFormattedQueryFromTokens",\n value: function getFormattedQueryFromTokens() {\n var _this = this;\n\n var formattedQuery = \'\';\n this.tokens.forEach(function (token, index) {\n _this.index = index;\n token = _this.tokenOverride(token);\n\n if (token.type === _tokenTypes["default"].LINE_COMMENT) {\n formattedQuery = _this.formatLineComment(token, formattedQuery);\n } else if (token.type === _tokenTypes["default"].BLOCK_COMMENT) {\n formattedQuery = _this.formatBlockComment(token, formattedQuery);\n } else if (token.type === _tokenTypes["default"].RESERVED_TOP_LEVEL) {\n formattedQuery = _this.formatTopLevelReservedWord(token, formattedQuery);\n _this.previousReservedToken = token;\n } else if (token.type === _tokenTypes["default"].RESERVED_TOP_LEVEL_NO_INDENT) {\n formattedQuery = _this.formatTopLevelReservedWordNoIndent(token, formattedQuery);\n _this.previousReservedToken = token;\n } else if (token.type === _tokenTypes["default"].RESERVED_NEWLINE) {\n formattedQuery = _this.formatNewlineReservedWord(token, formattedQuery);\n _this.previousReservedToken = token;\n } else if (token.type === _tokenTypes["default"].RESERVED) {\n formattedQuery = _this.formatWithSpaces(token, formattedQuery);\n _this.previousReservedToken = token;\n } else if (token.type === _tokenTypes["default"].OPEN_PAREN) {\n formattedQuery = _this.formatOpeningParentheses(token, formattedQuery);\n } else if (token.type === _tokenTypes["default"].CLOSE_PAREN) {\n formattedQuery = _this.formatClosingParentheses(token, formattedQuery);\n } else if (token.type === _tokenTypes["default"].PLACEHOLDER) {\n formattedQuery = _this.formatPlaceholder(token, formattedQuery);\n } else if (token.value === \',\') {\n formattedQuery = _this.formatComma(token, formattedQuery);\n } else if (token.value === \':\') {\n formattedQuery = _this.formatWithSpaceAfter(token, formattedQuery);\n } else if (token.value === \'.\') {\n formattedQuery = _this.formatWithoutSpaces(token, formattedQuery);\n } else if (token.value === \';\') {\n formattedQuery = _this.formatQuerySeparator(token, formattedQuery);\n } else {\n formattedQuery = _this.formatWithSpaces(token, formattedQuery);\n }\n });\n return formattedQuery;\n }\n }, {\n key: "formatLineComment",\n value: function formatLineComment(token, query) {\n return this.addNewline(query + this.show(token));\n }\n }, {\n key: "formatBlockComment",\n value: function formatBlockComment(token, query) {\n return this.addNewline(this.addNewline(query) + this.indentComment(token.value));\n }\n }, {\n key: "indentComment",\n value: function indentComment(comment) {\n return comment.replace(/\\n[\\t ]*/g, \'\\n\' + this.indentation.getIndent() + \' \');\n }\n }, {\n key: "formatTopLevelReservedWordNoIndent",\n value: function formatTopLevelReservedWordNoIndent(token, query) {\n this.indentation.decreaseTopLevel();\n query = this.addNewline(query) + this.equalizeWhitespace(this.show(token));\n return this.addNewline(query);\n }\n }, {\n key: "formatTopLevelReservedWord",\n value: function formatTopLevelReservedWord(token, query) {\n this.indentation.decreaseTopLevel();\n query = this.addNewline(query);\n this.indentation.increaseTopLevel();\n query += this.equalizeWhitespace(this.show(token));\n return this.addNewline(query);\n }\n }, {\n key: "formatNewlineReservedWord",\n value: function formatNewlineReservedWord(token, query) {\n if ((0, _token.isAnd)(token) && (0, _token.isBetween)(this.tokenLookBehind(2))) {\n return this.formatWithSpaces(token, query);\n }\n\n return this.addNewline(query) + this.equalizeWhitespace(this.show(token)) + \' \';\n } // Replace any sequence of whitespace characters with single space\n\n }, {\n key: "equalizeWhitespace",\n value: function equalizeWhitespace(string) {\n return string.replace(/[\\t-\\r \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+/g, \' \');\n } // Opening parentheses increase the block indent level and start a new line\n\n }, {\n key: "formatOpeningParentheses",\n value: function formatOpeningParentheses(token, query) {\n var _preserveWhitespaceFo, _this$tokenLookBehind;\n\n // Take out the preceding space unless there was whitespace there in the original query\n // or another opening parens or line comment\n var preserveWhitespaceFor = (_preserveWhitespaceFo = {}, _defineProperty(_preserveWhitespaceFo, _tokenTypes["default"].OPEN_PAREN, true), _defineProperty(_preserveWhitespaceFo, _tokenTypes["default"].LINE_COMMENT, true), _defineProperty(_preserveWhitespaceFo, _tokenTypes["default"].OPERATOR, true), _preserveWhitespaceFo);\n\n if (token.whitespaceBefore.length === 0 && !preserveWhitespaceFor[(_this$tokenLookBehind = this.tokenLookBehind()) === null || _this$tokenLookBehind === void 0 ? void 0 : _this$tokenLookBehind.type]) {\n query = (0, _utils.trimSpacesEnd)(query);\n }\n\n query += this.show(token);\n this.inlineBlock.beginIfPossible(this.tokens, this.index);\n\n if (!this.inlineBlock.isActive()) {\n this.indentation.increaseBlockLevel();\n query = this.addNewline(query);\n }\n\n return query;\n } // Closing parentheses decrease the block indent level\n\n }, {\n key: "formatClosingParentheses",\n value: function formatClosingParentheses(token, query) {\n if (this.inlineBlock.isActive()) {\n this.inlineBlock.end();\n return this.formatWithSpaceAfter(token, query);\n } else {\n this.indentation.decreaseBlockLevel();\n return this.formatWithSpaces(token, this.addNewline(query));\n }\n }\n }, {\n key: "formatPlaceholder",\n value: function formatPlaceholder(token, query) {\n return query + this.params.get(token) + \' \';\n } // Commas start a new line (unless within inline parentheses or SQL "LIMIT" clause)\n\n }, {\n key: "formatComma",\n value: function formatComma(token, query) {\n query = (0, _utils.trimSpacesEnd)(query) + this.show(token) + \' \';\n\n if (this.inlineBlock.isActive()) {\n return query;\n } else if ((0, _token.isLimit)(this.previousReservedToken)) {\n return query;\n } else {\n return this.addNewline(query);\n }\n }\n }, {\n key: "formatWithSpaceAfter",\n value: function formatWithSpaceAfter(token, query) {\n return (0, _utils.trimSpacesEnd)(query) + this.show(token) + \' \';\n }\n }, {\n key: "formatWithoutSpaces",\n value: function formatWithoutSpaces(token, query) {\n return (0, _utils.trimSpacesEnd)(query) + this.show(token);\n }\n }, {\n key: "formatWithSpaces",\n value: function formatWithSpaces(token, query) {\n return query + this.show(token) + \' \';\n }\n }, {\n key: "formatQuerySeparator",\n value: function formatQuerySeparator(token, query) {\n this.indentation.resetIndentation();\n return (0, _utils.trimSpacesEnd)(query) + (this.cfg.indentQuerySeparator ? \'\\n\' : \'\') + this.show(token) + \'\\n\'.repeat(this.cfg.linesBetweenQueries || 1);\n } // Converts token to string (uppercasing it if needed)\n\n }, {\n key: "show",\n value: function show(_ref) {\n var type = _ref.type,\n value = _ref.value;\n\n if (this.cfg.uppercase && (type === _tokenTypes["default"].RESERVED || type === _tokenTypes["default"].RESERVED_TOP_LEVEL || type === _tokenTypes["default"].RESERVED_TOP_LEVEL_NO_INDENT || type === _tokenTypes["default"].RESERVED_NEWLINE || type === _tokenTypes["default"].OPEN_PAREN || type === _tokenTypes["default"].CLOSE_PAREN)) {\n return value.toUpperCase();\n } else {\n return value;\n }\n }\n }, {\n key: "addNewline",\n value: function addNewline(query) {\n query = (0, _utils.trimSpacesEnd)(query);\n\n if (!query.endsWith(\'\\n\')) {\n query += \'\\n\';\n }\n\n return query + this.indentation.getIndent();\n }\n }, {\n key: "tokenLookBehind",\n value: function tokenLookBehind() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return this.tokens[this.index - n];\n }\n }, {\n key: "tokenLookAhead",\n value: function tokenLookAhead() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return this.tokens[this.index + n];\n }\n }]);\n\n return Formatter;\n}();\n\nexports.default = Formatter;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/Formatter.js?')},3626:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _utils = __webpack_require__(9789);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar INDENT_TYPE_TOP_LEVEL = \'top-level\';\nvar INDENT_TYPE_BLOCK_LEVEL = \'block-level\';\n/**\n * Manages indentation levels.\n *\n * There are two types of indentation levels:\n *\n * - BLOCK_LEVEL : increased by open-parenthesis\n * - TOP_LEVEL : increased by RESERVED_TOP_LEVEL words\n */\n\nvar Indentation = /*#__PURE__*/function () {\n /**\n * @param {String} indent Indent value, default is " " (2 spaces)\n */\n function Indentation(indent) {\n _classCallCheck(this, Indentation);\n\n this.indent = indent || \' \';\n this.indentTypes = [];\n }\n /**\n * Returns current indentation string.\n * @return {String}\n */\n\n\n _createClass(Indentation, [{\n key: "getIndent",\n value: function getIndent() {\n return this.indent.repeat(this.indentTypes.length);\n }\n /**\n * Increases indentation by one top-level indent.\n */\n\n }, {\n key: "increaseTopLevel",\n value: function increaseTopLevel() {\n this.indentTypes.push(INDENT_TYPE_TOP_LEVEL);\n }\n /**\n * Increases indentation by one block-level indent.\n */\n\n }, {\n key: "increaseBlockLevel",\n value: function increaseBlockLevel() {\n this.indentTypes.push(INDENT_TYPE_BLOCK_LEVEL);\n }\n /**\n * Decreases indentation by one top-level indent.\n * Does nothing when the previous indent is not top-level.\n */\n\n }, {\n key: "decreaseTopLevel",\n value: function decreaseTopLevel() {\n if (this.indentTypes.length > 0 && (0, _utils.last)(this.indentTypes) === INDENT_TYPE_TOP_LEVEL) {\n this.indentTypes.pop();\n }\n }\n /**\n * Decreases indentation by one block-level indent.\n * If there are top-level indents within the block-level indent,\n * throws away these as well.\n */\n\n }, {\n key: "decreaseBlockLevel",\n value: function decreaseBlockLevel() {\n while (this.indentTypes.length > 0) {\n var type = this.indentTypes.pop();\n\n if (type !== INDENT_TYPE_TOP_LEVEL) {\n break;\n }\n }\n }\n }, {\n key: "resetIndentation",\n value: function resetIndentation() {\n this.indentTypes = [];\n }\n }]);\n\n return Indentation;\n}();\n\nexports.default = Indentation;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/Indentation.js?')},8939:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _tokenTypes = _interopRequireDefault(__webpack_require__(9163));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar INLINE_MAX_LENGTH = 50;\n/**\n * Bookkeeper for inline blocks.\n *\n * Inline blocks are parenthized expressions that are shorter than INLINE_MAX_LENGTH.\n * These blocks are formatted on a single line, unlike longer parenthized\n * expressions where open-parenthesis causes newline and increase of indentation.\n */\n\nvar InlineBlock = /*#__PURE__*/function () {\n function InlineBlock() {\n _classCallCheck(this, InlineBlock);\n\n this.level = 0;\n }\n /**\n * Begins inline block when lookahead through upcoming tokens determines\n * that the block would be smaller than INLINE_MAX_LENGTH.\n * @param {Object[]} tokens Array of all tokens\n * @param {Number} index Current token position\n */\n\n\n _createClass(InlineBlock, [{\n key: "beginIfPossible",\n value: function beginIfPossible(tokens, index) {\n if (this.level === 0 && this.isInlineBlock(tokens, index)) {\n this.level = 1;\n } else if (this.level > 0) {\n this.level++;\n } else {\n this.level = 0;\n }\n }\n /**\n * Finishes current inline block.\n * There might be several nested ones.\n */\n\n }, {\n key: "end",\n value: function end() {\n this.level--;\n }\n /**\n * True when inside an inline block\n * @return {Boolean}\n */\n\n }, {\n key: "isActive",\n value: function isActive() {\n return this.level > 0;\n } // Check if this should be an inline parentheses block\n // Examples are "NOW()", "COUNT(*)", "int(10)", key(`somecolumn`), DECIMAL(7,2)\n\n }, {\n key: "isInlineBlock",\n value: function isInlineBlock(tokens, index) {\n var length = 0;\n var level = 0;\n\n for (var i = index; i < tokens.length; i++) {\n var token = tokens[i];\n length += token.value.length; // Overran max length\n\n if (length > INLINE_MAX_LENGTH) {\n return false;\n }\n\n if (token.type === _tokenTypes["default"].OPEN_PAREN) {\n level++;\n } else if (token.type === _tokenTypes["default"].CLOSE_PAREN) {\n level--;\n\n if (level === 0) {\n return true;\n }\n }\n\n if (this.isForbiddenToken(token)) {\n return false;\n }\n }\n\n return false;\n } // Reserved words that cause newlines, comments and semicolons\n // are not allowed inside inline parentheses block\n\n }, {\n key: "isForbiddenToken",\n value: function isForbiddenToken(_ref) {\n var type = _ref.type,\n value = _ref.value;\n return type === _tokenTypes["default"].RESERVED_TOP_LEVEL || type === _tokenTypes["default"].RESERVED_NEWLINE || type === _tokenTypes["default"].COMMENT || type === _tokenTypes["default"].BLOCK_COMMENT || value === \';\';\n }\n }]);\n\n return InlineBlock;\n}();\n\nexports.default = InlineBlock;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/InlineBlock.js?')},1534:(module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Handles placeholder replacement with given params.\n */\nvar Params = /*#__PURE__*/function () {\n /**\n * @param {Object} params\n */\n function Params(params) {\n _classCallCheck(this, Params);\n\n this.params = params;\n this.index = 0;\n }\n /**\n * Returns param value that matches given placeholder with param key.\n * @param {Object} token\n * @param {String} token.key Placeholder key\n * @param {String} token.value Placeholder value\n * @return {String} param or token.value when params are missing\n */\n\n\n _createClass(Params, [{\n key: "get",\n value: function get(_ref) {\n var key = _ref.key,\n value = _ref.value;\n\n if (!this.params) {\n return value;\n }\n\n if (key) {\n return this.params[key];\n }\n\n return this.params[this.index++];\n }\n }]);\n\n return Params;\n}();\n\nexports.default = Params;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/Params.js?')},4790:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nfunction _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _tokenTypes = _interopRequireDefault(__webpack_require__(9163));\n\nvar regexFactory = _interopRequireWildcard(__webpack_require__(1193));\n\nvar _utils = __webpack_require__(9789);\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar Tokenizer = /*#__PURE__*/function () {\n /**\n * @param {Object} cfg\n * @param {String[]} cfg.reservedWords Reserved words in SQL\n * @param {String[]} cfg.reservedTopLevelWords Words that are set to new line separately\n * @param {String[]} cfg.reservedNewlineWords Words that are set to newline\n * @param {String[]} cfg.reservedTopLevelWordsNoIndent Words that are top level but have no indentation\n * @param {String[]} cfg.stringTypes String types to enable: "", \'\', ``, [], N\'\'\n * @param {String[]} cfg.openParens Opening parentheses to enable, like (, [\n * @param {String[]} cfg.closeParens Closing parentheses to enable, like ), ]\n * @param {String[]} cfg.indexedPlaceholderTypes Prefixes for indexed placeholders, like ?\n * @param {String[]} cfg.namedPlaceholderTypes Prefixes for named placeholders, like @ and :\n * @param {String[]} cfg.lineCommentTypes Line comments to enable, like # and --\n * @param {String[]} cfg.specialWordChars Special chars that can be found inside of words, like @ and #\n * @param {String[]} [cfg.operator] Additional operators to recognize\n */\n function Tokenizer(cfg) {\n _classCallCheck(this, Tokenizer);\n\n this.WHITESPACE_REGEX = /^([\\t-\\r \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+)/;\n this.NUMBER_REGEX = /^((\\x2D[\\t-\\r \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]*)?[0-9]+(\\.[0-9]+)?([Ee]\\x2D?[0-9]+(\\.[0-9]+)?)?|0x[0-9A-Fa-f]+|0b[01]+)\\b/;\n this.OPERATOR_REGEX = regexFactory.createOperatorRegex([\'<>\', \'<=\', \'>=\'].concat(_toConsumableArray(cfg.operators || [])));\n this.BLOCK_COMMENT_REGEX = /^(\\/\\*(?:(?![])[\\s\\S])*?(?:\\*\\/|$))/;\n this.LINE_COMMENT_REGEX = regexFactory.createLineCommentRegex(cfg.lineCommentTypes);\n this.RESERVED_TOP_LEVEL_REGEX = regexFactory.createReservedWordRegex(cfg.reservedTopLevelWords);\n this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX = regexFactory.createReservedWordRegex(cfg.reservedTopLevelWordsNoIndent);\n this.RESERVED_NEWLINE_REGEX = regexFactory.createReservedWordRegex(cfg.reservedNewlineWords);\n this.RESERVED_PLAIN_REGEX = regexFactory.createReservedWordRegex(cfg.reservedWords);\n this.WORD_REGEX = regexFactory.createWordRegex(cfg.specialWordChars);\n this.STRING_REGEX = regexFactory.createStringRegex(cfg.stringTypes);\n this.OPEN_PAREN_REGEX = regexFactory.createParenRegex(cfg.openParens);\n this.CLOSE_PAREN_REGEX = regexFactory.createParenRegex(cfg.closeParens);\n this.INDEXED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(cfg.indexedPlaceholderTypes, \'[0-9]*\');\n this.IDENT_NAMED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(cfg.namedPlaceholderTypes, \'[a-zA-Z0-9._$]+\');\n this.STRING_NAMED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(cfg.namedPlaceholderTypes, regexFactory.createStringPattern(cfg.stringTypes));\n }\n /**\n * Takes a SQL string and breaks it into tokens.\n * Each token is an object with type and value.\n *\n * @param {String} input The SQL string\n * @return {Object[]} tokens An array of tokens.\n * @return {String} token.type\n * @return {String} token.value\n * @return {String} token.whitespaceBefore Preceding whitespace\n */\n\n\n _createClass(Tokenizer, [{\n key: "tokenize",\n value: function tokenize(input) {\n var tokens = [];\n var token; // Keep processing the string until it is empty\n\n while (input.length) {\n // grab any preceding whitespace\n var whitespaceBefore = this.getWhitespace(input);\n input = input.substring(whitespaceBefore.length);\n\n if (input.length) {\n // Get the next token and the token type\n token = this.getNextToken(input, token); // Advance the string\n\n input = input.substring(token.value.length);\n tokens.push(_objectSpread(_objectSpread({}, token), {}, {\n whitespaceBefore: whitespaceBefore\n }));\n }\n }\n\n return tokens;\n }\n }, {\n key: "getWhitespace",\n value: function getWhitespace(input) {\n var matches = input.match(this.WHITESPACE_REGEX);\n return matches ? matches[1] : \'\';\n }\n }, {\n key: "getNextToken",\n value: function getNextToken(input, previousToken) {\n return this.getCommentToken(input) || this.getStringToken(input) || this.getOpenParenToken(input) || this.getCloseParenToken(input) || this.getPlaceholderToken(input) || this.getNumberToken(input) || this.getReservedWordToken(input, previousToken) || this.getWordToken(input) || this.getOperatorToken(input);\n }\n }, {\n key: "getCommentToken",\n value: function getCommentToken(input) {\n return this.getLineCommentToken(input) || this.getBlockCommentToken(input);\n }\n }, {\n key: "getLineCommentToken",\n value: function getLineCommentToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].LINE_COMMENT,\n regex: this.LINE_COMMENT_REGEX\n });\n }\n }, {\n key: "getBlockCommentToken",\n value: function getBlockCommentToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].BLOCK_COMMENT,\n regex: this.BLOCK_COMMENT_REGEX\n });\n }\n }, {\n key: "getStringToken",\n value: function getStringToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].STRING,\n regex: this.STRING_REGEX\n });\n }\n }, {\n key: "getOpenParenToken",\n value: function getOpenParenToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].OPEN_PAREN,\n regex: this.OPEN_PAREN_REGEX\n });\n }\n }, {\n key: "getCloseParenToken",\n value: function getCloseParenToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].CLOSE_PAREN,\n regex: this.CLOSE_PAREN_REGEX\n });\n }\n }, {\n key: "getPlaceholderToken",\n value: function getPlaceholderToken(input) {\n return this.getIdentNamedPlaceholderToken(input) || this.getStringNamedPlaceholderToken(input) || this.getIndexedPlaceholderToken(input);\n }\n }, {\n key: "getIdentNamedPlaceholderToken",\n value: function getIdentNamedPlaceholderToken(input) {\n return this.getPlaceholderTokenWithKey({\n input: input,\n regex: this.IDENT_NAMED_PLACEHOLDER_REGEX,\n parseKey: function parseKey(v) {\n return v.slice(1);\n }\n });\n }\n }, {\n key: "getStringNamedPlaceholderToken",\n value: function getStringNamedPlaceholderToken(input) {\n var _this = this;\n\n return this.getPlaceholderTokenWithKey({\n input: input,\n regex: this.STRING_NAMED_PLACEHOLDER_REGEX,\n parseKey: function parseKey(v) {\n return _this.getEscapedPlaceholderKey({\n key: v.slice(2, -1),\n quoteChar: v.slice(-1)\n });\n }\n });\n }\n }, {\n key: "getIndexedPlaceholderToken",\n value: function getIndexedPlaceholderToken(input) {\n return this.getPlaceholderTokenWithKey({\n input: input,\n regex: this.INDEXED_PLACEHOLDER_REGEX,\n parseKey: function parseKey(v) {\n return v.slice(1);\n }\n });\n }\n }, {\n key: "getPlaceholderTokenWithKey",\n value: function getPlaceholderTokenWithKey(_ref) {\n var input = _ref.input,\n regex = _ref.regex,\n parseKey = _ref.parseKey;\n var token = this.getTokenOnFirstMatch({\n input: input,\n regex: regex,\n type: _tokenTypes["default"].PLACEHOLDER\n });\n\n if (token) {\n token.key = parseKey(token.value);\n }\n\n return token;\n }\n }, {\n key: "getEscapedPlaceholderKey",\n value: function getEscapedPlaceholderKey(_ref2) {\n var key = _ref2.key,\n quoteChar = _ref2.quoteChar;\n return key.replace(new RegExp((0, _utils.escapeRegExp)(\'\\\\\' + quoteChar), \'gu\'), quoteChar);\n } // Decimal, binary, or hex numbers\n\n }, {\n key: "getNumberToken",\n value: function getNumberToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].NUMBER,\n regex: this.NUMBER_REGEX\n });\n } // Punctuation and symbols\n\n }, {\n key: "getOperatorToken",\n value: function getOperatorToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].OPERATOR,\n regex: this.OPERATOR_REGEX\n });\n }\n }, {\n key: "getReservedWordToken",\n value: function getReservedWordToken(input, previousToken) {\n // A reserved word cannot be preceded by a "."\n // this makes it so in "mytable.from", "from" is not considered a reserved word\n if (previousToken && previousToken.value && previousToken.value === \'.\') {\n return undefined;\n }\n\n return this.getTopLevelReservedToken(input) || this.getNewlineReservedToken(input) || this.getTopLevelReservedTokenNoIndent(input) || this.getPlainReservedToken(input);\n }\n }, {\n key: "getTopLevelReservedToken",\n value: function getTopLevelReservedToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].RESERVED_TOP_LEVEL,\n regex: this.RESERVED_TOP_LEVEL_REGEX\n });\n }\n }, {\n key: "getNewlineReservedToken",\n value: function getNewlineReservedToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].RESERVED_NEWLINE,\n regex: this.RESERVED_NEWLINE_REGEX\n });\n }\n }, {\n key: "getTopLevelReservedTokenNoIndent",\n value: function getTopLevelReservedTokenNoIndent(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].RESERVED_TOP_LEVEL_NO_INDENT,\n regex: this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX\n });\n }\n }, {\n key: "getPlainReservedToken",\n value: function getPlainReservedToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].RESERVED,\n regex: this.RESERVED_PLAIN_REGEX\n });\n }\n }, {\n key: "getWordToken",\n value: function getWordToken(input) {\n return this.getTokenOnFirstMatch({\n input: input,\n type: _tokenTypes["default"].WORD,\n regex: this.WORD_REGEX\n });\n }\n }, {\n key: "getTokenOnFirstMatch",\n value: function getTokenOnFirstMatch(_ref3) {\n var input = _ref3.input,\n type = _ref3.type,\n regex = _ref3.regex;\n var matches = input.match(regex);\n return matches ? {\n type: type,\n value: matches[1]\n } : undefined;\n }\n }]);\n\n return Tokenizer;\n}();\n\nexports.default = Tokenizer;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/Tokenizer.js?')},1193:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.createOperatorRegex = createOperatorRegex;\nexports.createLineCommentRegex = createLineCommentRegex;\nexports.createReservedWordRegex = createReservedWordRegex;\nexports.createWordRegex = createWordRegex;\nexports.createStringRegex = createStringRegex;\nexports.createStringPattern = createStringPattern;\nexports.createParenRegex = createParenRegex;\nexports.createPlaceholderRegex = createPlaceholderRegex;\n\nvar _utils = __webpack_require__(9789);\n\nfunction createOperatorRegex(multiLetterOperators) {\n return new RegExp(\"^(\".concat((0, _utils.sortByLengthDesc)(multiLetterOperators).map(_utils.escapeRegExp).join('|'), \"|.)\"), 'u');\n}\n\nfunction createLineCommentRegex(lineCommentTypes) {\n return new RegExp(\"^((?:\".concat(lineCommentTypes.map(function (c) {\n return (0, _utils.escapeRegExp)(c);\n }).join('|'), \").*?)(?:\\r\\n|\\r|\\n|$)\"), 'u');\n}\n\nfunction createReservedWordRegex(reservedWords) {\n if (reservedWords.length === 0) {\n return new RegExp(\"^\\b$\", 'u');\n }\n\n var reservedWordsPattern = (0, _utils.sortByLengthDesc)(reservedWords).join('|').replace(/ /g, '\\\\s+');\n return new RegExp(\"^(\".concat(reservedWordsPattern, \")\\\\b\"), 'iu');\n}\n\nfunction createWordRegex() {\n var specialChars = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n return new RegExp(\"^([\\\\p{Alphabetic}\\\\p{Mark}\\\\p{Decimal_Number}\\\\p{Connector_Punctuation}\\\\p{Join_Control}\".concat(specialChars.join(''), \"]+)\"), 'u');\n}\n\nfunction createStringRegex(stringTypes) {\n return new RegExp('^(' + createStringPattern(stringTypes) + ')', 'u');\n} // This enables the following string patterns:\n// 1. backtick quoted string using `` to escape\n// 2. square bracket quoted string (SQL Server) using ]] to escape\n// 3. double quoted string using \"\" or \\\" to escape\n// 4. single quoted string using '' or \\' to escape\n// 5. national character quoted string using N'' or N\\' to escape\n// 6. Unicode single-quoted string using \\' to escape\n// 7. Unicode double-quoted string using \\\" to escape\n// 8. PostgreSQL dollar-quoted strings\n\n\nfunction createStringPattern(stringTypes) {\n var patterns = {\n '``': '((`[^`]*($|`))+)',\n '{}': '((\\\\{[^\\\\}]*($|\\\\}))+)',\n '[]': '((\\\\[[^\\\\]]*($|\\\\]))(\\\\][^\\\\]]*($|\\\\]))*)',\n '\"\"': '((\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*(\"|$))+)',\n \"''\": \"(('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"N''\": \"((N'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"U&''\": \"((U&'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n 'U&\"\"': '((U&\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*(\"|$))+)',\n $$: '((?<tag>\\\\$\\\\w*\\\\$)[\\\\s\\\\S]*?(?:\\\\k<tag>|$))'\n };\n return stringTypes.map(function (t) {\n return patterns[t];\n }).join('|');\n}\n\nfunction createParenRegex(parens) {\n return new RegExp('^(' + parens.map(escapeParen).join('|') + ')', 'iu');\n}\n\nfunction escapeParen(paren) {\n if (paren.length === 1) {\n // A single punctuation character\n return (0, _utils.escapeRegExp)(paren);\n } else {\n // longer word\n return '\\\\b' + paren + '\\\\b';\n }\n}\n\nfunction createPlaceholderRegex(types, pattern) {\n if ((0, _utils.isEmpty)(types)) {\n return false;\n }\n\n var typesRegex = types.map(_utils.escapeRegExp).join('|');\n return new RegExp(\"^((?:\".concat(typesRegex, \")(?:\").concat(pattern, \"))\"), 'u');\n}\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/regexFactory.js?")},6414:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.isEnd = exports.isWindow = exports.isBy = exports.isSet = exports.isLimit = exports.isBetween = exports.isAnd = void 0;\n\nvar _tokenTypes = _interopRequireDefault(__webpack_require__(9163));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\n\nvar isToken = function isToken(type, regex) {\n return function (token) {\n return (token === null || token === void 0 ? void 0 : token.type) === type && regex.test(token === null || token === void 0 ? void 0 : token.value);\n };\n};\n\nvar isAnd = isToken(_tokenTypes["default"].RESERVED_NEWLINE, /^AND$/i);\nexports.isAnd = isAnd;\nvar isBetween = isToken(_tokenTypes["default"].RESERVED, /^BETWEEN$/i);\nexports.isBetween = isBetween;\nvar isLimit = isToken(_tokenTypes["default"].RESERVED_TOP_LEVEL, /^LIMIT$/i);\nexports.isLimit = isLimit;\nvar isSet = isToken(_tokenTypes["default"].RESERVED_TOP_LEVEL, /^[S\\u017F]ET$/i);\nexports.isSet = isSet;\nvar isBy = isToken(_tokenTypes["default"].RESERVED, /^BY$/i);\nexports.isBy = isBy;\nvar isWindow = isToken(_tokenTypes["default"].RESERVED_TOP_LEVEL, /^WINDOW$/i);\nexports.isWindow = isWindow;\nvar isEnd = isToken(_tokenTypes["default"].CLOSE_PAREN, /^END$/i);\nexports.isEnd = isEnd;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/token.js?')},9163:(module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\n/**\n * Constants for token types\n */\nvar _default = {\n WORD: 'word',\n STRING: 'string',\n RESERVED: 'reserved',\n RESERVED_TOP_LEVEL: 'reserved-top-level',\n RESERVED_TOP_LEVEL_NO_INDENT: 'reserved-top-level-no-indent',\n RESERVED_NEWLINE: 'reserved-newline',\n OPERATOR: 'operator',\n OPEN_PAREN: 'open-paren',\n CLOSE_PAREN: 'close-paren',\n LINE_COMMENT: 'line-comment',\n BLOCK_COMMENT: 'block-comment',\n NUMBER: 'number',\n PLACEHOLDER: 'placeholder'\n};\nexports.default = _default;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@gethue/sql-formatter/lib/core/tokenTypes.js?")},5601:(module,exports,__webpack_require__)=>{"use strict";eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _Formatter2 = _interopRequireDefault(__webpack_require__(7332));\n\nvar _Tokenizer = _interopRequireDefault(__webpack_require__(4790));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar reservedWords = ['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', 'INCL