js.documents 7.9.1 → 7.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -606,7 +606,7 @@ import { readFirebirdBackup } from "documents.js";
606
606
  const { summary, tables } = readFirebirdBackup(firebirdBackupBytes);
607
607
  ```
608
608
 
609
- **SQL `SELECT` engine** — `parseSelect`/`evaluateSelect` run a bounded `SELECT` over `readOdbTables`' output. Closed allowlist grammar: column list or `*` or aggregates (`COUNT`/`SUM`/`AVG`/`MIN`/`MAX`), `FROM` one table plus zero or more joins (`[INNER]`, `LEFT [OUTER]`, `RIGHT [OUTER]`, `FULL [OUTER]`, `CROSS`, or `NATURAL`, each a plain nested-loop join with `ON`, `USING (col, ...)`, or NATURAL's own implicit equi-join over shared columns; a `USING`/`NATURAL` join's shared columns merge into one output column, `COALESCE(left, right)`), optional table aliases (`FROM t [AS] alias`, which is what makes a genuine self-join possible), optional `WHERE`/`GROUP BY`/`ORDER BY`. Subqueries, column aliases, and everything else outside the grammar throws `HsqldbSqlUnsupportedError`:
609
+ **SQL `SELECT` engine** — `parseSelect`/`evaluateSelect` run a bounded `SELECT` over `readOdbTables`' output. Closed allowlist grammar: column list or `*` or aggregates (`COUNT`/`SUM`/`AVG`/`MIN`/`MAX`), `FROM` one table (or one derived table — a subquery standing in for one, requiring its own alias) plus zero or more joins (`[INNER]`, `LEFT [OUTER]`, `RIGHT [OUTER]`, `FULL [OUTER]`, `CROSS`, or `NATURAL`, each a plain nested-loop join with `ON`, `USING (col, ...)`, or NATURAL's own implicit equi-join over shared columns; a `USING`/`NATURAL` join's shared columns merge into one output column, `COALESCE(left, right)`), optional table aliases (`FROM t [AS] alias`, which is what makes a genuine self-join possible), optional `WHERE`/`GROUP BY`/`ORDER BY` — `WHERE` (and a JOIN's own `ON`) also accepts `[NOT] IN (SELECT ...)` and `[NOT] EXISTS (SELECT ...)`, each recursing through the identical grammar to whatever subquery nesting depth it naturally reaches, with a correlated subquery resolving an outer column it cannot resolve itself. Column aliases and everything else outside the grammar throws `HsqldbSqlUnsupportedError`:
610
610
 
611
611
  ```ts
612
612
  import { decodePackage, readOdbInventory } from "odf.js";
@@ -892,7 +892,7 @@ To run a single test file: `pnpm vitest run src/path/to/file.test.ts`.
892
892
  - **The rpt formula engine's group scoping cascades enclosing breaks inward.** A group at level L starts a new instance when its own expression breaks OR when any enclosing group breaks — otherwise a "Q2" subtotal would span two regions. `HASCHANGED` itself knows nothing about groups; the cascade lives in the report structure. Aggregates are computed over complete ranges (not running totals); group expressions may not transitively depend on aggregates (circular).
893
893
  - **The rpt function set is a closed allowlist; separator is semicolon.** `rpt:HASCHANGED`/`rpt:LEFT`/`rpt:SUM`/`COUNT`/`AVG`/`MIN`/`MAX`/`field:[COLUMN]` — everything else throws. `[NAME]` and `"NAME"` are one concept. Three refusals where guessing would produce wrong values: non-boolean group expressions, `rpt:LEFT` over non-text, per-row formulas in report header/footer.
894
894
  - **The rpt engine emits no page headers/footers** — the renderer places them under a single-logical-page model, at report scope.
895
- - **The SQL engine is a closed allowlist** — subqueries, `UNION`, `DISTINCT`, `HAVING`, `LIMIT`, column aliases, `CASE`, arithmetic, etc. all throw `HsqldbSqlUnsupportedError` naming the construct. Silently dropping a clause would return plausible wrong rows. JOINs (every kind, `USING`, `NATURAL`) and table aliases are real grammar.
895
+ - **The SQL engine is a closed allowlist** — `UNION`, `DISTINCT`, `HAVING`, `LIMIT`, column aliases, `CASE`, arithmetic, etc. all throw `HsqldbSqlUnsupportedError` naming the construct. Silently dropping a clause would return plausible wrong rows. JOINs (every kind, `USING`, `NATURAL`), table aliases, a derived table in `FROM`, and `[NOT] IN`/`[NOT] EXISTS (SELECT ...)` subqueries are all real grammar, the latter recursing through the same grammar to whatever nesting depth it naturally reaches.
896
896
  - **Four SQL semantics decisions:** (1) NULL is `{ kind: 'empty' }`, three-valued logic; (2) values compare within classes (numeric/boolean/text), cross-class throws; (3) `GROUP BY` puts NULLs in one group, first-appearance order; `COUNT(*)` counts rows, `COUNT(column)` counts non-NULL; (4) `ORDER BY` sorts NULLs last under ASC, stable.
897
897
  - **Unquoted SQL identifiers fold to upper case; double-quoted match exactly.**
898
898
  - **All four `.odb` decoder tiers are implemented.** Tier 4 (BINARY/COMPRESSED) is a sibling of Tier 2, not a new value decoder — it recovers DDL as TEXT-format script text and decodes rows through the same per-column encoder. An external-only connection is a permanent scope boundary.
@@ -1,5 +1,5 @@
1
1
  import { r as HsqldbTable } from "./script-DsGGIzGU.js";
2
- import { m as SqlSelectStatement } from "./parser-D-9P_0Qd.js";
2
+ import { h as SqlSelectStatement } from "./parser-CfMvvMT1.js";
3
3
  import { ContentCellValue } from "document-schema.js";
4
4
  //#region src/odb/sql/evaluate.d.ts
