{"version":3,"file":"IdentifyTextUtils.mjs","sources":["../../../src/providers/IdentifyTextUtils.ts"],"sourcesContent":["import { makeCamelCase, makeCamelCaseArray } from './Utils';\nfunction getBoundingBox(geometry) {\n    return makeCamelCase(geometry?.BoundingBox);\n}\nfunction getPolygon(geometry) {\n    if (!geometry?.Polygon)\n        return undefined;\n    return makeCamelCaseArray(Array.from(geometry.Polygon));\n}\n/**\n * Organizes blocks from Rekognition API to each of the categories and and structures\n * their data accordingly.\n * @param {BlockList} source - Array containing blocks returned from Textract API.\n * @return {IdentifyTextOutput} -  Object that categorizes each block and its information.\n */\nexport function categorizeRekognitionBlocks(blocks) {\n    // Skeleton IdentifyText API response. We will populate it as we iterate through blocks.\n    const response = {\n        text: {\n            fullText: '',\n            words: [],\n            lines: [],\n            linesDetailed: [],\n        },\n    };\n    // We categorize each block by running a forEach loop through them.\n    blocks.forEach(block => {\n        switch (block.Type) {\n            case 'LINE':\n                if (block.DetectedText) {\n                    response.text.lines.push(block.DetectedText);\n                }\n                response.text.linesDetailed.push({\n                    text: block.DetectedText,\n                    polygon: getPolygon(block.Geometry),\n                    boundingBox: getBoundingBox(block.Geometry),\n                    page: undefined, // rekognition doesn't have this info\n                });\n                break;\n            case 'WORD':\n                response.text.fullText += block.DetectedText + ' ';\n                response.text.words.push({\n                    text: block.DetectedText,\n                    polygon: getPolygon(block.Geometry),\n                    boundingBox: getBoundingBox(block.Geometry),\n                });\n                break;\n        }\n    });\n    // remove trailing space of fullText\n    response.text.fullText = response.text.fullText.substr(0, response.text.fullText.length - 1);\n    return response;\n}\n/**\n * Organizes blocks from Textract API to each of the categories and and structures\n * their data accordingly.\n * @param {BlockList} source - Array containing blocks returned from Textract API.\n * @return {IdentifyTextOutput} -  Object that categorizes each block and its information.\n */\nexport function categorizeTextractBlocks(blocks) {\n    // Skeleton IdentifyText API response. We will populate it as we iterate through blocks.\n    const response = {\n        text: {\n            fullText: '',\n            words: [],\n            lines: [],\n            linesDetailed: [],\n        },\n    };\n    // if blocks is an empty array, ie. textract did not detect anything, return empty response.\n    if (blocks.length === 0)\n        return response;\n    /**\n     * We categorize each of the blocks by running a forEach loop through them.\n     *\n     * For complex structures such as Tables and KeyValue, we need to trasverse through their children. To do so,\n     * we will post-process them after the for each loop. We do this by storing table and keyvalues in arrays and\n     * mapping other blocks in `blockMap` (id to block) so we can reference them easily later.\n     *\n     * Note that we do not map `WORD` and `TABLE` in `blockMap` because they will not be referenced by any other\n     * block except the Page block.\n     */\n    const tableBlocks = [];\n    const keyValueBlocks = [];\n    const blockMap = {};\n    blocks.forEach(block => {\n        switch (block.BlockType) {\n            case 'LINE':\n                if (block.Text) {\n                    response.text.lines.push(block.Text);\n                }\n                response.text.linesDetailed.push({\n                    text: block.Text,\n                    polygon: getPolygon(block.Geometry),\n                    boundingBox: getBoundingBox(block.Geometry),\n                    page: block.Page,\n                });\n                break;\n            case 'WORD':\n                response.text.fullText += block.Text + ' ';\n                response.text.words.push({\n                    text: block.Text,\n                    polygon: getPolygon(block.Geometry),\n                    boundingBox: getBoundingBox(block.Geometry),\n                });\n                if (block.Id) {\n                    blockMap[block.Id] = block;\n                }\n                break;\n            case 'SELECTION_ELEMENT': {\n                const selectionStatus = block.SelectionStatus === 'SELECTED';\n                if (!response.text.selections)\n                    response.text.selections = [];\n                response.text.selections.push({\n                    selected: selectionStatus,\n                    polygon: getPolygon(block.Geometry),\n                    boundingBox: getBoundingBox(block.Geometry),\n                });\n                if (block.Id) {\n                    blockMap[block.Id] = block;\n                }\n                break;\n            }\n            case 'TABLE':\n                tableBlocks.push(block);\n                break;\n            case 'KEY_VALUE_SET':\n                keyValueBlocks.push(block);\n                if (block.Id) {\n                    blockMap[block.Id] = block;\n                }\n                break;\n            default:\n                if (block.Id) {\n                    blockMap[block.Id] = block;\n                }\n        }\n    });\n    // remove trailing space in fullText\n    response.text.fullText = response.text.fullText.substr(0, response.text.fullText.length - 1);\n    // Post-process complex structures if they exist.\n    if (tableBlocks.length !== 0) {\n        const tableResponse = [];\n        tableBlocks.forEach(table => {\n            tableResponse.push(constructTable(table, blockMap));\n        });\n        response.text.tables = tableResponse;\n    }\n    if (keyValueBlocks.length !== 0) {\n        const keyValueResponse = [];\n        keyValueBlocks.forEach(keyValue => {\n            // We need the KeyValue blocks of EntityType = `KEY`, which has both key and value references.\n            if (keyValue.EntityTypes) {\n                const entityTypes = Array.from(keyValue.EntityTypes);\n                if (entityTypes.indexOf('KEY') !== -1) {\n                    keyValueResponse.push(constructKeyValue(keyValue, blockMap));\n                }\n            }\n        });\n        response.text.keyValues = keyValueResponse;\n    }\n    return response;\n}\n/**\n * Constructs a table object using data from its children cells.\n * @param {Block} table - Table block that has references (`Relationships`) to its cells\n * @param {[id: string]: Block} blockMap - Maps block Ids to blocks.\n */\nfunction constructTable(table, blockMap) {\n    const tableMatrix = [];\n    // visit each of the cell associated with the table's relationship.\n    for (const tableRelation of table.Relationships ?? []) {\n        for (const cellId of tableRelation.Ids ?? []) {\n            const cellBlock = blockMap[cellId];\n            if (cellBlock.RowIndex && cellBlock.ColumnIndex) {\n                const row = cellBlock.RowIndex - 1; // textract starts indexing at 1, so subtract it by 1.\n                const col = cellBlock.ColumnIndex - 1; // textract starts indexing at 1, so subtract it by 1.\n                // extract data contained inside the cell.\n                const content = extractContentsFromBlock(cellBlock, blockMap);\n                const cell = {\n                    text: content.text,\n                    boundingBox: getBoundingBox(cellBlock.Geometry),\n                    polygon: getPolygon(cellBlock.Geometry),\n                    selected: content.selected,\n                    rowSpan: cellBlock.RowSpan,\n                    columnSpan: cellBlock.ColumnSpan,\n                };\n                if (!tableMatrix[row])\n                    tableMatrix[row] = [];\n                tableMatrix[row][col] = cell;\n            }\n        }\n    }\n    const rowSize = tableMatrix.length;\n    const columnSize = tableMatrix[0].length;\n    const boundingBox = getBoundingBox(table.Geometry);\n    const polygon = getPolygon(table.Geometry);\n    // Note that we leave spanned cells undefined for distinction\n    return {\n        size: { rows: rowSize, columns: columnSize },\n        table: tableMatrix,\n        boundingBox,\n        polygon,\n    };\n}\n/**\n * Constructs a key value object from its children key and value blocks.\n * @param {Block} KeyValue - KeyValue block that has references (`Relationships`) to its children.\n * @param {[id: string]: Block} blockMap - Maps block Ids to blocks.\n */\nfunction constructKeyValue(keyBlock, blockMap) {\n    let keyText = '';\n    let valueText = '';\n    let valueSelected = false;\n    for (const keyValueRelation of keyBlock.Relationships ?? []) {\n        if (keyValueRelation.Type === 'CHILD') {\n            // relation refers to key\n            const contents = extractContentsFromBlock(keyBlock, blockMap);\n            keyText = contents.text ?? '';\n        }\n        else if (keyValueRelation.Type === 'VALUE') {\n            // relation refers to value\n            for (const valueId of keyValueRelation.Ids ?? []) {\n                const valueBlock = blockMap[valueId];\n                const contents = extractContentsFromBlock(valueBlock, blockMap);\n                valueText = contents.text ?? '';\n                if (contents.selected != null)\n                    valueSelected = contents.selected;\n            }\n        }\n    }\n    return {\n        key: keyText,\n        value: { text: valueText, selected: valueSelected },\n        polygon: getPolygon(keyBlock.Geometry),\n        boundingBox: getBoundingBox(keyBlock.Geometry),\n    };\n}\n/**\n * Extracts text and selection from input block's children.\n * @param {Block}} block - Block that we want to extract contents from.\n * @param {[id: string]: Block} blockMap - Maps block Ids to blocks.\n */\nfunction extractContentsFromBlock(block, blockMap) {\n    let words = '';\n    let isSelected = false;\n    if (!block.Relationships) {\n        // some block might have no content\n        return { text: '', selected: undefined };\n    }\n    for (const relation of block.Relationships) {\n        for (const contentId of relation.Ids ?? []) {\n            const contentBlock = blockMap[contentId];\n            if (contentBlock.BlockType === 'WORD') {\n                words += contentBlock.Text + ' ';\n            }\n            else if (contentBlock.BlockType === 'SELECTION_ELEMENT') {\n                isSelected = contentBlock.SelectionStatus === 'SELECTED';\n            }\n        }\n    }\n    words = words.substr(0, words.length - 1); // remove trailing space.\n    return { text: words, selected: isSelected };\n}\n"],"names":[],"mappings":";;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,IAAI,OAAO,aAAa,CAAC,QAAQ,EAAE,WAAW,CAAC;AA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