diff --git a/changelogs/fragments/8137.yml b/changelogs/fragments/8137.yml new file mode 100644 index 000000000000..78e5516f34a6 --- /dev/null +++ b/changelogs/fragments/8137.yml @@ -0,0 +1,2 @@ +refactor: +- [Workspace] Integrate dashboard admin with dynamic config ([#8137](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8137)) \ No newline at end of file diff --git a/changelogs/fragments/8833.yml b/changelogs/fragments/8833.yml new file mode 100644 index 000000000000..922656d7d8b8 --- /dev/null +++ b/changelogs/fragments/8833.yml @@ -0,0 +1,2 @@ +fix: +- Adds test id for workspace multi-deletion button ([#8833](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8833)) \ No newline at end of file diff --git a/changelogs/fragments/8834.yml b/changelogs/fragments/8834.yml new file mode 100644 index 000000000000..78796507a6e4 --- /dev/null +++ b/changelogs/fragments/8834.yml @@ -0,0 +1,2 @@ +refactor: +- [Workspace] Add unit tests for inspect page url ([#8834](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8834)) \ No newline at end of file diff --git a/changelogs/fragments/8839.yml b/changelogs/fragments/8839.yml new file mode 100644 index 000000000000..27477e376254 --- /dev/null +++ b/changelogs/fragments/8839.yml @@ -0,0 +1,2 @@ +fix: +- Fix a typo while inspecting values for large numerals in OSD and the JS client ([#8839](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8839)) \ No newline at end of file diff --git a/changelogs/fragments/8848.yml b/changelogs/fragments/8848.yml new file mode 100644 index 000000000000..f8cc51214cf5 --- /dev/null +++ b/changelogs/fragments/8848.yml @@ -0,0 +1,2 @@ +fix: +- Fix template queries loading and update getSampleQuery interface ([#8848](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8848)) \ No newline at end of file diff --git a/changelogs/fragments/8851.yml b/changelogs/fragments/8851.yml new file mode 100644 index 000000000000..b006f3eee529 --- /dev/null +++ b/changelogs/fragments/8851.yml @@ -0,0 +1,3 @@ +feat: +- Add framework to show banner at the top in discover results canvas ([#8851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8851)) +- Show indexed views in dataset selector ([#8851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8851)) \ No newline at end of file diff --git a/changelogs/fragments/8857.yml b/changelogs/fragments/8857.yml new file mode 100644 index 000000000000..45d5fa5c5213 --- /dev/null +++ b/changelogs/fragments/8857.yml @@ -0,0 +1,2 @@ +fix: +- [Workspace][Bug] Fix inspect page url error. ([#8857](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8857)) \ No newline at end of file diff --git a/changelogs/fragments/8863.yml b/changelogs/fragments/8863.yml new file mode 100644 index 000000000000..51dc8d37cc2f --- /dev/null +++ b/changelogs/fragments/8863.yml @@ -0,0 +1,2 @@ +fix: +- Keep previous query result if current query result in error ([#8863](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8863)) \ No newline at end of file diff --git a/changelogs/fragments/8866.yml b/changelogs/fragments/8866.yml new file mode 100644 index 000000000000..9d328bf54e5b --- /dev/null +++ b/changelogs/fragments/8866.yml @@ -0,0 +1,2 @@ +fix: +- Hide Date Picker for Unsupported Types ([#8866](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8866)) \ No newline at end of file diff --git a/changelogs/fragments/8867.yml b/changelogs/fragments/8867.yml new file mode 100644 index 000000000000..384f388393c4 --- /dev/null +++ b/changelogs/fragments/8867.yml @@ -0,0 +1,2 @@ +fix: +- Add max height and scroll to error message body ([#8867](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8867)) \ No newline at end of file diff --git a/changelogs/fragments/8871.yml b/changelogs/fragments/8871.yml new file mode 100644 index 000000000000..032a928fd5c0 --- /dev/null +++ b/changelogs/fragments/8871.yml @@ -0,0 +1,2 @@ +fix: +- Search on page load out of sync state when clicking submit. ([#8871](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8871)) \ No newline at end of file diff --git a/packages/osd-std/src/json.test.ts b/packages/osd-std/src/json.test.ts index 33abd71d91d2..0d4b900e0ca5 100644 --- a/packages/osd-std/src/json.test.ts +++ b/packages/osd-std/src/json.test.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import JSON11 from 'json11'; import { stringify, parse } from './json'; describe('json', () => { @@ -90,9 +91,55 @@ describe('json', () => { expect(stringify(input, replacer, 2)).toEqual(JSON.stringify(input, replacer, 2)); }); - it('can handle long numerals while parsing', () => { - const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n; - const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n; + it('can handle positive long numerals while parsing', () => { + const longPositiveA = BigInt(Number.MAX_SAFE_INTEGER) * 2n; + const longPositiveB = BigInt(Number.MAX_SAFE_INTEGER) * 2n + 1n; + const text = + `{` + + // The space before and after the values, and the lack of spaces before comma are intentional + `"\\":${longPositiveA}": "[ ${longPositiveB.toString()}, ${longPositiveA.toString()} ]", ` + + `"positive": ${longPositiveA.toString()}, ` + + `"array": [ ${longPositiveB.toString()}, ${longPositiveA.toString()} ], ` + + `"negative": ${longPositiveB.toString()},` + + `"number": 102931203123987` + + `}`; + + const result = parse(text); + expect(result.positive).toBe(longPositiveA); + expect(result.negative).toBe(longPositiveB); + expect(result.array).toEqual([longPositiveB, longPositiveA]); + expect(result['":' + longPositiveA]).toBe( + `[ ${longPositiveB.toString()}, ${longPositiveA.toString()} ]` + ); + expect(result.number).toBe(102931203123987); + }); + + it('can handle negative long numerals while parsing', () => { + const longNegativeA = BigInt(Number.MIN_SAFE_INTEGER) * 2n; + const longNegativeB = BigInt(Number.MIN_SAFE_INTEGER) * 2n - 1n; + const text = + `{` + + // The space before and after the values, and the lack of spaces before comma are intentional + `"\\":${longNegativeA}": "[ ${longNegativeB.toString()}, ${longNegativeA.toString()} ]", ` + + `"positive": ${longNegativeA.toString()}, ` + + `"array": [ ${longNegativeB.toString()}, ${longNegativeA.toString()} ], ` + + `"negative": ${longNegativeB.toString()},` + + `"number": 102931203123987` + + `}`; + + const result = parse(text); + expect(result.positive).toBe(longNegativeA); + expect(result.negative).toBe(longNegativeB); + expect(result.array).toEqual([longNegativeB, longNegativeA]); + expect(result['":' + longNegativeA]).toBe( + `[ ${longNegativeB.toString()}, ${longNegativeA.toString()} ]` + ); + expect(result.number).toBe(102931203123987); + }); + + it('can handle mixed long numerals while parsing', () => { + const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n + 1n; + const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n - 1n; const text = `{` + // The space before and after the values, and the lack of spaces before comma are intentional @@ -113,6 +160,37 @@ describe('json', () => { expect(result.number).toBe(102931203123987); }); + it('does not use JSON11 when not needed', () => { + const spyParse = jest.spyOn(JSON11, 'parse'); + + const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n + 1n; + const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n - 1n; + const text = + `{` + + `"\\":${longPositive}": "[ ${longNegative.toString()}, ${longPositive.toString()} ]", ` + + `"number": 102931203123987` + + `}`; + parse(text); + + expect(spyParse).not.toHaveBeenCalled(); + }); + + it('uses JSON11 when dealing with long numerals', () => { + const spyParse = jest.spyOn(JSON11, 'parse'); + + const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n + 1n; + const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n - 1n; + const text = + `{` + + `"\\":${longPositive}": "[ ${longNegative.toString()}, ${longPositive.toString()} ]", ` + + `"positive": ${longPositive.toString()}, ` + + `"number": 102931203123987` + + `}`; + parse(text); + + expect(spyParse).toHaveBeenCalled(); + }); + it('can handle BigInt values while stringifying', () => { const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n; const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n; diff --git a/packages/osd-std/src/json.ts b/packages/osd-std/src/json.ts index 4dcd3eb03e65..79a148f625f7 100644 --- a/packages/osd-std/src/json.ts +++ b/packages/osd-std/src/json.ts @@ -69,7 +69,7 @@ export const parse = ( numeralsAreNumbers && typeof val === 'number' && isFinite(val) && - (val < Number.MAX_SAFE_INTEGER || val > Number.MAX_SAFE_INTEGER) + (val < Number.MIN_SAFE_INTEGER || val > Number.MAX_SAFE_INTEGER) ) { numeralsAreNumbers = false; } diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 7865473ee494..59be50284dca 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -84,6 +84,15 @@ const run = async () => { }, ]) ); + //ToDo: Remove when opensearch-js is released to include https://github.com/opensearch-project/opensearch-js/pull/889 + promises.push( + patchFile('node_modules/@opensearch-project/opensearch/lib/Serializer.js', [ + { + from: 'val < Number.MAX_SAFE_INTEGER', + to: 'val < Number.MIN_SAFE_INTEGER', + }, + ]) + ); await Promise.all(promises); }; diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index 1c85995f814b..5cfa4503537d 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { ToolingLog } from '@osd/dev-utils'; import { join, resolve } from 'path'; import { readFileSync, writeFileSync, Dirent, rm, rename, promises as fsPromises } from 'fs'; import { load as loadYaml } from 'js-yaml'; @@ -19,6 +20,11 @@ import { filePath, } from './generate_release_note_helper'; +const log = new ToolingLog({ + level: 'info', + writeTo: process.stdout, +}); + // Function to add content after the 'Unreleased' section in the changelog function addContentAfterUnreleased(path: string, newContent: string): void { let fileContent = readFileSync(path, 'utf8'); @@ -60,35 +66,63 @@ async function readFragments() { ) as unknown) as Changelog; const fragmentPaths = await readdir(fragmentDirPath, { withFileTypes: true }); + const failedFragments: string[] = []; + for (const fragmentFilename of fragmentPaths) { // skip non yml or yaml files if (!/\.ya?ml$/i.test(fragmentFilename.name)) { - // eslint-disable-next-line no-console - console.warn(`Skipping non yml or yaml file ${fragmentFilename.name}`); + log.info(`Skipping non yml or yaml file ${fragmentFilename.name}`); continue; } - const fragmentPath = join(fragmentDirPath, fragmentFilename.name); - const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); - - validateFragment(fragmentContents); - - const fragmentContentLines = fragmentContents.split('\n'); - // Adding a quotes to the second line and escaping exisiting " within the line - fragmentContentLines[1] = fragmentContentLines[1].replace(/-\s*(.*)/, (match, p1) => { - // Escape any existing quotes in the content - const escapedContent = p1.replace(/"/g, '\\"'); - return `- "${escapedContent}"`; - }); - - const processedFragmentContent = fragmentContentLines.join('\n'); - - const fragmentYaml = loadYaml(processedFragmentContent) as Changelog; - for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { - sections[sectionKey as SectionKey].push(...entries); + try { + const fragmentPath = join(fragmentDirPath, fragmentFilename.name); + const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); + + try { + validateFragment(fragmentContents); + } catch (validationError) { + log.info(`Validation failed for ${fragmentFilename.name}: ${validationError.message}`); + failedFragments.push( + `${fragmentFilename.name} (Validation Error: ${validationError.message})` + ); + continue; + } + + const fragmentContentLines = fragmentContents.split('\n'); + // Adding a quotes to the second line and escaping existing " within the line + fragmentContentLines[1] = fragmentContentLines[1].replace(/-\s*(.*)/, (match, p1) => { + // Escape any existing quotes in the content + const escapedContent = p1.replace(/"/g, '\\"'); + return `- "${escapedContent}"`; + }); + + const processedFragmentContent = fragmentContentLines.join('\n'); + + try { + const fragmentYaml = loadYaml(processedFragmentContent) as Changelog; + for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { + sections[sectionKey as SectionKey].push(...entries); + } + } catch (yamlError) { + log.info(`Failed to parse YAML in ${fragmentFilename.name}: ${yamlError.message}`); + failedFragments.push(`${fragmentFilename.name} (YAML Parse Error: ${yamlError.message})`); + continue; + } + } catch (error) { + log.info(`Failed to process ${fragmentFilename.name}: ${error.message}`); + failedFragments.push(`${fragmentFilename.name} (Processing Error: ${error.message})`); + continue; } } - return { sections, fragmentPaths }; + + if (failedFragments.length > 0) { + log.info('\nThe following changelog fragments were skipped due to errors:'); + failedFragments.forEach((fragment) => log.info(`- ${fragment}`)); + log.info('\nPlease review and fix these fragments for inclusion in the next release.\n'); + } + + return { sections, fragmentPaths, failedFragments }; } async function moveFragments(fragmentPaths: Dirent[], fragmentTempDirPath: string): Promise { @@ -128,16 +162,22 @@ function generateReleaseNote(changelogSections: string[]) { } (async () => { - const { sections, fragmentPaths } = await readFragments(); - // create folder for temp fragments - const fragmentTempDirPath = await fsPromises.mkdtemp(join(fragmentDirPath, 'tmp_fragments-')); - // move fragments to temp fragments folder - await moveFragments(fragmentPaths, fragmentTempDirPath); + const { sections, fragmentPaths, failedFragments } = await readFragments(); - const changelogSections = generateChangelog(sections); + // Only proceed if we have some valid fragments + if (Object.values(sections).some((section) => section.length > 0)) { + // create folder for temp fragments + const fragmentTempDirPath = await fsPromises.mkdtemp(join(fragmentDirPath, 'tmp_fragments-')); + // move fragments to temp fragments folder + await moveFragments(fragmentPaths, fragmentTempDirPath); - generateReleaseNote(changelogSections); + const changelogSections = generateChangelog(sections); + generateReleaseNote(changelogSections); - // remove temp fragments folder - await deleteFragments(fragmentTempDirPath); + // remove temp fragments folder + await deleteFragments(fragmentTempDirPath); + } else { + log.error('No valid changelog entries were found. Release notes generation aborted.'); + process.exit(1); + } })(); diff --git a/src/plugins/data/common/datasets/types.ts b/src/plugins/data/common/datasets/types.ts index e777eb8a45e8..ceffbd678218 100644 --- a/src/plugins/data/common/datasets/types.ts +++ b/src/plugins/data/common/datasets/types.ts @@ -247,6 +247,13 @@ export interface Dataset extends BaseDataset { timeFieldName?: string; /** Optional language to default to from the language selector */ language?: string; + /** Optional reference to the source dataset. Example usage is for indexed views to store the + * reference to the table dataset + */ + sourceDatasetRef?: { + id: string; + type: string; + }; } export interface DatasetField { diff --git a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLLexer.ts b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLLexer.ts index 554bd90f22fd..d9fb44016e20 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLLexer.ts +++ b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLLexer.ts @@ -1,4 +1,4 @@ -// Generated from grammar/OpenSearchPPLLexer.g4 by ANTLR 4.13.1 +// Generated from ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLLexer.g4 by ANTLR 4.13.1 import * as antlr from "antlr4ng"; import { Token } from "antlr4ng"; diff --git a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.interp b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.interp index d7aef0145ffd..5f9afe06d813 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.interp +++ b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.interp @@ -794,4 +794,4 @@ keywordsCanBeId atn: -[4, 1, 336, 1111, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 1, 0, 3, 0, 230, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 5, 3, 241, 8, 3, 10, 3, 12, 3, 244, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 249, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 267, 8, 5, 1, 6, 3, 6, 270, 8, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 285, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 293, 8, 11, 10, 11, 12, 11, 296, 9, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 302, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 307, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 312, 8, 12, 1, 12, 1, 12, 1, 12, 5, 12, 317, 8, 12, 10, 12, 12, 12, 320, 9, 12, 1, 12, 3, 12, 323, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 328, 8, 12, 1, 13, 1, 13, 3, 13, 332, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 338, 8, 13, 1, 13, 1, 13, 1, 13, 3, 13, 343, 8, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 352, 8, 15, 10, 15, 12, 15, 355, 9, 15, 1, 16, 1, 16, 3, 16, 359, 8, 16, 1, 16, 1, 16, 3, 16, 363, 8, 16, 1, 17, 1, 17, 3, 17, 367, 8, 17, 1, 17, 1, 17, 3, 17, 371, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 376, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 388, 8, 21, 10, 21, 12, 21, 391, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 401, 8, 22, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 407, 8, 24, 10, 24, 12, 24, 410, 9, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 421, 8, 25, 1, 26, 1, 26, 5, 26, 425, 8, 26, 10, 26, 12, 26, 428, 9, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 466, 8, 27, 1, 28, 1, 28, 5, 28, 470, 8, 28, 10, 28, 12, 28, 473, 9, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 485, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 505, 8, 34, 1, 35, 1, 35, 1, 35, 3, 35, 510, 8, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 518, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 5, 37, 525, 8, 37, 10, 37, 12, 37, 528, 9, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 3, 39, 537, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 554, 8, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 563, 8, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 3, 44, 578, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 586, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 593, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 5, 45, 599, 8, 45, 10, 45, 12, 45, 602, 9, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 612, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 3, 47, 623, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 629, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 642, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 651, 8, 52, 10, 52, 12, 52, 654, 9, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 664, 8, 53, 10, 53, 12, 53, 667, 9, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 674, 8, 53, 10, 53, 12, 53, 677, 9, 53, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 683, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 5, 56, 693, 8, 56, 10, 56, 12, 56, 696, 9, 56, 1, 57, 1, 57, 1, 57, 5, 57, 701, 8, 57, 10, 57, 12, 57, 704, 9, 57, 1, 58, 3, 58, 707, 8, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 732, 8, 59, 1, 60, 1, 60, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 765, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 773, 8, 66, 1, 67, 1, 67, 1, 67, 5, 67, 778, 8, 67, 10, 67, 12, 67, 781, 9, 67, 3, 67, 783, 8, 67, 1, 68, 1, 68, 1, 68, 3, 68, 788, 8, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 806, 8, 71, 1, 72, 1, 72, 3, 72, 810, 8, 72, 1, 73, 1, 73, 3, 73, 814, 8, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 820, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 845, 8, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 84, 1, 84, 3, 84, 873, 8, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 87, 1, 87, 1, 88, 1, 88, 1, 89, 1, 89, 1, 90, 1, 90, 1, 91, 1, 91, 1, 92, 1, 92, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 3, 94, 906, 8, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 97, 3, 97, 915, 8, 97, 1, 97, 1, 97, 1, 98, 3, 98, 920, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 3, 100, 929, 8, 100, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 5, 106, 948, 8, 106, 10, 106, 12, 106, 951, 9, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 5, 109, 962, 8, 109, 10, 109, 12, 109, 965, 9, 109, 1, 110, 3, 110, 968, 8, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 977, 8, 110, 1, 111, 3, 111, 980, 8, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 5, 112, 987, 8, 112, 10, 112, 12, 112, 990, 9, 112, 1, 112, 3, 112, 993, 8, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 3, 112, 1007, 8, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 3, 113, 1109, 8, 113, 1, 113, 0, 1, 90, 114, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 0, 20, 1, 0, 118, 119, 1, 0, 18, 19, 2, 0, 137, 137, 171, 171, 5, 0, 135, 136, 140, 140, 143, 143, 148, 148, 150, 153, 3, 0, 7, 7, 56, 56, 289, 319, 1, 0, 195, 204, 13, 0, 68, 70, 74, 74, 76, 76, 79, 79, 82, 82, 84, 84, 86, 87, 89, 92, 94, 97, 205, 222, 224, 225, 227, 243, 246, 255, 4, 0, 69, 69, 212, 212, 241, 241, 243, 243, 8, 0, 70, 70, 76, 76, 82, 82, 84, 84, 89, 89, 91, 92, 95, 95, 97, 97, 8, 0, 71, 73, 75, 75, 77, 78, 80, 80, 85, 85, 88, 88, 93, 93, 98, 98, 1, 0, 244, 245, 1, 0, 275, 280, 2, 0, 256, 260, 262, 273, 2, 0, 67, 67, 112, 117, 1, 0, 282, 285, 1, 0, 286, 288, 1, 0, 333, 334, 1, 0, 65, 66, 9, 0, 70, 73, 75, 78, 80, 80, 82, 82, 84, 85, 88, 89, 91, 93, 95, 95, 97, 98, 9, 0, 31, 31, 70, 70, 76, 76, 83, 84, 89, 89, 91, 92, 95, 95, 97, 97, 321, 327, 1258, 0, 229, 1, 0, 0, 0, 2, 233, 1, 0, 0, 0, 4, 235, 1, 0, 0, 0, 6, 237, 1, 0, 0, 0, 8, 248, 1, 0, 0, 0, 10, 266, 1, 0, 0, 0, 12, 269, 1, 0, 0, 0, 14, 273, 1, 0, 0, 0, 16, 276, 1, 0, 0, 0, 18, 279, 1, 0, 0, 0, 20, 282, 1, 0, 0, 0, 22, 288, 1, 0, 0, 0, 24, 297, 1, 0, 0, 0, 26, 329, 1, 0, 0, 0, 28, 344, 1, 0, 0, 0, 30, 347, 1, 0, 0, 0, 32, 356, 1, 0, 0, 0, 34, 364, 1, 0, 0, 0, 36, 372, 1, 0, 0, 0, 38, 377, 1, 0, 0, 0, 40, 381, 1, 0, 0, 0, 42, 385, 1, 0, 0, 0, 44, 400, 1, 0, 0, 0, 46, 402, 1, 0, 0, 0, 48, 404, 1, 0, 0, 0, 50, 420, 1, 0, 0, 0, 52, 422, 1, 0, 0, 0, 54, 465, 1, 0, 0, 0, 56, 467, 1, 0, 0, 0, 58, 474, 1, 0, 0, 0, 60, 484, 1, 0, 0, 0, 62, 486, 1, 0, 0, 0, 64, 488, 1, 0, 0, 0, 66, 492, 1, 0, 0, 0, 68, 504, 1, 0, 0, 0, 70, 506, 1, 0, 0, 0, 72, 511, 1, 0, 0, 0, 74, 521, 1, 0, 0, 0, 76, 529, 1, 0, 0, 0, 78, 533, 1, 0, 0, 0, 80, 553, 1, 0, 0, 0, 82, 555, 1, 0, 0, 0, 84, 557, 1, 0, 0, 0, 86, 566, 1, 0, 0, 0, 88, 577, 1, 0, 0, 0, 90, 585, 1, 0, 0, 0, 92, 611, 1, 0, 0, 0, 94, 622, 1, 0, 0, 0, 96, 628, 1, 0, 0, 0, 98, 630, 1, 0, 0, 0, 100, 637, 1, 0, 0, 0, 102, 641, 1, 0, 0, 0, 104, 643, 1, 0, 0, 0, 106, 657, 1, 0, 0, 0, 108, 682, 1, 0, 0, 0, 110, 684, 1, 0, 0, 0, 112, 689, 1, 0, 0, 0, 114, 697, 1, 0, 0, 0, 116, 706, 1, 0, 0, 0, 118, 731, 1, 0, 0, 0, 120, 733, 1, 0, 0, 0, 122, 735, 1, 0, 0, 0, 124, 737, 1, 0, 0, 0, 126, 742, 1, 0, 0, 0, 128, 749, 1, 0, 0, 0, 130, 764, 1, 0, 0, 0, 132, 772, 1, 0, 0, 0, 134, 782, 1, 0, 0, 0, 136, 787, 1, 0, 0, 0, 138, 791, 1, 0, 0, 0, 140, 795, 1, 0, 0, 0, 142, 805, 1, 0, 0, 0, 144, 809, 1, 0, 0, 0, 146, 813, 1, 0, 0, 0, 148, 815, 1, 0, 0, 0, 150, 819, 1, 0, 0, 0, 152, 844, 1, 0, 0, 0, 154, 846, 1, 0, 0, 0, 156, 848, 1, 0, 0, 0, 158, 850, 1, 0, 0, 0, 160, 857, 1, 0, 0, 0, 162, 859, 1, 0, 0, 0, 164, 866, 1, 0, 0, 0, 166, 868, 1, 0, 0, 0, 168, 872, 1, 0, 0, 0, 170, 874, 1, 0, 0, 0, 172, 883, 1, 0, 0, 0, 174, 885, 1, 0, 0, 0, 176, 887, 1, 0, 0, 0, 178, 889, 1, 0, 0, 0, 180, 891, 1, 0, 0, 0, 182, 893, 1, 0, 0, 0, 184, 895, 1, 0, 0, 0, 186, 897, 1, 0, 0, 0, 188, 905, 1, 0, 0, 0, 190, 907, 1, 0, 0, 0, 192, 911, 1, 0, 0, 0, 194, 914, 1, 0, 0, 0, 196, 919, 1, 0, 0, 0, 198, 923, 1, 0, 0, 0, 200, 928, 1, 0, 0, 0, 202, 930, 1, 0, 0, 0, 204, 933, 1, 0, 0, 0, 206, 936, 1, 0, 0, 0, 208, 939, 1, 0, 0, 0, 210, 941, 1, 0, 0, 0, 212, 943, 1, 0, 0, 0, 214, 954, 1, 0, 0, 0, 216, 956, 1, 0, 0, 0, 218, 958, 1, 0, 0, 0, 220, 976, 1, 0, 0, 0, 222, 979, 1, 0, 0, 0, 224, 1006, 1, 0, 0, 0, 226, 1108, 1, 0, 0, 0, 228, 230, 3, 2, 1, 0, 229, 228, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 5, 0, 0, 1, 232, 1, 1, 0, 0, 0, 233, 234, 3, 4, 2, 0, 234, 3, 1, 0, 0, 0, 235, 236, 3, 6, 3, 0, 236, 5, 1, 0, 0, 0, 237, 242, 3, 8, 4, 0, 238, 239, 5, 109, 0, 0, 239, 241, 3, 10, 5, 0, 240, 238, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 7, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 249, 3, 12, 6, 0, 246, 249, 3, 14, 7, 0, 247, 249, 3, 16, 8, 0, 248, 245, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 9, 1, 0, 0, 0, 250, 267, 3, 18, 9, 0, 251, 267, 3, 20, 10, 0, 252, 267, 3, 22, 11, 0, 253, 267, 3, 24, 12, 0, 254, 267, 3, 26, 13, 0, 255, 267, 3, 28, 14, 0, 256, 267, 3, 30, 15, 0, 257, 267, 3, 32, 16, 0, 258, 267, 3, 34, 17, 0, 259, 267, 3, 36, 18, 0, 260, 267, 3, 38, 19, 0, 261, 267, 3, 40, 20, 0, 262, 267, 3, 42, 21, 0, 263, 267, 3, 48, 24, 0, 264, 267, 3, 52, 26, 0, 265, 267, 3, 56, 28, 0, 266, 250, 1, 0, 0, 0, 266, 251, 1, 0, 0, 0, 266, 252, 1, 0, 0, 0, 266, 253, 1, 0, 0, 0, 266, 254, 1, 0, 0, 0, 266, 255, 1, 0, 0, 0, 266, 256, 1, 0, 0, 0, 266, 257, 1, 0, 0, 0, 266, 258, 1, 0, 0, 0, 266, 259, 1, 0, 0, 0, 266, 260, 1, 0, 0, 0, 266, 261, 1, 0, 0, 0, 266, 262, 1, 0, 0, 0, 266, 263, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 11, 1, 0, 0, 0, 268, 270, 5, 2, 0, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 3, 60, 30, 0, 272, 13, 1, 0, 0, 0, 273, 274, 5, 3, 0, 0, 274, 275, 3, 62, 31, 0, 275, 15, 1, 0, 0, 0, 276, 277, 5, 4, 0, 0, 277, 278, 5, 33, 0, 0, 278, 17, 1, 0, 0, 0, 279, 280, 5, 6, 0, 0, 280, 281, 3, 90, 45, 0, 281, 19, 1, 0, 0, 0, 282, 284, 5, 7, 0, 0, 283, 285, 7, 0, 0, 0, 284, 283, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 3, 112, 56, 0, 287, 21, 1, 0, 0, 0, 288, 289, 5, 8, 0, 0, 289, 294, 3, 64, 32, 0, 290, 291, 5, 110, 0, 0, 291, 293, 3, 64, 32, 0, 292, 290, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 23, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 301, 5, 9, 0, 0, 298, 299, 5, 42, 0, 0, 299, 300, 5, 112, 0, 0, 300, 302, 3, 194, 97, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 306, 1, 0, 0, 0, 303, 304, 5, 43, 0, 0, 304, 305, 5, 112, 0, 0, 305, 307, 3, 198, 99, 0, 306, 303, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 311, 1, 0, 0, 0, 308, 309, 5, 44, 0, 0, 309, 310, 5, 112, 0, 0, 310, 312, 3, 192, 96, 0, 311, 308, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 318, 3, 78, 39, 0, 314, 315, 5, 110, 0, 0, 315, 317, 3, 78, 39, 0, 316, 314, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 3, 68, 34, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 327, 1, 0, 0, 0, 324, 325, 5, 41, 0, 0, 325, 326, 5, 112, 0, 0, 326, 328, 3, 198, 99, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 25, 1, 0, 0, 0, 329, 331, 5, 10, 0, 0, 330, 332, 3, 194, 97, 0, 331, 330, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 337, 3, 112, 56, 0, 334, 335, 5, 39, 0, 0, 335, 336, 5, 112, 0, 0, 336, 338, 3, 198, 99, 0, 337, 334, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 342, 1, 0, 0, 0, 339, 340, 5, 40, 0, 0, 340, 341, 5, 112, 0, 0, 341, 343, 3, 198, 99, 0, 342, 339, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 27, 1, 0, 0, 0, 344, 345, 5, 11, 0, 0, 345, 346, 3, 74, 37, 0, 346, 29, 1, 0, 0, 0, 347, 348, 5, 12, 0, 0, 348, 353, 3, 76, 38, 0, 349, 350, 5, 110, 0, 0, 350, 352, 3, 76, 38, 0, 351, 349, 1, 0, 0, 0, 352, 355, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 31, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 356, 358, 5, 13, 0, 0, 357, 359, 3, 194, 97, 0, 358, 357, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 361, 5, 5, 0, 0, 361, 363, 3, 194, 97, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 33, 1, 0, 0, 0, 364, 366, 5, 14, 0, 0, 365, 367, 3, 194, 97, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 3, 112, 56, 0, 369, 371, 3, 66, 33, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 35, 1, 0, 0, 0, 372, 373, 5, 15, 0, 0, 373, 375, 3, 112, 56, 0, 374, 376, 3, 66, 33, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 37, 1, 0, 0, 0, 377, 378, 5, 20, 0, 0, 378, 379, 3, 88, 44, 0, 379, 380, 3, 192, 96, 0, 380, 39, 1, 0, 0, 0, 381, 382, 5, 16, 0, 0, 382, 383, 3, 88, 44, 0, 383, 384, 3, 192, 96, 0, 384, 41, 1, 0, 0, 0, 385, 389, 5, 22, 0, 0, 386, 388, 3, 44, 22, 0, 387, 386, 1, 0, 0, 0, 388, 391, 1, 0, 0, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 392, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 392, 393, 3, 88, 44, 0, 393, 43, 1, 0, 0, 0, 394, 395, 5, 23, 0, 0, 395, 396, 5, 112, 0, 0, 396, 401, 3, 192, 96, 0, 397, 398, 5, 21, 0, 0, 398, 399, 5, 112, 0, 0, 399, 401, 3, 192, 96, 0, 400, 394, 1, 0, 0, 0, 400, 397, 1, 0, 0, 0, 401, 45, 1, 0, 0, 0, 402, 403, 7, 1, 0, 0, 403, 47, 1, 0, 0, 0, 404, 408, 5, 24, 0, 0, 405, 407, 3, 50, 25, 0, 406, 405, 1, 0, 0, 0, 407, 410, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 49, 1, 0, 0, 0, 410, 408, 1, 0, 0, 0, 411, 412, 5, 45, 0, 0, 412, 413, 5, 112, 0, 0, 413, 421, 3, 194, 97, 0, 414, 415, 5, 46, 0, 0, 415, 416, 5, 112, 0, 0, 416, 421, 3, 194, 97, 0, 417, 418, 5, 47, 0, 0, 418, 419, 5, 112, 0, 0, 419, 421, 3, 192, 96, 0, 420, 411, 1, 0, 0, 0, 420, 414, 1, 0, 0, 0, 420, 417, 1, 0, 0, 0, 421, 51, 1, 0, 0, 0, 422, 426, 5, 25, 0, 0, 423, 425, 3, 54, 27, 0, 424, 423, 1, 0, 0, 0, 425, 428, 1, 0, 0, 0, 426, 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 53, 1, 0, 0, 0, 428, 426, 1, 0, 0, 0, 429, 430, 5, 48, 0, 0, 430, 431, 5, 112, 0, 0, 431, 466, 3, 194, 97, 0, 432, 433, 5, 49, 0, 0, 433, 434, 5, 112, 0, 0, 434, 466, 3, 194, 97, 0, 435, 436, 5, 50, 0, 0, 436, 437, 5, 112, 0, 0, 437, 466, 3, 194, 97, 0, 438, 439, 5, 51, 0, 0, 439, 440, 5, 112, 0, 0, 440, 466, 3, 194, 97, 0, 441, 442, 5, 52, 0, 0, 442, 443, 5, 112, 0, 0, 443, 466, 3, 196, 98, 0, 444, 445, 5, 53, 0, 0, 445, 446, 5, 112, 0, 0, 446, 466, 3, 196, 98, 0, 447, 448, 5, 54, 0, 0, 448, 449, 5, 112, 0, 0, 449, 466, 3, 192, 96, 0, 450, 451, 5, 55, 0, 0, 451, 452, 5, 112, 0, 0, 452, 466, 3, 192, 96, 0, 453, 454, 5, 215, 0, 0, 454, 455, 5, 112, 0, 0, 455, 466, 3, 192, 96, 0, 456, 457, 5, 56, 0, 0, 457, 458, 5, 112, 0, 0, 458, 466, 3, 192, 96, 0, 459, 460, 5, 57, 0, 0, 460, 461, 5, 112, 0, 0, 461, 466, 3, 194, 97, 0, 462, 463, 5, 58, 0, 0, 463, 464, 5, 112, 0, 0, 464, 466, 3, 196, 98, 0, 465, 429, 1, 0, 0, 0, 465, 432, 1, 0, 0, 0, 465, 435, 1, 0, 0, 0, 465, 438, 1, 0, 0, 0, 465, 441, 1, 0, 0, 0, 465, 444, 1, 0, 0, 0, 465, 447, 1, 0, 0, 0, 465, 450, 1, 0, 0, 0, 465, 453, 1, 0, 0, 0, 465, 456, 1, 0, 0, 0, 465, 459, 1, 0, 0, 0, 465, 462, 1, 0, 0, 0, 466, 55, 1, 0, 0, 0, 467, 471, 5, 26, 0, 0, 468, 470, 3, 58, 29, 0, 469, 468, 1, 0, 0, 0, 470, 473, 1, 0, 0, 0, 471, 469, 1, 0, 0, 0, 471, 472, 1, 0, 0, 0, 472, 57, 1, 0, 0, 0, 473, 471, 1, 0, 0, 0, 474, 475, 3, 220, 110, 0, 475, 476, 5, 112, 0, 0, 476, 477, 3, 188, 94, 0, 477, 59, 1, 0, 0, 0, 478, 479, 5, 29, 0, 0, 479, 480, 5, 112, 0, 0, 480, 485, 3, 62, 31, 0, 481, 482, 5, 30, 0, 0, 482, 483, 5, 112, 0, 0, 483, 485, 3, 62, 31, 0, 484, 478, 1, 0, 0, 0, 484, 481, 1, 0, 0, 0, 485, 61, 1, 0, 0, 0, 486, 487, 3, 108, 54, 0, 487, 63, 1, 0, 0, 0, 488, 489, 3, 122, 61, 0, 489, 490, 5, 27, 0, 0, 490, 491, 3, 122, 61, 0, 491, 65, 1, 0, 0, 0, 492, 493, 5, 28, 0, 0, 493, 494, 3, 112, 56, 0, 494, 67, 1, 0, 0, 0, 495, 496, 5, 28, 0, 0, 496, 505, 3, 112, 56, 0, 497, 498, 5, 28, 0, 0, 498, 505, 3, 70, 35, 0, 499, 500, 5, 28, 0, 0, 500, 501, 3, 70, 35, 0, 501, 502, 5, 110, 0, 0, 502, 503, 3, 112, 56, 0, 503, 505, 1, 0, 0, 0, 504, 495, 1, 0, 0, 0, 504, 497, 1, 0, 0, 0, 504, 499, 1, 0, 0, 0, 505, 69, 1, 0, 0, 0, 506, 509, 3, 72, 36, 0, 507, 508, 5, 27, 0, 0, 508, 510, 3, 214, 107, 0, 509, 507, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 71, 1, 0, 0, 0, 511, 512, 5, 320, 0, 0, 512, 513, 5, 125, 0, 0, 513, 514, 3, 120, 60, 0, 514, 515, 5, 110, 0, 0, 515, 517, 3, 188, 94, 0, 516, 518, 3, 210, 105, 0, 517, 516, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 520, 5, 126, 0, 0, 520, 73, 1, 0, 0, 0, 521, 526, 3, 116, 58, 0, 522, 523, 5, 110, 0, 0, 523, 525, 3, 116, 58, 0, 524, 522, 1, 0, 0, 0, 525, 528, 1, 0, 0, 0, 526, 524, 1, 0, 0, 0, 526, 527, 1, 0, 0, 0, 527, 75, 1, 0, 0, 0, 528, 526, 1, 0, 0, 0, 529, 530, 3, 120, 60, 0, 530, 531, 5, 112, 0, 0, 531, 532, 3, 88, 44, 0, 532, 77, 1, 0, 0, 0, 533, 536, 3, 80, 40, 0, 534, 535, 5, 27, 0, 0, 535, 537, 3, 122, 61, 0, 536, 534, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 79, 1, 0, 0, 0, 538, 539, 3, 82, 41, 0, 539, 540, 5, 125, 0, 0, 540, 541, 3, 94, 47, 0, 541, 542, 5, 126, 0, 0, 542, 554, 1, 0, 0, 0, 543, 544, 5, 136, 0, 0, 544, 545, 5, 125, 0, 0, 545, 554, 5, 126, 0, 0, 546, 547, 7, 2, 0, 0, 547, 548, 5, 125, 0, 0, 548, 549, 3, 94, 47, 0, 549, 550, 5, 126, 0, 0, 550, 554, 1, 0, 0, 0, 551, 554, 3, 86, 43, 0, 552, 554, 3, 84, 42, 0, 553, 538, 1, 0, 0, 0, 553, 543, 1, 0, 0, 0, 553, 546, 1, 0, 0, 0, 553, 551, 1, 0, 0, 0, 553, 552, 1, 0, 0, 0, 554, 81, 1, 0, 0, 0, 555, 556, 7, 3, 0, 0, 556, 83, 1, 0, 0, 0, 557, 558, 5, 155, 0, 0, 558, 559, 5, 125, 0, 0, 559, 562, 3, 120, 60, 0, 560, 561, 5, 110, 0, 0, 561, 563, 3, 194, 97, 0, 562, 560, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 1, 0, 0, 0, 564, 565, 5, 126, 0, 0, 565, 85, 1, 0, 0, 0, 566, 567, 5, 154, 0, 0, 567, 568, 5, 114, 0, 0, 568, 569, 3, 194, 97, 0, 569, 570, 5, 113, 0, 0, 570, 571, 5, 125, 0, 0, 571, 572, 3, 120, 60, 0, 572, 573, 5, 126, 0, 0, 573, 87, 1, 0, 0, 0, 574, 578, 3, 90, 45, 0, 575, 578, 3, 92, 46, 0, 576, 578, 3, 94, 47, 0, 577, 574, 1, 0, 0, 0, 577, 575, 1, 0, 0, 0, 577, 576, 1, 0, 0, 0, 578, 89, 1, 0, 0, 0, 579, 580, 6, 45, -1, 0, 580, 586, 3, 92, 46, 0, 581, 582, 5, 61, 0, 0, 582, 586, 3, 90, 45, 6, 583, 586, 3, 100, 50, 0, 584, 586, 3, 102, 51, 0, 585, 579, 1, 0, 0, 0, 585, 581, 1, 0, 0, 0, 585, 583, 1, 0, 0, 0, 585, 584, 1, 0, 0, 0, 586, 600, 1, 0, 0, 0, 587, 588, 10, 5, 0, 0, 588, 589, 5, 62, 0, 0, 589, 599, 3, 90, 45, 6, 590, 592, 10, 4, 0, 0, 591, 593, 5, 63, 0, 0, 592, 591, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 599, 3, 90, 45, 5, 595, 596, 10, 3, 0, 0, 596, 597, 5, 64, 0, 0, 597, 599, 3, 90, 45, 4, 598, 587, 1, 0, 0, 0, 598, 590, 1, 0, 0, 0, 598, 595, 1, 0, 0, 0, 599, 602, 1, 0, 0, 0, 600, 598, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 91, 1, 0, 0, 0, 602, 600, 1, 0, 0, 0, 603, 604, 3, 94, 47, 0, 604, 605, 3, 182, 91, 0, 605, 606, 3, 94, 47, 0, 606, 612, 1, 0, 0, 0, 607, 608, 3, 94, 47, 0, 608, 609, 5, 60, 0, 0, 609, 610, 3, 212, 106, 0, 610, 612, 1, 0, 0, 0, 611, 603, 1, 0, 0, 0, 611, 607, 1, 0, 0, 0, 612, 93, 1, 0, 0, 0, 613, 623, 3, 96, 48, 0, 614, 623, 3, 98, 49, 0, 615, 623, 3, 162, 81, 0, 616, 623, 3, 158, 79, 0, 617, 623, 3, 170, 85, 0, 618, 619, 5, 125, 0, 0, 619, 620, 3, 94, 47, 0, 620, 621, 5, 126, 0, 0, 621, 623, 1, 0, 0, 0, 622, 613, 1, 0, 0, 0, 622, 614, 1, 0, 0, 0, 622, 615, 1, 0, 0, 0, 622, 616, 1, 0, 0, 0, 622, 617, 1, 0, 0, 0, 622, 618, 1, 0, 0, 0, 623, 95, 1, 0, 0, 0, 624, 629, 3, 124, 62, 0, 625, 629, 3, 126, 63, 0, 626, 629, 3, 120, 60, 0, 627, 629, 3, 188, 94, 0, 628, 624, 1, 0, 0, 0, 628, 625, 1, 0, 0, 0, 628, 626, 1, 0, 0, 0, 628, 627, 1, 0, 0, 0, 629, 97, 1, 0, 0, 0, 630, 631, 3, 180, 90, 0, 631, 632, 5, 125, 0, 0, 632, 633, 3, 136, 68, 0, 633, 634, 5, 60, 0, 0, 634, 635, 3, 136, 68, 0, 635, 636, 5, 126, 0, 0, 636, 99, 1, 0, 0, 0, 637, 638, 3, 128, 64, 0, 638, 101, 1, 0, 0, 0, 639, 642, 3, 104, 52, 0, 640, 642, 3, 106, 53, 0, 641, 639, 1, 0, 0, 0, 641, 640, 1, 0, 0, 0, 642, 103, 1, 0, 0, 0, 643, 644, 3, 184, 92, 0, 644, 645, 5, 125, 0, 0, 645, 646, 3, 146, 73, 0, 646, 647, 5, 110, 0, 0, 647, 652, 3, 148, 74, 0, 648, 649, 5, 110, 0, 0, 649, 651, 3, 138, 69, 0, 650, 648, 1, 0, 0, 0, 651, 654, 1, 0, 0, 0, 652, 650, 1, 0, 0, 0, 652, 653, 1, 0, 0, 0, 653, 655, 1, 0, 0, 0, 654, 652, 1, 0, 0, 0, 655, 656, 5, 126, 0, 0, 656, 105, 1, 0, 0, 0, 657, 658, 3, 186, 93, 0, 658, 659, 5, 125, 0, 0, 659, 660, 5, 127, 0, 0, 660, 665, 3, 142, 71, 0, 661, 662, 5, 110, 0, 0, 662, 664, 3, 142, 71, 0, 663, 661, 1, 0, 0, 0, 664, 667, 1, 0, 0, 0, 665, 663, 1, 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 668, 1, 0, 0, 0, 667, 665, 1, 0, 0, 0, 668, 669, 5, 128, 0, 0, 669, 670, 5, 110, 0, 0, 670, 675, 3, 148, 74, 0, 671, 672, 5, 110, 0, 0, 672, 674, 3, 138, 69, 0, 673, 671, 1, 0, 0, 0, 674, 677, 1, 0, 0, 0, 675, 673, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 678, 1, 0, 0, 0, 677, 675, 1, 0, 0, 0, 678, 679, 5, 126, 0, 0, 679, 107, 1, 0, 0, 0, 680, 683, 3, 216, 108, 0, 681, 683, 5, 332, 0, 0, 682, 680, 1, 0, 0, 0, 682, 681, 1, 0, 0, 0, 683, 109, 1, 0, 0, 0, 684, 685, 3, 214, 107, 0, 685, 686, 5, 125, 0, 0, 686, 687, 3, 134, 67, 0, 687, 688, 5, 126, 0, 0, 688, 111, 1, 0, 0, 0, 689, 694, 3, 120, 60, 0, 690, 691, 5, 110, 0, 0, 691, 693, 3, 120, 60, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 113, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 702, 3, 122, 61, 0, 698, 699, 5, 110, 0, 0, 699, 701, 3, 122, 61, 0, 700, 698, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 702, 703, 1, 0, 0, 0, 703, 115, 1, 0, 0, 0, 704, 702, 1, 0, 0, 0, 705, 707, 7, 0, 0, 0, 706, 705, 1, 0, 0, 0, 706, 707, 1, 0, 0, 0, 707, 708, 1, 0, 0, 0, 708, 709, 3, 118, 59, 0, 709, 117, 1, 0, 0, 0, 710, 732, 3, 120, 60, 0, 711, 712, 5, 35, 0, 0, 712, 713, 5, 125, 0, 0, 713, 714, 3, 120, 60, 0, 714, 715, 5, 126, 0, 0, 715, 732, 1, 0, 0, 0, 716, 717, 5, 36, 0, 0, 717, 718, 5, 125, 0, 0, 718, 719, 3, 120, 60, 0, 719, 720, 5, 126, 0, 0, 720, 732, 1, 0, 0, 0, 721, 722, 5, 37, 0, 0, 722, 723, 5, 125, 0, 0, 723, 724, 3, 120, 60, 0, 724, 725, 5, 126, 0, 0, 725, 732, 1, 0, 0, 0, 726, 727, 5, 38, 0, 0, 727, 728, 5, 125, 0, 0, 728, 729, 3, 120, 60, 0, 729, 730, 5, 126, 0, 0, 730, 732, 1, 0, 0, 0, 731, 710, 1, 0, 0, 0, 731, 711, 1, 0, 0, 0, 731, 716, 1, 0, 0, 0, 731, 721, 1, 0, 0, 0, 731, 726, 1, 0, 0, 0, 732, 119, 1, 0, 0, 0, 733, 734, 3, 214, 107, 0, 734, 121, 1, 0, 0, 0, 735, 736, 3, 218, 109, 0, 736, 123, 1, 0, 0, 0, 737, 738, 3, 132, 66, 0, 738, 739, 5, 125, 0, 0, 739, 740, 3, 134, 67, 0, 740, 741, 5, 126, 0, 0, 741, 125, 1, 0, 0, 0, 742, 743, 5, 274, 0, 0, 743, 744, 5, 125, 0, 0, 744, 745, 3, 88, 44, 0, 745, 746, 5, 27, 0, 0, 746, 747, 3, 130, 65, 0, 747, 748, 5, 126, 0, 0, 748, 127, 1, 0, 0, 0, 749, 750, 3, 174, 87, 0, 750, 751, 5, 125, 0, 0, 751, 752, 3, 134, 67, 0, 752, 753, 5, 126, 0, 0, 753, 129, 1, 0, 0, 0, 754, 765, 5, 212, 0, 0, 755, 765, 5, 241, 0, 0, 756, 765, 5, 243, 0, 0, 757, 765, 5, 102, 0, 0, 758, 765, 5, 103, 0, 0, 759, 765, 5, 104, 0, 0, 760, 765, 5, 105, 0, 0, 761, 765, 5, 106, 0, 0, 762, 765, 5, 107, 0, 0, 763, 765, 5, 108, 0, 0, 764, 754, 1, 0, 0, 0, 764, 755, 1, 0, 0, 0, 764, 756, 1, 0, 0, 0, 764, 757, 1, 0, 0, 0, 764, 758, 1, 0, 0, 0, 764, 759, 1, 0, 0, 0, 764, 760, 1, 0, 0, 0, 764, 761, 1, 0, 0, 0, 764, 762, 1, 0, 0, 0, 764, 763, 1, 0, 0, 0, 765, 131, 1, 0, 0, 0, 766, 773, 3, 152, 76, 0, 767, 773, 3, 156, 78, 0, 768, 773, 3, 178, 89, 0, 769, 773, 3, 174, 87, 0, 770, 773, 3, 176, 88, 0, 771, 773, 3, 180, 90, 0, 772, 766, 1, 0, 0, 0, 772, 767, 1, 0, 0, 0, 772, 768, 1, 0, 0, 0, 772, 769, 1, 0, 0, 0, 772, 770, 1, 0, 0, 0, 772, 771, 1, 0, 0, 0, 773, 133, 1, 0, 0, 0, 774, 779, 3, 136, 68, 0, 775, 776, 5, 110, 0, 0, 776, 778, 3, 136, 68, 0, 777, 775, 1, 0, 0, 0, 778, 781, 1, 0, 0, 0, 779, 777, 1, 0, 0, 0, 779, 780, 1, 0, 0, 0, 780, 783, 1, 0, 0, 0, 781, 779, 1, 0, 0, 0, 782, 774, 1, 0, 0, 0, 782, 783, 1, 0, 0, 0, 783, 135, 1, 0, 0, 0, 784, 785, 3, 220, 110, 0, 785, 786, 5, 112, 0, 0, 786, 788, 1, 0, 0, 0, 787, 784, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 1, 0, 0, 0, 789, 790, 3, 94, 47, 0, 790, 137, 1, 0, 0, 0, 791, 792, 3, 140, 70, 0, 792, 793, 5, 112, 0, 0, 793, 794, 3, 150, 75, 0, 794, 139, 1, 0, 0, 0, 795, 796, 7, 4, 0, 0, 796, 141, 1, 0, 0, 0, 797, 806, 3, 146, 73, 0, 798, 799, 3, 146, 73, 0, 799, 800, 3, 144, 72, 0, 800, 806, 1, 0, 0, 0, 801, 802, 3, 146, 73, 0, 802, 803, 5, 134, 0, 0, 803, 804, 3, 144, 72, 0, 804, 806, 1, 0, 0, 0, 805, 797, 1, 0, 0, 0, 805, 798, 1, 0, 0, 0, 805, 801, 1, 0, 0, 0, 806, 143, 1, 0, 0, 0, 807, 810, 3, 194, 97, 0, 808, 810, 3, 196, 98, 0, 809, 807, 1, 0, 0, 0, 809, 808, 1, 0, 0, 0, 810, 145, 1, 0, 0, 0, 811, 814, 3, 214, 107, 0, 812, 814, 3, 192, 96, 0, 813, 811, 1, 0, 0, 0, 813, 812, 1, 0, 0, 0, 814, 147, 1, 0, 0, 0, 815, 816, 3, 150, 75, 0, 816, 149, 1, 0, 0, 0, 817, 820, 3, 214, 107, 0, 818, 820, 3, 188, 94, 0, 819, 817, 1, 0, 0, 0, 819, 818, 1, 0, 0, 0, 820, 151, 1, 0, 0, 0, 821, 845, 5, 172, 0, 0, 822, 845, 5, 173, 0, 0, 823, 845, 5, 174, 0, 0, 824, 845, 5, 175, 0, 0, 825, 845, 5, 176, 0, 0, 826, 845, 5, 177, 0, 0, 827, 845, 5, 178, 0, 0, 828, 845, 5, 179, 0, 0, 829, 845, 5, 180, 0, 0, 830, 845, 5, 181, 0, 0, 831, 845, 5, 182, 0, 0, 832, 845, 5, 183, 0, 0, 833, 845, 5, 184, 0, 0, 834, 845, 5, 185, 0, 0, 835, 845, 5, 186, 0, 0, 836, 845, 5, 188, 0, 0, 837, 845, 5, 189, 0, 0, 838, 845, 5, 190, 0, 0, 839, 845, 5, 191, 0, 0, 840, 845, 5, 192, 0, 0, 841, 845, 5, 193, 0, 0, 842, 845, 5, 194, 0, 0, 843, 845, 3, 154, 77, 0, 844, 821, 1, 0, 0, 0, 844, 822, 1, 0, 0, 0, 844, 823, 1, 0, 0, 0, 844, 824, 1, 0, 0, 0, 844, 825, 1, 0, 0, 0, 844, 826, 1, 0, 0, 0, 844, 827, 1, 0, 0, 0, 844, 828, 1, 0, 0, 0, 844, 829, 1, 0, 0, 0, 844, 830, 1, 0, 0, 0, 844, 831, 1, 0, 0, 0, 844, 832, 1, 0, 0, 0, 844, 833, 1, 0, 0, 0, 844, 834, 1, 0, 0, 0, 844, 835, 1, 0, 0, 0, 844, 836, 1, 0, 0, 0, 844, 837, 1, 0, 0, 0, 844, 838, 1, 0, 0, 0, 844, 839, 1, 0, 0, 0, 844, 840, 1, 0, 0, 0, 844, 841, 1, 0, 0, 0, 844, 842, 1, 0, 0, 0, 844, 843, 1, 0, 0, 0, 845, 153, 1, 0, 0, 0, 846, 847, 7, 5, 0, 0, 847, 155, 1, 0, 0, 0, 848, 849, 7, 6, 0, 0, 849, 157, 1, 0, 0, 0, 850, 851, 5, 226, 0, 0, 851, 852, 5, 125, 0, 0, 852, 853, 3, 160, 80, 0, 853, 854, 5, 110, 0, 0, 854, 855, 3, 136, 68, 0, 855, 856, 5, 126, 0, 0, 856, 159, 1, 0, 0, 0, 857, 858, 7, 7, 0, 0, 858, 161, 1, 0, 0, 0, 859, 860, 5, 223, 0, 0, 860, 861, 5, 125, 0, 0, 861, 862, 3, 168, 84, 0, 862, 863, 5, 5, 0, 0, 863, 864, 3, 136, 68, 0, 864, 865, 5, 126, 0, 0, 865, 163, 1, 0, 0, 0, 866, 867, 7, 8, 0, 0, 867, 165, 1, 0, 0, 0, 868, 869, 7, 9, 0, 0, 869, 167, 1, 0, 0, 0, 870, 873, 3, 164, 82, 0, 871, 873, 3, 166, 83, 0, 872, 870, 1, 0, 0, 0, 872, 871, 1, 0, 0, 0, 873, 169, 1, 0, 0, 0, 874, 875, 3, 172, 86, 0, 875, 876, 5, 125, 0, 0, 876, 877, 3, 164, 82, 0, 877, 878, 5, 110, 0, 0, 878, 879, 3, 136, 68, 0, 879, 880, 5, 110, 0, 0, 880, 881, 3, 136, 68, 0, 881, 882, 5, 126, 0, 0, 882, 171, 1, 0, 0, 0, 883, 884, 7, 10, 0, 0, 884, 173, 1, 0, 0, 0, 885, 886, 7, 11, 0, 0, 886, 175, 1, 0, 0, 0, 887, 888, 5, 281, 0, 0, 888, 177, 1, 0, 0, 0, 889, 890, 7, 12, 0, 0, 890, 179, 1, 0, 0, 0, 891, 892, 5, 187, 0, 0, 892, 181, 1, 0, 0, 0, 893, 894, 7, 13, 0, 0, 894, 183, 1, 0, 0, 0, 895, 896, 7, 14, 0, 0, 896, 185, 1, 0, 0, 0, 897, 898, 7, 15, 0, 0, 898, 187, 1, 0, 0, 0, 899, 906, 3, 190, 95, 0, 900, 906, 3, 192, 96, 0, 901, 906, 3, 194, 97, 0, 902, 906, 3, 196, 98, 0, 903, 906, 3, 198, 99, 0, 904, 906, 3, 200, 100, 0, 905, 899, 1, 0, 0, 0, 905, 900, 1, 0, 0, 0, 905, 901, 1, 0, 0, 0, 905, 902, 1, 0, 0, 0, 905, 903, 1, 0, 0, 0, 905, 904, 1, 0, 0, 0, 906, 189, 1, 0, 0, 0, 907, 908, 5, 81, 0, 0, 908, 909, 3, 94, 47, 0, 909, 910, 3, 208, 104, 0, 910, 191, 1, 0, 0, 0, 911, 912, 7, 16, 0, 0, 912, 193, 1, 0, 0, 0, 913, 915, 7, 0, 0, 0, 914, 913, 1, 0, 0, 0, 914, 915, 1, 0, 0, 0, 915, 916, 1, 0, 0, 0, 916, 917, 5, 330, 0, 0, 917, 195, 1, 0, 0, 0, 918, 920, 7, 0, 0, 0, 919, 918, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 922, 5, 331, 0, 0, 922, 197, 1, 0, 0, 0, 923, 924, 7, 17, 0, 0, 924, 199, 1, 0, 0, 0, 925, 929, 3, 202, 101, 0, 926, 929, 3, 204, 102, 0, 927, 929, 3, 206, 103, 0, 928, 925, 1, 0, 0, 0, 928, 926, 1, 0, 0, 0, 928, 927, 1, 0, 0, 0, 929, 201, 1, 0, 0, 0, 930, 931, 5, 212, 0, 0, 931, 932, 3, 192, 96, 0, 932, 203, 1, 0, 0, 0, 933, 934, 5, 241, 0, 0, 934, 935, 3, 192, 96, 0, 935, 205, 1, 0, 0, 0, 936, 937, 5, 243, 0, 0, 937, 938, 3, 192, 96, 0, 938, 207, 1, 0, 0, 0, 939, 940, 7, 18, 0, 0, 940, 209, 1, 0, 0, 0, 941, 942, 7, 19, 0, 0, 942, 211, 1, 0, 0, 0, 943, 944, 5, 125, 0, 0, 944, 949, 3, 188, 94, 0, 945, 946, 5, 110, 0, 0, 946, 948, 3, 188, 94, 0, 947, 945, 1, 0, 0, 0, 948, 951, 1, 0, 0, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 952, 1, 0, 0, 0, 951, 949, 1, 0, 0, 0, 952, 953, 5, 126, 0, 0, 953, 213, 1, 0, 0, 0, 954, 955, 5, 328, 0, 0, 955, 215, 1, 0, 0, 0, 956, 957, 5, 328, 0, 0, 957, 217, 1, 0, 0, 0, 958, 963, 3, 224, 112, 0, 959, 960, 5, 111, 0, 0, 960, 962, 3, 224, 112, 0, 961, 959, 1, 0, 0, 0, 962, 965, 1, 0, 0, 0, 963, 961, 1, 0, 0, 0, 963, 964, 1, 0, 0, 0, 964, 219, 1, 0, 0, 0, 965, 963, 1, 0, 0, 0, 966, 968, 5, 111, 0, 0, 967, 966, 1, 0, 0, 0, 967, 968, 1, 0, 0, 0, 968, 969, 1, 0, 0, 0, 969, 977, 5, 328, 0, 0, 970, 971, 5, 131, 0, 0, 971, 972, 3, 220, 110, 0, 972, 973, 5, 131, 0, 0, 973, 977, 1, 0, 0, 0, 974, 977, 5, 335, 0, 0, 975, 977, 3, 226, 113, 0, 976, 967, 1, 0, 0, 0, 976, 970, 1, 0, 0, 0, 976, 974, 1, 0, 0, 0, 976, 975, 1, 0, 0, 0, 977, 221, 1, 0, 0, 0, 978, 980, 5, 329, 0, 0, 979, 978, 1, 0, 0, 0, 979, 980, 1, 0, 0, 0, 980, 981, 1, 0, 0, 0, 981, 982, 3, 220, 110, 0, 982, 223, 1, 0, 0, 0, 983, 988, 3, 220, 110, 0, 984, 985, 5, 122, 0, 0, 985, 987, 3, 220, 110, 0, 986, 984, 1, 0, 0, 0, 987, 990, 1, 0, 0, 0, 988, 986, 1, 0, 0, 0, 988, 989, 1, 0, 0, 0, 989, 992, 1, 0, 0, 0, 990, 988, 1, 0, 0, 0, 991, 993, 5, 122, 0, 0, 992, 991, 1, 0, 0, 0, 992, 993, 1, 0, 0, 0, 993, 1007, 1, 0, 0, 0, 994, 995, 5, 129, 0, 0, 995, 996, 3, 224, 112, 0, 996, 997, 5, 129, 0, 0, 997, 1007, 1, 0, 0, 0, 998, 999, 5, 130, 0, 0, 999, 1000, 3, 224, 112, 0, 1000, 1001, 5, 130, 0, 0, 1001, 1007, 1, 0, 0, 0, 1002, 1003, 5, 131, 0, 0, 1003, 1004, 3, 224, 112, 0, 1004, 1005, 5, 131, 0, 0, 1005, 1007, 1, 0, 0, 0, 1006, 983, 1, 0, 0, 0, 1006, 994, 1, 0, 0, 0, 1006, 998, 1, 0, 0, 0, 1006, 1002, 1, 0, 0, 0, 1007, 225, 1, 0, 0, 0, 1008, 1109, 5, 31, 0, 0, 1009, 1109, 3, 210, 105, 0, 1010, 1109, 5, 320, 0, 0, 1011, 1109, 3, 132, 66, 0, 1012, 1109, 3, 140, 70, 0, 1013, 1109, 3, 208, 104, 0, 1014, 1109, 3, 156, 78, 0, 1015, 1109, 3, 178, 89, 0, 1016, 1109, 3, 152, 76, 0, 1017, 1109, 3, 180, 90, 0, 1018, 1109, 5, 2, 0, 0, 1019, 1109, 5, 3, 0, 0, 1020, 1109, 5, 4, 0, 0, 1021, 1109, 5, 5, 0, 0, 1022, 1109, 5, 6, 0, 0, 1023, 1109, 5, 7, 0, 0, 1024, 1109, 5, 8, 0, 0, 1025, 1109, 5, 9, 0, 0, 1026, 1109, 5, 10, 0, 0, 1027, 1109, 5, 11, 0, 0, 1028, 1109, 5, 12, 0, 0, 1029, 1109, 5, 13, 0, 0, 1030, 1109, 5, 14, 0, 0, 1031, 1109, 5, 15, 0, 0, 1032, 1109, 5, 16, 0, 0, 1033, 1109, 5, 17, 0, 0, 1034, 1109, 5, 18, 0, 0, 1035, 1109, 5, 19, 0, 0, 1036, 1109, 5, 20, 0, 0, 1037, 1109, 5, 21, 0, 0, 1038, 1109, 5, 22, 0, 0, 1039, 1109, 5, 23, 0, 0, 1040, 1109, 5, 24, 0, 0, 1041, 1109, 5, 25, 0, 0, 1042, 1109, 5, 26, 0, 0, 1043, 1109, 5, 29, 0, 0, 1044, 1109, 5, 30, 0, 0, 1045, 1109, 5, 32, 0, 0, 1046, 1109, 5, 33, 0, 0, 1047, 1109, 5, 34, 0, 0, 1048, 1109, 5, 36, 0, 0, 1049, 1109, 5, 37, 0, 0, 1050, 1109, 5, 38, 0, 0, 1051, 1109, 5, 39, 0, 0, 1052, 1109, 5, 40, 0, 0, 1053, 1109, 5, 41, 0, 0, 1054, 1109, 5, 42, 0, 0, 1055, 1109, 5, 43, 0, 0, 1056, 1109, 5, 44, 0, 0, 1057, 1109, 5, 45, 0, 0, 1058, 1109, 5, 46, 0, 0, 1059, 1109, 5, 47, 0, 0, 1060, 1109, 5, 48, 0, 0, 1061, 1109, 5, 49, 0, 0, 1062, 1109, 5, 50, 0, 0, 1063, 1109, 5, 51, 0, 0, 1064, 1109, 5, 52, 0, 0, 1065, 1109, 5, 53, 0, 0, 1066, 1109, 5, 54, 0, 0, 1067, 1109, 5, 55, 0, 0, 1068, 1109, 5, 56, 0, 0, 1069, 1109, 5, 57, 0, 0, 1070, 1109, 5, 58, 0, 0, 1071, 1109, 5, 135, 0, 0, 1072, 1109, 5, 136, 0, 0, 1073, 1109, 5, 137, 0, 0, 1074, 1109, 5, 138, 0, 0, 1075, 1109, 5, 139, 0, 0, 1076, 1109, 5, 140, 0, 0, 1077, 1109, 5, 141, 0, 0, 1078, 1109, 5, 142, 0, 0, 1079, 1109, 5, 143, 0, 0, 1080, 1109, 5, 144, 0, 0, 1081, 1109, 5, 145, 0, 0, 1082, 1109, 5, 146, 0, 0, 1083, 1109, 5, 147, 0, 0, 1084, 1109, 5, 148, 0, 0, 1085, 1109, 5, 149, 0, 0, 1086, 1109, 5, 150, 0, 0, 1087, 1109, 5, 151, 0, 0, 1088, 1109, 5, 152, 0, 0, 1089, 1109, 5, 153, 0, 0, 1090, 1109, 5, 154, 0, 0, 1091, 1109, 5, 155, 0, 0, 1092, 1109, 5, 156, 0, 0, 1093, 1109, 5, 157, 0, 0, 1094, 1109, 5, 158, 0, 0, 1095, 1109, 5, 159, 0, 0, 1096, 1109, 5, 160, 0, 0, 1097, 1109, 5, 161, 0, 0, 1098, 1109, 5, 162, 0, 0, 1099, 1109, 5, 163, 0, 0, 1100, 1109, 5, 164, 0, 0, 1101, 1109, 5, 165, 0, 0, 1102, 1109, 5, 166, 0, 0, 1103, 1109, 5, 167, 0, 0, 1104, 1109, 5, 168, 0, 0, 1105, 1109, 5, 169, 0, 0, 1106, 1109, 5, 170, 0, 0, 1107, 1109, 5, 171, 0, 0, 1108, 1008, 1, 0, 0, 0, 1108, 1009, 1, 0, 0, 0, 1108, 1010, 1, 0, 0, 0, 1108, 1011, 1, 0, 0, 0, 1108, 1012, 1, 0, 0, 0, 1108, 1013, 1, 0, 0, 0, 1108, 1014, 1, 0, 0, 0, 1108, 1015, 1, 0, 0, 0, 1108, 1016, 1, 0, 0, 0, 1108, 1017, 1, 0, 0, 0, 1108, 1018, 1, 0, 0, 0, 1108, 1019, 1, 0, 0, 0, 1108, 1020, 1, 0, 0, 0, 1108, 1021, 1, 0, 0, 0, 1108, 1022, 1, 0, 0, 0, 1108, 1023, 1, 0, 0, 0, 1108, 1024, 1, 0, 0, 0, 1108, 1025, 1, 0, 0, 0, 1108, 1026, 1, 0, 0, 0, 1108, 1027, 1, 0, 0, 0, 1108, 1028, 1, 0, 0, 0, 1108, 1029, 1, 0, 0, 0, 1108, 1030, 1, 0, 0, 0, 1108, 1031, 1, 0, 0, 0, 1108, 1032, 1, 0, 0, 0, 1108, 1033, 1, 0, 0, 0, 1108, 1034, 1, 0, 0, 0, 1108, 1035, 1, 0, 0, 0, 1108, 1036, 1, 0, 0, 0, 1108, 1037, 1, 0, 0, 0, 1108, 1038, 1, 0, 0, 0, 1108, 1039, 1, 0, 0, 0, 1108, 1040, 1, 0, 0, 0, 1108, 1041, 1, 0, 0, 0, 1108, 1042, 1, 0, 0, 0, 1108, 1043, 1, 0, 0, 0, 1108, 1044, 1, 0, 0, 0, 1108, 1045, 1, 0, 0, 0, 1108, 1046, 1, 0, 0, 0, 1108, 1047, 1, 0, 0, 0, 1108, 1048, 1, 0, 0, 0, 1108, 1049, 1, 0, 0, 0, 1108, 1050, 1, 0, 0, 0, 1108, 1051, 1, 0, 0, 0, 1108, 1052, 1, 0, 0, 0, 1108, 1053, 1, 0, 0, 0, 1108, 1054, 1, 0, 0, 0, 1108, 1055, 1, 0, 0, 0, 1108, 1056, 1, 0, 0, 0, 1108, 1057, 1, 0, 0, 0, 1108, 1058, 1, 0, 0, 0, 1108, 1059, 1, 0, 0, 0, 1108, 1060, 1, 0, 0, 0, 1108, 1061, 1, 0, 0, 0, 1108, 1062, 1, 0, 0, 0, 1108, 1063, 1, 0, 0, 0, 1108, 1064, 1, 0, 0, 0, 1108, 1065, 1, 0, 0, 0, 1108, 1066, 1, 0, 0, 0, 1108, 1067, 1, 0, 0, 0, 1108, 1068, 1, 0, 0, 0, 1108, 1069, 1, 0, 0, 0, 1108, 1070, 1, 0, 0, 0, 1108, 1071, 1, 0, 0, 0, 1108, 1072, 1, 0, 0, 0, 1108, 1073, 1, 0, 0, 0, 1108, 1074, 1, 0, 0, 0, 1108, 1075, 1, 0, 0, 0, 1108, 1076, 1, 0, 0, 0, 1108, 1077, 1, 0, 0, 0, 1108, 1078, 1, 0, 0, 0, 1108, 1079, 1, 0, 0, 0, 1108, 1080, 1, 0, 0, 0, 1108, 1081, 1, 0, 0, 0, 1108, 1082, 1, 0, 0, 0, 1108, 1083, 1, 0, 0, 0, 1108, 1084, 1, 0, 0, 0, 1108, 1085, 1, 0, 0, 0, 1108, 1086, 1, 0, 0, 0, 1108, 1087, 1, 0, 0, 0, 1108, 1088, 1, 0, 0, 0, 1108, 1089, 1, 0, 0, 0, 1108, 1090, 1, 0, 0, 0, 1108, 1091, 1, 0, 0, 0, 1108, 1092, 1, 0, 0, 0, 1108, 1093, 1, 0, 0, 0, 1108, 1094, 1, 0, 0, 0, 1108, 1095, 1, 0, 0, 0, 1108, 1096, 1, 0, 0, 0, 1108, 1097, 1, 0, 0, 0, 1108, 1098, 1, 0, 0, 0, 1108, 1099, 1, 0, 0, 0, 1108, 1100, 1, 0, 0, 0, 1108, 1101, 1, 0, 0, 0, 1108, 1102, 1, 0, 0, 0, 1108, 1103, 1, 0, 0, 0, 1108, 1104, 1, 0, 0, 0, 1108, 1105, 1, 0, 0, 0, 1108, 1106, 1, 0, 0, 0, 1108, 1107, 1, 0, 0, 0, 1109, 227, 1, 0, 0, 0, 78, 229, 242, 248, 266, 269, 284, 294, 301, 306, 311, 318, 322, 327, 331, 337, 342, 353, 358, 362, 366, 370, 375, 389, 400, 408, 420, 426, 465, 471, 484, 504, 509, 517, 526, 536, 553, 562, 577, 585, 592, 598, 600, 611, 622, 628, 641, 652, 665, 675, 682, 694, 702, 706, 731, 764, 772, 779, 782, 787, 805, 809, 813, 819, 844, 872, 905, 914, 919, 928, 949, 963, 967, 976, 979, 988, 992, 1006, 1108] \ No newline at end of file +[4, 1, 336, 1117, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 1, 0, 3, 0, 230, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 5, 3, 241, 8, 3, 10, 3, 12, 3, 244, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 249, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 267, 8, 5, 1, 6, 3, 6, 270, 8, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 285, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 293, 8, 11, 10, 11, 12, 11, 296, 9, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 302, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 307, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 312, 8, 12, 1, 12, 1, 12, 1, 12, 5, 12, 317, 8, 12, 10, 12, 12, 12, 320, 9, 12, 1, 12, 3, 12, 323, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 328, 8, 12, 1, 13, 1, 13, 3, 13, 332, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 338, 8, 13, 1, 13, 1, 13, 1, 13, 3, 13, 343, 8, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 352, 8, 15, 10, 15, 12, 15, 355, 9, 15, 1, 16, 1, 16, 3, 16, 359, 8, 16, 1, 16, 1, 16, 3, 16, 363, 8, 16, 1, 17, 1, 17, 3, 17, 367, 8, 17, 1, 17, 1, 17, 3, 17, 371, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 376, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 388, 8, 21, 10, 21, 12, 21, 391, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 401, 8, 22, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 407, 8, 24, 10, 24, 12, 24, 410, 9, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 421, 8, 25, 1, 26, 1, 26, 5, 26, 425, 8, 26, 10, 26, 12, 26, 428, 9, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 466, 8, 27, 1, 28, 1, 28, 5, 28, 470, 8, 28, 10, 28, 12, 28, 473, 9, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 485, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 505, 8, 34, 1, 35, 1, 35, 1, 35, 3, 35, 510, 8, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 518, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 5, 37, 525, 8, 37, 10, 37, 12, 37, 528, 9, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 3, 39, 537, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 554, 8, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 563, 8, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 3, 44, 578, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 586, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 593, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 5, 45, 599, 8, 45, 10, 45, 12, 45, 602, 9, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 612, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 3, 47, 623, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 629, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 642, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 651, 8, 52, 10, 52, 12, 52, 654, 9, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 664, 8, 53, 10, 53, 12, 53, 667, 9, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 674, 8, 53, 10, 53, 12, 53, 677, 9, 53, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 683, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 5, 56, 693, 8, 56, 10, 56, 12, 56, 696, 9, 56, 1, 57, 1, 57, 1, 57, 5, 57, 701, 8, 57, 10, 57, 12, 57, 704, 9, 57, 1, 58, 3, 58, 707, 8, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 732, 8, 59, 1, 60, 1, 60, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 765, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 773, 8, 66, 1, 67, 1, 67, 1, 67, 5, 67, 778, 8, 67, 10, 67, 12, 67, 781, 9, 67, 3, 67, 783, 8, 67, 1, 68, 1, 68, 1, 68, 3, 68, 788, 8, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 806, 8, 71, 1, 72, 1, 72, 3, 72, 810, 8, 72, 1, 73, 1, 73, 3, 73, 814, 8, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 820, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 845, 8, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 84, 1, 84, 3, 84, 873, 8, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 87, 1, 87, 1, 88, 1, 88, 1, 89, 1, 89, 1, 90, 1, 90, 1, 91, 1, 91, 1, 92, 1, 92, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 3, 94, 906, 8, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 97, 3, 97, 915, 8, 97, 1, 97, 1, 97, 1, 98, 3, 98, 920, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 3, 100, 929, 8, 100, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 5, 106, 948, 8, 106, 10, 106, 12, 106, 951, 9, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 5, 108, 960, 8, 108, 10, 108, 12, 108, 963, 9, 108, 1, 109, 1, 109, 1, 109, 5, 109, 968, 8, 109, 10, 109, 12, 109, 971, 9, 109, 1, 110, 3, 110, 974, 8, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 983, 8, 110, 1, 111, 3, 111, 986, 8, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 5, 112, 993, 8, 112, 10, 112, 12, 112, 996, 9, 112, 1, 112, 3, 112, 999, 8, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 3, 112, 1013, 8, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 3, 113, 1115, 8, 113, 1, 113, 0, 1, 90, 114, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 0, 20, 1, 0, 118, 119, 1, 0, 18, 19, 2, 0, 137, 137, 171, 171, 5, 0, 135, 136, 140, 140, 143, 143, 148, 148, 150, 153, 3, 0, 7, 7, 56, 56, 289, 319, 1, 0, 195, 204, 13, 0, 68, 70, 74, 74, 76, 76, 79, 79, 82, 82, 84, 84, 86, 87, 89, 92, 94, 97, 205, 222, 224, 225, 227, 243, 246, 255, 4, 0, 69, 69, 212, 212, 241, 241, 243, 243, 8, 0, 70, 70, 76, 76, 82, 82, 84, 84, 89, 89, 91, 92, 95, 95, 97, 97, 8, 0, 71, 73, 75, 75, 77, 78, 80, 80, 85, 85, 88, 88, 93, 93, 98, 98, 1, 0, 244, 245, 1, 0, 275, 280, 2, 0, 256, 260, 262, 273, 2, 0, 67, 67, 112, 117, 1, 0, 282, 285, 1, 0, 286, 288, 1, 0, 333, 334, 1, 0, 65, 66, 9, 0, 70, 73, 75, 78, 80, 80, 82, 82, 84, 85, 88, 89, 91, 93, 95, 95, 97, 98, 9, 0, 31, 31, 70, 70, 76, 76, 83, 84, 89, 89, 91, 92, 95, 95, 97, 97, 321, 327, 1265, 0, 229, 1, 0, 0, 0, 2, 233, 1, 0, 0, 0, 4, 235, 1, 0, 0, 0, 6, 237, 1, 0, 0, 0, 8, 248, 1, 0, 0, 0, 10, 266, 1, 0, 0, 0, 12, 269, 1, 0, 0, 0, 14, 273, 1, 0, 0, 0, 16, 276, 1, 0, 0, 0, 18, 279, 1, 0, 0, 0, 20, 282, 1, 0, 0, 0, 22, 288, 1, 0, 0, 0, 24, 297, 1, 0, 0, 0, 26, 329, 1, 0, 0, 0, 28, 344, 1, 0, 0, 0, 30, 347, 1, 0, 0, 0, 32, 356, 1, 0, 0, 0, 34, 364, 1, 0, 0, 0, 36, 372, 1, 0, 0, 0, 38, 377, 1, 0, 0, 0, 40, 381, 1, 0, 0, 0, 42, 385, 1, 0, 0, 0, 44, 400, 1, 0, 0, 0, 46, 402, 1, 0, 0, 0, 48, 404, 1, 0, 0, 0, 50, 420, 1, 0, 0, 0, 52, 422, 1, 0, 0, 0, 54, 465, 1, 0, 0, 0, 56, 467, 1, 0, 0, 0, 58, 474, 1, 0, 0, 0, 60, 484, 1, 0, 0, 0, 62, 486, 1, 0, 0, 0, 64, 488, 1, 0, 0, 0, 66, 492, 1, 0, 0, 0, 68, 504, 1, 0, 0, 0, 70, 506, 1, 0, 0, 0, 72, 511, 1, 0, 0, 0, 74, 521, 1, 0, 0, 0, 76, 529, 1, 0, 0, 0, 78, 533, 1, 0, 0, 0, 80, 553, 1, 0, 0, 0, 82, 555, 1, 0, 0, 0, 84, 557, 1, 0, 0, 0, 86, 566, 1, 0, 0, 0, 88, 577, 1, 0, 0, 0, 90, 585, 1, 0, 0, 0, 92, 611, 1, 0, 0, 0, 94, 622, 1, 0, 0, 0, 96, 628, 1, 0, 0, 0, 98, 630, 1, 0, 0, 0, 100, 637, 1, 0, 0, 0, 102, 641, 1, 0, 0, 0, 104, 643, 1, 0, 0, 0, 106, 657, 1, 0, 0, 0, 108, 682, 1, 0, 0, 0, 110, 684, 1, 0, 0, 0, 112, 689, 1, 0, 0, 0, 114, 697, 1, 0, 0, 0, 116, 706, 1, 0, 0, 0, 118, 731, 1, 0, 0, 0, 120, 733, 1, 0, 0, 0, 122, 735, 1, 0, 0, 0, 124, 737, 1, 0, 0, 0, 126, 742, 1, 0, 0, 0, 128, 749, 1, 0, 0, 0, 130, 764, 1, 0, 0, 0, 132, 772, 1, 0, 0, 0, 134, 782, 1, 0, 0, 0, 136, 787, 1, 0, 0, 0, 138, 791, 1, 0, 0, 0, 140, 795, 1, 0, 0, 0, 142, 805, 1, 0, 0, 0, 144, 809, 1, 0, 0, 0, 146, 813, 1, 0, 0, 0, 148, 815, 1, 0, 0, 0, 150, 819, 1, 0, 0, 0, 152, 844, 1, 0, 0, 0, 154, 846, 1, 0, 0, 0, 156, 848, 1, 0, 0, 0, 158, 850, 1, 0, 0, 0, 160, 857, 1, 0, 0, 0, 162, 859, 1, 0, 0, 0, 164, 866, 1, 0, 0, 0, 166, 868, 1, 0, 0, 0, 168, 872, 1, 0, 0, 0, 170, 874, 1, 0, 0, 0, 172, 883, 1, 0, 0, 0, 174, 885, 1, 0, 0, 0, 176, 887, 1, 0, 0, 0, 178, 889, 1, 0, 0, 0, 180, 891, 1, 0, 0, 0, 182, 893, 1, 0, 0, 0, 184, 895, 1, 0, 0, 0, 186, 897, 1, 0, 0, 0, 188, 905, 1, 0, 0, 0, 190, 907, 1, 0, 0, 0, 192, 911, 1, 0, 0, 0, 194, 914, 1, 0, 0, 0, 196, 919, 1, 0, 0, 0, 198, 923, 1, 0, 0, 0, 200, 928, 1, 0, 0, 0, 202, 930, 1, 0, 0, 0, 204, 933, 1, 0, 0, 0, 206, 936, 1, 0, 0, 0, 208, 939, 1, 0, 0, 0, 210, 941, 1, 0, 0, 0, 212, 943, 1, 0, 0, 0, 214, 954, 1, 0, 0, 0, 216, 956, 1, 0, 0, 0, 218, 964, 1, 0, 0, 0, 220, 982, 1, 0, 0, 0, 222, 985, 1, 0, 0, 0, 224, 1012, 1, 0, 0, 0, 226, 1114, 1, 0, 0, 0, 228, 230, 3, 2, 1, 0, 229, 228, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 5, 0, 0, 1, 232, 1, 1, 0, 0, 0, 233, 234, 3, 4, 2, 0, 234, 3, 1, 0, 0, 0, 235, 236, 3, 6, 3, 0, 236, 5, 1, 0, 0, 0, 237, 242, 3, 8, 4, 0, 238, 239, 5, 109, 0, 0, 239, 241, 3, 10, 5, 0, 240, 238, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 7, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 249, 3, 12, 6, 0, 246, 249, 3, 14, 7, 0, 247, 249, 3, 16, 8, 0, 248, 245, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 9, 1, 0, 0, 0, 250, 267, 3, 18, 9, 0, 251, 267, 3, 20, 10, 0, 252, 267, 3, 22, 11, 0, 253, 267, 3, 24, 12, 0, 254, 267, 3, 26, 13, 0, 255, 267, 3, 28, 14, 0, 256, 267, 3, 30, 15, 0, 257, 267, 3, 32, 16, 0, 258, 267, 3, 34, 17, 0, 259, 267, 3, 36, 18, 0, 260, 267, 3, 38, 19, 0, 261, 267, 3, 40, 20, 0, 262, 267, 3, 42, 21, 0, 263, 267, 3, 48, 24, 0, 264, 267, 3, 52, 26, 0, 265, 267, 3, 56, 28, 0, 266, 250, 1, 0, 0, 0, 266, 251, 1, 0, 0, 0, 266, 252, 1, 0, 0, 0, 266, 253, 1, 0, 0, 0, 266, 254, 1, 0, 0, 0, 266, 255, 1, 0, 0, 0, 266, 256, 1, 0, 0, 0, 266, 257, 1, 0, 0, 0, 266, 258, 1, 0, 0, 0, 266, 259, 1, 0, 0, 0, 266, 260, 1, 0, 0, 0, 266, 261, 1, 0, 0, 0, 266, 262, 1, 0, 0, 0, 266, 263, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 11, 1, 0, 0, 0, 268, 270, 5, 2, 0, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 3, 60, 30, 0, 272, 13, 1, 0, 0, 0, 273, 274, 5, 3, 0, 0, 274, 275, 3, 62, 31, 0, 275, 15, 1, 0, 0, 0, 276, 277, 5, 4, 0, 0, 277, 278, 5, 33, 0, 0, 278, 17, 1, 0, 0, 0, 279, 280, 5, 6, 0, 0, 280, 281, 3, 90, 45, 0, 281, 19, 1, 0, 0, 0, 282, 284, 5, 7, 0, 0, 283, 285, 7, 0, 0, 0, 284, 283, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 3, 112, 56, 0, 287, 21, 1, 0, 0, 0, 288, 289, 5, 8, 0, 0, 289, 294, 3, 64, 32, 0, 290, 291, 5, 110, 0, 0, 291, 293, 3, 64, 32, 0, 292, 290, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 23, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 301, 5, 9, 0, 0, 298, 299, 5, 42, 0, 0, 299, 300, 5, 112, 0, 0, 300, 302, 3, 194, 97, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 306, 1, 0, 0, 0, 303, 304, 5, 43, 0, 0, 304, 305, 5, 112, 0, 0, 305, 307, 3, 198, 99, 0, 306, 303, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 311, 1, 0, 0, 0, 308, 309, 5, 44, 0, 0, 309, 310, 5, 112, 0, 0, 310, 312, 3, 192, 96, 0, 311, 308, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 318, 3, 78, 39, 0, 314, 315, 5, 110, 0, 0, 315, 317, 3, 78, 39, 0, 316, 314, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 3, 68, 34, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 327, 1, 0, 0, 0, 324, 325, 5, 41, 0, 0, 325, 326, 5, 112, 0, 0, 326, 328, 3, 198, 99, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 25, 1, 0, 0, 0, 329, 331, 5, 10, 0, 0, 330, 332, 3, 194, 97, 0, 331, 330, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 337, 3, 112, 56, 0, 334, 335, 5, 39, 0, 0, 335, 336, 5, 112, 0, 0, 336, 338, 3, 198, 99, 0, 337, 334, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 342, 1, 0, 0, 0, 339, 340, 5, 40, 0, 0, 340, 341, 5, 112, 0, 0, 341, 343, 3, 198, 99, 0, 342, 339, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 27, 1, 0, 0, 0, 344, 345, 5, 11, 0, 0, 345, 346, 3, 74, 37, 0, 346, 29, 1, 0, 0, 0, 347, 348, 5, 12, 0, 0, 348, 353, 3, 76, 38, 0, 349, 350, 5, 110, 0, 0, 350, 352, 3, 76, 38, 0, 351, 349, 1, 0, 0, 0, 352, 355, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 31, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 356, 358, 5, 13, 0, 0, 357, 359, 3, 194, 97, 0, 358, 357, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 361, 5, 5, 0, 0, 361, 363, 3, 194, 97, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 33, 1, 0, 0, 0, 364, 366, 5, 14, 0, 0, 365, 367, 3, 194, 97, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 3, 112, 56, 0, 369, 371, 3, 66, 33, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 35, 1, 0, 0, 0, 372, 373, 5, 15, 0, 0, 373, 375, 3, 112, 56, 0, 374, 376, 3, 66, 33, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 37, 1, 0, 0, 0, 377, 378, 5, 20, 0, 0, 378, 379, 3, 88, 44, 0, 379, 380, 3, 192, 96, 0, 380, 39, 1, 0, 0, 0, 381, 382, 5, 16, 0, 0, 382, 383, 3, 88, 44, 0, 383, 384, 3, 192, 96, 0, 384, 41, 1, 0, 0, 0, 385, 389, 5, 22, 0, 0, 386, 388, 3, 44, 22, 0, 387, 386, 1, 0, 0, 0, 388, 391, 1, 0, 0, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 392, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 392, 393, 3, 88, 44, 0, 393, 43, 1, 0, 0, 0, 394, 395, 5, 23, 0, 0, 395, 396, 5, 112, 0, 0, 396, 401, 3, 192, 96, 0, 397, 398, 5, 21, 0, 0, 398, 399, 5, 112, 0, 0, 399, 401, 3, 192, 96, 0, 400, 394, 1, 0, 0, 0, 400, 397, 1, 0, 0, 0, 401, 45, 1, 0, 0, 0, 402, 403, 7, 1, 0, 0, 403, 47, 1, 0, 0, 0, 404, 408, 5, 24, 0, 0, 405, 407, 3, 50, 25, 0, 406, 405, 1, 0, 0, 0, 407, 410, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 49, 1, 0, 0, 0, 410, 408, 1, 0, 0, 0, 411, 412, 5, 45, 0, 0, 412, 413, 5, 112, 0, 0, 413, 421, 3, 194, 97, 0, 414, 415, 5, 46, 0, 0, 415, 416, 5, 112, 0, 0, 416, 421, 3, 194, 97, 0, 417, 418, 5, 47, 0, 0, 418, 419, 5, 112, 0, 0, 419, 421, 3, 192, 96, 0, 420, 411, 1, 0, 0, 0, 420, 414, 1, 0, 0, 0, 420, 417, 1, 0, 0, 0, 421, 51, 1, 0, 0, 0, 422, 426, 5, 25, 0, 0, 423, 425, 3, 54, 27, 0, 424, 423, 1, 0, 0, 0, 425, 428, 1, 0, 0, 0, 426, 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 53, 1, 0, 0, 0, 428, 426, 1, 0, 0, 0, 429, 430, 5, 48, 0, 0, 430, 431, 5, 112, 0, 0, 431, 466, 3, 194, 97, 0, 432, 433, 5, 49, 0, 0, 433, 434, 5, 112, 0, 0, 434, 466, 3, 194, 97, 0, 435, 436, 5, 50, 0, 0, 436, 437, 5, 112, 0, 0, 437, 466, 3, 194, 97, 0, 438, 439, 5, 51, 0, 0, 439, 440, 5, 112, 0, 0, 440, 466, 3, 194, 97, 0, 441, 442, 5, 52, 0, 0, 442, 443, 5, 112, 0, 0, 443, 466, 3, 196, 98, 0, 444, 445, 5, 53, 0, 0, 445, 446, 5, 112, 0, 0, 446, 466, 3, 196, 98, 0, 447, 448, 5, 54, 0, 0, 448, 449, 5, 112, 0, 0, 449, 466, 3, 192, 96, 0, 450, 451, 5, 55, 0, 0, 451, 452, 5, 112, 0, 0, 452, 466, 3, 192, 96, 0, 453, 454, 5, 215, 0, 0, 454, 455, 5, 112, 0, 0, 455, 466, 3, 192, 96, 0, 456, 457, 5, 56, 0, 0, 457, 458, 5, 112, 0, 0, 458, 466, 3, 192, 96, 0, 459, 460, 5, 57, 0, 0, 460, 461, 5, 112, 0, 0, 461, 466, 3, 194, 97, 0, 462, 463, 5, 58, 0, 0, 463, 464, 5, 112, 0, 0, 464, 466, 3, 196, 98, 0, 465, 429, 1, 0, 0, 0, 465, 432, 1, 0, 0, 0, 465, 435, 1, 0, 0, 0, 465, 438, 1, 0, 0, 0, 465, 441, 1, 0, 0, 0, 465, 444, 1, 0, 0, 0, 465, 447, 1, 0, 0, 0, 465, 450, 1, 0, 0, 0, 465, 453, 1, 0, 0, 0, 465, 456, 1, 0, 0, 0, 465, 459, 1, 0, 0, 0, 465, 462, 1, 0, 0, 0, 466, 55, 1, 0, 0, 0, 467, 471, 5, 26, 0, 0, 468, 470, 3, 58, 29, 0, 469, 468, 1, 0, 0, 0, 470, 473, 1, 0, 0, 0, 471, 469, 1, 0, 0, 0, 471, 472, 1, 0, 0, 0, 472, 57, 1, 0, 0, 0, 473, 471, 1, 0, 0, 0, 474, 475, 3, 220, 110, 0, 475, 476, 5, 112, 0, 0, 476, 477, 3, 188, 94, 0, 477, 59, 1, 0, 0, 0, 478, 479, 5, 29, 0, 0, 479, 480, 5, 112, 0, 0, 480, 485, 3, 62, 31, 0, 481, 482, 5, 30, 0, 0, 482, 483, 5, 112, 0, 0, 483, 485, 3, 62, 31, 0, 484, 478, 1, 0, 0, 0, 484, 481, 1, 0, 0, 0, 485, 61, 1, 0, 0, 0, 486, 487, 3, 108, 54, 0, 487, 63, 1, 0, 0, 0, 488, 489, 3, 122, 61, 0, 489, 490, 5, 27, 0, 0, 490, 491, 3, 122, 61, 0, 491, 65, 1, 0, 0, 0, 492, 493, 5, 28, 0, 0, 493, 494, 3, 112, 56, 0, 494, 67, 1, 0, 0, 0, 495, 496, 5, 28, 0, 0, 496, 505, 3, 112, 56, 0, 497, 498, 5, 28, 0, 0, 498, 505, 3, 70, 35, 0, 499, 500, 5, 28, 0, 0, 500, 501, 3, 70, 35, 0, 501, 502, 5, 110, 0, 0, 502, 503, 3, 112, 56, 0, 503, 505, 1, 0, 0, 0, 504, 495, 1, 0, 0, 0, 504, 497, 1, 0, 0, 0, 504, 499, 1, 0, 0, 0, 505, 69, 1, 0, 0, 0, 506, 509, 3, 72, 36, 0, 507, 508, 5, 27, 0, 0, 508, 510, 3, 214, 107, 0, 509, 507, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 71, 1, 0, 0, 0, 511, 512, 5, 320, 0, 0, 512, 513, 5, 125, 0, 0, 513, 514, 3, 120, 60, 0, 514, 515, 5, 110, 0, 0, 515, 517, 3, 188, 94, 0, 516, 518, 3, 210, 105, 0, 517, 516, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 520, 5, 126, 0, 0, 520, 73, 1, 0, 0, 0, 521, 526, 3, 116, 58, 0, 522, 523, 5, 110, 0, 0, 523, 525, 3, 116, 58, 0, 524, 522, 1, 0, 0, 0, 525, 528, 1, 0, 0, 0, 526, 524, 1, 0, 0, 0, 526, 527, 1, 0, 0, 0, 527, 75, 1, 0, 0, 0, 528, 526, 1, 0, 0, 0, 529, 530, 3, 120, 60, 0, 530, 531, 5, 112, 0, 0, 531, 532, 3, 88, 44, 0, 532, 77, 1, 0, 0, 0, 533, 536, 3, 80, 40, 0, 534, 535, 5, 27, 0, 0, 535, 537, 3, 122, 61, 0, 536, 534, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 79, 1, 0, 0, 0, 538, 539, 3, 82, 41, 0, 539, 540, 5, 125, 0, 0, 540, 541, 3, 94, 47, 0, 541, 542, 5, 126, 0, 0, 542, 554, 1, 0, 0, 0, 543, 544, 5, 136, 0, 0, 544, 545, 5, 125, 0, 0, 545, 554, 5, 126, 0, 0, 546, 547, 7, 2, 0, 0, 547, 548, 5, 125, 0, 0, 548, 549, 3, 94, 47, 0, 549, 550, 5, 126, 0, 0, 550, 554, 1, 0, 0, 0, 551, 554, 3, 86, 43, 0, 552, 554, 3, 84, 42, 0, 553, 538, 1, 0, 0, 0, 553, 543, 1, 0, 0, 0, 553, 546, 1, 0, 0, 0, 553, 551, 1, 0, 0, 0, 553, 552, 1, 0, 0, 0, 554, 81, 1, 0, 0, 0, 555, 556, 7, 3, 0, 0, 556, 83, 1, 0, 0, 0, 557, 558, 5, 155, 0, 0, 558, 559, 5, 125, 0, 0, 559, 562, 3, 120, 60, 0, 560, 561, 5, 110, 0, 0, 561, 563, 3, 194, 97, 0, 562, 560, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 1, 0, 0, 0, 564, 565, 5, 126, 0, 0, 565, 85, 1, 0, 0, 0, 566, 567, 5, 154, 0, 0, 567, 568, 5, 114, 0, 0, 568, 569, 3, 194, 97, 0, 569, 570, 5, 113, 0, 0, 570, 571, 5, 125, 0, 0, 571, 572, 3, 120, 60, 0, 572, 573, 5, 126, 0, 0, 573, 87, 1, 0, 0, 0, 574, 578, 3, 90, 45, 0, 575, 578, 3, 92, 46, 0, 576, 578, 3, 94, 47, 0, 577, 574, 1, 0, 0, 0, 577, 575, 1, 0, 0, 0, 577, 576, 1, 0, 0, 0, 578, 89, 1, 0, 0, 0, 579, 580, 6, 45, -1, 0, 580, 586, 3, 92, 46, 0, 581, 582, 5, 61, 0, 0, 582, 586, 3, 90, 45, 6, 583, 586, 3, 100, 50, 0, 584, 586, 3, 102, 51, 0, 585, 579, 1, 0, 0, 0, 585, 581, 1, 0, 0, 0, 585, 583, 1, 0, 0, 0, 585, 584, 1, 0, 0, 0, 586, 600, 1, 0, 0, 0, 587, 588, 10, 5, 0, 0, 588, 589, 5, 62, 0, 0, 589, 599, 3, 90, 45, 6, 590, 592, 10, 4, 0, 0, 591, 593, 5, 63, 0, 0, 592, 591, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 599, 3, 90, 45, 5, 595, 596, 10, 3, 0, 0, 596, 597, 5, 64, 0, 0, 597, 599, 3, 90, 45, 4, 598, 587, 1, 0, 0, 0, 598, 590, 1, 0, 0, 0, 598, 595, 1, 0, 0, 0, 599, 602, 1, 0, 0, 0, 600, 598, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 91, 1, 0, 0, 0, 602, 600, 1, 0, 0, 0, 603, 604, 3, 94, 47, 0, 604, 605, 3, 182, 91, 0, 605, 606, 3, 94, 47, 0, 606, 612, 1, 0, 0, 0, 607, 608, 3, 94, 47, 0, 608, 609, 5, 60, 0, 0, 609, 610, 3, 212, 106, 0, 610, 612, 1, 0, 0, 0, 611, 603, 1, 0, 0, 0, 611, 607, 1, 0, 0, 0, 612, 93, 1, 0, 0, 0, 613, 623, 3, 96, 48, 0, 614, 623, 3, 98, 49, 0, 615, 623, 3, 162, 81, 0, 616, 623, 3, 158, 79, 0, 617, 623, 3, 170, 85, 0, 618, 619, 5, 125, 0, 0, 619, 620, 3, 94, 47, 0, 620, 621, 5, 126, 0, 0, 621, 623, 1, 0, 0, 0, 622, 613, 1, 0, 0, 0, 622, 614, 1, 0, 0, 0, 622, 615, 1, 0, 0, 0, 622, 616, 1, 0, 0, 0, 622, 617, 1, 0, 0, 0, 622, 618, 1, 0, 0, 0, 623, 95, 1, 0, 0, 0, 624, 629, 3, 124, 62, 0, 625, 629, 3, 126, 63, 0, 626, 629, 3, 120, 60, 0, 627, 629, 3, 188, 94, 0, 628, 624, 1, 0, 0, 0, 628, 625, 1, 0, 0, 0, 628, 626, 1, 0, 0, 0, 628, 627, 1, 0, 0, 0, 629, 97, 1, 0, 0, 0, 630, 631, 3, 180, 90, 0, 631, 632, 5, 125, 0, 0, 632, 633, 3, 136, 68, 0, 633, 634, 5, 60, 0, 0, 634, 635, 3, 136, 68, 0, 635, 636, 5, 126, 0, 0, 636, 99, 1, 0, 0, 0, 637, 638, 3, 128, 64, 0, 638, 101, 1, 0, 0, 0, 639, 642, 3, 104, 52, 0, 640, 642, 3, 106, 53, 0, 641, 639, 1, 0, 0, 0, 641, 640, 1, 0, 0, 0, 642, 103, 1, 0, 0, 0, 643, 644, 3, 184, 92, 0, 644, 645, 5, 125, 0, 0, 645, 646, 3, 146, 73, 0, 646, 647, 5, 110, 0, 0, 647, 652, 3, 148, 74, 0, 648, 649, 5, 110, 0, 0, 649, 651, 3, 138, 69, 0, 650, 648, 1, 0, 0, 0, 651, 654, 1, 0, 0, 0, 652, 650, 1, 0, 0, 0, 652, 653, 1, 0, 0, 0, 653, 655, 1, 0, 0, 0, 654, 652, 1, 0, 0, 0, 655, 656, 5, 126, 0, 0, 656, 105, 1, 0, 0, 0, 657, 658, 3, 186, 93, 0, 658, 659, 5, 125, 0, 0, 659, 660, 5, 127, 0, 0, 660, 665, 3, 142, 71, 0, 661, 662, 5, 110, 0, 0, 662, 664, 3, 142, 71, 0, 663, 661, 1, 0, 0, 0, 664, 667, 1, 0, 0, 0, 665, 663, 1, 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 668, 1, 0, 0, 0, 667, 665, 1, 0, 0, 0, 668, 669, 5, 128, 0, 0, 669, 670, 5, 110, 0, 0, 670, 675, 3, 148, 74, 0, 671, 672, 5, 110, 0, 0, 672, 674, 3, 138, 69, 0, 673, 671, 1, 0, 0, 0, 674, 677, 1, 0, 0, 0, 675, 673, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 678, 1, 0, 0, 0, 677, 675, 1, 0, 0, 0, 678, 679, 5, 126, 0, 0, 679, 107, 1, 0, 0, 0, 680, 683, 3, 216, 108, 0, 681, 683, 5, 332, 0, 0, 682, 680, 1, 0, 0, 0, 682, 681, 1, 0, 0, 0, 683, 109, 1, 0, 0, 0, 684, 685, 3, 214, 107, 0, 685, 686, 5, 125, 0, 0, 686, 687, 3, 134, 67, 0, 687, 688, 5, 126, 0, 0, 688, 111, 1, 0, 0, 0, 689, 694, 3, 120, 60, 0, 690, 691, 5, 110, 0, 0, 691, 693, 3, 120, 60, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 113, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 702, 3, 122, 61, 0, 698, 699, 5, 110, 0, 0, 699, 701, 3, 122, 61, 0, 700, 698, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 702, 703, 1, 0, 0, 0, 703, 115, 1, 0, 0, 0, 704, 702, 1, 0, 0, 0, 705, 707, 7, 0, 0, 0, 706, 705, 1, 0, 0, 0, 706, 707, 1, 0, 0, 0, 707, 708, 1, 0, 0, 0, 708, 709, 3, 118, 59, 0, 709, 117, 1, 0, 0, 0, 710, 732, 3, 120, 60, 0, 711, 712, 5, 35, 0, 0, 712, 713, 5, 125, 0, 0, 713, 714, 3, 120, 60, 0, 714, 715, 5, 126, 0, 0, 715, 732, 1, 0, 0, 0, 716, 717, 5, 36, 0, 0, 717, 718, 5, 125, 0, 0, 718, 719, 3, 120, 60, 0, 719, 720, 5, 126, 0, 0, 720, 732, 1, 0, 0, 0, 721, 722, 5, 37, 0, 0, 722, 723, 5, 125, 0, 0, 723, 724, 3, 120, 60, 0, 724, 725, 5, 126, 0, 0, 725, 732, 1, 0, 0, 0, 726, 727, 5, 38, 0, 0, 727, 728, 5, 125, 0, 0, 728, 729, 3, 120, 60, 0, 729, 730, 5, 126, 0, 0, 730, 732, 1, 0, 0, 0, 731, 710, 1, 0, 0, 0, 731, 711, 1, 0, 0, 0, 731, 716, 1, 0, 0, 0, 731, 721, 1, 0, 0, 0, 731, 726, 1, 0, 0, 0, 732, 119, 1, 0, 0, 0, 733, 734, 3, 214, 107, 0, 734, 121, 1, 0, 0, 0, 735, 736, 3, 218, 109, 0, 736, 123, 1, 0, 0, 0, 737, 738, 3, 132, 66, 0, 738, 739, 5, 125, 0, 0, 739, 740, 3, 134, 67, 0, 740, 741, 5, 126, 0, 0, 741, 125, 1, 0, 0, 0, 742, 743, 5, 274, 0, 0, 743, 744, 5, 125, 0, 0, 744, 745, 3, 88, 44, 0, 745, 746, 5, 27, 0, 0, 746, 747, 3, 130, 65, 0, 747, 748, 5, 126, 0, 0, 748, 127, 1, 0, 0, 0, 749, 750, 3, 174, 87, 0, 750, 751, 5, 125, 0, 0, 751, 752, 3, 134, 67, 0, 752, 753, 5, 126, 0, 0, 753, 129, 1, 0, 0, 0, 754, 765, 5, 212, 0, 0, 755, 765, 5, 241, 0, 0, 756, 765, 5, 243, 0, 0, 757, 765, 5, 102, 0, 0, 758, 765, 5, 103, 0, 0, 759, 765, 5, 104, 0, 0, 760, 765, 5, 105, 0, 0, 761, 765, 5, 106, 0, 0, 762, 765, 5, 107, 0, 0, 763, 765, 5, 108, 0, 0, 764, 754, 1, 0, 0, 0, 764, 755, 1, 0, 0, 0, 764, 756, 1, 0, 0, 0, 764, 757, 1, 0, 0, 0, 764, 758, 1, 0, 0, 0, 764, 759, 1, 0, 0, 0, 764, 760, 1, 0, 0, 0, 764, 761, 1, 0, 0, 0, 764, 762, 1, 0, 0, 0, 764, 763, 1, 0, 0, 0, 765, 131, 1, 0, 0, 0, 766, 773, 3, 152, 76, 0, 767, 773, 3, 156, 78, 0, 768, 773, 3, 178, 89, 0, 769, 773, 3, 174, 87, 0, 770, 773, 3, 176, 88, 0, 771, 773, 3, 180, 90, 0, 772, 766, 1, 0, 0, 0, 772, 767, 1, 0, 0, 0, 772, 768, 1, 0, 0, 0, 772, 769, 1, 0, 0, 0, 772, 770, 1, 0, 0, 0, 772, 771, 1, 0, 0, 0, 773, 133, 1, 0, 0, 0, 774, 779, 3, 136, 68, 0, 775, 776, 5, 110, 0, 0, 776, 778, 3, 136, 68, 0, 777, 775, 1, 0, 0, 0, 778, 781, 1, 0, 0, 0, 779, 777, 1, 0, 0, 0, 779, 780, 1, 0, 0, 0, 780, 783, 1, 0, 0, 0, 781, 779, 1, 0, 0, 0, 782, 774, 1, 0, 0, 0, 782, 783, 1, 0, 0, 0, 783, 135, 1, 0, 0, 0, 784, 785, 3, 220, 110, 0, 785, 786, 5, 112, 0, 0, 786, 788, 1, 0, 0, 0, 787, 784, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 1, 0, 0, 0, 789, 790, 3, 94, 47, 0, 790, 137, 1, 0, 0, 0, 791, 792, 3, 140, 70, 0, 792, 793, 5, 112, 0, 0, 793, 794, 3, 150, 75, 0, 794, 139, 1, 0, 0, 0, 795, 796, 7, 4, 0, 0, 796, 141, 1, 0, 0, 0, 797, 806, 3, 146, 73, 0, 798, 799, 3, 146, 73, 0, 799, 800, 3, 144, 72, 0, 800, 806, 1, 0, 0, 0, 801, 802, 3, 146, 73, 0, 802, 803, 5, 134, 0, 0, 803, 804, 3, 144, 72, 0, 804, 806, 1, 0, 0, 0, 805, 797, 1, 0, 0, 0, 805, 798, 1, 0, 0, 0, 805, 801, 1, 0, 0, 0, 806, 143, 1, 0, 0, 0, 807, 810, 3, 194, 97, 0, 808, 810, 3, 196, 98, 0, 809, 807, 1, 0, 0, 0, 809, 808, 1, 0, 0, 0, 810, 145, 1, 0, 0, 0, 811, 814, 3, 214, 107, 0, 812, 814, 3, 192, 96, 0, 813, 811, 1, 0, 0, 0, 813, 812, 1, 0, 0, 0, 814, 147, 1, 0, 0, 0, 815, 816, 3, 150, 75, 0, 816, 149, 1, 0, 0, 0, 817, 820, 3, 214, 107, 0, 818, 820, 3, 188, 94, 0, 819, 817, 1, 0, 0, 0, 819, 818, 1, 0, 0, 0, 820, 151, 1, 0, 0, 0, 821, 845, 5, 172, 0, 0, 822, 845, 5, 173, 0, 0, 823, 845, 5, 174, 0, 0, 824, 845, 5, 175, 0, 0, 825, 845, 5, 176, 0, 0, 826, 845, 5, 177, 0, 0, 827, 845, 5, 178, 0, 0, 828, 845, 5, 179, 0, 0, 829, 845, 5, 180, 0, 0, 830, 845, 5, 181, 0, 0, 831, 845, 5, 182, 0, 0, 832, 845, 5, 183, 0, 0, 833, 845, 5, 184, 0, 0, 834, 845, 5, 185, 0, 0, 835, 845, 5, 186, 0, 0, 836, 845, 5, 188, 0, 0, 837, 845, 5, 189, 0, 0, 838, 845, 5, 190, 0, 0, 839, 845, 5, 191, 0, 0, 840, 845, 5, 192, 0, 0, 841, 845, 5, 193, 0, 0, 842, 845, 5, 194, 0, 0, 843, 845, 3, 154, 77, 0, 844, 821, 1, 0, 0, 0, 844, 822, 1, 0, 0, 0, 844, 823, 1, 0, 0, 0, 844, 824, 1, 0, 0, 0, 844, 825, 1, 0, 0, 0, 844, 826, 1, 0, 0, 0, 844, 827, 1, 0, 0, 0, 844, 828, 1, 0, 0, 0, 844, 829, 1, 0, 0, 0, 844, 830, 1, 0, 0, 0, 844, 831, 1, 0, 0, 0, 844, 832, 1, 0, 0, 0, 844, 833, 1, 0, 0, 0, 844, 834, 1, 0, 0, 0, 844, 835, 1, 0, 0, 0, 844, 836, 1, 0, 0, 0, 844, 837, 1, 0, 0, 0, 844, 838, 1, 0, 0, 0, 844, 839, 1, 0, 0, 0, 844, 840, 1, 0, 0, 0, 844, 841, 1, 0, 0, 0, 844, 842, 1, 0, 0, 0, 844, 843, 1, 0, 0, 0, 845, 153, 1, 0, 0, 0, 846, 847, 7, 5, 0, 0, 847, 155, 1, 0, 0, 0, 848, 849, 7, 6, 0, 0, 849, 157, 1, 0, 0, 0, 850, 851, 5, 226, 0, 0, 851, 852, 5, 125, 0, 0, 852, 853, 3, 160, 80, 0, 853, 854, 5, 110, 0, 0, 854, 855, 3, 136, 68, 0, 855, 856, 5, 126, 0, 0, 856, 159, 1, 0, 0, 0, 857, 858, 7, 7, 0, 0, 858, 161, 1, 0, 0, 0, 859, 860, 5, 223, 0, 0, 860, 861, 5, 125, 0, 0, 861, 862, 3, 168, 84, 0, 862, 863, 5, 5, 0, 0, 863, 864, 3, 136, 68, 0, 864, 865, 5, 126, 0, 0, 865, 163, 1, 0, 0, 0, 866, 867, 7, 8, 0, 0, 867, 165, 1, 0, 0, 0, 868, 869, 7, 9, 0, 0, 869, 167, 1, 0, 0, 0, 870, 873, 3, 164, 82, 0, 871, 873, 3, 166, 83, 0, 872, 870, 1, 0, 0, 0, 872, 871, 1, 0, 0, 0, 873, 169, 1, 0, 0, 0, 874, 875, 3, 172, 86, 0, 875, 876, 5, 125, 0, 0, 876, 877, 3, 164, 82, 0, 877, 878, 5, 110, 0, 0, 878, 879, 3, 136, 68, 0, 879, 880, 5, 110, 0, 0, 880, 881, 3, 136, 68, 0, 881, 882, 5, 126, 0, 0, 882, 171, 1, 0, 0, 0, 883, 884, 7, 10, 0, 0, 884, 173, 1, 0, 0, 0, 885, 886, 7, 11, 0, 0, 886, 175, 1, 0, 0, 0, 887, 888, 5, 281, 0, 0, 888, 177, 1, 0, 0, 0, 889, 890, 7, 12, 0, 0, 890, 179, 1, 0, 0, 0, 891, 892, 5, 187, 0, 0, 892, 181, 1, 0, 0, 0, 893, 894, 7, 13, 0, 0, 894, 183, 1, 0, 0, 0, 895, 896, 7, 14, 0, 0, 896, 185, 1, 0, 0, 0, 897, 898, 7, 15, 0, 0, 898, 187, 1, 0, 0, 0, 899, 906, 3, 190, 95, 0, 900, 906, 3, 192, 96, 0, 901, 906, 3, 194, 97, 0, 902, 906, 3, 196, 98, 0, 903, 906, 3, 198, 99, 0, 904, 906, 3, 200, 100, 0, 905, 899, 1, 0, 0, 0, 905, 900, 1, 0, 0, 0, 905, 901, 1, 0, 0, 0, 905, 902, 1, 0, 0, 0, 905, 903, 1, 0, 0, 0, 905, 904, 1, 0, 0, 0, 906, 189, 1, 0, 0, 0, 907, 908, 5, 81, 0, 0, 908, 909, 3, 94, 47, 0, 909, 910, 3, 208, 104, 0, 910, 191, 1, 0, 0, 0, 911, 912, 7, 16, 0, 0, 912, 193, 1, 0, 0, 0, 913, 915, 7, 0, 0, 0, 914, 913, 1, 0, 0, 0, 914, 915, 1, 0, 0, 0, 915, 916, 1, 0, 0, 0, 916, 917, 5, 330, 0, 0, 917, 195, 1, 0, 0, 0, 918, 920, 7, 0, 0, 0, 919, 918, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 922, 5, 331, 0, 0, 922, 197, 1, 0, 0, 0, 923, 924, 7, 17, 0, 0, 924, 199, 1, 0, 0, 0, 925, 929, 3, 202, 101, 0, 926, 929, 3, 204, 102, 0, 927, 929, 3, 206, 103, 0, 928, 925, 1, 0, 0, 0, 928, 926, 1, 0, 0, 0, 928, 927, 1, 0, 0, 0, 929, 201, 1, 0, 0, 0, 930, 931, 5, 212, 0, 0, 931, 932, 3, 192, 96, 0, 932, 203, 1, 0, 0, 0, 933, 934, 5, 241, 0, 0, 934, 935, 3, 192, 96, 0, 935, 205, 1, 0, 0, 0, 936, 937, 5, 243, 0, 0, 937, 938, 3, 192, 96, 0, 938, 207, 1, 0, 0, 0, 939, 940, 7, 18, 0, 0, 940, 209, 1, 0, 0, 0, 941, 942, 7, 19, 0, 0, 942, 211, 1, 0, 0, 0, 943, 944, 5, 125, 0, 0, 944, 949, 3, 188, 94, 0, 945, 946, 5, 110, 0, 0, 946, 948, 3, 188, 94, 0, 947, 945, 1, 0, 0, 0, 948, 951, 1, 0, 0, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 952, 1, 0, 0, 0, 951, 949, 1, 0, 0, 0, 952, 953, 5, 126, 0, 0, 953, 213, 1, 0, 0, 0, 954, 955, 5, 328, 0, 0, 955, 215, 1, 0, 0, 0, 956, 961, 3, 222, 111, 0, 957, 958, 5, 111, 0, 0, 958, 960, 3, 220, 110, 0, 959, 957, 1, 0, 0, 0, 960, 963, 1, 0, 0, 0, 961, 959, 1, 0, 0, 0, 961, 962, 1, 0, 0, 0, 962, 217, 1, 0, 0, 0, 963, 961, 1, 0, 0, 0, 964, 969, 3, 224, 112, 0, 965, 966, 5, 111, 0, 0, 966, 968, 3, 224, 112, 0, 967, 965, 1, 0, 0, 0, 968, 971, 1, 0, 0, 0, 969, 967, 1, 0, 0, 0, 969, 970, 1, 0, 0, 0, 970, 219, 1, 0, 0, 0, 971, 969, 1, 0, 0, 0, 972, 974, 5, 111, 0, 0, 973, 972, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 975, 1, 0, 0, 0, 975, 983, 5, 328, 0, 0, 976, 977, 5, 131, 0, 0, 977, 978, 3, 220, 110, 0, 978, 979, 5, 131, 0, 0, 979, 983, 1, 0, 0, 0, 980, 983, 5, 335, 0, 0, 981, 983, 3, 226, 113, 0, 982, 973, 1, 0, 0, 0, 982, 976, 1, 0, 0, 0, 982, 980, 1, 0, 0, 0, 982, 981, 1, 0, 0, 0, 983, 221, 1, 0, 0, 0, 984, 986, 5, 329, 0, 0, 985, 984, 1, 0, 0, 0, 985, 986, 1, 0, 0, 0, 986, 987, 1, 0, 0, 0, 987, 988, 3, 220, 110, 0, 988, 223, 1, 0, 0, 0, 989, 994, 3, 220, 110, 0, 990, 991, 5, 122, 0, 0, 991, 993, 3, 220, 110, 0, 992, 990, 1, 0, 0, 0, 993, 996, 1, 0, 0, 0, 994, 992, 1, 0, 0, 0, 994, 995, 1, 0, 0, 0, 995, 998, 1, 0, 0, 0, 996, 994, 1, 0, 0, 0, 997, 999, 5, 122, 0, 0, 998, 997, 1, 0, 0, 0, 998, 999, 1, 0, 0, 0, 999, 1013, 1, 0, 0, 0, 1000, 1001, 5, 129, 0, 0, 1001, 1002, 3, 224, 112, 0, 1002, 1003, 5, 129, 0, 0, 1003, 1013, 1, 0, 0, 0, 1004, 1005, 5, 130, 0, 0, 1005, 1006, 3, 224, 112, 0, 1006, 1007, 5, 130, 0, 0, 1007, 1013, 1, 0, 0, 0, 1008, 1009, 5, 131, 0, 0, 1009, 1010, 3, 224, 112, 0, 1010, 1011, 5, 131, 0, 0, 1011, 1013, 1, 0, 0, 0, 1012, 989, 1, 0, 0, 0, 1012, 1000, 1, 0, 0, 0, 1012, 1004, 1, 0, 0, 0, 1012, 1008, 1, 0, 0, 0, 1013, 225, 1, 0, 0, 0, 1014, 1115, 5, 31, 0, 0, 1015, 1115, 3, 210, 105, 0, 1016, 1115, 5, 320, 0, 0, 1017, 1115, 3, 132, 66, 0, 1018, 1115, 3, 140, 70, 0, 1019, 1115, 3, 208, 104, 0, 1020, 1115, 3, 156, 78, 0, 1021, 1115, 3, 178, 89, 0, 1022, 1115, 3, 152, 76, 0, 1023, 1115, 3, 180, 90, 0, 1024, 1115, 5, 2, 0, 0, 1025, 1115, 5, 3, 0, 0, 1026, 1115, 5, 4, 0, 0, 1027, 1115, 5, 5, 0, 0, 1028, 1115, 5, 6, 0, 0, 1029, 1115, 5, 7, 0, 0, 1030, 1115, 5, 8, 0, 0, 1031, 1115, 5, 9, 0, 0, 1032, 1115, 5, 10, 0, 0, 1033, 1115, 5, 11, 0, 0, 1034, 1115, 5, 12, 0, 0, 1035, 1115, 5, 13, 0, 0, 1036, 1115, 5, 14, 0, 0, 1037, 1115, 5, 15, 0, 0, 1038, 1115, 5, 16, 0, 0, 1039, 1115, 5, 17, 0, 0, 1040, 1115, 5, 18, 0, 0, 1041, 1115, 5, 19, 0, 0, 1042, 1115, 5, 20, 0, 0, 1043, 1115, 5, 21, 0, 0, 1044, 1115, 5, 22, 0, 0, 1045, 1115, 5, 23, 0, 0, 1046, 1115, 5, 24, 0, 0, 1047, 1115, 5, 25, 0, 0, 1048, 1115, 5, 26, 0, 0, 1049, 1115, 5, 29, 0, 0, 1050, 1115, 5, 30, 0, 0, 1051, 1115, 5, 32, 0, 0, 1052, 1115, 5, 33, 0, 0, 1053, 1115, 5, 34, 0, 0, 1054, 1115, 5, 36, 0, 0, 1055, 1115, 5, 37, 0, 0, 1056, 1115, 5, 38, 0, 0, 1057, 1115, 5, 39, 0, 0, 1058, 1115, 5, 40, 0, 0, 1059, 1115, 5, 41, 0, 0, 1060, 1115, 5, 42, 0, 0, 1061, 1115, 5, 43, 0, 0, 1062, 1115, 5, 44, 0, 0, 1063, 1115, 5, 45, 0, 0, 1064, 1115, 5, 46, 0, 0, 1065, 1115, 5, 47, 0, 0, 1066, 1115, 5, 48, 0, 0, 1067, 1115, 5, 49, 0, 0, 1068, 1115, 5, 50, 0, 0, 1069, 1115, 5, 51, 0, 0, 1070, 1115, 5, 52, 0, 0, 1071, 1115, 5, 53, 0, 0, 1072, 1115, 5, 54, 0, 0, 1073, 1115, 5, 55, 0, 0, 1074, 1115, 5, 56, 0, 0, 1075, 1115, 5, 57, 0, 0, 1076, 1115, 5, 58, 0, 0, 1077, 1115, 5, 135, 0, 0, 1078, 1115, 5, 136, 0, 0, 1079, 1115, 5, 137, 0, 0, 1080, 1115, 5, 138, 0, 0, 1081, 1115, 5, 139, 0, 0, 1082, 1115, 5, 140, 0, 0, 1083, 1115, 5, 141, 0, 0, 1084, 1115, 5, 142, 0, 0, 1085, 1115, 5, 143, 0, 0, 1086, 1115, 5, 144, 0, 0, 1087, 1115, 5, 145, 0, 0, 1088, 1115, 5, 146, 0, 0, 1089, 1115, 5, 147, 0, 0, 1090, 1115, 5, 148, 0, 0, 1091, 1115, 5, 149, 0, 0, 1092, 1115, 5, 150, 0, 0, 1093, 1115, 5, 151, 0, 0, 1094, 1115, 5, 152, 0, 0, 1095, 1115, 5, 153, 0, 0, 1096, 1115, 5, 154, 0, 0, 1097, 1115, 5, 155, 0, 0, 1098, 1115, 5, 156, 0, 0, 1099, 1115, 5, 157, 0, 0, 1100, 1115, 5, 158, 0, 0, 1101, 1115, 5, 159, 0, 0, 1102, 1115, 5, 160, 0, 0, 1103, 1115, 5, 161, 0, 0, 1104, 1115, 5, 162, 0, 0, 1105, 1115, 5, 163, 0, 0, 1106, 1115, 5, 164, 0, 0, 1107, 1115, 5, 165, 0, 0, 1108, 1115, 5, 166, 0, 0, 1109, 1115, 5, 167, 0, 0, 1110, 1115, 5, 168, 0, 0, 1111, 1115, 5, 169, 0, 0, 1112, 1115, 5, 170, 0, 0, 1113, 1115, 5, 171, 0, 0, 1114, 1014, 1, 0, 0, 0, 1114, 1015, 1, 0, 0, 0, 1114, 1016, 1, 0, 0, 0, 1114, 1017, 1, 0, 0, 0, 1114, 1018, 1, 0, 0, 0, 1114, 1019, 1, 0, 0, 0, 1114, 1020, 1, 0, 0, 0, 1114, 1021, 1, 0, 0, 0, 1114, 1022, 1, 0, 0, 0, 1114, 1023, 1, 0, 0, 0, 1114, 1024, 1, 0, 0, 0, 1114, 1025, 1, 0, 0, 0, 1114, 1026, 1, 0, 0, 0, 1114, 1027, 1, 0, 0, 0, 1114, 1028, 1, 0, 0, 0, 1114, 1029, 1, 0, 0, 0, 1114, 1030, 1, 0, 0, 0, 1114, 1031, 1, 0, 0, 0, 1114, 1032, 1, 0, 0, 0, 1114, 1033, 1, 0, 0, 0, 1114, 1034, 1, 0, 0, 0, 1114, 1035, 1, 0, 0, 0, 1114, 1036, 1, 0, 0, 0, 1114, 1037, 1, 0, 0, 0, 1114, 1038, 1, 0, 0, 0, 1114, 1039, 1, 0, 0, 0, 1114, 1040, 1, 0, 0, 0, 1114, 1041, 1, 0, 0, 0, 1114, 1042, 1, 0, 0, 0, 1114, 1043, 1, 0, 0, 0, 1114, 1044, 1, 0, 0, 0, 1114, 1045, 1, 0, 0, 0, 1114, 1046, 1, 0, 0, 0, 1114, 1047, 1, 0, 0, 0, 1114, 1048, 1, 0, 0, 0, 1114, 1049, 1, 0, 0, 0, 1114, 1050, 1, 0, 0, 0, 1114, 1051, 1, 0, 0, 0, 1114, 1052, 1, 0, 0, 0, 1114, 1053, 1, 0, 0, 0, 1114, 1054, 1, 0, 0, 0, 1114, 1055, 1, 0, 0, 0, 1114, 1056, 1, 0, 0, 0, 1114, 1057, 1, 0, 0, 0, 1114, 1058, 1, 0, 0, 0, 1114, 1059, 1, 0, 0, 0, 1114, 1060, 1, 0, 0, 0, 1114, 1061, 1, 0, 0, 0, 1114, 1062, 1, 0, 0, 0, 1114, 1063, 1, 0, 0, 0, 1114, 1064, 1, 0, 0, 0, 1114, 1065, 1, 0, 0, 0, 1114, 1066, 1, 0, 0, 0, 1114, 1067, 1, 0, 0, 0, 1114, 1068, 1, 0, 0, 0, 1114, 1069, 1, 0, 0, 0, 1114, 1070, 1, 0, 0, 0, 1114, 1071, 1, 0, 0, 0, 1114, 1072, 1, 0, 0, 0, 1114, 1073, 1, 0, 0, 0, 1114, 1074, 1, 0, 0, 0, 1114, 1075, 1, 0, 0, 0, 1114, 1076, 1, 0, 0, 0, 1114, 1077, 1, 0, 0, 0, 1114, 1078, 1, 0, 0, 0, 1114, 1079, 1, 0, 0, 0, 1114, 1080, 1, 0, 0, 0, 1114, 1081, 1, 0, 0, 0, 1114, 1082, 1, 0, 0, 0, 1114, 1083, 1, 0, 0, 0, 1114, 1084, 1, 0, 0, 0, 1114, 1085, 1, 0, 0, 0, 1114, 1086, 1, 0, 0, 0, 1114, 1087, 1, 0, 0, 0, 1114, 1088, 1, 0, 0, 0, 1114, 1089, 1, 0, 0, 0, 1114, 1090, 1, 0, 0, 0, 1114, 1091, 1, 0, 0, 0, 1114, 1092, 1, 0, 0, 0, 1114, 1093, 1, 0, 0, 0, 1114, 1094, 1, 0, 0, 0, 1114, 1095, 1, 0, 0, 0, 1114, 1096, 1, 0, 0, 0, 1114, 1097, 1, 0, 0, 0, 1114, 1098, 1, 0, 0, 0, 1114, 1099, 1, 0, 0, 0, 1114, 1100, 1, 0, 0, 0, 1114, 1101, 1, 0, 0, 0, 1114, 1102, 1, 0, 0, 0, 1114, 1103, 1, 0, 0, 0, 1114, 1104, 1, 0, 0, 0, 1114, 1105, 1, 0, 0, 0, 1114, 1106, 1, 0, 0, 0, 1114, 1107, 1, 0, 0, 0, 1114, 1108, 1, 0, 0, 0, 1114, 1109, 1, 0, 0, 0, 1114, 1110, 1, 0, 0, 0, 1114, 1111, 1, 0, 0, 0, 1114, 1112, 1, 0, 0, 0, 1114, 1113, 1, 0, 0, 0, 1115, 227, 1, 0, 0, 0, 79, 229, 242, 248, 266, 269, 284, 294, 301, 306, 311, 318, 322, 327, 331, 337, 342, 353, 358, 362, 366, 370, 375, 389, 400, 408, 420, 426, 465, 471, 484, 504, 509, 517, 526, 536, 553, 562, 577, 585, 592, 598, 600, 611, 622, 628, 641, 652, 665, 675, 682, 694, 702, 706, 731, 764, 772, 779, 782, 787, 805, 809, 813, 819, 844, 872, 905, 914, 919, 928, 949, 961, 969, 973, 982, 985, 994, 998, 1012, 1114] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.ts b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.ts index d5c14af0840a..811481d0f918 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.ts +++ b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParser.ts @@ -1,4 +1,4 @@ -// Generated from grammar/OpenSearchPPLParser.g4 by ANTLR 4.13.1 +// Generated from ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 by ANTLR 4.13.1 import * as antlr from "antlr4ng"; import { Token } from "antlr4ng"; @@ -3210,7 +3210,275 @@ export class OpenSearchPPLParser extends antlr.Parser { this.state = 682; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { + case OpenSearchPPLParser.SEARCH: + case OpenSearchPPLParser.DESCRIBE: + case OpenSearchPPLParser.SHOW: + case OpenSearchPPLParser.FROM: + case OpenSearchPPLParser.WHERE: + case OpenSearchPPLParser.FIELDS: + case OpenSearchPPLParser.RENAME: + case OpenSearchPPLParser.STATS: + case OpenSearchPPLParser.DEDUP: + case OpenSearchPPLParser.SORT: + case OpenSearchPPLParser.EVAL: + case OpenSearchPPLParser.HEAD: + case OpenSearchPPLParser.TOP: + case OpenSearchPPLParser.RARE: + case OpenSearchPPLParser.PARSE: + case OpenSearchPPLParser.METHOD: + case OpenSearchPPLParser.REGEX: + case OpenSearchPPLParser.PUNCT: + case OpenSearchPPLParser.GROK: + case OpenSearchPPLParser.PATTERN: + case OpenSearchPPLParser.PATTERNS: + case OpenSearchPPLParser.NEW_FIELD: + case OpenSearchPPLParser.KMEANS: + case OpenSearchPPLParser.AD: + case OpenSearchPPLParser.ML: + case OpenSearchPPLParser.SOURCE: + case OpenSearchPPLParser.INDEX: + case OpenSearchPPLParser.D: + case OpenSearchPPLParser.DESC: + case OpenSearchPPLParser.DATASOURCES: + case OpenSearchPPLParser.SORTBY: + case OpenSearchPPLParser.STR: + case OpenSearchPPLParser.IP: + case OpenSearchPPLParser.NUM: + case OpenSearchPPLParser.KEEPEMPTY: + case OpenSearchPPLParser.CONSECUTIVE: + case OpenSearchPPLParser.DEDUP_SPLITVALUES: + case OpenSearchPPLParser.PARTITIONS: + case OpenSearchPPLParser.ALLNUM: + case OpenSearchPPLParser.DELIM: + case OpenSearchPPLParser.CENTROIDS: + case OpenSearchPPLParser.ITERATIONS: + case OpenSearchPPLParser.DISTANCE_TYPE: + case OpenSearchPPLParser.NUMBER_OF_TREES: + case OpenSearchPPLParser.SHINGLE_SIZE: + case OpenSearchPPLParser.SAMPLE_SIZE: + case OpenSearchPPLParser.OUTPUT_AFTER: + case OpenSearchPPLParser.TIME_DECAY: + case OpenSearchPPLParser.ANOMALY_RATE: + case OpenSearchPPLParser.CATEGORY_FIELD: + case OpenSearchPPLParser.TIME_FIELD: + case OpenSearchPPLParser.TIME_ZONE: + case OpenSearchPPLParser.TRAINING_DATA_SIZE: + case OpenSearchPPLParser.ANOMALY_SCORE_THRESHOLD: + case OpenSearchPPLParser.CONVERT_TZ: + case OpenSearchPPLParser.DATETIME: + case OpenSearchPPLParser.DAY: + case OpenSearchPPLParser.DAY_HOUR: + case OpenSearchPPLParser.DAY_MICROSECOND: + case OpenSearchPPLParser.DAY_MINUTE: + case OpenSearchPPLParser.DAY_OF_YEAR: + case OpenSearchPPLParser.DAY_SECOND: + case OpenSearchPPLParser.HOUR: + case OpenSearchPPLParser.HOUR_MICROSECOND: + case OpenSearchPPLParser.HOUR_MINUTE: + case OpenSearchPPLParser.HOUR_OF_DAY: + case OpenSearchPPLParser.HOUR_SECOND: + case OpenSearchPPLParser.MICROSECOND: + case OpenSearchPPLParser.MILLISECOND: + case OpenSearchPPLParser.MINUTE: + case OpenSearchPPLParser.MINUTE_MICROSECOND: + case OpenSearchPPLParser.MINUTE_OF_DAY: + case OpenSearchPPLParser.MINUTE_OF_HOUR: + case OpenSearchPPLParser.MINUTE_SECOND: + case OpenSearchPPLParser.MONTH: + case OpenSearchPPLParser.MONTH_OF_YEAR: + case OpenSearchPPLParser.QUARTER: + case OpenSearchPPLParser.SECOND: + case OpenSearchPPLParser.SECOND_MICROSECOND: + case OpenSearchPPLParser.SECOND_OF_MINUTE: + case OpenSearchPPLParser.WEEK: + case OpenSearchPPLParser.WEEK_OF_YEAR: + case OpenSearchPPLParser.YEAR: + case OpenSearchPPLParser.YEAR_MONTH: + case OpenSearchPPLParser.DOT: + case OpenSearchPPLParser.BACKTICK: + case OpenSearchPPLParser.AVG: + case OpenSearchPPLParser.COUNT: + case OpenSearchPPLParser.DISTINCT_COUNT: + case OpenSearchPPLParser.ESTDC: + case OpenSearchPPLParser.ESTDC_ERROR: + case OpenSearchPPLParser.MAX: + case OpenSearchPPLParser.MEAN: + case OpenSearchPPLParser.MEDIAN: + case OpenSearchPPLParser.MIN: + case OpenSearchPPLParser.MODE: + case OpenSearchPPLParser.RANGE: + case OpenSearchPPLParser.STDEV: + case OpenSearchPPLParser.STDEVP: + case OpenSearchPPLParser.SUM: + case OpenSearchPPLParser.SUMSQ: + case OpenSearchPPLParser.VAR_SAMP: + case OpenSearchPPLParser.VAR_POP: + case OpenSearchPPLParser.STDDEV_SAMP: + case OpenSearchPPLParser.STDDEV_POP: + case OpenSearchPPLParser.PERCENTILE: + case OpenSearchPPLParser.TAKE: + case OpenSearchPPLParser.FIRST: + case OpenSearchPPLParser.LAST: + case OpenSearchPPLParser.LIST: + case OpenSearchPPLParser.VALUES: + case OpenSearchPPLParser.EARLIEST: + case OpenSearchPPLParser.EARLIEST_TIME: + case OpenSearchPPLParser.LATEST: + case OpenSearchPPLParser.LATEST_TIME: + case OpenSearchPPLParser.PER_DAY: + case OpenSearchPPLParser.PER_HOUR: + case OpenSearchPPLParser.PER_MINUTE: + case OpenSearchPPLParser.PER_SECOND: + case OpenSearchPPLParser.RATE: + case OpenSearchPPLParser.SPARKLINE: + case OpenSearchPPLParser.C: + case OpenSearchPPLParser.DC: + case OpenSearchPPLParser.ABS: + case OpenSearchPPLParser.CBRT: + case OpenSearchPPLParser.CEIL: + case OpenSearchPPLParser.CEILING: + case OpenSearchPPLParser.CONV: + case OpenSearchPPLParser.CRC32: + case OpenSearchPPLParser.E: + case OpenSearchPPLParser.EXP: + case OpenSearchPPLParser.FLOOR: + case OpenSearchPPLParser.LN: + case OpenSearchPPLParser.LOG: + case OpenSearchPPLParser.LOG10: + case OpenSearchPPLParser.LOG2: + case OpenSearchPPLParser.MOD: + case OpenSearchPPLParser.PI: + case OpenSearchPPLParser.POSITION: + case OpenSearchPPLParser.POW: + case OpenSearchPPLParser.POWER: + case OpenSearchPPLParser.RAND: + case OpenSearchPPLParser.ROUND: + case OpenSearchPPLParser.SIGN: + case OpenSearchPPLParser.SQRT: + case OpenSearchPPLParser.TRUNCATE: + case OpenSearchPPLParser.ACOS: + case OpenSearchPPLParser.ASIN: + case OpenSearchPPLParser.ATAN: + case OpenSearchPPLParser.ATAN2: + case OpenSearchPPLParser.COS: + case OpenSearchPPLParser.COT: + case OpenSearchPPLParser.DEGREES: + case OpenSearchPPLParser.RADIANS: + case OpenSearchPPLParser.SIN: + case OpenSearchPPLParser.TAN: + case OpenSearchPPLParser.ADDDATE: + case OpenSearchPPLParser.ADDTIME: + case OpenSearchPPLParser.CURDATE: + case OpenSearchPPLParser.CURRENT_DATE: + case OpenSearchPPLParser.CURRENT_TIME: + case OpenSearchPPLParser.CURRENT_TIMESTAMP: + case OpenSearchPPLParser.CURTIME: + case OpenSearchPPLParser.DATE: + case OpenSearchPPLParser.DATEDIFF: + case OpenSearchPPLParser.DATE_ADD: + case OpenSearchPPLParser.DATE_FORMAT: + case OpenSearchPPLParser.DATE_SUB: + case OpenSearchPPLParser.DAYNAME: + case OpenSearchPPLParser.DAYOFMONTH: + case OpenSearchPPLParser.DAYOFWEEK: + case OpenSearchPPLParser.DAYOFYEAR: + case OpenSearchPPLParser.DAY_OF_MONTH: + case OpenSearchPPLParser.DAY_OF_WEEK: + case OpenSearchPPLParser.FROM_DAYS: + case OpenSearchPPLParser.FROM_UNIXTIME: + case OpenSearchPPLParser.LAST_DAY: + case OpenSearchPPLParser.LOCALTIME: + case OpenSearchPPLParser.LOCALTIMESTAMP: + case OpenSearchPPLParser.MAKEDATE: + case OpenSearchPPLParser.MAKETIME: + case OpenSearchPPLParser.MONTHNAME: + case OpenSearchPPLParser.NOW: + case OpenSearchPPLParser.PERIOD_ADD: + case OpenSearchPPLParser.PERIOD_DIFF: + case OpenSearchPPLParser.SEC_TO_TIME: + case OpenSearchPPLParser.STR_TO_DATE: + case OpenSearchPPLParser.SUBDATE: + case OpenSearchPPLParser.SUBTIME: + case OpenSearchPPLParser.SYSDATE: + case OpenSearchPPLParser.TIME: + case OpenSearchPPLParser.TIMEDIFF: + case OpenSearchPPLParser.TIMESTAMP: + case OpenSearchPPLParser.TIME_FORMAT: + case OpenSearchPPLParser.TIME_TO_SEC: + case OpenSearchPPLParser.TO_DAYS: + case OpenSearchPPLParser.TO_SECONDS: + case OpenSearchPPLParser.UNIX_TIMESTAMP: + case OpenSearchPPLParser.UTC_DATE: + case OpenSearchPPLParser.UTC_TIME: + case OpenSearchPPLParser.UTC_TIMESTAMP: + case OpenSearchPPLParser.WEEKDAY: + case OpenSearchPPLParser.YEARWEEK: + case OpenSearchPPLParser.SUBSTR: + case OpenSearchPPLParser.SUBSTRING: + case OpenSearchPPLParser.LTRIM: + case OpenSearchPPLParser.RTRIM: + case OpenSearchPPLParser.TRIM: + case OpenSearchPPLParser.LOWER: + case OpenSearchPPLParser.UPPER: + case OpenSearchPPLParser.CONCAT: + case OpenSearchPPLParser.CONCAT_WS: + case OpenSearchPPLParser.LENGTH: + case OpenSearchPPLParser.STRCMP: + case OpenSearchPPLParser.RIGHT: + case OpenSearchPPLParser.LEFT: + case OpenSearchPPLParser.ASCII: + case OpenSearchPPLParser.LOCATE: + case OpenSearchPPLParser.REPLACE: + case OpenSearchPPLParser.REVERSE: + case OpenSearchPPLParser.LIKE: + case OpenSearchPPLParser.ISNULL: + case OpenSearchPPLParser.ISNOTNULL: + case OpenSearchPPLParser.IFNULL: + case OpenSearchPPLParser.NULLIF: + case OpenSearchPPLParser.IF: + case OpenSearchPPLParser.TYPEOF: + case OpenSearchPPLParser.ALLOW_LEADING_WILDCARD: + case OpenSearchPPLParser.ANALYZE_WILDCARD: + case OpenSearchPPLParser.ANALYZER: + case OpenSearchPPLParser.AUTO_GENERATE_SYNONYMS_PHRASE_QUERY: + case OpenSearchPPLParser.BOOST: + case OpenSearchPPLParser.CUTOFF_FREQUENCY: + case OpenSearchPPLParser.DEFAULT_FIELD: + case OpenSearchPPLParser.DEFAULT_OPERATOR: + case OpenSearchPPLParser.ENABLE_POSITION_INCREMENTS: + case OpenSearchPPLParser.ESCAPE: + case OpenSearchPPLParser.FLAGS: + case OpenSearchPPLParser.FUZZY_MAX_EXPANSIONS: + case OpenSearchPPLParser.FUZZY_PREFIX_LENGTH: + case OpenSearchPPLParser.FUZZY_TRANSPOSITIONS: + case OpenSearchPPLParser.FUZZY_REWRITE: + case OpenSearchPPLParser.FUZZINESS: + case OpenSearchPPLParser.LENIENT: + case OpenSearchPPLParser.LOW_FREQ_OPERATOR: + case OpenSearchPPLParser.MAX_DETERMINIZED_STATES: + case OpenSearchPPLParser.MAX_EXPANSIONS: + case OpenSearchPPLParser.MINIMUM_SHOULD_MATCH: + case OpenSearchPPLParser.OPERATOR: + case OpenSearchPPLParser.PHRASE_SLOP: + case OpenSearchPPLParser.PREFIX_LENGTH: + case OpenSearchPPLParser.QUOTE_ANALYZER: + case OpenSearchPPLParser.QUOTE_FIELD_SUFFIX: + case OpenSearchPPLParser.REWRITE: + case OpenSearchPPLParser.SLOP: + case OpenSearchPPLParser.TIE_BREAKER: + case OpenSearchPPLParser.TYPE: + case OpenSearchPPLParser.ZERO_TERMS_QUERY: + case OpenSearchPPLParser.SPAN: + case OpenSearchPPLParser.MS: + case OpenSearchPPLParser.S: + case OpenSearchPPLParser.M: + case OpenSearchPPLParser.H: + case OpenSearchPPLParser.W: + case OpenSearchPPLParser.Q: + case OpenSearchPPLParser.Y: case OpenSearchPPLParser.ID: + case OpenSearchPPLParser.CLUSTER: + case OpenSearchPPLParser.BQUOTA_STRING: this.enterOuterAlt(localContext, 1); { this.state = 680; @@ -5451,11 +5719,29 @@ export class OpenSearchPPLParser extends antlr.Parser { public tableQualifiedName(): TableQualifiedNameContext { let localContext = new TableQualifiedNameContext(this.context, this.state); this.enterRule(localContext, 216, OpenSearchPPLParser.RULE_tableQualifiedName); + let _la: number; try { + localContext = new IdentsAsTableQualifiedNameContext(localContext); this.enterOuterAlt(localContext, 1); { this.state = 956; - this.match(OpenSearchPPLParser.ID); + this.tableIdent(); + this.state = 961; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 111) { + { + { + this.state = 957; + this.match(OpenSearchPPLParser.DOT); + this.state = 958; + this.ident(); + } + } + this.state = 963; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } } } catch (re) { @@ -5479,21 +5765,21 @@ export class OpenSearchPPLParser extends antlr.Parser { localContext = new IdentsAsWildcardQualifiedNameContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 958; + this.state = 964; this.wildcard(); - this.state = 963; + this.state = 969; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 111) { { { - this.state = 959; + this.state = 965; this.match(OpenSearchPPLParser.DOT); - this.state = 960; + this.state = 966; this.wildcard(); } } - this.state = 965; + this.state = 971; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -5517,42 +5803,42 @@ export class OpenSearchPPLParser extends antlr.Parser { this.enterRule(localContext, 220, OpenSearchPPLParser.RULE_ident); let _la: number; try { - this.state = 976; + this.state = 982; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case OpenSearchPPLParser.DOT: case OpenSearchPPLParser.ID: this.enterOuterAlt(localContext, 1); { - this.state = 967; + this.state = 973; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 111) { { - this.state = 966; + this.state = 972; this.match(OpenSearchPPLParser.DOT); } } - this.state = 969; + this.state = 975; this.match(OpenSearchPPLParser.ID); } break; case OpenSearchPPLParser.BACKTICK: this.enterOuterAlt(localContext, 2); { - this.state = 970; + this.state = 976; this.match(OpenSearchPPLParser.BACKTICK); - this.state = 971; + this.state = 977; this.ident(); - this.state = 972; + this.state = 978; this.match(OpenSearchPPLParser.BACKTICK); } break; case OpenSearchPPLParser.BQUOTA_STRING: this.enterOuterAlt(localContext, 3); { - this.state = 974; + this.state = 980; this.match(OpenSearchPPLParser.BQUOTA_STRING); } break; @@ -5822,7 +6108,7 @@ export class OpenSearchPPLParser extends antlr.Parser { case OpenSearchPPLParser.Y: this.enterOuterAlt(localContext, 4); { - this.state = 975; + this.state = 981; this.keywordsCanBeId(); } break; @@ -5850,17 +6136,17 @@ export class OpenSearchPPLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 979; + this.state = 985; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 329) { { - this.state = 978; + this.state = 984; this.match(OpenSearchPPLParser.CLUSTER); } } - this.state = 981; + this.state = 987; this.ident(); } } @@ -5883,38 +6169,38 @@ export class OpenSearchPPLParser extends antlr.Parser { let _la: number; try { let alternative: number; - this.state = 1006; + this.state = 1012; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 76, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 77, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 983; + this.state = 989; this.ident(); - this.state = 988; + this.state = 994; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 74, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 75, this.context); while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { if (alternative === 1) { { { - this.state = 984; + this.state = 990; this.match(OpenSearchPPLParser.MODULE); - this.state = 985; + this.state = 991; this.ident(); } } } - this.state = 990; + this.state = 996; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 74, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 75, this.context); } - this.state = 992; + this.state = 998; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 122) { { - this.state = 991; + this.state = 997; this.match(OpenSearchPPLParser.MODULE); } } @@ -5924,33 +6210,33 @@ export class OpenSearchPPLParser extends antlr.Parser { case 2: this.enterOuterAlt(localContext, 2); { - this.state = 994; + this.state = 1000; this.match(OpenSearchPPLParser.SINGLE_QUOTE); - this.state = 995; + this.state = 1001; this.wildcard(); - this.state = 996; + this.state = 1002; this.match(OpenSearchPPLParser.SINGLE_QUOTE); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 998; + this.state = 1004; this.match(OpenSearchPPLParser.DOUBLE_QUOTE); - this.state = 999; + this.state = 1005; this.wildcard(); - this.state = 1000; + this.state = 1006; this.match(OpenSearchPPLParser.DOUBLE_QUOTE); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 1002; + this.state = 1008; this.match(OpenSearchPPLParser.BACKTICK); - this.state = 1003; + this.state = 1009; this.wildcard(); - this.state = 1004; + this.state = 1010; this.match(OpenSearchPPLParser.BACKTICK); } break; @@ -5973,706 +6259,706 @@ export class OpenSearchPPLParser extends antlr.Parser { let localContext = new KeywordsCanBeIdContext(this.context, this.state); this.enterRule(localContext, 226, OpenSearchPPLParser.RULE_keywordsCanBeId); try { - this.state = 1108; + this.state = 1114; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 77, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 78, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 1008; + this.state = 1014; this.match(OpenSearchPPLParser.D); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 1009; + this.state = 1015; this.timespanUnit(); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 1010; + this.state = 1016; this.match(OpenSearchPPLParser.SPAN); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 1011; + this.state = 1017; this.evalFunctionName(); } break; case 5: this.enterOuterAlt(localContext, 5); { - this.state = 1012; + this.state = 1018; this.relevanceArgName(); } break; case 6: this.enterOuterAlt(localContext, 6); { - this.state = 1013; + this.state = 1019; this.intervalUnit(); } break; case 7: this.enterOuterAlt(localContext, 7); { - this.state = 1014; + this.state = 1020; this.dateTimeFunctionName(); } break; case 8: this.enterOuterAlt(localContext, 8); { - this.state = 1015; + this.state = 1021; this.textFunctionName(); } break; case 9: this.enterOuterAlt(localContext, 9); { - this.state = 1016; + this.state = 1022; this.mathematicalFunctionName(); } break; case 10: this.enterOuterAlt(localContext, 10); { - this.state = 1017; + this.state = 1023; this.positionFunctionName(); } break; case 11: this.enterOuterAlt(localContext, 11); { - this.state = 1018; + this.state = 1024; this.match(OpenSearchPPLParser.SEARCH); } break; case 12: this.enterOuterAlt(localContext, 12); { - this.state = 1019; + this.state = 1025; this.match(OpenSearchPPLParser.DESCRIBE); } break; case 13: this.enterOuterAlt(localContext, 13); { - this.state = 1020; + this.state = 1026; this.match(OpenSearchPPLParser.SHOW); } break; case 14: this.enterOuterAlt(localContext, 14); { - this.state = 1021; + this.state = 1027; this.match(OpenSearchPPLParser.FROM); } break; case 15: this.enterOuterAlt(localContext, 15); { - this.state = 1022; + this.state = 1028; this.match(OpenSearchPPLParser.WHERE); } break; case 16: this.enterOuterAlt(localContext, 16); { - this.state = 1023; + this.state = 1029; this.match(OpenSearchPPLParser.FIELDS); } break; case 17: this.enterOuterAlt(localContext, 17); { - this.state = 1024; + this.state = 1030; this.match(OpenSearchPPLParser.RENAME); } break; case 18: this.enterOuterAlt(localContext, 18); { - this.state = 1025; + this.state = 1031; this.match(OpenSearchPPLParser.STATS); } break; case 19: this.enterOuterAlt(localContext, 19); { - this.state = 1026; + this.state = 1032; this.match(OpenSearchPPLParser.DEDUP); } break; case 20: this.enterOuterAlt(localContext, 20); { - this.state = 1027; + this.state = 1033; this.match(OpenSearchPPLParser.SORT); } break; case 21: this.enterOuterAlt(localContext, 21); { - this.state = 1028; + this.state = 1034; this.match(OpenSearchPPLParser.EVAL); } break; case 22: this.enterOuterAlt(localContext, 22); { - this.state = 1029; + this.state = 1035; this.match(OpenSearchPPLParser.HEAD); } break; case 23: this.enterOuterAlt(localContext, 23); { - this.state = 1030; + this.state = 1036; this.match(OpenSearchPPLParser.TOP); } break; case 24: this.enterOuterAlt(localContext, 24); { - this.state = 1031; + this.state = 1037; this.match(OpenSearchPPLParser.RARE); } break; case 25: this.enterOuterAlt(localContext, 25); { - this.state = 1032; + this.state = 1038; this.match(OpenSearchPPLParser.PARSE); } break; case 26: this.enterOuterAlt(localContext, 26); { - this.state = 1033; + this.state = 1039; this.match(OpenSearchPPLParser.METHOD); } break; case 27: this.enterOuterAlt(localContext, 27); { - this.state = 1034; + this.state = 1040; this.match(OpenSearchPPLParser.REGEX); } break; case 28: this.enterOuterAlt(localContext, 28); { - this.state = 1035; + this.state = 1041; this.match(OpenSearchPPLParser.PUNCT); } break; case 29: this.enterOuterAlt(localContext, 29); { - this.state = 1036; + this.state = 1042; this.match(OpenSearchPPLParser.GROK); } break; case 30: this.enterOuterAlt(localContext, 30); { - this.state = 1037; + this.state = 1043; this.match(OpenSearchPPLParser.PATTERN); } break; case 31: this.enterOuterAlt(localContext, 31); { - this.state = 1038; + this.state = 1044; this.match(OpenSearchPPLParser.PATTERNS); } break; case 32: this.enterOuterAlt(localContext, 32); { - this.state = 1039; + this.state = 1045; this.match(OpenSearchPPLParser.NEW_FIELD); } break; case 33: this.enterOuterAlt(localContext, 33); { - this.state = 1040; + this.state = 1046; this.match(OpenSearchPPLParser.KMEANS); } break; case 34: this.enterOuterAlt(localContext, 34); { - this.state = 1041; + this.state = 1047; this.match(OpenSearchPPLParser.AD); } break; case 35: this.enterOuterAlt(localContext, 35); { - this.state = 1042; + this.state = 1048; this.match(OpenSearchPPLParser.ML); } break; case 36: this.enterOuterAlt(localContext, 36); { - this.state = 1043; + this.state = 1049; this.match(OpenSearchPPLParser.SOURCE); } break; case 37: this.enterOuterAlt(localContext, 37); { - this.state = 1044; + this.state = 1050; this.match(OpenSearchPPLParser.INDEX); } break; case 38: this.enterOuterAlt(localContext, 38); { - this.state = 1045; + this.state = 1051; this.match(OpenSearchPPLParser.DESC); } break; case 39: this.enterOuterAlt(localContext, 39); { - this.state = 1046; + this.state = 1052; this.match(OpenSearchPPLParser.DATASOURCES); } break; case 40: this.enterOuterAlt(localContext, 40); { - this.state = 1047; + this.state = 1053; this.match(OpenSearchPPLParser.SORTBY); } break; case 41: this.enterOuterAlt(localContext, 41); { - this.state = 1048; + this.state = 1054; this.match(OpenSearchPPLParser.STR); } break; case 42: this.enterOuterAlt(localContext, 42); { - this.state = 1049; + this.state = 1055; this.match(OpenSearchPPLParser.IP); } break; case 43: this.enterOuterAlt(localContext, 43); { - this.state = 1050; + this.state = 1056; this.match(OpenSearchPPLParser.NUM); } break; case 44: this.enterOuterAlt(localContext, 44); { - this.state = 1051; + this.state = 1057; this.match(OpenSearchPPLParser.KEEPEMPTY); } break; case 45: this.enterOuterAlt(localContext, 45); { - this.state = 1052; + this.state = 1058; this.match(OpenSearchPPLParser.CONSECUTIVE); } break; case 46: this.enterOuterAlt(localContext, 46); { - this.state = 1053; + this.state = 1059; this.match(OpenSearchPPLParser.DEDUP_SPLITVALUES); } break; case 47: this.enterOuterAlt(localContext, 47); { - this.state = 1054; + this.state = 1060; this.match(OpenSearchPPLParser.PARTITIONS); } break; case 48: this.enterOuterAlt(localContext, 48); { - this.state = 1055; + this.state = 1061; this.match(OpenSearchPPLParser.ALLNUM); } break; case 49: this.enterOuterAlt(localContext, 49); { - this.state = 1056; + this.state = 1062; this.match(OpenSearchPPLParser.DELIM); } break; case 50: this.enterOuterAlt(localContext, 50); { - this.state = 1057; + this.state = 1063; this.match(OpenSearchPPLParser.CENTROIDS); } break; case 51: this.enterOuterAlt(localContext, 51); { - this.state = 1058; + this.state = 1064; this.match(OpenSearchPPLParser.ITERATIONS); } break; case 52: this.enterOuterAlt(localContext, 52); { - this.state = 1059; + this.state = 1065; this.match(OpenSearchPPLParser.DISTANCE_TYPE); } break; case 53: this.enterOuterAlt(localContext, 53); { - this.state = 1060; + this.state = 1066; this.match(OpenSearchPPLParser.NUMBER_OF_TREES); } break; case 54: this.enterOuterAlt(localContext, 54); { - this.state = 1061; + this.state = 1067; this.match(OpenSearchPPLParser.SHINGLE_SIZE); } break; case 55: this.enterOuterAlt(localContext, 55); { - this.state = 1062; + this.state = 1068; this.match(OpenSearchPPLParser.SAMPLE_SIZE); } break; case 56: this.enterOuterAlt(localContext, 56); { - this.state = 1063; + this.state = 1069; this.match(OpenSearchPPLParser.OUTPUT_AFTER); } break; case 57: this.enterOuterAlt(localContext, 57); { - this.state = 1064; + this.state = 1070; this.match(OpenSearchPPLParser.TIME_DECAY); } break; case 58: this.enterOuterAlt(localContext, 58); { - this.state = 1065; + this.state = 1071; this.match(OpenSearchPPLParser.ANOMALY_RATE); } break; case 59: this.enterOuterAlt(localContext, 59); { - this.state = 1066; + this.state = 1072; this.match(OpenSearchPPLParser.CATEGORY_FIELD); } break; case 60: this.enterOuterAlt(localContext, 60); { - this.state = 1067; + this.state = 1073; this.match(OpenSearchPPLParser.TIME_FIELD); } break; case 61: this.enterOuterAlt(localContext, 61); { - this.state = 1068; + this.state = 1074; this.match(OpenSearchPPLParser.TIME_ZONE); } break; case 62: this.enterOuterAlt(localContext, 62); { - this.state = 1069; + this.state = 1075; this.match(OpenSearchPPLParser.TRAINING_DATA_SIZE); } break; case 63: this.enterOuterAlt(localContext, 63); { - this.state = 1070; + this.state = 1076; this.match(OpenSearchPPLParser.ANOMALY_SCORE_THRESHOLD); } break; case 64: this.enterOuterAlt(localContext, 64); { - this.state = 1071; + this.state = 1077; this.match(OpenSearchPPLParser.AVG); } break; case 65: this.enterOuterAlt(localContext, 65); { - this.state = 1072; + this.state = 1078; this.match(OpenSearchPPLParser.COUNT); } break; case 66: this.enterOuterAlt(localContext, 66); { - this.state = 1073; + this.state = 1079; this.match(OpenSearchPPLParser.DISTINCT_COUNT); } break; case 67: this.enterOuterAlt(localContext, 67); { - this.state = 1074; + this.state = 1080; this.match(OpenSearchPPLParser.ESTDC); } break; case 68: this.enterOuterAlt(localContext, 68); { - this.state = 1075; + this.state = 1081; this.match(OpenSearchPPLParser.ESTDC_ERROR); } break; case 69: this.enterOuterAlt(localContext, 69); { - this.state = 1076; + this.state = 1082; this.match(OpenSearchPPLParser.MAX); } break; case 70: this.enterOuterAlt(localContext, 70); { - this.state = 1077; + this.state = 1083; this.match(OpenSearchPPLParser.MEAN); } break; case 71: this.enterOuterAlt(localContext, 71); { - this.state = 1078; + this.state = 1084; this.match(OpenSearchPPLParser.MEDIAN); } break; case 72: this.enterOuterAlt(localContext, 72); { - this.state = 1079; + this.state = 1085; this.match(OpenSearchPPLParser.MIN); } break; case 73: this.enterOuterAlt(localContext, 73); { - this.state = 1080; + this.state = 1086; this.match(OpenSearchPPLParser.MODE); } break; case 74: this.enterOuterAlt(localContext, 74); { - this.state = 1081; + this.state = 1087; this.match(OpenSearchPPLParser.RANGE); } break; case 75: this.enterOuterAlt(localContext, 75); { - this.state = 1082; + this.state = 1088; this.match(OpenSearchPPLParser.STDEV); } break; case 76: this.enterOuterAlt(localContext, 76); { - this.state = 1083; + this.state = 1089; this.match(OpenSearchPPLParser.STDEVP); } break; case 77: this.enterOuterAlt(localContext, 77); { - this.state = 1084; + this.state = 1090; this.match(OpenSearchPPLParser.SUM); } break; case 78: this.enterOuterAlt(localContext, 78); { - this.state = 1085; + this.state = 1091; this.match(OpenSearchPPLParser.SUMSQ); } break; case 79: this.enterOuterAlt(localContext, 79); { - this.state = 1086; + this.state = 1092; this.match(OpenSearchPPLParser.VAR_SAMP); } break; case 80: this.enterOuterAlt(localContext, 80); { - this.state = 1087; + this.state = 1093; this.match(OpenSearchPPLParser.VAR_POP); } break; case 81: this.enterOuterAlt(localContext, 81); { - this.state = 1088; + this.state = 1094; this.match(OpenSearchPPLParser.STDDEV_SAMP); } break; case 82: this.enterOuterAlt(localContext, 82); { - this.state = 1089; + this.state = 1095; this.match(OpenSearchPPLParser.STDDEV_POP); } break; case 83: this.enterOuterAlt(localContext, 83); { - this.state = 1090; + this.state = 1096; this.match(OpenSearchPPLParser.PERCENTILE); } break; case 84: this.enterOuterAlt(localContext, 84); { - this.state = 1091; + this.state = 1097; this.match(OpenSearchPPLParser.TAKE); } break; case 85: this.enterOuterAlt(localContext, 85); { - this.state = 1092; + this.state = 1098; this.match(OpenSearchPPLParser.FIRST); } break; case 86: this.enterOuterAlt(localContext, 86); { - this.state = 1093; + this.state = 1099; this.match(OpenSearchPPLParser.LAST); } break; case 87: this.enterOuterAlt(localContext, 87); { - this.state = 1094; + this.state = 1100; this.match(OpenSearchPPLParser.LIST); } break; case 88: this.enterOuterAlt(localContext, 88); { - this.state = 1095; + this.state = 1101; this.match(OpenSearchPPLParser.VALUES); } break; case 89: this.enterOuterAlt(localContext, 89); { - this.state = 1096; + this.state = 1102; this.match(OpenSearchPPLParser.EARLIEST); } break; case 90: this.enterOuterAlt(localContext, 90); { - this.state = 1097; + this.state = 1103; this.match(OpenSearchPPLParser.EARLIEST_TIME); } break; case 91: this.enterOuterAlt(localContext, 91); { - this.state = 1098; + this.state = 1104; this.match(OpenSearchPPLParser.LATEST); } break; case 92: this.enterOuterAlt(localContext, 92); { - this.state = 1099; + this.state = 1105; this.match(OpenSearchPPLParser.LATEST_TIME); } break; case 93: this.enterOuterAlt(localContext, 93); { - this.state = 1100; + this.state = 1106; this.match(OpenSearchPPLParser.PER_DAY); } break; case 94: this.enterOuterAlt(localContext, 94); { - this.state = 1101; + this.state = 1107; this.match(OpenSearchPPLParser.PER_HOUR); } break; case 95: this.enterOuterAlt(localContext, 95); { - this.state = 1102; + this.state = 1108; this.match(OpenSearchPPLParser.PER_MINUTE); } break; case 96: this.enterOuterAlt(localContext, 96); { - this.state = 1103; + this.state = 1109; this.match(OpenSearchPPLParser.PER_SECOND); } break; case 97: this.enterOuterAlt(localContext, 97); { - this.state = 1104; + this.state = 1110; this.match(OpenSearchPPLParser.RATE); } break; case 98: this.enterOuterAlt(localContext, 98); { - this.state = 1105; + this.state = 1111; this.match(OpenSearchPPLParser.SPARKLINE); } break; case 99: this.enterOuterAlt(localContext, 99); { - this.state = 1106; + this.state = 1112; this.match(OpenSearchPPLParser.C); } break; case 100: this.enterOuterAlt(localContext, 100); { - this.state = 1107; + this.state = 1113; this.match(OpenSearchPPLParser.DC); } break; @@ -6712,7 +6998,7 @@ export class OpenSearchPPLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,336,1111,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6, + 4,1,336,1117,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6, 7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7, 13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2, 20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7, @@ -6791,13 +7077,13 @@ export class OpenSearchPPLParser extends antlr.Parser { 1,98,1,98,1,99,1,99,1,100,1,100,1,100,3,100,929,8,100,1,101,1,101, 1,101,1,102,1,102,1,102,1,103,1,103,1,103,1,104,1,104,1,105,1,105, 1,106,1,106,1,106,1,106,5,106,948,8,106,10,106,12,106,951,9,106, - 1,106,1,106,1,107,1,107,1,108,1,108,1,109,1,109,1,109,5,109,962, - 8,109,10,109,12,109,965,9,109,1,110,3,110,968,8,110,1,110,1,110, - 1,110,1,110,1,110,1,110,1,110,3,110,977,8,110,1,111,3,111,980,8, - 111,1,111,1,111,1,112,1,112,1,112,5,112,987,8,112,10,112,12,112, - 990,9,112,1,112,3,112,993,8,112,1,112,1,112,1,112,1,112,1,112,1, - 112,1,112,1,112,1,112,1,112,1,112,1,112,3,112,1007,8,112,1,113,1, - 113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, + 1,106,1,106,1,107,1,107,1,108,1,108,1,108,5,108,960,8,108,10,108, + 12,108,963,9,108,1,109,1,109,1,109,5,109,968,8,109,10,109,12,109, + 971,9,109,1,110,3,110,974,8,110,1,110,1,110,1,110,1,110,1,110,1, + 110,1,110,3,110,983,8,110,1,111,3,111,986,8,111,1,111,1,111,1,112, + 1,112,1,112,5,112,993,8,112,10,112,12,112,996,9,112,1,112,3,112, + 999,8,112,1,112,1,112,1,112,1,112,1,112,1,112,1,112,1,112,1,112, + 1,112,1,112,1,112,3,112,1013,8,112,1,113,1,113,1,113,1,113,1,113, 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, @@ -6806,360 +7092,362 @@ export class OpenSearchPPLParser extends antlr.Parser { 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,113, - 3,113,1109,8,113,1,113,0,1,90,114,0,2,4,6,8,10,12,14,16,18,20,22, - 24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66, - 68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106, - 108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138, - 140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170, - 172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202, - 204,206,208,210,212,214,216,218,220,222,224,226,0,20,1,0,118,119, - 1,0,18,19,2,0,137,137,171,171,5,0,135,136,140,140,143,143,148,148, - 150,153,3,0,7,7,56,56,289,319,1,0,195,204,13,0,68,70,74,74,76,76, - 79,79,82,82,84,84,86,87,89,92,94,97,205,222,224,225,227,243,246, - 255,4,0,69,69,212,212,241,241,243,243,8,0,70,70,76,76,82,82,84,84, - 89,89,91,92,95,95,97,97,8,0,71,73,75,75,77,78,80,80,85,85,88,88, - 93,93,98,98,1,0,244,245,1,0,275,280,2,0,256,260,262,273,2,0,67,67, - 112,117,1,0,282,285,1,0,286,288,1,0,333,334,1,0,65,66,9,0,70,73, - 75,78,80,80,82,82,84,85,88,89,91,93,95,95,97,98,9,0,31,31,70,70, - 76,76,83,84,89,89,91,92,95,95,97,97,321,327,1258,0,229,1,0,0,0,2, - 233,1,0,0,0,4,235,1,0,0,0,6,237,1,0,0,0,8,248,1,0,0,0,10,266,1,0, - 0,0,12,269,1,0,0,0,14,273,1,0,0,0,16,276,1,0,0,0,18,279,1,0,0,0, - 20,282,1,0,0,0,22,288,1,0,0,0,24,297,1,0,0,0,26,329,1,0,0,0,28,344, - 1,0,0,0,30,347,1,0,0,0,32,356,1,0,0,0,34,364,1,0,0,0,36,372,1,0, - 0,0,38,377,1,0,0,0,40,381,1,0,0,0,42,385,1,0,0,0,44,400,1,0,0,0, - 46,402,1,0,0,0,48,404,1,0,0,0,50,420,1,0,0,0,52,422,1,0,0,0,54,465, - 1,0,0,0,56,467,1,0,0,0,58,474,1,0,0,0,60,484,1,0,0,0,62,486,1,0, - 0,0,64,488,1,0,0,0,66,492,1,0,0,0,68,504,1,0,0,0,70,506,1,0,0,0, - 72,511,1,0,0,0,74,521,1,0,0,0,76,529,1,0,0,0,78,533,1,0,0,0,80,553, - 1,0,0,0,82,555,1,0,0,0,84,557,1,0,0,0,86,566,1,0,0,0,88,577,1,0, - 0,0,90,585,1,0,0,0,92,611,1,0,0,0,94,622,1,0,0,0,96,628,1,0,0,0, - 98,630,1,0,0,0,100,637,1,0,0,0,102,641,1,0,0,0,104,643,1,0,0,0,106, - 657,1,0,0,0,108,682,1,0,0,0,110,684,1,0,0,0,112,689,1,0,0,0,114, - 697,1,0,0,0,116,706,1,0,0,0,118,731,1,0,0,0,120,733,1,0,0,0,122, - 735,1,0,0,0,124,737,1,0,0,0,126,742,1,0,0,0,128,749,1,0,0,0,130, - 764,1,0,0,0,132,772,1,0,0,0,134,782,1,0,0,0,136,787,1,0,0,0,138, - 791,1,0,0,0,140,795,1,0,0,0,142,805,1,0,0,0,144,809,1,0,0,0,146, - 813,1,0,0,0,148,815,1,0,0,0,150,819,1,0,0,0,152,844,1,0,0,0,154, - 846,1,0,0,0,156,848,1,0,0,0,158,850,1,0,0,0,160,857,1,0,0,0,162, - 859,1,0,0,0,164,866,1,0,0,0,166,868,1,0,0,0,168,872,1,0,0,0,170, - 874,1,0,0,0,172,883,1,0,0,0,174,885,1,0,0,0,176,887,1,0,0,0,178, - 889,1,0,0,0,180,891,1,0,0,0,182,893,1,0,0,0,184,895,1,0,0,0,186, - 897,1,0,0,0,188,905,1,0,0,0,190,907,1,0,0,0,192,911,1,0,0,0,194, - 914,1,0,0,0,196,919,1,0,0,0,198,923,1,0,0,0,200,928,1,0,0,0,202, - 930,1,0,0,0,204,933,1,0,0,0,206,936,1,0,0,0,208,939,1,0,0,0,210, - 941,1,0,0,0,212,943,1,0,0,0,214,954,1,0,0,0,216,956,1,0,0,0,218, - 958,1,0,0,0,220,976,1,0,0,0,222,979,1,0,0,0,224,1006,1,0,0,0,226, - 1108,1,0,0,0,228,230,3,2,1,0,229,228,1,0,0,0,229,230,1,0,0,0,230, - 231,1,0,0,0,231,232,5,0,0,1,232,1,1,0,0,0,233,234,3,4,2,0,234,3, - 1,0,0,0,235,236,3,6,3,0,236,5,1,0,0,0,237,242,3,8,4,0,238,239,5, - 109,0,0,239,241,3,10,5,0,240,238,1,0,0,0,241,244,1,0,0,0,242,240, - 1,0,0,0,242,243,1,0,0,0,243,7,1,0,0,0,244,242,1,0,0,0,245,249,3, - 12,6,0,246,249,3,14,7,0,247,249,3,16,8,0,248,245,1,0,0,0,248,246, - 1,0,0,0,248,247,1,0,0,0,249,9,1,0,0,0,250,267,3,18,9,0,251,267,3, - 20,10,0,252,267,3,22,11,0,253,267,3,24,12,0,254,267,3,26,13,0,255, - 267,3,28,14,0,256,267,3,30,15,0,257,267,3,32,16,0,258,267,3,34,17, - 0,259,267,3,36,18,0,260,267,3,38,19,0,261,267,3,40,20,0,262,267, - 3,42,21,0,263,267,3,48,24,0,264,267,3,52,26,0,265,267,3,56,28,0, - 266,250,1,0,0,0,266,251,1,0,0,0,266,252,1,0,0,0,266,253,1,0,0,0, - 266,254,1,0,0,0,266,255,1,0,0,0,266,256,1,0,0,0,266,257,1,0,0,0, - 266,258,1,0,0,0,266,259,1,0,0,0,266,260,1,0,0,0,266,261,1,0,0,0, - 266,262,1,0,0,0,266,263,1,0,0,0,266,264,1,0,0,0,266,265,1,0,0,0, - 267,11,1,0,0,0,268,270,5,2,0,0,269,268,1,0,0,0,269,270,1,0,0,0,270, - 271,1,0,0,0,271,272,3,60,30,0,272,13,1,0,0,0,273,274,5,3,0,0,274, - 275,3,62,31,0,275,15,1,0,0,0,276,277,5,4,0,0,277,278,5,33,0,0,278, - 17,1,0,0,0,279,280,5,6,0,0,280,281,3,90,45,0,281,19,1,0,0,0,282, - 284,5,7,0,0,283,285,7,0,0,0,284,283,1,0,0,0,284,285,1,0,0,0,285, - 286,1,0,0,0,286,287,3,112,56,0,287,21,1,0,0,0,288,289,5,8,0,0,289, - 294,3,64,32,0,290,291,5,110,0,0,291,293,3,64,32,0,292,290,1,0,0, - 0,293,296,1,0,0,0,294,292,1,0,0,0,294,295,1,0,0,0,295,23,1,0,0,0, - 296,294,1,0,0,0,297,301,5,9,0,0,298,299,5,42,0,0,299,300,5,112,0, - 0,300,302,3,194,97,0,301,298,1,0,0,0,301,302,1,0,0,0,302,306,1,0, - 0,0,303,304,5,43,0,0,304,305,5,112,0,0,305,307,3,198,99,0,306,303, - 1,0,0,0,306,307,1,0,0,0,307,311,1,0,0,0,308,309,5,44,0,0,309,310, - 5,112,0,0,310,312,3,192,96,0,311,308,1,0,0,0,311,312,1,0,0,0,312, - 313,1,0,0,0,313,318,3,78,39,0,314,315,5,110,0,0,315,317,3,78,39, - 0,316,314,1,0,0,0,317,320,1,0,0,0,318,316,1,0,0,0,318,319,1,0,0, - 0,319,322,1,0,0,0,320,318,1,0,0,0,321,323,3,68,34,0,322,321,1,0, - 0,0,322,323,1,0,0,0,323,327,1,0,0,0,324,325,5,41,0,0,325,326,5,112, - 0,0,326,328,3,198,99,0,327,324,1,0,0,0,327,328,1,0,0,0,328,25,1, - 0,0,0,329,331,5,10,0,0,330,332,3,194,97,0,331,330,1,0,0,0,331,332, - 1,0,0,0,332,333,1,0,0,0,333,337,3,112,56,0,334,335,5,39,0,0,335, - 336,5,112,0,0,336,338,3,198,99,0,337,334,1,0,0,0,337,338,1,0,0,0, - 338,342,1,0,0,0,339,340,5,40,0,0,340,341,5,112,0,0,341,343,3,198, - 99,0,342,339,1,0,0,0,342,343,1,0,0,0,343,27,1,0,0,0,344,345,5,11, - 0,0,345,346,3,74,37,0,346,29,1,0,0,0,347,348,5,12,0,0,348,353,3, - 76,38,0,349,350,5,110,0,0,350,352,3,76,38,0,351,349,1,0,0,0,352, - 355,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,31,1,0,0,0,355,353, - 1,0,0,0,356,358,5,13,0,0,357,359,3,194,97,0,358,357,1,0,0,0,358, - 359,1,0,0,0,359,362,1,0,0,0,360,361,5,5,0,0,361,363,3,194,97,0,362, - 360,1,0,0,0,362,363,1,0,0,0,363,33,1,0,0,0,364,366,5,14,0,0,365, - 367,3,194,97,0,366,365,1,0,0,0,366,367,1,0,0,0,367,368,1,0,0,0,368, - 370,3,112,56,0,369,371,3,66,33,0,370,369,1,0,0,0,370,371,1,0,0,0, - 371,35,1,0,0,0,372,373,5,15,0,0,373,375,3,112,56,0,374,376,3,66, - 33,0,375,374,1,0,0,0,375,376,1,0,0,0,376,37,1,0,0,0,377,378,5,20, - 0,0,378,379,3,88,44,0,379,380,3,192,96,0,380,39,1,0,0,0,381,382, - 5,16,0,0,382,383,3,88,44,0,383,384,3,192,96,0,384,41,1,0,0,0,385, - 389,5,22,0,0,386,388,3,44,22,0,387,386,1,0,0,0,388,391,1,0,0,0,389, - 387,1,0,0,0,389,390,1,0,0,0,390,392,1,0,0,0,391,389,1,0,0,0,392, - 393,3,88,44,0,393,43,1,0,0,0,394,395,5,23,0,0,395,396,5,112,0,0, - 396,401,3,192,96,0,397,398,5,21,0,0,398,399,5,112,0,0,399,401,3, - 192,96,0,400,394,1,0,0,0,400,397,1,0,0,0,401,45,1,0,0,0,402,403, - 7,1,0,0,403,47,1,0,0,0,404,408,5,24,0,0,405,407,3,50,25,0,406,405, - 1,0,0,0,407,410,1,0,0,0,408,406,1,0,0,0,408,409,1,0,0,0,409,49,1, - 0,0,0,410,408,1,0,0,0,411,412,5,45,0,0,412,413,5,112,0,0,413,421, - 3,194,97,0,414,415,5,46,0,0,415,416,5,112,0,0,416,421,3,194,97,0, - 417,418,5,47,0,0,418,419,5,112,0,0,419,421,3,192,96,0,420,411,1, - 0,0,0,420,414,1,0,0,0,420,417,1,0,0,0,421,51,1,0,0,0,422,426,5,25, - 0,0,423,425,3,54,27,0,424,423,1,0,0,0,425,428,1,0,0,0,426,424,1, - 0,0,0,426,427,1,0,0,0,427,53,1,0,0,0,428,426,1,0,0,0,429,430,5,48, - 0,0,430,431,5,112,0,0,431,466,3,194,97,0,432,433,5,49,0,0,433,434, - 5,112,0,0,434,466,3,194,97,0,435,436,5,50,0,0,436,437,5,112,0,0, - 437,466,3,194,97,0,438,439,5,51,0,0,439,440,5,112,0,0,440,466,3, - 194,97,0,441,442,5,52,0,0,442,443,5,112,0,0,443,466,3,196,98,0,444, - 445,5,53,0,0,445,446,5,112,0,0,446,466,3,196,98,0,447,448,5,54,0, - 0,448,449,5,112,0,0,449,466,3,192,96,0,450,451,5,55,0,0,451,452, - 5,112,0,0,452,466,3,192,96,0,453,454,5,215,0,0,454,455,5,112,0,0, - 455,466,3,192,96,0,456,457,5,56,0,0,457,458,5,112,0,0,458,466,3, - 192,96,0,459,460,5,57,0,0,460,461,5,112,0,0,461,466,3,194,97,0,462, - 463,5,58,0,0,463,464,5,112,0,0,464,466,3,196,98,0,465,429,1,0,0, - 0,465,432,1,0,0,0,465,435,1,0,0,0,465,438,1,0,0,0,465,441,1,0,0, - 0,465,444,1,0,0,0,465,447,1,0,0,0,465,450,1,0,0,0,465,453,1,0,0, - 0,465,456,1,0,0,0,465,459,1,0,0,0,465,462,1,0,0,0,466,55,1,0,0,0, - 467,471,5,26,0,0,468,470,3,58,29,0,469,468,1,0,0,0,470,473,1,0,0, - 0,471,469,1,0,0,0,471,472,1,0,0,0,472,57,1,0,0,0,473,471,1,0,0,0, - 474,475,3,220,110,0,475,476,5,112,0,0,476,477,3,188,94,0,477,59, - 1,0,0,0,478,479,5,29,0,0,479,480,5,112,0,0,480,485,3,62,31,0,481, - 482,5,30,0,0,482,483,5,112,0,0,483,485,3,62,31,0,484,478,1,0,0,0, - 484,481,1,0,0,0,485,61,1,0,0,0,486,487,3,108,54,0,487,63,1,0,0,0, - 488,489,3,122,61,0,489,490,5,27,0,0,490,491,3,122,61,0,491,65,1, - 0,0,0,492,493,5,28,0,0,493,494,3,112,56,0,494,67,1,0,0,0,495,496, - 5,28,0,0,496,505,3,112,56,0,497,498,5,28,0,0,498,505,3,70,35,0,499, - 500,5,28,0,0,500,501,3,70,35,0,501,502,5,110,0,0,502,503,3,112,56, - 0,503,505,1,0,0,0,504,495,1,0,0,0,504,497,1,0,0,0,504,499,1,0,0, - 0,505,69,1,0,0,0,506,509,3,72,36,0,507,508,5,27,0,0,508,510,3,214, - 107,0,509,507,1,0,0,0,509,510,1,0,0,0,510,71,1,0,0,0,511,512,5,320, - 0,0,512,513,5,125,0,0,513,514,3,120,60,0,514,515,5,110,0,0,515,517, - 3,188,94,0,516,518,3,210,105,0,517,516,1,0,0,0,517,518,1,0,0,0,518, - 519,1,0,0,0,519,520,5,126,0,0,520,73,1,0,0,0,521,526,3,116,58,0, - 522,523,5,110,0,0,523,525,3,116,58,0,524,522,1,0,0,0,525,528,1,0, - 0,0,526,524,1,0,0,0,526,527,1,0,0,0,527,75,1,0,0,0,528,526,1,0,0, - 0,529,530,3,120,60,0,530,531,5,112,0,0,531,532,3,88,44,0,532,77, - 1,0,0,0,533,536,3,80,40,0,534,535,5,27,0,0,535,537,3,122,61,0,536, - 534,1,0,0,0,536,537,1,0,0,0,537,79,1,0,0,0,538,539,3,82,41,0,539, - 540,5,125,0,0,540,541,3,94,47,0,541,542,5,126,0,0,542,554,1,0,0, - 0,543,544,5,136,0,0,544,545,5,125,0,0,545,554,5,126,0,0,546,547, - 7,2,0,0,547,548,5,125,0,0,548,549,3,94,47,0,549,550,5,126,0,0,550, - 554,1,0,0,0,551,554,3,86,43,0,552,554,3,84,42,0,553,538,1,0,0,0, - 553,543,1,0,0,0,553,546,1,0,0,0,553,551,1,0,0,0,553,552,1,0,0,0, - 554,81,1,0,0,0,555,556,7,3,0,0,556,83,1,0,0,0,557,558,5,155,0,0, - 558,559,5,125,0,0,559,562,3,120,60,0,560,561,5,110,0,0,561,563,3, - 194,97,0,562,560,1,0,0,0,562,563,1,0,0,0,563,564,1,0,0,0,564,565, - 5,126,0,0,565,85,1,0,0,0,566,567,5,154,0,0,567,568,5,114,0,0,568, - 569,3,194,97,0,569,570,5,113,0,0,570,571,5,125,0,0,571,572,3,120, - 60,0,572,573,5,126,0,0,573,87,1,0,0,0,574,578,3,90,45,0,575,578, - 3,92,46,0,576,578,3,94,47,0,577,574,1,0,0,0,577,575,1,0,0,0,577, - 576,1,0,0,0,578,89,1,0,0,0,579,580,6,45,-1,0,580,586,3,92,46,0,581, - 582,5,61,0,0,582,586,3,90,45,6,583,586,3,100,50,0,584,586,3,102, - 51,0,585,579,1,0,0,0,585,581,1,0,0,0,585,583,1,0,0,0,585,584,1,0, - 0,0,586,600,1,0,0,0,587,588,10,5,0,0,588,589,5,62,0,0,589,599,3, - 90,45,6,590,592,10,4,0,0,591,593,5,63,0,0,592,591,1,0,0,0,592,593, - 1,0,0,0,593,594,1,0,0,0,594,599,3,90,45,5,595,596,10,3,0,0,596,597, - 5,64,0,0,597,599,3,90,45,4,598,587,1,0,0,0,598,590,1,0,0,0,598,595, - 1,0,0,0,599,602,1,0,0,0,600,598,1,0,0,0,600,601,1,0,0,0,601,91,1, - 0,0,0,602,600,1,0,0,0,603,604,3,94,47,0,604,605,3,182,91,0,605,606, - 3,94,47,0,606,612,1,0,0,0,607,608,3,94,47,0,608,609,5,60,0,0,609, - 610,3,212,106,0,610,612,1,0,0,0,611,603,1,0,0,0,611,607,1,0,0,0, - 612,93,1,0,0,0,613,623,3,96,48,0,614,623,3,98,49,0,615,623,3,162, - 81,0,616,623,3,158,79,0,617,623,3,170,85,0,618,619,5,125,0,0,619, - 620,3,94,47,0,620,621,5,126,0,0,621,623,1,0,0,0,622,613,1,0,0,0, - 622,614,1,0,0,0,622,615,1,0,0,0,622,616,1,0,0,0,622,617,1,0,0,0, - 622,618,1,0,0,0,623,95,1,0,0,0,624,629,3,124,62,0,625,629,3,126, - 63,0,626,629,3,120,60,0,627,629,3,188,94,0,628,624,1,0,0,0,628,625, - 1,0,0,0,628,626,1,0,0,0,628,627,1,0,0,0,629,97,1,0,0,0,630,631,3, - 180,90,0,631,632,5,125,0,0,632,633,3,136,68,0,633,634,5,60,0,0,634, - 635,3,136,68,0,635,636,5,126,0,0,636,99,1,0,0,0,637,638,3,128,64, - 0,638,101,1,0,0,0,639,642,3,104,52,0,640,642,3,106,53,0,641,639, - 1,0,0,0,641,640,1,0,0,0,642,103,1,0,0,0,643,644,3,184,92,0,644,645, - 5,125,0,0,645,646,3,146,73,0,646,647,5,110,0,0,647,652,3,148,74, - 0,648,649,5,110,0,0,649,651,3,138,69,0,650,648,1,0,0,0,651,654,1, - 0,0,0,652,650,1,0,0,0,652,653,1,0,0,0,653,655,1,0,0,0,654,652,1, - 0,0,0,655,656,5,126,0,0,656,105,1,0,0,0,657,658,3,186,93,0,658,659, - 5,125,0,0,659,660,5,127,0,0,660,665,3,142,71,0,661,662,5,110,0,0, - 662,664,3,142,71,0,663,661,1,0,0,0,664,667,1,0,0,0,665,663,1,0,0, - 0,665,666,1,0,0,0,666,668,1,0,0,0,667,665,1,0,0,0,668,669,5,128, - 0,0,669,670,5,110,0,0,670,675,3,148,74,0,671,672,5,110,0,0,672,674, - 3,138,69,0,673,671,1,0,0,0,674,677,1,0,0,0,675,673,1,0,0,0,675,676, - 1,0,0,0,676,678,1,0,0,0,677,675,1,0,0,0,678,679,5,126,0,0,679,107, - 1,0,0,0,680,683,3,216,108,0,681,683,5,332,0,0,682,680,1,0,0,0,682, - 681,1,0,0,0,683,109,1,0,0,0,684,685,3,214,107,0,685,686,5,125,0, - 0,686,687,3,134,67,0,687,688,5,126,0,0,688,111,1,0,0,0,689,694,3, - 120,60,0,690,691,5,110,0,0,691,693,3,120,60,0,692,690,1,0,0,0,693, - 696,1,0,0,0,694,692,1,0,0,0,694,695,1,0,0,0,695,113,1,0,0,0,696, - 694,1,0,0,0,697,702,3,122,61,0,698,699,5,110,0,0,699,701,3,122,61, - 0,700,698,1,0,0,0,701,704,1,0,0,0,702,700,1,0,0,0,702,703,1,0,0, - 0,703,115,1,0,0,0,704,702,1,0,0,0,705,707,7,0,0,0,706,705,1,0,0, - 0,706,707,1,0,0,0,707,708,1,0,0,0,708,709,3,118,59,0,709,117,1,0, - 0,0,710,732,3,120,60,0,711,712,5,35,0,0,712,713,5,125,0,0,713,714, - 3,120,60,0,714,715,5,126,0,0,715,732,1,0,0,0,716,717,5,36,0,0,717, - 718,5,125,0,0,718,719,3,120,60,0,719,720,5,126,0,0,720,732,1,0,0, - 0,721,722,5,37,0,0,722,723,5,125,0,0,723,724,3,120,60,0,724,725, - 5,126,0,0,725,732,1,0,0,0,726,727,5,38,0,0,727,728,5,125,0,0,728, - 729,3,120,60,0,729,730,5,126,0,0,730,732,1,0,0,0,731,710,1,0,0,0, - 731,711,1,0,0,0,731,716,1,0,0,0,731,721,1,0,0,0,731,726,1,0,0,0, - 732,119,1,0,0,0,733,734,3,214,107,0,734,121,1,0,0,0,735,736,3,218, - 109,0,736,123,1,0,0,0,737,738,3,132,66,0,738,739,5,125,0,0,739,740, - 3,134,67,0,740,741,5,126,0,0,741,125,1,0,0,0,742,743,5,274,0,0,743, - 744,5,125,0,0,744,745,3,88,44,0,745,746,5,27,0,0,746,747,3,130,65, - 0,747,748,5,126,0,0,748,127,1,0,0,0,749,750,3,174,87,0,750,751,5, - 125,0,0,751,752,3,134,67,0,752,753,5,126,0,0,753,129,1,0,0,0,754, - 765,5,212,0,0,755,765,5,241,0,0,756,765,5,243,0,0,757,765,5,102, - 0,0,758,765,5,103,0,0,759,765,5,104,0,0,760,765,5,105,0,0,761,765, - 5,106,0,0,762,765,5,107,0,0,763,765,5,108,0,0,764,754,1,0,0,0,764, - 755,1,0,0,0,764,756,1,0,0,0,764,757,1,0,0,0,764,758,1,0,0,0,764, - 759,1,0,0,0,764,760,1,0,0,0,764,761,1,0,0,0,764,762,1,0,0,0,764, - 763,1,0,0,0,765,131,1,0,0,0,766,773,3,152,76,0,767,773,3,156,78, - 0,768,773,3,178,89,0,769,773,3,174,87,0,770,773,3,176,88,0,771,773, - 3,180,90,0,772,766,1,0,0,0,772,767,1,0,0,0,772,768,1,0,0,0,772,769, - 1,0,0,0,772,770,1,0,0,0,772,771,1,0,0,0,773,133,1,0,0,0,774,779, - 3,136,68,0,775,776,5,110,0,0,776,778,3,136,68,0,777,775,1,0,0,0, - 778,781,1,0,0,0,779,777,1,0,0,0,779,780,1,0,0,0,780,783,1,0,0,0, - 781,779,1,0,0,0,782,774,1,0,0,0,782,783,1,0,0,0,783,135,1,0,0,0, - 784,785,3,220,110,0,785,786,5,112,0,0,786,788,1,0,0,0,787,784,1, - 0,0,0,787,788,1,0,0,0,788,789,1,0,0,0,789,790,3,94,47,0,790,137, - 1,0,0,0,791,792,3,140,70,0,792,793,5,112,0,0,793,794,3,150,75,0, - 794,139,1,0,0,0,795,796,7,4,0,0,796,141,1,0,0,0,797,806,3,146,73, - 0,798,799,3,146,73,0,799,800,3,144,72,0,800,806,1,0,0,0,801,802, - 3,146,73,0,802,803,5,134,0,0,803,804,3,144,72,0,804,806,1,0,0,0, - 805,797,1,0,0,0,805,798,1,0,0,0,805,801,1,0,0,0,806,143,1,0,0,0, - 807,810,3,194,97,0,808,810,3,196,98,0,809,807,1,0,0,0,809,808,1, - 0,0,0,810,145,1,0,0,0,811,814,3,214,107,0,812,814,3,192,96,0,813, - 811,1,0,0,0,813,812,1,0,0,0,814,147,1,0,0,0,815,816,3,150,75,0,816, - 149,1,0,0,0,817,820,3,214,107,0,818,820,3,188,94,0,819,817,1,0,0, - 0,819,818,1,0,0,0,820,151,1,0,0,0,821,845,5,172,0,0,822,845,5,173, - 0,0,823,845,5,174,0,0,824,845,5,175,0,0,825,845,5,176,0,0,826,845, - 5,177,0,0,827,845,5,178,0,0,828,845,5,179,0,0,829,845,5,180,0,0, - 830,845,5,181,0,0,831,845,5,182,0,0,832,845,5,183,0,0,833,845,5, - 184,0,0,834,845,5,185,0,0,835,845,5,186,0,0,836,845,5,188,0,0,837, - 845,5,189,0,0,838,845,5,190,0,0,839,845,5,191,0,0,840,845,5,192, - 0,0,841,845,5,193,0,0,842,845,5,194,0,0,843,845,3,154,77,0,844,821, - 1,0,0,0,844,822,1,0,0,0,844,823,1,0,0,0,844,824,1,0,0,0,844,825, - 1,0,0,0,844,826,1,0,0,0,844,827,1,0,0,0,844,828,1,0,0,0,844,829, - 1,0,0,0,844,830,1,0,0,0,844,831,1,0,0,0,844,832,1,0,0,0,844,833, - 1,0,0,0,844,834,1,0,0,0,844,835,1,0,0,0,844,836,1,0,0,0,844,837, - 1,0,0,0,844,838,1,0,0,0,844,839,1,0,0,0,844,840,1,0,0,0,844,841, - 1,0,0,0,844,842,1,0,0,0,844,843,1,0,0,0,845,153,1,0,0,0,846,847, - 7,5,0,0,847,155,1,0,0,0,848,849,7,6,0,0,849,157,1,0,0,0,850,851, - 5,226,0,0,851,852,5,125,0,0,852,853,3,160,80,0,853,854,5,110,0,0, - 854,855,3,136,68,0,855,856,5,126,0,0,856,159,1,0,0,0,857,858,7,7, - 0,0,858,161,1,0,0,0,859,860,5,223,0,0,860,861,5,125,0,0,861,862, - 3,168,84,0,862,863,5,5,0,0,863,864,3,136,68,0,864,865,5,126,0,0, - 865,163,1,0,0,0,866,867,7,8,0,0,867,165,1,0,0,0,868,869,7,9,0,0, - 869,167,1,0,0,0,870,873,3,164,82,0,871,873,3,166,83,0,872,870,1, - 0,0,0,872,871,1,0,0,0,873,169,1,0,0,0,874,875,3,172,86,0,875,876, - 5,125,0,0,876,877,3,164,82,0,877,878,5,110,0,0,878,879,3,136,68, - 0,879,880,5,110,0,0,880,881,3,136,68,0,881,882,5,126,0,0,882,171, - 1,0,0,0,883,884,7,10,0,0,884,173,1,0,0,0,885,886,7,11,0,0,886,175, - 1,0,0,0,887,888,5,281,0,0,888,177,1,0,0,0,889,890,7,12,0,0,890,179, - 1,0,0,0,891,892,5,187,0,0,892,181,1,0,0,0,893,894,7,13,0,0,894,183, - 1,0,0,0,895,896,7,14,0,0,896,185,1,0,0,0,897,898,7,15,0,0,898,187, - 1,0,0,0,899,906,3,190,95,0,900,906,3,192,96,0,901,906,3,194,97,0, - 902,906,3,196,98,0,903,906,3,198,99,0,904,906,3,200,100,0,905,899, - 1,0,0,0,905,900,1,0,0,0,905,901,1,0,0,0,905,902,1,0,0,0,905,903, - 1,0,0,0,905,904,1,0,0,0,906,189,1,0,0,0,907,908,5,81,0,0,908,909, - 3,94,47,0,909,910,3,208,104,0,910,191,1,0,0,0,911,912,7,16,0,0,912, - 193,1,0,0,0,913,915,7,0,0,0,914,913,1,0,0,0,914,915,1,0,0,0,915, - 916,1,0,0,0,916,917,5,330,0,0,917,195,1,0,0,0,918,920,7,0,0,0,919, - 918,1,0,0,0,919,920,1,0,0,0,920,921,1,0,0,0,921,922,5,331,0,0,922, - 197,1,0,0,0,923,924,7,17,0,0,924,199,1,0,0,0,925,929,3,202,101,0, - 926,929,3,204,102,0,927,929,3,206,103,0,928,925,1,0,0,0,928,926, - 1,0,0,0,928,927,1,0,0,0,929,201,1,0,0,0,930,931,5,212,0,0,931,932, - 3,192,96,0,932,203,1,0,0,0,933,934,5,241,0,0,934,935,3,192,96,0, - 935,205,1,0,0,0,936,937,5,243,0,0,937,938,3,192,96,0,938,207,1,0, - 0,0,939,940,7,18,0,0,940,209,1,0,0,0,941,942,7,19,0,0,942,211,1, - 0,0,0,943,944,5,125,0,0,944,949,3,188,94,0,945,946,5,110,0,0,946, + 1,113,1,113,1,113,1,113,1,113,1,113,1,113,3,113,1115,8,113,1,113, + 0,1,90,114,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38, + 40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82, + 84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118, + 120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150, + 152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182, + 184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214, + 216,218,220,222,224,226,0,20,1,0,118,119,1,0,18,19,2,0,137,137,171, + 171,5,0,135,136,140,140,143,143,148,148,150,153,3,0,7,7,56,56,289, + 319,1,0,195,204,13,0,68,70,74,74,76,76,79,79,82,82,84,84,86,87,89, + 92,94,97,205,222,224,225,227,243,246,255,4,0,69,69,212,212,241,241, + 243,243,8,0,70,70,76,76,82,82,84,84,89,89,91,92,95,95,97,97,8,0, + 71,73,75,75,77,78,80,80,85,85,88,88,93,93,98,98,1,0,244,245,1,0, + 275,280,2,0,256,260,262,273,2,0,67,67,112,117,1,0,282,285,1,0,286, + 288,1,0,333,334,1,0,65,66,9,0,70,73,75,78,80,80,82,82,84,85,88,89, + 91,93,95,95,97,98,9,0,31,31,70,70,76,76,83,84,89,89,91,92,95,95, + 97,97,321,327,1265,0,229,1,0,0,0,2,233,1,0,0,0,4,235,1,0,0,0,6,237, + 1,0,0,0,8,248,1,0,0,0,10,266,1,0,0,0,12,269,1,0,0,0,14,273,1,0,0, + 0,16,276,1,0,0,0,18,279,1,0,0,0,20,282,1,0,0,0,22,288,1,0,0,0,24, + 297,1,0,0,0,26,329,1,0,0,0,28,344,1,0,0,0,30,347,1,0,0,0,32,356, + 1,0,0,0,34,364,1,0,0,0,36,372,1,0,0,0,38,377,1,0,0,0,40,381,1,0, + 0,0,42,385,1,0,0,0,44,400,1,0,0,0,46,402,1,0,0,0,48,404,1,0,0,0, + 50,420,1,0,0,0,52,422,1,0,0,0,54,465,1,0,0,0,56,467,1,0,0,0,58,474, + 1,0,0,0,60,484,1,0,0,0,62,486,1,0,0,0,64,488,1,0,0,0,66,492,1,0, + 0,0,68,504,1,0,0,0,70,506,1,0,0,0,72,511,1,0,0,0,74,521,1,0,0,0, + 76,529,1,0,0,0,78,533,1,0,0,0,80,553,1,0,0,0,82,555,1,0,0,0,84,557, + 1,0,0,0,86,566,1,0,0,0,88,577,1,0,0,0,90,585,1,0,0,0,92,611,1,0, + 0,0,94,622,1,0,0,0,96,628,1,0,0,0,98,630,1,0,0,0,100,637,1,0,0,0, + 102,641,1,0,0,0,104,643,1,0,0,0,106,657,1,0,0,0,108,682,1,0,0,0, + 110,684,1,0,0,0,112,689,1,0,0,0,114,697,1,0,0,0,116,706,1,0,0,0, + 118,731,1,0,0,0,120,733,1,0,0,0,122,735,1,0,0,0,124,737,1,0,0,0, + 126,742,1,0,0,0,128,749,1,0,0,0,130,764,1,0,0,0,132,772,1,0,0,0, + 134,782,1,0,0,0,136,787,1,0,0,0,138,791,1,0,0,0,140,795,1,0,0,0, + 142,805,1,0,0,0,144,809,1,0,0,0,146,813,1,0,0,0,148,815,1,0,0,0, + 150,819,1,0,0,0,152,844,1,0,0,0,154,846,1,0,0,0,156,848,1,0,0,0, + 158,850,1,0,0,0,160,857,1,0,0,0,162,859,1,0,0,0,164,866,1,0,0,0, + 166,868,1,0,0,0,168,872,1,0,0,0,170,874,1,0,0,0,172,883,1,0,0,0, + 174,885,1,0,0,0,176,887,1,0,0,0,178,889,1,0,0,0,180,891,1,0,0,0, + 182,893,1,0,0,0,184,895,1,0,0,0,186,897,1,0,0,0,188,905,1,0,0,0, + 190,907,1,0,0,0,192,911,1,0,0,0,194,914,1,0,0,0,196,919,1,0,0,0, + 198,923,1,0,0,0,200,928,1,0,0,0,202,930,1,0,0,0,204,933,1,0,0,0, + 206,936,1,0,0,0,208,939,1,0,0,0,210,941,1,0,0,0,212,943,1,0,0,0, + 214,954,1,0,0,0,216,956,1,0,0,0,218,964,1,0,0,0,220,982,1,0,0,0, + 222,985,1,0,0,0,224,1012,1,0,0,0,226,1114,1,0,0,0,228,230,3,2,1, + 0,229,228,1,0,0,0,229,230,1,0,0,0,230,231,1,0,0,0,231,232,5,0,0, + 1,232,1,1,0,0,0,233,234,3,4,2,0,234,3,1,0,0,0,235,236,3,6,3,0,236, + 5,1,0,0,0,237,242,3,8,4,0,238,239,5,109,0,0,239,241,3,10,5,0,240, + 238,1,0,0,0,241,244,1,0,0,0,242,240,1,0,0,0,242,243,1,0,0,0,243, + 7,1,0,0,0,244,242,1,0,0,0,245,249,3,12,6,0,246,249,3,14,7,0,247, + 249,3,16,8,0,248,245,1,0,0,0,248,246,1,0,0,0,248,247,1,0,0,0,249, + 9,1,0,0,0,250,267,3,18,9,0,251,267,3,20,10,0,252,267,3,22,11,0,253, + 267,3,24,12,0,254,267,3,26,13,0,255,267,3,28,14,0,256,267,3,30,15, + 0,257,267,3,32,16,0,258,267,3,34,17,0,259,267,3,36,18,0,260,267, + 3,38,19,0,261,267,3,40,20,0,262,267,3,42,21,0,263,267,3,48,24,0, + 264,267,3,52,26,0,265,267,3,56,28,0,266,250,1,0,0,0,266,251,1,0, + 0,0,266,252,1,0,0,0,266,253,1,0,0,0,266,254,1,0,0,0,266,255,1,0, + 0,0,266,256,1,0,0,0,266,257,1,0,0,0,266,258,1,0,0,0,266,259,1,0, + 0,0,266,260,1,0,0,0,266,261,1,0,0,0,266,262,1,0,0,0,266,263,1,0, + 0,0,266,264,1,0,0,0,266,265,1,0,0,0,267,11,1,0,0,0,268,270,5,2,0, + 0,269,268,1,0,0,0,269,270,1,0,0,0,270,271,1,0,0,0,271,272,3,60,30, + 0,272,13,1,0,0,0,273,274,5,3,0,0,274,275,3,62,31,0,275,15,1,0,0, + 0,276,277,5,4,0,0,277,278,5,33,0,0,278,17,1,0,0,0,279,280,5,6,0, + 0,280,281,3,90,45,0,281,19,1,0,0,0,282,284,5,7,0,0,283,285,7,0,0, + 0,284,283,1,0,0,0,284,285,1,0,0,0,285,286,1,0,0,0,286,287,3,112, + 56,0,287,21,1,0,0,0,288,289,5,8,0,0,289,294,3,64,32,0,290,291,5, + 110,0,0,291,293,3,64,32,0,292,290,1,0,0,0,293,296,1,0,0,0,294,292, + 1,0,0,0,294,295,1,0,0,0,295,23,1,0,0,0,296,294,1,0,0,0,297,301,5, + 9,0,0,298,299,5,42,0,0,299,300,5,112,0,0,300,302,3,194,97,0,301, + 298,1,0,0,0,301,302,1,0,0,0,302,306,1,0,0,0,303,304,5,43,0,0,304, + 305,5,112,0,0,305,307,3,198,99,0,306,303,1,0,0,0,306,307,1,0,0,0, + 307,311,1,0,0,0,308,309,5,44,0,0,309,310,5,112,0,0,310,312,3,192, + 96,0,311,308,1,0,0,0,311,312,1,0,0,0,312,313,1,0,0,0,313,318,3,78, + 39,0,314,315,5,110,0,0,315,317,3,78,39,0,316,314,1,0,0,0,317,320, + 1,0,0,0,318,316,1,0,0,0,318,319,1,0,0,0,319,322,1,0,0,0,320,318, + 1,0,0,0,321,323,3,68,34,0,322,321,1,0,0,0,322,323,1,0,0,0,323,327, + 1,0,0,0,324,325,5,41,0,0,325,326,5,112,0,0,326,328,3,198,99,0,327, + 324,1,0,0,0,327,328,1,0,0,0,328,25,1,0,0,0,329,331,5,10,0,0,330, + 332,3,194,97,0,331,330,1,0,0,0,331,332,1,0,0,0,332,333,1,0,0,0,333, + 337,3,112,56,0,334,335,5,39,0,0,335,336,5,112,0,0,336,338,3,198, + 99,0,337,334,1,0,0,0,337,338,1,0,0,0,338,342,1,0,0,0,339,340,5,40, + 0,0,340,341,5,112,0,0,341,343,3,198,99,0,342,339,1,0,0,0,342,343, + 1,0,0,0,343,27,1,0,0,0,344,345,5,11,0,0,345,346,3,74,37,0,346,29, + 1,0,0,0,347,348,5,12,0,0,348,353,3,76,38,0,349,350,5,110,0,0,350, + 352,3,76,38,0,351,349,1,0,0,0,352,355,1,0,0,0,353,351,1,0,0,0,353, + 354,1,0,0,0,354,31,1,0,0,0,355,353,1,0,0,0,356,358,5,13,0,0,357, + 359,3,194,97,0,358,357,1,0,0,0,358,359,1,0,0,0,359,362,1,0,0,0,360, + 361,5,5,0,0,361,363,3,194,97,0,362,360,1,0,0,0,362,363,1,0,0,0,363, + 33,1,0,0,0,364,366,5,14,0,0,365,367,3,194,97,0,366,365,1,0,0,0,366, + 367,1,0,0,0,367,368,1,0,0,0,368,370,3,112,56,0,369,371,3,66,33,0, + 370,369,1,0,0,0,370,371,1,0,0,0,371,35,1,0,0,0,372,373,5,15,0,0, + 373,375,3,112,56,0,374,376,3,66,33,0,375,374,1,0,0,0,375,376,1,0, + 0,0,376,37,1,0,0,0,377,378,5,20,0,0,378,379,3,88,44,0,379,380,3, + 192,96,0,380,39,1,0,0,0,381,382,5,16,0,0,382,383,3,88,44,0,383,384, + 3,192,96,0,384,41,1,0,0,0,385,389,5,22,0,0,386,388,3,44,22,0,387, + 386,1,0,0,0,388,391,1,0,0,0,389,387,1,0,0,0,389,390,1,0,0,0,390, + 392,1,0,0,0,391,389,1,0,0,0,392,393,3,88,44,0,393,43,1,0,0,0,394, + 395,5,23,0,0,395,396,5,112,0,0,396,401,3,192,96,0,397,398,5,21,0, + 0,398,399,5,112,0,0,399,401,3,192,96,0,400,394,1,0,0,0,400,397,1, + 0,0,0,401,45,1,0,0,0,402,403,7,1,0,0,403,47,1,0,0,0,404,408,5,24, + 0,0,405,407,3,50,25,0,406,405,1,0,0,0,407,410,1,0,0,0,408,406,1, + 0,0,0,408,409,1,0,0,0,409,49,1,0,0,0,410,408,1,0,0,0,411,412,5,45, + 0,0,412,413,5,112,0,0,413,421,3,194,97,0,414,415,5,46,0,0,415,416, + 5,112,0,0,416,421,3,194,97,0,417,418,5,47,0,0,418,419,5,112,0,0, + 419,421,3,192,96,0,420,411,1,0,0,0,420,414,1,0,0,0,420,417,1,0,0, + 0,421,51,1,0,0,0,422,426,5,25,0,0,423,425,3,54,27,0,424,423,1,0, + 0,0,425,428,1,0,0,0,426,424,1,0,0,0,426,427,1,0,0,0,427,53,1,0,0, + 0,428,426,1,0,0,0,429,430,5,48,0,0,430,431,5,112,0,0,431,466,3,194, + 97,0,432,433,5,49,0,0,433,434,5,112,0,0,434,466,3,194,97,0,435,436, + 5,50,0,0,436,437,5,112,0,0,437,466,3,194,97,0,438,439,5,51,0,0,439, + 440,5,112,0,0,440,466,3,194,97,0,441,442,5,52,0,0,442,443,5,112, + 0,0,443,466,3,196,98,0,444,445,5,53,0,0,445,446,5,112,0,0,446,466, + 3,196,98,0,447,448,5,54,0,0,448,449,5,112,0,0,449,466,3,192,96,0, + 450,451,5,55,0,0,451,452,5,112,0,0,452,466,3,192,96,0,453,454,5, + 215,0,0,454,455,5,112,0,0,455,466,3,192,96,0,456,457,5,56,0,0,457, + 458,5,112,0,0,458,466,3,192,96,0,459,460,5,57,0,0,460,461,5,112, + 0,0,461,466,3,194,97,0,462,463,5,58,0,0,463,464,5,112,0,0,464,466, + 3,196,98,0,465,429,1,0,0,0,465,432,1,0,0,0,465,435,1,0,0,0,465,438, + 1,0,0,0,465,441,1,0,0,0,465,444,1,0,0,0,465,447,1,0,0,0,465,450, + 1,0,0,0,465,453,1,0,0,0,465,456,1,0,0,0,465,459,1,0,0,0,465,462, + 1,0,0,0,466,55,1,0,0,0,467,471,5,26,0,0,468,470,3,58,29,0,469,468, + 1,0,0,0,470,473,1,0,0,0,471,469,1,0,0,0,471,472,1,0,0,0,472,57,1, + 0,0,0,473,471,1,0,0,0,474,475,3,220,110,0,475,476,5,112,0,0,476, + 477,3,188,94,0,477,59,1,0,0,0,478,479,5,29,0,0,479,480,5,112,0,0, + 480,485,3,62,31,0,481,482,5,30,0,0,482,483,5,112,0,0,483,485,3,62, + 31,0,484,478,1,0,0,0,484,481,1,0,0,0,485,61,1,0,0,0,486,487,3,108, + 54,0,487,63,1,0,0,0,488,489,3,122,61,0,489,490,5,27,0,0,490,491, + 3,122,61,0,491,65,1,0,0,0,492,493,5,28,0,0,493,494,3,112,56,0,494, + 67,1,0,0,0,495,496,5,28,0,0,496,505,3,112,56,0,497,498,5,28,0,0, + 498,505,3,70,35,0,499,500,5,28,0,0,500,501,3,70,35,0,501,502,5,110, + 0,0,502,503,3,112,56,0,503,505,1,0,0,0,504,495,1,0,0,0,504,497,1, + 0,0,0,504,499,1,0,0,0,505,69,1,0,0,0,506,509,3,72,36,0,507,508,5, + 27,0,0,508,510,3,214,107,0,509,507,1,0,0,0,509,510,1,0,0,0,510,71, + 1,0,0,0,511,512,5,320,0,0,512,513,5,125,0,0,513,514,3,120,60,0,514, + 515,5,110,0,0,515,517,3,188,94,0,516,518,3,210,105,0,517,516,1,0, + 0,0,517,518,1,0,0,0,518,519,1,0,0,0,519,520,5,126,0,0,520,73,1,0, + 0,0,521,526,3,116,58,0,522,523,5,110,0,0,523,525,3,116,58,0,524, + 522,1,0,0,0,525,528,1,0,0,0,526,524,1,0,0,0,526,527,1,0,0,0,527, + 75,1,0,0,0,528,526,1,0,0,0,529,530,3,120,60,0,530,531,5,112,0,0, + 531,532,3,88,44,0,532,77,1,0,0,0,533,536,3,80,40,0,534,535,5,27, + 0,0,535,537,3,122,61,0,536,534,1,0,0,0,536,537,1,0,0,0,537,79,1, + 0,0,0,538,539,3,82,41,0,539,540,5,125,0,0,540,541,3,94,47,0,541, + 542,5,126,0,0,542,554,1,0,0,0,543,544,5,136,0,0,544,545,5,125,0, + 0,545,554,5,126,0,0,546,547,7,2,0,0,547,548,5,125,0,0,548,549,3, + 94,47,0,549,550,5,126,0,0,550,554,1,0,0,0,551,554,3,86,43,0,552, + 554,3,84,42,0,553,538,1,0,0,0,553,543,1,0,0,0,553,546,1,0,0,0,553, + 551,1,0,0,0,553,552,1,0,0,0,554,81,1,0,0,0,555,556,7,3,0,0,556,83, + 1,0,0,0,557,558,5,155,0,0,558,559,5,125,0,0,559,562,3,120,60,0,560, + 561,5,110,0,0,561,563,3,194,97,0,562,560,1,0,0,0,562,563,1,0,0,0, + 563,564,1,0,0,0,564,565,5,126,0,0,565,85,1,0,0,0,566,567,5,154,0, + 0,567,568,5,114,0,0,568,569,3,194,97,0,569,570,5,113,0,0,570,571, + 5,125,0,0,571,572,3,120,60,0,572,573,5,126,0,0,573,87,1,0,0,0,574, + 578,3,90,45,0,575,578,3,92,46,0,576,578,3,94,47,0,577,574,1,0,0, + 0,577,575,1,0,0,0,577,576,1,0,0,0,578,89,1,0,0,0,579,580,6,45,-1, + 0,580,586,3,92,46,0,581,582,5,61,0,0,582,586,3,90,45,6,583,586,3, + 100,50,0,584,586,3,102,51,0,585,579,1,0,0,0,585,581,1,0,0,0,585, + 583,1,0,0,0,585,584,1,0,0,0,586,600,1,0,0,0,587,588,10,5,0,0,588, + 589,5,62,0,0,589,599,3,90,45,6,590,592,10,4,0,0,591,593,5,63,0,0, + 592,591,1,0,0,0,592,593,1,0,0,0,593,594,1,0,0,0,594,599,3,90,45, + 5,595,596,10,3,0,0,596,597,5,64,0,0,597,599,3,90,45,4,598,587,1, + 0,0,0,598,590,1,0,0,0,598,595,1,0,0,0,599,602,1,0,0,0,600,598,1, + 0,0,0,600,601,1,0,0,0,601,91,1,0,0,0,602,600,1,0,0,0,603,604,3,94, + 47,0,604,605,3,182,91,0,605,606,3,94,47,0,606,612,1,0,0,0,607,608, + 3,94,47,0,608,609,5,60,0,0,609,610,3,212,106,0,610,612,1,0,0,0,611, + 603,1,0,0,0,611,607,1,0,0,0,612,93,1,0,0,0,613,623,3,96,48,0,614, + 623,3,98,49,0,615,623,3,162,81,0,616,623,3,158,79,0,617,623,3,170, + 85,0,618,619,5,125,0,0,619,620,3,94,47,0,620,621,5,126,0,0,621,623, + 1,0,0,0,622,613,1,0,0,0,622,614,1,0,0,0,622,615,1,0,0,0,622,616, + 1,0,0,0,622,617,1,0,0,0,622,618,1,0,0,0,623,95,1,0,0,0,624,629,3, + 124,62,0,625,629,3,126,63,0,626,629,3,120,60,0,627,629,3,188,94, + 0,628,624,1,0,0,0,628,625,1,0,0,0,628,626,1,0,0,0,628,627,1,0,0, + 0,629,97,1,0,0,0,630,631,3,180,90,0,631,632,5,125,0,0,632,633,3, + 136,68,0,633,634,5,60,0,0,634,635,3,136,68,0,635,636,5,126,0,0,636, + 99,1,0,0,0,637,638,3,128,64,0,638,101,1,0,0,0,639,642,3,104,52,0, + 640,642,3,106,53,0,641,639,1,0,0,0,641,640,1,0,0,0,642,103,1,0,0, + 0,643,644,3,184,92,0,644,645,5,125,0,0,645,646,3,146,73,0,646,647, + 5,110,0,0,647,652,3,148,74,0,648,649,5,110,0,0,649,651,3,138,69, + 0,650,648,1,0,0,0,651,654,1,0,0,0,652,650,1,0,0,0,652,653,1,0,0, + 0,653,655,1,0,0,0,654,652,1,0,0,0,655,656,5,126,0,0,656,105,1,0, + 0,0,657,658,3,186,93,0,658,659,5,125,0,0,659,660,5,127,0,0,660,665, + 3,142,71,0,661,662,5,110,0,0,662,664,3,142,71,0,663,661,1,0,0,0, + 664,667,1,0,0,0,665,663,1,0,0,0,665,666,1,0,0,0,666,668,1,0,0,0, + 667,665,1,0,0,0,668,669,5,128,0,0,669,670,5,110,0,0,670,675,3,148, + 74,0,671,672,5,110,0,0,672,674,3,138,69,0,673,671,1,0,0,0,674,677, + 1,0,0,0,675,673,1,0,0,0,675,676,1,0,0,0,676,678,1,0,0,0,677,675, + 1,0,0,0,678,679,5,126,0,0,679,107,1,0,0,0,680,683,3,216,108,0,681, + 683,5,332,0,0,682,680,1,0,0,0,682,681,1,0,0,0,683,109,1,0,0,0,684, + 685,3,214,107,0,685,686,5,125,0,0,686,687,3,134,67,0,687,688,5,126, + 0,0,688,111,1,0,0,0,689,694,3,120,60,0,690,691,5,110,0,0,691,693, + 3,120,60,0,692,690,1,0,0,0,693,696,1,0,0,0,694,692,1,0,0,0,694,695, + 1,0,0,0,695,113,1,0,0,0,696,694,1,0,0,0,697,702,3,122,61,0,698,699, + 5,110,0,0,699,701,3,122,61,0,700,698,1,0,0,0,701,704,1,0,0,0,702, + 700,1,0,0,0,702,703,1,0,0,0,703,115,1,0,0,0,704,702,1,0,0,0,705, + 707,7,0,0,0,706,705,1,0,0,0,706,707,1,0,0,0,707,708,1,0,0,0,708, + 709,3,118,59,0,709,117,1,0,0,0,710,732,3,120,60,0,711,712,5,35,0, + 0,712,713,5,125,0,0,713,714,3,120,60,0,714,715,5,126,0,0,715,732, + 1,0,0,0,716,717,5,36,0,0,717,718,5,125,0,0,718,719,3,120,60,0,719, + 720,5,126,0,0,720,732,1,0,0,0,721,722,5,37,0,0,722,723,5,125,0,0, + 723,724,3,120,60,0,724,725,5,126,0,0,725,732,1,0,0,0,726,727,5,38, + 0,0,727,728,5,125,0,0,728,729,3,120,60,0,729,730,5,126,0,0,730,732, + 1,0,0,0,731,710,1,0,0,0,731,711,1,0,0,0,731,716,1,0,0,0,731,721, + 1,0,0,0,731,726,1,0,0,0,732,119,1,0,0,0,733,734,3,214,107,0,734, + 121,1,0,0,0,735,736,3,218,109,0,736,123,1,0,0,0,737,738,3,132,66, + 0,738,739,5,125,0,0,739,740,3,134,67,0,740,741,5,126,0,0,741,125, + 1,0,0,0,742,743,5,274,0,0,743,744,5,125,0,0,744,745,3,88,44,0,745, + 746,5,27,0,0,746,747,3,130,65,0,747,748,5,126,0,0,748,127,1,0,0, + 0,749,750,3,174,87,0,750,751,5,125,0,0,751,752,3,134,67,0,752,753, + 5,126,0,0,753,129,1,0,0,0,754,765,5,212,0,0,755,765,5,241,0,0,756, + 765,5,243,0,0,757,765,5,102,0,0,758,765,5,103,0,0,759,765,5,104, + 0,0,760,765,5,105,0,0,761,765,5,106,0,0,762,765,5,107,0,0,763,765, + 5,108,0,0,764,754,1,0,0,0,764,755,1,0,0,0,764,756,1,0,0,0,764,757, + 1,0,0,0,764,758,1,0,0,0,764,759,1,0,0,0,764,760,1,0,0,0,764,761, + 1,0,0,0,764,762,1,0,0,0,764,763,1,0,0,0,765,131,1,0,0,0,766,773, + 3,152,76,0,767,773,3,156,78,0,768,773,3,178,89,0,769,773,3,174,87, + 0,770,773,3,176,88,0,771,773,3,180,90,0,772,766,1,0,0,0,772,767, + 1,0,0,0,772,768,1,0,0,0,772,769,1,0,0,0,772,770,1,0,0,0,772,771, + 1,0,0,0,773,133,1,0,0,0,774,779,3,136,68,0,775,776,5,110,0,0,776, + 778,3,136,68,0,777,775,1,0,0,0,778,781,1,0,0,0,779,777,1,0,0,0,779, + 780,1,0,0,0,780,783,1,0,0,0,781,779,1,0,0,0,782,774,1,0,0,0,782, + 783,1,0,0,0,783,135,1,0,0,0,784,785,3,220,110,0,785,786,5,112,0, + 0,786,788,1,0,0,0,787,784,1,0,0,0,787,788,1,0,0,0,788,789,1,0,0, + 0,789,790,3,94,47,0,790,137,1,0,0,0,791,792,3,140,70,0,792,793,5, + 112,0,0,793,794,3,150,75,0,794,139,1,0,0,0,795,796,7,4,0,0,796,141, + 1,0,0,0,797,806,3,146,73,0,798,799,3,146,73,0,799,800,3,144,72,0, + 800,806,1,0,0,0,801,802,3,146,73,0,802,803,5,134,0,0,803,804,3,144, + 72,0,804,806,1,0,0,0,805,797,1,0,0,0,805,798,1,0,0,0,805,801,1,0, + 0,0,806,143,1,0,0,0,807,810,3,194,97,0,808,810,3,196,98,0,809,807, + 1,0,0,0,809,808,1,0,0,0,810,145,1,0,0,0,811,814,3,214,107,0,812, + 814,3,192,96,0,813,811,1,0,0,0,813,812,1,0,0,0,814,147,1,0,0,0,815, + 816,3,150,75,0,816,149,1,0,0,0,817,820,3,214,107,0,818,820,3,188, + 94,0,819,817,1,0,0,0,819,818,1,0,0,0,820,151,1,0,0,0,821,845,5,172, + 0,0,822,845,5,173,0,0,823,845,5,174,0,0,824,845,5,175,0,0,825,845, + 5,176,0,0,826,845,5,177,0,0,827,845,5,178,0,0,828,845,5,179,0,0, + 829,845,5,180,0,0,830,845,5,181,0,0,831,845,5,182,0,0,832,845,5, + 183,0,0,833,845,5,184,0,0,834,845,5,185,0,0,835,845,5,186,0,0,836, + 845,5,188,0,0,837,845,5,189,0,0,838,845,5,190,0,0,839,845,5,191, + 0,0,840,845,5,192,0,0,841,845,5,193,0,0,842,845,5,194,0,0,843,845, + 3,154,77,0,844,821,1,0,0,0,844,822,1,0,0,0,844,823,1,0,0,0,844,824, + 1,0,0,0,844,825,1,0,0,0,844,826,1,0,0,0,844,827,1,0,0,0,844,828, + 1,0,0,0,844,829,1,0,0,0,844,830,1,0,0,0,844,831,1,0,0,0,844,832, + 1,0,0,0,844,833,1,0,0,0,844,834,1,0,0,0,844,835,1,0,0,0,844,836, + 1,0,0,0,844,837,1,0,0,0,844,838,1,0,0,0,844,839,1,0,0,0,844,840, + 1,0,0,0,844,841,1,0,0,0,844,842,1,0,0,0,844,843,1,0,0,0,845,153, + 1,0,0,0,846,847,7,5,0,0,847,155,1,0,0,0,848,849,7,6,0,0,849,157, + 1,0,0,0,850,851,5,226,0,0,851,852,5,125,0,0,852,853,3,160,80,0,853, + 854,5,110,0,0,854,855,3,136,68,0,855,856,5,126,0,0,856,159,1,0,0, + 0,857,858,7,7,0,0,858,161,1,0,0,0,859,860,5,223,0,0,860,861,5,125, + 0,0,861,862,3,168,84,0,862,863,5,5,0,0,863,864,3,136,68,0,864,865, + 5,126,0,0,865,163,1,0,0,0,866,867,7,8,0,0,867,165,1,0,0,0,868,869, + 7,9,0,0,869,167,1,0,0,0,870,873,3,164,82,0,871,873,3,166,83,0,872, + 870,1,0,0,0,872,871,1,0,0,0,873,169,1,0,0,0,874,875,3,172,86,0,875, + 876,5,125,0,0,876,877,3,164,82,0,877,878,5,110,0,0,878,879,3,136, + 68,0,879,880,5,110,0,0,880,881,3,136,68,0,881,882,5,126,0,0,882, + 171,1,0,0,0,883,884,7,10,0,0,884,173,1,0,0,0,885,886,7,11,0,0,886, + 175,1,0,0,0,887,888,5,281,0,0,888,177,1,0,0,0,889,890,7,12,0,0,890, + 179,1,0,0,0,891,892,5,187,0,0,892,181,1,0,0,0,893,894,7,13,0,0,894, + 183,1,0,0,0,895,896,7,14,0,0,896,185,1,0,0,0,897,898,7,15,0,0,898, + 187,1,0,0,0,899,906,3,190,95,0,900,906,3,192,96,0,901,906,3,194, + 97,0,902,906,3,196,98,0,903,906,3,198,99,0,904,906,3,200,100,0,905, + 899,1,0,0,0,905,900,1,0,0,0,905,901,1,0,0,0,905,902,1,0,0,0,905, + 903,1,0,0,0,905,904,1,0,0,0,906,189,1,0,0,0,907,908,5,81,0,0,908, + 909,3,94,47,0,909,910,3,208,104,0,910,191,1,0,0,0,911,912,7,16,0, + 0,912,193,1,0,0,0,913,915,7,0,0,0,914,913,1,0,0,0,914,915,1,0,0, + 0,915,916,1,0,0,0,916,917,5,330,0,0,917,195,1,0,0,0,918,920,7,0, + 0,0,919,918,1,0,0,0,919,920,1,0,0,0,920,921,1,0,0,0,921,922,5,331, + 0,0,922,197,1,0,0,0,923,924,7,17,0,0,924,199,1,0,0,0,925,929,3,202, + 101,0,926,929,3,204,102,0,927,929,3,206,103,0,928,925,1,0,0,0,928, + 926,1,0,0,0,928,927,1,0,0,0,929,201,1,0,0,0,930,931,5,212,0,0,931, + 932,3,192,96,0,932,203,1,0,0,0,933,934,5,241,0,0,934,935,3,192,96, + 0,935,205,1,0,0,0,936,937,5,243,0,0,937,938,3,192,96,0,938,207,1, + 0,0,0,939,940,7,18,0,0,940,209,1,0,0,0,941,942,7,19,0,0,942,211, + 1,0,0,0,943,944,5,125,0,0,944,949,3,188,94,0,945,946,5,110,0,0,946, 948,3,188,94,0,947,945,1,0,0,0,948,951,1,0,0,0,949,947,1,0,0,0,949, 950,1,0,0,0,950,952,1,0,0,0,951,949,1,0,0,0,952,953,5,126,0,0,953, - 213,1,0,0,0,954,955,5,328,0,0,955,215,1,0,0,0,956,957,5,328,0,0, - 957,217,1,0,0,0,958,963,3,224,112,0,959,960,5,111,0,0,960,962,3, - 224,112,0,961,959,1,0,0,0,962,965,1,0,0,0,963,961,1,0,0,0,963,964, - 1,0,0,0,964,219,1,0,0,0,965,963,1,0,0,0,966,968,5,111,0,0,967,966, - 1,0,0,0,967,968,1,0,0,0,968,969,1,0,0,0,969,977,5,328,0,0,970,971, - 5,131,0,0,971,972,3,220,110,0,972,973,5,131,0,0,973,977,1,0,0,0, - 974,977,5,335,0,0,975,977,3,226,113,0,976,967,1,0,0,0,976,970,1, - 0,0,0,976,974,1,0,0,0,976,975,1,0,0,0,977,221,1,0,0,0,978,980,5, - 329,0,0,979,978,1,0,0,0,979,980,1,0,0,0,980,981,1,0,0,0,981,982, - 3,220,110,0,982,223,1,0,0,0,983,988,3,220,110,0,984,985,5,122,0, - 0,985,987,3,220,110,0,986,984,1,0,0,0,987,990,1,0,0,0,988,986,1, - 0,0,0,988,989,1,0,0,0,989,992,1,0,0,0,990,988,1,0,0,0,991,993,5, - 122,0,0,992,991,1,0,0,0,992,993,1,0,0,0,993,1007,1,0,0,0,994,995, - 5,129,0,0,995,996,3,224,112,0,996,997,5,129,0,0,997,1007,1,0,0,0, - 998,999,5,130,0,0,999,1000,3,224,112,0,1000,1001,5,130,0,0,1001, - 1007,1,0,0,0,1002,1003,5,131,0,0,1003,1004,3,224,112,0,1004,1005, - 5,131,0,0,1005,1007,1,0,0,0,1006,983,1,0,0,0,1006,994,1,0,0,0,1006, - 998,1,0,0,0,1006,1002,1,0,0,0,1007,225,1,0,0,0,1008,1109,5,31,0, - 0,1009,1109,3,210,105,0,1010,1109,5,320,0,0,1011,1109,3,132,66,0, - 1012,1109,3,140,70,0,1013,1109,3,208,104,0,1014,1109,3,156,78,0, - 1015,1109,3,178,89,0,1016,1109,3,152,76,0,1017,1109,3,180,90,0,1018, - 1109,5,2,0,0,1019,1109,5,3,0,0,1020,1109,5,4,0,0,1021,1109,5,5,0, - 0,1022,1109,5,6,0,0,1023,1109,5,7,0,0,1024,1109,5,8,0,0,1025,1109, - 5,9,0,0,1026,1109,5,10,0,0,1027,1109,5,11,0,0,1028,1109,5,12,0,0, - 1029,1109,5,13,0,0,1030,1109,5,14,0,0,1031,1109,5,15,0,0,1032,1109, - 5,16,0,0,1033,1109,5,17,0,0,1034,1109,5,18,0,0,1035,1109,5,19,0, - 0,1036,1109,5,20,0,0,1037,1109,5,21,0,0,1038,1109,5,22,0,0,1039, - 1109,5,23,0,0,1040,1109,5,24,0,0,1041,1109,5,25,0,0,1042,1109,5, - 26,0,0,1043,1109,5,29,0,0,1044,1109,5,30,0,0,1045,1109,5,32,0,0, - 1046,1109,5,33,0,0,1047,1109,5,34,0,0,1048,1109,5,36,0,0,1049,1109, - 5,37,0,0,1050,1109,5,38,0,0,1051,1109,5,39,0,0,1052,1109,5,40,0, - 0,1053,1109,5,41,0,0,1054,1109,5,42,0,0,1055,1109,5,43,0,0,1056, - 1109,5,44,0,0,1057,1109,5,45,0,0,1058,1109,5,46,0,0,1059,1109,5, - 47,0,0,1060,1109,5,48,0,0,1061,1109,5,49,0,0,1062,1109,5,50,0,0, - 1063,1109,5,51,0,0,1064,1109,5,52,0,0,1065,1109,5,53,0,0,1066,1109, - 5,54,0,0,1067,1109,5,55,0,0,1068,1109,5,56,0,0,1069,1109,5,57,0, - 0,1070,1109,5,58,0,0,1071,1109,5,135,0,0,1072,1109,5,136,0,0,1073, - 1109,5,137,0,0,1074,1109,5,138,0,0,1075,1109,5,139,0,0,1076,1109, - 5,140,0,0,1077,1109,5,141,0,0,1078,1109,5,142,0,0,1079,1109,5,143, - 0,0,1080,1109,5,144,0,0,1081,1109,5,145,0,0,1082,1109,5,146,0,0, - 1083,1109,5,147,0,0,1084,1109,5,148,0,0,1085,1109,5,149,0,0,1086, - 1109,5,150,0,0,1087,1109,5,151,0,0,1088,1109,5,152,0,0,1089,1109, - 5,153,0,0,1090,1109,5,154,0,0,1091,1109,5,155,0,0,1092,1109,5,156, - 0,0,1093,1109,5,157,0,0,1094,1109,5,158,0,0,1095,1109,5,159,0,0, - 1096,1109,5,160,0,0,1097,1109,5,161,0,0,1098,1109,5,162,0,0,1099, - 1109,5,163,0,0,1100,1109,5,164,0,0,1101,1109,5,165,0,0,1102,1109, - 5,166,0,0,1103,1109,5,167,0,0,1104,1109,5,168,0,0,1105,1109,5,169, - 0,0,1106,1109,5,170,0,0,1107,1109,5,171,0,0,1108,1008,1,0,0,0,1108, - 1009,1,0,0,0,1108,1010,1,0,0,0,1108,1011,1,0,0,0,1108,1012,1,0,0, - 0,1108,1013,1,0,0,0,1108,1014,1,0,0,0,1108,1015,1,0,0,0,1108,1016, - 1,0,0,0,1108,1017,1,0,0,0,1108,1018,1,0,0,0,1108,1019,1,0,0,0,1108, - 1020,1,0,0,0,1108,1021,1,0,0,0,1108,1022,1,0,0,0,1108,1023,1,0,0, - 0,1108,1024,1,0,0,0,1108,1025,1,0,0,0,1108,1026,1,0,0,0,1108,1027, - 1,0,0,0,1108,1028,1,0,0,0,1108,1029,1,0,0,0,1108,1030,1,0,0,0,1108, - 1031,1,0,0,0,1108,1032,1,0,0,0,1108,1033,1,0,0,0,1108,1034,1,0,0, - 0,1108,1035,1,0,0,0,1108,1036,1,0,0,0,1108,1037,1,0,0,0,1108,1038, - 1,0,0,0,1108,1039,1,0,0,0,1108,1040,1,0,0,0,1108,1041,1,0,0,0,1108, - 1042,1,0,0,0,1108,1043,1,0,0,0,1108,1044,1,0,0,0,1108,1045,1,0,0, - 0,1108,1046,1,0,0,0,1108,1047,1,0,0,0,1108,1048,1,0,0,0,1108,1049, - 1,0,0,0,1108,1050,1,0,0,0,1108,1051,1,0,0,0,1108,1052,1,0,0,0,1108, - 1053,1,0,0,0,1108,1054,1,0,0,0,1108,1055,1,0,0,0,1108,1056,1,0,0, - 0,1108,1057,1,0,0,0,1108,1058,1,0,0,0,1108,1059,1,0,0,0,1108,1060, - 1,0,0,0,1108,1061,1,0,0,0,1108,1062,1,0,0,0,1108,1063,1,0,0,0,1108, - 1064,1,0,0,0,1108,1065,1,0,0,0,1108,1066,1,0,0,0,1108,1067,1,0,0, - 0,1108,1068,1,0,0,0,1108,1069,1,0,0,0,1108,1070,1,0,0,0,1108,1071, - 1,0,0,0,1108,1072,1,0,0,0,1108,1073,1,0,0,0,1108,1074,1,0,0,0,1108, - 1075,1,0,0,0,1108,1076,1,0,0,0,1108,1077,1,0,0,0,1108,1078,1,0,0, - 0,1108,1079,1,0,0,0,1108,1080,1,0,0,0,1108,1081,1,0,0,0,1108,1082, - 1,0,0,0,1108,1083,1,0,0,0,1108,1084,1,0,0,0,1108,1085,1,0,0,0,1108, - 1086,1,0,0,0,1108,1087,1,0,0,0,1108,1088,1,0,0,0,1108,1089,1,0,0, - 0,1108,1090,1,0,0,0,1108,1091,1,0,0,0,1108,1092,1,0,0,0,1108,1093, - 1,0,0,0,1108,1094,1,0,0,0,1108,1095,1,0,0,0,1108,1096,1,0,0,0,1108, - 1097,1,0,0,0,1108,1098,1,0,0,0,1108,1099,1,0,0,0,1108,1100,1,0,0, - 0,1108,1101,1,0,0,0,1108,1102,1,0,0,0,1108,1103,1,0,0,0,1108,1104, - 1,0,0,0,1108,1105,1,0,0,0,1108,1106,1,0,0,0,1108,1107,1,0,0,0,1109, - 227,1,0,0,0,78,229,242,248,266,269,284,294,301,306,311,318,322,327, + 213,1,0,0,0,954,955,5,328,0,0,955,215,1,0,0,0,956,961,3,222,111, + 0,957,958,5,111,0,0,958,960,3,220,110,0,959,957,1,0,0,0,960,963, + 1,0,0,0,961,959,1,0,0,0,961,962,1,0,0,0,962,217,1,0,0,0,963,961, + 1,0,0,0,964,969,3,224,112,0,965,966,5,111,0,0,966,968,3,224,112, + 0,967,965,1,0,0,0,968,971,1,0,0,0,969,967,1,0,0,0,969,970,1,0,0, + 0,970,219,1,0,0,0,971,969,1,0,0,0,972,974,5,111,0,0,973,972,1,0, + 0,0,973,974,1,0,0,0,974,975,1,0,0,0,975,983,5,328,0,0,976,977,5, + 131,0,0,977,978,3,220,110,0,978,979,5,131,0,0,979,983,1,0,0,0,980, + 983,5,335,0,0,981,983,3,226,113,0,982,973,1,0,0,0,982,976,1,0,0, + 0,982,980,1,0,0,0,982,981,1,0,0,0,983,221,1,0,0,0,984,986,5,329, + 0,0,985,984,1,0,0,0,985,986,1,0,0,0,986,987,1,0,0,0,987,988,3,220, + 110,0,988,223,1,0,0,0,989,994,3,220,110,0,990,991,5,122,0,0,991, + 993,3,220,110,0,992,990,1,0,0,0,993,996,1,0,0,0,994,992,1,0,0,0, + 994,995,1,0,0,0,995,998,1,0,0,0,996,994,1,0,0,0,997,999,5,122,0, + 0,998,997,1,0,0,0,998,999,1,0,0,0,999,1013,1,0,0,0,1000,1001,5,129, + 0,0,1001,1002,3,224,112,0,1002,1003,5,129,0,0,1003,1013,1,0,0,0, + 1004,1005,5,130,0,0,1005,1006,3,224,112,0,1006,1007,5,130,0,0,1007, + 1013,1,0,0,0,1008,1009,5,131,0,0,1009,1010,3,224,112,0,1010,1011, + 5,131,0,0,1011,1013,1,0,0,0,1012,989,1,0,0,0,1012,1000,1,0,0,0,1012, + 1004,1,0,0,0,1012,1008,1,0,0,0,1013,225,1,0,0,0,1014,1115,5,31,0, + 0,1015,1115,3,210,105,0,1016,1115,5,320,0,0,1017,1115,3,132,66,0, + 1018,1115,3,140,70,0,1019,1115,3,208,104,0,1020,1115,3,156,78,0, + 1021,1115,3,178,89,0,1022,1115,3,152,76,0,1023,1115,3,180,90,0,1024, + 1115,5,2,0,0,1025,1115,5,3,0,0,1026,1115,5,4,0,0,1027,1115,5,5,0, + 0,1028,1115,5,6,0,0,1029,1115,5,7,0,0,1030,1115,5,8,0,0,1031,1115, + 5,9,0,0,1032,1115,5,10,0,0,1033,1115,5,11,0,0,1034,1115,5,12,0,0, + 1035,1115,5,13,0,0,1036,1115,5,14,0,0,1037,1115,5,15,0,0,1038,1115, + 5,16,0,0,1039,1115,5,17,0,0,1040,1115,5,18,0,0,1041,1115,5,19,0, + 0,1042,1115,5,20,0,0,1043,1115,5,21,0,0,1044,1115,5,22,0,0,1045, + 1115,5,23,0,0,1046,1115,5,24,0,0,1047,1115,5,25,0,0,1048,1115,5, + 26,0,0,1049,1115,5,29,0,0,1050,1115,5,30,0,0,1051,1115,5,32,0,0, + 1052,1115,5,33,0,0,1053,1115,5,34,0,0,1054,1115,5,36,0,0,1055,1115, + 5,37,0,0,1056,1115,5,38,0,0,1057,1115,5,39,0,0,1058,1115,5,40,0, + 0,1059,1115,5,41,0,0,1060,1115,5,42,0,0,1061,1115,5,43,0,0,1062, + 1115,5,44,0,0,1063,1115,5,45,0,0,1064,1115,5,46,0,0,1065,1115,5, + 47,0,0,1066,1115,5,48,0,0,1067,1115,5,49,0,0,1068,1115,5,50,0,0, + 1069,1115,5,51,0,0,1070,1115,5,52,0,0,1071,1115,5,53,0,0,1072,1115, + 5,54,0,0,1073,1115,5,55,0,0,1074,1115,5,56,0,0,1075,1115,5,57,0, + 0,1076,1115,5,58,0,0,1077,1115,5,135,0,0,1078,1115,5,136,0,0,1079, + 1115,5,137,0,0,1080,1115,5,138,0,0,1081,1115,5,139,0,0,1082,1115, + 5,140,0,0,1083,1115,5,141,0,0,1084,1115,5,142,0,0,1085,1115,5,143, + 0,0,1086,1115,5,144,0,0,1087,1115,5,145,0,0,1088,1115,5,146,0,0, + 1089,1115,5,147,0,0,1090,1115,5,148,0,0,1091,1115,5,149,0,0,1092, + 1115,5,150,0,0,1093,1115,5,151,0,0,1094,1115,5,152,0,0,1095,1115, + 5,153,0,0,1096,1115,5,154,0,0,1097,1115,5,155,0,0,1098,1115,5,156, + 0,0,1099,1115,5,157,0,0,1100,1115,5,158,0,0,1101,1115,5,159,0,0, + 1102,1115,5,160,0,0,1103,1115,5,161,0,0,1104,1115,5,162,0,0,1105, + 1115,5,163,0,0,1106,1115,5,164,0,0,1107,1115,5,165,0,0,1108,1115, + 5,166,0,0,1109,1115,5,167,0,0,1110,1115,5,168,0,0,1111,1115,5,169, + 0,0,1112,1115,5,170,0,0,1113,1115,5,171,0,0,1114,1014,1,0,0,0,1114, + 1015,1,0,0,0,1114,1016,1,0,0,0,1114,1017,1,0,0,0,1114,1018,1,0,0, + 0,1114,1019,1,0,0,0,1114,1020,1,0,0,0,1114,1021,1,0,0,0,1114,1022, + 1,0,0,0,1114,1023,1,0,0,0,1114,1024,1,0,0,0,1114,1025,1,0,0,0,1114, + 1026,1,0,0,0,1114,1027,1,0,0,0,1114,1028,1,0,0,0,1114,1029,1,0,0, + 0,1114,1030,1,0,0,0,1114,1031,1,0,0,0,1114,1032,1,0,0,0,1114,1033, + 1,0,0,0,1114,1034,1,0,0,0,1114,1035,1,0,0,0,1114,1036,1,0,0,0,1114, + 1037,1,0,0,0,1114,1038,1,0,0,0,1114,1039,1,0,0,0,1114,1040,1,0,0, + 0,1114,1041,1,0,0,0,1114,1042,1,0,0,0,1114,1043,1,0,0,0,1114,1044, + 1,0,0,0,1114,1045,1,0,0,0,1114,1046,1,0,0,0,1114,1047,1,0,0,0,1114, + 1048,1,0,0,0,1114,1049,1,0,0,0,1114,1050,1,0,0,0,1114,1051,1,0,0, + 0,1114,1052,1,0,0,0,1114,1053,1,0,0,0,1114,1054,1,0,0,0,1114,1055, + 1,0,0,0,1114,1056,1,0,0,0,1114,1057,1,0,0,0,1114,1058,1,0,0,0,1114, + 1059,1,0,0,0,1114,1060,1,0,0,0,1114,1061,1,0,0,0,1114,1062,1,0,0, + 0,1114,1063,1,0,0,0,1114,1064,1,0,0,0,1114,1065,1,0,0,0,1114,1066, + 1,0,0,0,1114,1067,1,0,0,0,1114,1068,1,0,0,0,1114,1069,1,0,0,0,1114, + 1070,1,0,0,0,1114,1071,1,0,0,0,1114,1072,1,0,0,0,1114,1073,1,0,0, + 0,1114,1074,1,0,0,0,1114,1075,1,0,0,0,1114,1076,1,0,0,0,1114,1077, + 1,0,0,0,1114,1078,1,0,0,0,1114,1079,1,0,0,0,1114,1080,1,0,0,0,1114, + 1081,1,0,0,0,1114,1082,1,0,0,0,1114,1083,1,0,0,0,1114,1084,1,0,0, + 0,1114,1085,1,0,0,0,1114,1086,1,0,0,0,1114,1087,1,0,0,0,1114,1088, + 1,0,0,0,1114,1089,1,0,0,0,1114,1090,1,0,0,0,1114,1091,1,0,0,0,1114, + 1092,1,0,0,0,1114,1093,1,0,0,0,1114,1094,1,0,0,0,1114,1095,1,0,0, + 0,1114,1096,1,0,0,0,1114,1097,1,0,0,0,1114,1098,1,0,0,0,1114,1099, + 1,0,0,0,1114,1100,1,0,0,0,1114,1101,1,0,0,0,1114,1102,1,0,0,0,1114, + 1103,1,0,0,0,1114,1104,1,0,0,0,1114,1105,1,0,0,0,1114,1106,1,0,0, + 0,1114,1107,1,0,0,0,1114,1108,1,0,0,0,1114,1109,1,0,0,0,1114,1110, + 1,0,0,0,1114,1111,1,0,0,0,1114,1112,1,0,0,0,1114,1113,1,0,0,0,1115, + 227,1,0,0,0,79,229,242,248,266,269,284,294,301,306,311,318,322,327, 331,337,342,353,358,362,366,370,375,389,400,408,420,426,465,471, 484,504,509,517,526,536,553,562,577,585,592,598,600,611,622,628, 641,652,665,675,682,694,702,706,731,764,772,779,782,787,805,809, - 813,819,844,872,905,914,919,928,949,963,967,976,979,988,992,1006, - 1108 + 813,819,844,872,905,914,919,928,949,961,969,973,982,985,994,998, + 1012,1114 ]; private static __ATN: antlr.ATN; @@ -11374,15 +11662,42 @@ export class TableQualifiedNameContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public ID(): antlr.TerminalNode { - return this.getToken(OpenSearchPPLParser.ID, 0)!; - } public override get ruleIndex(): number { return OpenSearchPPLParser.RULE_tableQualifiedName; } + public override copyFrom(ctx: TableQualifiedNameContext): void { + super.copyFrom(ctx); + } +} +export class IdentsAsTableQualifiedNameContext extends TableQualifiedNameContext { + public constructor(ctx: TableQualifiedNameContext) { + super(ctx.parent, ctx.invokingState); + super.copyFrom(ctx); + } + public tableIdent(): TableIdentContext { + return this.getRuleContext(0, TableIdentContext)!; + } + public DOT(): antlr.TerminalNode[]; + public DOT(i: number): antlr.TerminalNode | null; + public DOT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(OpenSearchPPLParser.DOT); + } else { + return this.getToken(OpenSearchPPLParser.DOT, i); + } + } + public ident(): IdentContext[]; + public ident(i: number): IdentContext | null; + public ident(i?: number): IdentContext[] | IdentContext | null { + if (i === undefined) { + return this.getRuleContexts(IdentContext); + } + + return this.getRuleContext(i, IdentContext); + } public override accept(visitor: OpenSearchPPLParserVisitor): Result | null { - if (visitor.visitTableQualifiedName) { - return visitor.visitTableQualifiedName(this); + if (visitor.visitIdentsAsTableQualifiedName) { + return visitor.visitIdentsAsTableQualifiedName(this); } else { return visitor.visitChildren(this); } diff --git a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParserVisitor.ts b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParserVisitor.ts index 44088c262bd1..31ef0e269056 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParserVisitor.ts +++ b/src/plugins/data/public/antlr/opensearch_ppl/.generated/OpenSearchPPLParserVisitor.ts @@ -1,4 +1,4 @@ -// Generated from grammar/OpenSearchPPLParser.g4 by ANTLR 4.13.1 +// Generated from ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 by ANTLR 4.13.1 import { AbstractParseTreeVisitor } from "antlr4ng"; @@ -127,7 +127,7 @@ import { IntervalUnitContext } from "./OpenSearchPPLParser.js"; import { TimespanUnitContext } from "./OpenSearchPPLParser.js"; import { ValueListContext } from "./OpenSearchPPLParser.js"; import { QualifiedNameContext } from "./OpenSearchPPLParser.js"; -import { TableQualifiedNameContext } from "./OpenSearchPPLParser.js"; +import { IdentsAsTableQualifiedNameContext } from "./OpenSearchPPLParser.js"; import { IdentsAsWildcardQualifiedNameContext } from "./OpenSearchPPLParser.js"; import { IdentContext } from "./OpenSearchPPLParser.js"; import { TableIdentContext } from "./OpenSearchPPLParser.js"; @@ -909,11 +909,12 @@ export class OpenSearchPPLParserVisitor extends AbstractParseTreeVisitor */ visitQualifiedName?: (ctx: QualifiedNameContext) => Result; /** - * Visit a parse tree produced by `OpenSearchPPLParser.tableQualifiedName`. + * Visit a parse tree produced by the `identsAsTableQualifiedName` + * labeled alternative in `OpenSearchPPLParser.tableQualifiedName`. * @param ctx the parse tree * @return the visitor result */ - visitTableQualifiedName?: (ctx: TableQualifiedNameContext) => Result; + visitIdentsAsTableQualifiedName?: (ctx: IdentsAsTableQualifiedNameContext) => Result; /** * Visit a parse tree produced by the `identsAsWildcardQualifiedName` * labeled alternative in `OpenSearchPPLParser.wcQualifiedName`. diff --git a/src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 b/src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 index 1c75937f6f37..337952c12098 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 +++ b/src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4 @@ -775,11 +775,11 @@ valueList ; qualifiedName - : ID // (DOT ident)* # identsAsQualifiedName + : ID // ident (DOT ident)* # identsAsQualifiedName ; tableQualifiedName - : ID // tableIdent (DOT ident)* # identsAsTableQualifiedName + : tableIdent (DOT ident)* # identsAsTableQualifiedName ; wcQualifiedName diff --git a/src/plugins/data/public/antlr/opensearch_ppl/opensearch_ppl_autocomplete.ts b/src/plugins/data/public/antlr/opensearch_ppl/opensearch_ppl_autocomplete.ts index 7b04ab685adf..99d74a2e7b62 100644 --- a/src/plugins/data/public/antlr/opensearch_ppl/opensearch_ppl_autocomplete.ts +++ b/src/plugins/data/public/antlr/opensearch_ppl/opensearch_ppl_autocomplete.ts @@ -73,7 +73,7 @@ const rulesToVisit = new Set([ OpenSearchPPLParser.RULE_takeAggFunction, OpenSearchPPLParser.RULE_timestampFunctionName, OpenSearchPPLParser.RULE_getFormatFunction, - OpenSearchPPLParser.RULE_tableQualifiedName, + OpenSearchPPLParser.RULE_tableIdent, OpenSearchPPLParser.RULE_singleFieldRelevanceFunctionName, OpenSearchPPLParser.RULE_multiFieldRelevanceFunctionName, OpenSearchPPLParser.RULE_positionFunctionName, @@ -99,7 +99,7 @@ export function processVisitedRules( shouldSuggestColumns = true; break; } - case OpenSearchPPLParser.RULE_tableQualifiedName: { + case OpenSearchPPLParser.RULE_tableIdent: { suggestSourcesOrTables = SourceOrTableSuggestion.TABLES; } } diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index e39722118721..b120c69af694 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -493,6 +493,7 @@ export { QueryStart, PersistedLog, LanguageReference, + DatasetIndexedViewsService, } from './query'; export { AggsStart } from './search/aggs'; diff --git a/src/plugins/data/public/query/query_string/dataset_service/types.ts b/src/plugins/data/public/query/query_string/dataset_service/types.ts index f303fa6af56d..0b8bcd402d15 100644 --- a/src/plugins/data/public/query/query_string/dataset_service/types.ts +++ b/src/plugins/data/public/query/query_string/dataset_service/types.ts @@ -3,7 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ import { EuiIconProps } from '@elastic/eui'; -import { Dataset, DatasetField, DatasetSearchOptions, DataStructure } from '../../../../common'; +import { + Dataset, + DatasetField, + DatasetSearchOptions, + DataStructure, + SavedObject, +} from '../../../../common'; import { IDataPluginServices } from '../../../types'; /** @@ -16,6 +22,18 @@ export interface DataStructureFetchOptions { paginationToken?: string; } +export interface DatasetIndexedView { + name: string; +} + +export interface DatasetIndexedViewsService { + getIndexedViews: (dataset: Dataset) => Promise; + /** + * Returns the data source saved object connected with the data connection object + */ + getConnectedDataSource: (dataset: Dataset) => Promise; +} + /** * Configuration for handling dataset operations. */ @@ -83,5 +101,9 @@ export interface DatasetTypeConfig { /** * Returns a list of sample queries for this dataset type */ - getSampleQueries?: (dataset: Dataset, language: string) => any; + getSampleQueries?: (dataset?: Dataset, language?: string) => Promise | any; + /** + * Service used for indexedViews related operations + */ + indexedViewsService?: DatasetIndexedViewsService; } diff --git a/src/plugins/data/public/query/query_string/index.ts b/src/plugins/data/public/query/query_string/index.ts index 96f473a3aea5..9ec21a485663 100644 --- a/src/plugins/data/public/query/query_string/index.ts +++ b/src/plugins/data/public/query/query_string/index.ts @@ -34,6 +34,7 @@ export { DatasetService, DatasetServiceContract, DatasetTypeConfig, + DatasetIndexedViewsService, } from './dataset_service'; export { LanguageServiceContract, diff --git a/src/plugins/data/public/query/query_string/language_service/language_service.mock.ts b/src/plugins/data/public/query/query_string/language_service/language_service.mock.ts index 936ff690353d..e481932883ca 100644 --- a/src/plugins/data/public/query/query_string/language_service/language_service.mock.ts +++ b/src/plugins/data/public/query/query_string/language_service/language_service.mock.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { createEditor, DQLBody, SingleLineInput } from '../../../ui'; import { LanguageServiceContract } from './language_service'; import { LanguageConfig } from './types'; @@ -14,7 +15,7 @@ const createSetupLanguageServiceMock = (): jest.Mocked title: 'DQL', search: {} as any, getQueryString: jest.fn(), - editor: {} as any, + editor: createEditor(SingleLineInput, SingleLineInput, [], DQLBody), fields: { filterable: true, visualizable: true, @@ -28,7 +29,7 @@ const createSetupLanguageServiceMock = (): jest.Mocked title: 'Lucene', search: {} as any, getQueryString: jest.fn(), - editor: {} as any, + editor: createEditor(SingleLineInput, SingleLineInput, [], DQLBody), fields: { filterable: true, visualizable: true, @@ -42,7 +43,9 @@ const createSetupLanguageServiceMock = (): jest.Mocked return { __enhance: jest.fn(), - registerLanguage: jest.fn(), + registerLanguage: jest.fn((language: LanguageConfig) => { + languages.set(language.id, language); + }), getLanguage: jest.fn((id: string) => languages.get(id)), getLanguages: jest.fn(() => Array.from(languages.values())), getDefaultLanguage: jest.fn(() => languages.get('kuery') || languages.values().next().value), diff --git a/src/plugins/data/public/query/query_string/language_service/lib/__snapshots__/query_result.test.tsx.snap b/src/plugins/data/public/query/query_string/language_service/lib/__snapshots__/query_result.test.tsx.snap index a0fd2861a2b4..f3d4e3df2c92 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/__snapshots__/query_result.test.tsx.snap +++ b/src/plugins/data/public/query/query_string/language_service/lib/__snapshots__/query_result.test.tsx.snap @@ -37,6 +37,8 @@ exports[`Query Result show error status with error message 2`] = ` className="eui-textBreakWord" style={ Object { + "maxHeight": "250px", + "overflowY": "auto", "width": "250px", } } diff --git a/src/plugins/data/public/query/query_string/language_service/lib/query_result.test.tsx b/src/plugins/data/public/query/query_string/language_service/lib/query_result.test.tsx index 9e735cd02d64..ea464f5ec68f 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/query_result.test.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/query_result.test.tsx @@ -27,6 +27,17 @@ describe('Query Result', () => { expect(component).toMatchSnapshot(); }); + it('should not render if status is uninitialized', () => { + const props = { + queryStatus: { + status: ResultStatus.UNINITIALIZED, + startTime: Number.NEGATIVE_INFINITY, + }, + }; + const component = shallowWithIntl(); + expect(component.isEmptyRender()).toBe(true); + }); + it('shows ready status with complete message', () => { const props = { queryStatus: { diff --git a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx index 2e8ab769e2e4..dff7faea36e3 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx @@ -58,24 +58,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) { }; }, [props.queryStatus.startTime]); - if (elapsedTime > BUFFER_TIME) { - if (props.queryStatus.status === ResultStatus.LOADING) { - const time = Math.floor(elapsedTime / 1000); - return ( - {}} - isLoading - data-test-subj="queryResultLoading" - > - {i18n.translate('data.query.languageService.queryResults.loadTime', { - defaultMessage: 'Loading {time} s', - values: { time }, - })} - - ); - } + if (elapsedTime > BUFFER_TIME && props.queryStatus.status === ResultStatus.LOADING) { const time = Math.floor(elapsedTime / 1000); return ( ERRORS -
+

diff --git a/src/plugins/data/public/query/query_string/query_string_manager.test.ts b/src/plugins/data/public/query/query_string/query_string_manager.test.ts index da054574ff85..758d658864ab 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.test.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.test.ts @@ -44,7 +44,6 @@ describe('QueryStringManager', () => { storage = new DataStorage(window.localStorage, 'opensearchDashboards.'); sessionStorage = new DataStorage(window.sessionStorage, 'opensearchDashboards.'); mockSearchInterceptor = {} as jest.Mocked; - service = new QueryStringManager( storage, sessionStorage, diff --git a/src/plugins/data/public/ui/dataset_selector/configurator.test.tsx b/src/plugins/data/public/ui/dataset_selector/configurator.test.tsx new file mode 100644 index 000000000000..462c6298a0a3 --- /dev/null +++ b/src/plugins/data/public/ui/dataset_selector/configurator.test.tsx @@ -0,0 +1,361 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { render, screen, fireEvent, waitFor } from '@testing-library/react'; +import { Configurator } from './configurator'; +import '@testing-library/jest-dom'; +import React from 'react'; +import { setQueryService, setIndexPatterns } from '../../services'; +import { IntlProvider } from 'react-intl'; +import { Query } from '../../../../data/public'; +import { Dataset } from 'src/plugins/data/common'; + +const getQueryMock = jest.fn().mockReturnValue({ + query: '', + language: 'lucene', + dataset: undefined, +} as Query); + +const languageService = { + getDefaultLanguage: () => ({ id: 'lucene', title: 'Lucene' }), + getLanguages: () => [ + { id: 'lucene', title: 'Lucene' }, + { id: 'kuery', title: 'DQL' }, + ], + getLanguage: (languageId: string) => { + const languages = [ + { id: 'lucene', title: 'Lucene' }, + { id: 'kuery', title: 'DQL' }, + ]; + return languages.find((lang) => lang.id === languageId); + }, + setUserQueryLanguage: jest.fn(), +}; + +const datasetService = { + getType: jest.fn().mockReturnValue({ + fetchFields: jest.fn().mockResolvedValue([{ name: 'timestamp', type: 'date' }]), + supportedLanguages: jest.fn().mockReturnValue(['kuery', 'lucene']), + indexedViewsService: { + getIndexedViews: jest.fn().mockResolvedValue([ + { name: 'view1', type: 'type1' }, + { name: 'view2', type: 'type2' }, + ]), + getConnectedDataSource: jest.fn().mockResolvedValue({ + id: 'test-connected-data-source-saved-obj', + attributes: { + title: 'test-connected-data-source-saved-obj', + }, + }), + }, + }), + addRecentDataset: jest.fn(), +}; + +const fetchFieldsMock = jest.fn().mockResolvedValue([{ name: 'timestamp', type: 'date' }]); + +const mockServices = { + getQueryService: () => ({ + queryString: { + getQuery: getQueryMock, + getLanguageService: () => languageService, + getDatasetService: () => datasetService, + fetchFields: fetchFieldsMock, + getUpdates$: jest.fn().mockReturnValue({ + subscribe: jest.fn().mockReturnValue({ unsubscribe: jest.fn() }), + }), + }, + }), + getIndexPatterns: jest.fn().mockResolvedValue([ + { + id: 'indexPattern1', + attributes: { + title: 'indexPattern1', + }, + }, + { + id: 'indexPattern2', + attributes: { + title: 'indexPattern2', + }, + }, + ]), +}; + +const mockBaseDataset: Dataset = { + id: 'mock-dataset', + title: 'Sample Dataset', + type: 'index-pattern', + timeFieldName: 'timestamp', + dataSource: { + id: 'test-connection-id', + meta: { supportsTimeFilter: true }, + title: 'mock-datasource', + type: 'DATA_SOURCE', + }, +}; + +const messages = { + 'app.welcome': 'Welcome to our application!', + 'app.logout': 'Log Out', +}; + +const mockOnConfirm = jest.fn(); +const mockOnCancel = jest.fn(); +const mockOnPrevious = jest.fn(); + +beforeEach(() => { + jest.clearAllMocks(); + setQueryService(mockServices.getQueryService()); + setIndexPatterns(mockServices.getIndexPatterns()); +}); + +describe('Configurator Component', () => { + it('should render the component with the correct title and description', () => { + render( + + {/* Wrap with IntlProvider */} + + + ); + + expect(screen.getByText('Step 2: Configure data')).toBeInTheDocument(); + expect( + screen.getByText('Configure selected data based on parameters available.') + ).toBeInTheDocument(); + }); + + it('should call onCancel when cancel button is clicked', () => { + render( + + + + ); + fireEvent.click(screen.getByText('Cancel')); + + expect(mockOnCancel).toHaveBeenCalledTimes(1); + }); + + it('should call onPrevious when previous button is clicked', () => { + render( + + + + ); + + fireEvent.click(screen.getByText('Back')); + + expect(mockOnPrevious).toHaveBeenCalledTimes(1); + }); + + it('should update state correctly when language is selected', async () => { + render( + + + + ); + const languageSelect = screen.getByText('Lucene'); + expect(languageSelect).toBeInTheDocument(); + expect(languageSelect.value).toBe('lucene'); + fireEvent.change(languageSelect, { target: { value: 'kuery' } }); + await waitFor(() => { + expect(languageSelect.value).toBe('kuery'); + }); + expect(mockOnConfirm).not.toHaveBeenCalled(); + }); + + it('should fetch indexed views on mount', async () => { + render( + + + + ); + + await waitFor(() => { + expect( + mockServices.getQueryService().queryString.getDatasetService().getType().indexedViewsService + .getIndexedViews + ).toHaveBeenCalledTimes(1); + }); + }); + + it('should display indexed views when query indexed view toggle is checked', async () => { + const container = render( + + + + ); + await waitFor(() => { + expect( + mockServices.getQueryService().queryString.getDatasetService().getType().indexedViewsService + .getIndexedViews + ).toHaveBeenCalledTimes(1); + }); + + fireEvent.click(container.getByText('Query indexed view')); + + await waitFor(() => { + expect(screen.getByText('view1')).toBeInTheDocument(); + expect(screen.getByText('view2')).toBeInTheDocument(); + }); + }); + + it('should update state correctly when indexed view is selected', async () => { + const container = render( + + + + ); + fireEvent.click(container.getByText('Query indexed view')); + await waitFor(() => { + expect( + mockServices.getQueryService().queryString.getDatasetService().getType().indexedViewsService + .getIndexedViews + ).toHaveBeenCalledTimes(1); + }); + const indexedViewSelector = screen.getByText('view1'); + expect(indexedViewSelector).toBeInTheDocument(); + expect(indexedViewSelector.value).toBe('view1'); + fireEvent.change(indexedViewSelector, { target: { value: 'view2' } }); + await waitFor(() => { + expect(indexedViewSelector.value).toBe('view2'); + }); + expect(mockOnConfirm).not.toHaveBeenCalled(); + }); + + it('should initialize selectedLanguage with the current language from queryString', async () => { + render( + + + + ); + + await waitFor(() => { + expect(screen.getByText('Lucene')).toBeInTheDocument(); + }); + }); + + it('should default selectedLanguage to the first language if currentLanguage is not supported', async () => { + mockServices.getQueryService().queryString.getQuery.mockReturnValue({ language: 'de' }); + + render( + + + + ); + + await waitFor(() => { + expect(screen.getByText('Lucene')).toBeInTheDocument(); // Should default to 'Lucene' + }); + }); + + it('should display the supported language dropdown correctly', async () => { + render( + + + + ); + + await waitFor(() => { + expect(screen.getByText('Lucene')).toBeInTheDocument(); + expect(screen.getByText('DQL')).toBeInTheDocument(); + }); + }); + + it('should disable the confirm button when submit is disabled', async () => { + const mockDataset = { + ...mockBaseDataset, + timeFieldName: undefined, + type: 'index', + }; + const { container } = render( + + + + ); + + const submitButton = container.querySelector( + `button[data-test-subj="advancedSelectorConfirmButton"]` + ); // screen.getAllByTestId() // screen.getByRole('button', { name: /select data/i }); + await waitFor(() => { + expect(submitButton).toBeDisabled(); + }); + + const timeFieldSelect = container.querySelector( + `[data-test-subj="advancedSelectorTimeFieldSelect"]` + ); + fireEvent.change(timeFieldSelect!, { target: { value: 'timestamp' } }); + + await waitFor(() => { + expect(submitButton).toBeEnabled(); + }); + }); +}); diff --git a/src/plugins/data/public/ui/dataset_selector/configurator.tsx b/src/plugins/data/public/ui/dataset_selector/configurator.tsx index 2940c6b2baf0..0dba9107934c 100644 --- a/src/plugins/data/public/ui/dataset_selector/configurator.tsx +++ b/src/plugins/data/public/ui/dataset_selector/configurator.tsx @@ -8,20 +8,24 @@ import { EuiButtonEmpty, EuiFieldText, EuiForm, + EuiFormLabel, EuiFormRow, EuiModalBody, EuiModalFooter, EuiModalHeader, EuiModalHeaderTitle, EuiSelect, + EuiSpacer, + EuiSwitch, EuiText, } from '@elastic/eui'; import { i18n } from '@osd/i18n'; import { FormattedMessage } from '@osd/i18n/react'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { BaseDataset, DEFAULT_DATA, Dataset, DatasetField, Query } from '../../../common'; import { getIndexPatterns, getQueryService } from '../../services'; import { IDataPluginServices } from '../../types'; +import { DatasetIndexedView } from '../../query/query_string/dataset_service'; export const Configurator = ({ services, @@ -42,6 +46,15 @@ export const Configurator = ({ const indexPatternsService = getIndexPatterns(); const type = queryString.getDatasetService().getType(baseDataset.type); const languages = type?.supportedLanguages(baseDataset) || []; + const [shouldSelectIndexedView, setShouldSelectIndexedView] = useState(false); + + const [language, setLanguage] = useState(() => { + const currentLanguage = queryString.getQuery().language; + if (languages.includes(currentLanguage)) { + return currentLanguage; + } + return languages[0]; + }); const [dataset, setDataset] = useState(baseDataset); const [timeFields, setTimeFields] = useState([]); @@ -52,13 +65,29 @@ export const Configurator = ({ defaultMessage: "I don't want to use the time filter", } ); - const [language, setLanguage] = useState(() => { - const currentLanguage = queryString.getQuery().language; - if (languages.includes(currentLanguage)) { - return currentLanguage; - } - return languages[0]; - }); + const indexedViewsService = type?.indexedViewsService; + const [selectedIndexedView, setSelectedIndexedView] = useState(); + const [indexedViews, setIndexedViews] = useState([]); + const [isLoadingIndexedViews, setIsLoadingIndexedViews] = useState(false); + + useEffect(() => { + let isMounted = true; + const getIndexedViews = async () => { + if (indexedViewsService) { + setIsLoadingIndexedViews(true); + const fetchedIndexedViews = await indexedViewsService.getIndexedViews(baseDataset); + if (isMounted) { + setIsLoadingIndexedViews(false); + setIndexedViews(fetchedIndexedViews || []); + } + } + }; + + getIndexedViews(); + return () => { + isMounted = false; + }; + }, [indexedViewsService, baseDataset]); const submitDisabled = useMemo(() => { return ( @@ -91,6 +120,38 @@ export const Configurator = ({ fetchFields(); }, [baseDataset, indexPatternsService, queryString, timeFields.length]); + const updateDatasetForIndexedView = useCallback(async () => { + if (!indexedViewsService || !selectedIndexedView) { + return dataset; + } + + let connectedDataSource; + if (dataset.dataSource?.id) { + const connectedDataSourceSavedObj: any = await indexedViewsService.getConnectedDataSource( + dataset + ); + if (connectedDataSourceSavedObj) { + connectedDataSource = { + id: connectedDataSourceSavedObj.id, + title: connectedDataSourceSavedObj.attributes?.title, + type: 'DATA_SOURCE', + }; + } + } + + return { + ...dataset, + id: `${dataset.id}.${selectedIndexedView}`, + title: selectedIndexedView, + type: DEFAULT_DATA.SET_TYPES.INDEX, + sourceDatasetRef: { + id: dataset.id, + type: dataset.type, + }, + dataSource: connectedDataSource ?? dataset.dataSource, + }; + }, [indexedViewsService, selectedIndexedView, dataset]); + return ( <> @@ -123,6 +184,57 @@ export const Configurator = ({ > + {indexedViewsService && ( + <> + + + {i18n.translate( + 'data.explorer.datasetSelector.advancedSelector.configurator.showAvailableIndexedViewsLabel', + { + defaultMessage: 'Query indexed view', + } + )} + + } + onChange={(e) => setShouldSelectIndexedView(e.target.checked)} + /> + + {shouldSelectIndexedView && ( + + ({ + text: name, + value: name, + }))} + value={selectedIndexedView} + onChange={async (e) => { + const value = e.target.value; + setSelectedIndexedView(value); + }} + hasNoInitialSelection + /> + + )} + + )} { - await queryString.getDatasetService().cacheDataset(dataset, services); - onConfirm({ dataset, language }); + let newDataset = dataset; + if (shouldSelectIndexedView && selectedIndexedView) { + newDataset = await updateDatasetForIndexedView(); + } + await queryString.getDatasetService().cacheDataset(newDataset, services); + onConfirm({ dataset: newDataset, language }); }} fill disabled={submitDisabled} diff --git a/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx b/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx index 75ea695a2083..a88aea528e7e 100644 --- a/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx +++ b/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx @@ -82,7 +82,8 @@ export const DatasetSelector = ({ const { overlays } = services; const datasetService = getQueryService().queryString.getDatasetService(); const datasetIcon = - datasetService.getType(selectedDataset?.type || '')?.meta.icon.type || 'database'; + datasetService.getType(selectedDataset?.sourceDatasetRef?.type || selectedDataset?.type || '') + ?.meta.icon.type || 'database'; useEffect(() => { isMounted.current = true; diff --git a/src/plugins/data/public/ui/filter_bar/filter_options.tsx b/src/plugins/data/public/ui/filter_bar/filter_options.tsx index 3cda39731fa7..4af53fa28df1 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_options.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_options.tsx @@ -59,7 +59,7 @@ import { import { FilterEditor } from './filter_editor'; import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { SavedQueryManagementComponent } from '../saved_query_management'; -import { SavedQuery, SavedQueryService } from '../../query'; +import { QueryStringManager, SavedQuery, SavedQueryService } from '../../query'; import { SavedQueryMeta } from '../saved_query_form'; import { getUseNewSavedQueriesUI } from '../../services'; @@ -79,6 +79,7 @@ interface Props { useSaveQueryMenu: boolean; isQueryEditorControl: boolean; saveQuery: (savedQueryMeta: SavedQueryMeta, saveAsNew?: boolean) => Promise; + queryStringManager: QueryStringManager; } const maxFilterWidth = 600; @@ -310,6 +311,7 @@ const FilterOptionsUI = (props: Props) => { key={'savedQueryManagement'} useNewSavedQueryUI={getUseNewSavedQueriesUI()} saveQuery={props.saveQuery} + queryStringManager={props.queryStringManager} />, ]} data-test-subj="save-query-panel" diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 2223b577b513..20650cca6acc 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -15,7 +15,7 @@ import { PopoverAnchorPosition, } from '@elastic/eui'; import classNames from 'classnames'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { monaco } from '@osd/monaco'; import { IDataPluginServices, @@ -74,6 +74,7 @@ export const QueryEditorUI: React.FC = (props) => { const inputRef = useRef(null); const headerRef = useRef(null); const bannerRef = useRef(null); + const bottomPanelRef = useRef(null); const queryControlsContainer = useRef(null); // TODO: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/8801 const editorQuery = props.query; // local query state managed by the editor. Not to be confused by the app query state. @@ -113,6 +114,7 @@ export const QueryEditorUI: React.FC = (props) => { headerRef.current && bannerRef.current && queryControlsContainer.current && + bottomPanelRef.current && query.language && extensionMap && Object.keys(extensionMap).length > 0 @@ -130,6 +132,9 @@ export const QueryEditorUI: React.FC = (props) => { componentContainer={headerRef.current} bannerContainer={bannerRef.current} queryControlsContainer={queryControlsContainer.current} + bottomPanelContainer={bottomPanelRef.current} + query={query} + fetchStatus={props.queryStatus?.status} /> ); }; @@ -434,7 +439,7 @@ export const QueryEditorUI: React.FC = (props) => { queryString={queryString} onClickRecentQuery={onClickRecentQuery} /> - +

{renderQueryEditorExtensions()}
); diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.test.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.test.tsx index 289afadbac5e..13bb51ffea14 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.test.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.test.tsx @@ -15,9 +15,21 @@ jest.mock('react-dom', () => ({ type QueryEditorExtensionProps = ComponentProps; +const mockQuery = { + query: 'dummy query', + language: 'kuery', + dataset: { + id: 'db', + title: 'db', + type: 'index', + dataSource: { id: 'testId', type: 'DATA_SOURCE', title: 'testTitle' }, + }, +}; + describe('QueryEditorExtension', () => { const getComponentMock = jest.fn(); const getBannerMock = jest.fn(); + const getBottomPanelMock = jest.fn(); const isEnabledMock = jest.fn(); const defaultProps: QueryEditorExtensionProps = { @@ -27,15 +39,19 @@ describe('QueryEditorExtension', () => { isEnabled$: isEnabledMock, getComponent: getComponentMock, getBanner: getBannerMock, + getBottomPanel: getBottomPanelMock, }, dependencies: { language: 'Test', onSelectLanguage: jest.fn(), isCollapsed: false, setIsCollapsed: jest.fn(), + query: mockQuery, }, componentContainer: document.createElement('div'), bannerContainer: document.createElement('div'), + bottomPanelContainer: document.createElement('div'), + queryControlsContainer: document.createElement('div'), }; beforeEach(() => { @@ -46,26 +62,31 @@ describe('QueryEditorExtension', () => { isEnabledMock.mockReturnValue(of(true)); getComponentMock.mockReturnValue(
Test Component
); getBannerMock.mockReturnValue(
Test Banner
); + getBottomPanelMock.mockReturnValue(
Test Bottom panel
); const { getByText } = render(); await waitFor(() => { expect(getByText('Test Component')).toBeInTheDocument(); expect(getByText('Test Banner')).toBeInTheDocument(); + expect(getByText('Test Bottom panel')).toBeInTheDocument(); }); expect(isEnabledMock).toHaveBeenCalled(); expect(getComponentMock).toHaveBeenCalledWith(defaultProps.dependencies); + expect(getBottomPanelMock).toHaveBeenCalledWith(defaultProps.dependencies); }); it('does not render when isEnabled is false', async () => { isEnabledMock.mockReturnValue(of(false)); getComponentMock.mockReturnValue(
Test Component
); + getBottomPanelMock.mockReturnValue(
Test Bottom panel
); const { queryByText } = render(); await waitFor(() => { expect(queryByText('Test Component')).toBeNull(); + expect(queryByText('Test Bottom panel')).toBeNull(); }); expect(isEnabledMock).toHaveBeenCalled(); diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx index 95af159c785f..bcfa95357040 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx @@ -7,13 +7,15 @@ import { EuiErrorBoundary } from '@elastic/eui'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; import { Observable } from 'rxjs'; -import { DataStructureMeta } from '../../../../common'; +import { DataStructureMeta, Query } from '../../../../common'; +import { ResultStatus } from '../../../query/query_string/language_service/lib'; interface QueryEditorExtensionProps { config: QueryEditorExtensionConfig; dependencies: QueryEditorExtensionDependencies; componentContainer: Element; bannerContainer: Element; + bottomPanelContainer: Element; queryControlsContainer: Element; } @@ -34,6 +36,14 @@ export interface QueryEditorExtensionDependencies { * Set whether the query editor is collapsed. */ setIsCollapsed: (isCollapsed: boolean) => void; + /** + * Currently set Query + */ + query: Query; + /** + * Fetch status for the currently running query + */ + fetchStatus?: ResultStatus; } export interface QueryEditorExtensionConfig { @@ -74,6 +84,12 @@ export interface QueryEditorExtensionConfig { getSearchBarButton?: ( dependencies: QueryEditorExtensionDependencies ) => React.ReactElement | null; + /** + * Returns the footer element that is rendered at the bottom of the query editor. + * @param dependencies - The dependencies required for the extension. + * @returns The component the query editor extension. + */ + getBottomPanel?: (dependencies: QueryEditorExtensionDependencies) => React.ReactElement | null; } const QueryEditorExtensionPortal: React.FC<{ container: Element }> = (props) => { if (!props.children) return null; @@ -103,6 +119,11 @@ export const QueryEditorExtension: React.FC = (props) props.dependencies, ]); + const bottomPanel = useMemo(() => props.config.getBottomPanel?.(props.dependencies), [ + props.config, + props.dependencies, + ]); + useEffect(() => { isMounted.current = true; return () => { @@ -130,6 +151,9 @@ export const QueryEditorExtension: React.FC = (props) {queryControlButtons} + + {bottomPanel} + ); }; diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.test.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.test.tsx index ec67a3a52dfb..8a18a82d3714 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.test.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.test.tsx @@ -19,6 +19,17 @@ jest.mock('./query_editor_extension', () => ({ )), })); +const mockQuery = { + query: 'dummy query', + language: 'kuery', + dataset: { + id: 'db', + title: 'db', + type: 'index', + dataSource: { id: 'testId', type: 'DATA_SOURCE', title: 'testTitle' }, + }, +}; + describe('QueryEditorExtensions', () => { const defaultProps: QueryEditorExtensionsProps = { componentContainer: document.createElement('div'), @@ -28,6 +39,8 @@ describe('QueryEditorExtensions', () => { onSelectLanguage: jest.fn(), isCollapsed: false, setIsCollapsed: jest.fn(), + query: mockQuery, + bottomPanelContainer: document.createElement('div'), }; beforeEach(() => { @@ -78,6 +91,7 @@ describe('QueryEditorExtensions', () => { onSelectLanguage: expect.any(Function), isCollapsed: false, setIsCollapsed: expect.any(Function), + query: mockQuery, }, }), expect.anything() diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx index 90c7fbf51666..4c420adc0312 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx @@ -14,6 +14,7 @@ interface QueryEditorExtensionsProps extends QueryEditorExtensionDependencies { configMap?: Record; componentContainer: Element; bannerContainer: Element; + bottomPanelContainer: Element; queryControlsContainer: Element; } @@ -22,6 +23,7 @@ const QueryEditorExtensions: React.FC = React.memo(( configMap, componentContainer, bannerContainer, + bottomPanelContainer, queryControlsContainer, ...dependencies } = props; @@ -62,6 +64,7 @@ const QueryEditorExtensions: React.FC = React.memo(( dependencies={dependencies} componentContainer={extensionComponentContainer} bannerContainer={bannerContainer} + bottomPanelContainer={bottomPanelContainer} queryControlsContainer={extensionQueryControlsContainer} /> ); diff --git a/src/plugins/data/public/ui/query_editor/query_editor_top_row.test.tsx b/src/plugins/data/public/ui/query_editor/query_editor_top_row.test.tsx new file mode 100644 index 000000000000..62fe653bfd45 --- /dev/null +++ b/src/plugins/data/public/ui/query_editor/query_editor_top_row.test.tsx @@ -0,0 +1,158 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { Query, UI_SETTINGS } from '../../../common'; +import { coreMock } from '../../../../../core/public/mocks'; +import { dataPluginMock } from '../../mocks'; +import React from 'react'; +import { I18nProvider } from '@osd/i18n/react'; +import { createEditor, DQLBody, QueryEditorTopRow, SingleLineInput } from '../'; +import { OpenSearchDashboardsContextProvider } from 'src/plugins/opensearch_dashboards_react/public'; +import { cleanup, render, waitFor } from '@testing-library/react'; +import { LanguageConfig } from '../../query'; +import { getQueryService } from '../../services'; + +const startMock = coreMock.createStart(); + +jest.mock('../../services', () => ({ + getQueryService: jest.fn(), +})); + +startMock.uiSettings.get.mockImplementation((key: string) => { + switch (key) { + case UI_SETTINGS.TIMEPICKER_QUICK_RANGES: + return [ + { + from: 'now/d', + to: 'now/d', + display: 'Today', + }, + ]; + case 'dateFormat': + return 'MMM D, YYYY @ HH:mm:ss.SSS'; + case UI_SETTINGS.HISTORY_LIMIT: + return 10; + case UI_SETTINGS.TIMEPICKER_TIME_DEFAULTS: + return { + from: 'now-15m', + to: 'now', + }; + case UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED: + return true; + case 'theme:darkMode': + return true; + default: + throw new Error(`Unexpected config key: ${key}`); + } +}); + +const createMockWebStorage = () => ({ + clear: jest.fn(), + getItem: jest.fn(), + key: jest.fn(), + removeItem: jest.fn(), + setItem: jest.fn(), + length: 0, +}); + +const createMockStorage = () => ({ + storage: createMockWebStorage(), + get: jest.fn(), + set: jest.fn(), + remove: jest.fn(), + clear: jest.fn(), +}); + +const dataPlugin = dataPluginMock.createStartContract(true); + +function wrapQueryEditorTopRowInContext(testProps: any) { + const defaultOptions = { + onSubmit: jest.fn(), + onChange: jest.fn(), + isDirty: true, + screenTitle: 'Another Screen', + }; + + const mockLanguage: LanguageConfig = { + id: 'test-language', + title: 'Test Language', + search: {} as any, + getQueryString: jest.fn(), + editor: createEditor(SingleLineInput, SingleLineInput, [], DQLBody), + fields: {}, + showDocLinks: true, + editorSupportedAppNames: ['discover'], + hideDatePicker: true, + }; + dataPlugin.query.queryString.getLanguageService().registerLanguage(mockLanguage); + + const services = { + ...startMock, + data: dataPlugin, + appName: 'discover', + storage: createMockStorage(), + }; + + return ( + + + + + + ); +} + +describe('QueryEditorTopRow', () => { + const QUERY_EDITOR = '.osdQueryEditor'; + const DATE_PICKER = '.osdQueryEditor__datePickerWrapper'; + + beforeEach(() => { + jest.clearAllMocks(); + (getQueryService as jest.Mock).mockReturnValue(dataPlugin.query); + }); + + afterEach(() => { + cleanup(); + jest.resetModules(); + }); + + it('Should render query editor', async () => { + const { container } = render( + wrapQueryEditorTopRowInContext({ + showQueryEditor: true, + }) + ); + await waitFor(() => expect(container.querySelector(QUERY_EDITOR)).toBeTruthy()); + expect(container.querySelector(DATE_PICKER)).toBeTruthy(); + }); + + it('Should not render date picker if showDatePicker is false', async () => { + const { container } = render( + wrapQueryEditorTopRowInContext({ + showQueryEditor: true, + showDatePicker: false, + }) + ); + await waitFor(() => expect(container.querySelector(QUERY_EDITOR)).toBeTruthy()); + expect(container.querySelector(DATE_PICKER)).toBeFalsy(); + }); + + it('Should not render date picker if language does not support time field', async () => { + const query: Query = { + query: 'test query', + language: 'test-language', + }; + dataPlugin.query.queryString.getQuery = jest.fn().mockReturnValue(query); + const { container } = render( + wrapQueryEditorTopRowInContext({ + query, + showQueryEditor: false, + showDatePicker: true, + }) + ); + await waitFor(() => expect(container.querySelector(QUERY_EDITOR)).toBeTruthy()); + expect(container.querySelector(DATE_PICKER)).toBeFalsy(); + }); +}); diff --git a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx index ab9b8c50e038..ea15fbfeeaa1 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx @@ -72,7 +72,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { const [isDateRangeInvalid, setIsDateRangeInvalid] = useState(false); const [isQueryEditorFocused, setIsQueryEditorFocused] = useState(false); const opensearchDashboards = useOpenSearchDashboards(); - const { uiSettings, storage, appName } = opensearchDashboards.services; + const { uiSettings, storage, appName, data } = opensearchDashboards.services; const queryLanguage = props.query && props.query.language; const persistedLog: PersistedLog | undefined = React.useMemo( @@ -225,7 +225,17 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { } function shouldRenderDatePicker(): boolean { - return Boolean(props.showDatePicker ?? true) ?? (props.showAutoRefreshOnly && true); + return ( + Boolean((props.showDatePicker || props.showAutoRefreshOnly) ?? true) && + !( + queryLanguage && + data.query.queryString.getLanguageService().getLanguage(queryLanguage)?.hideDatePicker + ) && + (props.query?.dataset + ? data.query.queryString.getDatasetService().getType(props.query.dataset.type)?.meta + ?.supportsTimeFilter !== false + : true) + ); } function shouldRenderQueryEditor(): boolean { diff --git a/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.test.tsx b/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.test.tsx new file mode 100644 index 000000000000..8daaafe0fdcb --- /dev/null +++ b/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.test.tsx @@ -0,0 +1,228 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render, screen, fireEvent, waitFor, act } from '@testing-library/react'; +import { OpenSavedQueryFlyout } from './open_saved_query_flyout'; +import { createSavedQueryService } from '../../../public/query/saved_query/saved_query_service'; +import { applicationServiceMock, uiSettingsServiceMock } from '../../../../../core/public/mocks'; +import { SavedQueryAttributes } from '../../../public/query/saved_query/types'; +import '@testing-library/jest-dom'; +import { queryStringManagerMock } from '../../../../data/public/query/query_string/query_string_manager.mock'; + +const savedQueryAttributesWithTemplate: SavedQueryAttributes = { + title: 'foo', + description: 'bar', + query: { + language: 'kuery', + query: 'response:200', + dataset: 'my_dataset', + }, +}; + +const mockSavedObjectsClient = { + create: jest.fn(), + error: jest.fn(), + find: jest.fn(), + get: jest.fn(), + delete: jest.fn(), +}; + +mockSavedObjectsClient.create.mockReturnValue({ + id: 'foo', + attributes: { + ...savedQueryAttributesWithTemplate, + query: { + ...savedQueryAttributesWithTemplate.query, + }, + }, +}); + +jest.mock('./saved_query_card', () => ({ + SavedQueryCard: ({ + savedQuery = { + id: 'foo1', + attributes: savedQueryAttributesWithTemplate, + }, + onSelect, + handleQueryDelete, + }) => ( +
+
{savedQuery?.attributes?.title}
+ + +
+ ), +})); + +jest.mock('@osd/i18n', () => ({ + i18n: { + translate: jest.fn((id, { defaultMessage }) => defaultMessage), + }, +})); + +const mockSavedQueryService = createSavedQueryService( + // @ts-ignore + mockSavedObjectsClient, + { + application: applicationServiceMock.create(), + uiSettings: uiSettingsServiceMock.createStartContract(), + } +); + +const mockHandleQueryDelete = jest.fn(); +const mockOnQueryOpen = jest.fn(); +const mockOnClose = jest.fn(); + +const savedQueries = [ + { + id: '1', + attributes: { + title: 'Saved Query 1', + description: 'Description for Query 1', + query: { query: 'SELECT * FROM table1', language: 'sql' }, + }, + }, + { + id: '2', + attributes: { + title: 'Saved Query 2', + description: 'Description for Query 2', + query: { query: 'SELECT * FROM table2', language: 'sql' }, + }, + }, +]; + +jest.spyOn(mockSavedQueryService, 'getAllSavedQueries').mockResolvedValue(savedQueries); + +describe('OpenSavedQueryFlyout', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render the flyout with correct tabs and content', async () => { + render( + + ); + + const savedQueriesTextElements = screen.getAllByText('Saved queries'); + + expect(savedQueriesTextElements).toHaveLength(2); + + await waitFor(() => screen.getByPlaceholderText('Search')); + + await waitFor(() => screen.getByText('Saved Query 1')); + await waitFor(() => screen.getByText('Saved Query 2')); + + const openQueryButton = screen.getByText('Open query'); + + fireEvent.change(screen.getByPlaceholderText('Search'), { target: { value: 'Saved Query 1' } }); + + await waitFor(() => screen.getByText('Saved Query 1')); + expect(screen.queryByText('Saved Query 2')).not.toBeInTheDocument(); + + fireEvent.click(screen.getByText('Saved Query 1')); + + expect(openQueryButton).toBeEnabled(); + }); + + it('should filter saved queries based on search input', async () => { + render( + + ); + + await waitFor(() => screen.getByText('Saved Query 1')); + await waitFor(() => screen.getByText('Saved Query 2')); + + const searchBar = screen.getByPlaceholderText('Search'); + fireEvent.change(searchBar, { target: { value: 'Saved Query 1' } }); + + expect(screen.getByText('Saved Query 1')).toBeInTheDocument(); + expect(screen.queryByText('Saved Query 2')).toBeNull(); + }); + + it('should select a query when clicking on it and enable the "Open query" button', async () => { + render( + + ); + + await waitFor(() => screen.getByText('Saved Query 1')); + + fireEvent.click(screen.getByText('Saved Query 1')); + + expect(screen.getByText('Open query')).toBeEnabled(); + }); + + it('should call handleQueryDelete when deleting a query', async () => { + mockHandleQueryDelete.mockResolvedValueOnce(); + render( + + ); + + await waitFor(() => screen.getByText('Saved Query 1')); + + const deleteButtons = screen.getAllByText('Delete'); + + fireEvent.click(deleteButtons[0]); + + await waitFor(() => { + expect(mockHandleQueryDelete).toHaveBeenCalledWith({ + id: '1', + attributes: { + description: 'Description for Query 1', + query: { + language: 'sql', + query: 'SELECT * FROM table1', + }, + title: 'Saved Query 1', + }, + }); + }); + expect(mockHandleQueryDelete).toHaveBeenCalledTimes(1); + }); + + it('should handle pagination controls correctly', async () => { + render( + + ); + + await waitFor(() => screen.getByText('Saved Query 1')); + + const pageSizeButton = await screen.findByText(/10/); + fireEvent.click(pageSizeButton); + + expect(mockSavedQueryService.getAllSavedQueries).toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.tsx b/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.tsx index c7f13f27db08..41aa344bbaef 100644 --- a/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.tsx +++ b/src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.tsx @@ -13,6 +13,7 @@ import { EuiFlyoutBody, EuiFlyoutFooter, EuiFlyoutHeader, + EuiLoadingSpinner, EuiSearchBar, EuiSearchBarProps, EuiSpacer, @@ -23,14 +24,16 @@ import { } from '@elastic/eui'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { i18n } from '@osd/i18n'; -import { SavedQuery, SavedQueryService } from '../../query'; +import { QueryStringManager, SavedQuery, SavedQueryService } from '../../query'; import { SavedQueryCard } from './saved_query_card'; +import { Query } from '../../../common'; export interface OpenSavedQueryFlyoutProps { savedQueryService: SavedQueryService; onClose: () => void; onQueryOpen: (query: SavedQuery) => void; handleQueryDelete: (query: SavedQuery) => Promise; + queryStringManager: QueryStringManager; } interface SavedQuerySearchableItem { @@ -47,6 +50,7 @@ export function OpenSavedQueryFlyout({ onClose, onQueryOpen, handleQueryDelete, + queryStringManager, }: OpenSavedQueryFlyoutProps) { const [selectedTabId, setSelectedTabId] = useState('mutable-saved-queries'); const [savedQueries, setSavedQueries] = useState([]); @@ -59,18 +63,39 @@ export function OpenSavedQueryFlyout({ const [languageFilterOptions, setLanguageFilterOptions] = useState([]); const [selectedQuery, setSelectedQuery] = useState(undefined); const [searchQuery, setSearchQuery] = useState(EuiSearchBar.Query.MATCH_ALL); + const [isLoading, setIsLoading] = useState(false); + const currentTabIdRef = useRef(selectedTabId); const fetchAllSavedQueriesForSelectedTab = useCallback(async () => { - const allQueries = await savedQueryService.getAllSavedQueries(); - const templateQueriesPresent = allQueries.some((q) => q.attributes.isTemplate); - const queriesForSelectedTab = allQueries.filter( - (q) => - (selectedTabId === 'mutable-saved-queries' && !q.attributes.isTemplate) || - (selectedTabId === 'template-saved-queries' && q.attributes.isTemplate) - ); - setSavedQueries(queriesForSelectedTab); - setHasTemplateQueries(templateQueriesPresent); - }, [savedQueryService, selectedTabId, setSavedQueries]); + setIsLoading(true); + const query = queryStringManager.getQuery(); + let templateQueries: any[] = []; + + // fetch sample query based on dataset type + if (query?.dataset?.type) { + templateQueries = + (await queryStringManager + .getDatasetService() + ?.getType(query.dataset.type) + ?.getSampleQueries?.()) || []; + + // Check if any sample query has isTemplate set to true + const hasTemplates = templateQueries.some((q) => q?.attributes?.isTemplate); + setHasTemplateQueries(hasTemplates); + } + + // Set queries based on the current tab + if (currentTabIdRef.current === 'mutable-saved-queries') { + const allQueries = await savedQueryService.getAllSavedQueries(); + const mutableSavedQueries = allQueries.filter((q) => !q.attributes.isTemplate); + if (currentTabIdRef.current === 'mutable-saved-queries') { + setSavedQueries(mutableSavedQueries); + } + } else if (currentTabIdRef.current === 'template-saved-queries') { + setSavedQueries(templateQueries); + } + setIsLoading(false); + }, [savedQueryService, currentTabIdRef, setSavedQueries, queryStringManager]); const updatePageIndex = useCallback((index: number) => { pager.current.goToPageIndex(index); @@ -179,7 +204,13 @@ export function OpenSavedQueryFlyout({ onChange={onChange} /> - {queriesOnCurrentPage.length > 0 ? ( + {isLoading ? ( + + + + + + ) : queriesOnCurrentPage.length > 0 ? ( queriesOnCurrentPage.map((query) => ( )} - {queriesOnCurrentPage.length > 0 && ( + {!isLoading && queriesOnCurrentPage.length > 0 && ( { setSelectedTabId(tab.id); + currentTabIdRef.current = tab.id; }} /> @@ -268,7 +300,19 @@ export function OpenSavedQueryFlyout({ fill onClick={() => { if (selectedQuery) { - onQueryOpen(selectedQuery); + if ( + // Template queries are not associated with data sources. Apply data source from current query + selectedQuery.attributes.isTemplate + ) { + const updatedQuery: Query = { + ...queryStringManager?.getQuery(), + query: selectedQuery.attributes.query.query, + language: selectedQuery.attributes.query.language, + }; + queryStringManager.setQuery(updatedQuery); + } else { + onQueryOpen(selectedQuery); + } onClose(); } }} diff --git a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx index 01f9b97e978f..44c5ef384966 100644 --- a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx +++ b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx @@ -45,7 +45,7 @@ import { import { i18n } from '@osd/i18n'; import React, { useCallback, useEffect, useState, Fragment, useRef } from 'react'; import { sortBy } from 'lodash'; -import { SavedQuery, SavedQueryService } from '../..'; +import { QueryStringManager, SavedQuery, SavedQueryService } from '../..'; import { SavedQueryListItem } from './saved_query_list_item'; import { toMountPoint, @@ -70,6 +70,7 @@ interface Props { onClearSavedQuery: () => void; closeMenuPopover: () => void; saveQuery: (savedQueryMeta: SavedQueryMeta, saveAsNew?: boolean) => Promise; + queryStringManager: QueryStringManager; } export function SavedQueryManagementComponent({ @@ -83,6 +84,7 @@ export function SavedQueryManagementComponent({ closeMenuPopover, useNewSavedQueryUI, saveQuery, + queryStringManager, }: Props) { const [savedQueries, setSavedQueries] = useState([] as SavedQuery[]); const [count, setTotalCount] = useState(0); @@ -256,6 +258,7 @@ export function SavedQueryManagementComponent({ onClose={() => openSavedQueryFlyout?.close().then()} onQueryOpen={onLoad} handleQueryDelete={handleDelete} + queryStringManager={queryStringManager} /> ) ); diff --git a/src/plugins/data/public/ui/search_bar/create_search_bar.tsx b/src/plugins/data/public/ui/search_bar/create_search_bar.tsx index f8b9694caabc..d3f89d0f559d 100644 --- a/src/plugins/data/public/ui/search_bar/create_search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/create_search_bar.tsx @@ -202,6 +202,7 @@ export function createSearchBar({ core, storage, data }: StatefulSearchBarDeps) isRefreshPaused={refreshInterval.pause} filters={filters} query={query} + queryStringManager={data.query.queryString} onFiltersUpdated={defaultFiltersUpdated(data.query)} onRefreshChange={defaultOnRefreshChange(data.query)} savedQuery={savedQuery} diff --git a/src/plugins/data/public/ui/search_bar/search_bar.tsx b/src/plugins/data/public/ui/search_bar/search_bar.tsx index 1f1b20b8c952..3cd6cdcca25e 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.tsx @@ -38,7 +38,13 @@ import { withOpenSearchDashboards, } from '../../../../opensearch_dashboards_react/public'; import { Filter, IIndexPattern, Query, TimeRange, UI_SETTINGS } from '../../../common'; -import { SavedQuery, SavedQueryAttributes, TimeHistoryContract, QueryStatus } from '../../query'; +import { + SavedQuery, + SavedQueryAttributes, + TimeHistoryContract, + QueryStatus, + QueryStringManager, +} from '../../query'; import { IDataPluginServices } from '../../types'; import { FilterBar } from '../filter_bar/filter_bar'; import { QueryEditorTopRow } from '../query_editor'; @@ -95,6 +101,7 @@ export interface SearchBarOwnProps { onRefresh?: (payload: { dateRange: TimeRange }) => void; indicateNoData?: boolean; queryStatus?: QueryStatus; + queryStringManager: QueryStringManager; } export type SearchBarProps = SearchBarOwnProps & SearchBarInjectedDeps; @@ -467,6 +474,7 @@ class SearchBarUI extends Component { useSaveQueryMenu={useSaveQueryMenu} isQueryEditorControl={isQueryEditorControl} saveQuery={this.onSave} + queryStringManager={this.props.queryStringManager} /> ) ); diff --git a/src/plugins/discover/public/application/components/no_results/no_results.tsx b/src/plugins/discover/public/application/components/no_results/no_results.tsx index b1ec382b4fd5..24a4b80c7204 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/components/no_results/no_results.tsx @@ -174,6 +174,7 @@ export const DiscoverNoResults = ({ queryString, query, savedQuery, timeFieldNam // } const [savedQueries, setSavedQueries] = useState([]); + const [sampleQueries, setSampleQueries] = useState([]); useEffect(() => { const fetchSavedQueries = async () => { @@ -186,6 +187,39 @@ export const DiscoverNoResults = ({ queryString, query, savedQuery, timeFieldNam fetchSavedQueries(); }, [setSavedQueries, query, savedQuery]); + useEffect(() => { + // Samples for the language + const newSampleQueries: any = []; + if (query?.language) { + const languageSampleQueries = queryString.getLanguageService()?.getLanguage(query.language) + ?.sampleQueries; + if (Array.isArray(languageSampleQueries)) { + newSampleQueries.push(...languageSampleQueries); + } + } + + // Samples for the dataset type + if (query?.dataset?.type) { + const datasetType = queryString.getDatasetService()?.getType(query.dataset.type); + if (datasetType?.getSampleQueries) { + const sampleQueriesResponse = datasetType.getSampleQueries(query.dataset, query.language); + if (Array.isArray(sampleQueriesResponse)) { + setSampleQueries([...sampleQueriesResponse, ...newSampleQueries]); + } else if (sampleQueriesResponse instanceof Promise) { + sampleQueriesResponse + .then((datasetSampleQueries: any) => { + if (Array.isArray(datasetSampleQueries)) { + setSampleQueries([...datasetSampleQueries, ...newSampleQueries]); + } + }) + .catch((error: any) => { + // noop + }); + } + } + } + }, [queryString, query]); + const tabs = useMemo(() => { const buildSampleQueryBlock = (sampleTitle: string, sampleQuery: string) => { return ( @@ -197,25 +231,6 @@ export const DiscoverNoResults = ({ queryString, query, savedQuery, timeFieldNam ); }; - - const sampleQueries = []; - - // Samples for the dataset type - if (query?.dataset?.type) { - const datasetSampleQueries = queryString - .getDatasetService() - ?.getType(query.dataset.type) - ?.getSampleQueries?.(query.dataset, query.language); - if (Array.isArray(datasetSampleQueries)) sampleQueries.push(...datasetSampleQueries); - } - - // Samples for the language - if (query?.language) { - const languageSampleQueries = queryString.getLanguageService()?.getLanguage(query.language) - ?.sampleQueries; - if (Array.isArray(languageSampleQueries)) sampleQueries.push(...languageSampleQueries); - } - return [ ...(sampleQueries.length > 0 ? [ @@ -229,7 +244,7 @@ export const DiscoverNoResults = ({ queryString, query, savedQuery, timeFieldNam {sampleQueries .slice(0, 5) - .map((sampleQuery) => + .map((sampleQuery: any) => buildSampleQueryBlock(sampleQuery.title, sampleQuery.query) )} @@ -256,7 +271,7 @@ export const DiscoverNoResults = ({ queryString, query, savedQuery, timeFieldNam ] : []), ]; - }, [queryString, query, savedQueries]); + }, [savedQueries, sampleQueries]); return ( diff --git a/src/plugins/discover/public/application/view_components/canvas/index.tsx b/src/plugins/discover/public/application/view_components/canvas/index.tsx index cf834888b4f0..5fe1bac50891 100644 --- a/src/plugins/discover/public/application/view_components/canvas/index.tsx +++ b/src/plugins/discover/public/application/view_components/canvas/index.tsx @@ -77,8 +77,6 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history, optionalR useEffect(() => { const subscription = data$.subscribe((next) => { - if (next.status === ResultStatus.LOADING) return; - let shouldUpdateState = false; if (next.status !== fetchState.status) shouldUpdateState = true; @@ -86,7 +84,13 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history, optionalR if (next.bucketInterval && next.bucketInterval !== fetchState.bucketInterval) shouldUpdateState = true; if (next.chartData && next.chartData !== fetchState.chartData) shouldUpdateState = true; - if (next.rows && next.rows !== fetchState.rows) { + // we still want to show rows from the previous query while current query is loading or the current query results in error + if ( + next.status !== ResultStatus.LOADING && + next.status !== ResultStatus.ERROR && + next.rows && + next.rows !== fetchState.rows + ) { shouldUpdateState = true; setRows(next.rows); } @@ -153,30 +157,27 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history, optionalR timeFieldName={timeField} /> )} - {fetchState.status === ResultStatus.ERROR && ( - - )} {fetchState.status === ResultStatus.UNINITIALIZED && ( refetch$.next()} /> )} - {fetchState.status === ResultStatus.LOADING && } - {fetchState.status === ResultStatus.READY && isEnhancementsEnabled && ( - <> - - - - )} - {fetchState.status === ResultStatus.READY && !isEnhancementsEnabled && ( - - - - + {fetchState.status === ResultStatus.LOADING && !rows?.length && } + {fetchState.status === ResultStatus.ERROR && !rows?.length && ( + refetch$.next()} /> )} + {(fetchState.status === ResultStatus.READY || + (fetchState.status === ResultStatus.LOADING && !!rows?.length) || + (fetchState.status === ResultStatus.ERROR && !!rows?.length)) && + (isEnhancementsEnabled ? ( + <> + + + + ) : ( + + + + + ))} ) : ( <> diff --git a/src/plugins/discover/public/application/view_components/utils/use_search.test.tsx b/src/plugins/discover/public/application/view_components/utils/use_search.test.tsx index 1b1d55726407..ee1ae61a1db3 100644 --- a/src/plugins/discover/public/application/view_components/utils/use_search.test.tsx +++ b/src/plugins/discover/public/application/view_components/utils/use_search.test.tsx @@ -119,6 +119,48 @@ describe('useSearch', () => { }); }); + it('should initialize with uninitialized state when dataset type config search on page load is disabled', async () => { + const services = createMockServices(); + (services.uiSettings.get as jest.Mock).mockReturnValueOnce(true); + (services.data.query.queryString.getDatasetService as jest.Mock).mockReturnValue({ + meta: { searchOnLoad: false }, + }); + (services.data.query.timefilter.timefilter.getRefreshInterval as jest.Mock).mockReturnValue({ + pause: true, + value: 10, + }); + + const { result, waitForNextUpdate } = renderHook(() => useSearch(services), { wrapper }); + expect(result.current.data$.getValue()).toEqual( + expect.objectContaining({ status: ResultStatus.UNINITIALIZED }) + ); + + await act(async () => { + await waitForNextUpdate(); + }); + }); + + it('should initialize with uninitialized state when dataset type config search on page load is enabled but the UI setting is disabled', async () => { + const services = createMockServices(); + (services.uiSettings.get as jest.Mock).mockReturnValueOnce(false); + (services.data.query.queryString.getDatasetService as jest.Mock).mockReturnValue({ + meta: { searchOnLoad: true }, + }); + (services.data.query.timefilter.timefilter.getRefreshInterval as jest.Mock).mockReturnValue({ + pause: true, + value: 10, + }); + + const { result, waitForNextUpdate } = renderHook(() => useSearch(services), { wrapper }); + expect(result.current.data$.getValue()).toEqual( + expect.objectContaining({ status: ResultStatus.UNINITIALIZED }) + ); + + await act(async () => { + await waitForNextUpdate(); + }); + }); + it('should update startTime when hook rerenders', async () => { const services = createMockServices(); @@ -151,23 +193,29 @@ describe('useSearch', () => { wrapper, }); + act(() => { + mockDatasetUpdates$.next({ + dataset: { id: 'new-dataset-id', title: 'New Dataset', type: 'INDEX_PATTERN' }, + }); + }); + act(() => { result.current.data$.next({ status: ResultStatus.READY }); }); + act(() => { + mockDatasetUpdates$.next({ + dataset: { id: 'new-dataset-id', title: 'New Dataset', type: 'INDEX_PATTERN' }, + }); + }); + expect(result.current.data$.getValue()).toEqual( expect.objectContaining({ status: ResultStatus.READY }) ); act(() => { mockDatasetUpdates$.next({ - dataset: { id: 'new-dataset-id', title: 'New Dataset', type: 'INDEX_PATTERN' }, - }); - mockDatasetUpdates$.next({ - dataset: { id: 'new-dataset-id', title: 'New Dataset', type: 'INDEX_PATTERN' }, - }); - mockDatasetUpdates$.next({ - dataset: { id: 'new-dataset-id2', title: 'New Dataset', type: 'INDEX_PATTERN' }, + dataset: { id: 'different-dataset-id', title: 'New Dataset', type: 'INDEX_PATTERN' }, }); }); @@ -176,7 +224,7 @@ describe('useSearch', () => { }); expect(result.current.data$.getValue()).toEqual( - expect.objectContaining({ status: ResultStatus.LOADING }) + expect.objectContaining({ status: ResultStatus.LOADING, rows: [] }) ); }); diff --git a/src/plugins/discover/public/application/view_components/utils/use_search.ts b/src/plugins/discover/public/application/view_components/utils/use_search.ts index 49fe0856149a..955811ebc9f8 100644 --- a/src/plugins/discover/public/application/view_components/utils/use_search.ts +++ b/src/plugins/discover/public/application/view_components/utils/use_search.ts @@ -115,24 +115,23 @@ export const useSearch = (services: DiscoverViewServices) => { requests: new RequestAdapter(), }; - const getDatasetAutoSearchOnPageLoadPreference = () => { - // Checks the searchOnpageLoadPreference for the current dataset if not specifed defaults to true - const datasetType = data.query.queryString.getQuery().dataset?.type; - - const datasetService = data.query.queryString.getDatasetService(); - - return !datasetType || (datasetService?.getType(datasetType)?.meta?.searchOnLoad ?? true); - }; - const shouldSearchOnPageLoad = useCallback(() => { + // Checks the searchOnpageLoadPreference for the current dataset if not specifed defaults to UI Settings + const { queryString } = data.query; + const { dataset } = queryString.getQuery(); + const typeConfig = dataset ? queryString.getDatasetService().getType(dataset.type) : undefined; + const datasetPreference = + typeConfig?.meta?.searchOnLoad ?? uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING); + // A saved search is created on every page load, so we check the ID to see if we're loading a // previously saved search or if it is just transient return ( - services.uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) || + datasetPreference || + uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) || savedSearch?.id !== undefined || timefilter.getRefreshInterval().pause === false ); - }, [savedSearch, services.uiSettings, timefilter]); + }, [data.query, savedSearch, uiSettings, timefilter]); const startTime = Date.now(); const data$ = useMemo( @@ -155,7 +154,7 @@ export const useSearch = (services: DiscoverViewServices) => { .getUpdates$() .pipe( pairwise(), - filter(([prev, curr]) => prev.dataset?.id === curr.dataset?.id) + filter(([prev, curr]) => prev.dataset?.id !== curr.dataset?.id) ) .subscribe(() => { data$.next({ @@ -164,6 +163,7 @@ export const useSearch = (services: DiscoverViewServices) => { ? ResultStatus.LOADING : ResultStatus.UNINITIALIZED, queryStatus: { startTime }, + rows: [], }); }); return () => subscription.unsubscribe(); @@ -186,11 +186,12 @@ export const useSearch = (services: DiscoverViewServices) => { const refetch$ = useMemo(() => new Subject(), []); const fetch = useCallback(async () => { + const currentTime = Date.now(); let dataset = indexPattern; if (!dataset) { data$.next({ status: shouldSearchOnPageLoad() ? ResultStatus.LOADING : ResultStatus.UNINITIALIZED, - queryStatus: { startTime }, + queryStatus: { startTime: currentTime }, }); return; } @@ -220,10 +221,7 @@ export const useSearch = (services: DiscoverViewServices) => { let elapsedMs; try { - // Only show loading indicator if we are fetching when the rows are empty - if (fetchStateRef.current.rows?.length === 0) { - data$.next({ status: ResultStatus.LOADING, queryStatus: { startTime } }); - } + data$.next({ status: ResultStatus.LOADING, queryStatus: { startTime: currentTime } }); // Initialize inspect adapter for search source inspectorAdapters.requests.reset(); @@ -341,17 +339,12 @@ export const useSearch = (services: DiscoverViewServices) => { services, sort, savedSearch?.searchSource, - startTime, data$, shouldSearchOnPageLoad, inspectorAdapters.requests, ]); useEffect(() => { - if (!getDatasetAutoSearchOnPageLoadPreference()) { - skipInitialFetch.current = true; - } - const fetch$ = merge( refetch$, filterManager.getFetches$(), @@ -384,8 +377,6 @@ export const useSearch = (services: DiscoverViewServices) => { return () => { subscription.unsubscribe(); }; - // disabling the eslint since we are not adding getDatasetAutoSearchOnPageLoadPreference since this changes when dataset changes and these chnages are already part of data.query.queryString - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ data$, data.query.queryString, diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.test.tsx new file mode 100644 index 000000000000..cc3b785344df --- /dev/null +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.test.tsx @@ -0,0 +1,163 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { createOpenSearchDashboardsReactContext } from '../../../../../opensearch_dashboards_react/public'; +import { coreMock, workspacesServiceMock } from '../../../../../../core/public/mocks'; +import { BehaviorSubject } from 'rxjs'; +import { WorkspaceObject } from 'opensearch-dashboards/public'; +import { IntlProvider } from 'react-intl'; +import { IndexHeader } from './index_header'; + +describe('IndexHeader at new home page', () => { + const indexPattern = { id: 'default-index', title: 'Test Index Pattern', fields: [] }; + const mockCoreStart = coreMock.createStart(); + const workspaceObject = { + id: 'foo_id', + name: 'foo', + }; + const getIndexHeader = (props: any) => { + const mockHeaderControl = + (props?.header as Function) || + (() => { + return null; + }); + + const setDefault = jest.fn(); + const refreshFields = jest.fn(); + const deleteIndexPatternClick = jest.fn(); + const { Provider } = createOpenSearchDashboardsReactContext({ + ...mockCoreStart, + ...{ + application: { + ...mockCoreStart.application, + capabilities: { + ...mockCoreStart.application.capabilities, + workspaces: { enabled: props.workspaceEnabled }, + }, + }, + uiSettings: { ...mockCoreStart.uiSettings, get: jest.fn().mockReturnValue(true) }, + workspaces: { + ...workspacesServiceMock.createStartContract(), + currentWorkspace$: new BehaviorSubject(props?.workspace), + }, + navigationUI: { + HeaderControl: mockHeaderControl, + }, + }, + }); + + return ( + + + + + + ); + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('renders the set default button when index is not default and workspace is disabled', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { getByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'no-default-index', + workspaceEnabled: false, + }) + ); + + expect(getByText('Set as default index')).toBeInTheDocument(); + }); + + it('does not render the set default button when index is default and workspace is disabled', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { queryByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'default-index', + workspaceEnabled: false, + }) + ); + + expect(queryByText('Set as default index')).toBeNull(); + }); + + it('renders the set default button when index is not default and user is in workspace', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { getByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'no-default-index', + workspace: workspaceObject, + workspaceEnabled: true, + }) + ); + + expect(getByText('Set as default index')).toBeInTheDocument(); + }); + + it('does not render the set default button when index is default and user is in workspace', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { queryByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'default-index', + workspace: workspaceObject, + workspaceEnabled: true, + }) + ); + + expect(queryByText('Set as default index')).toBeNull(); + }); + + it('does not render the set default button when index is not default and user is not in workspace', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { queryByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'no-default-index', + workspaceEnabled: true, + }) + ); + + expect(queryByText('Set as default index')).toBeNull(); + }); + + it('does not render the set default button when index is default and user is not in workspace', () => { + const mockHeaderControl = ({ controls }) => { + return controls?.[1]?.label ?? null; + }; + const { queryByText } = render( + getIndexHeader({ + header: mockHeaderControl, + defaultIndex: 'default-index', + workspaceEnabled: true, + }) + ); + + expect(queryByText('Set as default index')).toBeNull(); + }); +}); diff --git a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx index 4b0a3b215db3..fc790cc79c11 100644 --- a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx +++ b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx @@ -12,6 +12,7 @@ import { QueryEditorExtensionDependencies, QueryStringContract } from '../../../ import { dataPluginMock } from '../../../../data/public/mocks'; import { ConfigSchema } from '../../../common/config'; import { clearCache, createQueryAssistExtension } from './create_extension'; +import { ResultStatus } from '../../../../discover/public'; const coreSetupMock = coreMock.createSetup({ pluginStartDeps: { @@ -54,6 +55,8 @@ describe('CreateExtension', () => { onSelectLanguage: jest.fn(), isCollapsed: false, setIsCollapsed: jest.fn(), + query: mockQueryWithIndexPattern, + fetchStatus: ResultStatus.NO_RESULTS, }; afterEach(() => { jest.clearAllMocks(); diff --git a/src/plugins/saved_objects_management/common/types.ts b/src/plugins/saved_objects_management/common/types.ts index e66fae37724e..cd560886f2e1 100644 --- a/src/plugins/saved_objects_management/common/types.ts +++ b/src/plugins/saved_objects_management/common/types.ts @@ -58,4 +58,5 @@ export interface SavedObjectRelation { type: string; relationship: 'child' | 'parent'; meta: SavedObjectMetadata; + workspaces?: SavedObject['workspaces']; } diff --git a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx index 772d33199583..0b32dfdfffce 100644 --- a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx +++ b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx @@ -43,7 +43,7 @@ import { } from '../services'; import { SavedObjectsTable } from './objects_table'; import { NavigationPublicPluginStart } from '../../../navigation/public'; -import { formatUrlWithWorkspaceId } from '../../../../core/public/utils'; +import { formatInspectUrl } from '../utils'; const SavedObjectsTablePage = ({ coreStart, @@ -76,8 +76,6 @@ const SavedObjectsTablePage = ({ const itemsPerPage = coreStart.uiSettings.get('savedObjects:perPage', 50); const dateFormat = coreStart.uiSettings.get('dateFormat'); const currentWorkspace = useObservable(coreStart.workspaces.currentWorkspace$); - const basePath = coreStart.http.basePath; - const visibleWsIds = useObservable(coreStart.workspaces.workspaceList$)?.map((ws) => ws.id) || []; useEffect(() => { setBreadcrumbs([ @@ -119,26 +117,8 @@ const SavedObjectsTablePage = ({ workspaces={coreStart.workspaces} perPageConfig={itemsPerPage} goInspectObject={(savedObject) => { - const { editUrl } = savedObject.meta; - let finalEditUrl = editUrl; - if (useUpdatedUX && finalEditUrl) { - finalEditUrl = finalEditUrl.replace(/^\/management\/opensearch-dashboards/, '/app'); - } - if (finalEditUrl) { - let inAppUrl = basePath.prepend(finalEditUrl); - if (savedObject.workspaces?.length) { - if (currentWorkspace) { - inAppUrl = formatUrlWithWorkspaceId(finalEditUrl, currentWorkspace.id, basePath); - } else { - // find first workspace user have permission - const workspaceId = savedObject.workspaces.find((wsId) => - visibleWsIds.includes(wsId) - ); - if (workspaceId) { - inAppUrl = formatUrlWithWorkspaceId(finalEditUrl, workspaceId, basePath); - } - } - } + const inAppUrl = formatInspectUrl(savedObject, coreStart); + if (inAppUrl) { return coreStart.application.navigateToUrl(inAppUrl); } }} diff --git a/src/plugins/saved_objects_management/public/utils.test.ts b/src/plugins/saved_objects_management/public/utils.test.ts index eebfdec8f61d..fb9a8e328f04 100644 --- a/src/plugins/saved_objects_management/public/utils.test.ts +++ b/src/plugins/saved_objects_management/public/utils.test.ts @@ -3,7 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { formatWorkspaceIdParams } from './utils'; +import { coreMock } from '../../../core/public/mocks'; +import { formatInspectUrl, formatWorkspaceIdParams } from './utils'; +import { CoreStart } from 'opensearch-dashboards/public'; describe('Utils', () => { it('formatWorkspaceIdParams with workspace null/undefined', async () => { @@ -41,4 +43,84 @@ describe('Utils', () => { }); expect(obj).toEqual({ foo: 'bar', availableWorkspaces: ['foo', 'bar'], workspaces: ['foo'] }); }); + + describe('formatInspectUrl', () => { + let mockCoreStart: CoreStart; + const savedObject = { + type: 'dashboard', + id: 'dashboard', + attributes: {}, + references: [], + meta: { + editUrl: '/management/opensearch-dashboards/objects/dashboard/ID1', + }, + }; + const savedObjectWithWorkspaces = { + ...savedObject, + workspaces: ['workspace1'], + }; + + beforeEach(() => { + jest.clearAllMocks(); + mockCoreStart = coreMock.createStart(); + mockCoreStart.application.capabilities = { + ...mockCoreStart.application.capabilities, + workspaces: { + ...mockCoreStart.application.capabilities.workspaces, + enabled: true, + }, + }; + mockCoreStart.uiSettings = { + ...mockCoreStart.uiSettings, + get: jest.fn().mockReturnValue(true), + }; + }); + + it('formats URL correctly when useUpdatedUX is false and workspace is disabled', () => { + mockCoreStart.application.capabilities = { + ...mockCoreStart.application.capabilities, + workspaces: { + ...mockCoreStart.application.capabilities.workspaces, + enabled: false, + }, + }; + mockCoreStart.uiSettings = { + ...mockCoreStart.uiSettings, + get: jest.fn().mockReturnValue(false), + }; + const result = formatInspectUrl(savedObject, mockCoreStart); + expect(result).toBe('/app/management/opensearch-dashboards/objects/dashboard/ID1'); + }); + + it('formats URL correctly when useUpdatedUX is false, saved object does not belong to certain workspaces and not in current workspace', () => { + mockCoreStart.uiSettings = { + ...mockCoreStart.uiSettings, + get: jest.fn().mockReturnValue(false), + }; + const result = formatInspectUrl(savedObject, mockCoreStart); + expect(result).toBe('/app/management/opensearch-dashboards/objects/dashboard/ID1'); + }); + + it('formats URL correctly when useUpdatedUX is true and in current workspace', () => { + const currentWorkspace = { id: 'workspace1', name: 'workspace1' }; + mockCoreStart.workspaces.currentWorkspace$.next(currentWorkspace); + const result = formatInspectUrl(savedObjectWithWorkspaces, mockCoreStart); + + expect(result).toBe('http://localhost/w/workspace1/app/objects/dashboard/ID1'); + }); + + it('formats URL correctly when useUpdatedUX is true and saved object belongs to certain workspaces', () => { + mockCoreStart.workspaces.workspaceList$.next([{ id: 'workspace1', name: 'workspace1' }]); + const result = formatInspectUrl(savedObjectWithWorkspaces, mockCoreStart); + + expect(result).toBe('http://localhost/w/workspace1/app/objects/dashboard/ID1'); + }); + + it('formats URL correctly when useUpdatedUX is true and the object does not belong to any workspace', () => { + mockCoreStart.workspaces.workspaceList$.next([{ id: 'workspace2', name: 'workspace2' }]); + const result = formatInspectUrl(savedObjectWithWorkspaces, mockCoreStart); + + expect(result).toBe('/app/objects/dashboard/ID1'); + }); + }); }); diff --git a/src/plugins/saved_objects_management/public/utils.ts b/src/plugins/saved_objects_management/public/utils.ts index 937e7767702d..61f3670fed5c 100644 --- a/src/plugins/saved_objects_management/public/utils.ts +++ b/src/plugins/saved_objects_management/public/utils.ts @@ -3,6 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { CoreStart } from 'opensearch-dashboards/public'; +import { formatUrlWithWorkspaceId } from '../../../core/public/utils'; +import { SavedObjectWithMetadata } from './types'; + export function formatWorkspaceIdParams< T extends { workspaces?: string[] | null; availableWorkspaces?: string[] | null } >(obj: T): T | Omit { @@ -12,3 +16,36 @@ export function formatWorkspaceIdParams< } return others; } + +export function formatInspectUrl( + savedObject: SavedObjectWithMetadata, + coreStart: CoreStart +): string | undefined { + const { editUrl } = savedObject.meta; + const useUpdatedUX = !!coreStart.uiSettings.get('home:useNewHomePage'); + let finalEditUrl = editUrl; + if (useUpdatedUX && finalEditUrl) { + finalEditUrl = finalEditUrl.replace(/^\/management\/opensearch-dashboards/, ''); + } + if (finalEditUrl) { + finalEditUrl = `/app${finalEditUrl}`; + const basePath = coreStart.http.basePath; + let inAppUrl = basePath.prepend(finalEditUrl); + const workspaceEnabled = coreStart.application.capabilities.workspaces.enabled; + if (workspaceEnabled) { + const currentWorkspace = coreStart.workspaces.currentWorkspace$.value; + if (currentWorkspace) { + inAppUrl = formatUrlWithWorkspaceId(finalEditUrl, currentWorkspace.id, basePath); + } else { + const visibleWsIds = coreStart.workspaces.workspaceList$.value?.map((ws) => ws.id) || []; + + // find first workspace user have permission + const workspaceId = savedObject?.workspaces?.find((wsId) => visibleWsIds.includes(wsId)); + if (workspaceId) { + inAppUrl = formatUrlWithWorkspaceId(finalEditUrl, workspaceId, basePath); + } + } + } + return inAppUrl; + } +} diff --git a/src/plugins/saved_objects_management/server/lib/find_relationships.test.ts b/src/plugins/saved_objects_management/server/lib/find_relationships.test.ts index c9ee0a1e766d..b34e65dbc6f6 100644 --- a/src/plugins/saved_objects_management/server/lib/find_relationships.test.ts +++ b/src/plugins/saved_objects_management/server/lib/find_relationships.test.ts @@ -72,12 +72,14 @@ describe('findRelationships', () => { id: 'ref-1', attributes: {}, references: [], + workspaces: ['workspace1'], }, { type: 'another-type', id: 'ref-2', attributes: {}, references: [], + workspaces: ['workspace1'], }, ], }); @@ -90,6 +92,7 @@ describe('findRelationships', () => { attributes: {}, score: 1, references: [], + workspaces: ['workspace1'], }, ], total: 1, @@ -130,18 +133,21 @@ describe('findRelationships', () => { relationship: 'child', type: 'some-type', meta: expect.any(Object), + workspaces: ['workspace1'], }, { id: 'ref-2', relationship: 'child', type: 'another-type', meta: expect.any(Object), + workspaces: ['workspace1'], }, { id: 'parent-id', relationship: 'parent', type: 'parent-type', meta: expect.any(Object), + workspaces: ['workspace1'], }, ]); }); diff --git a/src/plugins/saved_objects_management/server/lib/find_relationships.ts b/src/plugins/saved_objects_management/server/lib/find_relationships.ts index 4a4ed8155c8c..a2582ed7074f 100644 --- a/src/plugins/saved_objects_management/server/lib/find_relationships.ts +++ b/src/plugins/saved_objects_management/server/lib/find_relationships.ts @@ -95,5 +95,6 @@ function extractCommonProperties(savedObject: SavedObjectWithMetadata) { id: savedObject.id, type: savedObject.type, meta: savedObject.meta, + workspaces: savedObject.workspaces, }; } diff --git a/src/plugins/workspace/common/constants.ts b/src/plugins/workspace/common/constants.ts index 366e5ace85d1..7ea882c03c14 100644 --- a/src/plugins/workspace/common/constants.ts +++ b/src/plugins/workspace/common/constants.ts @@ -168,6 +168,7 @@ export enum AssociationDataSourceModalMode { DirectQueryConnections = 'direction-query-connections', } export const USE_CASE_PREFIX = 'use-case-'; +export const OPENSEARCHDASHBOARDS_CONFIG_PATH = 'opensearchDashboards'; // Workspace will handle both data source and data connection type saved object. export const WORKSPACE_DATA_SOURCE_AND_CONNECTION_OBJECT_TYPES = [ diff --git a/src/plugins/workspace/public/components/workspace_list/index.tsx b/src/plugins/workspace/public/components/workspace_list/index.tsx index 158713186c0d..baee010b73d6 100644 --- a/src/plugins/workspace/public/components/workspace_list/index.tsx +++ b/src/plugins/workspace/public/components/workspace_list/index.tsx @@ -347,7 +347,13 @@ export const WorkspaceListInner = ({ return ( isDashboardAdmin && ( <> - + Delete {selection.length} Workspace {deletedWorkspaces && deletedWorkspaces.length > 0 && ( diff --git a/src/plugins/workspace/server/plugin.test.ts b/src/plugins/workspace/server/plugin.test.ts index c3f47042d340..9149a02d6ffa 100644 --- a/src/plugins/workspace/server/plugin.test.ts +++ b/src/plugins/workspace/server/plugin.test.ts @@ -13,7 +13,6 @@ import { updateWorkspaceState, } from '../../../core/server/utils'; import * as serverUtils from '../../../core/server/utils/auth_info'; -import * as utilsExports from './utils'; import { SavedObjectsPermissionControl } from './permission_control/client'; describe('Workspace server plugin', () => { @@ -109,6 +108,21 @@ describe('Workspace server plugin', () => { describe('#setupPermission', () => { const setupMock = coreMock.createSetup(); + const getConfigMock = jest.fn().mockResolvedValue({ + dashboardAdmin: { + users: ['dashboard-admin-user'], + groups: [], + }, + }); + jest.spyOn(setupMock.dynamicConfigService, 'getStartService').mockResolvedValue({ + ...setupMock.dynamicConfigService.getStartService(), + getAsyncLocalStore: jest.fn(), + getClient: () => ({ + getConfig: getConfigMock, + bulkGetConfigs: jest.fn(), + listConfigs: jest.fn(), + }), + }); const initializerContextConfigMock = coreMock.createPluginInitializerContext({ enabled: true, permission: { @@ -137,13 +151,10 @@ describe('Workspace server plugin', () => { expect(toolKitMock.next).toBeCalledTimes(1); }); - it('with configuring user as OSD admin', async () => { + it('with dynamic config and user is dashboard admin', async () => { jest .spyOn(serverUtils, 'getPrincipalsFromRequest') - .mockImplementation(() => ({ users: [`user1`] })); - jest - .spyOn(utilsExports, 'getOSDAdminConfigFromYMLConfig') - .mockResolvedValue([['group1'], ['user1']]); + .mockImplementation(() => ({ users: [`dashboard-admin-user`] })); await workspacePlugin.setup(setupMock); const toolKitMock = httpServerMock.createToolkit(); @@ -160,11 +171,36 @@ describe('Workspace server plugin', () => { expect(toolKitMock.next).toBeCalledTimes(1); }); + it('with dynamic config and user is not dashboard admin', async () => { + jest + .spyOn(serverUtils, 'getPrincipalsFromRequest') + .mockImplementation(() => ({ users: [`none-dashboard-admin-user`] })); + + await workspacePlugin.setup(setupMock); + const toolKitMock = httpServerMock.createToolkit(); + + await registerOnPostAuthFn( + requestWithWorkspaceInUrl, + httpServerMock.createResponseFactory(), + toolKitMock + ); + + expect(getWorkspaceState(requestWithWorkspaceInUrl)).toEqual({ + isDashboardAdmin: false, + }); + expect(toolKitMock.next).toBeCalledTimes(1); + }); + it('with configuring wildcard * and anyone will be OSD admin', async () => { jest .spyOn(serverUtils, 'getPrincipalsFromRequest') .mockImplementation(() => ({ users: [`user1`] })); - jest.spyOn(utilsExports, 'getOSDAdminConfigFromYMLConfig').mockResolvedValue([[], ['*']]); + getConfigMock.mockResolvedValueOnce({ + dashboardAdmin: { + users: ['*'], + groups: [], + }, + }); await workspacePlugin.setup(setupMock); const toolKitMock = httpServerMock.createToolkit(); @@ -185,7 +221,12 @@ describe('Workspace server plugin', () => { jest .spyOn(serverUtils, 'getPrincipalsFromRequest') .mockImplementation(() => ({ users: [`user1`] })); - jest.spyOn(utilsExports, 'getOSDAdminConfigFromYMLConfig').mockResolvedValue([[], []]); + getConfigMock.mockResolvedValueOnce({ + dashboardAdmin: { + users: [], + groups: [], + }, + }); await workspacePlugin.setup(setupMock); const toolKitMock = httpServerMock.createToolkit(); diff --git a/src/plugins/workspace/server/plugin.ts b/src/plugins/workspace/server/plugin.ts index 6c82097fda3d..8aa8de48c8c7 100644 --- a/src/plugins/workspace/server/plugin.ts +++ b/src/plugins/workspace/server/plugin.ts @@ -5,6 +5,7 @@ import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; +import { cloneDeep } from 'lodash'; import { PluginInitializerContext, CoreSetup, @@ -26,6 +27,7 @@ import { WORKSPACE_NAVIGATION_APP_ID, DEFAULT_WORKSPACE, PRIORITY_FOR_REPOSITORY_WRAPPER, + OPENSEARCHDASHBOARDS_CONFIG_PATH, } from '../common/constants'; import { IWorkspaceClientImpl, WorkspacePluginSetup, WorkspacePluginStart } from './types'; import { WorkspaceClient } from './workspace_client'; @@ -47,7 +49,7 @@ import { SavedObjectsPermissionControl, SavedObjectsPermissionControlContract, } from './permission_control/client'; -import { getOSDAdminConfigFromYMLConfig, updateDashboardAdminStateForRequest } from './utils'; +import { updateDashboardAdminStateForRequest } from './utils'; import { WorkspaceIdConsumerWrapper } from './saved_objects/workspace_id_consumer_wrapper'; import { WorkspaceUiSettingsClientWrapper } from './saved_objects/workspace_ui_settings_client_wrapper'; import { uiSettings } from './ui_settings'; @@ -97,8 +99,17 @@ export class WorkspacePlugin implements Plugin { expect(getWorkspaceState(mockRequest)?.isDashboardAdmin).toBe(true); }); - it('should get correct admin config when admin config is enabled ', async () => { - const globalConfig$: Observable = of({ - opensearchDashboards: { - dashboardAdmin: { - groups: ['group1', 'group2'], - users: ['user1', 'user2'], - }, - }, - }); - const [groups, users] = await getOSDAdminConfigFromYMLConfig(globalConfig$); - expect(groups).toEqual(['group1', 'group2']); - expect(users).toEqual(['user1', 'user2']); - }); - - it('should get [] when admin config is not enabled', async () => { - const globalConfig$: Observable = of({}); - const [groups, users] = await getOSDAdminConfigFromYMLConfig(globalConfig$); - expect(groups).toEqual([]); - expect(users).toEqual([]); - }); - it('should transfer current user placeholder in permissions', () => { expect(transferCurrentUserInPermissions('foo', undefined)).toBeUndefined(); expect( diff --git a/src/plugins/workspace/server/utils.ts b/src/plugins/workspace/server/utils.ts index 0fab0ce56176..98bfe4339a52 100644 --- a/src/plugins/workspace/server/utils.ts +++ b/src/plugins/workspace/server/utils.ts @@ -4,11 +4,8 @@ */ import crypto from 'crypto'; -import { Observable } from 'rxjs'; -import { first } from 'rxjs/operators'; import { OpenSearchDashboardsRequest, - SharedGlobalConfig, Permissions, SavedObjectsClientContract, IUiSettingsClient, @@ -53,17 +50,6 @@ export const updateDashboardAdminStateForRequest = ( }); }; -export const getOSDAdminConfigFromYMLConfig = async ( - globalConfig$: Observable -) => { - const globalConfig = await globalConfig$.pipe(first()).toPromise(); - const groupsResult = (globalConfig.opensearchDashboards?.dashboardAdmin?.groups || - []) as string[]; - const usersResult = (globalConfig.opensearchDashboards?.dashboardAdmin?.users || []) as string[]; - - return [groupsResult, usersResult]; -}; - export const transferCurrentUserInPermissions = ( realUserId: string, permissions: Permissions | undefined