5
5
  interface SqlResultSet {
@@ -1,5 +1,5 @@
1
1
  import { r as HsqldbTable } from "./script-DsGGIzGU.cjs";
2
- import { m as SqlSelectStatement } from "./parser-h1n0BflA.cjs";
2
+ import { h as SqlSelectStatement } from "./parser-Oq6zLQsu.cjs";
3
3
  import { ContentCellValue } from "document-schema.js";
4
4
  //#region src/odb/sql/evaluate.d.ts
5
5
  interface SqlResultSet {
package/dist/index.d.cts CHANGED
@@ -114,8 +114,8 @@ import { odbTablesToSpreadsheetDocument } from "./odb/spreadsheet.cjs";
114
114
  import { readOdbForms, readOdbReports } from "./odb/components.cjs";
115
115
  import { OdbTableNotFoundError, OdbTableNotSpecifiedError } from "./odb/csv.cjs";
116
116
  import { i as tokenizeSql, n as SqlPunctuation, r as SqlToken, t as SqlComparisonOperator } from "./lexer-DgsW7jMA.cjs";
117
- import { a as SqlJoinClause, c as SqlLiteral, d as SqlOrderByTerm, f as SqlPredicate, g as parseSelect, h as SqlSortDirection, i as SqlFromClause, l as SqlNameRef, m as SqlSelectStatement, n as SqlAggregateFunction, p as SqlSelectItem, r as SqlColumnRef, t as SqlAggregateArgument, u as SqlOperand } from "./parser-h1n0BflA.cjs";
118
- import { n as evaluateSelect, t as SqlResultSet } from "./evaluate-3T-0yAut.cjs";
117
+ import { _ as parseSelect, a as SqlFromSource, d as SqlOperand, f as SqlOrderByTerm, g as SqlSortDirection, h as SqlSelectStatement, i as SqlFromClause, l as SqlLiteral, m as SqlSelectItem, n as SqlAggregateFunction, o as SqlJoinClause, p as SqlPredicate, r as SqlColumnRef, t as SqlAggregateArgument, u as SqlNameRef } from "./parser-Oq6zLQsu.cjs";
118
+ import { n as evaluateSelect, t as SqlResultSet } from "./evaluate-CYYLwKtR.cjs";
119
119
  import { HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError } from "./odb/sql/errors.cjs";
120
120
  import { RptBandDefinition, RptBandInstance, RptBandKind, RptGroupDefinition, RptNamedFunctionDefinition, RptReportDefinition, RptReportRun, RptScope, evaluateRptBandOutsideData, runRptReport } from "./odb/formula/evaluate.cjs";
121
121
  import { RptAggregateFunction, RptFormula, RptReference, parseRptFormula } from "./odb/formula/parser.cjs";
@@ -137,4 +137,4 @@ import { EpubBytesSchema, readEpubContent, writeEpubContent } from "epub-codec";
137
137
  import { readWpdContent } from "wpd-codec";
138
138
  import { readDocContent, writeDocContent } from "doc-codec";
139
139
  import { XlsContentDocument, readXlsContent, writeXlsContent } from "xls-codec";
140
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, CsvBytesSchema, CsvInvalidUtf8Error, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, type XlsContentDocument, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
140
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, CsvBytesSchema, CsvInvalidUtf8Error, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlFromSource, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, type XlsContentDocument, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
package/dist/index.d.ts CHANGED
@@ -114,8 +114,8 @@ import { odbTablesToSpreadsheetDocument } from "./odb/spreadsheet.js";
114
114
  import { readOdbForms, readOdbReports } from "./odb/components.js";
115
115
  import { OdbTableNotFoundError, OdbTableNotSpecifiedError } from "./odb/csv.js";
116
116
  import { i as tokenizeSql, n as SqlPunctuation, r as SqlToken, t as SqlComparisonOperator } from "./lexer-DgsW7jMA.js";
117
- import { a as SqlJoinClause, c as SqlLiteral, d as SqlOrderByTerm, f as SqlPredicate, g as parseSelect, h as SqlSortDirection, i as SqlFromClause, l as SqlNameRef, m as SqlSelectStatement, n as SqlAggregateFunction, p as SqlSelectItem, r as SqlColumnRef, t as SqlAggregateArgument, u as SqlOperand } from "./parser-D-9P_0Qd.js";
118
- import { n as evaluateSelect, t as SqlResultSet } from "./evaluate-Ddsxehrf.js";
117
+ import { _ as parseSelect, a as SqlFromSource, d as SqlOperand, f as SqlOrderByTerm, g as SqlSortDirection, h as SqlSelectStatement, i as SqlFromClause, l as SqlLiteral, m as SqlSelectItem, n as SqlAggregateFunction, o as SqlJoinClause, p as SqlPredicate, r as SqlColumnRef, t as SqlAggregateArgument, u as SqlNameRef } from "./parser-CfMvvMT1.js";
118
+ import { n as evaluateSelect, t as SqlResultSet } from "./evaluate-BnRKjJ1G.js";
119
119
  import { HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError } from "./odb/sql/errors.js";
120
120
  import { RptBandDefinition, RptBandInstance, RptBandKind, RptGroupDefinition, RptNamedFunctionDefinition, RptReportDefinition, RptReportRun, RptScope, evaluateRptBandOutsideData, runRptReport } from "./odb/formula/evaluate.js";
121
121
  import { RptAggregateFunction, RptFormula, RptReference, parseRptFormula } from "./odb/formula/parser.js";
@@ -137,4 +137,4 @@ import { XlsContentDocument, readXlsContent, writeXlsContent } from "xls-codec";
137
137
  import { RtfBytesSchema, readRtfContent, writeRtfContent } from "rtf-codec";
138
138
  import { EpubBytesSchema, readEpubContent, writeEpubContent } from "epub-codec";
139
139
  import { readWpdContent } from "wpd-codec";
140
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, CsvBytesSchema, CsvInvalidUtf8Error, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, type XlsContentDocument, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
140
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, CsvBytesSchema, CsvInvalidUtf8Error, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlFromSource, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, type XlsContentDocument, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
@@ -1,4 +1,4 @@
1
- import { t as SqlResultSet } from "../../evaluate-3T-0yAut.cjs";
1
+ import { t as SqlResultSet } from "../../evaluate-CYYLwKtR.cjs";
2
2
  import { ContentCellValue } from "document-schema.js";
3
3
  //#region src/odb/formula/evaluate.d.ts
4
4
  type RptBandKind = "report-header" | "group-header" | "detail" | "group-footer" | "report-footer";
@@ -1,4 +1,4 @@
1
- import { t as SqlResultSet } from "../../evaluate-Ddsxehrf.js";
1
+ import { t as SqlResultSet } from "../../evaluate-BnRKjJ1G.js";
2
2
  import { ContentCellValue } from "document-schema.js";
3
3
  //#region src/odb/formula/evaluate.d.ts
4
4
  type RptBandKind = "report-header" | "group-header" | "detail" | "group-footer" | "report-footer";
@@ -1,4 +1,4 @@
1
- import { t as SqlResultSet } from "../../evaluate-3T-0yAut.cjs";
1
+ import { t as SqlResultSet } from "../../evaluate-CYYLwKtR.cjs";
2
2
  import { ContentDocument } from "document-schema.js";
3
3
  import { OdbReport } from "odf.js";
4
4
  //#region src/odb/report/render.d.ts
@@ -1,4 +1,4 @@
1
- import { t as SqlResultSet } from "../../evaluate-Ddsxehrf.js";
1
+ import { t as SqlResultSet } from "../../evaluate-BnRKjJ1G.js";
2
2
  import { ContentDocument } from "document-schema.js";
3
3
  import { OdbReport } from "odf.js";
4
4
  //#region src/odb/report/render.d.ts
@@ -1,5 +1,5 @@
1
1
  import { n as HsqldbDecodeOptions } from "../../rowformat-Cl2exlEh.cjs";
2
- import { t as SqlResultSet } from "../../evaluate-3T-0yAut.cjs";
2
+ import { t as SqlResultSet } from "../../evaluate-CYYLwKtR.cjs";
3
3
  import { OdbQueryInfo, OdbReport, Package } from "odf.js";
4
4
  //#region src/odb/report/source.d.ts
5
5
  declare class OdbReportDataSourceError extends Error {
@@ -1,5 +1,5 @@
1
1
  import { n as HsqldbDecodeOptions } from "../../rowformat-Cl2exlEh.js";
2
- import { t as SqlResultSet } from "../../evaluate-Ddsxehrf.js";
2
+ import { t as SqlResultSet } from "../../evaluate-BnRKjJ1G.js";
3
3
  import { OdbQueryInfo, OdbReport, Package } from "odf.js";
4
4
  //#region src/odb/report/source.d.ts
5
5
  declare class OdbReportDataSourceError extends Error {
@@ -54,7 +54,7 @@ function likePatternToRegExp(pattern) {
54
54
  else source += character.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
55
55
  return new RegExp(`${source}$`);
56
56
  }
57
- function resolveName(candidates, ref, what, sql) {
57
+ function tryResolveName(candidates, ref, what, sql) {
58
58
  const exact = candidates.find((candidate) => candidate === ref.name);
59
59
  if (exact !== void 0) return exact;
60
60
  if (!ref.quoted) {
@@ -63,6 +63,10 @@ function resolveName(candidates, ref, what, sql) {
63
63
  const only = folded[0];
64
64
  if (only !== void 0) return only;
65
65
  }
66
+ }
67
+ function resolveName(candidates, ref, what, sql) {
68
+ const found = tryResolveName(candidates, ref, what, sql);
69
+ if (found !== void 0) return found;
66
70
  throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`${what} "${ref.name}" not found -- available: ${candidates.length === 0 ? "(none)" : candidates.join(", ")}`, sql);
67
71
  }
68
72
  function resolveTable(tables, ref, sql) {
@@ -81,7 +85,7 @@ function valueAtIndex(row, index, sql) {
81
85
  if (value === void 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`malformed joined row: it carries ${String(row.length)} values but index ${String(index)} was expected`, sql);
82
86
  return value;
83
87
  }
84
- function resolveColumnIndex(columns, candidateIndices, ref, sql) {
88
+ function tryResolveColumnIndex(columns, candidateIndices, ref, sql) {
85
89
  let firstExact;
86
90
  let exactCount = 0;
87
91
  for (const index of candidateIndices) if (columns[index]?.columnName === ref.name) {
@@ -102,15 +106,21 @@ function resolveColumnIndex(columns, candidateIndices, ref, sql) {
102
106
  if (foldedNames.length > 1) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous -- it matches ${foldedNames.join(", ")} case-insensitively`, sql);
103
107
  if (firstFolded !== void 0) return firstFolded;
104
108
  }
109
+ }
110
+ function resolveColumnIndex(columns, candidateIndices, ref, sql) {
111
+ const index = tryResolveColumnIndex(columns, candidateIndices, ref, sql);
112
+ if (index !== void 0) return index;
105
113
  throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column "${ref.name}" not found -- available: ${candidateIndices.length === 0 ? "(none)" : candidateIndices.map((index) => columns[index]?.columnName ?? "?").join(", ")}`, sql);
106
114
  }
107
115
  var ColumnResolver = class {
108
116
  sql;
117
+ outer;
109
118
  cache = /* @__PURE__ */ new Map();
110
119
  columns;
111
120
  qualifierNames;
112
- constructor(columns, sql) {
121
+ constructor(columns, sql, outer) {
113
122
  this.sql = sql;
123
+ this.outer = outer;
114
124
  this.columns = columns;
115
125
  this.qualifierNames = [...new Set(columns.flatMap((column) => column.qualifiers))];
116
126
  }
@@ -132,10 +142,27 @@ var ColumnResolver = class {
132
142
  this.cache.set(ref, index);
133
143
  return index;
134
144
  }
145
+ tryLocalIndexOf(ref) {
146
+ const cached = this.cache.get(ref);
147
+ if (cached !== void 0) return cached;
148
+ let candidateIndices;
149
+ if (ref.qualifier !== void 0) {
150
+ const qualifierName = tryResolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
151
+ if (qualifierName === void 0) return;
152
+ candidateIndices = this.columns.map((column, index) => column.qualifiers.includes(qualifierName) ? index : -1).filter((index) => index >= 0);
153
+ } else candidateIndices = this.columns.map((_column, index) => index);
154
+ const index = tryResolveColumnIndex(this.columns, candidateIndices, ref.column, this.sql);
155
+ if (index === void 0) return;
156
+ this.cache.set(ref, index);
157
+ return index;
158
+ }
135
159
  valueAt(index, row) {
136
160
  return valueAtIndex(row, index, this.sql);
137
161
  }
138
162
  valueOf(ref, row) {
163
+ const localIndex = this.tryLocalIndexOf(ref);
164
+ if (localIndex !== void 0) return this.valueAt(localIndex, row);
165
+ if (this.outer !== void 0) return this.outer.resolver.valueOf(ref, this.outer.row);
139
166
  return this.valueAt(this.indexOf(ref), row);
140
167
  }
141
168
  };
@@ -161,7 +188,7 @@ function evaluateIn(value, values, sql) {
161
188
  }
162
189
  return sawNull ? "unknown" : "false";
163
190
  }
164
- function evaluatePredicate(predicate, row, resolver, sql) {
191
+ function evaluatePredicate(predicate, row, resolver, tables, sql) {
165
192
  switch (predicate.kind) {
166
193
  case "comparison": {
167
194
  const left = operandValue(predicate.left, row, resolver);
@@ -181,6 +208,10 @@ function evaluatePredicate(predicate, row, resolver, sql) {
181
208
  const truth = evaluateIn(operandValue(predicate.operand, row, resolver), predicate.values, sql);
182
209
  return predicate.negated ? notTruth(truth) : truth;
183
210
  }
211
+ case "inSubquery": {
212
+ const truth = evaluateInSubquery(operandValue(predicate.operand, row, resolver), predicate.query, tables, resolver, row, sql);
213
+ return predicate.negated ? notTruth(truth) : truth;
214
+ }
184
215
  case "between": {
185
216
  const value = operandValue(predicate.operand, row, resolver);
186
217
  const lower = operandValue(predicate.lower, row, resolver);
@@ -189,11 +220,37 @@ function evaluatePredicate(predicate, row, resolver, sql) {
189
220
  const truth = andTruth(truthOfComparison(compareValues(value, lower, sql), ">="), truthOfComparison(compareValues(value, upper, sql), "<="));
190
221
  return predicate.negated ? notTruth(truth) : truth;
191
222
  }
192
- case "not": return notTruth(evaluatePredicate(predicate.predicate, row, resolver, sql));
193
- case "and": return andTruth(evaluatePredicate(predicate.left, row, resolver, sql), evaluatePredicate(predicate.right, row, resolver, sql));
194
- case "or": return orTruth(evaluatePredicate(predicate.left, row, resolver, sql), evaluatePredicate(predicate.right, row, resolver, sql));
223
+ case "exists": return evaluateExists(predicate.query, tables, resolver, row);
224
+ case "not": return notTruth(evaluatePredicate(predicate.predicate, row, resolver, tables, sql));
225
+ case "and": return andTruth(evaluatePredicate(predicate.left, row, resolver, tables, sql), evaluatePredicate(predicate.right, row, resolver, tables, sql));
226
+ case "or": return orTruth(evaluatePredicate(predicate.left, row, resolver, tables, sql), evaluatePredicate(predicate.right, row, resolver, tables, sql));
195
227
  }
196
228
  }
229
+ function evaluateInSubquery(value, query, tables, outerResolver, outerRow, sql) {
230
+ if (value.kind === "empty") return "unknown";
231
+ const result = evaluateSelectInScope(query, tables, {
232
+ resolver: outerResolver,
233
+ row: outerRow
234
+ });
235
+ if (result.columns.length !== 1) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`IN (SELECT ...) requires the subquery to produce exactly one column, but it produced ${String(result.columns.length)} (${result.columns.length === 0 ? "none" : result.columns.join(", ")})`, sql);
236
+ let sawNull = false;
237
+ for (const candidateRow of result.rows) {
238
+ const candidate = candidateRow[0];
239
+ if (candidate === void 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError("malformed subquery row: it declares one column but carries none", sql);
240
+ if (candidate.kind === "empty") {
241
+ sawNull = true;
242
+ continue;
243
+ }
244
+ if (compareValues(value, candidate, sql) === 0) return "true";
245
+ }
246
+ return sawNull ? "unknown" : "false";
247
+ }
248
+ function evaluateExists(query, tables, outerResolver, outerRow) {
249
+ return evaluateSelectInScope(query, tables, {
250
+ resolver: outerResolver,
251
+ row: outerRow
252
+ }).rows.length > 0 ? "true" : "false";
253
+ }
197
254
  function aggregateOverValues(aggregate, values, sql) {
198
255
  return require_odb_values.aggregateCellValues(aggregate, values, sqlFailure(sql));
199
256
  }
@@ -391,7 +448,7 @@ function mergeSharedColumns(rawColumns, rows, sharedPairs, leftColumnCount, sql)
391
448
  })
392
449
  };
393
450
  }
394
- function applyJoinClause(left, join, tables, sql) {
451
+ function applyJoinClause(left, join, tables, sql, outer) {
395
452
  const rightTable = resolveTable(tables, join.table, sql);
396
453
  const rightColumns = tableColumns(join.alias !== void 0 ? join.alias.name : rightTable.tableName, rightTable);
397
454
  const leftColumnCount = left.columns.length;
@@ -414,14 +471,14 @@ function applyJoinClause(left, join, tables, sql) {
414
471
  sharedPairs = computeNaturalSharedPairs(left.columns, rightColumns, sql);
415
472
  if (sharedPairs.length === 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError("NATURAL JOIN found no columns shared between the joined tables", sql);
416
473
  }
417
- const rawResolver = new ColumnResolver(rawColumns, sql);
474
+ const rawResolver = new ColumnResolver(rawColumns, sql, outer);
418
475
  const matchedLeft = /* @__PURE__ */ new Set();
419
476
  const matchedRight = /* @__PURE__ */ new Set();
420
477
  const paired = [];
421
478
  left.rows.forEach((leftRow, leftIndex) => {
422
479
  rightTable.rows.forEach((rightRow, rightIndex) => {
423
480
  const combined = [...leftRow, ...rightRow];
424
- if (onPredicate !== void 0 ? evaluatePredicate(onPredicate, combined, rawResolver, sql) === "true" : sharedPairs.length > 0 ? evaluateSharedColumnMatch(combined, sharedPairs, leftColumnCount, sql) : true) {
481
+ if (onPredicate !== void 0 ? evaluatePredicate(onPredicate, combined, rawResolver, tables, sql) === "true" : sharedPairs.length > 0 ? evaluateSharedColumnMatch(combined, sharedPairs, leftColumnCount, sql) : true) {
425
482
  paired.push(combined);
426
483
  matchedLeft.add(leftIndex);
427
484
  matchedRight.add(rightIndex);
@@ -440,21 +497,37 @@ function applyJoinClause(left, join, tables, sql) {
440
497
  rows: paired
441
498
  };
442
499
  }
443
- function joinTables(from, tables, sql) {
444
- const baseTable = resolveTable(tables, from.table, sql);
445
- let result = {
446
- columns: tableColumns(from.alias !== void 0 ? from.alias.name : baseTable.tableName, baseTable),
447
- rows: baseTable.rows
500
+ function resolveFromSource(source, tables, sql) {
501
+ if (source.kind === "table") {
502
+ const table = resolveTable(tables, source.table, sql);
503
+ return {
504
+ columns: tableColumns(source.alias !== void 0 ? source.alias.name : table.tableName, table),
505
+ rows: table.rows
506
+ };
507
+ }
508
+ const result = evaluateSelectInScope(source.query, tables, void 0);
509
+ return {
510
+ columns: result.columns.map((name) => ({
511
+ qualifiers: [source.alias.name],
512
+ columnName: name
513
+ })),
514
+ rows: result.rows
448
515
  };
449
- for (const join of from.joins) result = applyJoinClause(result, join, tables, sql);
516
+ }
517
+ function joinTables(from, tables, sql, outer) {
518
+ let result = resolveFromSource(from.source, tables, sql);
519
+ for (const join of from.joins) result = applyJoinClause(result, join, tables, sql, outer);
450
520
  return result;
451
521
  }
452
522
  function evaluateSelect(statement, tables) {
453
- const { columns, rows } = joinTables(statement.from, tables, statement.sql);
454
- const resolver = new ColumnResolver(columns, statement.sql);
523
+ return evaluateSelectInScope(statement, tables, void 0);
524
+ }
525
+ function evaluateSelectInScope(statement, tables, outer) {
526
+ const { columns, rows } = joinTables(statement.from, tables, statement.sql, outer);
527
+ const resolver = new ColumnResolver(columns, statement.sql, outer);
455
528
  const plan = planSelectList(statement, resolver);
456
529
  const where = statement.where;
457
- const matching = where === void 0 ? rows : rows.filter((row) => evaluatePredicate(where, row, resolver, statement.sql) === "true");
530
+ const matching = where === void 0 ? rows : rows.filter((row) => evaluatePredicate(where, row, resolver, tables, statement.sql) === "true");
458
531
  const hasAggregate = plan.some((item) => item.kind === "aggregate");
459
532
  if (statement.groupBy.length > 0 || hasAggregate) {
460
533
  if (statement.groupBy.length > 0 && statement.items.some((item) => item.kind === "star")) throw new require_odb_sql_errors.HsqldbSqlEvaluationError("SELECT * is not valid with GROUP BY -- name the grouped columns and the aggregates explicitly", statement.sql);
@@ -1,2 +1,2 @@
1
- import { n as evaluateSelect, t as SqlResultSet } from "../../evaluate-3T-0yAut.cjs";
1
+ import { n as evaluateSelect, t as SqlResultSet } from "../../evaluate-CYYLwKtR.cjs";
2
2
  export { SqlResultSet, evaluateSelect };
@@ -1,2 +1,2 @@
1
- import { n as evaluateSelect, t as SqlResultSet } from "../../evaluate-Ddsxehrf.js";
1
+ import { n as evaluateSelect, t as SqlResultSet } from "../../evaluate-BnRKjJ1G.js";
2
2
  export { SqlResultSet, evaluateSelect };
@@ -53,7 +53,7 @@ function likePatternToRegExp(pattern) {
53
53
  else source += character.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
54
54
  return new RegExp(`${source}$`);
55
55
  }
56
- function resolveName(candidates, ref, what, sql) {
56
+ function tryResolveName(candidates, ref, what, sql) {
57
57
  const exact = candidates.find((candidate) => candidate === ref.name);
58
58
  if (exact !== void 0) return exact;
59
59
  if (!ref.quoted) {
@@ -62,6 +62,10 @@ function resolveName(candidates, ref, what, sql) {
62
62
  const only = folded[0];
63
63
  if (only !== void 0) return only;
64
64
  }
65
+ }
66
+ function resolveName(candidates, ref, what, sql) {
67
+ const found = tryResolveName(candidates, ref, what, sql);
68
+ if (found !== void 0) return found;
65
69
  throw new HsqldbSqlEvaluationError(`${what} "${ref.name}" not found -- available: ${candidates.length === 0 ? "(none)" : candidates.join(", ")}`, sql);
66
70
  }
67
71
  function resolveTable(tables, ref, sql) {
@@ -80,7 +84,7 @@ function valueAtIndex(row, index, sql) {
80
84
  if (value === void 0) throw new HsqldbSqlEvaluationError(`malformed joined row: it carries ${String(row.length)} values but index ${String(index)} was expected`, sql);
81
85
  return value;
82
86
  }
83
- function resolveColumnIndex(columns, candidateIndices, ref, sql) {
87
+ function tryResolveColumnIndex(columns, candidateIndices, ref, sql) {
84
88
  let firstExact;
85
89
  let exactCount = 0;
86
90
  for (const index of candidateIndices) if (columns[index]?.columnName === ref.name) {
@@ -101,15 +105,21 @@ function resolveColumnIndex(columns, candidateIndices, ref, sql) {
101
105
  if (foldedNames.length > 1) throw new HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous -- it matches ${foldedNames.join(", ")} case-insensitively`, sql);
102
106
  if (firstFolded !== void 0) return firstFolded;
103
107
  }
108
+ }
109
+ function resolveColumnIndex(columns, candidateIndices, ref, sql) {
110
+ const index = tryResolveColumnIndex(columns, candidateIndices, ref, sql);
111
+ if (index !== void 0) return index;
104
112
  throw new HsqldbSqlEvaluationError(`column "${ref.name}" not found -- available: ${candidateIndices.length === 0 ? "(none)" : candidateIndices.map((index) => columns[index]?.columnName ?? "?").join(", ")}`, sql);
105
113
  }
106
114
  var ColumnResolver = class {
107
115
  sql;
116
+ outer;
108
117
  cache = /* @__PURE__ */ new Map();
109
118
  columns;
110
119
  qualifierNames;
111
- constructor(columns, sql) {
120
+ constructor(columns, sql, outer) {
112
121
  this.sql = sql;
122
+ this.outer = outer;
113
123
  this.columns = columns;
114
124
  this.qualifierNames = [...new Set(columns.flatMap((column) => column.qualifiers))];
115
125
  }
@@ -131,10 +141,27 @@ var ColumnResolver = class {
131
141
  this.cache.set(ref, index);
132
142
  return index;
133
143
  }
144
+ tryLocalIndexOf(ref) {
145
+ const cached = this.cache.get(ref);
146
+ if (cached !== void 0) return cached;
147
+ let candidateIndices;
148
+ if (ref.qualifier !== void 0) {
149
+ const qualifierName = tryResolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
150
+ if (qualifierName === void 0) return;
151
+ candidateIndices = this.columns.map((column, index) => column.qualifiers.includes(qualifierName) ? index : -1).filter((index) => index >= 0);
152
+ } else candidateIndices = this.columns.map((_column, index) => index);
153
+ const index = tryResolveColumnIndex(this.columns, candidateIndices, ref.column, this.sql);
154
+ if (index === void 0) return;
155
+ this.cache.set(ref, index);
156
+ return index;
157
+ }
134
158
  valueAt(index, row) {
135
159
  return valueAtIndex(row, index, this.sql);
136
160
  }
137
161
  valueOf(ref, row) {
162
+ const localIndex = this.tryLocalIndexOf(ref);
163
+ if (localIndex !== void 0) return this.valueAt(localIndex, row);
164
+ if (this.outer !== void 0) return this.outer.resolver.valueOf(ref, this.outer.row);
138
165
  return this.valueAt(this.indexOf(ref), row);
139
166
  }
140
167
  };
@@ -160,7 +187,7 @@ function evaluateIn(value, values, sql) {
160
187
  }
161
188
  return sawNull ? "unknown" : "false";
162
189
  }
163
- function evaluatePredicate(predicate, row, resolver, sql) {
190
+ function evaluatePredicate(predicate, row, resolver, tables, sql) {
164
191
  switch (predicate.kind) {
165
192
  case "comparison": {
166
193
  const left = operandValue(predicate.left, row, resolver);
@@ -180,6 +207,10 @@ function evaluatePredicate(predicate, row, resolver, sql) {
180
207
  const truth = evaluateIn(operandValue(predicate.operand, row, resolver), predicate.values, sql);
181
208
  return predicate.negated ? notTruth(truth) : truth;
182
209
  }
210
+ case "inSubquery": {
211
+ const truth = evaluateInSubquery(operandValue(predicate.operand, row, resolver), predicate.query, tables, resolver, row, sql);
212
+ return predicate.negated ? notTruth(truth) : truth;
213
+ }
183
214
  case "between": {
184
215
  const value = operandValue(predicate.operand, row, resolver);
185
216
  const lower = operandValue(predicate.lower, row, resolver);
@@ -188,11 +219,37 @@ function evaluatePredicate(predicate, row, resolver, sql) {
188
219
  const truth = andTruth(truthOfComparison(compareValues(value, lower, sql), ">="), truthOfComparison(compareValues(value, upper, sql), "<="));
189
220
  return predicate.negated ? notTruth(truth) : truth;
190
221
  }
191
- case "not": return notTruth(evaluatePredicate(predicate.predicate, row, resolver, sql));
192
- case "and": return andTruth(evaluatePredicate(predicate.left, row, resolver, sql), evaluatePredicate(predicate.right, row, resolver, sql));
193
- case "or": return orTruth(evaluatePredicate(predicate.left, row, resolver, sql), evaluatePredicate(predicate.right, row, resolver, sql));
222
+ case "exists": return evaluateExists(predicate.query, tables, resolver, row);
223
+ case "not": return notTruth(evaluatePredicate(predicate.predicate, row, resolver, tables, sql));
224
+ case "and": return andTruth(evaluatePredicate(predicate.left, row, resolver, tables, sql), evaluatePredicate(predicate.right, row, resolver, tables, sql));
225
+ case "or": return orTruth(evaluatePredicate(predicate.left, row, resolver, tables, sql), evaluatePredicate(predicate.right, row, resolver, tables, sql));
194
226
  }
195
227
  }
228
+ function evaluateInSubquery(value, query, tables, outerResolver, outerRow, sql) {
229
+ if (value.kind === "empty") return "unknown";
230
+ const result = evaluateSelectInScope(query, tables, {
231
+ resolver: outerResolver,
232
+ row: outerRow
233
+ });
234
+ if (result.columns.length !== 1) throw new HsqldbSqlEvaluationError(`IN (SELECT ...) requires the subquery to produce exactly one column, but it produced ${String(result.columns.length)} (${result.columns.length === 0 ? "none" : result.columns.join(", ")})`, sql);
235
+ let sawNull = false;
236
+ for (const candidateRow of result.rows) {
237
+ const candidate = candidateRow[0];
238
+ if (candidate === void 0) throw new HsqldbSqlEvaluationError("malformed subquery row: it declares one column but carries none", sql);
239
+ if (candidate.kind === "empty") {
240
+ sawNull = true;
241
+ continue;
242
+ }
243
+ if (compareValues(value, candidate, sql) === 0) return "true";
244
+ }
245
+ return sawNull ? "unknown" : "false";
246
+ }
247
+ function evaluateExists(query, tables, outerResolver, outerRow) {
248
+ return evaluateSelectInScope(query, tables, {
249
+ resolver: outerResolver,
250
+ row: outerRow
251
+ }).rows.length > 0 ? "true" : "false";
252
+ }
196
253
  function aggregateOverValues(aggregate, values, sql) {
197
254
  return aggregateCellValues(aggregate, values, sqlFailure(sql));
198
255
  }
@@ -390,7 +447,7 @@ function mergeSharedColumns(rawColumns, rows, sharedPairs, leftColumnCount, sql)
390
447
  })
391
448
  };
392
449
  }
393
- function applyJoinClause(left, join, tables, sql) {
450
+ function applyJoinClause(left, join, tables, sql, outer) {
394
451
  const rightTable = resolveTable(tables, join.table, sql);
395
452
  const rightColumns = tableColumns(join.alias !== void 0 ? join.alias.name : rightTable.tableName, rightTable);
396
453
  const leftColumnCount = left.columns.length;
@@ -413,14 +470,14 @@ function applyJoinClause(left, join, tables, sql) {
413
470
  sharedPairs = computeNaturalSharedPairs(left.columns, rightColumns, sql);
414
471
  if (sharedPairs.length === 0) throw new HsqldbSqlEvaluationError("NATURAL JOIN found no columns shared between the joined tables", sql);
415
472
  }
416
- const rawResolver = new ColumnResolver(rawColumns, sql);
473
+ const rawResolver = new ColumnResolver(rawColumns, sql, outer);
417
474
  const matchedLeft = /* @__PURE__ */ new Set();
418
475
  const matchedRight = /* @__PURE__ */ new Set();
419
476
  const paired = [];
420
477
  left.rows.forEach((leftRow, leftIndex) => {
421
478
  rightTable.rows.forEach((rightRow, rightIndex) => {
422
479
  const combined = [...leftRow, ...rightRow];
423
- if (onPredicate !== void 0 ? evaluatePredicate(onPredicate, combined, rawResolver, sql) === "true" : sharedPairs.length > 0 ? evaluateSharedColumnMatch(combined, sharedPairs, leftColumnCount, sql) : true) {
480
+ if (onPredicate !== void 0 ? evaluatePredicate(onPredicate, combined, rawResolver, tables, sql) === "true" : sharedPairs.length > 0 ? evaluateSharedColumnMatch(combined, sharedPairs, leftColumnCount, sql) : true) {
424
481
  paired.push(combined);
425
482
  matchedLeft.add(leftIndex);
426
483
  matchedRight.add(rightIndex);
@@ -439,21 +496,37 @@ function applyJoinClause(left, join, tables, sql) {
439
496
  rows: paired
440
497
  };
441
498
  }
442
- function joinTables(from, tables, sql) {
443
- const baseTable = resolveTable(tables, from.table, sql);
444
- let result = {
445
- columns: tableColumns(from.alias !== void 0 ? from.alias.name : baseTable.tableName, baseTable),
446
- rows: baseTable.rows
499
+ function resolveFromSource(source, tables, sql) {
500
+ if (source.kind === "table") {
501
+ const table = resolveTable(tables, source.table, sql);
502
+ return {
503
+ columns: tableColumns(source.alias !== void 0 ? source.alias.name : table.tableName, table),
504
+ rows: table.rows
505
+ };
506
+ }
507
+ const result = evaluateSelectInScope(source.query, tables, void 0);
508
+ return {
509
+ columns: result.columns.map((name) => ({
510
+ qualifiers: [source.alias.name],
511
+ columnName: name
512
+ })),
513
+ rows: result.rows
447
514
  };
448
- for (const join of from.joins) result = applyJoinClause(result, join, tables, sql);
515
+ }
516
+ function joinTables(from, tables, sql, outer) {
517
+ let result = resolveFromSource(from.source, tables, sql);
518
+ for (const join of from.joins) result = applyJoinClause(result, join, tables, sql, outer);
449
519
  return result;
450
520
  }
451
521
  function evaluateSelect(statement, tables) {
452
- const { columns, rows } = joinTables(statement.from, tables, statement.sql);
453
- const resolver = new ColumnResolver(columns, statement.sql);
522
+ return evaluateSelectInScope(statement, tables, void 0);
523
+ }
524
+ function evaluateSelectInScope(statement, tables, outer) {
525
+ const { columns, rows } = joinTables(statement.from, tables, statement.sql, outer);
526
+ const resolver = new ColumnResolver(columns, statement.sql, outer);
454
527
  const plan = planSelectList(statement, resolver);
455
528
  const where = statement.where;
456
- const matching = where === void 0 ? rows : rows.filter((row) => evaluatePredicate(where, row, resolver, statement.sql) === "true");
529
+ const matching = where === void 0 ? rows : rows.filter((row) => evaluatePredicate(where, row, resolver, tables, statement.sql) === "true");
457
530
  const hasAggregate = plan.some((item) => item.kind === "aggregate");
458
531
  if (statement.groupBy.length > 0 || hasAggregate) {
459
532
  if (statement.groupBy.length > 0 && statement.items.some((item) => item.kind === "star")) throw new HsqldbSqlEvaluationError("SELECT * is not valid with GROUP BY -- name the grouped columns and the aggregates explicitly", statement.sql);
@@ -29,7 +29,6 @@ const OUT_OF_SCOPE_KEYWORDS = /* @__PURE__ */ new Map([
29
29
  ["THEN", "a CASE expression"],
30
30
  ["ELSE", "a CASE expression"],
31
31
  ["END", "a CASE expression"],
32
- ["EXISTS", "an EXISTS subquery"],
33
32
  ["ANY", "a quantified subquery predicate (ANY)"],
34
33
  ["SOME", "a quantified subquery predicate (SOME)"],
35
34
  ["WITH", "a common table expression (WITH)"],
@@ -60,7 +59,6 @@ function rejectOutOfScopeConstructs(tokens, sql) {
60
59
  if (token.kind === "keyword") {
61
60
  const construct = OUT_OF_SCOPE_KEYWORDS.get(token.keyword);
62
61
  if (construct !== void 0) throw new require_odb_sql_errors.HsqldbSqlUnsupportedError(construct, sql);
63
- if (token.keyword === "SELECT" && index > 0) throw new require_odb_sql_errors.HsqldbSqlUnsupportedError("a subquery", sql);
64
62
  return;
65
63
  }
66
64
  if (token.kind === "identifier") {
@@ -241,6 +239,16 @@ var SqlParser = class {
241
239
  }
242
240
  parseInList(operand, negated) {
243
241
  this.takePunctuation("(");
242
+ if (this.atKeyword("SELECT")) {
243
+ const query = this.parseSelectBody();
244
+ this.takePunctuation(")");
245
+ return {
246
+ kind: "inSubquery",
247
+ operand,
248
+ query,
249
+ negated
250
+ };
251
+ }
244
252
  const values = [];
245
253
  for (;;) {
246
254
  if (this.peek().kind === "identifier") throw new require_odb_sql_errors.HsqldbSqlUnsupportedError("a column reference inside an IN list", this.sql);
@@ -347,6 +355,16 @@ var SqlParser = class {
347
355
  this.takePunctuation(")");
348
356
  return predicate;
349
357
  }
358
+ if (this.atKeyword("EXISTS")) {
359
+ this.advance();
360
+ this.takePunctuation("(");
361
+ const query = this.parseSelectBody();
362
+ this.takePunctuation(")");
363
+ return {
364
+ kind: "exists",
365
+ query
366
+ };
367
+ }
350
368
  return this.parsePostfix(this.parseOperand());
351
369
  }
352
370
  parseNot() {
@@ -448,6 +466,31 @@ var SqlParser = class {
448
466
  }
449
467
  if (this.peek().kind === "identifier") return this.takeName("a table alias");
450
468
  }
469
+ parseRequiredAlias(what) {
470
+ if (this.atKeyword("AS")) {
471
+ this.advance();
472
+ return this.takeName(`${what} after AS`);
473
+ }
474
+ return this.takeName(what);
475
+ }
476
+ parseFromSource() {
477
+ if (this.atPunctuation("(")) {
478
+ this.advance();
479
+ const query = this.parseSelectBody();
480
+ this.takePunctuation(")");
481
+ return {
482
+ kind: "derived",
483
+ query,
484
+ alias: this.parseRequiredAlias("a derived table alias")
485
+ };
486
+ }
487
+ const { table, alias } = this.parseTableRefWithAlias();
488
+ return {
489
+ kind: "table",
490
+ table,
491
+ alias
492
+ };
493
+ }
451
494
  parseJoinKind() {
452
495
  if (this.atKeyword("INNER")) {
453
496
  this.advance();
@@ -523,16 +566,12 @@ var SqlParser = class {
523
566
  }
524
567
  return joins;
525
568
  }
526
- parseStatement() {
527
- const first = this.peek();
528
- if (!(first.kind === "keyword" && first.keyword === "SELECT")) this.fail("keyword SELECT");
529
- this.advance();
569
+ parseSelectBody() {
570
+ this.takeKeyword("SELECT");
530
571
  const items = this.parseSelectList();
531
572
  this.takeKeyword("FROM");
532
- const { table, alias } = this.parseTableRefWithAlias();
533
573
  const from = {
534
- table,
535
- alias,
574
+ source: this.parseFromSource(),
536
575
  joins: this.parseJoins()
537
576
  };
538
577
  if (this.atPunctuation(",")) throw new require_odb_sql_errors.HsqldbSqlUnsupportedError("a comma-separated FROM list (write an explicit JOIN instead)", this.sql);
@@ -543,8 +582,6 @@ var SqlParser = class {
543
582
  }
544
583
  const groupBy = this.atKeyword("GROUP") ? this.parseGroupBy() : [];
545
584
  const orderBy = this.atKeyword("ORDER") ? this.parseOrderBy() : [];
546
- if (this.atPunctuation(";")) this.advance();
547
- if (this.peek().kind !== "end") this.fail("end of statement");
548
585
  return {
549
586
  sql: this.sql,
550
587
  items,
@@ -554,6 +591,12 @@ var SqlParser = class {
554
591
  orderBy
555
592
  };
556
593
  }
594
+ parseStatement() {
595
+ const statement = this.parseSelectBody();
596
+ if (this.atPunctuation(";")) this.advance();
597
+ if (this.peek().kind !== "end") this.fail("end of statement");
598
+ return statement;
599
+ }
557
600
  };
558
601
  function parseSelect(sql) {
559
602
  return new SqlParser(sql).parseStatement();
@@ -1,2 +1,2 @@
1
- import { a as SqlJoinClause, c as SqlLiteral, d as SqlOrderByTerm, f as SqlPredicate, g as parseSelect, h as SqlSortDirection, i as SqlFromClause, l as SqlNameRef, m as SqlSelectStatement, n as SqlAggregateFunction, o as SqlJoinCondition, p as SqlSelectItem, r as SqlColumnRef, s as SqlJoinKind, t as SqlAggregateArgument, u as SqlOperand } from "../../parser-h1n0BflA.cjs";
2
- export { SqlAggregateArgument, SqlAggregateFunction, SqlColumnRef, SqlFromClause, SqlJoinClause, SqlJoinCondition, SqlJoinKind, SqlLiteral, SqlNameRef, SqlOperand, SqlOrderByTerm, SqlPredicate, SqlSelectItem, SqlSelectStatement, SqlSortDirection, parseSelect };
1
+ import { _ as parseSelect, a as SqlFromSource, c as SqlJoinKind, d as SqlOperand, f as SqlOrderByTerm, g as SqlSortDirection, h as SqlSelectStatement, i as SqlFromClause, l as SqlLiteral, m as SqlSelectItem, n as SqlAggregateFunction, o as SqlJoinClause, p as SqlPredicate, r as SqlColumnRef, s as SqlJoinCondition, t as SqlAggregateArgument, u as SqlNameRef } from "../../parser-Oq6zLQsu.cjs";
2
+ export { SqlAggregateArgument, SqlAggregateFunction, SqlColumnRef, SqlFromClause, SqlFromSource, SqlJoinClause, SqlJoinCondition, SqlJoinKind, SqlLiteral, SqlNameRef, SqlOperand, SqlOrderByTerm, SqlPredicate, SqlSelectItem, SqlSelectStatement, SqlSortDirection, parseSelect };
@@ -1,2 +1,2 @@
1
- import { a as SqlJoinClause, c as SqlLiteral, d as SqlOrderByTerm, f as SqlPredicate, g as parseSelect, h as SqlSortDirection, i as SqlFromClause, l as SqlNameRef, m as SqlSelectStatement, n as SqlAggregateFunction, o as SqlJoinCondition, p as SqlSelectItem, r as SqlColumnRef, s as SqlJoinKind, t as SqlAggregateArgument, u as SqlOperand } from "../../parser-D-9P_0Qd.js";
2
- export { SqlAggregateArgument, SqlAggregateFunction, SqlColumnRef, SqlFromClause, SqlJoinClause, SqlJoinCondition, SqlJoinKind, SqlLiteral, SqlNameRef, SqlOperand, SqlOrderByTerm, SqlPredicate, SqlSelectItem, SqlSelectStatement, SqlSortDirection, parseSelect };
1
+ import { _ as parseSelect, a as SqlFromSource, c as SqlJoinKind, d as SqlOperand, f as SqlOrderByTerm, g as SqlSortDirection, h as SqlSelectStatement, i as SqlFromClause, l as SqlLiteral, m as SqlSelectItem, n as SqlAggregateFunction, o as SqlJoinClause, p as SqlPredicate, r as SqlColumnRef, s as SqlJoinCondition, t as SqlAggregateArgument, u as SqlNameRef } from "../../parser-CfMvvMT1.js";
2
+ export { SqlAggregateArgument, SqlAggregateFunction, SqlColumnRef, SqlFromClause, SqlFromSource, SqlJoinClause, SqlJoinCondition, SqlJoinKind, SqlLiteral, SqlNameRef, SqlOperand, SqlOrderByTerm, SqlPredicate, SqlSelectItem, SqlSelectStatement, SqlSortDirection, parseSelect };
@@ -28,7 +28,6 @@ const OUT_OF_SCOPE_KEYWORDS = /* @__PURE__ */ new Map([
28
28
  ["THEN", "a CASE expression"],
29
29
  ["ELSE", "a CASE expression"],
30
30
  ["END", "a CASE expression"],
31
- ["EXISTS", "an EXISTS subquery"],
32
31
  ["ANY", "a quantified subquery predicate (ANY)"],
33
32
  ["SOME", "a quantified subquery predicate (SOME)"],
34
33
  ["WITH", "a common table expression (WITH)"],
@@ -59,7 +58,6 @@ function rejectOutOfScopeConstructs(tokens, sql) {
59
58
  if (token.kind === "keyword") {
60
59
  const construct = OUT_OF_SCOPE_KEYWORDS.get(token.keyword);
61
60
  if (construct !== void 0) throw new HsqldbSqlUnsupportedError(construct, sql);
62
- if (token.keyword === "SELECT" && index > 0) throw new HsqldbSqlUnsupportedError("a subquery", sql);
63
61
  return;
64
62
  }
65
63
  if (token.kind === "identifier") {
@@ -240,6 +238,16 @@ var SqlParser = class {
240
238
  }
241
239
  parseInList(operand, negated) {
242
240
  this.takePunctuation("(");
241
+ if (this.atKeyword("SELECT")) {
242
+ const query = this.parseSelectBody();
243
+ this.takePunctuation(")");
244
+ return {
245
+ kind: "inSubquery",
246
+ operand,
247
+ query,
248
+ negated
249
+ };
250
+ }
243
251
  const values = [];
244
252
  for (;;) {
245
253
  if (this.peek().kind === "identifier") throw new HsqldbSqlUnsupportedError("a column reference inside an IN list", this.sql);
@@ -346,6 +354,16 @@ var SqlParser = class {
346
354
  this.takePunctuation(")");
347
355
  return predicate;
348
356
  }
357
+ if (this.atKeyword("EXISTS")) {
358
+ this.advance();
359
+ this.takePunctuation("(");
360
+ const query = this.parseSelectBody();
361
+ this.takePunctuation(")");
362
+ return {
363
+ kind: "exists",
364
+ query
365
+ };
366
+ }
349
367
  return this.parsePostfix(this.parseOperand());
350
368
  }
351
369
  parseNot() {
@@ -447,6 +465,31 @@ var SqlParser = class {
447
465
  }
448
466
  if (this.peek().kind === "identifier") return this.takeName("a table alias");
449
467
  }
468
+ parseRequiredAlias(what) {
469
+ if (this.atKeyword("AS")) {
470
+ this.advance();
471
+ return this.takeName(`${what} after AS`);
472
+ }
473
+ return this.takeName(what);
474
+ }
475
+ parseFromSource() {
476
+ if (this.atPunctuation("(")) {
477
+ this.advance();
478
+ const query = this.parseSelectBody();
479
+ this.takePunctuation(")");
480
+ return {
481
+ kind: "derived",
482
+ query,
483
+ alias: this.parseRequiredAlias("a derived table alias")
484
+ };
485
+ }
486
+ const { table, alias } = this.parseTableRefWithAlias();
487
+ return {
488
+ kind: "table",
489
+ table,
490
+ alias
491
+ };
492
+ }
450
493
  parseJoinKind() {
451
494
  if (this.atKeyword("INNER")) {
452
495
  this.advance();
@@ -522,16 +565,12 @@ var SqlParser = class {
522
565
  }
523
566
  return joins;
524
567
  }
525
- parseStatement() {
526
- const first = this.peek();
527
- if (!(first.kind === "keyword" && first.keyword === "SELECT")) this.fail("keyword SELECT");
528
- this.advance();
568
+ parseSelectBody() {
569
+ this.takeKeyword("SELECT");
529
570
  const items = this.parseSelectList();
530
571
  this.takeKeyword("FROM");
531
- const { table, alias } = this.parseTableRefWithAlias();
532
572
  const from = {
533
- table,
534
- alias,
573
+ source: this.parseFromSource(),
535
574
  joins: this.parseJoins()
536
575
  };
537
576
  if (this.atPunctuation(",")) throw new HsqldbSqlUnsupportedError("a comma-separated FROM list (write an explicit JOIN instead)", this.sql);
@@ -542,8 +581,6 @@ var SqlParser = class {
542
581
  }
543
582
  const groupBy = this.atKeyword("GROUP") ? this.parseGroupBy() : [];
544
583
  const orderBy = this.atKeyword("ORDER") ? this.parseOrderBy() : [];
545
- if (this.atPunctuation(";")) this.advance();
546
- if (this.peek().kind !== "end") this.fail("end of statement");
547
584
  return {
548
585
  sql: this.sql,
549
586
  items,
@@ -553,6 +590,12 @@ var SqlParser = class {
553
590
  orderBy
554
591
  };
555
592
  }
593
+ parseStatement() {
594
+ const statement = this.parseSelectBody();
595
+ if (this.atPunctuation(";")) this.advance();
596
+ if (this.peek().kind !== "end") this.fail("end of statement");
597
+ return statement;
598
+ }
556
599
  };
557
600
  function parseSelect(sql) {
558
601
  return new SqlParser(sql).parseStatement();
@@ -48,12 +48,20 @@ type SqlPredicate = {
48
48
  readonly operand: SqlOperand;
49
49
  readonly values: readonly SqlLiteral[];
50
50
  readonly negated: boolean;
51
+ } | {
52
+ readonly kind: "inSubquery";
53
+ readonly operand: SqlOperand;
54
+ readonly query: SqlSelectStatement;
55
+ readonly negated: boolean;
51
56
  } | {
52
57
  readonly kind: "between";
53
58
  readonly operand: SqlOperand;
54
59
  readonly lower: SqlOperand;
55
60
  readonly upper: SqlOperand;
56
61
  readonly negated: boolean;
62
+ } | {
63
+ readonly kind: "exists";
64
+ readonly query: SqlSelectStatement;
57
65
  } | {
58
66
  readonly kind: "not";
59
67
  readonly predicate: SqlPredicate;
@@ -106,9 +114,17 @@ interface SqlJoinClause {
106
114
  readonly alias: SqlNameRef | undefined;
107
115
  readonly condition: SqlJoinCondition;
108
116
  }
109
- interface SqlFromClause {
117
+ type SqlFromSource = {
118
+ readonly kind: "table";
110
119
  readonly table: SqlNameRef;
111
120
  readonly alias: SqlNameRef | undefined;
121
+ } | {
122
+ readonly kind: "derived";
123
+ readonly query: SqlSelectStatement;
124
+ readonly alias: SqlNameRef;
125
+ };
126
+ interface SqlFromClause {
127
+ readonly source: SqlFromSource;
112
128
  readonly joins: readonly SqlJoinClause[];
113
129
  }
114
130
  interface SqlSelectStatement {
@@ -121,4 +137,4 @@ interface SqlSelectStatement {
121
137
  }
122
138
  declare function parseSelect(sql: string): SqlSelectStatement;
123
139
  //#endregion
124
- export { SqlJoinClause as a, SqlLiteral as c, SqlOrderByTerm as d, SqlPredicate as f, parseSelect as g, SqlSortDirection as h, SqlFromClause as i, SqlNameRef as l, SqlSelectStatement as m, SqlAggregateFunction as n, SqlJoinCondition as o, SqlSelectItem as p, SqlColumnRef as r, SqlJoinKind as s, SqlAggregateArgument as t, SqlOperand as u };
140
+ export { parseSelect as _, SqlFromSource as a, SqlJoinKind as c, SqlOperand as d, SqlOrderByTerm as f, SqlSortDirection as g, SqlSelectStatement as h, SqlFromClause as i, SqlLiteral as l, SqlSelectItem as m, SqlAggregateFunction as n, SqlJoinClause as o, SqlPredicate as p, SqlColumnRef as r, SqlJoinCondition as s, SqlAggregateArgument as t, SqlNameRef as u };
@@ -48,12 +48,20 @@ type SqlPredicate = {
48
48
  readonly operand: SqlOperand;
49
49
  readonly values: readonly SqlLiteral[];
50
50
  readonly negated: boolean;
51
+ } | {
52
+ readonly kind: "inSubquery";
53
+ readonly operand: SqlOperand;
54
+ readonly query: SqlSelectStatement;
55
+ readonly negated: boolean;
51
56
  } | {
52
57
  readonly kind: "between";
53
58
  readonly operand: SqlOperand;
54
59
  readonly lower: SqlOperand;
55
60
  readonly upper: SqlOperand;
56
61
  readonly negated: boolean;
62
+ } | {
63
+ readonly kind: "exists";
64
+ readonly query: SqlSelectStatement;
57
65
  } | {
58
66
  readonly kind: "not";
59
67
  readonly predicate: SqlPredicate;
@@ -106,9 +114,17 @@ interface SqlJoinClause {
106
114
  readonly alias: SqlNameRef | undefined;
107
115
  readonly condition: SqlJoinCondition;
108
116
  }
109
- interface SqlFromClause {
117
+ type SqlFromSource = {
118
+ readonly kind: "table";
110
119
  readonly table: SqlNameRef;
111
120
  readonly alias: SqlNameRef | undefined;
121
+ } | {
122
+ readonly kind: "derived";
123
+ readonly query: SqlSelectStatement;
124
+ readonly alias: SqlNameRef;
125
+ };
126
+ interface SqlFromClause {
127
+ readonly source: SqlFromSource;
112
128
  readonly joins: readonly SqlJoinClause[];
113
129
  }
114
130
  interface SqlSelectStatement {
@@ -121,4 +137,4 @@ interface SqlSelectStatement {
121
137
  }
122
138
  declare function parseSelect(sql: string): SqlSelectStatement;
123
139
  //#endregion
124
- export { SqlJoinClause as a, SqlLiteral as c, SqlOrderByTerm as d, SqlPredicate as f, parseSelect as g, SqlSortDirection as h, SqlFromClause as i, SqlNameRef as l, SqlSelectStatement as m, SqlAggregateFunction as n, SqlJoinCondition as o, SqlSelectItem as p, SqlColumnRef as r, SqlJoinKind as s, SqlAggregateArgument as t, SqlOperand as u };
140
+ export { parseSelect as _, SqlFromSource as a, SqlJoinKind as c, SqlOperand as d, SqlOrderByTerm as f, SqlSortDirection as g, SqlSelectStatement as h, SqlFromClause as i, SqlLiteral as l, SqlSelectItem as m, SqlAggregateFunction as n, SqlJoinClause as o, SqlPredicate as p, SqlColumnRef as r, SqlJoinCondition as s, SqlAggregateArgument as t, SqlNameRef as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "7.9.1",
3
+ "version": "7.10.0",
4
4
  "description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {